@linnlabs/linnkit 0.38.0 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/contracts/agentSpec.d.cts +30 -30
  3. package/dist/contracts/agentSpec.d.ts +30 -30
  4. package/dist/contracts/audit.d.cts +32 -32
  5. package/dist/contracts/audit.d.ts +32 -32
  6. package/dist/contracts/contextPolicy.d.cts +36 -36
  7. package/dist/contracts/contextPolicy.d.ts +36 -36
  8. package/dist/contracts/events.d.cts +1203 -1203
  9. package/dist/contracts/events.d.ts +1203 -1203
  10. package/dist/contracts/execution.d.cts +8 -8
  11. package/dist/contracts/execution.d.ts +8 -8
  12. package/dist/contracts/llm-retry.d.cts +2 -2
  13. package/dist/contracts/llm-retry.d.ts +2 -2
  14. package/dist/contracts/messages.d.cts +1178 -1178
  15. package/dist/contracts/messages.d.ts +1178 -1178
  16. package/dist/contracts/provider-continuation.d.cts +28 -28
  17. package/dist/contracts/provider-continuation.d.ts +28 -28
  18. package/dist/contracts/sse.d.cts +988 -988
  19. package/dist/contracts/sse.d.ts +988 -988
  20. package/dist/contracts/sub-run-trace-payload.d.cts +40 -40
  21. package/dist/contracts/sub-run-trace-payload.d.ts +40 -40
  22. package/dist/contracts/token-accounting.d.cts +38 -38
  23. package/dist/contracts/token-accounting.d.ts +38 -38
  24. package/dist/index.cjs +46 -1
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.js +46 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/runtime-kernel/events/agentEvents.d.cts +184 -184
  29. package/dist/runtime-kernel/events/agentEvents.d.ts +184 -184
  30. package/dist/runtime-kernel.cjs +46 -1
  31. package/dist/runtime-kernel.cjs.map +1 -1
  32. package/dist/runtime-kernel.js +46 -1
  33. package/dist/runtime-kernel.js.map +1 -1
  34. package/dist/testkit.cjs +46 -1
  35. package/dist/testkit.cjs.map +1 -1
  36. package/dist/testkit.js +46 -1
  37. package/dist/testkit.js.map +1 -1
  38. package/docs/integration/tools.md +4 -0
  39. package/package.json +2 -2
@@ -12,19 +12,19 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
12
12
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13
13
  thought_message_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
14
14
  }, "strict", z.ZodTypeAny, {
15
- type: "thought";
16
15
  id: string;
17
- timestamp: number;
16
+ type: "thought";
18
17
  content: string;
18
+ timestamp: number;
19
19
  is_complete: boolean;
20
20
  thought_message_id?: string | undefined;
21
21
  delta?: string | undefined;
22
22
  meta?: Record<string, unknown> | undefined;
23
23
  }, {
24
- type: "thought";
25
24
  id: string;
26
- timestamp: number;
25
+ type: "thought";
27
26
  content: string;
27
+ timestamp: number;
28
28
  is_complete: boolean;
29
29
  thought_message_id?: string | undefined;
30
30
  delta?: string | undefined;
@@ -68,7 +68,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
68
68
  kind: z.ZodString;
69
69
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
70
70
  }, "strict", z.ZodTypeAny, {
71
- kind: string;
72
71
  schema_version: 2;
73
72
  producer: {
74
73
  model_id: string;
@@ -77,9 +76,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
77
76
  capability_id: string;
78
77
  endpoint_model_id: string;
79
78
  };
79
+ kind: string;
80
80
  payload: SerializableJsonValue;
81
81
  }, {
82
- kind: string;
83
82
  schema_version: 2;
84
83
  producer: {
85
84
  model_id: string;
@@ -88,6 +87,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
88
87
  capability_id: string;
89
88
  endpoint_model_id: string;
90
89
  };
90
+ kind: string;
91
91
  payload: SerializableJsonValue;
92
92
  }>, "many">>;
93
93
  assistant_replay_parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -117,7 +117,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
117
117
  kind: z.ZodString;
118
118
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
119
119
  }, "strict", z.ZodTypeAny, {
120
- kind: string;
121
120
  schema_version: 2;
122
121
  producer: {
123
122
  model_id: string;
@@ -126,9 +125,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
126
125
  capability_id: string;
127
126
  endpoint_model_id: string;
128
127
  };
128
+ kind: string;
129
129
  payload: SerializableJsonValue;
130
130
  }, {
131
- kind: string;
132
131
  schema_version: 2;
133
132
  producer: {
134
133
  model_id: string;
@@ -137,13 +136,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
137
136
  capability_id: string;
138
137
  endpoint_model_id: string;
139
138
  };
139
+ kind: string;
140
140
  payload: SerializableJsonValue;
141
141
  }>, "many">>;
142
142
  }, "strict", z.ZodTypeAny, {
143
143
  type: "text";
144
144
  text: string;
145
145
  provider_continuations?: {
146
- kind: string;
147
146
  schema_version: 2;
148
147
  producer: {
149
148
  model_id: string;
@@ -152,13 +151,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
152
151
  capability_id: string;
153
152
  endpoint_model_id: string;
154
153
  };
154
+ kind: string;
155
155
  payload: SerializableJsonValue;
156
156
  }[] | undefined;
157
157
  }, {
158
158
  type: "text";
159
159
  text: string;
160
160
  provider_continuations?: {
161
- kind: string;
162
161
  schema_version: 2;
163
162
  producer: {
164
163
  model_id: string;
@@ -167,6 +166,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
167
166
  capability_id: string;
168
167
  endpoint_model_id: string;
169
168
  };
169
+ kind: string;
170
170
  payload: SerializableJsonValue;
171
171
  }[] | undefined;
172
172
  }>, z.ZodObject<{
@@ -196,7 +196,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
196
196
  kind: z.ZodString;
197
197
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
198
198
  }, "strict", z.ZodTypeAny, {
199
- kind: string;
200
199
  schema_version: 2;
201
200
  producer: {
202
201
  model_id: string;
@@ -205,9 +204,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
205
204
  capability_id: string;
206
205
  endpoint_model_id: string;
207
206
  };
207
+ kind: string;
208
208
  payload: SerializableJsonValue;
209
209
  }, {
210
- kind: string;
211
210
  schema_version: 2;
212
211
  producer: {
213
212
  model_id: string;
@@ -216,13 +215,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
216
215
  capability_id: string;
217
216
  endpoint_model_id: string;
218
217
  };
218
+ kind: string;
219
219
  payload: SerializableJsonValue;
220
220
  }>, "many">>;
