stitchkit 0.68.5 → 0.68.7

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.
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * What happens to a run in flight when new input arrives on the same key.
3
3
  *
4
- * `queue` finishes the run first. `interrupt` and `supersede` both end it, and
4
+ * `queue` finishes the run first. `interrupt`, `interrupt-next` and `supersede`
5
+ * end it. `interrupt-next` is the priority form: it runs before ordinary work
6
+ * already waiting on the lane, while preserving FIFO inside both classes.
7
+ * `interrupt` keeps ordinary FIFO. `interrupt` and `supersede` otherwise
5
8
  * differ in one thing only: what becomes of what it produced. An interrupted
6
9
  * run's partial answer stays part of the conversation; a superseded run's does
7
10
  * not reach the model again.
@@ -21,7 +24,7 @@
21
24
  * `inputPolicy` accepting a function of the input: one application can hold
22
25
  * both surfaces.
23
26
  */
24
- export type AgentInputPolicy = 'queue' | 'inject' | 'interrupt' | 'supersede';
27
+ export type AgentInputPolicy = 'queue' | 'inject' | 'interrupt' | 'interrupt-next' | 'supersede';
25
28
  export type AgentStopReason = 'user-interrupt' | 'supersede' | 'timeout' | 'shutdown';
26
29
  export interface AgentCoordinatedRun<RESULT> {
27
30
  runId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;AAC9E,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtF,MAAM,WAAW,mBAAmB,CAAC,MAAM;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc,CAAC,MAAM;IACpC,QAAQ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AM,WAAW,uBAAuB;IACtC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAkBD,wBAAgB,6BAA6B,IAAI,uBAAuB,CA0JvE"}
@@ -101,6 +101,10 @@ export declare const AgentAdmissionEventSchema: z.ZodObject<{
101
101
  superseded: "superseded";
102
102
  }>;
103
103
  revision: z.ZodInt;
104
+ queuePriority: z.ZodOptional<z.ZodEnum<{
105
+ "interrupt-next": "interrupt-next";
106
+ }>>;
107
+ executionSequence: z.ZodOptional<z.ZodInt>;
104
108
  ownerId: z.ZodOptional<z.ZodString>;
105
109
  fencingToken: z.ZodOptional<z.ZodInt>;
106
110
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -766,6 +770,10 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
766
770
  superseded: "superseded";
767
771
  }>;
768
772
  revision: z.ZodInt;
773
+ queuePriority: z.ZodOptional<z.ZodEnum<{
774
+ "interrupt-next": "interrupt-next";
775
+ }>>;
776
+ executionSequence: z.ZodOptional<z.ZodInt>;
769
777
  ownerId: z.ZodOptional<z.ZodString>;
770
778
  fencingToken: z.ZodOptional<z.ZodInt>;
771
779
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"event-schema.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/event-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,KAAK,SAAS,OAAO,EAC9D,YAAY,EAAE,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,WAcb;IACtC,WAAW,EAAE,QAAQ,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB,KAAG,OAAO,CAAC,kBAAkB,CAAC,CAq4BhC"}
@@ -34,7 +34,7 @@ export declare function abortTerminalReason(signal: AbortSignal): AgentTerminalR
34
34
  */
35
35
  export declare function addUsage(total: AgentUsage | undefined, step: AgentUsage): AgentUsage;
36
36
  /**
37
- * The provider's own run total where it has one, ours where it does not.
37
+ * The SDK's own model-step total where it has one, our per-step sum where it does not.
38
38
  *
39
39
  * `totalUsage` is the SDK's sum over the steps it saw, and it covers only the
40
40
  * five token fields it knows about — a `normalizeUsage` hook that reads
@@ -49,7 +49,7 @@ export declare function addUsage(total: AgentUsage | undefined, step: AgentUsage
49
49
  * for a billable figure cares about, and pretending otherwise made one run
50
50
  * report `provider-reported` on success and `computed` on abort.
51
51
  */
