stitchkit 0.56.4 → 0.57.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.
@@ -1,4 +1,207 @@
1
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
+ }>;
26
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
27
+ type: z.ZodLiteral<"text">;
28
+ text: z.ZodString;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ type: z.ZodLiteral<"reasoning">;
31
+ text: z.ZodString;
32
+ provider: z.ZodOptional<z.ZodObject<{
33
+ schemaVersion: z.ZodInt;
34
+ provider: z.ZodString;
35
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ type: z.ZodLiteral<"file">;
39
+ mediaType: z.ZodString;
40
+ reference: z.ZodString;
41
+ filename: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ type: z.ZodLiteral<"source">;
44
+ sourceId: z.ZodString;
45
+ url: z.ZodOptional<z.ZodURL>;
46
+ title: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ type: z.ZodLiteral<"tool-call">;
49
+ callId: z.ZodString;
50
+ toolName: z.ZodString;
51
+ input: z.ZodJSONSchema;
52
+ provider: z.ZodOptional<z.ZodObject<{
53
+ schemaVersion: z.ZodInt;
54
+ provider: z.ZodString;
55
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ type: z.ZodLiteral<"tool-result">;
59
+ callId: z.ZodString;
60
+ toolName: z.ZodString;
61
+ outcome: z.ZodEnum<{
62
+ error: "error";
63
+ interrupted: "interrupted";
64
+ success: "success";
65
+ }>;
66
+ output: z.ZodOptional<z.ZodJSONSchema>;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ type: z.ZodLiteral<"provider">;
69
+ envelope: 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<"control">;
76
+ reason: z.ZodEnum<{
77
+ "run-interrupted": "run-interrupted";
78
+ "stale-run": "stale-run";
79
+ }>;
80
+ }, z.core.$strip>], "type">>;
81
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
82
+ createdAt: z.ZodISODateTime;
83
+ updatedAt: z.ZodISODateTime;
84
+ }, z.core.$strip>;
85
+ run: z.ZodObject<{
86
+ schemaVersion: z.ZodLiteral<1>;
87
+ id: z.ZodString;
88
+ conversationId: z.ZodString;
89
+ inputMessageIds: z.ZodArray<z.ZodString>;
90
+ assistantMessageId: z.ZodString;
91
+ state: z.ZodEnum<{
92
+ abandoned: "abandoned";
93
+ cancelled: "cancelled";
94
+ completed: "completed";
95
+ failed: "failed";
96
+ interrupt_requested: "interrupt_requested";
97
+ interrupted: "interrupted";
98
+ queued: "queued";
99
+ running: "running";
100
+ }>;
101
+ revision: z.ZodInt;
102
+ ownerId: z.ZodOptional<z.ZodString>;
103
+ terminalReason: z.ZodOptional<z.ZodEnum<{
104
+ abandoned: "abandoned";
105
+ cancelled: "cancelled";
106
+ interrupted: "interrupted";
107
+ policy_stop: "policy_stop";
108
+ provider_failure: "provider_failure";
109
+ shutdown: "shutdown";
110
+ success: "success";
111
+ timeout: "timeout";
112
+ tool_failure: "tool_failure";
113
+ }>>;
114
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
115
+ createdAt: z.ZodISODateTime;
116
+ updatedAt: z.ZodISODateTime;
117
+ }, z.core.$strip>;
118
+ assistant: z.ZodUnion<readonly [z.ZodObject<{
119
+ schemaVersion: z.ZodLiteral<1>;
120
+ id: z.ZodString;
121
+ conversationId: z.ZodString;
122
+ runId: z.ZodString;
123
+ status: z.ZodLiteral<"pending">;
124
+ createdAt: z.ZodISODateTime;
125
+ updatedAt: z.ZodISODateTime;
126
+ }, z.core.$strip>, z.ZodObject<{
127
+ schemaVersion: z.ZodLiteral<1>;
128
+ id: z.ZodString;
129
+ conversationId: z.ZodString;
130
+ runId: z.ZodOptional<z.ZodString>;
131
+ role: z.ZodEnum<{
132
+ assistant: "assistant";
133
+ summary: "summary";
134
+ system: "system";
135
+ user: "user";
136
+ }>;
137
+ status: z.ZodEnum<{
138
+ committed: "committed";
139
+ completed: "completed";
140
+ failed: "failed";
141
+ interrupted: "interrupted";
142
+ streaming: "streaming";
143
+ }>;
144
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
145
+ type: z.ZodLiteral<"text">;
146
+ text: z.ZodString;
147
+ }, z.core.$strip>, z.ZodObject<{
148
+ type: z.ZodLiteral<"reasoning">;
149
+ text: z.ZodString;
150
+ provider: z.ZodOptional<z.ZodObject<{
151
+ schemaVersion: z.ZodInt;
152
+ provider: z.ZodString;
153
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
154
+ }, z.core.$strip>>;
155
+ }, z.core.$strip>, z.ZodObject<{
156
+ type: z.ZodLiteral<"file">;
157
+ mediaType: z.ZodString;
158
+ reference: z.ZodString;
159
+ filename: z.ZodOptional<z.ZodString>;
160
+ }, z.core.$strip>, z.ZodObject<{
161
+ type: z.ZodLiteral<"source">;
162
+ sourceId: z.ZodString;
163
+ url: z.ZodOptional<z.ZodURL>;
164
+ title: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ type: z.ZodLiteral<"tool-call">;
167
+ callId: z.ZodString;
168
+ toolName: z.ZodString;
169
+ input: z.ZodJSONSchema;
170
+ provider: z.ZodOptional<z.ZodObject<{
171
+ schemaVersion: z.ZodInt;
172
+ provider: z.ZodString;
173
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
174
+ }, z.core.$strip>>;
175
+ }, z.core.$strip>, z.ZodObject<{
176
+ type: z.ZodLiteral<"tool-result">;
177
+ callId: z.ZodString;
178
+ toolName: z.ZodString;
179
+ outcome: z.ZodEnum<{
180
+ error: "error";
181
+ interrupted: "interrupted";
182
+ success: "success";
183
+ }>;
184
+ output: z.ZodOptional<z.ZodJSONSchema>;
185
+ }, z.core.$strip>, z.ZodObject<{
186
+ type: z.ZodLiteral<"provider">;
187
+ envelope: z.ZodObject<{
188
+ schemaVersion: z.ZodInt;
189
+ provider: z.ZodString;
190
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
191
+ }, z.core.$strip>;
192
+ }, z.core.$strip>, z.ZodObject<{
193
+ type: z.ZodLiteral<"control">;
194
+ reason: z.ZodEnum<{
195
+ "run-interrupted": "run-interrupted";
196
+ "stale-run": "stale-run";
197
+ }>;
198
+ }, z.core.$strip>], "type">>;
199
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
200
+ createdAt: z.ZodISODateTime;
201
+ updatedAt: z.ZodISODateTime;
202
+ }, z.core.$strip>]>;
203
+ emittedAt: z.ZodISODateTime;
204
+ }, z.core.$strip>;
2
205
  export declare const AgentTransientDeltaEventSchema: z.ZodObject<{
3
206
  conversationId: z.ZodString;
4
207
  runId: z.ZodString;
@@ -8,6 +211,46 @@ export declare const AgentTransientDeltaEventSchema: z.ZodObject<{
8
211
  sequence: z.ZodInt;
9
212
  textDelta: z.ZodString;
10
213
  }, z.core.$strip>;
214
+ export declare const AgentReasoningStartEventSchema: z.ZodObject<{
215
+ conversationId: z.ZodString;
216
+ runId: z.ZodString;
217
+ emittedAt: z.ZodISODateTime;
218
+ runtimeEpoch: z.ZodString;
219
+ sequence: z.ZodInt;
220
+ provider: z.ZodOptional<z.ZodObject<{
221
+ schemaVersion: z.ZodInt;
222
+ provider: z.ZodString;
223
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
224
+ }, z.core.$strip>>;
225
+ type: z.ZodLiteral<"reasoning-start">;
226
+ }, z.core.$strip>;
227
+ export declare const AgentReasoningDeltaEventSchema: z.ZodObject<{
228
+ conversationId: z.ZodString;
229
+ runId: z.ZodString;
230
+ emittedAt: z.ZodISODateTime;
231
+ runtimeEpoch: z.ZodString;
232
+ sequence: z.ZodInt;
233
+ provider: z.ZodOptional<z.ZodObject<{
234
+ schemaVersion: z.ZodInt;
235
+ provider: z.ZodString;
236
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
237
+ }, z.core.$strip>>;
238
+ type: z.ZodLiteral<"reasoning-delta">;
239
+ textDelta: z.ZodString;
240
+ }, z.core.$strip>;
241
+ export declare const AgentReasoningEndEventSchema: z.ZodObject<{
242
+ conversationId: z.ZodString;
243
+ runId: z.ZodString;
244
+ emittedAt: z.ZodISODateTime;
245
+ runtimeEpoch: z.ZodString;
246
+ sequence: z.ZodInt;
247
+ provider: z.ZodOptional<z.ZodObject<{
248
+ schemaVersion: z.ZodInt;
249
+ provider: z.ZodString;
250
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
251
+ }, z.core.$strip>>;
252
+ type: z.ZodLiteral<"reasoning-end">;
253
+ }, z.core.$strip>;
11
254
  export declare const AgentCheckpointEventSchema: z.ZodObject<{
12
255
  conversationId: z.ZodString;
13
256
  runId: z.ZodString;
@@ -92,6 +335,68 @@ export declare const AgentCheckpointEventSchema: z.ZodObject<{
92
335
  createdAt: z.ZodISODateTime;
93
336
  updatedAt: z.ZodISODateTime;
94
337
  }, z.core.$strip>;
338
+ metrics: z.ZodOptional<z.ZodObject<{
339
+ partial: z.ZodBoolean;
340
+ usage: z.ZodOptional<z.ZodObject<{
341
+ inputTokens: z.ZodObject<{
342
+ value: z.ZodOptional<z.ZodNumber>;
343
+ provenance: z.ZodEnum<{
344
+ computed: "computed";
345
+ estimated: "estimated";
346
+ "provider-reported": "provider-reported";
347
+ unavailable: "unavailable";
348
+ }>;
349
+ }, z.core.$strip>;
350
+ outputTokens: z.ZodObject<{
351
+ value: z.ZodOptional<z.ZodNumber>;
352
+ provenance: z.ZodEnum<{
353
+ computed: "computed";
354
+ estimated: "estimated";
355
+ "provider-reported": "provider-reported";
356
+ unavailable: "unavailable";
357
+ }>;
358
+ }, z.core.$strip>;
359
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
360
+ value: z.ZodOptional<z.ZodNumber>;
361
+ provenance: z.ZodEnum<{
362
+ computed: "computed";
363
+ estimated: "estimated";
364
+ "provider-reported": "provider-reported";
365
+ unavailable: "unavailable";
366
+ }>;
367
+ }, z.core.$strip>>;
368
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
369
+ value: z.ZodOptional<z.ZodNumber>;
370
+ provenance: z.ZodEnum<{
371
+ computed: "computed";
372
+ estimated: "estimated";
373
+ "provider-reported": "provider-reported";
374
+ unavailable: "unavailable";
375
+ }>;
376
+ }, z.core.$strip>>;
377
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
378
+ value: z.ZodOptional<z.ZodNumber>;
379
+ provenance: z.ZodEnum<{
380
+ computed: "computed";
381
+ estimated: "estimated";
382
+ "provider-reported": "provider-reported";
383
+ unavailable: "unavailable";
384
+ }>;
385
+ }, z.core.$strip>>;
386
+ cost: z.ZodOptional<z.ZodObject<{
387
+ value: z.ZodOptional<z.ZodNumber>;
388
+ currency: z.ZodOptional<z.ZodString>;
389
+ provenance: z.ZodEnum<{
390
+ computed: "computed";
391
+ estimated: "estimated";
392
+ "provider-reported": "provider-reported";
393
+ unavailable: "unavailable";
394
+ }>;
395
+ }, z.core.$strip>>;
396
+ }, z.core.$strip>>;
397
+ durationMs: z.ZodOptional<z.ZodNumber>;
398
+ ttftMs: z.ZodOptional<z.ZodNumber>;
399
+ }, z.core.$strip>>;
95
400
  }, z.core.$strip>;
