feat: add durable pending memory journal

This commit is contained in:
Ralph Chang
2026-04-27 02:20:26 +08:00
parent 026c75a5e4
commit e7c7a5cfb2
6 changed files with 471 additions and 25 deletions
+4
View File
@@ -20,6 +20,10 @@ export async function workspaceMemoryPath(root: string): Promise<string> {
return join(await memoryRoot(root), "workspace-memory.json");
}
export async function workspacePendingJournalPath(root: string): Promise<string> {
return join(await memoryRoot(root), "workspace-pending-journal.json");
}
export async function sessionStatePath(root: string, sessionID: string): Promise<string> {
const safeSessionID = createHash("sha256").update(sessionID).digest("hex").slice(0, 32);
return join(await memoryRoot(root), "sessions", `${safeSessionID}.json`);