@runtypelabs/persona 4.15.0 → 4.17.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 (91) hide show
  1. package/dist/codegen.cjs +1 -1
  2. package/dist/codegen.js +1 -1
  3. package/dist/context-mentions.d.cts +283 -9
  4. package/dist/context-mentions.d.ts +283 -9
  5. package/dist/index.cjs +68 -68
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +299 -10
  8. package/dist/index.d.ts +299 -10
  9. package/dist/index.global.js +57 -57
  10. package/dist/index.global.js.map +1 -1
  11. package/dist/index.js +69 -69
  12. package/dist/index.js.map +1 -1
  13. package/dist/install.global.js +1 -1
  14. package/dist/install.global.js.map +1 -1
  15. package/dist/launcher.global.js +2 -2
  16. package/dist/launcher.global.js.map +1 -1
  17. package/dist/markdown-parsers.js +36 -36
  18. package/dist/smart-dom-reader.d.cts +283 -9
  19. package/dist/smart-dom-reader.d.ts +283 -9
  20. package/dist/testing.cjs +3 -3
  21. package/dist/testing.d.cts +7 -0
  22. package/dist/testing.d.ts +7 -0
  23. package/dist/testing.js +3 -3
  24. package/dist/theme-editor-preview.cjs +64 -64
  25. package/dist/theme-editor-preview.d.cts +283 -9
  26. package/dist/theme-editor-preview.d.ts +283 -9
  27. package/dist/theme-editor-preview.js +56 -56
  28. package/dist/theme-editor.cjs +10 -10
  29. package/dist/theme-editor.d.cts +283 -10
  30. package/dist/theme-editor.d.ts +283 -10
  31. package/dist/theme-editor.js +10 -10
  32. package/dist/theme-reference.cjs +1 -1
  33. package/dist/theme-reference.d.cts +66 -3
  34. package/dist/theme-reference.d.ts +66 -3
  35. package/dist/theme-reference.js +1 -1
  36. package/dist/widget.css +1 -1
  37. package/package.json +2 -2
  38. package/src/components/artifact-pane.test.ts +27 -0
  39. package/src/components/artifact-pane.ts +7 -3
  40. package/src/components/header-builder.ts +27 -2
  41. package/src/components/header-layouts.test.ts +56 -0
  42. package/src/components/header-layouts.ts +29 -9
  43. package/src/components/launcher-surface.test.ts +403 -0
  44. package/src/components/launcher.ts +297 -2
  45. package/src/components/panel.ts +69 -74
  46. package/src/components/suggestions.test.ts +40 -0
  47. package/src/components/suggestions.ts +213 -153
  48. package/src/components/welcome.test.ts +121 -0
  49. package/src/components/welcome.ts +305 -0
  50. package/src/components/widget-view.test.ts +5 -3
  51. package/src/components/widget-view.ts +14 -7
  52. package/src/defaults.ts +2 -2
  53. package/src/index-core.ts +12 -1
  54. package/src/install.test.ts +35 -1
  55. package/src/install.ts +47 -11
  56. package/src/launcher-global.ts +10 -7
  57. package/src/plugins/types.ts +66 -1
  58. package/src/styles/widget-styles.test.ts +220 -0
  59. package/src/styles/widget.css +353 -9
  60. package/src/testing/mock-stream.test.ts +19 -0
  61. package/src/testing/mock-stream.ts +20 -0
  62. package/src/theme-editor/sections.ts +30 -1
  63. package/src/theme-reference.ts +26 -4
  64. package/src/types/theme.ts +40 -3
  65. package/src/types.ts +164 -6
  66. package/src/ui.body-top-slot.test.ts +95 -0
  67. package/src/ui.content-width.test.ts +91 -0
  68. package/src/ui.docked.test.ts +7 -4
  69. package/src/ui.launcher-teaser.test.ts +162 -0
  70. package/src/ui.rebuild-composer.test.ts +491 -0
  71. package/src/ui.render-welcome.test.ts +505 -0
  72. package/src/ui.scroll-additive.test.ts +91 -21
  73. package/src/ui.scroll.test.ts +302 -14
  74. package/src/ui.suggest-replies.test.ts +46 -0
  75. package/src/ui.ts +747 -136
  76. package/src/ui.welcome.test.ts +504 -0
  77. package/src/utils/artifact-gate.test.ts +27 -0
  78. package/src/utils/artifact-gate.ts +9 -0
  79. package/src/utils/attachment-manager.test.ts +37 -0
  80. package/src/utils/attachment-manager.ts +15 -0
  81. package/src/utils/auto-follow.test.ts +23 -0
  82. package/src/utils/auto-follow.ts +11 -1
  83. package/src/utils/config-merge.ts +2 -0
  84. package/src/utils/content-width.test.ts +37 -0
  85. package/src/utils/content-width.ts +17 -0
  86. package/src/utils/plugin-storage.test.ts +94 -0
  87. package/src/utils/plugin-storage.ts +98 -0
  88. package/src/utils/theme.test.ts +137 -0
  89. package/src/utils/tokens.ts +49 -3
  90. package/src/welcome.test.ts +213 -0
  91. package/src/welcome.ts +130 -0
