@runtypelabs/persona 3.17.0 → 3.19.0

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 (61) hide show
  1. package/README.md +143 -1
  2. package/dist/animations/glyph-cycle.d.cts +1 -1
  3. package/dist/animations/glyph-cycle.d.ts +1 -1
  4. package/dist/animations/{types-HPZY7oAI.d.cts → types-cwY5HaFD.d.cts} +25 -0
  5. package/dist/animations/{types-HPZY7oAI.d.ts → types-cwY5HaFD.d.ts} +25 -0
  6. package/dist/animations/wipe.d.cts +1 -1
  7. package/dist/animations/wipe.d.ts +1 -1
  8. package/dist/index.cjs +47 -47
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +580 -4
  11. package/dist/index.d.ts +580 -4
  12. package/dist/index.global.js +102 -1636
  13. package/dist/index.global.js.map +1 -1
  14. package/dist/index.js +45 -45
  15. package/dist/index.js.map +1 -1
  16. package/dist/theme-editor.cjs +2844 -752
  17. package/dist/theme-editor.d.cts +337 -1
  18. package/dist/theme-editor.d.ts +337 -1
  19. package/dist/theme-editor.js +2958 -752
  20. package/dist/theme-reference.cjs +1 -1
  21. package/dist/theme-reference.d.cts +14 -0
  22. package/dist/theme-reference.d.ts +14 -0
  23. package/dist/widget.css +780 -0
  24. package/package.json +1 -1
  25. package/src/client.test.ts +134 -0
  26. package/src/client.ts +71 -0
  27. package/src/components/ask-user-question-bubble.test.ts +583 -0
  28. package/src/components/ask-user-question-bubble.ts +924 -0
  29. package/src/components/composer-builder.test.ts +52 -0
  30. package/src/components/composer-builder.ts +67 -490
  31. package/src/components/composer-parts.test.ts +152 -0
  32. package/src/components/composer-parts.ts +452 -0
  33. package/src/components/header-builder.ts +22 -299
  34. package/src/components/header-parts.ts +360 -0
  35. package/src/components/messages.ts +33 -1
  36. package/src/components/panel.test.ts +61 -0
  37. package/src/components/panel.ts +303 -9
  38. package/src/components/pill-composer-builder.test.ts +85 -0
  39. package/src/components/pill-composer-builder.ts +183 -0
  40. package/src/defaults.ts +21 -0
  41. package/src/index.ts +20 -1
  42. package/src/plugins/types.ts +57 -0
  43. package/src/runtime/init.ts +4 -2
  44. package/src/runtime/persist-state.test.ts +152 -0
  45. package/src/session.test.ts +183 -0
  46. package/src/session.ts +242 -3
  47. package/src/styles/widget.css +780 -0
  48. package/src/types/theme.ts +15 -0
  49. package/src/types.ts +271 -1
  50. package/src/ui.ask-user-question-plugin.test.ts +649 -0
  51. package/src/ui.component-directive.test.ts +183 -0
  52. package/src/ui.composer-bar.test.ts +1009 -0
  53. package/src/ui.ts +1439 -76
  54. package/src/utils/attachment-manager.ts +1 -1
  55. package/src/utils/dock.test.ts +45 -0
  56. package/src/utils/dock.ts +3 -0
  57. package/src/utils/icons.ts +314 -58
  58. package/src/utils/storage.ts +10 -2
  59. package/src/utils/stream-animation.ts +7 -2
  60. package/src/utils/theme.test.ts +36 -0
  61. package/src/utils/tokens.ts +23 -0
package/dist/index.d.cts CHANGED
@@ -1,3 +1,5 @@
1
+ import { IconNode } from 'lucide';
2
+
1
3
  /**
2
4
  * Plugin interface for customizing widget components
3
5
  */
@@ -91,6 +93,61 @@ interface AgentWidgetPlugin {
91
93
  defaultRenderer: () => HTMLElement;
92
94
  config: AgentWidgetConfig;
93
95
  }) => HTMLElement | null;
96
+ /**
97
+ * Custom renderer for `ask_user_question` tool calls.
98
+ *
99
+ * When a plugin returns an `HTMLElement`, it is inserted into the transcript
100
+ * in place of the default (which is no transcript bubble — the built-in
101
+ * renders a sheet over the composer). The built-in composer-overlay sheet
102
+ * is suppressed so the plugin's UI fully owns the interaction.
103
+ *
104
+ * Return `null` to fall through to the built-in overlay sheet.
105
+ *
106
+ * The context gives you a pre-parsed `payload` (may be partial while the
107
+ * tool call is still streaming — check `complete`) and two callbacks:
108
+ * `resolve(answer)` resumes the paused LOCAL tool with the user's answer,
109
+ * and `dismiss()` cancels with the sentinel `"(dismissed)"`.
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * renderAskUserQuestion: ({ payload, resolve, dismiss }) => {
114
+ * const prompt = payload.questions?.[0];
115
+ * if (!prompt) return null;
116
+ * const root = document.createElement("div");
117
+ * root.textContent = prompt.question ?? "";
118
+ * (prompt.options ?? []).forEach((option) => {
119
+ * const btn = document.createElement("button");
120
+ * btn.textContent = option.label;
121
+ * btn.addEventListener("click", () => resolve(option.label));
122
+ * root.appendChild(btn);
123
+ * });
124
+ * return root;
125
+ * }
126
+ * ```
127
+ */
128
+ renderAskUserQuestion?: (context: {
129
+ message: AgentWidgetMessage;
130
+ /**
131
+ * Parsed `{ questions: [...] }` payload. May be partial while the tool
132
+ * call is still streaming; see `complete`. `null` when no payload has
133
+ * arrived yet.
134
+ */
135
+ payload: Partial<AskUserQuestionPayload> | null;
136
+ /** `true` once the tool-call args have fully streamed in. */
137
+ complete: boolean;
138
+ /**
139
+ * Resume the paused LOCAL tool with the user's answer. Posts to the
140
+ * resume endpoint, pipes the SSE stream back into the session, and
141
+ * appends a user-visible answer bubble to the transcript.
142
+ */
143
+ resolve: (answer: string) => void;
144
+ /**
145
+ * Cancel the question. Resumes with the sentinel `"(dismissed)"` so the
146
+ * server doesn't sit in `waiting_for_local` forever. Idempotent.
147
+ */
148
+ dismiss: () => void;
149
+ config: AgentWidgetConfig;
150
+ }) => HTMLElement | null;
94
151
  /**
95
152
  * Custom renderer for approval bubbles
96
153
  * Return null to use default renderer
@@ -384,6 +441,18 @@ interface MessageTokens {
384
441
  /** Border color between messages in the thread. */
