import type { ProviderEvent, ProviderUsage } from '../../provider.js'; export interface OpenAIChunk { id?: string; model?: string; choices?: Array<{ index?: number; delta?: { role?: string; content?: string | null; reasoning_content?: string | null; reasoning?: string | null; tool_calls?: Array<{ index: number; id?: string; type?: 'function'; function?: { name?: string; arguments?: string; }; }>; }; finish_reason?: string | null; }>; usage?: { prompt_tokens?: number; completion_tokens?: number; total_tokens?: number; prompt_tokens_details?: { cached_tokens?: number; }; }; } export interface StreamState { assistantText: string; reasoningText: string; toolCallsByIndex: Map; finishReason: string | null; usage: OpenAIChunk['usage'] | null; model: string | null; id: string | null; } export interface AccumulatedToolCall { index: number; id: string; name: string; argumentsRaw: string; startEmitted: boolean; } export declare function createStreamState(): StreamState; export declare function translateChunk(chunk: OpenAIChunk, state: StreamState, sessionId: string): Generator; export declare function usageFromState(state: StreamState, model?: string): ProviderUsage; export declare function finalizedToolCalls(state: StreamState): AccumulatedToolCall[]; export declare function isToolCallStop(state: StreamState): boolean;