@linnlabs/linnkit 0.32.2 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cli.cjs +312 -50
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +312 -50
  5. package/dist/cli.js.map +1 -1
  6. package/dist/context-manager.cjs +1 -0
  7. package/dist/context-manager.cjs.map +1 -1
  8. package/dist/context-manager.js +1 -0
  9. package/dist/context-manager.js.map +1 -1
  10. package/dist/contracts/agentSpec.d.cts +30 -30
  11. package/dist/contracts/agentSpec.d.ts +30 -30
  12. package/dist/contracts/audit.d.cts +32 -32
  13. package/dist/contracts/audit.d.ts +32 -32
  14. package/dist/contracts/contextPolicy.d.cts +36 -36
  15. package/dist/contracts/contextPolicy.d.ts +36 -36
  16. package/dist/contracts/events.d.cts +968 -968
  17. package/dist/contracts/events.d.ts +968 -968
  18. package/dist/contracts/execution.d.cts +8 -8
  19. package/dist/contracts/execution.d.ts +8 -8
  20. package/dist/contracts/messages.d.cts +204 -204
  21. package/dist/contracts/messages.d.ts +204 -204
  22. package/dist/contracts/sse.d.cts +891 -891
  23. package/dist/contracts/sse.d.ts +891 -891
  24. package/dist/contracts/sub-run-trace-payload.d.cts +26 -26
  25. package/dist/contracts/sub-run-trace-payload.d.ts +26 -26
  26. package/dist/contracts/token-accounting.d.cts +28 -28
  27. package/dist/contracts/token-accounting.d.ts +28 -28
  28. package/dist/index.cjs +383 -66
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.js +383 -66
  31. package/dist/index.js.map +1 -1
  32. package/dist/quickstart/toolRuntime.d.cts +1 -1
  33. package/dist/quickstart/toolRuntime.d.ts +1 -1
  34. package/dist/quickstart/types.d.cts +1 -1
  35. package/dist/quickstart/types.d.ts +1 -1
  36. package/dist/quickstart.cjs +312 -50
  37. package/dist/quickstart.cjs.map +1 -1
  38. package/dist/quickstart.js +312 -50
  39. package/dist/quickstart.js.map +1 -1
  40. package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +11 -0
  41. package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +11 -0
  42. package/dist/runtime-kernel/events/agentEvents.d.cts +98 -98
  43. package/dist/runtime-kernel/events/agentEvents.d.ts +98 -98
  44. package/dist/runtime-kernel/execution/eventBusEventPersistence.d.cts +15 -1
  45. package/dist/runtime-kernel/execution/eventBusEventPersistence.d.ts +15 -1
  46. package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.cts +34 -0
  47. package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.ts +34 -0
  48. package/dist/runtime-kernel/graph-engine/engine.d.cts +13 -2
  49. package/dist/runtime-kernel/graph-engine/engine.d.ts +13 -2
  50. package/dist/runtime-kernel/graph-engine/index.d.cts +2 -1
  51. package/dist/runtime-kernel/graph-engine/index.d.ts +2 -1
  52. package/dist/runtime-kernel/graph-engine/types.d.cts +8 -0
  53. package/dist/runtime-kernel/graph-engine/types.d.ts +8 -0
  54. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +14 -2
  55. package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +14 -2
  56. package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.cts +1 -0
  57. package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.ts +1 -0
  58. package/dist/runtime-kernel/run-supervisor/runHandle.d.cts +9 -5
  59. package/dist/runtime-kernel/run-supervisor/runHandle.d.ts +9 -5
  60. package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.cts +2 -0
  61. package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.ts +2 -0
  62. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +7 -1
  63. package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +7 -1
  64. package/dist/runtime-kernel.cjs +383 -66
  65. package/dist/runtime-kernel.cjs.map +1 -1
  66. package/dist/runtime-kernel.d.cts +2 -1
  67. package/dist/runtime-kernel.d.ts +2 -1
  68. package/dist/runtime-kernel.js +381 -67
  69. package/dist/runtime-kernel.js.map +1 -1
  70. package/dist/testkit.cjs +383 -66
  71. package/dist/testkit.cjs.map +1 -1
  72. package/dist/testkit.js +383 -66
  73. package/dist/testkit.js.map +1 -1
  74. package/docs/integration/01-installation.md +1 -1
  75. package/docs/integration/child-runs.md +12 -0
  76. package/docs/integration/persistence.md +23 -0
  77. package/docs/integration/run-supervisor.md +12 -2
  78. package/package.json +4 -4
@@ -22,12 +22,12 @@ declare const RuntimeEventRoutingIdentity: z.ZodObject<{
22
22
  }, "strict", z.ZodTypeAny, {
23
23
  run_id: string & z.BRAND<"RunId">;
24
24
  lane: "foreground" | "auxiliary" | "child";
25
- visibility: "none" | "conversation" | "parent-trace";
25
+ visibility: "conversation" | "parent-trace" | "none";
26
26
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
27
27
  }, {
28
28
  run_id: string;
29
29
  lane: "foreground" | "auxiliary" | "child";
30
- visibility: "none" | "conversation" | "parent-trace";
30
+ visibility: "conversation" | "parent-trace" | "none";
31
31
  parent_run_id?: string | undefined;
32
32
  }>;
33
33
  type RuntimeEventRoutingIdentity = z.infer<typeof RuntimeEventRoutingIdentity>;
@@ -45,28 +45,28 @@ declare const BaseEvent: z.ZodObject<{
45
45
  visibility: z.ZodOptional<z.ZodEnum<["conversation", "parent-trace", "none"]>>;
46
46
  }, "strip", z.ZodTypeAny, {
47
47
  id: string;
48
+ conversation_id: string;
48
49
  timestamp: number;
49
50
  version: 1;
50
- conversation_id: string;
51
51
  turn_id: string;
52
52
  metadata?: Record<string, SerializableJsonValue> | undefined;
53
+ ephemeral?: boolean | undefined;
53
54
  run_id?: (string & z.BRAND<"RunId">) | undefined;
54
55
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
55
56
  lane?: "foreground" | "auxiliary" | "child" | undefined;
56
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
57
- ephemeral?: boolean | undefined;
57
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
58
58
  }, {
59
59
  id: string;
60
- timestamp: number;
61
60
  conversation_id: string;
61
+ timestamp: number;
62
62
  turn_id: string;
63
63
  metadata?: Record<string, SerializableJsonValue> | undefined;
64
64
  version?: 1 | undefined;
65
+ ephemeral?: boolean | undefined;
65
66
  run_id?: string | undefined;
66
67
  parent_run_id?: string | undefined;
67
68
  lane?: "foreground" | "auxiliary" | "child" | undefined;
68
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
69
- ephemeral?: boolean | undefined;
69
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
70
70
  }>;
71
71
 
72
72
  declare const ToolCallDecisionPayload: z.ZodObject<{
@@ -362,6 +362,7 @@ declare const ToolCallDecisionPayload: z.ZodObject<{
362
362
  }[] | undefined;
363
363
  }>]>, "many">>;
364
364
  }, "strict", z.ZodTypeAny, {
365
+ args?: Record<string, SerializableJsonValue> | undefined;
365
366
  tool_calls?: SerializableJsonValue[] | undefined;
366
367
  provider_continuations?: {
367
368
  kind: string;
@@ -421,8 +422,8 @@ declare const ToolCallDecisionPayload: z.ZodObject<{
421
422
  payload: SerializableJsonValue;
422
423
  }[] | undefined;
423
424
  })[] | undefined;
424
- args?: Record<string, SerializableJsonValue> | undefined;
425
425
  }, {
426
+ args?: Record<string, SerializableJsonValue> | undefined;
426
427
  tool_calls?: SerializableJsonValue[] | undefined;
427
428
  provider_continuations?: {
428
429
  kind: string;
@@ -482,7 +483,6 @@ declare const ToolCallDecisionPayload: z.ZodObject<{
482
483
  payload: SerializableJsonValue;
483
484
  }[] | undefined;
484
485
  })[] | undefined;
485
- args?: Record<string, SerializableJsonValue> | undefined;
486
486
  }>;
487
487
  type ToolCallDecisionPayload = z.infer<typeof ToolCallDecisionPayload>;
488
488
  declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -537,15 +537,21 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
537
537
  label?: string | undefined;
538
538
  }>, "many">>;
539
539
  }, "strip", z.ZodTypeAny, {
540
- id: string;
541
540
  type: "user_input";
542
- content: string;
541
+ id: string;
542
+ conversation_id: string;
543
543
  timestamp: number;
544
544
  version: 1;
545
- conversation_id: string;
546
545
  turn_id: string;
547
- source: "system" | "user" | "editor";
546
+ content: string;
547
+ source: "user" | "editor" | "system";
548
548
  metadata?: Record<string, SerializableJsonValue> | undefined;
549
+ ephemeral?: boolean | undefined;
550
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
551
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
552
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
553
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
554
+ raw_content?: string | undefined;
549
555
  attachments?: {
550
556
  id: string;
551
557
  kind: "image";
@@ -558,20 +564,22 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
558
564
  fileName?: string | undefined;
559
565
  label?: string | undefined;
560
566
  }[] | undefined;
561
- run_id?: (string & z.BRAND<"RunId">) | undefined;
562
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
563
- lane?: "foreground" | "auxiliary" | "child" | undefined;
564
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
565
- ephemeral?: boolean | undefined;
566
- raw_content?: string | undefined;
567
567
  }, {
568
- id: string;
569
568
  type: "user_input";
570
- content: string;
571
- timestamp: number;
569
+ id: string;
572
570
  conversation_id: string;
571
+ timestamp: number;
573
572
  turn_id: string;
573
+ content: string;
574
574
  metadata?: Record<string, SerializableJsonValue> | undefined;
575
+ version?: 1 | undefined;
576
+ ephemeral?: boolean | undefined;
577
+ run_id?: string | undefined;
578
+ parent_run_id?: string | undefined;
579
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
580
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
581
+ raw_content?: string | undefined;
582
+ source?: "user" | "editor" | "system" | undefined;
575
583
  attachments?: {
576
584
  id: string;
577
585
  kind: "image";
@@ -584,14 +592,6 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
584
592
  fileName?: string | undefined;
585
593
  label?: string | undefined;
586
594
  }[] | undefined;
587
- version?: 1 | undefined;
588
- run_id?: string | undefined;
589
- parent_run_id?: string | undefined;
590
- lane?: "foreground" | "auxiliary" | "child" | undefined;
591
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
592
- ephemeral?: boolean | undefined;
593
- raw_content?: string | undefined;
594
- source?: "system" | "user" | "editor" | undefined;
595
595
  }>, z.ZodObject<{
596
596
  id: z.ZodEffects<z.ZodString, string, string>;
597
597
  conversation_id: z.ZodEffects<z.ZodString, string, string>;
@@ -611,36 +611,36 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
611
611
  delta: z.ZodOptional<z.ZodString>;
612
612
  is_complete: z.ZodDefault<z.ZodBoolean>;
613
613
  }, "strip", z.ZodTypeAny, {
614
- id: string;
615
614
  type: "thought";
616
- content: string;
615
+ id: string;
616
+ conversation_id: string;
617
617
  timestamp: number;
618
618
  version: 1;
619
- conversation_id: string;
620
619
  turn_id: string;
620
+ content: string;
621
621
  is_complete: boolean;
622
622
  metadata?: Record<string, SerializableJsonValue> | undefined;
623
+ ephemeral?: boolean | undefined;
623
624
  run_id?: (string & z.BRAND<"RunId">) | undefined;
624
625
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
625
626
  lane?: "foreground" | "auxiliary" | "child" | undefined;
626
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
627
- ephemeral?: boolean | undefined;
627
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
628
628
  thought_message_id?: string | undefined;
629
629
  delta?: string | undefined;
630
630
  }, {
631
- id: string;
632
631
  type: "thought";
633
- content: string;
634
- timestamp: number;
632
+ id: string;
635
633
  conversation_id: string;
634
+ timestamp: number;
636
635
  turn_id: string;
636
+ content: string;
637
637
  metadata?: Record<string, SerializableJsonValue> | undefined;
638
638
  version?: 1 | undefined;
639
+ ephemeral?: boolean | undefined;
639
640
  run_id?: string | undefined;
640
641
  parent_run_id?: string | undefined;
641
642
  lane?: "foreground" | "auxiliary" | "child" | undefined;
642
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
643
- ephemeral?: boolean | undefined;
643
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
644
644
  thought_message_id?: string | undefined;
645
645
  delta?: string | undefined;
646
646
  is_complete?: boolean | undefined;
@@ -956,6 +956,7 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
956
956
  }[] | undefined;
957
957
  }>]>, "many">>;
958
958
  }, "strict", z.ZodTypeAny, {
959
+ args?: Record<string, SerializableJsonValue> | undefined;
959
960
  tool_calls?: SerializableJsonValue[] | undefined;
960
961
  provider_continuations?: {
961
962
  kind: string;
@@ -1015,8 +1016,8 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1015
1016
  payload: SerializableJsonValue;
1016
1017
  }[] | undefined;
1017
1018
  })[] | undefined;
1018
- args?: Record<string, SerializableJsonValue> | undefined;
1019
1019
  }, {
1020
+ args?: Record<string, SerializableJsonValue> | undefined;
1020
1021
  tool_calls?: SerializableJsonValue[] | undefined;
1021
1022
  provider_continuations?: {
1022
1023
  kind: string;
@@ -1076,22 +1077,29 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1076
1077
  payload: SerializableJsonValue;
1077
1078
  }[] | undefined;
1078
1079
  })[] | undefined;
1079
- args?: Record<string, SerializableJsonValue> | undefined;
1080
1080
  }>>;
1081
1081
  parent_tool_call_id: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "ToolCallId">>;
1082
1082
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
1083
1083
  }, "strip", z.ZodTypeAny, {
1084
- id: string;
1085
- status: "error" | "loading" | "success";
1086
1084
  type: "tool_call_decision";
1087
- tool_call_id: string & z.BRAND<"ToolCallId">;
1088
- tool_name: string;
1085
+ id: string;
1086
+ conversation_id: string;
1089
1087
  timestamp: number;
1088
+ status: "error" | "loading" | "success";
1090
1089
  version: 1;
1091
- conversation_id: string;
1092
1090
  turn_id: string;
1093
- phase: "error" | "start" | "update" | "complete";
1091
+ tool_name: string;
1092
+ tool_call_id: string & z.BRAND<"ToolCallId">;
1093
+ phase: "start" | "update" | "complete" | "error";
1094
+ metadata?: Record<string, SerializableJsonValue> | undefined;
1095
+ ephemeral?: boolean | undefined;
1096
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
1097
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1098
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
1099
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1100
+ args?: Record<string, SerializableJsonValue> | undefined;
1094
1101
  payload?: {
1102
+ args?: Record<string, SerializableJsonValue> | undefined;
1095
1103
  tool_calls?: SerializableJsonValue[] | undefined;
1096
1104
  provider_continuations?: {
1097
1105
  kind: string;
@@ -1151,28 +1159,29 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1151
1159
  payload: SerializableJsonValue;
1152
1160
  }[] | undefined;
1153
1161
  })[] | undefined;
1154
- args?: Record<string, SerializableJsonValue> | undefined;
1155
1162
  } | undefined;
1156
- args?: Record<string, SerializableJsonValue> | undefined;
1157
- metadata?: Record<string, SerializableJsonValue> | undefined;
1158
- run_id?: (string & z.BRAND<"RunId">) | undefined;
1159
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1160
- lane?: "foreground" | "auxiliary" | "child" | undefined;
1161
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1162
- ephemeral?: boolean | undefined;
1163
1163
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
1164
1164
  meta?: Record<string, SerializableJsonValue> | undefined;
1165
1165
  }, {
1166
- id: string;
1167
- status: "error" | "loading" | "success";
1168
1166
  type: "tool_call_decision";
1169
- tool_call_id: string;
1170
- tool_name: string;
1171
- timestamp: number;
1167
+ id: string;
1172
1168
  conversation_id: string;
1169
+ timestamp: number;
1170
+ status: "error" | "loading" | "success";
1173
1171
  turn_id: string;
1174
- phase: "error" | "start" | "update" | "complete";
1172
+ tool_name: string;
1173
+ tool_call_id: string;
1174
+ phase: "start" | "update" | "complete" | "error";
1175
+ metadata?: Record<string, SerializableJsonValue> | undefined;
1176
+ version?: 1 | undefined;
1177
+ ephemeral?: boolean | undefined;
1178
+ run_id?: string | undefined;
1179
+ parent_run_id?: string | undefined;
1180
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
1181
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1182
+ args?: Record<string, SerializableJsonValue> | undefined;
1175
1183
  payload?: {
1184
+ args?: Record<string, SerializableJsonValue> | undefined;
1176
1185
  tool_calls?: SerializableJsonValue[] | undefined;
1177
1186
  provider_continuations?: {
1178
1187
  kind: string;
@@ -1232,16 +1241,7 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1232
1241
  payload: SerializableJsonValue;
1233
1242
  }[] | undefined;
1234
1243
  })[] | undefined;
1235
- args?: Record<string, SerializableJsonValue> | undefined;
1236
1244
  } | undefined;
1237
- args?: Record<string, SerializableJsonValue> | undefined;
1238
- metadata?: Record<string, SerializableJsonValue> | undefined;
1239
- version?: 1 | undefined;
1240
- run_id?: string | undefined;
1241
- parent_run_id?: string | undefined;
1242
- lane?: "foreground" | "auxiliary" | "child" | undefined;
1243
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1244
- ephemeral?: boolean | undefined;
1245
1245
  parent_tool_call_id?: string | undefined;
1246
1246
  meta?: Record<string, SerializableJsonValue> | undefined;
1247
1247
  }>, z.ZodObject<{
@@ -1267,45 +1267,45 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1267
1267
  parent_tool_call_id: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "ToolCallId">>;
1268
1268
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
1269
1269
  }, "strip", z.ZodTypeAny, {
1270
- id: string;
1271
- status: "error" | "loading" | "success";
1272
1270
  type: "tool_process";
1273
- tool_call_id: string & z.BRAND<"ToolCallId">;
1274
- tool_name: string;
1271
+ id: string;
1272
+ conversation_id: string;
1275
1273
  timestamp: number;
1274
+ status: "error" | "loading" | "success";
1276
1275
  version: 1;
1277
- conversation_id: string;
1278
1276
  turn_id: string;
1279
- phase: "error" | "start" | "update" | "complete";
1280
- payload?: Record<string, SerializableJsonValue> | undefined;
1281
- args?: Record<string, SerializableJsonValue> | undefined;
1277
+ tool_name: string;
1278
+ tool_call_id: string & z.BRAND<"ToolCallId">;
1279
+ phase: "start" | "update" | "complete" | "error";
1282
1280
  metadata?: Record<string, SerializableJsonValue> | undefined;
1281
+ ephemeral?: boolean | undefined;
1283
1282
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1284
1283
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1285
1284
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1286
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1287
- ephemeral?: boolean | undefined;
1285
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1286
+ args?: Record<string, SerializableJsonValue> | undefined;
1287
+ payload?: Record<string, SerializableJsonValue> | undefined;
1288
1288
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
1289
1289
  meta?: Record<string, SerializableJsonValue> | undefined;
1290
1290
  }, {
1291
- id: string;
1292
- status: "error" | "loading" | "success";
1293
1291
  type: "tool_process";
1294
- tool_call_id: string;
1295
- tool_name: string;
1296
- timestamp: number;
1292
+ id: string;
1297
1293
  conversation_id: string;
1294
+ timestamp: number;
1295
+ status: "error" | "loading" | "success";
1298
1296
  turn_id: string;
1299
- phase: "error" | "start" | "update" | "complete";
1300
- payload?: Record<string, SerializableJsonValue> | undefined;
1301
- args?: Record<string, SerializableJsonValue> | undefined;
1297
+ tool_name: string;
1298
+ tool_call_id: string;
1299
+ phase: "start" | "update" | "complete" | "error";
1302
1300
  metadata?: Record<string, SerializableJsonValue> | undefined;
1303
1301
  version?: 1 | undefined;
1302
+ ephemeral?: boolean | undefined;
1304
1303
  run_id?: string | undefined;
1305
1304
  parent_run_id?: string | undefined;
1306
1305
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1307
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1308
- ephemeral?: boolean | undefined;
1306
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1307
+ args?: Record<string, SerializableJsonValue> | undefined;
1308
+ payload?: Record<string, SerializableJsonValue> | undefined;
1309
1309
  parent_tool_call_id?: string | undefined;
1310
1310
  meta?: Record<string, SerializableJsonValue> | undefined;
1311
1311
  }>, z.ZodObject<{
@@ -1365,19 +1365,22 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1365
1365
  label?: string | undefined;
1366
1366
  }>, "many">>;
