/**
 * Shared graceful-exit logic for Ctrl+C / SIGINT handling.
 *
 * Used by both CtrlCHandler (Ink useInput path) and the process SIGINT
 * handler in bin.ts. Extracting it here keeps the two paths in sync and
 * avoids the Temporal Dead Zone issue that arose when the SIGINT handler
 * referenced a `saveCheckpoint` binding before its dynamic import resolved.
 */
import type { WizardSession } from './wizard-session';
export interface GracefulExitContext {
    session: WizardSession;
    setCommandFeedback: (message: string, ms: number) => void;
}
/** Test-only — reset the re-entry guard between assertions. */
export declare function _resetGracefulExitForTests(): void;
/** Test-only — observe the guard from a test. */
export declare function _isGracefulExitInProgressForTests(): boolean;
/**
 * Execute the graceful-exit sequence:
 * 1. Show "Saving session…" banner
 * 2. Abort the wizard-wide AbortController so in-flight async work
 *    (agent SDK query, MCP fetches, ingestion polls) starts unwinding
 *    during the grace window instead of being SIGKILL'd
 * 3. Save session checkpoint (best-effort)
 * 4. Fire-and-forget analytics flush
 * 5. Exit after a fixed 2s grace window
 *
 * Idempotent: a second concurrent call (e.g. SIGINT firing after Ink's
 * Ctrl+C path already started) is a no-op.
 */
export declare function performGracefulExit(ctx: GracefulExitContext): void;