96
401
  export declare const AgentRunStateEventSchema: z.ZodObject<{
97
402
  conversationId: z.ZodString;
@@ -225,8 +530,272 @@ export declare const AgentTerminalEventSchema: z.ZodObject<{
225
530
  createdAt: z.ZodISODateTime;
226
531
  updatedAt: z.ZodISODateTime;
227
532
  }, z.core.$strip>;
533
+ metrics: z.ZodOptional<z.ZodObject<{
534
+ partial: z.ZodBoolean;
535
+ usage: z.ZodOptional<z.ZodObject<{
536
+ inputTokens: z.ZodObject<{
537
+ value: z.ZodOptional<z.ZodNumber>;
538
+ provenance: z.ZodEnum<{
539
+ computed: "computed";
540
+ estimated: "estimated";
541
+ "provider-reported": "provider-reported";
542
+ unavailable: "unavailable";
543
+ }>;
544
+ }, z.core.$strip>;
545
+ outputTokens: z.ZodObject<{
546
+ value: z.ZodOptional<z.ZodNumber>;
547
+ provenance: z.ZodEnum<{
548
+ computed: "computed";
549
+ estimated: "estimated";
550
+ "provider-reported": "provider-reported";
551
+ unavailable: "unavailable";
552
+ }>;
553
+ }, z.core.$strip>;
554
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
555
+ value: z.ZodOptional<z.ZodNumber>;
556
+ provenance: z.ZodEnum<{
557
+ computed: "computed";
558
+ estimated: "estimated";
559
+ "provider-reported": "provider-reported";
560
+ unavailable: "unavailable";
561
+ }>;
562
+ }, z.core.$strip>>;
563
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
564
+ value: z.ZodOptional<z.ZodNumber>;
565
+ provenance: z.ZodEnum<{
566
+ computed: "computed";
567
+ estimated: "estimated";
568
+ "provider-reported": "provider-reported";
569
+ unavailable: "unavailable";
570
+ }>;
571
+ }, z.core.$strip>>;
572
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
573
+ value: z.ZodOptional<z.ZodNumber>;
574
+ provenance: z.ZodEnum<{
575
+ computed: "computed";
576
+ estimated: "estimated";
577
+ "provider-reported": "provider-reported";
578
+ unavailable: "unavailable";
579
+ }>;
580
+ }, z.core.$strip>>;
581
+ cost: z.ZodOptional<z.ZodObject<{
582
+ value: z.ZodOptional<z.ZodNumber>;
583
+ currency: z.ZodOptional<z.ZodString>;
584
+ provenance: z.ZodEnum<{
585
+ computed: "computed";
586
+ estimated: "estimated";
587
+ "provider-reported": "provider-reported";
588
+ unavailable: "unavailable";
589
+ }>;
590
+ }, z.core.$strip>>;
591
+ }, z.core.$strip>>;
592
+ durationMs: z.ZodOptional<z.ZodNumber>;
593
+ ttftMs: z.ZodOptional<z.ZodNumber>;
594
+ }, z.core.$strip>>;
228
595
  }, z.core.$strip>;
