import { EventEmitter } from 'events'; import { ConversationItem } from './conversation-renderer.js'; export interface UIState { mode: 'normal' | 'tool-execution' | 'alternate-screen'; isProcessingInput: boolean; bufferedOutput: BufferedOutput[]; currentToolExecutions: Set; alternateScreenActive: boolean; } export interface BufferedOutput { id: string; type: 'console' | 'tool-progress' | 'tool-result' | 'tool-confirmation'; content: string; timestamp: Date; metadata?: { toolName?: string; executionId?: string; stream?: 'stdout' | 'stderr'; }; } export interface UIStateEvents { 'state-changed': (state: UIState) => void; 'output-buffered': (output: BufferedOutput) => void; 'tool-execution-start': (executionId: string) => void; 'tool-execution-end': (executionId: string) => void; 'alternate-screen-enter': () => void; 'alternate-screen-exit': () => void; 'console-output-intercepted': (output: string, stream: 'stdout' | 'stderr') => void; } export declare class UIStateManager extends EventEmitter { private state; private originalConsoleLog; private originalConsoleError; private originalStdoutWrite; private originalStderrWrite; private isIntercepting; private interceptBuffer; constructor(); emit(event: K, ...args: Parameters): boolean; on(event: K, listener: UIStateEvents[K]): this; startIntercepting(): void; stopIntercepting(): void; private shouldInterceptOutput; private isAnsiControlSequence; private bufferOutput; flushBufferedOutput(): BufferedOutput[]; setMode(mode: UIState['mode']): void; startToolExecution(executionId: string): void; endToolExecution(executionId: string): void; setAlternateScreenActive(active: boolean): void; isCurrentlyIntercepting(): boolean; getState(): Readonly; addToolConfirmationOutput(content: string, metadata?: any): void; addToolProgressOutput(content: string, executionId: string, toolName?: string): void; addToolResultOutput(content: string, executionId: string, toolName?: string): void; formatBufferedOutput(output: BufferedOutput): ConversationItem | null; reset(): void; } export declare const uiStateManager: UIStateManager; //# sourceMappingURL=ui-state-manager.d.ts.map