@tylertech/forge-ai 0.15.3-dev.0 → 0.15.3-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/custom-elements.json +7733 -6803
  2. package/dist/ai-assistant-response/ai-assistant-response.d.ts +2 -2
  3. package/dist/ai-assistant-response/ai-assistant-response.mjs +4 -3
  4. package/dist/ai-canvas/ai-canvas.d.ts +43 -0
  5. package/dist/ai-canvas/ai-canvas.mjs +95 -0
  6. package/dist/ai-canvas/ai-canvas.scss.mjs +4 -0
  7. package/dist/ai-canvas/index.d.ts +1 -0
  8. package/dist/ai-canvas/index.mjs +5 -0
  9. package/dist/ai-chatbot/ag-ui-adapter.d.ts +2 -2
  10. package/dist/ai-chatbot/agent-adapter.d.ts +5 -5
  11. package/dist/ai-chatbot/agent-runner.d.ts +2 -2
  12. package/dist/ai-chatbot/ai-chatbot-base.d.ts +3 -2
  13. package/dist/ai-chatbot/ai-chatbot-base.mjs +11 -0
  14. package/dist/ai-chatbot/ai-chatbot-tool-call.d.ts +2 -2
  15. package/dist/ai-chatbot/ai-chatbot-tool-call.mjs +88 -10
  16. package/dist/ai-chatbot/ai-chatbot.d.ts +24 -1
  17. package/dist/ai-chatbot/ai-chatbot.mjs +102 -2
  18. package/dist/ai-chatbot/ai-chatbot.scss.mjs +1 -1
  19. package/dist/ai-chatbot/create-tool-renderer.d.ts +5 -5
  20. package/dist/ai-chatbot/index.d.ts +2 -1
  21. package/dist/ai-chatbot/index.mjs +3 -0
  22. package/dist/ai-chatbot/message-state-controller.d.ts +2 -2
  23. package/dist/ai-chatbot/message-state-controller.mjs +11 -11
  24. package/dist/ai-chatbot/tool-canvas.d.ts +60 -0
  25. package/dist/ai-chatbot/tool-canvas.mjs +128 -0
  26. package/dist/ai-chatbot/types.d.ts +128 -16
  27. package/dist/ai-chatbot/utils.d.ts +8 -3
  28. package/dist/ai-chatbot/utils.mjs +4 -0
  29. package/dist/ai-chatbot-launcher/ai-chatbot-launcher.d.ts +40 -2
  30. package/dist/ai-chatbot-launcher/ai-chatbot-launcher.mjs +224 -5
  31. package/dist/ai-chatbot-launcher/ai-chatbot-launcher.scss.mjs +1 -1
  32. package/dist/ai-embedded-chat/ai-embedded-chat.mjs +1 -0
  33. package/dist/ai-message-thread/ai-message-thread.d.ts +2 -2
  34. package/dist/ai-message-thread/ai-message-thread.mjs +3 -2
  35. package/dist/ai-tool-call-indicator/ai-tool-call-indicator.d.ts +2 -2
  36. package/dist/core/canvas-controller.d.ts +81 -0
  37. package/dist/core/canvas-controller.mjs +221 -0
  38. package/dist/core/chatbot-core-controller.d.ts +2 -2
  39. package/dist/core/chatbot-core-controller.mjs +44 -22
  40. package/dist/core/index.d.ts +2 -1
  41. package/dist/core/index.mjs +2 -0
  42. package/dist/core/resize-controller.d.ts +5 -0
  43. package/dist/core/resize-controller.mjs +7 -5
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.mjs +6 -0
  46. package/dist/tools/ai-data-table/ai-data-table-definition.mjs +1 -0
  47. package/dist/tools/ai-mcp-app/ai-mcp-app.d.ts +2 -1
  48. package/dist/tools/ai-mcp-app/ai-mcp-app.mjs +16 -1
  49. package/dist/tools/ai-mcp-app/ai-mcp-app.scss.mjs +1 -1
  50. package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.d.ts +3 -4
  51. package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.mjs +12 -21
  52. package/dist/tools/ai-mcp-app/mcp-app-bridge-types.d.ts +2 -1
  53. package/dist/tools/ai-steps/ai-steps-definition.mjs +1 -0
  54. package/package.json +1 -1