221
221
  }, "strict", z.ZodTypeAny, {
222
222
  type: "reasoning";
223
223
  text: string;
224
224
  provider_continuations?: {
225
- kind: string;
226
225
  schema_version: 2;
227
226
  producer: {
228
227
  model_id: string;
@@ -231,13 +230,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
231
230
  capability_id: string;
232
231
  endpoint_model_id: string;
233
232
  };
233
+ kind: string;
234
234
  payload: SerializableJsonValue;
235
235
  }[] | undefined;
236
236
  }, {
237
237
  type: "reasoning";
238
238
  text: string;
239
239
  provider_continuations?: {
240
- kind: string;
241
240
  schema_version: 2;
242
241
  producer: {
243
242
  model_id: string;
@@ -246,6 +245,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
246
245
  capability_id: string;
247
246
  endpoint_model_id: string;
248
247
  };
248
+ kind: string;
249
249
  payload: SerializableJsonValue;
250
250
  }[] | undefined;
251
251
  }>, z.ZodObject<{
@@ -275,7 +275,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
275
275
  kind: z.ZodString;
276
276
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
277
277
  }, "strict", z.ZodTypeAny, {
278
- kind: string;
279
278
  schema_version: 2;
280
279
  producer: {
281
280
  model_id: string;
@@ -284,9 +283,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
284
283
  capability_id: string;
285
284
  endpoint_model_id: string;
286
285
  };
286
+ kind: string;
287
287
  payload: SerializableJsonValue;
288
288
  }, {
289
- kind: string;
290
289
  schema_version: 2;
291
290
  producer: {
292
291
  model_id: string;
@@ -295,13 +294,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
295
294
  capability_id: string;
296
295
  endpoint_model_id: string;
297
296
  };
297
+ kind: string;
298
298
  payload: SerializableJsonValue;
299
299
  }>, "many">>;
300
300
  }, "strict", z.ZodTypeAny, {
301
301
  type: "tool_call";
302
302
  tool_call_id: string;
303
303
  provider_continuations?: {
304
- kind: string;
305
304
  schema_version: 2;
306
305
  producer: {
307
306
  model_id: string;
@@ -310,13 +309,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
310
309
  capability_id: string;
311
310
  endpoint_model_id: string;
312
311
  };
312
+ kind: string;
313
313
  payload: SerializableJsonValue;
314
314
  }[] | undefined;
315
315
  }, {
316
316
  type: "tool_call";
317
317
  tool_call_id: string;
318
318
  provider_continuations?: {
319
- kind: string;
320
319
  schema_version: 2;
321
320
  producer: {
322
321
  model_id: string;
@@ -325,14 +324,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
325
324
  capability_id: string;
326
325
  endpoint_model_id: string;
327
326
  };
327
+ kind: string;
328
328
  payload: SerializableJsonValue;
329
329
  }[] | undefined;
330
330
  }>]>, "many">>;
331
331
  }, "strict", z.ZodTypeAny, {
332
- args?: Record<string, unknown> | undefined;
333
332
  tool_calls?: unknown[] | undefined;
334
333
  provider_continuations?: {
335
- kind: string;
336
334
  schema_version: 2;
337
335
  producer: {
338
336
  model_id: string;
@@ -341,13 +339,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
341
339
  capability_id: string;
342
340
  endpoint_model_id: string;
343
341
  };
342
+ kind: string;
344
343
  payload: SerializableJsonValue;
345
344
  }[] | undefined;
346
345
  assistant_replay_parts?: ({
347
346
  type: "text";
348
347
  text: string;
349
348
  provider_continuations?: {
350
- kind: string;
351
349
  schema_version: 2;
352
350
  producer: {
353
351
  model_id: string;
@@ -356,13 +354,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
356
354
  capability_id: string;
357
355
  endpoint_model_id: string;
358
356
  };
357
+ kind: string;
359
358
  payload: SerializableJsonValue;
360
359
  }[] | undefined;
361
360
  } | {
362
361
  type: "reasoning";
363
362
  text: string;
364
363
  provider_continuations?: {
365
- kind: string;
366
364
  schema_version: 2;
367
365
  producer: {
368
366
  model_id: string;
@@ -371,13 +369,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
371
369
  capability_id: string;
372
370
  endpoint_model_id: string;
373
371
  };
372
+ kind: string;
374
373
  payload: SerializableJsonValue;
375
374
  }[] | undefined;
376
375
  } | {
377
376
  type: "tool_call";
378
377
  tool_call_id: string;
379
378
  provider_continuations?: {
380
- kind: string;
381
379
  schema_version: 2;
382
380
  producer: {
383
381
  model_id: string;
@@ -386,14 +384,14 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
386
384
  capability_id: string;
387
385
  endpoint_model_id: string;
388
386
  };
387
+ kind: string;
389
388
  payload: SerializableJsonValue;
390
389
  }[] | undefined;
391
390
  })[] | undefined;
392
- }, {
393
391
  args?: Record<string, unknown> | undefined;
392
+ }, {
394
393
  tool_calls?: unknown[] | undefined;
395
394
  provider_continuations?: {
396
- kind: string;
397
395
  schema_version: 2;
398
396
  producer: {
399
397
  model_id: string;
@@ -402,13 +400,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
402
400
  capability_id: string;
403
401
  endpoint_model_id: string;
404
402
  };
403
+ kind: string;
405
404
  payload: SerializableJsonValue;
406
405
  }[] | undefined;
407
406
  assistant_replay_parts?: ({
408
407
  type: "text";
409
408
  text: string;
410
409
  provider_continuations?: {
411
- kind: string;
412
410
  schema_version: 2;
413
411
  producer: {
414
412
  model_id: string;
@@ -417,13 +415,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
417
415
  capability_id: string;
418
416
  endpoint_model_id: string;
419
417
  };
418
+ kind: string;
420
419
  payload: SerializableJsonValue;
421
420
  }[] | undefined;
422
421
  } | {
423
422
  type: "reasoning";
424
423
  text: string;
425
424
  provider_continuations?: {
426
- kind: string;
427
425
  schema_version: 2;
428
426
  producer: {
429
427
  model_id: string;
@@ -432,13 +430,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
432
430
  capability_id: string;
433
431
  endpoint_model_id: string;
434
432
  };
433
+ kind: string;
435
434
  payload: SerializableJsonValue;
436
435
  }[] | undefined;
437
436
  } | {
438
437
  type: "tool_call";
439
438
  tool_call_id: string;
440
439
  provider_continuations?: {
441
- kind: string;
442
440
  schema_version: 2;
443
441
  producer: {
444
442
  model_id: string;
@@ -447,25 +445,25 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
447
445
  capability_id: string;
448
446
  endpoint_model_id: string;
449
447
  };
448
+ kind: string;
450
449
  payload: SerializableJsonValue;
451
450
  }[] | undefined;
452
451
  })[] | undefined;
452
+ args?: Record<string, unknown> | undefined;
453
453
  }>>;
