stitchkit 0.68.4 → 0.68.6

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 (32) hide show
  1. package/README.md +4 -1
  2. package/dist/agent-runtime/coordinator.d.ts +5 -2
  3. package/dist/agent-runtime/coordinator.d.ts.map +1 -1
  4. package/dist/agent-runtime/event-schema.d.ts +1349 -0
  5. package/dist/agent-runtime/event-schema.d.ts.map +1 -0
  6. package/dist/agent-runtime/events.d.ts +2 -1347
  7. package/dist/agent-runtime/events.d.ts.map +1 -1
  8. package/dist/agent-runtime/run-execution.d.ts +2 -0
  9. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  10. package/dist/agent-runtime/runtime.d.ts +2 -0
  11. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  12. package/dist/agent-runtime/schemas.d.ts +12 -0
  13. package/dist/agent-runtime/schemas.d.ts.map +1 -1
  14. package/dist/agent-runtime/store-driver.d.ts +12 -0
  15. package/dist/agent-runtime/store-driver.d.ts.map +1 -1
  16. package/dist/agent-runtime/store.d.ts +37 -6
  17. package/dist/agent-runtime/store.d.ts.map +1 -1
  18. package/dist/agent-runtime/terminal-commit.d.ts +2 -0
  19. package/dist/agent-runtime/terminal-commit.d.ts.map +1 -1
  20. package/dist/agent-runtime-browser.d.ts +4 -0
  21. package/dist/agent-runtime-browser.d.ts.map +1 -0
  22. package/dist/agent-runtime-browser.js +424 -0
  23. package/dist/agent-runtime.js +169 -93
  24. package/dist/browser/cancellation.d.ts.map +1 -1
  25. package/dist/{index-thcy3w8c.js → index-n34x0q5e.js} +6 -6
  26. package/dist/{index-fhsmrzj7.js → index-ysphyxax.js} +4 -1
  27. package/dist/index.js +6 -6
  28. package/dist/remote.js +1 -1
  29. package/dist/testing/agent-store-conformance.d.ts.map +1 -1
  30. package/dist/testing.js +117 -6
  31. package/llms-full.txt +71 -10
  32. package/package.json +6 -2
