@runtypelabs/persona 4.21.0 → 4.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{approval-ui-RNNBR5R3.js → approval-ui-K7R5Q5OC.js} +1 -1
  2. package/dist/approval-ui.cjs +2 -2
  3. package/dist/approval-ui.d.cts +73 -2
  4. package/dist/approval-ui.d.ts +73 -2
  5. package/dist/approval-ui.js +2 -2
  6. package/dist/artifacts-ui-F4N6VMKF.js +7 -0
  7. package/dist/artifacts-ui.cjs +1 -1
  8. package/dist/artifacts-ui.d.cts +73 -2
  9. package/dist/artifacts-ui.d.ts +73 -2
  10. package/dist/artifacts-ui.js +1 -1
  11. package/dist/chunk-NQLDCJAP.js +4 -0
  12. package/dist/codegen.cjs +1 -1
  13. package/dist/codegen.js +1 -1
  14. package/dist/context-mentions.d.cts +73 -2
  15. package/dist/context-mentions.d.ts +73 -2
  16. package/dist/event-stream-view-FKWDY3UB.js +1 -0
  17. package/dist/event-stream-view.cjs +1 -1
  18. package/dist/event-stream-view.d.cts +73 -2
  19. package/dist/event-stream-view.d.ts +73 -2
  20. package/dist/event-stream-view.js +1 -1
  21. package/dist/forms-ui.d.cts +73 -2
  22. package/dist/forms-ui.d.ts +73 -2
  23. package/dist/index.cjs +66 -66
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +136 -5
  26. package/dist/index.d.ts +136 -5
  27. package/dist/index.global.js +50 -50
  28. package/dist/index.global.js.map +1 -1
  29. package/dist/index.js +67 -67
  30. package/dist/index.js.map +1 -1
  31. package/dist/launcher.global.js +2 -2
  32. package/dist/launcher.global.js.map +1 -1
  33. package/dist/session-reconnect.d.cts +73 -2
  34. package/dist/session-reconnect.d.ts +73 -2
  35. package/dist/smart-dom-reader.d.cts +73 -2
  36. package/dist/smart-dom-reader.d.ts +73 -2
  37. package/dist/theme-editor-preview.cjs +65 -65
  38. package/dist/theme-editor-preview.d.cts +73 -2
  39. package/dist/theme-editor-preview.d.ts +73 -2
  40. package/dist/theme-editor-preview.js +49 -49
  41. package/dist/theme-editor.cjs +4 -4
  42. package/dist/theme-editor.d.cts +73 -2
  43. package/dist/theme-editor.d.ts +73 -2
  44. package/dist/theme-editor.js +2 -2
  45. package/dist/theme-reference.cjs +1 -1
  46. package/dist/theme-reference.d.cts +65 -1
  47. package/dist/theme-reference.d.ts +65 -1
  48. package/dist/theme-reference.js +1 -1
  49. package/dist/webmcp-polyfill.js +1 -4
  50. package/dist/webmcp-runtime-JI7T4QYF.js +6 -0
  51. package/dist/webmcp-runtime.cjs +2 -2
  52. package/dist/webmcp-runtime.d.cts +34 -2
  53. package/dist/webmcp-runtime.d.ts +34 -2
  54. package/dist/webmcp-runtime.js +2 -2
  55. package/package.json +2 -2
  56. package/src/client-visitor-history.test.ts +131 -0
  57. package/src/components/artifact-preview.ts +5 -0
  58. package/src/components/event-stream-badge-theming.test.ts +159 -0
  59. package/src/components/event-stream-view.ts +50 -20
  60. package/src/generated/runtype-openapi-contract.ts +8 -0
  61. package/src/index-core.ts +2 -0
  62. package/src/runtime/init.registry.test.ts +56 -0
  63. package/src/runtime/init.ts +17 -0
  64. package/src/types/theme.ts +41 -1
  65. package/src/types.ts +38 -1
  66. package/src/ui.reasoning-display.test.ts +136 -2
  67. package/src/ui.ts +69 -21
  68. package/src/utils/__snapshots__/tokens-parity.test.ts.snap +1740 -0
  69. package/src/utils/formatting.ts +22 -0
  70. package/src/utils/theme.ts +16 -0
  71. package/src/utils/tokens.ts +59 -0
  72. package/src/webmcp-bridge.test.ts +132 -23
  73. package/src/webmcp-bridge.ts +26 -2
  74. package/src/webmcp-runtime-entry.ts +71 -11
  75. package/dist/artifacts-ui-J6AKUGTS.js +0 -7
  76. package/dist/chunk-HBE7LFNT.js +0 -4
  77. package/dist/event-stream-view-73NWKWVQ.js +0 -1
  78. package/dist/webmcp-runtime-P3CHZRHF.js +0 -6
