@runtypelabs/persona 4.13.0 → 4.15.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 (106) hide show
  1. package/README.md +4 -4
  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-DveIaNx6.d.cts → types-BpWGm7_6.d.cts} +17 -0
  5. package/dist/animations/{types-DveIaNx6.d.ts → types-BpWGm7_6.d.ts} +17 -0
  6. package/dist/animations/wipe.d.cts +1 -1
  7. package/dist/animations/wipe.d.ts +1 -1
  8. package/dist/chunk-QJ4LV2KW.js +1 -0
  9. package/dist/codegen.cjs +12 -11
  10. package/dist/codegen.js +14 -13
  11. package/dist/{context-mentions-ONG7A7M6.js → context-mentions-BTSTIBFC.js} +1 -1
  12. package/dist/context-mentions.cjs +11 -8
  13. package/dist/context-mentions.d.cts +339 -22
  14. package/dist/context-mentions.d.ts +339 -22
  15. package/dist/context-mentions.js +11 -8
  16. package/dist/index.cjs +68 -67
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +483 -48
  19. package/dist/index.d.ts +483 -48
  20. package/dist/index.global.js +61 -58
  21. package/dist/index.global.js.map +1 -1
  22. package/dist/index.js +70 -69
  23. package/dist/index.js.map +1 -1
  24. package/dist/launcher.global.js +5 -2
  25. package/dist/launcher.global.js.map +1 -1
  26. package/dist/smart-dom-reader.d.cts +339 -22
  27. package/dist/smart-dom-reader.d.ts +339 -22
  28. package/dist/theme-editor-preview.cjs +67 -67
  29. package/dist/theme-editor-preview.d.cts +355 -23
  30. package/dist/theme-editor-preview.d.ts +355 -23
  31. package/dist/theme-editor-preview.js +75 -75
  32. package/dist/theme-editor.cjs +10 -10
  33. package/dist/theme-editor.d.cts +376 -24
  34. package/dist/theme-editor.d.ts +376 -24
  35. package/dist/theme-editor.js +10 -10
  36. package/dist/theme-reference.cjs +1 -1
  37. package/dist/theme-reference.d.cts +38 -0
  38. package/dist/theme-reference.d.ts +38 -0
  39. package/dist/theme-reference.js +1 -1
  40. package/dist/widget.css +1 -1
  41. package/package.json +1 -1
  42. package/src/artifacts-session.test.ts +106 -0
  43. package/src/ask-user-question-tool.ts +10 -7
  44. package/src/client.test.ts +2 -2
  45. package/src/client.ts +4 -1
  46. package/src/components/artifact-card.ts +13 -2
  47. package/src/components/artifact-inline.ts +11 -2
  48. package/src/components/artifact-preview.ts +1 -1
  49. package/src/components/composer-builder.test.ts +2 -0
  50. package/src/components/composer-builder.ts +1 -1
  51. package/src/components/composer-parts.test.ts +105 -4
  52. package/src/components/composer-parts.ts +54 -16
  53. package/src/components/message-bubble.test.ts +7 -1
  54. package/src/components/message-bubble.ts +11 -8
  55. package/src/components/messages.ts +5 -2
  56. package/src/components/panel.ts +31 -5
  57. package/src/components/pill-composer-builder.test.ts +18 -0
  58. package/src/components/suggestions.test.ts +233 -0
  59. package/src/components/suggestions.ts +463 -81
  60. package/src/components/widget-view.ts +4 -0
  61. package/src/defaults.ts +5 -3
  62. package/src/generated/runtype-openapi-contract.ts +17 -0
  63. package/src/index-core.ts +52 -2
  64. package/src/launcher-global.ts +1 -1
  65. package/src/plugins/types.ts +71 -3
  66. package/src/presets.ts +3 -3
  67. package/src/session.ts +55 -12
  68. package/src/styles/widget-styles.test.ts +162 -0
  69. package/src/styles/widget.css +440 -1
  70. package/src/suggest-replies-tool.test.ts +233 -2
  71. package/src/suggest-replies-tool.ts +115 -39
  72. package/src/theme-editor/index.ts +5 -0
  73. package/src/theme-editor/presets.test.ts +43 -0
  74. package/src/theme-editor/presets.ts +101 -87
  75. package/src/theme-editor/preview-utils.test.ts +34 -0
  76. package/src/theme-editor/preview-utils.ts +77 -2
  77. package/src/theme-editor/sections.test.ts +72 -7
  78. package/src/theme-editor/sections.ts +113 -13
  79. package/src/theme-editor/state-preferences.test.ts +15 -0
  80. package/src/theme-editor/state.ts +46 -0
  81. package/src/theme-editor/types.ts +15 -1
  82. package/src/theme-editor/webmcp/tools.test.ts +13 -0
  83. package/src/theme-editor/webmcp/tools.ts +5 -0
  84. package/src/theme-reference.ts +9 -2
  85. package/src/types/theme.ts +32 -0
  86. package/src/types.ts +291 -25
  87. package/src/ui.artifact-pane-gating.test.ts +5 -5
  88. package/src/ui.config-preferences.test.ts +166 -0
  89. package/src/ui.detached-panel.test.ts +1 -1
  90. package/src/ui.suggest-replies.test.ts +1066 -1
  91. package/src/ui.ts +311 -45
  92. package/src/ui.typing-indicator.test.ts +135 -0
  93. package/src/utils/artifact-display.test.ts +180 -16
  94. package/src/utils/artifact-display.ts +155 -14
  95. package/src/utils/artifact-file.test.ts +1 -1
  96. package/src/utils/code-generators.test.ts +40 -0
  97. package/src/utils/code-generators.ts +22 -0
  98. package/src/utils/config-merge.test.ts +84 -0
  99. package/src/utils/config-merge.ts +6 -1
  100. package/src/utils/feature-preferences.test.ts +326 -0
  101. package/src/utils/feature-preferences.ts +498 -0
  102. package/src/utils/icons.test.ts +26 -0
  103. package/src/utils/icons.ts +8 -0
  104. package/src/utils/theme.test.ts +171 -0
  105. package/src/utils/tokens.ts +71 -7
  106. package/dist/chunk-MMUPR2JW.js +0 -1
package/dist/index.d.ts CHANGED
@@ -2,6 +2,40 @@ import { IconNode } from 'lucide';
2
2
  import { Marked } from 'marked';
3
3
  import DOMPurify from 'dompurify';
4
4
 
5
+ type AgentWidgetTransformSuggestionsContext = {
6
+ /**
7
+ * Fresh copy of the suggestions entering this plugin, already normalized:
8
+ * shorthand strings expanded and the effective send/fill behavior resolved.
9
+ */
10
+ suggestions: AgentWidgetResolvedSuggestion[];
11
+ surface: AgentWidgetSuggestionSurface;
12
+ source: AgentWidgetSuggestionSource;
13
+ config: AgentWidgetConfig;
14
+ };
15
+ type AgentWidgetRenderSuggestionContext = {
16
+ /** Fully normalized suggestion, including the effective send/fill behavior. */
17
+ suggestion: AgentWidgetResolvedSuggestion;
18
+ index: number;
19
+ surface: AgentWidgetSuggestionSurface;
20
+ source: AgentWidgetSuggestionSource;
21
+ variant: AgentWidgetSuggestionVariant;
22
+ streaming: boolean;
23
+ config: AgentWidgetConfig;
24
+ /** Build Persona's standard chip, card, or list item. */
25
+ defaultRenderer: () => HTMLElement;
26
+ /**
27
+ * Run the normal selection pipeline: DOM event, plugin selection hooks, then
28
+ * send or fill. Custom renderers should call this instead of sending directly.
29
+ */
30
+ select: () => void;
31
+ };
32
+ type AgentWidgetSuggestionSelectContext = {
33
+ suggestion: AgentWidgetResolvedSuggestion;
34
+ surface: AgentWidgetSuggestionSurface;
35
+ source: AgentWidgetSuggestionSource;
36
+ variant: AgentWidgetSuggestionVariant;
37
+ config: AgentWidgetConfig;
38
+ };
5
39
  /**
6
40
  * Plugin interface for customizing widget components
7
41
  */