229
596
  export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
597
+ type: z.ZodLiteral<"admission">;
598
+ eventId: z.ZodString;
599
+ conversationId: z.ZodString;
600
+ runId: z.ZodString;
601
+ snapshotVersion: z.ZodInt;
602
+ input: z.ZodObject<{
603
+ schemaVersion: z.ZodLiteral<1>;
604
+ id: z.ZodString;
605
+ conversationId: z.ZodString;
606
+ runId: z.ZodOptional<z.ZodString>;
607
+ role: z.ZodEnum<{
608
+ assistant: "assistant";
609
+ summary: "summary";
610
+ system: "system";
611
+ user: "user";
612
+ }>;
613
+ status: z.ZodEnum<{
614
+ committed: "committed";
615
+ completed: "completed";
616
+ failed: "failed";
617
+ interrupted: "interrupted";
618
+ streaming: "streaming";
619
+ }>;
620
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
621
+ type: z.ZodLiteral<"text">;
622
+ text: z.ZodString;
623
+ }, z.core.$strip>, z.ZodObject<{
624
+ type: z.ZodLiteral<"reasoning">;
625
+ text: z.ZodString;
626
+ provider: z.ZodOptional<z.ZodObject<{
627
+ schemaVersion: z.ZodInt;
628
+ provider: z.ZodString;
629
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
630
+ }, z.core.$strip>>;
631
+ }, z.core.$strip>, z.ZodObject<{
632
+ type: z.ZodLiteral<"file">;
633
+ mediaType: z.ZodString;
634
+ reference: z.ZodString;
635
+ filename: z.ZodOptional<z.ZodString>;
636
+ }, z.core.$strip>, z.ZodObject<{
637
+ type: z.ZodLiteral<"source">;
638
+ sourceId: z.ZodString;
639
+ url: z.ZodOptional<z.ZodURL>;
640
+ title: z.ZodOptional<z.ZodString>;
641
+ }, z.core.$strip>, z.ZodObject<{
642
+ type: z.ZodLiteral<"tool-call">;
643
+ callId: z.ZodString;
644
+ toolName: z.ZodString;
645
+ input: z.ZodJSONSchema;
646
+ provider: z.ZodOptional<z.ZodObject<{
647
+ schemaVersion: z.ZodInt;
648
+ provider: z.ZodString;
649
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
650
+ }, z.core.$strip>>;
651
+ }, z.core.$strip>, z.ZodObject<{
652
+ type: z.ZodLiteral<"tool-result">;
653
+ callId: z.ZodString;
654
+ toolName: z.ZodString;
655
+ outcome: z.ZodEnum<{
656
+ error: "error";
657
+ interrupted: "interrupted";
658
+ success: "success";
659
+ }>;
660
+ output: z.ZodOptional<z.ZodJSONSchema>;
661
+ }, z.core.$strip>, z.ZodObject<{
662
+ type: z.ZodLiteral<"provider">;
663
+ envelope: z.ZodObject<{
664
+ schemaVersion: z.ZodInt;
665
+ provider: z.ZodString;
666
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
667
+ }, z.core.$strip>;
668
+ }, z.core.$strip>, z.ZodObject<{
669
+ type: z.ZodLiteral<"control">;
670
+ reason: z.ZodEnum<{
671
+ "run-interrupted": "run-interrupted";
672
+ "stale-run": "stale-run";
673
+ }>;
674
+ }, z.core.$strip>], "type">>;
675
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
676
+ createdAt: z.ZodISODateTime;
677
+ updatedAt: z.ZodISODateTime;
678
+ }, z.core.$strip>;
679
+ run: z.ZodObject<{
680
+ schemaVersion: z.ZodLiteral<1>;
681
+ id: z.ZodString;
682
+ conversationId: z.ZodString;
683
+ inputMessageIds: z.ZodArray<z.ZodString>;
684
+ assistantMessageId: z.ZodString;
685
+ state: z.ZodEnum<{
686
+ abandoned: "abandoned";
687
+ cancelled: "cancelled";
688
+ completed: "completed";
689
+ failed: "failed";
690
+ interrupt_requested: "interrupt_requested";
691
+ interrupted: "interrupted";
692
+ queued: "queued";
693
+ running: "running";
694
+ }>;
695
+ revision: z.ZodInt;
696
+ ownerId: z.ZodOptional<z.ZodString>;
697
+ terminalReason: z.ZodOptional<z.ZodEnum<{
698
+ abandoned: "abandoned";
699
+ cancelled: "cancelled";
700
+ interrupted: "interrupted";
701
+ policy_stop: "policy_stop";
702
+ provider_failure: "provider_failure";
703
+ shutdown: "shutdown";
704
+ success: "success";
705
+ timeout: "timeout";
706
+ tool_failure: "tool_failure";
707
+ }>>;
708
+ terminalPolicyName: z.ZodOptional<z.ZodString>;
709
+ createdAt: z.ZodISODateTime;
710
+ updatedAt: z.ZodISODateTime;
711
+ }, z.core.$strip>;
712
+ assistant: z.ZodUnion<readonly [z.ZodObject<{
713
+ schemaVersion: z.ZodLiteral<1>;
714
+ id: z.ZodString;
715
+ conversationId: z.ZodString;
716
+ runId: z.ZodString;
717
+ status: z.ZodLiteral<"pending">;
718
+ createdAt: z.ZodISODateTime;
719
+ updatedAt: z.ZodISODateTime;
720
+ }, z.core.$strip>, z.ZodObject<{
721
+ schemaVersion: z.ZodLiteral<1>;
722
+ id: z.ZodString;
723
+ conversationId: z.ZodString;
724
+ runId: z.ZodOptional<z.ZodString>;
725
+ role: z.ZodEnum<{
726
+ assistant: "assistant";
727
+ summary: "summary";
728
+ system: "system";
729
+ user: "user";
730
+ }>;
731
+ status: z.ZodEnum<{
732
+ committed: "committed";
733
+ completed: "completed";
734
+ failed: "failed";
735
+ interrupted: "interrupted";
736
+ streaming: "streaming";
737
+ }>;
738
+ parts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
739
+ type: z.ZodLiteral<"text">;
740
+ text: z.ZodString;
741
+ }, z.core.$strip>, z.ZodObject<{
742
+ type: z.ZodLiteral<"reasoning">;
743
+ text: z.ZodString;
744
+ provider: z.ZodOptional<z.ZodObject<{
745
+ schemaVersion: z.ZodInt;
746
+ provider: z.ZodString;
747
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
748
+ }, z.core.$strip>>;
749
+ }, z.core.$strip>, z.ZodObject<{
750
+ type: z.ZodLiteral<"file">;
751
+ mediaType: z.ZodString;
752
+ reference: z.ZodString;
753
+ filename: z.ZodOptional<z.ZodString>;
754
+ }, z.core.$strip>, z.ZodObject<{
755
+ type: z.ZodLiteral<"source">;
756
+ sourceId: z.ZodString;
757
+ url: z.ZodOptional<z.ZodURL>;
758
+ title: z.ZodOptional<z.ZodString>;
759
+ }, z.core.$strip>, z.ZodObject<{
760
+ type: z.ZodLiteral<"tool-call">;
761
+ callId: z.ZodString;
762
+ toolName: z.ZodString;
763
+ input: z.ZodJSONSchema;
764
+ provider: z.ZodOptional<z.ZodObject<{
765
+ schemaVersion: z.ZodInt;
766
+ provider: z.ZodString;
767
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
768
+ }, z.core.$strip>>;
769
+ }, z.core.$strip>, z.ZodObject<{
770
+ type: z.ZodLiteral<"tool-result">;
771
+ callId: z.ZodString;
772
+ toolName: z.ZodString;
773
+ outcome: z.ZodEnum<{
774
+ error: "error";
775
+ interrupted: "interrupted";
776
+ success: "success";
777
+ }>;
778
+ output: z.ZodOptional<z.ZodJSONSchema>;
779
+ }, z.core.$strip>, z.ZodObject<{
780
+ type: z.ZodLiteral<"provider">;
781
+ envelope: z.ZodObject<{
782
+ schemaVersion: z.ZodInt;
783
+ provider: z.ZodString;
784
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
785
+ }, z.core.$strip>;
786
+ }, z.core.$strip>, z.ZodObject<{
787
+ type: z.ZodLiteral<"control">;
788
+ reason: z.ZodEnum<{
789
+ "run-interrupted": "run-interrupted";
790
+ "stale-run": "stale-run";
791
+ }>;
792
+ }, z.core.$strip>], "type">>;
793
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
794
+ createdAt: z.ZodISODateTime;
795
+ updatedAt: z.ZodISODateTime;
796
+ }, z.core.$strip>]>;
797
+ emittedAt: z.ZodISODateTime;
798
+ }, z.core.$strip>, z.ZodObject<{
230
799
  conversationId: z.ZodString;
231
800
  runId: z.ZodString;
232
801
  emittedAt: z.ZodISODateTime;
@@ -234,6 +803,43 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
234
803
  runtimeEpoch: z.ZodString;
235
804
  sequence: z.ZodInt;
236
805
  textDelta: z.ZodString;
806
+ }, z.core.$strip>, z.ZodObject<{
807
+ conversationId: z.ZodString;
808
+ runId: z.ZodString;
809
+ emittedAt: z.ZodISODateTime;
810
+ runtimeEpoch: z.ZodString;
811
+ sequence: z.ZodInt;
812
+ provider: z.ZodOptional<z.ZodObject<{
813
+ schemaVersion: z.ZodInt;
814
+ provider: z.ZodString;
815
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
816
+ }, z.core.$strip>>;
817
+ type: z.ZodLiteral<"reasoning-start">;
818
+ }, z.core.$strip>, z.ZodObject<{
819
+ conversationId: z.ZodString;
820
+ runId: z.ZodString;
821
+ emittedAt: z.ZodISODateTime;
822
+ runtimeEpoch: z.ZodString;
823
+ sequence: z.ZodInt;
824
+ provider: z.ZodOptional<z.ZodObject<{
825
+ schemaVersion: z.ZodInt;
826
+ provider: z.ZodString;
827
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
828
+ }, z.core.$strip>>;
829
+ type: z.ZodLiteral<"reasoning-delta">;
830
+ textDelta: z.ZodString;
831
+ }, z.core.$strip>, z.ZodObject<{
832
+ conversationId: z.ZodString;
833
+ runId: z.ZodString;
834
+ emittedAt: z.ZodISODateTime;
835
+ runtimeEpoch: z.ZodString;
836
+ sequence: z.ZodInt;
837
+ provider: z.ZodOptional<z.ZodObject<{
838
+ schemaVersion: z.ZodInt;
839
+ provider: z.ZodString;
840
+ data: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
841
+ }, z.core.$strip>>;
842
+ type: z.ZodLiteral<"reasoning-end">;
237
843
  }, z.core.$strip>, z.ZodObject<{
238
844
  conversationId: z.ZodString;
239
845
  runId: z.ZodString;
@@ -318,6 +924,68 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
318
924
  createdAt: z.ZodISODateTime;
319
925
  updatedAt: z.ZodISODateTime;
320
926
  }, z.core.$strip>;
