@runtypelabs/persona 4.23.2 → 4.25.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/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-CI7OckWI.d.cts → types-Db61aI9J.d.cts} +2 -0
- package/dist/animations/{types-CI7OckWI.d.ts → types-Db61aI9J.d.ts} +2 -0
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/animations-extra.d.cts +2 -0
- package/dist/animations-extra.d.ts +2 -0
- package/dist/approval-ui-3NMYNXBD.js +1 -0
- package/dist/approval-ui.cjs +2 -2
- package/dist/approval-ui.d.cts +278 -37
- package/dist/approval-ui.d.ts +278 -37
- package/dist/approval-ui.js +2 -2
- package/dist/{artifacts-ui-F4N6VMKF.js → artifacts-ui-IGB5YKLO.js} +4 -4
- package/dist/artifacts-ui.d.cts +273 -25
- package/dist/artifacts-ui.d.ts +273 -25
- package/dist/{chunk-NIKYKSNZ.js → chunk-7CO4T5KB.js} +1 -1
- package/dist/codegen.cjs +11 -11
- package/dist/codegen.js +13 -13
- package/dist/context-mentions.d.cts +273 -25
- package/dist/context-mentions.d.ts +273 -25
- package/dist/event-stream-view.d.cts +273 -25
- package/dist/event-stream-view.d.ts +273 -25
- package/dist/forms-ui.d.cts +319 -27
- package/dist/forms-ui.d.ts +319 -27
- package/dist/history-view.d.cts +2 -0
- package/dist/history-view.d.ts +2 -0
- package/dist/index.cjs +70 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +344 -39
- package/dist/index.d.ts +344 -39
- package/dist/index.global.js +57 -54
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +70 -69
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/launcher.global.js +2 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/session-reconnect.d.cts +273 -25
- package/dist/session-reconnect.d.ts +273 -25
- package/dist/smart-dom-reader.d.cts +273 -25
- package/dist/smart-dom-reader.d.ts +273 -25
- package/dist/theme-editor-preview.cjs +74 -73
- package/dist/theme-editor-preview.d.cts +280 -25
- package/dist/theme-editor-preview.d.ts +280 -25
- package/dist/theme-editor-preview.js +51 -50
- package/dist/theme-editor.cjs +10 -10
- package/dist/theme-editor.d.cts +293 -27
- package/dist/theme-editor.d.ts +293 -27
- package/dist/theme-editor.js +10 -10
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +1522 -11
- package/dist/theme-reference.d.ts +1522 -11
- package/dist/theme-reference.js +1 -1
- package/dist/voice-runtime-7DA7MJH4.js +1 -0
- package/dist/voice-runtime.cjs +1 -1
- package/dist/voice-runtime.d.cts +33 -0
- package/dist/voice-runtime.d.ts +33 -0
- package/dist/voice-runtime.js +1 -1
- package/dist/widget.css +1 -1
- package/package.json +3 -2
- package/src/__fixtures__/defaults-parity.v4.json +776 -0
- package/src/approval-ui-entry.ts +0 -1
- package/src/approval-ui-loader.ts +5 -4
- package/src/approval-ui.ts +0 -1
- package/src/client-identity-proof.test.ts +193 -0
- package/src/client-session-warm.test.ts +216 -0
- package/src/client-visitor-history.test.ts +6 -0
- package/src/client.ts +122 -30
- package/src/codegen.test.ts +24 -0
- package/src/components/activity-row.test.ts +100 -0
- package/src/components/activity-row.ts +136 -0
- package/src/components/approval-actions.test.ts +8 -5
- package/src/components/approval-actions.ts +19 -6
- package/src/components/approval-bubble.test.ts +56 -9
- package/src/components/approval-bubble.ts +36 -41
- package/src/components/composer-builder.ts +5 -2
- package/src/components/composer-parts.ts +10 -2
- package/src/components/header-builder.test.ts +32 -0
- package/src/components/header-builder.ts +7 -4
- package/src/components/header-layouts.test.ts +12 -0
- package/src/components/header-layouts.ts +3 -2
- package/src/components/launcher.ts +11 -2
- package/src/components/message-bubble.test.ts +22 -0
- package/src/components/message-bubble.ts +7 -3
- package/src/components/panel.test.ts +52 -1
- package/src/components/panel.ts +47 -8
- package/src/components/pill-composer-builder.test.ts +2 -0
- package/src/components/pill-composer-builder.ts +0 -1
- package/src/components/reasoning-bubble.ts +29 -17
- package/src/components/suggestions.test.ts +1 -0
- package/src/components/suggestions.ts +0 -16
- package/src/components/tool-bubble.ts +131 -114
- package/src/components/tool-details.test.ts +87 -0
- package/src/components/tool-details.ts +102 -0
- package/src/components/welcome.test.ts +8 -0
- package/src/components/welcome.ts +4 -2
- package/src/defaults-parity.test.ts +158 -0
- package/src/defaults.test.ts +69 -0
- package/src/defaults.ts +128 -49
- package/src/generated/runtype-openapi-contract.ts +2 -2
- package/src/index-core.ts +4 -0
- package/src/install.test.ts +24 -0
- package/src/install.ts +3 -1
- package/src/launcher-global.ts +2 -1
- package/src/launcher-variants.test.ts +52 -0
- package/src/runtime/init-update-reset.test.ts +21 -0
- package/src/session.ts +59 -7
- package/src/session.voice.test.ts +72 -1
- package/src/styles/widget-styles.test.ts +19 -0
- package/src/styles/widget.css +295 -23
- package/src/theme-editor/index.ts +2 -0
- package/src/theme-editor/preview-utils.test.ts +8 -0
- package/src/theme-editor/preview-utils.ts +7 -3
- package/src/theme-editor/sections.test.ts +31 -0
- package/src/theme-editor/sections.ts +55 -1
- package/src/theme-editor/state-preferences.test.ts +49 -0
- package/src/theme-editor/state.ts +73 -15
- package/src/theme-reference.test.ts +20 -0
- package/src/theme-reference.ts +11 -5
- package/src/tool-call-display-defaults.test.ts +33 -1
- package/src/types/theme.ts +80 -3
- package/src/types.ts +207 -22
- package/src/ui.activity-row.test.ts +91 -0
- package/src/ui.approval-plugin.test.ts +63 -0
- package/src/ui.composer-compact.test.ts +24 -2
- package/src/ui.composer-placement.test.ts +23 -0
- package/src/ui.detached-panel.test.ts +33 -6
- package/src/ui.docked.test.ts +19 -0
- package/src/ui.header-update-stability.test.ts +25 -0
- package/src/ui.identity-proof.test.ts +58 -0
- package/src/ui.launcher-teaser.test.ts +25 -0
- package/src/ui.message-width.test.ts +17 -2
- package/src/ui.reasoning-display.test.ts +92 -0
- package/src/ui.rebuild-composer.test.ts +20 -3
- package/src/ui.scroll.test.ts +32 -0
- package/src/ui.session-init.test.ts +312 -0
- package/src/ui.status-indicator.test.ts +82 -0
- package/src/ui.suggest-replies.test.ts +11 -0
- package/src/ui.ts +422 -74
- package/src/ui.v5-defaults.test.ts +144 -0
- package/src/ui.voice-prewarm.test.ts +222 -0
- package/src/ui.welcome.test.ts +92 -3
- package/src/utils/__snapshots__/tokens-parity.test.ts.snap +811 -140
- package/src/utils/code-generators.ts +14 -0
- package/src/utils/composer-compact.test.ts +0 -2
- package/src/utils/composer-compact.ts +2 -4
- package/src/utils/composer-placement.ts +2 -3
- package/src/utils/config-merge.test.ts +81 -5
- package/src/utils/config-merge.ts +13 -3
- package/src/utils/defaults-provenance.ts +67 -0
- package/src/utils/dock.ts +7 -1
- package/src/utils/launcher-variant.ts +16 -0
- package/src/utils/panel-config.ts +97 -0
- package/src/utils/status-indicator.ts +39 -0
- package/src/utils/theme.test.ts +182 -0
- package/src/utils/theme.ts +131 -18
- package/src/utils/tokens.test.ts +122 -1
- package/src/utils/tokens.ts +177 -17
- package/src/voice/runtype-voice-provider.ts +238 -27
- package/src/voice/voice.test.ts +272 -2
- package/src/welcome.test.ts +23 -0
- package/src/welcome.ts +16 -9
- package/dist/approval-ui-K7R5Q5OC.js +0 -1
- package/dist/voice-runtime-EFR3R5ES.js +0 -1
package/dist/forms-ui.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface ResolvedWelcomeConfig {
|
|
|
21
21
|
* Optional on the interface, always populated by `resolveWelcomeConfig`:
|
|
22
22
|
* a plugin literal built against an older minor must still type-check.
|
|
23
23
|
*/
|
|
24
|
+
layout?: "top" | "centered";
|
|
24
25
|
anchor?: AgentWidgetWelcomeAnchor;
|
|
25
26
|
/** Percentage string; validated, falls back to "44%". */
|
|
26
27
|
anchorComposerTop?: string;
|
|
@@ -792,6 +793,8 @@ interface InputTokens extends ComponentTokenSet {
|
|
|
792
793
|
backdropFilter?: string;
|
|
793
794
|
}
|
|
794
795
|
interface LauncherTokens extends ComponentTokenSet {
|
|
796
|
+
/** Distance from the viewport edges. Circle default: 20px; pill: 24px. */
|
|
797
|
+
offset?: string;
|
|
795
798
|
size: string;
|
|
796
799
|
iconSize: string;
|
|
797
800
|
shadow: TokenReference<'shadow'>;
|
|
@@ -814,6 +817,15 @@ interface PanelTokens extends ComponentTokenSet {
|
|
|
814
817
|
inset?: string;
|
|
815
818
|
/** Background of the region revealed behind a detached panel. */
|
|
816
819
|
canvasBackground?: string;
|
|
820
|
+
/** Chrome defaults by rendered panel mode. */
|
|
821
|
+
modes?: Partial<Record<'floating' | 'inline' | 'sidebar' | 'docked' | 'mobile', {
|
|
822
|
+
/** Full border shorthand (for example, `"1px solid var(--persona-border)"`). */
|
|
823
|
+
border?: string;
|
|
824
|
+
/** Box-shadow token reference or raw CSS shadow. */
|
|
825
|
+
shadow?: string;
|
|
826
|
+
/** Corner radius token reference or raw CSS radius. */
|
|
827
|
+
borderRadius?: TokenReference<'radius'>;
|
|
828
|
+
}>>;
|
|
817
829
|
}
|
|
818
830
|
/** Per-element text styling shared by themable text surfaces. */
|
|
819
831
|
interface TextStyleTokens {
|
|
@@ -840,10 +852,16 @@ interface HeaderTokens extends ComponentTokenSet {
|
|
|
840
852
|
*/
|
|
841
853
|
border?: TokenReference<'color'>;
|
|
842
854
|
borderRadius: TokenReference<'radius'>;
|
|
855
|
+
/** Standard-header padding. @default "20px 24px" */
|
|
856
|
+
padding?: string;
|
|
857
|
+
/** Minimal-header padding. Explicitly wins over `padding`. @default "16px 24px" */
|
|
858
|
+
minimalPadding?: string;
|
|
843
859
|
/** Background of the rounded avatar tile next to the title (Lucide / emoji / image). */
|
|
844
860
|
iconBackground: TokenReference<'color'>;
|
|
845
861
|
/** Foreground (glyph stroke or emoji text) on the header avatar tile. */
|
|
846
862
|
iconForeground: TokenReference<'color'>;
|
|
863
|
+
/** Header identity glyph size as a fraction of its icon box. @default "0.6" */
|
|
864
|
+
iconScale?: string;
|
|
847
865
|
/**
|
|
848
866
|
* Legacy alias of `title.color`; `title.color` wins when both are set.
|
|
849
867
|
* Unset, the title takes `foreground`, then the primary color.
|
|
@@ -882,6 +900,14 @@ interface HeaderTokens extends ComponentTokenSet {
|
|
|
882
900
|
* sibling. @default "1.5"
|
|
883
901
|
*/
|
|
884
902
|
controlStrokeWidth?: string;
|
|
903
|
+
/** Header control corner radius. Per-control radius overrides win. */
|
|
904
|
+
controlBorderRadius?: string;
|
|
905
|
+
/** Default control hover/focus fill. Explicit button backgrounds win. */
|
|
906
|
+
controlHoverBackground?: TokenReference<'color'>;
|
|
907
|
+
/** Default control hover/focus icon color. Explicit button colors win. */
|
|
908
|
+
controlHoverForeground?: TokenReference<'color'>;
|
|
909
|
+
/** Keyboard focus outline; unset preserves the browser default. */
|
|
910
|
+
controlFocusOutline?: string;
|
|
885
911
|
/** Box-shadow on the header (e.g., a fade shadow to replace the default border). */
|
|
886
912
|
shadow?: string;
|
|
887
913
|
/** Override the header bottom border (e.g., `none`). */
|
|
@@ -1056,6 +1082,12 @@ interface MessageGeometryTokens {
|
|
|
1056
1082
|
lineHeight?: string;
|
|
1057
1083
|
}
|
|
1058
1084
|
interface MessageTokens {
|
|
1085
|
+
/** Height of the optional transcript top fade. Default 18px. */
|
|
1086
|
+
topFadeHeight?: string;
|
|
1087
|
+
/** Vertical gap between transcript turns. @default "12px" */
|
|
1088
|
+
gap?: string;
|
|
1089
|
+
/** Gap between turns in fullscreen mode; falls back to `gap`. */
|
|
1090
|
+
fullscreenGap?: string;
|
|
1059
1091
|
user: MessageGeometryTokens & {
|
|
1060
1092
|
background: TokenReference<'color'>;
|
|
1061
1093
|
text: TokenReference<'color'>;
|
|
@@ -1069,6 +1101,8 @@ interface MessageTokens {
|
|
|
1069
1101
|
borderRadius: TokenReference<'radius'>;
|
|
1070
1102
|
/** Assistant bubble border color (CSS color). */
|
|
1071
1103
|
border?: TokenReference<'color'>;
|
|
1104
|
+
/** Border width; set to 0px for a flat assistant response. @default "1px" */
|
|
1105
|
+
borderWidth?: string;
|
|
1072
1106
|
/** Assistant bubble box-shadow (token ref or raw CSS, e.g. `none`). */
|
|
1073
1107
|
shadow?: string;
|
|
1074
1108
|
};
|
|
@@ -1187,12 +1221,40 @@ interface AttachmentTokens {
|
|
|
1187
1221
|
};
|
|
1188
1222
|
}
|
|
1189
1223
|
/** Tool-call row chrome (collapsible tool bubbles). */
|
|
1190
|
-
interface
|
|
1224
|
+
interface ActivityTokens {
|
|
1225
|
+
/** Minimum activity row height. */
|
|
1226
|
+
rowHeight?: string;
|
|
1227
|
+
/** Group child indentation; falls back to indent when unset. V5: 0px. */
|
|
1228
|
+
groupIndent?: string;
|
|
1229
|
+
/** Extra vertical gap between grouped rows. V5: 0px. */
|
|
1230
|
+
groupGap?: string;
|
|
1231
|
+
/** Padding around expanded group children. V5: 0px. */
|
|
1232
|
+
groupPadding?: string;
|
|
1233
|
+
/** Gap between consecutive activity entries. V5: 0px. */
|
|
1234
|
+
transcriptGap?: string;
|
|
1235
|
+
/** Gap from activity to an assistant response. V5: 12px. */
|
|
1236
|
+
responseGap?: string;
|
|
1237
|
+
/** Expanded body padding. V5: 4px 0. */
|
|
1238
|
+
bodyPadding?: string;
|
|
1239
|
+
/** Expanded reasoning text size. V5: 13px. */
|
|
1240
|
+
bodySize?: string;
|
|
1241
|
+
/** Expanded reasoning line height. V5: 1.5. */
|
|
1242
|
+
bodyLineHeight?: string;
|
|
1243
|
+
/** Expanded reasoning font weight. V5: 400. */
|
|
1244
|
+
bodyFontWeight?: string;
|
|
1245
|
+
/** Gap between expanded detail sections. V5: 8px. */
|
|
1246
|
+
sectionGap?: string;
|
|
1247
|
+
labelSize?: string;
|
|
1248
|
+
iconSize?: string;
|
|
1249
|
+
indent?: string;
|
|
1250
|
+
bodySurface?: TokenReference<'color'>;
|
|
1251
|
+
}
|
|
1252
|
+
interface ToolBubbleTokens extends ActivityTokens {
|
|
1191
1253
|
/** Box-shadow for tool bubbles (token ref or raw CSS, e.g. `none`). */
|
|
1192
1254
|
shadow: string;
|
|
1193
1255
|
}
|
|
1194
1256
|
/** Reasoning / “thinking” row chrome. */
|
|
1195
|
-
interface ReasoningBubbleTokens {
|
|
1257
|
+
interface ReasoningBubbleTokens extends ActivityTokens {
|
|
1196
1258
|
shadow: string;
|
|
1197
1259
|
}
|
|
1198
1260
|
/** One event-stream badge chip: fill + text pair. The chip border derives
|
|
@@ -1326,6 +1388,10 @@ interface ComposerChromeTokens {
|
|
|
1326
1388
|
shadow: string;
|
|
1327
1389
|
/** Border color of the composer form. @default semantic.colors.border */
|
|
1328
1390
|
borderColor?: TokenReference<'color'>;
|
|
1391
|
+
/** Focused form border color; falls back to borderColor. V5: a stronger neutral border. */
|
|
1392
|
+
focusBorderColor?: TokenReference<'color'>;
|
|
1393
|
+
/** Outer focus ring (CSS outline shorthand). V4: none; V5: a thin neutral ring. */
|
|
1394
|
+
focusRing?: string;
|
|
1329
1395
|
/** Inner padding of the composer form (raw CSS shorthand). @default "0.75rem 1rem" */
|
|
1330
1396
|
padding?: string;
|
|
1331
1397
|
/** Gap between the textarea row and the actions row. @default "0.5rem" */
|
|
@@ -1344,12 +1410,18 @@ interface ComposerChromeTokens {
|
|
|
1344
1410
|
controlSize?: string;
|
|
1345
1411
|
/** Glyph box inside those controls. @default "24px" */
|
|
1346
1412
|
controlIconSize?: string;
|
|
1413
|
+
/** Send/stop glyph size. Explicit sendButton.iconSize wins. V5: 18px. */
|
|
1414
|
+
sendIconSize?: string;
|
|
1415
|
+
/** Icon-mode submit button radius. V4 inherits the primary button; V5: 9999px. */
|
|
1416
|
+
sendButtonRadius?: string;
|
|
1417
|
+
/** Footer top border (CSS shorthand). V4: 1px solid divider; V5: none. */
|
|
1418
|
+
footerBorder?: string;
|
|
1347
1419
|
/**
|
|
1348
1420
|
* Background painted behind an overlaid composer footer
|
|
1349
1421
|
* (`composer.placement: "overlay"`). Any CSS `background` value, gradients
|
|
1350
1422
|
* included — same convention as the shadow tokens. Inert under
|
|
1351
1423
|
* `placement: "block"`.
|
|
1352
|
-
* @default "transparent"
|
|
1424
|
+
* @default "transparent" (V4); a theme-aware 24px fade (V5)
|
|
1353
1425
|
*/
|
|
1354
1426
|
overlayBand?: string;
|
|
1355
1427
|
/** Segmented mode-group track. */
|
|
@@ -1525,6 +1597,8 @@ interface ScrollToBottomTokens extends ComponentTokenSet {
|
|
|
1525
1597
|
}
|
|
1526
1598
|
/** Visual tokens shared by one suggestion presentation variant. */
|
|
1527
1599
|
interface SuggestionVariantTokens extends ComponentTokenSet {
|
|
1600
|
+
/** Label weight. V4: 500; V5: 400. */
|
|
1601
|
+
fontWeight?: string;
|
|
1528
1602
|
/** Space inside one item, between its icon and its copy. */
|
|
1529
1603
|
gap?: string;
|
|
1530
1604
|
/** Space between suggestion items in the container. */
|
|
@@ -1573,6 +1647,7 @@ interface ComponentTokens {
|
|
|
1573
1647
|
voice: VoiceTokens;
|
|
1574
1648
|
approval: ApprovalTokens;
|
|
1575
1649
|
attachment: AttachmentTokens;
|
|
1650
|
+
activity?: ActivityTokens;
|
|
1576
1651
|
toolBubble: ToolBubbleTokens;
|
|
1577
1652
|
reasoningBubble: ReasoningBubbleTokens;
|
|
1578
1653
|
/** Event-stream inspector badge chips. */
|
|
@@ -4393,6 +4468,14 @@ type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-previe
|
|
|
4393
4468
|
*/
|
|
4394
4469
|
type AgentWidgetToolCallLoadingAnimation = "none" | "pulse" | "shimmer" | "shimmer-color" | "rainbow";
|
|
4395
4470
|
type AgentWidgetToolCallDisplayFeature = {
|
|
4471
|
+
/** Activity chrome. Defaults to card in V4 and row with future.v5Defaults. */
|
|
4472
|
+
variant?: "card" | "row";
|
|
4473
|
+
/** Row status icons: always, active/attention-needed only, or never. V5 defaults to active; V4 to always. */
|
|
4474
|
+
iconVisibility?: "always" | "active" | "never";
|
|
4475
|
+
/** Row variant: open when the first content chunk arrives. Default false in V5; true in V4. */
|
|
4476
|
+
autoExpand?: boolean;
|
|
4477
|
+
/** Row variant: collapse once after completion, in ms; false disables. Default 1000. */
|
|
4478
|
+
autoCollapseDelay?: number | false;
|
|
4396
4479
|
/**
|
|
4397
4480
|
* Controls what collapsed tool call rows show in their header/summary area.
|
|
4398
4481
|
* @default "tool-call"
|
|
@@ -4423,9 +4506,10 @@ type AgentWidgetToolCallDisplayFeature = {
|
|
|
4423
4506
|
* Controls how a grouped tool sequence is rendered.
|
|
4424
4507
|
* - `"stack"`: show the group summary and each child tool row.
|
|
4425
4508
|
* - `"summary"`: show one consolidated summary row only.
|
|
4509
|
+
* - `"collapsible"`: expandable activity group (V5 default).
|
|
4426
4510
|
* @default "stack"
|
|
4427
4511
|
*/
|
|
4428
|
-
groupedMode?: "stack" | "summary";
|
|
4512
|
+
groupedMode?: "stack" | "summary" | "collapsible";
|
|
4429
4513
|
/**
|
|
4430
4514
|
* What happens to a tool call row once it completes.
|
|
4431
4515
|
*
|
|
@@ -4456,6 +4540,14 @@ type AgentWidgetToolCallDisplayFeature = {
|
|
|
4456
4540
|
/** See `features.toolCallDisplay.completedVisibility`. */
|
|
4457
4541
|
type AgentWidgetToolCallCompletedVisibility = "kept" | "removed";
|
|
4458
4542
|
type AgentWidgetReasoningDisplayFeature = {
|
|
4543
|
+
/** Activity chrome. Defaults to card in V4 and row with future.v5Defaults. */
|
|
4544
|
+
variant?: "card" | "row";
|
|
4545
|
+
/** Row status icons: always, active/attention-needed only, or never. V5 defaults to active; V4 to always. */
|
|
4546
|
+
iconVisibility?: "always" | "active" | "never";
|
|
4547
|
+
/** Row variant: open when the first content chunk arrives. Default false in V5; true in V4. */
|
|
4548
|
+
autoExpand?: boolean;
|
|
4549
|
+
/** Row variant: collapse once after completion, in ms; false disables. Default 1000. */
|
|
4550
|
+
autoCollapseDelay?: number | false;
|
|
4459
4551
|
/**
|
|
4460
4552
|
* When true, active collapsed reasoning rows can render a lightweight preview block.
|
|
4461
4553
|
* @default false
|
|
@@ -5151,8 +5243,8 @@ interface AgentWidgetHistoryFeature {
|
|
|
5151
5243
|
* otherwise `"browser"`) and narrows it to what the provider advertises, so a
|
|
5152
5244
|
* browser-only provider is never asked for a scope it cannot serve. An
|
|
5153
5245
|
* explicit `features.history.scope` is a hard request and still fails closed
|
|
5154
|
-
* with `unsupported_scope`.
|
|
5155
|
-
*
|
|
5246
|
+
* with `unsupported_scope`. History operations on a supplied provider never
|
|
5247
|
+
* call `getIdentityProof`, and `HistoryOperationContext` carries only the resolved scope;
|
|
5156
5248
|
* report your own identity through `getIdentityStatus()` /
|
|
5157
5249
|
* `subscribeIdentityStatus()`, which is what the scope banner and its retry
|
|
5158
5250
|
* affordance read.
|
|
@@ -5536,7 +5628,7 @@ type EventStreamConfig = {
|
|
|
5536
5628
|
/**
|
|
5537
5629
|
* Fields to extract from event payloads for description text.
|
|
5538
5630
|
* The first matching field value is displayed after the badge.
|
|
5539
|
-
* @default ["flowName", "stepName", "name", "tool", "toolName"]
|
|
5631
|
+
* @default ["flowName", "stepName", "reasoningText", "text", "name", "tool", "toolName"]
|
|
5540
5632
|
*/
|
|
5541
5633
|
descriptionFields?: string[];
|
|
5542
5634
|
/**
|
|
@@ -5747,6 +5839,8 @@ type AgentWidgetComposerBarPeekConfig = {
|
|
|
5747
5839
|
streamAnimation?: AgentWidgetStreamAnimationFeature;
|
|
5748
5840
|
};
|
|
5749
5841
|
type AgentWidgetLauncherConfig = {
|
|
5842
|
+
/** Collapsed launcher shape. V4 defaults to pill; V5 defaults to circle. */
|
|
5843
|
+
variant?: "pill" | "circle";
|
|
5750
5844
|
enabled?: boolean;
|
|
5751
5845
|
title?: string;
|
|
5752
5846
|
subtitle?: string;
|
|
@@ -6502,9 +6596,9 @@ type AgentWidgetComposerConfig = {
|
|
|
6502
6596
|
/**
|
|
6503
6597
|
* Where the composer footer sits relative to the transcript.
|
|
6504
6598
|
*
|
|
6505
|
-
* - `"block"` (default): the footer is a flex sibling below the scroll body.
|
|
6599
|
+
* - `"block"` (V4 default): the footer is a flex sibling below the scroll body.
|
|
6506
6600
|
* Nothing scrolls behind it.
|
|
6507
|
-
* - `"overlay"
|
|
6601
|
+
* - `"overlay"` (V5 default): the footer is absolutely overlaid on the scroll body, so the
|
|
6508
6602
|
* transcript scrolls behind it (the chatgpt.com / claude.ai model, where the
|
|
6509
6603
|
* composer is sticky inside the scroller). The widget reserves the footer's
|
|
6510
6604
|
* live height as bottom padding on the scroll body and on a plugin welcome
|
|
@@ -6516,7 +6610,7 @@ type AgentWidgetComposerConfig = {
|
|
|
6516
6610
|
* included) and `theme.components.input.backdropFilter`.
|
|
6517
6611
|
*
|
|
6518
6612
|
* Ignored in composer-bar mount mode, which owns its own geometry.
|
|
6519
|
-
* @default "block"
|
|
6613
|
+
* @default "block" (V4), "overlay" (V5)
|
|
6520
6614
|
*/
|
|
6521
6615
|
placement?: ComposerPlacement;
|
|
6522
6616
|
/**
|
|
@@ -6530,8 +6624,9 @@ type AgentWidgetComposerConfig = {
|
|
|
6530
6624
|
*
|
|
6531
6625
|
* `"single-row"` describes the IDLE composer only. It composes with the
|
|
6532
6626
|
* compact state, so a wrapped draft, chips, attachment previews, a quote, a
|
|
6533
|
-
* pending card
|
|
6534
|
-
* as `data-persona-composer-compact` does today.
|
|
6627
|
+
* pending card all fall back to the stacked card, exactly
|
|
6628
|
+
* as `data-persona-composer-compact` does today. Recording alone does not
|
|
6629
|
+
* expand the composer; dictated text expands it when it wraps.
|
|
6535
6630
|
*
|
|
6536
6631
|
* Ignored in composer-bar mount mode, whose pill is already one row.
|
|
6537
6632
|
* @default "stacked"
|
|
@@ -6573,7 +6668,14 @@ type AgentWidgetClearChatConfig = {
|
|
|
6573
6668
|
showTooltip?: boolean;
|
|
6574
6669
|
};
|
|
6575
6670
|
type AgentWidgetStatusIndicatorConfig = {
|
|
6671
|
+
/** Show the indicator. Explicit false also hides transient connection states. */
|
|
6576
6672
|
visible?: boolean;
|
|
6673
|
+
/**
|
|
6674
|
+
* "always" shows status beneath the composer; "transient" shows connecting,
|
|
6675
|
+
* reconnecting, and error status above it, hiding normal idle/streaming status.
|
|
6676
|
+
* Available in both defaults states. Default: "always" in v4, "transient" in v5.
|
|
6677
|
+
*/
|
|
6678
|
+
mode?: "always" | "transient";
|
|
6577
6679
|
/** Text alignment. Default: 'right'. */
|
|
6578
6680
|
align?: 'left' | 'center' | 'right';
|
|
6579
6681
|
idleText?: string;
|
|
@@ -6587,6 +6689,22 @@ type AgentWidgetStatusIndicatorConfig = {
|
|
|
6587
6689
|
/** Status text while a reconnect attempt is in flight. */
|
|
6588
6690
|
resumingText?: string;
|
|
6589
6691
|
};
|
|
6692
|
+
/** Built-in `voiceRecognition.prewarm` triggers. See {@link AgentWidgetVoiceRecognitionConfig.prewarm}. */
|
|
6693
|
+
type AgentWidgetVoicePrewarmTrigger = 'hover';
|
|
6694
|
+
/**
|
|
6695
|
+
* Custom `voiceRecognition.prewarm` trigger. Runs while the composer has a mic
|
|
6696
|
+
* button, and again when the button is rebuilt or `update()` swaps in a
|
|
6697
|
+
* different function. Call `warm()` whenever the visitor shows intent to talk
|
|
6698
|
+
* (it is safe to call repeatedly). Return a cleanup to run on replacement.
|
|
6699
|
+
*/
|
|
6700
|
+
type AgentWidgetVoicePrewarmHook = (context: {
|
|
6701
|
+
/** Fire-and-forget voice warm-up; latched and error-swallowing. */
|
|
6702
|
+
warm: () => void;
|
|
6703
|
+
/** The composer's current mic button. */
|
|
6704
|
+
micButton: HTMLButtonElement;
|
|
6705
|
+
/** The widget's mount element. */
|
|
6706
|
+
mount: HTMLElement;
|
|
6707
|
+
}) => void | (() => void);
|
|
6590
6708
|
type AgentWidgetVoiceRecognitionConfig = {
|
|
6591
6709
|
/**
|
|
6592
6710
|
* Enable the mic button and voice input. The mic still only renders when the
|
|
@@ -6652,6 +6770,29 @@ type AgentWidgetVoiceRecognitionConfig = {
|
|
|
6652
6770
|
* Fires once per turn after the reply completes.
|
|
6653
6771
|
*/
|
|
6654
6772
|
onMetrics?: (metrics: VoiceMetrics) => void;
|
|
6773
|
+
/**
|
|
6774
|
+
* Warm the voice path when the visitor shows intent to talk, before the mic
|
|
6775
|
+
* click, so the call starts faster.
|
|
6776
|
+
*
|
|
6777
|
+
* - `'hover'`: when the pointer enters the mic button, it receives focus, or
|
|
6778
|
+
* (on touch) the first pointer-down on it.
|
|
6779
|
+
* - `false`: never.
|
|
6780
|
+
* - A function: custom trigger. Called with `{ warm, micButton, mount }`
|
|
6781
|
+
* while the mic button exists (and again when the button is rebuilt or
|
|
6782
|
+
* `update()` swaps in a different function); call `warm()` whenever you
|
|
6783
|
+
* decide, e.g. when the panel opens. May return a cleanup that runs on
|
|
6784
|
+
* destroy, rebuild, or replacement. Replaces the built-in trigger.
|
|
6785
|
+
*
|
|
6786
|
+
* What `warm()` does depends on the provider: `runtype` fires its prewarm
|
|
6787
|
+
* (see `provider.runtype.prewarmMode`), a `custom` provider's optional
|
|
6788
|
+
* {@link VoiceProvider.prewarm} runs, and the browser (Web Speech) path
|
|
6789
|
+
* starts the client-token session init (as `sessionInit` does), since speech
|
|
6790
|
+
* recognition itself cannot start before the click. Warming is
|
|
6791
|
+
* fire-and-forget, latched, and never surfaces an error or UI state.
|
|
6792
|
+
*
|
|
6793
|
+
* @default 'hover' in client token mode, otherwise `false`
|
|
6794
|
+
*/
|
|
6795
|
+
prewarm?: AgentWidgetVoicePrewarmTrigger | AgentWidgetVoicePrewarmHook | false;
|
|
6655
6796
|
provider?: {
|
|
6656
6797
|
type: 'browser' | 'runtype' | 'custom';
|
|
6657
6798
|
browser?: {
|
|
@@ -6673,6 +6814,23 @@ type AgentWidgetVoiceRecognitionConfig = {
|
|
|
6673
6814
|
* `@runtypelabs/persona/voice-worklet-player` for a jitter-buffered engine.
|
|
6674
6815
|
*/
|
|
6675
6816
|
createPlaybackEngine?: () => VoicePlaybackEngine | Promise<VoicePlaybackEngine>;
|
|
6817
|
+
/**
|
|
6818
|
+
* How `prewarm()` warms the voice path (see `voiceRecognition.prewarm`).
|
|
6819
|
+
*
|
|
6820
|
+
* - `'request'` (default): a fire-and-forget
|
|
6821
|
+
* `POST {host}/v1/client/agents/{agentId}/voice/prewarm`.
|
|
6822
|
+
* - `'attach'`: open the voice WebSocket ahead of the click without
|
|
6823
|
+
* starting a call; the click then starts the call on that socket. It can
|
|
6824
|
+
* create server work before the visitor clicks, so it is opt-in.
|
|
6825
|
+
* @default 'request'
|
|
6826
|
+
*/
|
|
6827
|
+
prewarmMode?: 'request' | 'attach';
|
|
6828
|
+
/**
|
|
6829
|
+
* `'attach'` mode: how long (ms) an attached socket waits for the click
|
|
6830
|
+
* before it closes. The server clamps it to 30000..600000.
|
|
6831
|
+
* @default 30000
|
|
6832
|
+
*/
|
|
6833
|
+
attachIdleMs?: number;
|
|
6676
6834
|
/** @deprecated No-op on the realtime path: the server's STT owns turn-taking. */
|
|
6677
6835
|
pauseDuration?: number;
|
|
6678
6836
|
/** @deprecated No-op on the realtime path: the server's STT owns turn-taking. */
|
|
@@ -6958,6 +7116,10 @@ type VoiceConfig = {
|
|
|
6958
7116
|
* `@runtypelabs/persona/voice-worklet-player` for a jitter-buffered engine.
|
|
6959
7117
|
*/
|
|
6960
7118
|
createPlaybackEngine?: () => VoicePlaybackEngine | Promise<VoicePlaybackEngine>;
|
|
7119
|
+
/** See `voiceRecognition.provider.runtype.prewarmMode`. @default 'request' */
|
|
7120
|
+
prewarmMode?: 'request' | 'attach';
|
|
7121
|
+
/** See `voiceRecognition.provider.runtype.attachIdleMs`. @default 30000 */
|
|
7122
|
+
attachIdleMs?: number;
|
|
6961
7123
|
/** @deprecated No-op on the realtime path: the server's STT owns turn-taking. */
|
|
6962
7124
|
pauseDuration?: number;
|
|
6963
7125
|
/** @deprecated No-op on the realtime path: the server's STT owns turn-taking. */
|
|
@@ -7018,6 +7180,13 @@ interface VoiceProvider {
|
|
|
7018
7180
|
deactivateBargeIn?(): Promise<void>;
|
|
7019
7181
|
/** Stop playback / cancel in-flight request without starting recording */
|
|
7020
7182
|
stopPlayback?(): void;
|
|
7183
|
+
/**
|
|
7184
|
+
* Warm the provider ahead of `startListening()` (the widget calls it on mic
|
|
7185
|
+
* intent, see `voiceRecognition.prewarm`). Must be fire-and-forget: never
|
|
7186
|
+
* throw, emit errors or status, or acquire the microphone. May be called
|
|
7187
|
+
* repeatedly; throttle as needed.
|
|
7188
|
+
*/
|
|
7189
|
+
prewarm?(): void;
|
|
7021
7190
|
}
|
|
7022
7191
|
/**
|
|
7023
7192
|
* Extra context for an approval decision, surfaced to `onDecision` and to the
|
|
@@ -7393,7 +7562,8 @@ type AgentWidgetResolvedSuggestion = {
|
|
|
7393
7562
|
};
|
|
7394
7563
|
/** Presentation keys shared by every suggestion surface. */
|
|
7395
7564
|
type AgentWidgetSuggestionSurfaceConfig = {
|
|
7396
|
-
/** Item density.
|
|
7565
|
+
/** Item density. V4 starters: card. V5 starters: chip, or card in fullscreen.
|
|
7566
|
+
* Follow-ups default to chip. */
|
|
7397
7567
|
variant?: AgentWidgetSuggestionVariant;
|
|
7398
7568
|
/** Default click behavior, overridable per item. Defaults to `send`. */
|
|
7399
7569
|
behavior?: AgentWidgetSuggestionBehavior;
|
|
@@ -7404,7 +7574,7 @@ type AgentWidgetSuggestionSurfaceConfig = {
|
|
|
7404
7574
|
* own stacking.
|
|
7405
7575
|
*/
|
|
7406
7576
|
overflow?: "scroll" | "wrap";
|
|
7407
|
-
/** Maximum visible items. Defaults to 4. */
|
|
7577
|
+
/** Maximum visible items. Defaults to 4, or 3 for V5 non-fullscreen starters. */
|
|
7408
7578
|
maxItems?: number;
|
|
7409
7579
|
};
|
|
7410
7580
|
type AgentWidgetStarterSuggestionsConfig = AgentWidgetSuggestionSurfaceConfig & {
|
|
@@ -7458,8 +7628,8 @@ type AgentWidgetSuggestionsConfig = {
|
|
|
7458
7628
|
type AgentWidgetWelcomeVariant = "card" | "hero" | "none";
|
|
7459
7629
|
/**
|
|
7460
7630
|
* When the welcome surface goes away. `"never"` is the default for `"card"`;
|
|
7461
|
-
* `"on-first-message"` is
|
|
7462
|
-
*
|
|
7631
|
+
* `"on-first-message"` is forced for legacy V4 `"hero"`. V5 defaults every
|
|
7632
|
+
* variant to `"on-first-message"`. Explicit layout opts into overridable dismissal.
|
|
7463
7633
|
*/
|
|
7464
7634
|
type AgentWidgetWelcomeDismiss = "never" | "on-first-message";
|
|
7465
7635
|
/**
|
|
@@ -7513,7 +7683,10 @@ type AgentWidgetWelcomeAlign = "start" | "center";
|
|
|
7513
7683
|
* host-set value from a filled-in default.
|
|
7514
7684
|
*/
|
|
7515
7685
|
interface AgentWidgetWelcomeConfig {
|
|
7516
|
-
/**
|
|
7686
|
+
/** Vertical placement: V4 defaults to top; V5 to centered. Fullscreen centered
|
|
7687
|
+
* welcomes also raise the empty composer unless `anchor` is explicitly set. */
|
|
7688
|
+
layout?: "top" | "centered";
|
|
7689
|
+
/** Card or hero title. V4: "Hello 👋". V5: "What can I help with?". */
|
|
7517
7690
|
title?: string;
|
|
7518
7691
|
/**
|
|
7519
7692
|
* Small muted line above the title, e.g. a section name. Omitted when unset
|
|
@@ -7526,19 +7699,22 @@ interface AgentWidgetWelcomeConfig {
|
|
|
7526
7699
|
icon?: AgentWidgetWelcomeIcon;
|
|
7527
7700
|
/**
|
|
7528
7701
|
* Horizontal alignment of the kicker, title, subtitle, and starter
|
|
7529
|
-
* suggestions.
|
|
7702
|
+
* suggestions. Centered layouts default to center. Otherwise unset follows
|
|
7703
|
+
* the variant: `card` starts, `hero` centers.
|
|
7530
7704
|
*/
|
|
7531
7705
|
align?: AgentWidgetWelcomeAlign;
|
|
7532
7706
|
/** @default "card" */
|
|
7533
7707
|
variant?: AgentWidgetWelcomeVariant;
|
|
7534
|
-
/**
|
|
7708
|
+
/** V4: never for card, forced on-first-message for hero. V5: on-first-message
|
|
7709
|
+
* for all variants; explicit values win. Explicit layout also allows overriding
|
|
7710
|
+
* the legacy hero dismissal in V4. */
|
|
7535
7711
|
dismiss?: AgentWidgetWelcomeDismiss;
|
|
7536
7712
|
/**
|
|
7537
7713
|
* Vertical anchoring of the greeting-plus-composer pair in the EMPTY
|
|
7538
7714
|
* conversation only. On the first message the pair drops to the bottom
|
|
7539
7715
|
* (animated; see `data-persona-conversation-state`).
|
|
7540
7716
|
*
|
|
7541
|
-
* - `"bottom"
|
|
7717
|
+
* - `"bottom"`: the composer stays pinned at the bottom.
|
|
7542
7718
|
* - `"center"`: greeting and composer float together so the composer's top
|
|
7543
7719
|
* edge lands at `anchorComposerTop` of the panel column, and the welcome
|
|
7544
7720
|
* surface is end-anchored `composerGap` above it.
|
|
@@ -7546,7 +7722,8 @@ interface AgentWidgetWelcomeConfig {
|
|
|
7546
7722
|
* Composes with either `composer.placement`. Ignored in composer-bar mount
|
|
7547
7723
|
* mode. `renderWelcome` plugin content inherits the anchor: the widget
|
|
7548
7724
|
* positions the overlay host and reserves the composer zone.
|
|
7549
|
-
*
|
|
7725
|
+
* Defaults to bottom, except centered fullscreen layouts, which center the
|
|
7726
|
+
* measured greeting/composer group when no anchor override is supplied.
|
|
7550
7727
|
*/
|
|
7551
7728
|
anchor?: AgentWidgetWelcomeAnchor;
|
|
7552
7729
|
/**
|
|
@@ -8136,6 +8313,9 @@ type AgentWidgetLayoutConfig = {
|
|
|
8136
8313
|
* `launcher.composerBar.contentMaxWidth`)
|
|
8137
8314
|
*/
|
|
8138
8315
|
contentMaxWidth?: string;
|
|
8316
|
+
/** Fade the transcript's top edge when content is scrolled above it.
|
|
8317
|
+
* Defaults to false in V4 and true with future.v5Defaults. */
|
|
8318
|
+
topFade?: boolean;
|
|
8139
8319
|
};
|
|
8140
8320
|
/**
|
|
8141
8321
|
* Token types for marked renderer methods
|
|
@@ -8749,7 +8929,30 @@ type AgentWidgetLoadingIndicatorConfig = {
|
|
|
8749
8929
|
*/
|
|
8750
8930
|
renderIdle?: (context: IdleIndicatorRenderContext) => HTMLElement | null;
|
|
8751
8931
|
};
|
|
8932
|
+
/** Built-in `sessionInit` triggers. See {@link AgentWidgetConfig.sessionInit}. */
|
|
8933
|
+
type AgentWidgetSessionInitTrigger = 'input' | 'focus' | 'mount' | 'send';
|
|
8934
|
+
/**
|
|
8935
|
+
* Custom `sessionInit` trigger. Runs when the widget mounts in client token mode,
|
|
8936
|
+
* and again if `update()` swaps in a different function. Call `warm()` whenever
|
|
8937
|
+
* the visitor shows intent (it is safe to call repeatedly). Return a cleanup to
|
|
8938
|
+
* run when the widget is destroyed or the hook is replaced.
|
|
8939
|
+
*/
|
|
8940
|
+
type AgentWidgetSessionInitHook = (context: {
|
|
8941
|
+
/** Fire-and-forget early session init; latched and error-swallowing. */
|
|
8942
|
+
warm: () => void;
|
|
8943
|
+
/** The widget's mount element. */
|
|
8944
|
+
mount: HTMLElement;
|
|
8945
|
+
}) => void | (() => void);
|
|
8752
8946
|
type AgentWidgetConfig = {
|
|
8947
|
+
/** Opt in to upcoming major-version defaults without changing explicit settings. */
|
|
8948
|
+
future?: {
|
|
8949
|
+
/**
|
|
8950
|
+
* Use the v5 default styling as it rolls out in 4.x. Every affected setting
|
|
8951
|
+
* remains independently configurable. Explicit options and theme tokens win.
|
|
8952
|
+
* @default false
|
|
8953
|
+
*/
|
|
8954
|
+
v5Defaults?: boolean;
|
|
8955
|
+
};
|
|
8753
8956
|
apiUrl?: string;
|
|
8754
8957
|
flowId?: string;
|
|
8755
8958
|
/**
|
|
@@ -8904,6 +9107,46 @@ type AgentWidgetConfig = {
|
|
|
8904
9107
|
* ```
|
|
8905
9108
|
*/
|
|
8906
9109
|
onSessionExpired?: () => void;
|
|
9110
|
+
/**
|
|
9111
|
+
* When the widget calls `/v1/client/init` in client token mode, ahead of the
|
|
9112
|
+
* first send. Ignored outside client token mode.
|
|
9113
|
+
*
|
|
9114
|
+
* - `'input'` (default): on the composer's first user keystroke that leaves
|
|
9115
|
+
* non-empty text. Programmatic value changes (restored drafts,
|
|
9116
|
+
* `setMessage()`, history recall) do not count.
|
|
9117
|
+
* - `'focus'`: when the visitor focuses the composer by pointer or Tab (and
|
|
9118
|
+
* on first input, as a fallback). Programmatic focus, such as
|
|
9119
|
+
* `autoFocusInput` on open or mount, does not count.
|
|
9120
|
+
* - `'mount'`: as soon as the widget mounts (the behavior before this option
|
|
9121
|
+
* existed). Use it when a server-configured welcome message, which arrives
|
|
9122
|
+
* with the init response, must show before the visitor types.
|
|
9123
|
+
* - `'send'`: no early init; the first send initializes the session.
|
|
9124
|
+
* - A function: custom trigger. Called on mount (and when `update()` swaps
|
|
9125
|
+
* in a different function) with a `warm` callback to call whenever you
|
|
9126
|
+
* decide (e.g. on hover); may return a cleanup that runs on destroy or
|
|
9127
|
+
* replacement. Replaces the built-in triggers.
|
|
9128
|
+
*
|
|
9129
|
+
* The early init is fire-and-forget: it runs at most once per session
|
|
9130
|
+
* lifetime (re-armed after expiry or a new conversation), sends exactly the
|
|
9131
|
+
* same request the send would, and swallows errors. A failure resurfaces
|
|
9132
|
+
* when the send retries init. A send during an in-flight early init reuses
|
|
9133
|
+
* it, so only one `/v1/client/init` is issued. When visitor history is
|
|
9134
|
+
* enabled the widget still initializes on mount to restore the conversation.
|
|
9135
|
+
* Hosts can also trigger it imperatively with `controller.warmSession()`.
|
|
9136
|
+
*
|
|
9137
|
+
* @default 'input'
|
|
9138
|
+
*
|
|
9139
|
+
* @example
|
|
9140
|
+
* ```typescript
|
|
9141
|
+
* config: {
|
|
9142
|
+
* clientToken: 'ct_live_...',
|
|
9143
|
+
* sessionInit: ({ warm, mount }) => {
|
|
9144
|
+
* mount.addEventListener('pointerenter', warm, { once: true });
|
|
9145
|
+
* }
|
|
9146
|
+
* }
|
|
9147
|
+
* ```
|
|
9148
|
+
*/
|
|
9149
|
+
sessionInit?: AgentWidgetSessionInitTrigger | AgentWidgetSessionInitHook;
|
|
8907
9150
|
/**
|
|
8908
9151
|
* Get stored session ID for session resumption (client token mode only).
|
|
8909
9152
|
* Called when initializing a new session to check if there's a previous session_id
|
|
@@ -8936,13 +9179,20 @@ type AgentWidgetConfig = {
|
|
|
8936
9179
|
*/
|
|
8937
9180
|
setStoredSessionId?: (sessionId: string) => void;
|
|
8938
9181
|
/**
|
|
8939
|
-
*
|
|
9182
|
+
* With identityProvider, called before every client-token chat POST, including retries, independently of history.
|
|
9183
|
+
* Also called immediately before any cross-device history request and before a
|
|
8940
9184
|
* conversationId resume of a conversation discovered on another device.
|
|
8941
|
-
* Return a fresh end-user access token (rt_eu_… / JWT). Null
|
|
8942
|
-
*
|
|
8943
|
-
* until resetHistoryIdentity()
|
|
9185
|
+
* Return a fresh end-user access token (rt_eu_… / JWT). Null stops identity-enabled chat.
|
|
9186
|
+
* For history only, null uses exact-browser scope for a never-bound visitor;
|
|
9187
|
+
* a bound visitor fails closed until resetHistoryIdentity(). Never cached.
|
|
8944
9188
|
*/
|
|
8945
9189
|
getIdentityProof?: () => string | null | Promise<string | null>;
|
|
9190
|
+
/**
|
|
9191
|
+
* Provider name registered with Runtype, for example "clerk". Enables per-request
|
|
9192
|
+
* chat identity through getIdentityProof without enabling history. A missing or
|
|
9193
|
+
* failed proof stops the turn; omitting this preserves history-only callbacks.
|
|
9194
|
+
*/
|
|
9195
|
+
identityProvider?: string;
|
|
8946
9196
|
/**
|
|
8947
9197
|
* Read the persisted active conversation id (client token mode only).
|
|
8948
9198
|
* Called only after the internal stored-state bootstrap gate resolves.
|
|
@@ -9616,6 +9866,8 @@ type AgentWidgetReasoning = {
|
|
|
9616
9866
|
durationMs?: number;
|
|
9617
9867
|
};
|
|
9618
9868
|
type AgentWidgetToolCall = {
|
|
9869
|
+
/** Optional approval state for activity-row status chrome. */
|
|
9870
|
+
approvalStatus?: "pending" | "approved" | "denied" | "timeout";
|
|
9619
9871
|
id: string;
|
|
9620
9872
|
name?: string;
|
|
9621
9873
|
status: "pending" | "running" | "complete";
|
|
@@ -10085,6 +10337,14 @@ declare class AgentWidgetClient {
|
|
|
10085
10337
|
private currentClientTurnId;
|
|
10086
10338
|
private clientSession;
|
|
10087
10339
|
private sessionInitPromise;
|
|
10340
|
+
/**
|
|
10341
|
+
* Early-init latch for `warmSession()`. `false` = armed. Otherwise it holds
|
|
10342
|
+
* the session value (`null` or an expired session) the one early attempt was
|
|
10343
|
+
* made against, so a failed attempt is not retried on every keystroke. It is
|
|
10344
|
+
* re-armed when a session is installed or cleared, so each session lifetime
|
|
10345
|
+
* gets one early init.
|
|
10346
|
+
*/
|
|
10347
|
+
private sessionWarmLatch;
|
|
10088
10348
|
private lastSentClientToolsFingerprint;
|
|
10089
10349
|
private clientToolsFingerprintSessionId;
|
|
10090
10350
|
private sentNonEmptyClientToolsSessionId;
|
|
@@ -10193,9 +10453,27 @@ declare class AgentWidgetClient {
|
|
|
10193
10453
|
after: string;
|
|
10194
10454
|
signal: AbortSignal;
|
|
10195
10455
|
}): Promise<Response>;
|
|
10456
|
+
/**
|
|
10457
|
+
* Fire-and-forget early `initSession()` for client-token mode, driven by the
|
|
10458
|
+
* widget's `sessionInit` trigger (or a host calling it directly, e.g. on
|
|
10459
|
+
* hover). It fires at most once per session lifetime and is a no-op while a
|
|
10460
|
+
* session is live or an init is already in flight. Errors are swallowed, with
|
|
10461
|
+
* no `onSessionExpired` and no UI: a send calls `initSession()` again and
|
|
10462
|
+
* reuses the in-flight promise, so any failure resurfaces there exactly as it
|
|
10463
|
+
* would without the early init. Sends nothing new on the wire. Outside
|
|
10464
|
+
* client-token mode this does nothing.
|
|
10465
|
+
*
|
|
10466
|
+
* Resolves with the session this call initialized, or `null` when it was
|
|
10467
|
+
* skipped or failed. It never rejects.
|
|
10468
|
+
*/
|
|
10469
|
+
warmSession(): Promise<ClientSession | null>;
|
|
10196
10470
|
/**
|
|
10197
10471
|
* Initialize session for client token mode.
|
|
10198
|
-
* Called
|
|
10472
|
+
* Called by the send if no live session exists. The widget normally calls
|
|
10473
|
+
* it earlier, when the visitor shows intent to send (see the `sessionInit`
|
|
10474
|
+
* config option and `warmSession()`), and concurrent calls share one
|
|
10475
|
+
* in-flight request, so a send racing an early init issues a single
|
|
10476
|
+
* `/v1/client/init`.
|
|
10199
10477
|
*/
|
|
10200
10478
|
initSession(): Promise<ClientSession>;
|
|
10201
10479
|
/** Visitor history rides on client-token init only, and latches off after a 403 degrade. */
|
|
@@ -10340,6 +10618,7 @@ declare class AgentWidgetClient {
|
|
|
10340
10618
|
private historyUrl;
|
|
10341
10619
|
/** Explicit per-operation scope wins; otherwise config, then evidence. */
|
|
10342
10620
|
private resolveHistoryScope;
|
|
10621
|
+
private resolveChatIdentityProof;
|
|
10343
10622
|
/**
|
|
10344
10623
|
* Resolve the proof for one logical request. `null` is an intentional
|
|
10345
10624
|
* browser-scope fallback only while the visitor has never been bound.
|
|
@@ -10779,6 +11058,13 @@ declare class AgentWidgetSession {
|
|
|
10779
11058
|
* Toggle voice recognition on/off
|
|
10780
11059
|
*/
|
|
10781
11060
|
toggleVoice(): Promise<void>;
|
|
11061
|
+
/**
|
|
11062
|
+
* Warm the voice path ahead of the mic click (`voiceRecognition.prewarm`).
|
|
11063
|
+
* Session-owned providers (`runtype`, `custom`) get `provider.prewarm()` once
|
|
11064
|
+
* the lazy voice runtime has installed them; the browser (Web Speech) path
|
|
11065
|
+
* warms the client-token session instead. Fire-and-forget and silent.
|
|
11066
|
+
*/
|
|
11067
|
+
prewarmVoice(): void;
|
|
10782
11068
|
/**
|
|
10783
11069
|
* Cleanup voice resources
|
|
10784
11070
|
*/
|
|
@@ -10795,10 +11081,16 @@ declare class AgentWidgetSession {
|
|
|
10795
11081
|
* explicitly to pre-initialize the session and get config from server.
|
|
10796
11082
|
*/
|
|
10797
11083
|
initClientSession(): Promise<ClientSession | null>;
|
|
11084
|
+
/**
|
|
11085
|
+
* Early, fire-and-forget client-token init (`sessionInit` trigger or
|
|
11086
|
+
* `controller.initSession()`). Failures stay silent here: no `onError`, no
|
|
11087
|
+
* UI. The send re-runs `initSession()` and reports them as it always has.
|
|
11088
|
+
*/
|
|
11089
|
+
warmClientSession(): void;
|
|
10798
11090
|
/**
|
|
10799
11091
|
* Set the client session after initialization
|
|
10800
11092
|
*/
|
|
10801
|
-
setClientSession(session: ClientSession): void;
|
|
11093
|
+
setClientSession(session: ClientSession, pristine?: boolean): void;
|
|
10802
11094
|
/**
|
|
10803
11095
|
* Welcome injection is skipped while `suppressWelcomeInjection` is latched:
|
|
10804
11096
|
* reopening a stored conversation is not a new thread, and the hydrated
|