@linnlabs/linnkit 0.32.1 → 0.32.3

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 (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cli.cjs +35 -14
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +35 -14
  5. package/dist/cli.js.map +1 -1
  6. package/dist/contracts/agentSpec.d.cts +30 -30
  7. package/dist/contracts/agentSpec.d.ts +30 -30
  8. package/dist/contracts/audit.d.cts +24 -24
  9. package/dist/contracts/audit.d.ts +24 -24
  10. package/dist/contracts/contextPolicy.d.cts +36 -36
  11. package/dist/contracts/contextPolicy.d.ts +36 -36
  12. package/dist/contracts/events.d.cts +1080 -1080
  13. package/dist/contracts/events.d.ts +1080 -1080
  14. package/dist/contracts/execution.d.cts +8 -8
  15. package/dist/contracts/execution.d.ts +8 -8
  16. package/dist/contracts/messages.d.cts +1178 -1178
  17. package/dist/contracts/messages.d.ts +1178 -1178
  18. package/dist/contracts/provider-continuation.d.cts +28 -28
  19. package/dist/contracts/provider-continuation.d.ts +28 -28
  20. package/dist/contracts/sse.d.cts +897 -897
  21. package/dist/contracts/sse.d.ts +897 -897
  22. package/dist/contracts/sub-run-trace-payload.d.cts +26 -26
  23. package/dist/contracts/sub-run-trace-payload.d.ts +26 -26
  24. package/dist/contracts/token-accounting.d.cts +30 -30
  25. package/dist/contracts/token-accounting.d.ts +30 -30
  26. package/dist/index.cjs +35 -14
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.js +35 -14
  29. package/dist/index.js.map +1 -1
  30. package/dist/quickstart.cjs +35 -14
  31. package/dist/quickstart.cjs.map +1 -1
  32. package/dist/quickstart.js +35 -14
  33. package/dist/quickstart.js.map +1 -1
  34. package/dist/runtime-kernel/events/agentEvents.d.cts +172 -172
  35. package/dist/runtime-kernel/events/agentEvents.d.ts +172 -172
  36. package/dist/runtime-kernel.cjs +35 -14
  37. package/dist/runtime-kernel.cjs.map +1 -1
  38. package/dist/runtime-kernel.js +35 -14
  39. package/dist/runtime-kernel.js.map +1 -1
  40. package/dist/testkit.cjs +35 -14
  41. package/dist/testkit.cjs.map +1 -1
  42. package/dist/testkit.js +35 -14
  43. package/dist/testkit.js.map +1 -1
  44. package/docs/integration/01-installation.md +1 -1
  45. package/package.json +4 -4
@@ -16,24 +16,24 @@ declare const BaseSSEEvent: z.ZodObject<{
16
16
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
17
17
  }, "strip", z.ZodTypeAny, {
18
18
  id: string;
19
- conversation_id: string;
20
19
  timestamp: number;
20
+ conversation_id: string;
21
21
  turn_id: string;
22
22
  metadata?: Record<string, SerializableJsonValue> | undefined;
23
23
  run_id?: (string & z.BRAND<"RunId">) | undefined;
24
24
  lane?: "foreground" | "auxiliary" | "child" | undefined;
25
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
25
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
26
26
  execution_id?: string | undefined;
27
27
  execution_seq?: number | undefined;
28
28
  }, {
29
29
  id: string;
30
- conversation_id: string;
31
30
  timestamp: number;
31
+ conversation_id: string;
32
32
  turn_id: string;
33
33
  metadata?: Record<string, SerializableJsonValue> | undefined;
34
34
  run_id?: string | undefined;
35
35
  lane?: "foreground" | "auxiliary" | "child" | undefined;
36
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
36
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
37
37
  execution_id?: string | undefined;
38
38
  execution_seq?: number | undefined;
39
39
  }>;
@@ -75,32 +75,32 @@ declare const SSEThoughtEvent: z.ZodObject<{
75
75
  content: z.ZodOptional<z.ZodString>;
76
76
  is_complete: z.ZodDefault<z.ZodBoolean>;
77
77
  }, "strip", z.ZodTypeAny, {
78
- type: "thought";
79
78
  id: string;
80
- conversation_id: string;
79
+ type: "thought";
81
80
  timestamp: number;
81
+ conversation_id: string;
82
82
  turn_id: string;
83
83
  is_complete: boolean;
84
+ content?: string | undefined;
84
85
  metadata?: Record<string, SerializableJsonValue> | undefined;
85
86
  run_id?: (string & z.BRAND<"RunId">) | undefined;
86
87
  lane?: "foreground" | "auxiliary" | "child" | undefined;
87
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
88
- content?: string | undefined;
88
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
89
89
  thought_message_id?: string | undefined;
90
90
  delta?: string | undefined;
91
91
  execution_id?: string | undefined;
92
92
  execution_seq?: number | undefined;
93
93
  }, {
94
- type: "thought";
95
94
  id: string;
96
- conversation_id: string;
95
+ type: "thought";
97
96
  timestamp: number;
97
+ conversation_id: string;
98
98
  turn_id: string;
99
+ content?: string | undefined;
99
100
  metadata?: Record<string, SerializableJsonValue> | undefined;
100
101
  run_id?: string | undefined;
101
102
  lane?: "foreground" | "auxiliary" | "child" | undefined;
102
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
103
- content?: string | undefined;
103
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
104
104
  thought_message_id?: string | undefined;
105
105
  delta?: string | undefined;
106
106
  is_complete?: boolean | undefined;
@@ -126,10 +126,10 @@ declare const SSEFinalAnswerChunkEvent: z.ZodObject<{
126
126
  chunk: z.ZodString;
127
127
  is_last: z.ZodOptional<z.ZodBoolean>;
128
128
  }, "strip", z.ZodTypeAny, {
129
- type: "final_answer_chunk";
130
129
  id: string;
131
- conversation_id: string;
130
+ type: "final_answer_chunk";
132
131
  timestamp: number;
132
+ conversation_id: string;
133
133
  turn_id: string;
134
134
  answer_id: string;
135
135
  seq: number;
@@ -137,15 +137,15 @@ declare const SSEFinalAnswerChunkEvent: z.ZodObject<{
137
137
  metadata?: Record<string, SerializableJsonValue> | undefined;
138
138
  run_id?: (string & z.BRAND<"RunId">) | undefined;
139
139
  lane?: "foreground" | "auxiliary" | "child" | undefined;
140
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
140
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
141
141
  is_last?: boolean | undefined;
142
142
  execution_id?: string | undefined;
143
143
  execution_seq?: number | undefined;
144
144
  }, {
145
- type: "final_answer_chunk";
146
145
  id: string;
147
- conversation_id: string;
146
+ type: "final_answer_chunk";
148
147
  timestamp: number;
148
+ conversation_id: string;
149
149
  turn_id: string;
150
150
  answer_id: string;
151
151
  seq: number;
@@ -153,7 +153,7 @@ declare const SSEFinalAnswerChunkEvent: z.ZodObject<{
153
153
  metadata?: Record<string, SerializableJsonValue> | undefined;
154
154
  run_id?: string | undefined;
155
155
  lane?: "foreground" | "auxiliary" | "child" | undefined;
156
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
156
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
157
157
  is_last?: boolean | undefined;
158
158
  execution_id?: string | undefined;
159
159
  execution_seq?: number | undefined;
@@ -175,29 +175,29 @@ declare const SSEFinalAnswerResetEvent: z.ZodObject<{
175
175
  answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
176
176
  thought_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
177
177
  }, "strip", z.ZodTypeAny, {
178
- type: "final_answer_reset";
179
178
  id: string;
180
- conversation_id: string;
179
+ type: "final_answer_reset";
181
180
  timestamp: number;
181
+ conversation_id: string;
182
182
  turn_id: string;
183
183
  metadata?: Record<string, SerializableJsonValue> | undefined;
184
184
  run_id?: (string & z.BRAND<"RunId">) | undefined;
185
185
  lane?: "foreground" | "auxiliary" | "child" | undefined;
186
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
186
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
187
187
  answer_id?: string | undefined;
188
188
  thought_message_ids?: string[] | undefined;
189
189
  execution_id?: string | undefined;
190
190
  execution_seq?: number | undefined;
191
191
  }, {
192
- type: "final_answer_reset";
193
192
  id: string;
194
- conversation_id: string;
193
+ type: "final_answer_reset";
195
194
  timestamp: number;
195
+ conversation_id: string;
196
196
  turn_id: string;
197
197
  metadata?: Record<string, SerializableJsonValue> | undefined;
198
198
  run_id?: string | undefined;
199
199
  lane?: "foreground" | "auxiliary" | "child" | undefined;
200
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
200
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
201
201
  answer_id?: string | undefined;
202
202
  thought_message_ids?: string[] | undefined;
203
203
  execution_id?: string | undefined;
@@ -222,34 +222,34 @@ declare const SSEFinalAnswerEvent: z.ZodObject<{
222
222
  completion_reason: z.ZodEnum<["terminal", "tool_call", "interrupted"]>;
223
223
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
224
224
  }, "strip", z.ZodTypeAny, {
225
- type: "final_answer";
226
225
  id: string;
227
- conversation_id: string;
226
+ type: "final_answer";
227
+ completion_reason: "tool_call" | "terminal" | "interrupted";
228
+ content: string;
228
229
  timestamp: number;
230
+ conversation_id: string;
229
231
  turn_id: string;
230
- content: string;
231
232
  answer_id: string;
232
- completion_reason: "tool_call" | "terminal" | "interrupted";
233
233
  metadata?: Record<string, SerializableJsonValue> | undefined;
234
234
  run_id?: (string & z.BRAND<"RunId">) | undefined;
235
235
  lane?: "foreground" | "auxiliary" | "child" | undefined;
236
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
236
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
237
237
  meta?: Record<string, SerializableJsonValue> | undefined;
238
238
  execution_id?: string | undefined;
239
239
  execution_seq?: number | undefined;
240
240
  }, {
241
- type: "final_answer";
242
241
  id: string;
243
- conversation_id: string;
242
+ type: "final_answer";
243
+ completion_reason: "tool_call" | "terminal" | "interrupted";
244
+ content: string;
244
245
  timestamp: number;
246
+ conversation_id: string;
245
247
  turn_id: string;
246
- content: string;
247
248
  answer_id: string;
248
- completion_reason: "tool_call" | "terminal" | "interrupted";
249
249
  metadata?: Record<string, SerializableJsonValue> | undefined;
250
250
  run_id?: string | undefined;
251
251
  lane?: "foreground" | "auxiliary" | "child" | undefined;
252
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
252
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
253
253
  meta?: Record<string, SerializableJsonValue> | undefined;
254
254
  execution_id?: string | undefined;
255
255
  execution_seq?: number | undefined;
@@ -272,35 +272,35 @@ declare const SSEMarkdownChunkEvent: z.ZodObject<{
272
272
  text: z.ZodString;
273
273
  seq: z.ZodOptional<z.ZodNumber>;
274
274
  }, "strip", z.ZodTypeAny, {
275
- type: "markdown_chunk";
276
275
  id: string;
277
- conversation_id: string;
276
+ type: "markdown_chunk";
277
+ text: string;
278
278
  timestamp: number;
279
+ conversation_id: string;
279
280
  turn_id: string;
280
- text: string;
281
- content_type: "code" | "image" | "text" | "table";
281
+ content_type: "code" | "text" | "image" | "table";
282
282
  metadata?: Record<string, SerializableJsonValue> | undefined;
283
283
  run_id?: (string & z.BRAND<"RunId">) | undefined;
284
284
  lane?: "foreground" | "auxiliary" | "child" | undefined;
285
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
285
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
286
286
  seq?: number | undefined;
287
287
  execution_id?: string | undefined;
288
288
  execution_seq?: number | undefined;
289
289
  }, {
290
- type: "markdown_chunk";
291
290
  id: string;
292
- conversation_id: string;
291
+ type: "markdown_chunk";
292
+ text: string;
293
293
  timestamp: number;
294
+ conversation_id: string;
294
295
  turn_id: string;
295
- text: string;
296
296
  metadata?: Record<string, SerializableJsonValue> | undefined;
297
297
  run_id?: string | undefined;
298
298
  lane?: "foreground" | "auxiliary" | "child" | undefined;
299
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
299
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
300
300
  seq?: number | undefined;
301
301
  execution_id?: string | undefined;
302
302
  execution_seq?: number | undefined;
303
- content_type?: "code" | "image" | "text" | "table" | undefined;
303
+ content_type?: "code" | "text" | "image" | "table" | undefined;
304
304
  }>;
305
305
  type SSEMarkdownChunkEvent = z.infer<typeof SSEMarkdownChunkEvent>;
306
306
  declare const SSEToolCallDecisionEvent: z.ZodObject<{
@@ -325,40 +325,40 @@ declare const SSEToolCallDecisionEvent: z.ZodObject<{
325
325
  } & {
326
326
  type: z.ZodLiteral<"tool_call_decision">;
327
327
  }, "strip", z.ZodTypeAny, {
328
- type: "tool_call_decision";
329
328
  id: string;
330
- conversation_id: string;
331
- timestamp: number;
329
+ type: "tool_call_decision";
332
330
  status: "error" | "loading" | "success";
333
- turn_id: string;
334
- tool_name: string;
335
331
  tool_call_id: string & z.BRAND<"ToolCallId">;
336
- phase: "start" | "update" | "complete" | "error";
332
+ tool_name: string;
333
+ timestamp: number;
334
+ conversation_id: string;
335
+ turn_id: string;
336
+ phase: "error" | "start" | "update" | "complete";
337
+ payload?: SerializableJsonValue | undefined;
338
+ args?: SerializableJsonValue | undefined;
337
339
  metadata?: Record<string, SerializableJsonValue> | undefined;
338
340
  run_id?: (string & z.BRAND<"RunId">) | undefined;
339
341
  lane?: "foreground" | "auxiliary" | "child" | undefined;
340
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
341
- args?: SerializableJsonValue | undefined;
342
- payload?: SerializableJsonValue | undefined;
342
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
343
343
  meta?: Record<string, SerializableJsonValue> | undefined;
344
344
  execution_id?: string | undefined;
345
345
  execution_seq?: number | undefined;
346
346
  }, {
347
- type: "tool_call_decision";
348
347
  id: string;
349
- conversation_id: string;
350
- timestamp: number;
348
+ type: "tool_call_decision";
351
349
  status: "error" | "loading" | "success";
352
- turn_id: string;
353
- tool_name: string;
354
350
  tool_call_id: string;
355
- phase: "start" | "update" | "complete" | "error";
351
+ tool_name: string;
352
+ timestamp: number;
353
+ conversation_id: string;
354
+ turn_id: string;
355
+ phase: "error" | "start" | "update" | "complete";
356
+ payload?: SerializableJsonValue | undefined;
357
+ args?: SerializableJsonValue | undefined;
356
358
  metadata?: Record<string, SerializableJsonValue> | undefined;
357
359
  run_id?: string | undefined;
358
360
  lane?: "foreground" | "auxiliary" | "child" | undefined;
359
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
360
- args?: SerializableJsonValue | undefined;
361
- payload?: SerializableJsonValue | undefined;
361
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
362
362
  meta?: Record<string, SerializableJsonValue> | undefined;
363
363
  execution_id?: string | undefined;
364
364
  execution_seq?: number | undefined;
@@ -386,40 +386,40 @@ declare const SSEToolProcessEvent: z.ZodObject<{
386
386
  } & {
387
387
  type: z.ZodLiteral<"tool_process">;
388
388
  }, "strip", z.ZodTypeAny, {
389
- type: "tool_process";
390
389
  id: string;
391
- conversation_id: string;
392
- timestamp: number;
390
+ type: "tool_process";
393
391
  status: "error" | "loading" | "success";
394
- turn_id: string;
395
- tool_name: string;
396
392
  tool_call_id: string & z.BRAND<"ToolCallId">;
397
- phase: "start" | "update" | "complete" | "error";
393
+ tool_name: string;
394
+ timestamp: number;
395
+ conversation_id: string;
396
+ turn_id: string;
397
+ phase: "error" | "start" | "update" | "complete";
398
+ payload?: SerializableJsonValue | undefined;
399
+ args?: SerializableJsonValue | undefined;
398
400
  metadata?: Record<string, SerializableJsonValue> | undefined;
399
401
  run_id?: (string & z.BRAND<"RunId">) | undefined;
400
402
  lane?: "foreground" | "auxiliary" | "child" | undefined;
401
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
402
- args?: SerializableJsonValue | undefined;
403
- payload?: SerializableJsonValue | undefined;
403
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
404
404
  meta?: Record<string, SerializableJsonValue> | undefined;
405
405
  execution_id?: string | undefined;
406
406
  execution_seq?: number | undefined;
407
407
  }, {
408
- type: "tool_process";
409
408
  id: string;
410
- conversation_id: string;
411
- timestamp: number;
409
+ type: "tool_process";
412
410
  status: "error" | "loading" | "success";
413
- turn_id: string;
414
- tool_name: string;
415
411
  tool_call_id: string;
416
- phase: "start" | "update" | "complete" | "error";
412
+ tool_name: string;
413
+ timestamp: number;
414
+ conversation_id: string;
415
+ turn_id: string;
416
+ phase: "error" | "start" | "update" | "complete";
417
+ payload?: SerializableJsonValue | undefined;
418
+ args?: SerializableJsonValue | undefined;
417
419
  metadata?: Record<string, SerializableJsonValue> | undefined;
418
420
  run_id?: string | undefined;
419
421
  lane?: "foreground" | "auxiliary" | "child" | undefined;
420
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
421
- args?: SerializableJsonValue | undefined;
422
- payload?: SerializableJsonValue | undefined;
422
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
423
423
  meta?: Record<string, SerializableJsonValue> | undefined;
424
424
  execution_id?: string | undefined;
425
425
  execution_seq?: number | undefined;
@@ -481,19 +481,18 @@ declare const SSEToolOutputEvent: z.ZodObject<{
481
481
  label?: string | undefined;
482
482
  }>, "many">>;
483
483
  }, "strip", z.ZodTypeAny, {
484
- type: "tool_output";
485
484
  id: string;
486
- conversation_id: string;
487
- timestamp: number;
485
+ type: "tool_output";
488
486
  status: "error" | "success";
489
- turn_id: string;
490
- tool_name: string;
491
487
  tool_call_id: string & z.BRAND<"ToolCallId">;
488
+ tool_name: string;
489
+ timestamp: number;
490
+ conversation_id: string;
491
+ turn_id: string;
492
492
  observation: string;
493
+ data?: SerializableJsonValue | undefined;
494
+ error?: string | undefined;
493
495
  metadata?: Record<string, SerializableJsonValue> | undefined;
494
- run_id?: (string & z.BRAND<"RunId">) | undefined;
495
- lane?: "foreground" | "auxiliary" | "child" | undefined;
496
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
497
496
  attachments?: {
498
497
  id: string;
499
498
  kind: "image";
@@ -506,26 +505,26 @@ declare const SSEToolOutputEvent: z.ZodObject<{
506
505
  fileName?: string | undefined;
507
506
  label?: string | undefined;
508
507
  }[] | undefined;
509
- error?: string | undefined;
510
- data?: SerializableJsonValue | undefined;
508
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
509
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
510
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
511
511
  error_code?: string | undefined;
512
512
  duration_ms?: number | undefined;
513
513
  execution_id?: string | undefined;
514
514
  execution_seq?: number | undefined;
515
515
  }, {
516
- type: "tool_output";
517
516
  id: string;
518
- conversation_id: string;
519
- timestamp: number;
517
+ type: "tool_output";
520
518
  status: "error" | "success";
521
- turn_id: string;
522
- tool_name: string;
523
519
  tool_call_id: string;
520
+ tool_name: string;
521
+ timestamp: number;
522
+ conversation_id: string;
523
+ turn_id: string;
524
524
  observation: string;
525
+ data?: SerializableJsonValue | undefined;
526
+ error?: string | undefined;
525
527
  metadata?: Record<string, SerializableJsonValue> | undefined;
526
- run_id?: string | undefined;
527
- lane?: "foreground" | "auxiliary" | "child" | undefined;
528
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
529
528
  attachments?: {
530
529
  id: string;
531
530
  kind: "image";
@@ -538,8 +537,9 @@ declare const SSEToolOutputEvent: z.ZodObject<{
538
537
  fileName?: string | undefined;
539
538
  label?: string | undefined;
540
539
  }[] | undefined;
541
- error?: string | undefined;
542
- data?: SerializableJsonValue | undefined;
540
+ run_id?: string | undefined;
541
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
542
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
543
543
  error_code?: string | undefined;
544
544
  duration_ms?: number | undefined;
545
545
  execution_id?: string | undefined;
@@ -579,12 +579,12 @@ declare const SSESubRunTraceEvent: z.ZodObject<{
579
579
  tool_name: z.ZodString;
580
580
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
581
581
  }, "strict", z.ZodTypeAny, {
582
- tool_name: string;
583
582
  tool_call_id: string & z.BRAND<"ToolCallId">;
583
+ tool_name: string;
584
584
  args: Record<string, SerializableJsonValue>;
585
585
  }, {
586
- tool_name: string;
587
586
  tool_call_id: string;
587
+ tool_name: string;
588
588
  args: Record<string, SerializableJsonValue>;
589
589
  }>, "many">>;
590
590
  output: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
@@ -630,21 +630,27 @@ declare const SSESubRunTraceEvent: z.ZodObject<{
630
630
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
631
631
  type: z.ZodLiteral<"subrun_trace">;
632
632
  }, "strip", z.ZodTypeAny, {
633
- type: "subrun_trace";
634
633
  id: string;
635
- conversation_id: string;
634
+ type: "subrun_trace";
635
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
636
636
  timestamp: number;
637
+ conversation_id: string;
637
638
  turn_id: string;
638
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
639
639
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
640
640
  subrun_id: string;
641
641
  source_event_id: string;
642
642
  status?: "error" | "loading" | "success" | undefined;
643
- metadata?: Record<string, SerializableJsonValue> | undefined;
644
- run_id?: (string & z.BRAND<"RunId">) | undefined;
645
- lane?: "foreground" | "auxiliary" | "child" | undefined;
646
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
643
+ tool_calls?: {
644
+ tool_call_id: string & z.BRAND<"ToolCallId">;
645
+ tool_name: string;
646
+ args: Record<string, SerializableJsonValue>;
647
+ }[] | undefined;
648
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
649
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
650
+ tool_name?: string | undefined;
651
+ args?: Record<string, SerializableJsonValue> | undefined;
647
652
  content?: string | undefined;
653
+ metadata?: Record<string, SerializableJsonValue> | undefined;
648
654
  attachments?: {
649
655
  id: string;
650
656
  kind: "image";
@@ -657,23 +663,17 @@ declare const SSESubRunTraceEvent: z.ZodObject<{
657
663
  fileName?: string | undefined;
658
664
  label?: string | undefined;
659
665
  }[] | undefined;
666
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
667
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
668
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
660
669
  delta?: string | undefined;
661
- tool_name?: string | undefined;
662
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
663
- phase?: "start" | "update" | "complete" | "error" | undefined;
664
- args?: Record<string, SerializableJsonValue> | undefined;
665
- tool_calls?: {
666
- tool_name: string;
667
- tool_call_id: string & z.BRAND<"ToolCallId">;
668
- args: Record<string, SerializableJsonValue>;
669
- }[] | undefined;
670
+ phase?: "error" | "start" | "update" | "complete" | undefined;
670
671
  meta?: Record<string, SerializableJsonValue> | undefined;
671
672
  duration_ms?: number | undefined;
672
673
  subrun_parent_id?: string | undefined;
673
674
  answer_id?: string | undefined;
674
675
  seq?: number | undefined;
675
676
  is_last?: boolean | undefined;
676
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
677
677
  output?: SerializableJsonValue | undefined;
678
678
  original_message_count?: number | undefined;
679
679
  compression_ratio?: number | undefined;
@@ -682,21 +682,27 @@ declare const SSESubRunTraceEvent: z.ZodObject<{
682
682
  execution_id?: string | undefined;
683
683
  execution_seq?: number | undefined;
684
684
  }, {
685
- type: "subrun_trace";
686
685
  id: string;
687
- conversation_id: string;
686
+ type: "subrun_trace";
687
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
688
688
  timestamp: number;
689
+ conversation_id: string;
689
690
  turn_id: string;
690
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
691
691
  parent_tool_call_id: string;
692
692
  subrun_id: string;
693
693
  source_event_id: string;
694
694
  status?: "error" | "loading" | "success" | undefined;
695
- metadata?: Record<string, SerializableJsonValue> | undefined;
696
- run_id?: string | undefined;
697
- lane?: "foreground" | "auxiliary" | "child" | undefined;
698
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
695
+ tool_calls?: {
696
+ tool_call_id: string;
697
+ tool_name: string;
698
+ args: Record<string, SerializableJsonValue>;
699
+ }[] | undefined;
700
+ tool_call_id?: string | undefined;
701
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
702
+ tool_name?: string | undefined;
703
+ args?: Record<string, SerializableJsonValue> | undefined;
699
704
  content?: string | undefined;
705
+ metadata?: Record<string, SerializableJsonValue> | undefined;
700
706
  attachments?: {
701
707
  id: string;
702
708
  kind: "image";
@@ -709,23 +715,17 @@ declare const SSESubRunTraceEvent: z.ZodObject<{
709
715
  fileName?: string | undefined;
710
716
  label?: string | undefined;
711
717
  }[] | undefined;
718
+ run_id?: string | undefined;
719
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
720
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
712
721
  delta?: string | undefined;
713
- tool_name?: string | undefined;
714
- tool_call_id?: string | undefined;
715
- phase?: "start" | "update" | "complete" | "error" | undefined;
716
- args?: Record<string, SerializableJsonValue> | undefined;
717
- tool_calls?: {
718
- tool_name: string;
719
- tool_call_id: string;
720
- args: Record<string, SerializableJsonValue>;
721
- }[] | undefined;
722
+ phase?: "error" | "start" | "update" | "complete" | undefined;
722
723
  meta?: Record<string, SerializableJsonValue> | undefined;
723
724
  duration_ms?: number | undefined;
724
725
  subrun_parent_id?: string | undefined;
725
726
  answer_id?: string | undefined;
726
727
  seq?: number | undefined;
727
728
  is_last?: boolean | undefined;
728
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
729
729
  output?: SerializableJsonValue | undefined;
730
730
  original_message_count?: number | undefined;
731
731
  compression_ratio?: number | undefined;
@@ -757,40 +757,40 @@ declare const SSERequiresUserInteractionEvent: z.ZodObject<{
757
757
  resume_token: z.ZodEffects<z.ZodString, string, string>;
758
758
  interaction_status: z.ZodLiteral<"pending">;
759
759
  }, "strip", z.ZodTypeAny, {
760
- type: "requires_user_interaction";
761
760
  id: string;
762
- conversation_id: string;
761
+ type: "requires_user_interaction";
762
+ tool_call_id: string & z.BRAND<"ToolCallId">;
763
763
  timestamp: number;
764
- turn_id: string;
765
764
  run_id: string & z.BRAND<"RunId">;
766
- tool_call_id: string & z.BRAND<"ToolCallId">;
765
+ conversation_id: string;
766
+ turn_id: string;
767
767
  interaction_id: string;
768
768
  checkpoint_revision: number;
769
769
  resume_token: string;
770
770
  interaction_status: "pending";
771
771
  metadata?: Record<string, SerializableJsonValue> | undefined;
772
772
  lane?: "foreground" | "auxiliary" | "child" | undefined;
773
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
773
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
774
774
  form?: SerializableJsonValue | undefined;
775
775
  interaction_type?: string | undefined;
776
776
  prompt?: string | undefined;
777
777
  execution_id?: string | undefined;
778
778
  execution_seq?: number | undefined;
779
779
  }, {
780
- type: "requires_user_interaction";
781
780
  id: string;
782
- conversation_id: string;
781
+ type: "requires_user_interaction";
782
+ tool_call_id: string;
783
783
  timestamp: number;
784
- turn_id: string;
785
784
  run_id: string;
786
- tool_call_id: string;
785
+ conversation_id: string;
786
+ turn_id: string;
787
787
  interaction_id: string;
788
788
  checkpoint_revision: number;
789
789
  resume_token: string;
790
790
  interaction_status: "pending";
791
791
  metadata?: Record<string, SerializableJsonValue> | undefined;
792
792
  lane?: "foreground" | "auxiliary" | "child" | undefined;
793
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
793
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
794
794
  form?: SerializableJsonValue | undefined;
795
795
  interaction_type?: string | undefined;
796
796
  prompt?: string | undefined;
@@ -816,32 +816,32 @@ declare const SSEErrorEvent: z.ZodObject<{
816
816
  error_code: z.ZodOptional<z.ZodString>;
817
817
  retryable: z.ZodOptional<z.ZodBoolean>;
818
818
  }, "strip", z.ZodTypeAny, {
819
- type: "error";
820
819
  id: string;
821
- conversation_id: string;
820
+ type: "error";
821
+ error: string;
822
822
  timestamp: number;
823
+ conversation_id: string;
823
824
  turn_id: string;
824
- error: string;
825
825
  metadata?: Record<string, SerializableJsonValue> | undefined;
826
826
  run_id?: (string & z.BRAND<"RunId">) | undefined;
827
827
  lane?: "foreground" | "auxiliary" | "child" | undefined;
828
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
828
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
829
829
  error_code?: string | undefined;
830
830
  details?: SerializableJsonValue | undefined;
831
831
  retryable?: boolean | undefined;
832
832
  execution_id?: string | undefined;
833
833
  execution_seq?: number | undefined;
834
834
  }, {
835
- type: "error";
836
835
  id: string;
837
- conversation_id: string;
836
+ type: "error";
837
+ error: string;
838
838
  timestamp: number;
839
+ conversation_id: string;
839
840
  turn_id: string;
840
- error: string;
841
841
  metadata?: Record<string, SerializableJsonValue> | undefined;
842
842
  run_id?: string | undefined;
843
843
  lane?: "foreground" | "auxiliary" | "child" | undefined;
844
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
844
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
845
845
  error_code?: string | undefined;
846
846
  details?: SerializableJsonValue | undefined;
847
847
  retryable?: boolean | undefined;
@@ -872,33 +872,33 @@ declare const SSETransportErrorEvent: z.ZodObject<{
872
872
  error_code: z.ZodOptional<z.ZodString>;
873
873
  retryable: z.ZodOptional<z.ZodBoolean>;
874
874
  }, "strip", z.ZodTypeAny, {
875
- type: "transport_error";
876
875
  id: string;
877
- conversation_id: string;
876
+ type: "transport_error";
877
+ error: string;
878
878
  timestamp: number;
879
+ conversation_id: string;
879
880
  turn_id: string;
880
- error: string;
881
881
  execution_id: string;
882
882
  metadata?: Record<string, SerializableJsonValue> | undefined;
883
883
  run_id?: (string & z.BRAND<"RunId">) | undefined;
884
884
  lane?: "foreground" | "auxiliary" | "child" | undefined;
885
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
885
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
886
886
  error_code?: string | undefined;
887
887
  details?: SerializableJsonValue | undefined;
888
888
  retryable?: boolean | undefined;
889
889
  execution_seq?: number | undefined;
890
890
  }, {
891
- type: "transport_error";
892
891
  id: string;
893
- conversation_id: string;
892
+ type: "transport_error";
893
+ error: string;
894
894
  timestamp: number;
895
+ conversation_id: string;
895
896
  turn_id: string;
896
- error: string;
897
897
  execution_id: string;
898
898
  metadata?: Record<string, SerializableJsonValue> | undefined;
899
899
  run_id?: string | undefined;
900
900
  lane?: "foreground" | "auxiliary" | "child" | undefined;
901
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
901
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
902
902
  error_code?: string | undefined;
903
903
  details?: SerializableJsonValue | undefined;
904
904
  retryable?: boolean | undefined;
@@ -1014,10 +1014,10 @@ declare const SSEContextUsageSnapshotEvent: z.ZodObject<{
1014
1014
  served_model_id?: string | undefined;
1015
1015
  }>;
1016
1016
  }, "strip", z.ZodTypeAny, {
1017
- type: "context_usage_snapshot";
1018
1017
  id: string;
1019
- conversation_id: string;
1018
+ type: "context_usage_snapshot";
1020
1019
  timestamp: number;
1020
+ conversation_id: string;
1021
1021
  turn_id: string;
1022
1022
  context_usage: {
1023
1023
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -1040,15 +1040,15 @@ declare const SSEContextUsageSnapshotEvent: z.ZodObject<{
1040
1040
  metadata?: Record<string, SerializableJsonValue> | undefined;
1041
1041
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1042
1042
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1043
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1043
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1044
1044
  user_message_id?: string | undefined;
1045
1045
  execution_id?: string | undefined;
1046
1046
  execution_seq?: number | undefined;
1047
1047
  }, {
1048
- type: "context_usage_snapshot";
1049
1048
  id: string;
1050
- conversation_id: string;
1049
+ type: "context_usage_snapshot";
1051
1050
  timestamp: number;
1051
+ conversation_id: string;
1052
1052
  turn_id: string;
1053
1053
  context_usage: {
1054
1054
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -1071,7 +1071,7 @@ declare const SSEContextUsageSnapshotEvent: z.ZodObject<{
1071
1071
  metadata?: Record<string, SerializableJsonValue> | undefined;
1072
1072
  run_id?: string | undefined;
1073
1073
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1074
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1074
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1075
1075
  user_message_id?: string | undefined;
1076
1076
  execution_id?: string | undefined;
1077
1077
  execution_seq?: number | undefined;
@@ -1188,18 +1188,18 @@ declare const SSERunExecutionMetricsEvent: z.ZodObject<{
1188
1188
  served_model_id?: string | undefined;
1189
1189
  }>>;
1190
1190
  }, "strip", z.ZodTypeAny, {
1191
- type: "run_execution_metrics";
1192
1191
  id: string;
1193
- conversation_id: string;
1192
+ type: "run_execution_metrics";
1194
1193
  timestamp: number;
1194
+ conversation_id: string;
1195
1195
  turn_id: string;
1196
1196
  duration_ms: number;
1197
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
1197
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
1198
1198
  execution_id: string;
1199
1199
  metadata?: Record<string, SerializableJsonValue> | undefined;
1200
1200
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1201
1201
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1202
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1202
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1203
1203
  user_message_id?: string | undefined;
1204
1204
  context_usage?: {
1205
1205
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -1221,18 +1221,18 @@ declare const SSERunExecutionMetricsEvent: z.ZodObject<{
1221
1221
  } | undefined;
1222
1222
  execution_seq?: number | undefined;
1223
1223
  }, {
1224
- type: "run_execution_metrics";
1225
1224
  id: string;
1226
- conversation_id: string;
1225
+ type: "run_execution_metrics";
1227
1226
  timestamp: number;
1227
+ conversation_id: string;
1228
1228
  turn_id: string;
1229
1229
  duration_ms: number;
1230
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
1230
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
1231
1231
  execution_id: string;
1232
1232
  metadata?: Record<string, SerializableJsonValue> | undefined;
1233
1233
  run_id?: string | undefined;
1234
1234
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1235
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1235
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1236
1236
  user_message_id?: string | undefined;
1237
1237
  context_usage?: {
1238
1238
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -1271,31 +1271,31 @@ declare const SSERunStatusEvent: z.ZodObject<{
1271
1271
  status: z.ZodEnum<["pending", "running", "awaiting_user", "paused", "completed", "failed", "cancelled"]>;
1272
1272
  reason_message: z.ZodOptional<z.ZodString>;
1273
1273
  }, "strip", z.ZodTypeAny, {
1274
- type: "run_status";
1275
1274
  id: string;
1276
- conversation_id: string;
1275
+ type: "run_status";
1276
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
1277
1277
  timestamp: number;
1278
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
1279
- turn_id: string;
1280
1278
  run_id: string & z.BRAND<"RunId">;
1279
+ conversation_id: string;
1280
+ turn_id: string;
1281
1281
  execution_id: string;
1282
1282
  metadata?: Record<string, SerializableJsonValue> | undefined;
1283
1283
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1284
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1284
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1285
1285
  execution_seq?: number | undefined;
1286
1286
  reason_message?: string | undefined;
1287
1287
  }, {
1288
- type: "run_status";
1289
1288
  id: string;
1290
- conversation_id: string;
1289
+ type: "run_status";
1290
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
1291
1291
  timestamp: number;
1292
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
1293
- turn_id: string;
1294
1292
  run_id: string;
1293
+ conversation_id: string;
1294
+ turn_id: string;
1295
1295
  execution_id: string;
1296
1296
  metadata?: Record<string, SerializableJsonValue> | undefined;
1297
1297
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1298
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1298
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1299
1299
  execution_seq?: number | undefined;
1300
1300
  reason_message?: string | undefined;
1301
1301
  }>;
@@ -1316,31 +1316,31 @@ declare const SSETransportEndEvent: z.ZodObject<{
1316
1316
  reason: z.ZodOptional<z.ZodEnum<["complete", "error", "interrupted", "timeout"]>>;
1317
1317
  reason_message: z.ZodOptional<z.ZodString>;
1318
1318
  }, "strip", z.ZodTypeAny, {
1319
- type: "transport_end";
1320
1319
  id: string;
1321
- conversation_id: string;
1320
+ type: "transport_end";
1322
1321
  timestamp: number;
1322
+ conversation_id: string;
1323
1323
  turn_id: string;
1324
1324
  execution_id: string;
1325
1325
  metadata?: Record<string, SerializableJsonValue> | undefined;
1326
1326
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1327
1327
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1328
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1329
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
1328
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1329
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
1330
1330
  execution_seq?: number | undefined;
1331
1331
  reason_message?: string | undefined;
1332
1332
  }, {
1333
- type: "transport_end";
1334
1333
  id: string;
1335
- conversation_id: string;
1334
+ type: "transport_end";
1336
1335
  timestamp: number;
1336
+ conversation_id: string;
1337
1337
  turn_id: string;
1338
1338
  execution_id: string;
1339
1339
  metadata?: Record<string, SerializableJsonValue> | undefined;
1340
1340
  run_id?: string | undefined;
1341
1341
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1342
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1343
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
1342
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1343
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
1344
1344
  execution_seq?: number | undefined;
1345
1345
  reason_message?: string | undefined;
1346
1346
  }>;
@@ -1367,12 +1367,12 @@ declare const SSEHistorySummaryEvent: z.ZodObject<{
1367
1367
  compression_ratio: z.ZodOptional<z.ZodNumber>;
1368
1368
  included_old_summary: z.ZodOptional<z.ZodBoolean>;
1369
1369
  }, "strip", z.ZodTypeAny, {
1370
- type: "history_summary";
1371
1370
  id: string;
1372
- conversation_id: string;
1371
+ type: "history_summary";
1372
+ content: string;
1373
1373
  timestamp: number;
1374
+ conversation_id: string;
1374
1375
  turn_id: string;
1375
- content: string;
1376
1376
  original_message_count: number;
1377
1377
  replaced_message_ids: string[];
1378
1378
  summary_seq: number;
@@ -1380,18 +1380,18 @@ declare const SSEHistorySummaryEvent: z.ZodObject<{
1380
1380
  metadata?: Record<string, SerializableJsonValue> | undefined;
1381
1381
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1382
1382
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1383
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1383
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1384
1384
  compression_ratio?: number | undefined;
1385
1385
  included_old_summary?: boolean | undefined;
1386
1386
  execution_id?: string | undefined;
1387
1387
  execution_seq?: number | undefined;
1388
1388
  }, {
1389
- type: "history_summary";
1390
1389
  id: string;
1391
- conversation_id: string;
1390
+ type: "history_summary";
1391
+ content: string;
1392
1392
  timestamp: number;
1393
+ conversation_id: string;
1393
1394
  turn_id: string;
1394
- content: string;
1395
1395
  original_message_count: number;
1396
1396
  replaced_message_ids: string[];
1397
1397
  summary_seq: number;
@@ -1399,7 +1399,7 @@ declare const SSEHistorySummaryEvent: z.ZodObject<{
1399
1399
  metadata?: Record<string, SerializableJsonValue> | undefined;
1400
1400
  run_id?: string | undefined;
1401
1401
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1402
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1402
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1403
1403
  compression_ratio?: number | undefined;
1404
1404
  included_old_summary?: boolean | undefined;
1405
1405
  execution_id?: string | undefined;
@@ -1421,30 +1421,30 @@ declare const SSESummarizationStartEvent: z.ZodObject<{
1421
1421
  execution_id: z.ZodEffects<z.ZodString, string, string>;
1422
1422
  summarization_id: z.ZodEffects<z.ZodString, string, string>;
1423
1423
  }, "strip", z.ZodTypeAny, {
1424
- type: "summarization_start";
1425
1424
  id: string;
1426
- conversation_id: string;
1425
+ type: "summarization_start";
1427
1426
  timestamp: number;
1428
- turn_id: string;
1429
1427
  run_id: string & z.BRAND<"RunId">;
1428
+ conversation_id: string;
1429
+ turn_id: string;
1430
1430
  execution_id: string;
1431
1431
  summarization_id: string;
1432
1432
  metadata?: Record<string, SerializableJsonValue> | undefined;
1433
1433
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1434
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1434
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1435
1435
  execution_seq?: number | undefined;
1436
1436
  }, {
1437
- type: "summarization_start";
1438
1437
  id: string;
1439
- conversation_id: string;
1438
+ type: "summarization_start";
1440
1439
  timestamp: number;
1441
- turn_id: string;
1442
1440
  run_id: string;
1441
+ conversation_id: string;
1442
+ turn_id: string;
1443
1443
  execution_id: string;
1444
1444
  summarization_id: string;
1445
1445
  metadata?: Record<string, SerializableJsonValue> | undefined;
1446
1446
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1447
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1447
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1448
1448
  execution_seq?: number | undefined;
1449
1449
  }>;
1450
1450
  type SSESummarizationStartEvent = z.infer<typeof SSESummarizationStartEvent>;
@@ -1467,12 +1467,12 @@ declare const SSESummarizationEndEvent: z.ZodObject<{
1467
1467
  compressed_message_count: z.ZodNumber;
1468
1468
  compression_ratio: z.ZodOptional<z.ZodNumber>;
1469
1469
  }, "strip", z.ZodTypeAny, {
1470
- type: "summarization_end";
1471
1470
  id: string;
1472
- conversation_id: string;
1471
+ type: "summarization_end";
1473
1472
  timestamp: number;
1474
- turn_id: string;
1475
1473
  run_id: string & z.BRAND<"RunId">;
1474
+ conversation_id: string;
1475
+ turn_id: string;
1476
1476
  original_message_count: number;
1477
1477
  execution_id: string;
1478
1478
  summary_id: string;
@@ -1480,16 +1480,16 @@ declare const SSESummarizationEndEvent: z.ZodObject<{
1480
1480
  compressed_message_count: number;
1481
1481
  metadata?: Record<string, SerializableJsonValue> | undefined;
1482
1482
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1483
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1483
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1484
1484
  compression_ratio?: number | undefined;
1485
1485
  execution_seq?: number | undefined;
1486
1486
  }, {
1487
- type: "summarization_end";
1488
1487
  id: string;
1489
- conversation_id: string;
1488
+ type: "summarization_end";
1490
1489
  timestamp: number;
1491
- turn_id: string;
1492
1490
  run_id: string;
1491
+ conversation_id: string;
1492
+ turn_id: string;
1493
1493
  original_message_count: number;
1494
1494
  execution_id: string;
1495
1495
  summary_id: string;
@@ -1497,7 +1497,7 @@ declare const SSESummarizationEndEvent: z.ZodObject<{
1497
1497
  compressed_message_count: number;
1498
1498
  metadata?: Record<string, SerializableJsonValue> | undefined;
1499
1499
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1500
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1500
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1501
1501
  compression_ratio?: number | undefined;
1502
1502
  execution_seq?: number | undefined;
1503
1503
  }>;
@@ -1518,32 +1518,32 @@ declare const SSESummarizationErrorEvent: z.ZodObject<{
1518
1518
  summarization_id: z.ZodEffects<z.ZodString, string, string>;
1519
1519
  error: z.ZodString;
1520
1520
  }, "strip", z.ZodTypeAny, {
1521
- type: "summarization_error";
1522
1521
  id: string;
1523
- conversation_id: string;
1522
+ type: "summarization_error";
1523
+ error: string;
1524
1524
  timestamp: number;
1525
- turn_id: string;
1526
1525
  run_id: string & z.BRAND<"RunId">;
1527
- error: string;
1526
+ conversation_id: string;
1527
+ turn_id: string;
1528
1528
  execution_id: string;
1529
1529
  summarization_id: string;
1530
1530
  metadata?: Record<string, SerializableJsonValue> | undefined;
1531
1531
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1532
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1532
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1533
1533
  execution_seq?: number | undefined;
1534
1534
  }, {
1535
- type: "summarization_error";
1536
1535
  id: string;
1537
- conversation_id: string;
1536
+ type: "summarization_error";
1537
+ error: string;
1538
1538
  timestamp: number;
1539
- turn_id: string;
1540
1539
  run_id: string;
1541
- error: string;
1540
+ conversation_id: string;
1541
+ turn_id: string;
1542
1542
  execution_id: string;
1543
1543
  summarization_id: string;
1544
1544
  metadata?: Record<string, SerializableJsonValue> | undefined;
1545
1545
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1546
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1546
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1547
1547
  execution_seq?: number | undefined;
1548
1548
  }>;
1549
1549
  type SSESummarizationErrorEvent = z.infer<typeof SSESummarizationErrorEvent>;
@@ -1565,32 +1565,32 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1565
1565
  content: z.ZodOptional<z.ZodString>;
1566
1566
  is_complete: z.ZodDefault<z.ZodBoolean>;
1567
1567
  }, "strip", z.ZodTypeAny, {
1568
- type: "thought";
1569
1568
  id: string;
1570
- conversation_id: string;
1569
+ type: "thought";
1571
1570
  timestamp: number;
1571
+ conversation_id: string;
1572
1572
  turn_id: string;
1573
1573
  is_complete: boolean;
1574
+ content?: string | undefined;
1574
1575
  metadata?: Record<string, SerializableJsonValue> | undefined;
1575
1576
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1576
1577
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1577
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1578
- content?: string | undefined;
1578
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1579
1579
  thought_message_id?: string | undefined;
1580
1580
  delta?: string | undefined;
1581
1581
  execution_id?: string | undefined;
1582
1582
  execution_seq?: number | undefined;
1583
1583
  }, {
1584
- type: "thought";
1585
1584
  id: string;
1586
- conversation_id: string;
1585
+ type: "thought";
1587
1586
  timestamp: number;
1587
+ conversation_id: string;
1588
1588
  turn_id: string;
1589
+ content?: string | undefined;
1589
1590
  metadata?: Record<string, SerializableJsonValue> | undefined;
1590
1591
  run_id?: string | undefined;
1591
1592
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1592
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1593
- content?: string | undefined;
1593
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1594
1594
  thought_message_id?: string | undefined;
1595
1595
  delta?: string | undefined;
1596
1596
  is_complete?: boolean | undefined;
@@ -1614,10 +1614,10 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1614
1614
  chunk: z.ZodString;
1615
1615
  is_last: z.ZodOptional<z.ZodBoolean>;
1616
1616
  }, "strip", z.ZodTypeAny, {
1617
- type: "final_answer_chunk";
1618
1617
  id: string;
1619
- conversation_id: string;
1618
+ type: "final_answer_chunk";
1620
1619
  timestamp: number;
1620
+ conversation_id: string;
1621
1621
  turn_id: string;
1622
1622
  answer_id: string;
1623
1623
  seq: number;
@@ -1625,15 +1625,15 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1625
1625
  metadata?: Record<string, SerializableJsonValue> | undefined;
1626
1626
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1627
1627
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1628
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1628
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1629
1629
  is_last?: boolean | undefined;
1630
1630
  execution_id?: string | undefined;
1631
1631
  execution_seq?: number | undefined;
1632
1632
  }, {
1633
- type: "final_answer_chunk";
1634
1633
  id: string;
1635
- conversation_id: string;
1634
+ type: "final_answer_chunk";
1636
1635
  timestamp: number;
1636
+ conversation_id: string;
1637
1637
  turn_id: string;
1638
1638
  answer_id: string;
1639
1639
  seq: number;
@@ -1641,7 +1641,7 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1641
1641
  metadata?: Record<string, SerializableJsonValue> | undefined;
1642
1642
  run_id?: string | undefined;
1643
1643
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1644
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1644
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1645
1645
  is_last?: boolean | undefined;
1646
1646
  execution_id?: string | undefined;
1647
1647
  execution_seq?: number | undefined;
@@ -1661,29 +1661,29 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1661
1661
  answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1662
1662
  thought_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
1663
1663
  }, "strip", z.ZodTypeAny, {
1664
- type: "final_answer_reset";
1665
1664
  id: string;
1666
- conversation_id: string;
1665
+ type: "final_answer_reset";
1667
1666
  timestamp: number;
1667
+ conversation_id: string;
1668
1668
  turn_id: string;
1669
1669
  metadata?: Record<string, SerializableJsonValue> | undefined;
1670
1670
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1671
1671
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1672
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1672
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1673
1673
  answer_id?: string | undefined;
1674
1674
  thought_message_ids?: string[] | undefined;
1675
1675
  execution_id?: string | undefined;
1676
1676
  execution_seq?: number | undefined;
1677
1677
  }, {
1678
- type: "final_answer_reset";
1679
1678
  id: string;
1680
- conversation_id: string;
1679
+ type: "final_answer_reset";
1681
1680
  timestamp: number;
1681
+ conversation_id: string;
1682
1682
  turn_id: string;
1683
1683
  metadata?: Record<string, SerializableJsonValue> | undefined;
1684
1684
  run_id?: string | undefined;
1685
1685
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1686
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1686
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1687
1687
  answer_id?: string | undefined;
1688
1688
  thought_message_ids?: string[] | undefined;
1689
1689
  execution_id?: string | undefined;
@@ -1706,34 +1706,34 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1706
1706
  completion_reason: z.ZodEnum<["terminal", "tool_call", "interrupted"]>;
1707
1707
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
1708
1708
  }, "strip", z.ZodTypeAny, {
1709
- type: "final_answer";
1710
1709
  id: string;
1711
- conversation_id: string;
1710
+ type: "final_answer";
1711
+ completion_reason: "tool_call" | "terminal" | "interrupted";
1712
+ content: string;
1712
1713
  timestamp: number;
1714
+ conversation_id: string;
1713
1715
  turn_id: string;
1714
- content: string;
1715
1716
  answer_id: string;
1716
- completion_reason: "tool_call" | "terminal" | "interrupted";
1717
1717
  metadata?: Record<string, SerializableJsonValue> | undefined;
1718
1718
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1719
1719
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1720
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1720
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1721
1721
  meta?: Record<string, SerializableJsonValue> | undefined;
1722
1722
  execution_id?: string | undefined;
1723
1723
  execution_seq?: number | undefined;
1724
1724
  }, {
1725
- type: "final_answer";
1726
1725
  id: string;
1727
- conversation_id: string;
1726
+ type: "final_answer";
1727
+ completion_reason: "tool_call" | "terminal" | "interrupted";
1728
+ content: string;
1728
1729
  timestamp: number;
1730
+ conversation_id: string;
1729
1731
  turn_id: string;
1730
- content: string;
1731
1732
  answer_id: string;
1732
- completion_reason: "tool_call" | "terminal" | "interrupted";
1733
1733
  metadata?: Record<string, SerializableJsonValue> | undefined;
1734
1734
  run_id?: string | undefined;
1735
1735
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1736
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1736
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1737
1737
  meta?: Record<string, SerializableJsonValue> | undefined;
1738
1738
  execution_id?: string | undefined;
1739
1739
  execution_seq?: number | undefined;
@@ -1754,35 +1754,35 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1754
1754
  text: z.ZodString;
1755
1755
  seq: z.ZodOptional<z.ZodNumber>;
1756
1756
  }, "strip", z.ZodTypeAny, {
1757
- type: "markdown_chunk";
1758
1757
  id: string;
1759
- conversation_id: string;
1758
+ type: "markdown_chunk";
1759
+ text: string;
1760
1760
  timestamp: number;
1761
+ conversation_id: string;
1761
1762
  turn_id: string;
1762
- text: string;
1763
- content_type: "code" | "image" | "text" | "table";
1763
+ content_type: "code" | "text" | "image" | "table";
1764
1764
  metadata?: Record<string, SerializableJsonValue> | undefined;
1765
1765
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1766
1766
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1767
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1767
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1768
1768
  seq?: number | undefined;
1769
1769
  execution_id?: string | undefined;
1770
1770
  execution_seq?: number | undefined;
1771
1771
  }, {
1772
- type: "markdown_chunk";
1773
1772
  id: string;
1774
- conversation_id: string;
1773
+ type: "markdown_chunk";
1774
+ text: string;
1775
1775
  timestamp: number;
1776
+ conversation_id: string;
1776
1777
  turn_id: string;
1777
- text: string;
1778
1778
  metadata?: Record<string, SerializableJsonValue> | undefined;
1779
1779
  run_id?: string | undefined;
1780
1780
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1781
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1781
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1782
1782
  seq?: number | undefined;
1783
1783
  execution_id?: string | undefined;
1784
1784
  execution_seq?: number | undefined;
1785
- content_type?: "code" | "image" | "text" | "table" | undefined;
1785
+ content_type?: "code" | "text" | "image" | "table" | undefined;
1786
1786
  }>, z.ZodObject<{
1787
1787
  id: z.ZodEffects<z.ZodString, string, string>;
1788
1788
  timestamp: z.ZodNumber;
@@ -1805,40 +1805,40 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1805
1805
  } & {
1806
1806
  type: z.ZodLiteral<"tool_call_decision">;
1807
1807
  }, "strip", z.ZodTypeAny, {
1808
- type: "tool_call_decision";
1809
1808
  id: string;
1810
- conversation_id: string;
1811
- timestamp: number;
1809
+ type: "tool_call_decision";
1812
1810
  status: "error" | "loading" | "success";
1813
- turn_id: string;
1814
- tool_name: string;
1815
1811
  tool_call_id: string & z.BRAND<"ToolCallId">;
1816
- phase: "start" | "update" | "complete" | "error";
1812
+ tool_name: string;
1813
+ timestamp: number;
1814
+ conversation_id: string;
1815
+ turn_id: string;
1816
+ phase: "error" | "start" | "update" | "complete";
1817
+ payload?: SerializableJsonValue | undefined;
1818
+ args?: SerializableJsonValue | undefined;
1817
1819
  metadata?: Record<string, SerializableJsonValue> | undefined;
1818
1820
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1819
1821
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1820
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1821
- args?: SerializableJsonValue | undefined;
1822
- payload?: SerializableJsonValue | undefined;
1822
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1823
1823
  meta?: Record<string, SerializableJsonValue> | undefined;
1824
1824
  execution_id?: string | undefined;
1825
1825
  execution_seq?: number | undefined;
1826
1826
  }, {
1827
- type: "tool_call_decision";
1828
1827
  id: string;
1829
- conversation_id: string;
1830
- timestamp: number;
1828
+ type: "tool_call_decision";
1831
1829
  status: "error" | "loading" | "success";
1832
- turn_id: string;
1833
- tool_name: string;
1834
1830
  tool_call_id: string;
1835
- phase: "start" | "update" | "complete" | "error";
1831
+ tool_name: string;
1832
+ timestamp: number;
1833
+ conversation_id: string;
1834
+ turn_id: string;
1835
+ phase: "error" | "start" | "update" | "complete";
1836
+ payload?: SerializableJsonValue | undefined;
1837
+ args?: SerializableJsonValue | undefined;
1836
1838
  metadata?: Record<string, SerializableJsonValue> | undefined;
1837
1839
  run_id?: string | undefined;
1838
1840
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1839
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1840
- args?: SerializableJsonValue | undefined;
1841
- payload?: SerializableJsonValue | undefined;
1841
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1842
1842
  meta?: Record<string, SerializableJsonValue> | undefined;
1843
1843
  execution_id?: string | undefined;
1844
1844
  execution_seq?: number | undefined;
@@ -1864,40 +1864,40 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1864
1864
  } & {
1865
1865
  type: z.ZodLiteral<"tool_process">;
1866
1866
  }, "strip", z.ZodTypeAny, {
1867
- type: "tool_process";
1868
1867
  id: string;
1869
- conversation_id: string;
1870
- timestamp: number;
1868
+ type: "tool_process";
1871
1869
  status: "error" | "loading" | "success";
1872
- turn_id: string;
1873
- tool_name: string;
1874
1870
  tool_call_id: string & z.BRAND<"ToolCallId">;
1875
- phase: "start" | "update" | "complete" | "error";
1871
+ tool_name: string;
1872
+ timestamp: number;
1873
+ conversation_id: string;
1874
+ turn_id: string;
1875
+ phase: "error" | "start" | "update" | "complete";
1876
+ payload?: SerializableJsonValue | undefined;
1877
+ args?: SerializableJsonValue | undefined;
1876
1878
  metadata?: Record<string, SerializableJsonValue> | undefined;
1877
1879
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1878
1880
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1879
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1880
- args?: SerializableJsonValue | undefined;
1881
- payload?: SerializableJsonValue | undefined;
1881
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1882
1882
  meta?: Record<string, SerializableJsonValue> | undefined;
1883
1883
  execution_id?: string | undefined;
1884
1884
  execution_seq?: number | undefined;
1885
1885
  }, {
1886
- type: "tool_process";
1887
1886
  id: string;
1888
- conversation_id: string;
1889
- timestamp: number;
1887
+ type: "tool_process";
1890
1888
  status: "error" | "loading" | "success";
1891
- turn_id: string;
1892
- tool_name: string;
1893
1889
  tool_call_id: string;
1894
- phase: "start" | "update" | "complete" | "error";
1890
+ tool_name: string;
1891
+ timestamp: number;
1892
+ conversation_id: string;
1893
+ turn_id: string;
1894
+ phase: "error" | "start" | "update" | "complete";
1895
+ payload?: SerializableJsonValue | undefined;
1896
+ args?: SerializableJsonValue | undefined;
1895
1897
  metadata?: Record<string, SerializableJsonValue> | undefined;
1896
1898
  run_id?: string | undefined;
1897
1899
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1898
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1899
- args?: SerializableJsonValue | undefined;
1900
- payload?: SerializableJsonValue | undefined;
1900
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1901
1901
  meta?: Record<string, SerializableJsonValue> | undefined;
1902
1902
  execution_id?: string | undefined;
1903
1903
  execution_seq?: number | undefined;
@@ -1957,19 +1957,18 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1957
1957
  label?: string | undefined;
1958
1958
  }>, "many">>;
1959
1959
  }, "strip", z.ZodTypeAny, {
1960
- type: "tool_output";
1961
1960
  id: string;
1962
- conversation_id: string;
1963
- timestamp: number;
1961
+ type: "tool_output";
1964
1962
  status: "error" | "success";
1965
- turn_id: string;
1966
- tool_name: string;
1967
1963
  tool_call_id: string & z.BRAND<"ToolCallId">;
1964
+ tool_name: string;
1965
+ timestamp: number;
1966
+ conversation_id: string;
1967
+ turn_id: string;
1968
1968
  observation: string;
1969
+ data?: SerializableJsonValue | undefined;
1970
+ error?: string | undefined;
1969
1971
  metadata?: Record<string, SerializableJsonValue> | undefined;
1970
- run_id?: (string & z.BRAND<"RunId">) | undefined;
1971
- lane?: "foreground" | "auxiliary" | "child" | undefined;
1972
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
1973
1972
  attachments?: {
1974
1973
  id: string;
1975
1974
  kind: "image";
@@ -1982,26 +1981,26 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
1982
1981
  fileName?: string | undefined;
1983
1982
  label?: string | undefined;
1984
1983
  }[] | undefined;
1985
- error?: string | undefined;
1986
- data?: SerializableJsonValue | undefined;
1984
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
1985
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
1986
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
1987
1987
  error_code?: string | undefined;
1988
1988
  duration_ms?: number | undefined;
1989
1989
  execution_id?: string | undefined;
1990
1990
  execution_seq?: number | undefined;
1991
1991
  }, {
1992
- type: "tool_output";
1993
1992
  id: string;
1994
- conversation_id: string;
1995
- timestamp: number;
1993
+ type: "tool_output";
1996
1994
  status: "error" | "success";
1997
- turn_id: string;
1998
- tool_name: string;
1999
1995
  tool_call_id: string;
1996
+ tool_name: string;
1997
+ timestamp: number;
1998
+ conversation_id: string;
1999
+ turn_id: string;
2000
2000
  observation: string;
2001
+ data?: SerializableJsonValue | undefined;
2002
+ error?: string | undefined;
2001
2003
  metadata?: Record<string, SerializableJsonValue> | undefined;
2002
- run_id?: string | undefined;
2003
- lane?: "foreground" | "auxiliary" | "child" | undefined;
2004
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2005
2004
  attachments?: {
2006
2005
  id: string;
2007
2006
  kind: "image";
@@ -2014,8 +2013,9 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2014
2013
  fileName?: string | undefined;
2015
2014
  label?: string | undefined;
2016
2015
  }[] | undefined;
2017
- error?: string | undefined;
2018
- data?: SerializableJsonValue | undefined;
2016
+ run_id?: string | undefined;
2017
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
2018
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2019
2019
  error_code?: string | undefined;
2020
2020
  duration_ms?: number | undefined;
2021
2021
  execution_id?: string | undefined;
@@ -2053,12 +2053,12 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2053
2053
  tool_name: z.ZodString;
2054
2054
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
2055
2055
  }, "strict", z.ZodTypeAny, {
2056
- tool_name: string;
2057
2056
  tool_call_id: string & z.BRAND<"ToolCallId">;
2057
+ tool_name: string;
2058
2058
  args: Record<string, SerializableJsonValue>;
2059
2059
  }, {
2060
- tool_name: string;
2061
2060
  tool_call_id: string;
2061
+ tool_name: string;
2062
2062
  args: Record<string, SerializableJsonValue>;
2063
2063
  }>, "many">>;
2064
2064
  output: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
@@ -2104,21 +2104,27 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2104
2104
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
2105
2105
  type: z.ZodLiteral<"subrun_trace">;
2106
2106
  }, "strip", z.ZodTypeAny, {
2107
- type: "subrun_trace";
2108
2107
  id: string;
2109
- conversation_id: string;
2108
+ type: "subrun_trace";
2109
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
2110
2110
  timestamp: number;
2111
+ conversation_id: string;
2111
2112
  turn_id: string;
2112
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
2113
2113
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
2114
2114
  subrun_id: string;
2115
2115
  source_event_id: string;
2116
2116
  status?: "error" | "loading" | "success" | undefined;
2117
- metadata?: Record<string, SerializableJsonValue> | undefined;
2118
- run_id?: (string & z.BRAND<"RunId">) | undefined;
2119
- lane?: "foreground" | "auxiliary" | "child" | undefined;
2120
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2117
+ tool_calls?: {
2118
+ tool_call_id: string & z.BRAND<"ToolCallId">;
2119
+ tool_name: string;
2120
+ args: Record<string, SerializableJsonValue>;
2121
+ }[] | undefined;
2122
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
2123
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
2124
+ tool_name?: string | undefined;
2125
+ args?: Record<string, SerializableJsonValue> | undefined;
2121
2126
  content?: string | undefined;
2127
+ metadata?: Record<string, SerializableJsonValue> | undefined;
2122
2128
  attachments?: {
2123
2129
  id: string;
2124
2130
  kind: "image";
@@ -2131,23 +2137,17 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2131
2137
  fileName?: string | undefined;
2132
2138
  label?: string | undefined;
2133
2139
  }[] | undefined;
2140
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
2141
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
2142
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2134
2143
  delta?: string | undefined;
2135
- tool_name?: string | undefined;
2136
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
2137
- phase?: "start" | "update" | "complete" | "error" | undefined;
2138
- args?: Record<string, SerializableJsonValue> | undefined;
2139
- tool_calls?: {
2140
- tool_name: string;
2141
- tool_call_id: string & z.BRAND<"ToolCallId">;
2142
- args: Record<string, SerializableJsonValue>;
2143
- }[] | undefined;
2144
+ phase?: "error" | "start" | "update" | "complete" | undefined;
2144
2145
  meta?: Record<string, SerializableJsonValue> | undefined;
2145
2146
  duration_ms?: number | undefined;
2146
2147
  subrun_parent_id?: string | undefined;
2147
2148
  answer_id?: string | undefined;
2148
2149
  seq?: number | undefined;
2149
2150
  is_last?: boolean | undefined;
2150
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
2151
2151
  output?: SerializableJsonValue | undefined;
2152
2152
  original_message_count?: number | undefined;
2153
2153
  compression_ratio?: number | undefined;
@@ -2156,21 +2156,27 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2156
2156
  execution_id?: string | undefined;
2157
2157
  execution_seq?: number | undefined;
2158
2158
  }, {
2159
- type: "subrun_trace";
2160
2159
  id: string;
2161
- conversation_id: string;
2160
+ type: "subrun_trace";
2161
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
2162
2162
  timestamp: number;
2163
+ conversation_id: string;
2163
2164
  turn_id: string;
2164
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
2165
2165
  parent_tool_call_id: string;
2166
2166
  subrun_id: string;
2167
2167
  source_event_id: string;
2168
2168
  status?: "error" | "loading" | "success" | undefined;
2169
- metadata?: Record<string, SerializableJsonValue> | undefined;
2170
- run_id?: string | undefined;
2171
- lane?: "foreground" | "auxiliary" | "child" | undefined;
2172
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2169
+ tool_calls?: {
2170
+ tool_call_id: string;
2171
+ tool_name: string;
2172
+ args: Record<string, SerializableJsonValue>;
2173
+ }[] | undefined;
2174
+ tool_call_id?: string | undefined;
2175
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
2176
+ tool_name?: string | undefined;
2177
+ args?: Record<string, SerializableJsonValue> | undefined;
2173
2178
  content?: string | undefined;
2179
+ metadata?: Record<string, SerializableJsonValue> | undefined;
2174
2180
  attachments?: {
2175
2181
  id: string;
2176
2182
  kind: "image";
@@ -2183,23 +2189,17 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2183
2189
  fileName?: string | undefined;
2184
2190
  label?: string | undefined;
2185
2191
  }[] | undefined;
2192
+ run_id?: string | undefined;
2193
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
2194
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2186
2195
  delta?: string | undefined;
2187
- tool_name?: string | undefined;
2188
- tool_call_id?: string | undefined;
2189
- phase?: "start" | "update" | "complete" | "error" | undefined;
2190
- args?: Record<string, SerializableJsonValue> | undefined;
2191
- tool_calls?: {
2192
- tool_name: string;
2193
- tool_call_id: string;
2194
- args: Record<string, SerializableJsonValue>;
2195
- }[] | undefined;
2196
+ phase?: "error" | "start" | "update" | "complete" | undefined;
2196
2197
  meta?: Record<string, SerializableJsonValue> | undefined;
2197
2198
  duration_ms?: number | undefined;
2198
2199
  subrun_parent_id?: string | undefined;
2199
2200
  answer_id?: string | undefined;
2200
2201
  seq?: number | undefined;
2201
2202
  is_last?: boolean | undefined;
2202
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
2203
2203
  output?: SerializableJsonValue | undefined;
2204
2204
  original_message_count?: number | undefined;
2205
2205
  compression_ratio?: number | undefined;
@@ -2229,40 +2229,40 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2229
2229
  resume_token: z.ZodEffects<z.ZodString, string, string>;
2230
2230
  interaction_status: z.ZodLiteral<"pending">;
2231
2231
  }, "strip", z.ZodTypeAny, {
2232
- type: "requires_user_interaction";
2233
2232
  id: string;
2234
- conversation_id: string;
2233
+ type: "requires_user_interaction";
2234
+ tool_call_id: string & z.BRAND<"ToolCallId">;
2235
2235
  timestamp: number;
2236
- turn_id: string;
2237
2236
  run_id: string & z.BRAND<"RunId">;
2238
- tool_call_id: string & z.BRAND<"ToolCallId">;
2237
+ conversation_id: string;
2238
+ turn_id: string;
2239
2239
  interaction_id: string;
2240
2240
  checkpoint_revision: number;
2241
2241
  resume_token: string;
2242
2242
  interaction_status: "pending";
2243
2243
  metadata?: Record<string, SerializableJsonValue> | undefined;
2244
2244
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2245
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2245
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2246
2246
  form?: SerializableJsonValue | undefined;
2247
2247
  interaction_type?: string | undefined;
2248
2248
  prompt?: string | undefined;
2249
2249
  execution_id?: string | undefined;
2250
2250
  execution_seq?: number | undefined;
2251
2251
  }, {
2252
- type: "requires_user_interaction";
2253
2252
  id: string;
2254
- conversation_id: string;
2253
+ type: "requires_user_interaction";
2254
+ tool_call_id: string;
2255
2255
  timestamp: number;
2256
- turn_id: string;
2257
2256
  run_id: string;
2258
- tool_call_id: string;
2257
+ conversation_id: string;
2258
+ turn_id: string;
2259
2259
  interaction_id: string;
2260
2260
  checkpoint_revision: number;
2261
2261
  resume_token: string;
2262
2262
  interaction_status: "pending";
2263
2263
  metadata?: Record<string, SerializableJsonValue> | undefined;
2264
2264
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2265
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2265
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2266
2266
  form?: SerializableJsonValue | undefined;
2267
2267
  interaction_type?: string | undefined;
2268
2268
  prompt?: string | undefined;
@@ -2286,32 +2286,32 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2286
2286
  error_code: z.ZodOptional<z.ZodString>;
2287
2287
  retryable: z.ZodOptional<z.ZodBoolean>;
2288
2288
  }, "strip", z.ZodTypeAny, {
2289
- type: "error";
2290
2289
  id: string;
2291
- conversation_id: string;
2290
+ type: "error";
2291
+ error: string;
2292
2292
  timestamp: number;
2293
+ conversation_id: string;
2293
2294
  turn_id: string;
2294
- error: string;
2295
2295
  metadata?: Record<string, SerializableJsonValue> | undefined;
2296
2296
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2297
2297
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2298
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2298
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2299
2299
  error_code?: string | undefined;
2300
2300
  details?: SerializableJsonValue | undefined;
2301
2301
  retryable?: boolean | undefined;
2302
2302
  execution_id?: string | undefined;
2303
2303
  execution_seq?: number | undefined;
2304
2304
  }, {
2305
- type: "error";
2306
2305
  id: string;
2307
- conversation_id: string;
2306
+ type: "error";
2307
+ error: string;
2308
2308
  timestamp: number;
2309
+ conversation_id: string;
2309
2310
  turn_id: string;
2310
- error: string;
2311
2311
  metadata?: Record<string, SerializableJsonValue> | undefined;
2312
2312
  run_id?: string | undefined;
2313
2313
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2314
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2314
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2315
2315
  error_code?: string | undefined;
2316
2316
  details?: SerializableJsonValue | undefined;
2317
2317
  retryable?: boolean | undefined;
@@ -2335,33 +2335,33 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2335
2335
  error_code: z.ZodOptional<z.ZodString>;
2336
2336
  retryable: z.ZodOptional<z.ZodBoolean>;
2337
2337
  }, "strip", z.ZodTypeAny, {
2338
- type: "transport_error";
2339
2338
  id: string;
2340
- conversation_id: string;
2339
+ type: "transport_error";
2340
+ error: string;
2341
2341
  timestamp: number;
2342
+ conversation_id: string;
2342
2343
  turn_id: string;
2343
- error: string;
2344
2344
  execution_id: string;
2345
2345
  metadata?: Record<string, SerializableJsonValue> | undefined;
2346
2346
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2347
2347
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2348
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2348
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2349
2349
  error_code?: string | undefined;
2350
2350
  details?: SerializableJsonValue | undefined;
2351
2351
  retryable?: boolean | undefined;
2352
2352
  execution_seq?: number | undefined;
2353
2353
  }, {
2354
- type: "transport_error";
2355
2354
  id: string;
2356
- conversation_id: string;
2355
+ type: "transport_error";
2356
+ error: string;
2357
2357
  timestamp: number;
2358
+ conversation_id: string;
2358
2359
  turn_id: string;
2359
- error: string;
2360
2360
  execution_id: string;
2361
2361
  metadata?: Record<string, SerializableJsonValue> | undefined;
2362
2362
  run_id?: string | undefined;
2363
2363
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2364
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2364
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2365
2365
  error_code?: string | undefined;
2366
2366
  details?: SerializableJsonValue | undefined;
2367
2367
  retryable?: boolean | undefined;
@@ -2475,10 +2475,10 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2475
2475
  served_model_id?: string | undefined;
2476
2476
  }>;
2477
2477
  }, "strip", z.ZodTypeAny, {
2478
- type: "context_usage_snapshot";
2479
2478
  id: string;
2480
- conversation_id: string;
2479
+ type: "context_usage_snapshot";
2481
2480
  timestamp: number;
2481
+ conversation_id: string;
2482
2482
  turn_id: string;
2483
2483
  context_usage: {
2484
2484
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -2501,15 +2501,15 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2501
2501
  metadata?: Record<string, SerializableJsonValue> | undefined;
2502
2502
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2503
2503
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2504
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2504
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2505
2505
  user_message_id?: string | undefined;
2506
2506
  execution_id?: string | undefined;
2507
2507
  execution_seq?: number | undefined;
2508
2508
  }, {
2509
- type: "context_usage_snapshot";
2510
2509
  id: string;
2511
- conversation_id: string;
2510
+ type: "context_usage_snapshot";
2512
2511
  timestamp: number;
2512
+ conversation_id: string;
2513
2513
  turn_id: string;
2514
2514
  context_usage: {
2515
2515
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -2532,7 +2532,7 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2532
2532
  metadata?: Record<string, SerializableJsonValue> | undefined;
2533
2533
  run_id?: string | undefined;
2534
2534
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2535
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2535
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2536
2536
  user_message_id?: string | undefined;
2537
2537
  execution_id?: string | undefined;
2538
2538
  execution_seq?: number | undefined;
@@ -2647,18 +2647,18 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2647
2647
  served_model_id?: string | undefined;
2648
2648
  }>>;
2649
2649
  }, "strip", z.ZodTypeAny, {
2650
- type: "run_execution_metrics";
2651
2650
  id: string;
2652
- conversation_id: string;
2651
+ type: "run_execution_metrics";
2653
2652
  timestamp: number;
2653
+ conversation_id: string;
2654
2654
  turn_id: string;
2655
2655
  duration_ms: number;
2656
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
2656
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
2657
2657
  execution_id: string;
2658
2658
  metadata?: Record<string, SerializableJsonValue> | undefined;
2659
2659
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2660
2660
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2661
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2661
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2662
2662
  user_message_id?: string | undefined;
2663
2663
  context_usage?: {
2664
2664
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -2680,18 +2680,18 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2680
2680
  } | undefined;
2681
2681
  execution_seq?: number | undefined;
2682
2682
  }, {
2683
- type: "run_execution_metrics";
2684
2683
  id: string;
2685
- conversation_id: string;
2684
+ type: "run_execution_metrics";
2686
2685
  timestamp: number;
2686
+ conversation_id: string;
2687
2687
  turn_id: string;
2688
2688
  duration_ms: number;
2689
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
2689
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
2690
2690
  execution_id: string;
2691
2691
  metadata?: Record<string, SerializableJsonValue> | undefined;
2692
2692
  run_id?: string | undefined;
2693
2693
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2694
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2694
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2695
2695
  user_message_id?: string | undefined;
2696
2696
  context_usage?: {
2697
2697
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -2728,31 +2728,31 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2728
2728
  status: z.ZodEnum<["pending", "running", "awaiting_user", "paused", "completed", "failed", "cancelled"]>;
2729
2729
  reason_message: z.ZodOptional<z.ZodString>;
2730
2730
  }, "strip", z.ZodTypeAny, {
2731
- type: "run_status";
2732
2731
  id: string;
2733
- conversation_id: string;
2732
+ type: "run_status";
2733
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
2734
2734
  timestamp: number;
2735
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
2736
- turn_id: string;
2737
2735
  run_id: string & z.BRAND<"RunId">;
2736
+ conversation_id: string;
2737
+ turn_id: string;
2738
2738
  execution_id: string;
2739
2739
  metadata?: Record<string, SerializableJsonValue> | undefined;
2740
2740
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2741
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2741
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2742
2742
  execution_seq?: number | undefined;
2743
2743
  reason_message?: string | undefined;
2744
2744
  }, {
2745
- type: "run_status";
2746
2745
  id: string;
2747
- conversation_id: string;
2746
+ type: "run_status";
2747
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
2748
2748
  timestamp: number;
2749
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
2750
- turn_id: string;
2751
2749
  run_id: string;
2750
+ conversation_id: string;
2751
+ turn_id: string;
2752
2752
  execution_id: string;
2753
2753
  metadata?: Record<string, SerializableJsonValue> | undefined;
2754
2754
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2755
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2755
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2756
2756
  execution_seq?: number | undefined;
2757
2757
  reason_message?: string | undefined;
2758
2758
  }>, z.ZodObject<{
@@ -2771,31 +2771,31 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2771
2771
  reason: z.ZodOptional<z.ZodEnum<["complete", "error", "interrupted", "timeout"]>>;
2772
2772
  reason_message: z.ZodOptional<z.ZodString>;
2773
2773
  }, "strip", z.ZodTypeAny, {
2774
- type: "transport_end";
2775
2774
  id: string;
2776
- conversation_id: string;
2775
+ type: "transport_end";
2777
2776
  timestamp: number;
2777
+ conversation_id: string;
2778
2778
  turn_id: string;
2779
2779
  execution_id: string;
2780
2780
  metadata?: Record<string, SerializableJsonValue> | undefined;
2781
2781
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2782
2782
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2783
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2784
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
2783
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2784
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
2785
2785
  execution_seq?: number | undefined;
2786
2786
  reason_message?: string | undefined;
2787
2787
  }, {
2788
- type: "transport_end";
2789
2788
  id: string;
2790
- conversation_id: string;
2789
+ type: "transport_end";
2791
2790
  timestamp: number;
2791
+ conversation_id: string;
2792
2792
  turn_id: string;
2793
2793
  execution_id: string;
2794
2794
  metadata?: Record<string, SerializableJsonValue> | undefined;
2795
2795
  run_id?: string | undefined;
2796
2796
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2797
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2798
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
2797
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2798
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
2799
2799
  execution_seq?: number | undefined;
2800
2800
  reason_message?: string | undefined;
2801
2801
  }>, z.ZodObject<{
@@ -2820,12 +2820,12 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2820
2820
  compression_ratio: z.ZodOptional<z.ZodNumber>;
2821
2821
  included_old_summary: z.ZodOptional<z.ZodBoolean>;
2822
2822
  }, "strip", z.ZodTypeAny, {
2823
- type: "history_summary";
2824
2823
  id: string;
2825
- conversation_id: string;
2824
+ type: "history_summary";
2825
+ content: string;
2826
2826
  timestamp: number;
2827
+ conversation_id: string;
2827
2828
  turn_id: string;
2828
- content: string;
2829
2829
  original_message_count: number;
2830
2830
  replaced_message_ids: string[];
2831
2831
  summary_seq: number;
@@ -2833,18 +2833,18 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2833
2833
  metadata?: Record<string, SerializableJsonValue> | undefined;
2834
2834
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2835
2835
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2836
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2836
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2837
2837
  compression_ratio?: number | undefined;
2838
2838
  included_old_summary?: boolean | undefined;
2839
2839
  execution_id?: string | undefined;
2840
2840
  execution_seq?: number | undefined;
2841
2841
  }, {
2842
- type: "history_summary";
2843
2842
  id: string;
2844
- conversation_id: string;
2843
+ type: "history_summary";
2844
+ content: string;
2845
2845
  timestamp: number;
2846
+ conversation_id: string;
2846
2847
  turn_id: string;
2847
- content: string;
2848
2848
  original_message_count: number;
2849
2849
  replaced_message_ids: string[];
2850
2850
  summary_seq: number;
@@ -2852,7 +2852,7 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2852
2852
  metadata?: Record<string, SerializableJsonValue> | undefined;
2853
2853
  run_id?: string | undefined;
2854
2854
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2855
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2855
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2856
2856
  compression_ratio?: number | undefined;
2857
2857
  included_old_summary?: boolean | undefined;
2858
2858
  execution_id?: string | undefined;
@@ -2872,30 +2872,30 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2872
2872
  execution_id: z.ZodEffects<z.ZodString, string, string>;
2873
2873
  summarization_id: z.ZodEffects<z.ZodString, string, string>;
2874
2874
  }, "strip", z.ZodTypeAny, {
2875
- type: "summarization_start";
2876
2875
  id: string;
2877
- conversation_id: string;
2876
+ type: "summarization_start";
2878
2877
  timestamp: number;
2879
- turn_id: string;
2880
2878
  run_id: string & z.BRAND<"RunId">;
2879
+ conversation_id: string;
2880
+ turn_id: string;
2881
2881
  execution_id: string;
2882
2882
  summarization_id: string;
2883
2883
  metadata?: Record<string, SerializableJsonValue> | undefined;
2884
2884
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2885
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2885
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2886
2886
  execution_seq?: number | undefined;
2887
2887
  }, {
2888
- type: "summarization_start";
2889
2888
  id: string;
2890
- conversation_id: string;
2889
+ type: "summarization_start";
2891
2890
  timestamp: number;
2892
- turn_id: string;
2893
2891
  run_id: string;
2892
+ conversation_id: string;
2893
+ turn_id: string;
2894
2894
  execution_id: string;
2895
2895
  summarization_id: string;
2896
2896
  metadata?: Record<string, SerializableJsonValue> | undefined;
2897
2897
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2898
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2898
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2899
2899
  execution_seq?: number | undefined;
2900
2900
  }>, z.ZodObject<{
2901
2901
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -2916,12 +2916,12 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2916
2916
  compressed_message_count: z.ZodNumber;
2917
2917
  compression_ratio: z.ZodOptional<z.ZodNumber>;
2918
2918
  }, "strip", z.ZodTypeAny, {
2919
- type: "summarization_end";
2920
2919
  id: string;
2921
- conversation_id: string;
2920
+ type: "summarization_end";
2922
2921
  timestamp: number;
2923
- turn_id: string;
2924
2922
  run_id: string & z.BRAND<"RunId">;
2923
+ conversation_id: string;
2924
+ turn_id: string;
2925
2925
  original_message_count: number;
2926
2926
  execution_id: string;
2927
2927
  summary_id: string;
@@ -2929,16 +2929,16 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2929
2929
  compressed_message_count: number;
2930
2930
  metadata?: Record<string, SerializableJsonValue> | undefined;
2931
2931
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2932
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2932
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2933
2933
  compression_ratio?: number | undefined;
2934
2934
  execution_seq?: number | undefined;
2935
2935
  }, {
2936
- type: "summarization_end";
2937
2936
  id: string;
2938
- conversation_id: string;
2937
+ type: "summarization_end";
2939
2938
  timestamp: number;
2940
- turn_id: string;
2941
2939
  run_id: string;
2940
+ conversation_id: string;
2941
+ turn_id: string;
2942
2942
  original_message_count: number;
2943
2943
  execution_id: string;
2944
2944
  summary_id: string;
@@ -2946,7 +2946,7 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2946
2946
  compressed_message_count: number;
2947
2947
  metadata?: Record<string, SerializableJsonValue> | undefined;
2948
2948
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2949
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2949
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2950
2950
  compression_ratio?: number | undefined;
2951
2951
  execution_seq?: number | undefined;
2952
2952
  }>, z.ZodObject<{
@@ -2965,54 +2965,54 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2965
2965
  summarization_id: z.ZodEffects<z.ZodString, string, string>;
2966
2966
  error: z.ZodString;
2967
2967
  }, "strip", z.ZodTypeAny, {
2968
- type: "summarization_error";
2969
2968
  id: string;
2970
- conversation_id: string;
2969
+ type: "summarization_error";
2970
+ error: string;
2971
2971
  timestamp: number;
2972
- turn_id: string;
2973
2972
  run_id: string & z.BRAND<"RunId">;
2974
- error: string;
2973
+ conversation_id: string;
2974
+ turn_id: string;
2975
2975
  execution_id: string;
2976
2976
  summarization_id: string;
2977
2977
  metadata?: Record<string, SerializableJsonValue> | undefined;
2978
2978
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2979
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2979
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2980
2980
  execution_seq?: number | undefined;
2981
2981
  }, {
2982
- type: "summarization_error";
2983
2982
  id: string;
2984
- conversation_id: string;
2983
+ type: "summarization_error";
2984
+ error: string;
2985
2985
  timestamp: number;
2986
- turn_id: string;
2987
2986
  run_id: string;
2988
- error: string;
2987
+ conversation_id: string;
2988
+ turn_id: string;
2989
2989
  execution_id: string;
2990
2990
  summarization_id: string;
2991
2991
  metadata?: Record<string, SerializableJsonValue> | undefined;
2992
2992
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2993
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
2993
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
2994
2994
  execution_seq?: number | undefined;
2995
2995
  }>]>, {
2996
- type: "thought";
2997
2996
  id: string;
2998
- conversation_id: string;
2997
+ type: "thought";
2999
2998
  timestamp: number;
2999
+ conversation_id: string;
3000
3000
  turn_id: string;
3001
3001
  is_complete: boolean;
3002
+ content?: string | undefined;
3002
3003
  metadata?: Record<string, SerializableJsonValue> | undefined;
3003
3004
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3004
3005
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3005
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3006
- content?: string | undefined;
3006
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3007
3007
  thought_message_id?: string | undefined;
3008
3008
  delta?: string | undefined;
3009
3009
  execution_id?: string | undefined;
3010
3010
  execution_seq?: number | undefined;
3011
3011
  } | {
3012
- type: "final_answer_chunk";
3013
3012
  id: string;
3014
- conversation_id: string;
3013
+ type: "final_answer_chunk";
3015
3014
  timestamp: number;
3015
+ conversation_id: string;
3016
3016
  turn_id: string;
3017
3017
  answer_id: string;
3018
3018
  seq: number;
@@ -3020,107 +3020,106 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3020
3020
  metadata?: Record<string, SerializableJsonValue> | undefined;
3021
3021
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3022
3022
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3023
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3023
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3024
3024
  is_last?: boolean | undefined;
3025
3025
  execution_id?: string | undefined;
3026
3026
  execution_seq?: number | undefined;
3027
3027
  } | {
3028
- type: "final_answer_reset";
3029
3028
  id: string;
3030
- conversation_id: string;
3029
+ type: "final_answer_reset";
3031
3030
  timestamp: number;
3031
+ conversation_id: string;
3032
3032
  turn_id: string;
3033
3033
  metadata?: Record<string, SerializableJsonValue> | undefined;
3034
3034
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3035
3035
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3036
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3036
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3037
3037
  answer_id?: string | undefined;
3038
3038
  thought_message_ids?: string[] | undefined;
3039
3039
  execution_id?: string | undefined;
3040
3040
  execution_seq?: number | undefined;
3041
3041
  } | {
3042
- type: "final_answer";
3043
3042
  id: string;
3044
- conversation_id: string;
3043
+ type: "final_answer";
3044
+ completion_reason: "tool_call" | "terminal" | "interrupted";
3045
+ content: string;
3045
3046
  timestamp: number;
3047
+ conversation_id: string;
3046
3048
  turn_id: string;
3047
- content: string;
3048
3049
  answer_id: string;
3049
- completion_reason: "tool_call" | "terminal" | "interrupted";
3050
3050
  metadata?: Record<string, SerializableJsonValue> | undefined;
3051
3051
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3052
3052
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3053
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3053
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3054
3054
  meta?: Record<string, SerializableJsonValue> | undefined;
3055
3055
  execution_id?: string | undefined;
3056
3056
  execution_seq?: number | undefined;
3057
3057
  } | {
3058
- type: "markdown_chunk";
3059
3058
  id: string;
3060
- conversation_id: string;
3059
+ type: "markdown_chunk";
3060
+ text: string;
3061
3061
  timestamp: number;
3062
+ conversation_id: string;
3062
3063
  turn_id: string;
3063
- text: string;
3064
- content_type: "code" | "image" | "text" | "table";
3064
+ content_type: "code" | "text" | "image" | "table";
3065
3065
  metadata?: Record<string, SerializableJsonValue> | undefined;
3066
3066
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3067
3067
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3068
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3068
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3069
3069
  seq?: number | undefined;
3070
3070
  execution_id?: string | undefined;
3071
3071
  execution_seq?: number | undefined;
3072
3072
  } | {
3073
- type: "tool_call_decision";
3074
3073
  id: string;
3075
- conversation_id: string;
3076
- timestamp: number;
3074
+ type: "tool_call_decision";
3077
3075
  status: "error" | "loading" | "success";
3078
- turn_id: string;
3079
- tool_name: string;
3080
3076
  tool_call_id: string & z.BRAND<"ToolCallId">;
3081
- phase: "start" | "update" | "complete" | "error";
3077
+ tool_name: string;
3078
+ timestamp: number;
3079
+ conversation_id: string;
3080
+ turn_id: string;
3081
+ phase: "error" | "start" | "update" | "complete";
3082
+ payload?: SerializableJsonValue | undefined;
3083
+ args?: SerializableJsonValue | undefined;
3082
3084
  metadata?: Record<string, SerializableJsonValue> | undefined;
3083
3085
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3084
3086
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3085
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3086
- args?: SerializableJsonValue | undefined;
3087
- payload?: SerializableJsonValue | undefined;
3087
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3088
3088
  meta?: Record<string, SerializableJsonValue> | undefined;
3089
3089
  execution_id?: string | undefined;
3090
3090
  execution_seq?: number | undefined;
3091
3091
  } | {
3092
- type: "tool_process";
3093
3092
  id: string;
3094
- conversation_id: string;
3095
- timestamp: number;
3093
+ type: "tool_process";
3096
3094
  status: "error" | "loading" | "success";
3097
- turn_id: string;
3098
- tool_name: string;
3099
3095
  tool_call_id: string & z.BRAND<"ToolCallId">;
3100
- phase: "start" | "update" | "complete" | "error";
3096
+ tool_name: string;
3097
+ timestamp: number;
3098
+ conversation_id: string;
3099
+ turn_id: string;
3100
+ phase: "error" | "start" | "update" | "complete";
3101
+ payload?: SerializableJsonValue | undefined;
3102
+ args?: SerializableJsonValue | undefined;
3101
3103
  metadata?: Record<string, SerializableJsonValue> | undefined;
3102
3104
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3103
3105
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3104
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3105
- args?: SerializableJsonValue | undefined;
3106
- payload?: SerializableJsonValue | undefined;
3106
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3107
3107
  meta?: Record<string, SerializableJsonValue> | undefined;
3108
3108
  execution_id?: string | undefined;
3109
3109
  execution_seq?: number | undefined;
3110
3110
  } | {
3111
- type: "tool_output";
3112
3111
  id: string;
3113
- conversation_id: string;
3114
- timestamp: number;
3112
+ type: "tool_output";
3115
3113
  status: "error" | "success";
3116
- turn_id: string;
3117
- tool_name: string;
3118
3114
  tool_call_id: string & z.BRAND<"ToolCallId">;
3115
+ tool_name: string;
3116
+ timestamp: number;
3117
+ conversation_id: string;
3118
+ turn_id: string;
3119
3119
  observation: string;
3120
+ data?: SerializableJsonValue | undefined;
3121
+ error?: string | undefined;
3120
3122
  metadata?: Record<string, SerializableJsonValue> | undefined;
3121
- run_id?: (string & z.BRAND<"RunId">) | undefined;
3122
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3123
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3124
3123
  attachments?: {
3125
3124
  id: string;
3126
3125
  kind: "image";
@@ -3133,28 +3132,35 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3133
3132
  fileName?: string | undefined;
3134
3133
  label?: string | undefined;
3135
3134
  }[] | undefined;
3136
- error?: string | undefined;
3137
- data?: SerializableJsonValue | undefined;
3135
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
3136
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3137
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3138
3138
  error_code?: string | undefined;
3139
3139
  duration_ms?: number | undefined;
3140
3140
  execution_id?: string | undefined;
3141
3141
  execution_seq?: number | undefined;
3142
3142
  } | {
3143
- type: "subrun_trace";
3144
3143
  id: string;
3145
- conversation_id: string;
3144
+ type: "subrun_trace";
3145
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
3146
3146
  timestamp: number;
3147
+ conversation_id: string;
3147
3148
  turn_id: string;
3148
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
3149
3149
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
3150
3150
  subrun_id: string;
3151
3151
  source_event_id: string;
3152
3152
  status?: "error" | "loading" | "success" | undefined;
3153
- metadata?: Record<string, SerializableJsonValue> | undefined;
3154
- run_id?: (string & z.BRAND<"RunId">) | undefined;
3155
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3156
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3153
+ tool_calls?: {
3154
+ tool_call_id: string & z.BRAND<"ToolCallId">;
3155
+ tool_name: string;
3156
+ args: Record<string, SerializableJsonValue>;
3157
+ }[] | undefined;
3158
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
3159
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
3160
+ tool_name?: string | undefined;
3161
+ args?: Record<string, SerializableJsonValue> | undefined;
3157
3162
  content?: string | undefined;
3163
+ metadata?: Record<string, SerializableJsonValue> | undefined;
3158
3164
  attachments?: {
3159
3165
  id: string;
3160
3166
  kind: "image";
@@ -3167,23 +3173,17 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3167
3173
  fileName?: string | undefined;
3168
3174
  label?: string | undefined;
3169
3175
  }[] | undefined;
3170
- delta?: string | undefined;
3171
- tool_name?: string | undefined;
3172
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
3173
- phase?: "start" | "update" | "complete" | "error" | undefined;
3174
- args?: Record<string, SerializableJsonValue> | undefined;
3175
- tool_calls?: {
3176
- tool_name: string;
3177
- tool_call_id: string & z.BRAND<"ToolCallId">;
3178
- args: Record<string, SerializableJsonValue>;
3179
- }[] | undefined;
3176
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
3177
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3178
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3179
+ delta?: string | undefined;
3180
+ phase?: "error" | "start" | "update" | "complete" | undefined;
3180
3181
  meta?: Record<string, SerializableJsonValue> | undefined;
3181
3182
  duration_ms?: number | undefined;
3182
3183
  subrun_parent_id?: string | undefined;
3183
3184
  answer_id?: string | undefined;
3184
3185
  seq?: number | undefined;
3185
3186
  is_last?: boolean | undefined;
3186
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
3187
3187
  output?: SerializableJsonValue | undefined;
3188
3188
  original_message_count?: number | undefined;
3189
3189
  compression_ratio?: number | undefined;
@@ -3192,62 +3192,62 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3192
3192
  execution_id?: string | undefined;
3193
3193
  execution_seq?: number | undefined;
3194
3194
  } | {
3195
- type: "requires_user_interaction";
3196
3195
  id: string;
3197
- conversation_id: string;
3196
+ type: "requires_user_interaction";
3197
+ tool_call_id: string & z.BRAND<"ToolCallId">;
3198
3198
  timestamp: number;
3199
- turn_id: string;
3200
3199
  run_id: string & z.BRAND<"RunId">;
3201
- tool_call_id: string & z.BRAND<"ToolCallId">;
3200
+ conversation_id: string;
3201
+ turn_id: string;
3202
3202
  interaction_id: string;
3203
3203
  checkpoint_revision: number;
3204
3204
  resume_token: string;
3205
3205
  interaction_status: "pending";
3206
3206
  metadata?: Record<string, SerializableJsonValue> | undefined;
3207
3207
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3208
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3208
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3209
3209
  form?: SerializableJsonValue | undefined;
3210
3210
  interaction_type?: string | undefined;
3211
3211
  prompt?: string | undefined;
3212
3212
  execution_id?: string | undefined;
3213
3213
  execution_seq?: number | undefined;
3214
3214
  } | {
3215
- type: "error";
3216
3215
  id: string;
3217
- conversation_id: string;
3216
+ type: "error";
3217
+ error: string;
3218
3218
  timestamp: number;
3219
+ conversation_id: string;
3219
3220
  turn_id: string;
3220
- error: string;
3221
3221
  metadata?: Record<string, SerializableJsonValue> | undefined;
3222
3222
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3223
3223
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3224
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3224
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3225
3225
  error_code?: string | undefined;
3226
3226
  details?: SerializableJsonValue | undefined;
3227
3227
  retryable?: boolean | undefined;
3228
3228
  execution_id?: string | undefined;
3229
3229
  execution_seq?: number | undefined;
3230
3230
  } | {
3231
- type: "transport_error";
3232
3231
  id: string;
3233
- conversation_id: string;
3232
+ type: "transport_error";
3233
+ error: string;
3234
3234
  timestamp: number;
3235
+ conversation_id: string;
3235
3236
  turn_id: string;
3236
- error: string;
3237
3237
  execution_id: string;
3238
3238
  metadata?: Record<string, SerializableJsonValue> | undefined;
3239
3239
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3240
3240
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3241
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3241
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3242
3242
  error_code?: string | undefined;
3243
3243
  details?: SerializableJsonValue | undefined;
3244
3244
  retryable?: boolean | undefined;
3245
3245
  execution_seq?: number | undefined;
3246
3246
  } | {
3247
- type: "context_usage_snapshot";
3248
3247
  id: string;
3249
- conversation_id: string;
3248
+ type: "context_usage_snapshot";
3250
3249
  timestamp: number;
3250
+ conversation_id: string;
3251
3251
  turn_id: string;
3252
3252
  context_usage: {
3253
3253
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -3270,23 +3270,23 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3270
3270
  metadata?: Record<string, SerializableJsonValue> | undefined;
3271
3271
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3272
3272
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3273
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3273
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3274
3274
  user_message_id?: string | undefined;
3275
3275
  execution_id?: string | undefined;
3276
3276
  execution_seq?: number | undefined;
3277
3277
  } | {
3278
- type: "run_execution_metrics";
3279
3278
  id: string;
3280
- conversation_id: string;
3279
+ type: "run_execution_metrics";
3281
3280
  timestamp: number;
3281
+ conversation_id: string;
3282
3282
  turn_id: string;
3283
3283
  duration_ms: number;
3284
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
3284
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
3285
3285
  execution_id: string;
3286
3286
  metadata?: Record<string, SerializableJsonValue> | undefined;
3287
3287
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3288
3288
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3289
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3289
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3290
3290
  user_message_id?: string | undefined;
3291
3291
  context_usage?: {
3292
3292
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -3308,40 +3308,40 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3308
3308
  } | undefined;
3309
3309
  execution_seq?: number | undefined;
3310
3310
  } | {
3311
- type: "run_status";
3312
3311
  id: string;
3313
- conversation_id: string;
3312
+ type: "run_status";
3313
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
3314
3314
  timestamp: number;
3315
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
3316
- turn_id: string;
3317
3315
  run_id: string & z.BRAND<"RunId">;
3316
+ conversation_id: string;
3317
+ turn_id: string;
3318
3318
  execution_id: string;
3319
3319
  metadata?: Record<string, SerializableJsonValue> | undefined;
3320
3320
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3321
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3321
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3322
3322
  execution_seq?: number | undefined;
3323
3323
  reason_message?: string | undefined;
3324
3324
  } | {
3325
- type: "transport_end";
3326
3325
  id: string;
3327
- conversation_id: string;
3326
+ type: "transport_end";
3328
3327
  timestamp: number;
3328
+ conversation_id: string;
3329
3329
  turn_id: string;
3330
3330
  execution_id: string;
3331
3331
  metadata?: Record<string, SerializableJsonValue> | undefined;
3332
3332
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3333
3333
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3334
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3335
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
3334
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3335
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
3336
3336
  execution_seq?: number | undefined;
3337
3337
  reason_message?: string | undefined;
3338
3338
  } | {
3339
- type: "history_summary";
3340
3339
  id: string;
3341
- conversation_id: string;
3340
+ type: "history_summary";
3341
+ content: string;
3342
3342
  timestamp: number;
3343
+ conversation_id: string;
3343
3344
  turn_id: string;
3344
- content: string;
3345
3345
  original_message_count: number;
3346
3346
  replaced_message_ids: string[];
3347
3347
  summary_seq: number;
@@ -3349,31 +3349,31 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3349
3349
  metadata?: Record<string, SerializableJsonValue> | undefined;
3350
3350
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3351
3351
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3352
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3352
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3353
3353
  compression_ratio?: number | undefined;
3354
3354
  included_old_summary?: boolean | undefined;
3355
3355
  execution_id?: string | undefined;
3356
3356
  execution_seq?: number | undefined;
3357
3357
  } | {
3358
- type: "summarization_start";
3359
3358
  id: string;
3360
- conversation_id: string;
3359
+ type: "summarization_start";
3361
3360
  timestamp: number;
3362
- turn_id: string;
3363
3361
  run_id: string & z.BRAND<"RunId">;
3362
+ conversation_id: string;
3363
+ turn_id: string;
3364
3364
  execution_id: string;
3365
3365
  summarization_id: string;
3366
3366
  metadata?: Record<string, SerializableJsonValue> | undefined;
3367
3367
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3368
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3368
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3369
3369
  execution_seq?: number | undefined;
3370
3370
  } | {
3371
- type: "summarization_end";
3372
3371
  id: string;
3373
- conversation_id: string;
3372
+ type: "summarization_end";
3374
3373
  timestamp: number;
3375
- turn_id: string;
3376
3374
  run_id: string & z.BRAND<"RunId">;
3375
+ conversation_id: string;
3376
+ turn_id: string;
3377
3377
  original_message_count: number;
3378
3378
  execution_id: string;
3379
3379
  summary_id: string;
@@ -3381,44 +3381,44 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3381
3381
  compressed_message_count: number;
3382
3382
  metadata?: Record<string, SerializableJsonValue> | undefined;
3383
3383
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3384
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3384
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3385
3385
  compression_ratio?: number | undefined;
3386
3386
  execution_seq?: number | undefined;
3387
3387
  } | {
3388
- type: "summarization_error";
3389
3388
  id: string;
3390
- conversation_id: string;
3389
+ type: "summarization_error";
3390
+ error: string;
3391
3391
  timestamp: number;
3392
- turn_id: string;
3393
3392
  run_id: string & z.BRAND<"RunId">;
3394
- error: string;
3393
+ conversation_id: string;
3394
+ turn_id: string;
3395
3395
  execution_id: string;
3396
3396
  summarization_id: string;
3397
3397
  metadata?: Record<string, SerializableJsonValue> | undefined;
3398
3398
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3399
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3399
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3400
3400
  execution_seq?: number | undefined;
3401
3401
  }, {
3402
- type: "thought";
3403
3402
  id: string;
3404
- conversation_id: string;
3403
+ type: "thought";
3405
3404
  timestamp: number;
3405
+ conversation_id: string;
3406
3406
  turn_id: string;
3407
+ content?: string | undefined;
3407
3408
  metadata?: Record<string, SerializableJsonValue> | undefined;
3408
3409
  run_id?: string | undefined;
3409
3410
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3410
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3411
- content?: string | undefined;
3411
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3412
3412
  thought_message_id?: string | undefined;
3413
3413
  delta?: string | undefined;
3414
3414
  is_complete?: boolean | undefined;
3415
3415
  execution_id?: string | undefined;
3416
3416
  execution_seq?: number | undefined;
3417
3417
  } | {
3418
- type: "final_answer_chunk";
3419
3418
  id: string;
3420
- conversation_id: string;
3419
+ type: "final_answer_chunk";
3421
3420
  timestamp: number;
3421
+ conversation_id: string;
3422
3422
  turn_id: string;
3423
3423
  answer_id: string;
3424
3424
  seq: number;
@@ -3426,107 +3426,106 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3426
3426
  metadata?: Record<string, SerializableJsonValue> | undefined;
3427
3427
  run_id?: string | undefined;
3428
3428
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3429
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3429
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3430
3430
  is_last?: boolean | undefined;
3431
3431
  execution_id?: string | undefined;
3432
3432
  execution_seq?: number | undefined;
3433
3433
  } | {
3434
- type: "final_answer_reset";
3435
3434
  id: string;
3436
- conversation_id: string;
3435
+ type: "final_answer_reset";
3437
3436
  timestamp: number;
3437
+ conversation_id: string;
3438
3438
  turn_id: string;
3439
3439
  metadata?: Record<string, SerializableJsonValue> | undefined;
3440
3440
  run_id?: string | undefined;
3441
3441
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3442
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3442
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3443
3443
  answer_id?: string | undefined;
3444
3444
  thought_message_ids?: string[] | undefined;
3445
3445
  execution_id?: string | undefined;
3446
3446
  execution_seq?: number | undefined;
3447
3447
  } | {
3448
- type: "final_answer";
3449
3448
  id: string;
3450
- conversation_id: string;
3449
+ type: "final_answer";
3450
+ completion_reason: "tool_call" | "terminal" | "interrupted";
3451
+ content: string;
3451
3452
  timestamp: number;
3453
+ conversation_id: string;
3452
3454
  turn_id: string;
3453
- content: string;
3454
3455
  answer_id: string;
3455
- completion_reason: "tool_call" | "terminal" | "interrupted";
3456
3456
  metadata?: Record<string, SerializableJsonValue> | undefined;
3457
3457
  run_id?: string | undefined;
3458
3458
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3459
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3459
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3460
3460
  meta?: Record<string, SerializableJsonValue> | undefined;
3461
3461
  execution_id?: string | undefined;
3462
3462
  execution_seq?: number | undefined;
3463
3463
  } | {
3464
- type: "markdown_chunk";
3465
3464
  id: string;
3466
- conversation_id: string;
3465
+ type: "markdown_chunk";
3466
+ text: string;
3467
3467
  timestamp: number;
3468
+ conversation_id: string;
3468
3469
  turn_id: string;
3469
- text: string;
3470
3470
  metadata?: Record<string, SerializableJsonValue> | undefined;
3471
3471
  run_id?: string | undefined;
3472
3472
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3473
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3473
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3474
3474
  seq?: number | undefined;
3475
3475
  execution_id?: string | undefined;
3476
3476
  execution_seq?: number | undefined;
3477
- content_type?: "code" | "image" | "text" | "table" | undefined;
3477
+ content_type?: "code" | "text" | "image" | "table" | undefined;
3478
3478
  } | {
3479
- type: "tool_call_decision";
3480
3479
  id: string;
3481
- conversation_id: string;
3482
- timestamp: number;
3480
+ type: "tool_call_decision";
3483
3481
  status: "error" | "loading" | "success";
3484
- turn_id: string;
3485
- tool_name: string;
3486
3482
  tool_call_id: string;
3487
- phase: "start" | "update" | "complete" | "error";
3483
+ tool_name: string;
3484
+ timestamp: number;
3485
+ conversation_id: string;
3486
+ turn_id: string;
3487
+ phase: "error" | "start" | "update" | "complete";
3488
+ payload?: SerializableJsonValue | undefined;
3489
+ args?: SerializableJsonValue | undefined;
3488
3490
  metadata?: Record<string, SerializableJsonValue> | undefined;
3489
3491
  run_id?: string | undefined;
3490
3492
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3491
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3492
- args?: SerializableJsonValue | undefined;
3493
- payload?: SerializableJsonValue | undefined;
3493
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3494
3494
  meta?: Record<string, SerializableJsonValue> | undefined;
3495
3495
  execution_id?: string | undefined;
3496
3496
  execution_seq?: number | undefined;
3497
3497
  } | {
3498
- type: "tool_process";
3499
3498
  id: string;
3500
- conversation_id: string;
3501
- timestamp: number;
3499
+ type: "tool_process";
3502
3500
  status: "error" | "loading" | "success";
3503
- turn_id: string;
3504
- tool_name: string;
3505
3501
  tool_call_id: string;
3506
- phase: "start" | "update" | "complete" | "error";
3502
+ tool_name: string;
3503
+ timestamp: number;
3504
+ conversation_id: string;
3505
+ turn_id: string;
3506
+ phase: "error" | "start" | "update" | "complete";
3507
+ payload?: SerializableJsonValue | undefined;
3508
+ args?: SerializableJsonValue | undefined;
3507
3509
  metadata?: Record<string, SerializableJsonValue> | undefined;
3508
3510
  run_id?: string | undefined;
3509
3511
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3510
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3511
- args?: SerializableJsonValue | undefined;
3512
- payload?: SerializableJsonValue | undefined;
3512
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3513
3513
  meta?: Record<string, SerializableJsonValue> | undefined;
3514
3514
  execution_id?: string | undefined;
3515
3515
  execution_seq?: number | undefined;
3516
3516
  } | {
3517
- type: "tool_output";
3518
3517
  id: string;
3519
- conversation_id: string;
3520
- timestamp: number;
3518
+ type: "tool_output";
3521
3519
  status: "error" | "success";
3522
- turn_id: string;
3523
- tool_name: string;
3524
3520
  tool_call_id: string;
3521
+ tool_name: string;
3522
+ timestamp: number;
3523
+ conversation_id: string;
3524
+ turn_id: string;
3525
3525
  observation: string;
3526
+ data?: SerializableJsonValue | undefined;
3527
+ error?: string | undefined;
3526
3528
  metadata?: Record<string, SerializableJsonValue> | undefined;
3527
- run_id?: string | undefined;
3528
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3529
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3530
3529
  attachments?: {
3531
3530
  id: string;
3532
3531
  kind: "image";
@@ -3539,28 +3538,35 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3539
3538
  fileName?: string | undefined;
3540
3539
  label?: string | undefined;
3541
3540
  }[] | undefined;
3542
- error?: string | undefined;
3543
- data?: SerializableJsonValue | undefined;
3541
+ run_id?: string | undefined;
3542
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3543
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3544
3544
  error_code?: string | undefined;
3545
3545
  duration_ms?: number | undefined;
3546
3546
  execution_id?: string | undefined;
3547
3547
  execution_seq?: number | undefined;
3548
3548
  } | {
3549
- type: "subrun_trace";
3550
3549
  id: string;
3551
- conversation_id: string;
3550
+ type: "subrun_trace";
3551
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
3552
3552
  timestamp: number;
3553
+ conversation_id: string;
3553
3554
  turn_id: string;
3554
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
3555
3555
  parent_tool_call_id: string;
3556
3556
  subrun_id: string;
3557
3557
  source_event_id: string;
3558
3558
  status?: "error" | "loading" | "success" | undefined;
3559
- metadata?: Record<string, SerializableJsonValue> | undefined;
3560
- run_id?: string | undefined;
3561
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3562
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3559
+ tool_calls?: {
3560
+ tool_call_id: string;
3561
+ tool_name: string;
3562
+ args: Record<string, SerializableJsonValue>;
3563
+ }[] | undefined;
3564
+ tool_call_id?: string | undefined;
3565
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
3566
+ tool_name?: string | undefined;
3567
+ args?: Record<string, SerializableJsonValue> | undefined;
3563
3568
  content?: string | undefined;
3569
+ metadata?: Record<string, SerializableJsonValue> | undefined;
3564
3570
  attachments?: {
3565
3571
  id: string;
3566
3572
  kind: "image";
@@ -3573,23 +3579,17 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3573
3579
  fileName?: string | undefined;
3574
3580
  label?: string | undefined;
3575
3581
  }[] | undefined;
3582
+ run_id?: string | undefined;
3583
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3584
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3576
3585
  delta?: string | undefined;
3577
- tool_name?: string | undefined;
3578
- tool_call_id?: string | undefined;
3579
- phase?: "start" | "update" | "complete" | "error" | undefined;
3580
- args?: Record<string, SerializableJsonValue> | undefined;
3581
- tool_calls?: {
3582
- tool_name: string;
3583
- tool_call_id: string;
3584
- args: Record<string, SerializableJsonValue>;
3585
- }[] | undefined;
3586
+ phase?: "error" | "start" | "update" | "complete" | undefined;
3586
3587
  meta?: Record<string, SerializableJsonValue> | undefined;
3587
3588
  duration_ms?: number | undefined;
3588
3589
  subrun_parent_id?: string | undefined;
3589
3590
  answer_id?: string | undefined;
3590
3591
  seq?: number | undefined;
3591
3592
  is_last?: boolean | undefined;
3592
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
3593
3593
  output?: SerializableJsonValue | undefined;
3594
3594
  original_message_count?: number | undefined;
3595
3595
  compression_ratio?: number | undefined;
@@ -3598,62 +3598,62 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3598
3598
  execution_id?: string | undefined;
3599
3599
  execution_seq?: number | undefined;
3600
3600
  } | {
3601
- type: "requires_user_interaction";
3602
3601
  id: string;
3603
- conversation_id: string;
3602
+ type: "requires_user_interaction";
3603
+ tool_call_id: string;
3604
3604
  timestamp: number;
3605
- turn_id: string;
3606
3605
  run_id: string;
3607
- tool_call_id: string;
3606
+ conversation_id: string;
3607
+ turn_id: string;
3608
3608
  interaction_id: string;
3609
3609
  checkpoint_revision: number;
3610
3610
  resume_token: string;
3611
3611
  interaction_status: "pending";
3612
3612
  metadata?: Record<string, SerializableJsonValue> | undefined;
3613
3613
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3614
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3614
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3615
3615
  form?: SerializableJsonValue | undefined;
3616
3616
  interaction_type?: string | undefined;
3617
3617
  prompt?: string | undefined;
3618
3618
  execution_id?: string | undefined;
3619
3619
  execution_seq?: number | undefined;
3620
3620
  } | {
3621
- type: "error";
3622
3621
  id: string;
3623
- conversation_id: string;
3622
+ type: "error";
3623
+ error: string;
3624
3624
  timestamp: number;
3625
+ conversation_id: string;
3625
3626
  turn_id: string;
3626
- error: string;
3627
3627
  metadata?: Record<string, SerializableJsonValue> | undefined;
3628
3628
  run_id?: string | undefined;
3629
3629
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3630
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3630
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3631
3631
  error_code?: string | undefined;
3632
3632
  details?: SerializableJsonValue | undefined;
3633
3633
  retryable?: boolean | undefined;
3634
3634
  execution_id?: string | undefined;
3635
3635
  execution_seq?: number | undefined;
3636
3636
  } | {
3637
- type: "transport_error";
3638
3637
  id: string;
3639
- conversation_id: string;
3638
+ type: "transport_error";
3639
+ error: string;
3640
3640
  timestamp: number;
3641
+ conversation_id: string;
3641
3642
  turn_id: string;
3642
- error: string;
3643
3643
  execution_id: string;
3644
3644
  metadata?: Record<string, SerializableJsonValue> | undefined;
3645
3645
  run_id?: string | undefined;
3646
3646
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3647
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3647
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3648
3648
  error_code?: string | undefined;
3649
3649
  details?: SerializableJsonValue | undefined;
3650
3650
  retryable?: boolean | undefined;
3651
3651
  execution_seq?: number | undefined;
3652
3652
  } | {
3653
- type: "context_usage_snapshot";
3654
3653
  id: string;
3655
- conversation_id: string;
3654
+ type: "context_usage_snapshot";
3656
3655
  timestamp: number;
3656
+ conversation_id: string;
3657
3657
  turn_id: string;
3658
3658
  context_usage: {
3659
3659
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -3676,23 +3676,23 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3676
3676
  metadata?: Record<string, SerializableJsonValue> | undefined;
3677
3677
  run_id?: string | undefined;
3678
3678
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3679
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3679
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3680
3680
  user_message_id?: string | undefined;
3681
3681
  execution_id?: string | undefined;
3682
3682
  execution_seq?: number | undefined;
3683
3683
  } | {
3684
- type: "run_execution_metrics";
3685
3684
  id: string;
3686
- conversation_id: string;
3685
+ type: "run_execution_metrics";
3687
3686
  timestamp: number;
3687
+ conversation_id: string;
3688
3688
  turn_id: string;
3689
3689
  duration_ms: number;
3690
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
3690
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
3691
3691
  execution_id: string;
3692
3692
  metadata?: Record<string, SerializableJsonValue> | undefined;
3693
3693
  run_id?: string | undefined;
3694
3694
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3695
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3695
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3696
3696
  user_message_id?: string | undefined;
3697
3697
  context_usage?: {
3698
3698
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -3714,40 +3714,40 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3714
3714
  } | undefined;
3715
3715
  execution_seq?: number | undefined;
3716
3716
  } | {
3717
- type: "run_status";
3718
3717
  id: string;
3719
- conversation_id: string;
3718
+ type: "run_status";
3719
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
3720
3720
  timestamp: number;
3721
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
3722
- turn_id: string;
3723
3721
  run_id: string;
3722
+ conversation_id: string;
3723
+ turn_id: string;
3724
3724
  execution_id: string;
3725
3725
  metadata?: Record<string, SerializableJsonValue> | undefined;
3726
3726
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3727
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3727
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3728
3728
  execution_seq?: number | undefined;
3729
3729
  reason_message?: string | undefined;
3730
3730
  } | {
3731
- type: "transport_end";
3732
3731
  id: string;
3733
- conversation_id: string;
3732
+ type: "transport_end";
3734
3733
  timestamp: number;
3734
+ conversation_id: string;
3735
3735
  turn_id: string;
3736
3736
  execution_id: string;
3737
3737
  metadata?: Record<string, SerializableJsonValue> | undefined;
3738
3738
  run_id?: string | undefined;
3739
3739
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3740
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3741
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
3740
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3741
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
3742
3742
  execution_seq?: number | undefined;
3743
3743
  reason_message?: string | undefined;
3744
3744
  } | {
3745
- type: "history_summary";
3746
3745
  id: string;
3747
- conversation_id: string;
3746
+ type: "history_summary";
3747
+ content: string;
3748
3748
  timestamp: number;
3749
+ conversation_id: string;
3749
3750
  turn_id: string;
3750
- content: string;
3751
3751
  original_message_count: number;
3752
3752
  replaced_message_ids: string[];
3753
3753
  summary_seq: number;
@@ -3755,31 +3755,31 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3755
3755
  metadata?: Record<string, SerializableJsonValue> | undefined;
3756
3756
  run_id?: string | undefined;
3757
3757
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3758
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3758
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3759
3759
  compression_ratio?: number | undefined;
3760
3760
  included_old_summary?: boolean | undefined;
3761
3761
  execution_id?: string | undefined;
3762
3762
  execution_seq?: number | undefined;
3763
3763
  } | {
3764
- type: "summarization_start";
3765
3764
  id: string;
3766
- conversation_id: string;
3765
+ type: "summarization_start";
3767
3766
  timestamp: number;
3768
- turn_id: string;
3769
3767
  run_id: string;
3768
+ conversation_id: string;
3769
+ turn_id: string;
3770
3770
  execution_id: string;
3771
3771
  summarization_id: string;
3772
3772
  metadata?: Record<string, SerializableJsonValue> | undefined;
3773
3773
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3774
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3774
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3775
3775
  execution_seq?: number | undefined;
3776
3776
  } | {
3777
- type: "summarization_end";
3778
3777
  id: string;
3779
- conversation_id: string;
3778
+ type: "summarization_end";
3780
3779
  timestamp: number;
3781
- turn_id: string;
3782
3780
  run_id: string;
3781
+ conversation_id: string;
3782
+ turn_id: string;
3783
3783
  original_message_count: number;
3784
3784
  execution_id: string;
3785
3785
  summary_id: string;
@@ -3787,48 +3787,48 @@ declare const SSEEvent: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObjec
3787
3787
  compressed_message_count: number;
3788
3788
  metadata?: Record<string, SerializableJsonValue> | undefined;
3789
3789
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3790
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3790
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3791
3791
  compression_ratio?: number | undefined;
3792
3792
  execution_seq?: number | undefined;
3793
3793
  } | {
3794
- type: "summarization_error";
3795
3794
  id: string;
3796
- conversation_id: string;
3795
+ type: "summarization_error";
3796
+ error: string;
3797
3797
  timestamp: number;
3798
- turn_id: string;
3799
3798
  run_id: string;
3800
- error: string;
3799
+ conversation_id: string;
3800
+ turn_id: string;
3801
3801
  execution_id: string;
3802
3802
  summarization_id: string;
3803
3803
  metadata?: Record<string, SerializableJsonValue> | undefined;
3804
3804
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3805
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3805
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3806
3806
  execution_seq?: number | undefined;
3807
3807
  }>;
3808
3808
  type SSEEvent = z.infer<typeof SSEEvent>;
3809
3809
  /** Renderer/transport admission 前的 wire 输入;strict parse 后才可作为 SSEEvent 使用。 */
3810
3810
  type SSEEventInput = z.input<typeof SSEEvent>;
3811
3811
  declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
3812
- type: "thought";
3813
3812
  id: string;
3814
- conversation_id: string;
3813
+ type: "thought";
3815
3814
  timestamp: number;
3815
+ conversation_id: string;
3816
3816
  turn_id: string;
3817
+ content?: string | undefined;
3817
3818
  metadata?: Record<string, SerializableJsonValue> | undefined;
3818
3819
  run_id?: string | undefined;
3819
3820
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3820
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3821
- content?: string | undefined;
3821
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3822
3822
  thought_message_id?: string | undefined;
3823
3823
  delta?: string | undefined;
3824
3824
  is_complete?: boolean | undefined;
3825
3825
  execution_id?: string | undefined;
3826
3826
  execution_seq?: number | undefined;
3827
3827
  } | {
3828
- type: "final_answer_chunk";
3829
3828
  id: string;
3830
- conversation_id: string;
3829
+ type: "final_answer_chunk";
3831
3830
  timestamp: number;
3831
+ conversation_id: string;
3832
3832
  turn_id: string;
3833
3833
  answer_id: string;
3834
3834
  seq: number;
@@ -3836,107 +3836,106 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
3836
3836
  metadata?: Record<string, SerializableJsonValue> | undefined;
3837
3837
  run_id?: string | undefined;
3838
3838
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3839
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3839
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3840
3840
  is_last?: boolean | undefined;
3841
3841
  execution_id?: string | undefined;
3842
3842
  execution_seq?: number | undefined;
3843
3843
  } | {
3844
- type: "final_answer_reset";
3845
3844
  id: string;
3846
- conversation_id: string;
3845
+ type: "final_answer_reset";
3847
3846
  timestamp: number;
3847
+ conversation_id: string;
3848
3848
  turn_id: string;
3849
3849
  metadata?: Record<string, SerializableJsonValue> | undefined;
3850
3850
  run_id?: string | undefined;
3851
3851
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3852
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3852
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3853
3853
  answer_id?: string | undefined;
3854
3854
  thought_message_ids?: string[] | undefined;
3855
3855
  execution_id?: string | undefined;
3856
3856
  execution_seq?: number | undefined;
3857
3857
  } | {
3858
- type: "final_answer";
3859
3858
  id: string;
3860
- conversation_id: string;
3859
+ type: "final_answer";
3860
+ completion_reason: "tool_call" | "terminal" | "interrupted";
3861
+ content: string;
3861
3862
  timestamp: number;
3863
+ conversation_id: string;
3862
3864
  turn_id: string;
3863
- content: string;
3864
3865
  answer_id: string;
3865
- completion_reason: "tool_call" | "terminal" | "interrupted";
3866
3866
  metadata?: Record<string, SerializableJsonValue> | undefined;
3867
3867
  run_id?: string | undefined;
3868
3868
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3869
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3869
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3870
3870
  meta?: Record<string, SerializableJsonValue> | undefined;
3871
3871
  execution_id?: string | undefined;
3872
3872
  execution_seq?: number | undefined;
3873
3873
  } | {
3874
- type: "markdown_chunk";
3875
3874
  id: string;
3876
- conversation_id: string;
3875
+ type: "markdown_chunk";
3876
+ text: string;
3877
3877
  timestamp: number;
3878
+ conversation_id: string;
3878
3879
  turn_id: string;
3879
- text: string;
3880
3880
  metadata?: Record<string, SerializableJsonValue> | undefined;
3881
3881
  run_id?: string | undefined;
3882
3882
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3883
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3883
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3884
3884
  seq?: number | undefined;
3885
3885
  execution_id?: string | undefined;
3886
3886
  execution_seq?: number | undefined;
3887
- content_type?: "code" | "image" | "text" | "table" | undefined;
3887
+ content_type?: "code" | "text" | "image" | "table" | undefined;
3888
3888
  } | {
3889
- type: "tool_call_decision";
3890
3889
  id: string;
3891
- conversation_id: string;
3892
- timestamp: number;
3890
+ type: "tool_call_decision";
3893
3891
  status: "error" | "loading" | "success";
3894
- turn_id: string;
3895
- tool_name: string;
3896
3892
  tool_call_id: string;
3897
- phase: "start" | "update" | "complete" | "error";
3893
+ tool_name: string;
3894
+ timestamp: number;
3895
+ conversation_id: string;
3896
+ turn_id: string;
3897
+ phase: "error" | "start" | "update" | "complete";
3898
+ payload?: SerializableJsonValue | undefined;
3899
+ args?: SerializableJsonValue | undefined;
3898
3900
  metadata?: Record<string, SerializableJsonValue> | undefined;
3899
3901
  run_id?: string | undefined;
3900
3902
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3901
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3902
- args?: SerializableJsonValue | undefined;
3903
- payload?: SerializableJsonValue | undefined;
3903
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3904
3904
  meta?: Record<string, SerializableJsonValue> | undefined;
3905
3905
  execution_id?: string | undefined;
3906
3906
  execution_seq?: number | undefined;
3907
3907
  } | {
3908
- type: "tool_process";
3909
3908
  id: string;
3910
- conversation_id: string;
3911
- timestamp: number;
3909
+ type: "tool_process";
3912
3910
  status: "error" | "loading" | "success";
3913
- turn_id: string;
3914
- tool_name: string;
3915
3911
  tool_call_id: string;
3916
- phase: "start" | "update" | "complete" | "error";
3912
+ tool_name: string;
3913
+ timestamp: number;
3914
+ conversation_id: string;
3915
+ turn_id: string;
3916
+ phase: "error" | "start" | "update" | "complete";
3917
+ payload?: SerializableJsonValue | undefined;
3918
+ args?: SerializableJsonValue | undefined;
3917
3919
  metadata?: Record<string, SerializableJsonValue> | undefined;
3918
3920
  run_id?: string | undefined;
3919
3921
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3920
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3921
- args?: SerializableJsonValue | undefined;
3922
- payload?: SerializableJsonValue | undefined;
3922
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3923
3923
  meta?: Record<string, SerializableJsonValue> | undefined;
3924
3924
  execution_id?: string | undefined;
3925
3925
  execution_seq?: number | undefined;
3926
3926
  } | {
3927
- type: "tool_output";
3928
3927
  id: string;
3929
- conversation_id: string;
3930
- timestamp: number;
3928
+ type: "tool_output";
3931
3929
  status: "error" | "success";
3932
- turn_id: string;
3933
- tool_name: string;
3934
3930
  tool_call_id: string;
3931
+ tool_name: string;
3932
+ timestamp: number;
3933
+ conversation_id: string;
3934
+ turn_id: string;
3935
3935
  observation: string;
3936
+ data?: SerializableJsonValue | undefined;
3937
+ error?: string | undefined;
3936
3938
  metadata?: Record<string, SerializableJsonValue> | undefined;
3937
- run_id?: string | undefined;
3938
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3939
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3940
3939
  attachments?: {
3941
3940
  id: string;
3942
3941
  kind: "image";
@@ -3949,28 +3948,35 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
3949
3948
  fileName?: string | undefined;
3950
3949
  label?: string | undefined;
3951
3950
  }[] | undefined;
3952
- error?: string | undefined;
3953
- data?: SerializableJsonValue | undefined;
3951
+ run_id?: string | undefined;
3952
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3953
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3954
3954
  error_code?: string | undefined;
3955
3955
  duration_ms?: number | undefined;
3956
3956
  execution_id?: string | undefined;
3957
3957
  execution_seq?: number | undefined;
3958
3958
  } | {
3959
- type: "subrun_trace";
3960
3959
  id: string;
3961
- conversation_id: string;
3960
+ type: "subrun_trace";
3961
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
3962
3962
  timestamp: number;
3963
+ conversation_id: string;
3963
3964
  turn_id: string;
3964
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
3965
3965
  parent_tool_call_id: string;
3966
3966
  subrun_id: string;
3967
3967
  source_event_id: string;
3968
3968
  status?: "error" | "loading" | "success" | undefined;
3969
- metadata?: Record<string, SerializableJsonValue> | undefined;
3970
- run_id?: string | undefined;
3971
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3972
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
3969
+ tool_calls?: {
3970
+ tool_call_id: string;
3971
+ tool_name: string;
3972
+ args: Record<string, SerializableJsonValue>;
3973
+ }[] | undefined;
3974
+ tool_call_id?: string | undefined;
3975
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
3976
+ tool_name?: string | undefined;
3977
+ args?: Record<string, SerializableJsonValue> | undefined;
3973
3978
  content?: string | undefined;
3979
+ metadata?: Record<string, SerializableJsonValue> | undefined;
3974
3980
  attachments?: {
3975
3981
  id: string;
3976
3982
  kind: "image";
@@ -3983,23 +3989,17 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
3983
3989
  fileName?: string | undefined;
3984
3990
  label?: string | undefined;
3985
3991
  }[] | undefined;
3992
+ run_id?: string | undefined;
3993
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3994
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
3986
3995
  delta?: string | undefined;
3987
- tool_name?: string | undefined;
3988
- tool_call_id?: string | undefined;
3989
- phase?: "start" | "update" | "complete" | "error" | undefined;
3990
- args?: Record<string, SerializableJsonValue> | undefined;
3991
- tool_calls?: {
3992
- tool_name: string;
3993
- tool_call_id: string;
3994
- args: Record<string, SerializableJsonValue>;
3995
- }[] | undefined;
3996
+ phase?: "error" | "start" | "update" | "complete" | undefined;
3996
3997
  meta?: Record<string, SerializableJsonValue> | undefined;
3997
3998
  duration_ms?: number | undefined;
3998
3999
  subrun_parent_id?: string | undefined;
3999
4000
  answer_id?: string | undefined;
4000
4001
  seq?: number | undefined;
4001
4002
  is_last?: boolean | undefined;
4002
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
4003
4003
  output?: SerializableJsonValue | undefined;
4004
4004
  original_message_count?: number | undefined;
4005
4005
  compression_ratio?: number | undefined;
@@ -4008,62 +4008,62 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4008
4008
  execution_id?: string | undefined;
4009
4009
  execution_seq?: number | undefined;
4010
4010
  } | {
4011
- type: "requires_user_interaction";
4012
4011
  id: string;
4013
- conversation_id: string;
4012
+ type: "requires_user_interaction";
4013
+ tool_call_id: string;
4014
4014
  timestamp: number;
4015
- turn_id: string;
4016
4015
  run_id: string;
4017
- tool_call_id: string;
4016
+ conversation_id: string;
4017
+ turn_id: string;
4018
4018
  interaction_id: string;
4019
4019
  checkpoint_revision: number;
4020
4020
  resume_token: string;
4021
4021
  interaction_status: "pending";
4022
4022
  metadata?: Record<string, SerializableJsonValue> | undefined;
4023
4023
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4024
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4024
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4025
4025
  form?: SerializableJsonValue | undefined;
4026
4026
  interaction_type?: string | undefined;
4027
4027
  prompt?: string | undefined;
4028
4028
  execution_id?: string | undefined;
4029
4029
  execution_seq?: number | undefined;
4030
4030
  } | {
4031
- type: "error";
4032
4031
  id: string;
4033
- conversation_id: string;
4032
+ type: "error";
4033
+ error: string;
4034
4034
  timestamp: number;
4035
+ conversation_id: string;
4035
4036
  turn_id: string;
4036
- error: string;
4037
4037
  metadata?: Record<string, SerializableJsonValue> | undefined;
4038
4038
  run_id?: string | undefined;
4039
4039
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4040
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4040
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4041
4041
  error_code?: string | undefined;
4042
4042
  details?: SerializableJsonValue | undefined;
4043
4043
  retryable?: boolean | undefined;
4044
4044
  execution_id?: string | undefined;
4045
4045
  execution_seq?: number | undefined;
4046
4046
  } | {
4047
- type: "transport_error";
4048
4047
  id: string;
4049
- conversation_id: string;
4048
+ type: "transport_error";
4049
+ error: string;
4050
4050
  timestamp: number;
4051
+ conversation_id: string;
4051
4052
  turn_id: string;
4052
- error: string;
4053
4053
  execution_id: string;
4054
4054
  metadata?: Record<string, SerializableJsonValue> | undefined;
4055
4055
  run_id?: string | undefined;
4056
4056
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4057
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4057
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4058
4058
  error_code?: string | undefined;
4059
4059
  details?: SerializableJsonValue | undefined;
4060
4060
  retryable?: boolean | undefined;
4061
4061
  execution_seq?: number | undefined;
4062
4062
  } | {
4063
- type: "context_usage_snapshot";
4064
4063
  id: string;
4065
- conversation_id: string;
4064
+ type: "context_usage_snapshot";
4066
4065
  timestamp: number;
4066
+ conversation_id: string;
4067
4067
  turn_id: string;
4068
4068
  context_usage: {
4069
4069
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -4086,23 +4086,23 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4086
4086
  metadata?: Record<string, SerializableJsonValue> | undefined;
4087
4087
  run_id?: string | undefined;
4088
4088
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4089
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4089
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4090
4090
  user_message_id?: string | undefined;
4091
4091
  execution_id?: string | undefined;
4092
4092
  execution_seq?: number | undefined;
4093
4093
  } | {
4094
- type: "run_execution_metrics";
4095
4094
  id: string;
4096
- conversation_id: string;
4095
+ type: "run_execution_metrics";
4097
4096
  timestamp: number;
4097
+ conversation_id: string;
4098
4098
  turn_id: string;
4099
4099
  duration_ms: number;
4100
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
4100
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
4101
4101
  execution_id: string;
4102
4102
  metadata?: Record<string, SerializableJsonValue> | undefined;
4103
4103
  run_id?: string | undefined;
4104
4104
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4105
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4105
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4106
4106
  user_message_id?: string | undefined;
4107
4107
  context_usage?: {
4108
4108
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -4124,40 +4124,40 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4124
4124
  } | undefined;
4125
4125
  execution_seq?: number | undefined;
4126
4126
  } | {
4127
- type: "run_status";
4128
4127
  id: string;
4129
- conversation_id: string;
4128
+ type: "run_status";
4129
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
4130
4130
  timestamp: number;
4131
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
4132
- turn_id: string;
4133
4131
  run_id: string;
4132
+ conversation_id: string;
4133
+ turn_id: string;
4134
4134
  execution_id: string;
4135
4135
  metadata?: Record<string, SerializableJsonValue> | undefined;
4136
4136
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4137
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4137
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4138
4138
  execution_seq?: number | undefined;
4139
4139
  reason_message?: string | undefined;
4140
4140
  } | {
4141
- type: "transport_end";
4142
4141
  id: string;
4143
- conversation_id: string;
4142
+ type: "transport_end";
4144
4143
  timestamp: number;
4144
+ conversation_id: string;
4145
4145
  turn_id: string;
4146
4146
  execution_id: string;
4147
4147
  metadata?: Record<string, SerializableJsonValue> | undefined;
4148
4148
  run_id?: string | undefined;
4149
4149
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4150
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4151
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
4150
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4151
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
4152
4152
  execution_seq?: number | undefined;
4153
4153
  reason_message?: string | undefined;
4154
4154
  } | {
4155
- type: "history_summary";
4156
4155
  id: string;
4157
- conversation_id: string;
4156
+ type: "history_summary";
4157
+ content: string;
4158
4158
  timestamp: number;
4159
+ conversation_id: string;
4159
4160
  turn_id: string;
4160
- content: string;
4161
4161
  original_message_count: number;
4162
4162
  replaced_message_ids: string[];
4163
4163
  summary_seq: number;
@@ -4165,31 +4165,31 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4165
4165
  metadata?: Record<string, SerializableJsonValue> | undefined;
4166
4166
  run_id?: string | undefined;
4167
4167
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4168
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4168
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4169
4169
  compression_ratio?: number | undefined;
4170
4170
  included_old_summary?: boolean | undefined;
4171
4171
  execution_id?: string | undefined;
4172
4172
  execution_seq?: number | undefined;
4173
4173
  } | {
4174
- type: "summarization_start";
4175
4174
  id: string;
4176
- conversation_id: string;
4175
+ type: "summarization_start";
4177
4176
  timestamp: number;
4178
- turn_id: string;
4179
4177
  run_id: string;
4178
+ conversation_id: string;
4179
+ turn_id: string;
4180
4180
  execution_id: string;
4181
4181
  summarization_id: string;
4182
4182
  metadata?: Record<string, SerializableJsonValue> | undefined;
4183
4183
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4184
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4184
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4185
4185
  execution_seq?: number | undefined;
4186
4186
  } | {
4187
- type: "summarization_end";
4188
4187
  id: string;
4189
- conversation_id: string;
4188
+ type: "summarization_end";
4190
4189
  timestamp: number;
4191
- turn_id: string;
4192
4190
  run_id: string;
4191
+ conversation_id: string;
4192
+ turn_id: string;
4193
4193
  original_message_count: number;
4194
4194
  execution_id: string;
4195
4195
  summary_id: string;
@@ -4197,44 +4197,44 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4197
4197
  compressed_message_count: number;
4198
4198
  metadata?: Record<string, SerializableJsonValue> | undefined;
4199
4199
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4200
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4200
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4201
4201
  compression_ratio?: number | undefined;
4202
4202
  execution_seq?: number | undefined;
4203
4203
  } | {
4204
- type: "summarization_error";
4205
4204
  id: string;
4206
- conversation_id: string;
4205
+ type: "summarization_error";
4206
+ error: string;
4207
4207
  timestamp: number;
4208
- turn_id: string;
4209
4208
  run_id: string;
4210
- error: string;
4209
+ conversation_id: string;
4210
+ turn_id: string;
4211
4211
  execution_id: string;
4212
4212
  summarization_id: string;
4213
4213
  metadata?: Record<string, SerializableJsonValue> | undefined;
4214
4214
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4215
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4215
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4216
4216
  execution_seq?: number | undefined;
4217
4217
  }, {
4218
- type: "thought";
4219
4218
  id: string;
4220
- conversation_id: string;
4219
+ type: "thought";
4221
4220
  timestamp: number;
4221
+ conversation_id: string;
4222
4222
  turn_id: string;
4223
4223
  is_complete: boolean;
4224
+ content?: string | undefined;
4224
4225
  metadata?: Record<string, SerializableJsonValue> | undefined;
4225
4226
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4226
4227
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4227
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4228
- content?: string | undefined;
4228
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4229
4229
  thought_message_id?: string | undefined;
4230
4230
  delta?: string | undefined;
4231
4231
  execution_id?: string | undefined;
4232
4232
  execution_seq?: number | undefined;
4233
4233
  } | {
4234
- type: "final_answer_chunk";
4235
4234
  id: string;
4236
- conversation_id: string;
4235
+ type: "final_answer_chunk";
4237
4236
  timestamp: number;
4237
+ conversation_id: string;
4238
4238
  turn_id: string;
4239
4239
  answer_id: string;
4240
4240
  seq: number;
@@ -4242,107 +4242,106 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4242
4242
  metadata?: Record<string, SerializableJsonValue> | undefined;
4243
4243
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4244
4244
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4245
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4245
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4246
4246
  is_last?: boolean | undefined;
4247
4247
  execution_id?: string | undefined;
4248
4248
  execution_seq?: number | undefined;
4249
4249
  } | {
4250
- type: "final_answer_reset";
4251
4250
  id: string;
4252
- conversation_id: string;
4251
+ type: "final_answer_reset";
4253
4252
  timestamp: number;
4253
+ conversation_id: string;
4254
4254
  turn_id: string;
4255
4255
  metadata?: Record<string, SerializableJsonValue> | undefined;
4256
4256
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4257
4257
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4258
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4258
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4259
4259
  answer_id?: string | undefined;
4260
4260
  thought_message_ids?: string[] | undefined;
4261
4261
  execution_id?: string | undefined;
4262
4262
  execution_seq?: number | undefined;
4263
4263
  } | {
4264
- type: "final_answer";
4265
4264
  id: string;
4266
- conversation_id: string;
4265
+ type: "final_answer";
4266
+ completion_reason: "tool_call" | "terminal" | "interrupted";
4267
+ content: string;
4267
4268
  timestamp: number;
4269
+ conversation_id: string;
4268
4270
  turn_id: string;
4269
- content: string;
4270
4271
  answer_id: string;
4271
- completion_reason: "tool_call" | "terminal" | "interrupted";
4272
4272
  metadata?: Record<string, SerializableJsonValue> | undefined;
4273
4273
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4274
4274
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4275
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4275
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4276
4276
  meta?: Record<string, SerializableJsonValue> | undefined;
4277
4277
  execution_id?: string | undefined;
4278
4278
  execution_seq?: number | undefined;
4279
4279
  } | {
4280
- type: "markdown_chunk";
4281
4280
  id: string;
4282
- conversation_id: string;
4281
+ type: "markdown_chunk";
4282
+ text: string;
4283
4283
  timestamp: number;
4284
+ conversation_id: string;
4284
4285
  turn_id: string;
4285
- text: string;
4286
- content_type: "code" | "image" | "text" | "table";
4286
+ content_type: "code" | "text" | "image" | "table";
4287
4287
  metadata?: Record<string, SerializableJsonValue> | undefined;
4288
4288
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4289
4289
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4290
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4290
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4291
4291
  seq?: number | undefined;
4292
4292
  execution_id?: string | undefined;
4293
4293
  execution_seq?: number | undefined;
4294
4294
  } | {
4295
- type: "tool_call_decision";
4296
4295
  id: string;
4297
- conversation_id: string;
4298
- timestamp: number;
4296
+ type: "tool_call_decision";
4299
4297
  status: "error" | "loading" | "success";
4300
- turn_id: string;
4301
- tool_name: string;
4302
4298
  tool_call_id: string & z.BRAND<"ToolCallId">;
4303
- phase: "start" | "update" | "complete" | "error";
4299
+ tool_name: string;
4300
+ timestamp: number;
4301
+ conversation_id: string;
4302
+ turn_id: string;
4303
+ phase: "error" | "start" | "update" | "complete";
4304
+ payload?: SerializableJsonValue | undefined;
4305
+ args?: SerializableJsonValue | undefined;
4304
4306
  metadata?: Record<string, SerializableJsonValue> | undefined;
4305
4307
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4306
4308
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4307
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4308
- args?: SerializableJsonValue | undefined;
4309
- payload?: SerializableJsonValue | undefined;
4309
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4310
4310
  meta?: Record<string, SerializableJsonValue> | undefined;
4311
4311
  execution_id?: string | undefined;
4312
4312
  execution_seq?: number | undefined;
4313
4313
  } | {
4314
- type: "tool_process";
4315
4314
  id: string;
4316
- conversation_id: string;
4317
- timestamp: number;
4315
+ type: "tool_process";
4318
4316
  status: "error" | "loading" | "success";
4319
- turn_id: string;
4320
- tool_name: string;
4321
4317
  tool_call_id: string & z.BRAND<"ToolCallId">;
4322
- phase: "start" | "update" | "complete" | "error";
4318
+ tool_name: string;
4319
+ timestamp: number;
4320
+ conversation_id: string;
4321
+ turn_id: string;
4322
+ phase: "error" | "start" | "update" | "complete";
4323
+ payload?: SerializableJsonValue | undefined;
4324
+ args?: SerializableJsonValue | undefined;
4323
4325
  metadata?: Record<string, SerializableJsonValue> | undefined;
4324
4326
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4325
4327
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4326
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4327
- args?: SerializableJsonValue | undefined;
4328
- payload?: SerializableJsonValue | undefined;
4328
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4329
4329
  meta?: Record<string, SerializableJsonValue> | undefined;
4330
4330
  execution_id?: string | undefined;
4331
4331
  execution_seq?: number | undefined;
4332
4332
  } | {
4333
- type: "tool_output";
4334
4333
  id: string;
4335
- conversation_id: string;
4336
- timestamp: number;
4334
+ type: "tool_output";
4337
4335
  status: "error" | "success";
4338
- turn_id: string;
4339
- tool_name: string;
4340
4336
  tool_call_id: string & z.BRAND<"ToolCallId">;
4337
+ tool_name: string;
4338
+ timestamp: number;
4339
+ conversation_id: string;
4340
+ turn_id: string;
4341
4341
  observation: string;
4342
+ data?: SerializableJsonValue | undefined;
4343
+ error?: string | undefined;
4342
4344
  metadata?: Record<string, SerializableJsonValue> | undefined;
4343
- run_id?: (string & z.BRAND<"RunId">) | undefined;
4344
- lane?: "foreground" | "auxiliary" | "child" | undefined;
4345
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4346
4345
  attachments?: {
4347
4346
  id: string;
4348
4347
  kind: "image";
@@ -4355,28 +4354,35 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4355
4354
  fileName?: string | undefined;
4356
4355
  label?: string | undefined;
4357
4356
  }[] | undefined;
4358
- error?: string | undefined;
4359
- data?: SerializableJsonValue | undefined;
4357
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
4358
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
4359
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4360
4360
  error_code?: string | undefined;
4361
4361
  duration_ms?: number | undefined;
4362
4362
  execution_id?: string | undefined;
4363
4363
  execution_seq?: number | undefined;
4364
4364
  } | {
4365
- type: "subrun_trace";
4366
4365
  id: string;
4367
- conversation_id: string;
4366
+ type: "subrun_trace";
4367
+ kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
4368
4368
  timestamp: number;
4369
+ conversation_id: string;
4369
4370
  turn_id: string;
4370
- kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
4371
4371
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
4372
4372
  subrun_id: string;
4373
4373
  source_event_id: string;
4374
4374
  status?: "error" | "loading" | "success" | undefined;
4375
- metadata?: Record<string, SerializableJsonValue> | undefined;
4376
- run_id?: (string & z.BRAND<"RunId">) | undefined;
4377
- lane?: "foreground" | "auxiliary" | "child" | undefined;
4378
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4375
+ tool_calls?: {
4376
+ tool_call_id: string & z.BRAND<"ToolCallId">;
4377
+ tool_name: string;
4378
+ args: Record<string, SerializableJsonValue>;
4379
+ }[] | undefined;
4380
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
4381
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
4382
+ tool_name?: string | undefined;
4383
+ args?: Record<string, SerializableJsonValue> | undefined;
4379
4384
  content?: string | undefined;
4385
+ metadata?: Record<string, SerializableJsonValue> | undefined;
4380
4386
  attachments?: {
4381
4387
  id: string;
4382
4388
  kind: "image";
@@ -4389,23 +4395,17 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4389
4395
  fileName?: string | undefined;
4390
4396
  label?: string | undefined;
4391
4397
  }[] | undefined;
4398
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
4399
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
4400
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4392
4401
  delta?: string | undefined;
4393
- tool_name?: string | undefined;
4394
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
4395
- phase?: "start" | "update" | "complete" | "error" | undefined;
4396
- args?: Record<string, SerializableJsonValue> | undefined;
4397
- tool_calls?: {
4398
- tool_name: string;
4399
- tool_call_id: string & z.BRAND<"ToolCallId">;
4400
- args: Record<string, SerializableJsonValue>;
4401
- }[] | undefined;
4402
+ phase?: "error" | "start" | "update" | "complete" | undefined;
4402
4403
  meta?: Record<string, SerializableJsonValue> | undefined;
4403
4404
  duration_ms?: number | undefined;
4404
4405
  subrun_parent_id?: string | undefined;
4405
4406
  answer_id?: string | undefined;
4406
4407
  seq?: number | undefined;
4407
4408
  is_last?: boolean | undefined;
4408
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
4409
4409
  output?: SerializableJsonValue | undefined;
4410
4410
  original_message_count?: number | undefined;
4411
4411
  compression_ratio?: number | undefined;
@@ -4414,62 +4414,62 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4414
4414
  execution_id?: string | undefined;
4415
4415
  execution_seq?: number | undefined;
4416
4416
  } | {
4417
- type: "requires_user_interaction";
4418
4417
  id: string;
4419
- conversation_id: string;
4418
+ type: "requires_user_interaction";
4419
+ tool_call_id: string & z.BRAND<"ToolCallId">;
4420
4420
  timestamp: number;
4421
- turn_id: string;
4422
4421
  run_id: string & z.BRAND<"RunId">;
4423
- tool_call_id: string & z.BRAND<"ToolCallId">;
4422
+ conversation_id: string;
4423
+ turn_id: string;
4424
4424
  interaction_id: string;
4425
4425
  checkpoint_revision: number;
4426
4426
  resume_token: string;
4427
4427
  interaction_status: "pending";
4428
4428
  metadata?: Record<string, SerializableJsonValue> | undefined;
4429
4429
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4430
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4430
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4431
4431
  form?: SerializableJsonValue | undefined;
4432
4432
  interaction_type?: string | undefined;
4433
4433
  prompt?: string | undefined;
4434
4434
  execution_id?: string | undefined;
4435
4435
  execution_seq?: number | undefined;
4436
4436
  } | {
4437
- type: "error";
4438
4437
  id: string;
4439
- conversation_id: string;
4438
+ type: "error";
4439
+ error: string;
4440
4440
  timestamp: number;
4441
+ conversation_id: string;
4441
4442
  turn_id: string;
4442
- error: string;
4443
4443
  metadata?: Record<string, SerializableJsonValue> | undefined;
4444
4444
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4445
4445
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4446
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4446
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4447
4447
  error_code?: string | undefined;
4448
4448
  details?: SerializableJsonValue | undefined;
4449
4449
  retryable?: boolean | undefined;
4450
4450
  execution_id?: string | undefined;
4451
4451
  execution_seq?: number | undefined;
4452
4452
  } | {
4453
- type: "transport_error";
4454
4453
  id: string;
4455
- conversation_id: string;
4454
+ type: "transport_error";
4455
+ error: string;
4456
4456
  timestamp: number;
4457
+ conversation_id: string;
4457
4458
  turn_id: string;
4458
- error: string;
4459
4459
  execution_id: string;
4460
4460
  metadata?: Record<string, SerializableJsonValue> | undefined;
4461
4461
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4462
4462
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4463
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4463
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4464
4464
  error_code?: string | undefined;
4465
4465
  details?: SerializableJsonValue | undefined;
4466
4466
  retryable?: boolean | undefined;
4467
4467
  execution_seq?: number | undefined;
4468
4468
  } | {
4469
- type: "context_usage_snapshot";
4470
4469
  id: string;
4471
- conversation_id: string;
4470
+ type: "context_usage_snapshot";
4472
4471
  timestamp: number;
4472
+ conversation_id: string;
4473
4473
  turn_id: string;
4474
4474
  context_usage: {
4475
4475
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -4492,23 +4492,23 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4492
4492
  metadata?: Record<string, SerializableJsonValue> | undefined;
4493
4493
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4494
4494
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4495
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4495
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4496
4496
  user_message_id?: string | undefined;
4497
4497
  execution_id?: string | undefined;
4498
4498
  execution_seq?: number | undefined;
4499
4499
  } | {
4500
- type: "run_execution_metrics";
4501
4500
  id: string;
4502
- conversation_id: string;
4501
+ type: "run_execution_metrics";
4503
4502
  timestamp: number;
4503
+ conversation_id: string;
4504
4504
  turn_id: string;
4505
4505
  duration_ms: number;
4506
- outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
4506
+ outcome: "completed" | "failed" | "awaiting_user" | "cancelled";
4507
4507
  execution_id: string;
4508
4508
  metadata?: Record<string, SerializableJsonValue> | undefined;
4509
4509
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4510
4510
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4511
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4511
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4512
4512
  user_message_id?: string | undefined;
4513
4513
  context_usage?: {
4514
4514
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -4530,40 +4530,40 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4530
4530
  } | undefined;
4531
4531
  execution_seq?: number | undefined;
4532
4532
  } | {
4533
- type: "run_status";
4534
4533
  id: string;
4535
- conversation_id: string;
4534
+ type: "run_status";
4535
+ status: "completed" | "failed" | "pending" | "running" | "awaiting_user" | "paused" | "cancelled";
4536
4536
  timestamp: number;
4537
- status: "pending" | "cancelled" | "paused" | "completed" | "awaiting_user" | "failed" | "running";
4538
- turn_id: string;
4539
4537
  run_id: string & z.BRAND<"RunId">;
4538
+ conversation_id: string;
4539
+ turn_id: string;
4540
4540
  execution_id: string;
4541
4541
  metadata?: Record<string, SerializableJsonValue> | undefined;
4542
4542
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4543
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4543
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4544
4544
  execution_seq?: number | undefined;
4545
4545
  reason_message?: string | undefined;
4546
4546
  } | {
4547
- type: "transport_end";
4548
4547
  id: string;
4549
- conversation_id: string;
4548
+ type: "transport_end";
4550
4549
  timestamp: number;
4550
+ conversation_id: string;
4551
4551
  turn_id: string;
4552
4552
  execution_id: string;
4553
4553
  metadata?: Record<string, SerializableJsonValue> | undefined;
4554
4554
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4555
4555
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4556
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4557
- reason?: "complete" | "error" | "interrupted" | "timeout" | undefined;
4556
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4557
+ reason?: "interrupted" | "error" | "complete" | "timeout" | undefined;
4558
4558
  execution_seq?: number | undefined;
4559
4559
  reason_message?: string | undefined;
4560
4560
  } | {
4561
- type: "history_summary";
4562
4561
  id: string;
4563
- conversation_id: string;
4562
+ type: "history_summary";
4563
+ content: string;
4564
4564
  timestamp: number;
4565
+ conversation_id: string;
4565
4566
  turn_id: string;
4566
- content: string;
4567
4567
  original_message_count: number;
4568
4568
  replaced_message_ids: string[];
4569
4569
  summary_seq: number;
@@ -4571,31 +4571,31 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4571
4571
  metadata?: Record<string, SerializableJsonValue> | undefined;
4572
4572
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4573
4573
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4574
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4574
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4575
4575
  compression_ratio?: number | undefined;
4576
4576
  included_old_summary?: boolean | undefined;
4577
4577
  execution_id?: string | undefined;
4578
4578
  execution_seq?: number | undefined;
4579
4579
  } | {
4580
- type: "summarization_start";
4581
4580
  id: string;
4582
- conversation_id: string;
4581
+ type: "summarization_start";
4583
4582
  timestamp: number;
4584
- turn_id: string;
4585
4583
  run_id: string & z.BRAND<"RunId">;
4584
+ conversation_id: string;
4585
+ turn_id: string;
4586
4586
  execution_id: string;
4587
4587
  summarization_id: string;
4588
4588
  metadata?: Record<string, SerializableJsonValue> | undefined;
4589
4589
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4590
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4590
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4591
4591
  execution_seq?: number | undefined;
4592
4592
  } | {
4593
- type: "summarization_end";
4594
4593
  id: string;
4595
- conversation_id: string;
4594
+ type: "summarization_end";
4596
4595
  timestamp: number;
4597
- turn_id: string;
4598
4596
  run_id: string & z.BRAND<"RunId">;
4597
+ conversation_id: string;
4598
+ turn_id: string;
4599
4599
  original_message_count: number;
4600
4600
  execution_id: string;
4601
4601
  summary_id: string;
@@ -4603,22 +4603,22 @@ declare const validateSSEEvent: (event: unknown) => z.SafeParseReturnType<{
4603
4603
  compressed_message_count: number;
4604
4604
  metadata?: Record<string, SerializableJsonValue> | undefined;
4605
4605
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4606
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4606
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4607
4607
  compression_ratio?: number | undefined;
4608
4608
  execution_seq?: number | undefined;
4609
4609
  } | {
4610
- type: "summarization_error";
4611
4610
  id: string;
4612
- conversation_id: string;
4611
+ type: "summarization_error";
4612
+ error: string;
4613
4613
  timestamp: number;
4614
- turn_id: string;
4615
4614
  run_id: string & z.BRAND<"RunId">;
4616
- error: string;
4615
+ conversation_id: string;
4616
+ turn_id: string;
4617
4617
  execution_id: string;
4618
4618
  summarization_id: string;
4619
4619
  metadata?: Record<string, SerializableJsonValue> | undefined;
4620
4620
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4621
- visibility?: "conversation" | "parent-trace" | "none" | undefined;
4621
+ visibility?: "none" | "conversation" | "parent-trace" | undefined;
4622
4622
  execution_seq?: number | undefined;
4623
4623
  }>;
4624
4624
  /**