stitchkit 0.110.1 → 0.110.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/agent-runtime/archive-projection.d.ts +10 -0
  3. package/dist/agent-runtime/archive-projection.d.ts.map +1 -0
  4. package/dist/agent-runtime/archive-spill.d.ts +61 -0
  5. package/dist/agent-runtime/archive-spill.d.ts.map +1 -0
  6. package/dist/agent-runtime/branch-contract.d.ts +102 -0
  7. package/dist/agent-runtime/branch-contract.d.ts.map +1 -0
  8. package/dist/agent-runtime/branch-events.d.ts +18 -0
  9. package/dist/agent-runtime/branch-events.d.ts.map +1 -0
  10. package/dist/agent-runtime/branch-identities.d.ts +20 -0
  11. package/dist/agent-runtime/branch-identities.d.ts.map +1 -0
  12. package/dist/agent-runtime/branch-messages.d.ts +32 -0
  13. package/dist/agent-runtime/branch-messages.d.ts.map +1 -0
  14. package/dist/agent-runtime/branch-observations.d.ts +104 -0
  15. package/dist/agent-runtime/branch-observations.d.ts.map +1 -0
  16. package/dist/agent-runtime/branch-provider.d.ts +130 -0
  17. package/dist/agent-runtime/branch-provider.d.ts.map +1 -0
  18. package/dist/agent-runtime/branch-replay.d.ts +426 -0
  19. package/dist/agent-runtime/branch-replay.d.ts.map +1 -0
  20. package/dist/agent-runtime/branch-source.d.ts +16 -0
  21. package/dist/agent-runtime/branch-source.d.ts.map +1 -0
  22. package/dist/agent-runtime/branch-transitions.d.ts +6 -0
  23. package/dist/agent-runtime/branch-transitions.d.ts.map +1 -0
  24. package/dist/agent-runtime/sqlite-events.d.ts.map +1 -1
  25. package/dist/agent-runtime/sqlite-history.d.ts.map +1 -1
  26. package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
  27. package/dist/agent-runtime/store-archive.d.ts +1 -0
  28. package/dist/agent-runtime/store-archive.d.ts.map +1 -1
  29. package/dist/agent-runtime/store-branch.d.ts +5 -0
  30. package/dist/agent-runtime/store-branch.d.ts.map +1 -0
  31. package/dist/agent-runtime/store-conformance-branch.d.ts +4 -0
  32. package/dist/agent-runtime/store-conformance-branch.d.ts.map +1 -0
  33. package/dist/agent-runtime/store-conformance-support.d.ts +5 -5
  34. package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
  35. package/dist/agent-runtime/store-create.d.ts +1 -1
  36. package/dist/agent-runtime/store-create.d.ts.map +1 -1
  37. package/dist/agent-runtime/store-driver-contract.d.ts +6 -0
  38. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
  39. package/dist/agent-runtime/store-events.d.ts +1131 -0
  40. package/dist/agent-runtime/store-events.d.ts.map +1 -1
  41. package/dist/agent-runtime/store-memory-archive.d.ts +8 -0
  42. package/dist/agent-runtime/store-memory-archive.d.ts.map +1 -0
  43. package/dist/agent-runtime/store-memory-events.d.ts +7 -0
  44. package/dist/agent-runtime/store-memory-events.d.ts.map +1 -0
  45. package/dist/agent-runtime/store-memory.d.ts +1 -1
  46. package/dist/agent-runtime/store-memory.d.ts.map +1 -1
  47. package/dist/agent-runtime/store-purge.d.ts +2 -0
  48. package/dist/agent-runtime/store-purge.d.ts.map +1 -1
  49. package/dist/agent-runtime/store-reduce-run.d.ts +2 -2
  50. package/dist/agent-runtime/store-reduce-run.d.ts.map +1 -1
  51. package/dist/agent-runtime/store-reduce-shared.d.ts +1 -0
  52. package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -1
  53. package/dist/agent-runtime/store-reducer.d.ts +2 -2
  54. package/dist/agent-runtime/store-reducer.d.ts.map +1 -1
  55. package/dist/agent-runtime/store-replay.d.ts +4 -0
  56. package/dist/agent-runtime/store-replay.d.ts.map +1 -0
  57. package/dist/agent-runtime/store.d.ts +3 -0
  58. package/dist/agent-runtime/store.d.ts.map +1 -1
  59. package/dist/durability/events.d.ts +4 -0
  60. package/dist/durability/events.d.ts.map +1 -1
  61. package/dist/entrypoints/agent-runtime/coding-tools.js +1 -2
  62. package/dist/entrypoints/agent-runtime/harness.js +4 -3
  63. package/dist/entrypoints/agent-runtime/sandbox.js +3 -5
  64. package/dist/entrypoints/agent-runtime/sqlite/bun.js +13 -3
  65. package/dist/entrypoints/agent-runtime/sqlite/node.js +13 -3
  66. package/dist/entrypoints/agent-runtime/testing.js +89 -5
  67. package/dist/entrypoints/agent-runtime.d.ts +2 -1
  68. package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
  69. package/dist/entrypoints/agent-runtime.js +27 -15
  70. package/dist/entrypoints/tools.js +5 -3
  71. package/dist/{index-0gs4ymfj.js → index-4fgg1507.js} +31 -2
  72. package/dist/{index-c17xcx4k.js → index-56yx8dxp.js} +19 -96
  73. package/dist/{index-8rstkvcf.js → index-7c046kxr.js} +1 -1
  74. package/dist/{index-tjdsyrys.js → index-bm180f2d.js} +203 -83
  75. package/dist/{index-924500c3.js → index-ddkwkcvn.js} +2 -2
  76. package/dist/{index-c0hffcmj.js → index-dgfah0g8.js} +21 -9
  77. package/dist/index-j1cwtyk1.js +2269 -0
  78. package/dist/index-snef22zr.js +94 -0
  79. package/dist/{index-5p55xreg.js → index-w619fqvv.js} +67 -29
  80. package/llms/agent-runtime.3.txt +4 -0
  81. package/llms/agent-runtime.txt +75 -0
  82. package/llms-full.txt +79 -0
  83. package/llms.txt +1 -1
  84. package/package.json +1 -1
  85. package/dist/index-8ks9b85e.js +0 -129
  86. package/dist/index-d2h99n7d.js +0 -1071
@@ -428,6 +428,96 @@ export declare const AgentStoreTransitionSchema: z.ZodDiscriminatedUnion<[z.ZodO
428
428
  }>;
429
429
  replaySafe: z.ZodOptional<z.ZodBoolean>;
430
430
  }, z.core.$strip>;
