/** * The standalone agent's conversation, in a page — one `agentHandler()` mount, * stock `useChat`, nothing of its own kept in the browser. * * It is `useVendoThread`'s thinner sibling: no provider, no client, no embed * chrome, no situation channel — just the transport, the thread id round-trip, * and the two things a host has to render for an agent that asks permission. * * NOTHING IS STORED HERE. The conversation's id round-trips on the response * header and is handed back through `onThreadId` for the host to keep wherever * it already keeps route state; the transcript — pending approvals included — * is read back from the server, which is what makes `interruptions` survive a * reload without this hook owning a byte of browser storage. */ import type { Decisions, Interruption } from "../core/index.js"; import { type UIMessage } from "ai"; export interface UseVendoChatOptions { /** Where `agentHandler()` is mounted — `"/api/agent"`. */ api: string; /** Reopen this conversation; omit for a new one. */ threadId?: string; /** The id the server minted, the moment it lands. Keep it where your app * already keeps route state — this hook keeps nothing. */ onThreadId?: (threadId: string) => void; } export declare function useVendoChat({ api, threadId, onThreadId }: UseVendoChatOptions): { threadId: string | undefined; messages: UIMessage[]; sendMessage: (message?: (Omit, "id" | "role"> & { id?: string | undefined; role?: "user" | "system" | "assistant" | undefined; } & { text?: never; files?: never; messageId?: string; }) | { text: string; files?: FileList | import("ai").FileUIPart[]; metadata?: unknown; parts?: never; messageId?: string; } | { files: FileList | import("ai").FileUIPart[]; metadata?: unknown; parts?: never; messageId?: string; } | undefined, options?: import("ai").ChatRequestOptions) => Promise; status: import("ai").ChatStatus; error: Error | undefined; /** Pending, and durable across a reload — read back from the server. */ interruptions: Interruption[]; resume: (decisions: Decisions) => Promise; stop: () => Promise; };