1367
1367
  }, "strip", z.ZodTypeAny, {
1368
- id: string;
1369
- status: "error" | "success";
1370
1368
  type: "tool_output";
1371
- tool_call_id: string & z.BRAND<"ToolCallId">;
1372
- tool_name: string;
1369
+ id: string;
1370
+ conversation_id: string;
1373
1371
  timestamp: number;
1372
+ status: "error" | "success";
1374
1373
  version: 1;
1375
- conversation_id: string;
1376
1374
  turn_id: string;
1375
+ tool_name: string;
1376
+ tool_call_id: string & z.BRAND<"ToolCallId">;
1377
1377
  observation: string;
1378
- data?: SerializableJsonValue | undefined;
1379
- error?: string | undefined;
1380
1378
  metadata?: Record<string, SerializableJsonValue> | undefined;
1379
+ ephemeral?: boolean | undefined;
1380
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
1381
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1382
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
1383
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1381
1384
  attachments?: {
1382
1385
  id: string;
1383
1386
  kind: "image";
@@ -1390,26 +1393,27 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1390
1393
  fileName?: string | undefined;
1391
1394
  label?: string | undefined;
1392
1395
  }[] | undefined;
1393
- run_id?: (string & z.BRAND<"RunId">) | undefined;
1394
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1395
- lane?: "foreground" | "auxiliary" | "child" | undefined;
1396
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1397
- ephemeral?: boolean | undefined;
1396
+ error?: string | undefined;
1397
+ data?: SerializableJsonValue | undefined;
1398
1398
  error_code?: string | undefined;
1399
1399
  duration_ms?: number | undefined;
1400
1400
  }, {
1401
- id: string;
1402
- status: "error" | "success";
1403
1401
  type: "tool_output";
1404
- tool_call_id: string;
1405
- tool_name: string;
1406
- timestamp: number;
1402
+ id: string;
1407
1403
  conversation_id: string;
1404
+ timestamp: number;
1405
+ status: "error" | "success";
1408
1406
  turn_id: string;
1407
+ tool_name: string;
1408
+ tool_call_id: string;
1409
1409
  observation: string;
1410
- data?: SerializableJsonValue | undefined;
1411
- error?: string | undefined;
1412
1410
  metadata?: Record<string, SerializableJsonValue> | undefined;
1411
+ version?: 1 | undefined;
1412
+ ephemeral?: boolean | undefined;
1413
+ run_id?: string | undefined;
1414
+ parent_run_id?: string | undefined;
1415
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
1416
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1413
1417
  attachments?: {
1414
1418
  id: string;
1415
1419
  kind: "image";
@@ -1422,12 +1426,8 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1422
1426
  fileName?: string | undefined;
1423
1427
  label?: string | undefined;
1424
1428
  }[] | undefined;
1425
- version?: 1 | undefined;
1426
- run_id?: string | undefined;
1427
- parent_run_id?: string | undefined;
1428
- lane?: "foreground" | "auxiliary" | "child" | undefined;
1429
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1430
- ephemeral?: boolean | undefined;
1429
+ error?: string | undefined;
1430
+ data?: SerializableJsonValue | undefined;
1431
1431
  error_code?: string | undefined;
1432
1432
  duration_ms?: number | undefined;
1433
1433
  }>, z.ZodObject<{
@@ -1463,12 +1463,12 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1463
1463
  tool_name: z.ZodString;
1464
1464
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
1465
1465
  }, "strict", z.ZodTypeAny, {
1466
- tool_call_id: string & z.BRAND<"ToolCallId">;
1467
1466
  tool_name: string;
1467
+ tool_call_id: string & z.BRAND<"ToolCallId">;
1468
1468
  args: Record<string, SerializableJsonValue>;
1469
1469
  }, {
1470
- tool_call_id: string;
1471
1470
  tool_name: string;
1471
+ tool_call_id: string;
1472
1472
  args: Record<string, SerializableJsonValue>;
1473
1473
  }>, "many">>;
1474
1474
  output: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
@@ -1515,29 +1515,24 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1515
1515
  type: z.ZodLiteral<"subrun_trace">;
1516
1516
  ephemeral: z.ZodLiteral<true>;
1517
1517
  }, "strip", z.ZodTypeAny, {
1518
- id: string;
1519
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
1520
1518
  type: "subrun_trace";
1519
+ id: string;
1520
+ conversation_id: string;
1521
1521
  timestamp: number;
1522
1522
  version: 1;
1523
- conversation_id: string;
1524
1523
  turn_id: string;
1525
1524
  ephemeral: true;
1525
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
1526
1526
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
1527
1527
  subrun_id: string;
1528
1528
  source_event_id: string;
1529
1529
  status?: "error" | "loading" | "success" | undefined;
1530
- tool_calls?: {
1531
- tool_call_id: string & z.BRAND<"ToolCallId">;
1532
- tool_name: string;
1533
- args: Record<string, SerializableJsonValue>;
1534
- }[] | undefined;
1535
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
1536
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
1537
- tool_name?: string | undefined;
1538
- args?: Record<string, SerializableJsonValue> | undefined;
1539
- content?: string | undefined;
1540
1530
  metadata?: Record<string, SerializableJsonValue> | undefined;
1531
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
1532
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1533
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
1534
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1535
+ content?: string | undefined;
1541
1536
  attachments?: {
1542
1537
  id: string;
1543
1538
  kind: "image";
@@ -1550,46 +1545,47 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1550
1545
  fileName?: string | undefined;
1551
1546
  label?: string | undefined;
1552
1547
  }[] | undefined;
1553
- run_id?: (string & z.BRAND<"RunId">) | undefined;
1554
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1555
- lane?: "foreground" | "auxiliary" | "child" | undefined;
1556
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1557
1548
  delta?: string | undefined;
1558
- phase?: "error" | "start" | "update" | "complete" | undefined;
1549
+ tool_name?: string | undefined;
1550
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
1551
+ phase?: "start" | "update" | "complete" | "error" | undefined;
1552
+ args?: Record<string, SerializableJsonValue> | undefined;
1553
+ tool_calls?: {
1554
+ tool_name: string;
1555
+ tool_call_id: string & z.BRAND<"ToolCallId">;
1556
+ args: Record<string, SerializableJsonValue>;
1557
+ }[] | undefined;
1559
1558
  meta?: Record<string, SerializableJsonValue> | undefined;
1560
1559
  duration_ms?: number | undefined;
1561
1560
  subrun_parent_id?: string | undefined;
1562
1561
  answer_id?: string | undefined;
1563
1562
  seq?: number | undefined;
1564
1563
  is_last?: boolean | undefined;
1564
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
1565
1565
  output?: SerializableJsonValue | undefined;
1566
1566
  original_message_count?: number | undefined;
1567
1567
  compression_ratio?: number | undefined;
1568
1568
  included_old_summary?: boolean | undefined;
1569
1569
  replaced_message_ids?: string[] | undefined;
1570
1570
  }, {
1571
- id: string;
1572
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
1573
1571
  type: "subrun_trace";
1574
- timestamp: number;
1572
+ id: string;
1575
1573
  conversation_id: string;
1574
+ timestamp: number;
1576
1575
  turn_id: string;
1577
1576
  ephemeral: true;
1577
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
1578
1578
  parent_tool_call_id: string;
1579
1579
  subrun_id: string;
1580
1580
  source_event_id: string;
1581
1581
  status?: "error" | "loading" | "success" | undefined;
1582
- tool_calls?: {
1583
- tool_call_id: string;
1584
- tool_name: string;
1585
- args: Record<string, SerializableJsonValue>;
1586
- }[] | undefined;
1587
- tool_call_id?: string | undefined;
1588
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
1589
- tool_name?: string | undefined;
1590
- args?: Record<string, SerializableJsonValue> | undefined;
1591
- content?: string | undefined;
1592
1582
  metadata?: Record<string, SerializableJsonValue> | undefined;
1583
+ version?: 1 | undefined;
1584
+ run_id?: string | undefined;
1585
+ parent_run_id?: string | undefined;
1586
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
1587
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1588
+ content?: string | undefined;
1593
1589
  attachments?: {
1594
1590
  id: string;
1595
1591
  kind: "image";
@@ -1602,19 +1598,23 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1602
1598
  fileName?: string | undefined;
1603
1599
  label?: string | undefined;
1604
1600
  }[] | undefined;
1605
- version?: 1 | undefined;
1606
- run_id?: string | undefined;
1607
- parent_run_id?: string | undefined;
1608
- lane?: "foreground" | "auxiliary" | "child" | undefined;
1609
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1610
1601
  delta?: string | undefined;
1611
- phase?: "error" | "start" | "update" | "complete" | undefined;
1612
- meta?: Record<string, SerializableJsonValue> | undefined;
1613
- duration_ms?: number | undefined;
1614
- subrun_parent_id?: string | undefined;
1615
- answer_id?: string | undefined;
1616
- seq?: number | undefined;
1602
+ tool_name?: string | undefined;
1603
+ tool_call_id?: string | undefined;
1604
+ phase?: "start" | "update" | "complete" | "error" | undefined;
1605
+ args?: Record<string, SerializableJsonValue> | undefined;
1606
+ tool_calls?: {
1607
+ tool_name: string;
1608
+ tool_call_id: string;
1609
+ args: Record<string, SerializableJsonValue>;
1610
+ }[] | undefined;
1611
+ meta?: Record<string, SerializableJsonValue> | undefined;
1612
+ duration_ms?: number | undefined;
1613
+ subrun_parent_id?: string | undefined;
1614
+ answer_id?: string | undefined;
1615
+ seq?: number | undefined;
1617
1616
  is_last?: boolean | undefined;
1617
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
1618
1618
  output?: SerializableJsonValue | undefined;
1619
1619
  original_message_count?: number | undefined;
1620
1620
  compression_ratio?: number | undefined;
@@ -1643,44 +1643,44 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1643
1643
  resume_token: z.ZodEffects<z.ZodString, string, string>;
1644
1644
  interaction_status: z.ZodLiteral<"pending">;
1645
1645
  }, "strip", z.ZodTypeAny, {
1646
- id: string;
1647
1646
  type: "requires_user_interaction";
1648
- tool_call_id: string & z.BRAND<"ToolCallId">;
1647
+ id: string;
1648
+ conversation_id: string;
1649
1649
  timestamp: number;
1650
1650
  version: 1;
1651
- run_id: string & z.BRAND<"RunId">;
1652
- conversation_id: string;
1653
1651
  turn_id: string;
1652
+ run_id: string & z.BRAND<"RunId">;
1653
+ tool_call_id: string & z.BRAND<"ToolCallId">;
1654
1654
  interaction_id: string;
1655
1655
  checkpoint_revision: number;
1656
1656
  resume_token: string;
1657
1657
  interaction_status: "pending";
1658
1658
  metadata?: Record<string, SerializableJsonValue> | undefined;
1659
+ ephemeral?: boolean | undefined;
1659
1660
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1660
1661
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1661
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1662
- ephemeral?: boolean | undefined;
1662
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1663
1663
  form?: SerializableJsonValue | undefined;
1664
1664
  interaction_type?: string | undefined;
1665
1665
  prompt?: string | undefined;
1666
1666
  }, {
1667
- id: string;
1668
1667
  type: "requires_user_interaction";
1669
- tool_call_id: string;
1670
- timestamp: number;
1671
- run_id: string;
1668
+ id: string;
1672
1669
  conversation_id: string;
1670
+ timestamp: number;
1673
1671
  turn_id: string;
1672
+ run_id: string;
1673
+ tool_call_id: string;
1674
1674
  interaction_id: string;
1675
1675
  checkpoint_revision: number;
1676
1676
  resume_token: string;
1677
1677
  interaction_status: "pending";
1678
1678
  metadata?: Record<string, SerializableJsonValue> | undefined;
1679
1679
  version?: 1 | undefined;
1680
+ ephemeral?: boolean | undefined;
1680
1681
  parent_run_id?: string | undefined;
1681
1682
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1682
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1683
- ephemeral?: boolean | undefined;
1683
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1684
1684
  form?: SerializableJsonValue | undefined;
1685
1685
  interaction_type?: string | undefined;
1686
1686
  prompt?: string | undefined;
@@ -1708,11 +1708,11 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1708
1708
  id: z.ZodOptional<z.ZodString>;
1709
1709
  name: z.ZodOptional<z.ZodString>;
1710
1710
  }, "strip", z.ZodTypeAny, {
1711
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
1711
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
1712
1712
  id?: string | undefined;
1713
1713
  name?: string | undefined;
1714
1714
  }, {
1715
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
1715
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
1716
1716
  id?: string | undefined;
1717
1717
  name?: string | undefined;
1718
1718
  }>;
@@ -1723,12 +1723,12 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1723
1723
  policy: z.ZodOptional<z.ZodString>;
1724
1724
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1725
1725
  }, "strip", z.ZodTypeAny, {
1726
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
1726
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
1727
1727
  metadata?: Record<string, unknown> | undefined;
1728
1728
  reason?: string | undefined;
1729
1729
  policy?: string | undefined;
1730
1730
  }, {
1731
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
1731
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
1732
1732
  metadata?: Record<string, unknown> | undefined;
1733
1733
  reason?: string | undefined;
1734
1734
  policy?: string | undefined;
@@ -1740,14 +1740,14 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1740
1740
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1741
1741
  }, "strip", z.ZodTypeAny, {
1742
1742
  kind: string;
1743
- summary?: string | undefined;
1744
1743
  metadata?: Record<string, unknown> | undefined;
1745
1744
  ref?: string | undefined;
1745
+ summary?: string | undefined;
1746
1746
  }, {
1747
1747
  kind: string;
1748
- summary?: string | undefined;
1749
1748
  metadata?: Record<string, unknown> | undefined;
1750
1749
  ref?: string | undefined;
1750
+ summary?: string | undefined;
1751
1751
  }>, "many">>;
1752
1752
  costDelta: z.ZodOptional<z.ZodObject<{
1753
1753
  tokensInput: z.ZodOptional<z.ZodNumber>;
@@ -1779,51 +1779,51 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1779
1779
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1780
1780
  }, "strip", z.ZodTypeAny, {
1781
1781
  metadata?: Record<string, unknown> | undefined;
1782
- toolName?: string | undefined;
1783
- conversationId?: string | undefined;
1784
1782
  runId?: (string & z.BRAND<"RunId">) | undefined;
1785
1783
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
1784
+ conversationId?: string | undefined;
1786
1785
  turnId?: string | undefined;
1787
1786
  traceId?: string | undefined;
1788
1787
  agentSpecId?: string | undefined;
1789
1788
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
1789
+ toolName?: string | undefined;
1790
1790
  modelId?: string | undefined;
1791
1791
  nodeId?: string | undefined;
1792
1792
  }, {
1793
1793
  metadata?: Record<string, unknown> | undefined;
1794
- toolName?: string | undefined;
1795
- conversationId?: string | undefined;
1796
1794
  runId?: string | undefined;
1797
1795
  parentRunId?: string | undefined;
1796
+ conversationId?: string | undefined;
1798
1797
  turnId?: string | undefined;
1799
1798
  traceId?: string | undefined;
1800
1799
  agentSpecId?: string | undefined;
1801
1800
  toolCallId?: string | undefined;
1801
+ toolName?: string | undefined;
1802
1802
  modelId?: string | undefined;
1803
1803
  nodeId?: string | undefined;
1804
1804
  }>>;
1805
1805
  }, "strip", z.ZodTypeAny, {
1806
- runId: string & z.BRAND<"RunId">;
1807
1806
  envelopeId: string;
1807
+ runId: string & z.BRAND<"RunId">;
1808
1808
  ts: number;
1809
1809
  actor: {
1810
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
1810
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
1811
1811
  id?: string | undefined;
1812
1812
  name?: string | undefined;
1813
1813
  };
1814
1814
  action: string;
1815
1815
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
1816
1816
  decision?: {
1817
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
1817
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
1818
1818
  metadata?: Record<string, unknown> | undefined;
1819
1819
  reason?: string | undefined;
1820
1820
  policy?: string | undefined;
1821
1821
  } | undefined;
1822
1822
  evidence?: {
1823
1823
  kind: string;
1824
- summary?: string | undefined;
1825
1824
  metadata?: Record<string, unknown> | undefined;
1826
1825
  ref?: string | undefined;
1826
+ summary?: string | undefined;
1827
1827
  }[] | undefined;
1828
1828
  costDelta?: {
1829
1829
  tokensInput?: number | undefined;
@@ -1833,39 +1833,39 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1833
1833
  } | undefined;
1834
1834
  scope?: {
1835
1835
  metadata?: Record<string, unknown> | undefined;
1836
- toolName?: string | undefined;
1837
- conversationId?: string | undefined;
1838
1836
  runId?: (string & z.BRAND<"RunId">) | undefined;
1839
1837
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
1838
+ conversationId?: string | undefined;
1840
1839
  turnId?: string | undefined;
1841
1840
  traceId?: string | undefined;
1842
1841
  agentSpecId?: string | undefined;
1843
1842
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
1843
+ toolName?: string | undefined;
1844
1844
  modelId?: string | undefined;
1845
1845
  nodeId?: string | undefined;
1846
1846
  } | undefined;
1847
1847
  }, {
1848
- runId: string;
1849
1848
  envelopeId: string;
1849
+ runId: string;
1850
1850
  ts: number;
1851
1851
  actor: {
1852
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
1852
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
1853
1853
  id?: string | undefined;
1854
1854
  name?: string | undefined;
1855
1855
  };
1856
1856
  action: string;
1857
1857
  parentRunId?: string | undefined;
1858
1858
  decision?: {
1859
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
1859
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
1860
1860
  metadata?: Record<string, unknown> | undefined;
1861
1861
  reason?: string | undefined;
1862
1862
  policy?: string | undefined;
1863
1863
  } | undefined;
1864
1864
  evidence?: {
1865
1865
  kind: string;
1866
- summary?: string | undefined;
1867
1866
  metadata?: Record<string, unknown> | undefined;
1868
1867
  ref?: string | undefined;
1868
+ summary?: string | undefined;
1869
1869
  }[] | undefined;
1870
1870
  costDelta?: {
1871
1871
  tokensInput?: number | undefined;
@@ -1875,47 +1875,47 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1875
1875
  } | undefined;
1876
1876
  scope?: {
1877
1877
  metadata?: Record<string, unknown> | undefined;
1878
- toolName?: string | undefined;
1879
- conversationId?: string | undefined;
1880
1878
  runId?: string | undefined;
1881
1879
  parentRunId?: string | undefined;
1880
+ conversationId?: string | undefined;
1882
1881
  turnId?: string | undefined;
1883
1882
  traceId?: string | undefined;
1884
1883
  agentSpecId?: string | undefined;
1885
1884
  toolCallId?: string | undefined;
1885
+ toolName?: string | undefined;
1886
1886
  modelId?: string | undefined;
1887
1887
  nodeId?: string | undefined;
1888
1888
  } | undefined;
1889
1889
  }>;
1890
1890
  }, "strip", z.ZodTypeAny, {
1891
- id: string;
1892
1891
  type: "audit_envelope";
1892
+ id: string;
1893
+ conversation_id: string;
1893
1894
  timestamp: number;
1894
1895
  version: 1;
1895
- conversation_id: string;
1896
1896
  turn_id: string;
1897
1897
  envelope: {
1898
- runId: string & z.BRAND<"RunId">;
1899
1898
  envelopeId: string;
1899
+ runId: string & z.BRAND<"RunId">;
1900
1900
  ts: number;
1901
1901
  actor: {
1902
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
1902
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
1903
1903
  id?: string | undefined;
1904
1904
  name?: string | undefined;
1905
1905
  };
1906
1906
  action: string;
1907
1907
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
1908
1908
  decision?: {
1909
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
1909
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
1910
1910
  metadata?: Record<string, unknown> | undefined;
1911
1911
  reason?: string | undefined;
1912
1912
  policy?: string | undefined;
1913
1913
  } | undefined;
1914
1914
  evidence?: {
1915
1915
  kind: string;
1916
- summary?: string | undefined;
1917
1916
  metadata?: Record<string, unknown> | undefined;
1918
1917
  ref?: string | undefined;
1918
+ summary?: string | undefined;
1919
1919
  }[] | undefined;
1920
1920
  costDelta?: {
1921
1921
  tokensInput?: number | undefined;
@@ -1925,52 +1925,52 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1925
1925
  } | undefined;
1926
1926
  scope?: {
1927
1927
  metadata?: Record<string, unknown> | undefined;
1928
- toolName?: string | undefined;
1929
- conversationId?: string | undefined;
1930
1928
  runId?: (string & z.BRAND<"RunId">) | undefined;
1931
1929
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
1930
+ conversationId?: string | undefined;
1932
1931
  turnId?: string | undefined;
1933
1932
  traceId?: string | undefined;
1934
1933
  agentSpecId?: string | undefined;
1935
1934
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
1935
+ toolName?: string | undefined;
1936
1936
  modelId?: string | undefined;
1937
1937
  nodeId?: string | undefined;
1938
1938
  } | undefined;
1939
1939
  };
1940
1940
  metadata?: Record<string, SerializableJsonValue> | undefined;
1941
+ ephemeral?: boolean | undefined;
1941
1942
  run_id?: (string & z.BRAND<"RunId">) | undefined;
1942
1943
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
1943
1944
  lane?: "foreground" | "auxiliary" | "child" | undefined;
1944
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
1945
- ephemeral?: boolean | undefined;
1945
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
1946
1946
  }, {
1947
- id: string;
1948
1947
  type: "audit_envelope";
1949
- timestamp: number;
1948
+ id: string;
1950
1949
  conversation_id: string;
1950
+ timestamp: number;
1951
1951
  turn_id: string;
1952
1952
  envelope: {
1953
- runId: string;
1954
1953
  envelopeId: string;
1954
+ runId: string;
1955
1955
  ts: number;
1956
1956
  actor: {
1957
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
1957
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
1958
1958
  id?: string | undefined;
1959
1959
  name?: string | undefined;
1960
1960
  };
1961
1961
  action: string;
1962
1962
  parentRunId?: string | undefined;
1963
1963
  decision?: {
1964
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
1964
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
1965
1965
  metadata?: Record<string, unknown> | undefined;
1966
1966
  reason?: string | undefined;
1967
1967
  policy?: string | undefined;
1968
1968
  } | undefined;
1969
1969
  evidence?: {
1970
1970
  kind: string;
1971
- summary?: string | undefined;
1972
1971
  metadata?: Record<string, unknown> | undefined;
1973
1972
  ref?: string | undefined;
1973
+ summary?: string | undefined;
1974
1974
  }[] | undefined;
1975
1975
  costDelta?: {
1976
1976
  tokensInput?: number | undefined;
@@ -1980,25 +1980,25 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1980
1980
  } | undefined;
1981
1981
  scope?: {
1982
1982
  metadata?: Record<string, unknown> | undefined;
1983
- toolName?: string | undefined;
1984
- conversationId?: string | undefined;
1985
1983
  runId?: string | undefined;
1986
1984
  parentRunId?: string | undefined;
1985
+ conversationId?: string | undefined;
1987
1986
  turnId?: string | undefined;
1988
1987
  traceId?: string | undefined;
1989
1988
  agentSpecId?: string | undefined;
1990
1989
  toolCallId?: string | undefined;
1990
+ toolName?: string | undefined;
1991
1991
  modelId?: string | undefined;
1992
1992
  nodeId?: string | undefined;
1993
1993
  } | undefined;
1994
1994
  };
1995
1995
  metadata?: Record<string, SerializableJsonValue> | undefined;
1996
1996
  version?: 1 | undefined;
1997
+ ephemeral?: boolean | undefined;
1997
1998
  run_id?: string | undefined;
1998
1999
  parent_run_id?: string | undefined;
1999
2000
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2000
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2001
- ephemeral?: boolean | undefined;
2001
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2002
2002
  }>, z.ZodObject<{
2003
2003
  id: z.ZodEffects<z.ZodString, string, string>;
2004
2004
  conversation_id: z.ZodEffects<z.ZodString, string, string>;
@@ -2304,16 +2304,22 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2304
2304
  }>]>, "many">>;