@@ -1,5 +1,26 @@
1
1
  import { IconNode } from 'lucide';
2
2
 
3
+ interface ResolvedWelcomeConfig {
4
+ title: string;
5
+ subtitle: string;
6
+ icon?: AgentWidgetWelcomeIcon;
7
+ variant: AgentWidgetWelcomeVariant;
8
+ dismiss: AgentWidgetWelcomeDismiss;
9
+ /** Undefined under `variant: "hero"`, which suppresses the greeting. */
10
+ message?: string;
11
+ }
12
+
13
+ /**
14
+ * Synchronous key-value store handed to plugin render hooks. Backed by
15
+ * `localStorage`, namespaced per plugin id. The async `storageAdapter` cannot
16
+ * back a synchronous API and `persistState` is not a general key-value surface.
17
+ */
18
+ interface AgentWidgetPluginStorage {
19
+ get: (key: string) => string | null;
20
+ set: (key: string, value: string) => void;
21
+ remove: (key: string) => void;
22
+ }
23
+
3
24
  type AgentWidgetTransformSuggestionsContext = {
4
25
  /**
5
26
  * Fresh copy of the suggestions entering this plugin, already normalized:
@@ -27,6 +48,27 @@ type AgentWidgetRenderSuggestionContext = {
27
48
  */
28
49
  select: () => void;
29
50
  };
51
+ type AgentWidgetRenderWelcomeContext = {
52
+ /** Alias-resolved welcome config; never the raw `copy.welcome*` shape. */
53
+ config: ResolvedWelcomeConfig;
54
+ variant: AgentWidgetWelcomeVariant;
55
+ /** Derived visibility for this render; governs the default renderer only. */
56
+ visible: boolean;
57
+ /** The core-owned welcome card, live-updated by `controller.update()`. */
58
+ defaultRenderer: () => HTMLElement;
59
+ sendMessage: (text: string) => void;
60
+ /** Re-run welcome arbitration: cleanups run, previous content is removed. */
61
+ requestRender: () => void;
62
+ /**
63
+ * Persona's starter renderer, wired through the full select pipeline:
64
+ * `onSuggestionSelect`, cancelable `persona:suggestion:*` events, send/fill.
65
+ */
66
+ renderStarter: (suggestion: AgentWidgetSuggestion) => HTMLElement;
67
+ /** Sync store namespaced by `persistState.keyPrefix` plus the plugin id. */
68
+ storage: AgentWidgetPluginStorage;
69
+ /** Teardown for this render; runs before the next one and on destroy. */
70
+ onCleanup: (fn: () => void) => void;
71
+ };
30
72
  type AgentWidgetSuggestionSelectContext = {
31
73
  suggestion: AgentWidgetResolvedSuggestion;
32
74
  surface: AgentWidgetSuggestionSurface;
@@ -83,6 +125,34 @@ interface AgentWidgetPlugin {
83
125
  defaultRenderer: () => HTMLElement;
84
126
  onToggle: () => void;
85
127
  }) => HTMLElement | null;
