stitchkit 0.61.0 → 0.63.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 (36) hide show
  1. package/dist/agent-runtime/compaction.d.ts +14 -1
  2. package/dist/agent-runtime/compaction.d.ts.map +1 -1
  3. package/dist/agent-runtime/coordinator.d.ts +23 -2
  4. package/dist/agent-runtime/coordinator.d.ts.map +1 -1
  5. package/dist/agent-runtime/events.d.ts +140 -0
  6. package/dist/agent-runtime/events.d.ts.map +1 -1
  7. package/dist/agent-runtime/history.d.ts +39 -1
  8. package/dist/agent-runtime/history.d.ts.map +1 -1
  9. package/dist/agent-runtime/observability.d.ts +4 -0
  10. package/dist/agent-runtime/observability.d.ts.map +1 -1
  11. package/dist/agent-runtime/prompt.d.ts +1 -1
  12. package/dist/agent-runtime/prompt.d.ts.map +1 -1
  13. package/dist/agent-runtime/run-execution.d.ts +4 -0
  14. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  15. package/dist/agent-runtime/runtime-internals.d.ts +47 -0
  16. package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
  17. package/dist/agent-runtime/runtime.d.ts +1 -0
  18. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  19. package/dist/agent-runtime/schemas.d.ts +208 -77
  20. package/dist/agent-runtime/schemas.d.ts.map +1 -1
  21. package/dist/agent-runtime/store-driver.d.ts +191 -0
  22. package/dist/agent-runtime/store-driver.d.ts.map +1 -1
  23. package/dist/agent-runtime/store.d.ts +583 -0
  24. package/dist/agent-runtime/store.d.ts.map +1 -1
  25. package/dist/agent-runtime/terminal-commit.d.ts +34 -4
  26. package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
  27. package/dist/agent-runtime/terminal-status.d.ts +13 -0
  28. package/dist/agent-runtime/terminal-status.d.ts.map +1 -1
  29. package/dist/agent-runtime.d.ts +1 -1
  30. package/dist/agent-runtime.d.ts.map +1 -1
  31. package/dist/agent-runtime.js +399 -99
  32. package/dist/{index-vtjgx3vv.js → index-b1k33127.js} +25 -18
  33. package/dist/testing/agent-store-conformance.d.ts.map +1 -1
  34. package/dist/testing.js +26 -4
  35. package/llms-full.txt +386 -9
  36. package/package.json +1 -1
@@ -30,6 +30,7 @@ export declare const AgentStoreAppliedSchema: z.ZodObject<{
30
30
  failed: "failed";
31
31
  interrupted: "interrupted";
32
32
  streaming: "streaming";
33
+ superseded: "superseded";
33
34
  }>;
34
35
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
35
36
  type: z.ZodLiteral<"text">;
@@ -98,6 +99,7 @@ export declare const AgentStoreAppliedSchema: z.ZodObject<{
98
99
  assistantMessageId: z.ZodString;
99
100
  state: z.ZodEnum<{
100
101
  abandoned: "abandoned";
102
+ absorbed: "absorbed";
101
103
  cancelled: "cancelled";
102
104
  completed: "completed";
103
105
  failed: "failed";
@@ -105,6 +107,7 @@ export declare const AgentStoreAppliedSchema: z.ZodObject<{
105
107
  interrupted: "interrupted";
106
108
  queued: "queued";
107
109
  running: "running";
110
+ superseded: "superseded";
108
111
  }>;
109
112
  revision: z.ZodInt;
110
113
  ownerId: z.ZodOptional<z.ZodString>;
@@ -115,12 +118,72 @@ export declare const AgentStoreAppliedSchema: z.ZodObject<{
115
118
  interrupted: "interrupted";
116
119
  policy_stop: "policy_stop";
117
120
  provider_failure: "provider_failure";
121
+ provider_stop: "provider_stop";
118
122
  shutdown: "shutdown";
119
123
  success: "success";
124
+ superseded: "superseded";
120
125
  timeout: "timeout";
121
126
  tool_failure: "tool_failure";
122
127
  }>>;
123
128
  terminalPolicyName: z.ZodOptional<z.ZodString>;
129
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
130
+ usage: z.ZodOptional<z.ZodObject<{
131
+ inputTokens: z.ZodObject<{
132
+ value: z.ZodOptional<z.ZodNumber>;
133
+ provenance: z.ZodEnum<{
134
+ computed: "computed";
135
+ estimated: "estimated";
136
+ "provider-reported": "provider-reported";
137
+ unavailable: "unavailable";
138
+ }>;
139
+ }, z.core.$strip>;
140
+ outputTokens: z.ZodObject<{
141
+ value: z.ZodOptional<z.ZodNumber>;
142
+ provenance: z.ZodEnum<{
143
+ computed: "computed";
144
+ estimated: "estimated";
145
+ "provider-reported": "provider-reported";
146
+ unavailable: "unavailable";
147
+ }>;
148
+ }, z.core.$strip>;
149
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
150
+ value: z.ZodOptional<z.ZodNumber>;
151
+ provenance: z.ZodEnum<{
152
+ computed: "computed";
153
+ estimated: "estimated";
154
+ "provider-reported": "provider-reported";
155
+ unavailable: "unavailable";
156
+ }>;
157
+ }, z.core.$strip>>;
158
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
159
+ value: z.ZodOptional<z.ZodNumber>;
160
+ provenance: z.ZodEnum<{
161
+ computed: "computed";
162
+ estimated: "estimated";
163
+ "provider-reported": "provider-reported";
164
+ unavailable: "unavailable";
165
+ }>;
166
+ }, z.core.$strip>>;
167
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
168
+ value: z.ZodOptional<z.ZodNumber>;
169
+ provenance: z.ZodEnum<{
170
+ computed: "computed";
171
+ estimated: "estimated";
172
+ "provider-reported": "provider-reported";
173
+ unavailable: "unavailable";
174
+ }>;
175
+ }, z.core.$strip>>;
176
+ cost: z.ZodOptional<z.ZodObject<{
177
+ value: z.ZodOptional<z.ZodNumber>;
178
+ currency: z.ZodOptional<z.ZodString>;
179
+ provenance: z.ZodEnum<{
180
+ computed: "computed";
181
+ estimated: "estimated";
182
+ "provider-reported": "provider-reported";
183
+ unavailable: "unavailable";
184
+ }>;
185
+ }, z.core.$strip>>;
186
+ }, z.core.$strip>>;
124
187
  createdAt: z.ZodISODateTime;
