import type { SubmitRecheckResult } from '../adapters/cli/types.js'; export type SubmitActivityEvidence = 'pty-output' | 'structured-transcript' | 'botmux-send'; export type SubmitConfirmationAction = { kind: 'notify-hard-failure'; reason: string; } | { kind: 'suppress-confirmed'; } | { kind: 'suppress-usage-limit'; } | { kind: 'suppress-active'; evidence: SubmitActivityEvidence; } | { kind: 'notify-stuck'; }; export interface SubmitConfirmationDecisionInput { failureReason?: string; recheckSubmitted: boolean; usageLimitDetected: boolean; activityEvidence?: SubmitActivityEvidence; } export declare function decideSubmitConfirmationAction(input: SubmitConfirmationDecisionInput): SubmitConfirmationAction; export interface StructuredSubmitLifecycleController { hasPendingTurn(turnId: string, dispatchAttempt?: number): boolean; confirmPendingTurn(turnId: string, confirmedAtMs?: number, dispatchAttempt?: number): boolean; finishSubmitVerification(turnId: string, finishedAtMs?: number, dispatchAttempt?: number): boolean; } export interface DeferredSubmitConfirmationInput { turnId?: string; dispatchAttempt?: number; /** True only when turnId names a CodexBridgeQueue mark. Claude fallback * turns use BridgeTurnQueue IDs, so treating every bridge ID as a * structured target would incorrectly discard every Claude recheck. */ structuredTarget?: boolean; recheck?: () => SubmitRecheckResult | Promise; usageLimitDetected: () => boolean; activityEvidence: () => SubmitActivityEvidence | undefined; /** Generation/backend fence owned by the worker. It is checked both before * invoking the old recheck closure and after its await resolves. */ isCurrent?: () => boolean; } export interface CurrentDeferredSubmitConfirmationSettlement { stale: false; action: SubmitConfirmationAction; cliSessionId?: string; recheckError?: unknown; lifecycle: 'confirmed' | 'verification-finished' | 'unchanged'; } export interface StaleDeferredSubmitConfirmationSettlement { stale: true; staleReason: 'generation' | 'attempt'; lifecycle: 'unchanged'; } export type DeferredSubmitConfirmationSettlement = CurrentDeferredSubmitConfirmationSettlement | StaleDeferredSubmitConfirmationSettlement; export type StaleWriteContinuationDisposition = 'ambiguous-terminal' | 'ordinary-carryover'; /** Settle an await continuation whose CLI generation is no longer current. * Ordinary inputs are already owned by InflightInputTracker's crash carryover: * touching the process-global bridge queues or warning the user here could * delete the replacement generation's same-ID mark or invite a duplicate * manual retry. Durable inputs are not auto-replayed and therefore need their * exact attempt terminal reconciled by the receiver. */ export declare function settleStaleWriteContinuation(identity: { turnId?: string; dispatchAttempt?: number; }, errorCode: string, emitAmbiguous: (turnId: string, errorCode: string, dispatchAttempt: number) => void): StaleWriteContinuationDisposition; /** Execute the deferred submit-recheck callback and settle the structured * pre-start lifecycle atomically with its decision. Both an actual history * recheck hit and weaker "CLI is active" evidence become a bounded confirmed * lease. The latter must not merely clear verification: that would leave a * bare, unstarted fingerprint which no expiry pruning can ever remove. */ export declare function settleDeferredSubmitConfirmation(controller: StructuredSubmitLifecycleController, input: DeferredSubmitConfirmationInput): Promise; //# sourceMappingURL=submit-confirmation.d.ts.map