@layernorm/overlay-agent-bridge-protocol 0.3.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,3602 @@
1
+ import { z } from 'zod';
2
+ export declare const OVERLAY_AGENT_PROTOCOL_VERSION: 1;
3
+ export declare const MAX_COMMANDS_PER_POLL = 50;
4
+ export declare const MAX_COMMAND_BYTES: number;
5
+ export declare const MAX_EVENTS_PER_BATCH = 100;
6
+ export declare const MAX_EVENT_BATCH_BYTES: number;
7
+ export declare const MAX_HOST_REQUEST_BYTES: number;
8
+ export declare const filesystemGrantSchema: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
9
+ mode: z.ZodLiteral<"selected_roots">;
10
+ roots: z.ZodArray<z.ZodString, "many">;
11
+ }, "strict", z.ZodTypeAny, {
12
+ mode: "selected_roots";
13
+ roots: string[];
14
+ }, {
15
+ mode: "selected_roots";
16
+ roots: string[];
17
+ }>, z.ZodObject<{
18
+ mode: z.ZodLiteral<"all_user_files">;
19
+ }, "strict", z.ZodTypeAny, {
20
+ mode: "all_user_files";
21
+ }, {
22
+ mode: "all_user_files";
23
+ }>]>;
24
+ export type FilesystemGrant = z.infer<typeof filesystemGrantSchema>;
25
+ export declare const adapterCapabilitySchema: z.ZodObject<{
26
+ id: z.ZodString;
27
+ displayName: z.ZodString;
28
+ protocol: z.ZodEnum<["fake", "acp", "eve", "native"]>;
29
+ version: z.ZodOptional<z.ZodString>;
30
+ supports: z.ZodObject<{
31
+ prompt: z.ZodBoolean;
32
+ approval: z.ZodBoolean;
33
+ cancel: z.ZodBoolean;
34
+ resume: z.ZodBoolean;
35
+ }, "strict", z.ZodTypeAny, {
36
+ prompt: boolean;
37
+ approval: boolean;
38
+ cancel: boolean;
39
+ resume: boolean;
40
+ }, {
41
+ prompt: boolean;
42
+ approval: boolean;
43
+ cancel: boolean;
44
+ resume: boolean;
45
+ }>;
46
+ }, "strict", z.ZodTypeAny, {
47
+ id: string;
48
+ displayName: string;
49
+ protocol: "fake" | "acp" | "eve" | "native";
50
+ supports: {
51
+ prompt: boolean;
52
+ approval: boolean;
53
+ cancel: boolean;
54
+ resume: boolean;
55
+ };
56
+ version?: string | undefined;
57
+ }, {
58
+ id: string;
59
+ displayName: string;
60
+ protocol: "fake" | "acp" | "eve" | "native";
61
+ supports: {
62
+ prompt: boolean;
63
+ approval: boolean;
64
+ cancel: boolean;
65
+ resume: boolean;
66
+ };
67
+ version?: string | undefined;
68
+ }>;
69
+ export type AdapterCapability = z.infer<typeof adapterCapabilitySchema>;
70
+ export declare const hostCapabilitiesSchema: z.ZodObject<{
71
+ protocolVersion: z.ZodLiteral<1>;
72
+ hostVersion: z.ZodString;
73
+ platform: z.ZodString;
74
+ adapters: z.ZodArray<z.ZodObject<{
75
+ id: z.ZodString;
76
+ displayName: z.ZodString;
77
+ protocol: z.ZodEnum<["fake", "acp", "eve", "native"]>;
78
+ version: z.ZodOptional<z.ZodString>;
79
+ supports: z.ZodObject<{
80
+ prompt: z.ZodBoolean;
81
+ approval: z.ZodBoolean;
82
+ cancel: z.ZodBoolean;
83
+ resume: z.ZodBoolean;
84
+ }, "strict", z.ZodTypeAny, {
85
+ prompt: boolean;
86
+ approval: boolean;
87
+ cancel: boolean;
88
+ resume: boolean;
89
+ }, {
90
+ prompt: boolean;
91
+ approval: boolean;
92
+ cancel: boolean;
93
+ resume: boolean;
94
+ }>;
95
+ }, "strict", z.ZodTypeAny, {
96
+ id: string;
97
+ displayName: string;
98
+ protocol: "fake" | "acp" | "eve" | "native";
99
+ supports: {
100
+ prompt: boolean;
101
+ approval: boolean;
102
+ cancel: boolean;
103
+ resume: boolean;
104
+ };
105
+ version?: string | undefined;
106
+ }, {
107
+ id: string;
108
+ displayName: string;
109
+ protocol: "fake" | "acp" | "eve" | "native";
110
+ supports: {
111
+ prompt: boolean;
112
+ approval: boolean;
113
+ cancel: boolean;
114
+ resume: boolean;
115
+ };
116
+ version?: string | undefined;
117
+ }>, "many">;
118
+ filesystem: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
119
+ mode: z.ZodLiteral<"selected_roots">;
120
+ roots: z.ZodArray<z.ZodString, "many">;
121
+ }, "strict", z.ZodTypeAny, {
122
+ mode: "selected_roots";
123
+ roots: string[];
124
+ }, {
125
+ mode: "selected_roots";
126
+ roots: string[];
127
+ }>, z.ZodObject<{
128
+ mode: z.ZodLiteral<"all_user_files">;
129
+ }, "strict", z.ZodTypeAny, {
130
+ mode: "all_user_files";
131
+ }, {
132
+ mode: "all_user_files";
133
+ }>]>;
134
+ maxConcurrentRuns: z.ZodNumber;
135
+ }, "strict", z.ZodTypeAny, {
136
+ protocolVersion: 1;
137
+ hostVersion: string;
138
+ platform: string;
139
+ adapters: {
140
+ id: string;
141
+ displayName: string;
142
+ protocol: "fake" | "acp" | "eve" | "native";
143
+ supports: {
144
+ prompt: boolean;
145
+ approval: boolean;
146
+ cancel: boolean;
147
+ resume: boolean;
148
+ };
149
+ version?: string | undefined;
150
+ }[];
151
+ filesystem: {
152
+ mode: "selected_roots";
153
+ roots: string[];
154
+ } | {
155
+ mode: "all_user_files";
156
+ };
157
+ maxConcurrentRuns: number;
158
+ }, {
159
+ protocolVersion: 1;
160
+ hostVersion: string;
161
+ platform: string;
162
+ adapters: {
163
+ id: string;
164
+ displayName: string;
165
+ protocol: "fake" | "acp" | "eve" | "native";
166
+ supports: {
167
+ prompt: boolean;
168
+ approval: boolean;
169
+ cancel: boolean;
170
+ resume: boolean;
171
+ };
172
+ version?: string | undefined;
173
+ }[];
174
+ filesystem: {
175
+ mode: "selected_roots";
176
+ roots: string[];
177
+ } | {
178
+ mode: "all_user_files";
179
+ };
180
+ maxConcurrentRuns: number;
181
+ }>;
182
+ export type HostCapabilities = z.infer<typeof hostCapabilitiesSchema>;
183
+ export declare const enrollmentRequestSchema: z.ZodObject<{
184
+ code: z.ZodString;
185
+ name: z.ZodString;
186
+ publicKey: z.ZodString;
187
+ hostVersion: z.ZodString;
188
+ platform: z.ZodString;
189
+ capabilities: z.ZodObject<{
190
+ protocolVersion: z.ZodLiteral<1>;
191
+ hostVersion: z.ZodString;
192
+ platform: z.ZodString;
193
+ adapters: z.ZodArray<z.ZodObject<{
194
+ id: z.ZodString;
195
+ displayName: z.ZodString;
196
+ protocol: z.ZodEnum<["fake", "acp", "eve", "native"]>;
197
+ version: z.ZodOptional<z.ZodString>;
198
+ supports: z.ZodObject<{
199
+ prompt: z.ZodBoolean;
200
+ approval: z.ZodBoolean;
201
+ cancel: z.ZodBoolean;
202
+ resume: z.ZodBoolean;
203
+ }, "strict", z.ZodTypeAny, {
204
+ prompt: boolean;
205
+ approval: boolean;
206
+ cancel: boolean;
207
+ resume: boolean;
208
+ }, {
209
+ prompt: boolean;
210
+ approval: boolean;
211
+ cancel: boolean;
212
+ resume: boolean;
213
+ }>;
214
+ }, "strict", z.ZodTypeAny, {
215
+ id: string;
216
+ displayName: string;
217
+ protocol: "fake" | "acp" | "eve" | "native";
218
+ supports: {
219
+ prompt: boolean;
220
+ approval: boolean;
221
+ cancel: boolean;
222
+ resume: boolean;
223
+ };
224
+ version?: string | undefined;
225
+ }, {
226
+ id: string;
227
+ displayName: string;
228
+ protocol: "fake" | "acp" | "eve" | "native";
229
+ supports: {
230
+ prompt: boolean;
231
+ approval: boolean;
232
+ cancel: boolean;
233
+ resume: boolean;
234
+ };
235
+ version?: string | undefined;
236
+ }>, "many">;
237
+ filesystem: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
238
+ mode: z.ZodLiteral<"selected_roots">;
239
+ roots: z.ZodArray<z.ZodString, "many">;
240
+ }, "strict", z.ZodTypeAny, {
241
+ mode: "selected_roots";
242
+ roots: string[];
243
+ }, {
244
+ mode: "selected_roots";
245
+ roots: string[];
246
+ }>, z.ZodObject<{
247
+ mode: z.ZodLiteral<"all_user_files">;
248
+ }, "strict", z.ZodTypeAny, {
249
+ mode: "all_user_files";
250
+ }, {
251
+ mode: "all_user_files";
252
+ }>]>;
253
+ maxConcurrentRuns: z.ZodNumber;
254
+ }, "strict", z.ZodTypeAny, {
255
+ protocolVersion: 1;
256
+ hostVersion: string;
257
+ platform: string;
258
+ adapters: {
259
+ id: string;
260
+ displayName: string;
261
+ protocol: "fake" | "acp" | "eve" | "native";
262
+ supports: {
263
+ prompt: boolean;
264
+ approval: boolean;
265
+ cancel: boolean;
266
+ resume: boolean;
267
+ };
268
+ version?: string | undefined;
269
+ }[];
270
+ filesystem: {
271
+ mode: "selected_roots";
272
+ roots: string[];
273
+ } | {
274
+ mode: "all_user_files";
275
+ };
276
+ maxConcurrentRuns: number;
277
+ }, {
278
+ protocolVersion: 1;
279
+ hostVersion: string;
280
+ platform: string;
281
+ adapters: {
282
+ id: string;
283
+ displayName: string;
284
+ protocol: "fake" | "acp" | "eve" | "native";
285
+ supports: {
286
+ prompt: boolean;
287
+ approval: boolean;
288
+ cancel: boolean;
289
+ resume: boolean;
290
+ };
291
+ version?: string | undefined;
292
+ }[];
293
+ filesystem: {
294
+ mode: "selected_roots";
295
+ roots: string[];
296
+ } | {
297
+ mode: "all_user_files";
298
+ };
299
+ maxConcurrentRuns: number;
300
+ }>;
301
+ kind: z.ZodDefault<z.ZodEnum<["local", "vps", "overlay_cloud", "external"]>>;
302
+ }, "strict", z.ZodTypeAny, {
303
+ code: string;
304
+ hostVersion: string;
305
+ platform: string;
306
+ name: string;
307
+ publicKey: string;
308
+ capabilities: {
309
+ protocolVersion: 1;
310
+ hostVersion: string;
311
+ platform: string;
312
+ adapters: {
313
+ id: string;
314
+ displayName: string;
315
+ protocol: "fake" | "acp" | "eve" | "native";
316
+ supports: {
317
+ prompt: boolean;
318
+ approval: boolean;
319
+ cancel: boolean;
320
+ resume: boolean;
321
+ };
322
+ version?: string | undefined;
323
+ }[];
324
+ filesystem: {
325
+ mode: "selected_roots";
326
+ roots: string[];
327
+ } | {
328
+ mode: "all_user_files";
329
+ };
330
+ maxConcurrentRuns: number;
331
+ };
332
+ kind: "local" | "vps" | "overlay_cloud" | "external";
333
+ }, {
334
+ code: string;
335
+ hostVersion: string;
336
+ platform: string;
337
+ name: string;
338
+ publicKey: string;
339
+ capabilities: {
340
+ protocolVersion: 1;
341
+ hostVersion: string;
342
+ platform: string;
343
+ adapters: {
344
+ id: string;
345
+ displayName: string;
346
+ protocol: "fake" | "acp" | "eve" | "native";
347
+ supports: {
348
+ prompt: boolean;
349
+ approval: boolean;
350
+ cancel: boolean;
351
+ resume: boolean;
352
+ };
353
+ version?: string | undefined;
354
+ }[];
355
+ filesystem: {
356
+ mode: "selected_roots";
357
+ roots: string[];
358
+ } | {
359
+ mode: "all_user_files";
360
+ };
361
+ maxConcurrentRuns: number;
362
+ };
363
+ kind?: "local" | "vps" | "overlay_cloud" | "external" | undefined;
364
+ }>;
365
+ export type EnrollmentRequest = z.infer<typeof enrollmentRequestSchema>;
366
+ export declare const enrollmentResponseSchema: z.ZodObject<{
367
+ protocolVersion: z.ZodLiteral<1>;
368
+ workspaceId: z.ZodString;
369
+ environmentId: z.ZodString;
370
+ verificationPhrase: z.ZodString;
371
+ proofChallenge: z.ZodString;
372
+ proofChallengeExpiresAt: z.ZodNumber;
373
+ }, "strict", z.ZodTypeAny, {
374
+ protocolVersion: 1;
375
+ workspaceId: string;
376
+ environmentId: string;
377
+ verificationPhrase: string;
378
+ proofChallenge: string;
379
+ proofChallengeExpiresAt: number;
380
+ }, {
381
+ protocolVersion: 1;
382
+ workspaceId: string;
383
+ environmentId: string;
384
+ verificationPhrase: string;
385
+ proofChallenge: string;
386
+ proofChallengeExpiresAt: number;
387
+ }>;
388
+ export type EnrollmentResponse = z.infer<typeof enrollmentResponseSchema>;
389
+ export declare const initialCredentialRequestSchema: z.ZodObject<{
390
+ protocolVersion: z.ZodLiteral<1>;
391
+ proofChallenge: z.ZodString;
392
+ signature: z.ZodString;
393
+ }, "strict", z.ZodTypeAny, {
394
+ protocolVersion: 1;
395
+ proofChallenge: string;
396
+ signature: string;
397
+ }, {
398
+ protocolVersion: 1;
399
+ proofChallenge: string;
400
+ signature: string;
401
+ }>;
402
+ export type InitialCredentialRequest = z.infer<typeof initialCredentialRequestSchema>;
403
+ export declare const environmentCredentialResponseSchema: z.ZodObject<{
404
+ protocolVersion: z.ZodLiteral<1>;
405
+ workspaceId: z.ZodString;
406
+ environmentId: z.ZodString;
407
+ audience: z.ZodLiteral<"overlay-agent-control-plane">;
408
+ methods: z.ZodArray<z.ZodEnum<["agent:heartbeat", "agent:capabilities:update", "agent:commands:poll", "agent:commands:ack", "agent:events:write", "agent:artifacts:write", "agent:credentials:refresh"]>, "many">;
409
+ token: z.ZodString;
410
+ expiresAt: z.ZodNumber;
411
+ filesystemGrant: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
412
+ mode: z.ZodLiteral<"selected_roots">;
413
+ roots: z.ZodArray<z.ZodString, "many">;
414
+ }, "strict", z.ZodTypeAny, {
415
+ mode: "selected_roots";
416
+ roots: string[];
417
+ }, {
418
+ mode: "selected_roots";
419
+ roots: string[];
420
+ }>, z.ZodObject<{
421
+ mode: z.ZodLiteral<"all_user_files">;
422
+ }, "strict", z.ZodTypeAny, {
423
+ mode: "all_user_files";
424
+ }, {
425
+ mode: "all_user_files";
426
+ }>]>;
427
+ }, "strict", z.ZodTypeAny, {
428
+ protocolVersion: 1;
429
+ workspaceId: string;
430
+ environmentId: string;
431
+ audience: "overlay-agent-control-plane";
432
+ methods: ("agent:heartbeat" | "agent:capabilities:update" | "agent:commands:poll" | "agent:commands:ack" | "agent:events:write" | "agent:artifacts:write" | "agent:credentials:refresh")[];
433
+ token: string;
434
+ expiresAt: number;
435
+ filesystemGrant: {
436
+ mode: "selected_roots";
437
+ roots: string[];
438
+ } | {
439
+ mode: "all_user_files";
440
+ };
441
+ }, {
442
+ protocolVersion: 1;
443
+ workspaceId: string;
444
+ environmentId: string;
445
+ audience: "overlay-agent-control-plane";
446
+ methods: ("agent:heartbeat" | "agent:capabilities:update" | "agent:commands:poll" | "agent:commands:ack" | "agent:events:write" | "agent:artifacts:write" | "agent:credentials:refresh")[];
447
+ token: string;
448
+ expiresAt: number;
449
+ filesystemGrant: {
450
+ mode: "selected_roots";
451
+ roots: string[];
452
+ } | {
453
+ mode: "all_user_files";
454
+ };
455
+ }>;
456
+ export type EnvironmentCredentialResponse = z.infer<typeof environmentCredentialResponseSchema>;
457
+ export declare const hostRequestProofHeadersSchema: z.ZodObject<{
458
+ timestamp: z.ZodString;
459
+ nonce: z.ZodString;
460
+ signature: z.ZodString;
461
+ }, "strict", z.ZodTypeAny, {
462
+ signature: string;
463
+ timestamp: string;
464
+ nonce: string;
465
+ }, {
466
+ signature: string;
467
+ timestamp: string;
468
+ nonce: string;
469
+ }>;
470
+ export type HostRequestProofHeaders = z.infer<typeof hostRequestProofHeadersSchema>;
471
+ export declare function canonicalEnrollmentProof(environmentId: string, proofChallenge: string): string;
472
+ export declare function canonicalHostRequestProof(input: {
473
+ method: string;
474
+ pathname: string;
475
+ timestamp: string;
476
+ nonce: string;
477
+ bodySha256: string;
478
+ tokenSha256: string;
479
+ }): string;
480
+ export declare const agentHostCommandSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
481
+ protocolVersion: z.ZodLiteral<1>;
482
+ commandId: z.ZodString;
483
+ environmentId: z.ZodString;
484
+ workspaceId: z.ZodString;
485
+ runId: z.ZodString;
486
+ sequence: z.ZodNumber;
487
+ issuedAt: z.ZodNumber;
488
+ } & {
489
+ type: z.ZodLiteral<"start">;
490
+ payload: z.ZodObject<{
491
+ prompt: z.ZodString;
492
+ sessionId: z.ZodOptional<z.ZodString>;
493
+ fresh: z.ZodOptional<z.ZodBoolean>;
494
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
495
+ bindingId: z.ZodString;
496
+ adapterId: z.ZodString;
497
+ workingDirectory: z.ZodString;
498
+ }, "strict", z.ZodTypeAny, {
499
+ prompt: string;
500
+ metadata: Record<string, unknown>;
501
+ bindingId: string;
502
+ adapterId: string;
503
+ workingDirectory: string;
504
+ sessionId?: string | undefined;
505
+ fresh?: boolean | undefined;
506
+ }, {
507
+ prompt: string;
508
+ bindingId: string;
509
+ adapterId: string;
510
+ workingDirectory: string;
511
+ sessionId?: string | undefined;
512
+ fresh?: boolean | undefined;
513
+ metadata?: Record<string, unknown> | undefined;
514
+ }>;
515
+ }, "strict", z.ZodTypeAny, {
516
+ type: "start";
517
+ protocolVersion: 1;
518
+ workspaceId: string;
519
+ environmentId: string;
520
+ commandId: string;
521
+ runId: string;
522
+ sequence: number;
523
+ issuedAt: number;
524
+ payload: {
525
+ prompt: string;
526
+ metadata: Record<string, unknown>;
527
+ bindingId: string;
528
+ adapterId: string;
529
+ workingDirectory: string;
530
+ sessionId?: string | undefined;
531
+ fresh?: boolean | undefined;
532
+ };
533
+ }, {
534
+ type: "start";
535
+ protocolVersion: 1;
536
+ workspaceId: string;
537
+ environmentId: string;
538
+ commandId: string;
539
+ runId: string;
540
+ sequence: number;
541
+ issuedAt: number;
542
+ payload: {
543
+ prompt: string;
544
+ bindingId: string;
545
+ adapterId: string;
546
+ workingDirectory: string;
547
+ sessionId?: string | undefined;
548
+ fresh?: boolean | undefined;
549
+ metadata?: Record<string, unknown> | undefined;
550
+ };
551
+ }>, z.ZodObject<{
552
+ protocolVersion: z.ZodLiteral<1>;
553
+ commandId: z.ZodString;
554
+ environmentId: z.ZodString;
555
+ workspaceId: z.ZodString;
556
+ runId: z.ZodString;
557
+ sequence: z.ZodNumber;
558
+ issuedAt: z.ZodNumber;
559
+ } & {
560
+ type: z.ZodLiteral<"prompt">;
561
+ payload: z.ZodObject<{
562
+ prompt: z.ZodString;
563
+ }, "strict", z.ZodTypeAny, {
564
+ prompt: string;
565
+ }, {
566
+ prompt: string;
567
+ }>;
568
+ }, "strict", z.ZodTypeAny, {
569
+ type: "prompt";
570
+ protocolVersion: 1;
571
+ workspaceId: string;
572
+ environmentId: string;
573
+ commandId: string;
574
+ runId: string;
575
+ sequence: number;
576
+ issuedAt: number;
577
+ payload: {
578
+ prompt: string;
579
+ };
580
+ }, {
581
+ type: "prompt";
582
+ protocolVersion: 1;
583
+ workspaceId: string;
584
+ environmentId: string;
585
+ commandId: string;
586
+ runId: string;
587
+ sequence: number;
588
+ issuedAt: number;
589
+ payload: {
590
+ prompt: string;
591
+ };
592
+ }>, z.ZodObject<{
593
+ protocolVersion: z.ZodLiteral<1>;
594
+ commandId: z.ZodString;
595
+ environmentId: z.ZodString;
596
+ workspaceId: z.ZodString;
597
+ runId: z.ZodString;
598
+ sequence: z.ZodNumber;
599
+ issuedAt: z.ZodNumber;
600
+ } & {
601
+ type: z.ZodLiteral<"approval_response">;
602
+ payload: z.ZodObject<{
603
+ requestKey: z.ZodString;
604
+ optionId: z.ZodString;
605
+ }, "strict", z.ZodTypeAny, {
606
+ requestKey: string;
607
+ optionId: string;
608
+ }, {
609
+ requestKey: string;
610
+ optionId: string;
611
+ }>;
612
+ }, "strict", z.ZodTypeAny, {
613
+ type: "approval_response";
614
+ protocolVersion: 1;
615
+ workspaceId: string;
616
+ environmentId: string;
617
+ commandId: string;
618
+ runId: string;
619
+ sequence: number;
620
+ issuedAt: number;
621
+ payload: {
622
+ requestKey: string;
623
+ optionId: string;
624
+ };
625
+ }, {
626
+ type: "approval_response";
627
+ protocolVersion: 1;
628
+ workspaceId: string;
629
+ environmentId: string;
630
+ commandId: string;
631
+ runId: string;
632
+ sequence: number;
633
+ issuedAt: number;
634
+ payload: {
635
+ requestKey: string;
636
+ optionId: string;
637
+ };
638
+ }>, z.ZodObject<{
639
+ protocolVersion: z.ZodLiteral<1>;
640
+ commandId: z.ZodString;
641
+ environmentId: z.ZodString;
642
+ workspaceId: z.ZodString;
643
+ runId: z.ZodString;
644
+ sequence: z.ZodNumber;
645
+ issuedAt: z.ZodNumber;
646
+ } & {
647
+ type: z.ZodLiteral<"elicitation_response">;
648
+ payload: z.ZodObject<{
649
+ requestKey: z.ZodString;
650
+ action: z.ZodEnum<["accept", "decline", "cancel"]>;
651
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
652
+ }, "strict", z.ZodTypeAny, {
653
+ requestKey: string;
654
+ action: "cancel" | "accept" | "decline";
655
+ content?: Record<string, unknown> | undefined;
656
+ }, {
657
+ requestKey: string;
658
+ action: "cancel" | "accept" | "decline";
659
+ content?: Record<string, unknown> | undefined;
660
+ }>;
661
+ }, "strict", z.ZodTypeAny, {
662
+ type: "elicitation_response";
663
+ protocolVersion: 1;
664
+ workspaceId: string;
665
+ environmentId: string;
666
+ commandId: string;
667
+ runId: string;
668
+ sequence: number;
669
+ issuedAt: number;
670
+ payload: {
671
+ requestKey: string;
672
+ action: "cancel" | "accept" | "decline";
673
+ content?: Record<string, unknown> | undefined;
674
+ };
675
+ }, {
676
+ type: "elicitation_response";
677
+ protocolVersion: 1;
678
+ workspaceId: string;
679
+ environmentId: string;
680
+ commandId: string;
681
+ runId: string;
682
+ sequence: number;
683
+ issuedAt: number;
684
+ payload: {
685
+ requestKey: string;
686
+ action: "cancel" | "accept" | "decline";
687
+ content?: Record<string, unknown> | undefined;
688
+ };
689
+ }>, z.ZodObject<{
690
+ protocolVersion: z.ZodLiteral<1>;
691
+ commandId: z.ZodString;
692
+ environmentId: z.ZodString;
693
+ workspaceId: z.ZodString;
694
+ runId: z.ZodString;
695
+ sequence: z.ZodNumber;
696
+ issuedAt: z.ZodNumber;
697
+ } & {
698
+ type: z.ZodLiteral<"cancel">;
699
+ payload: z.ZodObject<{
700
+ reason: z.ZodOptional<z.ZodString>;
701
+ }, "strict", z.ZodTypeAny, {
702
+ reason?: string | undefined;
703
+ }, {
704
+ reason?: string | undefined;
705
+ }>;
706
+ }, "strict", z.ZodTypeAny, {
707
+ type: "cancel";
708
+ protocolVersion: 1;
709
+ workspaceId: string;
710
+ environmentId: string;
711
+ commandId: string;
712
+ runId: string;
713
+ sequence: number;
714
+ issuedAt: number;
715
+ payload: {
716
+ reason?: string | undefined;
717
+ };
718
+ }, {
719
+ type: "cancel";
720
+ protocolVersion: 1;
721
+ workspaceId: string;
722
+ environmentId: string;
723
+ commandId: string;
724
+ runId: string;
725
+ sequence: number;
726
+ issuedAt: number;
727
+ payload: {
728
+ reason?: string | undefined;
729
+ };
730
+ }>, z.ZodObject<{
731
+ protocolVersion: z.ZodLiteral<1>;
732
+ commandId: z.ZodString;
733
+ environmentId: z.ZodString;
734
+ workspaceId: z.ZodString;
735
+ runId: z.ZodString;
736
+ sequence: z.ZodNumber;
737
+ issuedAt: z.ZodNumber;
738
+ } & {
739
+ type: z.ZodLiteral<"reconnect">;
740
+ payload: z.ZodObject<{
741
+ remoteSessionId: z.ZodString;
742
+ }, "strict", z.ZodTypeAny, {
743
+ remoteSessionId: string;
744
+ }, {
745
+ remoteSessionId: string;
746
+ }>;
747
+ }, "strict", z.ZodTypeAny, {
748
+ type: "reconnect";
749
+ protocolVersion: 1;
750
+ workspaceId: string;
751
+ environmentId: string;
752
+ commandId: string;
753
+ runId: string;
754
+ sequence: number;
755
+ issuedAt: number;
756
+ payload: {
757
+ remoteSessionId: string;
758
+ };
759
+ }, {
760
+ type: "reconnect";
761
+ protocolVersion: 1;
762
+ workspaceId: string;
763
+ environmentId: string;
764
+ commandId: string;
765
+ runId: string;
766
+ sequence: number;
767
+ issuedAt: number;
768
+ payload: {
769
+ remoteSessionId: string;
770
+ };
771
+ }>, z.ZodObject<{
772
+ protocolVersion: z.ZodLiteral<1>;
773
+ commandId: z.ZodString;
774
+ environmentId: z.ZodString;
775
+ workspaceId: z.ZodString;
776
+ runId: z.ZodString;
777
+ sequence: z.ZodNumber;
778
+ issuedAt: z.ZodNumber;
779
+ } & {
780
+ type: z.ZodLiteral<"shutdown">;
781
+ payload: z.ZodObject<{
782
+ reason: z.ZodOptional<z.ZodString>;
783
+ }, "strict", z.ZodTypeAny, {
784
+ reason?: string | undefined;
785
+ }, {
786
+ reason?: string | undefined;
787
+ }>;
788
+ }, "strict", z.ZodTypeAny, {
789
+ type: "shutdown";
790
+ protocolVersion: 1;
791
+ workspaceId: string;
792
+ environmentId: string;
793
+ commandId: string;
794
+ runId: string;
795
+ sequence: number;
796
+ issuedAt: number;
797
+ payload: {
798
+ reason?: string | undefined;
799
+ };
800
+ }, {
801
+ type: "shutdown";
802
+ protocolVersion: 1;
803
+ workspaceId: string;
804
+ environmentId: string;
805
+ commandId: string;
806
+ runId: string;
807
+ sequence: number;
808
+ issuedAt: number;
809
+ payload: {
810
+ reason?: string | undefined;
811
+ };
812
+ }>]>;
813
+ export type AgentHostCommand = z.infer<typeof agentHostCommandSchema>;
814
+ export declare const commandPollResponseSchema: z.ZodEffects<z.ZodObject<{
815
+ protocolVersion: z.ZodLiteral<1>;
816
+ commands: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
817
+ protocolVersion: z.ZodLiteral<1>;
818
+ commandId: z.ZodString;
819
+ environmentId: z.ZodString;
820
+ workspaceId: z.ZodString;
821
+ runId: z.ZodString;
822
+ sequence: z.ZodNumber;
823
+ issuedAt: z.ZodNumber;
824
+ } & {
825
+ type: z.ZodLiteral<"start">;
826
+ payload: z.ZodObject<{
827
+ prompt: z.ZodString;
828
+ sessionId: z.ZodOptional<z.ZodString>;
829
+ fresh: z.ZodOptional<z.ZodBoolean>;
830
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
831
+ bindingId: z.ZodString;
832
+ adapterId: z.ZodString;
833
+ workingDirectory: z.ZodString;
834
+ }, "strict", z.ZodTypeAny, {
835
+ prompt: string;
836
+ metadata: Record<string, unknown>;
837
+ bindingId: string;
838
+ adapterId: string;
839
+ workingDirectory: string;
840
+ sessionId?: string | undefined;
841
+ fresh?: boolean | undefined;
842
+ }, {
843
+ prompt: string;
844
+ bindingId: string;
845
+ adapterId: string;
846
+ workingDirectory: string;
847
+ sessionId?: string | undefined;
848
+ fresh?: boolean | undefined;
849
+ metadata?: Record<string, unknown> | undefined;
850
+ }>;
851
+ }, "strict", z.ZodTypeAny, {
852
+ type: "start";
853
+ protocolVersion: 1;
854
+ workspaceId: string;
855
+ environmentId: string;
856
+ commandId: string;
857
+ runId: string;
858
+ sequence: number;
859
+ issuedAt: number;
860
+ payload: {
861
+ prompt: string;
862
+ metadata: Record<string, unknown>;
863
+ bindingId: string;
864
+ adapterId: string;
865
+ workingDirectory: string;
866
+ sessionId?: string | undefined;
867
+ fresh?: boolean | undefined;
868
+ };
869
+ }, {
870
+ type: "start";
871
+ protocolVersion: 1;
872
+ workspaceId: string;
873
+ environmentId: string;
874
+ commandId: string;
875
+ runId: string;
876
+ sequence: number;
877
+ issuedAt: number;
878
+ payload: {
879
+ prompt: string;
880
+ bindingId: string;
881
+ adapterId: string;
882
+ workingDirectory: string;
883
+ sessionId?: string | undefined;
884
+ fresh?: boolean | undefined;
885
+ metadata?: Record<string, unknown> | undefined;
886
+ };
887
+ }>, z.ZodObject<{
888
+ protocolVersion: z.ZodLiteral<1>;
889
+ commandId: z.ZodString;
890
+ environmentId: z.ZodString;
891
+ workspaceId: z.ZodString;
892
+ runId: z.ZodString;
893
+ sequence: z.ZodNumber;
894
+ issuedAt: z.ZodNumber;
895
+ } & {
896
+ type: z.ZodLiteral<"prompt">;
897
+ payload: z.ZodObject<{
898
+ prompt: z.ZodString;
899
+ }, "strict", z.ZodTypeAny, {
900
+ prompt: string;
901
+ }, {
902
+ prompt: string;
903
+ }>;
904
+ }, "strict", z.ZodTypeAny, {
905
+ type: "prompt";
906
+ protocolVersion: 1;
907
+ workspaceId: string;
908
+ environmentId: string;
909
+ commandId: string;
910
+ runId: string;
911
+ sequence: number;
912
+ issuedAt: number;
913
+ payload: {
914
+ prompt: string;
915
+ };
916
+ }, {
917
+ type: "prompt";
918
+ protocolVersion: 1;
919
+ workspaceId: string;
920
+ environmentId: string;
921
+ commandId: string;
922
+ runId: string;
923
+ sequence: number;
924
+ issuedAt: number;
925
+ payload: {
926
+ prompt: string;
927
+ };
928
+ }>, z.ZodObject<{
929
+ protocolVersion: z.ZodLiteral<1>;
930
+ commandId: z.ZodString;
931
+ environmentId: z.ZodString;
932
+ workspaceId: z.ZodString;
933
+ runId: z.ZodString;
934
+ sequence: z.ZodNumber;
935
+ issuedAt: z.ZodNumber;
936
+ } & {
937
+ type: z.ZodLiteral<"approval_response">;
938
+ payload: z.ZodObject<{
939
+ requestKey: z.ZodString;
940
+ optionId: z.ZodString;
941
+ }, "strict", z.ZodTypeAny, {
942
+ requestKey: string;
943
+ optionId: string;
944
+ }, {
945
+ requestKey: string;
946
+ optionId: string;
947
+ }>;
948
+ }, "strict", z.ZodTypeAny, {
949
+ type: "approval_response";
950
+ protocolVersion: 1;
951
+ workspaceId: string;
952
+ environmentId: string;
953
+ commandId: string;
954
+ runId: string;
955
+ sequence: number;
956
+ issuedAt: number;
957
+ payload: {
958
+ requestKey: string;
959
+ optionId: string;
960
+ };
961
+ }, {
962
+ type: "approval_response";
963
+ protocolVersion: 1;
964
+ workspaceId: string;
965
+ environmentId: string;
966
+ commandId: string;
967
+ runId: string;
968
+ sequence: number;
969
+ issuedAt: number;
970
+ payload: {
971
+ requestKey: string;
972
+ optionId: string;
973
+ };
974
+ }>, z.ZodObject<{
975
+ protocolVersion: z.ZodLiteral<1>;
976
+ commandId: z.ZodString;
977
+ environmentId: z.ZodString;
978
+ workspaceId: z.ZodString;
979
+ runId: z.ZodString;
980
+ sequence: z.ZodNumber;
981
+ issuedAt: z.ZodNumber;
982
+ } & {
983
+ type: z.ZodLiteral<"elicitation_response">;
984
+ payload: z.ZodObject<{
985
+ requestKey: z.ZodString;
986
+ action: z.ZodEnum<["accept", "decline", "cancel"]>;
987
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
988
+ }, "strict", z.ZodTypeAny, {
989
+ requestKey: string;
990
+ action: "cancel" | "accept" | "decline";
991
+ content?: Record<string, unknown> | undefined;
992
+ }, {
993
+ requestKey: string;
994
+ action: "cancel" | "accept" | "decline";
995
+ content?: Record<string, unknown> | undefined;
996
+ }>;
997
+ }, "strict", z.ZodTypeAny, {
998
+ type: "elicitation_response";
999
+ protocolVersion: 1;
1000
+ workspaceId: string;
1001
+ environmentId: string;
1002
+ commandId: string;
1003
+ runId: string;
1004
+ sequence: number;
1005
+ issuedAt: number;
1006
+ payload: {
1007
+ requestKey: string;
1008
+ action: "cancel" | "accept" | "decline";
1009
+ content?: Record<string, unknown> | undefined;
1010
+ };
1011
+ }, {
1012
+ type: "elicitation_response";
1013
+ protocolVersion: 1;
1014
+ workspaceId: string;
1015
+ environmentId: string;
1016
+ commandId: string;
1017
+ runId: string;
1018
+ sequence: number;
1019
+ issuedAt: number;
1020
+ payload: {
1021
+ requestKey: string;
1022
+ action: "cancel" | "accept" | "decline";
1023
+ content?: Record<string, unknown> | undefined;
1024
+ };
1025
+ }>, z.ZodObject<{
1026
+ protocolVersion: z.ZodLiteral<1>;
1027
+ commandId: z.ZodString;
1028
+ environmentId: z.ZodString;
1029
+ workspaceId: z.ZodString;
1030
+ runId: z.ZodString;
1031
+ sequence: z.ZodNumber;
1032
+ issuedAt: z.ZodNumber;
1033
+ } & {
1034
+ type: z.ZodLiteral<"cancel">;
1035
+ payload: z.ZodObject<{
1036
+ reason: z.ZodOptional<z.ZodString>;
1037
+ }, "strict", z.ZodTypeAny, {
1038
+ reason?: string | undefined;
1039
+ }, {
1040
+ reason?: string | undefined;
1041
+ }>;
1042
+ }, "strict", z.ZodTypeAny, {
1043
+ type: "cancel";
1044
+ protocolVersion: 1;
1045
+ workspaceId: string;
1046
+ environmentId: string;
1047
+ commandId: string;
1048
+ runId: string;
1049
+ sequence: number;
1050
+ issuedAt: number;
1051
+ payload: {
1052
+ reason?: string | undefined;
1053
+ };
1054
+ }, {
1055
+ type: "cancel";
1056
+ protocolVersion: 1;
1057
+ workspaceId: string;
1058
+ environmentId: string;
1059
+ commandId: string;
1060
+ runId: string;
1061
+ sequence: number;
1062
+ issuedAt: number;
1063
+ payload: {
1064
+ reason?: string | undefined;
1065
+ };
1066
+ }>, z.ZodObject<{
1067
+ protocolVersion: z.ZodLiteral<1>;
1068
+ commandId: z.ZodString;
1069
+ environmentId: z.ZodString;
1070
+ workspaceId: z.ZodString;
1071
+ runId: z.ZodString;
1072
+ sequence: z.ZodNumber;
1073
+ issuedAt: z.ZodNumber;
1074
+ } & {
1075
+ type: z.ZodLiteral<"reconnect">;
1076
+ payload: z.ZodObject<{
1077
+ remoteSessionId: z.ZodString;
1078
+ }, "strict", z.ZodTypeAny, {
1079
+ remoteSessionId: string;
1080
+ }, {
1081
+ remoteSessionId: string;
1082
+ }>;
1083
+ }, "strict", z.ZodTypeAny, {
1084
+ type: "reconnect";
1085
+ protocolVersion: 1;
1086
+ workspaceId: string;
1087
+ environmentId: string;
1088
+ commandId: string;
1089
+ runId: string;
1090
+ sequence: number;
1091
+ issuedAt: number;
1092
+ payload: {
1093
+ remoteSessionId: string;
1094
+ };
1095
+ }, {
1096
+ type: "reconnect";
1097
+ protocolVersion: 1;
1098
+ workspaceId: string;
1099
+ environmentId: string;
1100
+ commandId: string;
1101
+ runId: string;
1102
+ sequence: number;
1103
+ issuedAt: number;
1104
+ payload: {
1105
+ remoteSessionId: string;
1106
+ };
1107
+ }>, z.ZodObject<{
1108
+ protocolVersion: z.ZodLiteral<1>;
1109
+ commandId: z.ZodString;
1110
+ environmentId: z.ZodString;
1111
+ workspaceId: z.ZodString;
1112
+ runId: z.ZodString;
1113
+ sequence: z.ZodNumber;
1114
+ issuedAt: z.ZodNumber;
1115
+ } & {
1116
+ type: z.ZodLiteral<"shutdown">;
1117
+ payload: z.ZodObject<{
1118
+ reason: z.ZodOptional<z.ZodString>;
1119
+ }, "strict", z.ZodTypeAny, {
1120
+ reason?: string | undefined;
1121
+ }, {
1122
+ reason?: string | undefined;
1123
+ }>;
1124
+ }, "strict", z.ZodTypeAny, {
1125
+ type: "shutdown";
1126
+ protocolVersion: 1;
1127
+ workspaceId: string;
1128
+ environmentId: string;
1129
+ commandId: string;
1130
+ runId: string;
1131
+ sequence: number;
1132
+ issuedAt: number;
1133
+ payload: {
1134
+ reason?: string | undefined;
1135
+ };
1136
+ }, {
1137
+ type: "shutdown";
1138
+ protocolVersion: 1;
1139
+ workspaceId: string;
1140
+ environmentId: string;
1141
+ commandId: string;
1142
+ runId: string;
1143
+ sequence: number;
1144
+ issuedAt: number;
1145
+ payload: {
1146
+ reason?: string | undefined;
1147
+ };
1148
+ }>]>, "many">;
1149
+ retryAfterMs: z.ZodOptional<z.ZodNumber>;
1150
+ }, "strict", z.ZodTypeAny, {
1151
+ protocolVersion: 1;
1152
+ commands: ({
1153
+ type: "start";
1154
+ protocolVersion: 1;
1155
+ workspaceId: string;
1156
+ environmentId: string;
1157
+ commandId: string;
1158
+ runId: string;
1159
+ sequence: number;
1160
+ issuedAt: number;
1161
+ payload: {
1162
+ prompt: string;
1163
+ metadata: Record<string, unknown>;
1164
+ bindingId: string;
1165
+ adapterId: string;
1166
+ workingDirectory: string;
1167
+ sessionId?: string | undefined;
1168
+ fresh?: boolean | undefined;
1169
+ };
1170
+ } | {
1171
+ type: "prompt";
1172
+ protocolVersion: 1;
1173
+ workspaceId: string;
1174
+ environmentId: string;
1175
+ commandId: string;
1176
+ runId: string;
1177
+ sequence: number;
1178
+ issuedAt: number;
1179
+ payload: {
1180
+ prompt: string;
1181
+ };
1182
+ } | {
1183
+ type: "approval_response";
1184
+ protocolVersion: 1;
1185
+ workspaceId: string;
1186
+ environmentId: string;
1187
+ commandId: string;
1188
+ runId: string;
1189
+ sequence: number;
1190
+ issuedAt: number;
1191
+ payload: {
1192
+ requestKey: string;
1193
+ optionId: string;
1194
+ };
1195
+ } | {
1196
+ type: "elicitation_response";
1197
+ protocolVersion: 1;
1198
+ workspaceId: string;
1199
+ environmentId: string;
1200
+ commandId: string;
1201
+ runId: string;
1202
+ sequence: number;
1203
+ issuedAt: number;
1204
+ payload: {
1205
+ requestKey: string;
1206
+ action: "cancel" | "accept" | "decline";
1207
+ content?: Record<string, unknown> | undefined;
1208
+ };
1209
+ } | {
1210
+ type: "cancel";
1211
+ protocolVersion: 1;
1212
+ workspaceId: string;
1213
+ environmentId: string;
1214
+ commandId: string;
1215
+ runId: string;
1216
+ sequence: number;
1217
+ issuedAt: number;
1218
+ payload: {
1219
+ reason?: string | undefined;
1220
+ };
1221
+ } | {
1222
+ type: "reconnect";
1223
+ protocolVersion: 1;
1224
+ workspaceId: string;
1225
+ environmentId: string;
1226
+ commandId: string;
1227
+ runId: string;
1228
+ sequence: number;
1229
+ issuedAt: number;
1230
+ payload: {
1231
+ remoteSessionId: string;
1232
+ };
1233
+ } | {
1234
+ type: "shutdown";
1235
+ protocolVersion: 1;
1236
+ workspaceId: string;
1237
+ environmentId: string;
1238
+ commandId: string;
1239
+ runId: string;
1240
+ sequence: number;
1241
+ issuedAt: number;
1242
+ payload: {
1243
+ reason?: string | undefined;
1244
+ };
1245
+ })[];
1246
+ retryAfterMs?: number | undefined;
1247
+ }, {
1248
+ protocolVersion: 1;
1249
+ commands: ({
1250
+ type: "start";
1251
+ protocolVersion: 1;
1252
+ workspaceId: string;
1253
+ environmentId: string;
1254
+ commandId: string;
1255
+ runId: string;
1256
+ sequence: number;
1257
+ issuedAt: number;
1258
+ payload: {
1259
+ prompt: string;
1260
+ bindingId: string;
1261
+ adapterId: string;
1262
+ workingDirectory: string;
1263
+ sessionId?: string | undefined;
1264
+ fresh?: boolean | undefined;
1265
+ metadata?: Record<string, unknown> | undefined;
1266
+ };
1267
+ } | {
1268
+ type: "prompt";
1269
+ protocolVersion: 1;
1270
+ workspaceId: string;
1271
+ environmentId: string;
1272
+ commandId: string;
1273
+ runId: string;
1274
+ sequence: number;
1275
+ issuedAt: number;
1276
+ payload: {
1277
+ prompt: string;
1278
+ };
1279
+ } | {
1280
+ type: "approval_response";
1281
+ protocolVersion: 1;
1282
+ workspaceId: string;
1283
+ environmentId: string;
1284
+ commandId: string;
1285
+ runId: string;
1286
+ sequence: number;
1287
+ issuedAt: number;
1288
+ payload: {
1289
+ requestKey: string;
1290
+ optionId: string;
1291
+ };
1292
+ } | {
1293
+ type: "elicitation_response";
1294
+ protocolVersion: 1;
1295
+ workspaceId: string;
1296
+ environmentId: string;
1297
+ commandId: string;
1298
+ runId: string;
1299
+ sequence: number;
1300
+ issuedAt: number;
1301
+ payload: {
1302
+ requestKey: string;
1303
+ action: "cancel" | "accept" | "decline";
1304
+ content?: Record<string, unknown> | undefined;
1305
+ };
1306
+ } | {
1307
+ type: "cancel";
1308
+ protocolVersion: 1;
1309
+ workspaceId: string;
1310
+ environmentId: string;
1311
+ commandId: string;
1312
+ runId: string;
1313
+ sequence: number;
1314
+ issuedAt: number;
1315
+ payload: {
1316
+ reason?: string | undefined;
1317
+ };
1318
+ } | {
1319
+ type: "reconnect";
1320
+ protocolVersion: 1;
1321
+ workspaceId: string;
1322
+ environmentId: string;
1323
+ commandId: string;
1324
+ runId: string;
1325
+ sequence: number;
1326
+ issuedAt: number;
1327
+ payload: {
1328
+ remoteSessionId: string;
1329
+ };
1330
+ } | {
1331
+ type: "shutdown";
1332
+ protocolVersion: 1;
1333
+ workspaceId: string;
1334
+ environmentId: string;
1335
+ commandId: string;
1336
+ runId: string;
1337
+ sequence: number;
1338
+ issuedAt: number;
1339
+ payload: {
1340
+ reason?: string | undefined;
1341
+ };
1342
+ })[];
1343
+ retryAfterMs?: number | undefined;
1344
+ }>, {
1345
+ protocolVersion: 1;
1346
+ commands: ({
1347
+ type: "start";
1348
+ protocolVersion: 1;
1349
+ workspaceId: string;
1350
+ environmentId: string;
1351
+ commandId: string;
1352
+ runId: string;
1353
+ sequence: number;
1354
+ issuedAt: number;
1355
+ payload: {
1356
+ prompt: string;
1357
+ metadata: Record<string, unknown>;
1358
+ bindingId: string;
1359
+ adapterId: string;
1360
+ workingDirectory: string;
1361
+ sessionId?: string | undefined;
1362
+ fresh?: boolean | undefined;
1363
+ };
1364
+ } | {
1365
+ type: "prompt";
1366
+ protocolVersion: 1;
1367
+ workspaceId: string;
1368
+ environmentId: string;
1369
+ commandId: string;
1370
+ runId: string;
1371
+ sequence: number;
1372
+ issuedAt: number;
1373
+ payload: {
1374
+ prompt: string;
1375
+ };
1376
+ } | {
1377
+ type: "approval_response";
1378
+ protocolVersion: 1;
1379
+ workspaceId: string;
1380
+ environmentId: string;
1381
+ commandId: string;
1382
+ runId: string;
1383
+ sequence: number;
1384
+ issuedAt: number;
1385
+ payload: {
1386
+ requestKey: string;
1387
+ optionId: string;
1388
+ };
1389
+ } | {
1390
+ type: "elicitation_response";
1391
+ protocolVersion: 1;
1392
+ workspaceId: string;
1393
+ environmentId: string;
1394
+ commandId: string;
1395
+ runId: string;
1396
+ sequence: number;
1397
+ issuedAt: number;
1398
+ payload: {
1399
+ requestKey: string;
1400
+ action: "cancel" | "accept" | "decline";
1401
+ content?: Record<string, unknown> | undefined;
1402
+ };
1403
+ } | {
1404
+ type: "cancel";
1405
+ protocolVersion: 1;
1406
+ workspaceId: string;
1407
+ environmentId: string;
1408
+ commandId: string;
1409
+ runId: string;
1410
+ sequence: number;
1411
+ issuedAt: number;
1412
+ payload: {
1413
+ reason?: string | undefined;
1414
+ };
1415
+ } | {
1416
+ type: "reconnect";
1417
+ protocolVersion: 1;
1418
+ workspaceId: string;
1419
+ environmentId: string;
1420
+ commandId: string;
1421
+ runId: string;
1422
+ sequence: number;
1423
+ issuedAt: number;
1424
+ payload: {
1425
+ remoteSessionId: string;
1426
+ };
1427
+ } | {
1428
+ type: "shutdown";
1429
+ protocolVersion: 1;
1430
+ workspaceId: string;
1431
+ environmentId: string;
1432
+ commandId: string;
1433
+ runId: string;
1434
+ sequence: number;
1435
+ issuedAt: number;
1436
+ payload: {
1437
+ reason?: string | undefined;
1438
+ };
1439
+ })[];
1440
+ retryAfterMs?: number | undefined;
1441
+ }, {
1442
+ protocolVersion: 1;
1443
+ commands: ({
1444
+ type: "start";
1445
+ protocolVersion: 1;
1446
+ workspaceId: string;
1447
+ environmentId: string;
1448
+ commandId: string;
1449
+ runId: string;
1450
+ sequence: number;
1451
+ issuedAt: number;
1452
+ payload: {
1453
+ prompt: string;
1454
+ bindingId: string;
1455
+ adapterId: string;
1456
+ workingDirectory: string;
1457
+ sessionId?: string | undefined;
1458
+ fresh?: boolean | undefined;
1459
+ metadata?: Record<string, unknown> | undefined;
1460
+ };
1461
+ } | {
1462
+ type: "prompt";
1463
+ protocolVersion: 1;
1464
+ workspaceId: string;
1465
+ environmentId: string;
1466
+ commandId: string;
1467
+ runId: string;
1468
+ sequence: number;
1469
+ issuedAt: number;
1470
+ payload: {
1471
+ prompt: string;
1472
+ };
1473
+ } | {
1474
+ type: "approval_response";
1475
+ protocolVersion: 1;
1476
+ workspaceId: string;
1477
+ environmentId: string;
1478
+ commandId: string;
1479
+ runId: string;
1480
+ sequence: number;
1481
+ issuedAt: number;
1482
+ payload: {
1483
+ requestKey: string;
1484
+ optionId: string;
1485
+ };
1486
+ } | {
1487
+ type: "elicitation_response";
1488
+ protocolVersion: 1;
1489
+ workspaceId: string;
1490
+ environmentId: string;
1491
+ commandId: string;
1492
+ runId: string;
1493
+ sequence: number;
1494
+ issuedAt: number;
1495
+ payload: {
1496
+ requestKey: string;
1497
+ action: "cancel" | "accept" | "decline";
1498
+ content?: Record<string, unknown> | undefined;
1499
+ };
1500
+ } | {
1501
+ type: "cancel";
1502
+ protocolVersion: 1;
1503
+ workspaceId: string;
1504
+ environmentId: string;
1505
+ commandId: string;
1506
+ runId: string;
1507
+ sequence: number;
1508
+ issuedAt: number;
1509
+ payload: {
1510
+ reason?: string | undefined;
1511
+ };
1512
+ } | {
1513
+ type: "reconnect";
1514
+ protocolVersion: 1;
1515
+ workspaceId: string;
1516
+ environmentId: string;
1517
+ commandId: string;
1518
+ runId: string;
1519
+ sequence: number;
1520
+ issuedAt: number;
1521
+ payload: {
1522
+ remoteSessionId: string;
1523
+ };
1524
+ } | {
1525
+ type: "shutdown";
1526
+ protocolVersion: 1;
1527
+ workspaceId: string;
1528
+ environmentId: string;
1529
+ commandId: string;
1530
+ runId: string;
1531
+ sequence: number;
1532
+ issuedAt: number;
1533
+ payload: {
1534
+ reason?: string | undefined;
1535
+ };
1536
+ })[];
1537
+ retryAfterMs?: number | undefined;
1538
+ }>;
1539
+ export type CommandPollResponse = z.infer<typeof commandPollResponseSchema>;
1540
+ export declare const commandAcknowledgementSchema: z.ZodObject<{
1541
+ protocolVersion: z.ZodLiteral<1>;
1542
+ commandId: z.ZodString;
1543
+ environmentId: z.ZodString;
1544
+ accepted: z.ZodBoolean;
1545
+ error: z.ZodOptional<z.ZodObject<{
1546
+ code: z.ZodString;
1547
+ message: z.ZodString;
1548
+ }, "strict", z.ZodTypeAny, {
1549
+ code: string;
1550
+ message: string;
1551
+ }, {
1552
+ code: string;
1553
+ message: string;
1554
+ }>>;
1555
+ }, "strict", z.ZodTypeAny, {
1556
+ protocolVersion: 1;
1557
+ environmentId: string;
1558
+ commandId: string;
1559
+ accepted: boolean;
1560
+ error?: {
1561
+ code: string;
1562
+ message: string;
1563
+ } | undefined;
1564
+ }, {
1565
+ protocolVersion: 1;
1566
+ environmentId: string;
1567
+ commandId: string;
1568
+ accepted: boolean;
1569
+ error?: {
1570
+ code: string;
1571
+ message: string;
1572
+ } | undefined;
1573
+ }>;
1574
+ export type CommandAcknowledgement = z.infer<typeof commandAcknowledgementSchema>;
1575
+ export declare const agentHostEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1576
+ protocolVersion: z.ZodLiteral<1>;
1577
+ eventId: z.ZodString;
1578
+ environmentId: z.ZodString;
1579
+ runId: z.ZodString;
1580
+ sourceSequence: z.ZodNumber;
1581
+ occurredAt: z.ZodNumber;
1582
+ } & {
1583
+ type: z.ZodLiteral<"session_started">;
1584
+ payload: z.ZodObject<{
1585
+ remoteSessionId: z.ZodString;
1586
+ adapterId: z.ZodString;
1587
+ }, "strict", z.ZodTypeAny, {
1588
+ adapterId: string;
1589
+ remoteSessionId: string;
1590
+ }, {
1591
+ adapterId: string;
1592
+ remoteSessionId: string;
1593
+ }>;
1594
+ }, "strict", z.ZodTypeAny, {
1595
+ type: "session_started";
1596
+ protocolVersion: 1;
1597
+ environmentId: string;
1598
+ runId: string;
1599
+ payload: {
1600
+ adapterId: string;
1601
+ remoteSessionId: string;
1602
+ };
1603
+ eventId: string;
1604
+ sourceSequence: number;
1605
+ occurredAt: number;
1606
+ }, {
1607
+ type: "session_started";
1608
+ protocolVersion: 1;
1609
+ environmentId: string;
1610
+ runId: string;
1611
+ payload: {
1612
+ adapterId: string;
1613
+ remoteSessionId: string;
1614
+ };
1615
+ eventId: string;
1616
+ sourceSequence: number;
1617
+ occurredAt: number;
1618
+ }>, z.ZodObject<{
1619
+ protocolVersion: z.ZodLiteral<1>;
1620
+ eventId: z.ZodString;
1621
+ environmentId: z.ZodString;
1622
+ runId: z.ZodString;
1623
+ sourceSequence: z.ZodNumber;
1624
+ occurredAt: z.ZodNumber;
1625
+ } & {
1626
+ type: z.ZodLiteral<"text_checkpoint">;
1627
+ payload: z.ZodObject<{
1628
+ text: z.ZodString;
1629
+ final: z.ZodOptional<z.ZodBoolean>;
1630
+ }, "strict", z.ZodTypeAny, {
1631
+ text: string;
1632
+ final?: boolean | undefined;
1633
+ }, {
1634
+ text: string;
1635
+ final?: boolean | undefined;
1636
+ }>;
1637
+ }, "strict", z.ZodTypeAny, {
1638
+ type: "text_checkpoint";
1639
+ protocolVersion: 1;
1640
+ environmentId: string;
1641
+ runId: string;
1642
+ payload: {
1643
+ text: string;
1644
+ final?: boolean | undefined;
1645
+ };
1646
+ eventId: string;
1647
+ sourceSequence: number;
1648
+ occurredAt: number;
1649
+ }, {
1650
+ type: "text_checkpoint";
1651
+ protocolVersion: 1;
1652
+ environmentId: string;
1653
+ runId: string;
1654
+ payload: {
1655
+ text: string;
1656
+ final?: boolean | undefined;
1657
+ };
1658
+ eventId: string;
1659
+ sourceSequence: number;
1660
+ occurredAt: number;
1661
+ }>, z.ZodObject<{
1662
+ protocolVersion: z.ZodLiteral<1>;
1663
+ eventId: z.ZodString;
1664
+ environmentId: z.ZodString;
1665
+ runId: z.ZodString;
1666
+ sourceSequence: z.ZodNumber;
1667
+ occurredAt: z.ZodNumber;
1668
+ } & {
1669
+ type: z.ZodLiteral<"action">;
1670
+ payload: z.ZodObject<{
1671
+ actionId: z.ZodString;
1672
+ title: z.ZodString;
1673
+ status: z.ZodEnum<["started", "updated", "completed", "failed"]>;
1674
+ detail: z.ZodOptional<z.ZodString>;
1675
+ }, "strict", z.ZodTypeAny, {
1676
+ status: "started" | "updated" | "completed" | "failed";
1677
+ actionId: string;
1678
+ title: string;
1679
+ detail?: string | undefined;
1680
+ }, {
1681
+ status: "started" | "updated" | "completed" | "failed";
1682
+ actionId: string;
1683
+ title: string;
1684
+ detail?: string | undefined;
1685
+ }>;
1686
+ }, "strict", z.ZodTypeAny, {
1687
+ type: "action";
1688
+ protocolVersion: 1;
1689
+ environmentId: string;
1690
+ runId: string;
1691
+ payload: {
1692
+ status: "started" | "updated" | "completed" | "failed";
1693
+ actionId: string;
1694
+ title: string;
1695
+ detail?: string | undefined;
1696
+ };
1697
+ eventId: string;
1698
+ sourceSequence: number;
1699
+ occurredAt: number;
1700
+ }, {
1701
+ type: "action";
1702
+ protocolVersion: 1;
1703
+ environmentId: string;
1704
+ runId: string;
1705
+ payload: {
1706
+ status: "started" | "updated" | "completed" | "failed";
1707
+ actionId: string;
1708
+ title: string;
1709
+ detail?: string | undefined;
1710
+ };
1711
+ eventId: string;
1712
+ sourceSequence: number;
1713
+ occurredAt: number;
1714
+ }>, z.ZodObject<{
1715
+ protocolVersion: z.ZodLiteral<1>;
1716
+ eventId: z.ZodString;
1717
+ environmentId: z.ZodString;
1718
+ runId: z.ZodString;
1719
+ sourceSequence: z.ZodNumber;
1720
+ occurredAt: z.ZodNumber;
1721
+ } & {
1722
+ type: z.ZodLiteral<"approval_requested">;
1723
+ payload: z.ZodObject<{
1724
+ requestKey: z.ZodString;
1725
+ prompt: z.ZodString;
1726
+ options: z.ZodArray<z.ZodObject<{
1727
+ id: z.ZodString;
1728
+ label: z.ZodString;
1729
+ }, "strict", z.ZodTypeAny, {
1730
+ id: string;
1731
+ label: string;
1732
+ }, {
1733
+ id: string;
1734
+ label: string;
1735
+ }>, "many">;
1736
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1737
+ }, "strict", z.ZodTypeAny, {
1738
+ options: {
1739
+ id: string;
1740
+ label: string;
1741
+ }[];
1742
+ prompt: string;
1743
+ requestKey: string;
1744
+ context: Record<string, unknown>;
1745
+ }, {
1746
+ options: {
1747
+ id: string;
1748
+ label: string;
1749
+ }[];
1750
+ prompt: string;
1751
+ requestKey: string;
1752
+ context?: Record<string, unknown> | undefined;
1753
+ }>;
1754
+ }, "strict", z.ZodTypeAny, {
1755
+ type: "approval_requested";
1756
+ protocolVersion: 1;
1757
+ environmentId: string;
1758
+ runId: string;
1759
+ payload: {
1760
+ options: {
1761
+ id: string;
1762
+ label: string;
1763
+ }[];
1764
+ prompt: string;
1765
+ requestKey: string;
1766
+ context: Record<string, unknown>;
1767
+ };
1768
+ eventId: string;
1769
+ sourceSequence: number;
1770
+ occurredAt: number;
1771
+ }, {
1772
+ type: "approval_requested";
1773
+ protocolVersion: 1;
1774
+ environmentId: string;
1775
+ runId: string;
1776
+ payload: {
1777
+ options: {
1778
+ id: string;
1779
+ label: string;
1780
+ }[];
1781
+ prompt: string;
1782
+ requestKey: string;
1783
+ context?: Record<string, unknown> | undefined;
1784
+ };
1785
+ eventId: string;
1786
+ sourceSequence: number;
1787
+ occurredAt: number;
1788
+ }>, z.ZodObject<{
1789
+ protocolVersion: z.ZodLiteral<1>;
1790
+ eventId: z.ZodString;
1791
+ environmentId: z.ZodString;
1792
+ runId: z.ZodString;
1793
+ sourceSequence: z.ZodNumber;
1794
+ occurredAt: z.ZodNumber;
1795
+ } & {
1796
+ type: z.ZodLiteral<"elicitation_requested">;
1797
+ payload: z.ZodObject<{
1798
+ requestKey: z.ZodString;
1799
+ prompt: z.ZodString;
1800
+ requestedSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1801
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1802
+ }, "strict", z.ZodTypeAny, {
1803
+ prompt: string;
1804
+ requestKey: string;
1805
+ context: Record<string, unknown>;
1806
+ requestedSchema: Record<string, unknown>;
1807
+ }, {
1808
+ prompt: string;
1809
+ requestKey: string;
1810
+ requestedSchema: Record<string, unknown>;
1811
+ context?: Record<string, unknown> | undefined;
1812
+ }>;
1813
+ }, "strict", z.ZodTypeAny, {
1814
+ type: "elicitation_requested";
1815
+ protocolVersion: 1;
1816
+ environmentId: string;
1817
+ runId: string;
1818
+ payload: {
1819
+ prompt: string;
1820
+ requestKey: string;
1821
+ context: Record<string, unknown>;
1822
+ requestedSchema: Record<string, unknown>;
1823
+ };
1824
+ eventId: string;
1825
+ sourceSequence: number;
1826
+ occurredAt: number;
1827
+ }, {
1828
+ type: "elicitation_requested";
1829
+ protocolVersion: 1;
1830
+ environmentId: string;
1831
+ runId: string;
1832
+ payload: {
1833
+ prompt: string;
1834
+ requestKey: string;
1835
+ requestedSchema: Record<string, unknown>;
1836
+ context?: Record<string, unknown> | undefined;
1837
+ };
1838
+ eventId: string;
1839
+ sourceSequence: number;
1840
+ occurredAt: number;
1841
+ }>, z.ZodObject<{
1842
+ protocolVersion: z.ZodLiteral<1>;
1843
+ eventId: z.ZodString;
1844
+ environmentId: z.ZodString;
1845
+ runId: z.ZodString;
1846
+ sourceSequence: z.ZodNumber;
1847
+ occurredAt: z.ZodNumber;
1848
+ } & {
1849
+ type: z.ZodLiteral<"plan">;
1850
+ payload: z.ZodObject<{
1851
+ entries: z.ZodArray<z.ZodObject<{
1852
+ id: z.ZodString;
1853
+ title: z.ZodString;
1854
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed"]>;
1855
+ }, "strict", z.ZodTypeAny, {
1856
+ status: "completed" | "failed" | "pending" | "in_progress";
1857
+ id: string;
1858
+ title: string;
1859
+ }, {
1860
+ status: "completed" | "failed" | "pending" | "in_progress";
1861
+ id: string;
1862
+ title: string;
1863
+ }>, "many">;
1864
+ }, "strict", z.ZodTypeAny, {
1865
+ entries: {
1866
+ status: "completed" | "failed" | "pending" | "in_progress";
1867
+ id: string;
1868
+ title: string;
1869
+ }[];
1870
+ }, {
1871
+ entries: {
1872
+ status: "completed" | "failed" | "pending" | "in_progress";
1873
+ id: string;
1874
+ title: string;
1875
+ }[];
1876
+ }>;
1877
+ }, "strict", z.ZodTypeAny, {
1878
+ type: "plan";
1879
+ protocolVersion: 1;
1880
+ environmentId: string;
1881
+ runId: string;
1882
+ payload: {
1883
+ entries: {
1884
+ status: "completed" | "failed" | "pending" | "in_progress";
1885
+ id: string;
1886
+ title: string;
1887
+ }[];
1888
+ };
1889
+ eventId: string;
1890
+ sourceSequence: number;
1891
+ occurredAt: number;
1892
+ }, {
1893
+ type: "plan";
1894
+ protocolVersion: 1;
1895
+ environmentId: string;
1896
+ runId: string;
1897
+ payload: {
1898
+ entries: {
1899
+ status: "completed" | "failed" | "pending" | "in_progress";
1900
+ id: string;
1901
+ title: string;
1902
+ }[];
1903
+ };
1904
+ eventId: string;
1905
+ sourceSequence: number;
1906
+ occurredAt: number;
1907
+ }>, z.ZodObject<{
1908
+ protocolVersion: z.ZodLiteral<1>;
1909
+ eventId: z.ZodString;
1910
+ environmentId: z.ZodString;
1911
+ runId: z.ZodString;
1912
+ sourceSequence: z.ZodNumber;
1913
+ occurredAt: z.ZodNumber;
1914
+ } & {
1915
+ type: z.ZodLiteral<"diff">;
1916
+ payload: z.ZodObject<{
1917
+ diffId: z.ZodString;
1918
+ title: z.ZodString;
1919
+ patch: z.ZodString;
1920
+ language: z.ZodOptional<z.ZodString>;
1921
+ }, "strict", z.ZodTypeAny, {
1922
+ title: string;
1923
+ diffId: string;
1924
+ patch: string;
1925
+ language?: string | undefined;
1926
+ }, {
1927
+ title: string;
1928
+ diffId: string;
1929
+ patch: string;
1930
+ language?: string | undefined;
1931
+ }>;
1932
+ }, "strict", z.ZodTypeAny, {
1933
+ type: "diff";
1934
+ protocolVersion: 1;
1935
+ environmentId: string;
1936
+ runId: string;
1937
+ payload: {
1938
+ title: string;
1939
+ diffId: string;
1940
+ patch: string;
1941
+ language?: string | undefined;
1942
+ };
1943
+ eventId: string;
1944
+ sourceSequence: number;
1945
+ occurredAt: number;
1946
+ }, {
1947
+ type: "diff";
1948
+ protocolVersion: 1;
1949
+ environmentId: string;
1950
+ runId: string;
1951
+ payload: {
1952
+ title: string;
1953
+ diffId: string;
1954
+ patch: string;
1955
+ language?: string | undefined;
1956
+ };
1957
+ eventId: string;
1958
+ sourceSequence: number;
1959
+ occurredAt: number;
1960
+ }>, z.ZodObject<{
1961
+ protocolVersion: z.ZodLiteral<1>;
1962
+ eventId: z.ZodString;
1963
+ environmentId: z.ZodString;
1964
+ runId: z.ZodString;
1965
+ sourceSequence: z.ZodNumber;
1966
+ occurredAt: z.ZodNumber;
1967
+ } & {
1968
+ type: z.ZodLiteral<"terminal">;
1969
+ payload: z.ZodObject<{
1970
+ terminalId: z.ZodString;
1971
+ title: z.ZodString;
1972
+ summary: z.ZodString;
1973
+ exitCode: z.ZodOptional<z.ZodNumber>;
1974
+ status: z.ZodEnum<["running", "completed", "failed"]>;
1975
+ }, "strict", z.ZodTypeAny, {
1976
+ status: "completed" | "failed" | "running";
1977
+ title: string;
1978
+ terminalId: string;
1979
+ summary: string;
1980
+ exitCode?: number | undefined;
1981
+ }, {
1982
+ status: "completed" | "failed" | "running";
1983
+ title: string;
1984
+ terminalId: string;
1985
+ summary: string;
1986
+ exitCode?: number | undefined;
1987
+ }>;
1988
+ }, "strict", z.ZodTypeAny, {
1989
+ type: "terminal";
1990
+ protocolVersion: 1;
1991
+ environmentId: string;
1992
+ runId: string;
1993
+ payload: {
1994
+ status: "completed" | "failed" | "running";
1995
+ title: string;
1996
+ terminalId: string;
1997
+ summary: string;
1998
+ exitCode?: number | undefined;
1999
+ };
2000
+ eventId: string;
2001
+ sourceSequence: number;
2002
+ occurredAt: number;
2003
+ }, {
2004
+ type: "terminal";
2005
+ protocolVersion: 1;
2006
+ environmentId: string;
2007
+ runId: string;
2008
+ payload: {
2009
+ status: "completed" | "failed" | "running";
2010
+ title: string;
2011
+ terminalId: string;
2012
+ summary: string;
2013
+ exitCode?: number | undefined;
2014
+ };
2015
+ eventId: string;
2016
+ sourceSequence: number;
2017
+ occurredAt: number;
2018
+ }>, z.ZodObject<{
2019
+ protocolVersion: z.ZodLiteral<1>;
2020
+ eventId: z.ZodString;
2021
+ environmentId: z.ZodString;
2022
+ runId: z.ZodString;
2023
+ sourceSequence: z.ZodNumber;
2024
+ occurredAt: z.ZodNumber;
2025
+ } & {
2026
+ type: z.ZodLiteral<"artifact">;
2027
+ payload: z.ZodObject<{
2028
+ name: z.ZodString;
2029
+ mediaType: z.ZodString;
2030
+ size: z.ZodNumber;
2031
+ sha256: z.ZodString;
2032
+ uploadReference: z.ZodString;
2033
+ }, "strict", z.ZodTypeAny, {
2034
+ name: string;
2035
+ mediaType: string;
2036
+ size: number;
2037
+ sha256: string;
2038
+ uploadReference: string;
2039
+ }, {
2040
+ name: string;
2041
+ mediaType: string;
2042
+ size: number;
2043
+ sha256: string;
2044
+ uploadReference: string;
2045
+ }>;
2046
+ }, "strict", z.ZodTypeAny, {
2047
+ type: "artifact";
2048
+ protocolVersion: 1;
2049
+ environmentId: string;
2050
+ runId: string;
2051
+ payload: {
2052
+ name: string;
2053
+ mediaType: string;
2054
+ size: number;
2055
+ sha256: string;
2056
+ uploadReference: string;
2057
+ };
2058
+ eventId: string;
2059
+ sourceSequence: number;
2060
+ occurredAt: number;
2061
+ }, {
2062
+ type: "artifact";
2063
+ protocolVersion: 1;
2064
+ environmentId: string;
2065
+ runId: string;
2066
+ payload: {
2067
+ name: string;
2068
+ mediaType: string;
2069
+ size: number;
2070
+ sha256: string;
2071
+ uploadReference: string;
2072
+ };
2073
+ eventId: string;
2074
+ sourceSequence: number;
2075
+ occurredAt: number;
2076
+ }>, z.ZodObject<{
2077
+ protocolVersion: z.ZodLiteral<1>;
2078
+ eventId: z.ZodString;
2079
+ environmentId: z.ZodString;
2080
+ runId: z.ZodString;
2081
+ sourceSequence: z.ZodNumber;
2082
+ occurredAt: z.ZodNumber;
2083
+ } & {
2084
+ type: z.ZodLiteral<"completed">;
2085
+ payload: z.ZodObject<{
2086
+ summary: z.ZodOptional<z.ZodString>;
2087
+ usage: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2088
+ }, "strict", z.ZodTypeAny, {
2089
+ usage: Record<string, unknown>;
2090
+ summary?: string | undefined;
2091
+ }, {
2092
+ summary?: string | undefined;
2093
+ usage?: Record<string, unknown> | undefined;
2094
+ }>;
2095
+ }, "strict", z.ZodTypeAny, {
2096
+ type: "completed";
2097
+ protocolVersion: 1;
2098
+ environmentId: string;
2099
+ runId: string;
2100
+ payload: {
2101
+ usage: Record<string, unknown>;
2102
+ summary?: string | undefined;
2103
+ };
2104
+ eventId: string;
2105
+ sourceSequence: number;
2106
+ occurredAt: number;
2107
+ }, {
2108
+ type: "completed";
2109
+ protocolVersion: 1;
2110
+ environmentId: string;
2111
+ runId: string;
2112
+ payload: {
2113
+ summary?: string | undefined;
2114
+ usage?: Record<string, unknown> | undefined;
2115
+ };
2116
+ eventId: string;
2117
+ sourceSequence: number;
2118
+ occurredAt: number;
2119
+ }>, z.ZodObject<{
2120
+ protocolVersion: z.ZodLiteral<1>;
2121
+ eventId: z.ZodString;
2122
+ environmentId: z.ZodString;
2123
+ runId: z.ZodString;
2124
+ sourceSequence: z.ZodNumber;
2125
+ occurredAt: z.ZodNumber;
2126
+ } & {
2127
+ type: z.ZodLiteral<"failed">;
2128
+ payload: z.ZodObject<{
2129
+ code: z.ZodString;
2130
+ message: z.ZodString;
2131
+ retryable: z.ZodBoolean;
2132
+ }, "strict", z.ZodTypeAny, {
2133
+ code: string;
2134
+ message: string;
2135
+ retryable: boolean;
2136
+ }, {
2137
+ code: string;
2138
+ message: string;
2139
+ retryable: boolean;
2140
+ }>;
2141
+ }, "strict", z.ZodTypeAny, {
2142
+ type: "failed";
2143
+ protocolVersion: 1;
2144
+ environmentId: string;
2145
+ runId: string;
2146
+ payload: {
2147
+ code: string;
2148
+ message: string;
2149
+ retryable: boolean;
2150
+ };
2151
+ eventId: string;
2152
+ sourceSequence: number;
2153
+ occurredAt: number;
2154
+ }, {
2155
+ type: "failed";
2156
+ protocolVersion: 1;
2157
+ environmentId: string;
2158
+ runId: string;
2159
+ payload: {
2160
+ code: string;
2161
+ message: string;
2162
+ retryable: boolean;
2163
+ };
2164
+ eventId: string;
2165
+ sourceSequence: number;
2166
+ occurredAt: number;
2167
+ }>, z.ZodObject<{
2168
+ protocolVersion: z.ZodLiteral<1>;
2169
+ eventId: z.ZodString;
2170
+ environmentId: z.ZodString;
2171
+ runId: z.ZodString;
2172
+ sourceSequence: z.ZodNumber;
2173
+ occurredAt: z.ZodNumber;
2174
+ } & {
2175
+ type: z.ZodLiteral<"cancelled">;
2176
+ payload: z.ZodObject<{
2177
+ reason: z.ZodOptional<z.ZodString>;
2178
+ }, "strict", z.ZodTypeAny, {
2179
+ reason?: string | undefined;
2180
+ }, {
2181
+ reason?: string | undefined;
2182
+ }>;
2183
+ }, "strict", z.ZodTypeAny, {
2184
+ type: "cancelled";
2185
+ protocolVersion: 1;
2186
+ environmentId: string;
2187
+ runId: string;
2188
+ payload: {
2189
+ reason?: string | undefined;
2190
+ };
2191
+ eventId: string;
2192
+ sourceSequence: number;
2193
+ occurredAt: number;
2194
+ }, {
2195
+ type: "cancelled";
2196
+ protocolVersion: 1;
2197
+ environmentId: string;
2198
+ runId: string;
2199
+ payload: {
2200
+ reason?: string | undefined;
2201
+ };
2202
+ eventId: string;
2203
+ sourceSequence: number;
2204
+ occurredAt: number;
2205
+ }>]>;
2206
+ export type AgentHostEvent = z.infer<typeof agentHostEventSchema>;
2207
+ export declare const artifactUploadRequestSchema: z.ZodObject<{
2208
+ protocolVersion: z.ZodLiteral<1>;
2209
+ runId: z.ZodString;
2210
+ name: z.ZodString;
2211
+ mediaType: z.ZodString;
2212
+ size: z.ZodNumber;
2213
+ sha256: z.ZodString;
2214
+ }, "strict", z.ZodTypeAny, {
2215
+ protocolVersion: 1;
2216
+ name: string;
2217
+ runId: string;
2218
+ mediaType: string;
2219
+ size: number;
2220
+ sha256: string;
2221
+ }, {
2222
+ protocolVersion: 1;
2223
+ name: string;
2224
+ runId: string;
2225
+ mediaType: string;
2226
+ size: number;
2227
+ sha256: string;
2228
+ }>;
2229
+ export type ArtifactUploadRequest = z.infer<typeof artifactUploadRequestSchema>;
2230
+ export declare const artifactUploadResponseSchema: z.ZodObject<{
2231
+ protocolVersion: z.ZodLiteral<1>;
2232
+ artifactId: z.ZodString;
2233
+ uploadReference: z.ZodString;
2234
+ uploadUrl: z.ZodString;
2235
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2236
+ expiresAt: z.ZodNumber;
2237
+ }, "strict", z.ZodTypeAny, {
2238
+ protocolVersion: 1;
2239
+ expiresAt: number;
2240
+ uploadReference: string;
2241
+ artifactId: string;
2242
+ uploadUrl: string;
2243
+ headers: Record<string, string>;
2244
+ }, {
2245
+ protocolVersion: 1;
2246
+ expiresAt: number;
2247
+ uploadReference: string;
2248
+ artifactId: string;
2249
+ uploadUrl: string;
2250
+ headers?: Record<string, string> | undefined;
2251
+ }>;
2252
+ export type ArtifactUploadResponse = z.infer<typeof artifactUploadResponseSchema>;
2253
+ export declare const artifactCompleteRequestSchema: z.ZodObject<{
2254
+ protocolVersion: z.ZodLiteral<1>;
2255
+ uploadReference: z.ZodString;
2256
+ }, "strict", z.ZodTypeAny, {
2257
+ protocolVersion: 1;
2258
+ uploadReference: string;
2259
+ }, {
2260
+ protocolVersion: 1;
2261
+ uploadReference: string;
2262
+ }>;
2263
+ export declare const eventBatchSchema: z.ZodEffects<z.ZodObject<{
2264
+ protocolVersion: z.ZodLiteral<1>;
2265
+ environmentId: z.ZodString;
2266
+ runId: z.ZodString;
2267
+ events: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2268
+ protocolVersion: z.ZodLiteral<1>;
2269
+ eventId: z.ZodString;
2270
+ environmentId: z.ZodString;
2271
+ runId: z.ZodString;
2272
+ sourceSequence: z.ZodNumber;
2273
+ occurredAt: z.ZodNumber;
2274
+ } & {
2275
+ type: z.ZodLiteral<"session_started">;
2276
+ payload: z.ZodObject<{
2277
+ remoteSessionId: z.ZodString;
2278
+ adapterId: z.ZodString;
2279
+ }, "strict", z.ZodTypeAny, {
2280
+ adapterId: string;
2281
+ remoteSessionId: string;
2282
+ }, {
2283
+ adapterId: string;
2284
+ remoteSessionId: string;
2285
+ }>;
2286
+ }, "strict", z.ZodTypeAny, {
2287
+ type: "session_started";
2288
+ protocolVersion: 1;
2289
+ environmentId: string;
2290
+ runId: string;
2291
+ payload: {
2292
+ adapterId: string;
2293
+ remoteSessionId: string;
2294
+ };
2295
+ eventId: string;
2296
+ sourceSequence: number;
2297
+ occurredAt: number;
2298
+ }, {
2299
+ type: "session_started";
2300
+ protocolVersion: 1;
2301
+ environmentId: string;
2302
+ runId: string;
2303
+ payload: {
2304
+ adapterId: string;
2305
+ remoteSessionId: string;
2306
+ };
2307
+ eventId: string;
2308
+ sourceSequence: number;
2309
+ occurredAt: number;
2310
+ }>, z.ZodObject<{
2311
+ protocolVersion: z.ZodLiteral<1>;
2312
+ eventId: z.ZodString;
2313
+ environmentId: z.ZodString;
2314
+ runId: z.ZodString;
2315
+ sourceSequence: z.ZodNumber;
2316
+ occurredAt: z.ZodNumber;
2317
+ } & {
2318
+ type: z.ZodLiteral<"text_checkpoint">;
2319
+ payload: z.ZodObject<{
2320
+ text: z.ZodString;
2321
+ final: z.ZodOptional<z.ZodBoolean>;
2322
+ }, "strict", z.ZodTypeAny, {
2323
+ text: string;
2324
+ final?: boolean | undefined;
2325
+ }, {
2326
+ text: string;
2327
+ final?: boolean | undefined;
2328
+ }>;
2329
+ }, "strict", z.ZodTypeAny, {
2330
+ type: "text_checkpoint";
2331
+ protocolVersion: 1;
2332
+ environmentId: string;
2333
+ runId: string;
2334
+ payload: {
2335
+ text: string;
2336
+ final?: boolean | undefined;
2337
+ };
2338
+ eventId: string;
2339
+ sourceSequence: number;
2340
+ occurredAt: number;
2341
+ }, {
2342
+ type: "text_checkpoint";
2343
+ protocolVersion: 1;
2344
+ environmentId: string;
2345
+ runId: string;
2346
+ payload: {
2347
+ text: string;
2348
+ final?: boolean | undefined;
2349
+ };
2350
+ eventId: string;
2351
+ sourceSequence: number;
2352
+ occurredAt: number;
2353
+ }>, z.ZodObject<{
2354
+ protocolVersion: z.ZodLiteral<1>;
2355
+ eventId: z.ZodString;
2356
+ environmentId: z.ZodString;
2357
+ runId: z.ZodString;
2358
+ sourceSequence: z.ZodNumber;
2359
+ occurredAt: z.ZodNumber;
2360
+ } & {
2361
+ type: z.ZodLiteral<"action">;
2362
+ payload: z.ZodObject<{
2363
+ actionId: z.ZodString;
2364
+ title: z.ZodString;
2365
+ status: z.ZodEnum<["started", "updated", "completed", "failed"]>;
2366
+ detail: z.ZodOptional<z.ZodString>;
2367
+ }, "strict", z.ZodTypeAny, {
2368
+ status: "started" | "updated" | "completed" | "failed";
2369
+ actionId: string;
2370
+ title: string;
2371
+ detail?: string | undefined;
2372
+ }, {
2373
+ status: "started" | "updated" | "completed" | "failed";
2374
+ actionId: string;
2375
+ title: string;
2376
+ detail?: string | undefined;
2377
+ }>;
2378
+ }, "strict", z.ZodTypeAny, {
2379
+ type: "action";
2380
+ protocolVersion: 1;
2381
+ environmentId: string;
2382
+ runId: string;
2383
+ payload: {
2384
+ status: "started" | "updated" | "completed" | "failed";
2385
+ actionId: string;
2386
+ title: string;
2387
+ detail?: string | undefined;
2388
+ };
2389
+ eventId: string;
2390
+ sourceSequence: number;
2391
+ occurredAt: number;
2392
+ }, {
2393
+ type: "action";
2394
+ protocolVersion: 1;
2395
+ environmentId: string;
2396
+ runId: string;
2397
+ payload: {
2398
+ status: "started" | "updated" | "completed" | "failed";
2399
+ actionId: string;
2400
+ title: string;
2401
+ detail?: string | undefined;
2402
+ };
2403
+ eventId: string;
2404
+ sourceSequence: number;
2405
+ occurredAt: number;
2406
+ }>, z.ZodObject<{
2407
+ protocolVersion: z.ZodLiteral<1>;
2408
+ eventId: z.ZodString;
2409
+ environmentId: z.ZodString;
2410
+ runId: z.ZodString;
2411
+ sourceSequence: z.ZodNumber;
2412
+ occurredAt: z.ZodNumber;
2413
+ } & {
2414
+ type: z.ZodLiteral<"approval_requested">;
2415
+ payload: z.ZodObject<{
2416
+ requestKey: z.ZodString;
2417
+ prompt: z.ZodString;
2418
+ options: z.ZodArray<z.ZodObject<{
2419
+ id: z.ZodString;
2420
+ label: z.ZodString;
2421
+ }, "strict", z.ZodTypeAny, {
2422
+ id: string;
2423
+ label: string;
2424
+ }, {
2425
+ id: string;
2426
+ label: string;
2427
+ }>, "many">;
2428
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2429
+ }, "strict", z.ZodTypeAny, {
2430
+ options: {
2431
+ id: string;
2432
+ label: string;
2433
+ }[];
2434
+ prompt: string;
2435
+ requestKey: string;
2436
+ context: Record<string, unknown>;
2437
+ }, {
2438
+ options: {
2439
+ id: string;
2440
+ label: string;
2441
+ }[];
2442
+ prompt: string;
2443
+ requestKey: string;
2444
+ context?: Record<string, unknown> | undefined;
2445
+ }>;
2446
+ }, "strict", z.ZodTypeAny, {
2447
+ type: "approval_requested";
2448
+ protocolVersion: 1;
2449
+ environmentId: string;
2450
+ runId: string;
2451
+ payload: {
2452
+ options: {
2453
+ id: string;
2454
+ label: string;
2455
+ }[];
2456
+ prompt: string;
2457
+ requestKey: string;
2458
+ context: Record<string, unknown>;
2459
+ };
2460
+ eventId: string;
2461
+ sourceSequence: number;
2462
+ occurredAt: number;
2463
+ }, {
2464
+ type: "approval_requested";
2465
+ protocolVersion: 1;
2466
+ environmentId: string;
2467
+ runId: string;
2468
+ payload: {
2469
+ options: {
2470
+ id: string;
2471
+ label: string;
2472
+ }[];
2473
+ prompt: string;
2474
+ requestKey: string;
2475
+ context?: Record<string, unknown> | undefined;
2476
+ };
2477
+ eventId: string;
2478
+ sourceSequence: number;
2479
+ occurredAt: number;
2480
+ }>, z.ZodObject<{
2481
+ protocolVersion: z.ZodLiteral<1>;
2482
+ eventId: z.ZodString;
2483
+ environmentId: z.ZodString;
2484
+ runId: z.ZodString;
2485
+ sourceSequence: z.ZodNumber;
2486
+ occurredAt: z.ZodNumber;
2487
+ } & {
2488
+ type: z.ZodLiteral<"elicitation_requested">;
2489
+ payload: z.ZodObject<{
2490
+ requestKey: z.ZodString;
2491
+ prompt: z.ZodString;
2492
+ requestedSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2493
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2494
+ }, "strict", z.ZodTypeAny, {
2495
+ prompt: string;
2496
+ requestKey: string;
2497
+ context: Record<string, unknown>;
2498
+ requestedSchema: Record<string, unknown>;
2499
+ }, {
2500
+ prompt: string;
2501
+ requestKey: string;
2502
+ requestedSchema: Record<string, unknown>;
2503
+ context?: Record<string, unknown> | undefined;
2504
+ }>;
2505
+ }, "strict", z.ZodTypeAny, {
2506
+ type: "elicitation_requested";
2507
+ protocolVersion: 1;
2508
+ environmentId: string;
2509
+ runId: string;
2510
+ payload: {
2511
+ prompt: string;
2512
+ requestKey: string;
2513
+ context: Record<string, unknown>;
2514
+ requestedSchema: Record<string, unknown>;
2515
+ };
2516
+ eventId: string;
2517
+ sourceSequence: number;
2518
+ occurredAt: number;
2519
+ }, {
2520
+ type: "elicitation_requested";
2521
+ protocolVersion: 1;
2522
+ environmentId: string;
2523
+ runId: string;
2524
+ payload: {
2525
+ prompt: string;
2526
+ requestKey: string;
2527
+ requestedSchema: Record<string, unknown>;
2528
+ context?: Record<string, unknown> | undefined;
2529
+ };
2530
+ eventId: string;
2531
+ sourceSequence: number;
2532
+ occurredAt: number;
2533
+ }>, z.ZodObject<{
2534
+ protocolVersion: z.ZodLiteral<1>;
2535
+ eventId: z.ZodString;
2536
+ environmentId: z.ZodString;
2537
+ runId: z.ZodString;
2538
+ sourceSequence: z.ZodNumber;
2539
+ occurredAt: z.ZodNumber;
2540
+ } & {
2541
+ type: z.ZodLiteral<"plan">;
2542
+ payload: z.ZodObject<{
2543
+ entries: z.ZodArray<z.ZodObject<{
2544
+ id: z.ZodString;
2545
+ title: z.ZodString;
2546
+ status: z.ZodEnum<["pending", "in_progress", "completed", "failed"]>;
2547
+ }, "strict", z.ZodTypeAny, {
2548
+ status: "completed" | "failed" | "pending" | "in_progress";
2549
+ id: string;
2550
+ title: string;
2551
+ }, {
2552
+ status: "completed" | "failed" | "pending" | "in_progress";
2553
+ id: string;
2554
+ title: string;
2555
+ }>, "many">;
2556
+ }, "strict", z.ZodTypeAny, {
2557
+ entries: {
2558
+ status: "completed" | "failed" | "pending" | "in_progress";
2559
+ id: string;
2560
+ title: string;
2561
+ }[];
2562
+ }, {
2563
+ entries: {
2564
+ status: "completed" | "failed" | "pending" | "in_progress";
2565
+ id: string;
2566
+ title: string;
2567
+ }[];
2568
+ }>;
2569
+ }, "strict", z.ZodTypeAny, {
2570
+ type: "plan";
2571
+ protocolVersion: 1;
2572
+ environmentId: string;
2573
+ runId: string;
2574
+ payload: {
2575
+ entries: {
2576
+ status: "completed" | "failed" | "pending" | "in_progress";
2577
+ id: string;
2578
+ title: string;
2579
+ }[];
2580
+ };
2581
+ eventId: string;
2582
+ sourceSequence: number;
2583
+ occurredAt: number;
2584
+ }, {
2585
+ type: "plan";
2586
+ protocolVersion: 1;
2587
+ environmentId: string;
2588
+ runId: string;
2589
+ payload: {
2590
+ entries: {
2591
+ status: "completed" | "failed" | "pending" | "in_progress";
2592
+ id: string;
2593
+ title: string;
2594
+ }[];
2595
+ };
2596
+ eventId: string;
2597
+ sourceSequence: number;
2598
+ occurredAt: number;
2599
+ }>, z.ZodObject<{
2600
+ protocolVersion: z.ZodLiteral<1>;
2601
+ eventId: z.ZodString;
2602
+ environmentId: z.ZodString;
2603
+ runId: z.ZodString;
2604
+ sourceSequence: z.ZodNumber;
2605
+ occurredAt: z.ZodNumber;
2606
+ } & {
2607
+ type: z.ZodLiteral<"diff">;
2608
+ payload: z.ZodObject<{
2609
+ diffId: z.ZodString;
2610
+ title: z.ZodString;
2611
+ patch: z.ZodString;
2612
+ language: z.ZodOptional<z.ZodString>;
2613
+ }, "strict", z.ZodTypeAny, {
2614
+ title: string;
2615
+ diffId: string;
2616
+ patch: string;
2617
+ language?: string | undefined;
2618
+ }, {
2619
+ title: string;
2620
+ diffId: string;
2621
+ patch: string;
2622
+ language?: string | undefined;
2623
+ }>;
2624
+ }, "strict", z.ZodTypeAny, {
2625
+ type: "diff";
2626
+ protocolVersion: 1;
2627
+ environmentId: string;
2628
+ runId: string;
2629
+ payload: {
2630
+ title: string;
2631
+ diffId: string;
2632
+ patch: string;
2633
+ language?: string | undefined;
2634
+ };
2635
+ eventId: string;
2636
+ sourceSequence: number;
2637
+ occurredAt: number;
2638
+ }, {
2639
+ type: "diff";
2640
+ protocolVersion: 1;
2641
+ environmentId: string;
2642
+ runId: string;
2643
+ payload: {
2644
+ title: string;
2645
+ diffId: string;
2646
+ patch: string;
2647
+ language?: string | undefined;
2648
+ };
2649
+ eventId: string;
2650
+ sourceSequence: number;
2651
+ occurredAt: number;
2652
+ }>, z.ZodObject<{
2653
+ protocolVersion: z.ZodLiteral<1>;
2654
+ eventId: z.ZodString;
2655
+ environmentId: z.ZodString;
2656
+ runId: z.ZodString;
2657
+ sourceSequence: z.ZodNumber;
2658
+ occurredAt: z.ZodNumber;
2659
+ } & {
2660
+ type: z.ZodLiteral<"terminal">;
2661
+ payload: z.ZodObject<{
2662
+ terminalId: z.ZodString;
2663
+ title: z.ZodString;
2664
+ summary: z.ZodString;
2665
+ exitCode: z.ZodOptional<z.ZodNumber>;
2666
+ status: z.ZodEnum<["running", "completed", "failed"]>;
2667
+ }, "strict", z.ZodTypeAny, {
2668
+ status: "completed" | "failed" | "running";
2669
+ title: string;
2670
+ terminalId: string;
2671
+ summary: string;
2672
+ exitCode?: number | undefined;
2673
+ }, {
2674
+ status: "completed" | "failed" | "running";
2675
+ title: string;
2676
+ terminalId: string;
2677
+ summary: string;
2678
+ exitCode?: number | undefined;
2679
+ }>;
2680
+ }, "strict", z.ZodTypeAny, {
2681
+ type: "terminal";
2682
+ protocolVersion: 1;
2683
+ environmentId: string;
2684
+ runId: string;
2685
+ payload: {
2686
+ status: "completed" | "failed" | "running";
2687
+ title: string;
2688
+ terminalId: string;
2689
+ summary: string;
2690
+ exitCode?: number | undefined;
2691
+ };
2692
+ eventId: string;
2693
+ sourceSequence: number;
2694
+ occurredAt: number;
2695
+ }, {
2696
+ type: "terminal";
2697
+ protocolVersion: 1;
2698
+ environmentId: string;
2699
+ runId: string;
2700
+ payload: {
2701
+ status: "completed" | "failed" | "running";
2702
+ title: string;
2703
+ terminalId: string;
2704
+ summary: string;
2705
+ exitCode?: number | undefined;
2706
+ };
2707
+ eventId: string;
2708
+ sourceSequence: number;
2709
+ occurredAt: number;
2710
+ }>, z.ZodObject<{
2711
+ protocolVersion: z.ZodLiteral<1>;
2712
+ eventId: z.ZodString;
2713
+ environmentId: z.ZodString;
2714
+ runId: z.ZodString;
2715
+ sourceSequence: z.ZodNumber;
2716
+ occurredAt: z.ZodNumber;
2717
+ } & {
2718
+ type: z.ZodLiteral<"artifact">;
2719
+ payload: z.ZodObject<{
2720
+ name: z.ZodString;
2721
+ mediaType: z.ZodString;
2722
+ size: z.ZodNumber;
2723
+ sha256: z.ZodString;
2724
+ uploadReference: z.ZodString;
2725
+ }, "strict", z.ZodTypeAny, {
2726
+ name: string;
2727
+ mediaType: string;
2728
+ size: number;
2729
+ sha256: string;
2730
+ uploadReference: string;
2731
+ }, {
2732
+ name: string;
2733
+ mediaType: string;
2734
+ size: number;
2735
+ sha256: string;
2736
+ uploadReference: string;
2737
+ }>;
2738
+ }, "strict", z.ZodTypeAny, {
2739
+ type: "artifact";
2740
+ protocolVersion: 1;
2741
+ environmentId: string;
2742
+ runId: string;
2743
+ payload: {
2744
+ name: string;
2745
+ mediaType: string;
2746
+ size: number;
2747
+ sha256: string;
2748
+ uploadReference: string;
2749
+ };
2750
+ eventId: string;
2751
+ sourceSequence: number;
2752
+ occurredAt: number;
2753
+ }, {
2754
+ type: "artifact";
2755
+ protocolVersion: 1;
2756
+ environmentId: string;
2757
+ runId: string;
2758
+ payload: {
2759
+ name: string;
2760
+ mediaType: string;
2761
+ size: number;
2762
+ sha256: string;
2763
+ uploadReference: string;
2764
+ };
2765
+ eventId: string;
2766
+ sourceSequence: number;
2767
+ occurredAt: number;
2768
+ }>, z.ZodObject<{
2769
+ protocolVersion: z.ZodLiteral<1>;
2770
+ eventId: z.ZodString;
2771
+ environmentId: z.ZodString;
2772
+ runId: z.ZodString;
2773
+ sourceSequence: z.ZodNumber;
2774
+ occurredAt: z.ZodNumber;
2775
+ } & {
2776
+ type: z.ZodLiteral<"completed">;
2777
+ payload: z.ZodObject<{
2778
+ summary: z.ZodOptional<z.ZodString>;
2779
+ usage: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2780
+ }, "strict", z.ZodTypeAny, {
2781
+ usage: Record<string, unknown>;
2782
+ summary?: string | undefined;
2783
+ }, {
2784
+ summary?: string | undefined;
2785
+ usage?: Record<string, unknown> | undefined;
2786
+ }>;
2787
+ }, "strict", z.ZodTypeAny, {
2788
+ type: "completed";
2789
+ protocolVersion: 1;
2790
+ environmentId: string;
2791
+ runId: string;
2792
+ payload: {
2793
+ usage: Record<string, unknown>;
2794
+ summary?: string | undefined;
2795
+ };
2796
+ eventId: string;
2797
+ sourceSequence: number;
2798
+ occurredAt: number;
2799
+ }, {
2800
+ type: "completed";
2801
+ protocolVersion: 1;
2802
+ environmentId: string;
2803
+ runId: string;
2804
+ payload: {
2805
+ summary?: string | undefined;
2806
+ usage?: Record<string, unknown> | undefined;
2807
+ };
2808
+ eventId: string;
2809
+ sourceSequence: number;
2810
+ occurredAt: number;
2811
+ }>, z.ZodObject<{
2812
+ protocolVersion: z.ZodLiteral<1>;
2813
+ eventId: z.ZodString;
2814
+ environmentId: z.ZodString;
2815
+ runId: z.ZodString;
2816
+ sourceSequence: z.ZodNumber;
2817
+ occurredAt: z.ZodNumber;
2818
+ } & {
2819
+ type: z.ZodLiteral<"failed">;
2820
+ payload: z.ZodObject<{
2821
+ code: z.ZodString;
2822
+ message: z.ZodString;
2823
+ retryable: z.ZodBoolean;
2824
+ }, "strict", z.ZodTypeAny, {
2825
+ code: string;
2826
+ message: string;
2827
+ retryable: boolean;
2828
+ }, {
2829
+ code: string;
2830
+ message: string;
2831
+ retryable: boolean;
2832
+ }>;
2833
+ }, "strict", z.ZodTypeAny, {
2834
+ type: "failed";
2835
+ protocolVersion: 1;
2836
+ environmentId: string;
2837
+ runId: string;
2838
+ payload: {
2839
+ code: string;
2840
+ message: string;
2841
+ retryable: boolean;
2842
+ };
2843
+ eventId: string;
2844
+ sourceSequence: number;
2845
+ occurredAt: number;
2846
+ }, {
2847
+ type: "failed";
2848
+ protocolVersion: 1;
2849
+ environmentId: string;
2850
+ runId: string;
2851
+ payload: {
2852
+ code: string;
2853
+ message: string;
2854
+ retryable: boolean;
2855
+ };
2856
+ eventId: string;
2857
+ sourceSequence: number;
2858
+ occurredAt: number;
2859
+ }>, z.ZodObject<{
2860
+ protocolVersion: z.ZodLiteral<1>;
2861
+ eventId: z.ZodString;
2862
+ environmentId: z.ZodString;
2863
+ runId: z.ZodString;
2864
+ sourceSequence: z.ZodNumber;
2865
+ occurredAt: z.ZodNumber;
2866
+ } & {
2867
+ type: z.ZodLiteral<"cancelled">;
2868
+ payload: z.ZodObject<{
2869
+ reason: z.ZodOptional<z.ZodString>;
2870
+ }, "strict", z.ZodTypeAny, {
2871
+ reason?: string | undefined;
2872
+ }, {
2873
+ reason?: string | undefined;
2874
+ }>;
2875
+ }, "strict", z.ZodTypeAny, {
2876
+ type: "cancelled";
2877
+ protocolVersion: 1;
2878
+ environmentId: string;
2879
+ runId: string;
2880
+ payload: {
2881
+ reason?: string | undefined;
2882
+ };
2883
+ eventId: string;
2884
+ sourceSequence: number;
2885
+ occurredAt: number;
2886
+ }, {
2887
+ type: "cancelled";
2888
+ protocolVersion: 1;
2889
+ environmentId: string;
2890
+ runId: string;
2891
+ payload: {
2892
+ reason?: string | undefined;
2893
+ };
2894
+ eventId: string;
2895
+ sourceSequence: number;
2896
+ occurredAt: number;
2897
+ }>]>, "many">;
2898
+ }, "strict", z.ZodTypeAny, {
2899
+ protocolVersion: 1;
2900
+ environmentId: string;
2901
+ runId: string;
2902
+ events: ({
2903
+ type: "session_started";
2904
+ protocolVersion: 1;
2905
+ environmentId: string;
2906
+ runId: string;
2907
+ payload: {
2908
+ adapterId: string;
2909
+ remoteSessionId: string;
2910
+ };
2911
+ eventId: string;
2912
+ sourceSequence: number;
2913
+ occurredAt: number;
2914
+ } | {
2915
+ type: "text_checkpoint";
2916
+ protocolVersion: 1;
2917
+ environmentId: string;
2918
+ runId: string;
2919
+ payload: {
2920
+ text: string;
2921
+ final?: boolean | undefined;
2922
+ };
2923
+ eventId: string;
2924
+ sourceSequence: number;
2925
+ occurredAt: number;
2926
+ } | {
2927
+ type: "action";
2928
+ protocolVersion: 1;
2929
+ environmentId: string;
2930
+ runId: string;
2931
+ payload: {
2932
+ status: "started" | "updated" | "completed" | "failed";
2933
+ actionId: string;
2934
+ title: string;
2935
+ detail?: string | undefined;
2936
+ };
2937
+ eventId: string;
2938
+ sourceSequence: number;
2939
+ occurredAt: number;
2940
+ } | {
2941
+ type: "approval_requested";
2942
+ protocolVersion: 1;
2943
+ environmentId: string;
2944
+ runId: string;
2945
+ payload: {
2946
+ options: {
2947
+ id: string;
2948
+ label: string;
2949
+ }[];
2950
+ prompt: string;
2951
+ requestKey: string;
2952
+ context: Record<string, unknown>;
2953
+ };
2954
+ eventId: string;
2955
+ sourceSequence: number;
2956
+ occurredAt: number;
2957
+ } | {
2958
+ type: "elicitation_requested";
2959
+ protocolVersion: 1;
2960
+ environmentId: string;
2961
+ runId: string;
2962
+ payload: {
2963
+ prompt: string;
2964
+ requestKey: string;
2965
+ context: Record<string, unknown>;
2966
+ requestedSchema: Record<string, unknown>;
2967
+ };
2968
+ eventId: string;
2969
+ sourceSequence: number;
2970
+ occurredAt: number;
2971
+ } | {
2972
+ type: "plan";
2973
+ protocolVersion: 1;
2974
+ environmentId: string;
2975
+ runId: string;
2976
+ payload: {
2977
+ entries: {
2978
+ status: "completed" | "failed" | "pending" | "in_progress";
2979
+ id: string;
2980
+ title: string;
2981
+ }[];
2982
+ };
2983
+ eventId: string;
2984
+ sourceSequence: number;
2985
+ occurredAt: number;
2986
+ } | {
2987
+ type: "diff";
2988
+ protocolVersion: 1;
2989
+ environmentId: string;
2990
+ runId: string;
2991
+ payload: {
2992
+ title: string;
2993
+ diffId: string;
2994
+ patch: string;
2995
+ language?: string | undefined;
2996
+ };
2997
+ eventId: string;
2998
+ sourceSequence: number;
2999
+ occurredAt: number;
3000
+ } | {
3001
+ type: "terminal";
3002
+ protocolVersion: 1;
3003
+ environmentId: string;
3004
+ runId: string;
3005
+ payload: {
3006
+ status: "completed" | "failed" | "running";
3007
+ title: string;
3008
+ terminalId: string;
3009
+ summary: string;
3010
+ exitCode?: number | undefined;
3011
+ };
3012
+ eventId: string;
3013
+ sourceSequence: number;
3014
+ occurredAt: number;
3015
+ } | {
3016
+ type: "artifact";
3017
+ protocolVersion: 1;
3018
+ environmentId: string;
3019
+ runId: string;
3020
+ payload: {
3021
+ name: string;
3022
+ mediaType: string;
3023
+ size: number;
3024
+ sha256: string;
3025
+ uploadReference: string;
3026
+ };
3027
+ eventId: string;
3028
+ sourceSequence: number;
3029
+ occurredAt: number;
3030
+ } | {
3031
+ type: "completed";
3032
+ protocolVersion: 1;
3033
+ environmentId: string;
3034
+ runId: string;
3035
+ payload: {
3036
+ usage: Record<string, unknown>;
3037
+ summary?: string | undefined;
3038
+ };
3039
+ eventId: string;
3040
+ sourceSequence: number;
3041
+ occurredAt: number;
3042
+ } | {
3043
+ type: "failed";
3044
+ protocolVersion: 1;
3045
+ environmentId: string;
3046
+ runId: string;
3047
+ payload: {
3048
+ code: string;
3049
+ message: string;
3050
+ retryable: boolean;
3051
+ };
3052
+ eventId: string;
3053
+ sourceSequence: number;
3054
+ occurredAt: number;
3055
+ } | {
3056
+ type: "cancelled";
3057
+ protocolVersion: 1;
3058
+ environmentId: string;
3059
+ runId: string;
3060
+ payload: {
3061
+ reason?: string | undefined;
3062
+ };
3063
+ eventId: string;
3064
+ sourceSequence: number;
3065
+ occurredAt: number;
3066
+ })[];
3067
+ }, {
3068
+ protocolVersion: 1;
3069
+ environmentId: string;
3070
+ runId: string;
3071
+ events: ({
3072
+ type: "session_started";
3073
+ protocolVersion: 1;
3074
+ environmentId: string;
3075
+ runId: string;
3076
+ payload: {
3077
+ adapterId: string;
3078
+ remoteSessionId: string;
3079
+ };
3080
+ eventId: string;
3081
+ sourceSequence: number;
3082
+ occurredAt: number;
3083
+ } | {
3084
+ type: "text_checkpoint";
3085
+ protocolVersion: 1;
3086
+ environmentId: string;
3087
+ runId: string;
3088
+ payload: {
3089
+ text: string;
3090
+ final?: boolean | undefined;
3091
+ };
3092
+ eventId: string;
3093
+ sourceSequence: number;
3094
+ occurredAt: number;
3095
+ } | {
3096
+ type: "action";
3097
+ protocolVersion: 1;
3098
+ environmentId: string;
3099
+ runId: string;
3100
+ payload: {
3101
+ status: "started" | "updated" | "completed" | "failed";
3102
+ actionId: string;
3103
+ title: string;
3104
+ detail?: string | undefined;
3105
+ };
3106
+ eventId: string;
3107
+ sourceSequence: number;
3108
+ occurredAt: number;
3109
+ } | {
3110
+ type: "approval_requested";
3111
+ protocolVersion: 1;
3112
+ environmentId: string;
3113
+ runId: string;
3114
+ payload: {
3115
+ options: {
3116
+ id: string;
3117
+ label: string;
3118
+ }[];
3119
+ prompt: string;
3120
+ requestKey: string;
3121
+ context?: Record<string, unknown> | undefined;
3122
+ };
3123
+ eventId: string;
3124
+ sourceSequence: number;
3125
+ occurredAt: number;
3126
+ } | {
3127
+ type: "elicitation_requested";
3128
+ protocolVersion: 1;
3129
+ environmentId: string;
3130
+ runId: string;
3131
+ payload: {
3132
+ prompt: string;
3133
+ requestKey: string;
3134
+ requestedSchema: Record<string, unknown>;
3135
+ context?: Record<string, unknown> | undefined;
3136
+ };
3137
+ eventId: string;
3138
+ sourceSequence: number;
3139
+ occurredAt: number;
3140
+ } | {
3141
+ type: "plan";
3142
+ protocolVersion: 1;
3143
+ environmentId: string;
3144
+ runId: string;
3145
+ payload: {
3146
+ entries: {
3147
+ status: "completed" | "failed" | "pending" | "in_progress";
3148
+ id: string;
3149
+ title: string;
3150
+ }[];
3151
+ };
3152
+ eventId: string;
3153
+ sourceSequence: number;
3154
+ occurredAt: number;
3155
+ } | {
3156
+ type: "diff";
3157
+ protocolVersion: 1;
3158
+ environmentId: string;
3159
+ runId: string;
3160
+ payload: {
3161
+ title: string;
3162
+ diffId: string;
3163
+ patch: string;
3164
+ language?: string | undefined;
3165
+ };
3166
+ eventId: string;
3167
+ sourceSequence: number;
3168
+ occurredAt: number;
3169
+ } | {
3170
+ type: "terminal";
3171
+ protocolVersion: 1;
3172
+ environmentId: string;
3173
+ runId: string;
3174
+ payload: {
3175
+ status: "completed" | "failed" | "running";
3176
+ title: string;
3177
+ terminalId: string;
3178
+ summary: string;
3179
+ exitCode?: number | undefined;
3180
+ };
3181
+ eventId: string;
3182
+ sourceSequence: number;
3183
+ occurredAt: number;
3184
+ } | {
3185
+ type: "artifact";
3186
+ protocolVersion: 1;
3187
+ environmentId: string;
3188
+ runId: string;
3189
+ payload: {
3190
+ name: string;
3191
+ mediaType: string;
3192
+ size: number;
3193
+ sha256: string;
3194
+ uploadReference: string;
3195
+ };
3196
+ eventId: string;
3197
+ sourceSequence: number;
3198
+ occurredAt: number;
3199
+ } | {
3200
+ type: "completed";
3201
+ protocolVersion: 1;
3202
+ environmentId: string;
3203
+ runId: string;
3204
+ payload: {
3205
+ summary?: string | undefined;
3206
+ usage?: Record<string, unknown> | undefined;
3207
+ };
3208
+ eventId: string;
3209
+ sourceSequence: number;
3210
+ occurredAt: number;
3211
+ } | {
3212
+ type: "failed";
3213
+ protocolVersion: 1;
3214
+ environmentId: string;
3215
+ runId: string;
3216
+ payload: {
3217
+ code: string;
3218
+ message: string;
3219
+ retryable: boolean;
3220
+ };
3221
+ eventId: string;
3222
+ sourceSequence: number;
3223
+ occurredAt: number;
3224
+ } | {
3225
+ type: "cancelled";
3226
+ protocolVersion: 1;
3227
+ environmentId: string;
3228
+ runId: string;
3229
+ payload: {
3230
+ reason?: string | undefined;
3231
+ };
3232
+ eventId: string;
3233
+ sourceSequence: number;
3234
+ occurredAt: number;
3235
+ })[];
3236
+ }>, {
3237
+ protocolVersion: 1;
3238
+ environmentId: string;
3239
+ runId: string;
3240
+ events: ({
3241
+ type: "session_started";
3242
+ protocolVersion: 1;
3243
+ environmentId: string;
3244
+ runId: string;
3245
+ payload: {
3246
+ adapterId: string;
3247
+ remoteSessionId: string;
3248
+ };
3249
+ eventId: string;
3250
+ sourceSequence: number;
3251
+ occurredAt: number;
3252
+ } | {
3253
+ type: "text_checkpoint";
3254
+ protocolVersion: 1;
3255
+ environmentId: string;
3256
+ runId: string;
3257
+ payload: {
3258
+ text: string;
3259
+ final?: boolean | undefined;
3260
+ };
3261
+ eventId: string;
3262
+ sourceSequence: number;
3263
+ occurredAt: number;
3264
+ } | {
3265
+ type: "action";
3266
+ protocolVersion: 1;
3267
+ environmentId: string;
3268
+ runId: string;
3269
+ payload: {
3270
+ status: "started" | "updated" | "completed" | "failed";
3271
+ actionId: string;
3272
+ title: string;
3273
+ detail?: string | undefined;
3274
+ };
3275
+ eventId: string;
3276
+ sourceSequence: number;
3277
+ occurredAt: number;
3278
+ } | {
3279
+ type: "approval_requested";
3280
+ protocolVersion: 1;
3281
+ environmentId: string;
3282
+ runId: string;
3283
+ payload: {
3284
+ options: {
3285
+ id: string;
3286
+ label: string;
3287
+ }[];
3288
+ prompt: string;
3289
+ requestKey: string;
3290
+ context: Record<string, unknown>;
3291
+ };
3292
+ eventId: string;
3293
+ sourceSequence: number;
3294
+ occurredAt: number;
3295
+ } | {
3296
+ type: "elicitation_requested";
3297
+ protocolVersion: 1;
3298
+ environmentId: string;
3299
+ runId: string;
3300
+ payload: {
3301
+ prompt: string;
3302
+ requestKey: string;
3303
+ context: Record<string, unknown>;
3304
+ requestedSchema: Record<string, unknown>;
3305
+ };
3306
+ eventId: string;
3307
+ sourceSequence: number;
3308
+ occurredAt: number;
3309
+ } | {
3310
+ type: "plan";
3311
+ protocolVersion: 1;
3312
+ environmentId: string;
3313
+ runId: string;
3314
+ payload: {
3315
+ entries: {
3316
+ status: "completed" | "failed" | "pending" | "in_progress";
3317
+ id: string;
3318
+ title: string;
3319
+ }[];
3320
+ };
3321
+ eventId: string;
3322
+ sourceSequence: number;
3323
+ occurredAt: number;
3324
+ } | {
3325
+ type: "diff";
3326
+ protocolVersion: 1;
3327
+ environmentId: string;
3328
+ runId: string;
3329
+ payload: {
3330
+ title: string;
3331
+ diffId: string;
3332
+ patch: string;
3333
+ language?: string | undefined;
3334
+ };
3335
+ eventId: string;
3336
+ sourceSequence: number;
3337
+ occurredAt: number;
3338
+ } | {
3339
+ type: "terminal";
3340
+ protocolVersion: 1;
3341
+ environmentId: string;
3342
+ runId: string;
3343
+ payload: {
3344
+ status: "completed" | "failed" | "running";
3345
+ title: string;
3346
+ terminalId: string;
3347
+ summary: string;
3348
+ exitCode?: number | undefined;
3349
+ };
3350
+ eventId: string;
3351
+ sourceSequence: number;
3352
+ occurredAt: number;
3353
+ } | {
3354
+ type: "artifact";
3355
+ protocolVersion: 1;
3356
+ environmentId: string;
3357
+ runId: string;
3358
+ payload: {
3359
+ name: string;
3360
+ mediaType: string;
3361
+ size: number;
3362
+ sha256: string;
3363
+ uploadReference: string;
3364
+ };
3365
+ eventId: string;
3366
+ sourceSequence: number;
3367
+ occurredAt: number;
3368
+ } | {
3369
+ type: "completed";
3370
+ protocolVersion: 1;
3371
+ environmentId: string;
3372
+ runId: string;
3373
+ payload: {
3374
+ usage: Record<string, unknown>;
3375
+ summary?: string | undefined;
3376
+ };
3377
+ eventId: string;
3378
+ sourceSequence: number;
3379
+ occurredAt: number;
3380
+ } | {
3381
+ type: "failed";
3382
+ protocolVersion: 1;
3383
+ environmentId: string;
3384
+ runId: string;
3385
+ payload: {
3386
+ code: string;
3387
+ message: string;
3388
+ retryable: boolean;
3389
+ };
3390
+ eventId: string;
3391
+ sourceSequence: number;
3392
+ occurredAt: number;
3393
+ } | {
3394
+ type: "cancelled";
3395
+ protocolVersion: 1;
3396
+ environmentId: string;
3397
+ runId: string;
3398
+ payload: {
3399
+ reason?: string | undefined;
3400
+ };
3401
+ eventId: string;
3402
+ sourceSequence: number;
3403
+ occurredAt: number;
3404
+ })[];
3405
+ }, {
3406
+ protocolVersion: 1;
3407
+ environmentId: string;
3408
+ runId: string;
3409
+ events: ({
3410
+ type: "session_started";
3411
+ protocolVersion: 1;
3412
+ environmentId: string;
3413
+ runId: string;
3414
+ payload: {
3415
+ adapterId: string;
3416
+ remoteSessionId: string;
3417
+ };
3418
+ eventId: string;
3419
+ sourceSequence: number;
3420
+ occurredAt: number;
3421
+ } | {
3422
+ type: "text_checkpoint";
3423
+ protocolVersion: 1;
3424
+ environmentId: string;
3425
+ runId: string;
3426
+ payload: {
3427
+ text: string;
3428
+ final?: boolean | undefined;
3429
+ };
3430
+ eventId: string;
3431
+ sourceSequence: number;
3432
+ occurredAt: number;
3433
+ } | {
3434
+ type: "action";
3435
+ protocolVersion: 1;
3436
+ environmentId: string;
3437
+ runId: string;
3438
+ payload: {
3439
+ status: "started" | "updated" | "completed" | "failed";
3440
+ actionId: string;
3441
+ title: string;
3442
+ detail?: string | undefined;
3443
+ };
3444
+ eventId: string;
3445
+ sourceSequence: number;
3446
+ occurredAt: number;
3447
+ } | {
3448
+ type: "approval_requested";
3449
+ protocolVersion: 1;
3450
+ environmentId: string;
3451
+ runId: string;
3452
+ payload: {
3453
+ options: {
3454
+ id: string;
3455
+ label: string;
3456
+ }[];
3457
+ prompt: string;
3458
+ requestKey: string;
3459
+ context?: Record<string, unknown> | undefined;
3460
+ };
3461
+ eventId: string;
3462
+ sourceSequence: number;
3463
+ occurredAt: number;
3464
+ } | {
3465
+ type: "elicitation_requested";
3466
+ protocolVersion: 1;
3467
+ environmentId: string;
3468
+ runId: string;
3469
+ payload: {
3470
+ prompt: string;
3471
+ requestKey: string;
3472
+ requestedSchema: Record<string, unknown>;
3473
+ context?: Record<string, unknown> | undefined;
3474
+ };
3475
+ eventId: string;
3476
+ sourceSequence: number;
3477
+ occurredAt: number;
3478
+ } | {
3479
+ type: "plan";
3480
+ protocolVersion: 1;
3481
+ environmentId: string;
3482
+ runId: string;
3483
+ payload: {
3484
+ entries: {
3485
+ status: "completed" | "failed" | "pending" | "in_progress";
3486
+ id: string;
3487
+ title: string;
3488
+ }[];
3489
+ };
3490
+ eventId: string;
3491
+ sourceSequence: number;
3492
+ occurredAt: number;
3493
+ } | {
3494
+ type: "diff";
3495
+ protocolVersion: 1;
3496
+ environmentId: string;
3497
+ runId: string;
3498
+ payload: {
3499
+ title: string;
3500
+ diffId: string;
3501
+ patch: string;
3502
+ language?: string | undefined;
3503
+ };
3504
+ eventId: string;
3505
+ sourceSequence: number;
3506
+ occurredAt: number;
3507
+ } | {
3508
+ type: "terminal";
3509
+ protocolVersion: 1;
3510
+ environmentId: string;
3511
+ runId: string;
3512
+ payload: {
3513
+ status: "completed" | "failed" | "running";
3514
+ title: string;
3515
+ terminalId: string;
3516
+ summary: string;
3517
+ exitCode?: number | undefined;
3518
+ };
3519
+ eventId: string;
3520
+ sourceSequence: number;
3521
+ occurredAt: number;
3522
+ } | {
3523
+ type: "artifact";
3524
+ protocolVersion: 1;
3525
+ environmentId: string;
3526
+ runId: string;
3527
+ payload: {
3528
+ name: string;
3529
+ mediaType: string;
3530
+ size: number;
3531
+ sha256: string;
3532
+ uploadReference: string;
3533
+ };
3534
+ eventId: string;
3535
+ sourceSequence: number;
3536
+ occurredAt: number;
3537
+ } | {
3538
+ type: "completed";
3539
+ protocolVersion: 1;
3540
+ environmentId: string;
3541
+ runId: string;
3542
+ payload: {
3543
+ summary?: string | undefined;
3544
+ usage?: Record<string, unknown> | undefined;
3545
+ };
3546
+ eventId: string;
3547
+ sourceSequence: number;
3548
+ occurredAt: number;
3549
+ } | {
3550
+ type: "failed";
3551
+ protocolVersion: 1;
3552
+ environmentId: string;
3553
+ runId: string;
3554
+ payload: {
3555
+ code: string;
3556
+ message: string;
3557
+ retryable: boolean;
3558
+ };
3559
+ eventId: string;
3560
+ sourceSequence: number;
3561
+ occurredAt: number;
3562
+ } | {
3563
+ type: "cancelled";
3564
+ protocolVersion: 1;
3565
+ environmentId: string;
3566
+ runId: string;
3567
+ payload: {
3568
+ reason?: string | undefined;
3569
+ };
3570
+ eventId: string;
3571
+ sourceSequence: number;
3572
+ occurredAt: number;
3573
+ })[];
3574
+ }>;
3575
+ export type EventBatch = z.infer<typeof eventBatchSchema>;
3576
+ export declare const eventAcknowledgementSchema: z.ZodDiscriminatedUnion<"accepted", [z.ZodObject<{
3577
+ protocolVersion: z.ZodLiteral<1>;
3578
+ accepted: z.ZodLiteral<true>;
3579
+ acknowledgedSequence: z.ZodNumber;
3580
+ }, "strict", z.ZodTypeAny, {
3581
+ protocolVersion: 1;
3582
+ accepted: true;
3583
+ acknowledgedSequence: number;
3584
+ }, {
3585
+ protocolVersion: 1;
3586
+ accepted: true;
3587
+ acknowledgedSequence: number;
3588
+ }>, z.ZodObject<{
3589
+ protocolVersion: z.ZodLiteral<1>;
3590
+ accepted: z.ZodLiteral<false>;
3591
+ expectedSequence: z.ZodNumber;
3592
+ }, "strict", z.ZodTypeAny, {
3593
+ protocolVersion: 1;
3594
+ accepted: false;
3595
+ expectedSequence: number;
3596
+ }, {
3597
+ protocolVersion: 1;
3598
+ accepted: false;
3599
+ expectedSequence: number;
3600
+ }>]>;
3601
+ export type EventAcknowledgement = z.infer<typeof eventAcknowledgementSchema>;
3602
+ //# sourceMappingURL=index.d.ts.map