125
188
  updatedAt: z.ZodISODateTime;
126
189
  }, z.core.$strip>>;
@@ -145,6 +208,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
145
208
  failed: "failed";
146
209
  interrupted: "interrupted";
147
210
  streaming: "streaming";
211
+ superseded: "superseded";
148
212
  }>;
149
213
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
150
214
  type: z.ZodLiteral<"text">;
@@ -216,6 +280,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
216
280
  assistantMessageId: z.ZodString;
217
281
  state: z.ZodEnum<{
218
282
  abandoned: "abandoned";
283
+ absorbed: "absorbed";
219
284
  cancelled: "cancelled";
220
285
  completed: "completed";
221
286
  failed: "failed";
@@ -223,6 +288,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
223
288
  interrupted: "interrupted";
224
289
  queued: "queued";
225
290
  running: "running";
291
+ superseded: "superseded";
226
292
  }>;
227
293
  revision: z.ZodInt;
228
294
  ownerId: z.ZodOptional<z.ZodString>;
@@ -233,12 +299,72 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
233
299
  interrupted: "interrupted";
234
300
  policy_stop: "policy_stop";
235
301
  provider_failure: "provider_failure";
302
+ provider_stop: "provider_stop";
236
303
  shutdown: "shutdown";
237
304
  success: "success";
305
+ superseded: "superseded";
238
306
  timeout: "timeout";
239
307
  tool_failure: "tool_failure";
240
308
  }>>;
241
309
  terminalPolicyName: z.ZodOptional<z.ZodString>;
310
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
311
+ usage: z.ZodOptional<z.ZodObject<{
312
+ inputTokens: z.ZodObject<{
313
+ value: z.ZodOptional<z.ZodNumber>;
314
+ provenance: z.ZodEnum<{
315
+ computed: "computed";
316
+ estimated: "estimated";
317
+ "provider-reported": "provider-reported";
318
+ unavailable: "unavailable";
319
+ }>;
320
+ }, z.core.$strip>;
321
+ outputTokens: z.ZodObject<{
322
+ value: z.ZodOptional<z.ZodNumber>;
323
+ provenance: z.ZodEnum<{
324
+ computed: "computed";
325
+ estimated: "estimated";
326
+ "provider-reported": "provider-reported";
327
+ unavailable: "unavailable";
328
+ }>;
329
+ }, z.core.$strip>;
330
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
331
+ value: z.ZodOptional<z.ZodNumber>;
332
+ provenance: z.ZodEnum<{
333
+ computed: "computed";
334
+ estimated: "estimated";
335
+ "provider-reported": "provider-reported";
336
+ unavailable: "unavailable";
337
+ }>;
338
+ }, z.core.$strip>>;
339
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
340
+ value: z.ZodOptional<z.ZodNumber>;
341
+ provenance: z.ZodEnum<{
342
+ computed: "computed";
343
+ estimated: "estimated";
344
+ "provider-reported": "provider-reported";
345
+ unavailable: "unavailable";
346
+ }>;
347
+ }, z.core.$strip>>;
348
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
349
+ value: z.ZodOptional<z.ZodNumber>;
350
+ provenance: z.ZodEnum<{
351
+ computed: "computed";
352
+ estimated: "estimated";
353
+ "provider-reported": "provider-reported";
354
+ unavailable: "unavailable";
355
+ }>;
356
+ }, z.core.$strip>>;
357
+ cost: z.ZodOptional<z.ZodObject<{
358
+ value: z.ZodOptional<z.ZodNumber>;
359
+ currency: z.ZodOptional<z.ZodString>;
360
+ provenance: z.ZodEnum<{
361
+ computed: "computed";
362
+ estimated: "estimated";
363
+ "provider-reported": "provider-reported";
364
+ unavailable: "unavailable";
365
+ }>;
366
+ }, z.core.$strip>>;
367
+ }, z.core.$strip>>;
242
368
  createdAt: z.ZodISODateTime;
