import { type Agent, type AgentMessage } from "@gajae-code/agent-core"; import type { CompactionOutcome } from "@gajae-code/agent-core/compaction"; import type { AssistantMessage, ImageContent, Message, UsageReport } from "@gajae-code/ai/core"; import type { Component, EditorTheme, SlashCommand } from "@gajae-code/tui"; import { Container, Loader, Spacer, Text, TUI } from "@gajae-code/tui"; import { KeybindingsManager, type KeyDisplayContext } from "../config/keybindings"; import { type Settings } from "../config/settings"; import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetContent, ExtensionWidgetOptions } from "../extensibility/extensions"; import type { CompactOptions } from "../extensibility/extensions/types"; import { type Skill } from "../extensibility/skills"; import type { NotificationSessionReconcileResult, NotificationSessionStatus } from "../sdk/bus/session-control"; import type { AgentSession, AgentSessionEvent } from "../session/agent-session"; import type { HistoryStorage } from "../session/history-storage"; import type { SessionContext, SessionManager } from "../session/session-manager"; import type { LspStartupServerInfo } from "../tools"; import type { EventBus } from "../utils/event-bus"; import type { AssistantMessageComponent } from "./components/assistant-message"; import type { BashExecutionComponent } from "./components/bash-execution"; import type { CommandPaletteAction } from "./components/command-palette"; import { CustomEditor } from "./components/custom-editor"; import type { EvalExecutionComponent } from "./components/eval-execution"; import { GajaePetWidget, type PetMode } from "./components/gajae-pet-widget"; import type { HookEditorComponent } from "./components/hook-editor"; import type { HookInputComponent } from "./components/hook-input"; import type { HookSelectorComponent } from "./components/hook-selector"; import type { ToolExecutionHandle } from "./components/tool-execution"; import { StatusLineComponent } from "./components/tool-status-header"; import { type WelcomeLogoMode } from "./components/welcome"; import { GoalModeController } from "./controllers/goal-mode-controller"; import { PlanModeController } from "./controllers/plan-mode-controller"; import type { SttModeController } from "./controllers/stt-controller"; import { IrcObservationLedger } from "./irc-observation-ledger"; import { OAuthManualInputManager } from "./oauth-manual-input"; import { PromptSuggestionController } from "./prompt-suggestion-controller"; import type { Theme } from "./theme/theme"; import { type ActivityIndicatorStopOptions, type CompactionQueuedMessage, type ComposerSubmissionOptions, type InteractiveModeContext, type IrcArrivalSnapshot, type SubmittedUserInput, type TodoItem, type TodoPhase, type TranscriptRebuildPolicy } from "./types"; import type { ParsedIrcMessage } from "./utils/irc-message"; export declare function getDefaultComposerPlaceholder(context?: KeyDisplayContext, keybindings?: Pick): string; export declare const DEFAULT_COMPOSER_PLACEHOLDER: string; export declare function getComposerPlaceholder(keybindings: Pick, context: KeyDisplayContext, options: { readonly busy: boolean; readonly busyPromptMode: "steer" | "queue"; readonly showActionHints: boolean; }): string; export declare function resolveActivityIndicatorMessage(foregroundActive: boolean, activeBackgroundTasks: number, foregroundMessage: string): string | undefined; export declare function getWelcomeTranscriptReservedRows(chatContainer: Container, width: number): number; export type WelcomeBannerSettingMode = "auto" | "unicode" | "square" | "ascii"; export declare function resolveWelcomeLogoMode(mode: WelcomeBannerSettingMode, env?: Record, platform?: NodeJS.Platform): WelcomeLogoMode; /** Options for creating an InteractiveMode instance (for future API use) */ export interface InteractiveModeOptions { /** Providers that were migrated during startup */ migratedProviders?: string[]; /** Warning message if model fallback occurred */ modelFallbackMessage?: string; /** Initial message to send */ initialMessage?: string; /** Initial images to include with the message */ initialImages?: ImageContent[]; /** Additional initial messages to queue */ initialMessages?: string[]; } export declare function selectShutdownDraft(editorText: string, hasActiveBtw: boolean): string; export declare function ensureSttControllerForToggle(current: () => SttModeController | undefined, assign: (controller: SttModeController) => void, load?: () => Promise<() => SttModeController>): Promise; export declare class InteractiveMode implements InteractiveModeContext { #private; session: AgentSession; sessionManager: SessionManager; settings: Settings; keybindings: KeybindingsManager; agent: Agent; historyStorage?: HistoryStorage; readonly ircLedger: IrcObservationLedger; ui: TUI; chatContainer: Container; pendingMessagesContainer: Container; statusContainer: Container; todoContainer: Container; btwContainer: Container; editor: CustomEditor; editorContainer: Container; hookWidgetContainerAbove: Container; hookWidgetContainerBelow: Container; petFloorContainer: Container; petWidget: GajaePetWidget | undefined; statusLine: StatusLineComponent; isInitialized: boolean; isBackgrounded: boolean; isBashMode: boolean; isBashNoContext: boolean; toolOutputExpanded: boolean; todoExpanded: boolean; todoPhases: TodoPhase[]; hideThinkingBlock: boolean; pendingImages: ImageContent[]; compactionQueuedMessages: CompactionQueuedMessage[]; pendingTools: Map; pendingBashComponents: BashExecutionComponent[]; bashComponent: BashExecutionComponent | undefined; pendingPythonComponents: EvalExecutionComponent[]; pythonComponent: EvalExecutionComponent | undefined; isPythonMode: boolean; streamingComponent: AssistantMessageComponent | undefined; streamingMessage: AssistantMessage | undefined; loadingAnimation: Loader | undefined; autoCompactionLoader: Loader | undefined; retryLoader: Loader | undefined; autoCompactionEscapeHandler?: () => void; retryEscapeHandler?: () => void; retryEscapePrimed: boolean; retryCountdownTimer?: NodeJS.Timeout; unsubscribe?: () => void; onInputCallback?: (input: SubmittedUserInput) => void; optimisticUserMessageSignature: string | undefined; locallySubmittedUserSignatures: Set; optimisticInjectedSignatures: Map; lastSigintTime: number; lastEscapeTime: number; lastComposerClearEscapeTime: number; shutdownRequested: boolean; hookSelector: HookSelectorComponent | undefined; hookInput: HookInputComponent | undefined; hookEditor: HookEditorComponent | undefined; lastStatusSpacer: Spacer | undefined; lastStatusText: Text | undefined; fileSlashCommands: Set; skillCommands: Map; oauthManualInput: OAuthManualInputManager; promptSuggestion: PromptSuggestionController; readonly lspServers: LspStartupServerInfo[] | undefined; mcpManager?: import("../runtime-mcp").MCPManager; /** Direct controller capabilities for consumers that coordinate mode transitions. */ get planModeController(): PlanModeController; get goalModeController(): GoalModeController; constructor(session: AgentSession, version: string, changelogMarkdown?: string | undefined, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers?: LspStartupServerInfo[] | undefined, mcpManager?: import("../runtime-mcp").MCPManager, eventBus?: EventBus, keyDisplayContext?: KeyDisplayContext); getCurrentSessionNotificationStatus(): NotificationSessionStatus | undefined; setCurrentSessionNotificationsEnabled(enabled: boolean): Promise; init(): Promise; getSlashCommands(): readonly SlashCommand[]; ensureHistoryStorage(): Promise; /** Reload slash commands and autocomplete for the provided working directory. */ refreshSlashCommandState(cwd?: string): Promise; getUserInput(): Promise; recordLocalSubmission(text: string, imageCount?: number): () => void; withLocalSubmission(text: string, fn: () => Promise, options?: { imageCount?: number; }): Promise; startPendingSubmission(input: { text: string; images?: ImageContent[]; customType?: string; display?: boolean; }, options?: ComposerSubmissionOptions): SubmittedUserInput; cancelPendingSubmission(): boolean; hasPendingSubmission(): boolean; markPendingSubmissionStarted(input: SubmittedUserInput): boolean; finishPendingSubmission(input: SubmittedUserInput): void; updateEditorChrome(): void; updateEditorBorderColor(): void; updateEditorTopBorder(): void; setPetMode(mode: PetMode): boolean; previewPetMode(mode: PetMode): void; commitPetPreviewMode(mode: PetMode): boolean; restoreComposer(): void; rebuildChatFromMessages(policy: TranscriptRebuildPolicy): void; isStopped(): boolean; onStop(callback: () => void): () => void; stop(): void; shutdown(): Promise; checkShutdownRequested(): Promise; setToolUIContext(uiContext: ExtensionUIContext, hasUI: boolean): void; initializeHookRunner(uiContext: ExtensionUIContext, hasUI: boolean): void; createBackgroundUiContext(): ExtensionUIContext; setEditorComponent(factory: ((tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => CustomEditor) | undefined): void; handleBackgroundEvent(event: AgentSessionEvent): Promise; showStatus(message: string, options?: { dim?: boolean; }): void; showError(message: string): void; showWarning(message: string): void; syncActivityIndicator(): void; ensureLoadingAnimation(): void; stopLoadingAnimation(options?: ActivityIndicatorStopOptions): void; suspendActivityIndicator(): () => void; setWorkingMessage(message?: string): void; applyPendingWorkingMessage(): void; showNewVersionNotification(newVersion: string): void; clearEditor(): void; updatePendingMessagesDisplay(): void; queueCompactionMessage(text: string, mode: "steer" | "followUp", options?: ComposerSubmissionOptions): void; flushCompactionQueue(options?: { willRetry?: boolean; }): Promise; flushPendingBashComponents(): void; isKnownSlashCommand(text: string): boolean; /** Advances the sticky-viewport source only for semantic transcript output. */ recordVisibleTranscriptMutation(): void; addMessageToChat(message: AgentMessage, options?: { populateHistory?: boolean; }): Component[]; addLiveIrcObservationToChat(message: ParsedIrcMessage, arrival: IrcArrivalSnapshot): Component[]; removeRenderedIrcInlineComponents(observationId: string): readonly Component[] | undefined; resetRenderedIrcInlineComponents(): readonly (readonly Component[])[]; renderSessionContext(sessionContext: SessionContext, options?: { updateFooter?: boolean; populateHistory?: boolean; }): void; rebuildInitialMessages(policy: TranscriptRebuildPolicy, prebuiltContext?: SessionContext, options?: { preserveExistingChat?: boolean; }): void; renderInitialMessages(prebuiltContext?: SessionContext, options?: { preserveExistingChat?: boolean; }): void; getUserMessageText(message: Message): string; findLastAssistantMessage(): AssistantMessage | undefined; getAssistantViewportAnchorId(message: AssistantMessage): string; extractAssistantText(message: AssistantMessage): string; handleExportCommand(text: string): Promise; handleDumpCommand(): void; handleDebugTranscriptCommand(): Promise; handleShareCommand(): Promise; handleCopyCommand(sub?: string): void; handleTodoCommand(args: string): Promise; handleSessionCommand(): Promise; handleJobsCommand(): Promise; handleUsageCommand(reports?: UsageReport[] | null): Promise; handleChangelogCommand(showFull?: boolean): Promise; handleHotkeysCommand(): void; handleHelpCommand(): void; handleToolsCommand(): void; handleContextCommand(): void; handleClearCommand(): Promise; handleContextClearCommand(): Promise; handleDropCommand(): Promise; handleForkCommand(): Promise; handleMoveCommand(targetPath: string): Promise; handleRenameCommand(title: string): Promise; handleMemoryCommand(text: string): Promise; handleSTTToggle(): Promise; showDebugSelector(): void; showSessionObserver(): void; showSessionsDashboard(): void; isTranscriptViewerOpen(): boolean; refreshTranscriptViewer(): void; showTranscriptViewer(): void; showJobsOverlay(): void; showTasksPane(): void; resetObserverRegistry(): void; handleBashCommand(command: string, excludeFromContext?: boolean): Promise; handlePythonCommand(code: string, excludeFromContext?: boolean): Promise; handleMCPCommand(_text: string): Promise; handleSSHCommand(text: string): Promise; handleCompactCommand(customInstructions?: string): Promise; handleHandoffCommand(customInstructions?: string): Promise; handleContributionPrepCommand(customInstructions?: string): Promise; executeCompaction(customInstructionsOrOptions?: string | CompactOptions, isAuto?: boolean): Promise; openInBrowser(urlOrPath: string): void; showCommandPalette(commands: SlashCommand[], actions: CommandPaletteAction[], executeSlashCommand: (name: string) => Promise): void; showSettingsSelector(): void; showThemeSelector(): void; showPetSelector(): void; showHistorySearch(): Promise; showExtensionsDashboard(): void; showCustomizationDashboard(): void; showAgentsDashboard(): void; showModelSelector(options?: { temporaryOnly?: boolean; smartRoutingOnly?: boolean; }): void; setAutoroutingEnabled(enabled: boolean): Promise; showEffortSelector(): void; showProviderOnboarding(): void; showFrictionlessOnboarding(): Promise; showPluginSelector(mode?: "install" | "uninstall"): void; showUserMessageSelector(): void; showTreeSelector(): void; showSessionSelector(): void; handleResumeSession(sessionPath: string): Promise; handleSessionDeleteCommand(): Promise; showOAuthSelector(mode: "login" | "logout", providerId?: string, options?: import("./types").OAuthSelectorOptions): Promise; showHookConfirm(title: string, message: string): Promise; handleCtrlC(): void; handleCtrlD(): void; handleCtrlZ(): void; handleDequeue(): void; handleBackgroundCommand(): void; handleImagePaste(): Promise; handleBtwCommand(question: string): Promise; hasActiveBtw(): boolean; handleBtwFollowUp(question: string): Promise<"accepted" | "busy" | "closed" | "rejected">; handleBtwEscape(): boolean; cycleThinkingLevel(): void; cycleRoleModel(options?: { temporary?: boolean; }): Promise; toggleToolOutputExpansion(): void; setToolsExpanded(expanded: boolean): void; captureIrcArrivalSnapshot(): IrcArrivalSnapshot; toggleIrcSidebar(): void; applyIrcSidebarAvailability(enabled: boolean): void; resetIrcSidebarSession(): void; toggleThinkingBlockVisibility(): void; toggleTodoExpansion(): void; setTodos(todos: TodoItem[] | TodoPhase[]): void; reloadTodos(): Promise; openExternalEditor(): void; registerExtensionShortcuts(): void; initHooksAndCustomTools(): Promise; emitCustomToolSessionEvent(reason: "start" | "switch" | "branch" | "tree" | "shutdown", previousSessionFile?: string): Promise; setHookWidget(key: string, content: ExtensionWidgetContent, options?: ExtensionWidgetOptions): void; setHookStatus(key: string, text: string | undefined): void; showHookSelector(title: string, options: string[], dialogOptions?: ExtensionUIDialogOptions): Promise; hideHookSelector(): void; showHookInput(title: string, placeholder?: string, dialogOptions?: ExtensionUIDialogOptions, inputOptions?: { readonly initialValue?: string; }): Promise; hideHookInput(): void; showHookEditor(title: string, prefill?: string, dialogOptions?: ExtensionUIDialogOptions, editorOptions?: { promptStyle?: boolean; }): Promise; hideHookEditor(): void; showHookNotify(message: string, type?: "info" | "warning" | "error"): void; showHookCustom(factory: (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result: T) => void) => (Component & { dispose?(): void; }) | Promise, options?: { overlay?: boolean; }): Promise; showExtensionError(extensionPath: string, error: string): void; showToolError(toolName: string, error: string): void; }