927
+ metrics: z.ZodOptional<z.ZodObject<{
928
+ partial: z.ZodBoolean;
929
+ usage: z.ZodOptional<z.ZodObject<{
930
+ inputTokens: z.ZodObject<{
931
+ value: z.ZodOptional<z.ZodNumber>;
932
+ provenance: z.ZodEnum<{
933
+ computed: "computed";
934
+ estimated: "estimated";
935
+ "provider-reported": "provider-reported";
936
+ unavailable: "unavailable";
937
+ }>;
938
+ }, z.core.$strip>;
939
+ outputTokens: z.ZodObject<{
940
+ value: z.ZodOptional<z.ZodNumber>;
941
+ provenance: z.ZodEnum<{
942
+ computed: "computed";
943
+ estimated: "estimated";
944
+ "provider-reported": "provider-reported";
945
+ unavailable: "unavailable";
946
+ }>;
947
+ }, z.core.$strip>;
948
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
949
+ value: z.ZodOptional<z.ZodNumber>;
950
+ provenance: z.ZodEnum<{
951
+ computed: "computed";
952
+ estimated: "estimated";
953
+ "provider-reported": "provider-reported";
954
+ unavailable: "unavailable";
955
+ }>;
956
+ }, z.core.$strip>>;
957
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
958
+ value: z.ZodOptional<z.ZodNumber>;
959
+ provenance: z.ZodEnum<{
960
+ computed: "computed";
961
+ estimated: "estimated";
962
+ "provider-reported": "provider-reported";
963
+ unavailable: "unavailable";
964
+ }>;
965
+ }, z.core.$strip>>;
966
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
967
+ value: z.ZodOptional<z.ZodNumber>;
968
+ provenance: z.ZodEnum<{
969
+ computed: "computed";
970
+ estimated: "estimated";
971
+ "provider-reported": "provider-reported";
972
+ unavailable: "unavailable";
973
+ }>;
974
+ }, z.core.$strip>>;
975
+ cost: z.ZodOptional<z.ZodObject<{
976
+ value: z.ZodOptional<z.ZodNumber>;
977
+ currency: z.ZodOptional<z.ZodString>;
978
+ provenance: z.ZodEnum<{
979
+ computed: "computed";
980
+ estimated: "estimated";
981
+ "provider-reported": "provider-reported";
982
+ unavailable: "unavailable";
983
+ }>;
984
+ }, z.core.$strip>>;
985
+ }, z.core.$strip>>;
986
+ durationMs: z.ZodOptional<z.ZodNumber>;
987
+ ttftMs: z.ZodOptional<z.ZodNumber>;
988
+ }, z.core.$strip>>;
321
989
  }, z.core.$strip>, z.ZodObject<{
322
990
  conversationId: z.ZodString;
323
991
  runId: z.ZodString;
@@ -448,6 +1116,68 @@ export declare const AgentRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
448
1116
  createdAt: z.ZodISODateTime;
449
1117
  updatedAt: z.ZodISODateTime;
450
1118
  }, z.core.$strip>;
