@runtypelabs/persona 4.21.1 → 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-RNNBR5R3.js → approval-ui-K7R5Q5OC.js} +1 -1
- package/dist/approval-ui.cjs +2 -2
- package/dist/approval-ui.d.cts +221 -16
- package/dist/approval-ui.d.ts +221 -16
- package/dist/approval-ui.js +2 -2
- package/dist/artifacts-ui-F4N6VMKF.js +7 -0
- package/dist/artifacts-ui.cjs +1 -1
- package/dist/artifacts-ui.d.cts +221 -16
- package/dist/artifacts-ui.d.ts +221 -16
- package/dist/artifacts-ui.js +1 -1
- package/dist/chunk-NQLDCJAP.js +4 -0
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/context-mentions.d.cts +221 -16
- package/dist/context-mentions.d.ts +221 -16
- package/dist/event-stream-view-GL3ADRY2.js +1 -0
- package/dist/event-stream-view.cjs +1 -1
- package/dist/event-stream-view.d.cts +221 -16
- package/dist/event-stream-view.d.ts +221 -16
- package/dist/event-stream-view.js +1 -1
- package/dist/forms-ui.d.cts +234 -25
- package/dist/forms-ui.d.ts +234 -25
- package/dist/history-view.d.cts +136 -6
- package/dist/history-view.d.ts +136 -6
- package/dist/index.cjs +70 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +302 -32
- package/dist/index.d.ts +302 -32
- package/dist/index.global.js +54 -54
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +69 -69
- package/dist/index.js.map +1 -1
- package/dist/launcher.global.js +2 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/session-reconnect.d.cts +221 -16
- package/dist/session-reconnect.d.ts +221 -16
- package/dist/smart-dom-reader.d.cts +221 -16
- package/dist/smart-dom-reader.d.ts +221 -16
- 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 +73 -73
- package/dist/theme-editor-preview.d.cts +221 -16
- package/dist/theme-editor-preview.d.ts +221 -16
- package/dist/theme-editor-preview.js +51 -51
- package/dist/theme-editor.cjs +4 -4
- package/dist/theme-editor.d.cts +221 -16
- package/dist/theme-editor.d.ts +221 -16
- package/dist/theme-editor.js +2 -2
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +65 -1
- package/dist/theme-reference.d.ts +65 -1
- package/dist/theme-reference.js +1 -1
- package/dist/voice-runtime.d.cts +6 -2
- package/dist/voice-runtime.d.ts +6 -2
- package/dist/webmcp-polyfill.js +1 -4
- package/dist/webmcp-runtime-JI7T4QYF.js +6 -0
- package/dist/webmcp-runtime.cjs +2 -2
- package/dist/webmcp-runtime.d.cts +34 -2
- package/dist/webmcp-runtime.d.ts +34 -2
- package/dist/webmcp-runtime.js +2 -2
- package/package.json +2 -2
- 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/artifact-preview.ts +5 -0
- package/src/components/event-stream-badge-theming.test.ts +162 -0
- package/src/components/event-stream-view.test.ts +76 -76
- package/src/components/event-stream-view.ts +55 -20
- 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 +137 -1
- package/src/index-core.ts +2 -0
- package/src/internal/runtype-history-provider.test.ts +2 -2
- package/src/runtime/init.registry.test.ts +56 -0
- package/src/runtime/init.ts +17 -0
- 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/theme.ts +41 -1
- package/src/types.ts +57 -15
- 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.reasoning-display.test.ts +136 -2
- package/src/ui.streaming-coalescing.test.ts +10 -13
- package/src/ui.ts +101 -35
- package/src/ui.typing-indicator.test.ts +216 -0
- package/src/ui.voice-custom-provider.test.ts +211 -0
- package/src/utils/__snapshots__/tokens-parity.test.ts.snap +1740 -0
- package/src/utils/event-stream-buffer.test.ts +13 -13
- package/src/utils/event-stream-capture.test.ts +20 -20
- package/src/utils/formatting.ts +22 -0
- package/src/utils/theme.ts +16 -0
- package/src/utils/throughput-tracker.test.ts +100 -142
- package/src/utils/throughput-tracker.ts +18 -132
- package/src/utils/tokens.ts +59 -0
- package/src/utils/voice-support.ts +18 -1
- package/src/voice/voice-turn-tracker.ts +18 -0
- package/src/webmcp-bridge.test.ts +132 -23
- package/src/webmcp-bridge.ts +27 -3
- package/src/webmcp-runtime-entry.ts +71 -11
- package/dist/artifacts-ui-J6AKUGTS.js +0 -7
- package/dist/chunk-HBE7LFNT.js +0 -4
- package/dist/event-stream-view-73NWKWVQ.js +0 -1
- package/dist/webmcp-runtime-P3CHZRHF.js +0 -6
- package/src/utils/__fixtures__/unified-translator.oracle.ts +0 -717
|
@@ -61,6 +61,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
61
61
|
iteration?: number;
|
|
62
62
|
role: "user" | "assistant" | "system";
|
|
63
63
|
seq: number;
|
|
64
|
+
subagent?: {
|
|
65
|
+
agentName?: string;
|
|
66
|
+
parentToolCallId?: string;
|
|
67
|
+
toolName: string;
|
|
68
|
+
};
|
|
64
69
|
turnIndex?: number;
|
|
65
70
|
type: "turn_start";
|
|
66
71
|
}) | ({
|
|
@@ -95,12 +100,61 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
95
100
|
role: "user" | "assistant" | "system";
|
|
96
101
|
seq: number;
|
|
97
102
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
103
|
+
subagent?: {
|
|
104
|
+
agentName?: string;
|
|
105
|
+
parentToolCallId?: string;
|
|
106
|
+
toolName: string;
|
|
107
|
+
};
|
|
98
108
|
tokens?: {
|
|
99
109
|
input: number;
|
|
100
110
|
output: number;
|
|
101
111
|
};
|
|
102
112
|
type: "turn_complete";
|
|
103
113
|
}) | {
|
|
114
|
+
executionId: string;
|
|
115
|
+
id: string;
|
|
116
|
+
iteration?: number;
|
|
117
|
+
model?: string;
|
|
118
|
+
ordinal: number;
|
|
119
|
+
provider?: string;
|
|
120
|
+
seq: number;
|
|
121
|
+
startedAt?: string;
|
|
122
|
+
stepId?: string;
|
|
123
|
+
subagent?: {
|
|
124
|
+
agentName?: string;
|
|
125
|
+
parentToolCallId?: string;
|
|
126
|
+
toolName: string;
|
|
127
|
+
};
|
|
128
|
+
turnId?: string;
|
|
129
|
+
type: "model_call_start";
|
|
130
|
+
} | {
|
|
131
|
+
completedAt?: string;
|
|
132
|
+
cost?: number;
|
|
133
|
+
durationMs?: number;
|
|
134
|
+
executionId: string;
|
|
135
|
+
finishReason?: string;
|
|
136
|
+
id: string;
|
|
137
|
+
iteration?: number;
|
|
138
|
+
model?: string;
|
|
139
|
+
ordinal: number;
|
|
140
|
+
provider?: string;
|
|
141
|
+
responseModel?: string;
|
|
142
|
+
seq: number;
|
|
143
|
+
subagent?: {
|
|
144
|
+
agentName?: string;
|
|
145
|
+
parentToolCallId?: string;
|
|
146
|
+
toolName: string;
|
|
147
|
+
};
|
|
148
|
+
success?: boolean;
|
|
149
|
+
tokens?: {
|
|
150
|
+
cacheRead?: number;
|
|
151
|
+
cacheWrite?: number;
|
|
152
|
+
input: number;
|
|
153
|
+
output: number;
|
|
154
|
+
};
|
|
155
|
+
turnId?: string;
|
|
156
|
+
type: "model_call_complete";
|
|
157
|
+
} | {
|
|
104
158
|
executionId: string;
|
|
105
159
|
id: string;
|
|
106
160
|
index?: number;
|
|
@@ -109,6 +163,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
109
163
|
seq: number;
|
|
110
164
|
startedAt?: string;
|
|
111
165
|
stepType?: string;
|
|
166
|
+
subagent?: {
|
|
167
|
+
agentName?: string;
|
|
168
|
+
parentToolCallId?: string;
|
|
169
|
+
toolName: string;
|
|
170
|
+
};
|
|
112
171
|
totalSteps?: number;
|
|
113
172
|
type: "step_start";
|
|
114
173
|
} | ({
|
|
@@ -136,6 +195,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
136
195
|
seq: number;
|
|
137
196
|
stepType?: string;
|
|
138
197
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
198
|
+
subagent?: {
|
|
199
|
+
agentName?: string;
|
|
200
|
+
parentToolCallId?: string;
|
|
201
|
+
toolName: string;
|
|
202
|
+
};
|
|
139
203
|
success?: boolean;
|
|
140
204
|
tokensUsed?: number;
|
|
141
205
|
type: "step_complete";
|
|
@@ -158,6 +222,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
158
222
|
role?: "user" | "assistant" | "system";
|
|
159
223
|
seq: number;
|
|
160
224
|
stepId?: string;
|
|
225
|
+
subagent?: {
|
|
226
|
+
agentName?: string;
|
|
227
|
+
parentToolCallId?: string;
|
|
228
|
+
toolName: string;
|
|
229
|
+
};
|
|
161
230
|
turnId?: string;
|
|
162
231
|
type: "text_start";
|
|
163
232
|
}) | {
|
|
@@ -165,11 +234,21 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
165
234
|
executionId: string;
|
|
166
235
|
id: string;
|
|
167
236
|
seq: number;
|
|
237
|
+
subagent?: {
|
|
238
|
+
agentName?: string;
|
|
239
|
+
parentToolCallId?: string;
|
|
240
|
+
toolName: string;
|
|
241
|
+
};
|
|
168
242
|
type: "text_delta";
|
|
169
243
|
} | {
|
|
170
244
|
executionId: string;
|
|
171
245
|
id: string;
|
|
172
246
|
seq: number;
|
|
247
|
+
subagent?: {
|
|
248
|
+
agentName?: string;
|
|
249
|
+
parentToolCallId?: string;
|
|
250
|
+
toolName: string;
|
|
251
|
+
};
|
|
173
252
|
text?: string;
|
|
174
253
|
type: "text_complete";
|
|
175
254
|
} | ({
|
|
@@ -178,18 +257,33 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
178
257
|
parentToolCallId?: string;
|
|
179
258
|
scope?: "turn" | "loop";
|
|
180
259
|
seq: number;
|
|
260
|
+
subagent?: {
|
|
261
|
+
agentName?: string;
|
|
262
|
+
parentToolCallId?: string;
|
|
263
|
+
toolName: string;
|
|
264
|
+
};
|
|
181
265
|
type: "reasoning_start";
|
|
182
266
|
}) | {
|
|
183
267
|
delta: string;
|
|
184
268
|
executionId: string;
|
|
185
269
|
id: string;
|
|
186
270
|
seq: number;
|
|
271
|
+
subagent?: {
|
|
272
|
+
agentName?: string;
|
|
273
|
+
parentToolCallId?: string;
|
|
274
|
+
toolName: string;
|
|
275
|
+
};
|
|
187
276
|
type: "reasoning_delta";
|
|
188
277
|
} | ({
|
|
189
278
|
executionId: string;
|
|
190
279
|
id: string;
|
|
191
280
|
scope?: "turn" | "loop";
|
|
192
281
|
seq: number;
|
|
282
|
+
subagent?: {
|
|
283
|
+
agentName?: string;
|
|
284
|
+
parentToolCallId?: string;
|
|
285
|
+
toolName: string;
|
|
286
|
+
};
|
|
193
287
|
text?: string;
|
|
194
288
|
type: "reasoning_complete";
|
|
195
289
|
}) | ({
|
|
@@ -282,6 +376,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
282
376
|
seq: number;
|
|
283
377
|
startedAt?: string;
|
|
284
378
|
stepId?: string;
|
|
379
|
+
subagent?: {
|
|
380
|
+
agentName?: string;
|
|
381
|
+
parentToolCallId?: string;
|
|
382
|
+
toolName: string;
|
|
383
|
+
};
|
|
285
384
|
toolCallId: string;
|
|
286
385
|
toolName: string;
|
|
287
386
|
toolType: string;
|
|
@@ -290,6 +389,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
290
389
|
delta: string;
|
|
291
390
|
executionId: string;
|
|
292
391
|
seq: number;
|
|
392
|
+
subagent?: {
|
|
393
|
+
agentName?: string;
|
|
394
|
+
parentToolCallId?: string;
|
|
395
|
+
toolName: string;
|
|
396
|
+
};
|
|
293
397
|
toolCallId: string;
|
|
294
398
|
type: "tool_input_delta";
|
|
295
399
|
} | {
|
|
@@ -297,6 +401,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
297
401
|
hiddenParameterNames?: Array<string>;
|
|
298
402
|
parameters: Record<string, unknown>;
|
|
299
403
|
seq: number;
|
|
404
|
+
subagent?: {
|
|
405
|
+
agentName?: string;
|
|
406
|
+
parentToolCallId?: string;
|
|
407
|
+
toolName: string;
|
|
408
|
+
};
|
|
300
409
|
toolCallId: string;
|
|
301
410
|
toolName?: string;
|
|
302
411
|
type: "tool_input_complete";
|
|
@@ -314,6 +423,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
314
423
|
result?: unknown;
|
|
315
424
|
seq: number;
|
|
316
425
|
stepId?: string;
|
|
426
|
+
subagent?: {
|
|
427
|
+
agentName?: string;
|
|
428
|
+
parentToolCallId?: string;
|
|
429
|
+
toolName: string;
|
|
430
|
+
};
|
|
317
431
|
success: boolean;
|
|
318
432
|
toolCallId: string;
|
|
319
433
|
toolCost?: number;
|
|
@@ -393,6 +507,19 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
393
507
|
recoverable?: boolean;
|
|
394
508
|
seq: number;
|
|
395
509
|
type: "error";
|
|
510
|
+
}) | ({
|
|
511
|
+
epoch: number;
|
|
512
|
+
executionId: string;
|
|
513
|
+
kind: "compaction";
|
|
514
|
+
outcome?: "ok" | "failed" | "gap" | "skipped";
|
|
515
|
+
phase: "start" | "complete";
|
|
516
|
+
reason: "threshold" | "overflow" | "manual" | "surface_policy" | "provider_mismatch";
|
|
517
|
+
seq: number;
|
|
518
|
+
strategy: "provider_native" | "summary";
|
|
519
|
+
tier: number;
|
|
520
|
+
tokensAfter?: number;
|
|
521
|
+
tokensBefore?: number;
|
|
522
|
+
type: "context_notice";
|
|
396
523
|
}) | {
|
|
397
524
|
executionId: string;
|
|
398
525
|
seq: number;
|
|
@@ -509,15 +636,15 @@ type AgentMessageMetadata = {
|
|
|
509
636
|
*/
|
|
510
637
|
parentStepId?: string;
|
|
511
638
|
/**
|
|
512
|
-
* Set to `true` on a tool-variant message produced from
|
|
639
|
+
* Set to `true` on a tool-variant message produced from an `await`
|
|
513
640
|
* event (`awaitReason: "local_tool_required"`). Signals to UI code that
|
|
514
641
|
* the tool call is a LOCAL tool and the server is paused waiting for a
|
|
515
642
|
* `POST /v1/dispatch/resume` with the user's answer keyed by tool name.
|
|
516
643
|
*/
|
|
517
644
|
awaitingLocalTool?: boolean;
|
|
518
645
|
/**
|
|
519
|
-
* The provider per-call id (`toolu_…`) carried on the `
|
|
520
|
-
*
|
|
646
|
+
* The provider per-call id (`toolu_…`) carried on the `await`
|
|
647
|
+
* event for a LOCAL tool (core#3878). Present only when the
|
|
521
648
|
* server emits it. Two PARALLEL calls to the same tool in one turn share a
|
|
522
649
|
* `toolName` (and a collapsed `toolId`) but get DISTINCT `webMcpToolCallId`s,
|
|
523
650
|
* so this is the key the widget batches a single `/resume` on: preferred
|
|
@@ -649,7 +776,7 @@ type AgentWidgetReasoning = {
|
|
|
649
776
|
/**
|
|
650
777
|
* Reasoning channel scope (wire spec). `"turn"` is ordinary per-turn
|
|
651
778
|
* thinking; `"loop"` is a cross-iteration agent reflection (the fold that
|
|
652
|
-
* replaced the legacy `agent_reflection` event).
|
|
779
|
+
* replaced the legacy `agent_reflection` event). Optional when the stream does not specify a scope.
|
|
653
780
|
*/
|
|
654
781
|
scope?: "turn" | "loop";
|
|
655
782
|
startedAt?: number;
|
|
@@ -663,6 +790,9 @@ type AgentWidgetToolCall = {
|
|
|
663
790
|
args?: unknown;
|
|
664
791
|
chunks?: string[];
|
|
665
792
|
result?: unknown;
|
|
793
|
+
/** Whether the tool succeeded; failure does not necessarily end the execution. */
|
|
794
|
+
success?: boolean;
|
|
795
|
+
error?: string;
|
|
666
796
|
duration?: number;
|
|
667
797
|
startedAt?: number;
|
|
668
798
|
completedAt?: number;
|
|
@@ -693,7 +823,7 @@ type AgentWidgetApproval = {
|
|
|
693
823
|
type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "approval";
|
|
694
824
|
/**
|
|
695
825
|
* Per-turn / per-step stop reason emitted by the runtime on
|
|
696
|
-
* `
|
|
826
|
+
* `turn_complete` and `step_complete` SSE events. The vocabulary is
|
|
697
827
|
* owned by the upstream Runtype API: do not extend without coordination.
|
|
698
828
|
*
|
|
699
829
|
* - `end_turn`: natural completion (no affordance needed)
|
|
@@ -824,7 +954,7 @@ type AgentWidgetMessage = {
|
|
|
824
954
|
*/
|
|
825
955
|
agentMetadata?: AgentMessageMetadata;
|
|
826
956
|
/**
|
|
827
|
-
* Per-turn stop reason reported by the runtime on `
|
|
957
|
+
* Per-turn stop reason reported by the runtime on `turn_complete`
|
|
828
958
|
* (agent-loop path) or the last `step_complete` for a prompt step
|
|
829
959
|
* (dispatch / flow path). Absent when the API did not report a value.
|
|
830
960
|
*
|
|
@@ -61,6 +61,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
61
61
|
iteration?: number;
|
|
62
62
|
role: "user" | "assistant" | "system";
|
|
63
63
|
seq: number;
|
|
64
|
+
subagent?: {
|
|
65
|
+
agentName?: string;
|
|
66
|
+
parentToolCallId?: string;
|
|
67
|
+
toolName: string;
|
|
68
|
+
};
|
|
64
69
|
turnIndex?: number;
|
|
65
70
|
type: "turn_start";
|
|
66
71
|
}) | ({
|
|
@@ -95,12 +100,61 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
95
100
|
role: "user" | "assistant" | "system";
|
|
96
101
|
seq: number;
|
|
97
102
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
103
|
+
subagent?: {
|
|
104
|
+
agentName?: string;
|
|
105
|
+
parentToolCallId?: string;
|
|
106
|
+
toolName: string;
|
|
107
|
+
};
|
|
98
108
|
tokens?: {
|
|
99
109
|
input: number;
|
|
100
110
|
output: number;
|
|
101
111
|
};
|
|
102
112
|
type: "turn_complete";
|
|
103
113
|
}) | {
|
|
114
|
+
executionId: string;
|
|
115
|
+
id: string;
|
|
116
|
+
iteration?: number;
|
|
117
|
+
model?: string;
|
|
118
|
+
ordinal: number;
|
|
119
|
+
provider?: string;
|
|
120
|
+
seq: number;
|
|
121
|
+
startedAt?: string;
|
|
122
|
+
stepId?: string;
|
|
123
|
+
subagent?: {
|
|
124
|
+
agentName?: string;
|
|
125
|
+
parentToolCallId?: string;
|
|
126
|
+
toolName: string;
|
|
127
|
+
};
|
|
128
|
+
turnId?: string;
|
|
129
|
+
type: "model_call_start";
|
|
130
|
+
} | {
|
|
131
|
+
completedAt?: string;
|
|
132
|
+
cost?: number;
|
|
133
|
+
durationMs?: number;
|
|
134
|
+
executionId: string;
|
|
135
|
+
finishReason?: string;
|
|
136
|
+
id: string;
|
|
137
|
+
iteration?: number;
|
|
138
|
+
model?: string;
|
|
139
|
+
ordinal: number;
|
|
140
|
+
provider?: string;
|
|
141
|
+
responseModel?: string;
|
|
142
|
+
seq: number;
|
|
143
|
+
subagent?: {
|
|
144
|
+
agentName?: string;
|
|
145
|
+
parentToolCallId?: string;
|
|
146
|
+
toolName: string;
|
|
147
|
+
};
|
|
148
|
+
success?: boolean;
|
|
149
|
+
tokens?: {
|
|
150
|
+
cacheRead?: number;
|
|
151
|
+
cacheWrite?: number;
|
|
152
|
+
input: number;
|
|
153
|
+
output: number;
|
|
154
|
+
};
|
|
155
|
+
turnId?: string;
|
|
156
|
+
type: "model_call_complete";
|
|
157
|
+
} | {
|
|
104
158
|
executionId: string;
|
|
105
159
|
id: string;
|
|
106
160
|
index?: number;
|
|
@@ -109,6 +163,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
109
163
|
seq: number;
|
|
110
164
|
startedAt?: string;
|
|
111
165
|
stepType?: string;
|
|
166
|
+
subagent?: {
|
|
167
|
+
agentName?: string;
|
|
168
|
+
parentToolCallId?: string;
|
|
169
|
+
toolName: string;
|
|
170
|
+
};
|
|
112
171
|
totalSteps?: number;
|
|
113
172
|
type: "step_start";
|
|
114
173
|
} | ({
|
|
@@ -136,6 +195,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
136
195
|
seq: number;
|
|
137
196
|
stepType?: string;
|
|
138
197
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
198
|
+
subagent?: {
|
|
199
|
+
agentName?: string;
|
|
200
|
+
parentToolCallId?: string;
|
|
201
|
+
toolName: string;
|
|
202
|
+
};
|
|
139
203
|
success?: boolean;
|
|
140
204
|
tokensUsed?: number;
|
|
141
205
|
type: "step_complete";
|
|
@@ -158,6 +222,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
158
222
|
role?: "user" | "assistant" | "system";
|
|
159
223
|
seq: number;
|
|
160
224
|
stepId?: string;
|
|
225
|
+
subagent?: {
|
|
226
|
+
agentName?: string;
|
|
227
|
+
parentToolCallId?: string;
|
|
228
|
+
toolName: string;
|
|
229
|
+
};
|
|
161
230
|
turnId?: string;
|
|
162
231
|
type: "text_start";
|
|
163
232
|
}) | {
|
|
@@ -165,11 +234,21 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
165
234
|
executionId: string;
|
|
166
235
|
id: string;
|
|
167
236
|
seq: number;
|
|
237
|
+
subagent?: {
|
|
238
|
+
agentName?: string;
|
|
239
|
+
parentToolCallId?: string;
|
|
240
|
+
toolName: string;
|
|
241
|
+
};
|
|
168
242
|
type: "text_delta";
|
|
169
243
|
} | {
|
|
170
244
|
executionId: string;
|
|
171
245
|
id: string;
|
|
172
246
|
seq: number;
|
|
247
|
+
subagent?: {
|
|
248
|
+
agentName?: string;
|
|
249
|
+
parentToolCallId?: string;
|
|
250
|
+
toolName: string;
|
|
251
|
+
};
|
|
173
252
|
text?: string;
|
|
174
253
|
type: "text_complete";
|
|
175
254
|
} | ({
|
|
@@ -178,18 +257,33 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
178
257
|
parentToolCallId?: string;
|
|
179
258
|
scope?: "turn" | "loop";
|
|
180
259
|
seq: number;
|
|
260
|
+
subagent?: {
|
|
261
|
+
agentName?: string;
|
|
262
|
+
parentToolCallId?: string;
|
|
263
|
+
toolName: string;
|
|
264
|
+
};
|
|
181
265
|
type: "reasoning_start";
|
|
182
266
|
}) | {
|
|
183
267
|
delta: string;
|
|
184
268
|
executionId: string;
|
|
185
269
|
id: string;
|
|
186
270
|
seq: number;
|
|
271
|
+
subagent?: {
|
|
272
|
+
agentName?: string;
|
|
273
|
+
parentToolCallId?: string;
|
|
274
|
+
toolName: string;
|
|
275
|
+
};
|
|
187
276
|
type: "reasoning_delta";
|
|
188
277
|
} | ({
|
|
189
278
|
executionId: string;
|
|
190
279
|
id: string;
|
|
191
280
|
scope?: "turn" | "loop";
|
|
192
281
|
seq: number;
|
|
282
|
+
subagent?: {
|
|
283
|
+
agentName?: string;
|
|
284
|
+
parentToolCallId?: string;
|
|
285
|
+
toolName: string;
|
|
286
|
+
};
|
|
193
287
|
text?: string;
|
|
194
288
|
type: "reasoning_complete";
|
|
195
289
|
}) | ({
|
|
@@ -282,6 +376,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
282
376
|
seq: number;
|
|
283
377
|
startedAt?: string;
|
|
284
378
|
stepId?: string;
|
|
379
|
+
subagent?: {
|
|
380
|
+
agentName?: string;
|
|
381
|
+
parentToolCallId?: string;
|
|
382
|
+
toolName: string;
|
|
383
|
+
};
|
|
285
384
|
toolCallId: string;
|
|
286
385
|
toolName: string;
|
|
287
386
|
toolType: string;
|
|
@@ -290,6 +389,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
290
389
|
delta: string;
|
|
291
390
|
executionId: string;
|
|
292
391
|
seq: number;
|
|
392
|
+
subagent?: {
|
|
393
|
+
agentName?: string;
|
|
394
|
+
parentToolCallId?: string;
|
|
395
|
+
toolName: string;
|
|
396
|
+
};
|
|
293
397
|
toolCallId: string;
|
|
294
398
|
type: "tool_input_delta";
|
|
295
399
|
} | {
|
|
@@ -297,6 +401,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
297
401
|
hiddenParameterNames?: Array<string>;
|
|
298
402
|
parameters: Record<string, unknown>;
|
|
299
403
|
seq: number;
|
|
404
|
+
subagent?: {
|
|
405
|
+
agentName?: string;
|
|
406
|
+
parentToolCallId?: string;
|
|
407
|
+
toolName: string;
|
|
408
|
+
};
|
|
300
409
|
toolCallId: string;
|
|
301
410
|
toolName?: string;
|
|
302
411
|
type: "tool_input_complete";
|
|
@@ -314,6 +423,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
314
423
|
result?: unknown;
|
|
315
424
|
seq: number;
|
|
316
425
|
stepId?: string;
|
|
426
|
+
subagent?: {
|
|
427
|
+
agentName?: string;
|
|
428
|
+
parentToolCallId?: string;
|
|
429
|
+
toolName: string;
|
|
430
|
+
};
|
|
317
431
|
success: boolean;
|
|
318
432
|
toolCallId: string;
|
|
319
433
|
toolCost?: number;
|
|
@@ -393,6 +507,19 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
393
507
|
recoverable?: boolean;
|
|
394
508
|
seq: number;
|
|
395
509
|
type: "error";
|
|
510
|
+
}) | ({
|
|
511
|
+
epoch: number;
|
|
512
|
+
executionId: string;
|
|
513
|
+
kind: "compaction";
|
|
514
|
+
outcome?: "ok" | "failed" | "gap" | "skipped";
|
|
515
|
+
phase: "start" | "complete";
|
|
516
|
+
reason: "threshold" | "overflow" | "manual" | "surface_policy" | "provider_mismatch";
|
|
517
|
+
seq: number;
|
|
518
|
+
strategy: "provider_native" | "summary";
|
|
519
|
+
tier: number;
|
|
520
|
+
tokensAfter?: number;
|
|
521
|
+
tokensBefore?: number;
|
|
522
|
+
type: "context_notice";
|
|
396
523
|
}) | {
|
|
397
524
|
executionId: string;
|
|
398
525
|
seq: number;
|
|
@@ -509,15 +636,15 @@ type AgentMessageMetadata = {
|
|
|
509
636
|
*/
|
|
510
637
|
parentStepId?: string;
|
|
511
638
|
/**
|
|
512
|
-
* Set to `true` on a tool-variant message produced from
|
|
639
|
+
* Set to `true` on a tool-variant message produced from an `await`
|
|
513
640
|
* event (`awaitReason: "local_tool_required"`). Signals to UI code that
|
|
514
641
|
* the tool call is a LOCAL tool and the server is paused waiting for a
|
|
515
642
|
* `POST /v1/dispatch/resume` with the user's answer keyed by tool name.
|
|
516
643
|
*/
|
|
517
644
|
awaitingLocalTool?: boolean;
|
|
518
645
|
/**
|
|
519
|
-
* The provider per-call id (`toolu_…`) carried on the `
|
|
520
|
-
*
|
|
646
|
+
* The provider per-call id (`toolu_…`) carried on the `await`
|
|
647
|
+
* event for a LOCAL tool (core#3878). Present only when the
|
|
521
648
|
* server emits it. Two PARALLEL calls to the same tool in one turn share a
|
|
522
649
|
* `toolName` (and a collapsed `toolId`) but get DISTINCT `webMcpToolCallId`s,
|
|
523
650
|
* so this is the key the widget batches a single `/resume` on: preferred
|
|
@@ -649,7 +776,7 @@ type AgentWidgetReasoning = {
|
|
|
649
776
|
/**
|
|
650
777
|
* Reasoning channel scope (wire spec). `"turn"` is ordinary per-turn
|
|
651
778
|
* thinking; `"loop"` is a cross-iteration agent reflection (the fold that
|
|
652
|
-
* replaced the legacy `agent_reflection` event).
|
|
779
|
+
* replaced the legacy `agent_reflection` event). Optional when the stream does not specify a scope.
|
|
653
780
|
*/
|
|
654
781
|
scope?: "turn" | "loop";
|
|
655
782
|
startedAt?: number;
|
|
@@ -663,6 +790,9 @@ type AgentWidgetToolCall = {
|
|
|
663
790
|
args?: unknown;
|
|
664
791
|
chunks?: string[];
|
|
665
792
|
result?: unknown;
|
|
793
|
+
/** Whether the tool succeeded; failure does not necessarily end the execution. */
|
|
794
|
+
success?: boolean;
|
|
795
|
+
error?: string;
|
|
666
796
|
duration?: number;
|
|
667
797
|
startedAt?: number;
|
|
668
798
|
completedAt?: number;
|
|
@@ -693,7 +823,7 @@ type AgentWidgetApproval = {
|
|
|
693
823
|
type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "approval";
|
|
694
824
|
/**
|
|
695
825
|
* Per-turn / per-step stop reason emitted by the runtime on
|
|
696
|
-
* `
|
|
826
|
+
* `turn_complete` and `step_complete` SSE events. The vocabulary is
|
|
697
827
|
* owned by the upstream Runtype API: do not extend without coordination.
|
|
698
828
|
*
|
|
699
829
|
* - `end_turn`: natural completion (no affordance needed)
|
|
@@ -824,7 +954,7 @@ type AgentWidgetMessage = {
|
|
|
824
954
|
*/
|
|
825
955
|
agentMetadata?: AgentMessageMetadata;
|
|
826
956
|
/**
|
|
827
|
-
* Per-turn stop reason reported by the runtime on `
|
|
957
|
+
* Per-turn stop reason reported by the runtime on `turn_complete`
|
|
828
958
|
* (agent-loop path) or the last `step_complete` for a prompt step
|
|
829
959
|
* (dispatch / flow path). Absent when the API did not report a value.
|
|
830
960
|
*
|