/**
 * Interactive mode for the coding agent.
 * Handles TUI rendering and user interaction, delegating business logic to AgentSession.
 */
import type { AgentMessage, ThinkingLevel } from "@earendil-works/pi-agent-core";
import type { ImageContent, Model } from "@earendil-works/pi-ai/compat";
import type { EditorComponent, EditorSubmitDetails } from "@earendil-works/pi-tui";
import { type Terminal } from "@earendil-works/pi-tui";
import { type AgentSessionEvent } from "../../core/agent-session.ts";
import { type AgentSessionRuntime } from "../../core/agent-session-runtime.ts";
import { isApiKeyLoginProvider } from "../../core/auth-providers.ts";
import { type NoticeSpec } from "../../core/extensions/notice/index.ts";
import { SessionManager } from "../../core/session-manager.ts";
import type { FullscreenExitOutput, QuietStartup, TuiMode } from "../../core/settings-manager.ts";
import { type InteractiveChrome } from "./grok/chrome.ts";
import { type SubmissionTicket } from "./session-control-host.ts";
import type { PresenterAccountAuthority } from "../rpc/mcp-presenter-account.ts";
export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.ts";
/**
 * Run a submission parked during startup once the real submit path is installed (senpi#5731). The person
 * already pressed Enter, so the parked text is submitted unless they edited it since. A free function, like
 * `adoptDefaultEditorActions`, so `init()` gains no new `this` dependency.
 */
export declare function replayStartupSubmission(parked: {
    readonly text: string;
    readonly details?: EditorSubmitDetails;
} | undefined, editor: Pick<EditorComponent, "getText" | "setText">, defaultEditor: {
    onSubmit?: (text: string, details?: EditorSubmitDetails) => void | Promise<void>;
} | undefined): void;
export declare function shouldShowRetryIndicator(delayMs: number, fallbackApplied: boolean): boolean;
export declare function formatCrashExtensionHint(extensionMatches: readonly string[] | undefined): string | undefined;
export declare function formatResumeCommand(sessionManager: SessionManager): string | undefined;
export { isApiKeyLoginProvider };
/** Startup header (logo, version, key hints): hidden only by quietStartup: true, unless verbose. */
export declare function showsStartupHeader(verbose: boolean | undefined, quietStartup: QuietStartup): boolean;
/** Startup details (model scope, loaded resources): hidden by quietStartup: true or "header", unless verbose. */
export declare function showsStartupDetails(verbose: boolean | undefined, quietStartup: QuietStartup): boolean;
type OptimisticUserEchoRenderHandle = {
    replace(message: AgentMessage): void;
    remove(): void;
};
/** Coordinates render-only user echoes with AgentSession's canonical input lifecycle. */
export declare class OptimisticUserEchoController {
    private nextId;
    private readonly pending;
    private readonly render;
    constructor(render: (text: string) => OptimisticUserEchoRenderHandle);
    begin(text: string): string;
    /** `undefined` means nothing was painted for this submission; every callback then resolves to a no-op. */
    promptOptions(id: string | undefined): {
        preflightResult: (success: boolean) => void;
        promptDisposition: (disposition: "handled" | "queued" | "started") => void;
    };
    reject(id: string | undefined): void;
    remove(id: string | undefined): void;
    replaceNext(message: AgentMessage): boolean;
}
/** A user submission: editor text plus the images resolved from its `[Image #N]` markers. */
interface InteractiveUserInput {
    text: string;
    images?: ImageContent[];
    /** `undefined` for a submission that paints no echo, such as the manual-continue shortcut. */
    pendingEchoId: string | undefined;
    /** Typed after leading whitespace: send `/...` text to the model even when no command handles it. */
    unknownCommandAsText?: boolean;
    ticket?: SubmissionTicket;
}
/**
 * Options for InteractiveMode initialization.
 */
