stitchkit 0.57.0 → 0.59.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 (34) hide show
  1. package/dist/agent-runtime/compaction.d.ts +3 -0
  2. package/dist/agent-runtime/compaction.d.ts.map +1 -1
  3. package/dist/agent-runtime/events.d.ts +40 -0
  4. package/dist/agent-runtime/events.d.ts.map +1 -1
  5. package/dist/agent-runtime/history.d.ts +13 -0
  6. package/dist/agent-runtime/history.d.ts.map +1 -1
  7. package/dist/agent-runtime/managed-tools.d.ts +1 -0
  8. package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
  9. package/dist/agent-runtime/models.d.ts +39 -3
  10. package/dist/agent-runtime/models.d.ts.map +1 -1
  11. package/dist/agent-runtime/observability.d.ts +3 -0
  12. package/dist/agent-runtime/observability.d.ts.map +1 -1
  13. package/dist/agent-runtime/prompt.d.ts +21 -0
  14. package/dist/agent-runtime/prompt.d.ts.map +1 -1
  15. package/dist/agent-runtime/runtime.d.ts +9 -1
  16. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  17. package/dist/agent-runtime/schemas.d.ts +2 -0
  18. package/dist/agent-runtime/schemas.d.ts.map +1 -1
  19. package/dist/agent-runtime/store-driver.d.ts +202 -24
  20. package/dist/agent-runtime/store-driver.d.ts.map +1 -1
  21. package/dist/agent-runtime/store.d.ts +229 -0
  22. package/dist/agent-runtime/store.d.ts.map +1 -1
  23. package/dist/agent-runtime/testing.d.ts +10 -1
  24. package/dist/agent-runtime/testing.d.ts.map +1 -1
  25. package/dist/agent-runtime.d.ts +5 -5
  26. package/dist/agent-runtime.d.ts.map +1 -1
  27. package/dist/agent-runtime.js +629 -200
  28. package/dist/{index-1f4fcj0b.js → index-vtjgx3vv.js} +1 -0
  29. package/dist/testing/agent-store-conformance.d.ts.map +1 -1
  30. package/dist/testing.d.ts +1 -0
  31. package/dist/testing.d.ts.map +1 -1
  32. package/dist/testing.js +198 -4
  33. package/llms-full.txt +156 -36
  34. package/package.json +1 -1
@@ -1,17 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  import { type AgentMessage } from './schemas';
3
3
  import { type AgentRuntimeStore } from './store';
