import { type WorkflowLifecycleStateToken } from "../io/workflow-lifecycle-state.js"; import type { ProjectReadSnapshot } from "../io/project-read-snapshot.js"; export type WorkflowLoopIterationRecord = { readonly blockerId: string; readonly blockerIndex: number; readonly blockerTotal: number; readonly exitStatus: number; readonly iteration: number; readonly promptPath: string; readonly stderrPath: string; readonly stdoutPath: string; readonly timedOut: boolean; }; export type WorkflowLoopFinalDecision = "child-failure" | "finish-passed" | "iteration-cap" | "no-blockers" | "not-run" | "output-limit" | "signal" | "spawn-failure" | "state-conflict" | "timeout" | "unmapped-blocker"; export declare const WORKFLOW_LOOP_STATE_SCHEMA_VERSION = "workflow-loop-state.2"; export type WorkflowLoopState = { readonly completedAt?: string; readonly finalDecision: WorkflowLoopFinalDecision; readonly iterations: readonly WorkflowLoopIterationRecord[]; readonly rulePackHash: string; readonly schemaVersion: typeof WORKFLOW_LOOP_STATE_SCHEMA_VERSION; readonly startedAt: string; }; export type WorkflowLoopStateSnapshot = { readonly integrity: "absent" | "malformed" | "unsafe" | "valid"; readonly state: WorkflowLoopState | null; readonly token: WorkflowLifecycleStateToken; }; export declare function workflowLoopDir(projectDir: string): string; export declare function workflowLoopStatePath(projectDir: string): string; export declare function readWorkflowLoopStateSnapshot(projectDir: string, snapshot?: ProjectReadSnapshot): WorkflowLoopStateSnapshot; export declare function readWorkflowLoopState(projectDir: string): WorkflowLoopState | null; export declare function writeWorkflowLoopState(projectDir: string, state: WorkflowLoopState, expectedToken?: WorkflowLifecycleStateToken): WorkflowLifecycleStateToken;