import { ActionRegistry } from "./actionRegistry.js"; import { GenerativeUILibrary } from "./types.js"; import { ToolDefinition } from "@assistant-ui/react"; import { JSONSchema7 } from "json-schema"; //#region src/JSONGenerativeUI.shared.d.ts /** Options for {@link JSONGenerativeUI}. */ export type JSONGenerativeUIOptions = { /** * The components the model is allowed to render, keyed by the `$type` it * selects them with. Author it with `defineGenerativeComponents({ ... })` so a * `"use generative"` build can split each `render` from its `properties`. */ library: GenerativeUILibrary; /** * Host-provided map from `$action.type` to its handler. Interactive * components (`Button`/`Select`/`Input`/`DatePicker`) call `$dispatch($action)` * on their event, which resolves through this registry. Omit it for a * read-only render where model-emitted actions degrade to a no-op. */ actions?: ActionRegistry; }; /** Options for {@link JSONGenerativeUI.present}. */ export type PresentToolOptions = { /** * Set `"standalone"` to render the component on its own surface (outside the * chain-of-thought trace), e.g. a full-bleed artifact like a card. Omit it for * the default inline rendering — there is no `"inline"` value because that is * already the default. */ display?: "standalone"; }; type BackendDefaultMetadata = { unstable_backendDefault?: { parameters?: boolean; }; }; /** The `present` tool, as the model sees it (no client `render`/`execute`). */ export type PresentTool = ToolDefinition, Record> & BackendDefaultMetadata; /** The `prompt_user` tool, as the model sees it (no client `render`). */ export type PromptUserTool = ToolDefinition, unknown> & BackendDefaultMetadata; /** The tool `parameters` schema, built once per instance (see `buildPresentParameters`). */ export type PresentParameters = JSONSchema7; /** * The schema-only half of the `present` tool, shared by both builds. The server * build returns exactly this; the client build adds `execute` and `render`. * Takes the already-built `parameters` so it isn't recomputed per tool. */ export declare function presentToolBase(parameters: PresentParameters, options?: PresentToolOptions): { display?: "standalone"; type: "frontend"; description: string; parameters: JSONSchema7; }; /** * The schema-only half of the `prompt_user` tool, shared by both builds. The * server build returns exactly this; the client build adds `render`. */ export declare function promptUserToolBase(parameters: PresentParameters): { type: "human"; description: string; parameters: JSONSchema7; }; //#endregion //# sourceMappingURL=JSONGenerativeUI.shared.d.ts.map