stitchkit 0.56.1 → 0.56.2

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 (67) hide show
  1. package/README.md +12 -3
  2. package/dist/agent-runtime/compaction.d.ts +33 -0
  3. package/dist/agent-runtime/compaction.d.ts.map +1 -0
  4. package/dist/agent-runtime/coordinator.d.ts +24 -0
  5. package/dist/agent-runtime/coordinator.d.ts.map +1 -0
  6. package/dist/agent-runtime/events.d.ts +454 -0
  7. package/dist/agent-runtime/events.d.ts.map +1 -0
  8. package/dist/agent-runtime/history.d.ts +11 -0
  9. package/dist/agent-runtime/history.d.ts.map +1 -0
  10. package/dist/agent-runtime/managed-tools.d.ts +18 -0
  11. package/dist/agent-runtime/managed-tools.d.ts.map +1 -0
  12. package/dist/agent-runtime/models.d.ts +51 -0
  13. package/dist/agent-runtime/models.d.ts.map +1 -0
  14. package/dist/agent-runtime/observability.d.ts +134 -0
  15. package/dist/agent-runtime/observability.d.ts.map +1 -0
  16. package/dist/agent-runtime/prompt.d.ts +50 -0
  17. package/dist/agent-runtime/prompt.d.ts.map +1 -0
  18. package/dist/agent-runtime/protocol.d.ts +16 -0
  19. package/dist/agent-runtime/protocol.d.ts.map +1 -0
  20. package/dist/agent-runtime/runtime.d.ts +120 -0
  21. package/dist/agent-runtime/runtime.d.ts.map +1 -0
  22. package/dist/agent-runtime/schemas.d.ts +470 -0
  23. package/dist/agent-runtime/schemas.d.ts.map +1 -0
  24. package/dist/agent-runtime/store.d.ts +905 -0
  25. package/dist/agent-runtime/store.d.ts.map +1 -0
  26. package/dist/agent-runtime/testing.d.ts +17 -0
  27. package/dist/agent-runtime/testing.d.ts.map +1 -0
  28. package/dist/agent-runtime-openrouter.d.ts +6 -0
  29. package/dist/agent-runtime-openrouter.d.ts.map +1 -0
  30. package/dist/agent-runtime-openrouter.js +46 -0
  31. package/dist/agent-runtime.d.ts +13 -0
  32. package/dist/agent-runtime.d.ts.map +1 -0
  33. package/dist/agent-runtime.js +1931 -0
  34. package/dist/cli.js +8 -5
  35. package/dist/index-0nc0cddp.js +178 -0
  36. package/dist/{index-6y759j86.js → index-1tkyng3g.js} +9 -57
  37. package/dist/{index-sm2tjx06.js → index-41wm56v0.js} +2 -2
  38. package/dist/index-6djpbnda.js +56 -0
  39. package/dist/{index-j3dem06f.js → index-7c0gkyvj.js} +5 -3
  40. package/dist/{index-75njxz7p.js → index-9zn9fb4e.js} +8 -6
  41. package/dist/{index-xy8fmh6w.js → index-f6pymtqe.js} +3 -3
  42. package/dist/{index-jcc611vh.js → index-gnvzyw0k.js} +2 -2
  43. package/dist/{index-qh4xevf5.js → index-mr617n62.js} +4 -2
  44. package/dist/{index-5r13htq1.js → index-ps5pxp3h.js} +1 -1
  45. package/dist/index-sa2mbwa7.js +336 -0
  46. package/dist/index-smpbdg6k.js +27 -0
  47. package/dist/{index-7eq9va6e.js → index-y2rb7dwx.js} +1 -27
  48. package/dist/{index-escqg10p.js → index-zk5zn2nh.js} +32 -334
  49. package/dist/internal/observability-sink.d.ts +26 -0
  50. package/dist/internal/observability-sink.d.ts.map +1 -0
  51. package/dist/node.js +6 -5
  52. package/dist/observability/audit.d.ts.map +1 -1
  53. package/dist/observability/index.js +15 -178
  54. package/dist/remote.js +4 -3
  55. package/dist/server/error-hook.d.ts +9 -7
  56. package/dist/server/error-hook.d.ts.map +1 -1
  57. package/dist/server/index.js +9 -7
  58. package/dist/testing.js +5 -3
  59. package/dist/tools/agent.d.ts.map +1 -1
  60. package/dist/tools/execute.d.ts +7 -0
  61. package/dist/tools/execute.d.ts.map +1 -1
  62. package/dist/tools.d.ts +2 -1
  63. package/dist/tools.d.ts.map +1 -1
  64. package/dist/tools.js +23 -12
  65. package/llms-full.txt +365 -10
  66. package/llms.txt +1 -0
  67. package/package.json +16 -3
