@runtypelabs/persona 4.14.0 → 4.16.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.
- package/README.md +4 -4
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-DveIaNx6.d.cts → types-BpWGm7_6.d.cts} +17 -0
- package/dist/animations/{types-DveIaNx6.d.ts → types-BpWGm7_6.d.ts} +17 -0
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/chunk-QJ4LV2KW.js +1 -0
- package/dist/codegen.cjs +12 -11
- package/dist/codegen.js +14 -13
- package/dist/{context-mentions-ONG7A7M6.js → context-mentions-BTSTIBFC.js} +1 -1
- package/dist/context-mentions.cjs +11 -8
- package/dist/context-mentions.d.cts +520 -21
- package/dist/context-mentions.d.ts +520 -21
- package/dist/context-mentions.js +11 -8
- package/dist/index.cjs +69 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +595 -46
- package/dist/index.d.ts +595 -46
- package/dist/index.global.js +60 -57
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +69 -68
- package/dist/index.js.map +1 -1
- package/dist/launcher.global.js +5 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/smart-dom-reader.d.cts +520 -21
- package/dist/smart-dom-reader.d.ts +520 -21
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.cts +7 -0
- package/dist/testing.d.ts +7 -0
- package/dist/testing.js +3 -3
- package/dist/theme-editor-preview.cjs +67 -67
- package/dist/theme-editor-preview.d.cts +534 -22
- package/dist/theme-editor-preview.d.ts +534 -22
- package/dist/theme-editor-preview.js +57 -57
- package/dist/theme-editor.cjs +10 -10
- package/dist/theme-editor.d.cts +521 -23
- package/dist/theme-editor.d.ts +521 -23
- package/dist/theme-editor.js +10 -10
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +104 -3
- package/dist/theme-reference.d.ts +104 -3
- package/dist/theme-reference.js +1 -1
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/src/ask-user-question-tool.ts +10 -7
- package/src/components/artifact-pane.test.ts +27 -0
- package/src/components/artifact-pane.ts +7 -3
- package/src/components/artifact-preview.ts +1 -1
- package/src/components/composer-parts.test.ts +103 -4
- package/src/components/composer-parts.ts +53 -15
- package/src/components/header-builder.ts +27 -2
- package/src/components/header-layouts.test.ts +56 -0
- package/src/components/header-layouts.ts +29 -9
- package/src/components/launcher-surface.test.ts +403 -0
- package/src/components/launcher.ts +297 -2
- package/src/components/messages.ts +5 -2
- package/src/components/panel.ts +92 -71
- package/src/components/pill-composer-builder.test.ts +18 -0
- package/src/components/suggestions.test.ts +273 -0
- package/src/components/suggestions.ts +528 -86
- package/src/components/welcome.test.ts +121 -0
- package/src/components/welcome.ts +305 -0
- package/src/components/widget-view.test.ts +5 -3
- package/src/components/widget-view.ts +18 -7
- package/src/defaults.ts +7 -5
- package/src/generated/runtype-openapi-contract.ts +17 -0
- package/src/index-core.ts +29 -2
- package/src/launcher-global.ts +11 -8
- package/src/plugins/types.ts +136 -3
- package/src/presets.ts +3 -3
- package/src/session.ts +10 -8
- package/src/styles/widget-styles.test.ts +382 -0
- package/src/styles/widget.css +778 -4
- package/src/suggest-replies-tool.test.ts +233 -2
- package/src/suggest-replies-tool.ts +115 -39
- package/src/testing/mock-stream.test.ts +19 -0
- package/src/testing/mock-stream.ts +20 -0
- package/src/theme-editor/preview-utils.test.ts +34 -0
- package/src/theme-editor/preview-utils.ts +77 -2
- package/src/theme-editor/sections.test.ts +33 -0
- package/src/theme-editor/sections.ts +83 -6
- package/src/theme-reference.ts +34 -5
- package/src/types/theme.ts +72 -3
- package/src/types.ts +312 -18
- package/src/ui.body-top-slot.test.ts +95 -0
- package/src/ui.content-width.test.ts +91 -0
- package/src/ui.detached-panel.test.ts +1 -1
- package/src/ui.docked.test.ts +7 -4
- package/src/ui.launcher-teaser.test.ts +162 -0
- package/src/ui.rebuild-composer.test.ts +491 -0
- package/src/ui.render-welcome.test.ts +505 -0
- package/src/ui.scroll-additive.test.ts +91 -21
- package/src/ui.scroll.test.ts +302 -14
- package/src/ui.suggest-replies.test.ts +1112 -1
- package/src/ui.ts +1008 -149
- package/src/ui.welcome.test.ts +504 -0
- package/src/utils/artifact-file.test.ts +1 -1
- package/src/utils/artifact-gate.test.ts +27 -0
- package/src/utils/artifact-gate.ts +9 -0
- package/src/utils/attachment-manager.test.ts +37 -0
- package/src/utils/attachment-manager.ts +15 -0
- package/src/utils/auto-follow.test.ts +23 -0
- package/src/utils/auto-follow.ts +11 -1
- package/src/utils/code-generators.test.ts +40 -0
- package/src/utils/code-generators.ts +22 -0
- package/src/utils/config-merge.test.ts +24 -0
- package/src/utils/config-merge.ts +2 -0
- package/src/utils/content-width.test.ts +37 -0
- package/src/utils/content-width.ts +17 -0
- package/src/utils/icons.test.ts +26 -0
- package/src/utils/icons.ts +8 -0
- package/src/utils/plugin-storage.test.ts +94 -0
- package/src/utils/plugin-storage.ts +98 -0
- package/src/utils/theme.test.ts +216 -0
- package/src/utils/tokens.ts +113 -3
- package/src/welcome.test.ts +213 -0
- package/src/welcome.ts +130 -0
- package/dist/chunk-MMUPR2JW.js +0 -1
|
@@ -1,5 +1,81 @@
|
|
|
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
|
+
|
|
24
|
+
type AgentWidgetTransformSuggestionsContext = {
|
|
25
|
+
/**
|
|
26
|
+
* Fresh copy of the suggestions entering this plugin, already normalized:
|
|
27
|
+
* shorthand strings expanded and the effective send/fill behavior resolved.
|
|
28
|
+
*/
|
|
29
|
+
suggestions: AgentWidgetResolvedSuggestion[];
|
|
30
|
+
surface: AgentWidgetSuggestionSurface;
|
|
31
|
+
source: AgentWidgetSuggestionSource;
|
|
32
|
+
config: AgentWidgetConfig;
|
|
33
|
+
};
|
|
34
|
+
type AgentWidgetRenderSuggestionContext = {
|
|
35
|
+
/** Fully normalized suggestion, including the effective send/fill behavior. */
|
|
36
|
+
suggestion: AgentWidgetResolvedSuggestion;
|
|
37
|
+
index: number;
|
|
38
|
+
surface: AgentWidgetSuggestionSurface;
|
|
39
|
+
source: AgentWidgetSuggestionSource;
|
|
40
|
+
variant: AgentWidgetSuggestionVariant;
|
|
41
|
+
streaming: boolean;
|
|
42
|
+
config: AgentWidgetConfig;
|
|
43
|
+
/** Build Persona's standard chip, card, or list item. */
|
|
44
|
+
defaultRenderer: () => HTMLElement;
|
|
45
|
+
/**
|
|
46
|
+
* Run the normal selection pipeline: DOM event, plugin selection hooks, then
|
|
47
|
+
* send or fill. Custom renderers should call this instead of sending directly.
|
|
48
|
+
*/
|
|
49
|
+
select: () => void;
|
|
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
|
+
};
|
|
72
|
+
type AgentWidgetSuggestionSelectContext = {
|
|
73
|
+
suggestion: AgentWidgetResolvedSuggestion;
|
|
74
|
+
surface: AgentWidgetSuggestionSurface;
|
|
75
|
+
source: AgentWidgetSuggestionSource;
|
|
76
|
+
variant: AgentWidgetSuggestionVariant;
|
|
77
|
+
config: AgentWidgetConfig;
|
|
78
|
+
};
|
|
3
79
|
/**
|
|
4
80
|
* Plugin interface for customizing widget components
|
|
5
81
|
*/
|
|
@@ -12,6 +88,25 @@ interface AgentWidgetPlugin {
|
|
|
12
88
|
* Optional priority (higher = runs first). Default: 0
|
|
13
89
|
*/
|
|
14
90
|
priority?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Transform, filter, enrich, or reorder suggestions. Hooks receive normalized
|
|
93
|
+
* items and compose in plugin priority order; the return value may use the
|
|
94
|
+
* loose shape (string shorthand included) and is re-normalized before the next
|
|
95
|
+
* hook. A per-item `behavior` set here survives. `maxItems` caps the list
|
|
96
|
+
* after the full chain. Return an empty array to hide the surface.
|
|
97
|
+
*/
|
|
98
|
+
transformSuggestions?: (context: AgentWidgetTransformSuggestionsContext) => AgentWidgetSuggestion[];
|
|
99
|
+
/**
|
|
100
|
+
* Render one starter or follow-up suggestion. Return null to use Persona's
|
|
101
|
+
* default chip/card/list renderer. Call `select()` from custom interaction
|
|
102
|
+
* controls to preserve events, selection hooks, and send/fill behavior.
|
|
103
|
+
*/
|
|
104
|
+
renderSuggestion?: (context: AgentWidgetRenderSuggestionContext) => HTMLElement | null;
|
|
105
|
+
/**
|
|
106
|
+
* Observe or intercept a suggestion selection. Return false to cancel the
|
|
107
|
+
* built-in send/fill action. Hooks run in plugin priority order.
|
|
108
|
+
*/
|
|
109
|
+
onSuggestionSelect?: (context: AgentWidgetSuggestionSelectContext) => void | boolean;
|
|
15
110
|
/**
|
|
16
111
|
* Custom renderer for message bubbles
|
|
17
112
|
* Return null to use default renderer
|
|
@@ -30,6 +125,34 @@ interface AgentWidgetPlugin {
|
|
|
30
125
|
defaultRenderer: () => HTMLElement;
|
|
31
126
|
onToggle: () => void;
|
|
32
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;
|
|
33
156
|
/**
|
|
34
157
|
* Custom renderer for panel header
|
|
35
158
|
* Return null to use default renderer
|
|
@@ -74,6 +197,15 @@ interface AgentWidgetPlugin {
|
|
|
74
197
|
* Omitted when `config.voiceRecognition.enabled` is not true.
|
|
75
198
|
*/
|
|
76
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;
|
|
77
209
|
}) => HTMLElement | null;
|
|
78
210
|
/**
|
|
79
211
|
* Custom renderer for reasoning bubbles
|
|
@@ -454,6 +586,15 @@ interface PanelTokens extends ComponentTokenSet {
|
|
|
454
586
|
/** Background of the region revealed behind a detached panel. */
|
|
455
587
|
canvasBackground?: string;
|
|
456
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
|
+
}
|
|
457
598
|
interface HeaderTokens extends ComponentTokenSet {
|
|
458
599
|
background: TokenReference<'color'>;
|
|
459
600
|
border: TokenReference<'color'>;
|
|
@@ -462,10 +603,14 @@ interface HeaderTokens extends ComponentTokenSet {
|
|
|
462
603
|
iconBackground: TokenReference<'color'>;
|
|
463
604
|
/** Foreground (glyph stroke or emoji text) on the header avatar tile. */
|
|
464
605
|
iconForeground: TokenReference<'color'>;
|
|
465
|
-
/**
|
|
606
|
+
/** Legacy alias of `title.color`; `title.color` wins when both are set. */
|
|
466
607
|
titleForeground: TokenReference<'color'>;
|
|
467
|
-
/**
|
|
608
|
+
/** Legacy alias of `subtitle.color`; `subtitle.color` wins when both are set. */
|
|
468
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;
|
|
469
614
|
/** Default color for clear / close icon buttons when launcher overrides are unset. */
|
|
470
615
|
actionIconForeground: TokenReference<'color'>;
|
|
471
616
|
/** Box-shadow on the header (e.g., a fade shadow to replace the default border). */
|
|
@@ -495,7 +640,7 @@ interface MessageTokens {
|
|
|
495
640
|
}
|
|
496
641
|
/**
|
|
497
642
|
* Welcome / intro card rendered above the message list when no messages exist.
|
|
498
|
-
* Set `
|
|
643
|
+
* Set `welcome.variant: "none"` to hide it; use `layout.slots["body-top"]`
|
|
499
644
|
* to replace it wholesale.
|
|
500
645
|
*/
|
|
501
646
|
interface IntroCardTokens extends ComponentTokenSet {
|
|
@@ -504,6 +649,12 @@ interface IntroCardTokens extends ComponentTokenSet {
|
|
|
504
649
|
padding?: TokenReference<'spacing'>;
|
|
505
650
|
/** Box-shadow on the intro card (token ref or raw CSS, e.g. `none`). */
|
|
506
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;
|
|
507
658
|
}
|
|
508
659
|
/** Collapsible widget chrome (tool bubbles, reasoning bubbles, approval bubbles). */
|
|
509
660
|
interface CollapsibleWidgetTokens {
|
|
@@ -546,6 +697,8 @@ interface MarkdownTokens {
|
|
|
546
697
|
background?: TokenReference<'color'>;
|
|
547
698
|
borderColor?: TokenReference<'color'>;
|
|
548
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'>;
|
|
549
702
|
};
|
|
550
703
|
/** Table styling. */
|
|
551
704
|
table?: {
|
|
@@ -603,10 +756,27 @@ interface ToolBubbleTokens {
|
|
|
603
756
|
interface ReasoningBubbleTokens {
|
|
604
757
|
shadow: string;
|
|
605
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
|
+
}
|
|
606
766
|
/** Composer (message input) chrome. */
|
|
607
767
|
interface ComposerChromeTokens {
|
|
608
768
|
/** Box-shadow on the composer form (raw CSS, e.g. `none`). */
|
|
609
769
|
shadow: string;
|
|
770
|
+
/** Border color of the composer form. @default semantic.colors.border */
|
|
771
|
+
borderColor?: TokenReference<'color'>;
|
|
772
|
+
/** Inner padding of the composer form (raw CSS shorthand). @default "0.75rem 1rem" */
|
|
773
|
+
padding?: string;
|
|
774
|
+
/** Gap between the textarea row and the actions row. @default "0.5rem" */
|
|
775
|
+
gap?: string;
|
|
776
|
+
/** Composer textarea font-size. @default "0.875rem" */
|
|
777
|
+
fontSize?: string;
|
|
778
|
+
/** Composer textarea line-height. @default "1.25rem" */
|
|
779
|
+
lineHeight?: string;
|
|
610
780
|
}
|
|
611
781
|
/** Artifact toolbar chrome. */
|
|
612
782
|
interface ArtifactToolbarTokens {
|
|
@@ -756,6 +926,29 @@ interface ScrollToBottomTokens extends ComponentTokenSet {
|
|
|
756
926
|
fontSize?: string;
|
|
757
927
|
iconSize?: string;
|
|
758
928
|
}
|
|
929
|
+
/** Visual tokens shared by one suggestion presentation variant. */
|
|
930
|
+
interface SuggestionVariantTokens extends ComponentTokenSet {
|
|
931
|
+
/** Space inside one item, between its icon and its copy. */
|
|
932
|
+
gap?: string;
|
|
933
|
+
/** Space between suggestion items in the container. */
|
|
934
|
+
itemGap?: string;
|
|
935
|
+
minHeight?: string;
|
|
936
|
+
fontSize?: string;
|
|
937
|
+
lineHeight?: string;
|
|
938
|
+
iconSize?: string;
|
|
939
|
+
hoverBackground?: TokenReference<'color'>;
|
|
940
|
+
hoverForeground?: TokenReference<'color'>;
|
|
941
|
+
hoverBorder?: TokenReference<'color'>;
|
|
942
|
+
pressedBackground?: TokenReference<'color'>;
|
|
943
|
+
focusRing?: TokenReference<'color'>;
|
|
944
|
+
disabledOpacity?: string;
|
|
945
|
+
}
|
|
946
|
+
/** Starter and follow-up suggestion chrome. */
|
|
947
|
+
interface SuggestionTokens {
|
|
948
|
+
chip: SuggestionVariantTokens;
|
|
949
|
+
card: SuggestionVariantTokens;
|
|
950
|
+
list: SuggestionVariantTokens;
|
|
951
|
+
}
|
|
759
952
|
/** Toggle group chrome (used by createToggleGroup). */
|
|
760
953
|
interface ToggleGroupTokens {
|
|
761
954
|
/** Gap between toggle buttons. Default: 0 (connected). */
|
|
@@ -780,12 +973,16 @@ interface ComponentTokens {
|
|
|
780
973
|
toolBubble: ToolBubbleTokens;
|
|
781
974
|
reasoningBubble: ReasoningBubbleTokens;
|
|
782
975
|
composer: ComposerChromeTokens;
|
|
976
|
+
/** Scrollbar appearance for every scroller in the widget. */
|
|
977
|
+
scrollbar?: ScrollbarTokens;
|
|
783
978
|
/** Icon button styling tokens. */
|
|
784
979
|
iconButton?: IconButtonTokens;
|
|
785
980
|
/** Label button styling tokens. */
|
|
786
981
|
labelButton?: LabelButtonTokens;
|
|
787
982
|
/** Scroll-to-bottom indicator styling tokens. */
|
|
788
983
|
scrollToBottom?: ScrollToBottomTokens;
|
|
984
|
+
/** Starter prompt and follow-up suggestion styling tokens. */
|
|
985
|
+
suggestion?: SuggestionTokens;
|
|
789
986
|
/** Toggle group styling tokens. */
|
|
790
987
|
toggleGroup?: ToggleGroupTokens;
|
|
791
988
|
/** Artifact toolbar, tab strip, and pane chrome. */
|
|
@@ -1080,7 +1277,24 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1080
1277
|
type: "source";
|
|
1081
1278
|
url?: string;
|
|
1082
1279
|
[key: string]: unknown;
|
|
1280
|
+
} | {
|
|
1281
|
+
executionId: string;
|
|
1282
|
+
iteration?: number;
|
|
1283
|
+
seq: number;
|
|
1284
|
+
state: Record<string, unknown>;
|
|
1285
|
+
type: "state_snapshot";
|
|
1083
1286
|
} | ({
|
|
1287
|
+
executionId: string;
|
|
1288
|
+
iteration?: number;
|
|
1289
|
+
patch: Array<{
|
|
1290
|
+
from?: string;
|
|
1291
|
+
op: "add" | "remove" | "replace" | "move" | "copy" | "test";
|
|
1292
|
+
path: string;
|
|
1293
|
+
value?: unknown;
|
|
1294
|
+
}>;
|
|
1295
|
+
seq: number;
|
|
1296
|
+
type: "state_delta";
|
|
1297
|
+
}) | ({
|
|
1084
1298
|
executionId: string;
|
|
1085
1299
|
hiddenParameterNames?: Array<string>;
|
|
1086
1300
|
iteration?: number;
|
|
@@ -1322,6 +1536,7 @@ declare const LUCIDE_ICONS: {
|
|
|
1322
1536
|
readonly plus: IconNode;
|
|
1323
1537
|
readonly minus: IconNode;
|
|
1324
1538
|
readonly pencil: IconNode;
|
|
1539
|
+
readonly "pen-line": IconNode;
|
|
1325
1540
|
readonly trash: IconNode;
|
|
1326
1541
|
readonly "trash-2": IconNode;
|
|
1327
1542
|
readonly save: IconNode;
|
|
@@ -1364,11 +1579,13 @@ declare const LUCIDE_ICONS: {
|
|
|
1364
1579
|
readonly folder: IconNode;
|
|
1365
1580
|
readonly "folder-open": IconNode;
|
|
1366
1581
|
readonly files: IconNode;
|
|
1582
|
+
readonly "chart-column": IconNode;
|
|
1367
1583
|
readonly sparkles: IconNode;
|
|
1368
1584
|
readonly zap: IconNode;
|
|
1369
1585
|
readonly sun: IconNode;
|
|
1370
1586
|
readonly moon: IconNode;
|
|
1371
1587
|
readonly flag: IconNode;
|
|
1588
|
+
readonly lightbulb: IconNode;
|
|
1372
1589
|
readonly monitor: IconNode;
|
|
1373
1590
|
readonly smartphone: IconNode;
|
|
1374
1591
|
};
|
|
@@ -2366,6 +2583,13 @@ type AgentWidgetArtifactsLayoutConfig = {
|
|
|
2366
2583
|
* @default 520
|
|
2367
2584
|
*/
|
|
2368
2585
|
narrowHostMaxWidth?: number;
|
|
2586
|
+
/**
|
|
2587
|
+
* Width of the slide-over artifact drawer (the narrow-host and mobile
|
|
2588
|
+
* presentations; `paneWidth`/`paneMaxWidth` only size the desktop split).
|
|
2589
|
+
* CSS length; `"100%"` makes the drawer cover the whole panel.
|
|
2590
|
+
* @default min(calc(100% - 1rem), 22rem)
|
|
2591
|
+
*/
|
|
2592
|
+
drawerWidth?: string;
|
|
2369
2593
|
/**
|
|
2370
2594
|
* When true (default), widen the launcher panel while artifacts are visible and not user-dismissed.
|
|
2371
2595
|
* No-op for inline embed (`launcher.enabled === false`).
|
|
@@ -2994,6 +3218,18 @@ type AgentWidgetScrollMode = "follow" | "anchor-top" | "none";
|
|
|
2994
3218
|
* restored thread opens at a readable place rather than at the very bottom.
|
|
2995
3219
|
*/
|
|
2996
3220
|
type AgentWidgetScrollRestorePosition = "bottom" | "last-user-turn";
|
|
3221
|
+
/**
|
|
3222
|
+
* Scrollbar visibility policy for every scroll surface in the widget.
|
|
3223
|
+
*
|
|
3224
|
+
* - `"on-scroll"` hides bars at rest and reveals them on genuine reader
|
|
3225
|
+
* input, keeping them visible while the reader is away from the resting
|
|
3226
|
+
* position: overlay-scrollbar semantics on every platform.
|
|
3227
|
+
* - `"auto"` keeps the themed bar under native visibility semantics: overlay
|
|
3228
|
+
* platforms still auto-hide, classic-scrollbar platforms (Windows,
|
|
3229
|
+
* always-show macOS) show it persistently.
|
|
3230
|
+
* - `"hidden"` never shows an indicator. Scrolling itself is unaffected.
|
|
3231
|
+
*/
|
|
3232
|
+
type AgentWidgetScrollbarPolicy = "on-scroll" | "auto" | "hidden";
|
|
2997
3233
|
type AgentWidgetScrollBehaviorFeature = {
|
|
2998
3234
|
/** Scroll behavior during streamed responses. @default "anchor-top" */
|
|
2999
3235
|
mode?: AgentWidgetScrollMode;
|
|
@@ -3038,6 +3274,13 @@ type AgentWidgetScrollBehaviorFeature = {
|
|
|
3038
3274
|
* @default false
|
|
3039
3275
|
*/
|
|
3040
3276
|
announce?: boolean;
|
|
3277
|
+
/**
|
|
3278
|
+
* Scrollbar visibility policy, applied to the transcript and every inner
|
|
3279
|
+
* scroller through one root attribute. Themable via
|
|
3280
|
+
* `--persona-scrollbar-thumb` and `--persona-scrollbar-track`.
|
|
3281
|
+
* @default "on-scroll"
|
|
3282
|
+
*/
|
|
3283
|
+
scrollbar?: AgentWidgetScrollbarPolicy;
|
|
3041
3284
|
};
|
|
3042
3285
|
type AgentWidgetScrollToBottomFeature = {
|
|
3043
3286
|
/**
|
|
@@ -3327,10 +3570,13 @@ type AgentWidgetFeatureFlags = {
|
|
|
3327
3570
|
*/
|
|
3328
3571
|
askUserQuestion?: AgentWidgetAskUserQuestionFeature;
|
|
3329
3572
|
/**
|
|
3330
|
-
* Built-in `suggest_replies`
|
|
3331
|
-
*
|
|
3332
|
-
*
|
|
3333
|
-
*
|
|
3573
|
+
* Built-in `suggest_replies` follow-ups. When the assistant invokes the
|
|
3574
|
+
* tool, the widget shows the suggestions using `suggestions.followUps` and
|
|
3575
|
+
* immediately resumes the execution: fire-and-forget, no user input awaited.
|
|
3576
|
+
*
|
|
3577
|
+
* @deprecated Both keys moved to `suggestions.followUps`: use
|
|
3578
|
+
* `suggestions.followUps.enabled` and `suggestions.followUps.expose`. This
|
|
3579
|
+
* alias keeps working per key, with `suggestions.followUps` winning.
|
|
3334
3580
|
*/
|
|
3335
3581
|
suggestReplies?: AgentWidgetSuggestRepliesFeature;
|
|
3336
3582
|
};
|
|
@@ -3370,11 +3616,12 @@ type WidgetPreferenceSlice = {
|
|
|
3370
3616
|
};
|
|
3371
3617
|
};
|
|
3372
3618
|
/**
|
|
3373
|
-
* Feature config for the built-in `suggest_replies`
|
|
3374
|
-
*
|
|
3375
|
-
*
|
|
3376
|
-
*
|
|
3377
|
-
*
|
|
3619
|
+
* Feature config for the built-in `suggest_replies` follow-ups.
|
|
3620
|
+
*
|
|
3621
|
+
* @deprecated Both keys moved to `suggestions.followUps`
|
|
3622
|
+
* (`suggestions.followUps.enabled` / `suggestions.followUps.expose`), which
|
|
3623
|
+
* also owns presentation, placement, and send/fill behavior. Resolution is
|
|
3624
|
+
* per key with `suggestions.followUps` winning; removal waits for 5.0.
|
|
3378
3625
|
*/
|
|
3379
3626
|
type AgentWidgetSuggestRepliesFeature = {
|
|
3380
3627
|
/**
|
|
@@ -3382,14 +3629,18 @@ type AgentWidgetSuggestRepliesFeature = {
|
|
|
3382
3629
|
* renders as a regular tool bubble and is NOT auto-resumed: only set this
|
|
3383
3630
|
* with no server-side `suggest_replies` declaration, or the execution
|
|
3384
3631
|
* parks awaiting a resume that never comes.
|
|
3632
|
+
* @deprecated Use `suggestions.followUps.enabled`.
|
|
3385
3633
|
*/
|
|
3386
3634
|
enabled?: boolean;
|
|
3387
3635
|
/**
|
|
3388
3636
|
* Advertise the built-in `suggest_replies` tool to the agent on every
|
|
3389
3637
|
* dispatch via `clientTools[]`: no server-side `runtimeTools` declaration
|
|
3390
|
-
* needed. Defaults to `false
|
|
3391
|
-
*
|
|
3392
|
-
*
|
|
3638
|
+
* needed. Defaults to `false`. Declare the tool in one place: the API
|
|
3639
|
+
* dedupes a double declaration by name with `clientTools[]` winning, so the
|
|
3640
|
+
* model still sees exactly one tool, but the widget's description and schema
|
|
3641
|
+
* win and the effective tool type becomes `local` (the execution pauses and
|
|
3642
|
+
* the widget auto-resumes it). Ignored when `enabled` is `false`.
|
|
3643
|
+
* @deprecated Use `suggestions.followUps.expose`.
|
|
3393
3644
|
*/
|
|
3394
3645
|
expose?: boolean;
|
|
3395
3646
|
};
|
|
@@ -3459,10 +3710,13 @@ type AgentWidgetAskUserQuestionFeature = {
|
|
|
3459
3710
|
* matching {@link AskUserQuestionPayload}; when the model calls it, the
|
|
3460
3711
|
* existing answer-pill sheet renders and the answer resumes the execution.
|
|
3461
3712
|
*
|
|
3462
|
-
* Defaults to `false
|
|
3463
|
-
*
|
|
3464
|
-
*
|
|
3465
|
-
*
|
|
3713
|
+
* Defaults to `false`. Declare the tool in one place: the API dedupes a
|
|
3714
|
+
* double declaration by name with `clientTools[]` winning, so the model
|
|
3715
|
+
* still sees exactly one tool, but the widget's description and schema win
|
|
3716
|
+
* and the effective tool type becomes `local` (the execution pauses and the
|
|
3717
|
+
* widget resumes it with the user's answer). Ignored when `enabled` is
|
|
3718
|
+
* `false`: never offer the agent a question tool the widget can't render an
|
|
3719
|
+
* answer UI for.
|
|
3466
3720
|
*/
|
|
3467
3721
|
expose?: boolean;
|
|
3468
3722
|
/** Slide-in animation duration in ms. Defaults to 180. */
|
|
@@ -3927,6 +4181,57 @@ type AgentWidgetLauncherConfig = {
|
|
|
3927
4181
|
* @example "min(380px, calc(100vw - 48px))"
|
|
3928
4182
|
*/
|
|
3929
4183
|
collapsedMaxWidth?: string;
|
|
4184
|
+
/**
|
|
4185
|
+
* Proactive nudge bubble anchored above the collapsed floating launcher.
|
|
4186
|
+
* Omit it (the default) and no teaser renders.
|
|
4187
|
+
*/
|
|
4188
|
+
teaser?: AgentWidgetLauncherTeaserConfig;
|
|
4189
|
+
};
|
|
4190
|
+
/**
|
|
4191
|
+
* Launcher teaser: a small bubble above the collapsed launcher. Clicking it
|
|
4192
|
+
* opens the panel and consumes the teaser exactly like an explicit dismissal.
|
|
4193
|
+
* Within a single page load the teaser appears at most once under either
|
|
4194
|
+
* frequency.
|
|
4195
|
+
*
|
|
4196
|
+
* @example
|
|
4197
|
+
* ```typescript
|
|
4198
|
+
* launcher: {
|
|
4199
|
+
* teaser: { text: "Need a hand picking a plan?", delayMs: 3000 }
|
|
4200
|
+
* }
|
|
4201
|
+
* ```
|
|
4202
|
+
*/
|
|
4203
|
+
type AgentWidgetLauncherTeaserConfig = {
|
|
4204
|
+
/** Bubble copy. An empty string renders no teaser. */
|
|
4205
|
+
text: string;
|
|
4206
|
+
/**
|
|
4207
|
+
* Delay before the bubble appears, in milliseconds.
|
|
4208
|
+
* @default 0
|
|
4209
|
+
*/
|
|
4210
|
+
delayMs?: number;
|
|
4211
|
+
/**
|
|
4212
|
+
* How often the teaser may return.
|
|
4213
|
+
*
|
|
4214
|
+
* `"once"`: a dismissal or a click-through is remembered in `localStorage`
|
|
4215
|
+
* under `` `${persistState.keyPrefix ?? "persona-"}teaser-dismissed` `` and
|
|
4216
|
+
* the teaser never returns on that browser. `"always"`: shows on every page
|
|
4217
|
+
* load, tracked in memory only. `persistState: false` downgrades `"once"` to
|
|
4218
|
+
* in-memory too, so the teaser reappears each load.
|
|
4219
|
+
*
|
|
4220
|
+
* Custom `storageAdapter` implementations do not participate in teaser state.
|
|
4221
|
+
*
|
|
4222
|
+
* @default "once"
|
|
4223
|
+
*/
|
|
4224
|
+
frequency?: "once" | "always";
|
|
4225
|
+
/**
|
|
4226
|
+
* Render an x affordance that dismisses the teaser without opening the panel.
|
|
4227
|
+
* @default true
|
|
4228
|
+
*/
|
|
4229
|
+
dismissible?: boolean;
|
|
4230
|
+
/**
|
|
4231
|
+
* Accessible label for the dismiss affordance.
|
|
4232
|
+
* @default "Dismiss message"
|
|
4233
|
+
*/
|
|
4234
|
+
dismissLabel?: string;
|
|
3930
4235
|
};
|
|
3931
4236
|
type AgentWidgetSendButtonConfig = {
|
|
3932
4237
|
borderWidth?: string;
|
|
@@ -3935,6 +4240,10 @@ type AgentWidgetSendButtonConfig = {
|
|
|
3935
4240
|
paddingY?: string;
|
|
3936
4241
|
iconText?: string;
|
|
3937
4242
|
iconName?: string;
|
|
4243
|
+
/** Icon glyph box in icon mode, e.g. "20px". Defaults to half of `size`. */
|
|
4244
|
+
iconSize?: string;
|
|
4245
|
+
/** Stroke width for the icon glyph, in viewBox units. Default 2. */
|
|
4246
|
+
iconStrokeWidth?: number;
|
|
3938
4247
|
useIcon?: boolean;
|
|
3939
4248
|
tooltipText?: string;
|
|
3940
4249
|
showTooltip?: boolean;
|
|
@@ -4658,6 +4967,177 @@ type AgentWidgetSuggestionChipsConfig = {
|
|
|
4658
4967
|
paddingX?: string;
|
|
4659
4968
|
paddingY?: string;
|
|
4660
4969
|
};
|
|
4970
|
+
/** A suggested next action shown to the user. Strings remain supported as shorthand. */
|
|
4971
|
+
type AgentWidgetSuggestion = string | {
|
|
4972
|
+
/** Stable analytics / DOM identity. Falls back to the prompt or label. */
|
|
4973
|
+
id?: string;
|
|
4974
|
+
/** Concise visible action label. */
|
|
4975
|
+
label: string;
|
|
4976
|
+
/** Text placed in the composer or sent. Defaults to `label`. */
|
|
4977
|
+
prompt?: string;
|
|
4978
|
+
/**
|
|
4979
|
+
* Optional supporting copy, most useful with the `card` variant. The
|
|
4980
|
+
* `chip` variant ignores it and renders the label alone.
|
|
4981
|
+
*/
|
|
4982
|
+
description?: string;
|
|
4983
|
+
/** Optional icon from Persona's bundled Lucide registry. */
|
|
4984
|
+
icon?: IconName;
|
|
4985
|
+
/**
|
|
4986
|
+
* CSS color for this item's glyph. Tints the icon only: label, border,
|
|
4987
|
+
* and background stay neutral. Ignored without an `icon`.
|
|
4988
|
+
*/
|
|
4989
|
+
iconColor?: string;
|
|
4990
|
+
/** Override the surface's click behavior for this item. */
|
|
4991
|
+
behavior?: AgentWidgetSuggestionBehavior;
|
|
4992
|
+
/** Visually promote one high-confidence action. */
|
|
4993
|
+
emphasis?: "default" | "primary";
|
|
4994
|
+
};
|
|
4995
|
+
type AgentWidgetSuggestionBehavior = "send" | "fill";
|
|
4996
|
+
type AgentWidgetSuggestionVariant = "chip" | "card" | "list";
|
|
4997
|
+
type AgentWidgetSuggestionSurface = "starter" | "followUp";
|
|
4998
|
+
/**
|
|
4999
|
+
* Who produced the rendered suggestions: static config, the agent's
|
|
5000
|
+
* `suggest_replies` tool, or `controller.setFollowUpSuggestions`.
|
|
5001
|
+
*/
|
|
5002
|
+
type AgentWidgetSuggestionSource = "config" | "agent" | "host";
|
|
5003
|
+
/**
|
|
5004
|
+
* A suggestion after Persona has normalized shorthand strings and resolved the
|
|
5005
|
+
* effective click behavior. Plugin hooks receive this stable shape.
|
|
5006
|
+
*/
|
|
5007
|
+
type AgentWidgetResolvedSuggestion = {
|
|
5008
|
+
id: string;
|
|
5009
|
+
label: string;
|
|
5010
|
+
prompt: string;
|
|
5011
|
+
description?: string;
|
|
5012
|
+
icon?: IconName;
|
|
5013
|
+
/** CSS color for the glyph only; never the label, border, or background. */
|
|
5014
|
+
iconColor?: string;
|
|
5015
|
+
behavior: AgentWidgetSuggestionBehavior;
|
|
5016
|
+
emphasis: "default" | "primary";
|
|
5017
|
+
};
|
|
5018
|
+
/** Presentation keys shared by every suggestion surface. */
|
|
5019
|
+
type AgentWidgetSuggestionSurfaceConfig = {
|
|
5020
|
+
/** Item density. Defaults to `card` for starters and `chip` for follow-ups. */
|
|
5021
|
+
variant?: AgentWidgetSuggestionVariant;
|
|
5022
|
+
/** Default click behavior, overridable per item. Defaults to `send`. */
|
|
5023
|
+
behavior?: AgentWidgetSuggestionBehavior;
|
|
5024
|
+
/**
|
|
5025
|
+
* Layout for items past the surface width. Defaults to `wrap` on every
|
|
5026
|
+
* surface; `scroll` opts into a horizontal strip for large sets. Applies
|
|
5027
|
+
* to the `chip` variant only; the `card` and `list` layouts manage their
|
|
5028
|
+
* own stacking.
|
|
5029
|
+
*/
|
|
5030
|
+
overflow?: "scroll" | "wrap";
|
|
5031
|
+
/** Maximum visible items. Defaults to 4. */
|
|
5032
|
+
maxItems?: number;
|
|
5033
|
+
};
|
|
5034
|
+
type AgentWidgetStarterSuggestionsConfig = AgentWidgetSuggestionSurfaceConfig & {
|
|
5035
|
+
/** Suggestions shown before the first user message. */
|
|
5036
|
+
items?: AgentWidgetSuggestion[];
|
|
5037
|
+
/**
|
|
5038
|
+
* `auto` uses the welcome surface when the welcome card renders and the
|
|
5039
|
+
* composer otherwise. Explicit values are literal: `welcome` renders
|
|
5040
|
+
* nothing when the welcome card is hidden. Defaults to `auto`.
|
|
5041
|
+
*/
|
|
5042
|
+
placement?: "auto" | "welcome" | "composer";
|
|
5043
|
+
};
|
|
5044
|
+
type AgentWidgetFollowUpSuggestionsConfig = AgentWidgetSuggestionSurfaceConfig & {
|
|
5045
|
+
/**
|
|
5046
|
+
* Enable the built-in `suggest_replies` follow-ups. Defaults to true. When
|
|
5047
|
+
* false, `suggest_replies` renders as a regular tool bubble and is NOT
|
|
5048
|
+
* auto-resumed: only set this with no server-side `suggest_replies`
|
|
5049
|
+
* declaration, or the execution parks awaiting a resume that never comes.
|
|
5050
|
+
*/
|
|
5051
|
+
enabled?: boolean;
|
|
5052
|
+
/**
|
|
5053
|
+
* Advertise the built-in `suggest_replies` tool to the agent on every
|
|
5054
|
+
* dispatch via `clientTools[]`: no server-side `runtimeTools` declaration
|
|
5055
|
+
* needed. Defaults to `false`. Declare the tool in one place: the API
|
|
5056
|
+
* dedupes a double declaration by name with `clientTools[]` winning, so
|
|
5057
|
+
* the model still sees exactly one tool, but the widget's description and
|
|
5058
|
+
* schema win and the effective tool type becomes `local` (the execution
|
|
5059
|
+
* pauses and the widget auto-resumes it). Ignored when `enabled` is
|
|
5060
|
+
* `false`.
|
|
5061
|
+
*/
|
|
5062
|
+
expose?: boolean;
|
|
5063
|
+
/**
|
|
5064
|
+
* `auto` places follow-ups after the transcript in regular panels and above
|
|
5065
|
+
* the composer in composer-bar mode. Defaults to `auto`.
|
|
5066
|
+
*/
|
|
5067
|
+
placement?: "auto" | "after-message" | "composer";
|
|
5068
|
+
};
|
|
5069
|
+
/**
|
|
5070
|
+
* Structured suggestions configuration. The legacy `suggestionChips` and
|
|
5071
|
+
* `suggestionChipsConfig` fields remain supported for backwards compatibility.
|
|
5072
|
+
*/
|
|
5073
|
+
type AgentWidgetSuggestionsConfig = {
|
|
5074
|
+
starters?: AgentWidgetStarterSuggestionsConfig;
|
|
5075
|
+
followUps?: AgentWidgetFollowUpSuggestionsConfig;
|
|
5076
|
+
};
|
|
5077
|
+
/**
|
|
5078
|
+
* Which welcome surface renders.
|
|
5079
|
+
* `"card"` is the top-of-scroll intro card (default, back-compatible),
|
|
5080
|
+
* `"hero"` centers it in the empty conversation, `"none"` renders no surface.
|
|
5081
|
+
*/
|
|
5082
|
+
type AgentWidgetWelcomeVariant = "card" | "hero" | "none";
|
|
5083
|
+
/**
|
|
5084
|
+
* When the welcome surface goes away. `"never"` is the default for `"card"`;
|
|
5085
|
+
* `"on-first-message"` is the default for `"hero"` and cannot be overridden
|
|
5086
|
+
* there.
|
|
5087
|
+
*/
|
|
5088
|
+
type AgentWidgetWelcomeDismiss = "never" | "on-first-message";
|
|
5089
|
+
/**
|
|
5090
|
+
* Avatar or logo shown above the welcome title. Discriminated union; the
|
|
5091
|
+
* function form is the escape hatch for custom markup. There is deliberately
|
|
5092
|
+
* no raw HTML string variant (sanitization surface plus accessibility hole).
|
|
5093
|
+
*/
|
|
5094
|
+
type AgentWidgetWelcomeIcon = {
|
|
5095
|
+
type: "lucide";
|
|
5096
|
+
name: IconName;
|
|
5097
|
+
}
|
|
5098
|
+
/** `alt` is required, and may be `""` for a decorative logo. */
|
|
5099
|
+
| {
|
|
5100
|
+
type: "image";
|
|
5101
|
+
url: string;
|
|
5102
|
+
alt: string;
|
|
5103
|
+
}
|
|
5104
|
+
/** Emoji or short text glyph. */
|
|
5105
|
+
| {
|
|
5106
|
+
type: "text";
|
|
5107
|
+
text: string;
|
|
5108
|
+
} | (() => HTMLElement | SVGElement);
|
|
5109
|
+
/**
|
|
5110
|
+
* First-open welcome surface. Consolidates the deprecated
|
|
5111
|
+
* `copy.welcomeTitle` / `copy.welcomeSubtitle` / `copy.showWelcomeCard`
|
|
5112
|
+
* options; a field present here wins over its legacy alias.
|
|
5113
|
+
*
|
|
5114
|
+
* All defaults live in the resolver (`resolveWelcomeConfig`), never in
|
|
5115
|
+
* `DEFAULT_WIDGET_CONFIG`: presence on this object is what distinguishes a
|
|
5116
|
+
* host-set value from a filled-in default.
|
|
5117
|
+
*/
|
|
5118
|
+
interface AgentWidgetWelcomeConfig {
|
|
5119
|
+
/** Card or hero title. Defaults to "Hello 👋". */
|
|
5120
|
+
title?: string;
|
|
5121
|
+
/** Scope statement in the assistant's voice. Empty string omits it. */
|
|
5122
|
+
subtitle?: string;
|
|
5123
|
+
/** Avatar or logo shown above the title. */
|
|
5124
|
+
icon?: AgentWidgetWelcomeIcon;
|
|
5125
|
+
/** @default "card" */
|
|
5126
|
+
variant?: AgentWidgetWelcomeVariant;
|
|
5127
|
+
/** @default "never" for `card`, always `"on-first-message"` for `hero`. */
|
|
5128
|
+
dismiss?: AgentWidgetWelcomeDismiss;
|
|
5129
|
+
/**
|
|
5130
|
+
* Display-only greeting bubble pinned at transcript position zero. It is UI
|
|
5131
|
+
* chrome derived from config, never a session message: it does not appear in
|
|
5132
|
+
* `getMessages()`, is never persisted or sent to the model, `onMessage` does
|
|
5133
|
+
* not fire for it, and it survives `clearChat()`. Use an assistant
|
|
5134
|
+
* `initialMessages` entry instead when the model should see the greeting.
|
|
5135
|
+
*
|
|
5136
|
+
* Ignored (with a debug-mode warning) when `variant` is `"hero"`: the hero
|
|
5137
|
+
* is the greeting.
|
|
5138
|
+
*/
|
|
5139
|
+
message?: string;
|
|
5140
|
+
}
|
|
4661
5141
|
/**
|
|
4662
5142
|
* Interface for pluggable stream parsers that extract text from streaming responses.
|
|
4663
5143
|
* Parsers handle incremental parsing to extract text values from structured formats (JSON, XML, etc.).
|
|
@@ -4839,7 +5319,9 @@ type AgentWidgetHeaderLayoutConfig = {
|
|
|
4839
5319
|
*/
|
|
4840
5320
|
render?: (context: HeaderRenderContext) => HTMLElement;
|
|
4841
5321
|
/**
|
|
4842
|
-
*
|
|
5322
|
+
* Icon action buttons at the trailing edge of the `minimal` header layout,
|
|
5323
|
+
* clustered with the close button and sharing its chrome. For a menu
|
|
5324
|
+
* affordance next to the title, use `titleMenu` instead.
|
|
4843
5325
|
*/
|
|
4844
5326
|
trailingActions?: AgentWidgetHeaderTrailingAction[];
|
|
4845
5327
|
/** Called when a `trailingActions` button is clicked. */
|
|
@@ -5019,7 +5501,11 @@ type AgentWidgetLayoutConfig = {
|
|
|
5019
5501
|
/**
|
|
5020
5502
|
* Max width for the content area (messages + composer).
|
|
5021
5503
|
* Applied with `margin: 0 auto` for centering.
|
|
5022
|
-
* Accepts any CSS width value (e.g. "90ch", "720px", "80%")
|
|
5504
|
+
* Accepts any CSS width value (e.g. "90ch", "720px", "80%"), or "none"
|
|
5505
|
+
* for a full-width column. Only engages on panels wider than the cap,
|
|
5506
|
+
* so launcher-width panels are unaffected.
|
|
5507
|
+
* @default "768px" ("720px" in composer-bar mode via
|
|
5508
|
+
* `launcher.composerBar.contentMaxWidth`)
|
|
5023
5509
|
*/
|
|
5024
5510
|
contentMaxWidth?: string;
|
|
5025
5511
|
};
|
|
@@ -5767,7 +6253,9 @@ type AgentWidgetConfig = {
|
|
|
5767
6253
|
*/
|
|
5768
6254
|
getHeaders?: AgentWidgetHeadersFunction;
|
|
5769
6255
|
copy?: {
|
|
6256
|
+
/** @deprecated Use `welcome.title`. */
|
|
5770
6257
|
welcomeTitle?: string;
|
|
6258
|
+
/** @deprecated Use `welcome.subtitle`. */
|
|
5771
6259
|
welcomeSubtitle?: string;
|
|
5772
6260
|
inputPlaceholder?: string;
|
|
5773
6261
|
sendButtonLabel?: string;
|
|
@@ -5775,6 +6263,7 @@ type AgentWidgetConfig = {
|
|
|
5775
6263
|
stopButtonLabel?: string;
|
|
5776
6264
|
/**
|
|
5777
6265
|
* When false, the welcome / intro card is not shown above the message list.
|
|
6266
|
+
* @deprecated Use `welcome.variant: "none"`.
|
|
5778
6267
|
* @default true
|
|
5779
6268
|
*/
|
|
5780
6269
|
showWelcomeCard?: boolean;
|
|
@@ -5839,7 +6328,17 @@ type AgentWidgetConfig = {
|
|
|
5839
6328
|
* with `initialArtifacts`.
|
|
5840
6329
|
*/
|
|
5841
6330
|
initialSelectedArtifactId?: string | null;
|
|
6331
|
+
/** Rich starter and follow-up suggestion surfaces. */
|
|
6332
|
+
suggestions?: AgentWidgetSuggestionsConfig;
|
|
6333
|
+
/**
|
|
6334
|
+
* First-open welcome surface (card, hero, or none) plus the optional
|
|
6335
|
+
* display-only greeting bubble. Supersedes `copy.welcomeTitle`,
|
|
6336
|
+
* `copy.welcomeSubtitle`, and `copy.showWelcomeCard`.
|
|
6337
|
+
*/
|
|
6338
|
+
welcome?: AgentWidgetWelcomeConfig;
|
|
6339
|
+
/** @deprecated Prefer `suggestions.starters.items`. */
|
|
5842
6340
|
suggestionChips?: string[];
|
|
6341
|
+
/** @deprecated Prefer semantic tokens under `theme.components.suggestion`. */
|
|
5843
6342
|
suggestionChipsConfig?: AgentWidgetSuggestionChipsConfig;
|
|
5844
6343
|
debug?: boolean;
|
|
5845
6344
|
formEndpoint?: string;
|