@@ -14,6 +48,25 @@ interface AgentWidgetPlugin {
14
48
  * Optional priority (higher = runs first). Default: 0
15
49
  */
16
50
  priority?: number;
51
+ /**
52
+ * Transform, filter, enrich, or reorder suggestions. Hooks receive normalized
53
+ * items and compose in plugin priority order; the return value may use the
54
+ * loose shape (string shorthand included) and is re-normalized before the next
55
+ * hook. A per-item `behavior` set here survives. `maxItems` caps the list
56
+ * after the full chain. Return an empty array to hide the surface.
57
+ */
58
+ transformSuggestions?: (context: AgentWidgetTransformSuggestionsContext) => AgentWidgetSuggestion[];
59
+ /**
60
+ * Render one starter or follow-up suggestion. Return null to use Persona's
61
+ * default chip/card/list renderer. Call `select()` from custom interaction
62
+ * controls to preserve events, selection hooks, and send/fill behavior.
63
+ */
64
+ renderSuggestion?: (context: AgentWidgetRenderSuggestionContext) => HTMLElement | null;
65
+ /**
66
+ * Observe or intercept a suggestion selection. Return false to cancel the
67
+ * built-in send/fill action. Hooks run in plugin priority order.
68
+ */
69
+ onSuggestionSelect?: (context: AgentWidgetSuggestionSelectContext) => void | boolean;
17
70
  /**
18
71
  * Custom renderer for message bubbles
19
72
  * Return null to use default renderer
@@ -609,6 +662,14 @@ interface ReasoningBubbleTokens {
609
662
  interface ComposerChromeTokens {
610
663
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
611
664
  shadow: string;
665
+ /** Inner padding of the composer form (raw CSS shorthand). @default "0.75rem 1rem" */
666
+ padding?: string;
667
+ /** Gap between the textarea row and the actions row. @default "0.5rem" */
668
+ gap?: string;
669
+ /** Composer textarea font-size. @default "0.875rem" */
670
+ fontSize?: string;
671
+ /** Composer textarea line-height. @default "1.25rem" */
672
+ lineHeight?: string;
612
673
  }
613
674
  /** Artifact toolbar chrome. */
