/** * Stream Manager - Manages channel response streams. * * Handles creation and lifecycle of stream handles for streaming responses. */ export interface StreamHandle { update: (text: string) => void; updateReasoning?: (text: string) => void; end: () => Promise; abort: () => Promise; messageId: () => number | undefined; skipFinalOutbound?: () => boolean; } export declare class StreamManager { private currentHandle; private skipFinalOutboundPending; /** * Set the current stream handle */ setHandle(handle: StreamHandle): void; /** * Get the current stream handle */ getHandle(): StreamHandle | null; /** * Clear the current stream handle */ clearHandle(): void; /** * Check if a stream handle is currently active */ hasActiveHandle(): boolean; /** * Update the stream with text content */ update(text: string): void; updateReasoning(text: string): void; /** * End the stream and clear the handle */ end(): Promise; /** * Abort the stream and clear the handle */ abort(): Promise; /** * Whether the channel already delivered the final assistant text (e.g. Telegram streaming). * Consumes the flag for one outbound decision. */ consumeSkipFinalOutbound(): boolean; /** * Get the current message ID from the stream handle */ getMessageId(): number | undefined; }