@@ -619,7 +619,11 @@ interface ColorPalette {
619
619
  warning: ColorShade;
620
620
  error: ColorShade;
621
621
  info: ColorShade;
622
- [key: string]: ColorShade;
622
+ /** Event-stream tool badge family. */
623
+ purple?: ColorShade;
624
+ /** Event-stream agent badge family. */
625
+ teal?: ColorShade;
626
+ [key: string]: ColorShade | undefined;
623
627
  }
624
628
  interface SpacingScale {
625
629
  0: string;
@@ -1191,6 +1195,38 @@ interface ToolBubbleTokens {
1191
1195
  interface ReasoningBubbleTokens {
1192
1196
  shadow: string;
1193
1197
  }
1198
+ /** One event-stream badge chip: fill + text pair. The chip border derives
1199
+ * from `foreground` at ~31% alpha. */
1200
+ interface EventStreamBadgePairTokens {
1201
+ background: TokenReference<'color'>;
1202
+ foreground: TokenReference<'color'>;
1203
+ }
1204
+ /**
1205
+ * Event-stream inspector badge chips (`features.eventStream`), one pair per
1206
+ * unified event family. Materialized into every theme and emitted as
1207
+ * `--persona-event-badge-<family>-{bg,fg}`, with scheme-appropriate defaults:
1208
+ * light themes pair a 100-tone fill with a 700-tone text, the built-in dark
1209
+ * layer flips to a 900-tone fill with a 300-tone text. `badge.default` colors
1210
+ * event types no family matches.
1211
+ */
1212
+ interface EventStreamTokens {
1213
+ badge: {
1214
+ /** `flow_*` events. */
1215
+ flow: EventStreamBadgePairTokens;
1216
+ /** `step_*` events. */
1217
+ step: EventStreamBadgePairTokens;
1218
+ /** `reasoning_*` events. */
1219
+ reasoning: EventStreamBadgePairTokens;
1220
+ /** `tool_*` events. */
1221
+ tool: EventStreamBadgePairTokens;
1222
+ /** `agent_*` events. */
1223
+ agent: EventStreamBadgePairTokens;
1224
+ /** `error` / `execution_error` events. */
1225
+ error: EventStreamBadgePairTokens;
1226
+ /** Any event type no other family matches. */
1227
+ default: EventStreamBadgePairTokens;
1228
+ };
1229
+ }
1194
1230
  /** Scrollbar appearance shared by every scroller in the widget. */
1195
1231
  interface ScrollbarTokens {
1196
1232
  /** Thumb color. @default semantic.colors.border */
@@ -1539,6 +1575,8 @@ interface ComponentTokens {
1539
1575
  attachment: AttachmentTokens;
1540
1576
  toolBubble: ToolBubbleTokens;
1541
1577
  reasoningBubble: ReasoningBubbleTokens;
1578
+ /** Event-stream inspector badge chips. */
1579
+ eventStream?: EventStreamTokens;
1542
1580
  composer: ComposerChromeTokens;
1543
1581
  /** Shared motion timing for composer chrome animation. */
1544
1582
  motion?: MotionTokens;
@@ -2919,6 +2957,14 @@ type ClientToolDefinition = {
2919
2957
  readOnlyHint?: boolean;
2920
2958
  untrustedContentHint?: boolean;
2921
2959
  };
2960
+ /**
2961
+ * Hoisted copy of `annotations.untrustedContentHint`. This is the field the
2962
+ * server actually acts on (`InlineClientToolSchema`): it spotlights the
2963
+ * tool's output before the model reads it, so instructions embedded in
2964
+ * page-provided content (reviews, comments, emails) are not treated as
2965
+ * instructions. `annotations` itself is trace/dashboard metadata only.
2966
+ */
2967
+ untrustedContentHint?: boolean;
2922
2968
  };
2923
2969
  /**
2924
2970
  * Information passed to the confirm-bubble handler before a `webmcp:*` tool
@@ -4110,6 +4156,16 @@ type AgentWidgetToolCallDisplayFeature = {
4110
4156
  * @default "stack"
4111
4157
  */
4112
4158
  groupedMode?: "stack" | "summary";
4159
+ /**
4160
+ * What happens to a tool call row once it completes.
4161
+ *
4162
+ * - `"kept"` (default): the finished row stays in the transcript.
4163
+ * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4164
+ * it. The tool call stays on the message and in `getMessages()`.
4165
+ *
4166
+ * @default "kept"
4167
+ */
4168
+ completedVisibility?: AgentWidgetToolCallCompletedVisibility;
4113
4169
  /**
4114
4170
  * When false, tool call bubbles show only the collapsed summary with no
4115
4171
  * expand/collapse toggle. Users see tool awareness without full details.
@@ -4127,6 +4183,8 @@ type AgentWidgetToolCallDisplayFeature = {
4127
4183
  */
4128
4184
  loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
4129
4185
  };
4186
+ /** See `features.toolCallDisplay.completedVisibility`. */
4187
+ type AgentWidgetToolCallCompletedVisibility = "kept" | "removed";
4130
4188
  type AgentWidgetReasoningDisplayFeature = {
4131
4189
  /**
4132
4190
  * When true, active collapsed reasoning rows can render a lightweight preview block.
@@ -4172,13 +4230,26 @@ type AgentWidgetReasoningDisplayFeature = {
4172
4230
  * - `"kept"` (default): the finished row stays in the transcript.
4173
4231
  * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4174
4232
  * it. The reasoning text stays on the message and in `getMessages()`.
4233
+ * - `"removed-when-short"`: behaves as `"removed"` when the completed trace
4234
+ * is short (see `shortThinkThreshold`), and as `"kept"` otherwise.
4175
4235
  *
4176
4236
  * @default "kept"
4177
4237
  */
4178
4238
  completedVisibility?: AgentWidgetReasoningCompletedVisibility;
4239
+ /**
4240
+ * Thresholds used by `completedVisibility: "removed-when-short"` to decide
4241
+ * whether a completed trace counts as short. Duration is checked first when
4242
+ * the reasoning reports one; the character count is a fallback for traces
4243
+ * with no reported duration.
4244
+ * @default { durationMs: 15000, chars: 1200 }
4245
+ */
4246
+ shortThinkThreshold?: {
4247
+ durationMs?: number;
4248
+ chars?: number;
4249
+ };
4179
4250
  };
4180
4251
  /** See `features.reasoningDisplay.completedVisibility`. */
4181
- type AgentWidgetReasoningCompletedVisibility = "kept" | "removed";
4252
+ type AgentWidgetReasoningCompletedVisibility = "kept" | "removed" | "removed-when-short";
4182
4253
  /**
4183
4254
  * Reveal animation applied to assistant message text while it is streaming.
4184
4255
  *
@@ -619,7 +619,11 @@ interface ColorPalette {
619
619
  warning: ColorShade;
620
620
  error: ColorShade;
621
621
  info: ColorShade;
622
- [key: string]: ColorShade;
622
+ /** Event-stream tool badge family. */
623
+ purple?: ColorShade;
624
+ /** Event-stream agent badge family. */
625
+ teal?: ColorShade;
626
+ [key: string]: ColorShade | undefined;
623
627
  }
624
628
  interface SpacingScale {
625
629
  0: string;
@@ -1191,6 +1195,38 @@ interface ToolBubbleTokens {
1191
1195
  interface ReasoningBubbleTokens {
1192
1196
  shadow: string;
1193
1197
  }
1198
+ /** One event-stream badge chip: fill + text pair. The chip border derives
1199
+ * from `foreground` at ~31% alpha. */
1200
+ interface EventStreamBadgePairTokens {
1201
+ background: TokenReference<'color'>;
1202
+ foreground: TokenReference<'color'>;
1203
+ }
1204
+ /**
1205
+ * Event-stream inspector badge chips (`features.eventStream`), one pair per
1206
+ * unified event family. Materialized into every theme and emitted as
1207
+ * `--persona-event-badge-<family>-{bg,fg}`, with scheme-appropriate defaults:
1208
+ * light themes pair a 100-tone fill with a 700-tone text, the built-in dark
1209
+ * layer flips to a 900-tone fill with a 300-tone text. `badge.default` colors
1210
+ * event types no family matches.
1211
+ */
1212
+ interface EventStreamTokens {
1213
+ badge: {
1214
+ /** `flow_*` events. */
1215
+ flow: EventStreamBadgePairTokens;
1216
+ /** `step_*` events. */
1217
+ step: EventStreamBadgePairTokens;
1218
+ /** `reasoning_*` events. */
1219
+ reasoning: EventStreamBadgePairTokens;
1220
+ /** `tool_*` events. */
1221
+ tool: EventStreamBadgePairTokens;
1222
+ /** `agent_*` events. */
1223
+ agent: EventStreamBadgePairTokens;
1224
+ /** `error` / `execution_error` events. */
1225
+ error: EventStreamBadgePairTokens;
1226
+ /** Any event type no other family matches. */
1227
+ default: EventStreamBadgePairTokens;
1228
+ };
1229
+ }
1194
1230
  /** Scrollbar appearance shared by every scroller in the widget. */
1195
1231
  interface ScrollbarTokens {
1196
1232
  /** Thumb color. @default semantic.colors.border */
@@ -1539,6 +1575,8 @@ interface ComponentTokens {
1539
1575
  attachment: AttachmentTokens;
1540
1576
  toolBubble: ToolBubbleTokens;
1541
1577
  reasoningBubble: ReasoningBubbleTokens;
1578
+ /** Event-stream inspector badge chips. */
1579
+ eventStream?: EventStreamTokens;
1542
1580
  composer: ComposerChromeTokens;
1543
1581
  /** Shared motion timing for composer chrome animation. */
1544
1582
  motion?: MotionTokens;
@@ -2919,6 +2957,14 @@ type ClientToolDefinition = {
2919
2957
  readOnlyHint?: boolean;
2920
2958
  untrustedContentHint?: boolean;
2921
2959
  };
2960
+ /**
2961
+ * Hoisted copy of `annotations.untrustedContentHint`. This is the field the
2962
+ * server actually acts on (`InlineClientToolSchema`): it spotlights the
2963
+ * tool's output before the model reads it, so instructions embedded in
2964
+ * page-provided content (reviews, comments, emails) are not treated as
2965
+ * instructions. `annotations` itself is trace/dashboard metadata only.
2966
+ */
2967
+ untrustedContentHint?: boolean;
2922
2968
  };
2923
2969
  /**
2924
2970
  * Information passed to the confirm-bubble handler before a `webmcp:*` tool
@@ -4110,6 +4156,16 @@ type AgentWidgetToolCallDisplayFeature = {
4110
4156
  * @default "stack"
4111
4157
  */
4112
4158
  groupedMode?: "stack" | "summary";
4159
+ /**
4160
+ * What happens to a tool call row once it completes.
4161
+ *
4162
+ * - `"kept"` (default): the finished row stays in the transcript.
4163
+ * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4164
+ * it. The tool call stays on the message and in `getMessages()`.
4165
+ *
4166
+ * @default "kept"
4167
+ */
4168
+ completedVisibility?: AgentWidgetToolCallCompletedVisibility;
4113
4169
  /**
4114
4170
  * When false, tool call bubbles show only the collapsed summary with no
4115
4171
  * expand/collapse toggle. Users see tool awareness without full details.
@@ -4127,6 +4183,8 @@ type AgentWidgetToolCallDisplayFeature = {
4127
4183
  */
4128
4184
  loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
4129
4185
  };
4186
+ /** See `features.toolCallDisplay.completedVisibility`. */
4187
+ type AgentWidgetToolCallCompletedVisibility = "kept" | "removed";
4130
4188
  type AgentWidgetReasoningDisplayFeature = {
4131
4189
  /**
4132
4190
  * When true, active collapsed reasoning rows can render a lightweight preview block.
@@ -4172,13 +4230,26 @@ type AgentWidgetReasoningDisplayFeature = {
4172
4230
  * - `"kept"` (default): the finished row stays in the transcript.
4173
4231
  * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4174
4232
  * it. The reasoning text stays on the message and in `getMessages()`.
4233
+ * - `"removed-when-short"`: behaves as `"removed"` when the completed trace
4234
+ * is short (see `shortThinkThreshold`), and as `"kept"` otherwise.
4175
4235
  *
4176
4236
  * @default "kept"
4177
4237
  */
4178
4238
  completedVisibility?: AgentWidgetReasoningCompletedVisibility;
4239
+ /**
4240
+ * Thresholds used by `completedVisibility: "removed-when-short"` to decide
4241
+ * whether a completed trace counts as short. Duration is checked first when
4242
+ * the reasoning reports one; the character count is a fallback for traces
4243
+ * with no reported duration.
4244
+ * @default { durationMs: 15000, chars: 1200 }
4245
+ */
4246
+ shortThinkThreshold?: {
4247
+ durationMs?: number;
4248
+ chars?: number;
4249
+ };
4179
4250
  };
4180
4251
  /** See `features.reasoningDisplay.completedVisibility`. */
4181
- type AgentWidgetReasoningCompletedVisibility = "kept" | "removed";
4252
+ type AgentWidgetReasoningCompletedVisibility = "kept" | "removed" | "removed-when-short";
4182
4253
  /**
4183
4254
  * Reveal animation applied to assistant message text while it is streaming.
4184
4255
  *
@@ -888,7 +888,11 @@ interface ColorPalette {
888
888
  warning: ColorShade;
889
889
  error: ColorShade;
890
890
  info: ColorShade;
891
- [key: string]: ColorShade;
891
+ /** Event-stream tool badge family. */
892
+ purple?: ColorShade;
893
+ /** Event-stream agent badge family. */
894
+ teal?: ColorShade;
895
+ [key: string]: ColorShade | undefined;
892
896
  }
893
897
  interface SpacingScale {
894
898
  0: string;
@@ -1460,6 +1464,38 @@ interface ToolBubbleTokens {
1460
1464
  interface ReasoningBubbleTokens {
1461
1465
  shadow: string;
1462
1466
  }
1467
+ /** One event-stream badge chip: fill + text pair. The chip border derives
1468
+ * from `foreground` at ~31% alpha. */
1469
+ interface EventStreamBadgePairTokens {
1470
+ background: TokenReference<'color'>;
1471
+ foreground: TokenReference<'color'>;
1472
+ }
1473
+ /**
1474
+ * Event-stream inspector badge chips (`features.eventStream`), one pair per
1475
+ * unified event family. Materialized into every theme and emitted as
1476
+ * `--persona-event-badge-<family>-{bg,fg}`, with scheme-appropriate defaults:
1477
+ * light themes pair a 100-tone fill with a 700-tone text, the built-in dark
1478
+ * layer flips to a 900-tone fill with a 300-tone text. `badge.default` colors
1479
+ * event types no family matches.
1480
+ */
1481
+ interface EventStreamTokens {
1482
+ badge: {
1483
+ /** `flow_*` events. */
1484
+ flow: EventStreamBadgePairTokens;
1485
+ /** `step_*` events. */
1486
+ step: EventStreamBadgePairTokens;
1487
+ /** `reasoning_*` events. */
1488
+ reasoning: EventStreamBadgePairTokens;
1489
+ /** `tool_*` events. */
1490
+ tool: EventStreamBadgePairTokens;
1491
+ /** `agent_*` events. */
1492
+ agent: EventStreamBadgePairTokens;
1493
+ /** `error` / `execution_error` events. */
1494
+ error: EventStreamBadgePairTokens;
1495
+ /** Any event type no other family matches. */
1496
+ default: EventStreamBadgePairTokens;
1497
+ };
1498
+ }
1463
1499
  /** Scrollbar appearance shared by every scroller in the widget. */
1464
1500
  interface ScrollbarTokens {
1465
1501
  /** Thumb color. @default semantic.colors.border */
@@ -1808,6 +1844,8 @@ interface ComponentTokens {
1808
1844
  attachment: AttachmentTokens;
1809
1845
  toolBubble: ToolBubbleTokens;
1810
1846
  reasoningBubble: ReasoningBubbleTokens;
1847
+ /** Event-stream inspector badge chips. */
1848
+ eventStream?: EventStreamTokens;
1811
1849
  composer: ComposerChromeTokens;
1812
1850
  /** Shared motion timing for composer chrome animation. */
1813
1851
  motion?: MotionTokens;
@@ -3188,6 +3226,14 @@ type ClientToolDefinition = {
3188
3226
  readOnlyHint?: boolean;
3189
3227
  untrustedContentHint?: boolean;
3190
3228
  };
3229
+ /**
3230
+ * Hoisted copy of `annotations.untrustedContentHint`. This is the field the
3231
+ * server actually acts on (`InlineClientToolSchema`): it spotlights the
3232
+ * tool's output before the model reads it, so instructions embedded in
3233
+ * page-provided content (reviews, comments, emails) are not treated as
3234
+ * instructions. `annotations` itself is trace/dashboard metadata only.
3235
+ */
3236
+ untrustedContentHint?: boolean;
3191
3237
  };
3192
3238
  /**
3193
3239
  * Information passed to the confirm-bubble handler before a `webmcp:*` tool
@@ -4379,6 +4425,16 @@ type AgentWidgetToolCallDisplayFeature = {
4379
4425
  * @default "stack"
4380
4426
  */
4381
4427
  groupedMode?: "stack" | "summary";
4428
+ /**
4429
+ * What happens to a tool call row once it completes.
4430
+ *
4431
+ * - `"kept"` (default): the finished row stays in the transcript.
4432
+ * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4433
+ * it. The tool call stays on the message and in `getMessages()`.
4434
+ *
4435
+ * @default "kept"
4436
+ */
4437
+ completedVisibility?: AgentWidgetToolCallCompletedVisibility;
4382
4438
  /**
4383
4439
  * When false, tool call bubbles show only the collapsed summary with no
4384
4440
  * expand/collapse toggle. Users see tool awareness without full details.
@@ -4396,6 +4452,8 @@ type AgentWidgetToolCallDisplayFeature = {
4396
4452
  */
4397
4453
  loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
4398
4454
  };
4455
+ /** See `features.toolCallDisplay.completedVisibility`. */
4456
+ type AgentWidgetToolCallCompletedVisibility = "kept" | "removed";
4399
4457
  type AgentWidgetReasoningDisplayFeature = {
4400
4458
  /**
4401
4459
  * When true, active collapsed reasoning rows can render a lightweight preview block.
@@ -4441,13 +4499,26 @@ type AgentWidgetReasoningDisplayFeature = {
4441
4499
  * - `"kept"` (default): the finished row stays in the transcript.
4442
4500
  * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4443
4501
  * it. The reasoning text stays on the message and in `getMessages()`.
4502
+ * - `"removed-when-short"`: behaves as `"removed"` when the completed trace
4503
+ * is short (see `shortThinkThreshold`), and as `"kept"` otherwise.
4444
4504
  *
4445
4505
  * @default "kept"
4446
4506
  */
4447
4507
  completedVisibility?: AgentWidgetReasoningCompletedVisibility;
4508
+ /**
4509
+ * Thresholds used by `completedVisibility: "removed-when-short"` to decide
4510
+ * whether a completed trace counts as short. Duration is checked first when
4511
+ * the reasoning reports one; the character count is a fallback for traces
4512
+ * with no reported duration.
4513
+ * @default { durationMs: 15000, chars: 1200 }
4514
+ */
4515
+ shortThinkThreshold?: {
4516
+ durationMs?: number;
4517
+ chars?: number;
4518
+ };
4448
4519
  };
4449
4520
  /** See `features.reasoningDisplay.completedVisibility`. */
4450
- type AgentWidgetReasoningCompletedVisibility = "kept" | "removed";
4521
+ type AgentWidgetReasoningCompletedVisibility = "kept" | "removed" | "removed-when-short";
4451
4522
  /**
4452
4523
  * Reveal animation applied to assistant message text while it is streaming.
4453
4524
  *
@@ -888,7 +888,11 @@ interface ColorPalette {
888
888
  warning: ColorShade;
889
889
  error: ColorShade;
890
890
  info: ColorShade;
891
- [key: string]: ColorShade;
891
+ /** Event-stream tool badge family. */
892
+ purple?: ColorShade;
893
+ /** Event-stream agent badge family. */
894
+ teal?: ColorShade;
895
+ [key: string]: ColorShade | undefined;
892
896
  }
893
897
  interface SpacingScale {
894
898
  0: string;
@@ -1460,6 +1464,38 @@ interface ToolBubbleTokens {
1460
1464
  interface ReasoningBubbleTokens {
1461
1465
  shadow: string;
1462
1466
  }
1467
+ /** One event-stream badge chip: fill + text pair. The chip border derives
1468
+ * from `foreground` at ~31% alpha. */
1469
+ interface EventStreamBadgePairTokens {
1470
+ background: TokenReference<'color'>;
1471
+ foreground: TokenReference<'color'>;
1472
+ }
1473
+ /**
1474
+ * Event-stream inspector badge chips (`features.eventStream`), one pair per
1475
+ * unified event family. Materialized into every theme and emitted as
1476
+ * `--persona-event-badge-<family>-{bg,fg}`, with scheme-appropriate defaults:
1477
+ * light themes pair a 100-tone fill with a 700-tone text, the built-in dark
1478
+ * layer flips to a 900-tone fill with a 300-tone text. `badge.default` colors
1479
+ * event types no family matches.
1480
+ */
1481
+ interface EventStreamTokens {
1482
+ badge: {
1483
+ /** `flow_*` events. */
1484
+ flow: EventStreamBadgePairTokens;
1485
+ /** `step_*` events. */
1486
+ step: EventStreamBadgePairTokens;
1487
+ /** `reasoning_*` events. */
1488
+ reasoning: EventStreamBadgePairTokens;
1489
+ /** `tool_*` events. */
1490
+ tool: EventStreamBadgePairTokens;
1491
+ /** `agent_*` events. */
1492
+ agent: EventStreamBadgePairTokens;
1493
+ /** `error` / `execution_error` events. */
1494
+ error: EventStreamBadgePairTokens;
1495
+ /** Any event type no other family matches. */
1496
+ default: EventStreamBadgePairTokens;
1497
+ };
1498
+ }
1463
1499
  /** Scrollbar appearance shared by every scroller in the widget. */
1464
1500
  interface ScrollbarTokens {
1465
1501
  /** Thumb color. @default semantic.colors.border */
@@ -1808,6 +1844,8 @@ interface ComponentTokens {
1808
1844
  attachment: AttachmentTokens;
1809
1845
  toolBubble: ToolBubbleTokens;
1810
1846
  reasoningBubble: ReasoningBubbleTokens;
1847
+ /** Event-stream inspector badge chips. */
1848
+ eventStream?: EventStreamTokens;
1811
1849
  composer: ComposerChromeTokens;
1812
1850
  /** Shared motion timing for composer chrome animation. */
1813
1851
  motion?: MotionTokens;
@@ -3188,6 +3226,14 @@ type ClientToolDefinition = {
3188
3226
  readOnlyHint?: boolean;
3189
3227
  untrustedContentHint?: boolean;
3190
3228
  };
3229
+ /**
3230
+ * Hoisted copy of `annotations.untrustedContentHint`. This is the field the
3231
+ * server actually acts on (`InlineClientToolSchema`): it spotlights the
3232
+ * tool's output before the model reads it, so instructions embedded in
3233
+ * page-provided content (reviews, comments, emails) are not treated as
3234
+ * instructions. `annotations` itself is trace/dashboard metadata only.
3235
+ */
3236
+ untrustedContentHint?: boolean;
3191
3237
  };
3192
3238
  /**
3193
3239
  * Information passed to the confirm-bubble handler before a `webmcp:*` tool
@@ -4379,6 +4425,16 @@ type AgentWidgetToolCallDisplayFeature = {
4379
4425
  * @default "stack"
4380
4426
  */
4381
4427
  groupedMode?: "stack" | "summary";
4428
+ /**
4429
+ * What happens to a tool call row once it completes.
4430
+ *
4431
+ * - `"kept"` (default): the finished row stays in the transcript.
4432
+ * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4433
+ * it. The tool call stays on the message and in `getMessages()`.
4434
+ *
4435
+ * @default "kept"
4436
+ */
4437
+ completedVisibility?: AgentWidgetToolCallCompletedVisibility;
4382
4438
  /**
4383
4439
  * When false, tool call bubbles show only the collapsed summary with no
4384
4440
  * expand/collapse toggle. Users see tool awareness without full details.
@@ -4396,6 +4452,8 @@ type AgentWidgetToolCallDisplayFeature = {
4396
4452
  */
4397
4453
  loadingAnimation?: AgentWidgetToolCallLoadingAnimation;
4398
4454
  };
4455
+ /** See `features.toolCallDisplay.completedVisibility`. */
4456
+ type AgentWidgetToolCallCompletedVisibility = "kept" | "removed";
4399
4457
  type AgentWidgetReasoningDisplayFeature = {
4400
4458
  /**
4401
4459
  * When true, active collapsed reasoning rows can render a lightweight preview block.
@@ -4441,13 +4499,26 @@ type AgentWidgetReasoningDisplayFeature = {
4441
4499
  * - `"kept"` (default): the finished row stays in the transcript.
4442
4500
  * - `"removed"`: no row is rendered at all, so the transcript gap closes with
4443
4501
  * it. The reasoning text stays on the message and in `getMessages()`.
4502
+ * - `"removed-when-short"`: behaves as `"removed"` when the completed trace
4503
+ * is short (see `shortThinkThreshold`), and as `"kept"` otherwise.
4444
4504
  *
4445
4505
  * @default "kept"
4446
4506
  */
4447
4507
  completedVisibility?: AgentWidgetReasoningCompletedVisibility;
4508
+ /**
4509
+ * Thresholds used by `completedVisibility: "removed-when-short"` to decide
4510
+ * whether a completed trace counts as short. Duration is checked first when
4511
+ * the reasoning reports one; the character count is a fallback for traces
4512
+ * with no reported duration.
4513
+ * @default { durationMs: 15000, chars: 1200 }
4514
+ */
4515
+ shortThinkThreshold?: {
4516
+ durationMs?: number;
4517
+ chars?: number;
4518
+ };
4448
4519
  };
4449
4520
  /** See `features.reasoningDisplay.completedVisibility`. */
4450
- type AgentWidgetReasoningCompletedVisibility = "kept" | "removed";
4521
+ type AgentWidgetReasoningCompletedVisibility = "kept" | "removed" | "removed-when-short";
4451
4522
  /**
4452
4523
  * Reveal animation applied to assistant message text while it is streaming.
4453
4524
  *