52
- export declare function mergeRunTotals(sdkTotal: AgentUsage, accumulated: AgentUsage | undefined): AgentUsage;
52
+ export declare function mergeModelTotals(sdkTotal: AgentUsage, accumulated: AgentUsage | undefined): AgentUsage;
53
53
  /**
54
54
  * Every field present, so a reader never has to tell an absent key from a
55
55
  * reported zero.
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-internals.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/runtime-internals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE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AM,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB,CAAC,KAAK,SAAS,OAAO,GAAG,OAAO;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY,CAAC,OAAO,GAAG,OAAO;IAC7C,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG;QAChC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACxB,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAC1C,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;KACrC,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,yBAAyB,GAAG;QACxC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACxB,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;KACrC,CAAC;IACF,SAAS,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAChF,OAAO,CACL,OAAO,EAAE,0BAA0B,CAAC,OAAO,CAAC,GAC3C,OAAO,CAAC,SAAS,2BAA2B,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC;IACjE;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC7E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,KAAK,SAAS,OAAO,EAC/D,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC,GACzC,YAAY,CAAC,OAAO,CAAC,CA4tBvB"}
@@ -241,6 +241,10 @@ export declare const AgentRunStateSchema: z.ZodEnum<{
241
241
  running: "running";
242
242
  superseded: "superseded";
243
243
  }>;
244
+ export declare const AgentRunQueuePrioritySchema: z.ZodEnum<{
245
+ "interrupt-next": "interrupt-next";
246
+ }>;
247
+ export type AgentRunQueuePriority = z.infer<typeof AgentRunQueuePrioritySchema>;
244
248
  export declare const AgentTerminalReasonSchema: z.ZodEnum<{
245
249
  abandoned: "abandoned";
246
250
  absorbed: "absorbed";
@@ -419,6 +423,10 @@ export declare const AgentRunSchema: z.ZodObject<{
419
423
  superseded: "superseded";
420
424
  }>;
421
425
  revision: z.ZodInt;
426
+ queuePriority: z.ZodOptional<z.ZodEnum<{
427
+ "interrupt-next": "interrupt-next";
428
+ }>>;
429
+ executionSequence: z.ZodOptional<z.ZodInt>;
422
430
  ownerId: z.ZodOptional<z.ZodString>;
423
431
  fencingToken: z.ZodOptional<z.ZodInt>;
424
432
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -598,6 +606,10 @@ export declare const AgentSnapshotSchema: z.ZodObject<{
598
606
  superseded: "superseded";
599
607
  }>;
600
608
  revision: z.ZodInt;
609
+ queuePriority: z.ZodOptional<z.ZodEnum<{
610
+ "interrupt-next": "interrupt-next";
611
+ }>>;
612
+ executionSequence: z.ZodOptional<z.ZodInt>;
601
613
  ownerId: z.ZodOptional<z.ZodString>;
602
614
  fencingToken: z.ZodOptional<z.ZodInt>;
603
615
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,aAAoB,CAAC;AACrD,eAAO,MAAM,wBAAwB,UAAwB,CAAC;AAC9D,eAAO,MAAM,oBAAoB,kBAAmC,CAAC;AACrE,eAAO,MAAM,qBAAqB,2CAAiC,CAAC;AAEpE,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC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CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAsD1D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+CzB,CAAC;AAWH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgB9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -26,6 +26,10 @@ export declare const AgentStoredRunSchema: z.ZodObject<{
26
26
  superseded: "superseded";
27
27
  }>;
28
28
  revision: z.ZodInt;
29
+ queuePriority: z.ZodOptional<z.ZodEnum<{
30
+ "interrupt-next": "interrupt-next";
31
+ }>>;
32
+ executionSequence: z.ZodOptional<z.ZodInt>;
29
33
  ownerId: z.ZodOptional<z.ZodString>;
30
34
  fencingToken: z.ZodOptional<z.ZodInt>;
31
35
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -534,6 +538,10 @@ export declare const AgentRecoverableDescriptorSchema: z.ZodObject<{
534
538
  superseded: "superseded";
535
539
  }>;
536
540
  revision: z.ZodInt;
541
+ queuePriority: z.ZodOptional<z.ZodEnum<{
542
+ "interrupt-next": "interrupt-next";
543
+ }>>;
544
+ executionSequence: z.ZodOptional<z.ZodInt>;
537
545
  ownerId: z.ZodOptional<z.ZodString>;
538
546
  fencingToken: z.ZodOptional<z.ZodInt>;
539
547
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -634,6 +642,10 @@ export declare const AgentRecoverablePageSchema: z.ZodObject<{
634
642
  superseded: "superseded";
635
643
  }>;
636
644
  revision: z.ZodInt;
645
+ queuePriority: z.ZodOptional<z.ZodEnum<{
646
+ "interrupt-next": "interrupt-next";
647
+ }>>;
648
+ executionSequence: z.ZodOptional<z.ZodInt>;
637
649
  ownerId: z.ZodOptional<z.ZodString>;
638
650
  fencingToken: z.ZodOptional<z.ZodInt>;
639
651
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"store-driver.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store-driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,YAAY,EAIjB,KAAK,QAAQ,EAKd,MAAM,WAAW,CAAC;AACnB,OAAO,EAKL,KAAK,iBAAiB,EAcvB,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACjF,CAAC;IACF,OAAO,EAAE;QACP,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAAC;QACzF,KAAK,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KAChF,CAAC;IACF,eAAe,CAAC,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC3F;AAyOD;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,QAAQ,CAAC,OAAO,CAAC,EAI/D,CAAC;AAkfF,wBAAgB,uBAAuB,CAAC,WAAW,EACjD,MAAM,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAC3C,iBAAiB,CAqOnB;AAuCD,oGAAoG;AACpG,wBAAgB,6BAA6B,IAAI,iBAAiB,CAsMjE"}
@@ -109,6 +109,10 @@ export declare const AgentStoreAppliedSchema: z.ZodObject<{
109
109
  superseded: "superseded";
110
110
  }>;
111
111
  revision: z.ZodInt;
112
+ queuePriority: z.ZodOptional<z.ZodEnum<{
113
+ "interrupt-next": "interrupt-next";
114
+ }>>;
115
+ executionSequence: z.ZodOptional<z.ZodInt>;
112
116
  ownerId: z.ZodOptional<z.ZodString>;
113
117
  fencingToken: z.ZodOptional<z.ZodInt>;
114
118
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -290,6 +294,10 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
290
294
  superseded: "superseded";
291
295
  }>;
292
296
  revision: z.ZodInt;
297
+ queuePriority: z.ZodOptional<z.ZodEnum<{
298
+ "interrupt-next": "interrupt-next";
299
+ }>>;
300
+ executionSequence: z.ZodOptional<z.ZodInt>;
293
301
  ownerId: z.ZodOptional<z.ZodString>;
294
302
  fencingToken: z.ZodOptional<z.ZodInt>;
295
303
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -546,6 +554,10 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
546
554
  superseded: "superseded";
547
555
  }>;
548
556
  revision: z.ZodInt;
557
+ queuePriority: z.ZodOptional<z.ZodEnum<{
558
+ "interrupt-next": "interrupt-next";
559
+ }>>;
560
+ executionSequence: z.ZodOptional<z.ZodInt>;
549
561
  ownerId: z.ZodOptional<z.ZodString>;
550
562
  fencingToken: z.ZodOptional<z.ZodInt>;
551
563
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -728,6 +740,10 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
728
740
  superseded: "superseded";
729
741
  }>;
730
742
  revision: z.ZodInt;
743
+ queuePriority: z.ZodOptional<z.ZodEnum<{
744
+ "interrupt-next": "interrupt-next";
745
+ }>>;
746
+ executionSequence: z.ZodOptional<z.ZodInt>;
731
747
  ownerId: z.ZodOptional<z.ZodString>;
732
748
  fencingToken: z.ZodOptional<z.ZodInt>;
733
749
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -908,6 +924,10 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
908
924
  superseded: "superseded";
909
925
  }>;
910
926
  revision: z.ZodInt;
927
+ queuePriority: z.ZodOptional<z.ZodEnum<{
928
+ "interrupt-next": "interrupt-next";
929
+ }>>;
930
+ executionSequence: z.ZodOptional<z.ZodInt>;
911
931
  ownerId: z.ZodOptional<z.ZodString>;
912
932
  fencingToken: z.ZodOptional<z.ZodInt>;
913
933
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -1164,6 +1184,10 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
1164
1184
  superseded: "superseded";
1165
1185
  }>;
1166
1186
  revision: z.ZodInt;
1187
+ queuePriority: z.ZodOptional<z.ZodEnum<{
1188
+ "interrupt-next": "interrupt-next";
1189
+ }>>;
1190
+ executionSequence: z.ZodOptional<z.ZodInt>;
1167
1191
  ownerId: z.ZodOptional<z.ZodString>;
1168
1192
  fencingToken: z.ZodOptional<z.ZodInt>;
1169
1193
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -1282,6 +1306,10 @@ export declare const AgentRunViewSchema: z.ZodObject<{
1282
1306
  superseded: "superseded";
1283
1307
  }>;
1284
1308
  revision: z.ZodInt;
1309
+ queuePriority: z.ZodOptional<z.ZodEnum<{
1310
+ "interrupt-next": "interrupt-next";
1311
+ }>>;
1312
+ executionSequence: z.ZodOptional<z.ZodInt>;
1285
1313
  ownerId: z.ZodOptional<z.ZodString>;
1286
1314
  fencingToken: z.ZodOptional<z.ZodInt>;
1287
1315
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -1539,6 +1567,10 @@ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
1539
1567
  superseded: "superseded";
1540
1568
  }>;
1541
1569
  revision: z.ZodInt;
1570
+ queuePriority: z.ZodOptional<z.ZodEnum<{
1571
+ "interrupt-next": "interrupt-next";
1572
+ }>>;
1573
+ executionSequence: z.ZodOptional<z.ZodInt>;
1542
1574
  ownerId: z.ZodOptional<z.ZodString>;
1543
1575
  fencingToken: z.ZodOptional<z.ZodInt>;
1544
1576
  terminalReason: z.ZodOptional<z.ZodEnum<{
@@ -2054,8 +2086,9 @@ export interface AgentRuntimeStore {
2054
2086
  * Every run of this conversation that has not reached a terminal state, in
2055
2087
  * the same causal order as `AgentSnapshot.runs`.
2056
2088
  *
2057
- * The history position is the tie-breaker when timestamps match. Recovery
2058
- * relies on that fact: identifiers are identities, never queue positions.
2089
+ * Started runs follow durable execution sequence. Queued `interrupt-next`
2090
+ * runs precede ordinary queued runs, preserving FIFO inside each class.
2091
+ * Recovery relies on that fact: identifiers are identities, never positions.
2059
2092
  */