2305
2305
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
2306
2306
  }, "strip", z.ZodTypeAny, {
2307
- id: string;
2308
2307
  type: "final_answer";
2309
- completion_reason: "tool_call" | "terminal" | "interrupted";
2310
- content: string;
2308
+ id: string;
2309
+ conversation_id: string;
2311
2310
  timestamp: number;
2312
2311
  version: 1;
2313
- conversation_id: string;
2314
2312
  turn_id: string;
2313
+ content: string;
2315
2314
  is_complete: boolean;
2316
2315
  answer_id: string;
2316
+ completion_reason: "tool_call" | "terminal" | "interrupted";
2317
+ metadata?: Record<string, SerializableJsonValue> | undefined;
2318
+ ephemeral?: boolean | undefined;
2319
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
2320
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2321
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
2322
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2317
2323
  provider_continuations?: {
2318
2324
  kind: string;
2319
2325
  schema_version: 2;
@@ -2372,22 +2378,24 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2372
2378
  payload: SerializableJsonValue;
2373
2379
  }[] | undefined;
2374
2380
  })[] | undefined;
2375
- metadata?: Record<string, SerializableJsonValue> | undefined;
2376
- run_id?: (string & z.BRAND<"RunId">) | undefined;
2377
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2378
- lane?: "foreground" | "auxiliary" | "child" | undefined;
2379
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2380
- ephemeral?: boolean | undefined;
2381
2381
  meta?: Record<string, SerializableJsonValue> | undefined;
2382
2382
  }, {
2383
- id: string;
2384
2383
  type: "final_answer";
2385
- completion_reason: "tool_call" | "terminal" | "interrupted";
2386
- content: string;
2387
- timestamp: number;
2384
+ id: string;
2388
2385
  conversation_id: string;
2386
+ timestamp: number;
2389
2387
  turn_id: string;
2388
+ content: string;
2390
2389
  answer_id: string;
2390
+ completion_reason: "tool_call" | "terminal" | "interrupted";
2391
+ metadata?: Record<string, SerializableJsonValue> | undefined;
2392
+ version?: 1 | undefined;
2393
+ ephemeral?: boolean | undefined;
2394
+ run_id?: string | undefined;
2395
+ parent_run_id?: string | undefined;
2396
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
2397
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2398
+ is_complete?: boolean | undefined;
2391
2399
  provider_continuations?: {
2392
2400
  kind: string;
2393
2401
  schema_version: 2;
@@ -2446,14 +2454,6 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2446
2454
  payload: SerializableJsonValue;
2447
2455
  }[] | undefined;
2448
2456
  })[] | undefined;
2449
- metadata?: Record<string, SerializableJsonValue> | undefined;
2450
- version?: 1 | undefined;
2451
- run_id?: string | undefined;
2452
- parent_run_id?: string | undefined;
2453
- lane?: "foreground" | "auxiliary" | "child" | undefined;
2454
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2455
- ephemeral?: boolean | undefined;
2456
- is_complete?: boolean | undefined;
2457
2457
  meta?: Record<string, SerializableJsonValue> | undefined;
2458
2458
  }>, z.ZodObject<{
2459
2459
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -2474,38 +2474,38 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2474
2474
  content: z.ZodString;
2475
2475
  is_last: z.ZodOptional<z.ZodBoolean>;
2476
2476
  }, "strip", z.ZodTypeAny, {
2477
- id: string;
2478
2477
  type: "final_answer_chunk";
2479
- content: string;
2478
+ id: string;
2479
+ conversation_id: string;
2480
2480
  timestamp: number;
2481
2481
  version: 1;
2482
- conversation_id: string;
2483
2482
  turn_id: string;
2483
+ content: string;
2484
2484
  answer_id: string;
2485
2485
  seq: number;
2486
2486
  metadata?: Record<string, SerializableJsonValue> | undefined;
2487
+ ephemeral?: boolean | undefined;
2487
2488
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2488
2489
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2489
2490
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2490
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2491
- ephemeral?: boolean | undefined;
2491
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2492
2492
  is_last?: boolean | undefined;
2493
2493
  }, {
2494
- id: string;
2495
2494
  type: "final_answer_chunk";
2496
- content: string;
2497
- timestamp: number;
2495
+ id: string;
2498
2496
  conversation_id: string;
2497
+ timestamp: number;
2499
2498
  turn_id: string;
2499
+ content: string;
2500
2500
  answer_id: string;
2501
2501
  seq: number;
2502
2502
  metadata?: Record<string, SerializableJsonValue> | undefined;
2503
2503
  version?: 1 | undefined;
2504
+ ephemeral?: boolean | undefined;
2504
2505
  run_id?: string | undefined;
2505
2506
  parent_run_id?: string | undefined;
2506
2507
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2507
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2508
- ephemeral?: boolean | undefined;
2508
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2509
2509
  is_last?: boolean | undefined;
2510
2510
  }>, z.ZodObject<{
2511
2511
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -2524,33 +2524,33 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2524
2524
  answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2525
2525
  thought_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
2526
2526
  }, "strip", z.ZodTypeAny, {
2527
- id: string;
2528
2527
  type: "final_answer_reset";
2528
+ id: string;
2529
+ conversation_id: string;
2529
2530
  timestamp: number;
2530
2531
  version: 1;
2531
- conversation_id: string;
2532
2532
  turn_id: string;
2533
2533
  metadata?: Record<string, SerializableJsonValue> | undefined;
2534
+ ephemeral?: boolean | undefined;
2534
2535
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2535
2536
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2536
2537
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2537
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2538
- ephemeral?: boolean | undefined;
2538
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2539
2539
  answer_id?: string | undefined;
2540
2540
  thought_message_ids?: string[] | undefined;
2541
2541
  }, {
2542
- id: string;
2543
2542
  type: "final_answer_reset";
2544
- timestamp: number;
2543
+ id: string;
2545
2544
  conversation_id: string;
2545
+ timestamp: number;
2546
2546
  turn_id: string;
2547
2547
  metadata?: Record<string, SerializableJsonValue> | undefined;
2548
2548
  version?: 1 | undefined;
2549
+ ephemeral?: boolean | undefined;
2549
2550
  run_id?: string | undefined;
2550
2551
  parent_run_id?: string | undefined;
2551
2552
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2552
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2553
- ephemeral?: boolean | undefined;
2553
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2554
2554
  answer_id?: string | undefined;
2555
2555
  thought_message_ids?: string[] | undefined;
2556
2556
  }>, z.ZodObject<{
@@ -2574,41 +2574,41 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2574
2574
  compression_ratio: z.ZodOptional<z.ZodNumber>;
2575
2575
  included_old_summary: z.ZodOptional<z.ZodBoolean>;
2576
2576
  }, "strip", z.ZodTypeAny, {
2577
- id: string;
2578
2577
  type: "history_summary";
2579
- content: string;
2578
+ id: string;
2579
+ conversation_id: string;
2580
2580
  timestamp: number;
2581
2581
  version: 1;
2582
- conversation_id: string;
2583
2582
  turn_id: string;
2583
+ content: string;
2584
2584
  original_message_count: number;
2585
2585
  replaced_message_ids: string[];
2586
2586
  summary_seq: number;
2587
2587
  metadata?: Record<string, SerializableJsonValue> | undefined;
2588
+ ephemeral?: boolean | undefined;
2588
2589
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2589
2590
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2590
2591
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2591
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2592
- ephemeral?: boolean | undefined;
2592
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2593
2593
  compression_ratio?: number | undefined;
2594
2594
  included_old_summary?: boolean | undefined;
2595
2595
  }, {
2596
- id: string;
2597
2596
  type: "history_summary";
2598
- content: string;
2599
- timestamp: number;
2597
+ id: string;
2600
2598
  conversation_id: string;
2599
+ timestamp: number;
2601
2600
  turn_id: string;
2601
+ content: string;
2602
2602
  original_message_count: number;
2603
2603
  replaced_message_ids: string[];
2604
2604
  summary_seq: number;
2605
2605
  metadata?: Record<string, SerializableJsonValue> | undefined;
2606
2606
  version?: 1 | undefined;
2607
+ ephemeral?: boolean | undefined;
2607
2608
  run_id?: string | undefined;
2608
2609
  parent_run_id?: string | undefined;
2609
2610
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2610
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2611
- ephemeral?: boolean | undefined;
2611
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2612
2612
  compression_ratio?: number | undefined;
2613
2613
  included_old_summary?: boolean | undefined;
2614
2614
  }>, z.ZodObject<{
@@ -2630,36 +2630,36 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2630
2630
  error_code: z.ZodOptional<z.ZodString>;
2631
2631
  retryable: z.ZodOptional<z.ZodBoolean>;
2632
2632
  }, "strip", z.ZodTypeAny, {
2633
- id: string;
2634
2633
  type: "error";
2635
- error: string;
2634
+ id: string;
2635
+ conversation_id: string;
2636
2636
  timestamp: number;
2637
2637
  version: 1;
2638
- conversation_id: string;
2639
2638
  turn_id: string;
2639
+ error: string;
2640
2640
  metadata?: Record<string, SerializableJsonValue> | undefined;
2641
+ ephemeral?: boolean | undefined;
2641
2642
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2642
2643
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2643
2644
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2644
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2645
- ephemeral?: boolean | undefined;
2645
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2646
2646
  error_code?: string | undefined;
2647
2647
  details?: SerializableJsonValue | undefined;
2648
2648
  retryable?: boolean | undefined;
2649
2649
  }, {
2650
- id: string;
2651
2650
  type: "error";
2652
- error: string;
2653
- timestamp: number;
2651
+ id: string;
2654
2652
  conversation_id: string;
2653
+ timestamp: number;
2655
2654
  turn_id: string;
2655
+ error: string;
2656
2656
  metadata?: Record<string, SerializableJsonValue> | undefined;
2657
2657
  version?: 1 | undefined;
2658
+ ephemeral?: boolean | undefined;
2658
2659
  run_id?: string | undefined;
2659
2660
  parent_run_id?: string | undefined;
2660
2661
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2661
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2662
- ephemeral?: boolean | undefined;
2662
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2663
2663
  error_code?: string | undefined;
2664
2664
  details?: SerializableJsonValue | undefined;
2665
2665
  retryable?: boolean | undefined;
@@ -2682,38 +2682,38 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2682
2682
  reason: z.ZodOptional<z.ZodString>;
2683
2683
  meta: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
2684
2684
  }, "strip", z.ZodTypeAny, {
2685
- id: string;
2686
2685
  type: "control";
2686
+ id: string;
2687
+ conversation_id: string;
2687
2688
  timestamp: number;
2688
2689
  version: 1;
2689
- conversation_id: string;
2690
2690
  turn_id: string;
2691
2691
  op: "truncate_after" | "replace" | "redo" | "branch";
2692
2692
  metadata?: Record<string, SerializableJsonValue> | undefined;
2693
- reason?: string | undefined;
2693
+ ephemeral?: boolean | undefined;
2694
2694
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2695
2695
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2696
2696
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2697
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2698
- ephemeral?: boolean | undefined;
2697
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2699
2698
  meta?: SerializableJsonValue | undefined;
2699
+ reason?: string | undefined;
2700
2700
  target_id?: string | undefined;
2701
2701
  }, {
2702
- id: string;
2703
2702
  type: "control";
2704
- timestamp: number;
2703
+ id: string;
2705
2704
  conversation_id: string;
2705
+ timestamp: number;
2706
2706
  turn_id: string;
2707
2707
  op: "truncate_after" | "replace" | "redo" | "branch";
2708
2708
  metadata?: Record<string, SerializableJsonValue> | undefined;
2709
2709
  version?: 1 | undefined;
2710
- reason?: string | undefined;
2710
+ ephemeral?: boolean | undefined;
2711
2711
  run_id?: string | undefined;
2712
2712
  parent_run_id?: string | undefined;
2713
2713
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2714
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2715
- ephemeral?: boolean | undefined;
2714
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2716
2715
  meta?: SerializableJsonValue | undefined;
2716
+ reason?: string | undefined;
2717
2717
  target_id?: string | undefined;
2718
2718
  }>, z.ZodObject<{
2719
2719
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -2825,11 +2825,11 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2825
2825
  served_model_id?: string | undefined;
2826
2826
  }>;
2827
2827
  }, "strip", z.ZodTypeAny, {
2828
- id: string;
2829
2828
  type: "context_usage_snapshot";
2829
+ id: string;
2830
+ conversation_id: string;
2830
2831
  timestamp: number;
2831
2832
  version: 1;
2832
- conversation_id: string;
2833
2833
  turn_id: string;
2834
2834
  ephemeral: true;
2835
2835
  context_usage: {
@@ -2854,13 +2854,13 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2854
2854
  run_id?: (string & z.BRAND<"RunId">) | undefined;
2855
2855
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
2856
2856
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2857
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2857
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2858
2858
  user_message_id?: string | undefined;
2859
2859
  }, {
2860
- id: string;
2861
2860
  type: "context_usage_snapshot";
2862
- timestamp: number;
2861
+ id: string;
2863
2862
  conversation_id: string;
2863
+ timestamp: number;
2864
2864
  turn_id: string;
2865
2865
  ephemeral: true;
2866
2866
  context_usage: {
@@ -2886,7 +2886,7 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2886
2886
  run_id?: string | undefined;
2887
2887
  parent_run_id?: string | undefined;
2888
2888
  lane?: "foreground" | "auxiliary" | "child" | undefined;
2889
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
2889
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
2890
2890
  user_message_id?: string | undefined;
2891
2891
  }>, z.ZodObject<{
2892
2892
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -3001,21 +3001,21 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3001
3001
  served_model_id?: string | undefined;
3002
3002
  }>>;
3003
3003
  }, "strip", z.ZodTypeAny, {
3004
- id: string;
3005
3004
  type: "run_execution_metrics";
3005
+ id: string;
3006
+ conversation_id: string;
3006
3007
  timestamp: number;
3007
3008
  version: 1;
3008
- outcome: "completed" | "failed" | "cancelled" | "awaiting_user";
3009
- conversation_id: string;
3010
3009
  turn_id: string;
3011
3010
  duration_ms: number;
3011
+ outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
3012
3012
  execution_id: string;
3013
3013
  metadata?: Record<string, SerializableJsonValue> | undefined;
3014
+ ephemeral?: boolean | undefined;
3014
3015
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3015
3016
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3016
3017
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3017
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3018
- ephemeral?: boolean | undefined;
3018
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3019
3019
  user_message_id?: string | undefined;
3020
3020
  context_usage?: {
3021
3021
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -3036,21 +3036,21 @@ declare const RuntimeEventShape: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3036
3036
  served_model_id?: string | undefined;
3037
3037
  } | undefined;
3038
3038
  }, {
3039
- id: string;
3040
3039
  type: "run_execution_metrics";
3041
- timestamp: number;
3042
- outcome: "completed" | "failed" | "cancelled" | "awaiting_user";
3040
+ id: string;
3043
3041
  conversation_id: string;
3042
+ timestamp: number;
3044
3043
  turn_id: string;
3045
3044
  duration_ms: number;
3045
+ outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
3046
3046
  execution_id: string;
3047
3047
  metadata?: Record<string, SerializableJsonValue> | undefined;
3048
3048
  version?: 1 | undefined;
3049
+ ephemeral?: boolean | undefined;
3049
3050
  run_id?: string | undefined;
3050
3051
  parent_run_id?: string | undefined;
3051
3052
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3052
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3053
- ephemeral?: boolean | undefined;
3053
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3054
3054
  user_message_id?: string | undefined;
3055
3055
  context_usage?: {
3056
3056
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -3123,15 +3123,21 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3123
3123
  label?: string | undefined;
3124
3124
  }>, "many">>;
3125
3125
  }, "strip", z.ZodTypeAny, {
3126
- id: string;
3127
3126
  type: "user_input";
3128
- content: string;
3127
+ id: string;
3128
+ conversation_id: string;
3129
3129
  timestamp: number;
3130
3130
  version: 1;
3131
- conversation_id: string;
3132
3131
  turn_id: string;
3133
- source: "system" | "user" | "editor";
3132
+ content: string;
3133
+ source: "user" | "editor" | "system";
3134
3134
  metadata?: Record<string, SerializableJsonValue> | undefined;
3135
+ ephemeral?: boolean | undefined;
3136
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
3137
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3138
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3139
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3140
+ raw_content?: string | undefined;
3135
3141
  attachments?: {
3136
3142
  id: string;
3137
3143
  kind: "image";
@@ -3144,20 +3150,22 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3144
3150
  fileName?: string | undefined;
3145
3151
  label?: string | undefined;
3146
3152
  }[] | undefined;
3147
- run_id?: (string & z.BRAND<"RunId">) | undefined;
3148
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3149
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3150
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3151
- ephemeral?: boolean | undefined;
3152
- raw_content?: string | undefined;
3153
3153
  }, {
3154
- id: string;
3155
3154
  type: "user_input";
3156
- content: string;
3157
- timestamp: number;
3155
+ id: string;
3158
3156
  conversation_id: string;
3157
+ timestamp: number;
3159
3158
  turn_id: string;
3159
+ content: string;
3160
3160
  metadata?: Record<string, SerializableJsonValue> | undefined;
3161
+ version?: 1 | undefined;
3162
+ ephemeral?: boolean | undefined;
3163
+ run_id?: string | undefined;
3164
+ parent_run_id?: string | undefined;
3165
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3166
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3167
+ raw_content?: string | undefined;
3168
+ source?: "user" | "editor" | "system" | undefined;
3161
3169
  attachments?: {
3162
3170
  id: string;
3163
3171
  kind: "image";
@@ -3170,14 +3178,6 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3170
3178
  fileName?: string | undefined;
3171
3179
  label?: string | undefined;
3172
3180
  }[] | undefined;
3173
- version?: 1 | undefined;
3174
- run_id?: string | undefined;
3175
- parent_run_id?: string | undefined;
3176
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3177
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3178
- ephemeral?: boolean | undefined;
3179
- raw_content?: string | undefined;
3180
- source?: "system" | "user" | "editor" | undefined;
3181
3181
  }>, z.ZodObject<{
3182
3182
  id: z.ZodEffects<z.ZodString, string, string>;
3183
3183
  conversation_id: z.ZodEffects<z.ZodString, string, string>;
@@ -3197,36 +3197,36 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3197
3197
  delta: z.ZodOptional<z.ZodString>;
3198
3198
  is_complete: z.ZodDefault<z.ZodBoolean>;
3199
3199
  }, "strip", z.ZodTypeAny, {
3200
- id: string;
3201
3200
  type: "thought";
3202
- content: string;
3201
+ id: string;
3202
+ conversation_id: string;
3203
3203
  timestamp: number;
3204
3204
  version: 1;
3205
- conversation_id: string;
3206
3205
  turn_id: string;
3206
+ content: string;
3207
3207
  is_complete: boolean;
3208
3208
  metadata?: Record<string, SerializableJsonValue> | undefined;
3209
+ ephemeral?: boolean | undefined;
3209
3210
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3210
3211
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3211
3212
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3212
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3213
- ephemeral?: boolean | undefined;
3213
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3214
3214
  thought_message_id?: string | undefined;
3215
3215
  delta?: string | undefined;
3216
3216
  }, {
3217
- id: string;
3218
3217
  type: "thought";
3219
- content: string;
3220
- timestamp: number;
3218
+ id: string;
3221
3219
  conversation_id: string;
3220
+ timestamp: number;
3222
3221
  turn_id: string;
3222
+ content: string;
3223
3223
  metadata?: Record<string, SerializableJsonValue> | undefined;
3224
3224
  version?: 1 | undefined;
3225
+ ephemeral?: boolean | undefined;
3225
3226
  run_id?: string | undefined;
3226
3227
  parent_run_id?: string | undefined;
3227
3228
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3228
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3229
- ephemeral?: boolean | undefined;
3229
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3230
3230
  thought_message_id?: string | undefined;
3231
3231
  delta?: string | undefined;
3232
3232
  is_complete?: boolean | undefined;
@@ -3542,6 +3542,7 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3542
3542
  }[] | undefined;
3543
3543
  }>]>, "many">>;
