/** * Process-matrix on-disk store: one file per process (`state/process-matrix/.json`), * durable across restarts and crashes (see `agent-paths.ts` -- this is machine state, not * transient `work/`). * * Each entry is owned by the process it describes: a master writes and heartbeats its OWN entry, * a worker self-registers and heartbeats its OWN entry (see `runtime.ts`'s module doc for the one * sanctioned, ask-gated exception during orphan adoption/cleanup). A missing or corrupt entry file * reads as absent -- never an error -- matching `worktree-sync/store.ts`'s store doctrine. */ import type { ProcessMatrixEntry, ProcessRole } from "./codes.ts"; export declare function processMatrixDir(agentDir: string): string; export declare function entryPath(agentDir: string, entryId: string): string; /** Stable entry identity: one entry per (role, sessionId) pair. */ export declare function buildEntryId(role: ProcessRole, sessionId: string): string; export declare function readEntry(agentDir: string, entryId: string): Promise; export declare function listEntries(agentDir: string): Promise; export declare function writeEntry(agentDir: string, entry: ProcessMatrixEntry): Promise; /** Atomically replace one entry only when its full persisted value still equals `expected`. */ export declare function writeEntryIfUnchanged(agentDir: string, entryId: string, expected: ProcessMatrixEntry | undefined, next: ProcessMatrixEntry): Promise; /** Sync conditional replacement for best-effort `process.on("exit")` terminal writes. */ export declare function writeEntryIfUnchangedSync(agentDir: string, expected: ProcessMatrixEntry, next: ProcessMatrixEntry): boolean; export declare function removeEntry(agentDir: string, entryId: string): Promise; export declare function removeEntryIfUnchanged(agentDir: string, expected: ProcessMatrixEntry): Promise; //# sourceMappingURL=store.d.ts.map