import { ToolCall, ToolCanvas, ToolCanvasInline, AnyToolDefinition, ToolPresentation } from '../types/index.js'; export interface ForgeAiCanvasOpenRequestEventData { toolCallId: string; toolName: string; title?: string; /** Set to true by the host once the tool call is showing in the canvas. */ handled?: boolean; } export interface ForgeAiCanvasCloseRequestEventData { toolCallId: string; /** Set to true by the host once the canvas has closed. */ handled?: boolean; } declare global { interface HTMLElementEventMap { 'forge-ai-canvas-open-request': CustomEvent; 'forge-ai-canvas-close-request': CustomEvent; } } /** State a canvas host shares with the tool calls rendered in its thread. */ export interface ToolCanvasHostState { /** Presentation assigned to inline renderers of canvas-enabled tools. */ presentation: ToolPresentation; /** Tool call currently shown in the canvas, if any. */ openToolCallId?: string; } /** * Provided by hosts that render tool calls next to a canvas panel. Without a provider, inline * renderers get `inline`. */ export declare const toolCanvasHostContext: { __context__: ToolCanvasHostState; }; /** * Asks the nearest canvas host to show the given tool call. Hosts without a canvas leave the event * unhandled. Returns whether the tool call is now showing. */ export declare function requestCanvasOpen(target: EventTarget, detail: ForgeAiCanvasOpenRequestEventData): boolean; /** Asks the nearest canvas host to close the canvas if it is showing the given tool call. Returns whether it closed. */ export declare function requestCanvasClose(target: EventTarget, detail: ForgeAiCanvasCloseRequestEventData): boolean; export interface CreateToolCanvasConfig { available: boolean; /** Read live by `toggle()`; `isOpen` on the result is a snapshot taken when the controls are built. */ isOpen: () => boolean; open: (options?: { title?: string; }) => boolean; close: () => boolean; } /** Builds the `canvas` controls a host injects into a tool renderer. */ export declare function createToolCanvas({ available, isOpen, open, close }: CreateToolCanvasConfig): ToolCanvas; export declare function resolveToolCanvasTitle(toolCall: ToolCall, toolDefinition: AnyToolDefinition): string; export declare function resolveToolCanvasSubtitle(toolCall: ToolCall, toolDefinition: AnyToolDefinition): string | undefined; export declare function resolveToolCanvasActionLabel(toolCall: ToolCall, toolDefinition: AnyToolDefinition, active: boolean): string; /** * Resolves the artifact card icon to a fresh `` element, or undefined for the card's default glyph. * Markup strings are parsed and reduced to an allowlist of shape elements and presentation attributes. */ export declare function resolveToolCanvasIcon(toolCall: ToolCall, toolDefinition: AnyToolDefinition): SVGElement | undefined; export declare function resolveToolCanvasInline(toolDefinition: AnyToolDefinition): ToolCanvasInline;