/** * CLI Streaming Module - Real-time Agent Response Display * * Manages streaming display for CLI interface with real-time chunk accumulation, * visual feedback, and comprehensive event processing. * * FEATURES: * - Real-time streaming with visual feedback and state tracking * - Comprehensive event processing (chunk, end, error) * - Tool streaming output display for shell_cmd (stdout/stderr) * - Color-coded streaming indicators and status messages * - Enhanced tool display with Unicode icons and formatted names * - Tool output truncation at 50K characters * - Modular design for reuse across CLI components * - Event-driven display (no timer dependencies) * CHANGES: * - 2026-02-11: Enhanced tool display with icons, formatted names, stderr prefix, 50K truncation * - 2026-02-08: Added tool streaming support for shell_cmd real-time output display * - 2025-02-06: Track last streamed message to prevent duplicate MESSAGE events after streaming output */ import { type StatusLineManager } from './display.js'; export interface StreamingState { isActive: boolean; content: string; sender?: string; messageId?: string; lastStreamedMessageId?: string; lastStreamedContent?: string; lastStreamedSender?: string; lastStreamedAt?: number; } export declare function createStreamingState(): StreamingState; export declare function handleStreamingEvents(eventData: any, streaming: StreamingState, statusLine?: StatusLineManager): void; export declare function handleToolEvents(eventData: any): void; export declare function handleToolStreamEvents(eventData: any): void; /** Reset tool stream tracking (call on tool-start or new tool execution). */ export declare function resetToolStreamTracking(): void; export declare function handleActivityEvents(eventData: any): void; export declare function handleWorldEventWithStreaming(eventType: string, eventData: any, streaming: StreamingState, statusLine?: StatusLineManager): boolean; export declare function resetStreamingState(streaming: StreamingState): void; export declare function isStreamingActive(streaming: StreamingState): boolean;