import type { WidgetRegistry } from "./registry.js"; import type { WidgetLogger, WidgetPayload } from "./types.js"; /** * The plugin's single agent tool. The name is static — new widget types are * new `widget_type` enum values, never new tools — so it is declared once in * `openclaw.plugin.json` under `contracts.tools`. */ export declare const SHOW_WIDGET_TOOL_NAME = "show_widget"; export interface ShowWidgetToolResult { content: Array<{ type: "text"; text: string; }>; details: WidgetPayload; } export interface ShowWidgetTool { name: string; description: string; parameters: Record; execute(toolCallId: string, params: unknown): Promise; } export interface CreateShowWidgetToolOptions { registry: WidgetRegistry; logger?: WidgetLogger; /** Ephemeral session id from the plugin tool factory context; logged only. */ sessionId?: string; } /** * Tool description, generated from the enabled specs. Nothing else teaches the * model about these cards, so this text carries the condition that should make * it call the tool, not just the shape of the call. */ export declare function buildShowWidgetDescription(registry: WidgetRegistry): string; /** * Declared JSON schema: one flat object, no unions at any depth. * * OpenClaw flattens top-level unions, Gemini flattens nested ones, and OpenAI * strict mode rejects a schema containing one anywhere. `widget_type` is the * only parameter, and it is required. */ export declare function buildShowWidgetParameters(registry: WidgetRegistry): Record; /** * Build the `show_widget` tool for one agent turn. `sessionId` comes from the * plugin tool factory context and is used for logging only — nothing about the * result depends on it. */ export declare function createShowWidgetTool(options: CreateShowWidgetToolOptions): ShowWidgetTool; //# sourceMappingURL=tool.d.ts.map