385
442
  border?: TokenReference<'color'>;
386
443
  }
444
+ /**
445
+ * Welcome / intro card rendered above the message list when no messages exist.
446
+ * Set `copy.showWelcomeCard: false` to hide it; use `layout.slots["body-top"]`
447
+ * to replace it wholesale.
448
+ */
449
+ interface IntroCardTokens extends ComponentTokenSet {
450
+ background?: TokenReference<'color'>;
451
+ borderRadius?: TokenReference<'radius'>;
452
+ padding?: TokenReference<'spacing'>;
453
+ /** Box-shadow on the intro card (token ref or raw CSS, e.g. `none`). */
454
+ shadow?: string;
455
+ }
387
456
  /** Collapsible widget chrome (tool bubbles, reasoning bubbles, approval bubbles). */
388
457
  interface CollapsibleWidgetTokens {
389
458
  /** Background for content areas. */
@@ -581,6 +650,8 @@ interface ComponentTokens {
581
650
  panel: PanelTokens;
582
651
  header: HeaderTokens;
583
652
  message: MessageTokens;
653
+ /** Welcome / intro card shown above the message list. */
654
+ introCard?: IntroCardTokens;
584
655
  /** Markdown surfaces (chat + artifact pane). */
585
656
  markdown?: MarkdownTokens;
586
657
  voice: VoiceTokens;
@@ -829,6 +900,31 @@ type AgentMessageMetadata = {
829
900
  * or `prompt` step inside the nested flow). Stable key for that step.
830
901
  */
831
902
  parentStepId?: string;
903
+ /**
904
+ * Set to `true` on a tool-variant message produced from a `step_await`
905
+ * event (`awaitReason: "local_tool_required"`). Signals to UI code that
906
+ * the tool call is a LOCAL tool and the server is paused waiting for a
907
+ * `POST /v1/dispatch/resume` with the user's answer keyed by tool name.
908
+ */
909
+ awaitingLocalTool?: boolean;
910
+ /**
911
+ * Set to `true` once the user has picked / typed / dismissed an answer for
912
+ * an `ask_user_question` tool call, so renderers stop re-mounting the
913
+ * answer-pill sheet for this tool call on subsequent render passes.
914
+ */
915
+ askUserQuestionAnswered?: boolean;
916
+ /**
917
+ * In-progress answers for a multi-question `ask_user_question` payload,
918
+ * keyed by question text. Persisted across refresh so the user lands back
919
+ * where they were if the page reloads mid-flow. Cleared once
920
+ * `askUserQuestionAnswered` flips to `true`.
921
+ */
922
+ askUserQuestionAnswers?: Record<string, string | string[]>;
923
+ /**
924
+ * Current page index for a multi-question `ask_user_question` payload's
925
+ * paginated stepper. Persists alongside `askUserQuestionAnswers`.
926
+ */
927
+ askUserQuestionIndex?: number;
832
928
  };
833
929
  type AgentWidgetRequestMiddlewareContext = {
834
930
  payload: AgentWidgetRequestPayload;
@@ -876,6 +972,8 @@ type AgentWidgetActionHandler = (action: AgentWidgetParsedAction, context: Agent
876
972
  type AgentWidgetStoredState = {
877
973
  messages?: AgentWidgetMessage[];
878
974
  metadata?: Record<string, unknown>;
975
+ artifacts?: PersonaArtifactRecord[];
976
+ selectedArtifactId?: string | null;
879
977
  };
880
978
  interface AgentWidgetStorageAdapter {
881
979
  load?: () => AgentWidgetStoredState | null | Promise<AgentWidgetStoredState | null>;
@@ -1433,6 +1531,113 @@ type AgentWidgetFeatureFlags = {
1433
1531
  artifacts?: AgentWidgetArtifactsFeature;
1434
1532
  /** Reveal animation for streaming assistant text. */
1435
1533
  streamAnimation?: AgentWidgetStreamAnimationFeature;
1534
+ /**
1535
+ * Built-in interactive answer-pill sheet shown when the assistant invokes
1536
+ * the `ask_user_question` tool. Slides up over the composer with tappable
1537
+ * pills + optional free-text input.
1538
+ */
1539
+ askUserQuestion?: AgentWidgetAskUserQuestionFeature;
1540
+ };
1541
+ /**
1542
+ * Single selectable option in an `ask_user_question` prompt.
1543
+ * Mirrors Anthropic's AskUserQuestion schema.
1544
+ */
1545
+ type AskUserQuestionOption = {
1546
+ /** Pill label (required). */
1547
+ label: string;
1548
+ /** Optional long-form description (shown as a subtitle on tap-hover). */
1549
+ description?: string;
1550
+ /** Optional rich preview — reserved for future rendering; ignored in v1. */
1551
+ preview?: string;
1552
+ };
1553
+ /**
1554
+ * A single question in an `ask_user_question` tool call.
1555
+ * The tool may carry 1–8 prompts. When more than one is supplied, the built-in
1556
+ * renderer paginates them as a "Question N of M" stepper with Back / Next /
1557
+ * Submit-all controls; single-question payloads render without stepper chrome.
1558
+ */
1559
+ type AskUserQuestionPrompt = {
1560
+ /** The question text shown to the user. */
1561
+ question: string;
1562
+ /** Optional short header label (≤12 chars) used as a compact group title. */
1563
+ header?: string;
1564
+ /** 2–4 selectable options. */
1565
+ options: AskUserQuestionOption[];
1566
+ /** When true, the user can pick multiple options and submit together. Default false. */
1567
+ multiSelect?: boolean;
1568
+ /** When true, a free-text "Other…" pill expands to an input. Default true. */
1569
+ allowFreeText?: boolean;
1570
+ };
1571
+ /** Parsed payload of an `ask_user_question` tool call. */
1572
+ type AskUserQuestionPayload = {
1573
+ /** 1–8 questions. Anything beyond the renderer's cap is truncated with a console warning. */
1574
+ questions: AskUserQuestionPrompt[];
1575
+ };
1576
+ /**
1577
+ * Style overrides for the answer-pill sheet. All values are raw CSS strings
1578
+ * and are plumbed through as CSS custom properties on the sheet root.
1579
+ */
1580
+ type AgentWidgetAskUserQuestionStyles = {
1581
+ sheetBackground?: string;
1582
+ sheetBorder?: string;
1583
+ sheetShadow?: string;
1584
+ pillBackground?: string;
1585
+ pillBackgroundSelected?: string;
1586
+ pillTextColor?: string;
1587
+ pillTextColorSelected?: string;
1588
+ pillBorderRadius?: string;
1589
+ customInputBackground?: string;
1590
+ };
1591
+ /**
1592
+ * Feature config for the built-in `ask_user_question` answer-pill sheet.
1593
+ * When a tool call with the name `ask_user_question` arrives, the widget
1594
+ * renders an interactive sheet over the composer in place of the generic
1595
+ * tool bubble.
1596
+ */
1597
+ type AgentWidgetAskUserQuestionFeature = {
1598
+ /** Enable the feature. Defaults to true. When false, `ask_user_question` renders as a regular tool bubble. */
1599
+ enabled?: boolean;
1600
+ /** Slide-in animation duration in ms. Defaults to 180. */
1601
+ slideInMs?: number;
1602
+ /** Label for the free-text pill. Defaults to "Other…". */
1603
+ freeTextLabel?: string;
1604
+ /** Placeholder text in the free-text input. Defaults to "Type your answer…". */
1605
+ freeTextPlaceholder?: string;
1606
+ /** Button label for submitting multi-select / free-text answers. Defaults to "Send". */
1607
+ submitLabel?: string;
1608
+ /** Button label advancing to the next question in grouped (paginated) payloads. Defaults to "Next". */
1609
+ nextLabel?: string;
1610
+ /** Button label moving back to the previous question in grouped payloads. Defaults to "Back". */
1611
+ backLabel?: string;
1612
+ /** Button label submitting all answers from the final page of a grouped payload. Defaults to "Submit all". */
1613
+ submitAllLabel?: string;
1614
+ /**
1615
+ * In grouped (multi-question) mode, auto-advance to the next page after a
1616
+ * single-select pill pick or free-text submit on intermediate pages.
1617
+ * Defaults to `true`. The final page never auto-submits — users always
1618
+ * confirm with an explicit "Submit all" click. Multi-select pages always
1619
+ * require an explicit Next regardless of this setting.
1620
+ */
1621
+ groupedAutoAdvance?: boolean;
1622
+ /**
1623
+ * Visual layout for the option list.
1624
+ * - `"rows"` (default) — full-width stacked rows with always-visible
1625
+ * descriptions, right-edge number badges (single-select) or checkboxes
1626
+ * (multi-select), and an always-visible inline "Other" input.
1627
+ * - `"pills"` — legacy compact pill list with horizontal wrap; description
1628
+ * surfaces as a tooltip and the "Other…" pill expands on click.
1629
+ */
1630
+ layout?: "rows" | "pills";
1631
+ /**
1632
+ * Button label for skipping the current question in grouped payloads.
1633
+ * Defaults to "Skip". On intermediate pages Skip advances without recording
1634
+ * an answer; on the final page Skip submits the partial answer record
1635
+ * (skipped questions absent from the resolved object). For single-question
1636
+ * payloads Skip behaves like dismiss.
1637
+ */
1638
+ skipLabel?: string;
1639
+ /** Style overrides for the sheet and pills. */
1640
+ styles?: AgentWidgetAskUserQuestionStyles;
1436
1641
  };
1437
1642
  type SSEEventRecord = {
1438
1643
  id: string;
@@ -1574,6 +1779,101 @@ type AgentWidgetDockConfig = {
1574
1779
  */
1575
1780
  reveal?: "resize" | "overlay" | "push" | "emerge";
1576
1781
  };
1782
+ /**
1783
+ * Layout configuration for `mountMode: "composer-bar"`. Controls how the
1784
+ * collapsed pill is positioned and sized, and how the panel expands when
1785
+ * the user opens it.
1786
+ */
1787
+ type AgentWidgetComposerBarConfig = {
1788
+ /**
1789
+ * Max-width of the collapsed pill composer at the bottom of the viewport.
1790
+ * @default "720px"
1791
+ */
1792
+ collapsedMaxWidth?: string;
1793
+ /**
1794
+ * Bottom offset (CSS length) from the viewport edge in the collapsed state.
1795
+ * @default "16px"
1796
+ */
1797
+ bottomOffset?: string;
1798
+ /**
1799
+ * Auto-expand the panel when the user submits a message while the composer
1800
+ * is collapsed. When false, the message still sends but the panel remains
1801
+ * collapsed (the host can drive expansion programmatically).
1802
+ * @default true
1803
+ */
1804
+ expandOnSubmit?: boolean;
1805
+ /**
1806
+ * Size of the expanded chat panel.
1807
+ * - `"anchored"` (default): the pill stays at the bottom of the viewport
1808
+ * and the chat history grows upward into a centered column above it.
1809
+ * Width is driven by `expandedMaxWidth`; the panel's top edge sits at
1810
+ * `expandedTopOffset` from the viewport top.
1811
+ * - `"fullscreen"`: covers the entire viewport (mobile-app style). Inner
1812
+ * content is centered horizontally via `contentMaxWidth`.
1813
+ * - `"modal"`: centered sheet with margins; size driven by
1814
+ * `modalMaxWidth` / `modalMaxHeight`.
1815
+ * @default "anchored"
1816
+ */
1817
+ expandedSize?: "anchored" | "fullscreen" | "modal";
1818
+ /**
1819
+ * When `expandedSize === "anchored"`, max-width of the expanded panel
1820
+ * column. Capped at `calc(100vw - 32px)` on narrow viewports.
1821
+ * @default "880px"
1822
+ */
1823
+ expandedMaxWidth?: string;
1824
+ /**
1825
+ * When `expandedSize === "anchored"`, distance from the viewport top to
1826
+ * the panel's top edge. Accepts any CSS length.
1827
+ * @default "5vh"
1828
+ */
1829
+ expandedTopOffset?: string;
1830
+ /**
1831
+ * Max-width applied to messages, composer form, suggestions, and
1832
+ * attachment previews so they center horizontally inside the expanded
1833
+ * panel. Falls back to `layout.contentMaxWidth` when set; otherwise
1834
+ * defaults to this value.
1835
+ * @default "720px"
1836
+ */
1837
+ contentMaxWidth?: string;
1838
+ /**
1839
+ * When `expandedSize === "modal"`, max-width of the expanded sheet.
1840
+ * @default "880px"
1841
+ */
1842
+ modalMaxWidth?: string;
1843
+ /**
1844
+ * When `expandedSize === "modal"`, max-height of the expanded sheet.
1845
+ * @default "min(90vh, 800px)"
1846
+ */
1847
+ modalMaxHeight?: string;
1848
+ /**
1849
+ * Configuration for the "peek" banner — the chrome-less row above the
1850
+ * collapsed pill that previews the most recent assistant message.
1851
+ */
1852
+ peek?: AgentWidgetComposerBarPeekConfig;
1853
+ };
1854
+ /**
1855
+ * Configuration for the composer-bar peek banner. Reuses the same
1856
+ * `streamAnimation` shape developers already configure for the main message
1857
+ * stream, so the surface for animations is identical across both contexts.
1858
+ *
1859
+ * Resolution order:
1860
+ * - If `peek.streamAnimation` is set, those values apply to the peek.
1861
+ * - Otherwise the peek inherits from `features.streamAnimation`.
1862
+ *
1863
+ * Per-surface carve-outs:
1864
+ * - `bubbleClass` from a plugin (used by `pop-bubble`) is ignored — the peek
1865
+ * has no bubble analog.
1866
+ * - `containerClass`, `wrap` ("char" | "word"), `useCaret`, `placeholder`
1867
+ * ("skeleton"), `buffer` ("word" | "line"), `speed`, `duration`, and
1868
+ * custom plugins all apply unchanged.
1869
+ */
1870
+ type AgentWidgetComposerBarPeekConfig = {
1871
+ /**
1872
+ * Reveal animation for the peek's trailing-message preview. Same shape as
1873
+ * `features.streamAnimation`. Omit to inherit from the main stream config.
1874
+ */
1875
+ streamAnimation?: AgentWidgetStreamAnimationFeature;
1876
+ };
1577
1877
  type AgentWidgetLauncherConfig = {
1578
1878
  enabled?: boolean;
1579
1879
  title?: string;
@@ -1588,14 +1888,22 @@ type AgentWidgetLauncherConfig = {
1588
1888
  * Controls how the launcher panel is mounted relative to the host page.
1589
1889
  * - "floating": default floating launcher / panel behavior
1590
1890
  * - "docked": wraps the target container and renders as a sibling dock
1891
+ * - "composer-bar": persistent rounded-pill composer fixed to the bottom of
1892
+ * the viewport that morphs into a fullscreen (or modal) chat panel on
1893
+ * submit and minimizes back to the pill on close.
1591
1894
  *
1592
1895
  * @default "floating"
1593
1896
  */
1594
- mountMode?: "floating" | "docked";
1897
+ mountMode?: "floating" | "docked" | "composer-bar";
1595
1898
  /**
1596
1899
  * Layout configuration for docked mode.
1597
1900
  */
1598
1901
  dock?: AgentWidgetDockConfig;
1902
+ /**
1903
+ * Layout configuration for composer-bar mode.
1904
+ * Only applies when `mountMode === "composer-bar"`.
1905
+ */
1906
+ composerBar?: AgentWidgetComposerBarConfig;
1599
1907
  autoExpand?: boolean;
1600
1908
  width?: string;
1601
1909
  /**
@@ -3288,6 +3596,17 @@ type AgentWidgetConfig = {
3288
3596
  autoFocusInput?: boolean;
3289
3597
  launcher?: AgentWidgetLauncherConfig;
3290
3598
  initialMessages?: AgentWidgetMessage[];
3599
+ /**
3600
+ * Artifacts to hydrate into the pane at init. Typically populated from
3601
+ * `storageAdapter.load()` alongside `initialMessages` so the artifact pane
3602
+ * survives a page refresh.
3603
+ */
3604
+ initialArtifacts?: PersonaArtifactRecord[];
3605
+ /**
3606
+ * Which artifact id (if any) should be selected in the pane at init. Paired
3607
+ * with `initialArtifacts`.
3608
+ */
3609
+ initialSelectedArtifactId?: string | null;
3291
3610
  suggestionChips?: string[];
3292
3611
  suggestionChipsConfig?: AgentWidgetSuggestionChipsConfig;
3293
3612
  debug?: boolean;
@@ -3668,6 +3987,13 @@ type AgentWidgetConfig = {
3668
3987
  * When `true`, uses default settings with sessionStorage.
3669
3988
  * When an object, allows customizing storage type, key prefix, and what to persist.
3670
3989
  *
3990
+ * Setting this to `false` is the explicit kill-switch: it disables UI-state
3991
+ * persistence **and** message-history persistence. When `false`, any
3992
+ * `storageAdapter` you configure is ignored and the default localStorage
3993
+ * adapter is not created — no chat history is read or written. Pass `true`
3994
+ * (or omit) to keep the default behavior of persisting messages via the
3995
+ * configured `storageAdapter` (or the built-in localStorage adapter).
3996
+ *
3671
3997
  * @example
3672
3998
  * ```typescript
3673
3999
  * // Simple usage - persist open state in sessionStorage
@@ -3690,6 +4016,14 @@ type AgentWidgetConfig = {
3690
4016
  * }
3691
4017
  * }
3692
4018
  * ```
4019
+ *
4020
+ * @example
4021
+ * ```typescript
4022
+ * // Ephemeral widget — no message history written anywhere
4023
+ * config: {
4024
+ * persistState: false
4025
+ * }
4026
+ * ```
3693
4027
  */
3694
4028
  persistState?: boolean | AgentWidgetPersistStateConfig;
3695
4029
  /**
@@ -4157,6 +4491,22 @@ declare class AgentWidgetClient {
4157
4491
  executionId: string;
4158
4492
  approvalId: string;
4159
4493
  }, decision: 'approved' | 'denied'): Promise<Response>;
4494
+ /**
4495
+ * Resume a paused flow execution by supplying outputs for LOCAL
4496
+ * (client-executed) tools. Used by the built-in `ask_user_question`
4497
+ * answer-pill sheet, but generic enough for any LOCAL tool.
4498
+ *
4499
+ * Posts to the upstream `/resume` endpoint (the dispatch URL with
4500
+ * `/dispatch` replaced by `/resume` — works for both direct-to-Runtype
4501
+ * and the persona proxy) and returns the raw Response so the caller can
4502
+ * pipe its SSE body through `connectStream()`.
4503
+ *
4504
+ * @param executionId - The paused execution id carried on `step_await`.
4505
+ * @param toolOutputs - Map keyed by tool name → the tool's result value.
4506
+ */
4507
+ resumeFlow(executionId: string, toolOutputs: Record<string, unknown>, options?: {
4508
+ streamResponse?: boolean;
4509
+ }): Promise<Response>;
4160
4510
  private buildAgentPayload;
4161
4511
  private buildPayload;
4162
4512
  /**
@@ -4419,6 +4769,37 @@ declare class AgentWidgetSession {
4419
4769
  * and pipes the response stream through connectStream().
4420
4770
  */
4421
4771
  resolveApproval(approval: AgentWidgetApproval, decision: 'approved' | 'denied'): Promise<void>;
4772
+ /**
4773
+ * Resolve a paused `ask_user_question` LOCAL tool call.
4774
+ *
4775
+ * When the server emits `step_await` for `ask_user_question`, the widget
4776
+ * renders the answer-pill sheet and calls this method once the user
4777
+ * picks. Steps:
4778
+ * 1. POST the answer to `/resume` via `client.resumeFlow`.
4779
+ * 2. Pipe the resulting SSE stream through `connectStream()` so the
4780
+ * paused agent execution continues.
4781
+ * 3. Append a user-visible bubble with the answer text so the
4782
+ * transcript reads naturally.
4783
+ */
4784
+ /**
4785
+ * Persist in-progress answers and the current page index for a multi-question
4786
+ * `ask_user_question` payload, so a refresh resumes on the same page with
4787
+ * prior answers intact. Called by ui.ts on every Back/Next/pick interaction.
4788
+ */
4789
+ persistAskUserQuestionProgress(toolMessage: AgentWidgetMessage, progress: {
4790
+ answers: Record<string, string | string[]>;
4791
+ currentIndex: number;
4792
+ }): void;
4793
+ /**
4794
+ * Flip an `ask_user_question` tool message from awaiting → answered so
4795
+ * render passes stop re-mounting its answer-pill sheet. Idempotent.
4796
+ * When `answers` is provided, persists the full structured answer Record
4797
+ * atomically with the answered flag — guarding against later events that
4798
+ * could re-emit the tool message and clobber the per-pick persisted
4799
+ * answers via top-level merge.
4800
+ */
4801
+ markAskUserQuestionResolved(toolMessage: AgentWidgetMessage, answers?: Record<string, string | string[]>): void;
4802
+ resolveAskUserQuestion(toolMessage: AgentWidgetMessage, answer: string | Record<string, string | string[]>): Promise<void>;
4422
4803
  cancel(): void;
4423
4804
  clearMessages(): void;
4424
4805
  getArtifacts(): PersonaArtifactRecord[];
@@ -4431,6 +4812,7 @@ declare class AgentWidgetSession {
4431
4812
  private emitArtifactsState;
4432
4813
  private applyArtifactStreamEvent;
4433
4814
  hydrateMessages(messages: AgentWidgetMessage[]): void;
4815
+ hydrateArtifacts(artifacts: PersonaArtifactRecord[], selectedId?: string | null): void;
4434
4816
  private handleEvent;
4435
4817
  private setStatus;
4436
4818
  private setStreaming;
@@ -4592,6 +4974,10 @@ type Controller = {
4592
4974
  upsertArtifact: (manual: PersonaArtifactManualUpsert) => PersonaArtifactRecord | null;
4593
4975
  selectArtifact: (id: string) => void;
4594
4976
  clearArtifacts: () => void;
4977
+ /** Read current artifacts (useful on init to rebuild host-side tab state after hydration). */
4978
+ getArtifacts: () => PersonaArtifactRecord[];
4979
+ /** Read the currently selected artifact id (paired with `getArtifacts`). */
4980
+ getSelectedArtifactId: () => string | null;
4595
4981
  /**
4596
4982
  * Focus the chat input. Returns true if focus succeeded, false if panel is closed
4597
4983
  * (launcher mode) or textarea is unavailable.
@@ -4614,6 +5000,39 @@ type AgentWidgetInitHandle = AgentWidgetController & {
4614
5000
  };
4615
5001
  declare const initAgentWidget: (options: AgentWidgetInitOptions) => AgentWidgetInitHandle;
4616
5002
 
5003
+ declare const ASK_USER_QUESTION_TOOL_NAME = "ask_user_question";
5004
+ declare const isAskUserQuestionMessage: (message: AgentWidgetMessage) => boolean;
5005
+ /**
5006
+ * Parse an `ask_user_question` tool-variant message into a partial payload.
5007
+ * Safe to call mid-stream — will walk the tool call's `chunks` via
5008
+ * `partial-json` and return `{ payload: null, complete: false }` when there
5009
+ * isn't enough data yet. `complete` flips to `true` once the tool call
5010
+ * reports status `"complete"`.
5011
+ *
5012
+ * Exported for plugin authors implementing `renderAskUserQuestion`.
5013
+ */
5014
+ declare const parseAskUserQuestionPayload: (message: AgentWidgetMessage) => {
5015
+ payload: Partial<AskUserQuestionPayload> | null;
5016
+ complete: boolean;
5017
+ };
5018
+ /**
5019
+ * Create the small in-transcript stub for an `ask_user_question` tool call.
5020
+ * The stub is passive — the interactive sheet is mounted separately into
5021
+ * the composer overlay via `ensureAskUserQuestionSheet`.
5022
+ */
5023
+ declare const createAskUserQuestionBubble: (message: AgentWidgetMessage, config?: AgentWidgetConfig) => HTMLElement;
5024
+ /**
5025
+ * Mount or update the interactive answer-pill sheet for a given message.
5026
+ * Idempotent — if a sheet already exists for the tool-call id, it is hydrated
5027
+ * in-place instead of remounted, so streaming updates don't flicker.
5028
+ */
5029
+ declare const ensureAskUserQuestionSheet: (message: AgentWidgetMessage, config: AgentWidgetConfig | undefined, overlay: HTMLElement | null | undefined) => void;
5030
+ /**
5031
+ * Remove the sheet for a specific tool-call id, or all sheets if omitted.
5032
+ * Runs a slide-out transition before removing.
5033
+ */
5034
+ declare const removeAskUserQuestionSheet: (overlay: HTMLElement | null | undefined, toolCallId?: string) => void;
5035
+
4617
5036
  type WidgetHostLayoutMode = "direct" | "docked";
4618
5037
  type WidgetHostLayout = {
4619
5038
  mode: WidgetHostLayoutMode;
@@ -5333,6 +5752,161 @@ interface DropdownMenuHandle {
5333
5752
  */
5334
5753
  declare function createDropdownMenu(options: CreateDropdownOptions): DropdownMenuHandle;
5335
5754
 
5755
+ /**
5756
+ * Curated registry of lucide icons available to `renderLucideIcon`.
5757
+ *
5758
+ * The widget used to do `import * as icons from "lucide"` and look up
5759
+ * icons dynamically by string. That defeated tree-shaking, so the IIFE
5760
+ * (CDN/script-tag) bundle shipped all 1640 lucide icons (~400KB of icon
5761
+ * data) regardless of which we actually used. This explicit registry
5762
+ * lets the bundler drop any icon not listed here.
5763
+ *
5764
+ * Trade-off: `renderLucideIcon(name)` is now a *closed set*. Names not
5765
+ * in this map return `null` and log a warning, exactly as a typo did
5766
+ * before. The registry is intentionally generous (~110 icons) so that
5767
+ * custom `ComponentRenderer` authors rarely hit a missing-icon dead end.
5768
+ *
5769
+ * To add icons: add a named import above and a row in `LUCIDE_ICONS`,
5770
+ * keyed by the lucide kebab-case name (matches their filename and
5771
+ * https://lucide.dev/icons).
5772
+ *
5773
+ * See `packages/widget/docs/icon-registry-shortlist.md` for the full
5774
+ * curation rationale and which icons were considered but excluded.
5775
+ */
5776
+ declare const LUCIDE_ICONS: {
5777
+ readonly activity: IconNode;
5778
+ readonly "arrow-down": IconNode;
5779
+ readonly "arrow-up": IconNode;
5780
+ readonly "arrow-up-right": IconNode;
5781
+ readonly bot: IconNode;
5782
+ readonly "chevron-down": IconNode;
5783
+ readonly "chevron-up": IconNode;
5784
+ readonly "chevron-right": IconNode;
5785
+ readonly "chevron-left": IconNode;
5786
+ readonly check: IconNode;
5787
+ readonly clipboard: IconNode;
5788
+ readonly "clipboard-copy": IconNode;
5789
+ readonly copy: IconNode;
5790
+ readonly file: IconNode;
5791
+ readonly "file-code": IconNode;
5792
+ readonly "file-spreadsheet": IconNode;
5793
+ readonly "file-text": IconNode;
5794
+ readonly "image-plus": IconNode;
5795
+ readonly loader: IconNode;
5796
+ readonly "loader-circle": IconNode;
5797
+ readonly mic: IconNode;
5798
+ readonly paperclip: IconNode;
5799
+ readonly "refresh-cw": IconNode;
5800
+ readonly search: IconNode;
5801
+ readonly send: IconNode;
5802
+ readonly "shield-alert": IconNode;
5803
+ readonly "shield-check": IconNode;
5804
+ readonly "shield-x": IconNode;
5805
+ readonly square: IconNode;
5806
+ readonly "thumbs-down": IconNode;
5807
+ readonly "thumbs-up": IconNode;
5808
+ readonly upload: IconNode;
5809
+ readonly "volume-2": IconNode;
5810
+ readonly x: IconNode;
5811
+ readonly user: IconNode;
5812
+ readonly mail: IconNode;
5813
+ readonly phone: IconNode;
5814
+ readonly calendar: IconNode;
5815
+ readonly clock: IconNode;
5816
+ readonly building: IconNode;
5817
+ readonly "map-pin": IconNode;
5818
+ readonly lock: IconNode;
5819
+ readonly key: IconNode;
5820
+ readonly "credit-card": IconNode;
5821
+ readonly "at-sign": IconNode;
5822
+ readonly hash: IconNode;
5823
+ readonly globe: IconNode;
5824
+ readonly link: IconNode;
5825
+ readonly "circle-check": IconNode;
5826
+ readonly "circle-x": IconNode;
5827
+ readonly "triangle-alert": IconNode;
5828
+ readonly info: IconNode;
5829
+ readonly ban: IconNode;
5830
+ readonly shield: IconNode;
5831
+ readonly "arrow-left": IconNode;
5832
+ readonly "arrow-right": IconNode;
5833
+ readonly "external-link": IconNode;
5834
+ readonly ellipsis: IconNode;
5835
+ readonly "ellipsis-vertical": IconNode;
5836
+ readonly menu: IconNode;
5837
+ readonly house: IconNode;
5838
+ readonly plus: IconNode;
5839
+ readonly minus: IconNode;
5840
+ readonly pencil: IconNode;
5841
+ readonly trash: IconNode;
5842
+ readonly "trash-2": IconNode;
5843
+ readonly save: IconNode;
5844
+ readonly download: IconNode;
5845
+ readonly share: IconNode;
5846
+ readonly funnel: IconNode;
5847
+ readonly settings: IconNode;
5848
+ readonly "rotate-cw": IconNode;
5849
+ readonly maximize: IconNode;
5850
+ readonly minimize: IconNode;
5851
+ readonly "shopping-cart": IconNode;
5852
+ readonly "shopping-bag": IconNode;
5853
+ readonly package: IconNode;
5854
+ readonly truck: IconNode;
5855
+ readonly tag: IconNode;
5856
+ readonly gift: IconNode;
5857
+ readonly receipt: IconNode;
5858
+ readonly wallet: IconNode;
5859
+ readonly store: IconNode;
5860
+ readonly "dollar-sign": IconNode;
5861
+ readonly percent: IconNode;
5862
+ readonly play: IconNode;
5863
+ readonly pause: IconNode;
5864
+ readonly "volume-x": IconNode;
5865
+ readonly camera: IconNode;
5866
+ readonly image: IconNode;
5867
+ readonly film: IconNode;
5868
+ readonly headphones: IconNode;
5869
+ readonly "message-circle": IconNode;
5870
+ readonly "message-square": IconNode;
5871
+ readonly bell: IconNode;
5872
+ readonly heart: IconNode;
5873
+ readonly star: IconNode;
5874
+ readonly eye: IconNode;
5875
+ readonly "eye-off": IconNode;
5876
+ readonly bookmark: IconNode;
5877
+ readonly "calendar-days": IconNode;
5878
+ readonly history: IconNode;
5879
+ readonly timer: IconNode;
5880
+ readonly folder: IconNode;
5881
+ readonly "folder-open": IconNode;
5882
+ readonly files: IconNode;
5883
+ readonly sparkles: IconNode;
5884
+ readonly zap: IconNode;
5885
+ readonly sun: IconNode;
5886
+ readonly moon: IconNode;
5887
+ readonly flag: IconNode;
5888
+ readonly monitor: IconNode;
5889
+ readonly smartphone: IconNode;
5890
+ };
5891
+ /**
5892
+ * Names of lucide icons that ship with the widget. Names not in this
5893
+ * union return `null` from `renderLucideIcon` (with a console warning).
5894
+ */
5895
+ type IconName = keyof typeof LUCIDE_ICONS;
5896
+ /**
5897
+ * Renders a lucide icon as an inline SVG element. Works inside Shadow
5898
+ * DOM and requires no CSS.
5899
+ *
5900
+ * @param iconName - A lucide kebab-case name from the registry. See
5901
+ * `IconName` for the full list, or `docs/icon-registry-shortlist.md`
5902
+ * for rationale.
5903
+ * @param size - The size in pixels (number) or any CSS length string.
5904
+ * @param color - Stroke color (default: "currentColor").
5905
+ * @param strokeWidth - Stroke width (default: 2).
5906
+ * @returns SVGElement, or null if the name is not in the registry.
5907
+ */
5908
+ declare const renderLucideIcon: (iconName: IconName | (string & {}), size?: number | string, color?: string, strokeWidth?: number) => SVGElement | null;
5909
+
5336
5910
  /** Options for {@link createIconButton}. */
5337
5911
  interface CreateIconButtonOptions {
5338
5912
  /** Lucide icon name (kebab-case, e.g. "eye", "chevron-down"). */
@@ -6044,8 +6618,10 @@ interface ComposerBuildContext {
6044
6618
  disabled?: boolean;
6045
6619
  }
6046
6620
  /**
6047
- * Build the composer/footer section of the panel.
6048
- * Extracted for reuse and plugin override support.
6621
+ * Build the full footer + composer form (column-stacked card layout) for
6622
+ * the floating, docked, and inline-embed launcher modes. The pill variant
6623
+ * for `mountMode: "composer-bar"` lives in `pill-composer-builder.ts` and
6624
+ * shares the same low-level part factories from `composer-parts.ts`.
6049
6625
  */
6050
6626
  declare const buildComposer: (context: ComposerBuildContext) => ComposerElements;
6051
6627
 
@@ -6084,4 +6660,4 @@ declare function createVoiceProvider(config: VoiceConfig): VoiceProvider;
6084
6660
  declare function createBestAvailableVoiceProvider(config?: Partial<VoiceConfig>): VoiceProvider;
6085
6661
  declare function isVoiceSupported(config?: Partial<VoiceConfig>): boolean;
6086
6662
 
6087
- export { type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, listRegisteredStreamAnimations, markdownPostprocessor, mergeWithDefaults, normalizeContent, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, renderComponentDirective, renderLoadingIndicatorWithFallback, resolveDockConfig, resolveSanitizer, resolveTokens, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };
6663
+ export { ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetPlugin, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRenderer, type ComponentTokens, type ComposerBuildContext, type ComposerElements, type ContentPart, type CreateComboButtonOptions, type CreateDropdownOptions, type CreateIconButtonOptions, type CreateLabelButtonOptions, type CreateStandardBubbleOptions, type CreateThemeOptions, type CreateToggleGroupOptions, DEFAULT_COMPONENTS, DEFAULT_FLOATING_LAUNCHER_MAX_WIDTH, DEFAULT_FLOATING_LAUNCHER_WIDTH, DEFAULT_PALETTE, DEFAULT_SEMANTIC, DEFAULT_WIDGET_CONFIG, type DeepPartial, type DemoCarouselHandle, type DemoCarouselItem, type DemoCarouselOptions, type DomContextMode, type DomContextOptions, type DropdownMenuHandle, type DropdownMenuItem, type EnrichedPageElement, type EventStreamBadgeColor, type EventStreamConfig, type EventStreamPayloadRenderContext, type EventStreamRowRenderContext, type EventStreamToolbarRenderContext, type EventStreamViewRenderContext, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IconName, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PendingAttachment, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, type RuleScoringContext, type SSEEventCallback, type SSEEventRecord, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlotRenderContext, type SlotRenderer, type SpacingScale, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceProvider, type VoiceResult, type VoiceStatus, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, collectEnrichedPageContext, componentRegistry, createActionManager, createAgentExperience, createAskUserQuestionBubble, createBestAvailableVoiceProvider, createBubbleWithLayout, createCSATFeedback, createComboButton, createComponentMiddleware, createComponentStreamParser, createDefaultSanitizer, createDemoCarousel, createDirectivePostprocessor, createDropdownMenu, createFlexibleJsonStreamParser, createIconButton, createImagePart, createJsonStreamParser, createLabelButton, createLocalStorageAdapter, createMarkdownProcessor, createMarkdownProcessorFromConfig, createMessageActions, createNPSFeedback, createPlainTextParser, createPlugin, createRegexJsonParser, createStandardBubble, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultParseRules, detectColorScheme, directivePostprocessor, ensureAskUserQuestionSheet, escapeHtml, extractComponentDirectiveFromMessage, fileToImagePart, formatEnrichedContext, generateAssistantMessageId, generateCodeSnippet, generateMessageId, generateStableSelector, generateUserMessageId, getActiveTheme, getColorScheme, getDisplayText, getHeaderLayout, getImageParts, getPreset, hasComponentDirective, hasImages, headerLayouts, highContrastPlugin, initAgentWidget, isAskUserQuestionMessage, isComponentDirectiveType, isDockedMountMode, isVoiceSupported, listRegisteredStreamAnimations, markdownPostprocessor, mergeWithDefaults, normalizeContent, parseAskUserQuestionPayload, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, renderLucideIcon, resolveDockConfig, resolveSanitizer, resolveTokens, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };