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

Function getVersionedCachePathIn

src/utils/plugins/pluginLoader.ts:139–162  ·  view source on GitHub ↗
(
  baseDir: string,
  pluginId: string,
  version: string,
)

Source from the content-addressed store, hash-verified

137 * @returns Absolute path to versioned plugin directory under baseDir
138 */
139export function getVersionedCachePathIn(
140 baseDir: string,
141 pluginId: string,
142 version: string,
143): string {
144 const { name: pluginName, marketplace } = parsePluginIdentifier(pluginId)
145 const sanitizedMarketplace = (marketplace || 'unknown').replace(
146 /[^a-zA-Z0-9\-_]/g,
147 '-',
148 )
149 const sanitizedPlugin = (pluginName || pluginId).replace(
150 /[^a-zA-Z0-9\-_]/g,
151 '-',
152 )
153 // Sanitize version to prevent path traversal attacks
154 const sanitizedVersion = version.replace(/[^a-zA-Z0-9\-_.]/g, '-')
155 return join(
156 baseDir,
157 'cache',
158 sanitizedMarketplace,
159 sanitizedPlugin,
160 sanitizedVersion,
161 )
162}
163
164/**
165 * Get versioned cache path for a plugin under the primary plugins directory.

Callers 3

getVersionedCachePathFunction · 0.85
probeSeedCacheFunction · 0.85
probeSeedCacheAnyVersionFunction · 0.85

Calls 1

parsePluginIdentifierFunction · 0.85

Tested by

no test coverage detected