()
| 123 | * This is a temp directory on local disk where plugins are extracted for the session. |
| 124 | */ |
| 125 | export async function getSessionPluginCachePath(): Promise<string> { |
| 126 | if (sessionPluginCachePath) { |
| 127 | return sessionPluginCachePath |
| 128 | } |
| 129 | if (!sessionPluginCachePromise) { |
| 130 | sessionPluginCachePromise = (async () => { |
| 131 | const suffix = randomBytes(8).toString('hex') |
| 132 | const dir = join(tmpdir(), `claude-plugin-session-${suffix}`) |
| 133 | await getFsImplementation().mkdir(dir) |
| 134 | sessionPluginCachePath = dir |
| 135 | logForDebugging(`Created session plugin cache at ${dir}`) |
| 136 | return dir |
| 137 | })() |
| 138 | } |
| 139 | return sessionPluginCachePromise |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Clean up the session plugin cache directory. |
no test coverage detected