3544
3544
  }, "strict", z.ZodTypeAny, {
3545
+ args?: Record<string, SerializableJsonValue> | undefined;
3545
3546
  tool_calls?: SerializableJsonValue[] | undefined;
3546
3547
  provider_continuations?: {
3547
3548
  kind: string;
@@ -3601,8 +3602,8 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3601
3602
  payload: SerializableJsonValue;
3602
3603
  }[] | undefined;
3603
3604
  })[] | undefined;
3604
- args?: Record<string, SerializableJsonValue> | undefined;
3605
3605
  }, {
3606
+ args?: Record<string, SerializableJsonValue> | undefined;
3606
3607
  tool_calls?: SerializableJsonValue[] | undefined;
3607
3608
  provider_continuations?: {
3608
3609
  kind: string;
@@ -3662,22 +3663,29 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3662
3663
  payload: SerializableJsonValue;
3663
3664
  }[] | undefined;
3664
3665
  })[] | undefined;
3665
- args?: Record<string, SerializableJsonValue> | undefined;
3666
3666
  }>>;
3667
3667
  parent_tool_call_id: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "ToolCallId">>;
3668
3668
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
3669
3669
  }, "strip", z.ZodTypeAny, {
3670
- id: string;
3671
- status: "error" | "loading" | "success";
3672
3670
  type: "tool_call_decision";
3673
- tool_call_id: string & z.BRAND<"ToolCallId">;
3674
- tool_name: string;
3671
+ id: string;
3672
+ conversation_id: string;
3675
3673
  timestamp: number;
3674
+ status: "error" | "loading" | "success";
3676
3675
  version: 1;
3677
- conversation_id: string;
3678
3676
  turn_id: string;
3679
- phase: "error" | "start" | "update" | "complete";
3677
+ tool_name: string;
3678
+ tool_call_id: string & z.BRAND<"ToolCallId">;
3679
+ phase: "start" | "update" | "complete" | "error";
3680
+ metadata?: Record<string, SerializableJsonValue> | undefined;
3681
+ ephemeral?: boolean | undefined;
3682
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
3683
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3684
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3685
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3686
+ args?: Record<string, SerializableJsonValue> | undefined;
3680
3687
  payload?: {
3688
+ args?: Record<string, SerializableJsonValue> | undefined;
3681
3689
  tool_calls?: SerializableJsonValue[] | undefined;
3682
3690
  provider_continuations?: {
3683
3691
  kind: string;
@@ -3737,28 +3745,29 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3737
3745
  payload: SerializableJsonValue;
3738
3746
  }[] | undefined;
3739
3747
  })[] | undefined;
3740
- args?: Record<string, SerializableJsonValue> | undefined;
3741
3748
  } | undefined;
3742
- args?: Record<string, SerializableJsonValue> | undefined;
3743
- metadata?: Record<string, SerializableJsonValue> | undefined;
3744
- run_id?: (string & z.BRAND<"RunId">) | undefined;
3745
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3746
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3747
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3748
- ephemeral?: boolean | undefined;
3749
3749
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
3750
3750
  meta?: Record<string, SerializableJsonValue> | undefined;
3751
3751
  }, {
3752
- id: string;
3753
- status: "error" | "loading" | "success";
3754
3752
  type: "tool_call_decision";
3755
- tool_call_id: string;
3756
- tool_name: string;
3757
- timestamp: number;
3753
+ id: string;
3758
3754
  conversation_id: string;
3755
+ timestamp: number;
3756
+ status: "error" | "loading" | "success";
3759
3757
  turn_id: string;
3760
- phase: "error" | "start" | "update" | "complete";
3758
+ tool_name: string;
3759
+ tool_call_id: string;
3760
+ phase: "start" | "update" | "complete" | "error";
3761
+ metadata?: Record<string, SerializableJsonValue> | undefined;
3762
+ version?: 1 | undefined;
3763
+ ephemeral?: boolean | undefined;
3764
+ run_id?: string | undefined;
3765
+ parent_run_id?: string | undefined;
3766
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3767
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3768
+ args?: Record<string, SerializableJsonValue> | undefined;
3761
3769
  payload?: {
3770
+ args?: Record<string, SerializableJsonValue> | undefined;
3762
3771
  tool_calls?: SerializableJsonValue[] | undefined;
3763
3772
  provider_continuations?: {
3764
3773
  kind: string;
@@ -3818,16 +3827,7 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3818
3827
  payload: SerializableJsonValue;
3819
3828
  }[] | undefined;
3820
3829
  })[] | undefined;
3821
- args?: Record<string, SerializableJsonValue> | undefined;
3822
3830
  } | undefined;
3823
- args?: Record<string, SerializableJsonValue> | undefined;
3824
- metadata?: Record<string, SerializableJsonValue> | undefined;
3825
- version?: 1 | undefined;
3826
- run_id?: string | undefined;
3827
- parent_run_id?: string | undefined;
3828
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3829
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3830
- ephemeral?: boolean | undefined;
3831
3831
  parent_tool_call_id?: string | undefined;
3832
3832
  meta?: Record<string, SerializableJsonValue> | undefined;
3833
3833
  }>, z.ZodObject<{
@@ -3853,45 +3853,45 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3853
3853
  parent_tool_call_id: z.ZodOptional<z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "ToolCallId">>;
3854
3854
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
3855
3855
  }, "strip", z.ZodTypeAny, {
3856
- id: string;
3857
- status: "error" | "loading" | "success";
3858
3856
  type: "tool_process";
3859
- tool_call_id: string & z.BRAND<"ToolCallId">;
3860
- tool_name: string;
3857
+ id: string;
3858
+ conversation_id: string;
3861
3859
  timestamp: number;
3860
+ status: "error" | "loading" | "success";
3862
3861
  version: 1;
3863
- conversation_id: string;
3864
3862
  turn_id: string;
3865
- phase: "error" | "start" | "update" | "complete";
3866
- payload?: Record<string, SerializableJsonValue> | undefined;
3867
- args?: Record<string, SerializableJsonValue> | undefined;
3863
+ tool_name: string;
3864
+ tool_call_id: string & z.BRAND<"ToolCallId">;
3865
+ phase: "start" | "update" | "complete" | "error";
3868
3866
  metadata?: Record<string, SerializableJsonValue> | undefined;
3867
+ ephemeral?: boolean | undefined;
3869
3868
  run_id?: (string & z.BRAND<"RunId">) | undefined;
3870
3869
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3871
3870
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3872
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3873
- ephemeral?: boolean | undefined;
3871
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3872
+ args?: Record<string, SerializableJsonValue> | undefined;
3873
+ payload?: Record<string, SerializableJsonValue> | undefined;
3874
3874
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
3875
3875
  meta?: Record<string, SerializableJsonValue> | undefined;
3876
3876
  }, {
3877
- id: string;
3878
- status: "error" | "loading" | "success";
3879
3877
  type: "tool_process";
3880
- tool_call_id: string;
3881
- tool_name: string;
3882
- timestamp: number;
3878
+ id: string;
3883
3879
  conversation_id: string;
3880
+ timestamp: number;
3881
+ status: "error" | "loading" | "success";
3884
3882
  turn_id: string;
3885
- phase: "error" | "start" | "update" | "complete";
3886
- payload?: Record<string, SerializableJsonValue> | undefined;
3887
- args?: Record<string, SerializableJsonValue> | undefined;
3883
+ tool_name: string;
3884
+ tool_call_id: string;
3885
+ phase: "start" | "update" | "complete" | "error";
3888
3886
  metadata?: Record<string, SerializableJsonValue> | undefined;
3889
3887
  version?: 1 | undefined;
3888
+ ephemeral?: boolean | undefined;
3890
3889
  run_id?: string | undefined;
3891
3890
  parent_run_id?: string | undefined;
3892
3891
  lane?: "foreground" | "auxiliary" | "child" | undefined;
3893
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3894
- ephemeral?: boolean | undefined;
3892
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3893
+ args?: Record<string, SerializableJsonValue> | undefined;
3894
+ payload?: Record<string, SerializableJsonValue> | undefined;
3895
3895
  parent_tool_call_id?: string | undefined;
3896
3896
  meta?: Record<string, SerializableJsonValue> | undefined;
3897
3897
  }>, z.ZodObject<{
@@ -3951,19 +3951,22 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3951
3951
  label?: string | undefined;
3952
3952
  }>, "many">>;
3953
3953
  }, "strip", z.ZodTypeAny, {
3954
- id: string;
3955
- status: "error" | "success";
3956
3954
  type: "tool_output";
3957
- tool_call_id: string & z.BRAND<"ToolCallId">;
3958
- tool_name: string;
3955
+ id: string;
3956
+ conversation_id: string;
3959
3957
  timestamp: number;
3958
+ status: "error" | "success";
3960
3959
  version: 1;
3961
- conversation_id: string;
3962
3960
  turn_id: string;
3961
+ tool_name: string;
3962
+ tool_call_id: string & z.BRAND<"ToolCallId">;
3963
3963
  observation: string;
3964
- data?: SerializableJsonValue | undefined;
3965
- error?: string | undefined;
3966
3964
  metadata?: Record<string, SerializableJsonValue> | undefined;
3965
+ ephemeral?: boolean | undefined;
3966
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
3967
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3968
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
3969
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3967
3970
  attachments?: {
3968
3971
  id: string;
3969
3972
  kind: "image";
@@ -3976,26 +3979,27 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
3976
3979
  fileName?: string | undefined;
3977
3980
  label?: string | undefined;
3978
3981
  }[] | undefined;
3979
- run_id?: (string & z.BRAND<"RunId">) | undefined;
3980
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
3981
- lane?: "foreground" | "auxiliary" | "child" | undefined;
3982
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
3983
- ephemeral?: boolean | undefined;
3982
+ error?: string | undefined;
3983
+ data?: SerializableJsonValue | undefined;
3984
3984
  error_code?: string | undefined;
3985
3985
  duration_ms?: number | undefined;
3986
3986
  }, {
3987
- id: string;
3988
- status: "error" | "success";
3989
3987
  type: "tool_output";
3990
- tool_call_id: string;
3991
- tool_name: string;
3992
- timestamp: number;
3988
+ id: string;
3993
3989
  conversation_id: string;
3990
+ timestamp: number;
3991
+ status: "error" | "success";
3994
3992
  turn_id: string;
3993
+ tool_name: string;
3994
+ tool_call_id: string;
3995
3995
  observation: string;
3996
- data?: SerializableJsonValue | undefined;
3997
- error?: string | undefined;
3998
3996
  metadata?: Record<string, SerializableJsonValue> | undefined;
3997
+ version?: 1 | undefined;
3998
+ ephemeral?: boolean | undefined;
3999
+ run_id?: string | undefined;
4000
+ parent_run_id?: string | undefined;
4001
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
4002
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
3999
4003
  attachments?: {
4000
4004
  id: string;
4001
4005
  kind: "image";
@@ -4008,12 +4012,8 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4008
4012
  fileName?: string | undefined;
4009
4013
  label?: string | undefined;
4010
4014
  }[] | undefined;
4011
- version?: 1 | undefined;
4012
- run_id?: string | undefined;
4013
- parent_run_id?: string | undefined;
4014
- lane?: "foreground" | "auxiliary" | "child" | undefined;
4015
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4016
- ephemeral?: boolean | undefined;
4015
+ error?: string | undefined;
4016
+ data?: SerializableJsonValue | undefined;
4017
4017
  error_code?: string | undefined;
4018
4018
  duration_ms?: number | undefined;
4019
4019
  }>, z.ZodObject<{
@@ -4049,12 +4049,12 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4049
4049
  tool_name: z.ZodString;
4050
4050
  args: z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
4051
4051
  }, "strict", z.ZodTypeAny, {
4052
- tool_call_id: string & z.BRAND<"ToolCallId">;
4053
4052
  tool_name: string;
4053
+ tool_call_id: string & z.BRAND<"ToolCallId">;
4054
4054
  args: Record<string, SerializableJsonValue>;
4055
4055
  }, {
4056
- tool_call_id: string;
4057
4056
  tool_name: string;
4057
+ tool_call_id: string;
4058
4058
  args: Record<string, SerializableJsonValue>;
4059
4059
  }>, "many">>;
4060
4060
  output: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
@@ -4101,29 +4101,24 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4101
4101
  type: z.ZodLiteral<"subrun_trace">;
4102
4102
  ephemeral: z.ZodLiteral<true>;
4103
4103
  }, "strip", z.ZodTypeAny, {
4104
- id: string;
4105
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
4106
4104
  type: "subrun_trace";
4105
+ id: string;
4106
+ conversation_id: string;
4107
4107
  timestamp: number;
4108
4108
  version: 1;
4109
- conversation_id: string;
4110
4109
  turn_id: string;
4111
4110
  ephemeral: true;
4111
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
4112
4112
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
4113
4113
  subrun_id: string;
4114
4114
  source_event_id: string;
4115
4115
  status?: "error" | "loading" | "success" | undefined;
4116
- tool_calls?: {
4117
- tool_call_id: string & z.BRAND<"ToolCallId">;
4118
- tool_name: string;
4119
- args: Record<string, SerializableJsonValue>;
4120
- }[] | undefined;
4121
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
4122
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
4123
- tool_name?: string | undefined;
4124
- args?: Record<string, SerializableJsonValue> | undefined;
4125
- content?: string | undefined;
4126
4116
  metadata?: Record<string, SerializableJsonValue> | undefined;
4117
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
4118
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
4119
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
4120
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4121
+ content?: string | undefined;
4127
4122
  attachments?: {
4128
4123
  id: string;
4129
4124
  kind: "image";
@@ -4136,46 +4131,47 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4136
4131
  fileName?: string | undefined;
4137
4132
  label?: string | undefined;
4138
4133
  }[] | undefined;
4139
- run_id?: (string & z.BRAND<"RunId">) | undefined;
4140
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
4141
- lane?: "foreground" | "auxiliary" | "child" | undefined;
4142
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4143
4134
  delta?: string | undefined;
4144
- phase?: "error" | "start" | "update" | "complete" | undefined;
4135
+ tool_name?: string | undefined;
4136
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
4137
+ phase?: "start" | "update" | "complete" | "error" | undefined;
4138
+ args?: Record<string, SerializableJsonValue> | undefined;
4139
+ tool_calls?: {
4140
+ tool_name: string;
4141
+ tool_call_id: string & z.BRAND<"ToolCallId">;
4142
+ args: Record<string, SerializableJsonValue>;
4143
+ }[] | undefined;
4145
4144
  meta?: Record<string, SerializableJsonValue> | undefined;
4146
4145
  duration_ms?: number | undefined;
4147
4146
  subrun_parent_id?: string | undefined;
4148
4147
  answer_id?: string | undefined;
4149
4148
  seq?: number | undefined;
4150
4149
  is_last?: boolean | undefined;
4150
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
4151
4151
  output?: SerializableJsonValue | undefined;
4152
4152
  original_message_count?: number | undefined;
4153
4153
  compression_ratio?: number | undefined;
4154
4154
  included_old_summary?: boolean | undefined;
4155
4155
  replaced_message_ids?: string[] | undefined;
4156
4156
  }, {
4157
- id: string;
4158
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
4159
4157
  type: "subrun_trace";
4160
- timestamp: number;
4158
+ id: string;
4161
4159
  conversation_id: string;
4160
+ timestamp: number;
4162
4161
  turn_id: string;
4163
4162
  ephemeral: true;
4163
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
4164
4164
  parent_tool_call_id: string;
4165
4165
  subrun_id: string;
4166
4166
  source_event_id: string;
4167
4167
  status?: "error" | "loading" | "success" | undefined;
4168
- tool_calls?: {
4169
- tool_call_id: string;
4170
- tool_name: string;
4171
- args: Record<string, SerializableJsonValue>;
4172
- }[] | undefined;
4173
- tool_call_id?: string | undefined;
4174
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
4175
- tool_name?: string | undefined;
4176
- args?: Record<string, SerializableJsonValue> | undefined;
4177
- content?: string | undefined;
4178
4168
  metadata?: Record<string, SerializableJsonValue> | undefined;
4169
+ version?: 1 | undefined;
4170
+ run_id?: string | undefined;
4171
+ parent_run_id?: string | undefined;
4172
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
4173
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4174
+ content?: string | undefined;
4179
4175
  attachments?: {
4180
4176
  id: string;
4181
4177
  kind: "image";
@@ -4188,19 +4184,23 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4188
4184
  fileName?: string | undefined;
4189
4185
  label?: string | undefined;
4190
4186
  }[] | undefined;
4191
- version?: 1 | undefined;
4192
- run_id?: string | undefined;
4193
- parent_run_id?: string | undefined;
4194
- lane?: "foreground" | "auxiliary" | "child" | undefined;
4195
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4196
4187
  delta?: string | undefined;
4197
- phase?: "error" | "start" | "update" | "complete" | undefined;
4188
+ tool_name?: string | undefined;
4189
+ tool_call_id?: string | undefined;
4190
+ phase?: "start" | "update" | "complete" | "error" | undefined;
4191
+ args?: Record<string, SerializableJsonValue> | undefined;
4192
+ tool_calls?: {
4193
+ tool_name: string;
4194
+ tool_call_id: string;
4195
+ args: Record<string, SerializableJsonValue>;
4196
+ }[] | undefined;
4198
4197
  meta?: Record<string, SerializableJsonValue> | undefined;
4199
4198
  duration_ms?: number | undefined;
4200
4199
  subrun_parent_id?: string | undefined;
4201
4200
  answer_id?: string | undefined;
4202
4201
  seq?: number | undefined;
4203
4202
  is_last?: boolean | undefined;
4203
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
4204
4204
  output?: SerializableJsonValue | undefined;
4205
4205
  original_message_count?: number | undefined;
4206
4206
  compression_ratio?: number | undefined;
@@ -4229,44 +4229,44 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4229
4229
  resume_token: z.ZodEffects<z.ZodString, string, string>;
4230
4230
  interaction_status: z.ZodLiteral<"pending">;
4231
4231
  }, "strip", z.ZodTypeAny, {
4232
- id: string;
4233
4232
  type: "requires_user_interaction";
4234
- tool_call_id: string & z.BRAND<"ToolCallId">;
4233
+ id: string;
4234
+ conversation_id: string;
4235
4235
  timestamp: number;
4236
4236
  version: 1;
4237
- run_id: string & z.BRAND<"RunId">;
4238
- conversation_id: string;
4239
4237
  turn_id: string;
4238
+ run_id: string & z.BRAND<"RunId">;
4239
+ tool_call_id: string & z.BRAND<"ToolCallId">;
4240
4240
  interaction_id: string;
4241
4241
  checkpoint_revision: number;
4242
4242
  resume_token: string;
4243
4243
  interaction_status: "pending";
4244
4244
  metadata?: Record<string, SerializableJsonValue> | undefined;
4245
+ ephemeral?: boolean | undefined;
4245
4246
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
4246
4247
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4247
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4248
- ephemeral?: boolean | undefined;
4248
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4249
4249
  form?: SerializableJsonValue | undefined;
4250
4250
  interaction_type?: string | undefined;
4251
4251
  prompt?: string | undefined;
4252
4252
  }, {
4253
- id: string;
4254
4253
  type: "requires_user_interaction";
4255
- tool_call_id: string;
4256
- timestamp: number;
4257
- run_id: string;
4254
+ id: string;
4258
4255
  conversation_id: string;
4256
+ timestamp: number;
4259
4257
  turn_id: string;
4258
+ run_id: string;
4259
+ tool_call_id: string;
4260
4260
  interaction_id: string;
4261
4261
  checkpoint_revision: number;
4262
4262
  resume_token: string;
4263
4263
  interaction_status: "pending";
4264
4264
  metadata?: Record<string, SerializableJsonValue> | undefined;
4265
4265
  version?: 1 | undefined;
4266
+ ephemeral?: boolean | undefined;
4266
4267
  parent_run_id?: string | undefined;
4267
4268
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4268
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4269
- ephemeral?: boolean | undefined;
4269
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4270
4270
  form?: SerializableJsonValue | undefined;
4271
4271
  interaction_type?: string | undefined;
4272
4272
  prompt?: string | undefined;
@@ -4294,11 +4294,11 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4294
4294
  id: z.ZodOptional<z.ZodString>;
4295
4295
  name: z.ZodOptional<z.ZodString>;
4296
4296
  }, "strip", z.ZodTypeAny, {
4297
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
4297
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
4298
4298
  id?: string | undefined;
4299
4299
  name?: string | undefined;
4300
4300
  }, {
4301
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
4301
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
4302
4302
  id?: string | undefined;
4303
4303
  name?: string | undefined;
4304
4304
  }>;
@@ -4309,12 +4309,12 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4309
4309
  policy: z.ZodOptional<z.ZodString>;
