MCPcopy
hub / github.com/coder/mux / projectMemoryDirName

Function projectMemoryDirName

src/node/services/memoryService.ts:215–224  ·  view source on GitHub ↗
(projectPath: string)

Source from the content-addressed store, hash-verified

213 * projects in different parent directories.
214 */
215export function projectMemoryDirName(projectPath: string): string {
216 assert(projectPath !== "", "projectMemoryDirName requires a project identity");
217 const hash = createHash("sha256").update(projectPath).digest("hex").slice(0, 12);
218 // getProjectName falls back to "unknown" and sanitization maps (never
219 // drops) disallowed chars, so base is always non-empty.
220 const base = PlatformPaths.getProjectName(projectPath)
221 .replace(/[^A-Za-z0-9._-]/g, "_")
222 .slice(0, 40);
223 return `${base}-${hash}`;
224}
225
226function toVirtualPath(scope: MemoryScope, relPath: string): string {
227 return relPath === ""

Callers 6

createFixtureFunction · 0.90
projectMemoryRootFunction · 0.90
aiService.test.tsFile · 0.90
projectMemoryPathFunction · 0.90
getStoreMethod · 0.85

Calls 3

updateMethod · 0.65
assertFunction · 0.50
getProjectNameMethod · 0.45

Tested by 3

createFixtureFunction · 0.72
projectMemoryRootFunction · 0.72
projectMemoryPathFunction · 0.72