/** * Applies AG-UI intents to the widget's message state. * * The split is deliberate: `@/dynamic-ui/agui` decides *what a frame means* (pure, tested), and * this decides *what that does to the conversation* (Solid signals, widget callbacks). Without * it, `createChatSubmit`'s already-large SSE handler would gain a second protocol inline and the * wire contract would only be reachable through a live stream. * * Everything it writes lands on the last assistant message, the same row the legacy path writes, * so a turn that falls back to the legacy wire mid-flight still renders coherently. */ import type { AguiIntent } from '@/dynamic-ui'; import type { MessageType } from '@/widget/types'; type AguiStreamDeps = { /** Creates the streaming assistant row if the turn has not produced one yet. */ ensureStreamMessage: () => void; flushText: () => void; updateLastBotMessage: (updater: (msg: MessageType) => MessageType, persist?: boolean) => void; updateMetadata: (data: any) => void; updateLastMessageSourceDocuments: (docs: any) => void; updateLastMessageArtifacts: (artifacts: any) => void; updateLastMessageFileAnnotations: (annotations: any) => void; updateLastMessageAgentReasoning: (reasoning: any) => void; updateAgentFlowEvent: (event: string) => void; updateAgentFlowExecutedData: (data: any) => void; updateLastMessageAction: (action: any) => void; onError: (message: string) => void; onFinished: () => void; }; export declare function createAguiStream(deps: AguiStreamDeps): { apply: (intent: AguiIntent) => { textDelta?: string; }; appendText: (delta: string) => void; finalize: (status?: 'done' | 'error') => void; isActive: () => boolean; }; export {};