@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
@@ -25,7 +25,11 @@ interface ColorPalette {
25
25
  warning: ColorShade;
26
26
  error: ColorShade;
27
27
  info: ColorShade;
28
- [key: string]: ColorShade;
28
+ /** Event-stream tool badge family. */
29
+ purple?: ColorShade;
30
+ /** Event-stream agent badge family. */
31
+ teal?: ColorShade;
32
+ [key: string]: ColorShade | undefined;
29
33
  }
30
34
  interface SpacingScale {
31
35
  0: string;
@@ -597,6 +601,38 @@ interface ToolBubbleTokens {
597
601
  interface ReasoningBubbleTokens {
598
602
  shadow: string;
599
603
  }
604
+ /** One event-stream badge chip: fill + text pair. The chip border derives
605
+ * from `foreground` at ~31% alpha. */
606
+ interface EventStreamBadgePairTokens {
607
+ background: TokenReference<'color'>;
608
+ foreground: TokenReference<'color'>;
609
+ }
610
+ /**
611
+ * Event-stream inspector badge chips (`features.eventStream`), one pair per
612
+ * unified event family. Materialized into every theme and emitted as
613
+ * `--persona-event-badge-<family>-{bg,fg}`, with scheme-appropriate defaults:
614
+ * light themes pair a 100-tone fill with a 700-tone text, the built-in dark
615
+ * layer flips to a 900-tone fill with a 300-tone text. `badge.default` colors
616
+ * event types no family matches.
617
+ */
618
+ interface EventStreamTokens {
619
+ badge: {
620
+ /** `flow_*` events. */
621
+ flow: EventStreamBadgePairTokens;
622
+ /** `step_*` events. */
623
+ step: EventStreamBadgePairTokens;
624
+ /** `reasoning_*` events. */
625
+ reasoning: EventStreamBadgePairTokens;
626
+ /** `tool_*` events. */
627
+ tool: EventStreamBadgePairTokens;
628
+ /** `agent_*` events. */
629
+ agent: EventStreamBadgePairTokens;
630
+ /** `error` / `execution_error` events. */
631
+ error: EventStreamBadgePairTokens;
632
+ /** Any event type no other family matches. */
633
+ default: EventStreamBadgePairTokens;
634
+ };
635
+ }
600
636
  /** Scrollbar appearance shared by every scroller in the widget. */
601
637
  interface ScrollbarTokens {
602
638
  /** Thumb color. @default semantic.colors.border */
@@ -945,6 +981,8 @@ interface ComponentTokens {
945
981
  attachment: AttachmentTokens;
946
982
  toolBubble: ToolBubbleTokens;
947
983
  reasoningBubble: ReasoningBubbleTokens;
984
+ /** Event-stream inspector badge chips. */
985
+ eventStream?: EventStreamTokens;
948
986
  composer: ComposerChromeTokens;
949
987
  /** Shared motion timing for composer chrome animation. */
950
988
  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
  *
@@ -25,7 +25,11 @@ interface ColorPalette {
25
25
  warning: ColorShade;
26
26
  error: ColorShade;
27
27
  info: ColorShade;
28
- [key: string]: ColorShade;
28
+ /** Event-stream tool badge family. */
29
+ purple?: ColorShade;
30
+ /** Event-stream agent badge family. */
31
+ teal?: ColorShade;
32
+ [key: string]: ColorShade | undefined;
29
33
  }
30
34
  interface SpacingScale {
31
35
  0: string;
@@ -597,6 +601,38 @@ interface ToolBubbleTokens {
597
601
  interface ReasoningBubbleTokens {
598
602
  shadow: string;
599
603
  }
604
+ /** One event-stream badge chip: fill + text pair. The chip border derives
605
+ * from `foreground` at ~31% alpha. */
606
+ interface EventStreamBadgePairTokens {
607
+ background: TokenReference<'color'>;
608
+ foreground: TokenReference<'color'>;
609
+ }
610
+ /**
611
+ * Event-stream inspector badge chips (`features.eventStream`), one pair per
612
+ * unified event family. Materialized into every theme and emitted as
613
+ * `--persona-event-badge-<family>-{bg,fg}`, with scheme-appropriate defaults:
614
+ * light themes pair a 100-tone fill with a 700-tone text, the built-in dark
615
+ * layer flips to a 900-tone fill with a 300-tone text. `badge.default` colors
616
+ * event types no family matches.
617
+ */
618
+ interface EventStreamTokens {
619
+ badge: {
620
+ /** `flow_*` events. */
621
+ flow: EventStreamBadgePairTokens;
622
+ /** `step_*` events. */
623
+ step: EventStreamBadgePairTokens;
624
+ /** `reasoning_*` events. */
625
+ reasoning: EventStreamBadgePairTokens;
626
+ /** `tool_*` events. */
627
+ tool: EventStreamBadgePairTokens;
628
+ /** `agent_*` events. */
629
+ agent: EventStreamBadgePairTokens;
630
+ /** `error` / `execution_error` events. */
631
+ error: EventStreamBadgePairTokens;
632
+ /** Any event type no other family matches. */
633
+ default: EventStreamBadgePairTokens;
634
+ };
635
+ }
600
636
  /** Scrollbar appearance shared by every scroller in the widget. */
601
637
  interface ScrollbarTokens {
602
638
  /** Thumb color. @default semantic.colors.border */
@@ -945,6 +981,8 @@ interface ComponentTokens {
945
981
  attachment: AttachmentTokens;
946
982
  toolBubble: ToolBubbleTokens;
947
983
  reasoningBubble: ReasoningBubbleTokens;
984
+ /** Event-stream inspector badge chips. */
985
+ eventStream?: EventStreamTokens;
948
986
  composer: ComposerChromeTokens;
949
987
  /** Shared motion timing for composer chrome animation. */
950
988
  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
  *