243
369
  updatedAt: z.ZodISODateTime;
244
370
  }, z.core.$strip>;
@@ -259,6 +385,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
259
385
  failed: "failed";
260
386
  interrupted: "interrupted";
261
387
  streaming: "streaming";
388
+ superseded: "superseded";
262
389
  }>;
263
390
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
264
391
  type: z.ZodLiteral<"text">;
@@ -340,6 +467,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
340
467
  failed: "failed";
341
468
  interrupted: "interrupted";
342
469
  streaming: "streaming";
470
+ superseded: "superseded";
343
471
  }>;
344
472
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
345
473
  type: z.ZodLiteral<"text">;
@@ -408,6 +536,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
408
536
  assistantMessageId: z.ZodString;
409
537
  state: z.ZodEnum<{
410
538
  abandoned: "abandoned";
539
+ absorbed: "absorbed";
411
540
  cancelled: "cancelled";
412
541
  completed: "completed";
413
542
  failed: "failed";
@@ -415,6 +544,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
415
544
  interrupted: "interrupted";
416
545
  queued: "queued";
417
546
  running: "running";
547
+ superseded: "superseded";
418
548
  }>;
419
549
  revision: z.ZodInt;
420
550
  ownerId: z.ZodOptional<z.ZodString>;
@@ -425,12 +555,72 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
425
555
  interrupted: "interrupted";
426
556
  policy_stop: "policy_stop";
427
557
  provider_failure: "provider_failure";
558
+ provider_stop: "provider_stop";
428
559
  shutdown: "shutdown";
429
560
  success: "success";
561
+ superseded: "superseded";
430
562
  timeout: "timeout";
431
563
  tool_failure: "tool_failure";
432
564
  }>>;
433
565
  terminalPolicyName: z.ZodOptional<z.ZodString>;
566
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
567
+ usage: z.ZodOptional<z.ZodObject<{
568
+ inputTokens: z.ZodObject<{
569
+ value: z.ZodOptional<z.ZodNumber>;
570
+ provenance: z.ZodEnum<{
571
+ computed: "computed";
572
+ estimated: "estimated";
573
+ "provider-reported": "provider-reported";
574
+ unavailable: "unavailable";
575
+ }>;
576
+ }, z.core.$strip>;
577
+ outputTokens: z.ZodObject<{
578
+ value: z.ZodOptional<z.ZodNumber>;
579
+ provenance: z.ZodEnum<{
580
+ computed: "computed";
581
+ estimated: "estimated";
582
+ "provider-reported": "provider-reported";
583
+ unavailable: "unavailable";
584
+ }>;
585
+ }, z.core.$strip>;
586
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
587
+ value: z.ZodOptional<z.ZodNumber>;
588
+ provenance: z.ZodEnum<{
589
+ computed: "computed";
590
+ estimated: "estimated";
591
+ "provider-reported": "provider-reported";
592
+ unavailable: "unavailable";
593
+ }>;
594
+ }, z.core.$strip>>;
595
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
596
+ value: z.ZodOptional<z.ZodNumber>;
597
+ provenance: z.ZodEnum<{
598
+ computed: "computed";
599
+ estimated: "estimated";
600
+ "provider-reported": "provider-reported";
601
+ unavailable: "unavailable";
602
+ }>;
603
+ }, z.core.$strip>>;
604
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
605
+ value: z.ZodOptional<z.ZodNumber>;
606
+ provenance: z.ZodEnum<{
607
+ computed: "computed";
608
+ estimated: "estimated";
609
+ "provider-reported": "provider-reported";
610
+ unavailable: "unavailable";
611
+ }>;
612
+ }, z.core.$strip>>;
613
+ cost: z.ZodOptional<z.ZodObject<{
614
+ value: z.ZodOptional<z.ZodNumber>;
615
+ currency: z.ZodOptional<z.ZodString>;
616
+ provenance: z.ZodEnum<{
617
+ computed: "computed";
618
+ estimated: "estimated";
619
+ "provider-reported": "provider-reported";
620
+ unavailable: "unavailable";
621
+ }>;
622
+ }, z.core.$strip>>;
623
+ }, z.core.$strip>>;
434
624
  createdAt: z.ZodISODateTime;
435
625
  updatedAt: z.ZodISODateTime;
436
626
  }, z.core.$strip>>;
@@ -459,6 +649,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
459
649
  failed: "failed";
460
650
  interrupted: "interrupted";
461
651
  streaming: "streaming";
652
+ superseded: "superseded";
462
653
  }>;
463
654
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
464
655
  type: z.ZodLiteral<"text">;
@@ -527,6 +718,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
527
718
  assistantMessageId: z.ZodString;
528
719
  state: z.ZodEnum<{
529
720
  abandoned: "abandoned";
721
+ absorbed: "absorbed";
530
722
  cancelled: "cancelled";
531
723
  completed: "completed";
532
724
  failed: "failed";
@@ -534,6 +726,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
534
726
  interrupted: "interrupted";
535
727
  queued: "queued";
536
728
  running: "running";
729
+ superseded: "superseded";
537
730
  }>;
