@runtypelabs/persona 4.22.0 → 4.22.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.
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-B_JdVK9o.d.cts → types-9Vxm-PPz.d.cts} +136 -6
- package/dist/animations/{types-B_JdVK9o.d.ts → types-9Vxm-PPz.d.ts} +136 -6
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/animations-extra.d.cts +136 -6
- package/dist/animations-extra.d.ts +136 -6
- package/dist/approval-ui.d.cts +148 -14
- package/dist/approval-ui.d.ts +148 -14
- package/dist/artifacts-ui.d.cts +148 -14
- package/dist/artifacts-ui.d.ts +148 -14
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/context-mentions.d.cts +148 -14
- package/dist/context-mentions.d.ts +148 -14
- package/dist/event-stream-view-GL3ADRY2.js +1 -0
- package/dist/event-stream-view.cjs +1 -1
- package/dist/event-stream-view.d.cts +148 -14
- package/dist/event-stream-view.d.ts +148 -14
- package/dist/event-stream-view.js +1 -1
- package/dist/forms-ui.d.cts +161 -23
- package/dist/forms-ui.d.ts +161 -23
- package/dist/history-view.d.cts +136 -6
- package/dist/history-view.d.ts +136 -6
- package/dist/index.cjs +67 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +166 -27
- package/dist/index.d.ts +166 -27
- package/dist/index.global.js +51 -51
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +67 -67
- package/dist/index.js.map +1 -1
- package/dist/session-reconnect.d.cts +148 -14
- package/dist/session-reconnect.d.ts +148 -14
- package/dist/smart-dom-reader.d.cts +148 -14
- package/dist/smart-dom-reader.d.ts +148 -14
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.cts +3 -4
- package/dist/testing.d.ts +3 -4
- package/dist/testing.js +3 -3
- package/dist/theme-editor-preview.cjs +71 -71
- package/dist/theme-editor-preview.d.cts +148 -14
- package/dist/theme-editor-preview.d.ts +148 -14
- package/dist/theme-editor-preview.js +48 -48
- package/dist/theme-editor.d.cts +148 -14
- package/dist/theme-editor.d.ts +148 -14
- package/dist/voice-runtime.d.cts +6 -2
- package/dist/voice-runtime.d.ts +6 -2
- package/package.json +1 -1
- package/src/ask-user-question-tool.ts +1 -1
- package/src/client-history-rest.test.ts +2 -1
- package/src/client-visitor-history.test.ts +20 -4
- package/src/client.composer-options.test.ts +1 -1
- package/src/client.interrupt.test.ts +2 -2
- package/src/client.test.ts +477 -915
- package/src/client.ts +134 -494
- package/src/client.unified-tools.test.ts +76 -0
- package/src/components/event-stream-badge-theming.test.ts +3 -0
- package/src/components/event-stream-view.test.ts +76 -76
- package/src/components/event-stream-view.ts +5 -0
- package/src/components/tool-bubble.test.ts +12 -0
- package/src/components/tool-bubble.ts +13 -2
- package/src/event-stream-view-bundle.test.ts +2 -2
- package/src/generated/runtype-openapi-contract.ts +129 -1
- package/src/internal/runtype-history-provider.test.ts +2 -2
- package/src/session-history.test.ts +1 -1
- package/src/session.quote.test.ts +1 -1
- package/src/session.resubmit-from.test.ts +1 -1
- package/src/session.test.ts +5 -5
- package/src/session.ts +95 -36
- package/src/suggest-replies-tool.ts +1 -1
- package/src/testing/mock-stream.test.ts +37 -16
- package/src/testing/mock-stream.ts +14 -9
- package/src/types.ts +19 -14
- package/src/ui.ask-user-question-plugin.test.ts +7 -7
- package/src/ui.composer-defer-one.test.ts +6 -34
- package/src/ui.composer-draft-persistence.test.ts +1 -1
- package/src/ui.composer-quote.test.ts +1 -1
- package/src/ui.message-history-actions.test.ts +1 -1
- package/src/ui.streaming-coalescing.test.ts +10 -13
- package/src/ui.ts +67 -32
- package/src/ui.typing-indicator.test.ts +216 -0
- package/src/ui.voice-custom-provider.test.ts +211 -0
- package/src/utils/event-stream-buffer.test.ts +13 -13
- package/src/utils/event-stream-capture.test.ts +20 -20
- package/src/utils/throughput-tracker.test.ts +100 -142
- package/src/utils/throughput-tracker.ts +18 -132
- package/src/utils/voice-support.ts +18 -1
- package/src/voice/voice-turn-tracker.ts +18 -0
- package/src/webmcp-bridge.ts +1 -1
- package/dist/event-stream-view-FKWDY3UB.js +0 -1
- package/src/utils/__fixtures__/unified-translator.oracle.ts +0 -717
package/dist/history-view.d.ts
CHANGED
|
@@ -98,6 +98,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
98
98
|
iteration?: number;
|
|
99
99
|
role: "user" | "assistant" | "system";
|
|
100
100
|
seq: number;
|
|
101
|
+
subagent?: {
|
|
102
|
+
agentName?: string;
|
|
103
|
+
parentToolCallId?: string;
|
|
104
|
+
toolName: string;
|
|
105
|
+
};
|
|
101
106
|
turnIndex?: number;
|
|
102
107
|
type: "turn_start";
|
|
103
108
|
}) | ({
|
|
@@ -132,12 +137,61 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
132
137
|
role: "user" | "assistant" | "system";
|
|
133
138
|
seq: number;
|
|
134
139
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
140
|
+
subagent?: {
|
|
141
|
+
agentName?: string;
|
|
142
|
+
parentToolCallId?: string;
|
|
143
|
+
toolName: string;
|
|
144
|
+
};
|
|
135
145
|
tokens?: {
|
|
136
146
|
input: number;
|
|
137
147
|
output: number;
|
|
138
148
|
};
|
|
139
149
|
type: "turn_complete";
|
|
140
150
|
}) | {
|
|
151
|
+
executionId: string;
|
|
152
|
+
id: string;
|
|
153
|
+
iteration?: number;
|
|
154
|
+
model?: string;
|
|
155
|
+
ordinal: number;
|
|
156
|
+
provider?: string;
|
|
157
|
+
seq: number;
|
|
158
|
+
startedAt?: string;
|
|
159
|
+
stepId?: string;
|
|
160
|
+
subagent?: {
|
|
161
|
+
agentName?: string;
|
|
162
|
+
parentToolCallId?: string;
|
|
163
|
+
toolName: string;
|
|
164
|
+
};
|
|
165
|
+
turnId?: string;
|
|
166
|
+
type: "model_call_start";
|
|
167
|
+
} | {
|
|
168
|
+
completedAt?: string;
|
|
169
|
+
cost?: number;
|
|
170
|
+
durationMs?: number;
|
|
171
|
+
executionId: string;
|
|
172
|
+
finishReason?: string;
|
|
173
|
+
id: string;
|
|
174
|
+
iteration?: number;
|
|
175
|
+
model?: string;
|
|
176
|
+
ordinal: number;
|
|
177
|
+
provider?: string;
|
|
178
|
+
responseModel?: string;
|
|
179
|
+
seq: number;
|
|
180
|
+
subagent?: {
|
|
181
|
+
agentName?: string;
|
|
182
|
+
parentToolCallId?: string;
|
|
183
|
+
toolName: string;
|
|
184
|
+
};
|
|
185
|
+
success?: boolean;
|
|
186
|
+
tokens?: {
|
|
187
|
+
cacheRead?: number;
|
|
188
|
+
cacheWrite?: number;
|
|
189
|
+
input: number;
|
|
190
|
+
output: number;
|
|
191
|
+
};
|
|
192
|
+
turnId?: string;
|
|
193
|
+
type: "model_call_complete";
|
|
194
|
+
} | {
|
|
141
195
|
executionId: string;
|
|
142
196
|
id: string;
|
|
143
197
|
index?: number;
|
|
@@ -146,6 +200,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
146
200
|
seq: number;
|
|
147
201
|
startedAt?: string;
|
|
148
202
|
stepType?: string;
|
|
203
|
+
subagent?: {
|
|
204
|
+
agentName?: string;
|
|
205
|
+
parentToolCallId?: string;
|
|
206
|
+
toolName: string;
|
|
207
|
+
};
|
|
149
208
|
totalSteps?: number;
|
|
150
209
|
type: "step_start";
|
|
151
210
|
} | ({
|
|
@@ -173,6 +232,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
173
232
|
seq: number;
|
|
174
233
|
stepType?: string;
|
|
175
234
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
235
|
+
subagent?: {
|
|
236
|
+
agentName?: string;
|
|
237
|
+
parentToolCallId?: string;
|
|
238
|
+
toolName: string;
|
|
239
|
+
};
|
|
176
240
|
success?: boolean;
|
|
177
241
|
tokensUsed?: number;
|
|
178
242
|
type: "step_complete";
|
|
@@ -195,6 +259,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
195
259
|
role?: "user" | "assistant" | "system";
|
|
196
260
|
seq: number;
|
|
197
261
|
stepId?: string;
|
|
262
|
+
subagent?: {
|
|
263
|
+
agentName?: string;
|
|
264
|
+
parentToolCallId?: string;
|
|
265
|
+
toolName: string;
|
|
266
|
+
};
|
|
198
267
|
turnId?: string;
|
|
199
268
|
type: "text_start";
|
|
200
269
|
}) | {
|
|
@@ -202,11 +271,21 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
202
271
|
executionId: string;
|
|
203
272
|
id: string;
|
|
204
273
|
seq: number;
|
|
274
|
+
subagent?: {
|
|
275
|
+
agentName?: string;
|
|
276
|
+
parentToolCallId?: string;
|
|
277
|
+
toolName: string;
|
|
278
|
+
};
|
|
205
279
|
type: "text_delta";
|
|
206
280
|
} | {
|
|
207
281
|
executionId: string;
|
|
208
282
|
id: string;
|
|
209
283
|
seq: number;
|
|
284
|
+
subagent?: {
|
|
285
|
+
agentName?: string;
|
|
286
|
+
parentToolCallId?: string;
|
|
287
|
+
toolName: string;
|
|
288
|
+
};
|
|
210
289
|
text?: string;
|
|
211
290
|
type: "text_complete";
|
|
212
291
|
} | ({
|
|
@@ -215,18 +294,33 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
215
294
|
parentToolCallId?: string;
|
|
216
295
|
scope?: "turn" | "loop";
|
|
217
296
|
seq: number;
|
|
297
|
+
subagent?: {
|
|
298
|
+
agentName?: string;
|
|
299
|
+
parentToolCallId?: string;
|
|
300
|
+
toolName: string;
|
|
301
|
+
};
|
|
218
302
|
type: "reasoning_start";
|
|
219
303
|
}) | {
|
|
220
304
|
delta: string;
|
|
221
305
|
executionId: string;
|
|
222
306
|
id: string;
|
|
223
307
|
seq: number;
|
|
308
|
+
subagent?: {
|
|
309
|
+
agentName?: string;
|
|
310
|
+
parentToolCallId?: string;
|
|
311
|
+
toolName: string;
|
|
312
|
+
};
|
|
224
313
|
type: "reasoning_delta";
|
|
225
314
|
} | ({
|
|
226
315
|
executionId: string;
|
|
227
316
|
id: string;
|
|
228
317
|
scope?: "turn" | "loop";
|
|
229
318
|
seq: number;
|
|
319
|
+
subagent?: {
|
|
320
|
+
agentName?: string;
|
|
321
|
+
parentToolCallId?: string;
|
|
322
|
+
toolName: string;
|
|
323
|
+
};
|
|
230
324
|
text?: string;
|
|
231
325
|
type: "reasoning_complete";
|
|
232
326
|
}) | ({
|
|
@@ -319,6 +413,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
319
413
|
seq: number;
|
|
320
414
|
startedAt?: string;
|
|
321
415
|
stepId?: string;
|
|
416
|
+
subagent?: {
|
|
417
|
+
agentName?: string;
|
|
418
|
+
parentToolCallId?: string;
|
|
419
|
+
toolName: string;
|
|
420
|
+
};
|
|
322
421
|
toolCallId: string;
|
|
323
422
|
toolName: string;
|
|
324
423
|
toolType: string;
|
|
@@ -327,6 +426,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
327
426
|
delta: string;
|
|
328
427
|
executionId: string;
|
|
329
428
|
seq: number;
|
|
429
|
+
subagent?: {
|
|
430
|
+
agentName?: string;
|
|
431
|
+
parentToolCallId?: string;
|
|
432
|
+
toolName: string;
|
|
433
|
+
};
|
|
330
434
|
toolCallId: string;
|
|
331
435
|
type: "tool_input_delta";
|
|
332
436
|
} | {
|
|
@@ -334,6 +438,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
334
438
|
hiddenParameterNames?: Array<string>;
|
|
335
439
|
parameters: Record<string, unknown>;
|
|
336
440
|
seq: number;
|
|
441
|
+
subagent?: {
|
|
442
|
+
agentName?: string;
|
|
443
|
+
parentToolCallId?: string;
|
|
444
|
+
toolName: string;
|
|
445
|
+
};
|
|
337
446
|
toolCallId: string;
|
|
338
447
|
toolName?: string;
|
|
339
448
|
type: "tool_input_complete";
|
|
@@ -351,6 +460,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
351
460
|
result?: unknown;
|
|
352
461
|
seq: number;
|
|
353
462
|
stepId?: string;
|
|
463
|
+
subagent?: {
|
|
464
|
+
agentName?: string;
|
|
465
|
+
parentToolCallId?: string;
|
|
466
|
+
toolName: string;
|
|
467
|
+
};
|
|
354
468
|
success: boolean;
|
|
355
469
|
toolCallId: string;
|
|
356
470
|
toolCost?: number;
|
|
@@ -430,6 +544,19 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
430
544
|
recoverable?: boolean;
|
|
431
545
|
seq: number;
|
|
432
546
|
type: "error";
|
|
547
|
+
}) | ({
|
|
548
|
+
epoch: number;
|
|
549
|
+
executionId: string;
|
|
550
|
+
kind: "compaction";
|
|
551
|
+
outcome?: "ok" | "failed" | "gap" | "skipped";
|
|
552
|
+
phase: "start" | "complete";
|
|
553
|
+
reason: "threshold" | "overflow" | "manual" | "surface_policy" | "provider_mismatch";
|
|
554
|
+
seq: number;
|
|
555
|
+
strategy: "provider_native" | "summary";
|
|
556
|
+
tier: number;
|
|
557
|
+
tokensAfter?: number;
|
|
558
|
+
tokensBefore?: number;
|
|
559
|
+
type: "context_notice";
|
|
433
560
|
}) | {
|
|
434
561
|
executionId: string;
|
|
435
562
|
seq: number;
|
|
@@ -641,15 +768,15 @@ type AgentMessageMetadata = {
|
|
|
641
768
|
*/
|
|
642
769
|
parentStepId?: string;
|
|
643
770
|
/**
|
|
644
|
-
* Set to `true` on a tool-variant message produced from
|
|
771
|
+
* Set to `true` on a tool-variant message produced from an `await`
|
|
645
772
|
* event (`awaitReason: "local_tool_required"`). Signals to UI code that
|
|
646
773
|
* the tool call is a LOCAL tool and the server is paused waiting for a
|
|
647
774
|
* `POST /v1/dispatch/resume` with the user's answer keyed by tool name.
|
|
648
775
|
*/
|
|
649
776
|
awaitingLocalTool?: boolean;
|
|
650
777
|
/**
|
|
651
|
-
* The provider per-call id (`toolu_…`) carried on the `
|
|
652
|
-
*
|
|
778
|
+
* The provider per-call id (`toolu_…`) carried on the `await`
|
|
779
|
+
* event for a LOCAL tool (core#3878). Present only when the
|
|
653
780
|
* server emits it. Two PARALLEL calls to the same tool in one turn share a
|
|
654
781
|
* `toolName` (and a collapsed `toolId`) but get DISTINCT `webMcpToolCallId`s,
|
|
655
782
|
* so this is the key the widget batches a single `/resume` on: preferred
|
|
@@ -959,7 +1086,7 @@ type AgentWidgetReasoning = {
|
|
|
959
1086
|
/**
|
|
960
1087
|
* Reasoning channel scope (wire spec). `"turn"` is ordinary per-turn
|
|
961
1088
|
* thinking; `"loop"` is a cross-iteration agent reflection (the fold that
|
|
962
|
-
* replaced the legacy `agent_reflection` event).
|
|
1089
|
+
* replaced the legacy `agent_reflection` event). Optional when the stream does not specify a scope.
|
|
963
1090
|
*/
|
|
964
1091
|
scope?: "turn" | "loop";
|
|
965
1092
|
startedAt?: number;
|
|
@@ -973,6 +1100,9 @@ type AgentWidgetToolCall = {
|
|
|
973
1100
|
args?: unknown;
|
|
974
1101
|
chunks?: string[];
|
|
975
1102
|
result?: unknown;
|
|
1103
|
+
/** Whether the tool succeeded; failure does not necessarily end the execution. */
|
|
1104
|
+
success?: boolean;
|
|
1105
|
+
error?: string;
|
|
976
1106
|
duration?: number;
|
|
977
1107
|
startedAt?: number;
|
|
978
1108
|
completedAt?: number;
|
|
@@ -1003,7 +1133,7 @@ type AgentWidgetApproval = {
|
|
|
1003
1133
|
type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "approval";
|
|
1004
1134
|
/**
|
|
1005
1135
|
* Per-turn / per-step stop reason emitted by the runtime on
|
|
1006
|
-
* `
|
|
1136
|
+
* `turn_complete` and `step_complete` SSE events. The vocabulary is
|
|
1007
1137
|
* owned by the upstream Runtype API: do not extend without coordination.
|
|
1008
1138
|
*
|
|
1009
1139
|
* - `end_turn`: natural completion (no affordance needed)
|
|
@@ -1134,7 +1264,7 @@ type AgentWidgetMessage = {
|
|
|
1134
1264
|
*/
|
|
1135
1265
|
agentMetadata?: AgentMessageMetadata;
|
|
1136
1266
|
/**
|
|
1137
|
-
* Per-turn stop reason reported by the runtime on `
|
|
1267
|
+
* Per-turn stop reason reported by the runtime on `turn_complete`
|
|
1138
1268
|
* (agent-loop path) or the last `step_complete` for a prompt step
|
|
1139
1269
|
* (dispatch / flow path). Absent when the API did not report a value.
|
|
1140
1270
|
*
|