#!/usr/bin/env node interface TerminalRecoveryOptions { sendToCodex(line: string): void; emitToClient(line: string): void; log(line: string): void; quietMs?: number; } /** * Reconcile Codex's missing terminal notification without guessing from a * wall-clock timeout. A candidate needs the exact turn's authoritative final * assistant item, no live items or server requests, and a quiet period. The * proxy then asks app-server for the current thread snapshot. Only a terminal * stored turn, or an idle thread containing that exact turn, may synthesize the * missing notification. * * This lives in the authenticated bundled-Codex proxy, not the generic ACP * session: only here are App Server thread/turn IDs and item lifecycles visible. */ export declare class CodexTerminalRecovery { private readonly options; private readonly turns; private readonly pendingTurnStarts; private readonly serverRequests; private readonly reconcileRequests; private readonly inferredTurns; private reconcileSequence; constructor(options: TerminalRecoveryOptions); observeClientLine(line: string): void; /** Return false when an internal response or late duplicate was consumed. */ observeServerLine(line: string): boolean; close(): void; private parse; private ensureTurn; private candidate; private cancelReconciliation; private scheduleReconciliation; private reconcile; private handleReconcileResponse; private finishTurn; } /** Transform one app-server NDJSON request; malformed input passes through. */ export declare function rewriteCodexAppServerRequest(line: string, approval: string, expectedSandbox: string, disableInheritedMcp?: boolean): string; export declare function runCodexAppServerProxy(): void; export {};