import { createHash } from "node:crypto"; import * as fs from "node:fs"; import * as path from "node:path"; function canonicalProjectPath(cwd: string): string { const resolvedCwd = path.resolve(cwd); try { return fs.realpathSync.native(resolvedCwd); } catch { return resolvedCwd; } } export function projectStorageKey(cwd: string): string { return `project-${createHash("sha256").update(canonicalProjectPath(cwd)).digest("hex")}`; }