MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / probeSeedCacheAnyVersion

Function probeSeedCacheAnyVersion

src/utils/plugins/pluginLoader.ts:221–239  ·  view source on GitHub ↗
(
  pluginId: string,
)

Source from the content-addressed store, hash-verified

219 * Seeds are checked in precedence order; first match wins.
220 */
221export async function probeSeedCacheAnyVersion(
222 pluginId: string,
223): Promise<string | null> {
224 for (const seedDir of getPluginSeedDirs()) {
225 // The parent of the version dir — computed the same way as
226 // getVersionedCachePathIn, just without the version component.
227 const pluginDir = dirname(getVersionedCachePathIn(seedDir, pluginId, '_'))
228 try {
229 const versions = await readdir(pluginDir)
230 if (versions.length !== 1) continue
231 const versionDir = join(pluginDir, versions[0]!)
232 const entries = await readdir(versionDir)
233 if (entries.length > 0) return versionDir
234 } catch {
235 // Try next seed
236 }
237 }
238 return null
239}
240
241/**
242 * Get legacy (non-versioned) cache path for a plugin.

Callers 1

Calls 3

getPluginSeedDirsFunction · 0.85
getVersionedCachePathInFunction · 0.85
readdirFunction · 0.85

Tested by

no test coverage detected