import type { CompletionRequest } from "../types.js"; import type { TokenUsage } from "./token-usage.js"; import type { StreamTerminalProof } from "./provider-profile.js"; import type { ResponsesDialectConfig } from "./responses-config.js"; import type { ToolCallAccumulator } from "./responses-parse.js"; import type { StreamIdleWatchdog } from "./responses-stream-watchdog.js"; export interface StreamAccumulator { full: string; visible: string; reasoningSeen: string; finishReason: string | undefined; sawTerminalProof: StreamTerminalProof | undefined; streamUsage: TokenUsage | undefined; responseId: string | undefined; readonly toolCallState: Map; readonly outputIndexToItemId: Map; readonly outputIndexToToolCallIndex: Map; readonly reasoningItems: Array>; readonly reasoningItemSequences: number[]; readonly reasoningItemToolCallIndices: Array; readonly reasoningItemIndexes: Map; } export declare function newStreamAccumulator(): StreamAccumulator; export declare function noteReasoningItem(state: StreamAccumulator, item: Record, sequence?: number | undefined, toolCallIndex?: number | undefined): void; export declare function absorbResponseOutput(state: StreamAccumulator, resp: Record, emitVisible: (text: string) => void, emitReasoningDelta: (text: string) => void): void; export declare function streamReasoningReplay(config: ResponsesDialectConfig, model: string, state: StreamAccumulator, onStreamEvent: CompletionRequest["onStreamEvent"]): Record; export declare function streamUsageResult(state: StreamAccumulator, thinkingEnabled?: boolean | undefined): { usage: TokenUsage; } | Record; export interface StreamEventContext { config: ResponsesDialectConfig; model: string; request: CompletionRequest; state: StreamAccumulator; watchdog: StreamIdleWatchdog; emitVisible: (text: string) => void; emitReasoningDelta: (text: string) => void; }