/** * Pure finalize-time gate: pick the recovery nudge that must replace a final * answer, or nothing when the turn may finalize. No I/O, no budget mutation. */ import { type RecoveryAction, type RecoveryBudgets } from "./must-continue.js"; /** Task fields the gate reads. */ export interface FinalizeGatePlanTask { id: string; title: string; state: string; responderOwned?: boolean | undefined; } /** Plain-data snapshot of the live plan, resolved once by the caller. */ export interface FinalizeGatePlan { kind: string; hasVerifiedRuntime: boolean; tasks: readonly FinalizeGatePlanTask[]; } /** Everything the finalize cascade reads, as data. */ export interface FinalizeGateInput { cleaned: string; recovery: RecoveryBudgets; toolsAttached: boolean; productiveSteps: number; planApproved: boolean; planHasOpenWork: boolean; activePlanExists: boolean; wantsAction: boolean; narratedAction: boolean; narratedWebAction: boolean; isPlanMode: boolean; buildLikeTurn: boolean; pentestLikeTurn: boolean; buildLike: boolean; pentestLike: boolean; pentestSession: boolean; informationalQuery: boolean; idleOrSocialPrompt: boolean; sawPlanCreateOk: boolean; sawFeatureImplWrite: boolean; sawScaffoldOk: boolean; sawLocalAppMaterialWork: boolean; sawServerStart: boolean; sawServerTail: boolean; sawLocalHttpProbe: boolean; sawFailedLocalHttpProbe: boolean; sawActivePentestTest: boolean; sawSuccessfulMutation: boolean; featureAppAsk: boolean; projectRoot: string | undefined; plan: FinalizeGatePlan | undefined; deferResponderReport: boolean; } export declare function chooseFinalizeRecovery(input: FinalizeGateInput): RecoveryAction | undefined;