import { createHash, randomUUID } from "node:crypto";
import { resolve } from "node:path";
export function normalizeMemoryPath(path) {
    return resolve(path).replaceAll("\\", "/").toLowerCase();
}
export function createProjectId(cwd) {
    return createHash("sha256").update(normalizeMemoryPath(cwd)).digest("hex").slice(0, 16);
}
export function createMemorySessionIdentity(options) {
    return {
        cwd: options.cwd,
        projectId: createProjectId(options.cwd),
        sessionId: options.sessionId ?? randomUUID(),
        continuitySessionId: options.continuitySessionId,
        model: options.model?.id,
        provider: options.model?.provider,
    };
}
//# sourceMappingURL=memory-identity.js.map