2060
2093
  listActiveRuns(conversationId: string): Promise<readonly AgentRun[]>;
2061
2094
  acceptInputAndAssignRun(input: AcceptInputAndAssignRun): Promise<AgentStoreMutationResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,aAAa,EAInB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AACH,eAAO,MAAM,wBAAwB;;iBAAgD,CAAC;AACtF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGlC,CAAC;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASpC,CAAC;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;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qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvF;;;;;;;OAOG;IACH,eAAe,CAAC,KAAK,EAAE;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;CAC5D"}
@@ -74,6 +74,8 @@ export declare function appliedSnapshot(result: AgentStoreMutationResult, operat
74
74
  assistantMessageId: string;
75
75
  state: "abandoned" | "cancelled" | "completed" | "failed" | "interrupt_requested" | "interrupted" | "queued" | "running" | "superseded";
76
76
  revision: number;
77
+ queuePriority?: "interrupt-next" | undefined;
78
+ executionSequence?: number | undefined;
77
79
  ownerId?: string | undefined;
78
80
  fencingToken?: number | undefined;
79
81
  terminalReason?: "abandoned" | "absorbed" | "cancelled" | "context_overflow" | "interrupted" | "policy_stop" | "provider_failure" | "provider_stop" | "shutdown" | "success" | "superseded" | "timeout" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-commit.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/terminal-commit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,QAAQ,EAEb,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGzF,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,YAAY,SAAS,EAAE,MAAM,EAG5B;CACF;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlF;AAED,UAAU,uBAAuB;IAC/B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlF;AAED,UAAU,uBAAuB;IAC/B,GAAG,EAAE,QAAQ,CAAC;IACd,SAAS,EAAE,YAAY,CAAC;IACxB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CACzD;AAED,MAAM,WAAW,6BAA8B,SAAQ,uBAAuB;IAC5E;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CAChC;AAuID,wBAAsB,sBAAsB,CAAC,KAAK,EAAE;IAClD,KAAK,EAAE,iBAAiB,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,uBAAuB,CAAC;IACnC,GAAG,EAAE,MAAM,IAAI,CAAC;CACjB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CA2DzC"}
@@ -106,6 +106,7 @@ var AgentRunStateSchema = z.enum([
106
106
  "cancelled",
107
107
  "abandoned"
108
108
  ]);
109
+ var AgentRunQueuePrioritySchema = z.enum(["interrupt-next"]);
109
110
  var AgentTerminalReasonSchema = z.enum([
110
111
  "success",
111
112
  "policy_stop",
@@ -177,6 +178,8 @@ var AgentRunFieldsSchema = z.object({
177
178
  assistantMessageId: AgentRecordIdSchema,
178
179
  state: AgentRunStateSchema,
179
180
  revision: AgentRecordVersionSchema,
181
+ queuePriority: AgentRunQueuePrioritySchema.optional(),
182
+ executionSequence: AgentRecordVersionSchema.optional(),
180
183
  ownerId: z.string().min(1).optional(),
181
184
  fencingToken: AgentRecordVersionSchema.optional(),
182
185
  terminalReason: AgentTerminalReasonSchema.optional(),
@@ -397,6 +400,7 @@ export {
397
400
  AgentRecordIdSchema,
398
401
  AgentRecordVersionSchema,
399
402
  AgentRunMetricsSchema,
403
+ AgentRunQueuePrioritySchema,
400
404
  AgentRunSchema,
401
405
  AgentRunStateEventSchema,
402
406
  AgentRunStateSchema,
@@ -23,6 +23,7 @@ import {
23
23
  AgentRecordIdSchema,
24
24
  AgentRecordVersionSchema,
25
25
  AgentRunMetricsSchema,
26
+ AgentRunQueuePrioritySchema,
26
27
  AgentRunSchema,
27
28
  AgentRunStateSchema,
28
29
  AgentSnapshotSchema,
@@ -35,7 +36,7 @@ import {
35
36
  AgentUsageSchema,
36
37
  AgentUsageValueSchema,
37
38
  runStateForTerminalReason
38
- } from "./index-fhsmrzj7.js";
39
+ } from "./index-ysphyxax.js";
39
40
  import"./index-6djpbnda.js";
40
41
  import"./index-cby4ar3v.js";
41
42
  import {
@@ -227,6 +228,7 @@ function createAgentSessionCoordinator() {
227
228
  }
228
229
  const lane = laneFor(input.key);
229
230
  const pending = {
231
+ priority: input.policy === "interrupt-next",
230
232
  reject(reason) {
231
233
  accepted.reject(reason);
232
234
  result.reject(reason);
@@ -249,11 +251,20 @@ function createAgentSessionCoordinator() {
249
251
  }
250
252
  }
251
253
  };
252
- if (input.policy === "interrupt")
254
+ if (input.policy === "interrupt" || input.policy === "interrupt-next") {
253
255
  lane.active?.controller.abort("user-interrupt");
256
+ }
254
257
  if (input.policy === "supersede")
255
258
  lane.active?.controller.abort("supersede");
256
- lane.queue.push(pending);
259
+ if (pending.priority) {
260
+ const firstOrdinary = lane.queue.findIndex((queued) => !queued.priority);
261
+ if (firstOrdinary === -1)
262
+ lane.queue.push(pending);
263
+ else
264
+ lane.queue.splice(firstOrdinary, 0, pending);
265
+ } else {
266
+ lane.queue.push(pending);
267
+ }
257
268
  startNext(input.key, lane);
258
269
  return { accepted: accepted.promise, result: result.promise };
259
270
  },
@@ -1382,7 +1393,7 @@ function addUsage(total, step) {
1382
1393
  ...cost && { cost }
1383
1394
  };
1384
1395
  }
1385
- function mergeRunTotals(sdkTotal, accumulated) {
1396
+ function mergeModelTotals(sdkTotal, accumulated) {
1386
1397
  const pick = (total, ours) => total?.value !== undefined ? { value: total.value, provenance: "computed" } : ours ?? { provenance: "unavailable" };
1387
1398
  return {
1388
1399
  inputTokens: pick(sdkTotal.inputTokens, accumulated?.inputTokens),
@@ -1565,7 +1576,9 @@ function createRunExecutor(dependencies) {
1565
1576
  let eventCount = 0;
1566
1577
  let sequence = 0;
1567
1578
  let terminalReason = "success";
1568
- let usage = input.acceptedRun.usage;
1579
+ let nonModelUsage = input.acceptedRun.usage;
1580
+ let modelUsage;
1581
+ let usage = nonModelUsage;
1569
1582
  let sawProviderFinish = false;
1570
1583
  let step = 0;
1571
1584
  let selectedModel;
@@ -1640,8 +1653,10 @@ function createRunExecutor(dependencies) {
1640
1653
  snapshot = compacted.snapshot;
1641
1654
  observedVersion = snapshot.version;
1642
1655
  run = findRun(snapshot.runs, run.id);
1643
- if (compacted.usage)
1644
- usage = addUsage(usage, compacted.usage);
1656
+ if (compacted.usage) {
1657
+ nonModelUsage = addUsage(nonModelUsage, compacted.usage);
1658
+ usage = modelUsage ? addUsage(nonModelUsage, modelUsage) : nonModelUsage;
1659
+ }
1645
1660
  }
1646
1661
  const assertCurrent = async () => {
1647
1662
  if (executionSignal.aborted)
@@ -1998,7 +2013,8 @@ function createRunExecutor(dependencies) {
1998
2013
  usage: part.usage,
1999
2014
  providerMetadata: part.providerMetadata
2000
2015
  }) ?? normalizeSdkUsage(part.usage);
2001
- usage = addUsage(usage, stepUsage);
2016
+ modelUsage = addUsage(modelUsage, stepUsage);
2017
+ usage = nonModelUsage ? addUsage(nonModelUsage, modelUsage) : modelUsage;
2002
2018
  config.observe?.emit({
2003
2019
  schemaVersion: 1,
2004
2020
  eventId: generateId(),
@@ -2023,7 +2039,8 @@ function createRunExecutor(dependencies) {
2023
2039
  }
2024
2040
  if (part.type === "finish") {
2025
2041
  sawProviderFinish = true;
2026
- usage = mergeRunTotals(normalizeSdkUsage(part.totalUsage), usage);
2042
+ modelUsage = mergeModelTotals(normalizeSdkUsage(part.totalUsage), modelUsage);
2043
+ usage = nonModelUsage ? addUsage(nonModelUsage, modelUsage) : modelUsage;
2027
2044
  }
2028
2045
  if (eventCount % checkpointEveryEvents === 0)
2029
2046
  await checkpoint();
@@ -2385,6 +2402,7 @@ function createAgentRuntime(config) {
2385
2402
  assistantMessageId,
2386
2403
  state: "queued",
2387
2404
  revision: 0,
2405
+ ...policy === "interrupt-next" && { queuePriority: "interrupt-next" },
2388
2406
  createdAt: nowIso,
2389
2407
  updatedAt: nowIso
2390
2408
  });
@@ -2394,7 +2412,7 @@ function createAgentRuntime(config) {
2394
2412
  return;
2395
2413
  });
2396
2414
  const outerResult = Promise.withResolvers();
2397
- const reservation = config.runs?.coalescePending ? reserveAdmission(key, runId) : undefined;
2415
+ const reservation = config.runs?.coalescePending && policy !== "interrupt-next" ? reserveAdmission(key, runId) : undefined;
2398
2416
  const previousAcceptance = reservation?.lane.acceptanceTail ?? Promise.resolve();
2399
2417
  const acceptanceDone = Promise.withResolvers();
2400
2418
  if (reservation) {
@@ -2918,7 +2936,22 @@ function historyPositions(messages) {
2918
2936
  }
2919
2937
  function orderRuns(messages, runs) {
2920
2938
  const positionOf = historyPositions(messages);
2921
- return [...runs].sort((left, right) => left.createdAt.localeCompare(right.createdAt) || positionOf(left) - positionOf(right) || left.id.localeCompare(right.id));
2939
+ const fallback = (left, right) => left.createdAt.localeCompare(right.createdAt) || positionOf(left) - positionOf(right) || left.id.localeCompare(right.id);
2940
+ return [...runs].sort((left, right) => {
2941
+ if (left.executionSequence !== undefined && right.executionSequence !== undefined && left.executionSequence !== right.executionSequence) {
2942
+ return left.executionSequence - right.executionSequence;
2943
+ }
2944
+ const leftStarted = left.executionSequence !== undefined || left.state !== "queued";
2945
+ const rightStarted = right.executionSequence !== undefined || right.state !== "queued";
2946
+ if (leftStarted !== rightStarted)
2947
+ return leftStarted ? -1 : 1;
2948
+ if (!leftStarted && !rightStarted) {
2949
+ const priority = Number(right.queuePriority !== undefined) - Number(left.queuePriority !== undefined);
2950
+ if (priority !== 0)
2951
+ return priority;
2952
+ }
2953
+ return fallback(left, right);
2954
+ });
2922
2955
  }
2923
2956
  function orderRunMessages(messages, runs) {
2924
2957
  const byId = new Map(messages.map((message) => [message.id, message]));
@@ -3030,7 +3063,7 @@ function reduceStore(current, operation) {
3030
3063
  if (input.coalesceIntoRunId !== undefined && (!coalescedRun || coalescedRun.conversationId !== input.input.conversationId || coalescedRun.state !== "queued" || coalescedRun.ownerId !== undefined || coalescedRun.terminalReason !== undefined)) {
3031
3064
  return coalescedRun ? conflict(coalescedRun.revision) : { outcome: "not_found" };
3032
3065
  }
3033
- if (input.run.conversationId !== input.input.conversationId || input.run.inputMessageIds.length !== 1 || input.run.inputMessageIds[0] !== input.input.id || input.run.state !== "queued" || input.run.revision !== 0 || input.run.ownerId !== undefined || input.run.terminalReason !== undefined || input.run.terminalPolicyName !== undefined || input.input.role !== "user" || input.input.status !== "committed" || input.input.runId !== undefined || current.messages.some((message) => message.id === input.input.id) || coalescedRun !== undefined && input.input.id === coalescedRun.assistantMessageId || !coalescedRun && (input.run.assistantMessageId === input.input.id || current.runs.some((candidate) => candidate.id === input.run.id) || current.runs.some((candidate) => candidate.assistantMessageId === input.run.assistantMessageId) || current.messages.some((message) => message.id === input.run.assistantMessageId))) {
3066
+ if (input.run.conversationId !== input.input.conversationId || input.run.inputMessageIds.length !== 1 || input.run.inputMessageIds[0] !== input.input.id || input.run.state !== "queued" || input.run.revision !== 0 || input.run.executionSequence !== undefined || input.run.ownerId !== undefined || input.run.terminalReason !== undefined || input.run.terminalPolicyName !== undefined || input.input.role !== "user" || input.input.status !== "committed" || input.input.runId !== undefined || current.messages.some((message) => message.id === input.input.id) || coalescedRun !== undefined && input.input.id === coalescedRun.assistantMessageId || !coalescedRun && (input.run.assistantMessageId === input.input.id || current.runs.some((candidate) => candidate.id === input.run.id) || current.runs.some((candidate) => candidate.assistantMessageId === input.run.assistantMessageId) || current.messages.some((message) => message.id === input.run.assistantMessageId))) {
3034
3067
  throw new TypeError("Input and queued run do not form one valid assignment");
3035
3068
  }
3036
3069
  const assignedRun = coalescedRun ? AgentRunSchema.parse({
@@ -3069,6 +3102,7 @@ function reduceStore(current, operation) {
3069
3102
  const next = AgentRunSchema.parse({
3070
3103
  ...run,
3071
3104
  state: "running",
3105
+ executionSequence: run.executionSequence ?? current.version + 1,
3072
3106
  ownerId: operation.input.ownerId,
3073
3107
  fencingToken: (run.fencingToken ?? 0) + 1,
3074
3108
  revision: run.revision + 1,
@@ -3660,6 +3694,7 @@ export {
3660
3694
  AgentRecoverablePageSchema,
3661
3695
  AgentRunEventSchema,
3662
3696
  AgentRunMetricsSchema,
3697
+ AgentRunQueuePrioritySchema,
3663
3698
  AgentRunSchema,
3664
3699
  AgentRunStartedEventSchema,
3665
3700
  AgentRunStateEventSchema,
@@ -103,6 +103,7 @@ var AgentRunStateSchema = z.enum([
103
103
  "cancelled",
104
104
  "abandoned"
105
105
  ]);
106
+ var AgentRunQueuePrioritySchema = z.enum(["interrupt-next"]);
106
107
  var AgentTerminalReasonSchema = z.enum([
107
108
  "success",
108
109
  "policy_stop",
@@ -174,6 +175,8 @@ var AgentRunFieldsSchema = z.object({
174
175
  assistantMessageId: AgentRecordIdSchema,
175
176
  state: AgentRunStateSchema,
176
177
  revision: AgentRecordVersionSchema,
178
+ queuePriority: AgentRunQueuePrioritySchema.optional(),
179
+ executionSequence: AgentRecordVersionSchema.optional(),
177
180
  ownerId: z.string().min(1).optional(),
178
181
  fencingToken: AgentRecordVersionSchema.optional(),
179
182
  terminalReason: AgentTerminalReasonSchema.optional(),
@@ -253,4 +256,4 @@ var AgentRunMetricsSchema = z.object({
253
256
  ttftMs: z.number().nonnegative().optional()
254
257
  });
255
258
 
256
- export { AgentRecordIdSchema, AgentRecordVersionSchema, AgentTimestampSchema, AgentJsonObjectSchema, AgentProviderEnvelopeSchema, AgentTextPartSchema, AgentReasoningPartSchema, AgentFilePartSchema, AgentSourcePartSchema, AgentToolCallPartSchema, AgentToolResultPartSchema, AgentOpaquePartSchema, AgentControlPartSchema, AgentMessagePartSchema, AgentMessageRoleSchema, AgentMessageStatusSchema, AgentMessageSchema, AgentAssistantPlaceholderSchema, AgentRunStateSchema, AgentTerminalReasonSchema, runStateForTerminalReason, AgentProvenanceSchema, AgentUsageValueSchema, AgentCostValueSchema, AgentUsageSchema, AgentRunSchema, AgentSnapshotSchema, AgentRunMetricsSchema };
259
+ export { AgentRecordIdSchema, AgentRecordVersionSchema, AgentTimestampSchema, AgentJsonObjectSchema, AgentProviderEnvelopeSchema, AgentTextPartSchema, AgentReasoningPartSchema, AgentFilePartSchema, AgentSourcePartSchema, AgentToolCallPartSchema, AgentToolResultPartSchema, AgentOpaquePartSchema, AgentControlPartSchema, AgentMessagePartSchema, AgentMessageRoleSchema, AgentMessageStatusSchema, AgentMessageSchema, AgentAssistantPlaceholderSchema, AgentRunStateSchema, AgentRunQueuePrioritySchema, AgentTerminalReasonSchema, runStateForTerminalReason, AgentProvenanceSchema, AgentUsageValueSchema, AgentCostValueSchema, AgentUsageSchema, AgentRunSchema, AgentSnapshotSchema, AgentRunMetricsSchema };
@@ -1 +1 @@
1
- {"version":3,"file":"agent-store-conformance.d.ts","sourceRoot":"","sources":["../../src/testing/agent-store-conformance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,WAAW,CACT,OAAO,EAAE,4BAA4B,GACpC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClD;;;;;;;;OAQG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAwCD,gFAAgF;AAChF,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,IAAI,CAAC,CAiCf"}
1
+ {"version":3,"file":"agent-store-conformance.d.ts","sourceRoot":"","sources":["../../src/testing/agent-store-conformance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;;;;GASG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,WAAW,CACT,OAAO,EAAE,4BAA4B,GACpC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClD;;;;;;;;OAQG;IACH,OAAO,CAAC,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAwCD,gFAAgF;AAChF,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,IAAI,CAAC,CAkCf"}
package/dist/testing.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AgentMessageSchema,
3
3
  AgentRunSchema
4
- } from "./index-fhsmrzj7.js";
4
+ } from "./index-ysphyxax.js";
5
5
  import {
6
6
  createApplication
7
7
  } from "./index-6wzr93cg.js";
@@ -150,7 +150,8 @@ async function runAgentStoreConformance(config) {
150
150
  `${run}-recovery`,
151
151
  `${run}-absorb`,
152
152
  `${run}-causal-history`,
153
- `${run}-causal-active`
153
+ `${run}-causal-active`,
154
+ `${run}-interrupt-priority`
154
155
  ]
155
156
  };
156
157
  const store = await config.createStore(context);
@@ -176,10 +177,11 @@ async function conformanceScenario(store, conversationIds) {
176
177
  recoveryConversationId,
177
178
  absorbConversationId,
178
179
  causalHistoryConversationId,
179
- causalActiveConversationId
180
+ causalActiveConversationId,
181
+ interruptPriorityConversationId
180
182
  ] = conversationIds;
181
- if (!conversationId || !recoveryConversationId || !absorbConversationId || !causalHistoryConversationId || !causalActiveConversationId) {
182
- throw new Error("Agent store conformance requires five conversation identities");
183
+ if (!conversationId || !recoveryConversationId || !absorbConversationId || !causalHistoryConversationId || !causalActiveConversationId || !interruptPriorityConversationId) {
184
+ throw new Error("Agent store conformance requires six conversation identities");
183
185
  }
184
186
  const absentConversationId = `${conversationId}-absent`;
185
187
  const firstInput = userMessage(conversationId, "input-1");
@@ -452,6 +454,14 @@ async function conformanceScenario(store, conversationIds) {
452
454
  if (interruptedRun.usage?.cost?.value !== 0.25) {
453
455
  throw new Error("An interrupt must not discard the figure the run had already spent");
454
456
  }
457
+ const terminalUsage = {
458
+ inputTokens: { value: 3000, provenance: "computed" },
459
+ outputTokens: { value: 300, provenance: "computed" },
460
+ reasoningTokens: { value: 30, provenance: "computed" },
461
+ cacheReadTokens: { value: 200, provenance: "computed" },
462
+ cacheWriteTokens: { value: 100, provenance: "computed" },
463
+ cost: { value: 1.5, currency: "USD", provenance: "computed" }
464
+ };
455
465
  const terminalResults = await Promise.all([
456
466
  store.commitRunTerminal({
457
467
  conversationId,
@@ -460,11 +470,7 @@ async function conformanceScenario(store, conversationIds) {
460
470
  ownerId: "conformance-owner",
461
471
  assistant: terminalAssistant,
462
472
  reason: "success",
463
- usage: {
464
- inputTokens: { value: 3000, provenance: "computed" },
465
- outputTokens: { value: 300, provenance: "computed" },
466
- cost: { value: 1.5, currency: "USD", provenance: "computed" }
467
- }
473
+ usage: terminalUsage
468
474
  }),
469
475
  store.commitRunTerminal({
470
476
  conversationId,
@@ -473,11 +479,7 @@ async function conformanceScenario(store, conversationIds) {
473
479
  ownerId: "conformance-owner",
474
480
  assistant: terminalAssistant,
475
481
  reason: "success",
476
- usage: {
477
- inputTokens: { value: 3000, provenance: "computed" },
478
- outputTokens: { value: 300, provenance: "computed" },
479
- cost: { value: 1.5, currency: "USD", provenance: "computed" }
480
- }
482
+ usage: terminalUsage
481
483
  })
482
484
  ]);
483
485
  const terminalOutcomes = terminalResults.map((result) => result.outcome).sort();
@@ -489,13 +491,16 @@ async function conformanceScenario(store, conversationIds) {
489
491
  throw new Error("Terminal race produced no applied result");
490
492
  }
491
493
  const settledRun = terminalApplied.snapshot.runs.find((run) => run.id === running.id);
492
- if (settledRun?.usage?.cost?.value !== 1.5) {
494
+ if (JSON.stringify(settledRun?.usage) !== JSON.stringify(terminalUsage)) {
493
495
  throw new Error("Terminal commit did not persist the run usage it was given");
494
496
  }
495
497
  const terminalView = await store.loadRun({ conversationId, runId: running.id });
496
498
  if (terminalView?.run.terminalReason !== "success") {
497
499
  throw new Error("loadRun must report the terminal reason a settled run ended with");
498
500
  }
501
+ if (JSON.stringify(terminalView.run.usage) !== JSON.stringify(terminalUsage)) {
502
+ throw new Error("loadRun must return every persisted terminal usage field");
503
+ }
499
504
  if (JSON.stringify(terminalView.assistant) !== JSON.stringify(terminalAssistant)) {
500
505
  throw new Error("loadRun must retain the answer a settled run produced");
501
506
  }
@@ -562,8 +567,95 @@ async function conformanceScenario(store, conversationIds) {
562
567
  }
563
568
  await assertCausalHistoryOrder(store, causalHistoryConversationId);
564
569
  await assertActiveRunCausalOrder(store, causalActiveConversationId);
570
+ await assertInterruptPriorityOrder(store, interruptPriorityConversationId);
565
571
  await assertAbsorptionIsAtomic(store, absorbConversationId);
566
572
  }
573
+ async function assertInterruptPriorityOrder(store, conversationId) {
574
+ const inputs = ["priority-a", "priority-b", "priority-c"].map((id) => userMessage(conversationId, id));
575
+ const [inputA, inputB, inputC] = inputs;
576
+ if (!inputA || !inputB || !inputC)
577
+ throw new Error("Priority fixture is incomplete");
578
+ const runA = queuedRun(conversationId, inputA.id, "priority-run-a");
579
+ const runB = queuedRun(conversationId, inputB.id, "priority-run-b");
580
+ const runC = AgentRunSchema.parse({
581
+ ...queuedRun(conversationId, inputC.id, "priority-run-c"),
582
+ queuePriority: "interrupt-next"
583
+ });
584
+ requireOutcome(await store.acceptInputAndAssignRun({ idempotencyKey: runA.id, input: inputA, run: runA }), "applied");
585
+ const acquiredA = await store.acquireRun({
586
+ conversationId,
587
+ runId: runA.id,
588
+ expectedRevision: runA.revision,
589
+ ownerId: "priority-owner-a"
590
+ });
591
+ requireOutcome(acquiredA, "applied");
592
+ const runningA = acquiredA.snapshot.runs.find((run) => run.id === runA.id);
593
+ if (!runningA)
594
+ throw new Error("Priority lead run disappeared after acquisition");
595
+ requireOutcome(await store.acceptInputAndAssignRun({ idempotencyKey: runB.id, input: inputB, run: runB }), "applied");
596
+ requireOutcome(await store.acceptInputAndAssignRun({ idempotencyKey: runC.id, input: inputC, run: runC }), "applied");
597
+ const active = await store.listActiveRuns(conversationId);
598
+ if (active.map((run) => run.id).join(",") !== `${runA.id},${runC.id},${runB.id}`) {
599
+ throw new Error("Active runs did not place urgent work before ordinary pending work");
600
+ }
601
+ requireOutcome(await store.acquireRun({
602
+ conversationId,
603
+ runId: runB.id,
604
+ expectedRevision: runB.revision,
605
+ ownerId: "priority-owner-b"
606
+ }), "conflict");
607
+ const abandonedA = await store.recoverRun({
608
+ conversationId,
609
+ runId: runA.id,
610
+ expectedRevision: runningA.revision,
611
+ action: "abandon"
612
+ });
613
+ requireOutcome(abandonedA, "applied");
614
+ const queuedC = abandonedA.snapshot.runs.find((run) => run.id === runC.id);
615
+ if (!queuedC)
616
+ throw new Error("Urgent run disappeared after predecessor settlement");
617
+ const acquiredC = await store.acquireRun({
618
+ conversationId,
619
+ runId: runC.id,
620
+ expectedRevision: queuedC.revision,
621
+ ownerId: "priority-owner-c"
622
+ });
623
+ requireOutcome(acquiredC, "applied");
624
+ const runningC = acquiredC.snapshot.runs.find((run) => run.id === runC.id);
625
+ if (!runningC)
626
+ throw new Error("Urgent run disappeared after acquisition");
627
+ requireOutcome(await store.acquireRun({
628
+ conversationId,
629
+ runId: runB.id,
630
+ expectedRevision: runB.revision,
631
+ ownerId: "priority-owner-b"
632
+ }), "conflict");
633
+ const abandonedC = await store.recoverRun({
634
+ conversationId,
635
+ runId: runC.id,
636
+ expectedRevision: runningC.revision,
637
+ action: "abandon"
638
+ });
639
+ requireOutcome(abandonedC, "applied");
640
+ const queuedB = abandonedC.snapshot.runs.find((run) => run.id === runB.id);
641
+ if (!queuedB)
642
+ throw new Error("Ordinary run disappeared after urgent settlement");
643
+ const acquiredB = await store.acquireRun({
644
+ conversationId,
645
+ runId: runB.id,
646
+ expectedRevision: queuedB.revision,
647
+ ownerId: "priority-owner-b"
648
+ });
649
+ requireOutcome(acquiredB, "applied");
650
+ const ordered = acquiredB.snapshot.runs.map((run) => run.id).join(",");
651
+ if (ordered !== `${runA.id},${runC.id},${runB.id}`) {
652
+ throw new Error(`Durable execution order was not preserved: ${ordered}`);
653
+ }
654
+ const [sequenceA, sequenceC, sequenceB] = acquiredB.snapshot.runs.map((run) => run.executionSequence);
655
+ if (sequenceA === undefined || sequenceC === undefined || sequenceB === undefined || !(sequenceA < sequenceC && sequenceC < sequenceB)) {
656
+ throw new Error("Acquisition did not persist increasing execution sequence values");
657
+ }
658
+ }
567
659
  async function assertActiveRunCausalOrder(store, conversationId) {
568
660
  for (const id of ["z-causal-run", "a-causal-run"]) {
569
661
  const input = userMessage(conversationId, `${id}-input`);
package/llms-full.txt CHANGED
@@ -3964,15 +3964,22 @@ input + queued run → running → execution settled → terminal CAS → succes
3964
3964
 
3965
3965
  ## What happens to a run when new input arrives
3966
3966
 
3967
- `runs.inputPolicy` decides. It takes four values, or a function returning one:
3967
+ `runs.inputPolicy` decides. It takes five values, or a function returning one:
3968
3968
 
3969
3969
  | policy | the run in flight | what it already produced |
3970
3970
  |--------|-------------------|--------------------------|
3971
3971
  | `queue` (default) | finishes first | kept |
3972
3972
  | `inject` | continues, and answers the new input too | kept, and built on |
3973
3973
  | `interrupt` | ends | kept, and marked as cut off |
3974
+ | `interrupt-next` | ends; this input runs before ordinary queued work | kept, and marked as cut off |
3974
3975
  | `supersede` | ends | discarded from the prompt, kept in the record |
3975
3976
 
3977
+ `interrupt-next` is the explicit priority path for an urgent input. If A is
3978
+ running, ordinary B is queued, and urgent C arrives, the coordinator aborts A,
3979
+ waits for A to settle and then runs C before B. B keeps its durable identity and
3980
+ eventually runs. Urgent inputs remain FIFO among themselves. They do not
3981
+ coalesce into an ordinary pending run: that would erase the priority boundary.
3982
+
3976
3983
  `interrupt` and `supersede` differ in exactly one thing, and the question that
3977
3984
  picks between them is **not** "was the run interrupted" but **"did anyone see
3978
3985
  what it produced"**:
@@ -4213,9 +4220,11 @@ checkpoint/terminal CAS and tool context, so a distributed adapter can reject an
4213
4220
  an owner label is reused. Lease expiry and renewal remain application-owned.
4214
4221
 
4215
4222
  On startup, `runtime.recover({ resolveContext })` consumes bounded lightweight
4216
- pages, then restores each conversation's canonical causal order before any run
4217
- acquires. Scan identifiers and page boundaries therefore never become queue
4218
- order. Its safe default resumes queued runs and reports acquired or
4223
+ pages, then restores each conversation's durable execution order before any run
4224
+ acquires. Persisted `executionSequence` orders work that started; queued
4225
+ `interrupt-next` work precedes ordinary queued work with FIFO preserved inside
4226
+ each class. Scan identifiers, equal timestamps and page boundaries therefore
4227
+ never become queue order. Its safe default resumes queued runs and reports acquired or
4219
4228
  `interrupt_requested` runs as skipped. A policy may requeue acquired work only
4220
4229
  with explicit replay-safe evidence, or abandon it only with stale-owner
4221
4230
  evidence. Each attempted run returns its own outcome/error; a `resumed` or
@@ -4499,7 +4508,8 @@ outbox.
4499
4508
  `createAgentRaceTrace`. Barriers have bounded teardown, traces assert exact partial order, and the
4500
4509
  helpers are exercised from packed Bun and Node consumers. `runAgentStoreConformance` runs duplicate,
4501
4510
  coalescing, collision, stale checkpoint, replay safety, terminal race, absorption, bounded reads,
4502
- causal queued-history order, compaction and recovery invariants against any fresh durable adapter.
4511
+ causal queued-history order, durable interrupt priority, compaction and recovery invariants against
4512
+ any fresh durable adapter.
4503
4513
 
4504
4514
  It picks its conversation identities itself and passes them to `createStore(context)` **before the
4505
4515
  first mutation**, so an adapter whose runtime rows reference an application-owned conversation row
@@ -11524,6 +11534,7 @@ Server-only optional application runtime. See the
11524
11534
  | `defineAgentProtocol` | function | declare context, input metadata, canonical parts and optional pre-CAS terminal acceptance (`allow-empty`, `require-output` or callback) |
11525
11535
  | `hasAgentTerminalOutput` | function | generic `require-output` predicate for non-blank text, generated files, structured provider parts and explicit tool-only policy stops |
11526
11536
  | `AgentMessageSchema` / `AgentRunSchema` / `AgentSnapshotSchema` | schema | versioned canonical engine records |
11537
+ | `AgentRunQueuePrioritySchema` | schema | durable opt-in priority for queued `interrupt-next` runs |
11527
11538
  | `AgentRuntimeStore` | _type_ | aggregate CAS transaction boundary for message, run and compaction mutations |
11528
11539
  | `createAgentRuntimeStore` | function | build the aggregate store from one coherent transaction driver; framework owns every state transition |
11529
11540
  | `AgentRuntimeStoreDriver` | _type_ | ORM-neutral transaction over a bounded head, normalized runs/admissions, product history and indexed run recovery |
@@ -11573,7 +11584,8 @@ Canonical protocol exports are `AgentProtocol`, `AgentProtocolConfig`, `AgentTer
11573
11584
  `AgentToolCallPartSchema`, `AgentToolResultPartSchema`, `AgentOpaquePartSchema`,
11574
11585
  `AgentControlPartSchema`, `AgentMessageRoleSchema`, `AgentMessageStatusSchema`, `AgentMessage`,
11575
11586
  `AgentAssistantPlaceholderSchema`, `AgentAssistantPlaceholder`, `AgentRunStateSchema`,
11576
- `AgentTerminalReasonSchema`, `AgentTerminalReason`, `AgentRun`, `AgentSnapshot`,
11587
+ `AgentTerminalReasonSchema`, `AgentTerminalReason`, `AgentRunQueuePrioritySchema`,
11588
+ `AgentRunQueuePriority`, `AgentRun`, `AgentSnapshot`,
11577
11589
  `AgentUsageValueSchema`, `AgentCostValueSchema`, `AgentUsageSchema`, `AgentUsage` and
11578
11590
  `AgentRunMetrics`.
11579
11591
 
@@ -11589,7 +11601,7 @@ integer — `AgentUsageValueSchema` and `AgentTokenCountSchema` refuse a fractio
11589
11601
  provider figure that is not a whole number is normalised to `unavailable` rather than thrown.
11590
11602
  `AgentCostValueSchema.value` stays fractional, because money is.
11591
11603
 
11592
- `runs.inputPolicy` takes `queue` (default), `inject`, `interrupt` or `supersede`, or a function of
11604
+ `runs.inputPolicy` takes `queue` (default), `inject`, `interrupt`, `interrupt-next` or `supersede`, or a function of
11593
11605
  the raw input returning one. `inject` lets a run in flight take a newly arrived input into its prompt
11594
11606
  at a step boundary and answer it too; the absorption is committed in the **same transaction** as that
11595
11607
  run's terminal record, via `CommitRunTerminal.absorb`, so a run that ends any other way leaves an
@@ -11598,6 +11610,12 @@ ordinary queued successor. The absorbed run ends with `terminalReason: 'absorbed
11598
11610
  its own**; a submission on its idempotency key resolves through that pointer to the answer
11599
11611
  (→ ADR 0113).
11600
11612
 
11613
+ `interrupt-next` interrupts the active run, waits for its real settlement and then executes the new
11614
+ input before ordinary pending work. Ordinary work is not dropped or re-admitted, and urgent work is
11615
+ FIFO within its own class. `AgentRun.queuePriority` persists the pending class;
11616
+ `AgentRun.executionSequence` persists the actual first-acquisition order, so recovery and canonical
11617
+ history preserve the same `A → C → B` order across equal timestamps and scan pages (→ ADR 0127).
11618
+
11601
11619
  With `queue`, a durable successor admission is not prompt eligibility: the current executor sees
11602
11620
  only records through its own run boundary. Snapshot history is normalized to causal turn order
11603
11621
  (assigned input(s), assistant, then successor input(s)) even when the storage codec physically
@@ -11606,7 +11624,7 @@ appended the successor before the predecessor checkpoint.
11606
11624
  `AgentRuntimeStore` has two **bounded** reads beside `loadSnapshot`:
11607
11625
  `loadRun({ conversationId, runId })` returns an `AgentRunView` — the run, the conversation version it
11608
11626
  was read at, and the retained answer once the run is terminal — or `undefined`; `listActiveRuns(conversationId)`
11609
- returns the runs that have not ended, ordered by `createdAt` then `id`. Neither reads history, so
11627
+ returns the runs that have not ended in durable execution/priority order. Neither reads history, so
11610
11628
  neither grows with the length of the conversation, and neither needs anything new from
11611
11629
  `AgentRuntimeStoreDriver`. `loadSnapshot` and every mutation result still carry the whole
11612
11630
  conversation — that is what the store's reducer validates against, and what the runtime builds a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.68.5",
3
+ "version": "0.68.7",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",