454
454
  }, "strict", z.ZodTypeAny, {
455
- type: "tool_call_decision";
456
455
  id: string;
457
- timestamp: number;
456
+ type: "tool_call_decision";
458
457
  status: "error" | "loading" | "success";
459
- tool_name: string;
460
458
  tool_call_id: string & z.BRAND<"ToolCallId">;
461
- phase: "start" | "update" | "complete" | "error";
459
+ tool_name: string;
460
+ timestamp: number;
461
+ phase: "error" | "start" | "update" | "complete";
462
462
  tool_args: Record<string, unknown>;
463
463
  tool_calls?: unknown[] | undefined;
464
464
  payload?: {
465
- args?: Record<string, unknown> | undefined;
466
465
  tool_calls?: unknown[] | undefined;
467
466
  provider_continuations?: {
468
- kind: string;
469
467
  schema_version: 2;
470
468
  producer: {
471
469
  model_id: string;
@@ -474,13 +472,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
474
472
  capability_id: string;
475
473
  endpoint_model_id: string;
476
474
  };
475
+ kind: string;
477
476
  payload: SerializableJsonValue;
478
477
  }[] | undefined;
479
478
  assistant_replay_parts?: ({
480
479
  type: "text";
481
480
  text: string;
482
481
  provider_continuations?: {
483
- kind: string;
484
482
  schema_version: 2;
485
483
  producer: {
486
484
  model_id: string;
@@ -489,13 +487,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
489
487
  capability_id: string;
490
488
  endpoint_model_id: string;
491
489
  };
490
+ kind: string;
492
491
  payload: SerializableJsonValue;
493
492
  }[] | undefined;
494
493
  } | {
495
494
  type: "reasoning";
496
495
  text: string;
497
496
  provider_continuations?: {
498
- kind: string;
499
497
  schema_version: 2;
500
498
  producer: {
501
499
  model_id: string;
@@ -504,13 +502,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
504
502
  capability_id: string;
505
503
  endpoint_model_id: string;
506
504
  };
505
+ kind: string;
507
506
  payload: SerializableJsonValue;
508
507
  }[] | undefined;
509
508
  } | {
510
509
  type: "tool_call";
511
510
  tool_call_id: string;
512
511
  provider_continuations?: {
513
- kind: string;
514
512
  schema_version: 2;
515
513
  producer: {
516
514
  model_id: string;
@@ -519,26 +517,26 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
519
517
  capability_id: string;
520
518
  endpoint_model_id: string;
521
519
  };
520
+ kind: string;
522
521
  payload: SerializableJsonValue;
523
522
  }[] | undefined;
524
523
  })[] | undefined;
524
+ args?: Record<string, unknown> | undefined;
525
525
  } | undefined;
526
526
  meta?: Record<string, unknown> | undefined;
527
527
  }, {
528
- type: "tool_call_decision";
529
528
  id: string;
530
- timestamp: number;
529
+ type: "tool_call_decision";
531
530
  status: "error" | "loading" | "success";
532
- tool_name: string;
533
531
  tool_call_id: string;
534
- phase: "start" | "update" | "complete" | "error";
532
+ tool_name: string;
533
+ timestamp: number;
534
+ phase: "error" | "start" | "update" | "complete";
535
535
  tool_args: Record<string, unknown>;
536
536
  tool_calls?: unknown[] | undefined;
537
537
  payload?: {
538
- args?: Record<string, unknown> | undefined;
539
538
  tool_calls?: unknown[] | undefined;
540
539
  provider_continuations?: {
541
- kind: string;
542
540
  schema_version: 2;
543
541
  producer: {
544
542
  model_id: string;
@@ -547,13 +545,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
547
545
  capability_id: string;
548
546
  endpoint_model_id: string;
549
547
  };
548
+ kind: string;
550
549
  payload: SerializableJsonValue;
551
550
  }[] | undefined;
552
551
  assistant_replay_parts?: ({
553
552
  type: "text";
554
553
  text: string;
555
554
  provider_continuations?: {
556
- kind: string;
557
555
  schema_version: 2;
558
556
  producer: {
559
557
  model_id: string;
@@ -562,13 +560,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
562
560
  capability_id: string;
563
561
  endpoint_model_id: string;
564
562
  };
563
+ kind: string;
565
564
  payload: SerializableJsonValue;
566
565
  }[] | undefined;
567
566
  } | {
568
567
  type: "reasoning";
569
568
  text: string;
570
569
  provider_continuations?: {
571
- kind: string;
572
570
  schema_version: 2;
573
571
  producer: {
574
572
  model_id: string;
@@ -577,13 +575,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
577
575
  capability_id: string;
578
576
  endpoint_model_id: string;
579
577
  };
578
+ kind: string;
580
579
  payload: SerializableJsonValue;
581
580
  }[] | undefined;
582
581
  } | {
583
582
  type: "tool_call";
584
583
  tool_call_id: string;
585
584
  provider_continuations?: {
586
- kind: string;
587
585
  schema_version: 2;
588
586
  producer: {
589
587
  model_id: string;
@@ -592,9 +590,11 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
592
590
  capability_id: string;
593
591
  endpoint_model_id: string;
594
592
  };
593
+ kind: string;
595
594
  payload: SerializableJsonValue;
596
595
  }[] | undefined;
597
596
  })[] | undefined;
597
+ args?: Record<string, unknown> | undefined;
598
598
  } | undefined;
599
599
  meta?: Record<string, unknown> | undefined;
600
600
  }>, z.ZodObject<{
@@ -611,25 +611,25 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
611
611
  } & {
612
612
  type: z.ZodLiteral<"tool_process">;
613
613
  }, "strict", z.ZodTypeAny, {
614
- type: "tool_process";
615
614
  id: string;
616
- timestamp: number;
615
+ type: "tool_process";
617
616
  status: "error" | "loading" | "success";
618
- tool_name: string;
619
617
  tool_call_id: string & z.BRAND<"ToolCallId">;
620
- phase: "start" | "update" | "complete" | "error";
618
+ tool_name: string;
619
+ timestamp: number;
620
+ phase: "error" | "start" | "update" | "complete";
621
621
  tool_args: Record<string, unknown>;
622
622
  tool_calls?: unknown[] | undefined;
623
623
  payload?: Record<string, unknown> | undefined;
624
624
  meta?: Record<string, unknown> | undefined;
625
625
  }, {
626
- type: "tool_process";
627
626
  id: string;
628
- timestamp: number;
627
+ type: "tool_process";
629
628
  status: "error" | "loading" | "success";
630
- tool_name: string;
631
629
  tool_call_id: string;
632
- phase: "start" | "update" | "complete" | "error";
630
+ tool_name: string;
631
+ timestamp: number;
632
+ phase: "error" | "start" | "update" | "complete";
633
633
  tool_args: Record<string, unknown>;
634
634
  tool_calls?: unknown[] | undefined;
635
635
  payload?: Record<string, unknown> | undefined;
@@ -682,13 +682,15 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
682
682
  label?: string | undefined;
683
683
  }>, "many">>;
684
684
  }, "strict", z.ZodTypeAny, {
685
- type: "observation";
686
685
  id: string;
687
- timestamp: number;
688
- tool_name: string;
686
+ type: "observation";
689
687
  tool_call_id: string & z.BRAND<"ToolCallId">;
688
+ tool_name: string;
689
+ timestamp: number;
690
690
  success: boolean;
691
691
  observation: string;
692
+ data?: unknown;
693
+ error?: string | undefined;
692
694
  attachments?: {
693
695
  id: string;
694
696
  kind: "image";
@@ -701,18 +703,18 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
701
703
  fileName?: string | undefined;
702
704
  label?: string | undefined;
703
705
  }[] | undefined;
704
- error?: string | undefined;
705
- data?: unknown;
706
706
  error_code?: string | undefined;
707
707
  duration_ms?: number | undefined;
708
708
  }, {
709
- type: "observation";
710
709
  id: string;
711
- timestamp: number;
712
- tool_name: string;
710
+ type: "observation";
713
711
  tool_call_id: string;
712
+ tool_name: string;
713
+ timestamp: number;
714
714
  success: boolean;
715
715
  observation: string;
716
+ data?: unknown;
717
+ error?: string | undefined;
716
718
  attachments?: {
717
719
  id: string;
718
720
  kind: "image";
@@ -725,8 +727,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
725
727
  fileName?: string | undefined;
726
728
  label?: string | undefined;
727
729
  }[] | undefined;
728
- error?: string | undefined;
729
- data?: unknown;
730
730
  error_code?: string | undefined;
731
731
  duration_ms?: number | undefined;
732
732
  }>, z.ZodObject<{
@@ -761,7 +761,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
761
761
  kind: z.ZodString;
762
762
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
763
763
  }, "strict", z.ZodTypeAny, {
764
- kind: string;
765
764
  schema_version: 2;
766
765
  producer: {
767
766
  model_id: string;
@@ -770,9 +769,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
770
769
  capability_id: string;
771
770
  endpoint_model_id: string;
772
771
  };
772
+ kind: string;
773
773
  payload: SerializableJsonValue;
774
774
  }, {
775
- kind: string;
776
775
  schema_version: 2;
777
776
  producer: {
778
777
  model_id: string;
@@ -781,6 +780,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
781
780
  capability_id: string;
782
781
  endpoint_model_id: string;
783
782
  };
783
+ kind: string;
784
784
  payload: SerializableJsonValue;
785
785
  }>, "many">>;
