import type { AgentsSession } from "../session/types.js"; import type { Widget, WidgetSpec } from "./schema.js"; /** List every widget visible to the session. */ export declare const listWidgets: (session: AgentsSession) => Promise; /** Find one widget by `id` or `name`. Returns `undefined` if not found. */ export declare const getWidget: (session: AgentsSession, idOrName: string) => Promise; export interface CreateWidgetInput { name: string; description?: string | null; spec: WidgetSpec; } /** Create a widget (`POST /api/widgets`). */ export declare const createWidget: (session: AgentsSession, input: CreateWidgetInput) => Promise; export interface UpdateWidgetInput extends CreateWidgetInput { /** Id of the widget to replace. */ id: string; } /** Update a widget (`PUT /api/widgets/{id}`, full-replacement). */ export declare const updateWidget: (session: AgentsSession, input: UpdateWidgetInput) => Promise; /** Delete a widget (`DELETE /api/widgets/{id}`). */ export declare const deleteWidget: (session: AgentsSession, id: string) => Promise; /** A JSON-Patch op emitted by `generateWidgetSpec`. */ export interface WidgetSpecPatch { op: string; path: string; value?: unknown; } /** * AI-assisted widget-spec generation (`POST /api/generate-spec`). Streams * newline-delimited JSON-Patch ops that progressively build a `WidgetSpec`. */ export declare function generateWidgetSpec(session: AgentsSession, prompt: string, currentSpec?: WidgetSpec): AsyncIterable;