@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.
Files changed (158) 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-9Vxm-PPz.d.cts → types-Db61aI9J.d.cts} +25 -2
  4. package/dist/animations/{types-9Vxm-PPz.d.ts → types-Db61aI9J.d.ts} +25 -2
  5. package/dist/animations/wipe.d.cts +1 -1
  6. package/dist/animations/wipe.d.ts +1 -1
  7. package/dist/animations-extra.d.cts +25 -2
  8. package/dist/animations-extra.d.ts +25 -2
  9. package/dist/approval-ui-3NMYNXBD.js +1 -0
  10. package/dist/approval-ui.cjs +2 -2
  11. package/dist/approval-ui.d.cts +261 -40
  12. package/dist/approval-ui.d.ts +261 -40
  13. package/dist/approval-ui.js +2 -2
  14. package/dist/{artifacts-ui-F4N6VMKF.js → artifacts-ui-IGB5YKLO.js} +4 -4
  15. package/dist/artifacts-ui.d.cts +256 -28
  16. package/dist/artifacts-ui.d.ts +256 -28
  17. package/dist/{chunk-NIKYKSNZ.js → chunk-7CO4T5KB.js} +1 -1
  18. package/dist/codegen.cjs +11 -11
  19. package/dist/codegen.js +13 -13
  20. package/dist/context-mentions.d.cts +256 -28
  21. package/dist/context-mentions.d.ts +256 -28
  22. package/dist/event-stream-view.d.cts +256 -28
  23. package/dist/event-stream-view.d.ts +256 -28
  24. package/dist/forms-ui.d.cts +291 -30
  25. package/dist/forms-ui.d.ts +291 -30
  26. package/dist/history-view.d.cts +25 -2
  27. package/dist/history-view.d.ts +25 -2
  28. package/dist/index.cjs +70 -69
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +337 -51
  31. package/dist/index.d.ts +337 -51
  32. package/dist/index.global.js +57 -54
  33. package/dist/index.global.js.map +1 -1
  34. package/dist/index.js +70 -69
  35. package/dist/index.js.map +1 -1
  36. package/dist/install.global.js +1 -1
  37. package/dist/install.global.js.map +1 -1
  38. package/dist/launcher.global.js +2 -2
  39. package/dist/launcher.global.js.map +1 -1
  40. package/dist/session-reconnect.d.cts +256 -28
  41. package/dist/session-reconnect.d.ts +256 -28
  42. package/dist/smart-dom-reader.d.cts +256 -28
  43. package/dist/smart-dom-reader.d.ts +256 -28
  44. package/dist/theme-editor-preview.cjs +74 -73
  45. package/dist/theme-editor-preview.d.cts +263 -28
  46. package/dist/theme-editor-preview.d.ts +263 -28
  47. package/dist/theme-editor-preview.js +51 -50
  48. package/dist/theme-editor.cjs +10 -10
  49. package/dist/theme-editor.d.cts +276 -30
  50. package/dist/theme-editor.d.ts +276 -30
  51. package/dist/theme-editor.js +10 -10
  52. package/dist/theme-reference.cjs +1 -1
  53. package/dist/theme-reference.d.cts +1522 -11
  54. package/dist/theme-reference.d.ts +1522 -11
  55. package/dist/theme-reference.js +1 -1
  56. package/dist/widget.css +1 -1
  57. package/package.json +3 -2
  58. package/src/__fixtures__/defaults-parity.v4.json +776 -0
  59. package/src/approval-ui-entry.ts +0 -1
  60. package/src/approval-ui-loader.ts +5 -4
  61. package/src/approval-ui.ts +0 -1
  62. package/src/client-identity-proof.test.ts +193 -0
  63. package/src/client-session-warm.test.ts +216 -0
  64. package/src/client-visitor-history.test.ts +6 -0
  65. package/src/client.tool-pair-replay.test.ts +325 -0
  66. package/src/client.ts +154 -61
  67. package/src/codegen.test.ts +24 -0
  68. package/src/components/activity-row.test.ts +100 -0
  69. package/src/components/activity-row.ts +136 -0
  70. package/src/components/approval-actions.test.ts +8 -5
  71. package/src/components/approval-actions.ts +19 -6
  72. package/src/components/approval-bubble.test.ts +56 -9
  73. package/src/components/approval-bubble.ts +36 -41
  74. package/src/components/composer-builder.ts +5 -2
  75. package/src/components/composer-parts.ts +10 -2
  76. package/src/components/header-builder.test.ts +32 -0
  77. package/src/components/header-builder.ts +7 -4
  78. package/src/components/header-layouts.test.ts +12 -0
  79. package/src/components/header-layouts.ts +3 -2
  80. package/src/components/launcher.ts +11 -2
  81. package/src/components/message-bubble.test.ts +22 -0
  82. package/src/components/message-bubble.ts +7 -3
  83. package/src/components/panel.test.ts +52 -1
  84. package/src/components/panel.ts +47 -8
  85. package/src/components/pill-composer-builder.test.ts +2 -0
  86. package/src/components/pill-composer-builder.ts +0 -1
  87. package/src/components/reasoning-bubble.ts +29 -17
  88. package/src/components/suggestions.test.ts +1 -0
  89. package/src/components/suggestions.ts +0 -16
  90. package/src/components/tool-bubble.ts +131 -114
  91. package/src/components/tool-details.test.ts +87 -0
  92. package/src/components/tool-details.ts +102 -0
  93. package/src/components/welcome.test.ts +8 -0
  94. package/src/components/welcome.ts +4 -2
  95. package/src/defaults-parity.test.ts +158 -0
  96. package/src/defaults.test.ts +69 -0
  97. package/src/defaults.ts +128 -49
  98. package/src/generated/runtype-openapi-contract.ts +28 -13
  99. package/src/index-core.ts +2 -0
  100. package/src/install.test.ts +24 -0
  101. package/src/install.ts +3 -1
  102. package/src/launcher-global.ts +2 -1
  103. package/src/launcher-variants.test.ts +52 -0
  104. package/src/runtime/init-update-reset.test.ts +21 -0
  105. package/src/session.ts +61 -9
  106. package/src/styles/widget-styles.test.ts +19 -0
  107. package/src/styles/widget.css +295 -23
  108. package/src/theme-editor/index.ts +2 -0
  109. package/src/theme-editor/preview-utils.test.ts +8 -0
  110. package/src/theme-editor/preview-utils.ts +7 -3
  111. package/src/theme-editor/sections.test.ts +31 -0
  112. package/src/theme-editor/sections.ts +55 -1
  113. package/src/theme-editor/state-preferences.test.ts +49 -0
  114. package/src/theme-editor/state.ts +73 -15
  115. package/src/theme-reference.test.ts +20 -0
  116. package/src/theme-reference.ts +11 -5
  117. package/src/tool-call-display-defaults.test.ts +33 -1
  118. package/src/types/theme.ts +80 -3
  119. package/src/types.ts +179 -23
  120. package/src/ui.activity-row.test.ts +91 -0
  121. package/src/ui.approval-plugin.test.ts +63 -0
  122. package/src/ui.composer-compact.test.ts +24 -2
  123. package/src/ui.composer-placement.test.ts +23 -0
  124. package/src/ui.detached-panel.test.ts +33 -6
  125. package/src/ui.docked.test.ts +19 -0
  126. package/src/ui.header-update-stability.test.ts +25 -0
  127. package/src/ui.identity-proof.test.ts +58 -0
  128. package/src/ui.launcher-teaser.test.ts +25 -0
  129. package/src/ui.message-width.test.ts +17 -2
  130. package/src/ui.reasoning-display.test.ts +92 -0
  131. package/src/ui.rebuild-composer.test.ts +20 -3
  132. package/src/ui.scroll.test.ts +32 -0
  133. package/src/ui.session-init.test.ts +312 -0
  134. package/src/ui.status-indicator.test.ts +82 -0
  135. package/src/ui.suggest-replies.test.ts +11 -0
  136. package/src/ui.ts +363 -74
  137. package/src/ui.v5-defaults.test.ts +144 -0
  138. package/src/ui.welcome.test.ts +92 -3
  139. package/src/utils/__snapshots__/tokens-parity.test.ts.snap +811 -140
  140. package/src/utils/code-generators.ts +14 -0
  141. package/src/utils/composer-compact.test.ts +0 -2
  142. package/src/utils/composer-compact.ts +2 -4
  143. package/src/utils/composer-placement.ts +2 -3
  144. package/src/utils/config-merge.test.ts +81 -5
  145. package/src/utils/config-merge.ts +13 -3
  146. package/src/utils/defaults-provenance.ts +67 -0
  147. package/src/utils/dock.ts +7 -1
  148. package/src/utils/launcher-variant.ts +16 -0
  149. package/src/utils/panel-config.ts +97 -0
  150. package/src/utils/status-indicator.ts +39 -0
  151. package/src/utils/theme.test.ts +182 -0
  152. package/src/utils/theme.ts +131 -18
  153. package/src/utils/tokens.test.ts +122 -1
  154. package/src/utils/tokens.ts +177 -17
  155. package/src/utils/tool-pair-replay.ts +100 -0
  156. package/src/welcome.test.ts +23 -0
  157. package/src/welcome.ts +16 -9
  158. package/dist/approval-ui-K7R5Q5OC.js +0 -1
