import type { ReasoningArtifact, TokenUsage } from "../types.js"; export type ProviderStreamEvent = { readonly type: "answer_delta"; readonly text: string; } | { readonly type: "commentary_delta"; readonly text: string; } | { readonly type: "reasoning_delta"; readonly text: string; } | { readonly type: "reasoning_artifact_available"; readonly artifacts: readonly ReasoningArtifact[]; } | { readonly type: "tool_call_started"; readonly index: number; readonly id?: string | undefined; readonly name: string; } | { readonly type: "tool_arguments_delta"; readonly index: number; readonly id?: string | undefined; readonly argumentsBytes: number; } | { readonly type: "tool_call_completed"; readonly index: number; readonly id?: string | undefined; readonly name: string; } | { readonly type: "usage_observed"; readonly usage: TokenUsage; } | { readonly type: "provider_terminal"; readonly finishReason?: string | undefined; }; export type ProviderStreamEventSink = (event: ProviderStreamEvent) => void; export declare function emitStreamReasoningDelta(sink: ProviderStreamEventSink | undefined, text: string): void; export declare function emitStreamReasoningArtifacts(sink: ProviderStreamEventSink | undefined, artifacts: readonly ReasoningArtifact[] | undefined): void; export declare function isSemanticStreamOutputEvent(event: ProviderStreamEvent): boolean; export declare class StreamEventProtocolError extends Error { constructor(message: string); } export interface StreamEventGuard { accept(event: ProviderStreamEvent): void; readonly terminal: boolean; } export declare function createStreamEventGuard(): StreamEventGuard;