MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / resolvePluginPath

Function resolvePluginPath

source code/utils/plugins/pluginLoader.ts:268–289  ·  view source on GitHub ↗
(
  pluginId: string,
  version?: string,
)

Source from the content-addressed store, hash-verified

266 * @returns Absolute path to plugin directory
267 */
268export async function resolvePluginPath(
269 pluginId: string,
270 version?: string,
271): Promise<string> {
272 // Try versioned path first
273 if (version) {
274 const versionedPath = getVersionedCachePath(pluginId, version)
275 if (await pathExists(versionedPath)) {
276 return versionedPath
277 }
278 }
279
280 // Fall back to legacy path for existing installations
281 const pluginName = parsePluginIdentifier(pluginId).name || pluginId
282 const legacyPath = getLegacyCachePath(pluginName)
283 if (await pathExists(legacyPath)) {
284 return legacyPath
285 }
286
287 // Return versioned path for new installations
288 return version ? getVersionedCachePath(pluginId, version) : legacyPath
289}
290
291/**
292 * Recursively copy a directory.

Callers

nothing calls this directly

Calls 4

getVersionedCachePathFunction · 0.85
pathExistsFunction · 0.85
parsePluginIdentifierFunction · 0.85
getLegacyCachePathFunction · 0.85

Tested by

no test coverage detected