MCPcopy Index your code
hub / github.com/codeaashu/claude-code / probeSeedCacheAnyVersion

Function probeSeedCacheAnyVersion

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

Source from the content-addressed store, hash-verified

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