import { type PartialJson } from "./partial-json.js"; /** * `streaming`: arguments are still arriving. `done`: the tool finished and * its real output is on its way to the UI. `failed`: the tool errored, so the * preview is not a result and must not be presented as one. */ export type StreamingToolInputStatus = "streaming" | "done" | "failed"; export interface StreamingToolInput { callId: string | null; /** Stable for the call's lifetime, including calls that stream without an id. */ key: string; tool: string; status: StreamingToolInputStatus; value: T; } export interface UseStreamingToolInputOptions { /** Tool names to follow. */ tools: readonly string[]; enabled: boolean; /** * What the preview belongs to, such as a deck id plus its slide count. * Changing it drops the preview and ignores calls that started before. */ scope: string; /** * Whether a call is for this scope: `true`, `false`, or `undefined` while * the deciding argument is still streaming. A `false` call is ignored to * the end. */ matches?: (input: PartialJson, tool: string) => boolean | undefined; /** The preview value from the arguments so far, or `null` for nothing yet. */ select: (input: PartialJson, tool: string) => T | null; } /** * Follows the agent's tool arguments as they stream, for previewing what a * tool is about to write. Parsing runs at most once per animation frame. * Follows the newest call; see `useStreamingToolInputs` for every call. */ export declare function useStreamingToolInput(options: UseStreamingToolInputOptions): StreamingToolInput | null; /** * Every call in the scope, in the order the agent started them, so a model * that writes several items in one response previews each one. */ export declare function useStreamingToolInputs(options: UseStreamingToolInputOptions): StreamingToolInput[];