import type { SuccessfulRequestSnapshot, ToolCall } from "../../../types.js"; import type { ProviderStreamEvent } from "../../../llm/stream-events.js"; import { type ToolNameCanonicalizer } from "./canonicalize-turn-call.js"; export interface StreamDeferredToolCall { readonly eventId: string; call: ToolCall; shown: boolean; } export interface StreamSessionPorts { readonly emitStatus: (text: string) => void; readonly emitAssistantDelta: (text: string) => void; readonly emitThinkingDelta: (text: string) => void; readonly writeStatus: (text: string) => void; readonly notify: (level: "info" | "warn", message: string) => void; readonly writeToolCall: (eventId: string, call: ToolCall) => void; readonly nextToolEventId: () => string; readonly markPrinted: (eventId: string) => void; readonly nativeToolsAttached: () => boolean; readonly mcpRuntime?: ToolNameCanonicalizer | undefined; readonly onSuccessfulRequest: (snapshot: SuccessfulRequestSnapshot) => void; } export interface StreamSession { readonly accumulatedText: () => string; readonly streamedReasoningText: () => string; readonly sawReasoning: () => boolean; readonly deferredToolCalls: StreamDeferredToolCall[]; readonly streamedNativeCallNames: Map; readonly callIds: string[]; readonly onToken: (token: string) => void; readonly onStatus: (status: string) => void; readonly onStreamEvent: (event: ProviderStreamEvent) => void; readonly onToolCallDelta: (delta: { index: number; name?: string | undefined; argumentsBytes?: number | undefined; }) => void; readonly onSuccessfulRequest: (snapshot: SuccessfulRequestSnapshot) => void; readonly finishDeltaParser: () => void; readonly stopHeartbeat: () => void; } export declare const createStreamSession: (ports: StreamSessionPorts) => StreamSession;