@runtypelabs/persona 4.23.1 → 4.24.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-9Vxm-PPz.d.cts → types-Db61aI9J.d.cts} +25 -2
- package/dist/animations/{types-9Vxm-PPz.d.ts → types-Db61aI9J.d.ts} +25 -2
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/animations-extra.d.cts +25 -2
- package/dist/animations-extra.d.ts +25 -2
- package/dist/approval-ui-3NMYNXBD.js +1 -0
- package/dist/approval-ui.cjs +2 -2
- package/dist/approval-ui.d.cts +261 -40
- package/dist/approval-ui.d.ts +261 -40
- 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 +256 -28
- package/dist/artifacts-ui.d.ts +256 -28
- 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 +256 -28
- package/dist/context-mentions.d.ts +256 -28
- package/dist/event-stream-view.d.cts +256 -28
- package/dist/event-stream-view.d.ts +256 -28
- package/dist/forms-ui.d.cts +291 -30
- package/dist/forms-ui.d.ts +291 -30
- package/dist/history-view.d.cts +25 -2
- package/dist/history-view.d.ts +25 -2
- package/dist/index.cjs +70 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +337 -51
- package/dist/index.d.ts +337 -51
- 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 +256 -28
- package/dist/session-reconnect.d.ts +256 -28
- package/dist/smart-dom-reader.d.cts +256 -28
- package/dist/smart-dom-reader.d.ts +256 -28
- package/dist/theme-editor-preview.cjs +74 -73
- package/dist/theme-editor-preview.d.cts +263 -28
- package/dist/theme-editor-preview.d.ts +263 -28
- package/dist/theme-editor-preview.js +51 -50
- package/dist/theme-editor.cjs +10 -10
- package/dist/theme-editor.d.cts +276 -30
- package/dist/theme-editor.d.ts +276 -30
- 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/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.tool-pair-replay.test.ts +325 -0
- package/src/client.ts +154 -61
- 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 +28 -13
- package/src/index-core.ts +2 -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 +61 -9
- 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 +179 -23
- 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 +363 -74
- package/src/ui.v5-defaults.test.ts +144 -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/utils/tool-pair-replay.ts +100 -0
- package/src/welcome.test.ts +23 -0
- package/src/welcome.ts +16 -9
- package/dist/approval-ui-K7R5Q5OC.js +0 -1
package/dist/approval-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. */
|
|
@@ -1702,6 +1777,7 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1702
1777
|
turnIndex?: number;
|
|
1703
1778
|
type: "turn_start";
|
|
1704
1779
|
}) | ({
|
|
1780
|
+
attributes?: Record<string, string | number | boolean>;
|
|
1705
1781
|
completedAt?: string;
|
|
1706
1782
|
content?: string;
|
|
1707
1783
|
cost?: number;
|
|
@@ -1760,7 +1836,8 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1760
1836
|
};
|
|
1761
1837
|
turnId?: string;
|
|
1762
1838
|
type: "model_call_start";
|
|
1763
|
-
} | {
|
|
1839
|
+
} | ({
|
|
1840
|
+
attributes?: Record<string, string | number | boolean>;
|
|
1764
1841
|
completedAt?: string;
|
|
1765
1842
|
cost?: number;
|
|
1766
1843
|
durationMs?: number;
|
|
@@ -1784,10 +1861,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1784
1861
|
cacheWrite?: number;
|
|
1785
1862
|
input: number;
|
|
1786
1863
|
output: number;
|
|
1864
|
+
reasoning?: number;
|
|
1787
1865
|
};
|
|
1788
1866
|
turnId?: string;
|
|
1789
1867
|
type: "model_call_complete";
|
|
1790
|
-
} | {
|
|
1868
|
+
}) | {
|
|
1791
1869
|
executionId: string;
|
|
1792
1870
|
id: string;
|
|
1793
1871
|
index?: number;
|
|
@@ -2887,10 +2965,32 @@ type AgentWidgetContextMentionTokenRenderContext = {
|
|
|
2887
2965
|
ref: AgentWidgetContextMentionRef;
|
|
2888
2966
|
readonly: boolean;
|
|
2889
2967
|
};
|
|
2968
|
+
/** One earlier client-tool call replayed to the model, in `/v1/dispatch` shape. */
|
|
2969
|
+
type AgentWidgetReplayedToolCall = {
|
|
2970
|
+
toolCallId: string;
|
|
2971
|
+
/** Model-facing (sanitized) name, e.g. `webmcp_search`. */
|
|
2972
|
+
toolName: string;
|
|
2973
|
+
args: Record<string, unknown>;
|
|
2974
|
+
};
|
|
2975
|
+
/** The browser's answer to an {@link AgentWidgetReplayedToolCall}. */
|
|
2976
|
+
type AgentWidgetReplayedToolResult = {
|
|
2977
|
+
toolCallId: string;
|
|
2978
|
+
toolName: string;
|
|
2979
|
+
result: unknown;
|
|
2980
|
+
};
|
|
2981
|
+
/**
|
|
2982
|
+
* A message in the proxy/agent request payload. Earlier client-tool calls the
|
|
2983
|
+
* browser answered replay as an assistant message carrying `toolCalls`,
|
|
2984
|
+
* followed by a `tool` message carrying the matching `toolResults`; both have
|
|
2985
|
+
* empty `content`. Client-token mode never sends them: the server replays
|
|
2986
|
+
* from its own stored transcript there.
|
|
2987
|
+
*/
|
|
2890
2988
|
type AgentWidgetRequestPayloadMessage = {
|
|
2891
|
-
role: AgentWidgetMessageRole;
|
|
2989
|
+
role: AgentWidgetMessageRole | "tool";
|
|
2892
2990
|
content: MessageContent;
|
|
2893
2991
|
createdAt: string;
|
|
2992
|
+
toolCalls?: AgentWidgetReplayedToolCall[];
|
|
2993
|
+
toolResults?: AgentWidgetReplayedToolResult[];
|
|
2894
2994
|
};
|
|
2895
2995
|
type AgentWidgetRequestPayload = {
|
|
2896
2996
|
messages: AgentWidgetRequestPayloadMessage[];
|
|
@@ -3253,6 +3353,24 @@ type AgentMessageMetadata = {
|
|
|
3253
3353
|
* never re-resume the call.
|
|
3254
3354
|
*/
|
|
3255
3355
|
suggestRepliesResolved?: boolean;
|
|
3356
|
+
/**
|
|
3357
|
+
* The client-tool answer the server accepted through `/resume`, kept so
|
|
3358
|
+
* later proxy/agent turns can replay the call and its result to the model.
|
|
3359
|
+
* `toolName` is the widget's internal name (`webmcp:<name>` or a bare
|
|
3360
|
+
* built-in). Set only after the resume succeeds; preserved across
|
|
3361
|
+
* re-emissions of the tool message.
|
|
3362
|
+
*/
|
|
3363
|
+
clientToolAnswer?: {
|
|
3364
|
+
toolCallId: string;
|
|
3365
|
+
toolName: string;
|
|
3366
|
+
args: unknown;
|
|
3367
|
+
result: unknown;
|
|
3368
|
+
/**
|
|
3369
|
+
* Shared by the answers posted in one `/resume`, i.e. one assistant
|
|
3370
|
+
* turn's parallel calls; a chained call gets a new batch.
|
|
3371
|
+
*/
|
|
3372
|
+
batch?: string;
|
|
3373
|
+
};
|
|
3256
3374
|
};
|
|
3257
3375
|
type AgentWidgetRequestMiddlewareContext = {
|
|
3258
3376
|
payload: AgentWidgetRequestPayload;
|
|
@@ -4250,6 +4368,14 @@ type AgentWidgetToolCallCollapsedMode = "tool-call" | "tool-name" | "tool-previe
|
|
|
4250
4368
|
*/
|
|
4251
4369
|
type AgentWidgetToolCallLoadingAnimation = "none" | "pulse" | "shimmer" | "shimmer-color" | "rainbow";
|
|
4252
4370
|
type AgentWidgetToolCallDisplayFeature = {
|
|
4371
|
+
/** Activity chrome. Defaults to card in V4 and row with future.v5Defaults. */
|
|
4372
|
+
variant?: "card" | "row";
|
|
4373
|
+
/** Row status icons: always, active/attention-needed only, or never. V5 defaults to active; V4 to always. */
|
|
4374
|
+
iconVisibility?: "always" | "active" | "never";
|
|
4375
|
+
/** Row variant: open when the first content chunk arrives. Default false in V5; true in V4. */
|
|
4376
|
+
autoExpand?: boolean;
|
|
4377
|
+
/** Row variant: collapse once after completion, in ms; false disables. Default 1000. */
|
|
4378
|
+
autoCollapseDelay?: number | false;
|
|
4253
4379
|
/**
|
|
4254
4380
|
* Controls what collapsed tool call rows show in their header/summary area.
|
|
4255
4381
|
* @default "tool-call"
|
|
@@ -4280,9 +4406,10 @@ type AgentWidgetToolCallDisplayFeature = {
|
|
|
4280
4406
|
* Controls how a grouped tool sequence is rendered.
|
|
4281
4407
|
* - `"stack"`: show the group summary and each child tool row.
|
|
4282
4408
|
* - `"summary"`: show one consolidated summary row only.
|
|
4409
|
+
* - `"collapsible"`: expandable activity group (V5 default).
|
|
4283
4410
|
* @default "stack"
|
|
4284
4411
|
*/
|
|
4285
|
-
groupedMode?: "stack" | "summary";
|
|
4412
|
+
groupedMode?: "stack" | "summary" | "collapsible";
|
|
4286
4413
|
/**
|
|
4287
4414
|
* What happens to a tool call row once it completes.
|
|
4288
4415
|
*
|
|
@@ -4313,6 +4440,14 @@ type AgentWidgetToolCallDisplayFeature = {
|
|
|
4313
4440
|
/** See `features.toolCallDisplay.completedVisibility`. */
|
|
4314
4441
|
type AgentWidgetToolCallCompletedVisibility = "kept" | "removed";
|
|
4315
4442
|
type AgentWidgetReasoningDisplayFeature = {
|
|
4443
|
+
/** Activity chrome. Defaults to card in V4 and row with future.v5Defaults. */
|
|
4444
|
+
variant?: "card" | "row";
|
|
4445
|
+
/** Row status icons: always, active/attention-needed only, or never. V5 defaults to active; V4 to always. */
|
|
4446
|
+
iconVisibility?: "always" | "active" | "never";
|
|
4447
|
+
/** Row variant: open when the first content chunk arrives. Default false in V5; true in V4. */
|
|
4448
|
+
autoExpand?: boolean;
|
|
4449
|
+
/** Row variant: collapse once after completion, in ms; false disables. Default 1000. */
|
|
4450
|
+
autoCollapseDelay?: number | false;
|
|
4316
4451
|
/**
|
|
4317
4452
|
* When true, active collapsed reasoning rows can render a lightweight preview block.
|
|
4318
4453
|
* @default false
|
|
@@ -5008,8 +5143,8 @@ interface AgentWidgetHistoryFeature {
|
|
|
5008
5143
|
* otherwise `"browser"`) and narrows it to what the provider advertises, so a
|
|
5009
5144
|
* browser-only provider is never asked for a scope it cannot serve. An
|
|
5010
5145
|
* explicit `features.history.scope` is a hard request and still fails closed
|
|
5011
|
-
* with `unsupported_scope`.
|
|
5012
|
-
*
|
|
5146
|
+
* with `unsupported_scope`. History operations on a supplied provider never
|
|
5147
|
+
* call `getIdentityProof`, and `HistoryOperationContext` carries only the resolved scope;
|
|
5013
5148
|
* report your own identity through `getIdentityStatus()` /
|
|
5014
5149
|
* `subscribeIdentityStatus()`, which is what the scope banner and its retry
|
|
5015
5150
|
* affordance read.
|
|
@@ -5393,7 +5528,7 @@ type EventStreamConfig = {
|
|
|
5393
5528
|
/**
|
|
5394
5529
|
* Fields to extract from event payloads for description text.
|
|
5395
5530
|
* The first matching field value is displayed after the badge.
|
|
5396
|
-
* @default ["flowName", "stepName", "name", "tool", "toolName"]
|
|
5531
|
+
* @default ["flowName", "stepName", "reasoningText", "text", "name", "tool", "toolName"]
|
|
5397
5532
|
*/
|
|
5398
5533
|
descriptionFields?: string[];
|
|
5399
5534
|
/**
|
|
@@ -5604,6 +5739,8 @@ type AgentWidgetComposerBarPeekConfig = {
|
|
|
5604
5739
|
streamAnimation?: AgentWidgetStreamAnimationFeature;
|
|
5605
5740
|
};
|
|
5606
5741
|
type AgentWidgetLauncherConfig = {
|
|
5742
|
+
/** Collapsed launcher shape. V4 defaults to pill; V5 defaults to circle. */
|
|
5743
|
+
variant?: "pill" | "circle";
|
|
5607
5744
|
enabled?: boolean;
|
|
5608
5745
|
title?: string;
|
|
5609
5746
|
subtitle?: string;
|
|
@@ -6347,9 +6484,9 @@ type AgentWidgetComposerConfig = {
|
|
|
6347
6484
|
/**
|
|
6348
6485
|
* Where the composer footer sits relative to the transcript.
|
|
6349
6486
|
*
|
|
6350
|
-
* - `"block"` (default): the footer is a flex sibling below the scroll body.
|
|
6487
|
+
* - `"block"` (V4 default): the footer is a flex sibling below the scroll body.
|
|
6351
6488
|
* Nothing scrolls behind it.
|
|
6352
|
-
* - `"overlay"
|
|
6489
|
+
* - `"overlay"` (V5 default): the footer is absolutely overlaid on the scroll body, so the
|
|
6353
6490
|
* transcript scrolls behind it (the chatgpt.com / claude.ai model, where the
|
|
6354
6491
|
* composer is sticky inside the scroller). The widget reserves the footer's
|
|
6355
6492
|
* live height as bottom padding on the scroll body and on a plugin welcome
|
|
@@ -6361,7 +6498,7 @@ type AgentWidgetComposerConfig = {
|
|
|
6361
6498
|
* included) and `theme.components.input.backdropFilter`.
|
|
6362
6499
|
*
|
|
6363
6500
|
* Ignored in composer-bar mount mode, which owns its own geometry.
|
|
6364
|
-
* @default "block"
|
|
6501
|
+
* @default "block" (V4), "overlay" (V5)
|
|
6365
6502
|
*/
|
|
6366
6503
|
placement?: ComposerPlacement;
|
|
6367
6504
|
/**
|
|
@@ -6375,8 +6512,9 @@ type AgentWidgetComposerConfig = {
|
|
|
6375
6512
|
*
|
|
6376
6513
|
* `"single-row"` describes the IDLE composer only. It composes with the
|
|
6377
6514
|
* compact state, so a wrapped draft, chips, attachment previews, a quote, a
|
|
6378
|
-
* pending card
|
|
6379
|
-
* as `data-persona-composer-compact` does today.
|
|
6515
|
+
* pending card all fall back to the stacked card, exactly
|
|
6516
|
+
* as `data-persona-composer-compact` does today. Recording alone does not
|
|
6517
|
+
* expand the composer; dictated text expands it when it wraps.
|
|
6380
6518
|
*
|
|
6381
6519
|
* Ignored in composer-bar mount mode, whose pill is already one row.
|
|
6382
6520
|
* @default "stacked"
|
|
@@ -6418,7 +6556,14 @@ type AgentWidgetClearChatConfig = {
|
|
|
6418
6556
|
showTooltip?: boolean;
|
|
6419
6557
|
};
|
|
6420
6558
|
type AgentWidgetStatusIndicatorConfig = {
|
|
6559
|
+
/** Show the indicator. Explicit false also hides transient connection states. */
|
|
6421
6560
|
visible?: boolean;
|
|
6561
|
+
/**
|
|
6562
|
+
* "always" shows status beneath the composer; "transient" shows connecting,
|
|
6563
|
+
* reconnecting, and error status above it, hiding normal idle/streaming status.
|
|
6564
|
+
* Available in both defaults states. Default: "always" in v4, "transient" in v5.
|
|
6565
|
+
*/
|
|
6566
|
+
mode?: "always" | "transient";
|
|
6422
6567
|
/** Text alignment. Default: 'right'. */
|
|
6423
6568
|
align?: 'left' | 'center' | 'right';
|
|
6424
6569
|
idleText?: string;
|
|
@@ -7193,7 +7338,8 @@ type AgentWidgetResolvedSuggestion = {
|
|
|
7193
7338
|
};
|
|
7194
7339
|
/** Presentation keys shared by every suggestion surface. */
|
|
7195
7340
|
type AgentWidgetSuggestionSurfaceConfig = {
|
|
7196
|
-
/** Item density.
|
|
7341
|
+
/** Item density. V4 starters: card. V5 starters: chip, or card in fullscreen.
|
|
7342
|
+
* Follow-ups default to chip. */
|
|
7197
7343
|
variant?: AgentWidgetSuggestionVariant;
|
|
7198
7344
|
/** Default click behavior, overridable per item. Defaults to `send`. */
|
|
7199
7345
|
behavior?: AgentWidgetSuggestionBehavior;
|
|
@@ -7204,7 +7350,7 @@ type AgentWidgetSuggestionSurfaceConfig = {
|
|
|
7204
7350
|
* own stacking.
|
|
7205
7351
|
*/
|
|
7206
7352
|
overflow?: "scroll" | "wrap";
|
|
7207
|
-
/** Maximum visible items. Defaults to 4. */
|
|
7353
|
+
/** Maximum visible items. Defaults to 4, or 3 for V5 non-fullscreen starters. */
|
|
7208
7354
|
maxItems?: number;
|
|
7209
7355
|
};
|
|
7210
7356
|
type AgentWidgetStarterSuggestionsConfig = AgentWidgetSuggestionSurfaceConfig & {
|
|
@@ -7258,8 +7404,8 @@ type AgentWidgetSuggestionsConfig = {
|
|
|
7258
7404
|
type AgentWidgetWelcomeVariant = "card" | "hero" | "none";
|
|
7259
7405
|
/**
|
|
7260
7406
|
* When the welcome surface goes away. `"never"` is the default for `"card"`;
|
|
7261
|
-
* `"on-first-message"` is
|
|
7262
|
-
*
|
|
7407
|
+
* `"on-first-message"` is forced for legacy V4 `"hero"`. V5 defaults every
|
|
7408
|
+
* variant to `"on-first-message"`. Explicit layout opts into overridable dismissal.
|
|
7263
7409
|
*/
|
|
7264
7410
|
type AgentWidgetWelcomeDismiss = "never" | "on-first-message";
|
|
7265
7411
|
/**
|
|
@@ -7313,7 +7459,10 @@ type AgentWidgetWelcomeAlign = "start" | "center";
|
|
|
7313
7459
|
* host-set value from a filled-in default.
|
|
7314
7460
|
*/
|
|
7315
7461
|
interface AgentWidgetWelcomeConfig {
|
|
7316
|
-
/**
|
|
7462
|
+
/** Vertical placement: V4 defaults to top; V5 to centered. Fullscreen centered
|
|
7463
|
+
* welcomes also raise the empty composer unless `anchor` is explicitly set. */
|
|
7464
|
+
layout?: "top" | "centered";
|
|
7465
|
+
/** Card or hero title. V4: "Hello 👋". V5: "What can I help with?". */
|
|
7317
7466
|
title?: string;
|
|
7318
7467
|
/**
|
|
7319
7468
|
* Small muted line above the title, e.g. a section name. Omitted when unset
|
|
@@ -7326,19 +7475,22 @@ interface AgentWidgetWelcomeConfig {
|
|
|
7326
7475
|
icon?: AgentWidgetWelcomeIcon;
|
|
7327
7476
|
/**
|
|
7328
7477
|
* Horizontal alignment of the kicker, title, subtitle, and starter
|
|
7329
|
-
* suggestions.
|
|
7478
|
+
* suggestions. Centered layouts default to center. Otherwise unset follows
|
|
7479
|
+
* the variant: `card` starts, `hero` centers.
|
|
7330
7480
|
*/
|
|
7331
7481
|
align?: AgentWidgetWelcomeAlign;
|
|
7332
7482
|
/** @default "card" */
|
|
7333
7483
|
variant?: AgentWidgetWelcomeVariant;
|
|
7334
|
-
/**
|
|
7484
|
+
/** V4: never for card, forced on-first-message for hero. V5: on-first-message
|
|
7485
|
+
* for all variants; explicit values win. Explicit layout also allows overriding
|
|
7486
|
+
* the legacy hero dismissal in V4. */
|
|
7335
7487
|
dismiss?: AgentWidgetWelcomeDismiss;
|
|
7336
7488
|
/**
|
|
7337
7489
|
* Vertical anchoring of the greeting-plus-composer pair in the EMPTY
|
|
7338
7490
|
* conversation only. On the first message the pair drops to the bottom
|
|
7339
7491
|
* (animated; see `data-persona-conversation-state`).
|
|
7340
7492
|
*
|
|
7341
|
-
* - `"bottom"
|
|
7493
|
+
* - `"bottom"`: the composer stays pinned at the bottom.
|
|
7342
7494
|
* - `"center"`: greeting and composer float together so the composer's top
|
|
7343
7495
|
* edge lands at `anchorComposerTop` of the panel column, and the welcome
|
|
7344
7496
|
* surface is end-anchored `composerGap` above it.
|
|
@@ -7346,7 +7498,8 @@ interface AgentWidgetWelcomeConfig {
|
|
|
7346
7498
|
* Composes with either `composer.placement`. Ignored in composer-bar mount
|
|
7347
7499
|
* mode. `renderWelcome` plugin content inherits the anchor: the widget
|
|
7348
7500
|
* positions the overlay host and reserves the composer zone.
|
|
7349
|
-
*
|
|
7501
|
+
* Defaults to bottom, except centered fullscreen layouts, which center the
|
|
7502
|
+
* measured greeting/composer group when no anchor override is supplied.
|
|
7350
7503
|
*/
|
|
7351
7504
|
anchor?: AgentWidgetWelcomeAnchor;
|
|
7352
7505
|
/**
|
|
@@ -7838,6 +7991,9 @@ type AgentWidgetLayoutConfig = {
|
|
|
7838
7991
|
* `launcher.composerBar.contentMaxWidth`)
|
|
7839
7992
|
*/
|
|
7840
7993
|
contentMaxWidth?: string;
|
|
7994
|
+
/** Fade the transcript's top edge when content is scrolled above it.
|
|
7995
|
+
* Defaults to false in V4 and true with future.v5Defaults. */
|
|
7996
|
+
topFade?: boolean;
|
|
7841
7997
|
};
|
|
7842
7998
|
/**
|
|
7843
7999
|
* Token types for marked renderer methods
|
|
@@ -8451,7 +8607,30 @@ type AgentWidgetLoadingIndicatorConfig = {
|
|
|
8451
8607
|
*/
|
|
8452
8608
|
renderIdle?: (context: IdleIndicatorRenderContext) => HTMLElement | null;
|
|
8453
8609
|
};
|
|
8610
|
+
/** Built-in `sessionInit` triggers. See {@link AgentWidgetConfig.sessionInit}. */
|
|
8611
|
+
type AgentWidgetSessionInitTrigger = 'input' | 'focus' | 'mount' | 'send';
|
|
8612
|
+
/**
|
|
8613
|
+
* Custom `sessionInit` trigger. Runs when the widget mounts in client token mode,
|
|
8614
|
+
* and again if `update()` swaps in a different function. Call `warm()` whenever
|
|
8615
|
+
* the visitor shows intent (it is safe to call repeatedly). Return a cleanup to
|
|
8616
|
+
* run when the widget is destroyed or the hook is replaced.
|
|
8617
|
+
*/
|
|
8618
|
+
type AgentWidgetSessionInitHook = (context: {
|
|
8619
|
+
/** Fire-and-forget early session init; latched and error-swallowing. */
|
|
8620
|
+
warm: () => void;
|
|
8621
|
+
/** The widget's mount element. */
|
|
8622
|
+
mount: HTMLElement;
|
|
8623
|
+
}) => void | (() => void);
|
|
8454
8624
|
type AgentWidgetConfig = {
|
|
8625
|
+
/** Opt in to upcoming major-version defaults without changing explicit settings. */
|
|
8626
|
+
future?: {
|
|
8627
|
+
/**
|
|
8628
|
+
* Use the v5 default styling as it rolls out in 4.x. Every affected setting
|
|
8629
|
+
* remains independently configurable. Explicit options and theme tokens win.
|
|
8630
|
+
* @default false
|
|
8631
|
+
*/
|
|
8632
|
+
v5Defaults?: boolean;
|
|
8633
|
+
};
|
|
8455
8634
|
apiUrl?: string;
|
|
8456
8635
|
flowId?: string;
|
|
8457
8636
|
/**
|
|
@@ -8606,6 +8785,46 @@ type AgentWidgetConfig = {
|
|
|
8606
8785
|
* ```
|
|
8607
8786
|
*/
|
|
8608
8787
|
onSessionExpired?: () => void;
|
|
8788
|
+
/**
|
|
8789
|
+
* When the widget calls `/v1/client/init` in client token mode, ahead of the
|
|
8790
|
+
* first send. Ignored outside client token mode.
|
|
8791
|
+
*
|
|
8792
|
+
* - `'input'` (default): on the composer's first user keystroke that leaves
|
|
8793
|
+
* non-empty text. Programmatic value changes (restored drafts,
|
|
8794
|
+
* `setMessage()`, history recall) do not count.
|
|
8795
|
+
* - `'focus'`: when the visitor focuses the composer by pointer or Tab (and
|
|
8796
|
+
* on first input, as a fallback). Programmatic focus, such as
|
|
8797
|
+
* `autoFocusInput` on open or mount, does not count.
|
|
8798
|
+
* - `'mount'`: as soon as the widget mounts (the behavior before this option
|
|
8799
|
+
* existed). Use it when a server-configured welcome message, which arrives
|
|
8800
|
+
* with the init response, must show before the visitor types.
|
|
8801
|
+
* - `'send'`: no early init; the first send initializes the session.
|
|
8802
|
+
* - A function: custom trigger. Called on mount (and when `update()` swaps
|
|
8803
|
+
* in a different function) with a `warm` callback to call whenever you
|
|
8804
|
+
* decide (e.g. on hover); may return a cleanup that runs on destroy or
|
|
8805
|
+
* replacement. Replaces the built-in triggers.
|
|
8806
|
+
*
|
|
8807
|
+
* The early init is fire-and-forget: it runs at most once per session
|
|
8808
|
+
* lifetime (re-armed after expiry or a new conversation), sends exactly the
|
|
8809
|
+
* same request the send would, and swallows errors. A failure resurfaces
|
|
8810
|
+
* when the send retries init. A send during an in-flight early init reuses
|
|
8811
|
+
* it, so only one `/v1/client/init` is issued. When visitor history is
|
|
8812
|
+
* enabled the widget still initializes on mount to restore the conversation.
|
|
8813
|
+
* Hosts can also trigger it imperatively with `controller.warmSession()`.
|
|
8814
|
+
*
|
|
8815
|
+
* @default 'input'
|
|
8816
|
+
*
|
|
8817
|
+
* @example
|
|
8818
|
+
* ```typescript
|
|
8819
|
+
* config: {
|
|
8820
|
+
* clientToken: 'ct_live_...',
|
|
8821
|
+
* sessionInit: ({ warm, mount }) => {
|
|
8822
|
+
* mount.addEventListener('pointerenter', warm, { once: true });
|
|
8823
|
+
* }
|
|
8824
|
+
* }
|
|
8825
|
+
* ```
|
|
8826
|
+
*/
|
|
8827
|
+
sessionInit?: AgentWidgetSessionInitTrigger | AgentWidgetSessionInitHook;
|
|
8609
8828
|
/**
|
|
8610
8829
|
* Get stored session ID for session resumption (client token mode only).
|
|
8611
8830
|
* Called when initializing a new session to check if there's a previous session_id
|
|
@@ -8638,13 +8857,20 @@ type AgentWidgetConfig = {
|
|
|
8638
8857
|
*/
|
|
8639
8858
|
setStoredSessionId?: (sessionId: string) => void;
|
|
8640
8859
|
/**
|
|
8641
|
-
*
|
|
8860
|
+
* With identityProvider, called before every client-token chat POST, including retries, independently of history.
|
|
8861
|
+
* Also called immediately before any cross-device history request and before a
|
|
8642
8862
|
* conversationId resume of a conversation discovered on another device.
|
|
8643
|
-
* Return a fresh end-user access token (rt_eu_… / JWT). Null
|
|
8644
|
-
*
|
|
8645
|
-
* until resetHistoryIdentity()
|
|
8863
|
+
* Return a fresh end-user access token (rt_eu_… / JWT). Null stops identity-enabled chat.
|
|
8864
|
+
* For history only, null uses exact-browser scope for a never-bound visitor;
|
|
8865
|
+
* a bound visitor fails closed until resetHistoryIdentity(). Never cached.
|
|
8646
8866
|
*/
|
|
8647
8867
|
getIdentityProof?: () => string | null | Promise<string | null>;
|
|
8868
|
+
/**
|
|
8869
|
+
* Provider name registered with Runtype, for example "clerk". Enables per-request
|
|
8870
|
+
* chat identity through getIdentityProof without enabling history. A missing or
|
|
8871
|
+
* failed proof stops the turn; omitting this preserves history-only callbacks.
|
|
8872
|
+
*/
|
|
8873
|
+
identityProvider?: string;
|
|
8648
8874
|
/**
|
|
8649
8875
|
* Read the persisted active conversation id (client token mode only).
|
|
8650
8876
|
* Called only after the internal stored-state bootstrap gate resolves.
|
|
@@ -9318,6 +9544,8 @@ type AgentWidgetReasoning = {
|
|
|
9318
9544
|
durationMs?: number;
|
|
9319
9545
|
};
|
|
9320
9546
|
type AgentWidgetToolCall = {
|
|
9547
|
+
/** Optional approval state for activity-row status chrome. */
|
|
9548
|
+
approvalStatus?: "pending" | "approved" | "denied" | "timeout";
|
|
9321
9549
|
id: string;
|
|
9322
9550
|
name?: string;
|
|
9323
9551
|
status: "pending" | "running" | "complete";
|
|
@@ -9528,13 +9756,6 @@ type PersonaArtifactRecord = {
|
|
|
9528
9756
|
presentation?: PersonaArtifactPresentation;
|
|
9529
9757
|
};
|
|
9530
9758
|
|
|
9531
|
-
/**
|
|
9532
|
-
* Per-message expanded/collapsed state for the technical-details section.
|
|
9533
|
-
* Absent means "use the config default" (`approval.detailsDisplay`). Lives at
|
|
9534
|
-
* module scope so the choice survives idiomorph re-renders, mirroring
|
|
9535
|
-
* `toolExpansionState` in tool-bubble.ts.
|
|
9536
|
-
*/
|
|
9537
|
-
declare const approvalDetailsExpansionState: Map<string, boolean>;
|
|
9538
9759
|
/**
|
|
9539
9760
|
* Turn a wire tool name into a user-facing label: strips the `webmcp:`
|
|
9540
9761
|
* prefix and splits snake_case / kebab-case / camelCase into a sentence
|
|
@@ -9544,14 +9765,14 @@ declare const approvalDetailsExpansionState: Map<string, boolean>;
|
|
|
9544
9765
|
declare const humanizeToolName: (toolName: string) => string;
|
|
9545
9766
|
/**
|
|
9546
9767
|
* Sync the technical-details section (toggle label/chevron + visibility) with
|
|
9547
|
-
*
|
|
9768
|
+
* the widget instance's expansion state. Called from the ui.ts expansion event
|
|
9548
9769
|
* delegation after a toggle click.
|
|
9549
9770
|
*/
|
|
9550
|
-
declare const updateApprovalDetailsUI: (messageId: string, bubble: HTMLElement, config?: AgentWidgetConfig) => void;
|
|
9771
|
+
declare const updateApprovalDetailsUI: (messageId: string, bubble: HTMLElement, config?: AgentWidgetConfig, expansionState?: Map<string, boolean>) => void;
|
|
9551
9772
|
/**
|
|
9552
9773
|
* Create an approval bubble element for inline display in the chat.
|
|
9553
9774
|
*/
|
|
9554
|
-
declare const createApprovalBubble: (message: AgentWidgetMessage, config?: AgentWidgetConfig) => HTMLElement;
|
|
9775
|
+
declare const createApprovalBubble: (message: AgentWidgetMessage, config?: AgentWidgetConfig, expansionState?: Map<string, boolean>) => HTMLElement;
|
|
9555
9776
|
|
|
9556
9777
|
/**
|
|
9557
9778
|
* The built-in approval renderer, shaped as a plugin so ui.ts can run it through
|
|
@@ -9563,7 +9784,7 @@ declare const createApprovalBubble: (message: AgentWidgetMessage, config?: Agent
|
|
|
9563
9784
|
* callbacks — both close over the SAME per-instance state, so destroying one
|
|
9564
9785
|
* widget never disturbs another widget's open approvals on the same page.
|
|
9565
9786
|
*/
|
|
9566
|
-
declare const createBuiltInApprovalPlugin: () => {
|
|
9787
|
+
declare const createBuiltInApprovalPlugin: (expansionState?: Map<string, boolean>) => {
|
|
9567
9788
|
plugin: AgentWidgetPlugin;
|
|
9568
9789
|
teardown: () => void;
|
|
9569
9790
|
};
|
|
@@ -9583,4 +9804,4 @@ interface ApprovalUiDeps {
|
|
|
9583
9804
|
}
|
|
9584
9805
|
declare const initApprovalUi: (deps: ApprovalUiDeps) => void;
|
|
9585
9806
|
|
|
9586
|
-
export { type ApprovalUiDeps,
|
|
9807
|
+
export { type ApprovalUiDeps, createApprovalBubble, createBuiltInApprovalPlugin, humanizeToolName, initApprovalUi, updateApprovalDetailsUI };
|