786
786
  assistant_replay_parts: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -810,7 +810,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
810
810
  kind: z.ZodString;
811
811
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
812
812
  }, "strict", z.ZodTypeAny, {
813
- kind: string;
814
813
  schema_version: 2;
815
814
  producer: {
816
815
  model_id: string;
@@ -819,9 +818,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
819
818
  capability_id: string;
820
819
  endpoint_model_id: string;
821
820
  };
821
+ kind: string;
822
822
  payload: SerializableJsonValue;
823
823
  }, {
824
- kind: string;
825
824
  schema_version: 2;
826
825
  producer: {
827
826
  model_id: string;
@@ -830,13 +829,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
830
829
  capability_id: string;
831
830
  endpoint_model_id: string;
832
831
  };
832
+ kind: string;
833
833
  payload: SerializableJsonValue;
834
834
  }>, "many">>;
835
835
  }, "strict", z.ZodTypeAny, {
836
836
  type: "text";
837
837
  text: string;
838
838
  provider_continuations?: {
839
- kind: string;
840
839
  schema_version: 2;
841
840
  producer: {
842
841
  model_id: string;
@@ -845,13 +844,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
845
844
  capability_id: string;
846
845
  endpoint_model_id: string;
847
846
  };
847
+ kind: string;
848
848
  payload: SerializableJsonValue;
849
849
  }[] | undefined;
850
850
  }, {
851
851
  type: "text";
852
852
  text: string;
853
853
  provider_continuations?: {
854
- kind: string;
855
854
  schema_version: 2;
856
855
  producer: {
857
856
  model_id: string;
@@ -860,6 +859,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
860
859
  capability_id: string;
861
860
  endpoint_model_id: string;
862
861
  };
862
+ kind: string;
863
863
  payload: SerializableJsonValue;
864
864
  }[] | undefined;
865
865
  }>, z.ZodObject<{
@@ -889,7 +889,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
889
889
  kind: z.ZodString;
890
890
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
891
891
  }, "strict", z.ZodTypeAny, {
892
- kind: string;
893
892
  schema_version: 2;
894
893
  producer: {
895
894
  model_id: string;
@@ -898,9 +897,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
898
897
  capability_id: string;
899
898
  endpoint_model_id: string;
900
899
  };
900
+ kind: string;
901
901
  payload: SerializableJsonValue;
902
902
  }, {
903
- kind: string;
904
903
  schema_version: 2;
905
904
  producer: {
906
905
  model_id: string;
@@ -909,13 +908,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
909
908
  capability_id: string;
910
909
  endpoint_model_id: string;
911
910
  };
911
+ kind: string;
912
912
  payload: SerializableJsonValue;
913
913
  }>, "many">>;
914
914
  }, "strict", z.ZodTypeAny, {
915
915
  type: "reasoning";
916
916
  text: string;
917
917
  provider_continuations?: {
918
- kind: string;
919
918
  schema_version: 2;
920
919
  producer: {
921
920
  model_id: string;
@@ -924,13 +923,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
924
923
  capability_id: string;
925
924
  endpoint_model_id: string;
926
925
  };
926
+ kind: string;
927
927
  payload: SerializableJsonValue;
928
928
  }[] | undefined;
929
929
  }, {
930
930
  type: "reasoning";
931
931
  text: string;
932
932
  provider_continuations?: {
933
- kind: string;
934
933
  schema_version: 2;
935
934
  producer: {
936
935
  model_id: string;
@@ -939,6 +938,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
939
938
  capability_id: string;
940
939
  endpoint_model_id: string;
941
940
  };
941
+ kind: string;
942
942
  payload: SerializableJsonValue;
943
943
  }[] | undefined;
944
944
  }>, z.ZodObject<{
@@ -968,7 +968,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
968
968
  kind: z.ZodString;
969
969
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
970
970
  }, "strict", z.ZodTypeAny, {
971
- kind: string;
972
971
  schema_version: 2;
973
972
  producer: {
974
973
  model_id: string;
@@ -977,9 +976,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
977
976
  capability_id: string;
978
977
  endpoint_model_id: string;
979
978
  };
979
+ kind: string;
980
980
  payload: SerializableJsonValue;
981
981
  }, {
982
- kind: string;
983
982
  schema_version: 2;
984
983
  producer: {
985
984
  model_id: string;
@@ -988,13 +987,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
988
987
  capability_id: string;
989
988
  endpoint_model_id: string;
990
989
  };
990
+ kind: string;
991
991
  payload: SerializableJsonValue;
992
992
  }>, "many">>;
993
993
  }, "strict", z.ZodTypeAny, {
994
994
  type: "tool_call";
995
995
  tool_call_id: string;
996
996
  provider_continuations?: {
997
- kind: string;
998
997
  schema_version: 2;
999
998
  producer: {
1000
999
  model_id: string;
@@ -1003,13 +1002,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1003
1002
  capability_id: string;
1004
1003
  endpoint_model_id: string;
1005
1004
  };
1005
+ kind: string;
1006
1006
  payload: SerializableJsonValue;
1007
1007
  }[] | undefined;
1008
1008
  }, {
1009
1009
  type: "tool_call";
1010
1010
  tool_call_id: string;
1011
1011
  provider_continuations?: {
1012
- kind: string;
1013
1012
  schema_version: 2;
1014
1013
  producer: {
1015
1014
  model_id: string;
@@ -1018,19 +1017,19 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1018
1017
  capability_id: string;
1019
1018
  endpoint_model_id: string;
1020
1019
  };
1020
+ kind: string;
1021
1021
  payload: SerializableJsonValue;
1022
1022
  }[] | undefined;
1023
1023
  }>]>, "many">>;
