import type { InitialQueryResults } from './types.js'; /** Local data tool names to register with the renderer and declare to the prompt library. */ export declare const OPENUI_DATA_TOOL_NAMES: readonly ["openui_query", "openui_mutation"]; /** A scoped request to initialize defaults, read a Query, or apply a Mutation through the host. */ export interface QueryDataToolRequest { /** Local data operation; initialize registers defaults without persisting them. */ operation: 'initialize' | 'query' | 'mutation'; /** Host-defined identity selected with setScope. */ scope: string; /** Tool arguments, or a defaults map under the defaults key for initialize. */ args: Record; } /** Host access and initialization timing for local Query tools. */ export interface QueryDataToolsOptions { /** * Execute a scoped request, resolving to its value or rejecting on failure. * Initialize resolves when the host can serve the supplied defaults; its result is ignored. * The host owns transport timeouts and must honor each request's scope. */ call: (request: QueryDataToolRequest) => Promise; /** * Maximum milliseconds each tool call waits for defaults and host initialization; must be finite and nonnegative. * @defaultValue 5000 */ initializationTimeoutMs?: number; } /** Renderer tools and lifecycle controls for host-backed local Query data. */ export interface QueryDataTools { /** Select a data scope, resetting defaults and rejecting pending calls when the scope changes. */ setScope(scope: string): void; /** Merge completed defaults for the current scope and initialize the host; other scopes and unchanged maps are ignored. */ publishDefaults(scope: string, defaults: InitialQueryResults): void; /** Reset the scope and reject pending calls; setScope can start another lifecycle. Already dispatched host work is not aborted. */ dispose(): void; /** Registered local tools; spread into the renderer's toolProvider. */ tools: Record) => Promise>; } /** * Coordinate local Query tools with host initialization and scope changes without depending on a renderer or transport. * @example * ```ts * const dataTools = createQueryDataTools({ call: request => host.execute(request) }); * dataTools.setScope('document-123'); * dataTools.publishDefaults('document-123', getQueryDefaults(parsed, { source })); * const toolProvider = { ...dataTools.tools }; * // On unmount: * dataTools.dispose(); * ``` */ export declare function createQueryDataTools(options: QueryDataToolsOptions): QueryDataTools;