/** * Continue-site helpers for the advance dispatcher. * * Each function corresponds to one continue-site in the dispatch loop. * Adding a new recovery path = adding a new function here + one `if` in advance(). */ import type { SagaState, Stage, AdvanceResult } from './state.js'; export type TerminationReason = 'completed' | 'aborted_by_user' | 'plan_rejected' | 'worker_unrecoverable' | 'source_unavailable' | 'model_capability_exceeded' | 'budget_exceeded' | 'external_check_failed' | 'human_input_required' | 'internal_error'; export interface Termination { reason: TerminationReason; details: string; ts: string; } export declare function terminate(reason: TerminationReason, details: string): Termination; export declare function advanceCursor(state: SagaState, stageId: string): SagaState; export declare function allStagesDone(state: SagaState): boolean; export declare function terminatedResult(t: Termination): AdvanceResult; export declare function applyPlan(state: SagaState, plan: { summary: string; stages: Stage[]; }): SagaState; export declare function bumpRecovery(state: SagaState, stageId: string): SagaState; export declare const MAX_RECOVERY_ATTEMPTS = 4; //# sourceMappingURL=transitions.d.ts.map