1024
1024
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1025
1025
  }, "strict", z.ZodTypeAny, {
1026
- type: "final_answer";
1027
1026
  id: string;
1027
+ type: "final_answer";
1028
+ completion_reason: "tool_call" | "terminal" | "interrupted";
1028
1029
  timestamp: number;
1029
1030
  answer_id: string;
1030
- completion_reason: "tool_call" | "terminal" | "interrupted";
1031
1031
  answer: string;
1032
1032
  provider_continuations?: {
1033
- kind: string;
1034
1033
  schema_version: 2;
1035
1034
  producer: {
1036
1035
  model_id: string;
@@ -1039,13 +1038,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1039
1038
  capability_id: string;
1040
1039
  endpoint_model_id: string;
1041
1040
  };
1041
+ kind: string;
1042
1042
  payload: SerializableJsonValue;
1043
1043
  }[] | undefined;
1044
1044
  assistant_replay_parts?: ({
1045
1045
  type: "text";
1046
1046
  text: string;
1047
1047
  provider_continuations?: {
1048
- kind: string;
1049
1048
  schema_version: 2;
1050
1049
  producer: {
1051
1050
  model_id: string;
@@ -1054,13 +1053,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1054
1053
  capability_id: string;
1055
1054
  endpoint_model_id: string;
1056
1055
  };
1056
+ kind: string;
1057
1057
  payload: SerializableJsonValue;
1058
1058
  }[] | undefined;
1059
1059
  } | {
1060
1060
  type: "reasoning";
1061
1061
  text: string;
1062
1062
  provider_continuations?: {
1063
- kind: string;
1064
1063
  schema_version: 2;
1065
1064
  producer: {
1066
1065
  model_id: string;
@@ -1069,13 +1068,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1069
1068
  capability_id: string;
1070
1069
  endpoint_model_id: string;
1071
1070
  };
1071
+ kind: string;
1072
1072
  payload: SerializableJsonValue;
1073
1073
  }[] | undefined;
1074
1074
  } | {
1075
1075
  type: "tool_call";
1076
1076
  tool_call_id: string;
1077
1077
  provider_continuations?: {
1078
- kind: string;
1079
1078
  schema_version: 2;
1080
1079
  producer: {
1081
1080
  model_id: string;
@@ -1084,19 +1083,19 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1084
1083
  capability_id: string;
1085
1084
  endpoint_model_id: string;
1086
1085
  };
1086
+ kind: string;
1087
1087
  payload: SerializableJsonValue;
1088
1088
  }[] | undefined;
1089
1089
  })[] | undefined;
1090
1090
  meta?: Record<string, unknown> | undefined;
1091
1091
  }, {
1092
- type: "final_answer";
1093
1092
  id: string;
1093
+ type: "final_answer";
1094
+ completion_reason: "tool_call" | "terminal" | "interrupted";
1094
1095
  timestamp: number;
1095
1096
  answer_id: string;
1096
- completion_reason: "tool_call" | "terminal" | "interrupted";
1097
1097
  answer: string;
1098
1098
  provider_continuations?: {
1099
- kind: string;
1100
1099
  schema_version: 2;
1101
1100
  producer: {
1102
1101
  model_id: string;
@@ -1105,13 +1104,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1105
1104
  capability_id: string;
1106
1105
  endpoint_model_id: string;
1107
1106
  };
1107
+ kind: string;
1108
1108
  payload: SerializableJsonValue;
1109
1109
  }[] | undefined;
1110
1110
  assistant_replay_parts?: ({
1111
1111
  type: "text";
1112
1112
  text: string;
1113
1113
  provider_continuations?: {
1114
- kind: string;
1115
1114
  schema_version: 2;
1116
1115
  producer: {
1117
1116
  model_id: string;
@@ -1120,13 +1119,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1120
1119
  capability_id: string;
1121
1120
  endpoint_model_id: string;
1122
1121
  };
1122
+ kind: string;
1123
1123
  payload: SerializableJsonValue;
1124
1124
  }[] | undefined;
1125
1125
  } | {
1126
1126
  type: "reasoning";
1127
1127
  text: string;
1128
1128
  provider_continuations?: {
1129
- kind: string;
1130
1129
  schema_version: 2;
1131
1130
  producer: {
1132
1131
  model_id: string;
@@ -1135,13 +1134,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1135
1134
  capability_id: string;
1136
1135
  endpoint_model_id: string;
1137
1136
  };
1137
+ kind: string;
1138
1138
  payload: SerializableJsonValue;
1139
1139
  }[] | undefined;
1140
1140
  } | {
1141
1141
  type: "tool_call";
1142
1142
  tool_call_id: string;
1143
1143
  provider_continuations?: {
1144
- kind: string;
1145
1144
  schema_version: 2;
1146
1145
  producer: {
1147
1146
  model_id: string;
@@ -1150,6 +1149,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1150
1149
  capability_id: string;
1151
1150
  endpoint_model_id: string;
1152
1151
  };
1152
+ kind: string;
1153
1153
  payload: SerializableJsonValue;
1154
1154
  }[] | undefined;
1155
1155
  })[] | undefined;
@@ -1171,11 +1171,11 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1171
1171
  error_code: z.ZodString;
1172
1172
  type: z.ZodLiteral<"llm_retry">;
1173
1173
  }, "strict", z.ZodTypeAny, {
1174
- type: "llm_retry";
1175
1174
  id: string;
1176
- timestamp: number;
1177
- status: "waiting" | "retrying" | "succeeded" | "exhausted" | "failed" | "cancelled";
1175
+ type: "llm_retry";
1176
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
1178
1177
  error: string;
1178
+ timestamp: number;
1179
1179
  error_code: string;
1180
1180
  retry_id: string;
1181
1181
  category: "transport" | "output" | "rate_limit" | "other";
@@ -1186,11 +1186,11 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1186
1186
  delay_ms: number;
1187
1187
  next_retry_at?: number | undefined;
1188
1188
  }, {
1189
- type: "llm_retry";
1190
1189
  id: string;
1191
- timestamp: number;
1192
- status: "waiting" | "retrying" | "succeeded" | "exhausted" | "failed" | "cancelled";
1190
+ type: "llm_retry";
1191
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
1193
1192
  error: string;
1193
+ timestamp: number;
1194
1194
  error_code: string;
1195
1195
  retry_id: string;
1196
1196
  category: "transport" | "output" | "rate_limit" | "other";
@@ -1211,19 +1211,19 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1211
1211
  retryable: z.ZodOptional<z.ZodBoolean>;
1212
1212
  details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1213
1213
  }, "strict", z.ZodTypeAny, {
1214
- type: "error";
1215
1214
  id: string;
1216
- timestamp: number;
1215
+ type: "error";
1217
1216
  error: string;
1217
+ timestamp: number;
1218
1218
  error_code?: string | undefined;
1219
1219
  retry_id?: string | undefined;
1220
1220
  retryable?: boolean | undefined;
1221
1221
  details?: Record<string, unknown> | undefined;
1222
1222
  }, {
1223
- type: "error";
1224
1223
  id: string;
1225
- timestamp: number;
1224
+ type: "error";
1226
1225
  error: string;
1226
+ timestamp: number;
1227
1227
  error_code?: string | undefined;
1228
1228
  retry_id?: string | undefined;
1229
1229
  retryable?: boolean | undefined;
@@ -1238,18 +1238,18 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1238
1238
  seq: z.ZodNumber;
1239
1239
  is_last: z.ZodOptional<z.ZodBoolean>;
1240
1240
  }, "strict", z.ZodTypeAny, {
1241
- type: "stream_chunk";
1242
1241
  id: string;
1243
- timestamp: number;
1242
+ type: "stream_chunk";
1244
1243
  content: string;
1244
+ timestamp: number;
1245
1245
  answer_id: string;
1246
1246
  seq: number;
1247
1247
  is_last?: boolean | undefined;
1248
1248
  }, {
1249
- type: "stream_chunk";
1250
1249
  id: string;
1251
- timestamp: number;
1250
+ type: "stream_chunk";
1252
1251
  content: string;
1252
+ timestamp: number;
1253
1253
  answer_id: string;
1254
1254
  seq: number;
1255
1255
  is_last?: boolean | undefined;
@@ -1261,14 +1261,14 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1261
1261
  answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1262
1262
  thought_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
1263
1263
  }, "strict", z.ZodTypeAny, {
1264
- type: "stream_reset";
1265
1264
  id: string;
1265
+ type: "stream_reset";
1266
1266
  timestamp: number;
1267
1267
  answer_id?: string | undefined;
1268
1268
  thought_message_ids?: string[] | undefined;
1269
1269
  }, {
1270
- type: "stream_reset";
1271
1270
  id: string;
1271
+ type: "stream_reset";
1272
1272
  timestamp: number;
1273
1273
  answer_id?: string | undefined;
1274
1274
  thought_message_ids?: string[] | undefined;
@@ -1301,7 +1301,6 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1301
1301
  kind: z.ZodString;
1302
1302
  payload: z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>;
1303
1303
  }, "strict", z.ZodTypeAny, {
1304
- kind: string;
1305
1304
  schema_version: 2;
1306
1305
  producer: {
1307
1306
  model_id: string;
@@ -1310,9 +1309,9 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1310
1309
  capability_id: string;
1311
1310
  endpoint_model_id: string;
1312
1311
  };
1312
+ kind: string;
1313
1313
  payload: SerializableJsonValue;
1314
1314
  }, {
1315
- kind: string;
1316
1315
  schema_version: 2;
1317
1316
  producer: {
1318
1317
  model_id: string;
@@ -1321,14 +1320,14 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1321
1320
  capability_id: string;
1322
1321
  endpoint_model_id: string;
1323
1322
  };
1323
+ kind: string;
1324
1324
  payload: SerializableJsonValue;
1325
1325
  }>, "many">;
