/** * PromptController - minimal wrapper around UnifiedUIRenderer for coding agent UX. * Handles input wiring and status/meta updates without any of the legacy scroll-region plumbing. */ import { UnifiedUIRenderer, type CommandSuggestion, type RLAgentStatus, type MenuItem } from './UnifiedUIRenderer.js'; export type { RLAgentStatus, MenuItem }; export type EditGuardMode = 'display-edits' | 'require-approval' | 'block-writes' | 'ask-permission' | 'plan'; export interface PromptCallbacks { onSubmit: (text: string) => void; onQueue: (text: string) => void; onInterrupt: () => void; onExit?: () => void; onCtrlC?: (info: { hadBuffer: boolean; }) => void; onResume?: () => void; onChange?: (event: { text: string; cursor: number; }) => void; onEditModeChange?: (mode: EditGuardMode) => void; onToggleAutoContinue?: () => void; onToggleThinking?: () => void; onClearContext?: () => void; onToggleCriticalApproval?: () => void; onExpandToolResult?: () => void; } export declare class PromptController { private readonly renderer; private readonly callbacks; private editMode; private statusMain; private statusOverride; private statusStreaming; private modeToggleState; private started; private disposed; private boundHandlers; constructor(inStream: NodeJS.ReadStream, outStream: NodeJS.WriteStream, callbacks: PromptCallbacks, existingRenderer?: UnifiedUIRenderer); private addBoundHandler; private removeAllBoundHandlers; getRenderer(): UnifiedUIRenderer; start(): void; stop(): void; setStreaming(streaming: boolean): void; getMode(): 'idle' | 'streaming'; setContextUsage(percentage: number | null): void; setModeToggles(_options: { autoMode?: 'off' | 'on' | 'dual'; autoContinueHotkey?: string; thinkingModeLabel?: string | null; thinkingHotkey?: string; criticalApprovalMode?: 'auto' | 'approval'; criticalApprovalHotkey?: string; }): void; setDebugMode(enabled: boolean): void; toggleAutoContinue(): void; /** Get the current auto mode */ getAutoMode(): 'off' | 'on' | 'dual'; /** Set auto mode directly */ setAutoMode(mode: 'off' | 'on' | 'dual'): void; toggleApprovals(): void; toggleThinking(): void; /** * Sync the stored toggle state to the renderer so UI reflects the latest flags. */ private syncModeToggles; getModeToggleState(): Readonly; setStatusMessage(message: string | null): void; setOverrideStatus(message: string | null): void; setStreamingLabel(label: string | null): void; /** * Atomically set the streaming/override/main status text and render once. */ setStatusLine(status: { main?: string | null; override?: string | null; streaming?: string | null; }): void; setMetaStatus(meta: { elapsedSeconds?: number | null; tokensUsed?: number | null; tokenLimit?: number | null; thinkingMs?: number | null; thinkingHasContent?: boolean; }): void; clearAllStatus(): void; setModelContext(options: { model?: string | null; provider?: string | null; }): void; setChromeMeta(meta: { profile?: string; workspace?: string; directory?: string; writes?: string; sessionLabel?: string; thinkingLabel?: string; autosave?: boolean; version?: string; }): void; setAvailableCommands(commands: CommandSuggestion[]): void; /** * Display content in the inline panel (below prompt, above toggles). * Content is transient - not persisted to chat history. * Use for help menus, status displays, etc. */ setInlinePanel(lines: string[]): void; /** * Clear the inline panel. */ clearInlinePanel(): void; /** * Check if inline panel is supported (TTY mode only). */ supportsInlinePanel(): boolean; /** * Show an interactive menu with arrow key navigation (Claude Code style). * @param items - Menu items to display * @param options - Menu options (title, initialIndex) * @param callback - Called when user selects an item (or null if cancelled) */ setMenu(items: MenuItem[], options: { title?: string; initialIndex?: number; }, callback: (item: MenuItem | null) => void): void; /** * Close the active menu without selecting anything. */ closeMenu(): void; /** * Check if an interactive menu is currently active. */ isMenuActive(): boolean; /** * Set the activity message displayed during streaming (e.g., "Reasoning", "Thinking"). * This updates the animated status line: "✳ Reasoning… (esc to interrupt · 34s)" */ setActivityMessage(message: string | null): void; setEditMode(mode: EditGuardMode): void; applyEditMode(mode: EditGuardMode): void; getEditMode(): EditGuardMode; getBuffer(): string; getCursor(): number; setBuffer(text: string, cursorPos?: number): void; setSecretMode(enabled: boolean): void; clear(): void; render(): void; forceRender(): void; handleResize(): void; dispose(): void; /** * Update RL agent execution status for display in the UI. * Called during dual-RL mode to show active agent, module/step progress, and win statistics. */ updateRLStatus(status: Partial): void; /** * Clear RL agent status (e.g., when RL run completes). */ clearRLStatus(): void; /** * Get current RL status for external access. */ getRLStatus(): Readonly; /** * Update the status line with a single composed message so the UI looks identical * before and during streaming. The renderer only owns one status field, so we * join the different status sources here. */ private setStatusBundle; private refreshStatus; private formatElapsed; } //# sourceMappingURL=PromptController.d.ts.map