export interface InteractiveModeOptions {
    /** Opt in to host-issued MCP form authority; ordinary terminal forms remain the default. */
    mcpPresenterEnforcement?: boolean;
    /** Lets same-account devices enroll as form presenters on this terminal; injected by the distribution (D11 S3-6b). */
    presenterAccountAuthority?: PresenterAccountAuthority;
    /** Renderer mode for the interactive terminal. */
    uiMode?: TuiMode;
    /** Providers that were migrated to auth.json (shows warning) */
    migratedProviders?: string[];
    /** Config edits made in ~/.pi/agent after its copy, which this agent dir never reads (shows warning) */
    legacyPiEditNotice?: string;
    /** Runtime diagnostics collected during session creation. */
    startupDiagnostics?: Array<{
        type: "info" | "warning" | "error";
        message: string;
    }>;
    /** Credential notices to show once at startup; `markSeen` runs after they are shown (senpi#3486). */
    authNotices?: {
        readonly messages: readonly string[];
        readonly markSeen: () => void;
    };
    /** Warning message if session model couldn't be restored */
    modelFallbackMessage?: string;
    /** Cwd to trust after reload if it gained a .pi directory during this implicitly trusted session. */
    autoTrustOnReloadCwd?: string;
    /** Initial message to send on startup (can include @file content) */
    initialMessage?: string;
    /** Images to attach to the initial message */
    initialImages?: ImageContent[];
    initialTitlePrompt?: string;
    /** Additional messages to send after the initial message */
    initialMessages?: string[];
    /** Force verbose startup (overrides quietStartup setting) */
    verbose?: boolean;
    /** Select an experimental interactive chrome. */
    chrome?: InteractiveChrome | "grok";
    /** TUI layout mode. */
    tuiMode?: TuiMode;
    /** Initial interactive theme setting for this invocation. */
    initialThemeSetting?: string;
    /** Terminal implementation. Defaults to the current process terminal. */
    terminal?: Terminal;
}
export declare class InteractiveMode {
    private static confirmsRefusedUnknownCommand;
    private static restoreCompactionEscapeOverride;
    private runtimeHost;
    private options;
    private chrome;
    private renderer;
    private ui;
    private mainScreenRenderState;
    private loadedResourcesContainer;
    private chatContainer;
    private documentContainer;
    private transcriptScrollView;
    private fullscreenLayoutRoot;
    private pendingMessagesContainer;
    private statusContainer;
    private readonly sessionShownTipIds;
    private shortcutOverlay;
    private lastEditorText;
    private startupProviderGuidanceShown;
    private lastInputWasPaste;
    private sessionLogger;
    private readonly continuityNotices;
    private readonly turnWorkingTip;
    private hookStatusContainer;
    private defaultEditor;
    private editor;
    private editorComponentFactory;
    private autocompleteProvider;
    private autocompleteProviderWrappers;
    private fdPath;
    private editorContainer;
    private footer;
    private activeSelectorToken?;
    private activeSelectorDispose?;
    private footerContainer;
    private footerDataProvider;
    private keybindings;
    private version;
    private isInitialized;
    private onInputCallback?;
    private pendingUserInputs;
    private agentIdle;
    private transcriptWriteNoticeShown;
    private readonly optimisticUserEchoes;
    /**
     * Clipboard images pasted into the composer, keyed by their visible
     * `[Image #N]` marker number. The editor stores marker ids only, so these
     * bytes must live here (and survive an editor swap, which discards the
     * editor instance). Kept aligned with the displayed numbers by
     * {@link reconcilePendingImages}.
     */
    private pendingImages;
    /** Lets an extension expose this session on a control endpoint; the endpoint module loads on first use. */
    private readonly sessionControlHost;
    /**
     * Images pre-resolved by handleFollowUp's non-streaming branch, which hands
     * off through the public string-only `onSubmit(text)` API. Set BEFORE that
     * path's `setText("")` (whose prune chain destroys pendingImages) and
     * captured-then-cleared UNCONDITIONALLY at the submit-handler entry: slash,
     * extension and bash submissions return before the consuming branch, and a
     * field cleared only after use would leak a stale image into a later
     * ordinary submission that never references it.
     */
    private preResolvedSubmissionImages?;
    private startupParkedSubmission;
    private activeStatusIndicator;
    private activeWorkingIndicatorEmbedded;
    private readonly idleStatus;
    private workingMessage;
    private workingVisible;
    private workingIndicatorOptions;
    private workingStartedAt;
    private readonly defaultWorkingMessage;
    private readonly defaultHiddenThinkingLabel;
    private hiddenThinkingLabel;
    private activeToolExecutions;
    private activeToolExecutionTerminalTitle;
    private workingMessageBeforeActiveTool;
    private activeToolHooks;
    private hookStatusIntervalId;
    private activeToolTerminalTitle;
    private extensionTerminalTitle;
    /** The OSC 7501 report last written while a status is active; undefined once cleared. */
    private programStatusSequence;
    private programStatusClosed;
    private lastSigintTime;
    private lastEscapeTime;
    /** The last refused unknown-command text; submitting it again unchanged sends it as a message. */
    private refusedUnknownCommandText;
    private changelogMarkdown;
    private startupNoticesShown;
    private anthropicSubscriptionWarningShown;
    private copilotToolLimitNoticeSessionId;
    private lastStatusSpacer;
    private lastStatusText;
    private lastStatusMessage;
    private managedToolStatusStarted;
    private streamingComponent;
    private readonly assistantTextSegments;
    private readonly entriesRenderedByBoundaryCompaction;
    private streamingMessage;
    private readonly streamingReveal;
    private readonly toolArgsReveal;
    private readonly toolResultReveal;
    private pendingTools;
    private requestStreamingRender;
    private applySmoothStreamingRenderFps;
    private toolOutputExpanded;
    private hideThinkingBlock;
    private outputPad;
    private readonly mermaidMarkdownTransformer;
    private readonly messagePathLinkTransformer;
    private skillCommands;
    private unsubscribe?;
    private agentSubscriptionGeneration;
    private readonly lifecycleStatus;
    private signalCleanupHandlers;
    private isBashMode;
    private bashComponent;
    private pendingBashComponents;
    private autoCompactionEscapeHandler?;
    private compactionEscapeOverrideActive;
    /**
     * One-time notice guard for the external-owner compaction delegation episode
     * (e.g. the Claude Agent SDK owning compaction). Armed while true; re-armed by
     * a successful compaction, a model switch, or a session rebind.
     */
    private externalOwnerCompactionNoticeShown;
    private autoCompactionProgressText;
    private retryEscapeHandler?;
    private providerErrors;
    private fallbackAppliedBeforeRetryStart;
    private pendingZeroDelayRetryIndicator;
    private compactionQueuedMessages;
    private compactionInFlightMessages;
    private compactionTransferAbortControllers;
    private compactionQueueFlushTail;
    private compactionQueueGeneration;
    private shutdownRequested;
    private extensionSelector;
    private extensionInput;
    private secretInputCleanup;
    private extensionEditor;
    private askUserQuestion;
    private pendingQuestions;
    private pendingOrder;
    private shownQuestionId;
    private questionSurface;
    private composerDestination;
    private blockingQuestionHeader;
    private wantsMouseLease;
    private releaseMouseLease?;
    private releaseAlwaysMouseLease?;
    private questionMousePaused;
    private get shownQuestion();
    private extensionTerminalInputSubscriptions;
    private extensionWidgetsAbove;
    private extensionWidgetsBelow;
    private widgetContainerAbove;
    private widgetContainerBelow;
    private customFooter;
    private headerContainer;
    private builtInHeader;
    private customHeader;
    private readonly onRightClickPaste;
    private autoTrustOnReloadCwd;
    private themeController;
    private get session();
    private get sessionManager();
    private get settingsManager();
    constructor(runtimeHost: AgentSessionRuntime, options?: InteractiveModeOptions);
    private getAutocompleteSourceTag;
    private prefixAutocompleteDescription;
    private getBuiltInCommandConflictDiagnostics;
    private createBaseAutocompleteProvider;
    private setupAutocompleteProvider;
    private showStartupNoticesIfNeeded;
    private get terminalMouseMode();
    private syncQuestionMouseCapture;
    private pauseQuestionMouseCapture;
    private resumeQuestionMouseCapture;
    private mountInteractiveTui;
    private stopInteractiveTui;
    private switchTuiMode;
    init(): Promise<void>;
    /**
     * Update terminal title with session name and cwd.
     */
    private getNormalTerminalTitle;
    private applyTerminalTitle;
    private updateTerminalTitle;
    private setProgramStatus;
    /**
     * Run the interactive mode. This is the main entry point.
     * Initializes the UI, shows warnings, processes initial messages, and starts the interactive loop.
     */
    run(): Promise<void>;
    private checkForPackageUpdates;
    private checkTmuxSetup;
    private checkTmuxKeyboardSetup;
    /**
     * Get changelog entries to display on startup.
     * Only shows new entries since last seen version, skips for resumed sessions.
     */
    private getChangelogForDisplay;
    private reportInstallTelemetry;
    private getMarkdownThemeWithSettings;
    private getBuiltinExtensionDisplayName;
    private getBuiltinExtensionNameFromPath;
    private formatDisplayPath;
    private formatExtensionDisplayPath;
    private formatContextPath;
    private getStartupExpansionState;
    private handleKeybindingsCommand;
    private updateShortcutOverlay;
    private hideShortcutOverlay;
    private recordShownTip;
    /**
     * Get a short path relative to the package root for display.
     */
    private getShortPath;
    private getCompactPathLabel;
    private getCompactPackageSourceLabel;
    private getCompactExtensionLabel;
    private getCompactDisplayPathSegments;
    private getCompactNonPackageExtensionLabel;
    private getCompactExtensionLabels;
    private getDisplaySourceInfo;
    private isPackageSource;
    private buildScopeGroups;
    private formatScopeGroups;
    private findSourceInfoForPath;
    private formatPathWithSource;
    private formatDiagnostics;
    private showLoadedResources;
    /**
     * Initialize the extension system with TUI-based UI context.
     */
    private unsubscribeSecurityNotices?;
    private detachMcpGrantPresentation?;
    /** A presentation is optional until extension UI is created; shutdown may precede it. */
    private mcpMrtrPresentationLifetime?;
    private mcpLocalPresenter?;
    private bindCurrentSessionExtensions;
    private applyFullscreenScrollbarSetting;
    private applyRuntimeSettings;
    private rebindCurrentSession;
    private handleFatalRuntimeError;
    private getCrashExtensionHint;
    private renderCurrentSessionState;
    /**
     * Extension-registered definition, falling back to the built-in one. The renderer components take
     * whatever this returns, so they never reach into the tool registry themselves.
     */
    private getRegisteredToolDefinition;
    private getMarkdownTransformers;
    /**
     * Set up keyboard shortcuts registered by extensions.
     */
    private setupExtensionShortcuts;
    private withBlockedHostDialog;
    /**
     * Set extension status text in the footer.
     */
    private setExtensionStatus;
    private startToolHookStatusTimer;
    private stopToolHookStatusTimer;
    private refreshToolHookStatuses;
    private handleToolHookStatusEvent;
    private handleToolExecutionStart;
    private handleToolExecutionEnd;
    private stopChatToolAnimations;
    private clearPendingTools;
    private clearActiveToolExecutionStatus;
    private clearToolHookStatuses;
    private getWorkingElapsedSeconds;
    private getWorkingLoaderMessage;
    private refreshWorkingLoaderMessage;
    private getWorkingIndicatorOptions;
    private showStatusIndicator;
    private resolveTurnWorkingTip;
    private updateWorkingIndicatorMessage;
    private clearStatusIndicator;
    private showWorkingStatusIndicator;
    private setWorkingVisible;
    private setWorkingIndicator;
    private setHiddenThinkingLabel;
    /**
     * Set an extension widget (string array or custom component).
     */
    private setExtensionWidget;
    private clearExtensionWidgets;
    private resetExtensionUI;
    private static readonly MAX_WIDGET_LINES;
    /**
     * Render all extension widgets to the widget container.
     */
    private renderWidgets;
    private renderWidgetContainer;
    /**
     * Set a custom footer component, or restore the built-in footer.
     */
    private setExtensionFooter;
    /**
     * Set a custom header component, or restore the built-in header.
     */
    private setExtensionHeader;
    private addExtensionTerminalInputListener;
    private rebindExtensionTerminalInputListeners;
    private clearExtensionTerminalInputListeners;
    /**
     * Create the ExtensionUIContext for extensions.
     */
    private createProjectTrustContext;
    private createExtensionUIContext;
    /**
     * Show a selector for extensions.
     */
    private showExtensionSelector;
    /**
     * Hide the extension selector.
     */
    private hideExtensionSelector;
    /**
     * Show a confirmation dialog for extensions.
     */
    private showExtensionConfirm;
    private promptForMissingSessionCwd;
    /**
     * Show a text input for extensions.
     */
    private showExtensionInput;
    /**
     * Hide the extension input.
     */
    private hideExtensionInput;
    /**
     * Show a multi-line editor for extensions (with Ctrl+G support).
     */
    private showExtensionEditor;
    /**
     * Hide the extension editor.
     */
    private hideExtensionEditor;
    /**
     * Show the ask-user multi-question overlay in place of the editor.
     */
    private showQuestionOverlay;
    /**
     * Hide the ask-user question overlay and restore the editor.
     */
    private hideQuestionOverlay;
    /** Queue an async request without replacing another request or taking editor focus. */
    private showAsyncQuestion;
    private sessionControlContext;
    /** Whether the user is composing (non-blank text or pending images); a delivery never waits for it (senpi#7043). */
    private hasComposerDraft;
    /** Only the visible surface ticks; extension deadlines remain authoritative. */
    private refreshAsyncWidget;
    private cyclePendingQuestion;
    private clickPendingQuestion;
    /** Intercept question chords and first typed input before the editor inserts it. */
    private handleAskUserShortcut;
    private setComposerReply;
    private handleAnswerCommand;
    /**
     * Key-free entry into the pending async question (empty Enter, /answer):
     * mounts the full component in place of the editor. Returns false when
     * nothing is pending or the component is already open.
     */
    private expandPendingQuestion;
    /**
     * Ordinary composer text while an async question is pending is the comment
     * answer: resolve the question with it and let the framed message replace
     * the raw text. Returns false when nothing is pending.
     */
    private submitAsyncQuestionComment;
    /**
     * Full editor text with paste markers expanded. Prefers the editor's own
     * getExpandedText(); falls back to expanding from the paste snapshot when
     * only getPasteState() is implemented, then to the raw text (an editor
     * with neither capability never had expandable markers).
     */
    private getExpandedEditorText;
    /**
     * Set a custom editor component from an extension.
     * Pass undefined to restore the default editor.
     */
    private setCustomEditorComponent;
    /**
     * Show a notification for extensions.
     */
    private showExtensionNotify;
    /** Show a custom component with keyboard focus. Overlay mode renders on top of existing content. */
    private showExtensionCustom;
    /**
     * Show an extension error in the UI.
     */
    private showExtensionError;
    private setupKeyHandlers;
    private handleRightClickPaste;
    private handleClipboardPaste;
    /** Route an editor's image-marker changes into {@link reconcilePendingImages}. */
    private subscribeImageMarkers;
    /**
     * Re-key {@link pendingImages} onto the marker numbers the editor now
     * displays. `order` lists the SURVIVING marker ids (pre-renumber, i.e. the
     * keys the payloads currently sit under) in text reading order, and the
     * editor keeps the visible numbers canonical 1..k in reading order, so a
     * payload's new key is its position in that list. Ids absent from `order`
     * are dropped; reported ids with no payload (a hand-typed marker) are skipped
     * without consuming anyone else's slot.
     *
     * The map is mutated IN PLACE, never replaced: handleClipboardPaste hands
     * this.pendingImages by reference into attachClipboardImage's deps, and a
     * fresh identity would orphan that reference - the second paste in a turn
     * then wrote into the dead map and silently destroyed its image.
     */
    private reconcilePendingImages;
    /**
     * Resolve the `[Image #N]` markers in `submittedText` (in READING order)
     * into the image array submitted alongside it, then clear
     * {@link pendingImages}.
     *
     * Reads ONLY the submitted text plus pendingImages - never live editor
     * state: pi-tui's `Editor.submitValue()` resets the editor and clears its
     * registries BEFORE `onSubmit` fires. A marker with no pending payload (a
     * hand-typed `[Image #N]`, or the second half of a kill/yank duplicate) is
     * passed through untouched and consumes no slot; a payload-bearing
     * marker's FIRST occurrence wins. Slots are assigned 1..k in reading
     * order, so the Nth marker in the final text is `images[N-1]`.
     */
    private takeSubmissionImages;
    private getSessionLogger;
    private handleStartupSubmit;
    /**
     * Paint the render-only echo for a submission, unless it is the bare "."
     * manual-continue shortcut. The session routes that "." as a hidden
     * continuation, so painting it would leave a user bubble the transcript never
     * receives; `undefined` tells the echo callbacks nothing was painted.
     */
    private beginUserEcho;
    private setupEditorSubmitHandler;
    private showLifecycleStatus;
    private subscribeToAgent;
    private handleEvent;
    private showRetryStatusIndicator;
    private showSummarizationRetryStatusIndicator;
    private showRetryStatusIndicatorWithCadence;
    /** Extract text content from a user message */
    private getUserMessageText;
    /** Show a managed-tool status update in the chat. */
    private showManagedToolStatus;
    /**
     * Show a status message in the chat.
     *
     * If multiple status messages are emitted back-to-back (without anything else being added to the chat),
     * we update the previous status line instead of appending new ones to avoid log spam.
     */
    private showStatus;
    private addCustomEntryToChat;
    private renderPendingUserEcho;
    private addMessageToChat;
    private syncTrailingAssistantText;
    private detachAssistantTextSegments;
    private createToolExecutionComponent;
    private renderSessionItems;
    /**
     * Render session entries to chat. Used for initial load and rebuild after compaction.
     * @param entries Compaction-aware session entries to render
     * @param options.updateFooter Update footer state
     * @param options.populateHistory Add user messages to editor history
     */
    private renderSessionEntries;
    /**
     * Render billing usage for a compaction or branch summary. The notice is derived
     * from persisted summary usage and is not stored as a separate session entry.
     */
    private addModelChangeNotice;
    private addCompactionCostNotice;
    private maybeShowAssistantDiagnostics;
    private static countDroppedThinkingBlocks;
    private maybeShowThinkingDropNotice;
    /**
     * Show a transcript notice when a completed assistant message paid for a
     * significant cache miss. Only states observable facts: the miss itself,
     * a model switch, or an idle gap past the cache TTL.
     */
    /** Muted single-line notice for degraded session continuity; healthy turns stay silent. */
    private addContinuityNotice;
    private maybeShowCacheMissNotice;
    private addCacheMissNotice;
    renderInitialMessages(): void;
    private renderProjectTrustWarningIfNeeded;
    getUserInput(): Promise<InteractiveUserInput>;
    private buildMainLoopPromptOptions;
    private rebuildChatFromMessages;
    private handleCtrlC;
    private handleCtrlD;
    /**
     * Gracefully shutdown the agent.
     * Stops the TUI before emitting shutdown events so extension UI cleanup cannot
     * repaint the final frame while the process is exiting.
     */
    private isShuttingDown;
    private shutdown;
    private emergencyTerminalExit;
    /**
     * Last-resort handler for uncaught exceptions. The TUI puts stdin into raw
     * mode and hides the cursor; without this handler, an uncaught throw from
     * anywhere (e.g. an extension's async `ChildProcess.on("exit")` callback)
     * tears down the process while leaving the terminal in raw mode with no
     * cursor, requiring `stty sane && reset` to recover.
     *
     * Unlike emergencyTerminalExit, the terminal is still alive here, so we
     * call ui.stop() to restore cooked mode, the cursor, and disable bracketed
     * paste / Kitty / modifyOtherKeys sequences.
     */
    private uncaughtCrash;
    /**
     * An unhandled rejection is a bug, not something the user can act on, and Bun keeps the
     * process running after one. It goes to the debug log and never to the terminal the TUI is
     * drawing on (#2284).
     */
    private unhandledRejection;
    /**
     * Record an extension shutdown request and honor it as soon as it is safe to do so.
     *
     * An idle session emits no further `agent_settled`, and that event is the only
     * consumer of the deferred flag, so an idle request must shut down here or it
     * strands until the user happens to run another turn.
     */
    private requestExtensionShutdown;
    /**
     * Check if shutdown was requested and perform shutdown if so.
     */
    private checkShutdownRequested;
    private registerSignalHandlers;
    private unregisterSignalHandlers;
    private handleCtrlZ;
    private handleFollowUp;
    private handleDequeue;
    private updateEditorBorderColor;
    private cycleThinkingLevel;
    private cycleModel;
    private toggleToolOutputExpansion;
    private setToolsExpanded;
    private toggleThinkingBlockVisibility;
    private handleOpenExternalEditor;
    /**
     * Runs `work` (an external program that draws on the terminal itself) with the terminal handed
     * back: the TUI stops, fd 1 and fd 2 point at the terminal again, and both are taken over again
     * afterwards. An editor launched without this would draw into the debug log (#2815).
     */
    private withTerminalHandedOver;
    clearEditor(): void;
    showError(errorMessage: string): void;
    private getProviderErrors;
    showNoticeBox(spec: NoticeSpec): void;
    showWarning(warningMessage: string): void;
    showNewVersionNotification(newVersion: string): void;
    showRiskyMainModelWarning(model: Model<any> | undefined): void;
    showSettingsSourceSelected(event: Extract<AgentSessionEvent, {
        type: "settings_source_selected";
    }>): void;
    showHighReasoningWarning(event: {
        modelId: string;
        provider: string;
        thinkingLevel: ThinkingLevel;
    }): void;
    showPackageUpdateNotification(packages: string[]): void;
    /**
     * Get all queued messages (read-only).
     * Combines session queue and compaction queue.
     */
    private getAllQueuedMessages;
    /**
     * Clear all queued messages and return their contents.
     * Clears both session queue and compaction queue.
     */
    private clearAllQueues;
    private updatePendingMessagesDisplay;
    private restoreQueuedMessagesToEditor;
    /**
     * User-abort path that drains the queue, aborts the active run (and any in-flight retry),
     * waits for settle, then restores queued messages to the editor.
     *
     * Behavior contract:
     * - clearAllQueues() is called synchronously so the pending-messages display empties immediately.
     * - `await session.abort()` ensures the previous run is fully idle before touching the draft.
     * - The helper never auto-prompts restored queue text; the user decides whether to send it.
     */
    private abortAndFireQueuedMessages;
    /** Restore an unknown-command submission to the editor with a warning; `false` for any other error. */
    private reportUnknownCommandRejection;
    private queueCompactionMessage;
    /**
     * Queue a user submission for delivery after compaction. The compaction
     * queue carries text only, so pasted attachments are dropped here -
     * VISIBLY, never silently, mirroring attachClipboardImage's paste-time
     * contract - and their `[Image #N]` markers are stripped, because a queued
     * literal marker has no payload behind it and would ship an unreadable
     * `[Image #N]` string to the model once the queue drains.
     */
    private queueCompactionSubmission;
    private hasRegisteredCommand;
    /**
     * `/skill` and `/skill:` name the skill namespace, not a skill, so they never reach the model:
     * the editor is reset to `/skill:` with the skill list open, or a warning explains why it is empty.
     */
    private openSkillPickerForBareNamespace;
    private isExtensionCommand;
    private flushCompactionQueue;
    /** Move pending bash components from pending area to chat */
    private flushPendingBashComponents;
    private disposeActiveSelector;
    /**
     * Shows a selector component in place of the editor.
     * @param create Factory that receives a `done` callback and returns the component and focus target
     */
    private showSelector;
    private showSettingsSelector;
    private handleThinkingCommand;
    /**
     * `persist: false` scopes the level to this session; `persist: true` also
     * records it as the model's remembered level (the Ctrl+S path of the selector).
     */
    private selectThinkingLevel;
    /**
     * The level switch itself; the control endpoint's `set_thinking_level` runs it too.
     * Static and called through the class, so a handler invoked on a partial `this`
     * reaches exactly the members the switch uses.
     */
    private static applyThinkingLevel;
    private showThinkingSelector;
    private handleModelCommand;
    private findExactModelMatch;
    private selectModelFromUi;
    /**
     * The `/model` switch itself; the control endpoint's `set_model` runs it too, and reports a throw.
     * Static and called through the class for the same reason as `applyThinkingLevel`.
     */
    private static applyModelSelection;
    private resolveFavoriteModelsForUi;
    private getFavoriteModelIdsForUi;
    private captureFavoritePatternSnapshot;
    private applyFavoriteSelection;
    /** Update the footer's available provider count from the current snapshot without refreshing catalogs. */
    private updateAvailableProviderCount;
    private maybeWarnAboutAnthropicSubscriptionAuth;
    private maybeSaveImplicitProjectTrustAfterReload;
    private showTrustSelector;
    private showModelSelector;
    private showFavoriteModelsSelector;
    private showScopedModelsSelector;
    private showUserMessageSelector;
    private handleCloneCommand;
    private showTreeSelector;
    private editAssistantMessageFromTree;
    /** Bookkeeping entries after the target (thinking level, labels, custom state) leave nothing to summarize. */
    private treeNavigationAbandonsConversation;
    private promptBranchSummaryChoice;
    private runTreeNavigation;
    private showSessionSelector;
    private handleResumeSession;
    private getLoginProviderOptions;
    private getLogoutProviderOptions;
    private findLoginProviderOptions;
    private handleLoginCommand;
    private startProviderLogin;
    private showLoginAuthTypeSelector;
    private showLoginProviderSelector;
    private showOAuthSelector;
    private completeProviderAuthentication;
    private showAmbientAuthDialog;
    private showApiKeyLoginDialog;
    private showAuthSelect;
    private showAuthPrompt;
    private notifyAuthDialog;
    private loginProvider;
    private showLoginDialog;
    /** #1542: a cancelled login is a neutral status line; only a genuine failure is an error. */
    private showLoginFailure;
    private handleReloadCommand;
    private handleExportCommand;
    private getPathCommandArgument;
    private handleImportCommand;
    private handleShareCommand;
    private uploadShareWithLoader;
    private handleCopyCommand;
    /** `/rename [name]` and its `/name` alias: a bare command opens the inline editor. */
    private handleRenameCommand;
    /** Store the display name and report the value the session kept. */
    private applySessionName;
    /** Swap the composer for a single-line input prefilled with the current name. */
    private showSessionRenameInput;
    private commitSessionRename;
    private handleSessionCommand;
    private handleChangelogCommand;
    /**
     * Get capitalized display string for an app keybinding action.
     */
    private getAppKeyDisplay;
    /**
     * Get capitalized display string for an editor keybinding action.
     */
    private getEditorKeyDisplay;
    private handleHotkeysCommand;
    private handleClearCommand;
    private handleDebugCommand;
    private handleArminSaysHi;
    private handleDementedDelves;
    private handleDaxnuts;
    private checkDaxnutsEasterEgg;
    private handleBashCommand;
    private handleCompactCommand;
    stop(options?: FullscreenExitOutput | {
        restoreStderr?: boolean;
    }): void;
}
//# sourceMappingURL=interactive-mode.d.ts.map