import type { ChatMessageMetadata, ChatUiMessageChunk } from "./protocol.js"; /** Options accepted by hosted UI chunk mapping. */ export type HostedUiChunkMappingOptions = { messageId?: string | null; reasoningMessageId?: string | null; sendReasoning?: boolean; sendSources?: boolean; onError?: (error: unknown) => string; }; export type HostedStreamSourcePart = { type: "source"; id: string; sourceType: "url"; url: string; title?: string; } | { type: "source"; id: string; sourceType: "document"; mediaType: string; title?: string; filename?: string; }; /** Public API contract for hosted stream part for UI chunk mapping. */ export type HostedStreamPartForUiChunkMapping = { type: "start"; } | { type: "start-step"; } | { type: "finish-step"; } | { type: "finish"; finishReason?: string; } | { type: "abort"; } | { type: "reasoning-start"; id: string; } | { type: "reasoning-delta"; id: string; text: string; } | { type: "reasoning-end"; id: string; signature?: string; redactedData?: string; } | { type: "text-start"; id: string; } | { type: "text-delta"; id: string; text: string; } | { type: "text-end"; id: string; } | HostedStreamSourcePart | { type: "file"; file: { mediaType: string; base64: string; }; } | { type: "tool-input-start"; id: string; toolName: string; } | { type: "tool-input-delta"; id: string; delta: string; } | { type: "tool-call"; toolCallId: string; toolName: string; input: unknown; invalid: true; error: unknown; } | { type: "tool-call"; toolCallId: string; toolName: string; input: unknown; invalid?: false; } | { type: "tool-approval-request"; approvalId: string; toolCall: { toolCallId: string; }; } | { type: "tool-result"; toolCallId: string; toolName: string; input: unknown; output: unknown; } | { type: "tool-error"; toolCallId: string; toolName: string; input: unknown; error: unknown; } | { type: "tool-output-denied"; toolCallId: string; } | { type: "error"; error: unknown; } | { type: "tool-input-end"; } | { type: "raw"; }; /** Map hosted stream part to chat UI chunks. */ export declare function mapHostedStreamPartToChatUiChunks(part: HostedStreamPartForUiChunkMapping, options?: HostedUiChunkMappingOptions): ChatUiMessageChunk[]; //# sourceMappingURL=hosted-ui-chunk-mapping.d.ts.map