128
+ /**
129
+ * Custom renderer for the welcome surface (card, hero, greeting stack).
130
+ * First plugin returning an element wins; null falls through to the default,
131
+ * same contract as `renderSuggestion`.
132
+ *
133
+ * The core owns the welcome host: it stays mounted for the panel's lifetime
134
+ * and content is swapped inside it. A plugin element renders regardless of
135
+ * `ctx.visible` (derived visibility governs the default renderer only) and
136
+ * the host overlays the transcript while that element is active, so a home
137
+ * screen can return over an existing conversation. Return null again to
138
+ * clear the overlay.
139
+ *
140
+ * The ctx carries no controller: plugins are host-instantiated, so close a
141
+ * factory over the init handle (`plugin.attach(controller)`).
142
+ *
143
+ * @example
144
+ * ```typescript
145
+ * renderWelcome: ({ config, renderStarter, requestRender, onCleanup }) => {
146
+ * const root = document.createElement("div");
147
+ * root.textContent = config.title;
148
+ * root.appendChild(renderStarter({ label: "Track my order" }));
149
+ * const timer = setInterval(requestRender, 60_000);
150
+ * onCleanup(() => clearInterval(timer));
151
+ * return root;
152
+ * }
153
+ * ```
154
+ */
155
+ renderWelcome?: (context: AgentWidgetRenderWelcomeContext) => HTMLElement | null;
86
156
  /**
87
157
  * Custom renderer for panel header
88
158
  * Return null to use default renderer
@@ -127,6 +197,15 @@ interface AgentWidgetPlugin {
127
197
  * Omitted when `config.voiceRecognition.enabled` is not true.
128
198
  */
129
199
  onVoiceToggle?: () => void;
200
+ /**
201
+ * Re-run composer arbitration and swap the footer in place. The hook runs
202
+ * once at panel construction, so this is how a composer plugin unlocks
203
+ * (returns null) or re-renders later. Pending attachments, the mention
204
+ * affordances, and the composer listener registry are re-wired by the core.
205
+ */
206
+ requestRender: () => void;
207
+ /** Same sync store as the `renderWelcome` ctx, namespaced per plugin id. */
208
+ storage: AgentWidgetPluginStorage;
130
209
  }) => HTMLElement | null;
131
210
  /**
132
211
  * Custom renderer for reasoning bubbles
@@ -507,6 +586,15 @@ interface PanelTokens extends ComponentTokenSet {
507
586
  /** Background of the region revealed behind a detached panel. */
508
587
  canvasBackground?: string;
509
588
  }