@@ -106,6 +106,7 @@ type RuntypeExecutionStreamEvent = ({
106
106
  turnIndex?: number;
107
107
  type: "turn_start";
108
108
  }) | ({
109
+ attributes?: Record<string, string | number | boolean>;
109
110
  completedAt?: string;
110
111
  content?: string;
111
112
  cost?: number;
@@ -164,7 +165,8 @@ type RuntypeExecutionStreamEvent = ({
164
165
  };
165
166
  turnId?: string;
166
167
  type: "model_call_start";
167
- } | {
168
+ } | ({
169
+ attributes?: Record<string, string | number | boolean>;
168
170
  completedAt?: string;
169
171
  cost?: number;
170
172
  durationMs?: number;
@@ -188,10 +190,11 @@ type RuntypeExecutionStreamEvent = ({
188
190
  cacheWrite?: number;
189
191
  input: number;
190
192
  output: number;
193
+ reasoning?: number;
191
194
  };
192
195
  turnId?: string;
193
196
  type: "model_call_complete";
194
- } | {
197
+ }) | {
195
198
  executionId: string;
196
199
  id: string;
197
200
  index?: number;
@@ -809,6 +812,24 @@ type AgentMessageMetadata = {
809
812
  * never re-resume the call.
810
813
  */
811
814
  suggestRepliesResolved?: boolean;
815
+ /**
816
+ * The client-tool answer the server accepted through `/resume`, kept so
817
+ * later proxy/agent turns can replay the call and its result to the model.
818
+ * `toolName` is the widget's internal name (`webmcp:<name>` or a bare
819
+ * built-in). Set only after the resume succeeds; preserved across
820
+ * re-emissions of the tool message.
821
+ */
822
+ clientToolAnswer?: {
823
+ toolCallId: string;
824
+ toolName: string;
825
+ args: unknown;
826
+ result: unknown;
827
+ /**
828
+ * Shared by the answers posted in one `/resume`, i.e. one assistant
829
+ * turn's parallel calls; a chained call gets a new batch.
830
+ */
831
+ batch?: string;
832
+ };
812
833
  };
813
834
  /**
814
835
  * Copy overrides for the visitor-facing conversation history surface. These are
@@ -1094,6 +1115,8 @@ type AgentWidgetReasoning = {
1094
1115
  durationMs?: number;
1095
1116
  };
1096
1117
  type AgentWidgetToolCall = {
1118
+ /** Optional approval state for activity-row status chrome. */
1119
+ approvalStatus?: "pending" | "approved" | "denied" | "timeout";
1097
1120
  id: string;
1098
1121
  name?: string;
1099
1122
  status: "pending" | "running" | "complete";
@@ -106,6 +106,7 @@ type RuntypeExecutionStreamEvent = ({
106
106
  turnIndex?: number;
107
107
  type: "turn_start";
108
108
  }) | ({
109
+ attributes?: Record<string, string | number | boolean>;
109
110
  completedAt?: string;
110
111
  content?: string;
111
112
  cost?: number;
@@ -164,7 +165,8 @@ type RuntypeExecutionStreamEvent = ({
164
165
  };
165
166
  turnId?: string;
166
167
  type: "model_call_start";
167
- } | {
168
+ } | ({
169
+ attributes?: Record<string, string | number | boolean>;
168
170
  completedAt?: string;
169
171
  cost?: number;
170
172
  durationMs?: number;
@@ -188,10 +190,11 @@ type RuntypeExecutionStreamEvent = ({
188
190
  cacheWrite?: number;
189
191
  input: number;
190
192
  output: number;
193
+ reasoning?: number;
191
194
  };
192
195
  turnId?: string;
193
196
  type: "model_call_complete";
194
- } | {
197
+ }) | {
195
198
  executionId: string;
196
199
  id: string;
197
200
  index?: number;
@@ -809,6 +812,24 @@ type AgentMessageMetadata = {
809
812
  * never re-resume the call.
810
813
  */
811
814
  suggestRepliesResolved?: boolean;
815
+ /**
816
+ * The client-tool answer the server accepted through `/resume`, kept so
817
+ * later proxy/agent turns can replay the call and its result to the model.
818
+ * `toolName` is the widget's internal name (`webmcp:<name>` or a bare
819
+ * built-in). Set only after the resume succeeds; preserved across
820
+ * re-emissions of the tool message.
821
+ */
822
+ clientToolAnswer?: {
823
+ toolCallId: string;
824
+ toolName: string;
825
+ args: unknown;
826
+ result: unknown;
827
+ /**
828
+ * Shared by the answers posted in one `/resume`, i.e. one assistant
829
+ * turn's parallel calls; a chained call gets a new batch.
830
+ */
831
+ batch?: string;
832
+ };
812
833
  };
813
834
  /**
814
835
  * Copy overrides for the visitor-facing conversation history surface. These are
@@ -1094,6 +1115,8 @@ type AgentWidgetReasoning = {
1094
1115
  durationMs?: number;
1095
1116
  };
1096
1117
  type AgentWidgetToolCall = {
1118
+ /** Optional approval state for activity-row status chrome. */
1119
+ approvalStatus?: "pending" | "approved" | "denied" | "timeout";
1097
1120
  id: string;
1098
1121
  name?: string;
1099
1122
  status: "pending" | "running" | "complete";