@@ -19,16 +19,107 @@ export interface ForgeAiSlashCommandMenuSelectEventData {
19
19
  command: SlashCommand;
20
20
  index: number;
21
21
  }
22
- export interface ToolRenderer {
22
+ /**
23
+ * Function of a tool call whose parameter stays bivariant, so a `ToolDefinition<MyArgs>` can be stored in a
24
+ * `ToolDefinition[]` alongside untyped tools without casts.
25
+ */
26
+ export type ToolCallMapper<TReturn, TArgs = Record<string, unknown>, TResult = unknown> = {
27
+ bivarianceHack(toolCall: ToolCall<TArgs, TResult>): TReturn;
28
+ }['bivarianceHack'];
29
+ /** A static value, or one derived from the tool call. */
30
+ export type ToolCallValue<TValue, TArgs = Record<string, unknown>, TResult = unknown> = TValue | ToolCallMapper<TValue, TArgs, TResult>;
31
+ /** Host-provided context passed to a tool renderer's `render` function. */
32
+ export interface ToolRenderContext {
33
+ presentation: ToolPresentation;
34
+ /** Controls captured when `render` runs; element renderers receive a reactive `canvas` property instead. */
35
+ canvas: ToolCanvas;
36
+ }
37
+ /**
38
+ * Bivariant like `ToolCallMapper`. `context` is optional so existing `render(toolCall)` implementations and
39
+ * callers keep compiling; hosts always pass it.
40
+ */
41
+ export type ToolRenderFunction<TArgs = Record<string, unknown>, TResult = unknown> = {
42
+ bivarianceHack(toolCall: ToolCall<TArgs, TResult>, context?: ToolRenderContext): HTMLElement | DocumentFragment;
43
+ }['bivarianceHack'];
44
+ export interface ToolRenderer<TArgs = any, TResult = any> {
23
45
  elementTag?: string;
24
- render?: (toolCall: ToolCall) => HTMLElement | DocumentFragment;
46
+ render?: ToolRenderFunction<TArgs, TResult>;
47
+ }
48
+ /**
49
+ * Where a tool renderer instance is displayed. Set by the host on the elements it creates.
50
+ * - `inline`: in the message thread with no canvas available
51
+ * - `inline-expandable`: in the message thread; a canvas is available and the renderer may request it
52
+ * - `canvas`: inside the canvas panel
53
+ */
54
+ export type ToolPresentation = 'inline' | 'inline-expandable' | 'canvas';
55
+ /** Artifact card icon: an `<svg>` element, or SVG markup reduced to static shape elements and attributes. */
56
+ export type ToolCanvasIcon = SVGElement | string;
57
+ /** Artifact card labels for each state; shown as the tooltip and read by assistive technology. */
58
+ export interface ToolCanvasActionLabel {
59
+ /** Label while the artifact is not in the canvas, e.g. "Open report". */
60
+ open: string;
61
+ /** Label while the artifact is in the canvas, e.g. "Collapse report". */
62
+ collapse: string;
63
+ }
64
+ /**
65
+ * Opts a tool into the canvas panel of hosts that provide one (e.g. `forge-ai-chatbot-launcher`).
66
+ * Hosts without a canvas ignore this and render the tool inline as usual. Every mapper receives the
67
+ * `ToolCall`, so values can come from the agent's `args` or the handler's `result`.
68
+ */
69
+ export interface ToolCanvasConfig<TArgs = Record<string, unknown>, TResult = unknown> {
70
+ /**
71
+ * When the canvas opens. `auto`: as soon as the tool call renders (launcher only; other hosts treat it as
72
+ * `on-request`). `on-request` (default): only when the renderer or artifact card asks for it.
73
+ */
74
+ open?: 'auto' | 'on-request';
75
+ /**
76
+ * What the thread shows for the tool call. `renderer`: the inline renderer. `card`: an artifact card that
77
+ * opens the canvas. `card-while-open`: the renderer, swapped for the card while this call is in the canvas.
78
+ * Defaults to `card` when `open` is `auto`, otherwise `renderer`.
79
+ */
80
+ inline?: ToolCanvasInline;
81
+ /** Renderer used inside the canvas. Defaults to the tool's `renderer`. */
82
+ renderer?: ToolRenderer<TArgs, TResult>;
83
+ /** Canvas and artifact card title. Defaults to `displayName`, then `name`. */
84
+ title?: ToolCallValue<string, TArgs, TResult>;
85
+ /** Artifact card subtitle, e.g. a row count. */
86
+ subtitle?: ToolCallValue<string, TArgs, TResult>;
87
+ /** Artifact card icon. Defaults to a generic artifact glyph. */
88
+ icon?: ToolCallValue<ToolCanvasIcon, TArgs, TResult>;
89
+ /** Artifact card action labels. Defaults to "Open in canvas" / "Collapse canvas". */
90
+ actionLabel?: ToolCallValue<ToolCanvasActionLabel, TArgs, TResult>;
91
+ }
92
+ export type ToolCanvasInline = 'renderer' | 'card' | 'card-while-open';
93
+ /**
94
+ * Canvas controls the host injects into a tool renderer as `canvas`. A new object is assigned whenever
95
+ * `available` or `isOpen` changes, so declaring `canvas` as a reactive property re-renders the renderer.
96
+ * Hosts without a canvas inject one with `available: false` whose methods return `false`.
97
+ */
98
+ export interface ToolCanvas {
99
+ /** Whether the host can show this tool call in a canvas. */
100
+ readonly available: boolean;
101
+ /** Whether this tool call is the one currently shown in the canvas. */
102
+ readonly isOpen: boolean;
103
+ /** Shows this tool call in the canvas. Returns false when unavailable or the host declined. */
104
+ open(options?: {
105
+ title?: string;
106
+ }): boolean;
107
+ /** Closes the canvas if it is showing this tool call. Returns false when it was not or the host declined. */
108
+ close(): boolean;
109
+ /** Closes the canvas when this tool call is open, otherwise opens it. */
110
+ toggle(): boolean;
25
111
  }
26
112
  /**
27
113
  * Interface that tool renderer components should implement for type-safe tool call handling.
28
114
  * @template TArgs - Type of the tool call arguments
115
+ * @template TResult - Type returned by the tool's handler
29
116
  */
30
- export interface IToolRenderer<TArgs = Record<string, unknown>> {
31
- toolCall: ToolCall<TArgs>;
117
+ export interface IToolRenderer<TArgs = Record<string, unknown>, TResult = unknown> {
118
+ toolCall: ToolCall<TArgs, TResult>;
119
+ /** Assigned by the host to tell the renderer where it is displayed. */
120
+ presentation?: ToolPresentation;
121
+ /** Assigned by the host to let the renderer open and close the canvas. */
122
+ canvas?: ToolCanvas;
32
123
  }
33
124
  /**
34
125
  * Context provided to tool handlers when they are invoked.
@@ -73,9 +164,10 @@ export interface ToolEndContext<TArgs = Record<string, unknown>> {
73
164
  export type ToolType = 'client' | 'agent';
74
165
  /**
75
166
  * Tool definition with optional type-safe handler.
76
- * @template TArgs - Type of the tool call arguments for type-safe handler context
167
+ * @template TArgs - Type of the tool call arguments, typed through the handler, renderer, and canvas mappers
168
+ * @template TResult - Type returned by `handler`, available as `toolCall.result`
77
169
  */
78
- export interface ToolDefinition<THandlerArgs = Record<string, unknown>> {
170
+ export interface ToolDefinition<TArgs = Record<string, unknown>, TResult = string | Record<string, unknown>> {
79
171
  name: string;
80
172
  displayName?: string;
81
173
  description?: string;
@@ -84,7 +176,11 @@ export interface ToolDefinition<THandlerArgs = Record<string, unknown>> {
84
176
  properties?: Record<string, unknown>;
85
177
  required?: string[];
86
178
  };
87
- /** Optional renderer for displaying tool call results within the chat UI. */
179
+ /**
180
+ * Optional renderer for displaying tool call results within the chat UI. Deliberately untyped (`any`
181
+ * arguments) so renderers written before `ToolDefinition` had a `TResult`, including `render` callbacks
182
+ * annotated with plain `ToolCall`, keep compiling on any `ToolDefinition<TArgs>`.
183
+ */
88
184
  renderer?: ToolRenderer;
89
185
  /** If true, renderer shows immediately on tool call start (default: false). */
90
186
  renderOnStart?: boolean;
@@ -97,17 +193,19 @@ export interface ToolDefinition<THandlerArgs = Record<string, unknown>> {
97
193
  mcpApp?: {
98
194
  resourceUri?: string;
99
195
  };
196
+ /** Canvas behavior for hosts that provide a canvas panel. Requires `renderer`. */
197
+ canvas?: ToolCanvasConfig<TArgs, TResult>;
100
198
  /** Called when tool call starts (before args stream). */
101
- onStart?: (context: ToolStartContext) => void;
199
+ onStart?(context: ToolStartContext): void;
102
200
  /** Called during streaming with partial args. */
103
- onDelta?: (context: ToolDeltaContext<THandlerArgs>) => void;
201
+ onDelta?(context: ToolDeltaContext<TArgs>): void;
104
202
  /** Called when args are complete (before handler execution). */
105
- onEnd?: (context: ToolEndContext<THandlerArgs>) => void;
203
+ onEnd?(context: ToolEndContext<TArgs>): void;
106
204
  /**
107
205
  * Optional handler function invoked when tool is called.
108
- * Can return a string, object, or void. Strings and objects are used directly as tool results.
206
+ * Strings and objects are used directly as the tool result; `void` yields a generic success message.
109
207
  */
110
- handler?: (context: HandlerContext<THandlerArgs>) => Promise<string | Record<string, unknown> | void> | string | Record<string, unknown> | void;
208
+ handler?(context: HandlerContext<TArgs>): Promise<TResult | void> | TResult | void;
111
209
  }
112
210
  /**
113
211
  * Content-Security-Policy domain allow-lists for an MCP-app resource, mirroring the
@@ -167,6 +265,8 @@ export interface McpAppUiResource {
167
265
  */
168
266
  prefersBorder?: boolean;
169
267
  }
268
+ /** Resolve state of an announced MCP-app UI resource that has not been stamped yet. */
269
+ export type McpAppUiResourceStatus = 'loading' | 'error';
170
270
  /** Display modes an MCP-app widget can be presented in (spec 2026-01-26). */
171
271
  export type McpAppDisplayMode = 'inline' | 'fullscreen' | 'pip';
172
272
  /**
@@ -279,6 +379,11 @@ export interface McpAppHostCapabilities {
279
379
  updateModelContext?: McpAppContentModalities;
280
380
  sandbox?: McpAppSandboxCapabilities;
281
381
  }
382
+ /**
383
+ * Type-erased tool definition for collections that mix tools with different argument types, e.g. the
384
+ * `tools` passed to an adapter. Any `ToolDefinition<TArgs, TResult>` is assignable to it.
385
+ */
386
+ export type AnyToolDefinition = ToolDefinition<object, any>;
282
387
  export interface ChatMessage {
283
388
  id: string;
284
389
  role: 'user' | 'assistant' | 'system' | 'tool';
@@ -316,23 +421,30 @@ export interface ClientMessageInput {
316
421
  header?: string;
317
422
  actions?: ClientMessageAction[];
318
423
  }
319
- export interface ToolCall<TArgs = Record<string, unknown>> {
424
+ export interface ToolCall<TArgs = Record<string, unknown>, TResult = unknown> {
320
425
  id: string;
321
426
  messageId: string;
322
427
  name: string;
323
428
  args: TArgs;
324
429
  argsBuffer?: string;
325
- result?: unknown;
430
+ /** Handler return value once the call completes; an `{ error }` object if the handler threw. */
431
+ result?: TResult;
326
432
  status: ToolCallStatus;
327
433
  type: ToolType;
328
434
  startTimestamp?: number;
329
435
  endTimestamp?: number;
330
436
  /**
331
437
  * The resolved MCP-app UI resource. When present, this tool call renders as a
332
- * sandboxed `<forge-ai-mcp-app>` widget instead of the standard tool-call UI. Its
333
- * presence is the single render discriminator.
438
+ * sandboxed `<forge-ai-mcp-app>` widget instead of the standard tool-call UI.
334
439
  */
335
440
  uiResource?: McpAppUiResource;
441
+ /**
442
+ * Set while an announced MCP-app UI resource has not resolved: `loading` while it is
443
+ * being fetched, `error` when the fetch failed. The tool call renders as a
444
+ * `<forge-ai-mcp-app>` placeholder (or error) in its final position meanwhile.
445
+ * Cleared once `uiResource` is stamped, or when the adapter resolves no resource.
446
+ */
447
+ uiResourceStatus?: McpAppUiResourceStatus;
336
448
  /** Companion structured payload for the widget, stripped from LLM context. */
337
449
  structuredContent?: unknown;
338
450
  /** `true` when `structuredContent` was dropped by the backend (size caps). */
@@ -1,16 +1,21 @@
1
- import { ChatMessage, ContextItem, FileAttachment, ToolCall, ToolDefinition } from './types.js';
1
+ import { ChatMessage, ContextItem, FileAttachment, ToolCall, AnyToolDefinition } from './types.js';
2
2
  export { renderMarkdown, renderInlineMarkdown, type RenderMarkdownOptions } from '../utils/markdown.js';
3
3
  /**
4
4
  * Whether a tool call's renderer should currently be shown: once the call is complete,
5
5
  * or immediately (while still parsing/executing) if the tool opted into `renderOnStart`.
6
6
  */
7
- export declare function shouldShowToolRenderer(toolCall: ToolCall, toolDefinition?: ToolDefinition): boolean;
7
+ export declare function shouldShowToolRenderer(toolCall: ToolCall, toolDefinition?: AnyToolDefinition): boolean;
8
8
  /**
9
9
  * Whether a tool call should be treated as settled for activity indicators (thinking
10
10
  * indicator, tool-call summary spinner): either genuinely finished, or already showing
11
11
  * its own renderer to the user, which makes a redundant "running" spinner misleading.
12
12
  */
13
- export declare function isToolCallSettled(toolCall: ToolCall, toolDefinition?: ToolDefinition): boolean;
13
+ export declare function isToolCallSettled(toolCall: ToolCall, toolDefinition?: AnyToolDefinition): boolean;
14
+ /**
15
+ * Whether a tool call renders as a `<forge-ai-mcp-app>` widget: its UI resource is resolved,
16
+ * or announced and still loading (or failed to load).
17
+ */
18
+ export declare function rendersAsMcpAppWidget(toolCall: ToolCall): boolean;
14
19
  /**
15
20
  * Generates a unique ID using UUID v4
16
21
  */
@@ -12,6 +12,9 @@ function shouldShowToolRenderer(toolCall, toolDefinition) {
12
12
  function isToolCallSettled(toolCall, toolDefinition) {
13
13
  return toolCall.status === "complete" || toolCall.status === "error" || toolCall.status === "cancelled" || shouldShowToolRenderer(toolCall, toolDefinition);
14
14
  }
15
+ function rendersAsMcpAppWidget(toolCall) {
16
+ return !!toolCall.uiResource || !!toolCall.uiResourceStatus;
17
+ }
15
18
  function generateId() {
16
19
  return v4();
17
20
  }
@@ -106,5 +109,6 @@ export {
106
109
  isToolCallSettled,
107
110
  renderInlineMarkdown,
108
111
  renderMarkdown,
112
+ rendersAsMcpAppWidget,
109
113
  shouldShowToolRenderer
110
114
  };
@@ -1,9 +1,10 @@
1
- import { TemplateResult, CSSResult } from 'lit';
1
+ import { PropertyValues, TemplateResult, CSSResult } from 'lit';
2
2
  import { AiMessageThreadComponent } from '../ai-message-thread';
3
3
  import { AiPromptComponent, ForgeAiPromptSendEventData } from '../ai-prompt';
4
4
  import { ForgeAiSuggestionsEventData } from '../ai-suggestions';
5
- import { AiChatbotBase } from '../ai-chatbot/ai-chatbot-base.js';
5
+ import { AiChatbotBase, FeatureToggle } from '../ai-chatbot/ai-chatbot-base.js';
6
6
  import { ChatMessage, ThreadState } from '../ai-chatbot/types.js';
7
+ import { CanvasOpenEventData, OpenCanvasOptions } from '../core/canvas-controller.js';
7
8
  import { Thread } from '../ai-threads/ai-threads';
8
9
  import { Ref } from 'lit/directives/ref.js';
9
10
  export type LauncherViewState = 'welcome' | 'conversation' | 'history';
@@ -32,6 +33,12 @@ export interface ForgeAiChatbotLauncherThreadLoadMoreEventData {
32
33
  query: string;
33
34
  appendResults: (results: Thread[]) => void;
34
35
  }
36
+ export type { OpenCanvasOptions };
37
+ export type ForgeAiChatbotLauncherCanvasOpenEventData = CanvasOpenEventData;
38
+ export interface ForgeAiChatbotLauncherCanvasResizeEventData {
39
+ /** Width of the conversation column in pixels; the canvas takes the remaining width. */
40
+ chatWidth: number;
41
+ }
35
42
  declare global {
36
43
  interface HTMLElementTagNameMap {
37
44
  'forge-ai-chatbot-launcher': AiChatbotLauncherComponent;
@@ -47,6 +54,9 @@ declare global {
47
54
  'forge-ai-chatbot-launcher-thread-load-more': CustomEvent<ForgeAiChatbotLauncherThreadLoadMoreEventData>;
48
55
  'forge-ai-chatbot-launcher-new-chat': CustomEvent<void>;
49
56
  'forge-ai-chatbot-launcher-thread-retry': CustomEvent<void>;
57
+ 'forge-ai-chatbot-launcher-canvas-open': CustomEvent<ForgeAiChatbotLauncherCanvasOpenEventData>;
58
+ 'forge-ai-chatbot-launcher-canvas-close': CustomEvent<void>;
59
+ 'forge-ai-chatbot-launcher-canvas-resize': CustomEvent<ForgeAiChatbotLauncherCanvasResizeEventData>;
50
60
  }
51
61
  }
52
62
  export declare const AiChatbotLauncherComponentTagName: keyof HTMLElementTagNameMap;
@@ -60,10 +70,16 @@ export declare const AiChatbotLauncherComponentTagName: keyof HTMLElementTagName
60
70
  * that animates into a full conversation interface when the user sends their first message.
61
71
  * In conversation mode, a header is displayed with options for clear, export, and agent selection.
62
72
  *
73
+ * In conversation mode an artifact canvas can open beside the thread via `openCanvas()`, a tool definition's
74
+ * `canvas` config, or a renderer's `forge-ai-canvas-open-request`. The conversation narrows to a sidebar-style
75
+ * column and the canvas takes the remaining width. The canvas closes whenever the conversation view is left.
76
+ *
63
77
  * @slot icon - Slot for custom icon (used in both welcome view and conversation header)
64
78
  * @slot heading - Slot for custom heading content (welcome view only)
65
79
  * @slot description - Slot for custom description/welcome message below the title (welcome view only)
66
80
  * @slot header-actions - Slot for custom header action buttons in conversation mode (rendered before built-in header actions)
81
+ * @slot canvas - Content shown in the canvas when `openCanvas()` is called without `content`
82
+ * @slot canvas-actions - Action buttons rendered in the canvas header before the close button
67
83
  *
68
84
  * @property {string} titleText - The title text to display in the welcome view and header (default: 'AI Assistant')
69
85
  * @property {string} descriptionText - The description text displayed below the title in the welcome view.
@@ -81,6 +97,9 @@ export declare const AiChatbotLauncherComponentTagName: keyof HTMLElementTagName
81
97
  * @property {boolean} threadsLoading - Whether chats are currently loading, used to show a spinner on the history button and disable it
82
98
  * @property {string | undefined} threadsError - Message describing a failed chat history load. When set, the history popover/view shows the message with a retry button instead of the empty state, and the history button shows an error badge so the failure is visible with the popover closed. If chats are already loaded the list stays visible and the message renders as a compact single line with a retry - at the bottom of the list when a page was in flight, otherwise above it. Clear it once a load succeeds.
83
99
  * @property {string | null} selectedThreadId - The id of the currently selected thread, highlighted in the history popover/view. Updated internally when a thread is selected or a new chat starts.
100
+ * @property {string} canvasTitle - Default title for the canvas header, used when the open request does not supply one
101
+ * @property {FeatureToggle} canvasResizable - Controls the drag handle between the conversation and the canvas. `'on'` (default) lets users resize with a pointer or the arrow keys; `'off'` hides it, so the conversation stays at `chatWidth`.
102
+ * @property {number} chatWidth - Width in pixels of the conversation column while the canvas is open (default: 420). Updated as the user resizes, clamped to at least 360px and to leave the canvas at least 320px when there is room. Resized widths are persisted per tab in sessionStorage and shared across tabs via localStorage; on load the session value is preferred, then the local value, then the default.
84
103
  *
85
104
  * @cssproperty --forge-ai-chatbot-launcher-icon-color - The fill color for the AI icon.
86
105
  *
@@ -102,6 +121,9 @@ export declare const AiChatbotLauncherComponentTagName: keyof HTMLElementTagName
102
121
  * @event {CustomEvent<ForgeAiChatbotLauncherThreadLoadMoreEventData>} forge-ai-chatbot-launcher-thread-load-more - Fired when scrolling near the bottom of the history list for pagination. Call appendResults() with the next page (empty array signals no more results)
103
122
  * @event {CustomEvent<void>} forge-ai-chatbot-launcher-new-chat - Fired when "New chat" is clicked from the full history view. Cancelable - prevents startNewChat() from being called
104
123
  * @event {CustomEvent<void>} forge-ai-chatbot-launcher-thread-retry - Fired when the retry button in the history error state is clicked. Re-request the chats and clear threadsError once the load succeeds
124
+ * @event {CustomEvent<ForgeAiChatbotLauncherCanvasOpenEventData>} forge-ai-chatbot-launcher-canvas-open - Fired before the canvas opens or replaces its content. Cancelable - prevents the canvas from opening
125
+ * @event {CustomEvent<ForgeAiChatbotLauncherCanvasResizeEventData>} forge-ai-chatbot-launcher-canvas-resize - Fired when a resize is committed via pointer release or keyboard step. Detail has the new `chatWidth`
126
+ * @event {CustomEvent<void>} forge-ai-chatbot-launcher-canvas-close - Fired when the canvas closes. Cancelable only for user or `closeCanvas()` initiated closes; closes caused by leaving the conversation view cannot be prevented
105
127
  */
106
128
  export declare class AiChatbotLauncherComponent extends AiChatbotBase {
107
129
  #private;
@@ -117,7 +139,11 @@ export declare class AiChatbotLauncherComponent extends AiChatbotBase {
117
139
  threadsLoading: boolean;
118
140
  threadsError?: string;
119
141
  selectedThreadId: string | null;
142
+ canvasTitle?: string;
143
+ canvasResizable: FeatureToggle;
144
+ chatWidth: number;
120
145
  private _viewState;
146
+ private _isResizing;
121
147
  private _skipAnimation;
122
148
  private _editingThreadId;
123
149
  private _historyPopoverOpen;
@@ -125,6 +151,8 @@ export declare class AiChatbotLauncherComponent extends AiChatbotBase {
125
151
  protected _promptRef: Ref<AiPromptComponent>;
126
152
  constructor();
127
153
  protected _onConnected(): void;
154
+ willUpdate(changedProperties: PropertyValues<this>): void;
155
+ updated(changedProperties: PropertyValues<this>): void;
128
156
  startConversation(): void;
129
157
  /**
130
158
  * Returns to the welcome view without touching conversation state. Unlike `startNewChat()`, this
@@ -147,6 +175,16 @@ export declare class AiChatbotLauncherComponent extends AiChatbotBase {
147
175
  skipAnimation?: boolean;
148
176
  }): Promise<void>;
149
177
  get viewState(): LauncherViewState;
178
+ get canvasOpen(): boolean;
179
+ /**
180
+ * Opens the canvas beside the conversation, or swaps its content if already open. Only available in the
181
+ * conversation view; returns false elsewhere or when the open event is prevented.
182
+ */
183
+ openCanvas(options?: OpenCanvasOptions): boolean;
184
+ /**
185
+ * Closes the canvas. Returns false if it was not open or the close event was prevented.
186
+ */
187
+ closeCanvas(): boolean;
150
188
  focus(): void;
151
189
  render(): TemplateResult;
152
190
  }