538
731
  revision: z.ZodInt;
539
732
  ownerId: z.ZodOptional<z.ZodString>;
@@ -544,12 +737,72 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
544
737
  interrupted: "interrupted";
545
738
  policy_stop: "policy_stop";
546
739
  provider_failure: "provider_failure";
740
+ provider_stop: "provider_stop";
547
741
  shutdown: "shutdown";
548
742
  success: "success";
743
+ superseded: "superseded";
549
744
  timeout: "timeout";
550
745
  tool_failure: "tool_failure";
551
746
  }>>;
552
747
  terminalPolicyName: z.ZodOptional<z.ZodString>;
748
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
749
+ usage: z.ZodOptional<z.ZodObject<{
750
+ inputTokens: z.ZodObject<{
751
+ value: z.ZodOptional<z.ZodNumber>;
752
+ provenance: z.ZodEnum<{
753
+ computed: "computed";
754
+ estimated: "estimated";
755
+ "provider-reported": "provider-reported";
756
+ unavailable: "unavailable";
757
+ }>;
758
+ }, z.core.$strip>;
759
+ outputTokens: z.ZodObject<{
760
+ value: z.ZodOptional<z.ZodNumber>;
761
+ provenance: z.ZodEnum<{
762
+ computed: "computed";
763
+ estimated: "estimated";
764
+ "provider-reported": "provider-reported";
765
+ unavailable: "unavailable";
766
+ }>;
767
+ }, z.core.$strip>;
768
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
769
+ value: z.ZodOptional<z.ZodNumber>;
770
+ provenance: z.ZodEnum<{
771
+ computed: "computed";
772
+ estimated: "estimated";
773
+ "provider-reported": "provider-reported";
774
+ unavailable: "unavailable";
775
+ }>;
776
+ }, z.core.$strip>>;
777
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
778
+ value: z.ZodOptional<z.ZodNumber>;
779
+ provenance: z.ZodEnum<{
780
+ computed: "computed";
781
+ estimated: "estimated";
782
+ "provider-reported": "provider-reported";
783
+ unavailable: "unavailable";
784
+ }>;
785
+ }, z.core.$strip>>;
786
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
787
+ value: z.ZodOptional<z.ZodNumber>;
788
+ provenance: z.ZodEnum<{
789
+ computed: "computed";
790
+ estimated: "estimated";
791
+ "provider-reported": "provider-reported";
792
+ unavailable: "unavailable";
793
+ }>;
794
+ }, z.core.$strip>>;
795
+ cost: z.ZodOptional<z.ZodObject<{
796
+ value: z.ZodOptional<z.ZodNumber>;
797
+ currency: z.ZodOptional<z.ZodString>;
798
+ provenance: z.ZodEnum<{
799
+ computed: "computed";
800
+ estimated: "estimated";
801
+ "provider-reported": "provider-reported";
802
+ unavailable: "unavailable";
803
+ }>;
804
+ }, z.core.$strip>>;
805
+ }, z.core.$strip>>;
553
806
  createdAt: z.ZodISODateTime;
554
807
  updatedAt: z.ZodISODateTime;
555
808
  }, z.core.$strip>>;
@@ -573,6 +826,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
573
826
  failed: "failed";
574
827
  interrupted: "interrupted";
575
828
  streaming: "streaming";
829
+ superseded: "superseded";
576
830
  }>;
577
831
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
578
832
  type: z.ZodLiteral<"text">;
@@ -644,6 +898,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
644
898
  assistantMessageId: z.ZodString;
645
899
  state: z.ZodEnum<{
646
900
  abandoned: "abandoned";
901
+ absorbed: "absorbed";
647
902
  cancelled: "cancelled";
648
903
  completed: "completed";
649
904
  failed: "failed";
@@ -651,6 +906,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
651
906
  interrupted: "interrupted";
652
907
  queued: "queued";
653
908
  running: "running";
909
+ superseded: "superseded";
654
910
  }>;
655
911
  revision: z.ZodInt;
656
912
  ownerId: z.ZodOptional<z.ZodString>;
@@ -661,12 +917,72 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
661
917
  interrupted: "interrupted";
662
918
  policy_stop: "policy_stop";
663
919
  provider_failure: "provider_failure";
920
+ provider_stop: "provider_stop";
664
921
  shutdown: "shutdown";
665
922
  success: "success";
923
+ superseded: "superseded";
666
924
  timeout: "timeout";
667
925
  tool_failure: "tool_failure";
668
926
  }>>;
669
927
  terminalPolicyName: z.ZodOptional<z.ZodString>;
