@runtypelabs/persona 4.10.1 → 4.11.1

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 (57) hide show
  1. package/dist/animations/glyph-cycle.d.cts +1 -1
  2. package/dist/animations/glyph-cycle.d.ts +1 -1
  3. package/dist/animations/{types-Bx_rvjff.d.cts → types-DveIaNx6.d.cts} +2 -0
  4. package/dist/animations/{types-Bx_rvjff.d.ts → types-DveIaNx6.d.ts} +2 -0
  5. package/dist/animations/wipe.d.cts +1 -1
  6. package/dist/animations/wipe.d.ts +1 -1
  7. package/dist/chunk-MMUPR2JW.js +1 -0
  8. package/dist/codegen.cjs +1 -1
  9. package/dist/codegen.js +1 -1
  10. package/dist/{context-mentions-7S5KVUTG.js → context-mentions-ONG7A7M6.js} +1 -1
  11. package/dist/context-mentions.d.cts +28 -0
  12. package/dist/context-mentions.d.ts +28 -0
  13. package/dist/index.cjs +67 -67
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +29 -1
  16. package/dist/index.d.ts +29 -1
  17. package/dist/index.global.js +56 -56
  18. package/dist/index.global.js.map +1 -1
  19. package/dist/index.js +78 -78
  20. package/dist/index.js.map +1 -1
  21. package/dist/smart-dom-reader.d.cts +28 -0
  22. package/dist/smart-dom-reader.d.ts +28 -0
  23. package/dist/theme-editor-preview.cjs +66 -66
  24. package/dist/theme-editor-preview.d.cts +28 -0
  25. package/dist/theme-editor-preview.d.ts +28 -0
  26. package/dist/theme-editor-preview.js +55 -55
  27. package/dist/theme-editor.cjs +5 -5
  28. package/dist/theme-editor.d.cts +28 -0
  29. package/dist/theme-editor.d.ts +28 -0
  30. package/dist/theme-editor.js +9 -9
  31. package/dist/widget.css +1 -1
  32. package/package.json +1 -1
  33. package/src/components/approval-bubble.ts +0 -1
  34. package/src/components/composer-parts.ts +19 -19
  35. package/src/components/context-mention-button.test.ts +5 -1
  36. package/src/components/context-mention-button.ts +6 -4
  37. package/src/components/header-builder.test.ts +3 -3
  38. package/src/components/header-parts.ts +14 -108
  39. package/src/components/message-bubble.test.ts +49 -0
  40. package/src/components/message-bubble.ts +8 -7
  41. package/src/components/reasoning-bubble.ts +0 -2
  42. package/src/components/tool-bubble.ts +0 -2
  43. package/src/generated/runtype-openapi-contract.ts +2 -0
  44. package/src/index-core.ts +1 -0
  45. package/src/styles/widget.css +118 -58
  46. package/src/theme-editor/sections.test.ts +33 -0
  47. package/src/theme-editor/sections.ts +10 -1
  48. package/src/types.ts +27 -0
  49. package/src/ui.attachments-drop.test.ts +2 -1
  50. package/src/ui.message-width.test.ts +407 -0
  51. package/src/ui.tool-display.test.ts +177 -8
  52. package/src/ui.ts +159 -244
  53. package/src/utils/table-scroll-fade.test.ts +123 -0
  54. package/src/utils/table-scroll-fade.ts +75 -0
  55. package/src/utils/tooltip.test.ts +226 -0
  56. package/src/utils/tooltip.ts +245 -0
  57. package/dist/chunk-IPVK3KOM.js +0 -1