4310
4310
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4311
4311
  }, "strip", z.ZodTypeAny, {
4312
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
4312
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
4313
4313
  metadata?: Record<string, unknown> | undefined;
4314
4314
  reason?: string | undefined;
4315
4315
  policy?: string | undefined;
4316
4316
  }, {
4317
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
4317
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
4318
4318
  metadata?: Record<string, unknown> | undefined;
4319
4319
  reason?: string | undefined;
4320
4320
  policy?: string | undefined;
@@ -4326,14 +4326,14 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4326
4326
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4327
4327
  }, "strip", z.ZodTypeAny, {
4328
4328
  kind: string;
4329
- summary?: string | undefined;
4330
4329
  metadata?: Record<string, unknown> | undefined;
4331
4330
  ref?: string | undefined;
4331
+ summary?: string | undefined;
4332
4332
  }, {
4333
4333
  kind: string;
4334
- summary?: string | undefined;
4335
4334
  metadata?: Record<string, unknown> | undefined;
4336
4335
  ref?: string | undefined;
4336
+ summary?: string | undefined;
4337
4337
  }>, "many">>;
4338
4338
  costDelta: z.ZodOptional<z.ZodObject<{
4339
4339
  tokensInput: z.ZodOptional<z.ZodNumber>;
@@ -4365,51 +4365,51 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4365
4365
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4366
4366
  }, "strip", z.ZodTypeAny, {
4367
4367
  metadata?: Record<string, unknown> | undefined;
4368
- toolName?: string | undefined;
4369
- conversationId?: string | undefined;
4370
4368
  runId?: (string & z.BRAND<"RunId">) | undefined;
4371
4369
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
4370
+ conversationId?: string | undefined;
4372
4371
  turnId?: string | undefined;
4373
4372
  traceId?: string | undefined;
4374
4373
  agentSpecId?: string | undefined;
4375
4374
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
4375
+ toolName?: string | undefined;
4376
4376
  modelId?: string | undefined;
4377
4377
  nodeId?: string | undefined;
4378
4378
  }, {
4379
4379
  metadata?: Record<string, unknown> | undefined;
4380
- toolName?: string | undefined;
4381
- conversationId?: string | undefined;
4382
4380
  runId?: string | undefined;
4383
4381
  parentRunId?: string | undefined;
4382
+ conversationId?: string | undefined;
4384
4383
  turnId?: string | undefined;
4385
4384
  traceId?: string | undefined;
4386
4385
  agentSpecId?: string | undefined;
4387
4386
  toolCallId?: string | undefined;
4387
+ toolName?: string | undefined;
4388
4388
  modelId?: string | undefined;
4389
4389
  nodeId?: string | undefined;
4390
4390
  }>>;
4391
4391
  }, "strip", z.ZodTypeAny, {
4392
- runId: string & z.BRAND<"RunId">;
4393
4392
  envelopeId: string;
4393
+ runId: string & z.BRAND<"RunId">;
4394
4394
  ts: number;
4395
4395
  actor: {
4396
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
4396
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
4397
4397
  id?: string | undefined;
4398
4398
  name?: string | undefined;
4399
4399
  };
4400
4400
  action: string;
4401
4401
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
4402
4402
  decision?: {
4403
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
4403
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
4404
4404
  metadata?: Record<string, unknown> | undefined;
4405
4405
  reason?: string | undefined;
4406
4406
  policy?: string | undefined;
4407
4407
  } | undefined;
4408
4408
  evidence?: {
4409
4409
  kind: string;
4410
- summary?: string | undefined;
4411
4410
  metadata?: Record<string, unknown> | undefined;
4412
4411
  ref?: string | undefined;
4412
+ summary?: string | undefined;
4413
4413
  }[] | undefined;
4414
4414
  costDelta?: {
4415
4415
  tokensInput?: number | undefined;
@@ -4419,39 +4419,39 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4419
4419
  } | undefined;
4420
4420
  scope?: {
4421
4421
  metadata?: Record<string, unknown> | undefined;
4422
- toolName?: string | undefined;
4423
- conversationId?: string | undefined;
4424
4422
  runId?: (string & z.BRAND<"RunId">) | undefined;
4425
4423
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
4424
+ conversationId?: string | undefined;
4426
4425
  turnId?: string | undefined;
4427
4426
  traceId?: string | undefined;
4428
4427
  agentSpecId?: string | undefined;
4429
4428
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
4429
+ toolName?: string | undefined;
4430
4430
  modelId?: string | undefined;
4431
4431
  nodeId?: string | undefined;
4432
4432
  } | undefined;
4433
4433
  }, {
4434
- runId: string;
4435
4434
  envelopeId: string;
4435
+ runId: string;
4436
4436
  ts: number;
4437
4437
  actor: {
4438
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
4438
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
4439
4439
  id?: string | undefined;
4440
4440
  name?: string | undefined;
4441
4441
  };
4442
4442
  action: string;
4443
4443
  parentRunId?: string | undefined;
4444
4444
  decision?: {
4445
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
4445
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
4446
4446
  metadata?: Record<string, unknown> | undefined;
4447
4447
  reason?: string | undefined;
4448
4448
  policy?: string | undefined;
4449
4449
  } | undefined;
4450
4450
  evidence?: {
4451
4451
  kind: string;
4452
- summary?: string | undefined;
4453
4452
  metadata?: Record<string, unknown> | undefined;
4454
4453
  ref?: string | undefined;
4454
+ summary?: string | undefined;
4455
4455
  }[] | undefined;
4456
4456
  costDelta?: {
4457
4457
  tokensInput?: number | undefined;
@@ -4461,47 +4461,47 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4461
4461
  } | undefined;
4462
4462
  scope?: {
4463
4463
  metadata?: Record<string, unknown> | undefined;
4464
- toolName?: string | undefined;
4465
- conversationId?: string | undefined;
4466
4464
  runId?: string | undefined;
4467
4465
  parentRunId?: string | undefined;
4466
+ conversationId?: string | undefined;
4468
4467
  turnId?: string | undefined;
4469
4468
  traceId?: string | undefined;
4470
4469
  agentSpecId?: string | undefined;
4471
4470
  toolCallId?: string | undefined;
4471
+ toolName?: string | undefined;
4472
4472
  modelId?: string | undefined;
4473
4473
  nodeId?: string | undefined;
4474
4474
  } | undefined;
4475
4475
  }>;
4476
4476
  }, "strip", z.ZodTypeAny, {
4477
- id: string;
4478
4477
  type: "audit_envelope";
4478
+ id: string;
4479
+ conversation_id: string;
4479
4480
  timestamp: number;
4480
4481
  version: 1;
4481
- conversation_id: string;
4482
4482
  turn_id: string;
4483
4483
  envelope: {
4484
- runId: string & z.BRAND<"RunId">;
4485
4484
  envelopeId: string;
4485
+ runId: string & z.BRAND<"RunId">;
4486
4486
  ts: number;
4487
4487
  actor: {
4488
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
4488
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
4489
4489
  id?: string | undefined;
4490
4490
  name?: string | undefined;
4491
4491
  };
4492
4492
  action: string;
4493
4493
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
4494
4494
  decision?: {
4495
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
4495
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
4496
4496
  metadata?: Record<string, unknown> | undefined;
4497
4497
  reason?: string | undefined;
4498
4498
  policy?: string | undefined;
4499
4499
  } | undefined;
4500
4500
  evidence?: {
4501
4501
  kind: string;
4502
- summary?: string | undefined;
4503
4502
  metadata?: Record<string, unknown> | undefined;
4504
4503
  ref?: string | undefined;
4504
+ summary?: string | undefined;
4505
4505
  }[] | undefined;
4506
4506
  costDelta?: {
4507
4507
  tokensInput?: number | undefined;
@@ -4511,52 +4511,52 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4511
4511
  } | undefined;
4512
4512
  scope?: {
4513
4513
  metadata?: Record<string, unknown> | undefined;
4514
- toolName?: string | undefined;
4515
- conversationId?: string | undefined;
4516
4514
  runId?: (string & z.BRAND<"RunId">) | undefined;
4517
4515
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
4516
+ conversationId?: string | undefined;
4518
4517
  turnId?: string | undefined;
4519
4518
  traceId?: string | undefined;
4520
4519
  agentSpecId?: string | undefined;
4521
4520
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
4521
+ toolName?: string | undefined;
4522
4522
  modelId?: string | undefined;
4523
4523
  nodeId?: string | undefined;
4524
4524
  } | undefined;
4525
4525
  };
4526
4526
  metadata?: Record<string, SerializableJsonValue> | undefined;
4527
+ ephemeral?: boolean | undefined;
4527
4528
  run_id?: (string & z.BRAND<"RunId">) | undefined;
4528
4529
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
4529
4530
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4530
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4531
- ephemeral?: boolean | undefined;
4531
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4532
4532
  }, {
4533
- id: string;
4534
4533
  type: "audit_envelope";
4535
- timestamp: number;
4534
+ id: string;
4536
4535
  conversation_id: string;
4536
+ timestamp: number;
4537
4537
  turn_id: string;
4538
4538
  envelope: {
4539
- runId: string;
4540
4539
  envelopeId: string;
4540
+ runId: string;
4541
4541
  ts: number;
4542
4542
  actor: {
4543
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
4543
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
4544
4544
  id?: string | undefined;
4545
4545
  name?: string | undefined;
4546
4546
  };
4547
4547
  action: string;
4548
4548
  parentRunId?: string | undefined;
4549
4549
  decision?: {
4550
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
4550
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
4551
4551
  metadata?: Record<string, unknown> | undefined;
4552
4552
  reason?: string | undefined;
4553
4553
  policy?: string | undefined;
4554
4554
  } | undefined;
4555
4555
  evidence?: {
4556
4556
  kind: string;
4557
- summary?: string | undefined;
4558
4557
  metadata?: Record<string, unknown> | undefined;
4559
4558
  ref?: string | undefined;
4559
+ summary?: string | undefined;
4560
4560
  }[] | undefined;
4561
4561
  costDelta?: {
4562
4562
  tokensInput?: number | undefined;
@@ -4566,25 +4566,25 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4566
4566
  } | undefined;
4567
4567
  scope?: {
4568
4568
  metadata?: Record<string, unknown> | undefined;
4569
- toolName?: string | undefined;
4570
- conversationId?: string | undefined;
4571
4569
  runId?: string | undefined;
4572
4570
  parentRunId?: string | undefined;
4571
+ conversationId?: string | undefined;
4573
4572
  turnId?: string | undefined;
4574
4573
  traceId?: string | undefined;
4575
4574
  agentSpecId?: string | undefined;
4576
4575
  toolCallId?: string | undefined;
4576
+ toolName?: string | undefined;
4577
4577
  modelId?: string | undefined;
4578
4578
  nodeId?: string | undefined;
4579
4579
  } | undefined;
4580
4580
  };
4581
4581
  metadata?: Record<string, SerializableJsonValue> | undefined;
4582
4582
  version?: 1 | undefined;
4583
+ ephemeral?: boolean | undefined;
4583
4584
  run_id?: string | undefined;
4584
4585
  parent_run_id?: string | undefined;
4585
4586
  lane?: "foreground" | "auxiliary" | "child" | undefined;
4586
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4587
- ephemeral?: boolean | undefined;
4587
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4588
4588
  }>, z.ZodObject<{
4589
4589
  id: z.ZodEffects<z.ZodString, string, string>;
4590
4590
  conversation_id: z.ZodEffects<z.ZodString, string, string>;
@@ -4890,16 +4890,22 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4890
4890
  }>]>, "many">>;
4891
4891
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>>;
4892
4892
  }, "strip", z.ZodTypeAny, {
4893
- id: string;
4894
4893
  type: "final_answer";
4895
- completion_reason: "tool_call" | "terminal" | "interrupted";
4896
- content: string;
4894
+ id: string;
4895
+ conversation_id: string;
4897
4896
  timestamp: number;
4898
4897
  version: 1;
4899
- conversation_id: string;
4900
4898
  turn_id: string;
4899
+ content: string;
4901
4900
  is_complete: boolean;
4902
4901
  answer_id: string;
4902
+ completion_reason: "tool_call" | "terminal" | "interrupted";
4903
+ metadata?: Record<string, SerializableJsonValue> | undefined;
4904
+ ephemeral?: boolean | undefined;
4905
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
4906
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
4907
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
4908
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4903
4909
  provider_continuations?: {
4904
4910
  kind: string;
4905
4911
  schema_version: 2;
@@ -4958,22 +4964,24 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
4958
4964
  payload: SerializableJsonValue;
4959
4965
  }[] | undefined;
4960
4966
  })[] | undefined;
4961
- metadata?: Record<string, SerializableJsonValue> | undefined;
4962
- run_id?: (string & z.BRAND<"RunId">) | undefined;
4963
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
4964
- lane?: "foreground" | "auxiliary" | "child" | undefined;
4965
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
4966
- ephemeral?: boolean | undefined;
4967
4967
  meta?: Record<string, SerializableJsonValue> | undefined;
4968
4968
  }, {
4969
- id: string;
4970
4969
  type: "final_answer";
4971
- completion_reason: "tool_call" | "terminal" | "interrupted";
4972
- content: string;
4973
- timestamp: number;
4970
+ id: string;
4974
4971
  conversation_id: string;
4972
+ timestamp: number;
4975
4973
  turn_id: string;
4974
+ content: string;
4976
4975
  answer_id: string;
4976
+ completion_reason: "tool_call" | "terminal" | "interrupted";
4977
+ metadata?: Record<string, SerializableJsonValue> | undefined;
4978
+ version?: 1 | undefined;
4979
+ ephemeral?: boolean | undefined;
4980
+ run_id?: string | undefined;
4981
+ parent_run_id?: string | undefined;
4982
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
4983
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
4984
+ is_complete?: boolean | undefined;
4977
4985
  provider_continuations?: {
4978
4986
  kind: string;
4979
4987
  schema_version: 2;
@@ -5032,14 +5040,6 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5032
5040
  payload: SerializableJsonValue;
5033
5041
  }[] | undefined;
5034
5042
  })[] | undefined;
5035
- metadata?: Record<string, SerializableJsonValue> | undefined;
5036
- version?: 1 | undefined;
5037
- run_id?: string | undefined;
5038
- parent_run_id?: string | undefined;
5039
- lane?: "foreground" | "auxiliary" | "child" | undefined;
5040
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5041
- ephemeral?: boolean | undefined;
5042
- is_complete?: boolean | undefined;
5043
5043
  meta?: Record<string, SerializableJsonValue> | undefined;
5044
5044
  }>, z.ZodObject<{
5045
5045
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -5060,38 +5060,38 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5060
5060
  content: z.ZodString;
5061
5061
  is_last: z.ZodOptional<z.ZodBoolean>;
5062
5062
  }, "strip", z.ZodTypeAny, {
5063
- id: string;
5064
5063
  type: "final_answer_chunk";
5065
- content: string;
5064
+ id: string;
5065
+ conversation_id: string;
5066
5066
  timestamp: number;
5067
5067
  version: 1;
5068
- conversation_id: string;
5069
5068
  turn_id: string;
5069
+ content: string;
5070
5070
  answer_id: string;
5071
5071
  seq: number;
5072
5072
  metadata?: Record<string, SerializableJsonValue> | undefined;
5073
+ ephemeral?: boolean | undefined;
5073
5074
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5074
5075
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5075
5076
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5076
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5077
- ephemeral?: boolean | undefined;
5077
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5078
5078
  is_last?: boolean | undefined;
5079
5079
  }, {
5080
- id: string;
5081
5080
  type: "final_answer_chunk";
5082
- content: string;
5083
- timestamp: number;
5081
+ id: string;
5084
5082
  conversation_id: string;
5083
+ timestamp: number;
5085
5084
  turn_id: string;
5085
+ content: string;
5086
5086
  answer_id: string;
5087
5087
  seq: number;
5088
5088
  metadata?: Record<string, SerializableJsonValue> | undefined;
5089
5089
  version?: 1 | undefined;
5090
+ ephemeral?: boolean | undefined;
5090
5091
  run_id?: string | undefined;
5091
5092
  parent_run_id?: string | undefined;
5092
5093
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5093
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5094
- ephemeral?: boolean | undefined;
5094
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5095
5095
  is_last?: boolean | undefined;
5096
5096
  }>, z.ZodObject<{
5097
5097
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -5110,33 +5110,33 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5110
5110
  answer_id: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
5111
5111
  thought_message_ids: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
5112
5112
  }, "strip", z.ZodTypeAny, {
5113
- id: string;
5114
5113
  type: "final_answer_reset";
5114
+ id: string;
5115
+ conversation_id: string;
5115
5116
  timestamp: number;
5116
5117
  version: 1;
5117
- conversation_id: string;
5118
5118
  turn_id: string;
5119
5119
  metadata?: Record<string, SerializableJsonValue> | undefined;
5120
+ ephemeral?: boolean | undefined;
5120
5121
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5121
5122
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5122
5123
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5123
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5124
- ephemeral?: boolean | undefined;
5124
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5125
5125
  answer_id?: string | undefined;
5126
5126
  thought_message_ids?: string[] | undefined;
5127
5127
  }, {
5128
- id: string;
5129
5128
  type: "final_answer_reset";
5130
- timestamp: number;
5129
+ id: string;
5131
5130
  conversation_id: string;
5131
+ timestamp: number;
5132
5132
  turn_id: string;
5133
5133
  metadata?: Record<string, SerializableJsonValue> | undefined;
5134
5134
  version?: 1 | undefined;
5135
+ ephemeral?: boolean | undefined;
5135
5136
  run_id?: string | undefined;
5136
5137
  parent_run_id?: string | undefined;
5137
5138
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5138
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5139
- ephemeral?: boolean | undefined;
5139
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5140
5140
  answer_id?: string | undefined;
5141
5141
  thought_message_ids?: string[] | undefined;
5142
5142
  }>, z.ZodObject<{
@@ -5160,41 +5160,41 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5160
5160
  compression_ratio: z.ZodOptional<z.ZodNumber>;
5161
5161
  included_old_summary: z.ZodOptional<z.ZodBoolean>;
5162
5162
  }, "strip", z.ZodTypeAny, {
5163
- id: string;
5164
5163
  type: "history_summary";
5165
- content: string;
5164
+ id: string;
5165
+ conversation_id: string;
5166
5166
  timestamp: number;
5167
5167
  version: 1;
5168
- conversation_id: string;
5169
5168
  turn_id: string;
5169
+ content: string;
5170
5170
  original_message_count: number;
5171
5171
  replaced_message_ids: string[];
5172
5172
  summary_seq: number;
5173
5173
  metadata?: Record<string, SerializableJsonValue> | undefined;
5174
+ ephemeral?: boolean | undefined;
5174
5175
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5175
5176
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5176
5177
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5177
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5178
- ephemeral?: boolean | undefined;
5178
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5179
5179
  compression_ratio?: number | undefined;
5180
5180
  included_old_summary?: boolean | undefined;
5181
5181
  }, {
5182
- id: string;
5183
5182
  type: "history_summary";
5184
- content: string;
5185
- timestamp: number;
5183
+ id: string;
5186
5184
  conversation_id: string;
5185
+ timestamp: number;
5187
5186
  turn_id: string;
5187
+ content: string;
5188
5188
  original_message_count: number;
5189
5189
  replaced_message_ids: string[];
5190
5190
  summary_seq: number;
5191
5191
  metadata?: Record<string, SerializableJsonValue> | undefined;
5192
5192
  version?: 1 | undefined;
5193
+ ephemeral?: boolean | undefined;
5193
5194
  run_id?: string | undefined;
5194
5195
  parent_run_id?: string | undefined;
5195
5196
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5196
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5197
- ephemeral?: boolean | undefined;
5197
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5198
5198
  compression_ratio?: number | undefined;
5199
5199
  included_old_summary?: boolean | undefined;
5200
5200
  }>, z.ZodObject<{
@@ -5216,36 +5216,36 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5216
5216
  error_code: z.ZodOptional<z.ZodString>;
5217
5217
  retryable: z.ZodOptional<z.ZodBoolean>;
5218
5218
  }, "strip", z.ZodTypeAny, {
5219
- id: string;
5220
5219
  type: "error";
5221
- error: string;
5220
+ id: string;
5221
+ conversation_id: string;
5222
5222
  timestamp: number;
5223
5223
  version: 1;
5224
- conversation_id: string;
5225
5224
  turn_id: string;
5225
+ error: string;
5226
5226
  metadata?: Record<string, SerializableJsonValue> | undefined;
5227
+ ephemeral?: boolean | undefined;
5227
5228
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5228
5229
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5229
5230
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5230
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5231
- ephemeral?: boolean | undefined;
5231
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5232
5232
  error_code?: string | undefined;
5233
5233
  details?: SerializableJsonValue | undefined;
5234
5234
  retryable?: boolean | undefined;
5235
5235
  }, {
5236
- id: string;
5237
5236
  type: "error";
5238
- error: string;
5239
- timestamp: number;
5237
+ id: string;
5240
5238
  conversation_id: string;
5239
+ timestamp: number;
5241
5240
  turn_id: string;
5241
+ error: string;
5242
5242
  metadata?: Record<string, SerializableJsonValue> | undefined;
5243
5243
  version?: 1 | undefined;
5244
+ ephemeral?: boolean | undefined;
5244
5245
  run_id?: string | undefined;
5245
5246
  parent_run_id?: string | undefined;
5246
5247
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5247
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5248
- ephemeral?: boolean | undefined;
5248
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5249
5249
  error_code?: string | undefined;
5250
5250
  details?: SerializableJsonValue | undefined;
5251
5251
  retryable?: boolean | undefined;
@@ -5268,38 +5268,38 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5268
5268
  reason: z.ZodOptional<z.ZodString>;
5269
5269
  meta: z.ZodOptional<z.ZodType<SerializableJsonValue, z.ZodTypeDef, SerializableJsonValue>>;
5270
5270
  }, "strip", z.ZodTypeAny, {
5271
- id: string;
5272
5271
  type: "control";
5272
+ id: string;
5273
+ conversation_id: string;
5273
5274
  timestamp: number;
5274
5275
  version: 1;
5275
- conversation_id: string;
5276
5276
  turn_id: string;
5277
5277
  op: "truncate_after" | "replace" | "redo" | "branch";
5278
5278
  metadata?: Record<string, SerializableJsonValue> | undefined;
5279
- reason?: string | undefined;
5279
+ ephemeral?: boolean | undefined;
5280
5280
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5281
5281
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5282
5282
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5283
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5284
- ephemeral?: boolean | undefined;
5283
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5285
5284
  meta?: SerializableJsonValue | undefined;
5285
+ reason?: string | undefined;
5286
5286
  target_id?: string | undefined;
5287
5287
  }, {
5288
- id: string;
5289
5288
  type: "control";
5290
- timestamp: number;
5289
+ id: string;
5291
5290
  conversation_id: string;
5291
+ timestamp: number;
5292
5292
  turn_id: string;
5293
5293
  op: "truncate_after" | "replace" | "redo" | "branch";
5294
5294
  metadata?: Record<string, SerializableJsonValue> | undefined;
5295
5295
  version?: 1 | undefined;
5296
- reason?: string | undefined;
5296
+ ephemeral?: boolean | undefined;
5297
5297
  run_id?: string | undefined;
5298
5298
  parent_run_id?: string | undefined;
5299
5299
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5300
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5301
- ephemeral?: boolean | undefined;
5300
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5302
5301
  meta?: SerializableJsonValue | undefined;
5302
+ reason?: string | undefined;
5303
5303
  target_id?: string | undefined;
5304
5304
  }>, z.ZodObject<{
5305
5305
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -5411,11 +5411,11 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5411
5411
  served_model_id?: string | undefined;
5412
5412
  }>;
