import type { AgentResponse } from "../types.js"; import type { AgUiSseEvent } from "./host-support.js"; import { type AgUiEncoderState } from "./encoder.js"; /** State for AG-UI response request. */ export interface AgUiResponseRequestState { runId?: string; threadId?: string; state?: unknown; messages: unknown[]; } /** Public API contract for AG-UI response execution. */ export interface AgUiResponseExecution { agentUIStream: AsyncIterable; fail: (error: unknown) => Promise; waitForFinish: () => Promise; } /** Public API contract for AG-UI response encoder. */ export interface AgUiResponseEncoder { encode: (chunk: TChunk) => AgUiSseEvent[]; finalize: (response: AgentResponse | null) => AgUiSseEvent[]; /** Shared timing anchor for bootstrap, chunk, and final events. */ timingState?: AgUiEncoderState; } /** Input payload for create AG-UI response stream. */ export interface CreateAgUiResponseStreamInput { agUiInput: AgUiResponseRequestState; agentId: string; execution: AgUiResponseExecution; encoder: AgUiResponseEncoder; initialState: TState; onChunk?: (state: TState, chunk: TChunk) => void; getFinalResponse?: (state: TState) => AgentResponse | null; } /** Create AG-UI response stream. */ export declare function createAgUiResponseStream(input: CreateAgUiResponseStreamInput): ReadableStream; //# sourceMappingURL=response-stream.d.ts.map