589
+ /** Per-element text styling shared by themable text surfaces. */
590
+ interface TextStyleTokens {
591
+ fontFamily?: string;
592
+ fontSize?: string;
593
+ fontWeight?: string;
594
+ lineHeight?: string;
595
+ letterSpacing?: string;
596
+ color?: TokenReference<'color'>;
597
+ }
510
598
  interface HeaderTokens extends ComponentTokenSet {
511
599
  background: TokenReference<'color'>;
512
600
  border: TokenReference<'color'>;
@@ -515,10 +603,14 @@ interface HeaderTokens extends ComponentTokenSet {
515
603
  iconBackground: TokenReference<'color'>;
516
604
  /** Foreground (glyph stroke or emoji text) on the header avatar tile. */
517
605
  iconForeground: TokenReference<'color'>;
518
- /** Header title line (next to the icon, or minimal layout title). */
606
+ /** Legacy alias of `title.color`; `title.color` wins when both are set. */
519
607
  titleForeground: TokenReference<'color'>;
520
- /** Header subtitle line under the title. */
608
+ /** Legacy alias of `subtitle.color`; `subtitle.color` wins when both are set. */
521
609
  subtitleForeground: TokenReference<'color'>;
610
+ /** Header title typography (next to the icon, or minimal layout title). */
611
+ title?: TextStyleTokens;
612
+ /** Header subtitle typography, for the line under the title. */
613
+ subtitle?: TextStyleTokens;
522
614
  /** Default color for clear / close icon buttons when launcher overrides are unset. */
523
615
  actionIconForeground: TokenReference<'color'>;
524
616
  /** Box-shadow on the header (e.g., a fade shadow to replace the default border). */
@@ -548,7 +640,7 @@ interface MessageTokens {
548
640
  }
549
641
  /**
550
642
  * Welcome / intro card rendered above the message list when no messages exist.
551
- * Set `copy.showWelcomeCard: false` to hide it; use `layout.slots["body-top"]`
643
+ * Set `welcome.variant: "none"` to hide it; use `layout.slots["body-top"]`
552
644
  * to replace it wholesale.
553
645
  */
554
646
  interface IntroCardTokens extends ComponentTokenSet {
@@ -557,6 +649,12 @@ interface IntroCardTokens extends ComponentTokenSet {
557
649
  padding?: TokenReference<'spacing'>;
558
650
  /** Box-shadow on the intro card (token ref or raw CSS, e.g. `none`). */
559
651
  shadow?: string;
652
+ /** Full border shorthand on the intro card (raw CSS, e.g. `"1px solid rgba(0,0,0,0.1)"`). @default "none" */
653
+ border?: string;
654
+ /** Welcome title typography. */
655
+ title?: TextStyleTokens;
656
+ /** Welcome subtitle typography. */
657
+ subtitle?: TextStyleTokens;
560
658
  }
561
659
  /** Collapsible widget chrome (tool bubbles, reasoning bubbles, approval bubbles). */
562
660
  interface CollapsibleWidgetTokens {
@@ -599,6 +697,8 @@ interface MarkdownTokens {
599
697
  background?: TokenReference<'color'>;
600
698
  borderColor?: TokenReference<'color'>;
601
699
  textColor?: TokenReference<'color'>;
700
+ /** Corner radius; follows `palette.radius.md` by default so square-corner themes get square code blocks. */
701
+ borderRadius?: TokenReference<'radius'>;
602
702
  };
603
703
  /** Table styling. */
604
704
  table?: {
@@ -656,10 +756,19 @@ interface ToolBubbleTokens {
656
756
  interface ReasoningBubbleTokens {
657
757
  shadow: string;
658
758
  }
759
+ /** Scrollbar appearance shared by every scroller in the widget. */
760
+ interface ScrollbarTokens {
761
+ /** Thumb color. @default semantic.colors.border */
762
+ thumb?: TokenReference<'color'>;
763
+ /** Track color. @default "transparent" */
764
+ track?: TokenReference<'color'>;
765
+ }
659
766
  /** Composer (message input) chrome. */
660
767
  interface ComposerChromeTokens {
661
768
  /** Box-shadow on the composer form (raw CSS, e.g. `none`). */
662
769
  shadow: string;
770
+ /** Border color of the composer form. @default semantic.colors.border */
771
+ borderColor?: TokenReference<'color'>;
663
772
  /** Inner padding of the composer form (raw CSS shorthand). @default "0.75rem 1rem" */
664
773
  padding?: string;
665
774
  /** Gap between the textarea row and the actions row. @default "0.5rem" */
@@ -819,7 +928,10 @@ interface ScrollToBottomTokens extends ComponentTokenSet {
819
928
  }
820
929
  /** Visual tokens shared by one suggestion presentation variant. */
821
930
  interface SuggestionVariantTokens extends ComponentTokenSet {
931
+ /** Space inside one item, between its icon and its copy. */
822
932
  gap?: string;
933
+ /** Space between suggestion items in the container. */
934
+ itemGap?: string;
823
935
  minHeight?: string;
824
936
  fontSize?: string;
825
937
  lineHeight?: string;
@@ -861,6 +973,8 @@ interface ComponentTokens {
861
973
  toolBubble: ToolBubbleTokens;
862
974
  reasoningBubble: ReasoningBubbleTokens;
863
975
  composer: ComposerChromeTokens;
976
+ /** Scrollbar appearance for every scroller in the widget. */
977
+ scrollbar?: ScrollbarTokens;
864
978
  /** Icon button styling tokens. */
865
979
  iconButton?: IconButtonTokens;
866
980
  /** Label button styling tokens. */
@@ -2559,6 +2673,13 @@ type AgentWidgetArtifactsLayoutConfig = {
2559
2673
  * @default 520
2560
2674
  */
2561
2675
  narrowHostMaxWidth?: number;
2676
+ /**
2677
+ * Width of the slide-over artifact drawer (the narrow-host and mobile
2678
+ * presentations; `paneWidth`/`paneMaxWidth` only size the desktop split).
2679
+ * CSS length; `"100%"` makes the drawer cover the whole panel.
2680
+ * @default min(calc(100% - 1rem), 22rem)
2681
+ */
2682
+ drawerWidth?: string;
2562
2683
  /**
2563
2684
  * When true (default), widen the launcher panel while artifacts are visible and not user-dismissed.
2564
2685
  * No-op for inline embed (`launcher.enabled === false`).
@@ -3187,6 +3308,18 @@ type AgentWidgetScrollMode = "follow" | "anchor-top" | "none";
3187
3308
  * restored thread opens at a readable place rather than at the very bottom.
3188
3309
  */
3189
3310
  type AgentWidgetScrollRestorePosition = "bottom" | "last-user-turn";
3311
+ /**
3312
+ * Scrollbar visibility policy for every scroll surface in the widget.
3313
+ *
3314
+ * - `"on-scroll"` hides bars at rest and reveals them on genuine reader
3315
+ * input, keeping them visible while the reader is away from the resting
3316
+ * position: overlay-scrollbar semantics on every platform.
3317
+ * - `"auto"` keeps the themed bar under native visibility semantics: overlay
3318
+ * platforms still auto-hide, classic-scrollbar platforms (Windows,
3319
+ * always-show macOS) show it persistently.
3320
+ * - `"hidden"` never shows an indicator. Scrolling itself is unaffected.
3321
+ */
3322
+ type AgentWidgetScrollbarPolicy = "on-scroll" | "auto" | "hidden";
3190
3323
  type AgentWidgetScrollBehaviorFeature = {
3191
3324
  /** Scroll behavior during streamed responses. @default "anchor-top" */
3192
3325
  mode?: AgentWidgetScrollMode;
@@ -3231,6 +3364,13 @@ type AgentWidgetScrollBehaviorFeature = {
3231
3364
  * @default false
3232
3365
  */
3233
3366
  announce?: boolean;
3367
+ /**
3368
+ * Scrollbar visibility policy, applied to the transcript and every inner
3369
+ * scroller through one root attribute. Themable via
3370
+ * `--persona-scrollbar-thumb` and `--persona-scrollbar-track`.
3371
+ * @default "on-scroll"
3372
+ */
3373
+ scrollbar?: AgentWidgetScrollbarPolicy;
3234
3374
  };
3235
3375
  type AgentWidgetScrollToBottomFeature = {
3236
3376
  /**
@@ -4131,6 +4271,57 @@ type AgentWidgetLauncherConfig = {
4131
4271
  * @example "min(380px, calc(100vw - 48px))"
4132
4272
  */
4133
4273
  collapsedMaxWidth?: string;
4274
+ /**
4275
+ * Proactive nudge bubble anchored above the collapsed floating launcher.
4276
+ * Omit it (the default) and no teaser renders.
4277
+ */
4278
+ teaser?: AgentWidgetLauncherTeaserConfig;
4279
+ };
4280
+ /**
4281
+ * Launcher teaser: a small bubble above the collapsed launcher. Clicking it
4282
+ * opens the panel and consumes the teaser exactly like an explicit dismissal.
4283
+ * Within a single page load the teaser appears at most once under either
4284
+ * frequency.
4285
+ *
4286
+ * @example
4287
+ * ```typescript
4288
+ * launcher: {
4289
+ * teaser: { text: "Need a hand picking a plan?", delayMs: 3000 }
4290
+ * }
4291
+ * ```
4292
+ */
4293
+ type AgentWidgetLauncherTeaserConfig = {
4294
+ /** Bubble copy. An empty string renders no teaser. */
4295
+ text: string;
4296
+ /**
4297
+ * Delay before the bubble appears, in milliseconds.
4298
+ * @default 0
4299
+ */
4300
+ delayMs?: number;
4301
+ /**
4302
+ * How often the teaser may return.
4303
+ *
4304
+ * `"once"`: a dismissal or a click-through is remembered in `localStorage`
4305
+ * under `` `${persistState.keyPrefix ?? "persona-"}teaser-dismissed` `` and
4306
+ * the teaser never returns on that browser. `"always"`: shows on every page
4307
+ * load, tracked in memory only. `persistState: false` downgrades `"once"` to
4308
+ * in-memory too, so the teaser reappears each load.
4309
+ *
4310
+ * Custom `storageAdapter` implementations do not participate in teaser state.
4311
+ *
4312
+ * @default "once"
4313
+ */
4314
+ frequency?: "once" | "always";
4315
+ /**
4316
+ * Render an x affordance that dismisses the teaser without opening the panel.
4317
+ * @default true
4318
+ */
4319
+ dismissible?: boolean;
4320
+ /**
4321
+ * Accessible label for the dismiss affordance.
4322
+ * @default "Dismiss message"
4323
+ */
4324
+ dismissLabel?: string;
4134
4325
  };
4135
4326
  type AgentWidgetSendButtonConfig = {
4136
4327
  borderWidth?: string;
@@ -4883,7 +5074,10 @@ type AgentWidgetSuggestion = string | {
4883
5074
  label: string;
4884
5075
  /** Text placed in the composer or sent. Defaults to `label`. */
4885
5076
  prompt?: string;
4886
- /** Optional supporting copy, most useful with the `card` variant. */
5077
+ /**
5078
+ * Optional supporting copy, most useful with the `card` variant. The
5079
+ * `chip` variant ignores it and renders the label alone.
5080
+ */
4887
5081
  description?: string;
4888
5082
  /** Optional icon from Persona's bundled Lucide registry. */
4889
5083
  icon?: IconName;
@@ -4927,9 +5121,10 @@ type AgentWidgetSuggestionSurfaceConfig = {
4927
5121
  /** Default click behavior, overridable per item. Defaults to `send`. */
4928
5122
  behavior?: AgentWidgetSuggestionBehavior;
4929
5123
  /**
4930
- * Layout for items past the surface width. Defaults to `wrap` for starters
4931
- * and `scroll` for follow-ups. Applies to the `chip` variant only; the
4932
- * `card` and `list` layouts manage their own stacking.
5124
+ * Layout for items past the surface width. Defaults to `wrap` on every
5125
+ * surface; `scroll` opts into a horizontal strip for large sets. Applies
5126
+ * to the `chip` variant only; the `card` and `list` layouts manage their
5127
+ * own stacking.
4933
5128
  */
4934
5129
  overflow?: "scroll" | "wrap";
4935
5130
  /** Maximum visible items. Defaults to 4. */
@@ -4978,6 +5173,70 @@ type AgentWidgetSuggestionsConfig = {
4978
5173
  starters?: AgentWidgetStarterSuggestionsConfig;
4979
5174
  followUps?: AgentWidgetFollowUpSuggestionsConfig;
4980
5175
  };
5176
+ /**
5177
+ * Which welcome surface renders.
5178
+ * `"card"` is the top-of-scroll intro card (default, back-compatible),
5179
+ * `"hero"` centers it in the empty conversation, `"none"` renders no surface.
5180
+ */
5181
+ type AgentWidgetWelcomeVariant = "card" | "hero" | "none";
5182
+ /**
5183
+ * When the welcome surface goes away. `"never"` is the default for `"card"`;
5184
+ * `"on-first-message"` is the default for `"hero"` and cannot be overridden
5185
+ * there.
5186
+ */
5187
+ type AgentWidgetWelcomeDismiss = "never" | "on-first-message";
5188
+ /**
5189
+ * Avatar or logo shown above the welcome title. Discriminated union; the
5190
+ * function form is the escape hatch for custom markup. There is deliberately
5191
+ * no raw HTML string variant (sanitization surface plus accessibility hole).
5192
+ */
5193
+ type AgentWidgetWelcomeIcon = {
5194
+ type: "lucide";
5195
+ name: IconName;
5196
+ }
5197
+ /** `alt` is required, and may be `""` for a decorative logo. */
5198
+ | {
5199
+ type: "image";
5200
+ url: string;
5201
+ alt: string;
5202
+ }
5203
+ /** Emoji or short text glyph. */
5204
+ | {
5205
+ type: "text";
5206
+ text: string;
5207
+ } | (() => HTMLElement | SVGElement);
5208
+ /**
5209
+ * First-open welcome surface. Consolidates the deprecated
5210
+ * `copy.welcomeTitle` / `copy.welcomeSubtitle` / `copy.showWelcomeCard`
5211
+ * options; a field present here wins over its legacy alias.
5212
+ *
5213
+ * All defaults live in the resolver (`resolveWelcomeConfig`), never in
5214
+ * `DEFAULT_WIDGET_CONFIG`: presence on this object is what distinguishes a
5215
+ * host-set value from a filled-in default.
5216
+ */
5217
+ interface AgentWidgetWelcomeConfig {
5218
+ /** Card or hero title. Defaults to "Hello 👋". */
5219
+ title?: string;
5220
+ /** Scope statement in the assistant's voice. Empty string omits it. */
5221
+ subtitle?: string;
5222
+ /** Avatar or logo shown above the title. */
5223
+ icon?: AgentWidgetWelcomeIcon;
5224
+ /** @default "card" */
5225
+ variant?: AgentWidgetWelcomeVariant;
5226
+ /** @default "never" for `card`, always `"on-first-message"` for `hero`. */
5227
+ dismiss?: AgentWidgetWelcomeDismiss;
5228
+ /**
5229
+ * Display-only greeting bubble pinned at transcript position zero. It is UI
5230
+ * chrome derived from config, never a session message: it does not appear in
5231
+ * `getMessages()`, is never persisted or sent to the model, `onMessage` does
5232
+ * not fire for it, and it survives `clearChat()`. Use an assistant
5233
+ * `initialMessages` entry instead when the model should see the greeting.
5234
+ *
5235
+ * Ignored (with a debug-mode warning) when `variant` is `"hero"`: the hero
5236
+ * is the greeting.
5237
+ */
5238
+ message?: string;
5239
+ }
4981
5240
  /**
4982
5241
  * Interface for pluggable stream parsers that extract text from streaming responses.
4983
5242
  * Parsers handle incremental parsing to extract text values from structured formats (JSON, XML, etc.).
@@ -5159,7 +5418,9 @@ type AgentWidgetHeaderLayoutConfig = {
5159
5418
  */
5160
5419
  render?: (context: HeaderRenderContext) => HTMLElement;
5161
5420
  /**
5162
- * Shown after the title in `minimal` header layout (e.g. chevron menu affordance).
5421
+ * Icon action buttons at the trailing edge of the `minimal` header layout,
5422
+ * clustered with the close button and sharing its chrome. For a menu
5423
+ * affordance next to the title, use `titleMenu` instead.
5163
5424
  */
5164
5425
  trailingActions?: AgentWidgetHeaderTrailingAction[];
5165
5426
  /** Called when a `trailingActions` button is clicked. */
@@ -5339,7 +5600,11 @@ type AgentWidgetLayoutConfig = {
5339
5600
  /**
5340
5601
  * Max width for the content area (messages + composer).
5341
5602
  * Applied with `margin: 0 auto` for centering.
5342
- * Accepts any CSS width value (e.g. "90ch", "720px", "80%").
5603
+ * Accepts any CSS width value (e.g. "90ch", "720px", "80%"), or "none"
5604
+ * for a full-width column. Only engages on panels wider than the cap,
5605
+ * so launcher-width panels are unaffected.
5606
+ * @default "768px" ("720px" in composer-bar mode via
5607
+ * `launcher.composerBar.contentMaxWidth`)
5343
5608
  */
5344
5609
  contentMaxWidth?: string;
5345
5610
  };
@@ -6087,7 +6352,9 @@ type AgentWidgetConfig = {
6087
6352
  */
6088
6353
  getHeaders?: AgentWidgetHeadersFunction;
6089
6354
  copy?: {
6355
+ /** @deprecated Use `welcome.title`. */
6090
6356
  welcomeTitle?: string;
6357
+ /** @deprecated Use `welcome.subtitle`. */
6091
6358
  welcomeSubtitle?: string;
6092
6359
  inputPlaceholder?: string;
6093
6360
  sendButtonLabel?: string;
@@ -6095,6 +6362,7 @@ type AgentWidgetConfig = {
6095
6362
  stopButtonLabel?: string;
6096
6363
  /**
6097
6364
  * When false, the welcome / intro card is not shown above the message list.
6365
+ * @deprecated Use `welcome.variant: "none"`.
6098
6366
  * @default true
6099
6367
  */
6100
6368
  showWelcomeCard?: boolean;
@@ -6161,6 +6429,12 @@ type AgentWidgetConfig = {
6161
6429
  initialSelectedArtifactId?: string | null;
6162
6430
  /** Rich starter and follow-up suggestion surfaces. */
6163
6431
  suggestions?: AgentWidgetSuggestionsConfig;
6432
+ /**
6433
+ * First-open welcome surface (card, hero, or none) plus the optional
6434
+ * display-only greeting bubble. Supersedes `copy.welcomeTitle`,
6435
+ * `copy.welcomeSubtitle`, and `copy.showWelcomeCard`.
6436
+ */
6437
+ welcome?: AgentWidgetWelcomeConfig;
6164
6438
  /** @deprecated Prefer `suggestions.starters.items`. */
6165
6439
  suggestionChips?: string[];
6166
6440
  /** @deprecated Prefer semantic tokens under `theme.components.suggestion`. */