928
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
929
+ usage: z.ZodOptional<z.ZodObject<{
930
+ inputTokens: z.ZodObject<{
931
+ value: z.ZodOptional<z.ZodNumber>;
932
+ provenance: z.ZodEnum<{
933
+ computed: "computed";
934
+ estimated: "estimated";
935
+ "provider-reported": "provider-reported";
936
+ unavailable: "unavailable";
937
+ }>;
938
+ }, z.core.$strip>;
939
+ outputTokens: z.ZodObject<{
940
+ value: z.ZodOptional<z.ZodNumber>;
941
+ provenance: z.ZodEnum<{
942
+ computed: "computed";
943
+ estimated: "estimated";
944
+ "provider-reported": "provider-reported";
945
+ unavailable: "unavailable";
946
+ }>;
947
+ }, z.core.$strip>;
948
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
949
+ value: z.ZodOptional<z.ZodNumber>;
950
+ provenance: z.ZodEnum<{
951
+ computed: "computed";
952
+ estimated: "estimated";
953
+ "provider-reported": "provider-reported";
954
+ unavailable: "unavailable";
955
+ }>;
956
+ }, z.core.$strip>>;
957
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
958
+ value: z.ZodOptional<z.ZodNumber>;
959
+ provenance: z.ZodEnum<{
960
+ computed: "computed";
961
+ estimated: "estimated";
962
+ "provider-reported": "provider-reported";
963
+ unavailable: "unavailable";
964
+ }>;
965
+ }, z.core.$strip>>;
966
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
967
+ value: z.ZodOptional<z.ZodNumber>;
968
+ provenance: z.ZodEnum<{
969
+ computed: "computed";
970
+ estimated: "estimated";
971
+ "provider-reported": "provider-reported";
972
+ unavailable: "unavailable";
973
+ }>;
974
+ }, z.core.$strip>>;
975
+ cost: z.ZodOptional<z.ZodObject<{
976
+ value: z.ZodOptional<z.ZodNumber>;
977
+ currency: z.ZodOptional<z.ZodString>;
978
+ provenance: z.ZodEnum<{
979
+ computed: "computed";
980
+ estimated: "estimated";
981
+ "provider-reported": "provider-reported";
982
+ unavailable: "unavailable";
983
+ }>;
984
+ }, z.core.$strip>>;
985
+ }, z.core.$strip>>;
670
986
  createdAt: z.ZodISODateTime;
671
987
  updatedAt: z.ZodISODateTime;
672
988
  }, z.core.$strip>;
@@ -687,6 +1003,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
687
1003
  failed: "failed";
688
1004
  interrupted: "interrupted";
689
1005
  streaming: "streaming";
1006
+ superseded: "superseded";
690
1007
  }>;
691
1008
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
692
1009
  type: z.ZodLiteral<"text">;
@@ -768,6 +1085,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
768
1085
  failed: "failed";
769
1086
  interrupted: "interrupted";
770
1087
  streaming: "streaming";
1088
+ superseded: "superseded";
771
1089
  }>;
772
1090
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
773
1091
  type: z.ZodLiteral<"text">;
@@ -836,6 +1154,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
836
1154
  assistantMessageId: z.ZodString;
837
1155
  state: z.ZodEnum<{
838
1156
  abandoned: "abandoned";
1157
+ absorbed: "absorbed";
839
1158
  cancelled: "cancelled";
840
1159
  completed: "completed";
841
1160
  failed: "failed";
@@ -843,6 +1162,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
843
1162
  interrupted: "interrupted";
844
1163
  queued: "queued";
845
1164
  running: "running";
1165
+ superseded: "superseded";
846
1166
  }>;
847
1167
  revision: z.ZodInt;
848
1168
  ownerId: z.ZodOptional<z.ZodString>;
@@ -853,12 +1173,72 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
853
1173
  interrupted: "interrupted";
854
1174
  policy_stop: "policy_stop";
855
1175
  provider_failure: "provider_failure";
1176
+ provider_stop: "provider_stop";
856
1177
  shutdown: "shutdown";
857
1178
  success: "success";
1179
+ superseded: "superseded";
858
1180
  timeout: "timeout";
859
1181
  tool_failure: "tool_failure";
860
1182
  }>>;
861
1183
  terminalPolicyName: z.ZodOptional<z.ZodString>;
1184
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
1185
+ usage: z.ZodOptional<z.ZodObject<{
1186
+ inputTokens: z.ZodObject<{
1187
+ value: z.ZodOptional<z.ZodNumber>;
1188
+ provenance: z.ZodEnum<{
1189
+ computed: "computed";
1190
+ estimated: "estimated";
1191
+ "provider-reported": "provider-reported";
1192
+ unavailable: "unavailable";
1193
+ }>;
1194
+ }, z.core.$strip>;
1195
+ outputTokens: z.ZodObject<{
1196
+ value: z.ZodOptional<z.ZodNumber>;
1197
+ provenance: z.ZodEnum<{
1198
+ computed: "computed";
1199
+ estimated: "estimated";
1200
+ "provider-reported": "provider-reported";
1201
+ unavailable: "unavailable";
1202
+ }>;
1203
+ }, z.core.$strip>;
1204
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1205
+ value: z.ZodOptional<z.ZodNumber>;
1206
+ provenance: z.ZodEnum<{
1207
+ computed: "computed";
1208
+ estimated: "estimated";
1209
+ "provider-reported": "provider-reported";
1210
+ unavailable: "unavailable";
1211
+ }>;
1212
+ }, z.core.$strip>>;
1213
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1214
+ value: z.ZodOptional<z.ZodNumber>;
1215
+ provenance: z.ZodEnum<{
1216
+ computed: "computed";
1217
+ estimated: "estimated";
1218
+ "provider-reported": "provider-reported";
1219
+ unavailable: "unavailable";
1220
+ }>;
1221
+ }, z.core.$strip>>;
1222
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1223
+ value: z.ZodOptional<z.ZodNumber>;
1224
+ provenance: z.ZodEnum<{
1225
+ computed: "computed";
1226
+ estimated: "estimated";
1227
+ "provider-reported": "provider-reported";
1228
+ unavailable: "unavailable";
1229
+ }>;
1230
+ }, z.core.$strip>>;
1231
+ cost: z.ZodOptional<z.ZodObject<{
1232
+ value: z.ZodOptional<z.ZodNumber>;
1233
+ currency: z.ZodOptional<z.ZodString>;
1234
+ provenance: z.ZodEnum<{
1235
+ computed: "computed";
1236
+ estimated: "estimated";
1237
+ "provider-reported": "provider-reported";
1238
+ unavailable: "unavailable";
1239
+ }>;
1240
+ }, z.core.$strip>>;
1241
+ }, z.core.$strip>>;
862
1242
  createdAt: z.ZodISODateTime;
