import type { ChatMessageMetadata, ChatUiMessageChunk } from "../../chat/protocol.js"; import type { AgUiChunkEncoder } from "./chunk-encoder.js"; import { type AgUiEncoderStateOptions, type AgUiRunFinishedMetadata, type AgUiRuntimeStreamEvent } from "./encoder.js"; import { type CreateAgUiTrackedResponseInput } from "./tracked-response.js"; /** Public API contract for AG-UI chat UI chunk encoder. */ export type AgUiChatUiChunkEncoder = Pick>, "encode" | "finalize" | "timingState">; /** Options accepted by create AG-UI chat UI chunk encoder. */ export interface CreateAgUiChatUiChunkEncoderOptions { /** * Timing clocks forwarded verbatim to the encoder state. A single object so * that adding a clock is one edit in `AgUiEncoderStateOptions`, not a * sweep through every wrapper that happens to sit in between. */ timing?: AgUiEncoderStateOptions; modelId?: string; resolveProvider?: (modelId: string) => string | undefined; } /** Input payload for create AG-UI chat UI tracked response. */ export interface CreateAgUiChatUiTrackedResponseInput extends Omit>, "chunkEncoder" | "finalizeTracker"> { modelId: string; resolveProvider?: CreateAgUiChatUiChunkEncoderOptions["resolveProvider"]; } /** Return AG-UI chat UI message metadata from chunk. */ export declare function getAgUiChatUiMessageMetadataFromChunk(chunk: ChatUiMessageChunk): ChatMessageMetadata | undefined; /** Return AG-UI chat UI message usage metadata. */ export declare function getAgUiChatUiMessageUsageMetadata(messageMetadata: ChatMessageMetadata | undefined): Pick; /** Return AG-UI chat UI message chunk metadata. */ export declare function getAgUiChatUiMessageChunkMetadata(chunk: ChatUiMessageChunk, options?: Pick): Partial | null; /** Event emitted for normalize chat UI message chunk to AG-UI runtime. */ export declare function normalizeChatUiMessageChunkToAgUiRuntimeEvent(chunk: ChatUiMessageChunk): AgUiRuntimeStreamEvent; /** Create AG-UI chat UI chunk encoder. */ export declare function createAgUiChatUiChunkEncoder(options?: CreateAgUiChatUiChunkEncoderOptions): AgUiChatUiChunkEncoder; /** Response payload for create AG-UI chat UI tracked response. */ export declare function createAgUiChatUiTrackedResponse(input: CreateAgUiChatUiTrackedResponseInput): Response; //# sourceMappingURL=chat-ui-chunk-encoder.d.ts.map