5413
5413
  }, "strip", z.ZodTypeAny, {
5414
- id: string;
5415
5414
  type: "context_usage_snapshot";
5415
+ id: string;
5416
+ conversation_id: string;
5416
5417
  timestamp: number;
5417
5418
  version: 1;
5418
- conversation_id: string;
5419
5419
  turn_id: string;
5420
5420
  ephemeral: true;
5421
5421
  context_usage: {
@@ -5440,13 +5440,13 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5440
5440
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5441
5441
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5442
5442
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5443
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5443
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5444
5444
  user_message_id?: string | undefined;
5445
5445
  }, {
5446
- id: string;
5447
5446
  type: "context_usage_snapshot";
5448
- timestamp: number;
5447
+ id: string;
5449
5448
  conversation_id: string;
5449
+ timestamp: number;
5450
5450
  turn_id: string;
5451
5451
  ephemeral: true;
5452
5452
  context_usage: {
@@ -5472,7 +5472,7 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5472
5472
  run_id?: string | undefined;
5473
5473
  parent_run_id?: string | undefined;
5474
5474
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5475
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5475
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5476
5476
  user_message_id?: string | undefined;
5477
5477
  }>, z.ZodObject<{
5478
5478
  id: z.ZodEffects<z.ZodString, string, string>;
@@ -5587,21 +5587,21 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5587
5587
  served_model_id?: string | undefined;
5588
5588
  }>>;
5589
5589
  }, "strip", z.ZodTypeAny, {
5590
- id: string;
5591
5590
  type: "run_execution_metrics";
5591
+ id: string;
5592
+ conversation_id: string;
5592
5593
  timestamp: number;
5593
5594
  version: 1;
5594
- outcome: "completed" | "failed" | "cancelled" | "awaiting_user";
5595
- conversation_id: string;
5596
5595
  turn_id: string;
5597
5596
  duration_ms: number;
5597
+ outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
5598
5598
  execution_id: string;
5599
5599
  metadata?: Record<string, SerializableJsonValue> | undefined;
5600
+ ephemeral?: boolean | undefined;
5600
5601
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5601
5602
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5602
5603
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5603
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5604
- ephemeral?: boolean | undefined;
5604
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5605
5605
  user_message_id?: string | undefined;
5606
5606
  context_usage?: {
5607
5607
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -5622,21 +5622,21 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5622
5622
  served_model_id?: string | undefined;
5623
5623
  } | undefined;
5624
5624
  }, {
5625
- id: string;
5626
5625
  type: "run_execution_metrics";
5627
- timestamp: number;
5628
- outcome: "completed" | "failed" | "cancelled" | "awaiting_user";
5626
+ id: string;
5629
5627
  conversation_id: string;
5628
+ timestamp: number;
5630
5629
  turn_id: string;
5631
5630
  duration_ms: number;
5631
+ outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
5632
5632
  execution_id: string;
5633
5633
  metadata?: Record<string, SerializableJsonValue> | undefined;
5634
5634
  version?: 1 | undefined;
5635
+ ephemeral?: boolean | undefined;
5635
5636
  run_id?: string | undefined;
5636
5637
  parent_run_id?: string | undefined;
5637
5638
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5638
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5639
- ephemeral?: boolean | undefined;
5639
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5640
5640
  user_message_id?: string | undefined;
5641
5641
  context_usage?: {
5642
5642
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -5657,15 +5657,21 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5657
5657
  served_model_id?: string | undefined;
5658
5658
  } | undefined;
5659
5659
  }>]>>, {
5660
- id: string;
5661
5660
  type: "user_input";
5662
- content: string;
5661
+ id: string;
5662
+ conversation_id: string;
5663
5663
  timestamp: number;
5664
5664
  version: 1;
5665
- conversation_id: string;
5666
5665
  turn_id: string;
5667
- source: "system" | "user" | "editor";
5666
+ content: string;
5667
+ source: "user" | "editor" | "system";
5668
5668
  metadata?: Record<string, SerializableJsonValue> | undefined;
5669
+ ephemeral?: boolean | undefined;
5670
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
5671
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5672
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
5673
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5674
+ raw_content?: string | undefined;
5669
5675
  attachments?: {
5670
5676
  id: string;
5671
5677
  kind: "image";
@@ -5678,41 +5684,43 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5678
5684
  fileName?: string | undefined;
5679
5685
  label?: string | undefined;
5680
5686
  }[] | undefined;
5681
- run_id?: (string & z.BRAND<"RunId">) | undefined;
5682
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5683
- lane?: "foreground" | "auxiliary" | "child" | undefined;
5684
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5685
- ephemeral?: boolean | undefined;
5686
- raw_content?: string | undefined;
5687
5687
  } | {
5688
- id: string;
5689
5688
  type: "thought";
5690
- content: string;
5689
+ id: string;
5690
+ conversation_id: string;
5691
5691
  timestamp: number;
5692
5692
  version: 1;
5693
- conversation_id: string;
5694
5693
  turn_id: string;
5694
+ content: string;
5695
5695
  is_complete: boolean;
5696
5696
  metadata?: Record<string, SerializableJsonValue> | undefined;
5697
+ ephemeral?: boolean | undefined;
5697
5698
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5698
5699
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5699
5700
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5700
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5701
- ephemeral?: boolean | undefined;
5701
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5702
5702
  thought_message_id?: string | undefined;
5703
5703
  delta?: string | undefined;
5704
5704
  } | {
5705
- id: string;
5706
- status: "error" | "loading" | "success";
5707
5705
  type: "tool_call_decision";
5708
- tool_call_id: string & z.BRAND<"ToolCallId">;
5709
- tool_name: string;
5706
+ id: string;
5707
+ conversation_id: string;
5710
5708
  timestamp: number;
5709
+ status: "error" | "loading" | "success";
5711
5710
  version: 1;
5712
- conversation_id: string;
5713
5711
  turn_id: string;
5714
- phase: "error" | "start" | "update" | "complete";
5712
+ tool_name: string;
5713
+ tool_call_id: string & z.BRAND<"ToolCallId">;
5714
+ phase: "start" | "update" | "complete" | "error";
5715
+ metadata?: Record<string, SerializableJsonValue> | undefined;
5716
+ ephemeral?: boolean | undefined;
5717
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
5718
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5719
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
5720
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5721
+ args?: Record<string, SerializableJsonValue> | undefined;
5715
5722
  payload?: {
5723
+ args?: Record<string, SerializableJsonValue> | undefined;
5716
5724
  tool_calls?: SerializableJsonValue[] | undefined;
5717
5725
  provider_continuations?: {
5718
5726
  kind: string;
@@ -5772,52 +5780,47 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5772
5780
  payload: SerializableJsonValue;
5773
5781
  }[] | undefined;
5774
5782
  })[] | undefined;
5775
- args?: Record<string, SerializableJsonValue> | undefined;
5776
5783
  } | undefined;
5777
- args?: Record<string, SerializableJsonValue> | undefined;
5778
- metadata?: Record<string, SerializableJsonValue> | undefined;
5779
- run_id?: (string & z.BRAND<"RunId">) | undefined;
5780
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5781
- lane?: "foreground" | "auxiliary" | "child" | undefined;
5782
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5783
- ephemeral?: boolean | undefined;
5784
5784
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
5785
5785
  meta?: Record<string, SerializableJsonValue> | undefined;
5786
5786
  } | {
5787
- id: string;
5788
- status: "error" | "loading" | "success";
5789
5787
  type: "tool_process";
5790
- tool_call_id: string & z.BRAND<"ToolCallId">;
5791
- tool_name: string;
5788
+ id: string;
5789
+ conversation_id: string;
5792
5790
  timestamp: number;
5791
+ status: "error" | "loading" | "success";
5793
5792
  version: 1;
5794
- conversation_id: string;
5795
5793
  turn_id: string;
5796
- phase: "error" | "start" | "update" | "complete";
5797
- payload?: Record<string, SerializableJsonValue> | undefined;
5798
- args?: Record<string, SerializableJsonValue> | undefined;
5794
+ tool_name: string;
5795
+ tool_call_id: string & z.BRAND<"ToolCallId">;
5796
+ phase: "start" | "update" | "complete" | "error";
5799
5797
  metadata?: Record<string, SerializableJsonValue> | undefined;
5798
+ ephemeral?: boolean | undefined;
5800
5799
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5801
5800
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5802
5801
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5803
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5804
- ephemeral?: boolean | undefined;
5802
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5803
+ args?: Record<string, SerializableJsonValue> | undefined;
5804
+ payload?: Record<string, SerializableJsonValue> | undefined;
5805
5805
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
5806
5806
  meta?: Record<string, SerializableJsonValue> | undefined;
5807
5807
  } | {
5808
- id: string;
5809
- status: "error" | "success";
5810
5808
  type: "tool_output";
5811
- tool_call_id: string & z.BRAND<"ToolCallId">;
5812
- tool_name: string;
5809
+ id: string;
5810
+ conversation_id: string;
5813
5811
  timestamp: number;
5812
+ status: "error" | "success";
5814
5813
  version: 1;
5815
- conversation_id: string;
5816
5814
  turn_id: string;
5815
+ tool_name: string;
5816
+ tool_call_id: string & z.BRAND<"ToolCallId">;
5817
5817
  observation: string;
5818
- data?: SerializableJsonValue | undefined;
5819
- error?: string | undefined;
5820
5818
  metadata?: Record<string, SerializableJsonValue> | undefined;
5819
+ ephemeral?: boolean | undefined;
5820
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
5821
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5822
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
5823
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5821
5824
  attachments?: {
5822
5825
  id: string;
5823
5826
  kind: "image";
@@ -5830,37 +5833,29 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5830
5833
  fileName?: string | undefined;
5831
5834
  label?: string | undefined;
5832
5835
  }[] | undefined;
5833
- run_id?: (string & z.BRAND<"RunId">) | undefined;
5834
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5835
- lane?: "foreground" | "auxiliary" | "child" | undefined;
5836
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5837
- ephemeral?: boolean | undefined;
5836
+ error?: string | undefined;
5837
+ data?: SerializableJsonValue | undefined;
5838
5838
  error_code?: string | undefined;
5839
5839
  duration_ms?: number | undefined;
5840
5840
  } | {
5841
- id: string;
5842
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
5843
5841
  type: "subrun_trace";
5842
+ id: string;
5843
+ conversation_id: string;
5844
5844
  timestamp: number;
5845
5845
  version: 1;
5846
- conversation_id: string;
5847
5846
  turn_id: string;
5848
5847
  ephemeral: true;
5848
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
5849
5849
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
5850
5850
  subrun_id: string;
5851
5851
  source_event_id: string;
5852
5852
  status?: "error" | "loading" | "success" | undefined;
5853
- tool_calls?: {
5854
- tool_call_id: string & z.BRAND<"ToolCallId">;
5855
- tool_name: string;
5856
- args: Record<string, SerializableJsonValue>;
5857
- }[] | undefined;
5858
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
5859
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
5860
- tool_name?: string | undefined;
5861
- args?: Record<string, SerializableJsonValue> | undefined;
5862
- content?: string | undefined;
5863
5853
  metadata?: Record<string, SerializableJsonValue> | undefined;
5854
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
5855
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5856
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
5857
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5858
+ content?: string | undefined;
5864
5859
  attachments?: {
5865
5860
  id: string;
5866
5861
  kind: "image";
@@ -5873,73 +5868,78 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5873
5868
  fileName?: string | undefined;
5874
5869
  label?: string | undefined;
5875
5870
  }[] | undefined;
5876
- run_id?: (string & z.BRAND<"RunId">) | undefined;
5877
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5878
- lane?: "foreground" | "auxiliary" | "child" | undefined;
5879
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5880
5871
  delta?: string | undefined;
5881
- phase?: "error" | "start" | "update" | "complete" | undefined;
5872
+ tool_name?: string | undefined;
5873
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
5874
+ phase?: "start" | "update" | "complete" | "error" | undefined;
5875
+ args?: Record<string, SerializableJsonValue> | undefined;
5876
+ tool_calls?: {
5877
+ tool_name: string;
5878
+ tool_call_id: string & z.BRAND<"ToolCallId">;
5879
+ args: Record<string, SerializableJsonValue>;
5880
+ }[] | undefined;
5882
5881
  meta?: Record<string, SerializableJsonValue> | undefined;
5883
5882
  duration_ms?: number | undefined;
5884
5883
  subrun_parent_id?: string | undefined;
5885
5884
  answer_id?: string | undefined;
5886
5885
  seq?: number | undefined;
5887
5886
  is_last?: boolean | undefined;
5887
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
5888
5888
  output?: SerializableJsonValue | undefined;
5889
5889
  original_message_count?: number | undefined;
5890
5890
  compression_ratio?: number | undefined;
5891
5891
  included_old_summary?: boolean | undefined;
5892
5892
  replaced_message_ids?: string[] | undefined;
5893
5893
  } | {
5894
- id: string;
5895
5894
  type: "requires_user_interaction";
5896
- tool_call_id: string & z.BRAND<"ToolCallId">;
5895
+ id: string;
5896
+ conversation_id: string;
5897
5897
  timestamp: number;
5898
5898
  version: 1;
5899
- run_id: string & z.BRAND<"RunId">;
5900
- conversation_id: string;
5901
5899
  turn_id: string;
5900
+ run_id: string & z.BRAND<"RunId">;
5901
+ tool_call_id: string & z.BRAND<"ToolCallId">;
5902
5902
  interaction_id: string;
5903
5903
  checkpoint_revision: number;
5904
5904
  resume_token: string;
5905
5905
  interaction_status: "pending";
5906
5906
  metadata?: Record<string, SerializableJsonValue> | undefined;
5907
+ ephemeral?: boolean | undefined;
5907
5908
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5908
5909
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5909
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5910
- ephemeral?: boolean | undefined;
5910
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5911
5911
  form?: SerializableJsonValue | undefined;
5912
5912
  interaction_type?: string | undefined;
5913
5913
  prompt?: string | undefined;
5914
5914
  } | {
5915
- id: string;
5916
5915
  type: "audit_envelope";
5916
+ id: string;
5917
+ conversation_id: string;
5917
5918
  timestamp: number;
5918
5919
  version: 1;
5919
- conversation_id: string;
5920
5920
  turn_id: string;
5921
5921
  envelope: {
5922
- runId: string & z.BRAND<"RunId">;
5923
5922
  envelopeId: string;
5923
+ runId: string & z.BRAND<"RunId">;
5924
5924
  ts: number;
5925
5925
  actor: {
5926
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
5926
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
5927
5927
  id?: string | undefined;
5928
5928
  name?: string | undefined;
5929
5929
  };
5930
5930
  action: string;
5931
5931
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
5932
5932
  decision?: {
5933
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
5933
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
5934
5934
  metadata?: Record<string, unknown> | undefined;
5935
5935
  reason?: string | undefined;
5936
5936
  policy?: string | undefined;
5937
5937
  } | undefined;
5938
5938
  evidence?: {
5939
5939
  kind: string;
5940
- summary?: string | undefined;
5941
5940
  metadata?: Record<string, unknown> | undefined;
5942
5941
  ref?: string | undefined;
5942
+ summary?: string | undefined;
5943
5943
  }[] | undefined;
5944
5944
  costDelta?: {
5945
5945
  tokensInput?: number | undefined;
@@ -5949,35 +5949,41 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
5949
5949
  } | undefined;
5950
5950
  scope?: {
5951
5951
  metadata?: Record<string, unknown> | undefined;
5952
- toolName?: string | undefined;
5953
- conversationId?: string | undefined;
5954
5952
  runId?: (string & z.BRAND<"RunId">) | undefined;
5955
5953
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
5954
+ conversationId?: string | undefined;
5956
5955
  turnId?: string | undefined;
5957
5956
  traceId?: string | undefined;
5958
5957
  agentSpecId?: string | undefined;
5959
5958
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
5959
+ toolName?: string | undefined;
5960
5960
  modelId?: string | undefined;
5961
5961
  nodeId?: string | undefined;
5962
5962
  } | undefined;
5963
5963
  };
5964
5964
  metadata?: Record<string, SerializableJsonValue> | undefined;
5965
+ ephemeral?: boolean | undefined;
5965
5966
  run_id?: (string & z.BRAND<"RunId">) | undefined;
5966
5967
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5967
5968
  lane?: "foreground" | "auxiliary" | "child" | undefined;
5968
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
5969
- ephemeral?: boolean | undefined;
5969
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5970
5970
  } | {
5971
- id: string;
5972
5971
  type: "final_answer";
5973
- completion_reason: "tool_call" | "terminal" | "interrupted";
5974
- content: string;
5972
+ id: string;
5973
+ conversation_id: string;
5975
5974
  timestamp: number;
5976
5975
  version: 1;
5977
- conversation_id: string;
5978
5976
  turn_id: string;
5977
+ content: string;
5979
5978
  is_complete: boolean;
5980
5979
  answer_id: string;
5980
+ completion_reason: "tool_call" | "terminal" | "interrupted";
5981
+ metadata?: Record<string, SerializableJsonValue> | undefined;
5982
+ ephemeral?: boolean | undefined;
5983
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
5984
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
5985
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
5986
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
5981
5987
  provider_continuations?: {
5982
5988
  kind: string;
5983
5989
  schema_version: 2;
@@ -6036,104 +6042,98 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
6036
6042
  payload: SerializableJsonValue;
6037
6043
  }[] | undefined;
6038
6044
  })[] | undefined;
6039
- metadata?: Record<string, SerializableJsonValue> | undefined;
6040
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6041
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6042
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6043
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6044
- ephemeral?: boolean | undefined;
6045
6045
  meta?: Record<string, SerializableJsonValue> | undefined;