1119
+ metrics: z.ZodOptional<z.ZodObject<{
1120
+ partial: z.ZodBoolean;
1121
+ usage: z.ZodOptional<z.ZodObject<{
1122
+ inputTokens: z.ZodObject<{
1123
+ value: z.ZodOptional<z.ZodNumber>;
1124
+ provenance: z.ZodEnum<{
1125
+ computed: "computed";
1126
+ estimated: "estimated";
1127
+ "provider-reported": "provider-reported";
1128
+ unavailable: "unavailable";
1129
+ }>;
1130
+ }, z.core.$strip>;
1131
+ outputTokens: z.ZodObject<{
1132
+ value: z.ZodOptional<z.ZodNumber>;
1133
+ provenance: z.ZodEnum<{
1134
+ computed: "computed";
1135
+ estimated: "estimated";
1136
+ "provider-reported": "provider-reported";
1137
+ unavailable: "unavailable";
1138
+ }>;
1139
+ }, z.core.$strip>;
1140
+ reasoningTokens: z.ZodOptional<z.ZodObject<{
1141
+ value: z.ZodOptional<z.ZodNumber>;
1142
+ provenance: z.ZodEnum<{
1143
+ computed: "computed";
1144
+ estimated: "estimated";
1145
+ "provider-reported": "provider-reported";
1146
+ unavailable: "unavailable";
1147
+ }>;
1148
+ }, z.core.$strip>>;
1149
+ cacheReadTokens: z.ZodOptional<z.ZodObject<{
1150
+ value: z.ZodOptional<z.ZodNumber>;
1151
+ provenance: z.ZodEnum<{
1152
+ computed: "computed";
1153
+ estimated: "estimated";
1154
+ "provider-reported": "provider-reported";
1155
+ unavailable: "unavailable";
1156
+ }>;
1157
+ }, z.core.$strip>>;
1158
+ cacheWriteTokens: z.ZodOptional<z.ZodObject<{
1159
+ value: z.ZodOptional<z.ZodNumber>;
1160
+ provenance: z.ZodEnum<{
1161
+ computed: "computed";
1162
+ estimated: "estimated";
1163
+ "provider-reported": "provider-reported";
1164
+ unavailable: "unavailable";
1165
+ }>;
1166
+ }, z.core.$strip>>;
1167
+ cost: z.ZodOptional<z.ZodObject<{
1168
+ value: z.ZodOptional<z.ZodNumber>;
1169
+ currency: z.ZodOptional<z.ZodString>;
1170
+ provenance: z.ZodEnum<{
1171
+ computed: "computed";
1172
+ estimated: "estimated";
1173
+ "provider-reported": "provider-reported";
1174
+ unavailable: "unavailable";
1175
+ }>;
1176
+ }, z.core.$strip>>;
1177
+ }, z.core.$strip>>;
1178
+ durationMs: z.ZodOptional<z.ZodNumber>;
1179
+ ttftMs: z.ZodOptional<z.ZodNumber>;
1180
+ }, z.core.$strip>>;
451
1181
  }, z.core.$strip>], "type">;
452
1182
  export type AgentRuntimeEvent = z.infer<typeof AgentRuntimeEventSchema>;
453
1183
  export type AgentRuntimePublisher = (event: AgentRuntimeEvent) => void | Promise<void>;