import type { Chunk, ExtendedResponse, ProviderChunk, ServiceName, ToolCall, Cost } from './types'; /** * Handles streaming responses from LLM providers * Tracks chunks for complete response assembly */ export declare class StreamHandler { private chunks; private isComplete; private response; private contentParts; private thinkingParts; private toolCalls; private usage; private readonly service; private readonly model; constructor(service: ServiceName, model: string); /** * Process a stream of provider chunks and yield normalized chunks */ process(stream: AsyncIterable): AsyncIterable; /** * Process a single provider chunk into a normalized chunk */ private processChunk; /** * Build the final ExtendedResponse from accumulated chunks */ private buildResponse; /** * Get the complete response after streaming finishes * @throws Error if called before stream is complete */ getComplete(): ExtendedResponse; /** * Check if the stream has completed */ getIsComplete(): boolean; /** * Get all accumulated chunks */ getChunks(): Chunk[]; /** * Get the accumulated content so far (even before completion) */ getCurrentContent(): string; /** * Get the accumulated thinking content so far */ getCurrentThinking(): string; /** * Get the accumulated tool calls so far */ getCurrentToolCalls(): ToolCall[]; /** * Set the cost on the response (called by CostCalculator) */ setCost(cost: Cost | null): void; /** * Reset the handler for reuse */ reset(): void; } //# sourceMappingURL=stream-handler.d.ts.map