import type { InspectedRunExecution, RunExecutionOwner, RunStore } from "./types.ts"; /** What marks a file in the artifacts directory as a run's event log rather than one of its step sessions. */ export declare const RUN_LOG_SUFFIX = ".events.jsonl"; export declare const RUN_LEASE_SUFFIX = ".execution.json"; /** Raised when atomic lease acquisition proves this exact run id already has an executor. */ export declare class RunExecutionAlreadyOwnedError extends Error { readonly execution: InspectedRunExecution; constructor(execution: InspectedRunExecution); } export interface FsStoreOptions { /** Omit for read-only callers such as completion; execution methods are then unavailable. */ readonly executionOwner?: RunExecutionOwner; readonly now?: () => Date; readonly generateExecutionId?: () => string; readonly isProcessAlive?: (owner: RunExecutionOwner) => boolean | Promise; } /** * Filesystem `RunStore` (spec §8.9): one append-only JSONL history per run, plus a temporary atomic * execution lease while work is live. Runs remain independently keyed and listable/resumable across * sessions and process restarts. * * `dir` is the already-resolved run-artifacts directory (project-dir.ts's `runArtifactsDir`), not a * project root: WHERE a run's artifacts belong is one decision, made once, by whoever holds the * harness context — this file only owns the format. * * That directory also holds every step SESSION file this run spawns (spec §2.2), which is why the log * carries the `.events.jsonl` suffix and why `list()` filters on it: a bare `.jsonl` scan would try to * read each step session as a run log. In the other direction nothing needs doing — the log is not a * session file and the harness's own reader returns `null` for anything whose first line is not * `{"type":"session"}`, with every enumerator dropping nulls. Workflow provenance and observable * ownership remain in the log (`run-meta` and `run-execution-started`); the `.execution.json` sidecar * is coordination state only and exists no longer than the active execution. */ export declare function createFsStore(dir: string, options?: FsStoreOptions): RunStore; //# sourceMappingURL=fs-store.d.ts.map