@@ -1133,6 +1133,7 @@ type RuntypeExecutionStreamEvent = ({
1133
1133
  input: number;
1134
1134
  output: number;
1135
1135
  };
1136
+ totalTokensUsed?: number;
1136
1137
  type: "execution_complete";
1137
1138
  }) | ({
1138
1139
  blockReason?: string;
@@ -1392,6 +1393,7 @@ type RuntypeExecutionStreamEvent = ({
1392
1393
  stepId?: string;
1393
1394
  success: boolean;
1394
1395
  toolCallId: string;
1396
+ toolCost?: number;
1395
1397
  toolName?: string;
1396
1398
  type: "tool_complete";
1397
1399
  } | {
@@ -4714,6 +4716,8 @@ type AgentWidgetToolCallConfig = {
4714
4716
  }) => HTMLElement | string | null;
4715
4717
  /**
4716
4718
  * Override the summary content for grouped consecutive tool-call containers.
4719
+ * In `groupedMode: "summary"`, the summary owns the visible row starting
4720
+ * with the first tool so its DOM stays stable as more calls arrive.
4717
4721
  * Return `null` to fall back to the built-in `Called [x] tools` summary.
4718
4722
  */
4719
4723
  renderGroupedSummary?: (context: {
@@ -5094,6 +5098,26 @@ type AgentWidgetTimestampConfig = {
5094
5098
  /** Custom formatter for timestamp display */
5095
5099
  format?: (date: Date) => string;
5096
5100
  };
5101
+ /**
5102
+ * Width configuration for one message role.
5103
+ *
5104
+ * `content` shrink-wraps the rendered message up to `maxWidth`; `full` fills
5105
+ * the available transcript track up to `maxWidth`. The track already accounts
5106
+ * for transcript padding and, when present, the avatar and its gap.
5107
+ */
5108
+ type AgentWidgetMessageRoleLayout = {
5109
+ /**
5110
+ * Message width behavior.
5111
+ * - content: size to the rendered content (the backward-compatible default)
5112
+ * - full: fill the available transcript track
5113
+ */
5114
+ width?: "content" | "full";
5115
+ /**
5116
+ * Optional CSS max-width (for example "80%", "42rem", or "72ch").
5117
+ * Defaults to "85%" for content width and "100%" for full width.
5118
+ */
5119
+ maxWidth?: string;
5120
+ };
5097
5121
  /**
5098
5122
  * Message layout configuration
5099
5123
  * Allows customization of how chat messages are displayed
@@ -5112,6 +5136,10 @@ type AgentWidgetMessageLayoutConfig = {
5112
5136
  timestamp?: AgentWidgetTimestampConfig;
5113
5137
  /** Group consecutive messages from the same role */
5114
5138
  groupConsecutive?: boolean;
5139
+ /** Width behavior for user-authored message rows */
5140
+ user?: AgentWidgetMessageRoleLayout;
5141
+ /** Width behavior for assistant-authored message rows and assistant UI variants */
5142
+ assistant?: AgentWidgetMessageRoleLayout;
5115
5143
  /**
5116
5144
  * Custom renderer for user messages
5117
5145
  * When provided, replaces the default user message rendering
@@ -1133,6 +1133,7 @@ type RuntypeExecutionStreamEvent = ({
1133
1133
  input: number;
1134
1134
  output: number;
1135
1135
  };
1136
+ totalTokensUsed?: number;
1136
1137
  type: "execution_complete";
1137
1138
  }) | ({
1138
1139
  blockReason?: string;
@@ -1392,6 +1393,7 @@ type RuntypeExecutionStreamEvent = ({
1392
1393
  stepId?: string;
1393
1394
  success: boolean;
1394
1395
  toolCallId: string;
1396
+ toolCost?: number;
1395
1397
  toolName?: string;
1396
1398
  type: "tool_complete";
1397
1399
  } | {
@@ -4714,6 +4716,8 @@ type AgentWidgetToolCallConfig = {
4714
4716
  }) => HTMLElement | string | null;
4715
4717
  /**
4716
4718
  * Override the summary content for grouped consecutive tool-call containers.
4719
+ * In `groupedMode: "summary"`, the summary owns the visible row starting
4720
+ * with the first tool so its DOM stays stable as more calls arrive.
4717
4721
  * Return `null` to fall back to the built-in `Called [x] tools` summary.
4718
4722
  */
4719
4723
  renderGroupedSummary?: (context: {
@@ -5094,6 +5098,26 @@ type AgentWidgetTimestampConfig = {
5094
5098
  /** Custom formatter for timestamp display */
5095
5099
  format?: (date: Date) => string;
5096
5100
  };
5101
+ /**
5102
+ * Width configuration for one message role.
5103
+ *
5104
+ * `content` shrink-wraps the rendered message up to `maxWidth`; `full` fills
5105
+ * the available transcript track up to `maxWidth`. The track already accounts
5106
+ * for transcript padding and, when present, the avatar and its gap.
5107
+ */
5108
+ type AgentWidgetMessageRoleLayout = {
5109
+ /**
5110
+ * Message width behavior.
5111
+ * - content: size to the rendered content (the backward-compatible default)
5112
+ * - full: fill the available transcript track
5113
+ */
5114
+ width?: "content" | "full";
5115
+ /**
5116
+ * Optional CSS max-width (for example "80%", "42rem", or "72ch").
5117
+ * Defaults to "85%" for content width and "100%" for full width.
5118
+ */
5119
+ maxWidth?: string;
5120
+ };
5097
5121
  /**
5098
5122
  * Message layout configuration
5099
5123
  * Allows customization of how chat messages are displayed
@@ -5112,6 +5136,10 @@ type AgentWidgetMessageLayoutConfig = {
5112
5136
  timestamp?: AgentWidgetTimestampConfig;
5113
5137
  /** Group consecutive messages from the same role */
5114
5138
  groupConsecutive?: boolean;
5139
+ /** Width behavior for user-authored message rows */
5140
+ user?: AgentWidgetMessageRoleLayout;
5141
+ /** Width behavior for assistant-authored message rows and assistant UI variants */
5142
+ assistant?: AgentWidgetMessageRoleLayout;
5115
5143
  /**
5116
5144
  * Custom renderer for user messages
5117
5145
  * When provided, replaces the default user message rendering