@get-bb/plugin-sdk 0.4.10 → 0.4.12

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.
@@ -0,0 +1,3314 @@
1
+ // Portable type declarations for `@get-bb/plugin-sdk`. Unpublished BB
2
+ // workspace contracts are flattened; public subpaths may reuse the
3
+ // package root without requiring any other @bb/* package.
4
+ //
5
+ // Confused by the API, or need a symbol that isn't here? Clone the BB repo
6
+ // and read the real source: https://github.com/get-bb/bb
7
+
8
+ import { z } from 'zod';
9
+
10
+ interface JsonObject {
11
+ [key: string]: JsonValue;
12
+ }
13
+ type JsonValue = string | number | boolean | null | JsonValue[] | JsonObject;
14
+
15
+ /** All thread events — provider-originated or system-originated. */
16
+ declare const threadEventSchema: z.ZodPipe<z.ZodUnknown, z.ZodUnion<readonly [z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ threadId: z.ZodString;
18
+ type: z.ZodLiteral<"thread/started">;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ providerThreadId: z.ZodString;
21
+ threadId: z.ZodString;
22
+ type: z.ZodLiteral<"thread/identity">;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ parentToolCallId: z.ZodOptional<z.ZodString>;
25
+ providerThreadId: z.ZodString;
26
+ threadId: z.ZodString;
27
+ type: z.ZodLiteral<"turn/started">;
28
+ }, z.core.$strip>, z.ZodObject<{
29
+ error: z.ZodOptional<z.ZodObject<{
30
+ message: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ providerCheckpointId: z.ZodOptional<z.ZodString>;
33
+ providerThreadId: z.ZodNullable<z.ZodString>;
34
+ status: z.ZodEnum<{
35
+ completed: "completed";
36
+ failed: "failed";
37
+ interrupted: "interrupted";
38
+ }>;
39
+ threadId: z.ZodString;
40
+ type: z.ZodLiteral<"turn/completed">;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ clientRequestId: z.ZodString;
43
+ providerThreadId: z.ZodString;
44
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
45
+ kind: z.ZodLiteral<"thread">;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ kind: z.ZodLiteral<"turn">;
48
+ turnId: z.ZodString;
49
+ }, z.core.$strip>], "kind">;
50
+ threadId: z.ZodString;
51
+ type: z.ZodLiteral<"turn/input/accepted">;
52
+ }, z.core.$strict>, z.ZodObject<{
53
+ providerThreadId: z.ZodString;
54
+ threadId: z.ZodString;
55
+ threadName: z.ZodString;
56
+ type: z.ZodLiteral<"thread/name/updated">;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ providerThreadId: z.ZodString;
59
+ threadId: z.ZodString;
60
+ type: z.ZodLiteral<"thread/compacted">;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ providerThreadId: z.ZodString;
63
+ threadId: z.ZodString;
64
+ type: z.ZodLiteral<"thread/context/cleared">;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ objective: z.ZodString;
67
+ providerThreadId: z.ZodString;
68
+ status: z.ZodEnum<{
69
+ active: "active";
70
+ budgetLimited: "budgetLimited";
71
+ complete: "complete";
72
+ paused: "paused";
73
+ }>;
74
+ threadId: z.ZodString;
75
+ timeUsedSeconds: z.ZodNumber;
76
+ tokenBudget: z.ZodNullable<z.ZodNumber>;
77
+ tokensUsed: z.ZodNumber;
78
+ type: z.ZodLiteral<"thread/goal/updated">;
79
+ }, z.core.$strip>, z.ZodObject<{
80
+ providerThreadId: z.ZodString;
81
+ threadId: z.ZodString;
82
+ type: z.ZodLiteral<"thread/goal/cleared">;
83
+ }, z.core.$strip>, z.ZodObject<{
84
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
85
+ clientRequestId: z.ZodOptional<z.ZodString>;
86
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
87
+ text: z.ZodString;
88
+ type: z.ZodLiteral<"text">;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ type: z.ZodLiteral<"image">;
91
+ url: z.ZodString;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ path: z.ZodString;
94
+ type: z.ZodLiteral<"localImage">;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ path: z.ZodString;
97
+ type: z.ZodLiteral<"localFile">;
98
+ }, z.core.$strip>], "type">>;
99
+ id: z.ZodString;
100
+ parentToolCallId: z.ZodOptional<z.ZodString>;
101
+ type: z.ZodLiteral<"userMessage">;
102
+ }, z.core.$strict>, z.ZodObject<{
103
+ id: z.ZodString;
104
+ parentToolCallId: z.ZodOptional<z.ZodString>;
105
+ presentation: z.ZodOptional<z.ZodObject<{
106
+ detail: z.ZodOptional<z.ZodString>;
107
+ icon: z.ZodObject<{
108
+ glyph: z.ZodString;
109
+ }, z.core.$strip>;
110
+ label: z.ZodObject<{
111
+ completed: z.ZodString;
112
+ pending: z.ZodString;
113
+ }, z.core.$strip>;
114
+ suppress: z.ZodOptional<z.ZodBoolean>;
115
+ tint: z.ZodOptional<z.ZodObject<{
116
+ dark: z.ZodString;
117
+ light: z.ZodString;
118
+ }, z.core.$strip>>;
119
+ title: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$strip>>;
121
+ text: z.ZodString;
122
+ type: z.ZodLiteral<"agentMessage">;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ aggregatedOutput: z.ZodOptional<z.ZodString>;
125
+ approvalStatus: z.ZodNullable<z.ZodEnum<{
126
+ denied: "denied";
127
+ waiting_for_approval: "waiting_for_approval";
128
+ }>>;
129
+ command: z.ZodString;
130
+ cwd: z.ZodString;
131
+ durationMs: z.ZodOptional<z.ZodNumber>;
132
+ exitCode: z.ZodOptional<z.ZodNumber>;
133
+ id: z.ZodString;
134
+ parentToolCallId: z.ZodOptional<z.ZodString>;
135
+ presentation: z.ZodOptional<z.ZodObject<{
136
+ detail: z.ZodOptional<z.ZodString>;
137
+ icon: z.ZodObject<{
138
+ glyph: z.ZodString;
139
+ }, z.core.$strip>;
140
+ label: z.ZodObject<{
141
+ completed: z.ZodString;
142
+ pending: z.ZodString;
143
+ }, z.core.$strip>;
144
+ suppress: z.ZodOptional<z.ZodBoolean>;
145
+ tint: z.ZodOptional<z.ZodObject<{
146
+ dark: z.ZodString;
147
+ light: z.ZodString;
148
+ }, z.core.$strip>>;
149
+ title: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strip>>;
151
+ status: z.ZodEnum<{
152
+ completed: "completed";
153
+ failed: "failed";
154
+ interrupted: "interrupted";
155
+ pending: "pending";
156
+ }>;
157
+ truncation: z.ZodOptional<z.ZodObject<{
158
+ aggregatedOutput: z.ZodOptional<z.ZodObject<{
159
+ originalLength: z.ZodNumber;
160
+ retainedHeadLength: z.ZodNumber;
161
+ retainedTailLength: z.ZodNumber;
162
+ truncatedAt: z.ZodNumber;
163
+ }, z.core.$strip>>;
164
+ result: z.ZodOptional<z.ZodObject<{
165
+ originalLength: z.ZodNumber;
166
+ retainedHeadLength: z.ZodNumber;
167
+ retainedTailLength: z.ZodNumber;
168
+ truncatedAt: z.ZodNumber;
169
+ }, z.core.$strip>>;
170
+ resultText: z.ZodOptional<z.ZodObject<{
171
+ originalLength: z.ZodNumber;
172
+ retainedHeadLength: z.ZodNumber;
173
+ retainedTailLength: z.ZodNumber;
174
+ truncatedAt: z.ZodNumber;
175
+ }, z.core.$strip>>;
176
+ }, z.core.$strip>>;
177
+ type: z.ZodLiteral<"commandExecution">;
178
+ }, z.core.$strip>, z.ZodObject<{
179
+ approvalStatus: z.ZodNullable<z.ZodEnum<{
180
+ denied: "denied";
181
+ waiting_for_approval: "waiting_for_approval";
182
+ }>>;
183
+ changes: z.ZodArray<z.ZodObject<{
184
+ diff: z.ZodOptional<z.ZodString>;
185
+ kind: z.ZodEnum<{
186
+ add: "add";
187
+ delete: "delete";
188
+ update: "update";
189
+ }>;
190
+ movePath: z.ZodOptional<z.ZodString>;
191
+ path: z.ZodString;
192
+ }, z.core.$strip>>;
193
+ id: z.ZodString;
194
+ parentToolCallId: z.ZodOptional<z.ZodString>;
195
+ presentation: z.ZodOptional<z.ZodObject<{
196
+ detail: z.ZodOptional<z.ZodString>;
197
+ icon: z.ZodObject<{
198
+ glyph: z.ZodString;
199
+ }, z.core.$strip>;
200
+ label: z.ZodObject<{
201
+ completed: z.ZodString;
202
+ pending: z.ZodString;
203
+ }, z.core.$strip>;
204
+ suppress: z.ZodOptional<z.ZodBoolean>;
205
+ tint: z.ZodOptional<z.ZodObject<{
206
+ dark: z.ZodString;
207
+ light: z.ZodString;
208
+ }, z.core.$strip>>;
209
+ title: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strip>>;
211
+ status: z.ZodEnum<{
212
+ completed: "completed";
213
+ failed: "failed";
214
+ interrupted: "interrupted";
215
+ pending: "pending";
216
+ }>;
217
+ type: z.ZodLiteral<"fileChange">;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ id: z.ZodString;
220
+ parentToolCallId: z.ZodOptional<z.ZodString>;
221
+ presentation: z.ZodOptional<z.ZodObject<{
222
+ detail: z.ZodOptional<z.ZodString>;
223
+ icon: z.ZodObject<{
224
+ glyph: z.ZodString;
225
+ }, z.core.$strip>;
226
+ label: z.ZodObject<{
227
+ completed: z.ZodString;
228
+ pending: z.ZodString;
229
+ }, z.core.$strip>;
230
+ suppress: z.ZodOptional<z.ZodBoolean>;
231
+ tint: z.ZodOptional<z.ZodObject<{
232
+ dark: z.ZodString;
233
+ light: z.ZodString;
234
+ }, z.core.$strip>>;
235
+ title: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strip>>;
237
+ queries: z.ZodArray<z.ZodString>;
238
+ resultText: z.ZodNullable<z.ZodString>;
239
+ type: z.ZodLiteral<"webSearch">;
240
+ }, z.core.$strip>, z.ZodObject<{
241
+ id: z.ZodString;
242
+ parentToolCallId: z.ZodOptional<z.ZodString>;
243
+ pattern: z.ZodNullable<z.ZodString>;
244
+ presentation: z.ZodOptional<z.ZodObject<{
245
+ detail: z.ZodOptional<z.ZodString>;
246
+ icon: z.ZodObject<{
247
+ glyph: z.ZodString;
248
+ }, z.core.$strip>;
249
+ label: z.ZodObject<{
250
+ completed: z.ZodString;
251
+ pending: z.ZodString;
252
+ }, z.core.$strip>;
253
+ suppress: z.ZodOptional<z.ZodBoolean>;
254
+ tint: z.ZodOptional<z.ZodObject<{
255
+ dark: z.ZodString;
256
+ light: z.ZodString;
257
+ }, z.core.$strip>>;
258
+ title: z.ZodOptional<z.ZodString>;
259
+ }, z.core.$strip>>;
260
+ prompt: z.ZodNullable<z.ZodString>;
261
+ resultText: z.ZodNullable<z.ZodString>;
262
+ type: z.ZodLiteral<"webFetch">;
263
+ url: z.ZodString;
264
+ }, z.core.$strip>, z.ZodObject<{
265
+ id: z.ZodString;
266
+ parentToolCallId: z.ZodOptional<z.ZodString>;
267
+ path: z.ZodString;
268
+ presentation: z.ZodOptional<z.ZodObject<{
269
+ detail: z.ZodOptional<z.ZodString>;
270
+ icon: z.ZodObject<{
271
+ glyph: z.ZodString;
272
+ }, z.core.$strip>;
273
+ label: z.ZodObject<{
274
+ completed: z.ZodString;
275
+ pending: z.ZodString;
276
+ }, z.core.$strip>;
277
+ suppress: z.ZodOptional<z.ZodBoolean>;
278
+ tint: z.ZodOptional<z.ZodObject<{
279
+ dark: z.ZodString;
280
+ light: z.ZodString;
281
+ }, z.core.$strip>>;
282
+ title: z.ZodOptional<z.ZodString>;
283
+ }, z.core.$strip>>;
284
+ type: z.ZodLiteral<"imageView">;
285
+ }, z.core.$strip>, z.ZodObject<{
286
+ cmd: z.ZodOptional<z.ZodString>;
287
+ id: z.ZodString;
288
+ parentToolCallId: z.ZodOptional<z.ZodString>;
289
+ path: z.ZodString;
290
+ presentation: z.ZodOptional<z.ZodObject<{
291
+ detail: z.ZodOptional<z.ZodString>;
292
+ icon: z.ZodObject<{
293
+ glyph: z.ZodString;
294
+ }, z.core.$strip>;
295
+ label: z.ZodObject<{
296
+ completed: z.ZodString;
297
+ pending: z.ZodString;
298
+ }, z.core.$strip>;
299
+ suppress: z.ZodOptional<z.ZodBoolean>;
300
+ tint: z.ZodOptional<z.ZodObject<{
301
+ dark: z.ZodString;
302
+ light: z.ZodString;
303
+ }, z.core.$strip>>;
304
+ title: z.ZodOptional<z.ZodString>;
305
+ }, z.core.$strip>>;
306
+ status: z.ZodEnum<{
307
+ completed: "completed";
308
+ failed: "failed";
309
+ interrupted: "interrupted";
310
+ pending: "pending";
311
+ }>;
312
+ type: z.ZodLiteral<"fileRead">;
313
+ }, z.core.$strip>, z.ZodObject<{
314
+ cmd: z.ZodOptional<z.ZodString>;
315
+ id: z.ZodString;
316
+ mode: z.ZodEnum<{
317
+ content: "content";
318
+ list: "list";
319
+ path: "path";
320
+ }>;
321
+ parentToolCallId: z.ZodOptional<z.ZodString>;
322
+ path: z.ZodOptional<z.ZodString>;
323
+ presentation: z.ZodOptional<z.ZodObject<{
324
+ detail: z.ZodOptional<z.ZodString>;
325
+ icon: z.ZodObject<{
326
+ glyph: z.ZodString;
327
+ }, z.core.$strip>;
328
+ label: z.ZodObject<{
329
+ completed: z.ZodString;
330
+ pending: z.ZodString;
331
+ }, z.core.$strip>;
332
+ suppress: z.ZodOptional<z.ZodBoolean>;
333
+ tint: z.ZodOptional<z.ZodObject<{
334
+ dark: z.ZodString;
335
+ light: z.ZodString;
336
+ }, z.core.$strip>>;
337
+ title: z.ZodOptional<z.ZodString>;
338
+ }, z.core.$strip>>;
339
+ query: z.ZodString;
340
+ status: z.ZodEnum<{
341
+ completed: "completed";
342
+ failed: "failed";
343
+ interrupted: "interrupted";
344
+ pending: "pending";
345
+ }>;
346
+ type: z.ZodLiteral<"search">;
347
+ }, z.core.$strip>, z.ZodObject<{
348
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
349
+ durationMs: z.ZodOptional<z.ZodNumber>;
350
+ error: z.ZodOptional<z.ZodString>;
351
+ id: z.ZodString;
352
+ parentToolCallId: z.ZodOptional<z.ZodString>;
353
+ presentation: z.ZodOptional<z.ZodObject<{
354
+ detail: z.ZodOptional<z.ZodString>;
355
+ icon: z.ZodObject<{
356
+ glyph: z.ZodString;
357
+ }, z.core.$strip>;
358
+ label: z.ZodObject<{
359
+ completed: z.ZodString;
360
+ pending: z.ZodString;
361
+ }, z.core.$strip>;
362
+ suppress: z.ZodOptional<z.ZodBoolean>;
363
+ tint: z.ZodOptional<z.ZodObject<{
364
+ dark: z.ZodString;
365
+ light: z.ZodString;
366
+ }, z.core.$strip>>;
367
+ title: z.ZodOptional<z.ZodString>;
368
+ }, z.core.$strip>>;
369
+ result: z.ZodOptional<z.ZodUnknown>;
370
+ server: z.ZodOptional<z.ZodString>;
371
+ status: z.ZodEnum<{
372
+ completed: "completed";
373
+ failed: "failed";
374
+ interrupted: "interrupted";
375
+ pending: "pending";
376
+ }>;
377
+ statusLabels: z.ZodOptional<z.ZodObject<{
378
+ completed: z.ZodString;
379
+ pending: z.ZodString;
380
+ }, z.core.$strip>>;
381
+ tool: z.ZodString;
382
+ truncation: z.ZodOptional<z.ZodObject<{
383
+ aggregatedOutput: z.ZodOptional<z.ZodObject<{
384
+ originalLength: z.ZodNumber;
385
+ retainedHeadLength: z.ZodNumber;
386
+ retainedTailLength: z.ZodNumber;
387
+ truncatedAt: z.ZodNumber;
388
+ }, z.core.$strip>>;
389
+ result: z.ZodOptional<z.ZodObject<{
390
+ originalLength: z.ZodNumber;
391
+ retainedHeadLength: z.ZodNumber;
392
+ retainedTailLength: z.ZodNumber;
393
+ truncatedAt: z.ZodNumber;
394
+ }, z.core.$strip>>;
395
+ resultText: z.ZodOptional<z.ZodObject<{
396
+ originalLength: z.ZodNumber;
397
+ retainedHeadLength: z.ZodNumber;
398
+ retainedTailLength: z.ZodNumber;
399
+ truncatedAt: z.ZodNumber;
400
+ }, z.core.$strip>>;
401
+ }, z.core.$strip>>;
402
+ type: z.ZodLiteral<"toolCall">;
403
+ }, z.core.$strip>, z.ZodObject<{
404
+ content: z.ZodArray<z.ZodString>;
405
+ id: z.ZodString;
406
+ parentToolCallId: z.ZodOptional<z.ZodString>;
407
+ presentation: z.ZodOptional<z.ZodObject<{
408
+ detail: z.ZodOptional<z.ZodString>;
409
+ icon: z.ZodObject<{
410
+ glyph: z.ZodString;
411
+ }, z.core.$strip>;
412
+ label: z.ZodObject<{
413
+ completed: z.ZodString;
414
+ pending: z.ZodString;
415
+ }, z.core.$strip>;
416
+ suppress: z.ZodOptional<z.ZodBoolean>;
417
+ tint: z.ZodOptional<z.ZodObject<{
418
+ dark: z.ZodString;
419
+ light: z.ZodString;
420
+ }, z.core.$strip>>;
421
+ title: z.ZodOptional<z.ZodString>;
422
+ }, z.core.$strip>>;
423
+ summary: z.ZodArray<z.ZodString>;
424
+ type: z.ZodLiteral<"reasoning">;
425
+ }, z.core.$strip>, z.ZodObject<{
426
+ id: z.ZodString;
427
+ parentToolCallId: z.ZodOptional<z.ZodString>;
428
+ presentation: z.ZodOptional<z.ZodObject<{
429
+ detail: z.ZodOptional<z.ZodString>;
430
+ icon: z.ZodObject<{
431
+ glyph: z.ZodString;
432
+ }, z.core.$strip>;
433
+ label: z.ZodObject<{
434
+ completed: z.ZodString;
435
+ pending: z.ZodString;
436
+ }, z.core.$strip>;
437
+ suppress: z.ZodOptional<z.ZodBoolean>;
438
+ tint: z.ZodOptional<z.ZodObject<{
439
+ dark: z.ZodString;
440
+ light: z.ZodString;
441
+ }, z.core.$strip>>;
442
+ title: z.ZodOptional<z.ZodString>;
443
+ }, z.core.$strip>>;
444
+ text: z.ZodString;
445
+ type: z.ZodLiteral<"plan">;
446
+ }, z.core.$strip>, z.ZodObject<{
447
+ explanation: z.ZodOptional<z.ZodString>;
448
+ id: z.ZodString;
449
+ parentToolCallId: z.ZodOptional<z.ZodString>;
450
+ presentation: z.ZodOptional<z.ZodObject<{
451
+ detail: z.ZodOptional<z.ZodString>;
452
+ icon: z.ZodObject<{
453
+ glyph: z.ZodString;
454
+ }, z.core.$strip>;
455
+ label: z.ZodObject<{
456
+ completed: z.ZodString;
457
+ pending: z.ZodString;
458
+ }, z.core.$strip>;
459
+ suppress: z.ZodOptional<z.ZodBoolean>;
460
+ tint: z.ZodOptional<z.ZodObject<{
461
+ dark: z.ZodString;
462
+ light: z.ZodString;
463
+ }, z.core.$strip>>;
464
+ title: z.ZodOptional<z.ZodString>;
465
+ }, z.core.$strip>>;
466
+ status: z.ZodEnum<{
467
+ completed: "completed";
468
+ failed: "failed";
469
+ interrupted: "interrupted";
470
+ pending: "pending";
471
+ }>;
472
+ steps: z.ZodArray<z.ZodObject<{
473
+ status: z.ZodOptional<z.ZodEnum<{
474
+ active: "active";
475
+ completed: "completed";
476
+ failed: "failed";
477
+ pending: "pending";
478
+ }>>;
479
+ step: z.ZodString;
480
+ }, z.core.$strip>>;
481
+ type: z.ZodLiteral<"planSteps">;
482
+ }, z.core.$strip>, z.ZodObject<{
483
+ id: z.ZodString;
484
+ parentToolCallId: z.ZodOptional<z.ZodString>;
485
+ presentation: z.ZodOptional<z.ZodObject<{
486
+ detail: z.ZodOptional<z.ZodString>;
487
+ icon: z.ZodObject<{
488
+ glyph: z.ZodString;
489
+ }, z.core.$strip>;
490
+ label: z.ZodObject<{
491
+ completed: z.ZodString;
492
+ pending: z.ZodString;
493
+ }, z.core.$strip>;
494
+ suppress: z.ZodOptional<z.ZodBoolean>;
495
+ tint: z.ZodOptional<z.ZodObject<{
496
+ dark: z.ZodString;
497
+ light: z.ZodString;
498
+ }, z.core.$strip>>;
499
+ title: z.ZodOptional<z.ZodString>;
500
+ }, z.core.$strip>>;
501
+ type: z.ZodLiteral<"contextCompaction">;
502
+ }, z.core.$strip>, z.ZodObject<{
503
+ description: z.ZodString;
504
+ error: z.ZodOptional<z.ZodString>;
505
+ familyId: z.ZodOptional<z.ZodString>;
506
+ id: z.ZodString;
507
+ outputFile: z.ZodOptional<z.ZodString>;
508
+ parentToolCallId: z.ZodOptional<z.ZodString>;
509
+ presentation: z.ZodOptional<z.ZodObject<{
510
+ detail: z.ZodOptional<z.ZodString>;
511
+ icon: z.ZodObject<{
512
+ glyph: z.ZodString;
513
+ }, z.core.$strip>;
514
+ label: z.ZodObject<{
515
+ completed: z.ZodString;
516
+ pending: z.ZodString;
517
+ }, z.core.$strip>;
518
+ suppress: z.ZodOptional<z.ZodBoolean>;
519
+ tint: z.ZodOptional<z.ZodObject<{
520
+ dark: z.ZodString;
521
+ light: z.ZodString;
522
+ }, z.core.$strip>>;
523
+ title: z.ZodOptional<z.ZodString>;
524
+ }, z.core.$strip>>;
525
+ skipTranscript: z.ZodBoolean;
526
+ status: z.ZodEnum<{
527
+ completed: "completed";
528
+ failed: "failed";
529
+ interrupted: "interrupted";
530
+ pending: "pending";
531
+ }>;
532
+ summary: z.ZodOptional<z.ZodString>;
533
+ taskStatus: z.ZodEnum<{
534
+ completed: "completed";
535
+ failed: "failed";
536
+ killed: "killed";
537
+ paused: "paused";
538
+ pending: "pending";
539
+ running: "running";
540
+ stopped: "stopped";
541
+ }>;
542
+ taskType: z.ZodString;
543
+ type: z.ZodLiteral<"backgroundTask">;
544
+ usage: z.ZodOptional<z.ZodObject<{
545
+ durationMs: z.ZodNumber;
546
+ toolUses: z.ZodNumber;
547
+ totalTokens: z.ZodNumber;
548
+ }, z.core.$strip>>;
549
+ workflow: z.ZodOptional<z.ZodObject<{
550
+ agents: z.ZodArray<z.ZodObject<{
551
+ agentType: z.ZodOptional<z.ZodString>;
552
+ attempt: z.ZodNumber;
553
+ cached: z.ZodBoolean;
554
+ durationMs: z.ZodOptional<z.ZodNumber>;
555
+ error: z.ZodOptional<z.ZodString>;
556
+ index: z.ZodNumber;
557
+ isolation: z.ZodOptional<z.ZodString>;
558
+ label: z.ZodString;
559
+ lastProgressAt: z.ZodNumber;
560
+ lastToolName: z.ZodOptional<z.ZodString>;
561
+ lastToolSummary: z.ZodOptional<z.ZodString>;
562
+ model: z.ZodString;
563
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
564
+ phaseTitle: z.ZodOptional<z.ZodString>;
565
+ promptPreview: z.ZodOptional<z.ZodString>;
566
+ queuedAt: z.ZodOptional<z.ZodNumber>;
567
+ resultPreview: z.ZodOptional<z.ZodString>;
568
+ startedAt: z.ZodOptional<z.ZodNumber>;
569
+ state: z.ZodEnum<{
570
+ done: "done";
571
+ failed: "failed";
572
+ queued: "queued";
573
+ running: "running";
574
+ skipped: "skipped";
575
+ }>;
576
+ tokens: z.ZodOptional<z.ZodNumber>;
577
+ toolCalls: z.ZodOptional<z.ZodNumber>;
578
+ }, z.core.$strip>>;
579
+ phases: z.ZodArray<z.ZodObject<{
580
+ index: z.ZodNumber;
581
+ kind: z.ZodOptional<z.ZodString>;
582
+ title: z.ZodString;
583
+ }, z.core.$strip>>;
584
+ }, z.core.$strip>>;
585
+ workflowName: z.ZodOptional<z.ZodString>;
586
+ }, z.core.$strip>, z.ZodObject<{
587
+ background: z.ZodBoolean;
588
+ childRef: z.ZodString;
589
+ id: z.ZodString;
590
+ label: z.ZodString;
591
+ parentToolCallId: z.ZodOptional<z.ZodString>;
592
+ presentation: z.ZodOptional<z.ZodObject<{
593
+ detail: z.ZodOptional<z.ZodString>;
594
+ icon: z.ZodObject<{
595
+ glyph: z.ZodString;
596
+ }, z.core.$strip>;
597
+ label: z.ZodObject<{
598
+ completed: z.ZodString;
599
+ pending: z.ZodString;
600
+ }, z.core.$strip>;
601
+ suppress: z.ZodOptional<z.ZodBoolean>;
602
+ tint: z.ZodOptional<z.ZodObject<{
603
+ dark: z.ZodString;
604
+ light: z.ZodString;
605
+ }, z.core.$strip>>;
606
+ title: z.ZodOptional<z.ZodString>;
607
+ }, z.core.$strip>>;
608
+ status: z.ZodEnum<{
609
+ completed: "completed";
610
+ failed: "failed";
611
+ interrupted: "interrupted";
612
+ pending: "pending";
613
+ }>;
614
+ summary: z.ZodOptional<z.ZodString>;
615
+ type: z.ZodLiteral<"delegation">;
616
+ }, z.core.$strip>, z.ZodObject<{
617
+ id: z.ZodString;
618
+ kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
619
+ parentToolCallId: z.ZodOptional<z.ZodString>;
620
+ payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
621
+ presentation: z.ZodObject<{
622
+ detail: z.ZodOptional<z.ZodString>;
623
+ icon: z.ZodObject<{
624
+ glyph: z.ZodString;
625
+ }, z.core.$strip>;
626
+ label: z.ZodObject<{
627
+ completed: z.ZodString;
628
+ pending: z.ZodString;
629
+ }, z.core.$strip>;
630
+ suppress: z.ZodOptional<z.ZodBoolean>;
631
+ tint: z.ZodOptional<z.ZodObject<{
632
+ dark: z.ZodString;
633
+ light: z.ZodString;
634
+ }, z.core.$strip>>;
635
+ title: z.ZodOptional<z.ZodString>;
636
+ }, z.core.$strip>;
637
+ status: z.ZodEnum<{
638
+ completed: "completed";
639
+ failed: "failed";
640
+ interrupted: "interrupted";
641
+ pending: "pending";
642
+ }>;
643
+ type: z.ZodLiteral<"extension">;
644
+ }, z.core.$strip>], "type">;
645
+ providerThreadId: z.ZodString;
646
+ threadId: z.ZodString;
647
+ type: z.ZodLiteral<"item/started">;
648
+ }, z.core.$strip>, z.ZodObject<{
649
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
650
+ clientRequestId: z.ZodOptional<z.ZodString>;
651
+ content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
652
+ text: z.ZodString;
653
+ type: z.ZodLiteral<"text">;
654
+ }, z.core.$strip>, z.ZodObject<{
655
+ type: z.ZodLiteral<"image">;
656
+ url: z.ZodString;
657
+ }, z.core.$strip>, z.ZodObject<{
658
+ path: z.ZodString;
659
+ type: z.ZodLiteral<"localImage">;
660
+ }, z.core.$strip>, z.ZodObject<{
661
+ path: z.ZodString;
662
+ type: z.ZodLiteral<"localFile">;
663
+ }, z.core.$strip>], "type">>;
664
+ id: z.ZodString;
665
+ parentToolCallId: z.ZodOptional<z.ZodString>;
666
+ type: z.ZodLiteral<"userMessage">;
667
+ }, z.core.$strict>, z.ZodObject<{
668
+ id: z.ZodString;
669
+ parentToolCallId: z.ZodOptional<z.ZodString>;
670
+ presentation: z.ZodOptional<z.ZodObject<{
671
+ detail: z.ZodOptional<z.ZodString>;
672
+ icon: z.ZodObject<{
673
+ glyph: z.ZodString;
674
+ }, z.core.$strip>;
675
+ label: z.ZodObject<{
676
+ completed: z.ZodString;
677
+ pending: z.ZodString;
678
+ }, z.core.$strip>;
679
+ suppress: z.ZodOptional<z.ZodBoolean>;
680
+ tint: z.ZodOptional<z.ZodObject<{
681
+ dark: z.ZodString;
682
+ light: z.ZodString;
683
+ }, z.core.$strip>>;
684
+ title: z.ZodOptional<z.ZodString>;
685
+ }, z.core.$strip>>;
686
+ text: z.ZodString;
687
+ type: z.ZodLiteral<"agentMessage">;
688
+ }, z.core.$strip>, z.ZodObject<{
689
+ aggregatedOutput: z.ZodOptional<z.ZodString>;
690
+ approvalStatus: z.ZodNullable<z.ZodEnum<{
691
+ denied: "denied";
692
+ waiting_for_approval: "waiting_for_approval";
693
+ }>>;
694
+ command: z.ZodString;
695
+ cwd: z.ZodString;
696
+ durationMs: z.ZodOptional<z.ZodNumber>;
697
+ exitCode: z.ZodOptional<z.ZodNumber>;
698
+ id: z.ZodString;
699
+ parentToolCallId: z.ZodOptional<z.ZodString>;
700
+ presentation: z.ZodOptional<z.ZodObject<{
701
+ detail: z.ZodOptional<z.ZodString>;
702
+ icon: z.ZodObject<{
703
+ glyph: z.ZodString;
704
+ }, z.core.$strip>;
705
+ label: z.ZodObject<{
706
+ completed: z.ZodString;
707
+ pending: z.ZodString;
708
+ }, z.core.$strip>;
709
+ suppress: z.ZodOptional<z.ZodBoolean>;
710
+ tint: z.ZodOptional<z.ZodObject<{
711
+ dark: z.ZodString;
712
+ light: z.ZodString;
713
+ }, z.core.$strip>>;
714
+ title: z.ZodOptional<z.ZodString>;
715
+ }, z.core.$strip>>;
716
+ status: z.ZodEnum<{
717
+ completed: "completed";
718
+ failed: "failed";
719
+ interrupted: "interrupted";
720
+ pending: "pending";
721
+ }>;
722
+ truncation: z.ZodOptional<z.ZodObject<{
723
+ aggregatedOutput: z.ZodOptional<z.ZodObject<{
724
+ originalLength: z.ZodNumber;
725
+ retainedHeadLength: z.ZodNumber;
726
+ retainedTailLength: z.ZodNumber;
727
+ truncatedAt: z.ZodNumber;
728
+ }, z.core.$strip>>;
729
+ result: z.ZodOptional<z.ZodObject<{
730
+ originalLength: z.ZodNumber;
731
+ retainedHeadLength: z.ZodNumber;
732
+ retainedTailLength: z.ZodNumber;
733
+ truncatedAt: z.ZodNumber;
734
+ }, z.core.$strip>>;
735
+ resultText: z.ZodOptional<z.ZodObject<{
736
+ originalLength: z.ZodNumber;
737
+ retainedHeadLength: z.ZodNumber;
738
+ retainedTailLength: z.ZodNumber;
739
+ truncatedAt: z.ZodNumber;
740
+ }, z.core.$strip>>;
741
+ }, z.core.$strip>>;
742
+ type: z.ZodLiteral<"commandExecution">;
743
+ }, z.core.$strip>, z.ZodObject<{
744
+ approvalStatus: z.ZodNullable<z.ZodEnum<{
745
+ denied: "denied";
746
+ waiting_for_approval: "waiting_for_approval";
747
+ }>>;
748
+ changes: z.ZodArray<z.ZodObject<{
749
+ diff: z.ZodOptional<z.ZodString>;
750
+ kind: z.ZodEnum<{
751
+ add: "add";
752
+ delete: "delete";
753
+ update: "update";
754
+ }>;
755
+ movePath: z.ZodOptional<z.ZodString>;
756
+ path: z.ZodString;
757
+ }, z.core.$strip>>;
758
+ id: z.ZodString;
759
+ parentToolCallId: z.ZodOptional<z.ZodString>;
760
+ presentation: z.ZodOptional<z.ZodObject<{
761
+ detail: z.ZodOptional<z.ZodString>;
762
+ icon: z.ZodObject<{
763
+ glyph: z.ZodString;
764
+ }, z.core.$strip>;
765
+ label: z.ZodObject<{
766
+ completed: z.ZodString;
767
+ pending: z.ZodString;
768
+ }, z.core.$strip>;
769
+ suppress: z.ZodOptional<z.ZodBoolean>;
770
+ tint: z.ZodOptional<z.ZodObject<{
771
+ dark: z.ZodString;
772
+ light: z.ZodString;
773
+ }, z.core.$strip>>;
774
+ title: z.ZodOptional<z.ZodString>;
775
+ }, z.core.$strip>>;
776
+ status: z.ZodEnum<{
777
+ completed: "completed";
778
+ failed: "failed";
779
+ interrupted: "interrupted";
780
+ pending: "pending";
781
+ }>;
782
+ type: z.ZodLiteral<"fileChange">;
783
+ }, z.core.$strip>, z.ZodObject<{
784
+ id: z.ZodString;
785
+ parentToolCallId: z.ZodOptional<z.ZodString>;
786
+ presentation: z.ZodOptional<z.ZodObject<{
787
+ detail: z.ZodOptional<z.ZodString>;
788
+ icon: z.ZodObject<{
789
+ glyph: z.ZodString;
790
+ }, z.core.$strip>;
791
+ label: z.ZodObject<{
792
+ completed: z.ZodString;
793
+ pending: z.ZodString;
794
+ }, z.core.$strip>;
795
+ suppress: z.ZodOptional<z.ZodBoolean>;
796
+ tint: z.ZodOptional<z.ZodObject<{
797
+ dark: z.ZodString;
798
+ light: z.ZodString;
799
+ }, z.core.$strip>>;
800
+ title: z.ZodOptional<z.ZodString>;
801
+ }, z.core.$strip>>;
802
+ queries: z.ZodArray<z.ZodString>;
803
+ resultText: z.ZodNullable<z.ZodString>;
804
+ type: z.ZodLiteral<"webSearch">;
805
+ }, z.core.$strip>, z.ZodObject<{
806
+ id: z.ZodString;
807
+ parentToolCallId: z.ZodOptional<z.ZodString>;
808
+ pattern: z.ZodNullable<z.ZodString>;
809
+ presentation: z.ZodOptional<z.ZodObject<{
810
+ detail: z.ZodOptional<z.ZodString>;
811
+ icon: z.ZodObject<{
812
+ glyph: z.ZodString;
813
+ }, z.core.$strip>;
814
+ label: z.ZodObject<{
815
+ completed: z.ZodString;
816
+ pending: z.ZodString;
817
+ }, z.core.$strip>;
818
+ suppress: z.ZodOptional<z.ZodBoolean>;
819
+ tint: z.ZodOptional<z.ZodObject<{
820
+ dark: z.ZodString;
821
+ light: z.ZodString;
822
+ }, z.core.$strip>>;
823
+ title: z.ZodOptional<z.ZodString>;
824
+ }, z.core.$strip>>;
825
+ prompt: z.ZodNullable<z.ZodString>;
826
+ resultText: z.ZodNullable<z.ZodString>;
827
+ type: z.ZodLiteral<"webFetch">;
828
+ url: z.ZodString;
829
+ }, z.core.$strip>, z.ZodObject<{
830
+ id: z.ZodString;
831
+ parentToolCallId: z.ZodOptional<z.ZodString>;
832
+ path: z.ZodString;
833
+ presentation: z.ZodOptional<z.ZodObject<{
834
+ detail: z.ZodOptional<z.ZodString>;
835
+ icon: z.ZodObject<{
836
+ glyph: z.ZodString;
837
+ }, z.core.$strip>;
838
+ label: z.ZodObject<{
839
+ completed: z.ZodString;
840
+ pending: z.ZodString;
841
+ }, z.core.$strip>;
842
+ suppress: z.ZodOptional<z.ZodBoolean>;
843
+ tint: z.ZodOptional<z.ZodObject<{
844
+ dark: z.ZodString;
845
+ light: z.ZodString;
846
+ }, z.core.$strip>>;
847
+ title: z.ZodOptional<z.ZodString>;
848
+ }, z.core.$strip>>;
849
+ type: z.ZodLiteral<"imageView">;
850
+ }, z.core.$strip>, z.ZodObject<{
851
+ cmd: z.ZodOptional<z.ZodString>;
852
+ id: z.ZodString;
853
+ parentToolCallId: z.ZodOptional<z.ZodString>;
854
+ path: z.ZodString;
855
+ presentation: z.ZodOptional<z.ZodObject<{
856
+ detail: z.ZodOptional<z.ZodString>;
857
+ icon: z.ZodObject<{
858
+ glyph: z.ZodString;
859
+ }, z.core.$strip>;
860
+ label: z.ZodObject<{
861
+ completed: z.ZodString;
862
+ pending: z.ZodString;
863
+ }, z.core.$strip>;
864
+ suppress: z.ZodOptional<z.ZodBoolean>;
865
+ tint: z.ZodOptional<z.ZodObject<{
866
+ dark: z.ZodString;
867
+ light: z.ZodString;
868
+ }, z.core.$strip>>;
869
+ title: z.ZodOptional<z.ZodString>;
870
+ }, z.core.$strip>>;
871
+ status: z.ZodEnum<{
872
+ completed: "completed";
873
+ failed: "failed";
874
+ interrupted: "interrupted";
875
+ pending: "pending";
876
+ }>;
877
+ type: z.ZodLiteral<"fileRead">;
878
+ }, z.core.$strip>, z.ZodObject<{
879
+ cmd: z.ZodOptional<z.ZodString>;
880
+ id: z.ZodString;
881
+ mode: z.ZodEnum<{
882
+ content: "content";
883
+ list: "list";
884
+ path: "path";
885
+ }>;
886
+ parentToolCallId: z.ZodOptional<z.ZodString>;
887
+ path: z.ZodOptional<z.ZodString>;
888
+ presentation: z.ZodOptional<z.ZodObject<{
889
+ detail: z.ZodOptional<z.ZodString>;
890
+ icon: z.ZodObject<{
891
+ glyph: z.ZodString;
892
+ }, z.core.$strip>;
893
+ label: z.ZodObject<{
894
+ completed: z.ZodString;
895
+ pending: z.ZodString;
896
+ }, z.core.$strip>;
897
+ suppress: z.ZodOptional<z.ZodBoolean>;
898
+ tint: z.ZodOptional<z.ZodObject<{
899
+ dark: z.ZodString;
900
+ light: z.ZodString;
901
+ }, z.core.$strip>>;
902
+ title: z.ZodOptional<z.ZodString>;
903
+ }, z.core.$strip>>;
904
+ query: z.ZodString;
905
+ status: z.ZodEnum<{
906
+ completed: "completed";
907
+ failed: "failed";
908
+ interrupted: "interrupted";
909
+ pending: "pending";
910
+ }>;
911
+ type: z.ZodLiteral<"search">;
912
+ }, z.core.$strip>, z.ZodObject<{
913
+ arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
914
+ durationMs: z.ZodOptional<z.ZodNumber>;
915
+ error: z.ZodOptional<z.ZodString>;
916
+ id: z.ZodString;
917
+ parentToolCallId: z.ZodOptional<z.ZodString>;
918
+ presentation: z.ZodOptional<z.ZodObject<{
919
+ detail: z.ZodOptional<z.ZodString>;
920
+ icon: z.ZodObject<{
921
+ glyph: z.ZodString;
922
+ }, z.core.$strip>;
923
+ label: z.ZodObject<{
924
+ completed: z.ZodString;
925
+ pending: z.ZodString;
926
+ }, z.core.$strip>;
927
+ suppress: z.ZodOptional<z.ZodBoolean>;
928
+ tint: z.ZodOptional<z.ZodObject<{
929
+ dark: z.ZodString;
930
+ light: z.ZodString;
931
+ }, z.core.$strip>>;
932
+ title: z.ZodOptional<z.ZodString>;
933
+ }, z.core.$strip>>;
934
+ result: z.ZodOptional<z.ZodUnknown>;
935
+ server: z.ZodOptional<z.ZodString>;
936
+ status: z.ZodEnum<{
937
+ completed: "completed";
938
+ failed: "failed";
939
+ interrupted: "interrupted";
940
+ pending: "pending";
941
+ }>;
942
+ statusLabels: z.ZodOptional<z.ZodObject<{
943
+ completed: z.ZodString;
944
+ pending: z.ZodString;
945
+ }, z.core.$strip>>;
946
+ tool: z.ZodString;
947
+ truncation: z.ZodOptional<z.ZodObject<{
948
+ aggregatedOutput: z.ZodOptional<z.ZodObject<{
949
+ originalLength: z.ZodNumber;
950
+ retainedHeadLength: z.ZodNumber;
951
+ retainedTailLength: z.ZodNumber;
952
+ truncatedAt: z.ZodNumber;
953
+ }, z.core.$strip>>;
954
+ result: z.ZodOptional<z.ZodObject<{
955
+ originalLength: z.ZodNumber;
956
+ retainedHeadLength: z.ZodNumber;
957
+ retainedTailLength: z.ZodNumber;
958
+ truncatedAt: z.ZodNumber;
959
+ }, z.core.$strip>>;
960
+ resultText: z.ZodOptional<z.ZodObject<{
961
+ originalLength: z.ZodNumber;
962
+ retainedHeadLength: z.ZodNumber;
963
+ retainedTailLength: z.ZodNumber;
964
+ truncatedAt: z.ZodNumber;
965
+ }, z.core.$strip>>;
966
+ }, z.core.$strip>>;
967
+ type: z.ZodLiteral<"toolCall">;
968
+ }, z.core.$strip>, z.ZodObject<{
969
+ content: z.ZodArray<z.ZodString>;
970
+ id: z.ZodString;
971
+ parentToolCallId: z.ZodOptional<z.ZodString>;
972
+ presentation: z.ZodOptional<z.ZodObject<{
973
+ detail: z.ZodOptional<z.ZodString>;
974
+ icon: z.ZodObject<{
975
+ glyph: z.ZodString;
976
+ }, z.core.$strip>;
977
+ label: z.ZodObject<{
978
+ completed: z.ZodString;
979
+ pending: z.ZodString;
980
+ }, z.core.$strip>;
981
+ suppress: z.ZodOptional<z.ZodBoolean>;
982
+ tint: z.ZodOptional<z.ZodObject<{
983
+ dark: z.ZodString;
984
+ light: z.ZodString;
985
+ }, z.core.$strip>>;
986
+ title: z.ZodOptional<z.ZodString>;
987
+ }, z.core.$strip>>;
988
+ summary: z.ZodArray<z.ZodString>;
989
+ type: z.ZodLiteral<"reasoning">;
990
+ }, z.core.$strip>, z.ZodObject<{
991
+ id: z.ZodString;
992
+ parentToolCallId: z.ZodOptional<z.ZodString>;
993
+ presentation: z.ZodOptional<z.ZodObject<{
994
+ detail: z.ZodOptional<z.ZodString>;
995
+ icon: z.ZodObject<{
996
+ glyph: z.ZodString;
997
+ }, z.core.$strip>;
998
+ label: z.ZodObject<{
999
+ completed: z.ZodString;
1000
+ pending: z.ZodString;
1001
+ }, z.core.$strip>;
1002
+ suppress: z.ZodOptional<z.ZodBoolean>;
1003
+ tint: z.ZodOptional<z.ZodObject<{
1004
+ dark: z.ZodString;
1005
+ light: z.ZodString;
1006
+ }, z.core.$strip>>;
1007
+ title: z.ZodOptional<z.ZodString>;
1008
+ }, z.core.$strip>>;
1009
+ text: z.ZodString;
1010
+ type: z.ZodLiteral<"plan">;
1011
+ }, z.core.$strip>, z.ZodObject<{
1012
+ explanation: z.ZodOptional<z.ZodString>;
1013
+ id: z.ZodString;
1014
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1015
+ presentation: z.ZodOptional<z.ZodObject<{
1016
+ detail: z.ZodOptional<z.ZodString>;
1017
+ icon: z.ZodObject<{
1018
+ glyph: z.ZodString;
1019
+ }, z.core.$strip>;
1020
+ label: z.ZodObject<{
1021
+ completed: z.ZodString;
1022
+ pending: z.ZodString;
1023
+ }, z.core.$strip>;
1024
+ suppress: z.ZodOptional<z.ZodBoolean>;
1025
+ tint: z.ZodOptional<z.ZodObject<{
1026
+ dark: z.ZodString;
1027
+ light: z.ZodString;
1028
+ }, z.core.$strip>>;
1029
+ title: z.ZodOptional<z.ZodString>;
1030
+ }, z.core.$strip>>;
1031
+ status: z.ZodEnum<{
1032
+ completed: "completed";
1033
+ failed: "failed";
1034
+ interrupted: "interrupted";
1035
+ pending: "pending";
1036
+ }>;
1037
+ steps: z.ZodArray<z.ZodObject<{
1038
+ status: z.ZodOptional<z.ZodEnum<{
1039
+ active: "active";
1040
+ completed: "completed";
1041
+ failed: "failed";
1042
+ pending: "pending";
1043
+ }>>;
1044
+ step: z.ZodString;
1045
+ }, z.core.$strip>>;
1046
+ type: z.ZodLiteral<"planSteps">;
1047
+ }, z.core.$strip>, z.ZodObject<{
1048
+ id: z.ZodString;
1049
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1050
+ presentation: z.ZodOptional<z.ZodObject<{
1051
+ detail: z.ZodOptional<z.ZodString>;
1052
+ icon: z.ZodObject<{
1053
+ glyph: z.ZodString;
1054
+ }, z.core.$strip>;
1055
+ label: z.ZodObject<{
1056
+ completed: z.ZodString;
1057
+ pending: z.ZodString;
1058
+ }, z.core.$strip>;
1059
+ suppress: z.ZodOptional<z.ZodBoolean>;
1060
+ tint: z.ZodOptional<z.ZodObject<{
1061
+ dark: z.ZodString;
1062
+ light: z.ZodString;
1063
+ }, z.core.$strip>>;
1064
+ title: z.ZodOptional<z.ZodString>;
1065
+ }, z.core.$strip>>;
1066
+ type: z.ZodLiteral<"contextCompaction">;
1067
+ }, z.core.$strip>, z.ZodObject<{
1068
+ description: z.ZodString;
1069
+ error: z.ZodOptional<z.ZodString>;
1070
+ familyId: z.ZodOptional<z.ZodString>;
1071
+ id: z.ZodString;
1072
+ outputFile: z.ZodOptional<z.ZodString>;
1073
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1074
+ presentation: z.ZodOptional<z.ZodObject<{
1075
+ detail: z.ZodOptional<z.ZodString>;
1076
+ icon: z.ZodObject<{
1077
+ glyph: z.ZodString;
1078
+ }, z.core.$strip>;
1079
+ label: z.ZodObject<{
1080
+ completed: z.ZodString;
1081
+ pending: z.ZodString;
1082
+ }, z.core.$strip>;
1083
+ suppress: z.ZodOptional<z.ZodBoolean>;
1084
+ tint: z.ZodOptional<z.ZodObject<{
1085
+ dark: z.ZodString;
1086
+ light: z.ZodString;
1087
+ }, z.core.$strip>>;
1088
+ title: z.ZodOptional<z.ZodString>;
1089
+ }, z.core.$strip>>;
1090
+ skipTranscript: z.ZodBoolean;
1091
+ status: z.ZodEnum<{
1092
+ completed: "completed";
1093
+ failed: "failed";
1094
+ interrupted: "interrupted";
1095
+ pending: "pending";
1096
+ }>;
1097
+ summary: z.ZodOptional<z.ZodString>;
1098
+ taskStatus: z.ZodEnum<{
1099
+ completed: "completed";
1100
+ failed: "failed";
1101
+ killed: "killed";
1102
+ paused: "paused";
1103
+ pending: "pending";
1104
+ running: "running";
1105
+ stopped: "stopped";
1106
+ }>;
1107
+ taskType: z.ZodString;
1108
+ type: z.ZodLiteral<"backgroundTask">;
1109
+ usage: z.ZodOptional<z.ZodObject<{
1110
+ durationMs: z.ZodNumber;
1111
+ toolUses: z.ZodNumber;
1112
+ totalTokens: z.ZodNumber;
1113
+ }, z.core.$strip>>;
1114
+ workflow: z.ZodOptional<z.ZodObject<{
1115
+ agents: z.ZodArray<z.ZodObject<{
1116
+ agentType: z.ZodOptional<z.ZodString>;
1117
+ attempt: z.ZodNumber;
1118
+ cached: z.ZodBoolean;
1119
+ durationMs: z.ZodOptional<z.ZodNumber>;
1120
+ error: z.ZodOptional<z.ZodString>;
1121
+ index: z.ZodNumber;
1122
+ isolation: z.ZodOptional<z.ZodString>;
1123
+ label: z.ZodString;
1124
+ lastProgressAt: z.ZodNumber;
1125
+ lastToolName: z.ZodOptional<z.ZodString>;
1126
+ lastToolSummary: z.ZodOptional<z.ZodString>;
1127
+ model: z.ZodString;
1128
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
1129
+ phaseTitle: z.ZodOptional<z.ZodString>;
1130
+ promptPreview: z.ZodOptional<z.ZodString>;
1131
+ queuedAt: z.ZodOptional<z.ZodNumber>;
1132
+ resultPreview: z.ZodOptional<z.ZodString>;
1133
+ startedAt: z.ZodOptional<z.ZodNumber>;
1134
+ state: z.ZodEnum<{
1135
+ done: "done";
1136
+ failed: "failed";
1137
+ queued: "queued";
1138
+ running: "running";
1139
+ skipped: "skipped";
1140
+ }>;
1141
+ tokens: z.ZodOptional<z.ZodNumber>;
1142
+ toolCalls: z.ZodOptional<z.ZodNumber>;
1143
+ }, z.core.$strip>>;
1144
+ phases: z.ZodArray<z.ZodObject<{
1145
+ index: z.ZodNumber;
1146
+ kind: z.ZodOptional<z.ZodString>;
1147
+ title: z.ZodString;
1148
+ }, z.core.$strip>>;
1149
+ }, z.core.$strip>>;
1150
+ workflowName: z.ZodOptional<z.ZodString>;
1151
+ }, z.core.$strip>, z.ZodObject<{
1152
+ background: z.ZodBoolean;
1153
+ childRef: z.ZodString;
1154
+ id: z.ZodString;
1155
+ label: z.ZodString;
1156
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1157
+ presentation: z.ZodOptional<z.ZodObject<{
1158
+ detail: z.ZodOptional<z.ZodString>;
1159
+ icon: z.ZodObject<{
1160
+ glyph: z.ZodString;
1161
+ }, z.core.$strip>;
1162
+ label: z.ZodObject<{
1163
+ completed: z.ZodString;
1164
+ pending: z.ZodString;
1165
+ }, z.core.$strip>;
1166
+ suppress: z.ZodOptional<z.ZodBoolean>;
1167
+ tint: z.ZodOptional<z.ZodObject<{
1168
+ dark: z.ZodString;
1169
+ light: z.ZodString;
1170
+ }, z.core.$strip>>;
1171
+ title: z.ZodOptional<z.ZodString>;
1172
+ }, z.core.$strip>>;
1173
+ status: z.ZodEnum<{
1174
+ completed: "completed";
1175
+ failed: "failed";
1176
+ interrupted: "interrupted";
1177
+ pending: "pending";
1178
+ }>;
1179
+ summary: z.ZodOptional<z.ZodString>;
1180
+ type: z.ZodLiteral<"delegation">;
1181
+ }, z.core.$strip>, z.ZodObject<{
1182
+ id: z.ZodString;
1183
+ kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
1184
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1185
+ payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
1186
+ presentation: z.ZodObject<{
1187
+ detail: z.ZodOptional<z.ZodString>;
1188
+ icon: z.ZodObject<{
1189
+ glyph: z.ZodString;
1190
+ }, z.core.$strip>;
1191
+ label: z.ZodObject<{
1192
+ completed: z.ZodString;
1193
+ pending: z.ZodString;
1194
+ }, z.core.$strip>;
1195
+ suppress: z.ZodOptional<z.ZodBoolean>;
1196
+ tint: z.ZodOptional<z.ZodObject<{
1197
+ dark: z.ZodString;
1198
+ light: z.ZodString;
1199
+ }, z.core.$strip>>;
1200
+ title: z.ZodOptional<z.ZodString>;
1201
+ }, z.core.$strip>;
1202
+ status: z.ZodEnum<{
1203
+ completed: "completed";
1204
+ failed: "failed";
1205
+ interrupted: "interrupted";
1206
+ pending: "pending";
1207
+ }>;
1208
+ type: z.ZodLiteral<"extension">;
1209
+ }, z.core.$strip>], "type">;
1210
+ providerThreadId: z.ZodString;
1211
+ threadId: z.ZodString;
1212
+ type: z.ZodLiteral<"item/completed">;
1213
+ }, z.core.$strip>, z.ZodObject<{
1214
+ delta: z.ZodString;
1215
+ itemId: z.ZodString;
1216
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1217
+ providerThreadId: z.ZodString;
1218
+ threadId: z.ZodString;
1219
+ type: z.ZodLiteral<"item/agentMessage/delta">;
1220
+ }, z.core.$strip>, z.ZodObject<{
1221
+ delta: z.ZodString;
1222
+ itemId: z.ZodString;
1223
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1224
+ providerThreadId: z.ZodString;
1225
+ reset: z.ZodOptional<z.ZodBoolean>;
1226
+ threadId: z.ZodString;
1227
+ type: z.ZodLiteral<"item/commandExecution/outputDelta">;
1228
+ }, z.core.$strip>, z.ZodObject<{
1229
+ delta: z.ZodString;
1230
+ itemId: z.ZodString;
1231
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1232
+ providerThreadId: z.ZodString;
1233
+ threadId: z.ZodString;
1234
+ type: z.ZodLiteral<"item/fileChange/outputDelta">;
1235
+ }, z.core.$strip>, z.ZodObject<{
1236
+ delta: z.ZodString;
1237
+ itemId: z.ZodString;
1238
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1239
+ providerThreadId: z.ZodString;
1240
+ threadId: z.ZodString;
1241
+ type: z.ZodLiteral<"item/reasoning/summaryTextDelta">;
1242
+ }, z.core.$strip>, z.ZodObject<{
1243
+ delta: z.ZodString;
1244
+ itemId: z.ZodString;
1245
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1246
+ providerThreadId: z.ZodString;
1247
+ threadId: z.ZodString;
1248
+ type: z.ZodLiteral<"item/reasoning/textDelta">;
1249
+ }, z.core.$strip>, z.ZodObject<{
1250
+ delta: z.ZodString;
1251
+ itemId: z.ZodString;
1252
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1253
+ providerThreadId: z.ZodString;
1254
+ threadId: z.ZodString;
1255
+ type: z.ZodLiteral<"item/plan/delta">;
1256
+ }, z.core.$strip>, z.ZodObject<{
1257
+ itemId: z.ZodString;
1258
+ message: z.ZodOptional<z.ZodString>;
1259
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1260
+ providerThreadId: z.ZodString;
1261
+ threadId: z.ZodString;
1262
+ type: z.ZodLiteral<"item/mcpToolCall/progress">;
1263
+ }, z.core.$strip>, z.ZodObject<{
1264
+ itemId: z.ZodString;
1265
+ message: z.ZodOptional<z.ZodString>;
1266
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1267
+ providerThreadId: z.ZodString;
1268
+ threadId: z.ZodString;
1269
+ type: z.ZodLiteral<"item/toolCall/progress">;
1270
+ }, z.core.$strip>, z.ZodObject<{
1271
+ item: z.ZodObject<{
1272
+ description: z.ZodString;
1273
+ error: z.ZodOptional<z.ZodString>;
1274
+ familyId: z.ZodOptional<z.ZodString>;
1275
+ id: z.ZodString;
1276
+ outputFile: z.ZodOptional<z.ZodString>;
1277
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1278
+ presentation: z.ZodOptional<z.ZodObject<{
1279
+ detail: z.ZodOptional<z.ZodString>;
1280
+ icon: z.ZodObject<{
1281
+ glyph: z.ZodString;
1282
+ }, z.core.$strip>;
1283
+ label: z.ZodObject<{
1284
+ completed: z.ZodString;
1285
+ pending: z.ZodString;
1286
+ }, z.core.$strip>;
1287
+ suppress: z.ZodOptional<z.ZodBoolean>;
1288
+ tint: z.ZodOptional<z.ZodObject<{
1289
+ dark: z.ZodString;
1290
+ light: z.ZodString;
1291
+ }, z.core.$strip>>;
1292
+ title: z.ZodOptional<z.ZodString>;
1293
+ }, z.core.$strip>>;
1294
+ skipTranscript: z.ZodBoolean;
1295
+ status: z.ZodEnum<{
1296
+ completed: "completed";
1297
+ failed: "failed";
1298
+ interrupted: "interrupted";
1299
+ pending: "pending";
1300
+ }>;
1301
+ summary: z.ZodOptional<z.ZodString>;
1302
+ taskStatus: z.ZodEnum<{
1303
+ completed: "completed";
1304
+ failed: "failed";
1305
+ killed: "killed";
1306
+ paused: "paused";
1307
+ pending: "pending";
1308
+ running: "running";
1309
+ stopped: "stopped";
1310
+ }>;
1311
+ taskType: z.ZodString;
1312
+ type: z.ZodLiteral<"backgroundTask">;
1313
+ usage: z.ZodOptional<z.ZodObject<{
1314
+ durationMs: z.ZodNumber;
1315
+ toolUses: z.ZodNumber;
1316
+ totalTokens: z.ZodNumber;
1317
+ }, z.core.$strip>>;
1318
+ workflow: z.ZodOptional<z.ZodObject<{
1319
+ agents: z.ZodArray<z.ZodObject<{
1320
+ agentType: z.ZodOptional<z.ZodString>;
1321
+ attempt: z.ZodNumber;
1322
+ cached: z.ZodBoolean;
1323
+ durationMs: z.ZodOptional<z.ZodNumber>;
1324
+ error: z.ZodOptional<z.ZodString>;
1325
+ index: z.ZodNumber;
1326
+ isolation: z.ZodOptional<z.ZodString>;
1327
+ label: z.ZodString;
1328
+ lastProgressAt: z.ZodNumber;
1329
+ lastToolName: z.ZodOptional<z.ZodString>;
1330
+ lastToolSummary: z.ZodOptional<z.ZodString>;
1331
+ model: z.ZodString;
1332
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
1333
+ phaseTitle: z.ZodOptional<z.ZodString>;
1334
+ promptPreview: z.ZodOptional<z.ZodString>;
1335
+ queuedAt: z.ZodOptional<z.ZodNumber>;
1336
+ resultPreview: z.ZodOptional<z.ZodString>;
1337
+ startedAt: z.ZodOptional<z.ZodNumber>;
1338
+ state: z.ZodEnum<{
1339
+ done: "done";
1340
+ failed: "failed";
1341
+ queued: "queued";
1342
+ running: "running";
1343
+ skipped: "skipped";
1344
+ }>;
1345
+ tokens: z.ZodOptional<z.ZodNumber>;
1346
+ toolCalls: z.ZodOptional<z.ZodNumber>;
1347
+ }, z.core.$strip>>;
1348
+ phases: z.ZodArray<z.ZodObject<{
1349
+ index: z.ZodNumber;
1350
+ kind: z.ZodOptional<z.ZodString>;
1351
+ title: z.ZodString;
1352
+ }, z.core.$strip>>;
1353
+ }, z.core.$strip>>;
1354
+ workflowName: z.ZodOptional<z.ZodString>;
1355
+ }, z.core.$strip>;
1356
+ providerThreadId: z.ZodString;
1357
+ threadId: z.ZodString;
1358
+ type: z.ZodLiteral<"item/backgroundTask/progress">;
1359
+ }, z.core.$strip>, z.ZodObject<{
1360
+ item: z.ZodObject<{
1361
+ description: z.ZodString;
1362
+ error: z.ZodOptional<z.ZodString>;
1363
+ familyId: z.ZodOptional<z.ZodString>;
1364
+ id: z.ZodString;
1365
+ outputFile: z.ZodOptional<z.ZodString>;
1366
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1367
+ presentation: z.ZodOptional<z.ZodObject<{
1368
+ detail: z.ZodOptional<z.ZodString>;
1369
+ icon: z.ZodObject<{
1370
+ glyph: z.ZodString;
1371
+ }, z.core.$strip>;
1372
+ label: z.ZodObject<{
1373
+ completed: z.ZodString;
1374
+ pending: z.ZodString;
1375
+ }, z.core.$strip>;
1376
+ suppress: z.ZodOptional<z.ZodBoolean>;
1377
+ tint: z.ZodOptional<z.ZodObject<{
1378
+ dark: z.ZodString;
1379
+ light: z.ZodString;
1380
+ }, z.core.$strip>>;
1381
+ title: z.ZodOptional<z.ZodString>;
1382
+ }, z.core.$strip>>;
1383
+ skipTranscript: z.ZodBoolean;
1384
+ status: z.ZodEnum<{
1385
+ completed: "completed";
1386
+ failed: "failed";
1387
+ interrupted: "interrupted";
1388
+ pending: "pending";
1389
+ }>;
1390
+ summary: z.ZodOptional<z.ZodString>;
1391
+ taskStatus: z.ZodEnum<{
1392
+ completed: "completed";
1393
+ failed: "failed";
1394
+ killed: "killed";
1395
+ paused: "paused";
1396
+ pending: "pending";
1397
+ running: "running";
1398
+ stopped: "stopped";
1399
+ }>;
1400
+ taskType: z.ZodString;
1401
+ type: z.ZodLiteral<"backgroundTask">;
1402
+ usage: z.ZodOptional<z.ZodObject<{
1403
+ durationMs: z.ZodNumber;
1404
+ toolUses: z.ZodNumber;
1405
+ totalTokens: z.ZodNumber;
1406
+ }, z.core.$strip>>;
1407
+ workflow: z.ZodOptional<z.ZodObject<{
1408
+ agents: z.ZodArray<z.ZodObject<{
1409
+ agentType: z.ZodOptional<z.ZodString>;
1410
+ attempt: z.ZodNumber;
1411
+ cached: z.ZodBoolean;
1412
+ durationMs: z.ZodOptional<z.ZodNumber>;
1413
+ error: z.ZodOptional<z.ZodString>;
1414
+ index: z.ZodNumber;
1415
+ isolation: z.ZodOptional<z.ZodString>;
1416
+ label: z.ZodString;
1417
+ lastProgressAt: z.ZodNumber;
1418
+ lastToolName: z.ZodOptional<z.ZodString>;
1419
+ lastToolSummary: z.ZodOptional<z.ZodString>;
1420
+ model: z.ZodString;
1421
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
1422
+ phaseTitle: z.ZodOptional<z.ZodString>;
1423
+ promptPreview: z.ZodOptional<z.ZodString>;
1424
+ queuedAt: z.ZodOptional<z.ZodNumber>;
1425
+ resultPreview: z.ZodOptional<z.ZodString>;
1426
+ startedAt: z.ZodOptional<z.ZodNumber>;
1427
+ state: z.ZodEnum<{
1428
+ done: "done";
1429
+ failed: "failed";
1430
+ queued: "queued";
1431
+ running: "running";
1432
+ skipped: "skipped";
1433
+ }>;
1434
+ tokens: z.ZodOptional<z.ZodNumber>;
1435
+ toolCalls: z.ZodOptional<z.ZodNumber>;
1436
+ }, z.core.$strip>>;
1437
+ phases: z.ZodArray<z.ZodObject<{
1438
+ index: z.ZodNumber;
1439
+ kind: z.ZodOptional<z.ZodString>;
1440
+ title: z.ZodString;
1441
+ }, z.core.$strip>>;
1442
+ }, z.core.$strip>>;
1443
+ workflowName: z.ZodOptional<z.ZodString>;
1444
+ }, z.core.$strip>;
1445
+ providerThreadId: z.ZodString;
1446
+ threadId: z.ZodString;
1447
+ type: z.ZodLiteral<"item/backgroundTask/completed">;
1448
+ }, z.core.$strip>, z.ZodObject<{
1449
+ item: z.ZodObject<{
1450
+ background: z.ZodBoolean;
1451
+ childRef: z.ZodString;
1452
+ id: z.ZodString;
1453
+ label: z.ZodString;
1454
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1455
+ presentation: z.ZodOptional<z.ZodObject<{
1456
+ detail: z.ZodOptional<z.ZodString>;
1457
+ icon: z.ZodObject<{
1458
+ glyph: z.ZodString;
1459
+ }, z.core.$strip>;
1460
+ label: z.ZodObject<{
1461
+ completed: z.ZodString;
1462
+ pending: z.ZodString;
1463
+ }, z.core.$strip>;
1464
+ suppress: z.ZodOptional<z.ZodBoolean>;
1465
+ tint: z.ZodOptional<z.ZodObject<{
1466
+ dark: z.ZodString;
1467
+ light: z.ZodString;
1468
+ }, z.core.$strip>>;
1469
+ title: z.ZodOptional<z.ZodString>;
1470
+ }, z.core.$strip>>;
1471
+ status: z.ZodEnum<{
1472
+ completed: "completed";
1473
+ failed: "failed";
1474
+ interrupted: "interrupted";
1475
+ pending: "pending";
1476
+ }>;
1477
+ summary: z.ZodOptional<z.ZodString>;
1478
+ type: z.ZodLiteral<"delegation">;
1479
+ }, z.core.$strip>;
1480
+ providerThreadId: z.ZodString;
1481
+ threadId: z.ZodString;
1482
+ type: z.ZodLiteral<"item/delegation/progress">;
1483
+ }, z.core.$strip>, z.ZodObject<{
1484
+ item: z.ZodObject<{
1485
+ background: z.ZodBoolean;
1486
+ childRef: z.ZodString;
1487
+ id: z.ZodString;
1488
+ label: z.ZodString;
1489
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1490
+ presentation: z.ZodOptional<z.ZodObject<{
1491
+ detail: z.ZodOptional<z.ZodString>;
1492
+ icon: z.ZodObject<{
1493
+ glyph: z.ZodString;
1494
+ }, z.core.$strip>;
1495
+ label: z.ZodObject<{
1496
+ completed: z.ZodString;
1497
+ pending: z.ZodString;
1498
+ }, z.core.$strip>;
1499
+ suppress: z.ZodOptional<z.ZodBoolean>;
1500
+ tint: z.ZodOptional<z.ZodObject<{
1501
+ dark: z.ZodString;
1502
+ light: z.ZodString;
1503
+ }, z.core.$strip>>;
1504
+ title: z.ZodOptional<z.ZodString>;
1505
+ }, z.core.$strip>>;
1506
+ status: z.ZodEnum<{
1507
+ completed: "completed";
1508
+ failed: "failed";
1509
+ interrupted: "interrupted";
1510
+ pending: "pending";
1511
+ }>;
1512
+ summary: z.ZodOptional<z.ZodString>;
1513
+ type: z.ZodLiteral<"delegation">;
1514
+ }, z.core.$strip>;
1515
+ providerThreadId: z.ZodString;
1516
+ threadId: z.ZodString;
1517
+ type: z.ZodLiteral<"item/delegation/completed">;
1518
+ }, z.core.$strip>, z.ZodObject<{
1519
+ providerThreadId: z.ZodString;
1520
+ threadId: z.ZodString;
1521
+ tokenUsage: z.ZodObject<{
1522
+ last: z.ZodObject<{
1523
+ cachedInputTokens: z.ZodNumber;
1524
+ inputTokens: z.ZodNumber;
1525
+ outputTokens: z.ZodNumber;
1526
+ reasoningOutputTokens: z.ZodNumber;
1527
+ totalTokens: z.ZodNumber;
1528
+ }, z.core.$strip>;
1529
+ modelContextWindow: z.ZodNullable<z.ZodNumber>;
1530
+ total: z.ZodObject<{
1531
+ cachedInputTokens: z.ZodNumber;
1532
+ inputTokens: z.ZodNumber;
1533
+ outputTokens: z.ZodNumber;
1534
+ reasoningOutputTokens: z.ZodNumber;
1535
+ totalTokens: z.ZodNumber;
1536
+ }, z.core.$strip>;
1537
+ }, z.core.$strip>;
1538
+ type: z.ZodLiteral<"thread/tokenUsage/updated">;
1539
+ }, z.core.$strip>, z.ZodObject<{
1540
+ contextWindowUsage: z.ZodObject<{
1541
+ estimated: z.ZodBoolean;
1542
+ modelContextWindow: z.ZodNullable<z.ZodNumber>;
1543
+ usedTokens: z.ZodNullable<z.ZodNumber>;
1544
+ }, z.core.$strip>;
1545
+ providerThreadId: z.ZodString;
1546
+ threadId: z.ZodString;
1547
+ type: z.ZodLiteral<"thread/contextWindowUsage/updated">;
1548
+ }, z.core.$strip>, z.ZodObject<{
1549
+ explanation: z.ZodOptional<z.ZodString>;
1550
+ plan: z.ZodArray<z.ZodObject<{
1551
+ status: z.ZodOptional<z.ZodEnum<{
1552
+ active: "active";
1553
+ completed: "completed";
1554
+ failed: "failed";
1555
+ pending: "pending";
1556
+ }>>;
1557
+ step: z.ZodString;
1558
+ }, z.core.$strip>>;
1559
+ providerThreadId: z.ZodString;
1560
+ threadId: z.ZodString;
1561
+ type: z.ZodLiteral<"turn/plan/updated">;
1562
+ }, z.core.$strip>, z.ZodObject<{
1563
+ diff: z.ZodOptional<z.ZodString>;
1564
+ providerThreadId: z.ZodString;
1565
+ threadId: z.ZodString;
1566
+ type: z.ZodLiteral<"turn/diff/updated">;
1567
+ }, z.core.$strip>, z.ZodObject<{
1568
+ detail: z.ZodOptional<z.ZodString>;
1569
+ errorInfo: z.ZodOptional<z.ZodObject<{
1570
+ category: z.ZodEnum<{
1571
+ "active-turn-not-steerable": "active-turn-not-steerable";
1572
+ "bad-request": "bad-request";
1573
+ "budget-exceeded": "budget-exceeded";
1574
+ "connection-failed": "connection-failed";
1575
+ "context-window-exceeded": "context-window-exceeded";
1576
+ "max-output-tokens": "max-output-tokens";
1577
+ "max-turns": "max-turns";
1578
+ "rate-limit": "rate-limit";
1579
+ "stream-disconnected": "stream-disconnected";
1580
+ "structured-output-retries": "structured-output-retries";
1581
+ "thread-rollback-failed": "thread-rollback-failed";
1582
+ "too-many-failed-attempts": "too-many-failed-attempts";
1583
+ billing: "billing";
1584
+ internal: "internal";
1585
+ overloaded: "overloaded";
1586
+ policy: "policy";
1587
+ sandbox: "sandbox";
1588
+ unauthorized: "unauthorized";
1589
+ unknown: "unknown";
1590
+ }>;
1591
+ httpStatusCode: z.ZodNullable<z.ZodNumber>;
1592
+ providerCode: z.ZodNullable<z.ZodString>;
1593
+ }, z.core.$strip>>;
1594
+ message: z.ZodString;
1595
+ providerThreadId: z.ZodString;
1596
+ threadId: z.ZodString;
1597
+ type: z.ZodLiteral<"provider/error">;
1598
+ willRetry: z.ZodOptional<z.ZodBoolean>;
1599
+ }, z.core.$strip>, z.ZodObject<{
1600
+ providerThreadId: z.ZodString;
1601
+ rateLimits: z.ZodObject<{
1602
+ kind: z.ZodEnum<{
1603
+ "spend-control": "spend-control";
1604
+ "subscription-window": "subscription-window";
1605
+ credits: "credits";
1606
+ unknown: "unknown";
1607
+ }>;
1608
+ overageReason: z.ZodNullable<z.ZodString>;
1609
+ overageStatus: z.ZodNullable<z.ZodEnum<{
1610
+ allowed: "allowed";
1611
+ rejected: "rejected";
1612
+ unavailable: "unavailable";
1613
+ warning: "warning";
1614
+ }>>;
1615
+ providerId: z.ZodString;
1616
+ reachedReason: z.ZodNullable<z.ZodString>;
1617
+ status: z.ZodEnum<{
1618
+ allowed: "allowed";
1619
+ blocked: "blocked";
1620
+ unknown: "unknown";
1621
+ warning: "warning";
1622
+ }>;
1623
+ windows: z.ZodArray<z.ZodObject<{
1624
+ label: z.ZodNullable<z.ZodString>;
1625
+ providerKey: z.ZodNullable<z.ZodString>;
1626
+ resetsAtMs: z.ZodNullable<z.ZodNumber>;
1627
+ status: z.ZodEnum<{
1628
+ allowed: "allowed";
1629
+ blocked: "blocked";
1630
+ unknown: "unknown";
1631
+ warning: "warning";
1632
+ }>;
1633
+ }, z.core.$strip>>;
1634
+ }, z.core.$strip>;
1635
+ threadId: z.ZodString;
1636
+ type: z.ZodLiteral<"provider/rateLimits/updated">;
1637
+ }, z.core.$strip>, z.ZodObject<{
1638
+ kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
1639
+ payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
1640
+ providerThreadId: z.ZodString;
1641
+ threadId: z.ZodString;
1642
+ type: z.ZodLiteral<"thread/extensionState/updated">;
1643
+ }, z.core.$strip>, z.ZodObject<{
1644
+ category: z.ZodEnum<{
1645
+ "compaction-skipped": "compaction-skipped";
1646
+ config: "config";
1647
+ deprecation: "deprecation";
1648
+ general: "general";
1649
+ }>;
1650
+ details: z.ZodOptional<z.ZodString>;
1651
+ providerThreadId: z.ZodString;
1652
+ summary: z.ZodOptional<z.ZodString>;
1653
+ threadId: z.ZodString;
1654
+ type: z.ZodLiteral<"provider/warning">;
1655
+ }, z.core.$strip>, z.ZodObject<{
1656
+ fallbackModel: z.ZodString;
1657
+ message: z.ZodString;
1658
+ originalModel: z.ZodString;
1659
+ providerThreadId: z.ZodString;
1660
+ reason: z.ZodEnum<{
1661
+ provider: "provider";
1662
+ refusal: "refusal";
1663
+ }>;
1664
+ threadId: z.ZodString;
1665
+ type: z.ZodLiteral<"provider/modelFallback">;
1666
+ }, z.core.$strip>, z.ZodObject<{
1667
+ parentToolCallId: z.ZodOptional<z.ZodString>;
1668
+ providerId: z.ZodString;
1669
+ providerThreadId: z.ZodString;
1670
+ rawEvent: z.ZodObject<{
1671
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
1672
+ jsonrpc: z.ZodLiteral<"2.0">;
1673
+ method: z.ZodString;
1674
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1675
+ }, z.core.$strip>;
1676
+ rawType: z.ZodString;
1677
+ threadId: z.ZodString;
1678
+ type: z.ZodLiteral<"provider/unhandled">;
1679
+ }, z.core.$strip>], "type">, z.ZodObject<{
1680
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1681
+ kind: z.ZodLiteral<"thread">;
1682
+ }, z.core.$strip>, z.ZodObject<{
1683
+ kind: z.ZodLiteral<"turn">;
1684
+ turnId: z.ZodString;
1685
+ }, z.core.$strip>], "kind">;
1686
+ }, z.core.$strip>>, z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
1687
+ direction: z.ZodLiteral<"outbound">;
1688
+ initiator: z.ZodEnum<{
1689
+ agent: "agent";
1690
+ system: "system";
1691
+ user: "user";
1692
+ }>;
1693
+ request: z.ZodObject<{
1694
+ method: z.ZodEnum<{
1695
+ "thread/start": "thread/start";
1696
+ "turn/start": "turn/start";
1697
+ }>;
1698
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1699
+ }, z.core.$strip>;
1700
+ source: z.ZodEnum<{
1701
+ spawn: "spawn";
1702
+ tell: "tell";
1703
+ }>;
1704
+ threadId: z.ZodString;
1705
+ type: z.ZodLiteral<"client/thread/start">;
1706
+ }, z.core.$strip>, z.ZodObject<{
1707
+ continuationOfRequestId: z.ZodOptional<z.ZodString>;
1708
+ direction: z.ZodLiteral<"outbound">;
1709
+ execution: z.ZodObject<{
1710
+ model: z.ZodString;
1711
+ permissionMode: z.ZodEnum<{
1712
+ "accept-edits": "accept-edits";
1713
+ "workspace-write": "workspace-write";
1714
+ auto: "auto";
1715
+ full: "full";
1716
+ readonly: "readonly";
1717
+ }>;
1718
+ reasoningLevel: z.ZodEnum<{
1719
+ high: "high";
1720
+ low: "low";
1721
+ max: "max";
1722
+ medium: "medium";
1723
+ none: "none";
1724
+ ultra: "ultra";
1725
+ ultracode: "ultracode";
1726
+ xhigh: "xhigh";
1727
+ }>;
1728
+ seq: z.ZodOptional<z.ZodNumber>;
1729
+ serviceTier: z.ZodEnum<{
1730
+ default: "default";
1731
+ fast: "fast";
1732
+ }>;
1733
+ source: z.ZodEnum<{
1734
+ "client/thread/start": "client/thread/start";
1735
+ "client/turn/requested": "client/turn/requested";
1736
+ "client/turn/start": "client/turn/start";
1737
+ }>;
1738
+ }, z.core.$strip>;
1739
+ initiator: z.ZodEnum<{
1740
+ agent: "agent";
1741
+ system: "system";
1742
+ user: "user";
1743
+ }>;
1744
+ input: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1745
+ mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1746
+ end: z.ZodNumber;
1747
+ resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1748
+ kind: z.ZodLiteral<"thread">;
1749
+ label: z.ZodString;
1750
+ projectId: z.ZodOptional<z.ZodString>;
1751
+ threadId: z.ZodString;
1752
+ }, z.core.$strip>, z.ZodObject<{
1753
+ kind: z.ZodLiteral<"project">;
1754
+ label: z.ZodString;
1755
+ projectId: z.ZodString;
1756
+ }, z.core.$strip>, z.ZodObject<{
1757
+ kind: z.ZodLiteral<"section">;
1758
+ label: z.ZodString;
1759
+ sectionId: z.ZodString;
1760
+ }, z.core.$strip>, z.ZodObject<{
1761
+ entryKind: z.ZodEnum<{
1762
+ directory: "directory";
1763
+ file: "file";
1764
+ }>;
1765
+ kind: z.ZodLiteral<"path">;
1766
+ label: z.ZodString;
1767
+ path: z.ZodString;
1768
+ source: z.ZodEnum<{
1769
+ "thread-storage": "thread-storage";
1770
+ workspace: "workspace";
1771
+ }>;
1772
+ }, z.core.$strip>, z.ZodObject<{
1773
+ argumentHint: z.ZodNullable<z.ZodString>;
1774
+ kind: z.ZodLiteral<"command">;
1775
+ label: z.ZodString;
1776
+ name: z.ZodString;
1777
+ origin: z.ZodEnum<{
1778
+ builtin: "builtin";
1779
+ project: "project";
1780
+ user: "user";
1781
+ }>;
1782
+ source: z.ZodEnum<{
1783
+ command: "command";
1784
+ skill: "skill";
1785
+ }>;
1786
+ trigger: z.ZodEnum<{
1787
+ "/": "/";
1788
+ }>;
1789
+ }, z.core.$strip>, z.ZodObject<{
1790
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1791
+ itemId: z.ZodString;
1792
+ kind: z.ZodLiteral<"plugin">;
1793
+ label: z.ZodString;
1794
+ pluginId: z.ZodString;
1795
+ }, z.core.$strip>], "kind">>;
1796
+ start: z.ZodNumber;
1797
+ }, z.core.$strip>>>;
1798
+ text: z.ZodString;
1799
+ type: z.ZodLiteral<"text">;
1800
+ visibility: z.ZodOptional<z.ZodEnum<{
1801
+ "agent-only": "agent-only";
1802
+ }>>;
1803
+ }, z.core.$strip>, z.ZodObject<{
1804
+ type: z.ZodLiteral<"image">;
1805
+ url: z.ZodString;
1806
+ visibility: z.ZodOptional<z.ZodEnum<{
1807
+ "agent-only": "agent-only";
1808
+ }>>;
1809
+ }, z.core.$strip>, z.ZodObject<{
1810
+ path: z.ZodString;
1811
+ type: z.ZodLiteral<"localImage">;
1812
+ visibility: z.ZodOptional<z.ZodEnum<{
1813
+ "agent-only": "agent-only";
1814
+ }>>;
1815
+ }, z.core.$strip>, z.ZodObject<{
1816
+ mimeType: z.ZodOptional<z.ZodString>;
1817
+ name: z.ZodOptional<z.ZodString>;
1818
+ path: z.ZodString;
1819
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
1820
+ type: z.ZodLiteral<"localFile">;
1821
+ visibility: z.ZodOptional<z.ZodEnum<{
1822
+ "agent-only": "agent-only";
1823
+ }>>;
1824
+ }, z.core.$strip>], "type">>;
1825
+ inputGroups: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1826
+ mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1827
+ end: z.ZodNumber;
1828
+ resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
1829
+ kind: z.ZodLiteral<"thread">;
1830
+ label: z.ZodString;
1831
+ projectId: z.ZodOptional<z.ZodString>;
1832
+ threadId: z.ZodString;
1833
+ }, z.core.$strip>, z.ZodObject<{
1834
+ kind: z.ZodLiteral<"project">;
1835
+ label: z.ZodString;
1836
+ projectId: z.ZodString;
1837
+ }, z.core.$strip>, z.ZodObject<{
1838
+ kind: z.ZodLiteral<"section">;
1839
+ label: z.ZodString;
1840
+ sectionId: z.ZodString;
1841
+ }, z.core.$strip>, z.ZodObject<{
1842
+ entryKind: z.ZodEnum<{
1843
+ directory: "directory";
1844
+ file: "file";
1845
+ }>;
1846
+ kind: z.ZodLiteral<"path">;
1847
+ label: z.ZodString;
1848
+ path: z.ZodString;
1849
+ source: z.ZodEnum<{
1850
+ "thread-storage": "thread-storage";
1851
+ workspace: "workspace";
1852
+ }>;
1853
+ }, z.core.$strip>, z.ZodObject<{
1854
+ argumentHint: z.ZodNullable<z.ZodString>;
1855
+ kind: z.ZodLiteral<"command">;
1856
+ label: z.ZodString;
1857
+ name: z.ZodString;
1858
+ origin: z.ZodEnum<{
1859
+ builtin: "builtin";
1860
+ project: "project";
1861
+ user: "user";
1862
+ }>;
1863
+ source: z.ZodEnum<{
1864
+ command: "command";
1865
+ skill: "skill";
1866
+ }>;
1867
+ trigger: z.ZodEnum<{
1868
+ "/": "/";
1869
+ }>;
1870
+ }, z.core.$strip>, z.ZodObject<{
1871
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1872
+ itemId: z.ZodString;
1873
+ kind: z.ZodLiteral<"plugin">;
1874
+ label: z.ZodString;
1875
+ pluginId: z.ZodString;
1876
+ }, z.core.$strip>], "kind">>;
1877
+ start: z.ZodNumber;
1878
+ }, z.core.$strip>>>;
1879
+ text: z.ZodString;
1880
+ type: z.ZodLiteral<"text">;
1881
+ visibility: z.ZodOptional<z.ZodEnum<{
1882
+ "agent-only": "agent-only";
1883
+ }>>;
1884
+ }, z.core.$strip>, z.ZodObject<{
1885
+ type: z.ZodLiteral<"image">;
1886
+ url: z.ZodString;
1887
+ visibility: z.ZodOptional<z.ZodEnum<{
1888
+ "agent-only": "agent-only";
1889
+ }>>;
1890
+ }, z.core.$strip>, z.ZodObject<{
1891
+ path: z.ZodString;
1892
+ type: z.ZodLiteral<"localImage">;
1893
+ visibility: z.ZodOptional<z.ZodEnum<{
1894
+ "agent-only": "agent-only";
1895
+ }>>;
1896
+ }, z.core.$strip>, z.ZodObject<{
1897
+ mimeType: z.ZodOptional<z.ZodString>;
1898
+ name: z.ZodOptional<z.ZodString>;
1899
+ path: z.ZodString;
1900
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
1901
+ type: z.ZodLiteral<"localFile">;
1902
+ visibility: z.ZodOptional<z.ZodEnum<{
1903
+ "agent-only": "agent-only";
1904
+ }>>;
1905
+ }, z.core.$strip>], "type">>>>;
1906
+ request: z.ZodObject<{
1907
+ method: z.ZodEnum<{
1908
+ "thread/start": "thread/start";
1909
+ "turn/start": "turn/start";
1910
+ }>;
1911
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1912
+ }, z.core.$strip>;
1913
+ requestId: z.ZodString;
1914
+ senderThreadId: z.ZodNullable<z.ZodString>;
1915
+ source: z.ZodEnum<{
1916
+ spawn: "spawn";
1917
+ tell: "tell";
1918
+ }>;
1919
+ systemMessageKind: z.ZodOptional<z.ZodEnum<{
1920
+ "child-completed": "child-completed";
1921
+ "child-failed": "child-failed";
1922
+ "child-interrupted": "child-interrupted";
1923
+ "child-needs-attention": "child-needs-attention";
1924
+ "child-outcome-batch": "child-outcome-batch";
1925
+ "ownership-assigned": "ownership-assigned";
1926
+ "ownership-removed": "ownership-removed";
1927
+ unlabeled: "unlabeled";
1928
+ }>>;
1929
+ systemMessageSubject: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1930
+ kind: z.ZodLiteral<"thread">;
1931
+ threadId: z.ZodString;
1932
+ threadName: z.ZodString;
1933
+ }, z.core.$strip>, z.ZodObject<{
1934
+ count: z.ZodNumber;
1935
+ kind: z.ZodLiteral<"thread-batch">;
1936
+ }, z.core.$strip>], "kind">>>;
1937
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
1938
+ kind: z.ZodLiteral<"thread-start">;
1939
+ }, z.core.$strip>, z.ZodObject<{
1940
+ kind: z.ZodLiteral<"new-turn">;
1941
+ }, z.core.$strip>, z.ZodObject<{
1942
+ expectedTurnId: z.ZodNullable<z.ZodString>;
1943
+ kind: z.ZodLiteral<"auto">;
1944
+ }, z.core.$strip>, z.ZodObject<{
1945
+ expectedTurnId: z.ZodNullable<z.ZodString>;
1946
+ kind: z.ZodLiteral<"steer">;
1947
+ }, z.core.$strip>], "kind">;
1948
+ threadId: z.ZodString;
1949
+ type: z.ZodLiteral<"client/turn/requested">;
1950
+ }, z.core.$strip>, z.ZodObject<{
1951
+ message: z.ZodString;
1952
+ reason: z.ZodString;
1953
+ requestId: z.ZodString;
1954
+ threadId: z.ZodString;
1955
+ type: z.ZodLiteral<"client/turn/rejected">;
1956
+ }, z.core.$strip>, z.ZodObject<{
1957
+ direction: z.ZodLiteral<"outbound">;
1958
+ initiator: z.ZodEnum<{
1959
+ agent: "agent";
1960
+ system: "system";
1961
+ user: "user";
1962
+ }>;
1963
+ request: z.ZodObject<{
1964
+ method: z.ZodEnum<{
1965
+ "thread/start": "thread/start";
1966
+ "turn/start": "turn/start";
1967
+ }>;
1968
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1969
+ }, z.core.$strip>;
1970
+ source: z.ZodEnum<{
1971
+ spawn: "spawn";
1972
+ tell: "tell";
1973
+ }>;
1974
+ threadId: z.ZodString;
1975
+ type: z.ZodLiteral<"client/turn/start">;
1976
+ }, z.core.$strip>, z.ZodObject<{
1977
+ code: z.ZodOptional<z.ZodString>;
1978
+ detail: z.ZodOptional<z.ZodString>;
1979
+ message: z.ZodString;
1980
+ reconnectAttempt: z.ZodOptional<z.ZodNumber>;
1981
+ reconnectTotal: z.ZodOptional<z.ZodNumber>;
1982
+ threadId: z.ZodString;
1983
+ type: z.ZodLiteral<"system/error">;
1984
+ }, z.core.$strip>, z.ZodObject<{
1985
+ text: z.ZodString;
1986
+ threadId: z.ZodString;
1987
+ toolCallId: z.ZodOptional<z.ZodString>;
1988
+ turnId: z.ZodOptional<z.ZodString>;
1989
+ type: z.ZodLiteral<"system/manager/user_message">;
1990
+ }, z.core.$strip>, z.ZodObject<{
1991
+ reason: z.ZodEnum<{
1992
+ "host-daemon-restarted": "host-daemon-restarted";
1993
+ "manual-stop": "manual-stop";
1994
+ "provider-turn-idle": "provider-turn-idle";
1995
+ }>;
1996
+ threadId: z.ZodString;
1997
+ type: z.ZodLiteral<"system/thread/interrupted">;
1998
+ }, z.core.$strip>, z.ZodObject<{
1999
+ message: z.ZodString;
2000
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
2001
+ operation: z.ZodString;
2002
+ operationId: z.ZodString;
2003
+ status: z.ZodString;
2004
+ threadId: z.ZodString;
2005
+ type: z.ZodLiteral<"system/operation">;
2006
+ }, z.core.$strip>, z.ZodObject<{
2007
+ interactionId: z.ZodString;
2008
+ providerId: z.ZodString;
2009
+ providerRequestId: z.ZodString;
2010
+ resolution: z.ZodDefault<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
2011
+ decision: z.ZodLiteral<"allow_once">;
2012
+ grantedPermissions: z.ZodNullable<z.ZodObject<{
2013
+ fileSystem: z.ZodNullable<z.ZodObject<{
2014
+ read: z.ZodArray<z.ZodString>;
2015
+ write: z.ZodArray<z.ZodString>;
2016
+ }, z.core.$strip>>;
2017
+ network: z.ZodNullable<z.ZodObject<{
2018
+ enabled: z.ZodNullable<z.ZodBoolean>;
2019
+ }, z.core.$strip>>;
2020
+ }, z.core.$strict>>;
2021
+ }, z.core.$strip>, z.ZodObject<{
2022
+ decision: z.ZodLiteral<"allow_for_session">;
2023
+ grantedPermissions: z.ZodNullable<z.ZodObject<{
2024
+ fileSystem: z.ZodNullable<z.ZodObject<{
2025
+ read: z.ZodArray<z.ZodString>;
2026
+ write: z.ZodArray<z.ZodString>;
2027
+ }, z.core.$strip>>;
2028
+ network: z.ZodNullable<z.ZodObject<{
2029
+ enabled: z.ZodNullable<z.ZodBoolean>;
2030
+ }, z.core.$strip>>;
2031
+ }, z.core.$strict>>;
2032
+ }, z.core.$strip>, z.ZodObject<{
2033
+ decision: z.ZodLiteral<"deny">;
2034
+ }, z.core.$strip>], "decision">>>;
2035
+ status: z.ZodEnum<{
2036
+ interrupted: "interrupted";
2037
+ pending: "pending";
2038
+ resolved: "resolved";
2039
+ resolving: "resolving";
2040
+ }>;
2041
+ statusReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2042
+ subject: z.ZodObject<{
2043
+ itemId: z.ZodString;
2044
+ kind: z.ZodLiteral<"permission_grant">;
2045
+ permissions: z.ZodObject<{
2046
+ fileSystem: z.ZodNullable<z.ZodObject<{
2047
+ read: z.ZodArray<z.ZodString>;
2048
+ write: z.ZodArray<z.ZodString>;
2049
+ }, z.core.$strip>>;
2050
+ network: z.ZodNullable<z.ZodObject<{
2051
+ enabled: z.ZodNullable<z.ZodBoolean>;
2052
+ }, z.core.$strip>>;
2053
+ }, z.core.$strict>;
2054
+ toolName: z.ZodNullable<z.ZodString>;
2055
+ }, z.core.$strip>;
2056
+ threadId: z.ZodString;
2057
+ type: z.ZodLiteral<"system/permissionGrant/lifecycle">;
2058
+ }, z.core.$strip>, z.ZodObject<{
2059
+ interactionId: z.ZodString;
2060
+ payload: z.ZodObject<{
2061
+ kind: z.ZodLiteral<"user_question">;
2062
+ questions: z.ZodArray<z.ZodObject<{
2063
+ allowFreeText: z.ZodBoolean;
2064
+ id: z.ZodString;
2065
+ multiSelect: z.ZodBoolean;
2066
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
2067
+ description: z.ZodOptional<z.ZodString>;
2068
+ label: z.ZodString;
2069
+ value: z.ZodString;
2070
+ }, z.core.$strip>>>;
2071
+ prompt: z.ZodString;
2072
+ shortLabel: z.ZodOptional<z.ZodString>;
2073
+ }, z.core.$strip>>;
2074
+ }, z.core.$strip>;
2075
+ providerId: z.ZodString;
2076
+ providerRequestId: z.ZodString;
2077
+ resolution: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2078
+ answers: z.ZodRecord<z.ZodString, z.ZodObject<{
2079
+ freeText: z.ZodOptional<z.ZodString>;
2080
+ selected: z.ZodArray<z.ZodString>;
2081
+ }, z.core.$strip>>;
2082
+ kind: z.ZodLiteral<"user_answer">;
2083
+ }, z.core.$strip>>>;
2084
+ status: z.ZodEnum<{
2085
+ interrupted: "interrupted";
2086
+ pending: "pending";
2087
+ resolved: "resolved";
2088
+ resolving: "resolving";
2089
+ }>;
2090
+ statusReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2091
+ threadId: z.ZodString;
2092
+ type: z.ZodLiteral<"system/userQuestion/lifecycle">;
2093
+ }, z.core.$strip>, z.ZodObject<{
2094
+ entries: z.ZodArray<z.ZodObject<{
2095
+ key: z.ZodString;
2096
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2097
+ startedAt: z.ZodOptional<z.ZodNumber>;
2098
+ status: z.ZodOptional<z.ZodEnum<{
2099
+ completed: "completed";
2100
+ failed: "failed";
2101
+ started: "started";
2102
+ }>>;
2103
+ text: z.ZodString;
2104
+ type: z.ZodEnum<{
2105
+ output: "output";
2106
+ step: "step";
2107
+ }>;
2108
+ }, z.core.$strip>>;
2109
+ environmentId: z.ZodString;
2110
+ provisioningId: z.ZodString;
2111
+ status: z.ZodEnum<{
2112
+ active: "active";
2113
+ cancelled: "cancelled";
2114
+ completed: "completed";
2115
+ failed: "failed";
2116
+ }>;
2117
+ threadId: z.ZodString;
2118
+ type: z.ZodLiteral<"system/thread-provisioning">;
2119
+ }, z.core.$strip>, z.ZodObject<{
2120
+ activeTurnId: z.ZodString;
2121
+ activeTurnStartedAt: z.ZodNumber;
2122
+ elapsedMs: z.ZodNumber;
2123
+ firedAt: z.ZodNumber;
2124
+ lastActivityEventAt: z.ZodNumber;
2125
+ lastActivityEventSequence: z.ZodNumber;
2126
+ lastActivityEventType: z.ZodString;
2127
+ providerId: z.ZodString;
2128
+ providerThreadId: z.ZodNullable<z.ZodString>;
2129
+ reason: z.ZodLiteral<"provider-turn-idle">;
2130
+ threadId: z.ZodString;
2131
+ thresholdMs: z.ZodNumber;
2132
+ type: z.ZodLiteral<"system/provider-turn-watchdog">;
2133
+ }, z.core.$strip>], "type">, z.ZodObject<{
2134
+ scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
2135
+ kind: z.ZodLiteral<"thread">;
2136
+ }, z.core.$strip>, z.ZodObject<{
2137
+ kind: z.ZodLiteral<"turn">;
2138
+ turnId: z.ZodString;
2139
+ }, z.core.$strip>], "kind">;
2140
+ }, z.core.$strip>>]>>;
2141
+ type ThreadEvent = z.infer<typeof threadEventSchema>;
2142
+
2143
+ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2144
+ mentions: z.ZodDefault<z.ZodArray<z.ZodObject<{
2145
+ end: z.ZodNumber;
2146
+ resource: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
2147
+ kind: z.ZodLiteral<"thread">;
2148
+ label: z.ZodString;
2149
+ projectId: z.ZodOptional<z.ZodString>;
2150
+ threadId: z.ZodString;
2151
+ }, z.core.$strip>, z.ZodObject<{
2152
+ kind: z.ZodLiteral<"project">;
2153
+ label: z.ZodString;
2154
+ projectId: z.ZodString;
2155
+ }, z.core.$strip>, z.ZodObject<{
2156
+ kind: z.ZodLiteral<"section">;
2157
+ label: z.ZodString;
2158
+ sectionId: z.ZodString;
2159
+ }, z.core.$strip>, z.ZodObject<{
2160
+ entryKind: z.ZodEnum<{
2161
+ directory: "directory";
2162
+ file: "file";
2163
+ }>;
2164
+ kind: z.ZodLiteral<"path">;
2165
+ label: z.ZodString;
2166
+ path: z.ZodString;
2167
+ source: z.ZodEnum<{
2168
+ "thread-storage": "thread-storage";
2169
+ workspace: "workspace";
2170
+ }>;
2171
+ }, z.core.$strip>, z.ZodObject<{
2172
+ argumentHint: z.ZodNullable<z.ZodString>;
2173
+ kind: z.ZodLiteral<"command">;
2174
+ label: z.ZodString;
2175
+ name: z.ZodString;
2176
+ origin: z.ZodEnum<{
2177
+ builtin: "builtin";
2178
+ project: "project";
2179
+ user: "user";
2180
+ }>;
2181
+ source: z.ZodEnum<{
2182
+ command: "command";
2183
+ skill: "skill";
2184
+ }>;
2185
+ trigger: z.ZodEnum<{
2186
+ "/": "/";
2187
+ }>;
2188
+ }, z.core.$strip>, z.ZodObject<{
2189
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2190
+ itemId: z.ZodString;
2191
+ kind: z.ZodLiteral<"plugin">;
2192
+ label: z.ZodString;
2193
+ pluginId: z.ZodString;
2194
+ }, z.core.$strip>], "kind">>;
2195
+ start: z.ZodNumber;
2196
+ }, z.core.$strip>>>;
2197
+ text: z.ZodString;
2198
+ type: z.ZodLiteral<"text">;
2199
+ visibility: z.ZodOptional<z.ZodEnum<{
2200
+ "agent-only": "agent-only";
2201
+ }>>;
2202
+ }, z.core.$strip>, z.ZodObject<{
2203
+ type: z.ZodLiteral<"image">;
2204
+ url: z.ZodString;
2205
+ visibility: z.ZodOptional<z.ZodEnum<{
2206
+ "agent-only": "agent-only";
2207
+ }>>;
2208
+ }, z.core.$strip>, z.ZodObject<{
2209
+ path: z.ZodString;
2210
+ type: z.ZodLiteral<"localImage">;
2211
+ visibility: z.ZodOptional<z.ZodEnum<{
2212
+ "agent-only": "agent-only";
2213
+ }>>;
2214
+ }, z.core.$strip>, z.ZodObject<{
2215
+ mimeType: z.ZodOptional<z.ZodString>;
2216
+ name: z.ZodOptional<z.ZodString>;
2217
+ path: z.ZodString;
2218
+ sizeBytes: z.ZodOptional<z.ZodNumber>;
2219
+ type: z.ZodLiteral<"localFile">;
2220
+ visibility: z.ZodOptional<z.ZodEnum<{
2221
+ "agent-only": "agent-only";
2222
+ }>>;
2223
+ }, z.core.$strip>], "type">;
2224
+ type PromptInput = z.infer<typeof promptInputSchema>;
2225
+
2226
+ /**
2227
+ * Transport abstraction the conformance kit drives. Black-box at the message
2228
+ * level: lines in, JSON-RPC messages out. Two expected implementations — an
2229
+ * in-process bridge (`send` = the bridge's exported line handler,
2230
+ * `takeMessages` drains a captured-output buffer) and a spawned bridge binary
2231
+ * (stdin write + stdout readline). The kit never sees which.
2232
+ */
2233
+ interface BridgeConformanceTransport {
2234
+ /** Deliver one raw line to the bridge. */
2235
+ send(line: string): void;
2236
+ /** Drain every message the bridge emitted since the last call. */
2237
+ takeMessages(): unknown[];
2238
+ close?(): Promise<void> | void;
2239
+ }
2240
+ /**
2241
+ * The kit-internal assembled-event lane. The wire carries `thread/delta`, but
2242
+ * the grammar checks run over canonical `ThreadEvent`s, so a conformance
2243
+ * transport assembles the bridge's deltas (through the runtime's real delta
2244
+ * assembler) and re-emits each assembled event as a notification with this
2245
+ * method and `{ threadId, event }` params. It is not a protocol method — it
2246
+ * exists only between a conformance transport and this kit.
2247
+ */
2248
+ declare const CONFORMANCE_ASSEMBLED_EVENT_METHOD = "conformance/assembledEvent";
2249
+ type ConformanceStatus = "fail" | "pass" | "skipped";
2250
+ interface ConformanceCheckResult {
2251
+ /** Stable rule id, e.g. "rpc/unknown-method". */
2252
+ id: string;
2253
+ title: string;
2254
+ status: ConformanceStatus;
2255
+ /** Failure or skip explanation; empty on pass. */
2256
+ detail: string;
2257
+ }
2258
+ interface ConformanceReport {
2259
+ results: ConformanceCheckResult[];
2260
+ passed: boolean;
2261
+ }
2262
+
2263
+ interface JsonRpcWireMessage {
2264
+ jsonrpc?: unknown;
2265
+ id?: string | number;
2266
+ method?: string;
2267
+ params?: unknown;
2268
+ result?: unknown;
2269
+ error?: {
2270
+ code?: unknown;
2271
+ message?: unknown;
2272
+ };
2273
+ }
2274
+ /**
2275
+ * A polling JSON-RPC client over a conformance transport. Accumulates every
2276
+ * message the bridge emits (responses, notifications, bridge-initiated
2277
+ * requests) into one ordered log so grammar checks can assert sequences.
2278
+ */
2279
+ declare class ConformanceClient {
2280
+ private readonly transport;
2281
+ private readonly timeoutMs;
2282
+ private nextId;
2283
+ readonly log: JsonRpcWireMessage[];
2284
+ constructor(transport: BridgeConformanceTransport, timeoutMs: number);
2285
+ drainIntoLog(): void;
2286
+ sendRaw(line: string): void;
2287
+ notify(method: string, params?: unknown): void;
2288
+ request(method: string, params?: unknown): number;
2289
+ /** Poll until `resolve` yields a value or the deadline passes (→ null). */
2290
+ waitFor<T>(resolve: () => T | undefined): Promise<T | null>;
2291
+ waitForResponse(id: number): Promise<JsonRpcWireMessage | null>;
2292
+ /** A settle window: drain for the given quiet period without expectations. */
2293
+ settle(quietMs: number): Promise<void>;
2294
+ responsesFor(id: number): JsonRpcWireMessage[];
2295
+ notifications(method?: string): JsonRpcWireMessage[];
2296
+ }
2297
+
2298
+ interface ConformanceSessionFixture {
2299
+ /** Workspace directory for the session under test. */
2300
+ cwd: string;
2301
+ /** Prompt expected to elicit at least one assistant-message item. */
2302
+ promptInput: PromptInput[];
2303
+ /**
2304
+ * A prompt this provider accepts and completes locally, without producing
2305
+ * any of the activity that opens a bb turn — Claude Code's `/clear` is the
2306
+ * canonical example (#1431). Opting in enables
2307
+ * `turn/settles-without-activity`.
2308
+ *
2309
+ * The kit cannot elicit this shape generically: only the bridge knows what
2310
+ * its provider handles as zero work. A fixture that omits it produces no
2311
+ * result for that rule rather than a skip, so bridges that have not opted in
2312
+ * keep a fully green report.
2313
+ */
2314
+ zeroWorkPromptInput?: PromptInput[];
2315
+ /** Execution options for the session; the kit defaults to full mode. */
2316
+ options?: Record<string, unknown>;
2317
+ }
2318
+ /**
2319
+ * item/opens-before-delta: no event may stream into an item id that no
2320
+ * item/started has opened yet. Pure over an event log so it is unit-testable
2321
+ * without a live bridge — the streaming grammar machine the host runs live,
2322
+ * fed a recording and filtered to this one rule.
2323
+ */
2324
+ declare function checkItemOpensBeforeDelta(events: ThreadEvent[]): ConformanceCheckResult;
2325
+
2326
+ interface RunBridgeConformanceOptions {
2327
+ transport: BridgeConformanceTransport;
2328
+ session: ConformanceSessionFixture;
2329
+ /** Per-wait timeout. Conformant bridges answer fast; keep this tight. */
2330
+ timeoutMs?: number;
2331
+ }
2332
+ /**
2333
+ * Drive one bridge through the conformance scenarios: JSON-RPC hygiene, the
2334
+ * initialize handshake, then a shared session lifecycle (start → turn →
2335
+ * grammar checks → release stop → resume → id-uniqueness). One transport for
2336
+ * the whole run, mirroring a real bridge lifetime.
2337
+ *
2338
+ * Against a conformant bridge every result passes. Against a bridge that is
2339
+ * not yet protocol-pure, the failures ARE the migration work list — run it
2340
+ * before migrating and pin the report, then make it shrink.
2341
+ */
2342
+ declare function runBridgeConformance(options: RunBridgeConformanceOptions): Promise<ConformanceReport>;
2343
+ /** Compact single-line-per-rule rendering for test snapshots and logs. */
2344
+ declare function formatConformanceReport(report: ConformanceReport): string;
2345
+
2346
+ /**
2347
+ * The inclusive `[min, max]` range of `thread/delta` grammar versions a bridge
2348
+ * speaks. Distinct from the JSON-RPC `protocolVersion`: the envelope can stay
2349
+ * put while the delta vocabulary grows, and a bridge that speaks both v2 and
2350
+ * v3 says so here instead of forcing a daemon bump.
2351
+ */
2352
+ declare const bridgeGrammarVersionsSchema: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
2353
+ type BridgeGrammarVersions = z.infer<typeof bridgeGrammarVersionsSchema>;
2354
+
2355
+ declare const threadDeltaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2356
+ clientRequestId: z.ZodString;
2357
+ kind: z.ZodLiteral<"input.accepted">;
2358
+ providerTurnId: z.ZodOptional<z.ZodString>;
2359
+ }, z.core.$strip>, z.ZodObject<{
2360
+ kind: z.ZodLiteral<"turn.open">;
2361
+ parentRef: z.ZodOptional<z.ZodString>;
2362
+ providerTurnId: z.ZodOptional<z.ZodString>;
2363
+ }, z.core.$strip>, z.ZodObject<{
2364
+ claimIfIdle: z.ZodOptional<z.ZodBoolean>;
2365
+ error: z.ZodOptional<z.ZodObject<{
2366
+ message: z.ZodString;
2367
+ }, z.core.$strip>>;
2368
+ kind: z.ZodLiteral<"turn.boundary">;
2369
+ providerCheckpointId: z.ZodOptional<z.ZodString>;
2370
+ providerTurnId: z.ZodOptional<z.ZodString>;
2371
+ status: z.ZodEnum<{
2372
+ completed: "completed";
2373
+ failed: "failed";
2374
+ interrupted: "interrupted";
2375
+ }>;
2376
+ }, z.core.$strip>, z.ZodObject<{
2377
+ attach: z.ZodOptional<z.ZodEnum<{
2378
+ currentOrLast: "currentOrLast";
2379
+ open: "open";
2380
+ }>>;
2381
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
2382
+ aggregatedOutput: z.ZodOptional<z.ZodString>;
2383
+ command: z.ZodString;
2384
+ cwd: z.ZodString;
2385
+ durationMs: z.ZodOptional<z.ZodNumber>;
2386
+ exitCode: z.ZodOptional<z.ZodNumber>;
2387
+ type: z.ZodLiteral<"command">;
2388
+ }, z.core.$strip>, z.ZodObject<{
2389
+ changes: z.ZodArray<z.ZodObject<{
2390
+ diff: z.ZodOptional<z.ZodString>;
2391
+ kind: z.ZodEnum<{
2392
+ add: "add";
2393
+ delete: "delete";
2394
+ update: "update";
2395
+ }>;
2396
+ movePath: z.ZodOptional<z.ZodString>;
2397
+ newText: z.ZodOptional<z.ZodString>;
2398
+ oldText: z.ZodOptional<z.ZodString>;
2399
+ path: z.ZodString;
2400
+ }, z.core.$strip>>;
2401
+ type: z.ZodLiteral<"fileChange">;
2402
+ }, z.core.$strip>, z.ZodObject<{
2403
+ args: z.ZodOptional<z.ZodUnknown>;
2404
+ durationMs: z.ZodOptional<z.ZodNumber>;
2405
+ error: z.ZodOptional<z.ZodString>;
2406
+ result: z.ZodOptional<z.ZodUnknown>;
2407
+ server: z.ZodOptional<z.ZodString>;
2408
+ tool: z.ZodString;
2409
+ type: z.ZodLiteral<"tool">;
2410
+ }, z.core.$strip>, z.ZodObject<{
2411
+ type: z.ZodLiteral<"compaction">;
2412
+ }, z.core.$strip>, z.ZodObject<{
2413
+ text: z.ZodString;
2414
+ type: z.ZodLiteral<"agentMessage">;
2415
+ }, z.core.$strip>, z.ZodObject<{
2416
+ content: z.ZodArray<z.ZodString>;
2417
+ summary: z.ZodArray<z.ZodString>;
2418
+ type: z.ZodLiteral<"reasoning">;
2419
+ }, z.core.$strip>, z.ZodObject<{
2420
+ text: z.ZodString;
2421
+ type: z.ZodLiteral<"plan">;
2422
+ }, z.core.$strip>, z.ZodObject<{
2423
+ queries: z.ZodArray<z.ZodString>;
2424
+ type: z.ZodLiteral<"webSearch">;
2425
+ }, z.core.$strip>, z.ZodObject<{
2426
+ pattern: z.ZodNullable<z.ZodString>;
2427
+ prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2428
+ type: z.ZodLiteral<"webFetch">;
2429
+ url: z.ZodString;
2430
+ }, z.core.$strip>, z.ZodObject<{
2431
+ path: z.ZodString;
2432
+ type: z.ZodLiteral<"imageView">;
2433
+ }, z.core.$strip>, z.ZodObject<{
2434
+ description: z.ZodString;
2435
+ error: z.ZodOptional<z.ZodString>;
2436
+ familyId: z.ZodString;
2437
+ outputFile: z.ZodOptional<z.ZodString>;
2438
+ skipTranscript: z.ZodBoolean;
2439
+ status: z.ZodEnum<{
2440
+ completed: "completed";
2441
+ failed: "failed";
2442
+ interrupted: "interrupted";
2443
+ pending: "pending";
2444
+ }>;
2445
+ summary: z.ZodOptional<z.ZodString>;
2446
+ taskStatus: z.ZodEnum<{
2447
+ completed: "completed";
2448
+ failed: "failed";
2449
+ killed: "killed";
2450
+ paused: "paused";
2451
+ pending: "pending";
2452
+ running: "running";
2453
+ stopped: "stopped";
2454
+ }>;
2455
+ taskType: z.ZodString;
2456
+ type: z.ZodLiteral<"backgroundTask">;
2457
+ usage: z.ZodOptional<z.ZodObject<{
2458
+ durationMs: z.ZodNumber;
2459
+ toolUses: z.ZodNumber;
2460
+ totalTokens: z.ZodNumber;
2461
+ }, z.core.$strip>>;
2462
+ workflow: z.ZodOptional<z.ZodObject<{
2463
+ agents: z.ZodArray<z.ZodObject<{
2464
+ agentType: z.ZodOptional<z.ZodString>;
2465
+ attempt: z.ZodNumber;
2466
+ cached: z.ZodBoolean;
2467
+ durationMs: z.ZodOptional<z.ZodNumber>;
2468
+ error: z.ZodOptional<z.ZodString>;
2469
+ index: z.ZodNumber;
2470
+ isolation: z.ZodOptional<z.ZodString>;
2471
+ label: z.ZodString;
2472
+ lastProgressAt: z.ZodNumber;
2473
+ lastToolName: z.ZodOptional<z.ZodString>;
2474
+ lastToolSummary: z.ZodOptional<z.ZodString>;
2475
+ model: z.ZodString;
2476
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
2477
+ phaseTitle: z.ZodOptional<z.ZodString>;
2478
+ promptPreview: z.ZodOptional<z.ZodString>;
2479
+ queuedAt: z.ZodOptional<z.ZodNumber>;
2480
+ resultPreview: z.ZodOptional<z.ZodString>;
2481
+ startedAt: z.ZodOptional<z.ZodNumber>;
2482
+ state: z.ZodEnum<{
2483
+ done: "done";
2484
+ failed: "failed";
2485
+ queued: "queued";
2486
+ running: "running";
2487
+ skipped: "skipped";
2488
+ }>;
2489
+ tokens: z.ZodOptional<z.ZodNumber>;
2490
+ toolCalls: z.ZodOptional<z.ZodNumber>;
2491
+ }, z.core.$strip>>;
2492
+ phases: z.ZodArray<z.ZodObject<{
2493
+ index: z.ZodNumber;
2494
+ kind: z.ZodOptional<z.ZodString>;
2495
+ title: z.ZodString;
2496
+ }, z.core.$strip>>;
2497
+ }, z.core.$strip>>;
2498
+ workflowName: z.ZodOptional<z.ZodString>;
2499
+ }, z.core.$strip>, z.ZodObject<{
2500
+ cmd: z.ZodOptional<z.ZodString>;
2501
+ path: z.ZodString;
2502
+ type: z.ZodLiteral<"fileRead">;
2503
+ }, z.core.$strip>, z.ZodObject<{
2504
+ cmd: z.ZodOptional<z.ZodString>;
2505
+ mode: z.ZodEnum<{
2506
+ content: "content";
2507
+ list: "list";
2508
+ path: "path";
2509
+ }>;
2510
+ path: z.ZodOptional<z.ZodString>;
2511
+ query: z.ZodString;
2512
+ type: z.ZodLiteral<"search">;
2513
+ }, z.core.$strip>, z.ZodObject<{
2514
+ background: z.ZodBoolean;
2515
+ childRef: z.ZodString;
2516
+ label: z.ZodString;
2517
+ summary: z.ZodOptional<z.ZodString>;
2518
+ type: z.ZodLiteral<"delegation">;
2519
+ }, z.core.$strip>, z.ZodObject<{
2520
+ explanation: z.ZodOptional<z.ZodString>;
2521
+ steps: z.ZodArray<z.ZodObject<{
2522
+ status: z.ZodOptional<z.ZodEnum<{
2523
+ active: "active";
2524
+ completed: "completed";
2525
+ failed: "failed";
2526
+ pending: "pending";
2527
+ }>>;
2528
+ step: z.ZodString;
2529
+ }, z.core.$strip>>;
2530
+ type: z.ZodLiteral<"planSteps">;
2531
+ }, z.core.$strip>, z.ZodObject<{
2532
+ kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
2533
+ payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
2534
+ type: z.ZodLiteral<"extension">;
2535
+ }, z.core.$strip>], "type">;
2536
+ key: z.ZodObject<{
2537
+ channel: z.ZodOptional<z.ZodString>;
2538
+ parentRef: z.ZodOptional<z.ZodString>;
2539
+ providerItemId: z.ZodOptional<z.ZodString>;
2540
+ }, z.core.$strip>;
2541
+ kind: z.ZodLiteral<"item.open">;
2542
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2543
+ raw: z.ZodObject<{
2544
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2545
+ jsonrpc: z.ZodLiteral<"2.0">;
2546
+ method: z.ZodString;
2547
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2548
+ }, z.core.$strip>;
2549
+ rawType: z.ZodString;
2550
+ }, z.core.$strip>>;
2551
+ presentation: z.ZodOptional<z.ZodObject<{
2552
+ detail: z.ZodOptional<z.ZodString>;
2553
+ icon: z.ZodObject<{
2554
+ glyph: z.ZodString;
2555
+ }, z.core.$strip>;
2556
+ label: z.ZodObject<{
2557
+ completed: z.ZodString;
2558
+ pending: z.ZodString;
2559
+ }, z.core.$strip>;
2560
+ suppress: z.ZodOptional<z.ZodBoolean>;
2561
+ tint: z.ZodOptional<z.ZodObject<{
2562
+ dark: z.ZodString;
2563
+ light: z.ZodString;
2564
+ }, z.core.$strip>>;
2565
+ title: z.ZodOptional<z.ZodString>;
2566
+ }, z.core.$strip>>;
2567
+ providerTurnId: z.ZodOptional<z.ZodString>;
2568
+ }, z.core.$strip>, z.ZodObject<{
2569
+ aggregatedOutput: z.ZodOptional<z.ZodString>;
2570
+ approvalStatus: z.ZodOptional<z.ZodLiteral<"denied">>;
2571
+ exitCode: z.ZodOptional<z.ZodNumber>;
2572
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
2573
+ aggregatedOutput: z.ZodOptional<z.ZodString>;
2574
+ command: z.ZodString;
2575
+ cwd: z.ZodString;
2576
+ durationMs: z.ZodOptional<z.ZodNumber>;
2577
+ exitCode: z.ZodOptional<z.ZodNumber>;
2578
+ type: z.ZodLiteral<"command">;
2579
+ }, z.core.$strip>, z.ZodObject<{
2580
+ changes: z.ZodArray<z.ZodObject<{
2581
+ diff: z.ZodOptional<z.ZodString>;
2582
+ kind: z.ZodEnum<{
2583
+ add: "add";
2584
+ delete: "delete";
2585
+ update: "update";
2586
+ }>;
2587
+ movePath: z.ZodOptional<z.ZodString>;
2588
+ newText: z.ZodOptional<z.ZodString>;
2589
+ oldText: z.ZodOptional<z.ZodString>;
2590
+ path: z.ZodString;
2591
+ }, z.core.$strip>>;
2592
+ type: z.ZodLiteral<"fileChange">;
2593
+ }, z.core.$strip>, z.ZodObject<{
2594
+ args: z.ZodOptional<z.ZodUnknown>;
2595
+ durationMs: z.ZodOptional<z.ZodNumber>;
2596
+ error: z.ZodOptional<z.ZodString>;
2597
+ result: z.ZodOptional<z.ZodUnknown>;
2598
+ server: z.ZodOptional<z.ZodString>;
2599
+ tool: z.ZodString;
2600
+ type: z.ZodLiteral<"tool">;
2601
+ }, z.core.$strip>, z.ZodObject<{
2602
+ type: z.ZodLiteral<"compaction">;
2603
+ }, z.core.$strip>, z.ZodObject<{
2604
+ text: z.ZodString;
2605
+ type: z.ZodLiteral<"agentMessage">;
2606
+ }, z.core.$strip>, z.ZodObject<{
2607
+ content: z.ZodArray<z.ZodString>;
2608
+ summary: z.ZodArray<z.ZodString>;
2609
+ type: z.ZodLiteral<"reasoning">;
2610
+ }, z.core.$strip>, z.ZodObject<{
2611
+ text: z.ZodString;
2612
+ type: z.ZodLiteral<"plan">;
2613
+ }, z.core.$strip>, z.ZodObject<{
2614
+ queries: z.ZodArray<z.ZodString>;
2615
+ type: z.ZodLiteral<"webSearch">;
2616
+ }, z.core.$strip>, z.ZodObject<{
2617
+ pattern: z.ZodNullable<z.ZodString>;
2618
+ prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2619
+ type: z.ZodLiteral<"webFetch">;
2620
+ url: z.ZodString;
2621
+ }, z.core.$strip>, z.ZodObject<{
2622
+ path: z.ZodString;
2623
+ type: z.ZodLiteral<"imageView">;
2624
+ }, z.core.$strip>, z.ZodObject<{
2625
+ description: z.ZodString;
2626
+ error: z.ZodOptional<z.ZodString>;
2627
+ familyId: z.ZodString;
2628
+ outputFile: z.ZodOptional<z.ZodString>;
2629
+ skipTranscript: z.ZodBoolean;
2630
+ status: z.ZodEnum<{
2631
+ completed: "completed";
2632
+ failed: "failed";
2633
+ interrupted: "interrupted";
2634
+ pending: "pending";
2635
+ }>;
2636
+ summary: z.ZodOptional<z.ZodString>;
2637
+ taskStatus: z.ZodEnum<{
2638
+ completed: "completed";
2639
+ failed: "failed";
2640
+ killed: "killed";
2641
+ paused: "paused";
2642
+ pending: "pending";
2643
+ running: "running";
2644
+ stopped: "stopped";
2645
+ }>;
2646
+ taskType: z.ZodString;
2647
+ type: z.ZodLiteral<"backgroundTask">;
2648
+ usage: z.ZodOptional<z.ZodObject<{
2649
+ durationMs: z.ZodNumber;
2650
+ toolUses: z.ZodNumber;
2651
+ totalTokens: z.ZodNumber;
2652
+ }, z.core.$strip>>;
2653
+ workflow: z.ZodOptional<z.ZodObject<{
2654
+ agents: z.ZodArray<z.ZodObject<{
2655
+ agentType: z.ZodOptional<z.ZodString>;
2656
+ attempt: z.ZodNumber;
2657
+ cached: z.ZodBoolean;
2658
+ durationMs: z.ZodOptional<z.ZodNumber>;
2659
+ error: z.ZodOptional<z.ZodString>;
2660
+ index: z.ZodNumber;
2661
+ isolation: z.ZodOptional<z.ZodString>;
2662
+ label: z.ZodString;
2663
+ lastProgressAt: z.ZodNumber;
2664
+ lastToolName: z.ZodOptional<z.ZodString>;
2665
+ lastToolSummary: z.ZodOptional<z.ZodString>;
2666
+ model: z.ZodString;
2667
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
2668
+ phaseTitle: z.ZodOptional<z.ZodString>;
2669
+ promptPreview: z.ZodOptional<z.ZodString>;
2670
+ queuedAt: z.ZodOptional<z.ZodNumber>;
2671
+ resultPreview: z.ZodOptional<z.ZodString>;
2672
+ startedAt: z.ZodOptional<z.ZodNumber>;
2673
+ state: z.ZodEnum<{
2674
+ done: "done";
2675
+ failed: "failed";
2676
+ queued: "queued";
2677
+ running: "running";
2678
+ skipped: "skipped";
2679
+ }>;
2680
+ tokens: z.ZodOptional<z.ZodNumber>;
2681
+ toolCalls: z.ZodOptional<z.ZodNumber>;
2682
+ }, z.core.$strip>>;
2683
+ phases: z.ZodArray<z.ZodObject<{
2684
+ index: z.ZodNumber;
2685
+ kind: z.ZodOptional<z.ZodString>;
2686
+ title: z.ZodString;
2687
+ }, z.core.$strip>>;
2688
+ }, z.core.$strip>>;
2689
+ workflowName: z.ZodOptional<z.ZodString>;
2690
+ }, z.core.$strip>, z.ZodObject<{
2691
+ cmd: z.ZodOptional<z.ZodString>;
2692
+ path: z.ZodString;
2693
+ type: z.ZodLiteral<"fileRead">;
2694
+ }, z.core.$strip>, z.ZodObject<{
2695
+ cmd: z.ZodOptional<z.ZodString>;
2696
+ mode: z.ZodEnum<{
2697
+ content: "content";
2698
+ list: "list";
2699
+ path: "path";
2700
+ }>;
2701
+ path: z.ZodOptional<z.ZodString>;
2702
+ query: z.ZodString;
2703
+ type: z.ZodLiteral<"search">;
2704
+ }, z.core.$strip>, z.ZodObject<{
2705
+ background: z.ZodBoolean;
2706
+ childRef: z.ZodString;
2707
+ label: z.ZodString;
2708
+ summary: z.ZodOptional<z.ZodString>;
2709
+ type: z.ZodLiteral<"delegation">;
2710
+ }, z.core.$strip>, z.ZodObject<{
2711
+ explanation: z.ZodOptional<z.ZodString>;
2712
+ steps: z.ZodArray<z.ZodObject<{
2713
+ status: z.ZodOptional<z.ZodEnum<{
2714
+ active: "active";
2715
+ completed: "completed";
2716
+ failed: "failed";
2717
+ pending: "pending";
2718
+ }>>;
2719
+ step: z.ZodString;
2720
+ }, z.core.$strip>>;
2721
+ type: z.ZodLiteral<"planSteps">;
2722
+ }, z.core.$strip>, z.ZodObject<{
2723
+ kind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
2724
+ payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
2725
+ type: z.ZodLiteral<"extension">;
2726
+ }, z.core.$strip>], "type">;
2727
+ key: z.ZodObject<{
2728
+ channel: z.ZodOptional<z.ZodString>;
2729
+ parentRef: z.ZodOptional<z.ZodString>;
2730
+ providerItemId: z.ZodOptional<z.ZodString>;
2731
+ }, z.core.$strip>;
2732
+ kind: z.ZodLiteral<"item.close">;
2733
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2734
+ raw: z.ZodObject<{
2735
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2736
+ jsonrpc: z.ZodLiteral<"2.0">;
2737
+ method: z.ZodString;
2738
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2739
+ }, z.core.$strip>;
2740
+ rawType: z.ZodString;
2741
+ }, z.core.$strip>>;
2742
+ presentation: z.ZodOptional<z.ZodObject<{
2743
+ detail: z.ZodOptional<z.ZodString>;
2744
+ icon: z.ZodObject<{
2745
+ glyph: z.ZodString;
2746
+ }, z.core.$strip>;
2747
+ label: z.ZodObject<{
2748
+ completed: z.ZodString;
2749
+ pending: z.ZodString;
2750
+ }, z.core.$strip>;
2751
+ suppress: z.ZodOptional<z.ZodBoolean>;
2752
+ tint: z.ZodOptional<z.ZodObject<{
2753
+ dark: z.ZodString;
2754
+ light: z.ZodString;
2755
+ }, z.core.$strip>>;
2756
+ title: z.ZodOptional<z.ZodString>;
2757
+ }, z.core.$strip>>;
2758
+ providerTurnId: z.ZodOptional<z.ZodString>;
2759
+ resultText: z.ZodOptional<z.ZodString>;
2760
+ status: z.ZodEnum<{
2761
+ completed: "completed";
2762
+ failed: "failed";
2763
+ interrupted: "interrupted";
2764
+ pending: "pending";
2765
+ }>;
2766
+ }, z.core.$strip>, z.ZodObject<{
2767
+ flush: z.ZodOptional<z.ZodBoolean>;
2768
+ key: z.ZodObject<{
2769
+ channel: z.ZodOptional<z.ZodString>;
2770
+ parentRef: z.ZodOptional<z.ZodString>;
2771
+ providerItemId: z.ZodOptional<z.ZodString>;
2772
+ }, z.core.$strip>;
2773
+ kind: z.ZodLiteral<"item.progress">;
2774
+ message: z.ZodOptional<z.ZodString>;
2775
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2776
+ raw: z.ZodObject<{
2777
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2778
+ jsonrpc: z.ZodLiteral<"2.0">;
2779
+ method: z.ZodString;
2780
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2781
+ }, z.core.$strip>;
2782
+ rawType: z.ZodString;
2783
+ }, z.core.$strip>>;
2784
+ providerTurnId: z.ZodOptional<z.ZodString>;
2785
+ snapshot: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2786
+ description: z.ZodString;
2787
+ error: z.ZodOptional<z.ZodString>;
2788
+ familyId: z.ZodString;
2789
+ outputFile: z.ZodOptional<z.ZodString>;
2790
+ skipTranscript: z.ZodBoolean;
2791
+ status: z.ZodEnum<{
2792
+ completed: "completed";
2793
+ failed: "failed";
2794
+ interrupted: "interrupted";
2795
+ pending: "pending";
2796
+ }>;
2797
+ summary: z.ZodOptional<z.ZodString>;
2798
+ taskStatus: z.ZodEnum<{
2799
+ completed: "completed";
2800
+ failed: "failed";
2801
+ killed: "killed";
2802
+ paused: "paused";
2803
+ pending: "pending";
2804
+ running: "running";
2805
+ stopped: "stopped";
2806
+ }>;
2807
+ taskType: z.ZodString;
2808
+ type: z.ZodLiteral<"backgroundTask">;
2809
+ usage: z.ZodOptional<z.ZodObject<{
2810
+ durationMs: z.ZodNumber;
2811
+ toolUses: z.ZodNumber;
2812
+ totalTokens: z.ZodNumber;
2813
+ }, z.core.$strip>>;
2814
+ workflow: z.ZodOptional<z.ZodObject<{
2815
+ agents: z.ZodArray<z.ZodObject<{
2816
+ agentType: z.ZodOptional<z.ZodString>;
2817
+ attempt: z.ZodNumber;
2818
+ cached: z.ZodBoolean;
2819
+ durationMs: z.ZodOptional<z.ZodNumber>;
2820
+ error: z.ZodOptional<z.ZodString>;
2821
+ index: z.ZodNumber;
2822
+ isolation: z.ZodOptional<z.ZodString>;
2823
+ label: z.ZodString;
2824
+ lastProgressAt: z.ZodNumber;
2825
+ lastToolName: z.ZodOptional<z.ZodString>;
2826
+ lastToolSummary: z.ZodOptional<z.ZodString>;
2827
+ model: z.ZodString;
2828
+ phaseIndex: z.ZodOptional<z.ZodNumber>;
2829
+ phaseTitle: z.ZodOptional<z.ZodString>;
2830
+ promptPreview: z.ZodOptional<z.ZodString>;
2831
+ queuedAt: z.ZodOptional<z.ZodNumber>;
2832
+ resultPreview: z.ZodOptional<z.ZodString>;
2833
+ startedAt: z.ZodOptional<z.ZodNumber>;
2834
+ state: z.ZodEnum<{
2835
+ done: "done";
2836
+ failed: "failed";
2837
+ queued: "queued";
2838
+ running: "running";
2839
+ skipped: "skipped";
2840
+ }>;
2841
+ tokens: z.ZodOptional<z.ZodNumber>;
2842
+ toolCalls: z.ZodOptional<z.ZodNumber>;
2843
+ }, z.core.$strip>>;
2844
+ phases: z.ZodArray<z.ZodObject<{
2845
+ index: z.ZodNumber;
2846
+ kind: z.ZodOptional<z.ZodString>;
2847
+ title: z.ZodString;
2848
+ }, z.core.$strip>>;
2849
+ }, z.core.$strip>>;
2850
+ workflowName: z.ZodOptional<z.ZodString>;
2851
+ }, z.core.$strip>, z.ZodObject<{
2852
+ background: z.ZodBoolean;
2853
+ childRef: z.ZodString;
2854
+ label: z.ZodString;
2855
+ summary: z.ZodOptional<z.ZodString>;
2856
+ type: z.ZodLiteral<"delegation">;
2857
+ }, z.core.$strip>], "type">>;
2858
+ }, z.core.$strip>, z.ZodObject<{
2859
+ channel: z.ZodEnum<{
2860
+ agentMessage: "agentMessage";
2861
+ plan: "plan";
2862
+ reasoningSummary: "reasoningSummary";
2863
+ reasoningText: "reasoningText";
2864
+ }>;
2865
+ key: z.ZodObject<{
2866
+ channel: z.ZodOptional<z.ZodString>;
2867
+ parentRef: z.ZodOptional<z.ZodString>;
2868
+ providerItemId: z.ZodOptional<z.ZodString>;
2869
+ }, z.core.$strip>;
2870
+ kind: z.ZodLiteral<"item.textDelta">;
2871
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2872
+ raw: z.ZodObject<{
2873
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2874
+ jsonrpc: z.ZodLiteral<"2.0">;
2875
+ method: z.ZodString;
2876
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2877
+ }, z.core.$strip>;
2878
+ rawType: z.ZodString;
2879
+ }, z.core.$strip>>;
2880
+ providerTurnId: z.ZodOptional<z.ZodString>;
2881
+ text: z.ZodString;
2882
+ }, z.core.$strip>, z.ZodObject<{
2883
+ channel: z.ZodEnum<{
2884
+ agentMessage: "agentMessage";
2885
+ plan: "plan";
2886
+ reasoningSummary: "reasoningSummary";
2887
+ reasoningText: "reasoningText";
2888
+ }>;
2889
+ key: z.ZodObject<{
2890
+ channel: z.ZodOptional<z.ZodString>;
2891
+ parentRef: z.ZodOptional<z.ZodString>;
2892
+ providerItemId: z.ZodOptional<z.ZodString>;
2893
+ }, z.core.$strip>;
2894
+ kind: z.ZodLiteral<"item.textClose">;
2895
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2896
+ raw: z.ZodObject<{
2897
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2898
+ jsonrpc: z.ZodLiteral<"2.0">;
2899
+ method: z.ZodString;
2900
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2901
+ }, z.core.$strip>;
2902
+ rawType: z.ZodString;
2903
+ }, z.core.$strip>>;
2904
+ providerTurnId: z.ZodOptional<z.ZodString>;
2905
+ text: z.ZodOptional<z.ZodString>;
2906
+ }, z.core.$strip>, z.ZodObject<{
2907
+ channel: z.ZodEnum<{
2908
+ command: "command";
2909
+ fileChange: "fileChange";
2910
+ }>;
2911
+ key: z.ZodObject<{
2912
+ channel: z.ZodOptional<z.ZodString>;
2913
+ parentRef: z.ZodOptional<z.ZodString>;
2914
+ providerItemId: z.ZodOptional<z.ZodString>;
2915
+ }, z.core.$strip>;
2916
+ kind: z.ZodLiteral<"item.outputDelta">;
2917
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2918
+ raw: z.ZodObject<{
2919
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2920
+ jsonrpc: z.ZodLiteral<"2.0">;
2921
+ method: z.ZodString;
2922
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2923
+ }, z.core.$strip>;
2924
+ rawType: z.ZodString;
2925
+ }, z.core.$strip>>;
2926
+ providerTurnId: z.ZodOptional<z.ZodString>;
2927
+ text: z.ZodString;
2928
+ }, z.core.$strip>, z.ZodObject<{
2929
+ key: z.ZodObject<{
2930
+ channel: z.ZodOptional<z.ZodString>;
2931
+ parentRef: z.ZodOptional<z.ZodString>;
2932
+ providerItemId: z.ZodOptional<z.ZodString>;
2933
+ }, z.core.$strip>;
2934
+ kind: z.ZodLiteral<"command.outputSnapshot">;
2935
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2936
+ raw: z.ZodObject<{
2937
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2938
+ jsonrpc: z.ZodLiteral<"2.0">;
2939
+ method: z.ZodString;
2940
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2941
+ }, z.core.$strip>;
2942
+ rawType: z.ZodString;
2943
+ }, z.core.$strip>>;
2944
+ text: z.ZodString;
2945
+ }, z.core.$strip>, z.ZodObject<{
2946
+ kind: z.ZodLiteral<"usage">;
2947
+ last: z.ZodObject<{
2948
+ cachedInputTokens: z.ZodNumber;
2949
+ inputTokens: z.ZodNumber;
2950
+ outputTokens: z.ZodNumber;
2951
+ reasoningOutputTokens: z.ZodNumber;
2952
+ totalTokens: z.ZodNumber;
2953
+ }, z.core.$strip>;
2954
+ modelContextWindow: z.ZodNullable<z.ZodNumber>;
2955
+ providerTurnId: z.ZodOptional<z.ZodString>;
2956
+ total: z.ZodObject<{
2957
+ cachedInputTokens: z.ZodNumber;
2958
+ inputTokens: z.ZodNumber;
2959
+ outputTokens: z.ZodNumber;
2960
+ reasoningOutputTokens: z.ZodNumber;
2961
+ totalTokens: z.ZodNumber;
2962
+ }, z.core.$strip>;
2963
+ }, z.core.$strip>, z.ZodObject<{
2964
+ attach: z.ZodEnum<{
2965
+ currentOrLast: "currentOrLast";
2966
+ open: "open";
2967
+ }>;
2968
+ estimated: z.ZodBoolean;
2969
+ kind: z.ZodLiteral<"contextWindow">;
2970
+ providerTurnId: z.ZodOptional<z.ZodString>;
2971
+ size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2972
+ used: z.ZodNullable<z.ZodNumber>;
2973
+ }, z.core.$strip>, z.ZodObject<{
2974
+ kind: z.ZodLiteral<"context.compacted">;
2975
+ noTurnFallback: z.ZodOptional<z.ZodObject<{
2976
+ raw: z.ZodObject<{
2977
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
2978
+ jsonrpc: z.ZodLiteral<"2.0">;
2979
+ method: z.ZodString;
2980
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2981
+ }, z.core.$strip>;
2982
+ rawType: z.ZodString;
2983
+ }, z.core.$strip>>;
2984
+ providerTurnId: z.ZodOptional<z.ZodString>;
2985
+ }, z.core.$strip>, z.ZodObject<{
2986
+ kind: z.ZodLiteral<"context.cleared">;
2987
+ }, z.core.$strip>, z.ZodObject<{
2988
+ diff: z.ZodString;
2989
+ kind: z.ZodLiteral<"turn.diff">;
2990
+ providerTurnId: z.ZodOptional<z.ZodString>;
2991
+ }, z.core.$strip>, z.ZodObject<{
2992
+ kind: z.ZodLiteral<"thread.started">;
2993
+ }, z.core.$strip>, z.ZodObject<{
2994
+ kind: z.ZodLiteral<"thread.identity">;
2995
+ providerThreadId: z.ZodString;
2996
+ }, z.core.$strip>, z.ZodObject<{
2997
+ kind: z.ZodLiteral<"thread.name">;
2998
+ name: z.ZodString;
2999
+ }, z.core.$strip>, z.ZodObject<{
3000
+ extensionKind: z.ZodString & z.ZodType<`${string}/${string}`, string, z.core.$ZodTypeInternals<`${string}/${string}`, string>>;
3001
+ kind: z.ZodLiteral<"extension.state">;
3002
+ payload: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
3003
+ }, z.core.$strip>, z.ZodObject<{
3004
+ kind: z.ZodLiteral<"provider.rateLimits">;
3005
+ rateLimits: z.ZodObject<{
3006
+ kind: z.ZodEnum<{
3007
+ "spend-control": "spend-control";
3008
+ "subscription-window": "subscription-window";
3009
+ credits: "credits";
3010
+ unknown: "unknown";
3011
+ }>;
3012
+ overageReason: z.ZodNullable<z.ZodString>;
3013
+ overageStatus: z.ZodNullable<z.ZodEnum<{
3014
+ allowed: "allowed";
3015
+ rejected: "rejected";
3016
+ unavailable: "unavailable";
3017
+ warning: "warning";
3018
+ }>>;
3019
+ providerId: z.ZodString;
3020
+ reachedReason: z.ZodNullable<z.ZodString>;
3021
+ status: z.ZodEnum<{
3022
+ allowed: "allowed";
3023
+ blocked: "blocked";
3024
+ unknown: "unknown";
3025
+ warning: "warning";
3026
+ }>;
3027
+ windows: z.ZodArray<z.ZodObject<{
3028
+ label: z.ZodNullable<z.ZodString>;
3029
+ providerKey: z.ZodNullable<z.ZodString>;
3030
+ resetsAtMs: z.ZodNullable<z.ZodNumber>;
3031
+ status: z.ZodEnum<{
3032
+ allowed: "allowed";
3033
+ blocked: "blocked";
3034
+ unknown: "unknown";
3035
+ warning: "warning";
3036
+ }>;
3037
+ }, z.core.$strip>>;
3038
+ }, z.core.$strip>;
3039
+ }, z.core.$strip>, z.ZodObject<{
3040
+ category: z.ZodOptional<z.ZodEnum<{
3041
+ "active-turn-not-steerable": "active-turn-not-steerable";
3042
+ "bad-request": "bad-request";
3043
+ "budget-exceeded": "budget-exceeded";
3044
+ "connection-failed": "connection-failed";
3045
+ "context-window-exceeded": "context-window-exceeded";
3046
+ "max-output-tokens": "max-output-tokens";
3047
+ "max-turns": "max-turns";
3048
+ "rate-limit": "rate-limit";
3049
+ "stream-disconnected": "stream-disconnected";
3050
+ "structured-output-retries": "structured-output-retries";
3051
+ "thread-rollback-failed": "thread-rollback-failed";
3052
+ "too-many-failed-attempts": "too-many-failed-attempts";
3053
+ billing: "billing";
3054
+ internal: "internal";
3055
+ overloaded: "overloaded";
3056
+ policy: "policy";
3057
+ sandbox: "sandbox";
3058
+ unauthorized: "unauthorized";
3059
+ unknown: "unknown";
3060
+ }>>;
3061
+ detail: z.ZodOptional<z.ZodString>;
3062
+ errorInfo: z.ZodOptional<z.ZodObject<{
3063
+ category: z.ZodEnum<{
3064
+ "active-turn-not-steerable": "active-turn-not-steerable";
3065
+ "bad-request": "bad-request";
3066
+ "budget-exceeded": "budget-exceeded";
3067
+ "connection-failed": "connection-failed";
3068
+ "context-window-exceeded": "context-window-exceeded";
3069
+ "max-output-tokens": "max-output-tokens";
3070
+ "max-turns": "max-turns";
3071
+ "rate-limit": "rate-limit";
3072
+ "stream-disconnected": "stream-disconnected";
3073
+ "structured-output-retries": "structured-output-retries";
3074
+ "thread-rollback-failed": "thread-rollback-failed";
3075
+ "too-many-failed-attempts": "too-many-failed-attempts";
3076
+ billing: "billing";
3077
+ internal: "internal";
3078
+ overloaded: "overloaded";
3079
+ policy: "policy";
3080
+ sandbox: "sandbox";
3081
+ unauthorized: "unauthorized";
3082
+ unknown: "unknown";
3083
+ }>;
3084
+ httpStatusCode: z.ZodNullable<z.ZodNumber>;
3085
+ providerCode: z.ZodNullable<z.ZodString>;
3086
+ }, z.core.$strip>>;
3087
+ kind: z.ZodLiteral<"provider.error">;
3088
+ message: z.ZodString;
3089
+ providerTurnId: z.ZodOptional<z.ZodString>;
3090
+ settlesTurn: z.ZodOptional<z.ZodBoolean>;
3091
+ threadScoped: z.ZodOptional<z.ZodBoolean>;
3092
+ willRetry: z.ZodOptional<z.ZodBoolean>;
3093
+ }, z.core.$strip>, z.ZodObject<{
3094
+ fallbackModel: z.ZodString;
3095
+ kind: z.ZodLiteral<"provider.modelFallback">;
3096
+ message: z.ZodString;
3097
+ originalModel: z.ZodString;
3098
+ reason: z.ZodEnum<{
3099
+ provider: "provider";
3100
+ refusal: "refusal";
3101
+ }>;
3102
+ }, z.core.$strip>, z.ZodObject<{
3103
+ category: z.ZodOptional<z.ZodEnum<{
3104
+ "compaction-skipped": "compaction-skipped";
3105
+ config: "config";
3106
+ deprecation: "deprecation";
3107
+ general: "general";
3108
+ }>>;
3109
+ details: z.ZodOptional<z.ZodString>;
3110
+ kind: z.ZodLiteral<"provider.warning">;
3111
+ summary: z.ZodOptional<z.ZodString>;
3112
+ vouchedTurn: z.ZodOptional<z.ZodBoolean>;
3113
+ }, z.core.$strip>, z.ZodObject<{
3114
+ kind: z.ZodLiteral<"unhandled">;
3115
+ onlyIfNoTurn: z.ZodOptional<z.ZodBoolean>;
3116
+ parentRef: z.ZodOptional<z.ZodString>;
3117
+ providerTurnId: z.ZodOptional<z.ZodString>;
3118
+ raw: z.ZodObject<{
3119
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
3120
+ jsonrpc: z.ZodLiteral<"2.0">;
3121
+ method: z.ZodString;
3122
+ params: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
3123
+ }, z.core.$strip>;
3124
+ rawType: z.ZodString;
3125
+ vouchedTurn: z.ZodBoolean;
3126
+ }, z.core.$strip>, z.ZodObject<{
3127
+ kind: z.ZodLiteral<"session.ended">;
3128
+ }, z.core.$strip>, z.ZodObject<{
3129
+ kind: z.ZodLiteral<"session.reset">;
3130
+ }, z.core.$strip>], "kind">;
3131
+ type ThreadDelta = z.infer<typeof threadDeltaSchema>;
3132
+
3133
+ /**
3134
+ * The `thread/delta` grammar range this assembler speaks, reported to every
3135
+ * bridge in the `initialize` params so the two sides negotiate a version
3136
+ * (see `negotiateGrammarVersion` in the protocol). `[3, 3]`: the v2 dialects
3137
+ * (`message.*`, `usage.turn`/`usage.exact`) are deleted, so a bridge whose
3138
+ * range lacks 3 — including one that predates `grammarVersions` and reads as
3139
+ * `[2, 2]` — is refused at the handshake with a legible error instead of
3140
+ * connecting to an assembler that would drop its every stream.
3141
+ */
3142
+ declare const ASSEMBLER_GRAMMAR_VERSIONS: BridgeGrammarVersions;
3143
+ interface DiffCumulativeTextArgs {
3144
+ nextText: string;
3145
+ previousText?: string;
3146
+ }
3147
+ interface DiffCumulativeTextResult {
3148
+ delta: string;
3149
+ nextText: string;
3150
+ reset: boolean;
3151
+ }
3152
+ /**
3153
+ * Diffs a cumulative text snapshot against the previous one: emits only the
3154
+ * appended suffix when the provider keeps appending, or the full text with
3155
+ * `reset: true` when the snapshot restarted.
3156
+ */
3157
+ declare function diffCumulativeText(args: DiffCumulativeTextArgs): DiffCumulativeTextResult | null;
3158
+ interface CreateDeltaAssemblerOptions {
3159
+ /** Provider id stamped onto provider/unhandled events. */
3160
+ providerId: string;
3161
+ /**
3162
+ * Entropy prefix for minted turn/item ids. Defaults to fresh per-assembler
3163
+ * entropy so ids never collide across assembler (process) restarts; tests
3164
+ * inject a fixed prefix for determinism.
3165
+ */
3166
+ entropyPrefix?: string;
3167
+ /**
3168
+ * Minimum gap between emitted `item.progress` events per item key
3169
+ * (`flush: true` bypasses it; `item.close` always emits). 500ms default —
3170
+ * the cadence the claude bridge hand-rolled for background-task snapshots,
3171
+ * now the central policy for every provider's progress stream.
3172
+ */
3173
+ progressThrottleMs?: number;
3174
+ /**
3175
+ * Coalescing window for streamed-text events (assistant/reasoning/plan
3176
+ * deltas and command/fileChange output deltas) per stream. Within the
3177
+ * window consecutive deltas concatenate into one emitted event of the same
3178
+ * type; the buffer flushes trailing-edge with no timers — on the thread's
3179
+ * next traffic once the window elapsed, on stream close, and before ANY
3180
+ * non-batchable event for the thread (the ordering barrier: coalescing
3181
+ * never reorders text relative to item opens/closes, turn events, errors,
3182
+ * or other streams' flushes). The first delta of a fresh stream always
3183
+ * emits immediately, keeping time-to-first-token unchanged. 100ms default;
3184
+ * 0 disables batching (one event per delta).
3185
+ */
3186
+ textDeltaFlushMs?: number;
3187
+ /** Clock override for tests. */
3188
+ now?: () => number;
3189
+ }
3190
+ interface AssembleDeltasArgs {
3191
+ threadId: string;
3192
+ deltas: readonly ThreadDelta[];
3193
+ }
3194
+ interface DeltaAssembler {
3195
+ assemble(args: AssembleDeltasArgs): ThreadEvent[];
3196
+ /** bb item id minted for a provider item id (command-plane lookup). */
3197
+ getBbItemId(threadId: string, providerItemId: string): string | undefined;
3198
+ /** Provider item id behind a bb item id (reverse command-plane lookup). */
3199
+ getProviderItemId(threadId: string, bbItemId: string): string | undefined;
3200
+ /** bb turn id minted for a vouched provider turn id. */
3201
+ getBbTurnId(threadId: string, providerTurnId: string): string | undefined;
3202
+ /** Provider turn id behind a bb turn id (steer/interrupt reverse lookup). */
3203
+ getProviderTurnId(threadId: string, bbTurnId: string): string | undefined;
3204
+ getOpenTurnId(threadId: string): string | undefined;
3205
+ }
3206
+ declare function createDeltaAssembler(options: CreateDeltaAssemblerOptions): DeltaAssembler;
3207
+
3208
+ type BridgeJsonRpcId = string | number;
3209
+ type BridgeJsonRpcLineHandler = (line: string) => void;
3210
+ interface BridgeJsonRpcObject {
3211
+ [key: string]: JsonValue;
3212
+ }
3213
+ interface BridgeJsonRpcOutputMessage {
3214
+ jsonrpc: "2.0";
3215
+ id?: BridgeJsonRpcId;
3216
+ method?: string;
3217
+ params?: JsonValue;
3218
+ result?: JsonValue;
3219
+ error?: {
3220
+ code: number;
3221
+ message: string;
3222
+ data?: JsonValue;
3223
+ };
3224
+ }
3225
+ interface CapturedBridgeJsonRpcOutput {
3226
+ messages: BridgeJsonRpcOutputMessage[];
3227
+ restore(): void;
3228
+ }
3229
+ interface BridgeJsonRpcTestHarness {
3230
+ messages: BridgeJsonRpcOutputMessage[];
3231
+ flushWork(): Promise<void>;
3232
+ hasResponse(id: BridgeJsonRpcId): boolean;
3233
+ restore(): void;
3234
+ sendRequest(id: BridgeJsonRpcId, method: string, params: BridgeJsonRpcObject): void;
3235
+ waitForResponse(id: BridgeJsonRpcId): Promise<BridgeJsonRpcOutputMessage>;
3236
+ }
3237
+ /**
3238
+ * Capture everything a bridge writes to stdout as parsed JSON-RPC messages.
3239
+ * Patches `process.stdout.write` directly (no test-framework spy), so the
3240
+ * kit runs under any runner; `restore()` puts the original writer back.
3241
+ */
3242
+ declare function captureBridgeJsonRpcOutput(): CapturedBridgeJsonRpcOutput;
3243
+ declare function createBridgeJsonRpcTestHarness(handleLine: BridgeJsonRpcLineHandler): BridgeJsonRpcTestHarness;
3244
+
3245
+ /**
3246
+ * Test-side view of the runtime's delta assembly: bridge tests capture raw
3247
+ * JSON-RPC output, and bridges emit `thread/delta` notifications rather than
3248
+ * finished `ThreadEvent`s. These helpers run captured notifications through
3249
+ * the real delta assembler — the exact translation the bridge protocol
3250
+ * adapter performs — so assertions keep working against canonical
3251
+ * `ThreadEvent`s.
3252
+ */
3253
+
3254
+ interface CapturedBridgeNotification {
3255
+ method?: string;
3256
+ params?: unknown;
3257
+ }
3258
+ interface BridgeDeltaEventCollector {
3259
+ assembler: DeltaAssembler;
3260
+ /** Canonical events for one captured notification (empty for non-deltas). */
3261
+ assembleMessage(message: CapturedBridgeNotification): ThreadEvent[];
3262
+ }
3263
+ declare function createBridgeDeltaEventCollector(providerId?: string): BridgeDeltaEventCollector;
3264
+ /**
3265
+ * All canonical events an ordered capture of bridge notifications assembles
3266
+ * to. Builds a fresh assembler per call, so feed it the full capture (not an
3267
+ * incremental slice) for deterministic ids.
3268
+ */
3269
+ declare function assembleCapturedThreadEvents(messages: readonly CapturedBridgeNotification[], providerId?: string): ThreadEvent[];
3270
+ /**
3271
+ * Map one captured bridge message for the conformance kit's transport: a
3272
+ * `thread/delta` notification is assembled (statefully, through the
3273
+ * collector's real assembler — hold one collector for the whole run) and each
3274
+ * assembled event is re-emitted on the kit's internal assembled-event lane;
3275
+ * every other message passes through untouched.
3276
+ */
3277
+ declare function toConformanceMessages(message: CapturedBridgeNotification, collector: BridgeDeltaEventCollector): unknown[];
3278
+
3279
+ /**
3280
+ * Dual-path calibration support.
3281
+ *
3282
+ * A calibration replays one scripted provider session through both the legacy
3283
+ * adapter and the canonical bridge, then diffs the two ThreadEvent streams.
3284
+ * Anything the diff reports is either a deliberate, documented protocol
3285
+ * difference (the bridge synthesizes item/started, announces thread/identity,
3286
+ * …) or a regression — there is no third category, which is what makes these
3287
+ * suites a graduation gate.
3288
+ *
3289
+ * Ids legitimately differ between the paths: the legacy adapter numbers from
3290
+ * its process-lifetime translator ("turn-1", "claude-assistant-2"), while a
3291
+ * canonical session mints per-session entropy ("bt3f9a2b1c-1-…") so ids stay
3292
+ * unique across resumes (#1224). Normalization interns them by first-seen
3293
+ * order instead of matching either scheme, so a stream that *reused* an id
3294
+ * still diffs.
3295
+ */
3296
+ interface NormalizeCalibrationEventsOptions {
3297
+ /**
3298
+ * Ids the provider itself owns (tool call ids, checkpoints) are identical on
3299
+ * both paths and are left alone. Anything reaching the intern table is a
3300
+ * translator- or bridge-minted id.
3301
+ */
3302
+ internedIdFields?: readonly string[];
3303
+ }
3304
+ /**
3305
+ * Normalize one path's stream. Each stream gets its own interner, so the token
3306
+ * a given id receives depends only on the order ids first appear — identical
3307
+ * across paths when the streams agree, different the moment they do not.
3308
+ */
3309
+ declare function normalizeCalibrationEvents(events: readonly ThreadEvent[], options?: NormalizeCalibrationEventsOptions): unknown[];
3310
+ /** Compact `type` (+ item type) rendering for asserting a known-divergence list. */
3311
+ declare function describeCalibrationEvents(events: readonly unknown[]): string[];
3312
+
3313
+ export { ASSEMBLER_GRAMMAR_VERSIONS, CONFORMANCE_ASSEMBLED_EVENT_METHOD, ConformanceClient as experimental_ConformanceClient, assembleCapturedThreadEvents as experimental_assembleCapturedThreadEvents, captureBridgeJsonRpcOutput as experimental_captureBridgeJsonRpcOutput, checkItemOpensBeforeDelta as experimental_checkItemOpensBeforeDelta, createBridgeDeltaEventCollector as experimental_createBridgeDeltaEventCollector, createBridgeJsonRpcTestHarness as experimental_createBridgeJsonRpcTestHarness, createDeltaAssembler as experimental_createDeltaAssembler, describeCalibrationEvents as experimental_describeCalibrationEvents, diffCumulativeText as experimental_diffCumulativeText, formatConformanceReport as experimental_formatConformanceReport, normalizeCalibrationEvents as experimental_normalizeCalibrationEvents, runBridgeConformance as experimental_runBridgeConformance, toConformanceMessages as experimental_toConformanceMessages };
3314
+ export type { AssembleDeltasArgs, BridgeConformanceTransport, BridgeDeltaEventCollector, BridgeJsonRpcId, BridgeJsonRpcLineHandler, BridgeJsonRpcObject, BridgeJsonRpcOutputMessage, BridgeJsonRpcTestHarness, CapturedBridgeJsonRpcOutput, CapturedBridgeNotification, ConformanceCheckResult, ConformanceReport, ConformanceSessionFixture, CreateDeltaAssemblerOptions, DeltaAssembler, DiffCumulativeTextArgs, DiffCumulativeTextResult, NormalizeCalibrationEventsOptions, RunBridgeConformanceOptions };