export type TtsAudioPayload = { data: string; contentType: string; }; export type SseEvent = { type: 'start'; chatId?: string; messageId?: string; data?: unknown; } | { type: 'token'; data: string; } | { type: 'sourceDocuments'; data: unknown[]; } | { type: 'artifacts'; data: unknown[]; } | { type: 'usedTools'; data: unknown[]; } | { type: 'calledTools'; data: unknown[]; } | { type: 'fileAnnotations'; data: unknown[]; } | { type: 'agentReasoning'; data: unknown; } | { type: 'agentFlowEvent'; data: string; } | { type: 'agentFlowExecutedData'; data: unknown; } | { type: 'metadata'; data: unknown; } | { type: 'action'; data: unknown; } | { type: 'error'; data: unknown; } | { type: 'abort'; data?: unknown; } | { type: 'ttsAudio'; data: TtsAudioPayload; } | { type: 'end'; data: unknown; } /** * A frame in a protocol this parser does not own — currently AG-UI, which Core streams * when the caller asks for it via `streamProtocol`. The parser recognises these * structurally (see `isPassthroughFrame`) and hands them over verbatim on `onEvent` * rather than guessing at token text, which would drop every non-text frame. */ | { type: 'aguiFrame'; data: unknown; } | { type: string; data: unknown; }; /** Set of event names treated as token-bearing on the wire. */ export declare const TOKEN_EVENT_NAMES: Set; /** Set of event names that terminate the stream successfully. */ export declare const END_EVENT_NAMES: Set; export type StreamCallbacks = { onStart?: (e: { chatId?: string; messageId?: string; data?: unknown; }) => void; onToken?: (token: string) => void; onSourceDocuments?: (docs: unknown[]) => void; onArtifacts?: (artifacts: unknown[]) => void; onUsedTools?: (tools: unknown[]) => void; onCalledTools?: (calls: unknown[]) => void; onFileAnnotations?: (files: unknown[]) => void; onAgentReasoning?: (reasoning: unknown) => void; onAgentFlowEvent?: (eventName: string) => void; onAgentFlowExecutedData?: (data: unknown) => void; onMetadata?: (data: unknown) => void; onAction?: (action: unknown) => void; onTtsAudio?: (audio: TtsAudioPayload) => void; onDone?: (final: { chatId?: string; messageId?: string; }) => void; onError?: (err: import('../errors/toruk-sdk-error').TorukSdkError) => void; onEvent?: (event: SseEvent) => void; };