import { TaskDocument } from "../../models/task.cjs"; import { TaskFailureReporter } from "../../types/telemetry.cjs"; //#region src/services/taskStore/index.d.ts export type TaskStoreCommitListener = (previous: TaskDocument, committed: TaskDocument) => void; export interface TaskStoreOptions { cwd?: string; env?: Readonly>; storePath?: string; onCommitted?: TaskStoreCommitListener; /** How long to wait for the advisory lock before proceeding lock-free. */ lockTimeoutMs?: number; /** Where swallowed failures go, so silent degradation stays visible. */ report?: TaskFailureReporter; } /** * File-backed task store shared by one root session and its delegated children. * * Durability model: the JSON file is the source of truth. Mutations are * read-modify-write under an advisory lock so concurrent delegated processes * cannot clobber each other, and writes land via temp-file rename so a * crash mid-write can never leave a partial document behind. */ export declare class TaskStore { storePath: string; private readonly cwd; private readonly env; private cached; private readonly listeners; private readonly lockTimeoutMs; private readonly report?; private readonly onCommitted?; constructor(options?: TaskStoreOptions); /** Bind a default store to the current session tree before reading it. */ configureSession(sessionKey: string): void; /** Last document read from disk, without hitting the filesystem. */ get snapshot(): TaskDocument; read(): TaskDocument; readAsync(shouldApply?: () => boolean): Promise; private readDocumentAsync; /** * Apply a mutation under the store lock. * * `mutate` receives the freshest on-disk document and returns either the next * document to commit or `undefined` for a read-only action (list/get), which * skips the write entirely so queries never bump `rev`. */ mutate(mutate: (document: TaskDocument) => { document?: TaskDocument; value: T; }): Promise<{ document: TaskDocument; value: T; }>; private notifyCommitted; private write; private acquireLock; /** Remove a lock left behind by a dead process or one held implausibly long. */ private breakStaleLock; /** * Listen for commits made through this store instance. * * Live cross-process updates use the owning session's direct event bus. This * listener remains for local terminal views and never watches the filesystem. */ onExternalChange(listener: (document: TaskDocument) => void): () => void; dispose(): void; } //#endregion //# sourceMappingURL=index.d.cts.map