1326
1326
  }, "strict", z.ZodTypeAny, {
1327
- type: "provider_continuation";
1328
1327
  id: string;
1328
+ type: "provider_continuation";
1329
1329
  timestamp: number;
1330
1330
  continuations: {
1331
- kind: string;
1332
1331
  schema_version: 2;
1333
1332
  producer: {
1334
1333
  model_id: string;
@@ -1337,14 +1336,14 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1337
1336
  capability_id: string;
1338
1337
  endpoint_model_id: string;
1339
1338
  };
1339
+ kind: string;
1340
1340
  payload: SerializableJsonValue;
1341
1341
  }[];
1342
1342
  }, {
1343
- type: "provider_continuation";
1344
1343
  id: string;
1344
+ type: "provider_continuation";
1345
1345
  timestamp: number;
1346
1346
  continuations: {
1347
- kind: string;
1348
1347
  schema_version: 2;
1349
1348
  producer: {
1350
1349
  model_id: string;
@@ -1353,32 +1352,31 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1353
1352
  capability_id: string;
1354
1353
  endpoint_model_id: string;
1355
1354
  };
1355
+ kind: string;
1356
1356
  payload: SerializableJsonValue;
1357
1357
  }[];
1358
1358
  }>]>, {
1359
- type: "thought";
1360
1359
  id: string;
1361
- timestamp: number;
1360
+ type: "thought";
1362
1361
  content: string;
1362
+ timestamp: number;
1363
1363
  is_complete: boolean;
1364
1364
  thought_message_id?: string | undefined;
1365
1365
  delta?: string | undefined;
1366
1366
  meta?: Record<string, unknown> | undefined;
1367
1367
  } | {
1368
- type: "tool_call_decision";
1369
1368
  id: string;
1370
- timestamp: number;
1369
+ type: "tool_call_decision";
1371
1370
  status: "error" | "loading" | "success";
1372
- tool_name: string;
1373
1371
  tool_call_id: string & z.BRAND<"ToolCallId">;
1374
- phase: "start" | "update" | "complete" | "error";
1372
+ tool_name: string;
1373
+ timestamp: number;
1374
+ phase: "error" | "start" | "update" | "complete";
1375
1375
  tool_args: Record<string, unknown>;
1376
1376
  tool_calls?: unknown[] | undefined;
1377
1377
  payload?: {
1378
- args?: Record<string, unknown> | undefined;
1379
1378
  tool_calls?: unknown[] | undefined;
1380
1379
  provider_continuations?: {
1381
- kind: string;
1382
1380
  schema_version: 2;
1383
1381
  producer: {
1384
1382
  model_id: string;
@@ -1387,13 +1385,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1387
1385
  capability_id: string;
1388
1386
  endpoint_model_id: string;
1389
1387
  };
1388
+ kind: string;
1390
1389
  payload: SerializableJsonValue;
1391
1390
  }[] | undefined;
1392
1391
  assistant_replay_parts?: ({
1393
1392
  type: "text";
1394
1393
  text: string;
1395
1394
  provider_continuations?: {
1396
- kind: string;
1397
1395
  schema_version: 2;
1398
1396
  producer: {
1399
1397
  model_id: string;
@@ -1402,13 +1400,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1402
1400
  capability_id: string;
1403
1401
  endpoint_model_id: string;
1404
1402
  };
1403
+ kind: string;
1405
1404
  payload: SerializableJsonValue;
1406
1405
  }[] | undefined;
1407
1406
  } | {
1408
1407
  type: "reasoning";
1409
1408
  text: string;
1410
1409
  provider_continuations?: {
1411
- kind: string;
1412
1410
  schema_version: 2;
1413
1411
  producer: {
1414
1412
  model_id: string;
@@ -1417,13 +1415,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1417
1415
  capability_id: string;
1418
1416
  endpoint_model_id: string;
1419
1417
  };
1418
+ kind: string;
1420
1419
  payload: SerializableJsonValue;
1421
1420
  }[] | undefined;
1422
1421
  } | {
1423
1422
  type: "tool_call";
1424
1423
  tool_call_id: string;
1425
1424
  provider_continuations?: {
1426
- kind: string;
1427
1425
  schema_version: 2;
1428
1426
  producer: {
1429
1427
  model_id: string;
@@ -1432,31 +1430,35 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1432
1430
  capability_id: string;
1433
1431
  endpoint_model_id: string;
1434
1432
  };
1433
+ kind: string;
1435
1434
  payload: SerializableJsonValue;
1436
1435
  }[] | undefined;
1437
1436
  })[] | undefined;
1437
+ args?: Record<string, unknown> | undefined;
1438
1438
  } | undefined;
1439
1439
  meta?: Record<string, unknown> | undefined;
1440
1440
  } | {
1441
- type: "tool_process";
1442
1441
  id: string;
1443
- timestamp: number;
1442
+ type: "tool_process";
1444
1443
  status: "error" | "loading" | "success";
1445
- tool_name: string;
1446
1444
  tool_call_id: string & z.BRAND<"ToolCallId">;
1447
- phase: "start" | "update" | "complete" | "error";
1445
+ tool_name: string;
1446
+ timestamp: number;
1447
+ phase: "error" | "start" | "update" | "complete";
1448
1448
  tool_args: Record<string, unknown>;
1449
1449
  tool_calls?: unknown[] | undefined;
1450
1450
  payload?: Record<string, unknown> | undefined;
1451
1451
  meta?: Record<string, unknown> | undefined;
1452
1452
  } | {
1453
- type: "observation";
1454
1453
  id: string;
1455
- timestamp: number;
1456
- tool_name: string;
1454
+ type: "observation";
1457
1455
  tool_call_id: string & z.BRAND<"ToolCallId">;
1456
+ tool_name: string;
1457
+ timestamp: number;
1458
1458
  success: boolean;
1459
1459
  observation: string;
1460
+ data?: unknown;
1461
+ error?: string | undefined;
1460
1462
  attachments?: {
1461
1463
  id: string;
1462
1464
  kind: "image";
@@ -1469,19 +1471,16 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1469
1471
  fileName?: string | undefined;
1470
1472
  label?: string | undefined;
1471
1473
  }[] | undefined;
1472
- error?: string | undefined;
1473
- data?: unknown;
1474
1474
  error_code?: string | undefined;
1475
1475
  duration_ms?: number | undefined;
1476
1476
  } | {
1477
- type: "final_answer";
1478
1477
  id: string;
1478
+ type: "final_answer";
1479
+ completion_reason: "tool_call" | "terminal" | "interrupted";
1479
1480
  timestamp: number;
1480
1481
  answer_id: string;
1481
- completion_reason: "tool_call" | "terminal" | "interrupted";
1482
1482
  answer: string;
1483
1483
  provider_continuations?: {
1484
- kind: string;
1485
1484
  schema_version: 2;
1486
1485
  producer: {
1487
1486
  model_id: string;
@@ -1490,13 +1489,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1490
1489
  capability_id: string;
1491
1490
  endpoint_model_id: string;
1492
1491
  };
1492
+ kind: string;
1493
1493
  payload: SerializableJsonValue;
1494
1494
  }[] | undefined;
1495
1495
  assistant_replay_parts?: ({
1496
1496
  type: "text";
1497
1497
  text: string;
1498
1498
  provider_continuations?: {
1499
- kind: string;
1500
1499
  schema_version: 2;
1501
1500
  producer: {
1502
1501
  model_id: string;
@@ -1505,13 +1504,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1505
1504
  capability_id: string;
1506
1505
  endpoint_model_id: string;
1507
1506
  };
1507
+ kind: string;
1508
1508
  payload: SerializableJsonValue;
1509
1509
  }[] | undefined;
1510
1510
  } | {
1511
1511
  type: "reasoning";
1512
1512
  text: string;
1513
1513
  provider_continuations?: {
1514
- kind: string;
1515
1514
  schema_version: 2;
1516
1515
  producer: {
1517
1516
  model_id: string;
@@ -1520,13 +1519,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1520
1519
  capability_id: string;
1521
1520
  endpoint_model_id: string;
1522
1521
  };
1522
+ kind: string;
1523
1523
  payload: SerializableJsonValue;
1524
1524
  }[] | undefined;
1525
1525
  } | {
1526
1526
  type: "tool_call";
1527
1527
  tool_call_id: string;
1528
1528
  provider_continuations?: {
1529
- kind: string;
1530
1529
  schema_version: 2;
1531
1530
  producer: {
1532
1531
  model_id: string;
@@ -1535,16 +1534,17 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1535
1534
  capability_id: string;
1536
1535
  endpoint_model_id: string;
1537
1536
  };
1537
+ kind: string;
1538
1538
  payload: SerializableJsonValue;
1539
1539
  }[] | undefined;
1540
1540
  })[] | undefined;
1541
1541
  meta?: Record<string, unknown> | undefined;
1542
1542
  } | {
1543
- type: "llm_retry";
1544
1543
  id: string;
1545
- timestamp: number;
1546
- status: "waiting" | "retrying" | "succeeded" | "exhausted" | "failed" | "cancelled";
1544
+ type: "llm_retry";
1545
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
1547
1546
  error: string;
1547
+ timestamp: number;
1548
1548
  error_code: string;
1549
1549
  retry_id: string;
1550
1550
  category: "transport" | "output" | "rate_limit" | "other";
@@ -1555,34 +1555,33 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1555
1555
  delay_ms: number;
1556
1556
  next_retry_at?: number | undefined;
1557
1557
  } | {
1558
- type: "error";
1559
1558
  id: string;
1560
- timestamp: number;
1559
+ type: "error";
1561
1560
  error: string;
1561
+ timestamp: number;
1562
1562
  error_code?: string | undefined;
1563
1563
  retry_id?: string | undefined;
1564
1564
  retryable?: boolean | undefined;
1565
1565
  details?: Record<string, unknown> | undefined;
1566
1566
  } | {
1567
- type: "stream_chunk";
1568
1567
  id: string;
1569
- timestamp: number;
1568
+ type: "stream_chunk";
1570
1569
  content: string;
1570
+ timestamp: number;
1571
1571
  answer_id: string;
1572
1572
  seq: number;
1573
1573
  is_last?: boolean | undefined;
1574
1574
  } | {
1575
- type: "stream_reset";
1576
1575
  id: string;
1576
+ type: "stream_reset";
1577
1577
  timestamp: number;
1578
1578
  answer_id?: string | undefined;
1579
1579
  thought_message_ids?: string[] | undefined;
1580
1580
  } | {
1581
- type: "provider_continuation";
1582
1581
  id: string;
1582
+ type: "provider_continuation";
1583
1583
  timestamp: number;
1584
1584
  continuations: {
1585
- kind: string;
1586
1585
  schema_version: 2;
1587
1586
  producer: {
1588
1587
  model_id: string;
@@ -1591,32 +1590,31 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1591
1590
  capability_id: string;
1592
1591
  endpoint_model_id: string;
1593
1592
  };
1593
+ kind: string;
1594
1594
  payload: SerializableJsonValue;
1595
1595
  }[];
1596
1596
  }, {
1597
- type: "thought";
1598
1597
  id: string;
1599
- timestamp: number;
1598
+ type: "thought";
1600
1599
  content: string;
1600
+ timestamp: number;
1601
1601
  is_complete: boolean;
1602
1602
  thought_message_id?: string | undefined;
1603
1603
  delta?: string | undefined;
1604
1604
  meta?: Record<string, unknown> | undefined;
1605
1605
  } | {
1606
- type: "tool_call_decision";
1607
1606
  id: string;
1608
- timestamp: number;
1607
+ type: "tool_call_decision";
1609
1608
  status: "error" | "loading" | "success";
1610
- tool_name: string;
1611
1609
  tool_call_id: string;
1612
- phase: "start" | "update" | "complete" | "error";
1610
+ tool_name: string;
1611
+ timestamp: number;
1612
+ phase: "error" | "start" | "update" | "complete";
1613
1613
  tool_args: Record<string, unknown>;
1614
1614
  tool_calls?: unknown[] | undefined;
1615
1615
  payload?: {
1616
- args?: Record<string, unknown> | undefined;
1617
1616
  tool_calls?: unknown[] | undefined;
1618
1617
  provider_continuations?: {
1619
- kind: string;
1620
1618
  schema_version: 2;
1621
1619
  producer: {
1622
1620
  model_id: string;
@@ -1625,13 +1623,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1625
1623
  capability_id: string;
1626
1624
  endpoint_model_id: string;
1627
1625
  };
1626
+ kind: string;
1628
1627
  payload: SerializableJsonValue;
1629
1628
  }[] | undefined;
1630
1629
  assistant_replay_parts?: ({
1631
1630
  type: "text";
1632
1631
  text: string;
1633
1632
  provider_continuations?: {
1634
- kind: string;
1635
1633
  schema_version: 2;
1636
1634
  producer: {
1637
1635
  model_id: string;
@@ -1640,13 +1638,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1640
1638
  capability_id: string;
1641
1639
  endpoint_model_id: string;
1642
1640
  };
1641
+ kind: string;
1643
1642
  payload: SerializableJsonValue;
1644
1643
  }[] | undefined;
1645
1644
  } | {
1646
1645
  type: "reasoning";
1647
1646
  text: string;
1648
1647
  provider_continuations?: {
1649
- kind: string;
1650
1648
  schema_version: 2;
1651
1649
  producer: {
1652
1650
  model_id: string;
@@ -1655,13 +1653,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1655
1653
  capability_id: string;
1656
1654
  endpoint_model_id: string;
1657
1655
  };
1656
+ kind: string;
1658
1657
  payload: SerializableJsonValue;
1659
1658
  }[] | undefined;
1660
1659
  } | {
1661
1660
  type: "tool_call";
1662
1661
  tool_call_id: string;
1663
1662
  provider_continuations?: {
1664
- kind: string;
1665
1663
  schema_version: 2;
1666
1664
  producer: {
1667
1665
  model_id: string;
@@ -1670,31 +1668,35 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1670
1668
  capability_id: string;
1671
1669
  endpoint_model_id: string;
1672
1670
  };
1671
+ kind: string;
1673
1672
  payload: SerializableJsonValue;
1674
1673
  }[] | undefined;
1675
1674
  })[] | undefined;
1675
+ args?: Record<string, unknown> | undefined;
1676
1676
  } | undefined;
1677
1677
  meta?: Record<string, unknown> | undefined;
1678
1678
  } | {
1679
- type: "tool_process";
1680
1679
  id: string;
1681
- timestamp: number;
1680
+ type: "tool_process";
1682
1681
  status: "error" | "loading" | "success";
1683
- tool_name: string;
1684
1682
  tool_call_id: string;
1685
- phase: "start" | "update" | "complete" | "error";
1683
+ tool_name: string;
1684
+ timestamp: number;
1685
+ phase: "error" | "start" | "update" | "complete";
1686
1686
  tool_args: Record<string, unknown>;
1687
1687
  tool_calls?: unknown[] | undefined;
1688
1688
  payload?: Record<string, unknown> | undefined;
1689
1689
  meta?: Record<string, unknown> | undefined;
1690
1690
  } | {
1691
- type: "observation";
1692
1691
  id: string;
1693
- timestamp: number;
1694
- tool_name: string;
1692
+ type: "observation";
1695
1693
  tool_call_id: string;
1694
+ tool_name: string;
1695
+ timestamp: number;
1696
1696
  success: boolean;
1697
1697
  observation: string;
1698
+ data?: unknown;
1699
+ error?: string | undefined;
1698
1700
  attachments?: {
1699
1701
  id: string;
1700
1702
  kind: "image";
@@ -1707,19 +1709,16 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1707
1709
  fileName?: string | undefined;
1708
1710
  label?: string | undefined;
1709
1711
  }[] | undefined;
1710
- error?: string | undefined;
1711
- data?: unknown;
1712
1712
  error_code?: string | undefined;
1713
1713
  duration_ms?: number | undefined;
1714
1714
  } | {
1715
- type: "final_answer";
1716
1715
  id: string;
1716
+ type: "final_answer";
1717
+ completion_reason: "tool_call" | "terminal" | "interrupted";
1717
1718
  timestamp: number;
1718
1719
  answer_id: string;
1719
- completion_reason: "tool_call" | "terminal" | "interrupted";
1720
1720
  answer: string;
1721
1721
  provider_continuations?: {
1722
- kind: string;
1723
1722
  schema_version: 2;
1724
1723
  producer: {
1725
1724
  model_id: string;
@@ -1728,13 +1727,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1728
1727
  capability_id: string;
1729
1728
  endpoint_model_id: string;
1730
1729
  };
1730
+ kind: string;
1731
1731
  payload: SerializableJsonValue;
1732
1732
  }[] | undefined;
1733
1733
  assistant_replay_parts?: ({
1734
1734
  type: "text";
1735
1735
  text: string;
1736
1736
  provider_continuations?: {
1737
- kind: string;
1738
1737
  schema_version: 2;
1739
1738
  producer: {
1740
1739
  model_id: string;
@@ -1743,13 +1742,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1743
1742
  capability_id: string;
1744
1743
  endpoint_model_id: string;
1745
1744
  };
1745
+ kind: string;
1746
1746
  payload: SerializableJsonValue;
1747
1747
  }[] | undefined;
1748
1748
  } | {
1749
1749
  type: "reasoning";
1750
1750
  text: string;
1751
1751
  provider_continuations?: {
1752
- kind: string;
1753
1752
  schema_version: 2;
1754
1753
  producer: {
1755
1754
  model_id: string;
@@ -1758,13 +1757,13 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1758
1757
  capability_id: string;
1759
1758
  endpoint_model_id: string;
1760
1759
  };
1760
+ kind: string;
1761
1761
  payload: SerializableJsonValue;
1762
1762
  }[] | undefined;
1763
1763
  } | {
1764
1764
  type: "tool_call";
1765
1765
  tool_call_id: string;
1766
1766
  provider_continuations?: {
1767
- kind: string;
1768
1767
  schema_version: 2;
1769
1768
  producer: {
1770
1769
  model_id: string;
@@ -1773,16 +1772,17 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1773
1772
  capability_id: string;
1774
1773
  endpoint_model_id: string;
1775
1774
  };
1775
+ kind: string;
1776
1776
  payload: SerializableJsonValue;
1777
1777
  }[] | undefined;
1778
1778
  })[] | undefined;
1779
1779
  meta?: Record<string, unknown> | undefined;
1780
1780
  } | {
1781
- type: "llm_retry";
1782
1781
  id: string;
1783
- timestamp: number;
1784
- status: "waiting" | "retrying" | "succeeded" | "exhausted" | "failed" | "cancelled";
1782
+ type: "llm_retry";
1783
+ status: "failed" | "cancelled" | "waiting" | "retrying" | "succeeded" | "exhausted";
1785
1784
  error: string;
1785
+ timestamp: number;
1786
1786
  error_code: string;
1787
1787
  retry_id: string;
1788
1788
  category: "transport" | "output" | "rate_limit" | "other";
@@ -1793,34 +1793,33 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1793
1793
  delay_ms: number;
1794
1794
  next_retry_at?: number | undefined;
1795
1795
  } | {
1796
- type: "error";
1797
1796
  id: string;
1798
- timestamp: number;
1797
+ type: "error";
1799
1798
  error: string;
1799
+ timestamp: number;
1800
1800
  error_code?: string | undefined;
1801
1801
  retry_id?: string | undefined;
1802
1802
  retryable?: boolean | undefined;
1803
1803
  details?: Record<string, unknown> | undefined;
1804
1804
  } | {
1805
- type: "stream_chunk";
1806
1805
  id: string;
1807
- timestamp: number;
1806
+ type: "stream_chunk";
1808
1807
  content: string;
1808
+ timestamp: number;
1809
1809
  answer_id: string;
1810
1810
  seq: number;
1811
1811
  is_last?: boolean | undefined;
1812
1812
  } | {
1813
- type: "stream_reset";
1814
1813
  id: string;
1814
+ type: "stream_reset";
1815
1815
  timestamp: number;
1816
1816
  answer_id?: string | undefined;
1817
1817
  thought_message_ids?: string[] | undefined;
1818
1818
  } | {
1819
- type: "provider_continuation";
1820
1819
  id: string;
1820
+ type: "provider_continuation";
1821
1821
  timestamp: number;
1822
1822
  continuations: {
1823
- kind: string;
1824
1823
  schema_version: 2;
1825
1824
  producer: {
1826
1825
  model_id: string;
@@ -1829,6 +1828,7 @@ declare const AgentEventSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.
1829
1828
  capability_id: string;
1830
1829
  endpoint_model_id: string;
1831
1830
  };
1831
+ kind: string;
1832
1832
  payload: SerializableJsonValue;
1833
1833
  }[];
1834
1834
  }>;