6046
6046
  } | {
6047
- id: string;
6048
6047
  type: "final_answer_chunk";
6049
- content: string;
6048
+ id: string;
6049
+ conversation_id: string;
6050
6050
  timestamp: number;
6051
6051
  version: 1;
6052
- conversation_id: string;
6053
6052
  turn_id: string;
6053
+ content: string;
6054
6054
  answer_id: string;
6055
6055
  seq: number;
6056
6056
  metadata?: Record<string, SerializableJsonValue> | undefined;
6057
+ ephemeral?: boolean | undefined;
6057
6058
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6058
6059
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6059
6060
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6060
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6061
- ephemeral?: boolean | undefined;
6061
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6062
6062
  is_last?: boolean | undefined;
6063
6063
  } | {
6064
- id: string;
6065
6064
  type: "final_answer_reset";
6065
+ id: string;
6066
+ conversation_id: string;
6066
6067
  timestamp: number;
6067
6068
  version: 1;
6068
- conversation_id: string;
6069
6069
  turn_id: string;
6070
6070
  metadata?: Record<string, SerializableJsonValue> | undefined;
6071
+ ephemeral?: boolean | undefined;
6071
6072
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6072
6073
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6073
6074
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6074
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6075
- ephemeral?: boolean | undefined;
6075
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6076
6076
  answer_id?: string | undefined;
6077
6077
  thought_message_ids?: string[] | undefined;
6078
6078
  } | {
6079
- id: string;
6080
6079
  type: "history_summary";
6081
- content: string;
6080
+ id: string;
6081
+ conversation_id: string;
6082
6082
  timestamp: number;
6083
6083
  version: 1;
6084
- conversation_id: string;
6085
6084
  turn_id: string;
6085
+ content: string;
6086
6086
  original_message_count: number;
6087
6087
  replaced_message_ids: string[];
6088
6088
  summary_seq: number;
6089
6089
  metadata?: Record<string, SerializableJsonValue> | undefined;
6090
+ ephemeral?: boolean | undefined;
6090
6091
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6091
6092
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6092
6093
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6093
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6094
- ephemeral?: boolean | undefined;
6094
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6095
6095
  compression_ratio?: number | undefined;
6096
6096
  included_old_summary?: boolean | undefined;
6097
6097
  } | {
6098
- id: string;
6099
6098
  type: "error";
6100
- error: string;
6099
+ id: string;
6100
+ conversation_id: string;
6101
6101
  timestamp: number;
6102
6102
  version: 1;
6103
- conversation_id: string;
6104
6103
  turn_id: string;
6104
+ error: string;
6105
6105
  metadata?: Record<string, SerializableJsonValue> | undefined;
6106
+ ephemeral?: boolean | undefined;
6106
6107
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6107
6108
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6108
6109
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6109
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6110
- ephemeral?: boolean | undefined;
6110
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6111
6111
  error_code?: string | undefined;
6112
6112
  details?: SerializableJsonValue | undefined;
6113
6113
  retryable?: boolean | undefined;
6114
6114
  } | {
6115
- id: string;
6116
6115
  type: "control";
6116
+ id: string;
6117
+ conversation_id: string;
6117
6118
  timestamp: number;
6118
6119
  version: 1;
6119
- conversation_id: string;
6120
6120
  turn_id: string;
6121
6121
  op: "truncate_after" | "replace" | "redo" | "branch";
6122
6122
  metadata?: Record<string, SerializableJsonValue> | undefined;
6123
- reason?: string | undefined;
6123
+ ephemeral?: boolean | undefined;
6124
6124
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6125
6125
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6126
6126
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6127
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6128
- ephemeral?: boolean | undefined;
6127
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6129
6128
  meta?: SerializableJsonValue | undefined;
6129
+ reason?: string | undefined;
6130
6130
  target_id?: string | undefined;
6131
6131
  } | {
6132
- id: string;
6133
6132
  type: "context_usage_snapshot";
6133
+ id: string;
6134
+ conversation_id: string;
6134
6135
  timestamp: number;
6135
6136
  version: 1;
6136
- conversation_id: string;
6137
6137
  turn_id: string;
6138
6138
  ephemeral: true;
6139
6139
  context_usage: {
@@ -6158,24 +6158,24 @@ declare const RuntimeEvent: z.ZodEffects<z.ZodPipeline<z.ZodEffects<z.ZodUnknown
6158
6158
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6159
6159
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6160
6160
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6161
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6161
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6162
6162
  user_message_id?: string | undefined;
6163
6163
  } | {
6164
- id: string;
6165
6164
  type: "run_execution_metrics";
6165
+ id: string;
6166
+ conversation_id: string;
6166
6167
  timestamp: number;
6167
6168
  version: 1;
6168
- outcome: "completed" | "failed" | "cancelled" | "awaiting_user";
6169
- conversation_id: string;
6170
6169
  turn_id: string;
6171
6170
  duration_ms: number;
6171
+ outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
6172
6172
  execution_id: string;
6173
6173
  metadata?: Record<string, SerializableJsonValue> | undefined;
6174
+ ephemeral?: boolean | undefined;
6174
6175
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6175
6176
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6176
6177
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6177
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6178
- ephemeral?: boolean | undefined;
6178
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6179
6179
  user_message_id?: string | undefined;
6180
6180
  context_usage?: {
6181
6181
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -6260,15 +6260,21 @@ type RunExecutionMetricsEvent = Extract<RuntimeEvent, {
6260
6260
  type: 'run_execution_metrics';
6261
6261
  }>;
6262
6262
  declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<unknown, {
6263
- id: string;
6264
6263
  type: "user_input";
6265
- content: string;
6264
+ id: string;
6265
+ conversation_id: string;
6266
6266
  timestamp: number;
6267
6267
  version: 1;
6268
- conversation_id: string;
6269
6268
  turn_id: string;
6270
- source: "system" | "user" | "editor";
6269
+ content: string;
6270
+ source: "user" | "editor" | "system";
6271
6271
  metadata?: Record<string, SerializableJsonValue> | undefined;
6272
+ ephemeral?: boolean | undefined;
6273
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6274
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6275
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6276
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6277
+ raw_content?: string | undefined;
6272
6278
  attachments?: {
6273
6279
  id: string;
6274
6280
  kind: "image";
@@ -6281,41 +6287,43 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6281
6287
  fileName?: string | undefined;
6282
6288
  label?: string | undefined;
6283
6289
  }[] | undefined;
6284
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6285
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6286
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6287
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6288
- ephemeral?: boolean | undefined;
6289
- raw_content?: string | undefined;
6290
6290
  } | {
6291
- id: string;
6292
6291
  type: "thought";
6293
- content: string;
6292
+ id: string;
6293
+ conversation_id: string;
6294
6294
  timestamp: number;
6295
6295
  version: 1;
6296
- conversation_id: string;
6297
6296
  turn_id: string;
6297
+ content: string;
6298
6298
  is_complete: boolean;
6299
6299
  metadata?: Record<string, SerializableJsonValue> | undefined;
6300
+ ephemeral?: boolean | undefined;
6300
6301
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6301
6302
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6302
6303
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6303
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6304
- ephemeral?: boolean | undefined;
6304
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6305
6305
  thought_message_id?: string | undefined;
6306
6306
  delta?: string | undefined;
6307
6307
  } | {
6308
- id: string;
6309
- status: "error" | "loading" | "success";
6310
6308
  type: "tool_call_decision";
6311
- tool_call_id: string & z.BRAND<"ToolCallId">;
6312
- tool_name: string;
6309
+ id: string;
6310
+ conversation_id: string;
6313
6311
  timestamp: number;
6312
+ status: "error" | "loading" | "success";
6314
6313
  version: 1;
6315
- conversation_id: string;
6316
6314
  turn_id: string;
6317
- phase: "error" | "start" | "update" | "complete";
6315
+ tool_name: string;
6316
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6317
+ phase: "start" | "update" | "complete" | "error";
6318
+ metadata?: Record<string, SerializableJsonValue> | undefined;
6319
+ ephemeral?: boolean | undefined;
6320
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6321
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6322
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6323
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6324
+ args?: Record<string, SerializableJsonValue> | undefined;
6318
6325
  payload?: {
6326
+ args?: Record<string, SerializableJsonValue> | undefined;
6319
6327
  tool_calls?: SerializableJsonValue[] | undefined;
6320
6328
  provider_continuations?: {
6321
6329
  kind: string;
@@ -6375,52 +6383,47 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6375
6383
  payload: SerializableJsonValue;
6376
6384
  }[] | undefined;
6377
6385
  })[] | undefined;
6378
- args?: Record<string, SerializableJsonValue> | undefined;
6379
6386
  } | undefined;
6380
- args?: Record<string, SerializableJsonValue> | undefined;
6381
- metadata?: Record<string, SerializableJsonValue> | undefined;
6382
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6383
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6384
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6385
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6386
- ephemeral?: boolean | undefined;
6387
6387
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
6388
6388
  meta?: Record<string, SerializableJsonValue> | undefined;
6389
6389
  } | {
6390
- id: string;
6391
- status: "error" | "loading" | "success";
6392
6390
  type: "tool_process";
6393
- tool_call_id: string & z.BRAND<"ToolCallId">;
6394
- tool_name: string;
6391
+ id: string;
6392
+ conversation_id: string;
6395
6393
  timestamp: number;
6394
+ status: "error" | "loading" | "success";
6396
6395
  version: 1;
6397
- conversation_id: string;
6398
6396
  turn_id: string;
6399
- phase: "error" | "start" | "update" | "complete";
6400
- payload?: Record<string, SerializableJsonValue> | undefined;
6401
- args?: Record<string, SerializableJsonValue> | undefined;
6397
+ tool_name: string;
6398
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6399
+ phase: "start" | "update" | "complete" | "error";
6402
6400
  metadata?: Record<string, SerializableJsonValue> | undefined;
6401
+ ephemeral?: boolean | undefined;
6403
6402
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6404
6403
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6405
6404
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6406
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6407
- ephemeral?: boolean | undefined;
6405
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6406
+ args?: Record<string, SerializableJsonValue> | undefined;
6407
+ payload?: Record<string, SerializableJsonValue> | undefined;
6408
6408
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
6409
6409
  meta?: Record<string, SerializableJsonValue> | undefined;
6410
6410
  } | {
6411
- id: string;
6412
- status: "error" | "success";
6413
6411
  type: "tool_output";
6414
- tool_call_id: string & z.BRAND<"ToolCallId">;
6415
- tool_name: string;
6412
+ id: string;
6413
+ conversation_id: string;
6416
6414
  timestamp: number;
6415
+ status: "error" | "success";
6417
6416
  version: 1;
6418
- conversation_id: string;
6419
6417
  turn_id: string;
6418
+ tool_name: string;
6419
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6420
6420
  observation: string;
6421
- data?: SerializableJsonValue | undefined;
6422
- error?: string | undefined;
6423
6421
  metadata?: Record<string, SerializableJsonValue> | undefined;
6422
+ ephemeral?: boolean | undefined;
6423
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6424
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6425
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6426
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6424
6427
  attachments?: {
6425
6428
  id: string;
6426
6429
  kind: "image";
@@ -6433,37 +6436,29 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6433
6436
  fileName?: string | undefined;
6434
6437
  label?: string | undefined;
6435
6438
  }[] | undefined;
6436
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6437
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6438
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6439
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6440
- ephemeral?: boolean | undefined;
6439
+ error?: string | undefined;
6440
+ data?: SerializableJsonValue | undefined;
6441
6441
  error_code?: string | undefined;
6442
6442
  duration_ms?: number | undefined;
6443
6443
  } | {
6444
- id: string;
6445
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
6446
6444
  type: "subrun_trace";
6445
+ id: string;
6446
+ conversation_id: string;
6447
6447
  timestamp: number;
6448
6448
  version: 1;
6449
- conversation_id: string;
6450
6449
  turn_id: string;
6451
6450
  ephemeral: true;
6451
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
6452
6452
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
6453
6453
  subrun_id: string;
6454
6454
  source_event_id: string;
6455
6455
  status?: "error" | "loading" | "success" | undefined;
6456
- tool_calls?: {
6457
- tool_call_id: string & z.BRAND<"ToolCallId">;
6458
- tool_name: string;
6459
- args: Record<string, SerializableJsonValue>;
6460
- }[] | undefined;
6461
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
6462
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
6463
- tool_name?: string | undefined;
6464
- args?: Record<string, SerializableJsonValue> | undefined;
6465
- content?: string | undefined;
6466
6456
  metadata?: Record<string, SerializableJsonValue> | undefined;
6457
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6458
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6459
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6460
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6461
+ content?: string | undefined;
6467
6462
  attachments?: {
6468
6463
  id: string;
6469
6464
  kind: "image";
@@ -6476,73 +6471,78 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6476
6471
  fileName?: string | undefined;
6477
6472
  label?: string | undefined;
6478
6473
  }[] | undefined;
6479
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6480
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6481
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6482
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6483
6474
  delta?: string | undefined;
6484
- phase?: "error" | "start" | "update" | "complete" | undefined;
6475
+ tool_name?: string | undefined;
6476
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
6477
+ phase?: "start" | "update" | "complete" | "error" | undefined;
6478
+ args?: Record<string, SerializableJsonValue> | undefined;
6479
+ tool_calls?: {
6480
+ tool_name: string;
6481
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6482
+ args: Record<string, SerializableJsonValue>;
6483
+ }[] | undefined;
6485
6484
  meta?: Record<string, SerializableJsonValue> | undefined;
6486
6485
  duration_ms?: number | undefined;
6487
6486
  subrun_parent_id?: string | undefined;
6488
6487
  answer_id?: string | undefined;
6489
6488
  seq?: number | undefined;
6490
6489
  is_last?: boolean | undefined;
6490
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
6491
6491
  output?: SerializableJsonValue | undefined;
6492
6492
  original_message_count?: number | undefined;
6493
6493
  compression_ratio?: number | undefined;
6494
6494
  included_old_summary?: boolean | undefined;
6495
6495
  replaced_message_ids?: string[] | undefined;
6496
6496
  } | {
6497
- id: string;
6498
6497
  type: "requires_user_interaction";
6499
- tool_call_id: string & z.BRAND<"ToolCallId">;
6498
+ id: string;
6499
+ conversation_id: string;
6500
6500
  timestamp: number;
6501
6501
  version: 1;
6502
- run_id: string & z.BRAND<"RunId">;
6503
- conversation_id: string;
6504
6502
  turn_id: string;
6503
+ run_id: string & z.BRAND<"RunId">;
6504
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6505
6505
  interaction_id: string;
6506
6506
  checkpoint_revision: number;
6507
6507
  resume_token: string;
6508
6508
  interaction_status: "pending";
6509
6509
  metadata?: Record<string, SerializableJsonValue> | undefined;
6510
+ ephemeral?: boolean | undefined;
6510
6511
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6511
6512
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6512
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6513
- ephemeral?: boolean | undefined;
6513
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6514
6514
  form?: SerializableJsonValue | undefined;
6515
6515
  interaction_type?: string | undefined;
6516
6516
  prompt?: string | undefined;
6517
6517
  } | {
6518
- id: string;
6519
6518
  type: "audit_envelope";
6519
+ id: string;
6520
+ conversation_id: string;
6520
6521
  timestamp: number;
6521
6522
  version: 1;
6522
- conversation_id: string;
6523
6523
  turn_id: string;
6524
6524
  envelope: {
6525
- runId: string & z.BRAND<"RunId">;
6526
6525
  envelopeId: string;
6526
+ runId: string & z.BRAND<"RunId">;
6527
6527
  ts: number;
6528
6528
  actor: {
6529
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
6529
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
6530
6530
  id?: string | undefined;
6531
6531
  name?: string | undefined;
6532
6532
  };
6533
6533
  action: string;
6534
6534
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
6535
6535
  decision?: {
6536
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
6536
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
6537
6537
  metadata?: Record<string, unknown> | undefined;
6538
6538
  reason?: string | undefined;
6539
6539
  policy?: string | undefined;
6540
6540
  } | undefined;
6541
6541
  evidence?: {
6542
6542
  kind: string;
6543
- summary?: string | undefined;
6544
6543
  metadata?: Record<string, unknown> | undefined;
6545
6544
  ref?: string | undefined;
6545
+ summary?: string | undefined;
6546
6546
  }[] | undefined;
6547
6547
  costDelta?: {
6548
6548
  tokensInput?: number | undefined;
@@ -6552,35 +6552,41 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6552
6552
  } | undefined;
6553
6553
  scope?: {
6554
6554
  metadata?: Record<string, unknown> | undefined;
6555
- toolName?: string | undefined;
6556
- conversationId?: string | undefined;
6557
6555
  runId?: (string & z.BRAND<"RunId">) | undefined;
6558
6556
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
6557
+ conversationId?: string | undefined;
6559
6558
  turnId?: string | undefined;
6560
6559
  traceId?: string | undefined;
6561
6560
  agentSpecId?: string | undefined;
6562
6561
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
6562
+ toolName?: string | undefined;
6563
6563
  modelId?: string | undefined;
6564
6564
  nodeId?: string | undefined;
6565
6565
  } | undefined;
6566
6566
  };
6567
6567
  metadata?: Record<string, SerializableJsonValue> | undefined;
6568
+ ephemeral?: boolean | undefined;
6568
6569
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6569
6570
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6570
6571
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6571
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6572
- ephemeral?: boolean | undefined;
6572
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6573
6573
  } | {
6574
- id: string;
6575
6574
  type: "final_answer";
6576
- completion_reason: "tool_call" | "terminal" | "interrupted";
6577
- content: string;
6575
+ id: string;
6576
+ conversation_id: string;
6578
6577
  timestamp: number;
6579
6578
  version: 1;
6580
- conversation_id: string;
6581
6579
  turn_id: string;
6580
+ content: string;
6582
6581
  is_complete: boolean;
6583
6582
  answer_id: string;
6583
+ completion_reason: "tool_call" | "terminal" | "interrupted";
6584
+ metadata?: Record<string, SerializableJsonValue> | undefined;
6585
+ ephemeral?: boolean | undefined;
6586
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6587
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6588
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6589
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6584
6590
  provider_continuations?: {
6585
6591
  kind: string;
6586
6592
  schema_version: 2;
@@ -6639,104 +6645,98 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6639
6645
  payload: SerializableJsonValue;
6640
6646
  }[] | undefined;
6641
6647
  })[] | undefined;
6642
- metadata?: Record<string, SerializableJsonValue> | undefined;
6643
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6644
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6645
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6646
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6647
- ephemeral?: boolean | undefined;
6648
6648
  meta?: Record<string, SerializableJsonValue> | undefined;