863
1243
  updatedAt: z.ZodISODateTime;
864
1244
  }, z.core.$strip>>;
@@ -890,6 +1270,7 @@ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
890
1270
  failed: "failed";
891
1271
  interrupted: "interrupted";
892
1272
  streaming: "streaming";
1273
+ superseded: "superseded";
893
1274
  }>;
894
1275
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
895
1276
  type: z.ZodLiteral<"text">;
@@ -958,6 +1339,7 @@ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
958
1339
  assistantMessageId: z.ZodString;
959
1340
  state: z.ZodEnum<{
960
1341
  abandoned: "abandoned";
1342
+ absorbed: "absorbed";
961
1343
  cancelled: "cancelled";
962
1344
  completed: "completed";
963
1345
  failed: "failed";
@@ -965,6 +1347,7 @@ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
965
1347
  interrupted: "interrupted";
966
1348
  queued: "queued";
967
1349
  running: "running";
1350
+ superseded: "superseded";
968
1351
  }>;
969
1352
  revision: z.ZodInt;
970
1353
  ownerId: z.ZodOptional<z.ZodString>;
@@ -975,12 +1358,72 @@ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
975
1358
  interrupted: "interrupted";
976
1359
  policy_stop: "policy_stop";
977
1360
  provider_failure: "provider_failure";
1361
+ provider_stop: "provider_stop";
978
1362
  shutdown: "shutdown";
979
1363
  success: "success";
1364
+ superseded: "superseded";
980
1365
  timeout: "timeout";
981
1366
  tool_failure: "tool_failure";
982
1367
  }>>;
983
1368
  terminalPolicyName: z.ZodOptional<z.ZodString>;
1369
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
1370
+ usage: z.ZodOptional<z.ZodObject<{
1371
+ inputTokens: z.ZodObject<{
1372
+ value: z.ZodOptional<z.ZodNumber>;
1373
+ provenance: z.ZodEnum<{
1374
+ computed: "computed";
1375
+ estimated: "estimated";
1376
+ "provider-reported": "provider-reported";
1377
+ unavailable: "unavailable";
1378
+ }>;
1379
+ }, z.core.$strip>;
1380
+ outputTokens: z.ZodObject<{
1381
+ value: z.ZodOptional<z.ZodNumber>;
1382
+ provenance: z.ZodEnum<{
1383
+ computed: "computed";
1384
+ estimated: "estimated";
1385
+ "provider-reported": "provider-reported";
1386
+ unavailable: "unavailable";
1387
+ }>;
1388
+ }, z.core.$strip>;
1389
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1390
+ value: z.ZodOptional<z.ZodNumber>;
1391
+ provenance: z.ZodEnum<{
1392
+ computed: "computed";
1393
+ estimated: "estimated";
1394
+ "provider-reported": "provider-reported";
1395
+ unavailable: "unavailable";
1396
+ }>;
1397
+ }, z.core.$strip>>;
1398
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1399
+ value: z.ZodOptional<z.ZodNumber>;
1400
+ provenance: z.ZodEnum<{
1401
+ computed: "computed";
1402
+ estimated: "estimated";
1403
+ "provider-reported": "provider-reported";
1404
+ unavailable: "unavailable";
1405
+ }>;
1406
+ }, z.core.$strip>>;
1407
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1408
+ value: z.ZodOptional<z.ZodNumber>;
1409
+ provenance: z.ZodEnum<{
1410
+ computed: "computed";
1411
+ estimated: "estimated";
1412
+ "provider-reported": "provider-reported";
1413
+ unavailable: "unavailable";
1414
+ }>;
1415
+ }, z.core.$strip>>;
1416
+ cost: z.ZodOptional<z.ZodObject<{
1417
+ value: z.ZodOptional<z.ZodNumber>;
1418
+ currency: z.ZodOptional<z.ZodString>;
1419
+ provenance: z.ZodEnum<{
1420
+ computed: "computed";
1421
+ estimated: "estimated";
1422
+ "provider-reported": "provider-reported";
1423
+ unavailable: "unavailable";
1424
+ }>;
1425
+ }, z.core.$strip>>;
1426
+ }, z.core.$strip>>;
984
1427
  createdAt: z.ZodISODateTime;