4
- export declare const AgentAdmissionIdentitySchema: z.ZodObject<{
5
- idempotencyKey: z.ZodString;
6
- inputMessageId: z.ZodString;
7
- runId: z.ZodString;
8
- assistantMessageId: z.ZodString;
9
- }, z.core.$strip>;
10
- export declare const AgentStoredStateSchema: z.ZodObject<{
4
+ export declare const AgentRuntimeHeadSchema: z.ZodObject<{
11
5
  schemaVersion: z.ZodLiteral<1>;
12
6
  conversationId: z.ZodString;
13
7
  version: z.ZodInt;
14
- runs: z.ZodArray<z.ZodObject<{
8
+ }, z.core.$strip>;
9
+ export declare const AgentStoredRunSchema: z.ZodObject<{
10
+ schemaVersion: z.ZodLiteral<1>;
11
+ run: z.ZodObject<{
15
12
  schemaVersion: z.ZodLiteral<1>;
16
13
  id: z.ZodString;
17
14
  conversationId: z.ZodString;
@@ -29,6 +26,7 @@ export declare const AgentStoredStateSchema: z.ZodObject<{
29
26
  }>;
30
27
  revision: z.ZodInt;
31
28
  ownerId: z.ZodOptional<z.ZodString>;
29
+ fencingToken: z.ZodOptional<z.ZodInt>;
32
30
  terminalReason: z.ZodOptional<z.ZodEnum<{
33
31
  abandoned: "abandoned";
34
32
  cancelled: "cancelled";
@@ -43,16 +41,172 @@ export declare const AgentStoredStateSchema: z.ZodObject<{
43
41
  terminalPolicyName: z.ZodOptional<z.ZodString>;
44
42
  createdAt: z.ZodISODateTime;
45
43
  updatedAt: z.ZodISODateTime;
44
+ }, z.core.$strip>;
45
+ terminalAssistant: z.ZodOptional<z.ZodObject<{
46
+ schemaVersion: z.ZodLiteral<1>;
47
+ id: z.ZodString;
48
+ conversationId: z.ZodString;
49
+ runId: z.ZodOptional<z.ZodString>;
50
+ role: z.ZodEnum<{
51
+ assistant: "assistant";
52
+ summary: "summary";
53
+ system: "system";
54
+ user: "user";
55
+ }>;
56
+ status: z.ZodEnum<{
57
+ committed: "committed";
58
+ completed: "completed";
59
+ failed: "failed";
60
+ interrupted: "interrupted";
61
+ streaming: "streaming";
62
+ }>;
63
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
64
+ type: z.ZodLiteral<"text">;
65
+ text: z.ZodString;
66
+ }, z.core.$strip>, z.ZodObject<{
67
+ type: z.ZodLiteral<"reasoning">;
68
+ text: z.ZodString;
69
+ provider: z.ZodOptional<z.ZodObject<{
70
+ schemaVersion: z.ZodInt;
71
+ provider: z.ZodString;
72
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
73
+ }, z.core.$strip>>;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ type: z.ZodLiteral<"file">;
76
+ mediaType: z.ZodString;
77
+ reference: z.ZodString;
78
+ filename: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strip>, z.ZodObject<{
80
+ type: z.ZodLiteral<"source">;
81
+ sourceId: z.ZodString;
82
+ url: z.ZodOptional<z.ZodURL>;
83
+ title: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ type: z.ZodLiteral<"tool-call">;
86
+ callId: z.ZodString;
87
+ toolName: z.ZodString;
88
+ input: z.ZodJSONSchema;
89
+ provider: z.ZodOptional<z.ZodObject<{
90
+ schemaVersion: z.ZodInt;
91
+ provider: z.ZodString;
92
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
93
+ }, z.core.$strip>>;
94
+ }, z.core.$strip>, z.ZodObject<{
95
+ type: z.ZodLiteral<"tool-result">;
96
+ callId: z.ZodString;
97
+ toolName: z.ZodString;
98
+ outcome: z.ZodEnum<{
99
+ error: "error";
100
+ interrupted: "interrupted";
101
+ success: "success";
102
+ }>;
103
+ output: z.ZodOptional<z.ZodJSONSchema>;
104
+ }, z.core.$strip>, z.ZodObject<{
105
+ type: z.ZodLiteral<"provider">;
106
+ envelope: z.ZodObject<{
107
+ schemaVersion: z.ZodInt;
108
+ provider: z.ZodString;
109
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
110
+ }, z.core.$strip>;
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ type: z.ZodLiteral<"control">;
113
+ reason: z.ZodEnum<{
114
+ "run-interrupted": "run-interrupted";
115
+ "stale-run": "stale-run";
116
+ }>;
117
+ }, z.core.$strip>], "type">>;
118
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
119
+ createdAt: z.ZodISODateTime;
120
+ updatedAt: z.ZodISODateTime;
46
121
  }, z.core.$strip>>;
47
- admissions: z.ZodArray<z.ZodObject<{
48
- idempotencyKey: z.ZodString;
49
- inputMessageId: z.ZodString;
50
- runId: z.ZodString;
51
- assistantMessageId: z.ZodString;
52
- }, z.core.$strip>>;
53
122
  }, z.core.$strip>;
54
- export type AgentAdmissionIdentity = z.infer<typeof AgentAdmissionIdentitySchema>;
55
- export type AgentStoredState = z.infer<typeof AgentStoredStateSchema>;
123
+ export declare const AgentAdmissionReceiptSchema: z.ZodObject<{
124
+ schemaVersion: z.ZodLiteral<1>;
125
+ conversationId: z.ZodString;
126
+ idempotencyKey: z.ZodString;
127
+ input: z.ZodObject<{
128
+ schemaVersion: z.ZodLiteral<1>;
129
+ id: z.ZodString;
130
+ conversationId: z.ZodString;
131
+ runId: z.ZodOptional<z.ZodString>;
132
+ role: z.ZodEnum<{
133
+ assistant: "assistant";
134
+ summary: "summary";
135
+ system: "system";
136
+ user: "user";
137
+ }>;
138
+ status: z.ZodEnum<{
139
+ committed: "committed";
140
+ completed: "completed";
141
+ failed: "failed";
142
+ interrupted: "interrupted";
143
+ streaming: "streaming";
144
+ }>;
145
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
146
+ type: z.ZodLiteral<"text">;
147
+ text: z.ZodString;
148
+ }, z.core.$strip>, z.ZodObject<{
149
+ type: z.ZodLiteral<"reasoning">;
150
+ text: z.ZodString;
151
+ provider: z.ZodOptional<z.ZodObject<{
152
+ schemaVersion: z.ZodInt;
153
+ provider: z.ZodString;
154
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
155
+ }, z.core.$strip>>;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ type: z.ZodLiteral<"file">;
158
+ mediaType: z.ZodString;
159
+ reference: z.ZodString;
160
+ filename: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>, z.ZodObject<{
162
+ type: z.ZodLiteral<"source">;
163
+ sourceId: z.ZodString;
164
+ url: z.ZodOptional<z.ZodURL>;
165
+ title: z.ZodOptional<z.ZodString>;
166
+ }, z.core.$strip>, z.ZodObject<{
167
+ type: z.ZodLiteral<"tool-call">;
168
+ callId: z.ZodString;
169
+ toolName: z.ZodString;
170
+ input: z.ZodJSONSchema;
171
+ provider: z.ZodOptional<z.ZodObject<{
172
+ schemaVersion: z.ZodInt;
173
+ provider: z.ZodString;
174
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
175
+ }, z.core.$strip>>;
176
+ }, z.core.$strip>, z.ZodObject<{
177
+ type: z.ZodLiteral<"tool-result">;
178
+ callId: z.ZodString;
179
+ toolName: z.ZodString;
180
+ outcome: z.ZodEnum<{
181
+ error: "error";
182
+ interrupted: "interrupted";
183
+ success: "success";
184
+ }>;
185
+ output: z.ZodOptional<z.ZodJSONSchema>;
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ type: z.ZodLiteral<"provider">;
188
+ envelope: z.ZodObject<{
189
+ schemaVersion: z.ZodInt;
190
+ provider: z.ZodString;
191
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
192
+ }, z.core.$strip>;
193
+ }, z.core.$strip>, z.ZodObject<{
194
+ type: z.ZodLiteral<"control">;
195
+ reason: z.ZodEnum<{
196
+ "run-interrupted": "run-interrupted";
197
+ "stale-run": "stale-run";
198
+ }>;
199
+ }, z.core.$strip>], "type">>;
200
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
201
+ createdAt: z.ZodISODateTime;
202
+ updatedAt: z.ZodISODateTime;
203
+ }, z.core.$strip>;
204
+ runId: z.ZodString;
205
+ assistantMessageId: z.ZodString;
206
+ }, z.core.$strip>;
207
+ export type AgentRuntimeHead = z.infer<typeof AgentRuntimeHeadSchema>;
208
+ export type AgentStoredRun = z.infer<typeof AgentStoredRunSchema>;
209
+ export type AgentAdmissionReceipt = z.infer<typeof AgentAdmissionReceiptSchema>;
56
210
  export declare const AgentHistoryMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
57
211
  type: z.ZodLiteral<"admit">;
58
212
  input: z.ZodObject<{
@@ -313,6 +467,7 @@ export declare const AgentRecoverableDescriptorSchema: z.ZodObject<{
313
467
  }>;
314
468
  revision: z.ZodInt;
315
469
  ownerId: z.ZodOptional<z.ZodString>;
470
+ fencingToken: z.ZodOptional<z.ZodInt>;
316
471
  terminalReason: z.ZodOptional<z.ZodEnum<{
317
472
  abandoned: "abandoned";
318
473
  cancelled: "cancelled";
@@ -350,6 +505,7 @@ export declare const AgentRecoverablePageSchema: z.ZodObject<{
350
505
  }>;
351
506
  revision: z.ZodInt;
352
507
  ownerId: z.ZodOptional<z.ZodString>;
508
+ fencingToken: z.ZodOptional<z.ZodInt>;
353
509
  terminalReason: z.ZodOptional<z.ZodEnum<{
354
510
  abandoned: "abandoned";
355
511
  cancelled: "cancelled";
@@ -378,21 +534,43 @@ export type AgentStoreCompareAndSwapResult = {
378
534
  };
379
535
  export interface AgentRuntimeStoreDriver<TRANSACTION> {
380
536
  transaction<RESULT>(work: (transaction: TRANSACTION) => Promise<RESULT>): Promise<RESULT>;
381
- state: {
382
- load(transaction: TRANSACTION, conversationId: string): Promise<AgentStoredState | undefined>;
537
+ head: {
538
+ load(transaction: TRANSACTION, conversationId: string): Promise<AgentRuntimeHead | undefined>;
383
539
  compareAndSwap(transaction: TRANSACTION, input: {
384
540
  conversationId: string;
385
541
  expectedVersion: number;
386
- next: AgentStoredState;
387
- recoverable: readonly AgentRecoverableDescriptor[];
542
+ next: AgentRuntimeHead;
388
543
  }): Promise<AgentStoreCompareAndSwapResult>;
389
544
  };
545
+ runs: {
546
+ load(transaction: TRANSACTION, input: {
547
+ conversationId: string;
548
+ runId: string;
549
+ }): Promise<AgentStoredRun | undefined>;
550
+ loadByAssistantMessageId(transaction: TRANSACTION, input: {
551
+ conversationId: string;
552
+ assistantMessageId: string;
553
+ }): Promise<AgentStoredRun | undefined>;
554
+ loadMany(transaction: TRANSACTION, input: {
555
+ conversationId: string;
556
+ runIds: readonly string[];
557
+ }): Promise<readonly AgentStoredRun[]>;
558
+ listActive(transaction: TRANSACTION, conversationId: string): Promise<readonly AgentStoredRun[]>;
559
+ save(transaction: TRANSACTION, record: AgentStoredRun): Promise<void>;
560
+ };
561
+ admissions: {
562
+ load(transaction: TRANSACTION, input: {
563
+ conversationId: string;
564
+ idempotencyKey: string;
565
+ }): Promise<AgentAdmissionReceipt | undefined>;
566
+ loadByInputMessageId(transaction: TRANSACTION, input: {
567
+ conversationId: string;
568
+ inputMessageId: string;
569
+ }): Promise<AgentAdmissionReceipt | undefined>;
570
+ create(transaction: TRANSACTION, receipt: AgentAdmissionReceipt): Promise<void>;
571
+ };
390
572
  history: {
391
573
  load(transaction: TRANSACTION, conversationId: string): Promise<readonly AgentMessage[]>;
392
- loadById(transaction: TRANSACTION, input: {
393
- conversationId: string;
394
- messageId: string;
395
- }): Promise<AgentMessage | undefined>;
396
574
  apply(transaction: TRANSACTION, mutation: AgentHistoryMutation): Promise<void>;
397
575
  };
398
576
  scanRecoverable(input: {
@@ -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,EASlB,MAAM,WAAW,CAAC;AACnB,OAAO,EAKL,KAAK,iBAAiB,EAYvB,MAAM,SAAS,C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C,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;AAsiBD,wBAAgB,uBAAuB,CAAC,WAAW,EACjD,MAAM,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAC3C,iBAAiB,CA+KnB;AAuCD,oGAAoG;AACpG,wBAAgB,6BAA6B,IAAI,iBAAiB,CA6LjE"}
@@ -108,6 +108,7 @@ export declare const AgentStoreAppliedSchema: z.ZodObject<{
108
108
  }>;
109
109
  revision: z.ZodInt;
110
110
  ownerId: z.ZodOptional<z.ZodString>;
111
+ fencingToken: z.ZodOptional<z.ZodInt>;
111
112
  terminalReason: z.ZodOptional<z.ZodEnum<{
112
113
  abandoned: "abandoned";
113
114
  cancelled: "cancelled";
@@ -207,6 +208,117 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
207
208
  inputMessageId: z.ZodString;
208
209
  runId: z.ZodString;
209
210
  assistantMessageId: z.ZodString;
211
+ run: z.ZodObject<{
212
+ schemaVersion: z.ZodLiteral<1>;
213
+ id: z.ZodString;
214
+ conversationId: z.ZodString;
215
+ inputMessageIds: z.ZodArray<z.ZodString>;
216
+ assistantMessageId: z.ZodString;
217
+ state: z.ZodEnum<{
218
+ abandoned: "abandoned";
219
+ cancelled: "cancelled";
220
+ completed: "completed";
221
+ failed: "failed";
222
+ interrupt_requested: "interrupt_requested";
223
+ interrupted: "interrupted";
224
+ queued: "queued";
225
+ running: "running";
226
+ }>;
227
+ revision: z.ZodInt;
228
+ ownerId: z.ZodOptional<z.ZodString>;
229
+ fencingToken: z.ZodOptional<z.ZodInt>;
230
+ terminalReason: z.ZodOptional<z.ZodEnum<{
231
+ abandoned: "abandoned";
232
+ cancelled: "cancelled";
233
+ interrupted: "interrupted";
234
+ policy_stop: "policy_stop";
235
+ provider_failure: "provider_failure";
236
+ shutdown: "shutdown";
237
+ success: "success";
238
+ timeout: "timeout";
239
+ tool_failure: "tool_failure";
240
+ }>>;
241
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
242
+ createdAt: z.ZodISODateTime;
243
+ updatedAt: z.ZodISODateTime;
244
+ }, z.core.$strip>;
245
+ assistant: z.ZodOptional<z.ZodObject<{
246
+ schemaVersion: z.ZodLiteral<1>;
247
+ id: z.ZodString;
248
+ conversationId: z.ZodString;
249
+ runId: z.ZodOptional<z.ZodString>;
250
+ role: z.ZodEnum<{
251
+ assistant: "assistant";
252
+ summary: "summary";
253
+ system: "system";
254
+ user: "user";
255
+ }>;
256
+ status: z.ZodEnum<{
257
+ committed: "committed";
258
+ completed: "completed";
259
+ failed: "failed";
260
+ interrupted: "interrupted";
261
+ streaming: "streaming";
262
+ }>;
263
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
264
+ type: z.ZodLiteral<"text">;
265
+ text: z.ZodString;
266
+ }, z.core.$strip>, z.ZodObject<{
267
+ type: z.ZodLiteral<"reasoning">;
268
+ text: z.ZodString;
269
+ provider: z.ZodOptional<z.ZodObject<{
270
+ schemaVersion: z.ZodInt;
271
+ provider: z.ZodString;
272
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
273
+ }, z.core.$strip>>;
274
+ }, z.core.$strip>, z.ZodObject<{
275
+ type: z.ZodLiteral<"file">;
276
+ mediaType: z.ZodString;
277
+ reference: z.ZodString;
278
+ filename: z.ZodOptional<z.ZodString>;
279
+ }, z.core.$strip>, z.ZodObject<{
280
+ type: z.ZodLiteral<"source">;
281
+ sourceId: z.ZodString;
282
+ url: z.ZodOptional<z.ZodURL>;
283
+ title: z.ZodOptional<z.ZodString>;
284
+ }, z.core.$strip>, z.ZodObject<{
285
+ type: z.ZodLiteral<"tool-call">;
286
+ callId: z.ZodString;
287
+ toolName: z.ZodString;
288
+ input: z.ZodJSONSchema;
289
+ provider: z.ZodOptional<z.ZodObject<{
290
+ schemaVersion: z.ZodInt;
291
+ provider: z.ZodString;
292
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
293
+ }, z.core.$strip>>;
294
+ }, z.core.$strip>, z.ZodObject<{
295
+ type: z.ZodLiteral<"tool-result">;
296
+ callId: z.ZodString;
297
+ toolName: z.ZodString;
298
+ outcome: z.ZodEnum<{
299
+ error: "error";
300
+ interrupted: "interrupted";
301
+ success: "success";
302
+ }>;
303
+ output: z.ZodOptional<z.ZodJSONSchema>;
304
+ }, z.core.$strip>, z.ZodObject<{
305
+ type: z.ZodLiteral<"provider">;
306
+ envelope: z.ZodObject<{
307
+ schemaVersion: z.ZodInt;
308
+ provider: z.ZodString;
309
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
310
+ }, z.core.$strip>;
311
+ }, z.core.$strip>, z.ZodObject<{
312
+ type: z.ZodLiteral<"control">;
313
+ reason: z.ZodEnum<{
314
+ "run-interrupted": "run-interrupted";
315
+ "stale-run": "stale-run";
316
+ }>;
317
+ }, z.core.$strip>], "type">>;
318
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
319
+ createdAt: z.ZodISODateTime;
320
+ updatedAt: z.ZodISODateTime;
321
+ }, z.core.$strip>>;
210
322
  snapshot: z.ZodObject<{
211
323
  schemaVersion: z.ZodLiteral<1>;
212
324
  conversationId: z.ZodString;
@@ -306,6 +418,7 @@ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
306
418
  }>;
307
419
  revision: z.ZodInt;
308
420
  ownerId: z.ZodOptional<z.ZodString>;
421
+ fencingToken: z.ZodOptional<z.ZodInt>;
309
422
  terminalReason: z.ZodOptional<z.ZodEnum<{
310
423
  abandoned: "abandoned";
311
424
  cancelled: "cancelled";
@@ -424,6 +537,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
424
537
  }>;
425
538
  revision: z.ZodInt;
426
539
  ownerId: z.ZodOptional<z.ZodString>;
540
+ fencingToken: z.ZodOptional<z.ZodInt>;
427
541
  terminalReason: z.ZodOptional<z.ZodEnum<{
428
542
  abandoned: "abandoned";
429
543
  cancelled: "cancelled";
@@ -522,6 +636,117 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
522
636
  inputMessageId: z.ZodString;
523
637
  runId: z.ZodString;
524
638
  assistantMessageId: z.ZodString;
639
+ run: z.ZodObject<{
640
+ schemaVersion: z.ZodLiteral<1>;
641
+ id: z.ZodString;
642
+ conversationId: z.ZodString;
643
+ inputMessageIds: z.ZodArray<z.ZodString>;
644
+ assistantMessageId: z.ZodString;
645
+ state: z.ZodEnum<{
646
+ abandoned: "abandoned";
647
+ cancelled: "cancelled";
648
+ completed: "completed";
649
+ failed: "failed";
650
+ interrupt_requested: "interrupt_requested";
651
+ interrupted: "interrupted";
652
+ queued: "queued";
653
+ running: "running";
654
+ }>;
655
+ revision: z.ZodInt;
656
+ ownerId: z.ZodOptional<z.ZodString>;
657
+ fencingToken: z.ZodOptional<z.ZodInt>;
658
+ terminalReason: z.ZodOptional<z.ZodEnum<{
659
+ abandoned: "abandoned";
660
+ cancelled: "cancelled";
661
+ interrupted: "interrupted";
662
+ policy_stop: "policy_stop";
663
+ provider_failure: "provider_failure";
664
+ shutdown: "shutdown";
665
+ success: "success";
666
+ timeout: "timeout";
667
+ tool_failure: "tool_failure";
668
+ }>>;
669
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
670
+ createdAt: z.ZodISODateTime;
671
+ updatedAt: z.ZodISODateTime;
672
+ }, z.core.$strip>;
673
+ assistant: z.ZodOptional<z.ZodObject<{
674
+ schemaVersion: z.ZodLiteral<1>;
675
+ id: z.ZodString;
676
+ conversationId: z.ZodString;
677
+ runId: z.ZodOptional<z.ZodString>;
678
+ role: z.ZodEnum<{
679
+ assistant: "assistant";
680
+ summary: "summary";
681
+ system: "system";
682
+ user: "user";
683
+ }>;
684
+ status: z.ZodEnum<{
685
+ committed: "committed";
686
+ completed: "completed";
687
+ failed: "failed";
688
+ interrupted: "interrupted";
689
+ streaming: "streaming";
690
+ }>;
691
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
692
+ type: z.ZodLiteral<"text">;
693
+ text: z.ZodString;
694
+ }, z.core.$strip>, z.ZodObject<{
695
+ type: z.ZodLiteral<"reasoning">;
696
+ text: z.ZodString;
697
+ provider: z.ZodOptional<z.ZodObject<{
698
+ schemaVersion: z.ZodInt;
699
+ provider: z.ZodString;
700
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
701
+ }, z.core.$strip>>;
702
+ }, z.core.$strip>, z.ZodObject<{
703
+ type: z.ZodLiteral<"file">;
704
+ mediaType: z.ZodString;
705
+ reference: z.ZodString;
706
+ filename: z.ZodOptional<z.ZodString>;
707
+ }, z.core.$strip>, z.ZodObject<{
708
+ type: z.ZodLiteral<"source">;
709
+ sourceId: z.ZodString;
710
+ url: z.ZodOptional<z.ZodURL>;
711
+ title: z.ZodOptional<z.ZodString>;
712
+ }, z.core.$strip>, z.ZodObject<{
713
+ type: z.ZodLiteral<"tool-call">;
714
+ callId: z.ZodString;
715
+ toolName: z.ZodString;
716
+ input: z.ZodJSONSchema;
717
+ provider: z.ZodOptional<z.ZodObject<{
718
+ schemaVersion: z.ZodInt;
719
+ provider: z.ZodString;
720
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
721
+ }, z.core.$strip>>;
722
+ }, z.core.$strip>, z.ZodObject<{
723
+ type: z.ZodLiteral<"tool-result">;
724
+ callId: z.ZodString;
725
+ toolName: z.ZodString;
726
+ outcome: z.ZodEnum<{
727
+ error: "error";
728
+ interrupted: "interrupted";
729
+ success: "success";
730
+ }>;
731
+ output: z.ZodOptional<z.ZodJSONSchema>;
732
+ }, z.core.$strip>, z.ZodObject<{
733
+ type: z.ZodLiteral<"provider">;
734
+ envelope: z.ZodObject<{
735
+ schemaVersion: z.ZodInt;
736
+ provider: z.ZodString;
737
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
738
+ }, z.core.$strip>;
739
+ }, z.core.$strip>, z.ZodObject<{
740
+ type: z.ZodLiteral<"control">;
741
+ reason: z.ZodEnum<{
742
+ "run-interrupted": "run-interrupted";
743
+ "stale-run": "stale-run";
744
+ }>;
745
+ }, z.core.$strip>], "type">>;
746
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
747
+ createdAt: z.ZodISODateTime;
748
+ updatedAt: z.ZodISODateTime;
749
+ }, z.core.$strip>>;
525
750
  snapshot: z.ZodObject<{
526
751
  schemaVersion: z.ZodLiteral<1>;
527
752
  conversationId: z.ZodString;
@@ -621,6 +846,7 @@ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.
621
846
  }>;
622
847
  revision: z.ZodInt;
623
848
  ownerId: z.ZodOptional<z.ZodString>;
849
+ fencingToken: z.ZodOptional<z.ZodInt>;
624
850
  terminalReason: z.ZodOptional<z.ZodEnum<{
625
851
  abandoned: "abandoned";
626
852
  cancelled: "cancelled";
@@ -742,6 +968,7 @@ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
742
968
  }>;
743
969
  revision: z.ZodInt;
744
970
  ownerId: z.ZodOptional<z.ZodString>;
971
+ fencingToken: z.ZodOptional<z.ZodInt>;
745
972
  terminalReason: z.ZodOptional<z.ZodEnum<{
746
973
  abandoned: "abandoned";
747
974
  cancelled: "cancelled";
@@ -770,6 +997,7 @@ export declare const CheckpointRunAssistantSchema: z.ZodObject<{
770
997
  runId: z.ZodString;
771
998
  expectedRevision: z.ZodInt;
772
999
  ownerId: z.ZodString;
1000
+ fencingToken: z.ZodOptional<z.ZodInt>;
773
1001
  assistant: z.ZodObject<{
774
1002
  schemaVersion: z.ZodLiteral<1>;
775
1003
  id: z.ZodString;
@@ -853,6 +1081,7 @@ export declare const CommitRunTerminalSchema: z.ZodObject<{
853
1081
  runId: z.ZodString;
854
1082
  expectedRevision: z.ZodInt;
855
1083
  ownerId: z.ZodString;
1084
+ fencingToken: z.ZodOptional<z.ZodInt>;
856
1085
  assistant: z.ZodObject<{
857
1086
  schemaVersion: z.ZodLiteral<1>;
858
1087
  id: z.ZodString;
@@ -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,EAKL,KAAK,aAAa,EAGnB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOpC,CAAC;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7D,uBAAuB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC3F,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACtE,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACzF,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACnF,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACtE,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC/E,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvF,eAAe,IAAI,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IACrD,mBAAmB,CAAC,CAAC,KAAK,EAAE;QAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;CAC5D"}
@@ -3,7 +3,7 @@ export interface AgentRaceBarrier {
3
3
  wait(): Promise<void>;
4
4
  release(): void;
5
5
  }
6
- export declare function createAgentRaceBarrier(): AgentRaceBarrier;
6
+ export declare function createAgentRaceBarrier(timeoutMs?: number): AgentRaceBarrier;
7
7
  export interface AgentRaceTraceEntry {
8
8
  name: string;
9
9
  sequence: number;
@@ -12,6 +12,15 @@ export interface AgentRaceTrace {
12
12
  record(name: string): AgentRaceTraceEntry;
13
13
  entries(): readonly AgentRaceTraceEntry[];
14
14
  assertBefore(first: string, second: string): void;
15
+ assertSequence(names: readonly string[]): void;
16
+ count(name: string): number;
15
17
  }
16
18
  export declare function createAgentRaceTrace(): AgentRaceTrace;
19
+ export interface AgentRaceDriver {
20
+ trace: AgentRaceTrace;
21
+ barrier(name: string): AgentRaceBarrier;
22
+ releaseAll(): void;
23
+ }
24
+ /** Named deterministic barriers with one bounded cleanup operation for every scenario. */
25
+ export declare function createAgentRaceDriver(timeoutMs?: number): AgentRaceDriver;
17
26
  //# sourceMappingURL=testing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/testing.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAezD;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC1C,OAAO,IAAI,SAAS,mBAAmB,EAAE,CAAC;IAC1C,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACnD;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAiBrD"}
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/testing.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CAAC,SAAS,SAAQ,GAAG,gBAAgB,CAgC1E;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC1C,OAAO,IAAI,SAAS,mBAAmB,EAAE,CAAC;IAC1C,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC/C,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CA6BrD;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC;IACxC,UAAU,IAAI,IAAI,CAAC;CACpB;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,SAAS,SAAQ,GAAG,eAAe,CAgBxE"}
@@ -1,14 +1,14 @@
1
1
  export { type AgentCompactionContext, type AgentCompactionResult, type StructuredCompactionConfig, structuredCompaction, } from './agent-runtime/compaction';
2
2
  export { type AgentCoordinatedRun, type AgentInputPolicy, type AgentRunTicket, type AgentSessionCloseOptions, type AgentSessionCoordinator, type AgentStopReason, createAgentSessionCoordinator, } from './agent-runtime/coordinator';
3
- export { AgentAdmissionEventSchema, AgentCheckpointEventSchema, AgentReasoningDeltaEventSchema, AgentReasoningEndEventSchema, AgentReasoningStartEventSchema, AgentRunStateEventSchema, type AgentRuntimeEvent, AgentRuntimeEventSchema, type AgentRuntimePublisher, AgentTerminalEventSchema, AgentToolStatusEventSchema, AgentTransientDeltaEventSchema, } from './agent-runtime/events';
4
- export { type AgentHistoryProjectionOptions, projectAgentHistory, } from './agent-runtime/history';
3
+ export { AgentAdmissionEventSchema, AgentCheckpointEventSchema, AgentReasoningDeltaEventSchema, AgentReasoningEndEventSchema, AgentReasoningStartEventSchema, AgentRunStateEventSchema, type AgentRuntimeCursorAdvance, type AgentRuntimeEvent, type AgentRuntimeEventCursor, AgentRuntimeEventCursorSchema, AgentRuntimeEventSchema, type AgentRuntimeEventSink, type AgentRuntimeEventSinkConfig, type AgentRuntimePublisher, AgentTerminalEventSchema, AgentToolStatusEventSchema, AgentTransientDeltaEventSchema, advanceAgentRuntimeEventCursor, agentDurableEventId, createAgentRuntimeEventSink, } from './agent-runtime/events';
4
+ export { type AgentHistoryProjectionDecision, type AgentHistoryProjectionOptions, type AgentHistoryProjectionResult, projectAgentHistory, projectAgentHistoryDetailed, } from './agent-runtime/history';
5
5
  export { type AgentToolFenceConfig, type AgentToolFenceContext, createAgentToolFenceLifecycle, } from './agent-runtime/managed-tools';
6
- export { type AgentLanguageModelProvider, type AgentModelCapability, AgentModelCapabilitySchema, type AgentModelDeclaration, type AgentModelDescriptor, AgentModelDescriptorSchema, type AgentModelRegistry, type AgentModelRegistryConfig, type AgentResolvedModel, defineModelRegistry, } from './agent-runtime/models';
6
+ export { type AgentLanguageModelProvider, type AgentModelCapability, AgentModelCapabilitySchema, type AgentModelDeclaration, type AgentModelDescriptor, AgentModelDescriptorSchema, type AgentModelRegistry, type AgentModelRegistryConfig, type AgentModelRegistrySnapshot, AgentModelRegistrySnapshotSchema, type AgentModelSnapshotPolicy, type AgentResolvedModel, defineModelRegistry, validateAgentModelSnapshot, } from './agent-runtime/models';
7
7
  export { type AgentObservability, type AgentRunEvent, AgentRunEventSchema, type AgentRunSinkConfig, type AgentRunSinkDrop, type AgentRunSinkError, createAgentObservability, } from './agent-runtime/observability';
8
- export { type AgentPromptBudget, type AgentPromptSection, type AgentPromptSectionContext, type AgentTokenCount, AgentTokenCountSchema, type ComposeAgentPromptOptions, type ComposedAgentPrompt, composeAgentPrompt, } from './agent-runtime/prompt';
8
+ export { type AgentHistoryBudgetDecision, type AgentHistoryBudgetResult, type AgentPromptBudget, type AgentPromptSection, type AgentPromptSectionContext, type AgentTokenCount, AgentTokenCountSchema, type ComposeAgentPromptOptions, type ComposedAgentPrompt, composeAgentPrompt, type SelectAgentHistoryOptions, selectAgentHistory, } from './agent-runtime/prompt';
9
9
  export { type AgentProtocol, type AgentProtocolConfig, defineAgentProtocol, } from './agent-runtime/protocol';
10
10
  export { type AgentRuntime, type AgentRuntimeAdmission, type AgentRuntimeConfig, type AgentRuntimeInput, type AgentRuntimeInterruptInput, type AgentRuntimePrepareStep, type AgentRuntimeProtocolInput, type AgentRuntimeRecordIds, type AgentRuntimeRecoverOptions, type AgentRuntimeRecoveryDecision, type AgentRuntimeRecoveryInput, type AgentRuntimeRecoveryOutcome, type AgentRuntimeResult, type AgentRuntimeRunContext, type AgentRuntimeStopPolicy, createAgentRuntime, } from './agent-runtime/runtime';
11
11
  export * from './agent-runtime/schemas';
12
12
  export { type AcceptInputAndAssignRun, AcceptInputAndAssignRunSchema, type AcquireAgentRun, AcquireAgentRunSchema, type AgentRuntimeStore, AgentStoreAppliedSchema, AgentStoreConflictSchema, AgentStoreDuplicateSchema, type AgentStoreMutationResult, AgentStoreMutationResultSchema, AgentStoreNotFoundSchema, type CheckpointRunAssistant, CheckpointRunAssistantSchema, type CommitRunTerminal, CommitRunTerminalSchema, type RecoverAgentRun, RecoverAgentRunSchema, type ReplaceCompactedRange, ReplaceCompactedRangeSchema, type RequestRunInterrupt, RequestRunInterruptSchema, } from './agent-runtime/store';
13
- export { type AgentAdmissionIdentity, AgentAdmissionIdentitySchema, type AgentHistoryMutation, AgentHistoryMutationSchema, type AgentRecoverableDescriptor, AgentRecoverableDescriptorSchema, type AgentRecoverablePage, AgentRecoverablePageSchema, type AgentRuntimeStoreDriver, type AgentStoreCompareAndSwapResult, type AgentStoredState, AgentStoredStateSchema, createAgentRuntimeStore, createMemoryAgentRuntimeStore, } from './agent-runtime/store-driver';
13
+ export { type AgentAdmissionReceipt, AgentAdmissionReceiptSchema, type AgentHistoryMutation, AgentHistoryMutationSchema, type AgentRecoverableDescriptor, AgentRecoverableDescriptorSchema, type AgentRecoverablePage, AgentRecoverablePageSchema, type AgentRuntimeHead, AgentRuntimeHeadSchema, type AgentRuntimeStoreDriver, type AgentStoreCompareAndSwapResult, type AgentStoredRun, AgentStoredRunSchema, createAgentRuntimeStore, createMemoryAgentRuntimeStore, } from './agent-runtime/store-driver';
14
14
  //# sourceMappingURL=agent-runtime.d.ts.map