@termlink/protocol 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1268 @@
1
+ import { z } from "zod";
2
+ export declare const Usage: z.ZodObject<{
3
+ inputTokens: z.ZodNumber;
4
+ outputTokens: z.ZodNumber;
5
+ costUsd: z.ZodOptional<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ export type Usage = z.infer<typeof Usage>;
8
+ export declare const HostReadyEvent: z.ZodObject<{
9
+ v: z.ZodLiteral<1>;
10
+ kind: z.ZodLiteral<"evt">;
11
+ type: z.ZodLiteral<"host.ready">;
12
+ ts: z.ZodNumber;
13
+ sessionId: z.ZodOptional<z.ZodString>;
14
+ seq: z.ZodOptional<z.ZodNumber>;
15
+ payload: z.ZodObject<{
16
+ hostId: z.ZodString;
17
+ name: z.ZodString;
18
+ version: z.ZodString;
19
+ protocol: z.ZodLiteral<1>;
20
+ os: z.ZodString;
21
+ providers: z.ZodArray<z.ZodObject<{
22
+ id: z.ZodString;
23
+ kind: z.ZodEnum<{
24
+ agent: "agent";
25
+ terminal: "terminal";
26
+ }>;
27
+ label: z.ZodString;
28
+ available: z.ZodBoolean;
29
+ version: z.ZodNullable<z.ZodString>;
30
+ detail: z.ZodNullable<z.ZodString>;
31
+ }, z.core.$strip>>;
32
+ roots: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ }, z.core.$strip>;
34
+ }, z.core.$strip>;
35
+ export declare const SessionCreatedEvent: z.ZodObject<{
36
+ v: z.ZodLiteral<1>;
37
+ kind: z.ZodLiteral<"evt">;
38
+ type: z.ZodLiteral<"session.created">;
39
+ ts: z.ZodNumber;
40
+ sessionId: z.ZodOptional<z.ZodString>;
41
+ seq: z.ZodOptional<z.ZodNumber>;
42
+ payload: z.ZodObject<{
43
+ session: z.ZodObject<{
44
+ id: z.ZodString;
45
+ kind: z.ZodEnum<{
46
+ agent: "agent";
47
+ terminal: "terminal";
48
+ }>;
49
+ provider: z.ZodString;
50
+ providerSessionId: z.ZodNullable<z.ZodString>;
51
+ cwd: z.ZodString;
52
+ title: z.ZodNullable<z.ZodString>;
53
+ status: z.ZodEnum<{
54
+ closed: "closed";
55
+ idle: "idle";
56
+ running: "running";
57
+ starting: "starting";
58
+ waiting_input: "waiting_input";
59
+ }>;
60
+ createdAt: z.ZodNumber;
61
+ updatedAt: z.ZodNumber;
62
+ lastSeq: z.ZodNumber;
63
+ autoApprove: z.ZodOptional<z.ZodEnum<{
64
+ all: "all";
65
+ edits: "edits";
66
+ off: "off";
67
+ }>>;
68
+ cols: z.ZodOptional<z.ZodNumber>;
69
+ rows: z.ZodOptional<z.ZodNumber>;
70
+ pid: z.ZodOptional<z.ZodNumber>;
71
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
72
+ }, z.core.$strip>;
73
+ }, z.core.$strip>;
74
+ }, z.core.$strip>;
75
+ export declare const SessionUpdatedEvent: z.ZodObject<{
76
+ v: z.ZodLiteral<1>;
77
+ kind: z.ZodLiteral<"evt">;
78
+ type: z.ZodLiteral<"session.updated">;
79
+ ts: z.ZodNumber;
80
+ sessionId: z.ZodOptional<z.ZodString>;
81
+ seq: z.ZodOptional<z.ZodNumber>;
82
+ payload: z.ZodObject<{
83
+ session: z.ZodObject<{
84
+ id: z.ZodString;
85
+ kind: z.ZodEnum<{
86
+ agent: "agent";
87
+ terminal: "terminal";
88
+ }>;
89
+ provider: z.ZodString;
90
+ providerSessionId: z.ZodNullable<z.ZodString>;
91
+ cwd: z.ZodString;
92
+ title: z.ZodNullable<z.ZodString>;
93
+ status: z.ZodEnum<{
94
+ closed: "closed";
95
+ idle: "idle";
96
+ running: "running";
97
+ starting: "starting";
98
+ waiting_input: "waiting_input";
99
+ }>;
100
+ createdAt: z.ZodNumber;
101
+ updatedAt: z.ZodNumber;
102
+ lastSeq: z.ZodNumber;
103
+ autoApprove: z.ZodOptional<z.ZodEnum<{
104
+ all: "all";
105
+ edits: "edits";
106
+ off: "off";
107
+ }>>;
108
+ cols: z.ZodOptional<z.ZodNumber>;
109
+ rows: z.ZodOptional<z.ZodNumber>;
110
+ pid: z.ZodOptional<z.ZodNumber>;
111
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
112
+ }, z.core.$strip>;
113
+ }, z.core.$strip>;
114
+ }, z.core.$strip>;
115
+ export declare const SessionClosedEvent: z.ZodObject<{
116
+ v: z.ZodLiteral<1>;
117
+ kind: z.ZodLiteral<"evt">;
118
+ type: z.ZodLiteral<"session.closed">;
119
+ ts: z.ZodNumber;
120
+ sessionId: z.ZodOptional<z.ZodString>;
121
+ seq: z.ZodOptional<z.ZodNumber>;
122
+ payload: z.ZodObject<{
123
+ session: z.ZodObject<{
124
+ id: z.ZodString;
125
+ kind: z.ZodEnum<{
126
+ agent: "agent";
127
+ terminal: "terminal";
128
+ }>;
129
+ provider: z.ZodString;
130
+ providerSessionId: z.ZodNullable<z.ZodString>;
131
+ cwd: z.ZodString;
132
+ title: z.ZodNullable<z.ZodString>;
133
+ status: z.ZodEnum<{
134
+ closed: "closed";
135
+ idle: "idle";
136
+ running: "running";
137
+ starting: "starting";
138
+ waiting_input: "waiting_input";
139
+ }>;
140
+ createdAt: z.ZodNumber;
141
+ updatedAt: z.ZodNumber;
142
+ lastSeq: z.ZodNumber;
143
+ autoApprove: z.ZodOptional<z.ZodEnum<{
144
+ all: "all";
145
+ edits: "edits";
146
+ off: "off";
147
+ }>>;
148
+ cols: z.ZodOptional<z.ZodNumber>;
149
+ rows: z.ZodOptional<z.ZodNumber>;
150
+ pid: z.ZodOptional<z.ZodNumber>;
151
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
152
+ }, z.core.$strip>;
153
+ reason: z.ZodNullable<z.ZodString>;
154
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
155
+ }, z.core.$strip>;
156
+ }, z.core.$strip>;
157
+ export declare const TurnStartedEvent: z.ZodObject<{
158
+ v: z.ZodLiteral<1>;
159
+ kind: z.ZodLiteral<"evt">;
160
+ type: z.ZodLiteral<"turn.started">;
161
+ ts: z.ZodNumber;
162
+ sessionId: z.ZodOptional<z.ZodString>;
163
+ seq: z.ZodOptional<z.ZodNumber>;
164
+ payload: z.ZodObject<{
165
+ turnId: z.ZodString;
166
+ userItemId: z.ZodOptional<z.ZodString>;
167
+ }, z.core.$strip>;
168
+ }, z.core.$strip>;
169
+ export declare const TurnCompletedEvent: z.ZodObject<{
170
+ v: z.ZodLiteral<1>;
171
+ kind: z.ZodLiteral<"evt">;
172
+ type: z.ZodLiteral<"turn.completed">;
173
+ ts: z.ZodNumber;
174
+ sessionId: z.ZodOptional<z.ZodString>;
175
+ seq: z.ZodOptional<z.ZodNumber>;
176
+ payload: z.ZodObject<{
177
+ turnId: z.ZodString;
178
+ status: z.ZodEnum<{
179
+ completed: "completed";
180
+ failed: "failed";
181
+ interrupted: "interrupted";
182
+ }>;
183
+ usage: z.ZodOptional<z.ZodObject<{
184
+ inputTokens: z.ZodNumber;
185
+ outputTokens: z.ZodNumber;
186
+ costUsd: z.ZodOptional<z.ZodNumber>;
187
+ }, z.core.$strip>>;
188
+ error: z.ZodOptional<z.ZodString>;
189
+ }, z.core.$strip>;
190
+ }, z.core.$strip>;
191
+ export declare const ItemStartedEvent: z.ZodObject<{
192
+ v: z.ZodLiteral<1>;
193
+ kind: z.ZodLiteral<"evt">;
194
+ type: z.ZodLiteral<"item.started">;
195
+ ts: z.ZodNumber;
196
+ sessionId: z.ZodOptional<z.ZodString>;
197
+ seq: z.ZodOptional<z.ZodNumber>;
198
+ payload: z.ZodObject<{
199
+ turnId: z.ZodNullable<z.ZodString>;
200
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
201
+ id: z.ZodString;
202
+ status: z.ZodEnum<{
203
+ completed: "completed";
204
+ declined: "declined";
205
+ failed: "failed";
206
+ in_progress: "in_progress";
207
+ interrupted: "interrupted";
208
+ }>;
209
+ kind: z.ZodLiteral<"message">;
210
+ role: z.ZodEnum<{
211
+ assistant: "assistant";
212
+ user: "user";
213
+ }>;
214
+ text: z.ZodString;
215
+ }, z.core.$strip>, z.ZodObject<{
216
+ id: z.ZodString;
217
+ status: z.ZodEnum<{
218
+ completed: "completed";
219
+ declined: "declined";
220
+ failed: "failed";
221
+ in_progress: "in_progress";
222
+ interrupted: "interrupted";
223
+ }>;
224
+ kind: z.ZodLiteral<"reasoning">;
225
+ text: z.ZodString;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ id: z.ZodString;
228
+ status: z.ZodEnum<{
229
+ completed: "completed";
230
+ declined: "declined";
231
+ failed: "failed";
232
+ in_progress: "in_progress";
233
+ interrupted: "interrupted";
234
+ }>;
235
+ kind: z.ZodLiteral<"command">;
236
+ command: z.ZodString;
237
+ display: z.ZodOptional<z.ZodString>;
238
+ cwd: z.ZodOptional<z.ZodString>;
239
+ output: z.ZodOptional<z.ZodString>;
240
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ id: z.ZodString;
243
+ status: z.ZodEnum<{
244
+ completed: "completed";
245
+ declined: "declined";
246
+ failed: "failed";
247
+ in_progress: "in_progress";
248
+ interrupted: "interrupted";
249
+ }>;
250
+ kind: z.ZodLiteral<"file_change">;
251
+ changes: z.ZodArray<z.ZodObject<{
252
+ path: z.ZodString;
253
+ action: z.ZodEnum<{
254
+ add: "add";
255
+ delete: "delete";
256
+ modify: "modify";
257
+ rename: "rename";
258
+ }>;
259
+ movePath: z.ZodOptional<z.ZodString>;
260
+ diff: z.ZodOptional<z.ZodString>;
261
+ }, z.core.$strip>>;
262
+ }, z.core.$strip>, z.ZodObject<{
263
+ id: z.ZodString;
264
+ status: z.ZodEnum<{
265
+ completed: "completed";
266
+ declined: "declined";
267
+ failed: "failed";
268
+ in_progress: "in_progress";
269
+ interrupted: "interrupted";
270
+ }>;
271
+ kind: z.ZodLiteral<"tool">;
272
+ name: z.ZodString;
273
+ input: z.ZodOptional<z.ZodUnknown>;
274
+ output: z.ZodOptional<z.ZodUnknown>;
275
+ }, z.core.$strip>, z.ZodObject<{
276
+ id: z.ZodString;
277
+ status: z.ZodEnum<{
278
+ completed: "completed";
279
+ declined: "declined";
280
+ failed: "failed";
281
+ in_progress: "in_progress";
282
+ interrupted: "interrupted";
283
+ }>;
284
+ kind: z.ZodLiteral<"todo">;
285
+ entries: z.ZodArray<z.ZodObject<{
286
+ text: z.ZodString;
287
+ done: z.ZodBoolean;
288
+ }, z.core.$strip>>;
289
+ }, z.core.$strip>], "kind">;
290
+ }, z.core.$strip>;
291
+ }, z.core.$strip>;
292
+ export declare const ItemDeltaEvent: z.ZodObject<{
293
+ v: z.ZodLiteral<1>;
294
+ kind: z.ZodLiteral<"evt">;
295
+ type: z.ZodLiteral<"item.delta">;
296
+ ts: z.ZodNumber;
297
+ sessionId: z.ZodOptional<z.ZodString>;
298
+ seq: z.ZodOptional<z.ZodNumber>;
299
+ payload: z.ZodObject<{
300
+ itemId: z.ZodString;
301
+ field: z.ZodEnum<{
302
+ output: "output";
303
+ text: "text";
304
+ }>;
305
+ delta: z.ZodString;
306
+ }, z.core.$strip>;
307
+ }, z.core.$strip>;
308
+ /** Full snapshot of an item still in progress. Used for catch-up after attach. */
309
+ export declare const ItemUpdatedEvent: z.ZodObject<{
310
+ v: z.ZodLiteral<1>;
311
+ kind: z.ZodLiteral<"evt">;
312
+ type: z.ZodLiteral<"item.updated">;
313
+ ts: z.ZodNumber;
314
+ sessionId: z.ZodOptional<z.ZodString>;
315
+ seq: z.ZodOptional<z.ZodNumber>;
316
+ payload: z.ZodObject<{
317
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
318
+ id: z.ZodString;
319
+ status: z.ZodEnum<{
320
+ completed: "completed";
321
+ declined: "declined";
322
+ failed: "failed";
323
+ in_progress: "in_progress";
324
+ interrupted: "interrupted";
325
+ }>;
326
+ kind: z.ZodLiteral<"message">;
327
+ role: z.ZodEnum<{
328
+ assistant: "assistant";
329
+ user: "user";
330
+ }>;
331
+ text: z.ZodString;
332
+ }, z.core.$strip>, z.ZodObject<{
333
+ id: z.ZodString;
334
+ status: z.ZodEnum<{
335
+ completed: "completed";
336
+ declined: "declined";
337
+ failed: "failed";
338
+ in_progress: "in_progress";
339
+ interrupted: "interrupted";
340
+ }>;
341
+ kind: z.ZodLiteral<"reasoning">;
342
+ text: z.ZodString;
343
+ }, z.core.$strip>, z.ZodObject<{
344
+ id: z.ZodString;
345
+ status: z.ZodEnum<{
346
+ completed: "completed";
347
+ declined: "declined";
348
+ failed: "failed";
349
+ in_progress: "in_progress";
350
+ interrupted: "interrupted";
351
+ }>;
352
+ kind: z.ZodLiteral<"command">;
353
+ command: z.ZodString;
354
+ display: z.ZodOptional<z.ZodString>;
355
+ cwd: z.ZodOptional<z.ZodString>;
356
+ output: z.ZodOptional<z.ZodString>;
357
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
358
+ }, z.core.$strip>, z.ZodObject<{
359
+ id: z.ZodString;
360
+ status: z.ZodEnum<{
361
+ completed: "completed";
362
+ declined: "declined";
363
+ failed: "failed";
364
+ in_progress: "in_progress";
365
+ interrupted: "interrupted";
366
+ }>;
367
+ kind: z.ZodLiteral<"file_change">;
368
+ changes: z.ZodArray<z.ZodObject<{
369
+ path: z.ZodString;
370
+ action: z.ZodEnum<{
371
+ add: "add";
372
+ delete: "delete";
373
+ modify: "modify";
374
+ rename: "rename";
375
+ }>;
376
+ movePath: z.ZodOptional<z.ZodString>;
377
+ diff: z.ZodOptional<z.ZodString>;
378
+ }, z.core.$strip>>;
379
+ }, z.core.$strip>, z.ZodObject<{
380
+ id: z.ZodString;
381
+ status: z.ZodEnum<{
382
+ completed: "completed";
383
+ declined: "declined";
384
+ failed: "failed";
385
+ in_progress: "in_progress";
386
+ interrupted: "interrupted";
387
+ }>;
388
+ kind: z.ZodLiteral<"tool">;
389
+ name: z.ZodString;
390
+ input: z.ZodOptional<z.ZodUnknown>;
391
+ output: z.ZodOptional<z.ZodUnknown>;
392
+ }, z.core.$strip>, z.ZodObject<{
393
+ id: z.ZodString;
394
+ status: z.ZodEnum<{
395
+ completed: "completed";
396
+ declined: "declined";
397
+ failed: "failed";
398
+ in_progress: "in_progress";
399
+ interrupted: "interrupted";
400
+ }>;
401
+ kind: z.ZodLiteral<"todo">;
402
+ entries: z.ZodArray<z.ZodObject<{
403
+ text: z.ZodString;
404
+ done: z.ZodBoolean;
405
+ }, z.core.$strip>>;
406
+ }, z.core.$strip>], "kind">;
407
+ }, z.core.$strip>;
408
+ }, z.core.$strip>;
409
+ /** Final, authoritative state of an item. May arrive without a matching item.started. */
410
+ export declare const ItemCompletedEvent: z.ZodObject<{
411
+ v: z.ZodLiteral<1>;
412
+ kind: z.ZodLiteral<"evt">;
413
+ type: z.ZodLiteral<"item.completed">;
414
+ ts: z.ZodNumber;
415
+ sessionId: z.ZodOptional<z.ZodString>;
416
+ seq: z.ZodOptional<z.ZodNumber>;
417
+ payload: z.ZodObject<{
418
+ turnId: z.ZodNullable<z.ZodString>;
419
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
420
+ id: z.ZodString;
421
+ status: z.ZodEnum<{
422
+ completed: "completed";
423
+ declined: "declined";
424
+ failed: "failed";
425
+ in_progress: "in_progress";
426
+ interrupted: "interrupted";
427
+ }>;
428
+ kind: z.ZodLiteral<"message">;
429
+ role: z.ZodEnum<{
430
+ assistant: "assistant";
431
+ user: "user";
432
+ }>;
433
+ text: z.ZodString;
434
+ }, z.core.$strip>, z.ZodObject<{
435
+ id: z.ZodString;
436
+ status: z.ZodEnum<{
437
+ completed: "completed";
438
+ declined: "declined";
439
+ failed: "failed";
440
+ in_progress: "in_progress";
441
+ interrupted: "interrupted";
442
+ }>;
443
+ kind: z.ZodLiteral<"reasoning">;
444
+ text: z.ZodString;
445
+ }, z.core.$strip>, z.ZodObject<{
446
+ id: z.ZodString;
447
+ status: z.ZodEnum<{
448
+ completed: "completed";
449
+ declined: "declined";
450
+ failed: "failed";
451
+ in_progress: "in_progress";
452
+ interrupted: "interrupted";
453
+ }>;
454
+ kind: z.ZodLiteral<"command">;
455
+ command: z.ZodString;
456
+ display: z.ZodOptional<z.ZodString>;
457
+ cwd: z.ZodOptional<z.ZodString>;
458
+ output: z.ZodOptional<z.ZodString>;
459
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
460
+ }, z.core.$strip>, z.ZodObject<{
461
+ id: z.ZodString;
462
+ status: z.ZodEnum<{
463
+ completed: "completed";
464
+ declined: "declined";
465
+ failed: "failed";
466
+ in_progress: "in_progress";
467
+ interrupted: "interrupted";
468
+ }>;
469
+ kind: z.ZodLiteral<"file_change">;
470
+ changes: z.ZodArray<z.ZodObject<{
471
+ path: z.ZodString;
472
+ action: z.ZodEnum<{
473
+ add: "add";
474
+ delete: "delete";
475
+ modify: "modify";
476
+ rename: "rename";
477
+ }>;
478
+ movePath: z.ZodOptional<z.ZodString>;
479
+ diff: z.ZodOptional<z.ZodString>;
480
+ }, z.core.$strip>>;
481
+ }, z.core.$strip>, z.ZodObject<{
482
+ id: z.ZodString;
483
+ status: z.ZodEnum<{
484
+ completed: "completed";
485
+ declined: "declined";
486
+ failed: "failed";
487
+ in_progress: "in_progress";
488
+ interrupted: "interrupted";
489
+ }>;
490
+ kind: z.ZodLiteral<"tool">;
491
+ name: z.ZodString;
492
+ input: z.ZodOptional<z.ZodUnknown>;
493
+ output: z.ZodOptional<z.ZodUnknown>;
494
+ }, z.core.$strip>, z.ZodObject<{
495
+ id: z.ZodString;
496
+ status: z.ZodEnum<{
497
+ completed: "completed";
498
+ declined: "declined";
499
+ failed: "failed";
500
+ in_progress: "in_progress";
501
+ interrupted: "interrupted";
502
+ }>;
503
+ kind: z.ZodLiteral<"todo">;
504
+ entries: z.ZodArray<z.ZodObject<{
505
+ text: z.ZodString;
506
+ done: z.ZodBoolean;
507
+ }, z.core.$strip>>;
508
+ }, z.core.$strip>], "kind">;
509
+ }, z.core.$strip>;
510
+ }, z.core.$strip>;
511
+ export declare const InputRequiredEvent: z.ZodObject<{
512
+ v: z.ZodLiteral<1>;
513
+ kind: z.ZodLiteral<"evt">;
514
+ type: z.ZodLiteral<"input.required">;
515
+ ts: z.ZodNumber;
516
+ sessionId: z.ZodOptional<z.ZodString>;
517
+ seq: z.ZodOptional<z.ZodNumber>;
518
+ payload: z.ZodObject<{
519
+ request: z.ZodObject<{
520
+ requestId: z.ZodString;
521
+ kind: z.ZodEnum<{
522
+ command_approval: "command_approval";
523
+ file_approval: "file_approval";
524
+ plan_approval: "plan_approval";
525
+ question: "question";
526
+ tool_approval: "tool_approval";
527
+ }>;
528
+ itemId: z.ZodOptional<z.ZodString>;
529
+ title: z.ZodString;
530
+ body: z.ZodOptional<z.ZodString>;
531
+ command: z.ZodOptional<z.ZodString>;
532
+ cwd: z.ZodOptional<z.ZodString>;
533
+ changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
534
+ path: z.ZodString;
535
+ action: z.ZodEnum<{
536
+ add: "add";
537
+ delete: "delete";
538
+ modify: "modify";
539
+ rename: "rename";
540
+ }>;
541
+ movePath: z.ZodOptional<z.ZodString>;
542
+ diff: z.ZodOptional<z.ZodString>;
543
+ }, z.core.$strip>>>;
544
+ toolName: z.ZodOptional<z.ZodString>;
545
+ toolInput: z.ZodOptional<z.ZodUnknown>;
546
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
547
+ id: z.ZodString;
548
+ question: z.ZodString;
549
+ options: z.ZodArray<z.ZodObject<{
550
+ label: z.ZodString;
551
+ description: z.ZodOptional<z.ZodString>;
552
+ }, z.core.$strip>>;
553
+ multiSelect: z.ZodBoolean;
554
+ }, z.core.$strip>>>;
555
+ decisions: z.ZodArray<z.ZodObject<{
556
+ id: z.ZodString;
557
+ label: z.ZodString;
558
+ effect: z.ZodEnum<{
559
+ allow: "allow";
560
+ allow_session: "allow_session";
561
+ cancel: "cancel";
562
+ deny: "deny";
563
+ }>;
564
+ }, z.core.$strip>>;
565
+ }, z.core.$strip>;
566
+ }, z.core.$strip>;
567
+ }, z.core.$strip>;
568
+ export declare const InputResolvedEvent: z.ZodObject<{
569
+ v: z.ZodLiteral<1>;
570
+ kind: z.ZodLiteral<"evt">;
571
+ type: z.ZodLiteral<"input.resolved">;
572
+ ts: z.ZodNumber;
573
+ sessionId: z.ZodOptional<z.ZodString>;
574
+ seq: z.ZodOptional<z.ZodNumber>;
575
+ payload: z.ZodObject<{
576
+ requestId: z.ZodString;
577
+ decisionId: z.ZodNullable<z.ZodString>;
578
+ effect: z.ZodEnum<{
579
+ allow: "allow";
580
+ allow_session: "allow_session";
581
+ cancel: "cancel";
582
+ deny: "deny";
583
+ }>;
584
+ by: z.ZodEnum<{
585
+ host: "host";
586
+ policy: "policy";
587
+ user: "user";
588
+ }>;
589
+ }, z.core.$strip>;
590
+ }, z.core.$strip>;
591
+ export declare const ErrorEvent: z.ZodObject<{
592
+ v: z.ZodLiteral<1>;
593
+ kind: z.ZodLiteral<"evt">;
594
+ type: z.ZodLiteral<"error">;
595
+ ts: z.ZodNumber;
596
+ sessionId: z.ZodOptional<z.ZodString>;
597
+ seq: z.ZodOptional<z.ZodNumber>;
598
+ payload: z.ZodObject<{
599
+ code: z.ZodString;
600
+ message: z.ZodString;
601
+ }, z.core.$strip>;
602
+ }, z.core.$strip>;
603
+ /** Provider-specific data with no common shape yet. Clients may ignore it. */
604
+ export declare const ProviderEvent: z.ZodObject<{
605
+ v: z.ZodLiteral<1>;
606
+ kind: z.ZodLiteral<"evt">;
607
+ type: z.ZodLiteral<"provider.event">;
608
+ ts: z.ZodNumber;
609
+ sessionId: z.ZodOptional<z.ZodString>;
610
+ seq: z.ZodOptional<z.ZodNumber>;
611
+ payload: z.ZodObject<{
612
+ name: z.ZodString;
613
+ data: z.ZodUnknown;
614
+ }, z.core.$strip>;
615
+ }, z.core.$strip>;
616
+ /** The PTY size changed. */
617
+ export declare const TerminalSizeEvent: z.ZodObject<{
618
+ v: z.ZodLiteral<1>;
619
+ kind: z.ZodLiteral<"evt">;
620
+ type: z.ZodLiteral<"terminal.size">;
621
+ ts: z.ZodNumber;
622
+ sessionId: z.ZodOptional<z.ZodString>;
623
+ seq: z.ZodOptional<z.ZodNumber>;
624
+ payload: z.ZodObject<{
625
+ cols: z.ZodNumber;
626
+ rows: z.ZodNumber;
627
+ }, z.core.$strip>;
628
+ }, z.core.$strip>;
629
+ /**
630
+ * Clear your terminal: the whole screen follows as output bytes. Sent to everyone
631
+ * attached when a client attaches, since the relay cannot address one client.
632
+ */
633
+ export declare const TerminalResetEvent: z.ZodObject<{
634
+ v: z.ZodLiteral<1>;
635
+ kind: z.ZodLiteral<"evt">;
636
+ type: z.ZodLiteral<"terminal.reset">;
637
+ ts: z.ZodNumber;
638
+ sessionId: z.ZodOptional<z.ZodString>;
639
+ seq: z.ZodOptional<z.ZodNumber>;
640
+ payload: z.ZodObject<{
641
+ cols: z.ZodNumber;
642
+ rows: z.ZodNumber;
643
+ }, z.core.$strip>;
644
+ }, z.core.$strip>;
645
+ export declare const AgentEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
646
+ v: z.ZodLiteral<1>;
647
+ kind: z.ZodLiteral<"evt">;
648
+ type: z.ZodLiteral<"host.ready">;
649
+ ts: z.ZodNumber;
650
+ sessionId: z.ZodOptional<z.ZodString>;
651
+ seq: z.ZodOptional<z.ZodNumber>;
652
+ payload: z.ZodObject<{
653
+ hostId: z.ZodString;
654
+ name: z.ZodString;
655
+ version: z.ZodString;
656
+ protocol: z.ZodLiteral<1>;
657
+ os: z.ZodString;
658
+ providers: z.ZodArray<z.ZodObject<{
659
+ id: z.ZodString;
660
+ kind: z.ZodEnum<{
661
+ agent: "agent";
662
+ terminal: "terminal";
663
+ }>;
664
+ label: z.ZodString;
665
+ available: z.ZodBoolean;
666
+ version: z.ZodNullable<z.ZodString>;
667
+ detail: z.ZodNullable<z.ZodString>;
668
+ }, z.core.$strip>>;
669
+ roots: z.ZodOptional<z.ZodArray<z.ZodString>>;
670
+ }, z.core.$strip>;
671
+ }, z.core.$strip>, z.ZodObject<{
672
+ v: z.ZodLiteral<1>;
673
+ kind: z.ZodLiteral<"evt">;
674
+ type: z.ZodLiteral<"session.created">;
675
+ ts: z.ZodNumber;
676
+ sessionId: z.ZodOptional<z.ZodString>;
677
+ seq: z.ZodOptional<z.ZodNumber>;
678
+ payload: z.ZodObject<{
679
+ session: z.ZodObject<{
680
+ id: z.ZodString;
681
+ kind: z.ZodEnum<{
682
+ agent: "agent";
683
+ terminal: "terminal";
684
+ }>;
685
+ provider: z.ZodString;
686
+ providerSessionId: z.ZodNullable<z.ZodString>;
687
+ cwd: z.ZodString;
688
+ title: z.ZodNullable<z.ZodString>;
689
+ status: z.ZodEnum<{
690
+ closed: "closed";
691
+ idle: "idle";
692
+ running: "running";
693
+ starting: "starting";
694
+ waiting_input: "waiting_input";
695
+ }>;
696
+ createdAt: z.ZodNumber;
697
+ updatedAt: z.ZodNumber;
698
+ lastSeq: z.ZodNumber;
699
+ autoApprove: z.ZodOptional<z.ZodEnum<{
700
+ all: "all";
701
+ edits: "edits";
702
+ off: "off";
703
+ }>>;
704
+ cols: z.ZodOptional<z.ZodNumber>;
705
+ rows: z.ZodOptional<z.ZodNumber>;
706
+ pid: z.ZodOptional<z.ZodNumber>;
707
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
708
+ }, z.core.$strip>;
709
+ }, z.core.$strip>;
710
+ }, z.core.$strip>, z.ZodObject<{
711
+ v: z.ZodLiteral<1>;
712
+ kind: z.ZodLiteral<"evt">;
713
+ type: z.ZodLiteral<"session.updated">;
714
+ ts: z.ZodNumber;
715
+ sessionId: z.ZodOptional<z.ZodString>;
716
+ seq: z.ZodOptional<z.ZodNumber>;
717
+ payload: z.ZodObject<{
718
+ session: z.ZodObject<{
719
+ id: z.ZodString;
720
+ kind: z.ZodEnum<{
721
+ agent: "agent";
722
+ terminal: "terminal";
723
+ }>;
724
+ provider: z.ZodString;
725
+ providerSessionId: z.ZodNullable<z.ZodString>;
726
+ cwd: z.ZodString;
727
+ title: z.ZodNullable<z.ZodString>;
728
+ status: z.ZodEnum<{
729
+ closed: "closed";
730
+ idle: "idle";
731
+ running: "running";
732
+ starting: "starting";
733
+ waiting_input: "waiting_input";
734
+ }>;
735
+ createdAt: z.ZodNumber;
736
+ updatedAt: z.ZodNumber;
737
+ lastSeq: z.ZodNumber;
738
+ autoApprove: z.ZodOptional<z.ZodEnum<{
739
+ all: "all";
740
+ edits: "edits";
741
+ off: "off";
742
+ }>>;
743
+ cols: z.ZodOptional<z.ZodNumber>;
744
+ rows: z.ZodOptional<z.ZodNumber>;
745
+ pid: z.ZodOptional<z.ZodNumber>;
746
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
747
+ }, z.core.$strip>;
748
+ }, z.core.$strip>;
749
+ }, z.core.$strip>, z.ZodObject<{
750
+ v: z.ZodLiteral<1>;
751
+ kind: z.ZodLiteral<"evt">;
752
+ type: z.ZodLiteral<"session.closed">;
753
+ ts: z.ZodNumber;
754
+ sessionId: z.ZodOptional<z.ZodString>;
755
+ seq: z.ZodOptional<z.ZodNumber>;
756
+ payload: z.ZodObject<{
757
+ session: z.ZodObject<{
758
+ id: z.ZodString;
759
+ kind: z.ZodEnum<{
760
+ agent: "agent";
761
+ terminal: "terminal";
762
+ }>;
763
+ provider: z.ZodString;
764
+ providerSessionId: z.ZodNullable<z.ZodString>;
765
+ cwd: z.ZodString;
766
+ title: z.ZodNullable<z.ZodString>;
767
+ status: z.ZodEnum<{
768
+ closed: "closed";
769
+ idle: "idle";
770
+ running: "running";
771
+ starting: "starting";
772
+ waiting_input: "waiting_input";
773
+ }>;
774
+ createdAt: z.ZodNumber;
775
+ updatedAt: z.ZodNumber;
776
+ lastSeq: z.ZodNumber;
777
+ autoApprove: z.ZodOptional<z.ZodEnum<{
778
+ all: "all";
779
+ edits: "edits";
780
+ off: "off";
781
+ }>>;
782
+ cols: z.ZodOptional<z.ZodNumber>;
783
+ rows: z.ZodOptional<z.ZodNumber>;
784
+ pid: z.ZodOptional<z.ZodNumber>;
785
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
786
+ }, z.core.$strip>;
787
+ reason: z.ZodNullable<z.ZodString>;
788
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
789
+ }, z.core.$strip>;
790
+ }, z.core.$strip>, z.ZodObject<{
791
+ v: z.ZodLiteral<1>;
792
+ kind: z.ZodLiteral<"evt">;
793
+ type: z.ZodLiteral<"turn.started">;
794
+ ts: z.ZodNumber;
795
+ sessionId: z.ZodOptional<z.ZodString>;
796
+ seq: z.ZodOptional<z.ZodNumber>;
797
+ payload: z.ZodObject<{
798
+ turnId: z.ZodString;
799
+ userItemId: z.ZodOptional<z.ZodString>;
800
+ }, z.core.$strip>;
801
+ }, z.core.$strip>, z.ZodObject<{
802
+ v: z.ZodLiteral<1>;
803
+ kind: z.ZodLiteral<"evt">;
804
+ type: z.ZodLiteral<"turn.completed">;
805
+ ts: z.ZodNumber;
806
+ sessionId: z.ZodOptional<z.ZodString>;
807
+ seq: z.ZodOptional<z.ZodNumber>;
808
+ payload: z.ZodObject<{
809
+ turnId: z.ZodString;
810
+ status: z.ZodEnum<{
811
+ completed: "completed";
812
+ failed: "failed";
813
+ interrupted: "interrupted";
814
+ }>;
815
+ usage: z.ZodOptional<z.ZodObject<{
816
+ inputTokens: z.ZodNumber;
817
+ outputTokens: z.ZodNumber;
818
+ costUsd: z.ZodOptional<z.ZodNumber>;
819
+ }, z.core.$strip>>;
820
+ error: z.ZodOptional<z.ZodString>;
821
+ }, z.core.$strip>;
822
+ }, z.core.$strip>, z.ZodObject<{
823
+ v: z.ZodLiteral<1>;
824
+ kind: z.ZodLiteral<"evt">;
825
+ type: z.ZodLiteral<"item.started">;
826
+ ts: z.ZodNumber;
827
+ sessionId: z.ZodOptional<z.ZodString>;
828
+ seq: z.ZodOptional<z.ZodNumber>;
829
+ payload: z.ZodObject<{
830
+ turnId: z.ZodNullable<z.ZodString>;
831
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
832
+ id: z.ZodString;
833
+ status: z.ZodEnum<{
834
+ completed: "completed";
835
+ declined: "declined";
836
+ failed: "failed";
837
+ in_progress: "in_progress";
838
+ interrupted: "interrupted";
839
+ }>;
840
+ kind: z.ZodLiteral<"message">;
841
+ role: z.ZodEnum<{
842
+ assistant: "assistant";
843
+ user: "user";
844
+ }>;
845
+ text: z.ZodString;
846
+ }, z.core.$strip>, z.ZodObject<{
847
+ id: z.ZodString;
848
+ status: z.ZodEnum<{
849
+ completed: "completed";
850
+ declined: "declined";
851
+ failed: "failed";
852
+ in_progress: "in_progress";
853
+ interrupted: "interrupted";
854
+ }>;
855
+ kind: z.ZodLiteral<"reasoning">;
856
+ text: z.ZodString;
857
+ }, z.core.$strip>, z.ZodObject<{
858
+ id: z.ZodString;
859
+ status: z.ZodEnum<{
860
+ completed: "completed";
861
+ declined: "declined";
862
+ failed: "failed";
863
+ in_progress: "in_progress";
864
+ interrupted: "interrupted";
865
+ }>;
866
+ kind: z.ZodLiteral<"command">;
867
+ command: z.ZodString;
868
+ display: z.ZodOptional<z.ZodString>;
869
+ cwd: z.ZodOptional<z.ZodString>;
870
+ output: z.ZodOptional<z.ZodString>;
871
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
872
+ }, z.core.$strip>, z.ZodObject<{
873
+ id: z.ZodString;
874
+ status: z.ZodEnum<{
875
+ completed: "completed";
876
+ declined: "declined";
877
+ failed: "failed";
878
+ in_progress: "in_progress";
879
+ interrupted: "interrupted";
880
+ }>;
881
+ kind: z.ZodLiteral<"file_change">;
882
+ changes: z.ZodArray<z.ZodObject<{
883
+ path: z.ZodString;
884
+ action: z.ZodEnum<{
885
+ add: "add";
886
+ delete: "delete";
887
+ modify: "modify";
888
+ rename: "rename";
889
+ }>;
890
+ movePath: z.ZodOptional<z.ZodString>;
891
+ diff: z.ZodOptional<z.ZodString>;
892
+ }, z.core.$strip>>;
893
+ }, z.core.$strip>, z.ZodObject<{
894
+ id: z.ZodString;
895
+ status: z.ZodEnum<{
896
+ completed: "completed";
897
+ declined: "declined";
898
+ failed: "failed";
899
+ in_progress: "in_progress";
900
+ interrupted: "interrupted";
901
+ }>;
902
+ kind: z.ZodLiteral<"tool">;
903
+ name: z.ZodString;
904
+ input: z.ZodOptional<z.ZodUnknown>;
905
+ output: z.ZodOptional<z.ZodUnknown>;
906
+ }, z.core.$strip>, z.ZodObject<{
907
+ id: z.ZodString;
908
+ status: z.ZodEnum<{
909
+ completed: "completed";
910
+ declined: "declined";
911
+ failed: "failed";
912
+ in_progress: "in_progress";
913
+ interrupted: "interrupted";
914
+ }>;
915
+ kind: z.ZodLiteral<"todo">;
916
+ entries: z.ZodArray<z.ZodObject<{
917
+ text: z.ZodString;
918
+ done: z.ZodBoolean;
919
+ }, z.core.$strip>>;
920
+ }, z.core.$strip>], "kind">;
921
+ }, z.core.$strip>;
922
+ }, z.core.$strip>, z.ZodObject<{
923
+ v: z.ZodLiteral<1>;
924
+ kind: z.ZodLiteral<"evt">;
925
+ type: z.ZodLiteral<"item.delta">;
926
+ ts: z.ZodNumber;
927
+ sessionId: z.ZodOptional<z.ZodString>;
928
+ seq: z.ZodOptional<z.ZodNumber>;
929
+ payload: z.ZodObject<{
930
+ itemId: z.ZodString;
931
+ field: z.ZodEnum<{
932
+ output: "output";
933
+ text: "text";
934
+ }>;
935
+ delta: z.ZodString;
936
+ }, z.core.$strip>;
937
+ }, z.core.$strip>, z.ZodObject<{
938
+ v: z.ZodLiteral<1>;
939
+ kind: z.ZodLiteral<"evt">;
940
+ type: z.ZodLiteral<"item.updated">;
941
+ ts: z.ZodNumber;
942
+ sessionId: z.ZodOptional<z.ZodString>;
943
+ seq: z.ZodOptional<z.ZodNumber>;
944
+ payload: z.ZodObject<{
945
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
946
+ id: z.ZodString;
947
+ status: z.ZodEnum<{
948
+ completed: "completed";
949
+ declined: "declined";
950
+ failed: "failed";
951
+ in_progress: "in_progress";
952
+ interrupted: "interrupted";
953
+ }>;
954
+ kind: z.ZodLiteral<"message">;
955
+ role: z.ZodEnum<{
956
+ assistant: "assistant";
957
+ user: "user";
958
+ }>;
959
+ text: z.ZodString;
960
+ }, z.core.$strip>, z.ZodObject<{
961
+ id: z.ZodString;
962
+ status: z.ZodEnum<{
963
+ completed: "completed";
964
+ declined: "declined";
965
+ failed: "failed";
966
+ in_progress: "in_progress";
967
+ interrupted: "interrupted";
968
+ }>;
969
+ kind: z.ZodLiteral<"reasoning">;
970
+ text: z.ZodString;
971
+ }, z.core.$strip>, z.ZodObject<{
972
+ id: z.ZodString;
973
+ status: z.ZodEnum<{
974
+ completed: "completed";
975
+ declined: "declined";
976
+ failed: "failed";
977
+ in_progress: "in_progress";
978
+ interrupted: "interrupted";
979
+ }>;
980
+ kind: z.ZodLiteral<"command">;
981
+ command: z.ZodString;
982
+ display: z.ZodOptional<z.ZodString>;
983
+ cwd: z.ZodOptional<z.ZodString>;
984
+ output: z.ZodOptional<z.ZodString>;
985
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
986
+ }, z.core.$strip>, z.ZodObject<{
987
+ id: z.ZodString;
988
+ status: z.ZodEnum<{
989
+ completed: "completed";
990
+ declined: "declined";
991
+ failed: "failed";
992
+ in_progress: "in_progress";
993
+ interrupted: "interrupted";
994
+ }>;
995
+ kind: z.ZodLiteral<"file_change">;
996
+ changes: z.ZodArray<z.ZodObject<{
997
+ path: z.ZodString;
998
+ action: z.ZodEnum<{
999
+ add: "add";
1000
+ delete: "delete";
1001
+ modify: "modify";
1002
+ rename: "rename";
1003
+ }>;
1004
+ movePath: z.ZodOptional<z.ZodString>;
1005
+ diff: z.ZodOptional<z.ZodString>;
1006
+ }, z.core.$strip>>;
1007
+ }, z.core.$strip>, z.ZodObject<{
1008
+ id: z.ZodString;
1009
+ status: z.ZodEnum<{
1010
+ completed: "completed";
1011
+ declined: "declined";
1012
+ failed: "failed";
1013
+ in_progress: "in_progress";
1014
+ interrupted: "interrupted";
1015
+ }>;
1016
+ kind: z.ZodLiteral<"tool">;
1017
+ name: z.ZodString;
1018
+ input: z.ZodOptional<z.ZodUnknown>;
1019
+ output: z.ZodOptional<z.ZodUnknown>;
1020
+ }, z.core.$strip>, z.ZodObject<{
1021
+ id: z.ZodString;
1022
+ status: z.ZodEnum<{
1023
+ completed: "completed";
1024
+ declined: "declined";
1025
+ failed: "failed";
1026
+ in_progress: "in_progress";
1027
+ interrupted: "interrupted";
1028
+ }>;
1029
+ kind: z.ZodLiteral<"todo">;
1030
+ entries: z.ZodArray<z.ZodObject<{
1031
+ text: z.ZodString;
1032
+ done: z.ZodBoolean;
1033
+ }, z.core.$strip>>;
1034
+ }, z.core.$strip>], "kind">;
1035
+ }, z.core.$strip>;
1036
+ }, z.core.$strip>, z.ZodObject<{
1037
+ v: z.ZodLiteral<1>;
1038
+ kind: z.ZodLiteral<"evt">;
1039
+ type: z.ZodLiteral<"item.completed">;
1040
+ ts: z.ZodNumber;
1041
+ sessionId: z.ZodOptional<z.ZodString>;
1042
+ seq: z.ZodOptional<z.ZodNumber>;
1043
+ payload: z.ZodObject<{
1044
+ turnId: z.ZodNullable<z.ZodString>;
1045
+ item: z.ZodDiscriminatedUnion<[z.ZodObject<{
1046
+ id: z.ZodString;
1047
+ status: z.ZodEnum<{
1048
+ completed: "completed";
1049
+ declined: "declined";
1050
+ failed: "failed";
1051
+ in_progress: "in_progress";
1052
+ interrupted: "interrupted";
1053
+ }>;
1054
+ kind: z.ZodLiteral<"message">;
1055
+ role: z.ZodEnum<{
1056
+ assistant: "assistant";
1057
+ user: "user";
1058
+ }>;
1059
+ text: z.ZodString;
1060
+ }, z.core.$strip>, z.ZodObject<{
1061
+ id: z.ZodString;
1062
+ status: z.ZodEnum<{
1063
+ completed: "completed";
1064
+ declined: "declined";
1065
+ failed: "failed";
1066
+ in_progress: "in_progress";
1067
+ interrupted: "interrupted";
1068
+ }>;
1069
+ kind: z.ZodLiteral<"reasoning">;
1070
+ text: z.ZodString;
1071
+ }, z.core.$strip>, z.ZodObject<{
1072
+ id: z.ZodString;
1073
+ status: z.ZodEnum<{
1074
+ completed: "completed";
1075
+ declined: "declined";
1076
+ failed: "failed";
1077
+ in_progress: "in_progress";
1078
+ interrupted: "interrupted";
1079
+ }>;
1080
+ kind: z.ZodLiteral<"command">;
1081
+ command: z.ZodString;
1082
+ display: z.ZodOptional<z.ZodString>;
1083
+ cwd: z.ZodOptional<z.ZodString>;
1084
+ output: z.ZodOptional<z.ZodString>;
1085
+ exitCode: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1086
+ }, z.core.$strip>, z.ZodObject<{
1087
+ id: z.ZodString;
1088
+ status: z.ZodEnum<{
1089
+ completed: "completed";
1090
+ declined: "declined";
1091
+ failed: "failed";
1092
+ in_progress: "in_progress";
1093
+ interrupted: "interrupted";
1094
+ }>;
1095
+ kind: z.ZodLiteral<"file_change">;
1096
+ changes: z.ZodArray<z.ZodObject<{
1097
+ path: z.ZodString;
1098
+ action: z.ZodEnum<{
1099
+ add: "add";
1100
+ delete: "delete";
1101
+ modify: "modify";
1102
+ rename: "rename";
1103
+ }>;
1104
+ movePath: z.ZodOptional<z.ZodString>;
1105
+ diff: z.ZodOptional<z.ZodString>;
1106
+ }, z.core.$strip>>;
1107
+ }, z.core.$strip>, z.ZodObject<{
1108
+ id: z.ZodString;
1109
+ status: z.ZodEnum<{
1110
+ completed: "completed";
1111
+ declined: "declined";
1112
+ failed: "failed";
1113
+ in_progress: "in_progress";
1114
+ interrupted: "interrupted";
1115
+ }>;
1116
+ kind: z.ZodLiteral<"tool">;
1117
+ name: z.ZodString;
1118
+ input: z.ZodOptional<z.ZodUnknown>;
1119
+ output: z.ZodOptional<z.ZodUnknown>;
1120
+ }, z.core.$strip>, z.ZodObject<{
1121
+ id: z.ZodString;
1122
+ status: z.ZodEnum<{
1123
+ completed: "completed";
1124
+ declined: "declined";
1125
+ failed: "failed";
1126
+ in_progress: "in_progress";
1127
+ interrupted: "interrupted";
1128
+ }>;
1129
+ kind: z.ZodLiteral<"todo">;
1130
+ entries: z.ZodArray<z.ZodObject<{
1131
+ text: z.ZodString;
1132
+ done: z.ZodBoolean;
1133
+ }, z.core.$strip>>;
1134
+ }, z.core.$strip>], "kind">;
1135
+ }, z.core.$strip>;
1136
+ }, z.core.$strip>, z.ZodObject<{
1137
+ v: z.ZodLiteral<1>;
1138
+ kind: z.ZodLiteral<"evt">;
1139
+ type: z.ZodLiteral<"input.required">;
1140
+ ts: z.ZodNumber;
1141
+ sessionId: z.ZodOptional<z.ZodString>;
1142
+ seq: z.ZodOptional<z.ZodNumber>;
1143
+ payload: z.ZodObject<{
1144
+ request: z.ZodObject<{
1145
+ requestId: z.ZodString;
1146
+ kind: z.ZodEnum<{
1147
+ command_approval: "command_approval";
1148
+ file_approval: "file_approval";
1149
+ plan_approval: "plan_approval";
1150
+ question: "question";
1151
+ tool_approval: "tool_approval";
1152
+ }>;
1153
+ itemId: z.ZodOptional<z.ZodString>;
1154
+ title: z.ZodString;
1155
+ body: z.ZodOptional<z.ZodString>;
1156
+ command: z.ZodOptional<z.ZodString>;
1157
+ cwd: z.ZodOptional<z.ZodString>;
1158
+ changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1159
+ path: z.ZodString;
1160
+ action: z.ZodEnum<{
1161
+ add: "add";
1162
+ delete: "delete";
1163
+ modify: "modify";
1164
+ rename: "rename";
1165
+ }>;
1166
+ movePath: z.ZodOptional<z.ZodString>;
1167
+ diff: z.ZodOptional<z.ZodString>;
1168
+ }, z.core.$strip>>>;
1169
+ toolName: z.ZodOptional<z.ZodString>;
1170
+ toolInput: z.ZodOptional<z.ZodUnknown>;
1171
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1172
+ id: z.ZodString;
1173
+ question: z.ZodString;
1174
+ options: z.ZodArray<z.ZodObject<{
1175
+ label: z.ZodString;
1176
+ description: z.ZodOptional<z.ZodString>;
1177
+ }, z.core.$strip>>;
1178
+ multiSelect: z.ZodBoolean;
1179
+ }, z.core.$strip>>>;
1180
+ decisions: z.ZodArray<z.ZodObject<{
1181
+ id: z.ZodString;
1182
+ label: z.ZodString;
1183
+ effect: z.ZodEnum<{
1184
+ allow: "allow";
1185
+ allow_session: "allow_session";
1186
+ cancel: "cancel";
1187
+ deny: "deny";
1188
+ }>;
1189
+ }, z.core.$strip>>;
1190
+ }, z.core.$strip>;
1191
+ }, z.core.$strip>;
1192
+ }, z.core.$strip>, z.ZodObject<{
1193
+ v: z.ZodLiteral<1>;
1194
+ kind: z.ZodLiteral<"evt">;
1195
+ type: z.ZodLiteral<"input.resolved">;
1196
+ ts: z.ZodNumber;
1197
+ sessionId: z.ZodOptional<z.ZodString>;
1198
+ seq: z.ZodOptional<z.ZodNumber>;
1199
+ payload: z.ZodObject<{
1200
+ requestId: z.ZodString;
1201
+ decisionId: z.ZodNullable<z.ZodString>;
1202
+ effect: z.ZodEnum<{
1203
+ allow: "allow";
1204
+ allow_session: "allow_session";
1205
+ cancel: "cancel";
1206
+ deny: "deny";
1207
+ }>;
1208
+ by: z.ZodEnum<{
1209
+ host: "host";
1210
+ policy: "policy";
1211
+ user: "user";
1212
+ }>;
1213
+ }, z.core.$strip>;
1214
+ }, z.core.$strip>, z.ZodObject<{
1215
+ v: z.ZodLiteral<1>;
1216
+ kind: z.ZodLiteral<"evt">;
1217
+ type: z.ZodLiteral<"error">;
1218
+ ts: z.ZodNumber;
1219
+ sessionId: z.ZodOptional<z.ZodString>;
1220
+ seq: z.ZodOptional<z.ZodNumber>;
1221
+ payload: z.ZodObject<{
1222
+ code: z.ZodString;
1223
+ message: z.ZodString;
1224
+ }, z.core.$strip>;
1225
+ }, z.core.$strip>, z.ZodObject<{
1226
+ v: z.ZodLiteral<1>;
1227
+ kind: z.ZodLiteral<"evt">;
1228
+ type: z.ZodLiteral<"provider.event">;
1229
+ ts: z.ZodNumber;
1230
+ sessionId: z.ZodOptional<z.ZodString>;
1231
+ seq: z.ZodOptional<z.ZodNumber>;
1232
+ payload: z.ZodObject<{
1233
+ name: z.ZodString;
1234
+ data: z.ZodUnknown;
1235
+ }, z.core.$strip>;
1236
+ }, z.core.$strip>, z.ZodObject<{
1237
+ v: z.ZodLiteral<1>;
1238
+ kind: z.ZodLiteral<"evt">;
1239
+ type: z.ZodLiteral<"terminal.size">;
1240
+ ts: z.ZodNumber;
1241
+ sessionId: z.ZodOptional<z.ZodString>;
1242
+ seq: z.ZodOptional<z.ZodNumber>;
1243
+ payload: z.ZodObject<{
1244
+ cols: z.ZodNumber;
1245
+ rows: z.ZodNumber;
1246
+ }, z.core.$strip>;
1247
+ }, z.core.$strip>, z.ZodObject<{
1248
+ v: z.ZodLiteral<1>;
1249
+ kind: z.ZodLiteral<"evt">;
1250
+ type: z.ZodLiteral<"terminal.reset">;
1251
+ ts: z.ZodNumber;
1252
+ sessionId: z.ZodOptional<z.ZodString>;
1253
+ seq: z.ZodOptional<z.ZodNumber>;
1254
+ payload: z.ZodObject<{
1255
+ cols: z.ZodNumber;
1256
+ rows: z.ZodNumber;
1257
+ }, z.core.$strip>;
1258
+ }, z.core.$strip>], "type">;
1259
+ export type AgentEvent = z.infer<typeof AgentEvent>;
1260
+ export type EventType = AgentEvent["type"];
1261
+ export type EventOf<T extends EventType> = Extract<AgentEvent, {
1262
+ type: T;
1263
+ }>;
1264
+ export type EventPayload<T extends EventType> = EventOf<T>["payload"];
1265
+ /** Session events that get a seq and are kept for replay. Everything else is ephemeral. */
1266
+ export declare const DURABLE_EVENT_TYPES: readonly ["turn.started", "turn.completed", "item.started", "item.completed", "input.required", "input.resolved", "error"];
1267
+ export declare function isDurableEvent(type: EventType): boolean;
1268
+ //# sourceMappingURL=events.d.ts.map