6649
6649
  } | {
6650
- id: string;
6651
6650
  type: "final_answer_chunk";
6652
- content: string;
6651
+ id: string;
6652
+ conversation_id: string;
6653
6653
  timestamp: number;
6654
6654
  version: 1;
6655
- conversation_id: string;
6656
6655
  turn_id: string;
6656
+ content: string;
6657
6657
  answer_id: string;
6658
6658
  seq: number;
6659
6659
  metadata?: Record<string, SerializableJsonValue> | undefined;
6660
+ ephemeral?: boolean | undefined;
6660
6661
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6661
6662
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6662
6663
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6663
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6664
- ephemeral?: boolean | undefined;
6664
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6665
6665
  is_last?: boolean | undefined;
6666
6666
  } | {
6667
- id: string;
6668
6667
  type: "final_answer_reset";
6668
+ id: string;
6669
+ conversation_id: string;
6669
6670
  timestamp: number;
6670
6671
  version: 1;
6671
- conversation_id: string;
6672
6672
  turn_id: string;
6673
6673
  metadata?: Record<string, SerializableJsonValue> | undefined;
6674
+ ephemeral?: boolean | undefined;
6674
6675
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6675
6676
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6676
6677
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6677
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6678
- ephemeral?: boolean | undefined;
6678
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6679
6679
  answer_id?: string | undefined;
6680
6680
  thought_message_ids?: string[] | undefined;
6681
6681
  } | {
6682
- id: string;
6683
6682
  type: "history_summary";
6684
- content: string;
6683
+ id: string;
6684
+ conversation_id: string;
6685
6685
  timestamp: number;
6686
6686
  version: 1;
6687
- conversation_id: string;
6688
6687
  turn_id: string;
6688
+ content: string;
6689
6689
  original_message_count: number;
6690
6690
  replaced_message_ids: string[];
6691
6691
  summary_seq: number;
6692
6692
  metadata?: Record<string, SerializableJsonValue> | undefined;
6693
+ ephemeral?: boolean | undefined;
6693
6694
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6694
6695
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6695
6696
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6696
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6697
- ephemeral?: boolean | undefined;
6697
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6698
6698
  compression_ratio?: number | undefined;
6699
6699
  included_old_summary?: boolean | undefined;
6700
6700
  } | {
6701
- id: string;
6702
6701
  type: "error";
6703
- error: string;
6702
+ id: string;
6703
+ conversation_id: string;
6704
6704
  timestamp: number;
6705
6705
  version: 1;
6706
- conversation_id: string;
6707
6706
  turn_id: string;
6707
+ error: string;
6708
6708
  metadata?: Record<string, SerializableJsonValue> | undefined;
6709
+ ephemeral?: boolean | undefined;
6709
6710
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6710
6711
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6711
6712
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6712
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6713
- ephemeral?: boolean | undefined;
6713
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6714
6714
  error_code?: string | undefined;
6715
6715
  details?: SerializableJsonValue | undefined;
6716
6716
  retryable?: boolean | undefined;
6717
6717
  } | {
6718
- id: string;
6719
6718
  type: "control";
6719
+ id: string;
6720
+ conversation_id: string;
6720
6721
  timestamp: number;
6721
6722
  version: 1;
6722
- conversation_id: string;
6723
6723
  turn_id: string;
6724
6724
  op: "truncate_after" | "replace" | "redo" | "branch";
6725
6725
  metadata?: Record<string, SerializableJsonValue> | undefined;
6726
- reason?: string | undefined;
6726
+ ephemeral?: boolean | undefined;
6727
6727
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6728
6728
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6729
6729
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6730
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6731
- ephemeral?: boolean | undefined;
6730
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6732
6731
  meta?: SerializableJsonValue | undefined;
6732
+ reason?: string | undefined;
6733
6733
  target_id?: string | undefined;
6734
6734
  } | {
6735
- id: string;
6736
6735
  type: "context_usage_snapshot";
6736
+ id: string;
6737
+ conversation_id: string;
6737
6738
  timestamp: number;
6738
6739
  version: 1;
6739
- conversation_id: string;
6740
6740
  turn_id: string;
6741
6741
  ephemeral: true;
6742
6742
  context_usage: {
@@ -6761,24 +6761,24 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6761
6761
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6762
6762
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6763
6763
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6764
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6764
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6765
6765
  user_message_id?: string | undefined;
6766
6766
  } | {
6767
- id: string;
6768
6767
  type: "run_execution_metrics";
6768
+ id: string;
6769
+ conversation_id: string;
6769
6770
  timestamp: number;
6770
6771
  version: 1;
6771
- outcome: "completed" | "failed" | "cancelled" | "awaiting_user";
6772
- conversation_id: string;
6773
6772
  turn_id: string;
6774
6773
  duration_ms: number;
6774
+ outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
6775
6775
  execution_id: string;
6776
6776
  metadata?: Record<string, SerializableJsonValue> | undefined;
6777
+ ephemeral?: boolean | undefined;
6777
6778
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6778
6779
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6779
6780
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6780
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6781
- ephemeral?: boolean | undefined;
6781
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6782
6782
  user_message_id?: string | undefined;
6783
6783
  context_usage?: {
6784
6784
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
@@ -6800,15 +6800,21 @@ declare const validateRuntimeEvent: (event: unknown) => z.SafeParseReturnType<un
6800
6800
  } | undefined;
6801
6801
  }>;
6802
6802
  declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnType<unknown[], ({
6803
- id: string;
6804
6803
  type: "user_input";
6805
- content: string;
6804
+ id: string;
6805
+ conversation_id: string;
6806
6806
  timestamp: number;
6807
6807
  version: 1;
6808
- conversation_id: string;
6809
6808
  turn_id: string;
6810
- source: "system" | "user" | "editor";
6809
+ content: string;
6810
+ source: "user" | "editor" | "system";
6811
6811
  metadata?: Record<string, SerializableJsonValue> | undefined;
6812
+ ephemeral?: boolean | undefined;
6813
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6814
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6815
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6816
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6817
+ raw_content?: string | undefined;
6812
6818
  attachments?: {
6813
6819
  id: string;
6814
6820
  kind: "image";
@@ -6821,41 +6827,43 @@ declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnTyp
6821
6827
  fileName?: string | undefined;
6822
6828
  label?: string | undefined;
6823
6829
  }[] | undefined;
6824
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6825
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6826
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6827
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6828
- ephemeral?: boolean | undefined;
6829
- raw_content?: string | undefined;
6830
6830
  } | {
6831
- id: string;
6832
6831
  type: "thought";
6833
- content: string;
6832
+ id: string;
6833
+ conversation_id: string;
6834
6834
  timestamp: number;
6835
6835
  version: 1;
6836
- conversation_id: string;
6837
6836
  turn_id: string;
6837
+ content: string;
6838
6838
  is_complete: boolean;
6839
6839
  metadata?: Record<string, SerializableJsonValue> | undefined;
6840
+ ephemeral?: boolean | undefined;
6840
6841
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6841
6842
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6842
6843
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6843
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6844
- ephemeral?: boolean | undefined;
6844
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6845
6845
  thought_message_id?: string | undefined;
6846
6846
  delta?: string | undefined;
6847
6847
  } | {
6848
- id: string;
6849
- status: "error" | "loading" | "success";
6850
6848
  type: "tool_call_decision";
6851
- tool_call_id: string & z.BRAND<"ToolCallId">;
6852
- tool_name: string;
6849
+ id: string;
6850
+ conversation_id: string;
6853
6851
  timestamp: number;
6852
+ status: "error" | "loading" | "success";
6854
6853
  version: 1;
6855
- conversation_id: string;
6856
6854
  turn_id: string;
6857
- phase: "error" | "start" | "update" | "complete";
6855
+ tool_name: string;
6856
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6857
+ phase: "start" | "update" | "complete" | "error";
6858
+ metadata?: Record<string, SerializableJsonValue> | undefined;
6859
+ ephemeral?: boolean | undefined;
6860
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6861
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6862
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6863
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6864
+ args?: Record<string, SerializableJsonValue> | undefined;
6858
6865
  payload?: {
6866
+ args?: Record<string, SerializableJsonValue> | undefined;
6859
6867
  tool_calls?: SerializableJsonValue[] | undefined;
6860
6868
  provider_continuations?: {
6861
6869
  kind: string;
@@ -6915,52 +6923,47 @@ declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnTyp
6915
6923
  payload: SerializableJsonValue;
6916
6924
  }[] | undefined;
6917
6925
  })[] | undefined;
6918
- args?: Record<string, SerializableJsonValue> | undefined;
6919
6926
  } | undefined;
6920
- args?: Record<string, SerializableJsonValue> | undefined;
6921
- metadata?: Record<string, SerializableJsonValue> | undefined;
6922
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6923
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6924
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6925
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6926
- ephemeral?: boolean | undefined;
6927
6927
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
6928
6928
  meta?: Record<string, SerializableJsonValue> | undefined;
6929
6929
  } | {
6930
- id: string;
6931
- status: "error" | "loading" | "success";
6932
6930
  type: "tool_process";
6933
- tool_call_id: string & z.BRAND<"ToolCallId">;
6934
- tool_name: string;
6931
+ id: string;
6932
+ conversation_id: string;
6935
6933
  timestamp: number;
6934
+ status: "error" | "loading" | "success";
6936
6935
  version: 1;
6937
- conversation_id: string;
6938
6936
  turn_id: string;
6939
- phase: "error" | "start" | "update" | "complete";
6940
- payload?: Record<string, SerializableJsonValue> | undefined;
6941
- args?: Record<string, SerializableJsonValue> | undefined;
6937
+ tool_name: string;
6938
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6939
+ phase: "start" | "update" | "complete" | "error";
6942
6940
  metadata?: Record<string, SerializableJsonValue> | undefined;
6941
+ ephemeral?: boolean | undefined;
6943
6942
  run_id?: (string & z.BRAND<"RunId">) | undefined;
6944
6943
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6945
6944
  lane?: "foreground" | "auxiliary" | "child" | undefined;
6946
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6947
- ephemeral?: boolean | undefined;
6945
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6946
+ args?: Record<string, SerializableJsonValue> | undefined;
6947
+ payload?: Record<string, SerializableJsonValue> | undefined;
6948
6948
  parent_tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
6949
6949
  meta?: Record<string, SerializableJsonValue> | undefined;
6950
6950
  } | {
6951
- id: string;
6952
- status: "error" | "success";
6953
6951
  type: "tool_output";
6954
- tool_call_id: string & z.BRAND<"ToolCallId">;
6955
- tool_name: string;
6952
+ id: string;
6953
+ conversation_id: string;
6956
6954
  timestamp: number;
6955
+ status: "error" | "success";
6957
6956
  version: 1;
6958
- conversation_id: string;
6959
6957
  turn_id: string;
6958
+ tool_name: string;
6959
+ tool_call_id: string & z.BRAND<"ToolCallId">;
6960
6960
  observation: string;
6961
- data?: SerializableJsonValue | undefined;
6962
- error?: string | undefined;
6963
6961
  metadata?: Record<string, SerializableJsonValue> | undefined;
6962
+ ephemeral?: boolean | undefined;
6963
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6964
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6965
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
6966
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
6964
6967
  attachments?: {
6965
6968
  id: string;
6966
6969
  kind: "image";
@@ -6973,37 +6976,29 @@ declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnTyp
6973
6976
  fileName?: string | undefined;
6974
6977
  label?: string | undefined;
6975
6978
  }[] | undefined;
6976
- run_id?: (string & z.BRAND<"RunId">) | undefined;
6977
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6978
- lane?: "foreground" | "auxiliary" | "child" | undefined;
6979
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
6980
- ephemeral?: boolean | undefined;
6979
+ error?: string | undefined;
6980
+ data?: SerializableJsonValue | undefined;
6981
6981
  error_code?: string | undefined;
6982
6982
  duration_ms?: number | undefined;
6983
6983
  } | {
6984
- id: string;
6985
- kind: "history_summary" | "final_answer" | "tool_output" | "tool_call_decision" | "tool_process" | "thought_delta" | "thought_complete" | "final_answer_chunk";
6986
6984
  type: "subrun_trace";
6985
+ id: string;
6986
+ conversation_id: string;
6987
6987
  timestamp: number;
6988
6988
  version: 1;
6989
- conversation_id: string;
6990
6989
  turn_id: string;
6991
6990
  ephemeral: true;
6991
+ kind: "tool_call_decision" | "tool_process" | "tool_output" | "thought_delta" | "thought_complete" | "final_answer_chunk" | "final_answer" | "history_summary";
6992
6992
  parent_tool_call_id: string & z.BRAND<"ToolCallId">;
6993
6993
  subrun_id: string;
6994
6994
  source_event_id: string;
6995
6995
  status?: "error" | "loading" | "success" | undefined;
6996
- tool_calls?: {
6997
- tool_call_id: string & z.BRAND<"ToolCallId">;
6998
- tool_name: string;
6999
- args: Record<string, SerializableJsonValue>;
7000
- }[] | undefined;
7001
- tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
7002
- completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
7003
- tool_name?: string | undefined;
7004
- args?: Record<string, SerializableJsonValue> | undefined;
7005
- content?: string | undefined;
7006
6996
  metadata?: Record<string, SerializableJsonValue> | undefined;
6997
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
6998
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
6999
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
7000
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7001
+ content?: string | undefined;
7007
7002
  attachments?: {
7008
7003
  id: string;
7009
7004
  kind: "image";
@@ -7016,73 +7011,78 @@ declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnTyp
7016
7011
  fileName?: string | undefined;
7017
7012
  label?: string | undefined;
7018
7013
  }[] | undefined;
7019
- run_id?: (string & z.BRAND<"RunId">) | undefined;
7020
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7021
- lane?: "foreground" | "auxiliary" | "child" | undefined;
7022
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7023
7014
  delta?: string | undefined;
7024
- phase?: "error" | "start" | "update" | "complete" | undefined;
7015
+ tool_name?: string | undefined;
7016
+ tool_call_id?: (string & z.BRAND<"ToolCallId">) | undefined;
7017
+ phase?: "start" | "update" | "complete" | "error" | undefined;
7018
+ args?: Record<string, SerializableJsonValue> | undefined;
7019
+ tool_calls?: {
7020
+ tool_name: string;
7021
+ tool_call_id: string & z.BRAND<"ToolCallId">;
7022
+ args: Record<string, SerializableJsonValue>;
7023
+ }[] | undefined;
7025
7024
  meta?: Record<string, SerializableJsonValue> | undefined;
7026
7025
  duration_ms?: number | undefined;
7027
7026
  subrun_parent_id?: string | undefined;
7028
7027
  answer_id?: string | undefined;
7029
7028
  seq?: number | undefined;
7030
7029
  is_last?: boolean | undefined;
7030
+ completion_reason?: "tool_call" | "terminal" | "interrupted" | undefined;
7031
7031
  output?: SerializableJsonValue | undefined;
7032
7032
  original_message_count?: number | undefined;
7033
7033
  compression_ratio?: number | undefined;
7034
7034
  included_old_summary?: boolean | undefined;
7035
7035
  replaced_message_ids?: string[] | undefined;
7036
7036
  } | {
7037
- id: string;
7038
7037
  type: "requires_user_interaction";
7039
- tool_call_id: string & z.BRAND<"ToolCallId">;
7038
+ id: string;
7039
+ conversation_id: string;
7040
7040
  timestamp: number;
7041
7041
  version: 1;
7042
- run_id: string & z.BRAND<"RunId">;
7043
- conversation_id: string;
7044
7042
  turn_id: string;
7043
+ run_id: string & z.BRAND<"RunId">;
7044
+ tool_call_id: string & z.BRAND<"ToolCallId">;
7045
7045
  interaction_id: string;
7046
7046
  checkpoint_revision: number;
7047
7047
  resume_token: string;
7048
7048
  interaction_status: "pending";
7049
7049
  metadata?: Record<string, SerializableJsonValue> | undefined;
7050
+ ephemeral?: boolean | undefined;
7050
7051
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7051
7052
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7052
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7053
- ephemeral?: boolean | undefined;
7053
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7054
7054
  form?: SerializableJsonValue | undefined;
7055
7055
  interaction_type?: string | undefined;
7056
7056
  prompt?: string | undefined;
7057
7057
  } | {
7058
- id: string;
7059
7058
  type: "audit_envelope";
7059
+ id: string;
7060
+ conversation_id: string;
7060
7061
  timestamp: number;
7061
7062
  version: 1;
7062
- conversation_id: string;
7063
7063
  turn_id: string;
7064
7064
  envelope: {
7065
- runId: string & z.BRAND<"RunId">;
7066
7065
  envelopeId: string;
7066
+ runId: string & z.BRAND<"RunId">;
7067
7067
  ts: number;
7068
7068
  actor: {
7069
- kind: "system" | "user" | "tool" | "host" | "agent" | "model";
7069
+ kind: "user" | "system" | "host" | "agent" | "model" | "tool";
7070
7070
  id?: string | undefined;
7071
7071
  name?: string | undefined;
7072
7072
  };
7073
7073
  action: string;
7074
7074
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
7075
7075
  decision?: {
7076
- outcome: "requested" | "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "recorded";
7076
+ outcome: "allowed" | "denied" | "fallback" | "retry" | "cancelled" | "paused" | "resumed" | "requested" | "recorded";
7077
7077
  metadata?: Record<string, unknown> | undefined;
7078
7078
  reason?: string | undefined;
7079
7079
  policy?: string | undefined;
7080
7080
  } | undefined;
7081
7081
  evidence?: {
7082
7082
  kind: string;
7083
- summary?: string | undefined;
7084
7083
  metadata?: Record<string, unknown> | undefined;
7085
7084
  ref?: string | undefined;
7085
+ summary?: string | undefined;
7086
7086
  }[] | undefined;
7087
7087
  costDelta?: {
7088
7088
  tokensInput?: number | undefined;
@@ -7092,35 +7092,41 @@ declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnTyp
7092
7092
  } | undefined;
7093
7093
  scope?: {
7094
7094
  metadata?: Record<string, unknown> | undefined;
7095
- toolName?: string | undefined;
7096
- conversationId?: string | undefined;
7097
7095
  runId?: (string & z.BRAND<"RunId">) | undefined;
7098
7096
  parentRunId?: (string & z.BRAND<"RunId">) | undefined;
7097
+ conversationId?: string | undefined;
7099
7098
  turnId?: string | undefined;
7100
7099
  traceId?: string | undefined;
7101
7100
  agentSpecId?: string | undefined;
7102
7101
  toolCallId?: (string & z.BRAND<"ToolCallId">) | undefined;
7102
+ toolName?: string | undefined;
7103
7103
  modelId?: string | undefined;
7104
7104
  nodeId?: string | undefined;
7105
7105
  } | undefined;
7106
7106
  };
7107
7107
  metadata?: Record<string, SerializableJsonValue> | undefined;
7108
+ ephemeral?: boolean | undefined;
7108
7109
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7109
7110
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7110
7111
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7111
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7112
- ephemeral?: boolean | undefined;
7112
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7113
7113
  } | {
7114
- id: string;
7115
7114
  type: "final_answer";
7116
- completion_reason: "tool_call" | "terminal" | "interrupted";
7117
- content: string;
7115
+ id: string;
7116
+ conversation_id: string;
7118
7117
  timestamp: number;
7119
7118
  version: 1;
7120
- conversation_id: string;
7121
7119
  turn_id: string;
7120
+ content: string;
7122
7121
  is_complete: boolean;
7123
7122
  answer_id: string;
7123
+ completion_reason: "tool_call" | "terminal" | "interrupted";
7124
+ metadata?: Record<string, SerializableJsonValue> | undefined;
7125
+ ephemeral?: boolean | undefined;
7126
+ run_id?: (string & z.BRAND<"RunId">) | undefined;
7127
+ parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7128
+ lane?: "foreground" | "auxiliary" | "child" | undefined;
7129
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7124
7130
  provider_continuations?: {
7125
7131
  kind: string;
7126
7132
  schema_version: 2;
@@ -7179,104 +7185,98 @@ declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnTyp
7179
7185
  payload: SerializableJsonValue;
7180
7186
  }[] | undefined;
7181
7187
  })[] | undefined;
7182
- metadata?: Record<string, SerializableJsonValue> | undefined;
7183
- run_id?: (string & z.BRAND<"RunId">) | undefined;
7184
- parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7185
- lane?: "foreground" | "auxiliary" | "child" | undefined;
7186
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7187
- ephemeral?: boolean | undefined;
7188
7188
  meta?: Record<string, SerializableJsonValue> | undefined;
7189
7189
  } | {
7190
- id: string;
7191
7190
  type: "final_answer_chunk";
7192
- content: string;
7191
+ id: string;
7192
+ conversation_id: string;
7193
7193
  timestamp: number;
7194
7194
  version: 1;
7195
- conversation_id: string;
7196
7195
  turn_id: string;
7196
+ content: string;
7197
7197
  answer_id: string;
7198
7198
  seq: number;
7199
7199
  metadata?: Record<string, SerializableJsonValue> | undefined;
7200
+ ephemeral?: boolean | undefined;
7200
7201
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7201
7202
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7202
7203
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7203
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7204
- ephemeral?: boolean | undefined;
7204
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7205
7205
  is_last?: boolean | undefined;
7206
7206
  } | {
7207
- id: string;
7208
7207
  type: "final_answer_reset";
7208
+ id: string;
7209
+ conversation_id: string;
7209
7210
  timestamp: number;
7210
7211
  version: 1;
7211
- conversation_id: string;
7212
7212
  turn_id: string;
7213
7213
  metadata?: Record<string, SerializableJsonValue> | undefined;
7214
+ ephemeral?: boolean | undefined;
7214
7215
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7215
7216
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7216
7217
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7217
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7218
- ephemeral?: boolean | undefined;
7218
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7219
7219
  answer_id?: string | undefined;
7220
7220
  thought_message_ids?: string[] | undefined;
7221
7221
  } | {
7222
- id: string;
7223
7222
  type: "history_summary";
7224
- content: string;
7223
+ id: string;
7224
+ conversation_id: string;
7225
7225
  timestamp: number;
7226
7226
  version: 1;
7227
- conversation_id: string;
7228
7227
  turn_id: string;
7228
+ content: string;
7229
7229
  original_message_count: number;
7230
7230
  replaced_message_ids: string[];
7231
7231
  summary_seq: number;
7232
7232
  metadata?: Record<string, SerializableJsonValue> | undefined;
7233
+ ephemeral?: boolean | undefined;
7233
7234
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7234
7235
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7235
7236
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7236
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7237
- ephemeral?: boolean | undefined;
7237
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7238
7238
  compression_ratio?: number | undefined;
7239
7239
  included_old_summary?: boolean | undefined;
7240
7240
  } | {
7241
- id: string;
7242
7241
  type: "error";
7243
- error: string;
7242
+ id: string;
7243
+ conversation_id: string;
7244
7244
  timestamp: number;
7245
7245
  version: 1;
7246
- conversation_id: string;
7247
7246
  turn_id: string;
7247
+ error: string;
7248
7248
  metadata?: Record<string, SerializableJsonValue> | undefined;
7249
+ ephemeral?: boolean | undefined;
7249
7250
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7250
7251
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7251
7252
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7252
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7253
- ephemeral?: boolean | undefined;
7253
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7254
7254
  error_code?: string | undefined;
7255
7255
  details?: SerializableJsonValue | undefined;
7256
7256
  retryable?: boolean | undefined;
7257
7257
  } | {
7258
- id: string;
7259
7258
  type: "control";
7259
+ id: string;
7260
+ conversation_id: string;
7260
7261
  timestamp: number;
7261
7262
  version: 1;
7262
- conversation_id: string;
7263
7263
  turn_id: string;
7264
7264
  op: "truncate_after" | "replace" | "redo" | "branch";
7265
7265
  metadata?: Record<string, SerializableJsonValue> | undefined;
7266
- reason?: string | undefined;
7266
+ ephemeral?: boolean | undefined;
7267
7267
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7268
7268
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7269
7269
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7270
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7271
- ephemeral?: boolean | undefined;
7270
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7272
7271
  meta?: SerializableJsonValue | undefined;
7272
+ reason?: string | undefined;
7273
7273
  target_id?: string | undefined;
7274
7274
  } | {
7275
- id: string;
7276
7275
  type: "context_usage_snapshot";
7276
+ id: string;
7277
+ conversation_id: string;
7277
7278
  timestamp: number;
7278
7279
  version: 1;
7279
- conversation_id: string;
7280
7280
  turn_id: string;
7281
7281
  ephemeral: true;
7282
7282
  context_usage: {
@@ -7301,24 +7301,24 @@ declare const validateRuntimeEvents: (events: unknown[]) => z.SafeParseReturnTyp
7301
7301
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7302
7302
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7303
7303
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7304
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7304
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7305
7305
  user_message_id?: string | undefined;
7306
7306
  } | {
7307
- id: string;
7308
7307
  type: "run_execution_metrics";
7308
+ id: string;
7309
+ conversation_id: string;
7309
7310
  timestamp: number;
7310
7311
  version: 1;
7311
- outcome: "completed" | "failed" | "cancelled" | "awaiting_user";
7312
- conversation_id: string;
7313
7312
  turn_id: string;
7314
7313
  duration_ms: number;
7314
+ outcome: "cancelled" | "completed" | "awaiting_user" | "failed";
7315
7315
  execution_id: string;
7316
7316
  metadata?: Record<string, SerializableJsonValue> | undefined;
7317
+ ephemeral?: boolean | undefined;
7317
7318
  run_id?: (string & z.BRAND<"RunId">) | undefined;
7318
7319
  parent_run_id?: (string & z.BRAND<"RunId">) | undefined;
7319
7320
  lane?: "foreground" | "auxiliary" | "child" | undefined;
7320
- visibility?: "none" | "conversation" | "parent-trace" | undefined;
7321
- ephemeral?: boolean | undefined;
7321
+ visibility?: "conversation" | "parent-trace" | "none" | undefined;
7322
7322
  user_message_id?: string | undefined;
7323
7323
  context_usage?: {
7324
7324
  source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";