431
+ assistant: z.ZodOptional<z.ZodObject<{
432
+ schemaVersion: z.ZodLiteral<1>;
433
+ id: z.ZodString;
434
+ conversationId: z.ZodString;
435
+ runId: z.ZodOptional<z.ZodString>;
436
+ role: z.ZodEnum<{
437
+ assistant: "assistant";
438
+ summary: "summary";
439
+ system: "system";
440
+ tool: "tool";
441
+ user: "user";
442
+ }>;
443
+ status: z.ZodEnum<{
444
+ committed: "committed";
445
+ completed: "completed";
446
+ failed: "failed";
447
+ interrupted: "interrupted";
448
+ streaming: "streaming";
449
+ superseded: "superseded";
450
+ }>;
451
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
452
+ type: z.ZodLiteral<"text">;
453
+ text: z.ZodString;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ type: z.ZodLiteral<"reasoning">;
456
+ text: z.ZodString;
457
+ provider: z.ZodOptional<z.ZodObject<{
458
+ schemaVersion: z.ZodInt;
459
+ provider: z.ZodString;
460
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
461
+ }, z.core.$strip>>;
462
+ }, z.core.$strip>, z.ZodObject<{
463
+ type: z.ZodLiteral<"file">;
464
+ mediaType: z.ZodString;
465
+ reference: z.ZodString;
466
+ filename: z.ZodOptional<z.ZodString>;
467
+ }, z.core.$strip>, z.ZodObject<{
468
+ type: z.ZodLiteral<"source">;
469
+ sourceId: z.ZodString;
470
+ url: z.ZodOptional<z.ZodURL>;
471
+ title: z.ZodOptional<z.ZodString>;
472
+ }, z.core.$strip>, z.ZodObject<{
473
+ type: z.ZodLiteral<"tool-call">;
474
+ callId: z.ZodString;
475
+ toolName: z.ZodString;
476
+ input: z.ZodJSONSchema;
477
+ provider: z.ZodOptional<z.ZodObject<{
478
+ schemaVersion: z.ZodInt;
479
+ provider: z.ZodString;
480
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
481
+ }, z.core.$strip>>;
482
+ }, z.core.$strip>, z.ZodObject<{
483
+ type: z.ZodLiteral<"tool-result">;
484
+ callId: z.ZodString;
485
+ toolName: z.ZodString;
486
+ outcome: z.ZodEnum<{
487
+ error: "error";
488
+ interrupted: "interrupted";
489
+ success: "success";
490
+ }>;
491
+ output: z.ZodOptional<z.ZodJSONSchema>;
492
+ }, z.core.$strip>, z.ZodObject<{
493
+ type: z.ZodLiteral<"tool-approval-request">;
494
+ approvalId: z.ZodString;
495
+ callId: z.ZodString;
496
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
497
+ signature: z.ZodOptional<z.ZodString>;
498
+ }, z.core.$strip>, z.ZodObject<{
499
+ type: z.ZodLiteral<"tool-approval-response">;
500
+ approvalId: z.ZodString;
501
+ approved: z.ZodBoolean;
502
+ reason: z.ZodOptional<z.ZodString>;
503
+ }, z.core.$strip>, z.ZodObject<{
504
+ type: z.ZodLiteral<"provider">;
505
+ envelope: z.ZodObject<{
506
+ schemaVersion: z.ZodInt;
507
+ provider: z.ZodString;
508
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
509
+ }, z.core.$strip>;
510
+ }, z.core.$strip>, z.ZodObject<{
511
+ type: z.ZodLiteral<"control">;
512
+ reason: z.ZodEnum<{
513
+ "run-interrupted": "run-interrupted";
514
+ "stale-run": "stale-run";
515
+ }>;
516
+ }, z.core.$strip>], "type">>;
517
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
518
+ createdAt: z.ZodISODateTime;
519
+ updatedAt: z.ZodISODateTime;
520
+ }, z.core.$strip>>;
431
521
  }, z.core.$strict>, z.ZodObject<{
432
522
  type: z.ZodLiteral<"terminal">;
433
523
  input: z.ZodObject<{
@@ -801,6 +891,1047 @@ export declare const AgentStoreTransitionSchema: z.ZodDiscriminatedUnion<[z.ZodO
801
891
  }, z.core.$strip>;
802
892
  }, z.core.$strict>], "type">;
803
893
  export type AgentStoreTransition = z.infer<typeof AgentStoreTransitionSchema>;