@@ -0,0 +1,1349 @@
1
+ import { z } from 'zod';
2
+ export declare const AgentAdmissionEventSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"admission">;
4
+ eventId: z.ZodString;
5
+ conversationId: z.ZodString;
6
+ runId: z.ZodString;
7
+ snapshotVersion: z.ZodInt;
8
+ input: z.ZodObject<{
9
+ schemaVersion: z.ZodLiteral<1>;
10
+ id: z.ZodString;
11
+ conversationId: z.ZodString;
12
+ runId: z.ZodOptional<z.ZodString>;
13
+ role: z.ZodEnum<{
14
+ assistant: "assistant";
15
+ summary: "summary";
16
+ system: "system";
17
+ user: "user";
18
+ }>;
19
+ status: z.ZodEnum<{
20
+ committed: "committed";
21
+ completed: "completed";
22
+ failed: "failed";
23
+ interrupted: "interrupted";
24
+ streaming: "streaming";
25
+ superseded: "superseded";
26
+ }>;
27
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
28
+ type: z.ZodLiteral<"text">;
29
+ text: z.ZodString;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ type: z.ZodLiteral<"reasoning">;
32
+ text: z.ZodString;
33
+ provider: z.ZodOptional<z.ZodObject<{
34
+ schemaVersion: z.ZodInt;
35
+ provider: z.ZodString;
36
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>, z.ZodObject<{
39
+ type: z.ZodLiteral<"file">;
40
+ mediaType: z.ZodString;
41
+ reference: z.ZodString;
42
+ filename: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ type: z.ZodLiteral<"source">;
45
+ sourceId: z.ZodString;
46
+ url: z.ZodOptional<z.ZodURL>;
47
+ title: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<"tool-call">;
50
+ callId: z.ZodString;
51
+ toolName: z.ZodString;
52
+ input: z.ZodJSONSchema;
53
+ provider: z.ZodOptional<z.ZodObject<{
54
+ schemaVersion: z.ZodInt;
55
+ provider: z.ZodString;
56
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
57
+ }, z.core.$strip>>;
58
+ }, z.core.$strip>, z.ZodObject<{
59
+ type: z.ZodLiteral<"tool-result">;
60
+ callId: z.ZodString;
61
+ toolName: z.ZodString;
62
+ outcome: z.ZodEnum<{
63
+ error: "error";
64
+ interrupted: "interrupted";
65
+ success: "success";
66
+ }>;
67
+ output: z.ZodOptional<z.ZodJSONSchema>;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ type: z.ZodLiteral<"provider">;
70
+ envelope: z.ZodObject<{
71
+ schemaVersion: z.ZodInt;
72
+ provider: z.ZodString;
73
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
74
+ }, z.core.$strip>;
75
+ }, z.core.$strip>, z.ZodObject<{
76
+ type: z.ZodLiteral<"control">;
77
+ reason: z.ZodEnum<{
78
+ "run-interrupted": "run-interrupted";
79
+ "stale-run": "stale-run";
80
+ }>;
81
+ }, z.core.$strip>], "type">>;
82
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
83
+ createdAt: z.ZodISODateTime;
84
+ updatedAt: z.ZodISODateTime;
85
+ }, z.core.$strip>;
86
+ run: z.ZodObject<{
87
+ schemaVersion: z.ZodLiteral<1>;
88
+ id: z.ZodString;
89
+ conversationId: z.ZodString;
90
+ inputMessageIds: z.ZodArray<z.ZodString>;
91
+ assistantMessageId: z.ZodString;
92
+ state: z.ZodEnum<{
93
+ abandoned: "abandoned";
94
+ cancelled: "cancelled";
95
+ completed: "completed";
96
+ failed: "failed";
97
+ interrupt_requested: "interrupt_requested";
98
+ interrupted: "interrupted";
99
+ queued: "queued";
100
+ running: "running";
101
+ superseded: "superseded";
102
+ }>;
103
+ revision: z.ZodInt;
104
+ queuePriority: z.ZodOptional<z.ZodEnum<{
105
+ "interrupt-next": "interrupt-next";
106
+ }>>;
107
+ executionSequence: z.ZodOptional<z.ZodInt>;
108
+ ownerId: z.ZodOptional<z.ZodString>;
109
+ fencingToken: z.ZodOptional<z.ZodInt>;
110
+ terminalReason: z.ZodOptional<z.ZodEnum<{
111
+ abandoned: "abandoned";
112
+ absorbed: "absorbed";
113
+ cancelled: "cancelled";
114
+ context_overflow: "context_overflow";
115
+ interrupted: "interrupted";
116
+ policy_stop: "policy_stop";
117
+ provider_failure: "provider_failure";
118
+ provider_stop: "provider_stop";
119
+ shutdown: "shutdown";
120
+ success: "success";
121
+ superseded: "superseded";
122
+ timeout: "timeout";
123
+ }>>;
124
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
125
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
126
+ usage: z.ZodOptional<z.ZodObject<{
127
+ inputTokens: z.ZodObject<{
128
+ value: z.ZodOptional<z.ZodInt>;
129
+ provenance: z.ZodEnum<{
130
+ computed: "computed";
131
+ estimated: "estimated";
132
+ "provider-reported": "provider-reported";
133
+ unavailable: "unavailable";
134
+ }>;
135
+ }, z.core.$strip>;
136
+ outputTokens: z.ZodObject<{
137
+ value: z.ZodOptional<z.ZodInt>;
138
+ provenance: z.ZodEnum<{
139
+ computed: "computed";
140
+ estimated: "estimated";
141
+ "provider-reported": "provider-reported";
142
+ unavailable: "unavailable";
143
+ }>;
144
+ }, z.core.$strip>;
145
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
146
+ value: z.ZodOptional<z.ZodInt>;
147
+ provenance: z.ZodEnum<{
148
+ computed: "computed";
149
+ estimated: "estimated";
150
+ "provider-reported": "provider-reported";
151
+ unavailable: "unavailable";
152
+ }>;
153
+ }, z.core.$strip>>;
154
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
155
+ value: z.ZodOptional<z.ZodInt>;
156
+ provenance: z.ZodEnum<{
157
+ computed: "computed";
158
+ estimated: "estimated";
159
+ "provider-reported": "provider-reported";
160
+ unavailable: "unavailable";
161
+ }>;
162
+ }, z.core.$strip>>;
163
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
164
+ value: z.ZodOptional<z.ZodInt>;
165
+ provenance: z.ZodEnum<{
166
+ computed: "computed";
167
+ estimated: "estimated";
168
+ "provider-reported": "provider-reported";
169
+ unavailable: "unavailable";
170
+ }>;
171
+ }, z.core.$strip>>;
172
+ cost: z.ZodOptional<z.ZodObject<{
173
+ value: z.ZodOptional<z.ZodNumber>;
174
+ currency: z.ZodOptional<z.ZodString>;
175
+ provenance: z.ZodEnum<{
176
+ computed: "computed";
177
+ estimated: "estimated";
178
+ "provider-reported": "provider-reported";
179
+ unavailable: "unavailable";
180
+ }>;
181
+ }, z.core.$strip>>;
182
+ }, z.core.$strip>>;
183
+ createdAt: z.ZodISODateTime;
184
+ updatedAt: z.ZodISODateTime;
185
+ }, z.core.$strip>;
186
+ assistant: z.ZodUnion<readonly [z.ZodObject<{
187
+ schemaVersion: z.ZodLiteral<1>;
188
+ id: z.ZodString;
189
+ conversationId: z.ZodString;
190
+ runId: z.ZodString;
191
+ status: z.ZodLiteral<"pending">;
192
+ createdAt: z.ZodISODateTime;
193
+ updatedAt: z.ZodISODateTime;
194
+ }, z.core.$strip>, z.ZodObject<{
195
+ schemaVersion: z.ZodLiteral<1>;
196
+ id: z.ZodString;
197
+ conversationId: z.ZodString;
198
+ runId: z.ZodOptional<z.ZodString>;
199
+ role: z.ZodEnum<{
200
+ assistant: "assistant";
201
+ summary: "summary";
202
+ system: "system";
203
+ user: "user";
204
+ }>;
205
+ status: z.ZodEnum<{
206
+ committed: "committed";
207
+ completed: "completed";
208
+ failed: "failed";
209
+ interrupted: "interrupted";
210
+ streaming: "streaming";
211
+ superseded: "superseded";
212
+ }>;
213
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
214
+ type: z.ZodLiteral<"text">;
215
+ text: z.ZodString;
216
+ }, z.core.$strip>, z.ZodObject<{
217
+ type: z.ZodLiteral<"reasoning">;
218
+ text: z.ZodString;
219
+ provider: z.ZodOptional<z.ZodObject<{
220
+ schemaVersion: z.ZodInt;
221
+ provider: z.ZodString;
222
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
223
+ }, z.core.$strip>>;
224
+ }, z.core.$strip>, z.ZodObject<{
225
+ type: z.ZodLiteral<"file">;
226
+ mediaType: z.ZodString;
227
+ reference: z.ZodString;
228
+ filename: z.ZodOptional<z.ZodString>;
229
+ }, z.core.$strip>, z.ZodObject<{
230
+ type: z.ZodLiteral<"source">;
231
+ sourceId: z.ZodString;
232
+ url: z.ZodOptional<z.ZodURL>;
233
+ title: z.ZodOptional<z.ZodString>;
234
+ }, z.core.$strip>, z.ZodObject<{
235
+ type: z.ZodLiteral<"tool-call">;
236
+ callId: z.ZodString;
237
+ toolName: z.ZodString;
238
+ input: z.ZodJSONSchema;
239
+ provider: z.ZodOptional<z.ZodObject<{
240
+ schemaVersion: z.ZodInt;
241
+ provider: z.ZodString;
242
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
243
+ }, z.core.$strip>>;
244
+ }, z.core.$strip>, z.ZodObject<{
245
+ type: z.ZodLiteral<"tool-result">;
246
+ callId: z.ZodString;
247
+ toolName: z.ZodString;
248
+ outcome: z.ZodEnum<{
249
+ error: "error";
250
+ interrupted: "interrupted";
251
+ success: "success";
252
+ }>;
253
+ output: z.ZodOptional<z.ZodJSONSchema>;
254
+ }, z.core.$strip>, z.ZodObject<{
255
+ type: z.ZodLiteral<"provider">;
256
+ envelope: z.ZodObject<{
257
+ schemaVersion: z.ZodInt;
258
+ provider: z.ZodString;
259
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
260
+ }, z.core.$strip>;
261
+ }, z.core.$strip>, z.ZodObject<{
262
+ type: z.ZodLiteral<"control">;
263
+ reason: z.ZodEnum<{
264
+ "run-interrupted": "run-interrupted";
265
+ "stale-run": "stale-run";
266
+ }>;
267
+ }, z.core.$strip>], "type">>;
268
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
269
+ createdAt: z.ZodISODateTime;
270
+ updatedAt: z.ZodISODateTime;
271
+ }, z.core.$strip>]>;
272
+ emittedAt: z.ZodISODateTime;
273
+ }, z.core.$strip>;
274
+ export declare const AgentTransientDeltaEventSchema: z.ZodObject<{
275
+ conversationId: z.ZodString;
276
+ runId: z.ZodString;
277
+ emittedAt: z.ZodISODateTime;
278
+ type: z.ZodLiteral<"assistant-delta">;
279
+ runtimeEpoch: z.ZodString;
280
+ sequence: z.ZodInt;
281
+ textDelta: z.ZodString;
282
+ }, z.core.$strip>;
283
+ export declare const AgentReasoningStartEventSchema: z.ZodObject<{
284
+ conversationId: z.ZodString;
285
+ runId: z.ZodString;
286
+ emittedAt: z.ZodISODateTime;
287
+ runtimeEpoch: z.ZodString;
288
+ sequence: z.ZodInt;
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
+ type: z.ZodLiteral<"reasoning-start">;
295
+ }, z.core.$strip>;
296
+ export declare const AgentReasoningDeltaEventSchema: z.ZodObject<{
297
+ conversationId: z.ZodString;
298
+ runId: z.ZodString;
299
+ emittedAt: z.ZodISODateTime;
300
+ runtimeEpoch: z.ZodString;
301
+ sequence: z.ZodInt;
302
+ provider: z.ZodOptional<z.ZodObject<{
303
+ schemaVersion: z.ZodInt;
304
+ provider: z.ZodString;
305
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
306
+ }, z.core.$strip>>;
307
+ type: z.ZodLiteral<"reasoning-delta">;
308
+ textDelta: z.ZodString;
309
+ }, z.core.$strip>;
310
+ export declare const AgentReasoningEndEventSchema: z.ZodObject<{
311
+ conversationId: z.ZodString;
312
+ runId: z.ZodString;
313
+ emittedAt: z.ZodISODateTime;
314
+ runtimeEpoch: z.ZodString;
315
+ sequence: z.ZodInt;
316
+ provider: z.ZodOptional<z.ZodObject<{
317
+ schemaVersion: z.ZodInt;
318
+ provider: z.ZodString;
319
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
320
+ }, z.core.$strip>>;
321
+ type: z.ZodLiteral<"reasoning-end">;
322
+ }, z.core.$strip>;
323
+ export declare const AgentCheckpointEventSchema: z.ZodObject<{
324
+ conversationId: z.ZodString;
325
+ runId: z.ZodString;
326
+ emittedAt: z.ZodISODateTime;
327
+ type: z.ZodLiteral<"assistant-checkpoint">;
328
+ eventId: z.ZodString;
329
+ snapshotVersion: z.ZodInt;
330
+ message: z.ZodObject<{
331
+ schemaVersion: z.ZodLiteral<1>;
332
+ id: z.ZodString;
333
+ conversationId: z.ZodString;
334
+ runId: z.ZodOptional<z.ZodString>;
335
+ role: z.ZodEnum<{
336
+ assistant: "assistant";
337
+ summary: "summary";
338
+ system: "system";
339
+ user: "user";
340
+ }>;
341
+ status: z.ZodEnum<{
342
+ committed: "committed";
343
+ completed: "completed";
344
+ failed: "failed";
345
+ interrupted: "interrupted";
346
+ streaming: "streaming";
347
+ superseded: "superseded";
348
+ }>;
349
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
350
+ type: z.ZodLiteral<"text">;
351
+ text: z.ZodString;
352
+ }, z.core.$strip>, z.ZodObject<{
353
+ type: z.ZodLiteral<"reasoning">;
354
+ text: z.ZodString;
355
+ provider: z.ZodOptional<z.ZodObject<{
356
+ schemaVersion: z.ZodInt;
357
+ provider: z.ZodString;
358
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
359
+ }, z.core.$strip>>;
360
+ }, z.core.$strip>, z.ZodObject<{
361
+ type: z.ZodLiteral<"file">;
362
+ mediaType: z.ZodString;
363
+ reference: z.ZodString;
364
+ filename: z.ZodOptional<z.ZodString>;
365
+ }, z.core.$strip>, z.ZodObject<{
366
+ type: z.ZodLiteral<"source">;
367
+ sourceId: z.ZodString;
368
+ url: z.ZodOptional<z.ZodURL>;
369
+ title: z.ZodOptional<z.ZodString>;
370
+ }, z.core.$strip>, z.ZodObject<{
371
+ type: z.ZodLiteral<"tool-call">;
372
+ callId: z.ZodString;
373
+ toolName: z.ZodString;
374
+ input: z.ZodJSONSchema;
375
+ provider: z.ZodOptional<z.ZodObject<{
376
+ schemaVersion: z.ZodInt;
377
+ provider: z.ZodString;
378
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
379
+ }, z.core.$strip>>;
380
+ }, z.core.$strip>, z.ZodObject<{
381
+ type: z.ZodLiteral<"tool-result">;
382
+ callId: z.ZodString;
383
+ toolName: z.ZodString;
384
+ outcome: z.ZodEnum<{
385
+ error: "error";
386
+ interrupted: "interrupted";
387
+ success: "success";
388
+ }>;
389
+ output: z.ZodOptional<z.ZodJSONSchema>;
390
+ }, z.core.$strip>, z.ZodObject<{
391
+ type: z.ZodLiteral<"provider">;
392
+ envelope: z.ZodObject<{
393
+ schemaVersion: z.ZodInt;
394
+ provider: z.ZodString;
395
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
396
+ }, z.core.$strip>;
397
+ }, z.core.$strip>, z.ZodObject<{
398
+ type: z.ZodLiteral<"control">;
399
+ reason: z.ZodEnum<{
400
+ "run-interrupted": "run-interrupted";
401
+ "stale-run": "stale-run";
402
+ }>;
403
+ }, z.core.$strip>], "type">>;
404
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
405
+ createdAt: z.ZodISODateTime;
406
+ updatedAt: z.ZodISODateTime;
407
+ }, z.core.$strip>;
408
+ metrics: z.ZodOptional<z.ZodObject<{
409
+ partial: z.ZodBoolean;
410
+ usage: z.ZodObject<{
411
+ inputTokens: z.ZodObject<{
412
+ value: z.ZodOptional<z.ZodInt>;
413
+ provenance: z.ZodEnum<{
414
+ computed: "computed";
415
+ estimated: "estimated";
416
+ "provider-reported": "provider-reported";
417
+ unavailable: "unavailable";
418
+ }>;
419
+ }, z.core.$strip>;
420
+ outputTokens: z.ZodObject<{
421
+ value: z.ZodOptional<z.ZodInt>;
422
+ provenance: z.ZodEnum<{
423
+ computed: "computed";
424
+ estimated: "estimated";
425
+ "provider-reported": "provider-reported";
426
+ unavailable: "unavailable";
427
+ }>;
428
+ }, z.core.$strip>;
429
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
430
+ value: z.ZodOptional<z.ZodInt>;
431
+ provenance: z.ZodEnum<{
432
+ computed: "computed";
433
+ estimated: "estimated";
434
+ "provider-reported": "provider-reported";
435
+ unavailable: "unavailable";
436
+ }>;
437
+ }, z.core.$strip>>;
438
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
439
+ value: z.ZodOptional<z.ZodInt>;
440
+ provenance: z.ZodEnum<{
441
+ computed: "computed";
442
+ estimated: "estimated";
443
+ "provider-reported": "provider-reported";
444
+ unavailable: "unavailable";
445
+ }>;
446
+ }, z.core.$strip>>;
447
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
448
+ value: z.ZodOptional<z.ZodInt>;
449
+ provenance: z.ZodEnum<{
450
+ computed: "computed";
451
+ estimated: "estimated";
452
+ "provider-reported": "provider-reported";
453
+ unavailable: "unavailable";
454
+ }>;
455
+ }, z.core.$strip>>;
456
+ cost: z.ZodOptional<z.ZodObject<{
457
+ value: z.ZodOptional<z.ZodNumber>;
458
+ currency: z.ZodOptional<z.ZodString>;
459
+ provenance: z.ZodEnum<{
460
+ computed: "computed";
461
+ estimated: "estimated";
462
+ "provider-reported": "provider-reported";
463
+ unavailable: "unavailable";
464
+ }>;
465
+ }, z.core.$strip>>;
466
+ }, z.core.$strip>;
467
+ durationMs: z.ZodOptional<z.ZodNumber>;
468
+ ttftMs: z.ZodOptional<z.ZodNumber>;
469
+ }, z.core.$strip>>;
470
+ }, z.core.$strip>;
471
+ export declare const AgentRunStateEventSchema: z.ZodObject<{
472
+ conversationId: z.ZodString;
473
+ runId: z.ZodString;
474
+ emittedAt: z.ZodISODateTime;
475
+ type: z.ZodLiteral<"run-state">;
476
+ eventId: z.ZodString;
477
+ snapshotVersion: z.ZodInt;
478
+ state: z.ZodEnum<{
479
+ abandoned: "abandoned";
480
+ cancelled: "cancelled";
481
+ completed: "completed";
482
+ failed: "failed";
483
+ interrupt_requested: "interrupt_requested";
484
+ interrupted: "interrupted";
485
+ queued: "queued";
486
+ running: "running";
487
+ superseded: "superseded";
488
+ }>;
489
+ }, z.core.$strip>;
490
+ export declare const AgentToolStatusEventSchema: z.ZodObject<{
491
+ conversationId: z.ZodString;
492
+ runId: z.ZodString;
493
+ emittedAt: z.ZodISODateTime;
494
+ type: z.ZodLiteral<"tool-status">;
495
+ runtimeEpoch: z.ZodString;
496
+ sequence: z.ZodInt;
497
+ callId: z.ZodString;
498
+ toolName: z.ZodString;
499
+ status: z.ZodEnum<{
500
+ completed: "completed";
501
+ failed: "failed";
502
+ interrupted: "interrupted";
503
+ started: "started";
504
+ }>;
505
+ input: z.ZodOptional<z.ZodJSONSchema>;
506
+ output: z.ZodOptional<z.ZodJSONSchema>;
507
+ }, z.core.$strip>;
508
+ export declare const AgentTerminalEventSchema: z.ZodObject<{
509
+ conversationId: z.ZodString;
510
+ runId: z.ZodString;
511
+ emittedAt: z.ZodISODateTime;
512
+ type: z.ZodLiteral<"terminal">;
513
+ eventId: z.ZodString;
514
+ snapshotVersion: z.ZodInt;
515
+ reason: z.ZodEnum<{
516
+ abandoned: "abandoned";
517
+ absorbed: "absorbed";
518
+ cancelled: "cancelled";
519
+ context_overflow: "context_overflow";
520
+ interrupted: "interrupted";
521
+ policy_stop: "policy_stop";
522
+ provider_failure: "provider_failure";
523
+ provider_stop: "provider_stop";
524
+ shutdown: "shutdown";
525
+ success: "success";
526
+ superseded: "superseded";
527
+ timeout: "timeout";
528
+ }>;
529
+ policyName: z.ZodOptional<z.ZodString>;
530
+ message: z.ZodObject<{
531
+ schemaVersion: z.ZodLiteral<1>;
532
+ id: z.ZodString;
533
+ conversationId: z.ZodString;
534
+ runId: z.ZodOptional<z.ZodString>;
535
+ role: z.ZodEnum<{
536
+ assistant: "assistant";
537
+ summary: "summary";
538
+ system: "system";
539
+ user: "user";
540
+ }>;
541
+ status: z.ZodEnum<{
542
+ committed: "committed";
543
+ completed: "completed";
544
+ failed: "failed";
545
+ interrupted: "interrupted";
546
+ streaming: "streaming";
547
+ superseded: "superseded";
548
+ }>;
549
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
550
+ type: z.ZodLiteral<"text">;
551
+ text: z.ZodString;
552
+ }, z.core.$strip>, z.ZodObject<{
553
+ type: z.ZodLiteral<"reasoning">;
554
+ text: z.ZodString;
555
+ provider: z.ZodOptional<z.ZodObject<{
556
+ schemaVersion: z.ZodInt;
557
+ provider: z.ZodString;
558
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
559
+ }, z.core.$strip>>;
560
+ }, z.core.$strip>, z.ZodObject<{
561
+ type: z.ZodLiteral<"file">;
562
+ mediaType: z.ZodString;
563
+ reference: z.ZodString;
564
+ filename: z.ZodOptional<z.ZodString>;
565
+ }, z.core.$strip>, z.ZodObject<{
566
+ type: z.ZodLiteral<"source">;
567
+ sourceId: z.ZodString;
568
+ url: z.ZodOptional<z.ZodURL>;
569
+ title: z.ZodOptional<z.ZodString>;
570
+ }, z.core.$strip>, z.ZodObject<{
571
+ type: z.ZodLiteral<"tool-call">;
572
+ callId: z.ZodString;
573
+ toolName: z.ZodString;
574
+ input: z.ZodJSONSchema;
575
+ provider: z.ZodOptional<z.ZodObject<{
576
+ schemaVersion: z.ZodInt;
577
+ provider: z.ZodString;
578
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
579
+ }, z.core.$strip>>;
580
+ }, z.core.$strip>, z.ZodObject<{
581
+ type: z.ZodLiteral<"tool-result">;
582
+ callId: z.ZodString;
583
+ toolName: z.ZodString;
584
+ outcome: z.ZodEnum<{
585
+ error: "error";
586
+ interrupted: "interrupted";
587
+ success: "success";
588
+ }>;
589
+ output: z.ZodOptional<z.ZodJSONSchema>;
590
+ }, z.core.$strip>, z.ZodObject<{
591
+ type: z.ZodLiteral<"provider">;
592
+ envelope: z.ZodObject<{
593
+ schemaVersion: z.ZodInt;
594
+ provider: z.ZodString;
595
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
596
+ }, z.core.$strip>;
597
+ }, z.core.$strip>, z.ZodObject<{
598
+ type: z.ZodLiteral<"control">;
599
+ reason: z.ZodEnum<{
600
+ "run-interrupted": "run-interrupted";
601
+ "stale-run": "stale-run";
602
+ }>;
603
+ }, z.core.$strip>], "type">>;
604
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
605
+ createdAt: z.ZodISODateTime;
606
+ updatedAt: z.ZodISODateTime;
607
+ }, z.core.$strip>;
608
+ metrics: z.ZodOptional<z.ZodObject<{
609
+ partial: z.ZodBoolean;
610
+ usage: z.ZodObject<{
611
+ inputTokens: z.ZodObject<{
612
+ value: z.ZodOptional<z.ZodInt>;
613
+ provenance: z.ZodEnum<{
614
+ computed: "computed";
615
+ estimated: "estimated";
616
+ "provider-reported": "provider-reported";
617
+ unavailable: "unavailable";
618
+ }>;
619
+ }, z.core.$strip>;
620
+ outputTokens: z.ZodObject<{
621
+ value: z.ZodOptional<z.ZodInt>;
622
+ provenance: z.ZodEnum<{
623
+ computed: "computed";
624
+ estimated: "estimated";
625
+ "provider-reported": "provider-reported";
626
+ unavailable: "unavailable";
627
+ }>;
628
+ }, z.core.$strip>;
629
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
630
+ value: z.ZodOptional<z.ZodInt>;
631
+ provenance: z.ZodEnum<{
632
+ computed: "computed";
633
+ estimated: "estimated";
634
+ "provider-reported": "provider-reported";
635
+ unavailable: "unavailable";
636
+ }>;
637
+ }, z.core.$strip>>;
638
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
639
+ value: z.ZodOptional<z.ZodInt>;
640
+ provenance: z.ZodEnum<{
641
+ computed: "computed";
642
+ estimated: "estimated";
643
+ "provider-reported": "provider-reported";
644
+ unavailable: "unavailable";
645
+ }>;
646
+ }, z.core.$strip>>;
647
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
648
+ value: z.ZodOptional<z.ZodInt>;
649
+ provenance: z.ZodEnum<{
650
+ computed: "computed";
651
+ estimated: "estimated";
652
+ "provider-reported": "provider-reported";
653
+ unavailable: "unavailable";
654
+ }>;
655
+ }, z.core.$strip>>;
656
+ cost: z.ZodOptional<z.ZodObject<{
657
+ value: z.ZodOptional<z.ZodNumber>;
658
+ currency: z.ZodOptional<z.ZodString>;
659
+ provenance: z.ZodEnum<{
660
+ computed: "computed";
661
+ estimated: "estimated";
662
+ "provider-reported": "provider-reported";
663
+ unavailable: "unavailable";
664
+ }>;
665
+ }, z.core.$strip>>;
666
+ }, z.core.$strip>;
667
+ durationMs: z.ZodOptional<z.ZodNumber>;
668
+ ttftMs: z.ZodOptional<z.ZodNumber>;
669
+ }, z.core.$strip>>;
670
+ }, z.core.$strip>;
671
+ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
672
+ type: z.ZodLiteral<"admission">;
673
+ eventId: z.ZodString;
674
+ conversationId: z.ZodString;
675
+ runId: z.ZodString;
676
+ snapshotVersion: z.ZodInt;
677
+ input: z.ZodObject<{
678
+ schemaVersion: z.ZodLiteral<1>;
679
+ id: z.ZodString;
680
+ conversationId: z.ZodString;
681
+ runId: z.ZodOptional<z.ZodString>;
682
+ role: z.ZodEnum<{
683
+ assistant: "assistant";
684
+ summary: "summary";
685
+ system: "system";
686
+ user: "user";
687
+ }>;
688
+ status: z.ZodEnum<{
689
+ committed: "committed";
690
+ completed: "completed";
691
+ failed: "failed";
692
+ interrupted: "interrupted";
693
+ streaming: "streaming";
694
+ superseded: "superseded";
695
+ }>;
696
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
697
+ type: z.ZodLiteral<"text">;
698
+ text: z.ZodString;
699
+ }, z.core.$strip>, z.ZodObject<{
700
+ type: z.ZodLiteral<"reasoning">;
701
+ text: z.ZodString;
702
+ provider: z.ZodOptional<z.ZodObject<{
703
+ schemaVersion: z.ZodInt;
704
+ provider: z.ZodString;
705
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
706
+ }, z.core.$strip>>;
707
+ }, z.core.$strip>, z.ZodObject<{
708
+ type: z.ZodLiteral<"file">;
709
+ mediaType: z.ZodString;
710
+ reference: z.ZodString;
711
+ filename: z.ZodOptional<z.ZodString>;
712
+ }, z.core.$strip>, z.ZodObject<{
713
+ type: z.ZodLiteral<"source">;
714
+ sourceId: z.ZodString;
715
+ url: z.ZodOptional<z.ZodURL>;
716
+ title: z.ZodOptional<z.ZodString>;
717
+ }, z.core.$strip>, z.ZodObject<{
718
+ type: z.ZodLiteral<"tool-call">;
719
+ callId: z.ZodString;
720
+ toolName: z.ZodString;
721
+ input: z.ZodJSONSchema;
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<"tool-result">;
729
+ callId: z.ZodString;
730
+ toolName: z.ZodString;
731
+ outcome: z.ZodEnum<{
732
+ error: "error";
733
+ interrupted: "interrupted";
734
+ success: "success";
735
+ }>;
736
+ output: z.ZodOptional<z.ZodJSONSchema>;
737
+ }, z.core.$strip>, z.ZodObject<{
738
+ type: z.ZodLiteral<"provider">;
739
+ envelope: z.ZodObject<{
740
+ schemaVersion: z.ZodInt;
741
+ provider: z.ZodString;
742
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
743
+ }, z.core.$strip>;
744
+ }, z.core.$strip>, z.ZodObject<{
745
+ type: z.ZodLiteral<"control">;
746
+ reason: z.ZodEnum<{
747
+ "run-interrupted": "run-interrupted";
748
+ "stale-run": "stale-run";
749
+ }>;
750
+ }, z.core.$strip>], "type">>;
751
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
752
+ createdAt: z.ZodISODateTime;
753
+ updatedAt: z.ZodISODateTime;
754
+ }, z.core.$strip>;
755
+ run: z.ZodObject<{
756
+ schemaVersion: z.ZodLiteral<1>;
757
+ id: z.ZodString;
758
+ conversationId: z.ZodString;
759
+ inputMessageIds: z.ZodArray<z.ZodString>;
760
+ assistantMessageId: z.ZodString;
761
+ state: z.ZodEnum<{
762
+ abandoned: "abandoned";
763
+ cancelled: "cancelled";
764
+ completed: "completed";
765
+ failed: "failed";
766
+ interrupt_requested: "interrupt_requested";
767
+ interrupted: "interrupted";
768
+ queued: "queued";
769
+ running: "running";
770
+ superseded: "superseded";
771
+ }>;
772
+ revision: z.ZodInt;
773
+ queuePriority: z.ZodOptional<z.ZodEnum<{
774
+ "interrupt-next": "interrupt-next";
775
+ }>>;
776
+ executionSequence: z.ZodOptional<z.ZodInt>;
777
+ ownerId: z.ZodOptional<z.ZodString>;
778
+ fencingToken: z.ZodOptional<z.ZodInt>;
779
+ terminalReason: z.ZodOptional<z.ZodEnum<{
780
+ abandoned: "abandoned";
781
+ absorbed: "absorbed";
782
+ cancelled: "cancelled";
783
+ context_overflow: "context_overflow";
784
+ interrupted: "interrupted";
785
+ policy_stop: "policy_stop";
786
+ provider_failure: "provider_failure";
787
+ provider_stop: "provider_stop";
788
+ shutdown: "shutdown";
789
+ success: "success";
790
+ superseded: "superseded";
791
+ timeout: "timeout";
792
+ }>>;
793
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
794
+ absorbedIntoRunId: z.ZodOptional<z.ZodString>;
795
+ usage: z.ZodOptional<z.ZodObject<{
796
+ inputTokens: z.ZodObject<{
797
+ value: z.ZodOptional<z.ZodInt>;
798
+ provenance: z.ZodEnum<{
799
+ computed: "computed";
800
+ estimated: "estimated";
801
+ "provider-reported": "provider-reported";
802
+ unavailable: "unavailable";
803
+ }>;
804
+ }, z.core.$strip>;
805
+ outputTokens: z.ZodObject<{
806
+ value: z.ZodOptional<z.ZodInt>;
807
+ provenance: z.ZodEnum<{
808
+ computed: "computed";
809
+ estimated: "estimated";
810
+ "provider-reported": "provider-reported";
811
+ unavailable: "unavailable";
812
+ }>;
813
+ }, z.core.$strip>;
814
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
815
+ value: z.ZodOptional<z.ZodInt>;
816
+ provenance: z.ZodEnum<{
817
+ computed: "computed";
818
+ estimated: "estimated";
819
+ "provider-reported": "provider-reported";
820
+ unavailable: "unavailable";
821
+ }>;
822
+ }, z.core.$strip>>;
823
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
824
+ value: z.ZodOptional<z.ZodInt>;
825
+ provenance: z.ZodEnum<{
826
+ computed: "computed";
827
+ estimated: "estimated";
828
+ "provider-reported": "provider-reported";
829
+ unavailable: "unavailable";
830
+ }>;
831
+ }, z.core.$strip>>;
832
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
833
+ value: z.ZodOptional<z.ZodInt>;
834
+ provenance: z.ZodEnum<{
835
+ computed: "computed";
836
+ estimated: "estimated";
837
+ "provider-reported": "provider-reported";
838
+ unavailable: "unavailable";
839
+ }>;
840
+ }, z.core.$strip>>;
841
+ cost: z.ZodOptional<z.ZodObject<{
842
+ value: z.ZodOptional<z.ZodNumber>;
843
+ currency: z.ZodOptional<z.ZodString>;
844
+ provenance: z.ZodEnum<{
845
+ computed: "computed";
846
+ estimated: "estimated";
847
+ "provider-reported": "provider-reported";
848
+ unavailable: "unavailable";
849
+ }>;
850
+ }, z.core.$strip>>;
851
+ }, z.core.$strip>>;
852
+ createdAt: z.ZodISODateTime;
853
+ updatedAt: z.ZodISODateTime;
854
+ }, z.core.$strip>;
855
+ assistant: z.ZodUnion<readonly [z.ZodObject<{
856
+ schemaVersion: z.ZodLiteral<1>;
857
+ id: z.ZodString;
858
+ conversationId: z.ZodString;
859
+ runId: z.ZodString;
860
+ status: z.ZodLiteral<"pending">;
861
+ createdAt: z.ZodISODateTime;
862
+ updatedAt: z.ZodISODateTime;
863
+ }, z.core.$strip>, z.ZodObject<{
864
+ schemaVersion: z.ZodLiteral<1>;
865
+ id: z.ZodString;
866
+ conversationId: z.ZodString;
867
+ runId: z.ZodOptional<z.ZodString>;
868
+ role: z.ZodEnum<{
869
+ assistant: "assistant";
870
+ summary: "summary";
871
+ system: "system";
872
+ user: "user";
873
+ }>;
874
+ status: z.ZodEnum<{
875
+ committed: "committed";
876
+ completed: "completed";
877
+ failed: "failed";
878
+ interrupted: "interrupted";
879
+ streaming: "streaming";
880
+ superseded: "superseded";
881
+ }>;
882
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
883
+ type: z.ZodLiteral<"text">;
884
+ text: z.ZodString;
885
+ }, z.core.$strip>, z.ZodObject<{
886
+ type: z.ZodLiteral<"reasoning">;
887
+ text: z.ZodString;
888
+ provider: z.ZodOptional<z.ZodObject<{
889
+ schemaVersion: z.ZodInt;
890
+ provider: z.ZodString;
891
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
892
+ }, z.core.$strip>>;
893
+ }, z.core.$strip>, z.ZodObject<{
894
+ type: z.ZodLiteral<"file">;
895
+ mediaType: z.ZodString;
896
+ reference: z.ZodString;
897
+ filename: z.ZodOptional<z.ZodString>;
898
+ }, z.core.$strip>, z.ZodObject<{
899
+ type: z.ZodLiteral<"source">;
900
+ sourceId: z.ZodString;
901
+ url: z.ZodOptional<z.ZodURL>;
902
+ title: z.ZodOptional<z.ZodString>;
903
+ }, z.core.$strip>, z.ZodObject<{
904
+ type: z.ZodLiteral<"tool-call">;
905
+ callId: z.ZodString;
906
+ toolName: z.ZodString;
907
+ input: z.ZodJSONSchema;
908
+ provider: z.ZodOptional<z.ZodObject<{
909
+ schemaVersion: z.ZodInt;
910
+ provider: z.ZodString;
911
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
912
+ }, z.core.$strip>>;
913
+ }, z.core.$strip>, z.ZodObject<{
914
+ type: z.ZodLiteral<"tool-result">;
915
+ callId: z.ZodString;
916
+ toolName: z.ZodString;
917
+ outcome: z.ZodEnum<{
918
+ error: "error";
919
+ interrupted: "interrupted";
920
+ success: "success";
921
+ }>;
922
+ output: z.ZodOptional<z.ZodJSONSchema>;
923
+ }, z.core.$strip>, z.ZodObject<{
924
+ type: z.ZodLiteral<"provider">;
925
+ envelope: z.ZodObject<{
926
+ schemaVersion: z.ZodInt;
927
+ provider: z.ZodString;
928
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
929
+ }, z.core.$strip>;
930
+ }, z.core.$strip>, z.ZodObject<{
931
+ type: z.ZodLiteral<"control">;
932
+ reason: z.ZodEnum<{
933
+ "run-interrupted": "run-interrupted";
934
+ "stale-run": "stale-run";
935
+ }>;
936
+ }, z.core.$strip>], "type">>;
937
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
938
+ createdAt: z.ZodISODateTime;
939
+ updatedAt: z.ZodISODateTime;
940
+ }, z.core.$strip>]>;
941
+ emittedAt: z.ZodISODateTime;
942
+ }, z.core.$strip>, z.ZodObject<{
943
+ conversationId: z.ZodString;
944
+ runId: z.ZodString;
945
+ emittedAt: z.ZodISODateTime;
946
+ type: z.ZodLiteral<"assistant-delta">;
947
+ runtimeEpoch: z.ZodString;
948
+ sequence: z.ZodInt;
949
+ textDelta: z.ZodString;
950
+ }, z.core.$strip>, z.ZodObject<{
951
+ conversationId: z.ZodString;
952
+ runId: z.ZodString;
953
+ emittedAt: z.ZodISODateTime;
954
+ runtimeEpoch: z.ZodString;
955
+ sequence: z.ZodInt;
956
+ provider: z.ZodOptional<z.ZodObject<{
957
+ schemaVersion: z.ZodInt;
958
+ provider: z.ZodString;
959
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
960
+ }, z.core.$strip>>;
961
+ type: z.ZodLiteral<"reasoning-start">;
962
+ }, z.core.$strip>, z.ZodObject<{
963
+ conversationId: z.ZodString;
964
+ runId: z.ZodString;
965
+ emittedAt: z.ZodISODateTime;
966
+ runtimeEpoch: z.ZodString;
967
+ sequence: z.ZodInt;
968
+ provider: z.ZodOptional<z.ZodObject<{
969
+ schemaVersion: z.ZodInt;
970
+ provider: z.ZodString;
971
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
972
+ }, z.core.$strip>>;
973
+ type: z.ZodLiteral<"reasoning-delta">;
974
+ textDelta: z.ZodString;
975
+ }, z.core.$strip>, z.ZodObject<{
976
+ conversationId: z.ZodString;
977
+ runId: z.ZodString;
978
+ emittedAt: z.ZodISODateTime;
979
+ runtimeEpoch: z.ZodString;
980
+ sequence: z.ZodInt;
981
+ provider: z.ZodOptional<z.ZodObject<{
982
+ schemaVersion: z.ZodInt;
983
+ provider: z.ZodString;
984
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
985
+ }, z.core.$strip>>;
986
+ type: z.ZodLiteral<"reasoning-end">;
987
+ }, z.core.$strip>, z.ZodObject<{
988
+ conversationId: z.ZodString;
989
+ runId: z.ZodString;
990
+ emittedAt: z.ZodISODateTime;
991
+ type: z.ZodLiteral<"assistant-checkpoint">;
992
+ eventId: z.ZodString;
993
+ snapshotVersion: z.ZodInt;
994
+ message: z.ZodObject<{
995
+ schemaVersion: z.ZodLiteral<1>;
996
+ id: z.ZodString;
997
+ conversationId: z.ZodString;
998
+ runId: z.ZodOptional<z.ZodString>;
999
+ role: z.ZodEnum<{
1000
+ assistant: "assistant";
1001
+ summary: "summary";
1002
+ system: "system";
1003
+ user: "user";
1004
+ }>;
1005
+ status: z.ZodEnum<{
1006
+ committed: "committed";
1007
+ completed: "completed";
1008
+ failed: "failed";
1009
+ interrupted: "interrupted";
1010
+ streaming: "streaming";
1011
+ superseded: "superseded";
1012
+ }>;
1013
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1014
+ type: z.ZodLiteral<"text">;
1015
+ text: z.ZodString;
1016
+ }, z.core.$strip>, z.ZodObject<{
1017
+ type: z.ZodLiteral<"reasoning">;
1018
+ text: z.ZodString;
1019
+ provider: z.ZodOptional<z.ZodObject<{
1020
+ schemaVersion: z.ZodInt;
1021
+ provider: z.ZodString;
1022
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1023
+ }, z.core.$strip>>;
1024
+ }, z.core.$strip>, z.ZodObject<{
1025
+ type: z.ZodLiteral<"file">;
1026
+ mediaType: z.ZodString;
1027
+ reference: z.ZodString;
1028
+ filename: z.ZodOptional<z.ZodString>;
1029
+ }, z.core.$strip>, z.ZodObject<{
1030
+ type: z.ZodLiteral<"source">;
1031
+ sourceId: z.ZodString;
1032
+ url: z.ZodOptional<z.ZodURL>;
1033
+ title: z.ZodOptional<z.ZodString>;
1034
+ }, z.core.$strip>, z.ZodObject<{
1035
+ type: z.ZodLiteral<"tool-call">;
1036
+ callId: z.ZodString;
1037
+ toolName: z.ZodString;
1038
+ input: z.ZodJSONSchema;
1039
+ provider: z.ZodOptional<z.ZodObject<{
1040
+ schemaVersion: z.ZodInt;
1041
+ provider: z.ZodString;
1042
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1043
+ }, z.core.$strip>>;
1044
+ }, z.core.$strip>, z.ZodObject<{
1045
+ type: z.ZodLiteral<"tool-result">;
1046
+ callId: z.ZodString;
1047
+ toolName: z.ZodString;
1048
+ outcome: z.ZodEnum<{
1049
+ error: "error";
1050
+ interrupted: "interrupted";
1051
+ success: "success";
1052
+ }>;
1053
+ output: z.ZodOptional<z.ZodJSONSchema>;
1054
+ }, z.core.$strip>, z.ZodObject<{
1055
+ type: z.ZodLiteral<"provider">;
1056
+ envelope: z.ZodObject<{
1057
+ schemaVersion: z.ZodInt;
1058
+ provider: z.ZodString;
1059
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1060
+ }, z.core.$strip>;
1061
+ }, z.core.$strip>, z.ZodObject<{
1062
+ type: z.ZodLiteral<"control">;
1063
+ reason: z.ZodEnum<{
1064
+ "run-interrupted": "run-interrupted";
1065
+ "stale-run": "stale-run";
1066
+ }>;
1067
+ }, z.core.$strip>], "type">>;
1068
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1069
+ createdAt: z.ZodISODateTime;
1070
+ updatedAt: z.ZodISODateTime;
1071
+ }, z.core.$strip>;
1072
+ metrics: z.ZodOptional<z.ZodObject<{
1073
+ partial: z.ZodBoolean;
1074
+ usage: z.ZodObject<{
1075
+ inputTokens: z.ZodObject<{
1076
+ value: z.ZodOptional<z.ZodInt>;
1077
+ provenance: z.ZodEnum<{
1078
+ computed: "computed";
1079
+ estimated: "estimated";
1080
+ "provider-reported": "provider-reported";
1081
+ unavailable: "unavailable";
1082
+ }>;
1083
+ }, z.core.$strip>;
1084
+ outputTokens: z.ZodObject<{
1085
+ value: z.ZodOptional<z.ZodInt>;
1086
+ provenance: z.ZodEnum<{
1087
+ computed: "computed";
1088
+ estimated: "estimated";
1089
+ "provider-reported": "provider-reported";
1090
+ unavailable: "unavailable";
1091
+ }>;
1092
+ }, z.core.$strip>;
1093
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1094
+ value: z.ZodOptional<z.ZodInt>;
1095
+ provenance: z.ZodEnum<{
1096
+ computed: "computed";
1097
+ estimated: "estimated";
1098
+ "provider-reported": "provider-reported";
1099
+ unavailable: "unavailable";
1100
+ }>;
1101
+ }, z.core.$strip>>;
1102
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1103
+ value: z.ZodOptional<z.ZodInt>;
1104
+ provenance: z.ZodEnum<{
1105
+ computed: "computed";
1106
+ estimated: "estimated";
1107
+ "provider-reported": "provider-reported";
1108
+ unavailable: "unavailable";
1109
+ }>;
1110
+ }, z.core.$strip>>;
1111
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1112
+ value: z.ZodOptional<z.ZodInt>;
1113
+ provenance: z.ZodEnum<{
1114
+ computed: "computed";
1115
+ estimated: "estimated";
1116
+ "provider-reported": "provider-reported";
1117
+ unavailable: "unavailable";
1118
+ }>;
1119
+ }, z.core.$strip>>;
1120
+ cost: z.ZodOptional<z.ZodObject<{
1121
+ value: z.ZodOptional<z.ZodNumber>;
1122
+ currency: z.ZodOptional<z.ZodString>;
1123
+ provenance: z.ZodEnum<{
1124
+ computed: "computed";
1125
+ estimated: "estimated";
1126
+ "provider-reported": "provider-reported";
1127
+ unavailable: "unavailable";
1128
+ }>;
1129
+ }, z.core.$strip>>;
1130
+ }, z.core.$strip>;
1131
+ durationMs: z.ZodOptional<z.ZodNumber>;
1132
+ ttftMs: z.ZodOptional<z.ZodNumber>;
1133
+ }, z.core.$strip>>;
1134
+ }, z.core.$strip>, z.ZodObject<{
1135
+ conversationId: z.ZodString;
1136
+ runId: z.ZodString;
1137
+ emittedAt: z.ZodISODateTime;
1138
+ type: z.ZodLiteral<"run-state">;
1139
+ eventId: z.ZodString;
1140
+ snapshotVersion: z.ZodInt;
1141
+ state: z.ZodEnum<{
1142
+ abandoned: "abandoned";
1143
+ cancelled: "cancelled";
1144
+ completed: "completed";
1145
+ failed: "failed";
1146
+ interrupt_requested: "interrupt_requested";
1147
+ interrupted: "interrupted";
1148
+ queued: "queued";
1149
+ running: "running";
1150
+ superseded: "superseded";
1151
+ }>;
1152
+ }, z.core.$strip>, z.ZodObject<{
1153
+ conversationId: z.ZodString;
1154
+ runId: z.ZodString;
1155
+ emittedAt: z.ZodISODateTime;
1156
+ type: z.ZodLiteral<"tool-status">;
1157
+ runtimeEpoch: z.ZodString;
1158
+ sequence: z.ZodInt;
1159
+ callId: z.ZodString;
1160
+ toolName: z.ZodString;
1161
+ status: z.ZodEnum<{
1162
+ completed: "completed";
1163
+ failed: "failed";
1164
+ interrupted: "interrupted";
1165
+ started: "started";
1166
+ }>;
1167
+ input: z.ZodOptional<z.ZodJSONSchema>;
1168
+ output: z.ZodOptional<z.ZodJSONSchema>;
1169
+ }, z.core.$strip>, z.ZodObject<{
1170
+ conversationId: z.ZodString;
1171
+ runId: z.ZodString;
1172
+ emittedAt: z.ZodISODateTime;
1173
+ type: z.ZodLiteral<"terminal">;
1174
+ eventId: z.ZodString;
1175
+ snapshotVersion: z.ZodInt;
1176
+ reason: z.ZodEnum<{
1177
+ abandoned: "abandoned";
1178
+ absorbed: "absorbed";
1179
+ cancelled: "cancelled";
1180
+ context_overflow: "context_overflow";
1181
+ interrupted: "interrupted";
1182
+ policy_stop: "policy_stop";
1183
+ provider_failure: "provider_failure";
1184
+ provider_stop: "provider_stop";
1185
+ shutdown: "shutdown";
1186
+ success: "success";
1187
+ superseded: "superseded";
1188
+ timeout: "timeout";
1189
+ }>;
1190
+ policyName: z.ZodOptional<z.ZodString>;
1191
+ message: z.ZodObject<{
1192
+ schemaVersion: z.ZodLiteral<1>;
1193
+ id: z.ZodString;
1194
+ conversationId: z.ZodString;
1195
+ runId: z.ZodOptional<z.ZodString>;
1196
+ role: z.ZodEnum<{
1197
+ assistant: "assistant";
1198
+ summary: "summary";
1199
+ system: "system";
1200
+ user: "user";
1201
+ }>;
1202
+ status: z.ZodEnum<{
1203
+ committed: "committed";
1204
+ completed: "completed";
1205
+ failed: "failed";
1206
+ interrupted: "interrupted";
1207
+ streaming: "streaming";
1208
+ superseded: "superseded";
1209
+ }>;
1210
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1211
+ type: z.ZodLiteral<"text">;
1212
+ text: z.ZodString;
1213
+ }, z.core.$strip>, z.ZodObject<{
1214
+ type: z.ZodLiteral<"reasoning">;
1215
+ text: z.ZodString;
1216
+ provider: z.ZodOptional<z.ZodObject<{
1217
+ schemaVersion: z.ZodInt;
1218
+ provider: z.ZodString;
1219
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1220
+ }, z.core.$strip>>;
1221
+ }, z.core.$strip>, z.ZodObject<{
1222
+ type: z.ZodLiteral<"file">;
1223
+ mediaType: z.ZodString;
1224
+ reference: z.ZodString;
1225
+ filename: z.ZodOptional<z.ZodString>;
1226
+ }, z.core.$strip>, z.ZodObject<{
1227
+ type: z.ZodLiteral<"source">;
1228
+ sourceId: z.ZodString;
1229
+ url: z.ZodOptional<z.ZodURL>;
1230
+ title: z.ZodOptional<z.ZodString>;
1231
+ }, z.core.$strip>, z.ZodObject<{
1232
+ type: z.ZodLiteral<"tool-call">;
1233
+ callId: z.ZodString;
1234
+ toolName: z.ZodString;
1235
+ input: z.ZodJSONSchema;
1236
+ provider: z.ZodOptional<z.ZodObject<{
1237
+ schemaVersion: z.ZodInt;
1238
+ provider: z.ZodString;
1239
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1240
+ }, z.core.$strip>>;
1241
+ }, z.core.$strip>, z.ZodObject<{
1242
+ type: z.ZodLiteral<"tool-result">;
1243
+ callId: z.ZodString;
1244
+ toolName: z.ZodString;
1245
+ outcome: z.ZodEnum<{
1246
+ error: "error";
1247
+ interrupted: "interrupted";
1248
+ success: "success";
1249
+ }>;
1250
+ output: z.ZodOptional<z.ZodJSONSchema>;
1251
+ }, z.core.$strip>, z.ZodObject<{
1252
+ type: z.ZodLiteral<"provider">;
1253
+ envelope: z.ZodObject<{
1254
+ schemaVersion: z.ZodInt;
1255
+ provider: z.ZodString;
1256
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
1257
+ }, z.core.$strip>;
1258
+ }, z.core.$strip>, z.ZodObject<{
1259
+ type: z.ZodLiteral<"control">;
1260
+ reason: z.ZodEnum<{
1261
+ "run-interrupted": "run-interrupted";
1262
+ "stale-run": "stale-run";
1263
+ }>;
1264
+ }, z.core.$strip>], "type">>;
1265
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
1266
+ createdAt: z.ZodISODateTime;
1267
+ updatedAt: z.ZodISODateTime;
1268
+ }, z.core.$strip>;
1269
+ metrics: z.ZodOptional<z.ZodObject<{
1270
+ partial: z.ZodBoolean;
1271
+ usage: z.ZodObject<{
1272
+ inputTokens: z.ZodObject<{
1273
+ value: z.ZodOptional<z.ZodInt>;
1274
+ provenance: z.ZodEnum<{
1275
+ computed: "computed";
1276
+ estimated: "estimated";
1277
+ "provider-reported": "provider-reported";
1278
+ unavailable: "unavailable";
1279
+ }>;
1280
+ }, z.core.$strip>;
1281
+ outputTokens: z.ZodObject<{
1282
+ value: z.ZodOptional<z.ZodInt>;
1283
+ provenance: z.ZodEnum<{
1284
+ computed: "computed";
1285
+ estimated: "estimated";
1286
+ "provider-reported": "provider-reported";
1287
+ unavailable: "unavailable";
1288
+ }>;
1289
+ }, z.core.$strip>;
1290
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1291
+ value: z.ZodOptional<z.ZodInt>;
1292
+ provenance: z.ZodEnum<{
1293
+ computed: "computed";
1294
+ estimated: "estimated";
1295
+ "provider-reported": "provider-reported";
1296
+ unavailable: "unavailable";
1297
+ }>;
1298
+ }, z.core.$strip>>;
1299
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1300
+ value: z.ZodOptional<z.ZodInt>;
1301
+ provenance: z.ZodEnum<{
1302
+ computed: "computed";
1303
+ estimated: "estimated";
1304
+ "provider-reported": "provider-reported";
1305
+ unavailable: "unavailable";
1306
+ }>;
1307
+ }, z.core.$strip>>;
1308
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1309
+ value: z.ZodOptional<z.ZodInt>;
1310
+ provenance: z.ZodEnum<{
1311
+ computed: "computed";
1312
+ estimated: "estimated";
1313
+ "provider-reported": "provider-reported";
1314
+ unavailable: "unavailable";
1315
+ }>;
1316
+ }, z.core.$strip>>;
1317
+ cost: z.ZodOptional<z.ZodObject<{
1318
+ value: z.ZodOptional<z.ZodNumber>;
1319
+ currency: z.ZodOptional<z.ZodString>;
1320
+ provenance: z.ZodEnum<{
1321
+ computed: "computed";
1322
+ estimated: "estimated";
1323
+ "provider-reported": "provider-reported";
1324
+ unavailable: "unavailable";
1325
+ }>;
1326
+ }, z.core.$strip>>;
1327
+ }, z.core.$strip>;
1328
+ durationMs: z.ZodOptional<z.ZodNumber>;
1329
+ ttftMs: z.ZodOptional<z.ZodNumber>;
1330
+ }, z.core.$strip>>;
1331
+ }, z.core.$strip>], "type">;
1332
+ export type AgentRuntimeEvent = z.infer<typeof AgentRuntimeEventSchema>;
1333
+ export type AgentRuntimePublisher = (event: AgentRuntimeEvent) => void | Promise<void>;
1334
+ export declare const AgentRuntimeEventCursorSchema: z.ZodObject<{
1335
+ snapshotVersion: z.ZodOptional<z.ZodInt>;
1336
+ durableEventIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1337
+ runtimeEpoch: z.ZodOptional<z.ZodString>;
1338
+ sequence: z.ZodOptional<z.ZodInt>;
1339
+ }, z.core.$strip>;
1340
+ export type AgentRuntimeEventCursor = z.infer<typeof AgentRuntimeEventCursorSchema>;
1341
+ export interface AgentRuntimeCursorAdvance {
1342
+ status: 'accepted' | 'duplicate' | 'gap';
1343
+ cursor: AgentRuntimeEventCursor;
1344
+ }
1345
+ /** Detect duplicate or missing delivery so reconnect can reload the durable snapshot. */
1346
+ export declare function advanceAgentRuntimeEventCursor(rawCursor: AgentRuntimeEventCursor, event: AgentRuntimeEvent): AgentRuntimeCursorAdvance;
1347
+ /** Stable identity for a post-CAS event; safe for outbox/dedup keys. */
1348
+ export declare function agentDurableEventId(type: 'admission' | 'assistant-checkpoint' | 'run-state' | 'terminal', runId: string, snapshotVersion: number): string;
1349
+ //# sourceMappingURL=event-schema.d.ts.map