/**
 * Stream Manager - Manages stream handles for progress updates
 *
 * Handles creation and lifecycle of stream handles for sending progress updates
 * and streaming responses.
 */
import type { ProgressStage } from '../lifecycle/progress.js';
export interface StreamHandle {
    update: (text: string) => void;
    updateProgress?: (text: string, stage: ProgressStage, detail?: string) => void;
    setProgress?: (stage: ProgressStage, detail?: string) => void;
    end: () => Promise<void>;
    abort: () => Promise<void>;
    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;
    /**
     * End the stream and clear the handle
     */
    end(): Promise<void>;
    /**
     * Abort the stream and clear the handle
     */
    abort(): Promise<void>;
    /**
     * 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;
    /**
     * Update progress via the stream handle
     */
    updateProgress(text: string, stage: ProgressStage, detail?: string): void;
    /**
     * Set progress stage via the stream handle
     */
    setProgress(stage: ProgressStage, detail?: string): void;
}
