import type { RunEvent } from "../engine/types.ts"; import type { RunStore, RunSummary } from "./types.ts"; export interface ReconciledRun { readonly runId: string; readonly executionId?: string; } type IsRunActive = (runId: string) => boolean; interface ProjectableRunStore extends Pick { readonly executions?: RunStore["executions"]; readonly loadEvents?: RunStore["loadEvents"]; } /** * Build the read-only view of one run's history. * * A provably dead/missing local executor is projected as `crashed`, but the synthetic terminal is not * appended. `/workflow run list` and `/workflow status` can therefore stop displaying ghost * `in_progress` runs without making observation a state-changing operation. */ export declare function projectRunEvents(store: Pick, runId: string, options?: { readonly isActive?: IsRunActive; readonly now?: () => Date; }): Promise; /** Read-only summaries with the same abandoned-run projection used by `/workflow status`. */ export declare function projectRunSummaries(store: ProjectableRunStore, options?: { readonly isActive?: IsRunActive; readonly now?: () => Date; }): Promise; /** * Durably reconcile one run immediately before a lifecycle mutation acts on it. * * Only a locally provable dead owner is reclaimed. A live PID and every foreign-host lease remain * authoritative; cross-host liveness is intentionally outside this package's contract. A legacy * `in_progress` log with no lease is also abandoned when this store supports execution inspection. */ export declare function reconcileAbandonedRun(store: RunStore, runId: string, isActive?: IsRunActive): Promise; export declare function latestExecutionId(events: readonly RunEvent[]): string | undefined; export {}; //# sourceMappingURL=reconcile-runs.d.ts.map