@@ -0,0 +1,905 @@
1
+ import { z } from 'zod';
2
+ import { type AgentSnapshot } from './schemas';
3
+ export declare const AgentStoreConflictSchema: z.ZodObject<{
4
+ outcome: z.ZodLiteral<"conflict">;
5
+ actualVersion: z.ZodInt;
6
+ }, z.core.$strip>;
7
+ export declare const AgentStoreNotFoundSchema: z.ZodObject<{
8
+ outcome: z.ZodLiteral<"not_found">;
9
+ }, z.core.$strip>;
10
+ export declare const AgentStoreAppliedSchema: z.ZodObject<{
11
+ outcome: z.ZodLiteral<"applied">;
12
+ snapshot: z.ZodObject<{
13
+ schemaVersion: z.ZodLiteral<1>;
14
+ conversationId: z.ZodString;
15
+ version: z.ZodInt;
16
+ messages: z.ZodArray<z.ZodObject<{
17
+ schemaVersion: z.ZodLiteral<1>;
18
+ id: z.ZodString;
19
+ conversationId: z.ZodString;
20
+ runId: z.ZodOptional<z.ZodString>;
21
+ role: z.ZodEnum<{
22
+ assistant: "assistant";
23
+ summary: "summary";
24
+ system: "system";
25
+ user: "user";
26
+ }>;
27
+ status: z.ZodEnum<{
28
+ committed: "committed";
29
+ completed: "completed";
30
+ failed: "failed";
31
+ interrupted: "interrupted";
32
+ streaming: "streaming";
33
+ }>;
34
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ type: z.ZodLiteral<"text">;
36
+ text: z.ZodString;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ type: z.ZodLiteral<"reasoning">;
39
+ text: z.ZodString;
40
+ provider: z.ZodOptional<z.ZodObject<{
41
+ schemaVersion: z.ZodInt;
42
+ provider: z.ZodString;
43
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<"file">;
47
+ mediaType: z.ZodString;
48
+ reference: z.ZodString;
49
+ filename: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ type: z.ZodLiteral<"source">;
52
+ sourceId: z.ZodString;
53
+ url: z.ZodOptional<z.ZodURL>;
54
+ title: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ type: z.ZodLiteral<"tool-call">;
57
+ callId: z.ZodString;
58
+ toolName: z.ZodString;
59
+ input: z.ZodJSONSchema;
60
+ provider: z.ZodOptional<z.ZodObject<{
61
+ schemaVersion: z.ZodInt;
62
+ provider: z.ZodString;
63
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
64
+ }, z.core.$strip>>;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ type: z.ZodLiteral<"tool-result">;
67
+ callId: z.ZodString;
68
+ toolName: z.ZodString;
69
+ outcome: z.ZodEnum<{
70
+ error: "error";
71
+ interrupted: "interrupted";
72
+ success: "success";
73
+ }>;
74
+ output: z.ZodOptional<z.ZodJSONSchema>;
75
+ }, z.core.$strip>, z.ZodObject<{
76
+ type: z.ZodLiteral<"provider">;
77
+ envelope: z.ZodObject<{
78
+ schemaVersion: z.ZodInt;
79
+ provider: z.ZodString;
80
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
81
+ }, z.core.$strip>;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ type: z.ZodLiteral<"control">;
84
+ reason: z.ZodEnum<{
85
+ "run-interrupted": "run-interrupted";
86
+ "stale-run": "stale-run";
87
+ }>;
88
+ }, z.core.$strip>], "type">>;
89
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
90
+ createdAt: z.ZodISODateTime;
91
+ updatedAt: z.ZodISODateTime;
92
+ }, z.core.$strip>>;
93
+ runs: z.ZodArray<z.ZodObject<{
94
+ schemaVersion: z.ZodLiteral<1>;
95
+ id: z.ZodString;
96
+ conversationId: z.ZodString;
97
+ inputMessageIds: z.ZodArray<z.ZodString>;
98
+ assistantMessageId: z.ZodString;
99
+ state: z.ZodEnum<{
100
+ abandoned: "abandoned";
101
+ cancelled: "cancelled";
102
+ completed: "completed";
103
+ failed: "failed";
104
+ interrupt_requested: "interrupt_requested";
105
+ interrupted: "interrupted";
106
+ queued: "queued";
107
+ running: "running";
108
+ }>;
109
+ revision: z.ZodInt;
110
+ ownerId: z.ZodOptional<z.ZodString>;
111
+ terminalReason: z.ZodOptional<z.ZodEnum<{
112
+ abandoned: "abandoned";
113
+ cancelled: "cancelled";
114
+ interrupted: "interrupted";
115
+ policy_stop: "policy_stop";
116
+ provider_failure: "provider_failure";
117
+ shutdown: "shutdown";
118
+ success: "success";
119
+ timeout: "timeout";
120
+ tool_failure: "tool_failure";
121
+ }>>;
122
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
123
+ createdAt: z.ZodISODateTime;
124
+ updatedAt: z.ZodISODateTime;
125
+ }, z.core.$strip>>;
126
+ }, z.core.$strip>;
127
+ }, z.core.$strip>;
128
+ export declare const AgentStoreDuplicateSchema: z.ZodObject<{
129
+ outcome: z.ZodLiteral<"duplicate">;
130
+ runId: z.ZodString;
131
+ snapshot: z.ZodObject<{
132
+ schemaVersion: z.ZodLiteral<1>;
133
+ conversationId: z.ZodString;
134
+ version: z.ZodInt;
135
+ messages: z.ZodArray<z.ZodObject<{
136
+ schemaVersion: z.ZodLiteral<1>;
137
+ id: z.ZodString;
138
+ conversationId: z.ZodString;
139
+ runId: z.ZodOptional<z.ZodString>;
140
+ role: z.ZodEnum<{
141
+ assistant: "assistant";
142
+ summary: "summary";
143
+ system: "system";
144
+ user: "user";
145
+ }>;
146
+ status: z.ZodEnum<{
147
+ committed: "committed";
148
+ completed: "completed";
149
+ failed: "failed";
150
+ interrupted: "interrupted";
151
+ streaming: "streaming";
152
+ }>;
153
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
154
+ type: z.ZodLiteral<"text">;
155
+ text: z.ZodString;
156
+ }, z.core.$strip>, z.ZodObject<{
157
+ type: z.ZodLiteral<"reasoning">;
158
+ text: z.ZodString;
159
+ provider: z.ZodOptional<z.ZodObject<{
160
+ schemaVersion: z.ZodInt;
161
+ provider: z.ZodString;
162
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
163
+ }, z.core.$strip>>;
164
+ }, z.core.$strip>, z.ZodObject<{
165
+ type: z.ZodLiteral<"file">;
166
+ mediaType: z.ZodString;
167
+ reference: z.ZodString;
168
+ filename: z.ZodOptional<z.ZodString>;
169
+ }, z.core.$strip>, z.ZodObject<{
170
+ type: z.ZodLiteral<"source">;
171
+ sourceId: z.ZodString;
172
+ url: z.ZodOptional<z.ZodURL>;
173
+ title: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ type: z.ZodLiteral<"tool-call">;
176
+ callId: z.ZodString;
177
+ toolName: z.ZodString;
178
+ input: z.ZodJSONSchema;
179
+ provider: z.ZodOptional<z.ZodObject<{
180
+ schemaVersion: z.ZodInt;
181
+ provider: z.ZodString;
182
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
183
+ }, z.core.$strip>>;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ type: z.ZodLiteral<"tool-result">;
186
+ callId: z.ZodString;
187
+ toolName: z.ZodString;
188
+ outcome: z.ZodEnum<{
189
+ error: "error";
190
+ interrupted: "interrupted";
191
+ success: "success";
192
+ }>;
193
+ output: z.ZodOptional<z.ZodJSONSchema>;
194
+ }, z.core.$strip>, z.ZodObject<{
195
+ type: z.ZodLiteral<"provider">;
196
+ envelope: z.ZodObject<{
197
+ schemaVersion: z.ZodInt;
198
+ provider: z.ZodString;
199
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
200
+ }, z.core.$strip>;
201
+ }, z.core.$strip>, z.ZodObject<{
202
+ type: z.ZodLiteral<"control">;
203
+ reason: z.ZodEnum<{
204
+ "run-interrupted": "run-interrupted";
205
+ "stale-run": "stale-run";
206
+ }>;
207
+ }, z.core.$strip>], "type">>;
208
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
209
+ createdAt: z.ZodISODateTime;
210
+ updatedAt: z.ZodISODateTime;
211
+ }, z.core.$strip>>;
212
+ runs: z.ZodArray<z.ZodObject<{
213
+ schemaVersion: z.ZodLiteral<1>;
214
+ id: z.ZodString;
215
+ conversationId: z.ZodString;
216
+ inputMessageIds: z.ZodArray<z.ZodString>;
217
+ assistantMessageId: z.ZodString;
218
+ state: z.ZodEnum<{
219
+ abandoned: "abandoned";
220
+ cancelled: "cancelled";
221
+ completed: "completed";
222
+ failed: "failed";
223
+ interrupt_requested: "interrupt_requested";
224
+ interrupted: "interrupted";
225
+ queued: "queued";
226
+ running: "running";
227
+ }>;
228
+ revision: z.ZodInt;
229
+ ownerId: z.ZodOptional<z.ZodString>;
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
+ }, z.core.$strip>;
246
+ }, z.core.$strip>;
247
+ export declare const AgentStoreMutationResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
248
+ outcome: z.ZodLiteral<"applied">;
249
+ snapshot: z.ZodObject<{
250
+ schemaVersion: z.ZodLiteral<1>;
251
+ conversationId: z.ZodString;
252
+ version: z.ZodInt;
253
+ messages: z.ZodArray<z.ZodObject<{
254
+ schemaVersion: z.ZodLiteral<1>;
255
+ id: z.ZodString;
256
+ conversationId: z.ZodString;
257
+ runId: z.ZodOptional<z.ZodString>;
258
+ role: z.ZodEnum<{
259
+ assistant: "assistant";
260
+ summary: "summary";
261
+ system: "system";
262
+ user: "user";
263
+ }>;
264
+ status: z.ZodEnum<{
265
+ committed: "committed";
266
+ completed: "completed";
267
+ failed: "failed";
268
+ interrupted: "interrupted";
269
+ streaming: "streaming";
270
+ }>;
271
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
272
+ type: z.ZodLiteral<"text">;
273
+ text: z.ZodString;
274
+ }, z.core.$strip>, z.ZodObject<{
275
+ type: z.ZodLiteral<"reasoning">;
276
+ text: z.ZodString;
277
+ provider: z.ZodOptional<z.ZodObject<{
278
+ schemaVersion: z.ZodInt;
279
+ provider: z.ZodString;
280
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
281
+ }, z.core.$strip>>;
282
+ }, z.core.$strip>, z.ZodObject<{
283
+ type: z.ZodLiteral<"file">;
284
+ mediaType: z.ZodString;
285
+ reference: z.ZodString;
286
+ filename: z.ZodOptional<z.ZodString>;
287
+ }, z.core.$strip>, z.ZodObject<{
288
+ type: z.ZodLiteral<"source">;
289
+ sourceId: z.ZodString;
290
+ url: z.ZodOptional<z.ZodURL>;
291
+ title: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strip>, z.ZodObject<{
293
+ type: z.ZodLiteral<"tool-call">;
294
+ callId: z.ZodString;
295
+ toolName: z.ZodString;
296
+ input: z.ZodJSONSchema;
297
+ provider: z.ZodOptional<z.ZodObject<{
298
+ schemaVersion: z.ZodInt;
299
+ provider: z.ZodString;
300
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
301
+ }, z.core.$strip>>;
302
+ }, z.core.$strip>, z.ZodObject<{
303
+ type: z.ZodLiteral<"tool-result">;
304
+ callId: z.ZodString;
305
+ toolName: z.ZodString;
306
+ outcome: z.ZodEnum<{
307
+ error: "error";
308
+ interrupted: "interrupted";
309
+ success: "success";
310
+ }>;
311
+ output: z.ZodOptional<z.ZodJSONSchema>;
312
+ }, z.core.$strip>, z.ZodObject<{
313
+ type: z.ZodLiteral<"provider">;
314
+ envelope: z.ZodObject<{
315
+ schemaVersion: z.ZodInt;
316
+ provider: z.ZodString;
317
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
318
+ }, z.core.$strip>;
319
+ }, z.core.$strip>, z.ZodObject<{
320
+ type: z.ZodLiteral<"control">;
321
+ reason: z.ZodEnum<{
322
+ "run-interrupted": "run-interrupted";
323
+ "stale-run": "stale-run";
324
+ }>;
325
+ }, z.core.$strip>], "type">>;
326
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
327
+ createdAt: z.ZodISODateTime;
328
+ updatedAt: z.ZodISODateTime;
329
+ }, z.core.$strip>>;
330
+ runs: z.ZodArray<z.ZodObject<{
331
+ schemaVersion: z.ZodLiteral<1>;
332
+ id: z.ZodString;
333
+ conversationId: z.ZodString;
334
+ inputMessageIds: z.ZodArray<z.ZodString>;
335
+ assistantMessageId: z.ZodString;
336
+ state: z.ZodEnum<{
337
+ abandoned: "abandoned";
338
+ cancelled: "cancelled";
339
+ completed: "completed";
340
+ failed: "failed";
341
+ interrupt_requested: "interrupt_requested";
342
+ interrupted: "interrupted";
343
+ queued: "queued";
344
+ running: "running";
345
+ }>;
346
+ revision: z.ZodInt;
347
+ ownerId: z.ZodOptional<z.ZodString>;
348
+ terminalReason: z.ZodOptional<z.ZodEnum<{
349
+ abandoned: "abandoned";
350
+ cancelled: "cancelled";
351
+ interrupted: "interrupted";
352
+ policy_stop: "policy_stop";
353
+ provider_failure: "provider_failure";
354
+ shutdown: "shutdown";
355
+ success: "success";
356
+ timeout: "timeout";
357
+ tool_failure: "tool_failure";
358
+ }>>;
359
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
360
+ createdAt: z.ZodISODateTime;
361
+ updatedAt: z.ZodISODateTime;
362
+ }, z.core.$strip>>;
363
+ }, z.core.$strip>;
364
+ }, z.core.$strip>, z.ZodObject<{
365
+ outcome: z.ZodLiteral<"duplicate">;
366
+ runId: z.ZodString;
367
+ snapshot: z.ZodObject<{
368
+ schemaVersion: z.ZodLiteral<1>;
369
+ conversationId: z.ZodString;
370
+ version: z.ZodInt;
371
+ messages: z.ZodArray<z.ZodObject<{
372
+ schemaVersion: z.ZodLiteral<1>;
373
+ id: z.ZodString;
374
+ conversationId: z.ZodString;
375
+ runId: z.ZodOptional<z.ZodString>;
376
+ role: z.ZodEnum<{
377
+ assistant: "assistant";
378
+ summary: "summary";
379
+ system: "system";
380
+ user: "user";
381
+ }>;
382
+ status: z.ZodEnum<{
383
+ committed: "committed";
384
+ completed: "completed";
385
+ failed: "failed";
386
+ interrupted: "interrupted";
387
+ streaming: "streaming";
388
+ }>;
389
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
390
+ type: z.ZodLiteral<"text">;
391
+ text: z.ZodString;
392
+ }, z.core.$strip>, z.ZodObject<{
393
+ type: z.ZodLiteral<"reasoning">;
394
+ text: z.ZodString;
395
+ provider: z.ZodOptional<z.ZodObject<{
396
+ schemaVersion: z.ZodInt;
397
+ provider: z.ZodString;
398
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
399
+ }, z.core.$strip>>;
400
+ }, z.core.$strip>, z.ZodObject<{
401
+ type: z.ZodLiteral<"file">;
402
+ mediaType: z.ZodString;
403
+ reference: z.ZodString;
404
+ filename: z.ZodOptional<z.ZodString>;
405
+ }, z.core.$strip>, z.ZodObject<{
406
+ type: z.ZodLiteral<"source">;
407
+ sourceId: z.ZodString;
408
+ url: z.ZodOptional<z.ZodURL>;
409
+ title: z.ZodOptional<z.ZodString>;
410
+ }, z.core.$strip>, z.ZodObject<{
411
+ type: z.ZodLiteral<"tool-call">;
412
+ callId: z.ZodString;
413
+ toolName: z.ZodString;
414
+ input: z.ZodJSONSchema;
415
+ provider: z.ZodOptional<z.ZodObject<{
416
+ schemaVersion: z.ZodInt;
417
+ provider: z.ZodString;
418
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
419
+ }, z.core.$strip>>;
420
+ }, z.core.$strip>, z.ZodObject<{
421
+ type: z.ZodLiteral<"tool-result">;
422
+ callId: z.ZodString;
423
+ toolName: z.ZodString;
424
+ outcome: z.ZodEnum<{
425
+ error: "error";
426
+ interrupted: "interrupted";
427
+ success: "success";
428
+ }>;
429
+ output: z.ZodOptional<z.ZodJSONSchema>;
430
+ }, z.core.$strip>, z.ZodObject<{
431
+ type: z.ZodLiteral<"provider">;
432
+ envelope: z.ZodObject<{
433
+ schemaVersion: z.ZodInt;
434
+ provider: z.ZodString;
435
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
436
+ }, z.core.$strip>;
437
+ }, z.core.$strip>, z.ZodObject<{
438
+ type: z.ZodLiteral<"control">;
439
+ reason: z.ZodEnum<{
440
+ "run-interrupted": "run-interrupted";
441
+ "stale-run": "stale-run";
442
+ }>;
443
+ }, z.core.$strip>], "type">>;
444
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
445
+ createdAt: z.ZodISODateTime;
446
+ updatedAt: z.ZodISODateTime;
447
+ }, z.core.$strip>>;
448
+ runs: z.ZodArray<z.ZodObject<{
449
+ schemaVersion: z.ZodLiteral<1>;
450
+ id: z.ZodString;
451
+ conversationId: z.ZodString;
452
+ inputMessageIds: z.ZodArray<z.ZodString>;
453
+ assistantMessageId: z.ZodString;
454
+ state: z.ZodEnum<{
455
+ abandoned: "abandoned";
456
+ cancelled: "cancelled";
457
+ completed: "completed";
458
+ failed: "failed";
459
+ interrupt_requested: "interrupt_requested";
460
+ interrupted: "interrupted";
461
+ queued: "queued";
462
+ running: "running";
463
+ }>;
464
+ revision: z.ZodInt;
465
+ ownerId: z.ZodOptional<z.ZodString>;
466
+ terminalReason: z.ZodOptional<z.ZodEnum<{
467
+ abandoned: "abandoned";
468
+ cancelled: "cancelled";
469
+ interrupted: "interrupted";
470
+ policy_stop: "policy_stop";
471
+ provider_failure: "provider_failure";
472
+ shutdown: "shutdown";
473
+ success: "success";
474
+ timeout: "timeout";
475
+ tool_failure: "tool_failure";
476
+ }>>;
477
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
478
+ createdAt: z.ZodISODateTime;
479
+ updatedAt: z.ZodISODateTime;
480
+ }, z.core.$strip>>;
481
+ }, z.core.$strip>;
482
+ }, z.core.$strip>, z.ZodObject<{
483
+ outcome: z.ZodLiteral<"conflict">;
484
+ actualVersion: z.ZodInt;
485
+ }, z.core.$strip>, z.ZodObject<{
486
+ outcome: z.ZodLiteral<"not_found">;
487
+ }, z.core.$strip>], "outcome">;
488
+ export type AgentStoreMutationResult = z.infer<typeof AgentStoreMutationResultSchema>;
489
+ export declare const AcceptInputAndAssignRunSchema: z.ZodObject<{
490
+ idempotencyKey: z.ZodString;
491
+ expectedVersion: z.ZodOptional<z.ZodInt>;
492
+ input: z.ZodObject<{
493
+ schemaVersion: z.ZodLiteral<1>;
494
+ id: z.ZodString;
495
+ conversationId: z.ZodString;
496
+ runId: z.ZodOptional<z.ZodString>;
497
+ role: z.ZodEnum<{
498
+ assistant: "assistant";
499
+ summary: "summary";
500
+ system: "system";
501
+ user: "user";
502
+ }>;
503
+ status: z.ZodEnum<{
504
+ committed: "committed";
505
+ completed: "completed";
506
+ failed: "failed";
507
+ interrupted: "interrupted";
508
+ streaming: "streaming";
509
+ }>;
510
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
511
+ type: z.ZodLiteral<"text">;
512
+ text: z.ZodString;
513
+ }, z.core.$strip>, z.ZodObject<{
514
+ type: z.ZodLiteral<"reasoning">;
515
+ text: z.ZodString;
516
+ provider: z.ZodOptional<z.ZodObject<{
517
+ schemaVersion: z.ZodInt;
518
+ provider: z.ZodString;
519
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
520
+ }, z.core.$strip>>;
521
+ }, z.core.$strip>, z.ZodObject<{
522
+ type: z.ZodLiteral<"file">;
523
+ mediaType: z.ZodString;
524
+ reference: z.ZodString;
525
+ filename: z.ZodOptional<z.ZodString>;
526
+ }, z.core.$strip>, z.ZodObject<{
527
+ type: z.ZodLiteral<"source">;
528
+ sourceId: z.ZodString;
529
+ url: z.ZodOptional<z.ZodURL>;
530
+ title: z.ZodOptional<z.ZodString>;
531
+ }, z.core.$strip>, z.ZodObject<{
532
+ type: z.ZodLiteral<"tool-call">;
533
+ callId: z.ZodString;
534
+ toolName: z.ZodString;
535
+ input: z.ZodJSONSchema;
536
+ provider: z.ZodOptional<z.ZodObject<{
537
+ schemaVersion: z.ZodInt;
538
+ provider: z.ZodString;
539
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
540
+ }, z.core.$strip>>;
541
+ }, z.core.$strip>, z.ZodObject<{
542
+ type: z.ZodLiteral<"tool-result">;
543
+ callId: z.ZodString;
544
+ toolName: z.ZodString;
545
+ outcome: z.ZodEnum<{
546
+ error: "error";
547
+ interrupted: "interrupted";
548
+ success: "success";
549
+ }>;
550
+ output: z.ZodOptional<z.ZodJSONSchema>;
551
+ }, z.core.$strip>, z.ZodObject<{
552
+ type: z.ZodLiteral<"provider">;
553
+ envelope: z.ZodObject<{
554
+ schemaVersion: z.ZodInt;
555
+ provider: z.ZodString;
556
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
557
+ }, z.core.$strip>;
558
+ }, z.core.$strip>, z.ZodObject<{
559
+ type: z.ZodLiteral<"control">;
560
+ reason: z.ZodEnum<{
561
+ "run-interrupted": "run-interrupted";
562
+ "stale-run": "stale-run";
563
+ }>;
564
+ }, z.core.$strip>], "type">>;
565
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
566
+ createdAt: z.ZodISODateTime;
567
+ updatedAt: z.ZodISODateTime;
568
+ }, z.core.$strip>;
569
+ run: z.ZodObject<{
570
+ schemaVersion: z.ZodLiteral<1>;
571
+ id: z.ZodString;
572
+ conversationId: z.ZodString;
573
+ inputMessageIds: z.ZodArray<z.ZodString>;
574
+ assistantMessageId: z.ZodString;
575
+ state: z.ZodEnum<{
576
+ abandoned: "abandoned";
577
+ cancelled: "cancelled";
578
+ completed: "completed";
579
+ failed: "failed";
580
+ interrupt_requested: "interrupt_requested";
581
+ interrupted: "interrupted";
582
+ queued: "queued";
583
+ running: "running";
584
+ }>;
585
+ revision: z.ZodInt;
586
+ ownerId: z.ZodOptional<z.ZodString>;
587
+ terminalReason: z.ZodOptional<z.ZodEnum<{
588
+ abandoned: "abandoned";
589
+ cancelled: "cancelled";
590
+ interrupted: "interrupted";
591
+ policy_stop: "policy_stop";
592
+ provider_failure: "provider_failure";
593
+ shutdown: "shutdown";
594
+ success: "success";
595
+ timeout: "timeout";
596
+ tool_failure: "tool_failure";
597
+ }>>;
598
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
599
+ createdAt: z.ZodISODateTime;
600
+ updatedAt: z.ZodISODateTime;
601
+ }, z.core.$strip>;
602
+ coalesceIntoRunId: z.ZodOptional<z.ZodString>;
603
+ }, z.core.$strip>;
604
+ export declare const AcquireAgentRunSchema: z.ZodObject<{
605
+ conversationId: z.ZodString;
606
+ runId: z.ZodString;
607
+ expectedRevision: z.ZodInt;
608
+ ownerId: z.ZodString;
609
+ }, z.core.$strip>;
610
+ export declare const CheckpointRunAssistantSchema: z.ZodObject<{
611
+ conversationId: z.ZodString;
612
+ runId: z.ZodString;
613
+ expectedRevision: z.ZodInt;
614
+ ownerId: z.ZodString;
615
+ assistant: z.ZodObject<{
616
+ schemaVersion: z.ZodLiteral<1>;
617
+ id: z.ZodString;
618
+ conversationId: z.ZodString;
619
+ runId: z.ZodOptional<z.ZodString>;
620
+ role: z.ZodEnum<{
621
+ assistant: "assistant";
622
+ summary: "summary";
623
+ system: "system";
624
+ user: "user";
625
+ }>;
626
+ status: z.ZodEnum<{
627
+ committed: "committed";
628
+ completed: "completed";
629
+ failed: "failed";
630
+ interrupted: "interrupted";
631
+ streaming: "streaming";
632
+ }>;
633
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
634
+ type: z.ZodLiteral<"text">;
635
+ text: z.ZodString;
636
+ }, z.core.$strip>, z.ZodObject<{
637
+ type: z.ZodLiteral<"reasoning">;
638
+ text: z.ZodString;
639
+ provider: z.ZodOptional<z.ZodObject<{
640
+ schemaVersion: z.ZodInt;
641
+ provider: z.ZodString;
642
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
643
+ }, z.core.$strip>>;
644
+ }, z.core.$strip>, z.ZodObject<{
645
+ type: z.ZodLiteral<"file">;
646
+ mediaType: z.ZodString;
647
+ reference: z.ZodString;
648
+ filename: z.ZodOptional<z.ZodString>;
649
+ }, z.core.$strip>, z.ZodObject<{
650
+ type: z.ZodLiteral<"source">;
651
+ sourceId: z.ZodString;
652
+ url: z.ZodOptional<z.ZodURL>;
653
+ title: z.ZodOptional<z.ZodString>;
654
+ }, z.core.$strip>, z.ZodObject<{
655
+ type: z.ZodLiteral<"tool-call">;
656
+ callId: z.ZodString;
657
+ toolName: z.ZodString;
658
+ input: z.ZodJSONSchema;
659
+ provider: z.ZodOptional<z.ZodObject<{
660
+ schemaVersion: z.ZodInt;
661
+ provider: z.ZodString;
662
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
663
+ }, z.core.$strip>>;
664
+ }, z.core.$strip>, z.ZodObject<{
665
+ type: z.ZodLiteral<"tool-result">;
666
+ callId: z.ZodString;
667
+ toolName: z.ZodString;
668
+ outcome: z.ZodEnum<{
669
+ error: "error";
670
+ interrupted: "interrupted";
671
+ success: "success";
672
+ }>;
673
+ output: z.ZodOptional<z.ZodJSONSchema>;
674
+ }, z.core.$strip>, z.ZodObject<{
675
+ type: z.ZodLiteral<"provider">;
676
+ envelope: z.ZodObject<{
677
+ schemaVersion: z.ZodInt;
678
+ provider: z.ZodString;
679
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
680
+ }, z.core.$strip>;
681
+ }, z.core.$strip>, z.ZodObject<{
682
+ type: z.ZodLiteral<"control">;
683
+ reason: z.ZodEnum<{
684
+ "run-interrupted": "run-interrupted";
685
+ "stale-run": "stale-run";
686
+ }>;
687
+ }, z.core.$strip>], "type">>;
688
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
689
+ createdAt: z.ZodISODateTime;
690
+ updatedAt: z.ZodISODateTime;
691
+ }, z.core.$strip>;
692
+ }, z.core.$strip>;
693
+ export declare const CommitRunTerminalSchema: z.ZodObject<{
694
+ conversationId: z.ZodString;
695
+ runId: z.ZodString;
696
+ expectedRevision: z.ZodInt;
697
+ ownerId: z.ZodString;
698
+ assistant: z.ZodObject<{
699
+ schemaVersion: z.ZodLiteral<1>;
700
+ id: z.ZodString;
701
+ conversationId: z.ZodString;
702
+ runId: z.ZodOptional<z.ZodString>;
703
+ role: z.ZodEnum<{
704
+ assistant: "assistant";
705
+ summary: "summary";
706
+ system: "system";
707
+ user: "user";
708
+ }>;
709
+ status: z.ZodEnum<{
710
+ committed: "committed";
711
+ completed: "completed";
712
+ failed: "failed";
713
+ interrupted: "interrupted";
714
+ streaming: "streaming";
715
+ }>;
716
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
717
+ type: z.ZodLiteral<"text">;
718
+ text: z.ZodString;
719
+ }, z.core.$strip>, z.ZodObject<{
720
+ type: z.ZodLiteral<"reasoning">;
721
+ text: z.ZodString;
722
+ provider: z.ZodOptional<z.ZodObject<{
723
+ schemaVersion: z.ZodInt;
724
+ provider: z.ZodString;
725
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
726
+ }, z.core.$strip>>;
727
+ }, z.core.$strip>, z.ZodObject<{
728
+ type: z.ZodLiteral<"file">;
729
+ mediaType: z.ZodString;
730
+ reference: z.ZodString;
731
+ filename: z.ZodOptional<z.ZodString>;
732
+ }, z.core.$strip>, z.ZodObject<{
733
+ type: z.ZodLiteral<"source">;
734
+ sourceId: z.ZodString;
735
+ url: z.ZodOptional<z.ZodURL>;
736
+ title: z.ZodOptional<z.ZodString>;
737
+ }, z.core.$strip>, z.ZodObject<{
738
+ type: z.ZodLiteral<"tool-call">;
739
+ callId: z.ZodString;
740
+ toolName: z.ZodString;
741
+ input: z.ZodJSONSchema;
742
+ provider: z.ZodOptional<z.ZodObject<{
743
+ schemaVersion: z.ZodInt;
744
+ provider: z.ZodString;
745
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
746
+ }, z.core.$strip>>;
747
+ }, z.core.$strip>, z.ZodObject<{
748
+ type: z.ZodLiteral<"tool-result">;
749
+ callId: z.ZodString;
750
+ toolName: z.ZodString;
751
+ outcome: z.ZodEnum<{
752
+ error: "error";
753
+ interrupted: "interrupted";
754
+ success: "success";
755
+ }>;
756
+ output: z.ZodOptional<z.ZodJSONSchema>;
757
+ }, z.core.$strip>, z.ZodObject<{
758
+ type: z.ZodLiteral<"provider">;
759
+ envelope: z.ZodObject<{
760
+ schemaVersion: z.ZodInt;
761
+ provider: z.ZodString;
762
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
763
+ }, z.core.$strip>;
764
+ }, z.core.$strip>, z.ZodObject<{
765
+ type: z.ZodLiteral<"control">;
766
+ reason: z.ZodEnum<{
767
+ "run-interrupted": "run-interrupted";
768
+ "stale-run": "stale-run";
769
+ }>;
770
+ }, z.core.$strip>], "type">>;
771
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
772
+ createdAt: z.ZodISODateTime;
773
+ updatedAt: z.ZodISODateTime;
774
+ }, z.core.$strip>;
775
+ reason: z.ZodEnum<{
776
+ abandoned: "abandoned";
777
+ cancelled: "cancelled";
778
+ interrupted: "interrupted";
779
+ policy_stop: "policy_stop";
780
+ provider_failure: "provider_failure";
781
+ shutdown: "shutdown";
782
+ success: "success";
783
+ timeout: "timeout";
784
+ tool_failure: "tool_failure";
785
+ }>;
786
+ policyName: z.ZodOptional<z.ZodString>;
787
+ }, z.core.$strip>;
788
+ export declare const RequestRunInterruptSchema: z.ZodObject<{
789
+ conversationId: z.ZodString;
790
+ runId: z.ZodString;
791
+ expectedRevision: z.ZodInt;
792
+ }, z.core.$strip>;
793
+ export declare const RecoverAgentRunSchema: z.ZodObject<{
794
+ conversationId: z.ZodString;
795
+ runId: z.ZodString;
796
+ expectedRevision: z.ZodInt;
797
+ action: z.ZodEnum<{
798
+ abandon: "abandon";
799
+ requeue: "requeue";
800
+ }>;
801
+ replaySafe: z.ZodOptional<z.ZodBoolean>;
802
+ }, z.core.$strip>;
803
+ export declare const ReplaceCompactedRangeSchema: z.ZodObject<{
804
+ conversationId: z.ZodString;
805
+ expectedVersion: z.ZodInt;
806
+ replacedMessageIds: z.ZodArray<z.ZodString>;
807
+ summary: z.ZodObject<{
808
+ schemaVersion: z.ZodLiteral<1>;
809
+ id: z.ZodString;
810
+ conversationId: z.ZodString;
811
+ runId: z.ZodOptional<z.ZodString>;
812
+ role: z.ZodEnum<{
813
+ assistant: "assistant";
814
+ summary: "summary";
815
+ system: "system";
816
+ user: "user";
817
+ }>;
818
+ status: z.ZodEnum<{
819
+ committed: "committed";
820
+ completed: "completed";
821
+ failed: "failed";
822
+ interrupted: "interrupted";
823
+ streaming: "streaming";
824
+ }>;
825
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
826
+ type: z.ZodLiteral<"text">;
827
+ text: z.ZodString;
828
+ }, z.core.$strip>, z.ZodObject<{
829
+ type: z.ZodLiteral<"reasoning">;
830
+ text: z.ZodString;
831
+ provider: z.ZodOptional<z.ZodObject<{
832
+ schemaVersion: z.ZodInt;
833
+ provider: z.ZodString;
834
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
835
+ }, z.core.$strip>>;
836
+ }, z.core.$strip>, z.ZodObject<{
837
+ type: z.ZodLiteral<"file">;
838
+ mediaType: z.ZodString;
839
+ reference: z.ZodString;
840
+ filename: z.ZodOptional<z.ZodString>;
841
+ }, z.core.$strip>, z.ZodObject<{
842
+ type: z.ZodLiteral<"source">;
843
+ sourceId: z.ZodString;
844
+ url: z.ZodOptional<z.ZodURL>;
845
+ title: z.ZodOptional<z.ZodString>;
846
+ }, z.core.$strip>, z.ZodObject<{
847
+ type: z.ZodLiteral<"tool-call">;
848
+ callId: z.ZodString;
849
+ toolName: z.ZodString;
850
+ input: z.ZodJSONSchema;
851
+ provider: z.ZodOptional<z.ZodObject<{
852
+ schemaVersion: z.ZodInt;
853
+ provider: z.ZodString;
854
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
855
+ }, z.core.$strip>>;
856
+ }, z.core.$strip>, z.ZodObject<{
857
+ type: z.ZodLiteral<"tool-result">;
858
+ callId: z.ZodString;
859
+ toolName: z.ZodString;
860
+ outcome: z.ZodEnum<{
861
+ error: "error";
862
+ interrupted: "interrupted";
863
+ success: "success";
864
+ }>;
865
+ output: z.ZodOptional<z.ZodJSONSchema>;
866
+ }, z.core.$strip>, z.ZodObject<{
867
+ type: z.ZodLiteral<"provider">;
868
+ envelope: z.ZodObject<{
869
+ schemaVersion: z.ZodInt;
870
+ provider: z.ZodString;
871
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
872
+ }, z.core.$strip>;
873
+ }, z.core.$strip>, z.ZodObject<{
874
+ type: z.ZodLiteral<"control">;
875
+ reason: z.ZodEnum<{
876
+ "run-interrupted": "run-interrupted";
877
+ "stale-run": "stale-run";
878
+ }>;
879
+ }, z.core.$strip>], "type">>;
880
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
881
+ createdAt: z.ZodISODateTime;
882
+ updatedAt: z.ZodISODateTime;
883
+ }, z.core.$strip>;
884
+ }, z.core.$strip>;
885
+ export type AcceptInputAndAssignRun = z.infer<typeof AcceptInputAndAssignRunSchema>;
886
+ export type AcquireAgentRun = z.infer<typeof AcquireAgentRunSchema>;
887
+ export type CheckpointRunAssistant = z.infer<typeof CheckpointRunAssistantSchema>;
888
+ export type CommitRunTerminal = z.infer<typeof CommitRunTerminalSchema>;
889
+ export type RequestRunInterrupt = z.infer<typeof RequestRunInterruptSchema>;
890
+ export type RecoverAgentRun = z.infer<typeof RecoverAgentRunSchema>;
891
+ export type ReplaceCompactedRange = z.infer<typeof ReplaceCompactedRangeSchema>;
892
+ export interface AgentRuntimeStore {
893
+ loadSnapshot(conversationId: string): Promise<AgentSnapshot>;
894
+ acceptInputAndAssignRun(input: AcceptInputAndAssignRun): Promise<AgentStoreMutationResult>;
895
+ acquireRun(input: AcquireAgentRun): Promise<AgentStoreMutationResult>;
896
+ checkpointRunAssistant(input: CheckpointRunAssistant): Promise<AgentStoreMutationResult>;
897
+ requestRunInterrupt(input: RequestRunInterrupt): Promise<AgentStoreMutationResult>;
898
+ recoverRun(input: RecoverAgentRun): Promise<AgentStoreMutationResult>;
899
+ commitRunTerminal(input: CommitRunTerminal): Promise<AgentStoreMutationResult>;
900
+ replaceCompactedRange(input: ReplaceCompactedRange): Promise<AgentStoreMutationResult>;
901
+ scanRecoverable(): Promise<readonly AgentSnapshot[]>;
902
+ }
903
+ /** In-memory reference adapter. It is process-local and deliberately offers no lease guarantee. */
904
+ export declare function createMemoryAgentRuntimeStore(): AgentRuntimeStore;
905
+ //# sourceMappingURL=store.d.ts.map