614
675
  interface ArtifactToolbarTokens {
@@ -758,6 +819,26 @@ interface ScrollToBottomTokens extends ComponentTokenSet {
758
819
  fontSize?: string;
759
820
  iconSize?: string;
760
821
  }
822
+ /** Visual tokens shared by one suggestion presentation variant. */
823
+ interface SuggestionVariantTokens extends ComponentTokenSet {
824
+ gap?: string;
825
+ minHeight?: string;
826
+ fontSize?: string;
827
+ lineHeight?: string;
828
+ iconSize?: string;
829
+ hoverBackground?: TokenReference<'color'>;
830
+ hoverForeground?: TokenReference<'color'>;
831
+ hoverBorder?: TokenReference<'color'>;
832
+ pressedBackground?: TokenReference<'color'>;
833
+ focusRing?: TokenReference<'color'>;
834
+ disabledOpacity?: string;
835
+ }
836
+ /** Starter and follow-up suggestion chrome. */
837
+ interface SuggestionTokens {
838
+ chip: SuggestionVariantTokens;
839
+ card: SuggestionVariantTokens;
840
+ list: SuggestionVariantTokens;
841
+ }
761
842
  /** Toggle group chrome (used by createToggleGroup). */
762
843
  interface ToggleGroupTokens {
763
844
  /** Gap between toggle buttons. Default: 0 (connected). */
@@ -788,6 +869,8 @@ interface ComponentTokens {
788
869
  labelButton?: LabelButtonTokens;
789
870
  /** Scroll-to-bottom indicator styling tokens. */
790
871
  scrollToBottom?: ScrollToBottomTokens;
872
+ /** Starter prompt and follow-up suggestion styling tokens. */
873
+ suggestion?: SuggestionTokens;
791
874
  /** Toggle group styling tokens. */
792
875
  toggleGroup?: ToggleGroupTokens;
793
876
  /** Artifact toolbar, tab strip, and pane chrome. */
@@ -1109,7 +1192,24 @@ type RuntypeExecutionStreamEvent = ({
1109
1192
  type: "source";
1110
1193
  url?: string;
1111
1194
  [key: string]: unknown;
1195
+ } | {
1196
+ executionId: string;
1197
+ iteration?: number;
1198
+ seq: number;
1199
+ state: Record<string, unknown>;
1200
+ type: "state_snapshot";
1112
1201
  } | ({
1202
+ executionId: string;
1203
+ iteration?: number;
1204
+ patch: Array<{
1205
+ from?: string;
1206
+ op: "add" | "remove" | "replace" | "move" | "copy" | "test";
1207
+ path: string;
1208
+ value?: unknown;
1209
+ }>;
1210
+ seq: number;
1211
+ type: "state_delta";
1212
+ }) | ({
1113
1213
  executionId: string;
1114
1214
  hiddenParameterNames?: Array<string>;
1115
1215
  iteration?: number;
@@ -1481,6 +1581,7 @@ declare const LUCIDE_ICONS: {
1481
1581
  readonly plus: IconNode;
1482
1582
  readonly minus: IconNode;
1483
1583
  readonly pencil: IconNode;
1584
+ readonly "pen-line": IconNode;
1484
1585
  readonly trash: IconNode;
1485
1586
  readonly "trash-2": IconNode;
1486
1587
  readonly save: IconNode;
@@ -1523,11 +1624,13 @@ declare const LUCIDE_ICONS: {
1523
1624
  readonly folder: IconNode;
1524
1625
  readonly "folder-open": IconNode;
1525
1626
  readonly files: IconNode;
1627
+ readonly "chart-column": IconNode;
1526
1628
  readonly sparkles: IconNode;
1527
1629
  readonly zap: IconNode;
1528
1630
  readonly sun: IconNode;
1529
1631
  readonly moon: IconNode;
1530
1632
  readonly flag: IconNode;
1633
+ readonly lightbulb: IconNode;
1531
1634
  readonly monitor: IconNode;
1532
1635
  readonly smartphone: IconNode;
1533
1636
  };
@@ -2140,6 +2243,14 @@ type AgentToolsConfig = {
2140
2243
  };
2141
2244
  /** Artifact kinds for the Persona sidebar and dispatch payload */
2142
2245
  type PersonaArtifactKind = "markdown" | "component";
2246
+ type PersonaArtifactPresentation = {
2247
+ /**
2248
+ * Producer hint for where this artifact renders (content-disposition
2249
+ * model). Beats configured defaults; loses to explicit `files`/`byKind`
2250
+ * rules. Persona never infers it; the producer or host supplies it.
2251
+ */
2252
+ preferredMode?: PersonaArtifactDisplayModeInput;
2253
+ };
2143
2254
  /**
2144
2255
  * Agent configuration for agent execution mode.
2145
2256
  * When provided in the widget config, enables agent loop execution instead of flow dispatch.
@@ -2810,7 +2921,48 @@ type AgentWidgetArtifactsLayoutConfig = {
2810
2921
  jsonPayload: string;
2811
2922
  }) => void | Promise<void>;
2812
2923
  };
2813
- type PersonaArtifactDisplayMode = "card" | "panel" | "inline";
2924
+ /**
2925
+ * Where the artifact body renders by default. Every mode shows the compact
2926
+ * reference in the transcript; the mode names where the body goes:
2927
+ * nowhere yet (`collapsed`), the side panel (`panel`), or the conversation
2928
+ * itself (`inline`).
2929
+ */
2930
+ type PersonaArtifactDisplayMode = "collapsed" | "panel" | "inline";
2931
+ /**
2932
+ * Accepted wherever a display mode is written. `"card"` is a deprecated
2933
+ * alias of `"collapsed"` (the old name described the reference card, which
2934
+ * every mode shows, instead of where the body renders). Resolution and
2935
+ * parsing always canonicalize to `"collapsed"`.
2936
+ */
2937
+ type PersonaArtifactDisplayModeInput = PersonaArtifactDisplayMode | "card";
2938
+ /**
2939
+ * Display rules for file-backed artifacts. `byMediaType` keys are exact MIME
2940
+ * types (`"text/html"`) or major-type wildcards (`"image/*"`), matched
2941
+ * case-insensitively without parameters; exact beats wildcard.
2942
+ */
2943
+ type PersonaArtifactFilesDisplayRules = {
2944
+ default?: PersonaArtifactDisplayModeInput;
2945
+ byMediaType?: Record<string, PersonaArtifactDisplayModeInput>;
2946
+ };
2947
+ /**
2948
+ * Scoped artifact display rules. Matching resolves from the most specific
2949
+ * selector to `default`; see `resolveArtifactDisplay`.
2950
+ *
2951
+ * Across preference layers, one merge rule applies everywhere: a string value
2952
+ * replaces the whole subtree it names; an object refines it per key. So
2953
+ * `files: "inline"` overrides every lower-layer file rule, while
2954
+ * `files: { default: "inline" }` keeps lower-layer MIME exceptions.
2955
+ */
2956
+ type PersonaArtifactDisplayRules = {
2957
+ default?: PersonaArtifactDisplayModeInput;
2958
+ byKind?: Partial<Record<PersonaArtifactKind, PersonaArtifactDisplayModeInput>>;
2959
+ /**
2960
+ * @deprecated Use `byKind`. When both are present, `byKind` wins.
2961
+ */
2962
+ byType?: Partial<Record<PersonaArtifactKind, PersonaArtifactDisplayModeInput>>;
2963
+ /** Rules for any artifact carrying file metadata. */
2964
+ files?: PersonaArtifactDisplayModeInput | PersonaArtifactFilesDisplayRules;
2965
+ };
2814
2966
  /** Context handed to custom artifact actions. Content fields are best-effort: resolved from live session state or, after a refresh, from the persisted reference-card payload. */
2815
2967
  type PersonaArtifactActionContext = {
2816
2968
  artifactId: string | null;
@@ -2867,13 +3019,10 @@ type AgentWidgetArtifactsFeature = {
2867
3019
  allowedTypes?: PersonaArtifactKind[];
2868
3020
  /**
2869
3021
  * Where artifact bodies render. A single mode applies to all artifacts;
2870
- * the object form sets a default plus per-type overrides.
3022
+ * the object form sets a default plus scoped overrides.
2871
3023
  * Defaults to "panel" (current behavior).
2872
3024
  */
2873
- display?: PersonaArtifactDisplayMode | {
2874
- default?: PersonaArtifactDisplayMode;
2875
- byType?: Partial<Record<PersonaArtifactKind, PersonaArtifactDisplayMode>>;
2876
- };
3025
+ display?: PersonaArtifactDisplayModeInput | PersonaArtifactDisplayRules;
2877
3026
  /** Split / drawer dimensions and launcher widen behavior */
2878
3027
  layout?: AgentWidgetArtifactsLayoutConfig;
2879
3028
  /**
@@ -3595,19 +3744,63 @@ type AgentWidgetFeatureFlags = {
3595
3744
  */
3596
3745
  askUserQuestion?: AgentWidgetAskUserQuestionFeature;
3597
3746
  /**
3598
- * Built-in `suggest_replies` quick-reply chips. When the assistant invokes
3599
- * the tool, the widget shows the suggestions as tappable chips above the
3600
- * composer (reusing the suggestion-chips surface) and immediately resumes
3601
- * the execution: fire-and-forget, no user input awaited.
3747
+ * Built-in `suggest_replies` follow-ups. When the assistant invokes the
3748
+ * tool, the widget shows the suggestions using `suggestions.followUps` and
3749
+ * immediately resumes the execution: fire-and-forget, no user input awaited.
3750
+ *
3751
+ * @deprecated Both keys moved to `suggestions.followUps`: use
3752
+ * `suggestions.followUps.enabled` and `suggestions.followUps.expose`. This
3753
+ * alias keeps working per key, with `suggestions.followUps` winning.
3602
3754
  */
3603
3755
  suggestReplies?: AgentWidgetSuggestRepliesFeature;
3604
3756
  };
3757
+ type WidgetPreferenceCapabilities = {
3758
+ artifacts?: boolean;
3759
+ tools?: boolean;
3760
+ reasoning?: boolean;
3761
+ };
3605
3762
  /**
3606
- * Feature config for the built-in `suggest_replies` quick-reply chips.
3607
- * Chips render in the existing suggestions slot above the composer and are
3608
- * styled by the widget-level `suggestionChipsConfig`. A tapped chip is sent
3609
- * verbatim as the user's next message; chips clear once any user message
3610
- * follows them.
3763
+ * Persistable artifact-layout choices. The full layout config deliberately is
3764
+ * not exposed because it also contains callbacks and embedder-owned chrome.
3765
+ */
3766
+ type WidgetArtifactLayoutPreference = Pick<AgentWidgetArtifactsLayoutConfig, "paneWidth" | "paneMaxWidth" | "paneMinWidth" | "expandLauncherPanelWhenOpen" | "expandedPanelWidth" | "resizable" | "resizableMinWidth" | "resizableMaxWidth">;
3767
+ /**
3768
+ * Curated, JSON-serializable display preferences in native `features` shape.
3769
+ *
3770
+ * Absence means inherit the next preference layer and ultimately Persona's
3771
+ * current default. Persist only explicit choices; resetting a choice deletes
3772
+ * its key.
3773
+ *
3774
+ * Capability facts (`artifacts.enabled`, `allowedTypes`), trusted iframe
3775
+ * security, callbacks, actions, renderers, labels, and theme styling are
3776
+ * intentionally excluded because they remain embedder/code-owned.
3777
+ */
3778
+ type WidgetPreferenceSlice = {
3779
+ showToolCalls?: boolean;
3780
+ showReasoning?: boolean;
3781
+ toolCallDisplay?: Pick<AgentWidgetToolCallDisplayFeature, "collapsedMode" | "expandable" | "grouped" | "groupedMode" | "loadingAnimation">;
3782
+ reasoningDisplay?: Pick<AgentWidgetReasoningDisplayFeature, "expandable" | "activePreview">;
3783
+ artifacts?: {
3784
+ /**
3785
+ * String and object forms are both persistable and mean different things
3786
+ * when layers merge: a string replaces every lower-layer display rule; an
3787
+ * object refines lower layers per selector key (same rule applies to
3788
+ * `display.files`).
3789
+ */
3790
+ display?: PersonaArtifactDisplayModeInput | PersonaArtifactDisplayRules;
3791
+ filePreview?: {
3792
+ enabled?: boolean;
3793
+ };
3794
+ layout?: WidgetArtifactLayoutPreference;
3795
+ };
3796
+ };
3797
+ /**
3798
+ * Feature config for the built-in `suggest_replies` follow-ups.
3799
+ *
3800
+ * @deprecated Both keys moved to `suggestions.followUps`
3801
+ * (`suggestions.followUps.enabled` / `suggestions.followUps.expose`), which
3802
+ * also owns presentation, placement, and send/fill behavior. Resolution is
3803
+ * per key with `suggestions.followUps` winning; removal waits for 5.0.
3611
3804
  */
3612
3805
  type AgentWidgetSuggestRepliesFeature = {
3613
3806
  /**
@@ -3615,14 +3808,18 @@ type AgentWidgetSuggestRepliesFeature = {
3615
3808
  * renders as a regular tool bubble and is NOT auto-resumed: only set this
3616
3809
  * with no server-side `suggest_replies` declaration, or the execution
3617
3810
  * parks awaiting a resume that never comes.
3811
+ * @deprecated Use `suggestions.followUps.enabled`.
3618
3812
  */
3619
3813
  enabled?: boolean;
3620
3814
  /**
3621
3815
  * Advertise the built-in `suggest_replies` tool to the agent on every
3622
3816
  * dispatch via `clientTools[]`: no server-side `runtimeTools` declaration
3623
- * needed. Defaults to `false`: flows that already declare the tool via
3624
- * `runtimeTools` would otherwise present it to the model twice. Ignored
3625
- * when `enabled` is `false`.
3817
+ * needed. Defaults to `false`. Declare the tool in one place: the API
3818
+ * dedupes a double declaration by name with `clientTools[]` winning, so the
3819
+ * model still sees exactly one tool, but the widget's description and schema
3820
+ * win and the effective tool type becomes `local` (the execution pauses and
3821
+ * the widget auto-resumes it). Ignored when `enabled` is `false`.
3822
+ * @deprecated Use `suggestions.followUps.expose`.
3626
3823
  */
3627
3824
  expose?: boolean;
3628
3825
  };
@@ -3692,10 +3889,13 @@ type AgentWidgetAskUserQuestionFeature = {
3692
3889
  * matching {@link AskUserQuestionPayload}; when the model calls it, the
3693
3890
  * existing answer-pill sheet renders and the answer resumes the execution.
3694
3891
  *
3695
- * Defaults to `false`: flows that already declare `ask_user_question` via
3696
- * `runtimeTools` would otherwise present the tool to the model twice.
3697
- * Ignored when `enabled` is `false`: never offer the agent a question
3698
- * tool the widget can't render an answer UI for.
3892
+ * Defaults to `false`. Declare the tool in one place: the API dedupes a
3893
+ * double declaration by name with `clientTools[]` winning, so the model
3894
+ * still sees exactly one tool, but the widget's description and schema win
3895
+ * and the effective tool type becomes `local` (the execution pauses and the
3896
+ * widget resumes it with the user's answer). Ignored when `enabled` is
3897
+ * `false`: never offer the agent a question tool the widget can't render an
3898
+ * answer UI for.
3699
3899
  */
3700
3900
  expose?: boolean;
3701
3901
  /** Slide-in animation duration in ms. Defaults to 180. */
@@ -4168,6 +4368,10 @@ type AgentWidgetSendButtonConfig = {
4168
4368
  paddingY?: string;
4169
4369
  iconText?: string;
4170
4370
  iconName?: string;
4371
+ /** Icon glyph box in icon mode, e.g. "20px". Defaults to half of `size`. */
4372
+ iconSize?: string;
4373
+ /** Stroke width for the icon glyph, in viewBox units. Default 2. */
4374
+ iconStrokeWidth?: number;
4171
4375
  useIcon?: boolean;
4172
4376
  tooltipText?: string;
4173
4377
  showTooltip?: boolean;
@@ -4936,6 +5140,109 @@ type AgentWidgetSuggestionChipsConfig = {
4936
5140
  paddingX?: string;
4937
5141
  paddingY?: string;
4938
5142
  };
5143
+ /** A suggested next action shown to the user. Strings remain supported as shorthand. */
5144
+ type AgentWidgetSuggestion = string | {
5145
+ /** Stable analytics / DOM identity. Falls back to the prompt or label. */
5146
+ id?: string;
5147
+ /** Concise visible action label. */
5148
+ label: string;
5149
+ /** Text placed in the composer or sent. Defaults to `label`. */
5150
+ prompt?: string;
5151
+ /** Optional supporting copy, most useful with the `card` variant. */
5152
+ description?: string;
5153
+ /** Optional icon from Persona's bundled Lucide registry. */
5154
+ icon?: IconName;
5155
+ /**
5156
+ * CSS color for this item's glyph. Tints the icon only: label, border,
5157
+ * and background stay neutral. Ignored without an `icon`.
5158
+ */
5159
+ iconColor?: string;
5160
+ /** Override the surface's click behavior for this item. */
5161
+ behavior?: AgentWidgetSuggestionBehavior;
5162
+ /** Visually promote one high-confidence action. */
5163
+ emphasis?: "default" | "primary";
5164
+ };
5165
+ type AgentWidgetSuggestionBehavior = "send" | "fill";
5166
+ type AgentWidgetSuggestionVariant = "chip" | "card" | "list";
5167
+ type AgentWidgetSuggestionSurface = "starter" | "followUp";
5168
+ /**
5169
+ * Who produced the rendered suggestions: static config, the agent's
5170
+ * `suggest_replies` tool, or `controller.setFollowUpSuggestions`.
5171
+ */
5172
+ type AgentWidgetSuggestionSource = "config" | "agent" | "host";
5173
+ /**
5174
+ * A suggestion after Persona has normalized shorthand strings and resolved the
5175
+ * effective click behavior. Plugin hooks receive this stable shape.
5176
+ */
5177
+ type AgentWidgetResolvedSuggestion = {
5178
+ id: string;
5179
+ label: string;
5180
+ prompt: string;
5181
+ description?: string;
5182
+ icon?: IconName;
5183
+ /** CSS color for the glyph only; never the label, border, or background. */
5184
+ iconColor?: string;
5185
+ behavior: AgentWidgetSuggestionBehavior;
5186
+ emphasis: "default" | "primary";
5187
+ };
5188
+ /** Presentation keys shared by every suggestion surface. */
5189
+ type AgentWidgetSuggestionSurfaceConfig = {
5190
+ /** Item density. Defaults to `card` for starters and `chip` for follow-ups. */
5191
+ variant?: AgentWidgetSuggestionVariant;
5192
+ /** Default click behavior, overridable per item. Defaults to `send`. */
5193
+ behavior?: AgentWidgetSuggestionBehavior;
5194
+ /**
5195
+ * Layout for items past the surface width. Defaults to `wrap` for starters
5196
+ * and `scroll` for follow-ups. Applies to the `chip` variant only; the
5197
+ * `card` and `list` layouts manage their own stacking.
5198
+ */
5199
+ overflow?: "scroll" | "wrap";
5200
+ /** Maximum visible items. Defaults to 4. */
5201
+ maxItems?: number;
5202
+ };
5203
+ type AgentWidgetStarterSuggestionsConfig = AgentWidgetSuggestionSurfaceConfig & {
5204
+ /** Suggestions shown before the first user message. */
5205
+ items?: AgentWidgetSuggestion[];
5206
+ /**
5207
+ * `auto` uses the welcome surface when the welcome card renders and the
5208
+ * composer otherwise. Explicit values are literal: `welcome` renders
5209
+ * nothing when the welcome card is hidden. Defaults to `auto`.
5210
+ */
5211
+ placement?: "auto" | "welcome" | "composer";
5212
+ };
5213
+ type AgentWidgetFollowUpSuggestionsConfig = AgentWidgetSuggestionSurfaceConfig & {
5214
+ /**
5215
+ * Enable the built-in `suggest_replies` follow-ups. Defaults to true. When
5216
+ * false, `suggest_replies` renders as a regular tool bubble and is NOT
5217
+ * auto-resumed: only set this with no server-side `suggest_replies`
5218
+ * declaration, or the execution parks awaiting a resume that never comes.
5219
+ */
5220
+ enabled?: boolean;
5221
+ /**
5222
+ * Advertise the built-in `suggest_replies` tool to the agent on every
5223
+ * dispatch via `clientTools[]`: no server-side `runtimeTools` declaration
5224
+ * needed. Defaults to `false`. Declare the tool in one place: the API
5225
+ * dedupes a double declaration by name with `clientTools[]` winning, so
5226
+ * the model still sees exactly one tool, but the widget's description and
5227
+ * schema win and the effective tool type becomes `local` (the execution
5228
+ * pauses and the widget auto-resumes it). Ignored when `enabled` is
5229
+ * `false`.
5230
+ */
5231
+ expose?: boolean;
5232
+ /**
5233
+ * `auto` places follow-ups after the transcript in regular panels and above
5234
+ * the composer in composer-bar mode. Defaults to `auto`.
5235
+ */
5236
+ placement?: "auto" | "after-message" | "composer";
5237
+ };
5238
+ /**
5239
+ * Structured suggestions configuration. The legacy `suggestionChips` and
5240
+ * `suggestionChipsConfig` fields remain supported for backwards compatibility.
5241
+ */
5242
+ type AgentWidgetSuggestionsConfig = {
5243
+ starters?: AgentWidgetStarterSuggestionsConfig;
5244
+ followUps?: AgentWidgetFollowUpSuggestionsConfig;
5245
+ };
4939
5246
  /**
4940
5247
  * Interface for pluggable stream parsers that extract text from streaming responses.
4941
5248
  * Parsers handle incremental parsing to extract text values from structured formats (JSON, XML, etc.).
@@ -6153,6 +6460,15 @@ type AgentWidgetConfig = {
6153
6460
  */
6154
6461
  colorScheme?: 'auto' | 'light' | 'dark';
6155
6462
  features?: AgentWidgetFeatureFlags;
6463
+ /**
6464
+ * Per-instance display overrides, applied over `features` through the
6465
+ * preference allowlist (security/capability keys cannot pass). String
6466
+ * `display` values replace the base rule subtree; objects refine it per
6467
+ * key. Each `controller.update({ preferences })` replaces the previous
6468
+ * slice wholesale (dropped keys revert to the base `features`); an
6469
+ * explicit-undefined patch clears it entirely.
6470
+ */
6471
+ preferences?: WidgetPreferenceSlice;
6156
6472
  /**
6157
6473
  * When true, focus the chat input after the panel opens and the open animation completes.
6158
6474
  * Applies to launcher mode (user click, controller.open(), autoExpand) and inline mode (on init).
@@ -6173,7 +6489,11 @@ type AgentWidgetConfig = {
6173
6489
  * with `initialArtifacts`.
6174
6490
  */
6175
6491
  initialSelectedArtifactId?: string | null;
6492
+ /** Rich starter and follow-up suggestion surfaces. */
6493
+ suggestions?: AgentWidgetSuggestionsConfig;
6494
+ /** @deprecated Prefer `suggestions.starters.items`. */
6176
6495
  suggestionChips?: string[];
6496
+ /** @deprecated Prefer semantic tokens under `theme.components.suggestion`. */
6177
6497
  suggestionChipsConfig?: AgentWidgetSuggestionChipsConfig;
6178
6498
  debug?: boolean;
6179
6499
  formEndpoint?: string;
@@ -7074,6 +7394,8 @@ type PersonaArtifactRecord = {
7074
7394
  props?: Record<string, unknown>;
7075
7395
  /** Present when this markdown artifact is a previewable file (see PersonaArtifactFileMeta). */
7076
7396
  file?: PersonaArtifactFileMeta;
7397
+ /** Optional presentation metadata such as the producer's display-mode hint. */
7398
+ presentation?: PersonaArtifactPresentation;
7077
7399
  };
7078
7400
  /** Programmatic artifact upsert (controller / window API) */
7079
7401
  type PersonaArtifactManualUpsert = {
@@ -7083,6 +7405,7 @@ type PersonaArtifactManualUpsert = {
7083
7405
  content: string;
7084
7406
  /** Optional file metadata for previewable file artifacts. */
7085
7407
  file?: PersonaArtifactFileMeta;
7408
+ presentation?: PersonaArtifactPresentation;
7086
7409
  /** Set false to update the registry/pane without a transcript block (pre-4.x behavior). */
7087
7410
  transcript?: boolean;
7088
7411
  } | {
@@ -7091,6 +7414,7 @@ type PersonaArtifactManualUpsert = {
7091
7414
  title?: string;
7092
7415
  component: string;
7093
7416
  props?: Record<string, unknown>;
7417
+ presentation?: PersonaArtifactPresentation;
7094
7418
  /** Set false to update the registry/pane without a transcript block (pre-4.x behavior). */
7095
7419
  transcript?: boolean;
7096
7420
  };
@@ -8066,7 +8390,7 @@ declare class AgentWidgetSession {
8066
8390
  /**
8067
8391
  * Injects (or refreshes) the in-thread artifact block for a programmatically
8068
8392
  * upserted artifact, matching the streamed UX: the resolved display mode
8069
- * picks the component ("card"/"panel" → reference card, "inline" → inline
8393
+ * picks the component ("collapsed"/"panel" → reference card, "inline" → inline
8070
8394
  * preview).
8071
8395
  *
8072
8396
  * Unlike the streamed path (which embeds content on `artifact_complete`),
@@ -8080,6 +8404,11 @@ declare class AgentWidgetSession {
8080
8404
  * content after a refresh.
8081
8405
  */
8082
8406
  private injectArtifactRefBlock;
8407
+ /**
8408
+ * Re-materialize existing transcript artifact blocks after a live display
8409
+ * preference update. One messages callback keeps conversion atomic.
8410
+ */
8411
+ private refreshArtifactReferenceBlocks;
8083
8412
  private clearArtifactState;
8084
8413
  private emitArtifactsState;
8085
8414
  private applyArtifactStreamEvent;
@@ -8369,6 +8698,19 @@ type Controller = {
8369
8698
  * @deprecated Use injectMessage() instead.
8370
8699
  */
8371
8700
  injectTestMessage: (event: AgentWidgetEvent) => void;
8701
+ /**
8702
+ * Show follow-up suggestions from host code. An ephemeral UI overlay: the
8703
+ * items never enter the transcript, the wire payload, or persisted state, so
8704
+ * they do not survive a refresh. Cleared automatically when the next user
8705
+ * message appends. Latest writer wins against the agent's `suggest_replies`
8706
+ * payloads: this call overrides chips shown now, and a payload arriving
8707
+ * afterwards overrides these. Renders through the `suggestions.followUps`
8708
+ * presentation config and the full plugin and `persona:suggestReplies:*`
8709
+ * event pipeline, with source `"host"`. An empty array clears.
8710
+ */
8711
+ setFollowUpSuggestions: (items: AgentWidgetSuggestion[]) => void;
8712
+ /** Remove host-set follow-up suggestions. Agent-set chips are untouched. */
8713
+ clearFollowUpSuggestions: () => void;
8372
8714
  getMessages: () => AgentWidgetMessage[];
8373
8715
  getStatus: () => AgentWidgetSessionStatus;
8374
8716
  getPersistentMetadata: () => Record<string, unknown>;
@@ -8440,6 +8782,77 @@ type AgentWidgetInitHandle = AgentWidgetController & {
8440
8782
  };
8441
8783
  declare const initAgentWidget: (options: AgentWidgetInitOptions) => AgentWidgetInitHandle;
8442
8784
 
8785
+ /** Canonicalize the deprecated `"card"` alias to `"collapsed"`. */
8786
+ declare function canonicalArtifactDisplayMode(mode: PersonaArtifactDisplayModeInput): PersonaArtifactDisplayMode;
8787
+ type PersonaArtifactDisplayDescriptor = Pick<PersonaArtifactRecord, "artifactType" | "file" | "presentation">;
8788
+ type PersonaArtifactDisplayMatch =
8789
+ /** `selector` is the configured `byMediaType` key ("text/html" or "image/*"). */
8790
+ {
8791
+ type: "mediaType";
8792
+ mediaType: string;
8793
+ selector: string;
8794
+ } | {
8795
+ type: "files";
8796
+ } | {
8797
+ type: "kind";
8798
+ kind: PersonaArtifactKind;
8799
+ configuredBy: "byKind" | "byType";
8800
+ } | {
8801
+ type: "preferredMode";
8802
+ } | {
8803
+ type: "default";
8804
+ } | {
8805
+ type: "personaDefault";
8806
+ };
8807
+ type PersonaArtifactDisplayResolution = {
8808
+ mode: PersonaArtifactDisplayMode;
8809
+ matchedBy: PersonaArtifactDisplayMatch;
8810
+ };
8811
+ declare function normalizeMediaType(mediaType: string): string;
8812
+ /**
8813
+ * Resolve an artifact's display mode together with the rule that selected it.
8814
+ * Always returns a canonical mode ("card" inputs resolve as "collapsed").
8815
+ *
8816
+ * Resolution order: file rules (exact MIME, then `major/*` wildcard, then the
8817
+ * files default), kind, the producer's `presentation.preferredMode` hint,
8818
+ * configured default, then `"panel"`.
8819
+ */
8820
+ declare function resolveArtifactDisplay(feature: AgentWidgetArtifactsFeature | undefined, artifact: PersonaArtifactDisplayDescriptor): PersonaArtifactDisplayResolution;
8821
+ /**
8822
+ * Resolve only the mode. Use `resolveArtifactDisplay` when a host needs to
8823
+ * explain which rule selected it.
8824
+ */
8825
+ declare function resolveArtifactDisplayMode(feature: AgentWidgetArtifactsFeature | undefined, artifact: PersonaArtifactDisplayDescriptor): PersonaArtifactDisplayMode;
8826
+
8827
+ type WidgetPreferenceParseIssueCode = "invalid_type" | "invalid_value" | "unknown_key" | "deprecated_key";
8828
+ type WidgetPreferenceParseIssue = {
8829
+ path: string;
8830
+ code: WidgetPreferenceParseIssueCode;
8831
+ message: string;
8832
+ };
8833
+ type WidgetPreferenceParseResult = {
8834
+ preferences: WidgetPreferenceSlice;
8835
+ issues: WidgetPreferenceParseIssue[];
8836
+ };
8837
+ /**
8838
+ * Parse untrusted JSON into Persona's curated preference schema.
8839
+ *
8840
+ * Unknown, invalid, capability, callback, renderer, and security fields are
8841
+ * omitted. The returned issues are suitable for logging or a settings UI.
8842
+ */
8843
+ declare function parseWidgetPreferenceSlice(input: unknown): WidgetPreferenceParseResult;
8844
+ /**
8845
+ * Overlay persisted display preferences onto code-owned feature config.
8846
+ * Only fields in `WidgetPreferenceSlice` are copied.
8847
+ */
8848
+ declare function applyFeaturePreferences(baseFeatures: AgentWidgetFeatureFlags | undefined, layers: readonly WidgetPreferenceSlice[]): AgentWidgetFeatureFlags;
8849
+ /**
8850
+ * Bake `config.preferences` into `config.features` for one widget instance.
8851
+ * Callers supporting live preference updates must re-resolve from the
8852
+ * pre-preference base features, not from a previously resolved result.
8853
+ */
8854
+ declare function resolveConfigPreferences(config: AgentWidgetConfig): AgentWidgetConfig;
8855
+
8443
8856
  declare const ASK_USER_QUESTION_TOOL_NAME = "ask_user_question";
8444
8857
  declare const isAskUserQuestionMessage: (message: AgentWidgetMessage) => boolean;
8445
8858
  /**
@@ -8480,15 +8893,18 @@ declare const removeAskUserQuestionSheet: (overlay: HTMLElement | null | undefin
8480
8893
  * `clientTools[]` (set `features.askUserQuestion.expose: true`): the same
8481
8894
  * wire surface WebMCP page tools ride. The server registers it as a LOCAL
8482
8895
  * tool under its bare name (`origin: 'sdk'` tools are not `webmcp:`-prefixed),
8483
- * so when the model calls it the execution pauses with a `step_await`
8484
- * (`awaitReason: "local_tool_required"`), the widget's answer-pill sheet
8485
- * renders, and `session.resolveAskUserQuestion()` resumes the execution with
8486
- * the structured answers.
8896
+ * so when the model calls it the execution pauses with a `step_await`, the
8897
+ * widget's answer-pill sheet renders, and `session.resolveAskUserQuestion()`
8898
+ * resumes the execution with the structured answers. The public await frame
8899
+ * for a local-tool pause carries no `awaitReason`; that discriminator is
8900
+ * internal, and its absence is what marks a client-resolvable pause.
8487
8901
  *
8488
8902
  * This replaces the previous integrator burden of hand-declaring the tool in
8489
8903
  * a flow's `runtimeTools` and keeping that schema in sync with the renderer.
8490
8904
  * Flows that already declare `ask_user_question` server-side should leave
8491
- * `expose` off: the model would otherwise see the tool twice.
8905
+ * `expose` off: the API dedupes a double declaration by name with
8906
+ * `clientTools[]` winning, so the model still sees exactly one tool, but the
8907
+ * widget's description and schema silently replace the flow's.
8492
8908
  */
8493
8909
 
8494
8910
  /**
@@ -8577,14 +8993,13 @@ declare const builtInClientToolsForDispatch: (config: AgentWidgetConfig | undefi
8577
8993
  * Built-in `suggest_replies` client tool.
8578
8994
  *
8579
8995
  * The widget can advertise this tool to the agent on every dispatch via
8580
- * `clientTools[]` (set `features.suggestReplies.expose: true`): the same
8996
+ * `clientTools[]` (set `suggestions.followUps.expose: true`): the same
8581
8997
  * wire surface as `ask_user_question` and WebMCP page tools. When the model
8582
- * calls it, the execution pauses with a `step_await`
8583
- * (`awaitReason: "local_tool_required"`); unlike `ask_user_question`, the
8584
- * widget resolves it FIRE-AND-FORGET: it renders the suggestions as tappable
8585
- * chips above the composer and immediately resumes the execution with a
8586
- * canned "shown" result, so the agent's turn completes without waiting on the
8587
- * user. Tapping a chip sends its text verbatim as the user's next message.
8998
+ * calls it, the execution pauses with a `step_await` (a local-tool pause
8999
+ * carries no `awaitReason`; that discriminator is internal). Unlike
9000
+ * `ask_user_question`, the widget resolves it FIRE-AND-FORGET: it renders the
9001
+ * configured follow-up surface and immediately resumes the execution with a
9002
+ * canned "shown" result, so the turn completes without waiting on the user.
8588
9003
  *
8589
9004
  * Chip visibility is DERIVED state, not imperative show/hide: the chips of
8590
9005
  * the last `suggest_replies` tool message with no user message after it are
@@ -8595,9 +9010,10 @@ declare const builtInClientToolsForDispatch: (config: AgentWidgetConfig | undefi
8595
9010
 
8596
9011
  declare const SUGGEST_REPLIES_TOOL_NAME = "suggest_replies";
8597
9012
  /**
8598
- * JSON Schema for the tool's parameters. Mirrors what
8599
- * {@link parseSuggestRepliesPayload} hydrates the chips from, so the schema
8600
- * the model is held to and the shape the renderer expects can never drift.
9013
+ * JSON Schema for the tool's parameters. The model owns semantics only: id,
9014
+ * icon, behavior, and emphasis are presentation, and hosts set them with the
9015
+ * `transformSuggestions` plugin hook. A single object type is used because
9016
+ * strict structured-output modes reject or flatten `oneOf`.
8601
9017
  */
8602
9018
  declare const SUGGEST_REPLIES_PARAMETERS_SCHEMA: {
8603
9019
  readonly type: "object";
@@ -8608,9 +9024,26 @@ declare const SUGGEST_REPLIES_PARAMETERS_SCHEMA: {
8608
9024
  readonly maxItems: 4;
8609
9025
  readonly description: "1-4 short, distinct follow-up replies, phrased in the user's voice.";
8610
9026
  readonly items: {
8611
- readonly type: "string";
8612
- readonly minLength: 1;
8613
- readonly maxLength: 60;
9027
+ readonly type: "object";
9028
+ readonly properties: {
9029
+ readonly label: {
9030
+ readonly type: "string";
9031
+ readonly minLength: 1;
9032
+ readonly maxLength: 80;
9033
+ };
9034
+ readonly prompt: {
9035
+ readonly type: "string";
9036
+ readonly minLength: 1;
9037
+ readonly maxLength: 500;
9038
+ };
9039
+ readonly description: {
9040
+ readonly type: "string";
9041
+ readonly minLength: 1;
9042
+ readonly maxLength: 160;
9043
+ };
9044
+ };
9045
+ readonly required: readonly ["label"];
9046
+ readonly additionalProperties: false;
8614
9047
  };
8615
9048
  };
8616
9049
  };
@@ -8619,7 +9052,7 @@ declare const SUGGEST_REPLIES_PARAMETERS_SCHEMA: {
8619
9052
  };
8620
9053
  /**
8621
9054
  * The `ClientToolDefinition` shipped on `dispatch.clientTools[]` when
8622
- * `features.suggestReplies.expose` is on. Exported so integrators who prefer
9055
+ * `suggestions.followUps.expose` is on. Exported so integrators who prefer
8623
9056
  * declaring the tool server-side (a flow's `runtimeTools`) can reuse the same
8624
9057
  * description and schema instead of hand-writing them.
8625
9058
  */
@@ -8627,18 +9060,20 @@ declare const SUGGEST_REPLIES_CLIENT_TOOL: ClientToolDefinition;
8627
9060
  /** A tool-variant message produced by a `suggest_replies` call. */
8628
9061
  declare const isSuggestRepliesMessage: (message: AgentWidgetMessage) => boolean;
8629
9062
  /**
8630
- * Tolerant parse of a `suggest_replies` tool call's args into chip labels:
8631
- * accepts a JSON string or object, coerces items to trimmed strings, drops
8632
- * empties, and truncates past the renderer cap with a console warning.
9063
+ * Tolerant parse of a `suggest_replies` tool call's args into suggestion
9064
+ * items. Plain strings stay strings for older flows that emit
9065
+ * `suggestions: string[]`; objects keep only label, prompt, and description,
9066
+ * so a model that ignores `additionalProperties` cannot set presentation.
9067
+ * Hosts add id, icon, behavior, and emphasis via `transformSuggestions`.
8633
9068
  */
8634
- declare const parseSuggestRepliesPayload: (args: unknown) => string[];
9069
+ declare const parseSuggestRepliesPayload: (args: unknown) => AgentWidgetSuggestion[];
8635
9070
  /**
8636
9071
  * The chips to show right now: those of the LAST `suggest_replies` tool
8637
9072
  * message with NO user message after it, or `null` when none apply. All
8638
9073
  * calls in a turn still get resumed (the server awaits each); only the
8639
9074
  * latest renders.
8640
9075
  */
8641
- declare const latestAgentSuggestions: (messages: AgentWidgetMessage[]) => string[] | null;
9076
+ declare const latestAgentSuggestions: (messages: AgentWidgetMessage[]) => AgentWidgetSuggestion[] | null;
8642
9077
 
8643
9078
  type WidgetHostLayoutMode = "direct" | "docked";
8644
9079
  type WidgetHostLayout = {
@@ -10358,4 +10793,4 @@ interface RovingTablistController {
10358
10793
  }
10359
10794
  declare function createRovingTablist(container: HTMLElement, options: RovingTablistOptions): RovingTablistController;
10360
10795
 
10361
- export { ASK_USER_QUESTION_CLIENT_TOOL, ASK_USER_QUESTION_PARAMETERS_SCHEMA, ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetActionContext, type AgentWidgetActionEventPayload, type AgentWidgetActionHandler, type AgentWidgetActionHandlerResult, type AgentWidgetActionParser, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetApprovalDecisionOptions, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComponentRenderer, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetConfigPatch, type AgentWidgetContextMentionChipRenderContext, type AgentWidgetContextMentionCommandContext, type AgentWidgetContextMentionComposerCapability, type AgentWidgetContextMentionConfig, type AgentWidgetContextMentionItem, type AgentWidgetContextMentionItemRenderContext, type AgentWidgetContextMentionMenuRenderContext, type AgentWidgetContextMentionPayload, type AgentWidgetContextMentionRef, type AgentWidgetContextMentionResolveContext, type AgentWidgetContextMentionSearchContext, type AgentWidgetContextMentionSource, type AgentWidgetContextMentionTokenRenderContext, type AgentWidgetContextProvider, type AgentWidgetContextProviderContext, 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 AgentWidgetMentionLlmEntry, type AgentWidgetMentionTriggerChannel, type AgentWidgetMentionTriggerPosition, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetMessageRoleLayout, type AgentWidgetParsedAction, type AgentWidgetPlugin, type AgentWidgetReadAloudEvent, type AgentWidgetRequestPayload, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, type AgentWidgetScrollBehaviorFeature, type AgentWidgetScrollMode, type AgentWidgetScrollRestorePosition, type AgentWidgetScrollToBottomFeature, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetTimestampConfig, type AgentWidgetVoiceStatusEvent, type AgentWidgetWebMcpConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, BrowserSpeechEngine, type BrowserSpeechEngineOptions, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type ClientToolDefinition, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRegistrationOptions, 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 FallbackSpeechEngineOptions, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IconName, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectComponentDirectiveOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownParsersModule, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PcmStreamPlayer, type PendingAttachment, type PersonaArtifactActionContext, type PersonaArtifactCustomAction, type PersonaArtifactDisplayMode, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactRecord, type PersonaArtifactStatusLabelContext, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, ReadAloudController, type ReadAloudListener, type ReadAloudState, type ResolvedTarget, type RovingTablistController, type RovingTablistOptions, type RuleScoringContext, type RuntypeClientChatRequest, type RuntypeClientChatStreamEvent, type RuntypeClientFeedbackRequest, type RuntypeClientFeedbackResponse, type RuntypeClientFeedbackType, type RuntypeClientInitRequest, type RuntypeClientInitResponse, type RuntypeClientResumeRequest, type RuntypeClientResumeStreamEvent, type RuntypeExecutionStreamEvent, type RuntypeFlowSSEEvent, type RuntypeStepCompleteEvent, type RuntypeStopReasonKind, type RuntypeStreamEventOf, type RuntypeTurnCompleteEvent, type SSEEventCallback, type SSEEventRecord, SUGGEST_REPLIES_CLIENT_TOOL, SUGGEST_REPLIES_PARAMETERS_SCHEMA, SUGGEST_REPLIES_TOOL_NAME, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlashCommandDefinition, type SlotRenderContext, type SlotRenderer, type SpacingScale, type SpeechCallbacks, type SpeechEngine, type SpeechRequest, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TargetResolver, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceMetrics, type VoicePlaybackEngine, type VoiceProvider, type VoiceResult, type VoiceStatus, WEBMCP_TOOL_PREFIX, WebMcpBridge, type WebMcpConfirmHandler, type WebMcpConfirmInfo, type WebMcpToolResult, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, builtInClientToolsForDispatch, 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, createRovingTablist, createSlashCommandsSource, createStandardBubble, createStaticMentionSource, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultMentionFilter, 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, isSuggestRepliesMessage, isVoiceSupported, isWebMcpToolName, latestAgentSuggestions, listRegisteredStreamAnimations, loadMarkdownParsers, markdownPostprocessor, mergeWithDefaults, normalizeContent, onMarkdownParsersReady, parseAskUserQuestionPayload, parseSuggestRepliesPayload, pickBestVoice, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, renderLucideIcon, resolveDockConfig, resolveSanitizer, resolveTokens, stripWebMcpPrefix, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };
10796
+ export { ASK_USER_QUESTION_CLIENT_TOOL, ASK_USER_QUESTION_PARAMETERS_SCHEMA, ASK_USER_QUESTION_TOOL_NAME, type AgentConfig, type AgentExecutionState, type AgentLoopConfig, type AgentMessageMetadata, type AgentRequestOptions, type AgentToolsConfig, type AgentWidgetActionContext, type AgentWidgetActionEventPayload, type AgentWidgetActionHandler, type AgentWidgetActionHandlerResult, type AgentWidgetActionParser, type AgentWidgetAgentRequestPayload, type AgentWidgetApproval, type AgentWidgetApprovalConfig, type AgentWidgetApprovalDecisionOptions, type AgentWidgetArtifactsFeature, type AgentWidgetArtifactsLayoutConfig, type AgentWidgetAskUserQuestionFeature, type AgentWidgetAskUserQuestionStyles, type AgentWidgetAttachmentsConfig, type AgentWidgetAvatarConfig, AgentWidgetClient, type AgentWidgetComponentRenderer, type AgentWidgetComposerConfig, type AgentWidgetConfig, type AgentWidgetConfigPatch, type AgentWidgetContextMentionChipRenderContext, type AgentWidgetContextMentionCommandContext, type AgentWidgetContextMentionComposerCapability, type AgentWidgetContextMentionConfig, type AgentWidgetContextMentionItem, type AgentWidgetContextMentionItemRenderContext, type AgentWidgetContextMentionMenuRenderContext, type AgentWidgetContextMentionPayload, type AgentWidgetContextMentionRef, type AgentWidgetContextMentionResolveContext, type AgentWidgetContextMentionSearchContext, type AgentWidgetContextMentionSource, type AgentWidgetContextMentionTokenRenderContext, type AgentWidgetContextProvider, type AgentWidgetContextProviderContext, type AgentWidgetController, type AgentWidgetControllerEventMap, type AgentWidgetCustomFetch, type AgentWidgetDockConfig, type AgentWidgetEvent, type AgentWidgetFeatureFlags, type AgentWidgetFollowUpSuggestionsConfig, type AgentWidgetHeaderLayoutConfig, type AgentWidgetHeadersFunction, type AgentWidgetInitHandle, type AgentWidgetInitOptions, type AgentWidgetLauncherConfig, type AgentWidgetLayoutConfig, type AgentWidgetLoadingIndicatorConfig, type AgentWidgetMarkdownConfig, type AgentWidgetMarkdownOptions, type AgentWidgetMarkdownRendererOverrides, type AgentWidgetMentionLlmEntry, type AgentWidgetMentionTriggerChannel, type AgentWidgetMentionTriggerPosition, type AgentWidgetMessage, type AgentWidgetMessageActionsConfig, type AgentWidgetMessageFeedback, type AgentWidgetMessageLayoutConfig, type AgentWidgetMessageRoleLayout, type AgentWidgetParsedAction, type AgentWidgetPlugin, type AgentWidgetReadAloudEvent, type AgentWidgetRenderSuggestionContext, type AgentWidgetRequestPayload, type AgentWidgetResolvedSuggestion, type AgentWidgetSSEEventParser, type AgentWidgetSSEEventResult, type AgentWidgetScrollBehaviorFeature, type AgentWidgetScrollMode, type AgentWidgetScrollRestorePosition, type AgentWidgetScrollToBottomFeature, AgentWidgetSession, type AgentWidgetSessionStatus, type AgentWidgetStarterSuggestionsConfig, type AgentWidgetStorageAdapter, type AgentWidgetStoredState, type AgentWidgetStreamAnimationBuffer, type AgentWidgetStreamAnimationBuiltinType, type AgentWidgetStreamAnimationFeature, type AgentWidgetStreamAnimationPlaceholder, type AgentWidgetStreamAnimationType, type AgentWidgetStreamParser, type AgentWidgetStreamParserResult, type AgentWidgetSuggestion, type AgentWidgetSuggestionBehavior, type AgentWidgetSuggestionChipsConfig, type AgentWidgetSuggestionSelectContext, type AgentWidgetSuggestionSource, type AgentWidgetSuggestionSurface, type AgentWidgetSuggestionSurfaceConfig, type AgentWidgetSuggestionVariant, type AgentWidgetSuggestionsConfig, type AgentWidgetTimestampConfig, type AgentWidgetTransformSuggestionsContext, type AgentWidgetVoiceStatusEvent, type AgentWidgetWebMcpConfig, type ArtifactConfigPayload, type ArtifactPaneTokens, type ArtifactTabTokens, type ArtifactToolbarTokens, type AskUserQuestionOption, type AskUserQuestionPayload, type AskUserQuestionPrompt, AttachmentManager, type AttachmentManagerConfig, type BorderScale, BrowserSpeechEngine, type BrowserSpeechEngineOptions, type CSATFeedbackOptions, type ClientChatRequest, type ClientFeedbackRequest, type ClientFeedbackType, type ClientInitResponse, type ClientSession, type ClientToolDefinition, type CodeFormat, type CodeGeneratorHooks, type CodeGeneratorOptions, type ColorPalette, type ColorShade, type ComboButtonHandle, type ComponentContext, type ComponentDirective, type ComponentRegistrationOptions, 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 FallbackSpeechEngineOptions, type FormatEnrichedContextOptions, type HeaderBuildContext, type HeaderElements, type HeaderLayoutContext, type HeaderLayoutRenderer, type HeaderRenderContext, type IconButtonTokens, type IconName, type IdleIndicatorRenderContext, type ImageContentPart, type InjectAssistantMessageOptions, type InjectComponentDirectiveOptions, type InjectMessageOptions, type InjectSystemMessageOptions, type InjectUserMessageOptions, type LabelButtonTokens, type LoadingIndicatorRenderContext, type LoadingIndicatorRenderer, type MarkdownParsersModule, type MarkdownProcessorOptions, type MessageActionCallbacks, type MessageContent, type MessageRenderContext, type MessageTransform, type NPSFeedbackOptions, PRESETS, PRESET_FULLSCREEN, PRESET_MINIMAL, PRESET_SHOP, type ParseOptionsConfig, type ParseRule, type PcmStreamPlayer, type PendingAttachment, type PersonaArtifactActionContext, type PersonaArtifactCustomAction, type PersonaArtifactDisplayDescriptor, type PersonaArtifactDisplayMatch, type PersonaArtifactDisplayMode, type PersonaArtifactDisplayModeInput, type PersonaArtifactDisplayResolution, type PersonaArtifactDisplayRules, type PersonaArtifactFilesDisplayRules, type PersonaArtifactKind, type PersonaArtifactManualUpsert, type PersonaArtifactPresentation, type PersonaArtifactRecord, type PersonaArtifactStatusLabelContext, type PersonaTheme, type PersonaThemePlugin, type RadiusScale, ReadAloudController, type ReadAloudListener, type ReadAloudState, type ResolvedTarget, type RovingTablistController, type RovingTablistOptions, type RuleScoringContext, type RuntypeClientChatRequest, type RuntypeClientChatStreamEvent, type RuntypeClientFeedbackRequest, type RuntypeClientFeedbackResponse, type RuntypeClientFeedbackType, type RuntypeClientInitRequest, type RuntypeClientInitResponse, type RuntypeClientResumeRequest, type RuntypeClientResumeStreamEvent, type RuntypeExecutionStreamEvent, type RuntypeFlowSSEEvent, type RuntypeStepCompleteEvent, type RuntypeStopReasonKind, type RuntypeStreamEventOf, type RuntypeTurnCompleteEvent, type SSEEventCallback, type SSEEventRecord, SUGGEST_REPLIES_CLIENT_TOOL, SUGGEST_REPLIES_PARAMETERS_SCHEMA, SUGGEST_REPLIES_TOOL_NAME, type SanitizeFunction, type SemanticColors, type SemanticSpacing, type SemanticTypography, type ShadowScale, type SlashCommandDefinition, type SlotRenderContext, type SlotRenderer, type SpacingScale, type SpeechCallbacks, type SpeechEngine, type SpeechRequest, type StreamAnimationContext, type StreamAnimationPlugin, THEME_ZONES, type TargetResolver, type TextContentPart, type ThemeValidationError, type ThemeValidationResult, type ThemeZone, type ToggleGroupHandle, type ToggleGroupItem, type ToggleGroupTokens, type TokenReference, type TypographyScale, VERSION, type VoiceConfig, type VoiceMetrics, type VoicePlaybackEngine, type VoiceProvider, type VoiceResult, type VoiceStatus, WEBMCP_TOOL_PREFIX, WebMcpBridge, type WebMcpConfirmHandler, type WebMcpConfirmInfo, type WebMcpToolResult, type WidgetArtifactLayoutPreference, type WidgetHostLayout, type WidgetHostLayoutMode, type WidgetLayoutSlot, type WidgetPreferenceCapabilities, type WidgetPreferenceParseIssue, type WidgetPreferenceParseIssueCode, type WidgetPreferenceParseResult, type WidgetPreferenceSlice, type WidgetPreset, accessibilityPlugin, animationsPlugin, applyFeaturePreferences, applyThemeVariables, attachHeaderToContainer, brandPlugin, buildComposer, buildDefaultHeader, buildHeader, buildHeaderWithLayout, buildMinimalHeader, builtInClientToolsForDispatch, canonicalArtifactDisplayMode, 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, createRovingTablist, createSlashCommandsSource, createStandardBubble, createStaticMentionSource, createTextPart, createTheme, createThemeObserver, createToggleGroup, createTypingIndicator, createVoiceProvider, createWidgetHostLayout, createXmlParser, initAgentWidget as default, defaultActionHandlers, defaultJsonActionParser, defaultMentionFilter, 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, isSuggestRepliesMessage, isVoiceSupported, isWebMcpToolName, latestAgentSuggestions, listRegisteredStreamAnimations, loadMarkdownParsers, markdownPostprocessor, mergeWithDefaults, normalizeContent, normalizeMediaType, onMarkdownParsersReady, parseAskUserQuestionPayload, parseSuggestRepliesPayload, parseWidgetPreferenceSlice, pickBestVoice, pluginRegistry, reducedMotionPlugin, registerStreamAnimationPlugin, removeAskUserQuestionSheet, renderComponentDirective, renderLoadingIndicatorWithFallback, renderLucideIcon, resolveArtifactDisplay, resolveArtifactDisplayMode, resolveConfigPreferences, resolveDockConfig, resolveSanitizer, resolveTokens, stripWebMcpPrefix, themeToCssVariables, unregisterStreamAnimationPlugin, validateImageFile, validateTheme };