985
1428
  updatedAt: z.ZodISODateTime;
986
1429
  }, z.core.$strip>;
@@ -1015,6 +1458,7 @@ export declare const CheckpointRunAssistantSchema: z.ZodObject<{
1015
1458
  failed: "failed";
1016
1459
  interrupted: "interrupted";
1017
1460
  streaming: "streaming";
1461
+ superseded: "superseded";
1018
1462
  }>;
1019
1463
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1020
1464
  type: z.ZodLiteral<"text">;
@@ -1075,6 +1519,63 @@ export declare const CheckpointRunAssistantSchema: z.ZodObject<{
1075
1519
  createdAt: z.ZodISODateTime;
1076
1520
  updatedAt: z.ZodISODateTime;
1077
1521
  }, z.core.$strip>;
1522
+ usage: z.ZodOptional<z.ZodObject<{
1523
+ inputTokens: z.ZodObject<{
1524
+ value: z.ZodOptional<z.ZodNumber>;
1525
+ provenance: z.ZodEnum<{
1526
+ computed: "computed";
1527
+ estimated: "estimated";
1528
+ "provider-reported": "provider-reported";
1529
+ unavailable: "unavailable";
1530
+ }>;
1531
+ }, z.core.$strip>;
1532
+ outputTokens: z.ZodObject<{
1533
+ value: z.ZodOptional<z.ZodNumber>;
1534
+ provenance: z.ZodEnum<{
1535
+ computed: "computed";
1536
+ estimated: "estimated";
1537
+ "provider-reported": "provider-reported";
1538
+ unavailable: "unavailable";
1539
+ }>;
1540
+ }, z.core.$strip>;
1541
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1542
+ value: z.ZodOptional<z.ZodNumber>;
1543
+ provenance: z.ZodEnum<{
1544
+ computed: "computed";
1545
+ estimated: "estimated";
1546
+ "provider-reported": "provider-reported";
1547
+ unavailable: "unavailable";
1548
+ }>;
1549
+ }, z.core.$strip>>;
1550
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1551
+ value: z.ZodOptional<z.ZodNumber>;
1552
+ provenance: z.ZodEnum<{
1553
+ computed: "computed";
1554
+ estimated: "estimated";
1555
+ "provider-reported": "provider-reported";
1556
+ unavailable: "unavailable";
1557
+ }>;
1558
+ }, z.core.$strip>>;
1559
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1560
+ value: z.ZodOptional<z.ZodNumber>;
1561
+ provenance: z.ZodEnum<{
1562
+ computed: "computed";
1563
+ estimated: "estimated";
1564
+ "provider-reported": "provider-reported";
1565
+ unavailable: "unavailable";
1566
+ }>;
1567
+ }, z.core.$strip>>;
1568
+ cost: z.ZodOptional<z.ZodObject<{
1569
+ value: z.ZodOptional<z.ZodNumber>;
1570
+ currency: z.ZodOptional<z.ZodString>;
1571
+ provenance: z.ZodEnum<{
1572
+ computed: "computed";
1573
+ estimated: "estimated";
1574
+ "provider-reported": "provider-reported";
1575
+ unavailable: "unavailable";
1576
+ }>;
1577
+ }, z.core.$strip>>;
1578
+ }, z.core.$strip>>;
1078
1579
  }, z.core.$strip>;
