export type HumanWorkKind = 'follow_up' | 'visual'; export type FollowUpWorkStatus = 'armed' | 'pending' | 'acked' | 'errored' | 'canceled'; export type VisualWorkStatus = 'visual_armed' | 'visual_pending' | 'visual_retired'; export type HumanWorkStatus = FollowUpWorkStatus | VisualWorkStatus; export interface HumanWorkRow { node_id: string; dir: string; root: string; request_id: string; work_kind: HumanWorkKind; status: HumanWorkStatus; final_report: string | null; interaction_id: string | null; generation_id: string | null; interaction_snapshot: string | null; handler_command: string | null; handler_args_json: string | null; claim_token: string | null; updated_at: string; } export interface VisualWorkBinding { nodeId: string; dir: string; root: string; requestId: string; interactionId: string; generationId: string; interactionSnapshot: string; handlerCommand: string; handlerArgs: readonly string[]; claimToken: string; } export interface VisualWorkClaim { row: HumanWorkRow; created: boolean; } /** Insert a follow-up receipt before its fork launches. `work_kind` is explicit * even though the migration default preserves old inserts, so new code never * depends on a compatibility default. */ export declare function armFollowUpWork(opts: { nodeId: string; dir: string; root: string; requestId: string; }): void; /** Promote only follow-up work inside the canonical-final transaction. */ export declare function promoteFollowUpWork(nodeId: string, finalReportBasename: string): boolean; export declare function ackFollowUpWork(nodeId: string): void; export declare function errorFollowUpWork(nodeId: string): void; export declare function cancelFollowUpWork(nodeId: string): void; /** Create or return the one immutable Visual claim for a request. A conflicting * duplicate fails closed; a byte-identical duplicate reuses its original row. */ export declare function claimVisualWork(binding: VisualWorkBinding): VisualWorkClaim; /** The future Visual finalizer may promote only its exact armed claim. */ export declare function promoteVisualWork(nodeId: string, finalReportBasename: string): boolean; /** Retire only an exact Visual request binding; cancellation never creates work. */ export declare function retireVisualWork(dir: string, requestId: string): boolean; export declare function getHumanWorkRow(nodeId: string): HumanWorkRow | null; export declare function getFollowUpWorkRow(nodeId: string): HumanWorkRow | null; export declare function listActiveVisualWorkByDir(dir: string): HumanWorkRow[]; export declare function getVisualWorkByRequest(dir: string, requestId: string): HumanWorkRow | null; export declare function listPendingFollowUpWork(): HumanWorkRow[]; export declare function listArmedFollowUpWork(): HumanWorkRow[]; export declare function getActiveFollowUpWorkByRequest(dir: string, requestId: string): HumanWorkRow | null; export declare function listActiveFollowUpWorkByDir(dir: string): HumanWorkRow[]; /** Deliver one pending follow-up receipt. */ export declare function dispatchFollowUpWork(nodeId: string): void; /** Dispatch a checked canonical final as the single correlated Visual result. */ export declare function dispatchVisualWork(nodeId: string): void; /** Reconcile this durable lane after a dead private child or interrupted dispatch. */ export declare function reconcileVisualWork(): void; /** Reconcile only follow-up work. */ export declare function reconcileFollowUpWork(): void;