894
+ export declare const AgentStoreCheckpointRecordSchema: z.ZodObject<{
895
+ type: z.ZodLiteral<"checkpoint">;
896
+ input: z.ZodObject<{
897
+ conversationId: z.ZodString;
898
+ runId: z.ZodString;
899
+ expectedRevision: z.ZodInt;
900
+ ownerId: z.ZodString;
901
+ fencingToken: z.ZodOptional<z.ZodInt>;
902
+ assistant: z.ZodObject<{
903
+ id: z.ZodString;
904
+ status: z.ZodLiteral<"streaming">;
905
+ sha256: z.ZodOptional<z.ZodString>;
906
+ sourceSha256: z.ZodOptional<z.ZodString>;
907
+ parts: z.ZodInt;
908
+ bytes: z.ZodInt;
909
+ }, z.core.$strict>;
910
+ usage: z.ZodOptional<z.ZodObject<{
911
+ inputTokens: z.ZodObject<{
912
+ value: z.ZodOptional<z.ZodInt>;
913
+ provenance: z.ZodEnum<{
914
+ computed: "computed";
915
+ estimated: "estimated";
916
+ "provider-reported": "provider-reported";
917
+ unavailable: "unavailable";
918
+ }>;
919
+ }, z.core.$strip>;
920
+ outputTokens: z.ZodObject<{
921
+ value: z.ZodOptional<z.ZodInt>;
922
+ provenance: z.ZodEnum<{
923
+ computed: "computed";
924
+ estimated: "estimated";
925
+ "provider-reported": "provider-reported";
926
+ unavailable: "unavailable";
927
+ }>;
928
+ }, z.core.$strip>;
929
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
930
+ value: z.ZodOptional<z.ZodInt>;
931
+ provenance: z.ZodEnum<{
932
+ computed: "computed";
933
+ estimated: "estimated";
934
+ "provider-reported": "provider-reported";
935
+ unavailable: "unavailable";
936
+ }>;
937
+ }, z.core.$strip>>;
938
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
939
+ value: z.ZodOptional<z.ZodInt>;
940
+ provenance: z.ZodEnum<{
941
+ computed: "computed";
942
+ estimated: "estimated";
943
+ "provider-reported": "provider-reported";
944
+ unavailable: "unavailable";
945
+ }>;
946
+ }, z.core.$strip>>;
947
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
948
+ value: z.ZodOptional<z.ZodInt>;
949
+ provenance: z.ZodEnum<{
950
+ computed: "computed";
951
+ estimated: "estimated";
952
+ "provider-reported": "provider-reported";
953
+ unavailable: "unavailable";
954
+ }>;
955
+ }, z.core.$strip>>;
956
+ cost: z.ZodOptional<z.ZodObject<{
957
+ value: z.ZodOptional<z.ZodNumber>;
958
+ currency: z.ZodOptional<z.ZodString>;
959
+ provenance: z.ZodEnum<{
960
+ computed: "computed";
961
+ estimated: "estimated";
962
+ "provider-reported": "provider-reported";
963
+ unavailable: "unavailable";
964
+ }>;
965
+ }, z.core.$strip>>;
966
+ }, z.core.$strip>>;
967
+ }, z.core.$strict>;
968
+ }, z.core.$strict>;
969
+ /** Persisted journal records: operations and compact hash-only checkpoint observations. */
970
+ export declare const AgentStoreTransitionRecordSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
971
+ type: z.ZodLiteral<"accept">;
972
+ input: z.ZodObject<{
973
+ idempotencyKey: z.ZodString;
974
+ expectedVersion: z.ZodOptional<z.ZodInt>;
975
+ input: z.ZodObject<{
976
+ schemaVersion: z.ZodLiteral<1>;
977
+ id: z.ZodString;
978
+ conversationId: z.ZodString;
979
+ runId: z.ZodOptional<z.ZodString>;
980
+ role: z.ZodEnum<{
981
+ assistant: "assistant";
982
+ summary: "summary";
983
+ system: "system";
984
+ tool: "tool";
985
+ user: "user";
986
+ }>;
987
+ status: z.ZodEnum<{
988
+ committed: "committed";
989
+ completed: "completed";
990
+ failed: "failed";
991
+ interrupted: "interrupted";
992
+ streaming: "streaming";
993
+ superseded: "superseded";
994
+ }>;
995
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
996
+ type: z.ZodLiteral<"text">;
997
+ text: z.ZodString;
998
+ }, z.core.$strip>, z.ZodObject<{
999
+ type: z.ZodLiteral<"reasoning">;
1000
+ text: z.ZodString;
1001
+ provider: z.ZodOptional<z.ZodObject<{
1002
+ schemaVersion: z.ZodInt;
1003
+ provider: z.ZodString;
1004
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1005
+ }, z.core.$strip>>;
1006
+ }, z.core.$strip>, z.ZodObject<{
1007
+ type: z.ZodLiteral<"file">;
1008
+ mediaType: z.ZodString;
1009
+ reference: z.ZodString;
1010
+ filename: z.ZodOptional<z.ZodString>;
1011
+ }, z.core.$strip>, z.ZodObject<{
1012
+ type: z.ZodLiteral<"source">;
1013
+ sourceId: z.ZodString;
1014
+ url: z.ZodOptional<z.ZodURL>;
1015
+ title: z.ZodOptional<z.ZodString>;
1016
+ }, z.core.$strip>, z.ZodObject<{
1017
+ type: z.ZodLiteral<"tool-call">;
1018
+ callId: z.ZodString;
1019
+ toolName: z.ZodString;
1020
+ input: z.ZodJSONSchema;
1021
+ provider: z.ZodOptional<z.ZodObject<{
1022
+ schemaVersion: z.ZodInt;
1023
+ provider: z.ZodString;
1024
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1025
+ }, z.core.$strip>>;
1026
+ }, z.core.$strip>, z.ZodObject<{
1027
+ type: z.ZodLiteral<"tool-result">;
1028
+ callId: z.ZodString;
1029
+ toolName: z.ZodString;
1030
+ outcome: z.ZodEnum<{
1031
+ error: "error";
1032
+ interrupted: "interrupted";
1033
+ success: "success";
1034
+ }>;
1035
+ output: z.ZodOptional<z.ZodJSONSchema>;
1036
+ }, z.core.$strip>, z.ZodObject<{
1037
+ type: z.ZodLiteral<"tool-approval-request">;
1038
+ approvalId: z.ZodString;
1039
+ callId: z.ZodString;
1040
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
1041
+ signature: z.ZodOptional<z.ZodString>;
1042
+ }, z.core.$strip>, z.ZodObject<{
1043
+ type: z.ZodLiteral<"tool-approval-response">;
1044
+ approvalId: z.ZodString;
1045
+ approved: z.ZodBoolean;
1046
+ reason: z.ZodOptional<z.ZodString>;
1047
+ }, z.core.$strip>, z.ZodObject<{
1048
+ type: z.ZodLiteral<"provider">;
1049
+ envelope: z.ZodObject<{
1050
+ schemaVersion: z.ZodInt;
1051
+ provider: z.ZodString;
1052
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1053
+ }, z.core.$strip>;
1054
+ }, z.core.$strip>, z.ZodObject<{
1055
+ type: z.ZodLiteral<"control">;
1056
+ reason: z.ZodEnum<{
1057
+ "run-interrupted": "run-interrupted";
1058
+ "stale-run": "stale-run";
1059
+ }>;
1060
+ }, z.core.$strip>], "type">>;
1061
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1062
+ createdAt: z.ZodISODateTime;
1063
+ updatedAt: z.ZodISODateTime;
1064
+ }, z.core.$strip>;
1065
+ run: z.ZodObject<{
1066
+ schemaVersion: z.ZodLiteral<1>;
1067
+ id: z.ZodString;
1068
+ conversationId: z.ZodString;
1069
+ inputMessageIds: z.ZodArray<z.ZodString>;
1070
+ assistantMessageId: z.ZodString;
1071
+ state: z.ZodEnum<{
1072
+ abandoned: "abandoned";
1073
+ cancelled: "cancelled";
1074
+ completed: "completed";
1075
+ failed: "failed";
1076
+ interrupt_requested: "interrupt_requested";
1077
+ interrupted: "interrupted";
1078
+ queued: "queued";
1079
+ running: "running";
1080
+ superseded: "superseded";
1081
+ }>;
1082
+ revision: z.ZodInt;
1083
+ queuePriority: z.ZodOptional<z.ZodEnum<{
1084
+ "interrupt-next": "interrupt-next";
1085
+ }>>;
1086
+ executionSequence: z.ZodOptional<z.ZodInt>;
1087
+ ownerId: z.ZodOptional<z.ZodString>;
1088
+ fencingToken: z.ZodOptional<z.ZodInt>;
1089
+ terminalReason: z.ZodOptional<z.ZodEnum<{
1090
+ abandoned: "abandoned";
1091
+ absorbed: "absorbed";
1092
+ cancelled: "cancelled";
1093
+ context_overflow: "context_overflow";
1094
+ interrupted: "interrupted";
1095
+ output_rejected: "output_rejected";
1096
+ policy_stop: "policy_stop";
1097
+ provider_failure: "provider_failure";
1098
+ provider_stop: "provider_stop";
1099
+ runtime_failure: "runtime_failure";
1100
+ shutdown: "shutdown";
1101
+ storage_conflict: "storage_conflict";
1102
+ success: "success";
1103
+ superseded: "superseded";
1104
+ timeout: "timeout";
1105
+ }>>;
1106
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
1107
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
1108
+ usage: z.ZodOptional<z.ZodObject<{
1109
+ inputTokens: z.ZodObject<{
1110
+ value: z.ZodOptional<z.ZodInt>;
1111
+ provenance: z.ZodEnum<{
1112
+ computed: "computed";
1113
+ estimated: "estimated";
1114
+ "provider-reported": "provider-reported";
1115
+ unavailable: "unavailable";
1116
+ }>;
1117
+ }, z.core.$strip>;
1118
+ outputTokens: z.ZodObject<{
1119
+ value: z.ZodOptional<z.ZodInt>;
1120
+ provenance: z.ZodEnum<{
1121
+ computed: "computed";
1122
+ estimated: "estimated";
1123
+ "provider-reported": "provider-reported";
1124
+ unavailable: "unavailable";
1125
+ }>;
1126
+ }, z.core.$strip>;
1127
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1128
+ value: z.ZodOptional<z.ZodInt>;
1129
+ provenance: z.ZodEnum<{
1130
+ computed: "computed";
1131
+ estimated: "estimated";
1132
+ "provider-reported": "provider-reported";
1133
+ unavailable: "unavailable";
1134
+ }>;
1135
+ }, z.core.$strip>>;
1136
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1137
+ value: z.ZodOptional<z.ZodInt>;
1138
+ provenance: z.ZodEnum<{
1139
+ computed: "computed";
1140
+ estimated: "estimated";
1141
+ "provider-reported": "provider-reported";
1142
+ unavailable: "unavailable";
1143
+ }>;
1144
+ }, z.core.$strip>>;
1145
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1146
+ value: z.ZodOptional<z.ZodInt>;
1147
+ provenance: z.ZodEnum<{
1148
+ computed: "computed";
1149
+ estimated: "estimated";
1150
+ "provider-reported": "provider-reported";
1151
+ unavailable: "unavailable";
1152
+ }>;
1153
+ }, z.core.$strip>>;
1154
+ cost: z.ZodOptional<z.ZodObject<{
1155
+ value: z.ZodOptional<z.ZodNumber>;
1156
+ currency: z.ZodOptional<z.ZodString>;
1157
+ provenance: z.ZodEnum<{
1158
+ computed: "computed";
1159
+ estimated: "estimated";
1160
+ "provider-reported": "provider-reported";
1161
+ unavailable: "unavailable";
1162
+ }>;
1163
+ }, z.core.$strip>>;
1164
+ }, z.core.$strip>>;
1165
+ lastOperation: z.ZodOptional<z.ZodObject<{
1166
+ operationId: z.ZodString;
1167
+ kind: z.ZodEnum<{
1168
+ compaction: "compaction";
1169
+ "model-request": "model-request";
1170
+ }>;
1171
+ phase: z.ZodEnum<{
1172
+ cancelled: "cancelled";
1173
+ completed: "completed";
1174
+ failed: "failed";
1175
+ "first-output": "first-output";
1176
+ started: "started";
1177
+ }>;
1178
+ step: z.ZodOptional<z.ZodInt>;
1179
+ startedAt: z.ZodISODateTime;
1180
+ firstOutputAt: z.ZodOptional<z.ZodISODateTime>;
1181
+ finishedAt: z.ZodOptional<z.ZodISODateTime>;
1182
+ }, z.core.$strip>>;
1183
+ createdAt: z.ZodISODateTime;
1184
+ updatedAt: z.ZodISODateTime;
1185
+ }, z.core.$strip>;
1186
+ coalesceIntoRunId: z.ZodOptional<z.ZodString>;
1187
+ }, z.core.$strip>;
1188
+ }, z.core.$strict>, z.ZodObject<{
1189
+ type: z.ZodLiteral<"acquire">;
1190
+ input: z.ZodObject<{
1191
+ conversationId: z.ZodString;
1192
+ runId: z.ZodString;
1193
+ expectedRevision: z.ZodInt;
1194
+ ownerId: z.ZodString;
1195
+ }, z.core.$strip>;
1196
+ }, z.core.$strict>, z.ZodObject<{
1197
+ type: z.ZodLiteral<"checkpoint">;
1198
+ input: z.ZodObject<{
1199
+ conversationId: z.ZodString;
1200
+ runId: z.ZodString;
1201
+ expectedRevision: z.ZodInt;
1202
+ ownerId: z.ZodString;
1203
+ fencingToken: z.ZodOptional<z.ZodInt>;
1204
+ assistant: z.ZodObject<{
1205
+ schemaVersion: z.ZodLiteral<1>;
1206
+ id: z.ZodString;
1207
+ conversationId: z.ZodString;
1208
+ runId: z.ZodOptional<z.ZodString>;
1209
+ role: z.ZodEnum<{
1210
+ assistant: "assistant";
1211
+ summary: "summary";
1212
+ system: "system";
1213
+ tool: "tool";
1214
+ user: "user";
1215
+ }>;
1216
+ status: z.ZodEnum<{
1217
+ committed: "committed";
1218
+ completed: "completed";
1219
+ failed: "failed";
1220
+ interrupted: "interrupted";
1221
+ streaming: "streaming";
1222
+ superseded: "superseded";
1223
+ }>;
1224
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1225
+ type: z.ZodLiteral<"text">;
1226
+ text: z.ZodString;
1227
+ }, z.core.$strip>, z.ZodObject<{
1228
+ type: z.ZodLiteral<"reasoning">;
1229
+ text: z.ZodString;
1230
+ provider: z.ZodOptional<z.ZodObject<{
1231
+ schemaVersion: z.ZodInt;
1232
+ provider: z.ZodString;
1233
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1234
+ }, z.core.$strip>>;
1235
+ }, z.core.$strip>, z.ZodObject<{
1236
+ type: z.ZodLiteral<"file">;
1237
+ mediaType: z.ZodString;
1238
+ reference: z.ZodString;
1239
+ filename: z.ZodOptional<z.ZodString>;
1240
+ }, z.core.$strip>, z.ZodObject<{
1241
+ type: z.ZodLiteral<"source">;
1242
+ sourceId: z.ZodString;
1243
+ url: z.ZodOptional<z.ZodURL>;
1244
+ title: z.ZodOptional<z.ZodString>;
1245
+ }, z.core.$strip>, z.ZodObject<{
1246
+ type: z.ZodLiteral<"tool-call">;
1247
+ callId: z.ZodString;
1248
+ toolName: z.ZodString;
1249
+ input: z.ZodJSONSchema;
1250
+ provider: z.ZodOptional<z.ZodObject<{
1251
+ schemaVersion: z.ZodInt;
1252
+ provider: z.ZodString;
1253
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1254
+ }, z.core.$strip>>;
1255
+ }, z.core.$strip>, z.ZodObject<{
1256
+ type: z.ZodLiteral<"tool-result">;
1257
+ callId: z.ZodString;
1258
+ toolName: z.ZodString;
1259
+ outcome: z.ZodEnum<{
1260
+ error: "error";
1261
+ interrupted: "interrupted";
1262
+ success: "success";
1263
+ }>;
1264
+ output: z.ZodOptional<z.ZodJSONSchema>;
1265
+ }, z.core.$strip>, z.ZodObject<{
1266
+ type: z.ZodLiteral<"tool-approval-request">;
1267
+ approvalId: z.ZodString;
1268
+ callId: z.ZodString;
1269
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
1270
+ signature: z.ZodOptional<z.ZodString>;
1271
+ }, z.core.$strip>, z.ZodObject<{
1272
+ type: z.ZodLiteral<"tool-approval-response">;
1273
+ approvalId: z.ZodString;
1274
+ approved: z.ZodBoolean;
1275
+ reason: z.ZodOptional<z.ZodString>;
1276
+ }, z.core.$strip>, z.ZodObject<{
1277
+ type: z.ZodLiteral<"provider">;
1278
+ envelope: z.ZodObject<{
1279
+ schemaVersion: z.ZodInt;
1280
+ provider: z.ZodString;
1281
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1282
+ }, z.core.$strip>;
1283
+ }, z.core.$strip>, z.ZodObject<{
1284
+ type: z.ZodLiteral<"control">;
1285
+ reason: z.ZodEnum<{
1286
+ "run-interrupted": "run-interrupted";
1287
+ "stale-run": "stale-run";
1288
+ }>;
1289
+ }, z.core.$strip>], "type">>;
1290
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1291
+ createdAt: z.ZodISODateTime;
1292
+ updatedAt: z.ZodISODateTime;
1293
+ }, z.core.$strip>;
1294
+ usage: z.ZodOptional<z.ZodObject<{
1295
+ inputTokens: z.ZodObject<{
1296
+ value: z.ZodOptional<z.ZodInt>;
1297
+ provenance: z.ZodEnum<{
1298
+ computed: "computed";
1299
+ estimated: "estimated";
1300
+ "provider-reported": "provider-reported";
1301
+ unavailable: "unavailable";
1302
+ }>;
1303
+ }, z.core.$strip>;
1304
+ outputTokens: z.ZodObject<{
1305
+ value: z.ZodOptional<z.ZodInt>;
1306
+ provenance: z.ZodEnum<{
1307
+ computed: "computed";
1308
+ estimated: "estimated";
1309
+ "provider-reported": "provider-reported";
1310
+ unavailable: "unavailable";
1311
+ }>;
1312
+ }, z.core.$strip>;
1313
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1314
+ value: z.ZodOptional<z.ZodInt>;
1315
+ provenance: z.ZodEnum<{
1316
+ computed: "computed";
1317
+ estimated: "estimated";
1318
+ "provider-reported": "provider-reported";
1319
+ unavailable: "unavailable";
1320
+ }>;
1321
+ }, z.core.$strip>>;
1322
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1323
+ value: z.ZodOptional<z.ZodInt>;
1324
+ provenance: z.ZodEnum<{
1325
+ computed: "computed";
1326
+ estimated: "estimated";
1327
+ "provider-reported": "provider-reported";
1328
+ unavailable: "unavailable";
1329
+ }>;
1330
+ }, z.core.$strip>>;
1331
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1332
+ value: z.ZodOptional<z.ZodInt>;
1333
+ provenance: z.ZodEnum<{
1334
+ computed: "computed";
1335
+ estimated: "estimated";
1336
+ "provider-reported": "provider-reported";
1337
+ unavailable: "unavailable";
1338
+ }>;
1339
+ }, z.core.$strip>>;
1340
+ cost: z.ZodOptional<z.ZodObject<{
1341
+ value: z.ZodOptional<z.ZodNumber>;
1342
+ currency: z.ZodOptional<z.ZodString>;
1343
+ provenance: z.ZodEnum<{
1344
+ computed: "computed";
1345
+ estimated: "estimated";
1346
+ "provider-reported": "provider-reported";
1347
+ unavailable: "unavailable";
1348
+ }>;
1349
+ }, z.core.$strip>>;
1350
+ }, z.core.$strip>>;
1351
+ }, z.core.$strip>;
1352
+ }, z.core.$strict>, z.ZodObject<{
1353
+ type: z.ZodLiteral<"operation">;
1354
+ input: z.ZodObject<{
1355
+ conversationId: z.ZodString;
1356
+ runId: z.ZodString;
1357
+ expectedRevision: z.ZodInt;
1358
+ ownerId: z.ZodString;
1359
+ fencingToken: z.ZodOptional<z.ZodInt>;
1360
+ operation: z.ZodObject<{
1361
+ operationId: z.ZodString;
1362
+ kind: z.ZodEnum<{
1363
+ compaction: "compaction";
1364
+ "model-request": "model-request";
1365
+ }>;
1366
+ phase: z.ZodEnum<{
1367
+ cancelled: "cancelled";
1368
+ completed: "completed";
1369
+ failed: "failed";
1370
+ "first-output": "first-output";
1371
+ started: "started";
1372
+ }>;
1373
+ step: z.ZodOptional<z.ZodInt>;
1374
+ startedAt: z.ZodISODateTime;
1375
+ firstOutputAt: z.ZodOptional<z.ZodISODateTime>;
1376
+ finishedAt: z.ZodOptional<z.ZodISODateTime>;
1377
+ }, z.core.$strip>;
1378
+ }, z.core.$strip>;
1379
+ }, z.core.$strict>, z.ZodObject<{
1380
+ type: z.ZodLiteral<"interrupt">;
1381
+ input: z.ZodObject<{
1382
+ conversationId: z.ZodString;
1383
+ runId: z.ZodString;
1384
+ expectedRevision: z.ZodInt;
1385
+ }, z.core.$strip>;
1386
+ }, z.core.$strict>, z.ZodObject<{
1387
+ type: z.ZodLiteral<"recover">;
1388
+ input: z.ZodObject<{
1389
+ conversationId: z.ZodString;
1390
+ runId: z.ZodString;
1391
+ expectedRevision: z.ZodInt;
1392
+ action: z.ZodEnum<{
1393
+ abandon: "abandon";
1394
+ requeue: "requeue";
1395
+ }>;
1396
+ replaySafe: z.ZodOptional<z.ZodBoolean>;
1397
+ }, z.core.$strip>;
1398
+ assistant: z.ZodOptional<z.ZodObject<{
1399
+ schemaVersion: z.ZodLiteral<1>;
1400
+ id: z.ZodString;
1401
+ conversationId: z.ZodString;
1402
+ runId: z.ZodOptional<z.ZodString>;
1403
+ role: z.ZodEnum<{
1404
+ assistant: "assistant";
1405
+ summary: "summary";
1406
+ system: "system";
1407
+ tool: "tool";
1408
+ user: "user";
1409
+ }>;
1410
+ status: z.ZodEnum<{
1411
+ committed: "committed";
1412
+ completed: "completed";
1413
+ failed: "failed";
1414
+ interrupted: "interrupted";
1415
+ streaming: "streaming";
1416
+ superseded: "superseded";
1417
+ }>;
1418
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1419
+ type: z.ZodLiteral<"text">;
1420
+ text: z.ZodString;
1421
+ }, z.core.$strip>, z.ZodObject<{
1422
+ type: z.ZodLiteral<"reasoning">;
1423
+ text: z.ZodString;
1424
+ provider: z.ZodOptional<z.ZodObject<{
1425
+ schemaVersion: z.ZodInt;
1426
+ provider: z.ZodString;
1427
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1428
+ }, z.core.$strip>>;
1429
+ }, z.core.$strip>, z.ZodObject<{
1430
+ type: z.ZodLiteral<"file">;
1431
+ mediaType: z.ZodString;
1432
+ reference: z.ZodString;
1433
+ filename: z.ZodOptional<z.ZodString>;
1434
+ }, z.core.$strip>, z.ZodObject<{
1435
+ type: z.ZodLiteral<"source">;
1436
+ sourceId: z.ZodString;
1437
+ url: z.ZodOptional<z.ZodURL>;
1438
+ title: z.ZodOptional<z.ZodString>;
1439
+ }, z.core.$strip>, z.ZodObject<{
1440
+ type: z.ZodLiteral<"tool-call">;
1441
+ callId: z.ZodString;
1442
+ toolName: z.ZodString;
1443
+ input: z.ZodJSONSchema;
1444
+ provider: z.ZodOptional<z.ZodObject<{
1445
+ schemaVersion: z.ZodInt;
1446
+ provider: z.ZodString;
1447
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1448
+ }, z.core.$strip>>;
1449
+ }, z.core.$strip>, z.ZodObject<{
1450
+ type: z.ZodLiteral<"tool-result">;
1451
+ callId: z.ZodString;
1452
+ toolName: z.ZodString;
1453
+ outcome: z.ZodEnum<{
1454
+ error: "error";
1455
+ interrupted: "interrupted";
1456
+ success: "success";
1457
+ }>;
1458
+ output: z.ZodOptional<z.ZodJSONSchema>;
1459
+ }, z.core.$strip>, z.ZodObject<{
1460
+ type: z.ZodLiteral<"tool-approval-request">;
1461
+ approvalId: z.ZodString;
1462
+ callId: z.ZodString;
1463
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
1464
+ signature: z.ZodOptional<z.ZodString>;
1465
+ }, z.core.$strip>, z.ZodObject<{
1466
+ type: z.ZodLiteral<"tool-approval-response">;
1467
+ approvalId: z.ZodString;
1468
+ approved: z.ZodBoolean;
1469
+ reason: z.ZodOptional<z.ZodString>;
1470
+ }, z.core.$strip>, z.ZodObject<{
1471
+ type: z.ZodLiteral<"provider">;
1472
+ envelope: z.ZodObject<{
1473
+ schemaVersion: z.ZodInt;
1474
+ provider: z.ZodString;
1475
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1476
+ }, z.core.$strip>;
1477
+ }, z.core.$strip>, z.ZodObject<{
1478
+ type: z.ZodLiteral<"control">;
1479
+ reason: z.ZodEnum<{
1480
+ "run-interrupted": "run-interrupted";
1481
+ "stale-run": "stale-run";
1482
+ }>;
1483
+ }, z.core.$strip>], "type">>;
1484
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1485
+ createdAt: z.ZodISODateTime;
1486
+ updatedAt: z.ZodISODateTime;
1487
+ }, z.core.$strip>>;
1488
+ }, z.core.$strict>, z.ZodObject<{
1489
+ type: z.ZodLiteral<"terminal">;
1490
+ input: z.ZodObject<{
1491
+ conversationId: z.ZodString;
1492
+ runId: z.ZodString;
1493
+ expectedRevision: z.ZodInt;
1494
+ ownerId: z.ZodString;
1495
+ fencingToken: z.ZodOptional<z.ZodInt>;
1496
+ assistant: z.ZodObject<{
1497
+ schemaVersion: z.ZodLiteral<1>;
1498
+ id: z.ZodString;
1499
+ conversationId: z.ZodString;
1500
+ runId: z.ZodOptional<z.ZodString>;
1501
+ role: z.ZodEnum<{
1502
+ assistant: "assistant";
1503
+ summary: "summary";
1504
+ system: "system";
1505
+ tool: "tool";
1506
+ user: "user";
1507
+ }>;
1508
+ status: z.ZodEnum<{
1509
+ committed: "committed";
1510
+ completed: "completed";
1511
+ failed: "failed";
1512
+ interrupted: "interrupted";
1513
+ streaming: "streaming";
1514
+ superseded: "superseded";
1515
+ }>;
1516
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1517
+ type: z.ZodLiteral<"text">;
1518
+ text: z.ZodString;
1519
+ }, z.core.$strip>, z.ZodObject<{
1520
+ type: z.ZodLiteral<"reasoning">;
1521
+ text: z.ZodString;
1522
+ provider: z.ZodOptional<z.ZodObject<{
1523
+ schemaVersion: z.ZodInt;
1524
+ provider: z.ZodString;
1525
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1526
+ }, z.core.$strip>>;
1527
+ }, z.core.$strip>, z.ZodObject<{
1528
+ type: z.ZodLiteral<"file">;
1529
+ mediaType: z.ZodString;
1530
+ reference: z.ZodString;
1531
+ filename: z.ZodOptional<z.ZodString>;
1532
+ }, z.core.$strip>, z.ZodObject<{
1533
+ type: z.ZodLiteral<"source">;
1534
+ sourceId: z.ZodString;
1535
+ url: z.ZodOptional<z.ZodURL>;
1536
+ title: z.ZodOptional<z.ZodString>;
1537
+ }, z.core.$strip>, z.ZodObject<{
1538
+ type: z.ZodLiteral<"tool-call">;
1539
+ callId: z.ZodString;
1540
+ toolName: z.ZodString;
1541
+ input: z.ZodJSONSchema;
1542
+ provider: z.ZodOptional<z.ZodObject<{
1543
+ schemaVersion: z.ZodInt;
1544
+ provider: z.ZodString;
1545
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1546
+ }, z.core.$strip>>;
1547
+ }, z.core.$strip>, z.ZodObject<{
1548
+ type: z.ZodLiteral<"tool-result">;
1549
+ callId: z.ZodString;
1550
+ toolName: z.ZodString;
1551
+ outcome: z.ZodEnum<{
1552
+ error: "error";
1553
+ interrupted: "interrupted";
1554
+ success: "success";
1555
+ }>;
1556
+ output: z.ZodOptional<z.ZodJSONSchema>;
1557
+ }, z.core.$strip>, z.ZodObject<{
1558
+ type: z.ZodLiteral<"tool-approval-request">;
1559
+ approvalId: z.ZodString;
1560
+ callId: z.ZodString;
1561
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
1562
+ signature: z.ZodOptional<z.ZodString>;
1563
+ }, z.core.$strip>, z.ZodObject<{
1564
+ type: z.ZodLiteral<"tool-approval-response">;
1565
+ approvalId: z.ZodString;
1566
+ approved: z.ZodBoolean;
1567
+ reason: z.ZodOptional<z.ZodString>;
1568
+ }, z.core.$strip>, z.ZodObject<{
1569
+ type: z.ZodLiteral<"provider">;
1570
+ envelope: z.ZodObject<{
1571
+ schemaVersion: z.ZodInt;
1572
+ provider: z.ZodString;
1573
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1574
+ }, z.core.$strip>;
1575
+ }, z.core.$strip>, z.ZodObject<{
1576
+ type: z.ZodLiteral<"control">;
1577
+ reason: z.ZodEnum<{
1578
+ "run-interrupted": "run-interrupted";
1579
+ "stale-run": "stale-run";
1580
+ }>;
1581
+ }, z.core.$strip>], "type">>;
1582
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1583
+ createdAt: z.ZodISODateTime;
1584
+ updatedAt: z.ZodISODateTime;
1585
+ }, z.core.$strip>;
1586
+ reason: z.ZodEnum<{
1587
+ abandoned: "abandoned";
1588
+ absorbed: "absorbed";
1589
+ cancelled: "cancelled";
1590
+ context_overflow: "context_overflow";
1591
+ interrupted: "interrupted";
1592
+ output_rejected: "output_rejected";
1593
+ policy_stop: "policy_stop";
1594
+ provider_failure: "provider_failure";
1595
+ provider_stop: "provider_stop";
1596
+ runtime_failure: "runtime_failure";
1597
+ shutdown: "shutdown";
1598
+ storage_conflict: "storage_conflict";
1599
+ success: "success";
1600
+ superseded: "superseded";
1601
+ timeout: "timeout";
1602
+ }>;
1603
+ policyName: z.ZodOptional<z.ZodString>;
1604
+ usage: z.ZodOptional<z.ZodObject<{
1605
+ inputTokens: z.ZodObject<{
1606
+ value: z.ZodOptional<z.ZodInt>;
1607
+ provenance: z.ZodEnum<{
1608
+ computed: "computed";
1609
+ estimated: "estimated";
1610
+ "provider-reported": "provider-reported";
1611
+ unavailable: "unavailable";
1612
+ }>;
1613
+ }, z.core.$strip>;
1614
+ outputTokens: z.ZodObject<{
1615
+ value: z.ZodOptional<z.ZodInt>;
1616
+ provenance: z.ZodEnum<{
1617
+ computed: "computed";
1618
+ estimated: "estimated";
1619
+ "provider-reported": "provider-reported";
1620
+ unavailable: "unavailable";
1621
+ }>;
1622
+ }, z.core.$strip>;
1623
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1624
+ value: z.ZodOptional<z.ZodInt>;
1625
+ provenance: z.ZodEnum<{
1626
+ computed: "computed";
1627
+ estimated: "estimated";
1628
+ "provider-reported": "provider-reported";
1629
+ unavailable: "unavailable";
1630
+ }>;
1631
+ }, z.core.$strip>>;
1632
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1633
+ value: z.ZodOptional<z.ZodInt>;
1634
+ provenance: z.ZodEnum<{
1635
+ computed: "computed";
1636
+ estimated: "estimated";
1637
+ "provider-reported": "provider-reported";
1638
+ unavailable: "unavailable";
1639
+ }>;
1640
+ }, z.core.$strip>>;
1641
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1642
+ value: z.ZodOptional<z.ZodInt>;
1643
+ provenance: z.ZodEnum<{
1644
+ computed: "computed";
1645
+ estimated: "estimated";
1646
+ "provider-reported": "provider-reported";
1647
+ unavailable: "unavailable";
1648
+ }>;
1649
+ }, z.core.$strip>>;
1650
+ cost: z.ZodOptional<z.ZodObject<{
1651
+ value: z.ZodOptional<z.ZodNumber>;
1652
+ currency: z.ZodOptional<z.ZodString>;
1653
+ provenance: z.ZodEnum<{
1654
+ computed: "computed";
1655
+ estimated: "estimated";
1656
+ "provider-reported": "provider-reported";
1657
+ unavailable: "unavailable";
1658
+ }>;
1659
+ }, z.core.$strip>>;
1660
+ }, z.core.$strip>>;
1661
+ absorb: z.ZodOptional<z.ZodArray<z.ZodObject<{
1662
+ runId: z.ZodString;
1663
+ inputMessageIds: z.ZodArray<z.ZodString>;
1664
+ }, z.core.$strip>>>;
1665
+ }, z.core.$strip>;
1666
+ }, z.core.$strict>, z.ZodObject<{
1667
+ type: z.ZodLiteral<"compact">;
1668
+ input: z.ZodObject<{
1669
+ conversationId: z.ZodString;
1670
+ expectedVersion: z.ZodInt;
1671
+ replacedMessageIds: z.ZodArray<z.ZodString>;
1672
+ summary: z.ZodObject<{
1673
+ schemaVersion: z.ZodLiteral<1>;
1674
+ id: z.ZodString;
1675
+ conversationId: z.ZodString;
1676
+ runId: z.ZodOptional<z.ZodString>;
1677
+ role: z.ZodEnum<{
1678
+ assistant: "assistant";
1679
+ summary: "summary";
1680
+ system: "system";
1681
+ tool: "tool";
1682
+ user: "user";
1683
+ }>;
1684
+ status: z.ZodEnum<{
1685
+ committed: "committed";
1686
+ completed: "completed";
1687
+ failed: "failed";
1688
+ interrupted: "interrupted";
1689
+ streaming: "streaming";
1690
+ superseded: "superseded";
1691
+ }>;
1692
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1693
+ type: z.ZodLiteral<"text">;
1694
+ text: z.ZodString;
1695
+ }, z.core.$strip>, z.ZodObject<{
1696
+ type: z.ZodLiteral<"reasoning">;
1697
+ text: z.ZodString;
1698
+ provider: z.ZodOptional<z.ZodObject<{
1699
+ schemaVersion: z.ZodInt;
1700
+ provider: z.ZodString;
1701
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1702
+ }, z.core.$strip>>;
1703
+ }, z.core.$strip>, z.ZodObject<{
1704
+ type: z.ZodLiteral<"file">;
1705
+ mediaType: z.ZodString;
1706
+ reference: z.ZodString;
1707
+ filename: z.ZodOptional<z.ZodString>;
1708
+ }, z.core.$strip>, z.ZodObject<{
1709
+ type: z.ZodLiteral<"source">;
1710
+ sourceId: z.ZodString;
1711
+ url: z.ZodOptional<z.ZodURL>;
1712
+ title: z.ZodOptional<z.ZodString>;
1713
+ }, z.core.$strip>, z.ZodObject<{
1714
+ type: z.ZodLiteral<"tool-call">;
1715
+ callId: z.ZodString;
1716
+ toolName: z.ZodString;
1717
+ input: z.ZodJSONSchema;
1718
+ provider: z.ZodOptional<z.ZodObject<{
1719
+ schemaVersion: z.ZodInt;
1720
+ provider: z.ZodString;
1721
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1722
+ }, z.core.$strip>>;
1723
+ }, z.core.$strip>, z.ZodObject<{
1724
+ type: z.ZodLiteral<"tool-result">;
1725
+ callId: z.ZodString;
1726
+ toolName: z.ZodString;
1727
+ outcome: z.ZodEnum<{
1728
+ error: "error";
1729
+ interrupted: "interrupted";
1730
+ success: "success";
1731
+ }>;
1732
+ output: z.ZodOptional<z.ZodJSONSchema>;
1733
+ }, z.core.$strip>, z.ZodObject<{
1734
+ type: z.ZodLiteral<"tool-approval-request">;
1735
+ approvalId: z.ZodString;
1736
+ callId: z.ZodString;
1737
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
1738
+ signature: z.ZodOptional<z.ZodString>;
1739
+ }, z.core.$strip>, z.ZodObject<{
1740
+ type: z.ZodLiteral<"tool-approval-response">;
1741
+ approvalId: z.ZodString;
1742
+ approved: z.ZodBoolean;
1743
+ reason: z.ZodOptional<z.ZodString>;
1744
+ }, z.core.$strip>, z.ZodObject<{
1745
+ type: z.ZodLiteral<"provider">;
1746
+ envelope: z.ZodObject<{
1747
+ schemaVersion: z.ZodInt;
1748
+ provider: z.ZodString;
1749
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1750
+ }, z.core.$strip>;
1751
+ }, z.core.$strip>, z.ZodObject<{
1752
+ type: z.ZodLiteral<"control">;
1753
+ reason: z.ZodEnum<{
1754
+ "run-interrupted": "run-interrupted";
1755
+ "stale-run": "stale-run";
1756
+ }>;
1757
+ }, z.core.$strip>], "type">>;
1758
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1759
+ createdAt: z.ZodISODateTime;
1760
+ updatedAt: z.ZodISODateTime;
1761
+ }, z.core.$strip>;
1762
+ }, z.core.$strip>;
1763
+ }, z.core.$strict>, z.ZodObject<{
1764
+ type: z.ZodLiteral<"seed">;
1765
+ input: z.ZodObject<{
1766
+ conversationId: z.ZodString;
1767
+ seedKey: z.ZodString;
1768
+ inputs: z.ZodArray<z.ZodObject<{
1769
+ schemaVersion: z.ZodLiteral<1>;
1770
+ id: z.ZodString;
1771
+ conversationId: z.ZodString;
1772
+ runId: z.ZodOptional<z.ZodString>;
1773
+ role: z.ZodEnum<{
1774
+ assistant: "assistant";
1775
+ summary: "summary";
1776
+ system: "system";
1777
+ tool: "tool";
1778
+ user: "user";
1779
+ }>;
1780
+ status: z.ZodEnum<{
1781
+ committed: "committed";
1782
+ completed: "completed";
1783
+ failed: "failed";
1784
+ interrupted: "interrupted";
1785
+ streaming: "streaming";
1786
+ superseded: "superseded";
1787
+ }>;
1788
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1789
+ type: z.ZodLiteral<"text">;
1790
+ text: z.ZodString;
1791
+ }, z.core.$strip>, z.ZodObject<{
1792
+ type: z.ZodLiteral<"reasoning">;
1793
+ text: z.ZodString;
1794
+ provider: z.ZodOptional<z.ZodObject<{
1795
+ schemaVersion: z.ZodInt;
1796
+ provider: z.ZodString;
1797
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1798
+ }, z.core.$strip>>;
1799
+ }, z.core.$strip>, z.ZodObject<{
1800
+ type: z.ZodLiteral<"file">;
1801
+ mediaType: z.ZodString;
1802
+ reference: z.ZodString;
1803
+ filename: z.ZodOptional<z.ZodString>;
1804
+ }, z.core.$strip>, z.ZodObject<{
1805
+ type: z.ZodLiteral<"source">;
1806
+ sourceId: z.ZodString;
1807
+ url: z.ZodOptional<z.ZodURL>;
1808
+ title: z.ZodOptional<z.ZodString>;
1809
+ }, z.core.$strip>, z.ZodObject<{
1810
+ type: z.ZodLiteral<"tool-call">;
1811
+ callId: z.ZodString;
1812
+ toolName: z.ZodString;
1813
+ input: z.ZodJSONSchema;
1814
+ provider: z.ZodOptional<z.ZodObject<{
1815
+ schemaVersion: z.ZodInt;
1816
+ provider: z.ZodString;
1817
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1818
+ }, z.core.$strip>>;
1819
+ }, z.core.$strip>, z.ZodObject<{
1820
+ type: z.ZodLiteral<"tool-result">;
1821
+ callId: z.ZodString;
1822
+ toolName: z.ZodString;
1823
+ outcome: z.ZodEnum<{
1824
+ error: "error";
1825
+ interrupted: "interrupted";
1826
+ success: "success";
1827
+ }>;
1828
+ output: z.ZodOptional<z.ZodJSONSchema>;
1829
+ }, z.core.$strip>, z.ZodObject<{
1830
+ type: z.ZodLiteral<"tool-approval-request">;
1831
+ approvalId: z.ZodString;
1832
+ callId: z.ZodString;
1833
+ isAutomatic: z.ZodOptional<z.ZodBoolean>;
1834
+ signature: z.ZodOptional<z.ZodString>;
1835
+ }, z.core.$strip>, z.ZodObject<{
1836
+ type: z.ZodLiteral<"tool-approval-response">;
1837
+ approvalId: z.ZodString;
1838
+ approved: z.ZodBoolean;
1839
+ reason: z.ZodOptional<z.ZodString>;
1840
+ }, z.core.$strip>, z.ZodObject<{
1841
+ type: z.ZodLiteral<"provider">;
1842
+ envelope: z.ZodObject<{
1843
+ schemaVersion: z.ZodInt;
1844
+ provider: z.ZodString;
1845
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1846
+ }, z.core.$strip>;
1847
+ }, z.core.$strip>, z.ZodObject<{
1848
+ type: z.ZodLiteral<"control">;
1849
+ reason: z.ZodEnum<{
1850
+ "run-interrupted": "run-interrupted";
1851
+ "stale-run": "stale-run";
1852
+ }>;
1853
+ }, z.core.$strip>], "type">>;
1854
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1855
+ createdAt: z.ZodISODateTime;
1856
+ updatedAt: z.ZodISODateTime;
1857
+ }, z.core.$strip>>;
1858
+ }, z.core.$strip>;
1859
+ }, z.core.$strict>], "type">, z.ZodObject<{
1860
+ type: z.ZodLiteral<"checkpoint">;
1861
+ input: z.ZodObject<{
1862
+ conversationId: z.ZodString;
1863
+ runId: z.ZodString;
1864
+ expectedRevision: z.ZodInt;
1865
+ ownerId: z.ZodString;
1866
+ fencingToken: z.ZodOptional<z.ZodInt>;
1867
+ assistant: z.ZodObject<{
1868
+ id: z.ZodString;
1869
+ status: z.ZodLiteral<"streaming">;
1870
+ sha256: z.ZodOptional<z.ZodString>;
1871
+ sourceSha256: z.ZodOptional<z.ZodString>;
1872
+ parts: z.ZodInt;
1873
+ bytes: z.ZodInt;
1874
+ }, z.core.$strict>;
1875
+ usage: z.ZodOptional<z.ZodObject<{
1876
+ inputTokens: z.ZodObject<{
1877
+ value: z.ZodOptional<z.ZodInt>;
1878
+ provenance: z.ZodEnum<{
1879
+ computed: "computed";
1880
+ estimated: "estimated";
1881
+ "provider-reported": "provider-reported";
1882
+ unavailable: "unavailable";
1883
+ }>;
1884
+ }, z.core.$strip>;
1885
+ outputTokens: z.ZodObject<{
1886
+ value: z.ZodOptional<z.ZodInt>;
1887
+ provenance: z.ZodEnum<{
1888
+ computed: "computed";
1889
+ estimated: "estimated";
1890
+ "provider-reported": "provider-reported";
1891
+ unavailable: "unavailable";
1892
+ }>;
1893
+ }, z.core.$strip>;
1894
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1895
+ value: z.ZodOptional<z.ZodInt>;
1896
+ provenance: z.ZodEnum<{
1897
+ computed: "computed";
1898
+ estimated: "estimated";
1899
+ "provider-reported": "provider-reported";
1900
+ unavailable: "unavailable";
1901
+ }>;
1902
+ }, z.core.$strip>>;
1903
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1904
+ value: z.ZodOptional<z.ZodInt>;
1905
+ provenance: z.ZodEnum<{
1906
+ computed: "computed";
1907
+ estimated: "estimated";
1908
+ "provider-reported": "provider-reported";
1909
+ unavailable: "unavailable";
1910
+ }>;
1911
+ }, z.core.$strip>>;
1912
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1913
+ value: z.ZodOptional<z.ZodInt>;
1914
+ provenance: z.ZodEnum<{
1915
+ computed: "computed";
1916
+ estimated: "estimated";
1917
+ "provider-reported": "provider-reported";
1918
+ unavailable: "unavailable";
1919
+ }>;
1920
+ }, z.core.$strip>>;
1921
+ cost: z.ZodOptional<z.ZodObject<{
1922
+ value: z.ZodOptional<z.ZodNumber>;
1923
+ currency: z.ZodOptional<z.ZodString>;
1924
+ provenance: z.ZodEnum<{
1925
+ computed: "computed";
1926
+ estimated: "estimated";
1927
+ "provider-reported": "provider-reported";
1928
+ unavailable: "unavailable";
1929
+ }>;
1930
+ }, z.core.$strip>>;
1931
+ }, z.core.$strip>>;
1932
+ }, z.core.$strict>;
1933
+ }, z.core.$strict>]>;
1934
+ export type AgentStoreTransitionRecord = z.infer<typeof AgentStoreTransitionRecordSchema>;
804
1935
  export type AgentStoreEventDraft = Omit<AgentStoreEventEnvelope, 'seq'>;
805
1936
  export interface AgentStoreEventDecodeAccepted {
806
1937
  outcome: 'accepted';