1079
1580
  export declare const CommitRunTerminalSchema: z.ZodObject<{
1080
1581
  conversationId: z.ZodString;
@@ -1099,6 +1600,7 @@ export declare const CommitRunTerminalSchema: z.ZodObject<{
1099
1600
  failed: "failed";
1100
1601
  interrupted: "interrupted";
1101
1602
  streaming: "streaming";
1603
+ superseded: "superseded";
1102
1604
  }>;
1103
1605
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1104
1606
  type: z.ZodLiteral<"text">;
@@ -1165,12 +1667,90 @@ export declare const CommitRunTerminalSchema: z.ZodObject<{
1165
1667
  interrupted: "interrupted";
1166
1668
  policy_stop: "policy_stop";
1167
1669
  provider_failure: "provider_failure";
1670
+ provider_stop: "provider_stop";
1168
1671
  shutdown: "shutdown";
1169
1672
  success: "success";
1673
+ superseded: "superseded";
1170
1674
  timeout: "timeout";
1171
1675
  tool_failure: "tool_failure";
1172
1676
  }>;
1173
1677
  policyName: z.ZodOptional<z.ZodString>;
1678
+ usage: z.ZodOptional<z.ZodObject<{
1679
+ inputTokens: z.ZodObject<{
1680
+ value: z.ZodOptional<z.ZodNumber>;
1681
+ provenance: z.ZodEnum<{
1682
+ computed: "computed";
1683
+ estimated: "estimated";
1684
+ "provider-reported": "provider-reported";
1685
+ unavailable: "unavailable";
1686
+ }>;
1687
+ }, z.core.$strip>;
1688
+ outputTokens: z.ZodObject<{
1689
+ value: z.ZodOptional<z.ZodNumber>;
1690
+ provenance: z.ZodEnum<{
1691
+ computed: "computed";
1692
+ estimated: "estimated";
1693
+ "provider-reported": "provider-reported";
1694
+ unavailable: "unavailable";
1695
+ }>;
1696
+ }, z.core.$strip>;
1697
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1698
+ value: z.ZodOptional<z.ZodNumber>;
1699
+ provenance: z.ZodEnum<{
1700
+ computed: "computed";
1701
+ estimated: "estimated";
1702
+ "provider-reported": "provider-reported";
1703
+ unavailable: "unavailable";
1704
+ }>;
1705
+ }, z.core.$strip>>;
1706
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1707
+ value: z.ZodOptional<z.ZodNumber>;
1708
+ provenance: z.ZodEnum<{
1709
+ computed: "computed";
1710
+ estimated: "estimated";
1711
+ "provider-reported": "provider-reported";
1712
+ unavailable: "unavailable";
1713
+ }>;
1714
+ }, z.core.$strip>>;
1715
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1716
+ value: z.ZodOptional<z.ZodNumber>;
1717
+ provenance: z.ZodEnum<{
1718
+ computed: "computed";
1719
+ estimated: "estimated";
1720
+ "provider-reported": "provider-reported";
1721
+ unavailable: "unavailable";
1722
+ }>;
1723
+ }, z.core.$strip>>;
1724
+ cost: z.ZodOptional<z.ZodObject<{
1725
+ value: z.ZodOptional<z.ZodNumber>;
1726
+ currency: z.ZodOptional<z.ZodString>;
1727
+ provenance: z.ZodEnum<{
1728
+ computed: "computed";
1729
+ estimated: "estimated";
1730
+ "provider-reported": "provider-reported";
1731
+ unavailable: "unavailable";
1732
+ }>;
1733
+ }, z.core.$strip>>;
1734
+ }, z.core.$strip>>;
1735
+ }, z.core.$strip>;
1736
+ /**
1737
+ * Move a queued successor's inputs into the run already answering, atomically.
1738
+ *
1739
+ * The alternative — attaching a new input straight to a running run — has a
1740
+ * loss case with no honest answer: the run may terminate before the loop ever
1741
+ * reaches a step boundary, and the input is then recorded as answered by a turn
1742
+ * that never saw it. Accepting it as an ordinary successor first means the
1743
+ * fallback is simply that the successor runs, which is the behaviour every
1744
+ * other policy already has.
1745
+ */
1746
+ export declare const AbsorbQueuedRunSchema: z.ZodObject<{
1747
+ conversationId: z.ZodString;
1748
+ runningRunId: z.ZodString;
1749
+ runningExpectedRevision: z.ZodInt;
1750
+ ownerId: z.ZodString;
1751
+ fencingToken: z.ZodOptional<z.ZodInt>;
1752
+ queuedRunId: z.ZodString;
1753
+ queuedExpectedRevision: z.ZodInt;
1174
1754
  }, z.core.$strip>;
1175
1755
  export declare const RequestRunInterruptSchema: z.ZodObject<{
1176
1756
  conversationId: z.ZodString;
@@ -1208,6 +1788,7 @@ export declare const ReplaceCompactedRangeSchema: z.ZodObject<{
1208
1788
  failed: "failed";
1209
1789
  interrupted: "interrupted";
1210
1790
  streaming: "streaming";
1791
+ superseded: "superseded";
1211
1792
  }>;
1212
1793
  parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1213
1794
  type: z.ZodLiteral<"text">;
@@ -1273,6 +1854,7 @@ export type AcceptInputAndAssignRun = z.infer<typeof AcceptInputAndAssignRunSche
1273
1854
  export type AcquireAgentRun = z.infer<typeof AcquireAgentRunSchema>;
1274
1855
  export type CheckpointRunAssistant = z.infer<typeof CheckpointRunAssistantSchema>;
1275
1856
  export type CommitRunTerminal = z.infer<typeof CommitRunTerminalSchema>;
1857
+ export type AbsorbQueuedRun = z.infer<typeof AbsorbQueuedRunSchema>;
1276
1858
  export type RequestRunInterrupt = z.infer<typeof RequestRunInterruptSchema>;
1277
1859
  export type RecoverAgentRun = z.infer<typeof RecoverAgentRunSchema>;
1278
1860
  export type ReplaceCompactedRange = z.infer<typeof ReplaceCompactedRangeSchema>;
@@ -1282,6 +1864,7 @@ export interface AgentRuntimeStore {
1282
1864
  acquireRun(input: AcquireAgentRun): Promise<AgentStoreMutationResult>;
1283
1865
  checkpointRunAssistant(input: CheckpointRunAssistant): Promise<AgentStoreMutationResult>;
1284
1866
  requestRunInterrupt(input: RequestRunInterrupt): Promise<AgentStoreMutationResult>;
1867
+ absorbQueuedRun(input: AbsorbQueuedRun): Promise<AgentStoreMutationResult>;
1285
1868
  recoverRun(input: RecoverAgentRun): Promise<AgentStoreMutationResult>;
1286
1869
  commitRunTerminal(input: CommitRunTerminal): Promise<AgentStoreMutationResult>;
1287
1870
  replaceCompactedRange(input: ReplaceCompactedRange): Promise<AgentStoreMutationResult>;