import { type AgUiEncoderStateOptions } from "./encoder.js"; import type { AgUiEncodedEvent, AgUiEncoderState, AgUiRunFinishedMetadata, AgUiRuntimeStreamEvent } from "./encoder.js"; import type { AgentResponse } from "../types.js"; /** Public API contract for AG-UI chunk encoder. */ export interface AgUiChunkEncoder { state: AgUiEncoderState; /** Optional timing anchor consumed by the response composition root. */ timingState?: AgUiEncoderState; encode: (chunk: TChunk) => AgUiEncodedEvent[]; finalize: (response: AgentResponse | null) => AgUiEncodedEvent[]; } /** Options accepted by create AG-UI chunk encoder. */ export interface CreateAgUiChunkEncoderOptions { /** * 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; getRuntimeEvents: (chunk: TChunk) => readonly AgUiRuntimeStreamEvent[]; getMetadataFromChunk?: (chunk: TChunk) => Partial | null | undefined; initialMetadata?: Partial; } /** Create AG-UI chunk encoder. */ export declare function createAgUiChunkEncoder(options: CreateAgUiChunkEncoderOptions): AgUiChunkEncoder; //# sourceMappingURL=chunk-encoder.d.ts.map