@byok-sdk/protocol 0.28.3 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { EnvelopeSchema } from './envelope';
2
3
  /**
3
4
  * HTTP-side request/response shapes for the reference server's auth and blob
4
5
  * endpoints (M1 Part B). These are plain HTTP bodies, not wire envelopes —
@@ -151,1407 +152,11 @@ export type EventsPollResponse = z.infer<typeof EventsPollResponseSchema>;
151
152
  * hard-coded, driftable copy of it.
152
153
  */
153
154
  export declare const MAX_MESSAGES_PER_BATCH = 256;
155
+ /** Request body ceiling for `POST /byok/messages`; the cloud answers 413 above it, so the client chunks its drain by it. */
156
+ export declare const MESSAGES_SEND_MAX_BODY_BYTES: number;
157
+ /** Annotated so declaration emit names `EnvelopeSchema` instead of copying it. Type-only. */
154
158
  export declare const MessagesSendRequestSchema: z.ZodObject<{
155
- messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
156
- v: z.ZodNumber;
157
- id: z.ZodUUID;
158
- ts: z.ZodISODateTime;
159
- type: z.ZodLiteral<"conn.hello">;
160
- task_id: z.ZodOptional<z.ZodString>;
161
- session_ref: z.ZodOptional<z.ZodString>;
162
- seq: z.ZodOptional<z.ZodNumber>;
163
- payload: z.ZodObject<{
164
- protocolVersions: z.ZodArray<z.ZodNumber>;
165
- capabilities: z.ZodArray<z.ZodString>;
166
- deviceId: z.ZodString;
167
- productId: z.ZodString;
168
- clientVersion: z.ZodOptional<z.ZodString>;
169
- runtimes: z.ZodOptional<z.ZodArray<z.ZodObject<{
170
- id: z.ZodEnum<{
171
- claude: "claude";
172
- codex: "codex";
173
- pi: "pi";
174
- }>;
175
- version: z.ZodOptional<z.ZodString>;
176
- authPresent: z.ZodOptional<z.ZodBoolean>;
177
- capabilities: z.ZodOptional<z.ZodObject<{
178
- steer: z.ZodOptional<z.ZodBoolean>;
179
- resume: z.ZodOptional<z.ZodBoolean>;
180
- approvalInteractive: z.ZodOptional<z.ZodBoolean>;
181
- mcpToolsets: z.ZodOptional<z.ZodBoolean>;
182
- messageDraft: z.ZodOptional<z.ZodBoolean>;
183
- }, z.core.$strip>>;
184
- }, z.core.$strip>>>;
185
- harnesses: z.ZodOptional<z.ZodArray<z.ZodObject<{
186
- id: z.ZodString;
187
- version: z.ZodOptional<z.ZodString>;
188
- capabilities: z.ZodObject<{
189
- steer: z.ZodOptional<z.ZodBoolean>;
190
- resume: z.ZodOptional<z.ZodBoolean>;
191
- approvalInteractive: z.ZodOptional<z.ZodBoolean>;
192
- mcpToolsets: z.ZodOptional<z.ZodBoolean>;
193
- messageDraft: z.ZodOptional<z.ZodBoolean>;
194
- }, z.core.$strip>;
195
- }, z.core.$strip>>>;
196
- configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
197
- cursor: z.ZodOptional<z.ZodNumber>;
198
- }, z.core.$strip>;
199
- }, z.core.$strip>, z.ZodObject<{
200
- v: z.ZodNumber;
201
- id: z.ZodUUID;
202
- ts: z.ZodISODateTime;
203
- type: z.ZodLiteral<"conn.ack">;
204
- task_id: z.ZodOptional<z.ZodString>;
205
- session_ref: z.ZodOptional<z.ZodString>;
206
- seq: z.ZodNumber;
207
- payload: z.ZodObject<{
208
- protocolVersion: z.ZodNumber;
209
- capabilities: z.ZodArray<z.ZodString>;
210
- serverTime: z.ZodISODateTime;
211
- }, z.core.$strip>;
212
- }, z.core.$strip>, z.ZodObject<{
213
- v: z.ZodNumber;
214
- id: z.ZodUUID;
215
- ts: z.ZodISODateTime;
216
- type: z.ZodLiteral<"task.offer">;
217
- task_id: z.ZodString;
218
- session_ref: z.ZodOptional<z.ZodString>;
219
- seq: z.ZodNumber;
220
- payload: z.ZodObject<{
221
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
222
- blobRef: z.ZodObject<{
223
- blobId: z.ZodString;
224
- contentHash: z.ZodString;
225
- size: z.ZodNumber;
226
- contentType: z.ZodString;
227
- url: z.ZodOptional<z.ZodString>;
228
- }, z.core.$strip>;
229
- }, z.core.$strict>]>;
230
- runtime: z.ZodOptional<z.ZodEnum<{
231
- claude: "claude";
232
- codex: "codex";
233
- pi: "pi";
234
- }>>;
235
- harnessId: z.ZodOptional<z.ZodString>;
236
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
237
- lane: z.ZodLiteral<"subscription">;
238
- runtimeId: z.ZodEnum<{
239
- claude: "claude";
240
- codex: "codex";
241
- }>;
242
- providerId: z.ZodNull;
243
- modelId: z.ZodString;
244
- }, z.core.$strict>, z.ZodObject<{
245
- lane: z.ZodLiteral<"byok">;
246
- runtimeId: z.ZodLiteral<"pi">;
247
- providerId: z.ZodString;
248
- modelId: z.ZodString;
249
- }, z.core.$strict>, z.ZodObject<{
250
- lane: z.ZodLiteral<"byok-profile">;
251
- runtimeId: z.ZodLiteral<"pi">;
252
- providerProfile: z.ZodObject<{
253
- profileRef: z.ZodString;
254
- profileRevision: z.ZodString;
255
- profileHash: z.ZodString;
256
- modelId: z.ZodString;
257
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
258
- "image-input": "image-input";
259
- }>>;
260
- }, z.core.$strict>;
261
- }, z.core.$strict>], "lane">>;
262
- sessionRef: z.ZodOptional<z.ZodString>;
263
- workspaceHint: z.ZodOptional<z.ZodString>;
264
- limits: z.ZodOptional<z.ZodObject<{
265
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
266
- maxTokens: z.ZodOptional<z.ZodNumber>;
267
- }, z.core.$strip>>;
268
- }, z.core.$strip>;
269
- }, z.core.$strip>, z.ZodObject<{
270
- v: z.ZodNumber;
271
- id: z.ZodUUID;
272
- ts: z.ZodISODateTime;
273
- type: z.ZodLiteral<"task.offer_with_toolsets">;
274
- task_id: z.ZodString;
275
- session_ref: z.ZodOptional<z.ZodString>;
276
- seq: z.ZodNumber;
277
- payload: z.ZodObject<{
278
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
279
- blobRef: z.ZodObject<{
280
- blobId: z.ZodString;
281
- contentHash: z.ZodString;
282
- size: z.ZodNumber;
283
- contentType: z.ZodString;
284
- url: z.ZodOptional<z.ZodString>;
285
- }, z.core.$strip>;
286
- }, z.core.$strict>]>;
287
- runtime: z.ZodOptional<z.ZodEnum<{
288
- claude: "claude";
289
- codex: "codex";
290
- pi: "pi";
291
- }>>;
292
- harnessId: z.ZodOptional<z.ZodString>;
293
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
294
- lane: z.ZodLiteral<"subscription">;
295
- runtimeId: z.ZodEnum<{
296
- claude: "claude";
297
- codex: "codex";
298
- }>;
299
- providerId: z.ZodNull;
300
- modelId: z.ZodString;
301
- }, z.core.$strict>, z.ZodObject<{
302
- lane: z.ZodLiteral<"byok">;
303
- runtimeId: z.ZodLiteral<"pi">;
304
- providerId: z.ZodString;
305
- modelId: z.ZodString;
306
- }, z.core.$strict>, z.ZodObject<{
307
- lane: z.ZodLiteral<"byok-profile">;
308
- runtimeId: z.ZodLiteral<"pi">;
309
- providerProfile: z.ZodObject<{
310
- profileRef: z.ZodString;
311
- profileRevision: z.ZodString;
312
- profileHash: z.ZodString;
313
- modelId: z.ZodString;
314
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
315
- "image-input": "image-input";
316
- }>>;
317
- }, z.core.$strict>;
318
- }, z.core.$strict>], "lane">>;
319
- sessionRef: z.ZodOptional<z.ZodString>;
320
- workspaceHint: z.ZodOptional<z.ZodString>;
321
- limits: z.ZodOptional<z.ZodObject<{
322
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
323
- maxTokens: z.ZodOptional<z.ZodNumber>;
324
- }, z.core.$strip>>;
325
- requiredToolsets: z.ZodArray<z.ZodString>;
326
- }, z.core.$strict>;
327
- }, z.core.$strip>, z.ZodObject<{
328
- v: z.ZodNumber;
329
- id: z.ZodUUID;
330
- ts: z.ZodISODateTime;
331
- type: z.ZodLiteral<"task.offer_for_agent">;
332
- task_id: z.ZodString;
333
- session_ref: z.ZodOptional<z.ZodString>;
334
- seq: z.ZodNumber;
335
- payload: z.ZodObject<{
336
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
337
- blobRef: z.ZodObject<{
338
- blobId: z.ZodString;
339
- contentHash: z.ZodString;
340
- size: z.ZodNumber;
341
- contentType: z.ZodString;
342
- url: z.ZodOptional<z.ZodString>;
343
- }, z.core.$strip>;
344
- }, z.core.$strict>]>;
345
- agentRef: z.ZodObject<{
346
- agentId: z.ZodString;
347
- profileRevision: z.ZodString;
348
- }, z.core.$strict>;
349
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
350
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
351
- runtime: z.ZodOptional<z.ZodEnum<{
352
- claude: "claude";
353
- codex: "codex";
354
- pi: "pi";
355
- }>>;
356
- harnessId: z.ZodOptional<z.ZodString>;
357
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
358
- lane: z.ZodLiteral<"subscription">;
359
- runtimeId: z.ZodEnum<{
360
- claude: "claude";
361
- codex: "codex";
362
- }>;
363
- providerId: z.ZodNull;
364
- modelId: z.ZodString;
365
- }, z.core.$strict>, z.ZodObject<{
366
- lane: z.ZodLiteral<"byok">;
367
- runtimeId: z.ZodLiteral<"pi">;
368
- providerId: z.ZodString;
369
- modelId: z.ZodString;
370
- }, z.core.$strict>, z.ZodObject<{
371
- lane: z.ZodLiteral<"byok-profile">;
372
- runtimeId: z.ZodLiteral<"pi">;
373
- providerProfile: z.ZodObject<{
374
- profileRef: z.ZodString;
375
- profileRevision: z.ZodString;
376
- profileHash: z.ZodString;
377
- modelId: z.ZodString;
378
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
379
- "image-input": "image-input";
380
- }>>;
381
- }, z.core.$strict>;
382
- }, z.core.$strict>], "lane">>;
383
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
384
- mode: z.ZodLiteral<"none">;
385
- }, z.core.$strict>, z.ZodObject<{
386
- mode: z.ZodLiteral<"result-document">;
387
- contract: z.ZodString;
388
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
389
- }, z.core.$strict>], "mode">>;
390
- sessionRef: z.ZodOptional<z.ZodString>;
391
- limits: z.ZodOptional<z.ZodObject<{
392
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
393
- maxTokens: z.ZodOptional<z.ZodNumber>;
394
- }, z.core.$strip>>;
395
- }, z.core.$strict>;
396
- }, z.core.$strip>, z.ZodObject<{
397
- v: z.ZodNumber;
398
- id: z.ZodUUID;
399
- ts: z.ZodISODateTime;
400
- type: z.ZodLiteral<"task.offer_for_agent_with_egress">;
401
- task_id: z.ZodString;
402
- session_ref: z.ZodOptional<z.ZodString>;
403
- seq: z.ZodNumber;
404
- payload: z.ZodObject<{
405
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
406
- blobRef: z.ZodObject<{
407
- blobId: z.ZodString;
408
- contentHash: z.ZodString;
409
- size: z.ZodNumber;
410
- contentType: z.ZodString;
411
- url: z.ZodOptional<z.ZodString>;
412
- }, z.core.$strip>;
413
- }, z.core.$strict>]>;
414
- agentRef: z.ZodObject<{
415
- agentId: z.ZodString;
416
- profileRevision: z.ZodString;
417
- }, z.core.$strict>;
418
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
419
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
420
- runtime: z.ZodOptional<z.ZodEnum<{
421
- claude: "claude";
422
- codex: "codex";
423
- pi: "pi";
424
- }>>;
425
- harnessId: z.ZodOptional<z.ZodString>;
426
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
427
- lane: z.ZodLiteral<"subscription">;
428
- runtimeId: z.ZodEnum<{
429
- claude: "claude";
430
- codex: "codex";
431
- }>;
432
- providerId: z.ZodNull;
433
- modelId: z.ZodString;
434
- }, z.core.$strict>, z.ZodObject<{
435
- lane: z.ZodLiteral<"byok">;
436
- runtimeId: z.ZodLiteral<"pi">;
437
- providerId: z.ZodString;
438
- modelId: z.ZodString;
439
- }, z.core.$strict>, z.ZodObject<{
440
- lane: z.ZodLiteral<"byok-profile">;
441
- runtimeId: z.ZodLiteral<"pi">;
442
- providerProfile: z.ZodObject<{
443
- profileRef: z.ZodString;
444
- profileRevision: z.ZodString;
445
- profileHash: z.ZodString;
446
- modelId: z.ZodString;
447
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
448
- "image-input": "image-input";
449
- }>>;
450
- }, z.core.$strict>;
451
- }, z.core.$strict>], "lane">>;
452
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
453
- mode: z.ZodLiteral<"none">;
454
- }, z.core.$strict>, z.ZodObject<{
455
- mode: z.ZodLiteral<"result-document">;
456
- contract: z.ZodString;
457
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
458
- }, z.core.$strict>], "mode">>;
459
- limits: z.ZodOptional<z.ZodObject<{
460
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
461
- maxTokens: z.ZodOptional<z.ZodNumber>;
462
- }, z.core.$strip>>;
463
- sessionRef: z.ZodString;
464
- egressPolicy: z.ZodObject<{
465
- policyRevision: z.ZodString;
466
- activity: z.ZodObject<{
467
- delivery: z.ZodLiteral<"latest-value">;
468
- maxCoalesceMs: z.ZodNumber;
469
- maxEventBytes: z.ZodNumber;
470
- }, z.core.$strict>;
471
- reliable: z.ZodObject<{
472
- maxPendingEventsPerAgent: z.ZodNumber;
473
- maxPendingBytesPerAgent: z.ZodNumber;
474
- maxPendingBytesPerTenant: z.ZodNumber;
475
- }, z.core.$strict>;
476
- transfers: z.ZodObject<{
477
- workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
478
- maxBytes: z.ZodNumber;
479
- allowedMimeTypes: z.ZodArray<z.ZodString>;
480
- }, z.core.$strict>]>;
481
- transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
482
- maxBytes: z.ZodNumber;
483
- allowedMimeTypes: z.ZodArray<z.ZodString>;
484
- }, z.core.$strict>]>;
485
- artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
486
- maxBytes: z.ZodNumber;
487
- allowedMimeTypes: z.ZodArray<z.ZodString>;
488
- }, z.core.$strict>]>;
489
- }, z.core.$strict>;
490
- }, z.core.$strict>;
491
- messageEgress: z.ZodOptional<z.ZodObject<{
492
- mode: z.ZodLiteral<"required">;
493
- contract: z.ZodString;
494
- contentType: z.ZodEnum<{
495
- "text/markdown": "text/markdown";
496
- "text/plain": "text/plain";
497
- }>;
498
- maxBytes: z.ZodNumber;
499
- }, z.core.$strict>>;
500
- }, z.core.$strict>;
501
- }, z.core.$strip>, z.ZodObject<{
502
- v: z.ZodNumber;
503
- id: z.ZodUUID;
504
- ts: z.ZodISODateTime;
505
- type: z.ZodLiteral<"task.offer_for_agent_with_egress_fresh">;
506
- task_id: z.ZodString;
507
- session_ref: z.ZodOptional<z.ZodString>;
508
- seq: z.ZodNumber;
509
- payload: z.ZodObject<{
510
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
511
- blobRef: z.ZodObject<{
512
- blobId: z.ZodString;
513
- contentHash: z.ZodString;
514
- size: z.ZodNumber;
515
- contentType: z.ZodString;
516
- url: z.ZodOptional<z.ZodString>;
517
- }, z.core.$strip>;
518
- }, z.core.$strict>]>;
519
- agentRef: z.ZodObject<{
520
- agentId: z.ZodString;
521
- profileRevision: z.ZodString;
522
- }, z.core.$strict>;
523
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
524
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
525
- runtime: z.ZodOptional<z.ZodEnum<{
526
- claude: "claude";
527
- codex: "codex";
528
- pi: "pi";
529
- }>>;
530
- harnessId: z.ZodOptional<z.ZodString>;
531
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
532
- lane: z.ZodLiteral<"subscription">;
533
- runtimeId: z.ZodEnum<{
534
- claude: "claude";
535
- codex: "codex";
536
- }>;
537
- providerId: z.ZodNull;
538
- modelId: z.ZodString;
539
- }, z.core.$strict>, z.ZodObject<{
540
- lane: z.ZodLiteral<"byok">;
541
- runtimeId: z.ZodLiteral<"pi">;
542
- providerId: z.ZodString;
543
- modelId: z.ZodString;
544
- }, z.core.$strict>, z.ZodObject<{
545
- lane: z.ZodLiteral<"byok-profile">;
546
- runtimeId: z.ZodLiteral<"pi">;
547
- providerProfile: z.ZodObject<{
548
- profileRef: z.ZodString;
549
- profileRevision: z.ZodString;
550
- profileHash: z.ZodString;
551
- modelId: z.ZodString;
552
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
553
- "image-input": "image-input";
554
- }>>;
555
- }, z.core.$strict>;
556
- }, z.core.$strict>], "lane">>;
557
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
558
- mode: z.ZodLiteral<"none">;
559
- }, z.core.$strict>, z.ZodObject<{
560
- mode: z.ZodLiteral<"result-document">;
561
- contract: z.ZodString;
562
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
563
- }, z.core.$strict>], "mode">>;
564
- limits: z.ZodOptional<z.ZodObject<{
565
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
566
- maxTokens: z.ZodOptional<z.ZodNumber>;
567
- }, z.core.$strip>>;
568
- egressPolicy: z.ZodObject<{
569
- policyRevision: z.ZodString;
570
- activity: z.ZodObject<{
571
- delivery: z.ZodLiteral<"latest-value">;
572
- maxCoalesceMs: z.ZodNumber;
573
- maxEventBytes: z.ZodNumber;
574
- }, z.core.$strict>;
575
- reliable: z.ZodObject<{
576
- maxPendingEventsPerAgent: z.ZodNumber;
577
- maxPendingBytesPerAgent: z.ZodNumber;
578
- maxPendingBytesPerTenant: z.ZodNumber;
579
- }, z.core.$strict>;
580
- transfers: z.ZodObject<{
581
- workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
582
- maxBytes: z.ZodNumber;
583
- allowedMimeTypes: z.ZodArray<z.ZodString>;
584
- }, z.core.$strict>]>;
585
- transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
586
- maxBytes: z.ZodNumber;
587
- allowedMimeTypes: z.ZodArray<z.ZodString>;
588
- }, z.core.$strict>]>;
589
- artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
590
- maxBytes: z.ZodNumber;
591
- allowedMimeTypes: z.ZodArray<z.ZodString>;
592
- }, z.core.$strict>]>;
593
- }, z.core.$strict>;
594
- }, z.core.$strict>;
595
- messageEgress: z.ZodOptional<z.ZodObject<{
596
- mode: z.ZodLiteral<"required">;
597
- contract: z.ZodString;
598
- contentType: z.ZodEnum<{
599
- "text/markdown": "text/markdown";
600
- "text/plain": "text/plain";
601
- }>;
602
- maxBytes: z.ZodNumber;
603
- }, z.core.$strict>>;
604
- }, z.core.$strict>;
605
- }, z.core.$strip>, z.ZodObject<{
606
- v: z.ZodNumber;
607
- id: z.ZodUUID;
608
- ts: z.ZodISODateTime;
609
- type: z.ZodLiteral<"task.offer_prepared">;
610
- task_id: z.ZodString;
611
- session_ref: z.ZodOptional<z.ZodString>;
612
- seq: z.ZodNumber;
613
- payload: z.ZodObject<{
614
- agentRef: z.ZodObject<{
615
- agentId: z.ZodString;
616
- profileRevision: z.ZodString;
617
- }, z.core.$strict>;
618
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
619
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
620
- runtime: z.ZodOptional<z.ZodEnum<{
621
- claude: "claude";
622
- codex: "codex";
623
- pi: "pi";
624
- }>>;
625
- harnessId: z.ZodOptional<z.ZodString>;
626
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
627
- lane: z.ZodLiteral<"subscription">;
628
- runtimeId: z.ZodEnum<{
629
- claude: "claude";
630
- codex: "codex";
631
- }>;
632
- providerId: z.ZodNull;
633
- modelId: z.ZodString;
634
- }, z.core.$strict>, z.ZodObject<{
635
- lane: z.ZodLiteral<"byok">;
636
- runtimeId: z.ZodLiteral<"pi">;
637
- providerId: z.ZodString;
638
- modelId: z.ZodString;
639
- }, z.core.$strict>, z.ZodObject<{
640
- lane: z.ZodLiteral<"byok-profile">;
641
- runtimeId: z.ZodLiteral<"pi">;
642
- providerProfile: z.ZodObject<{
643
- profileRef: z.ZodString;
644
- profileRevision: z.ZodString;
645
- profileHash: z.ZodString;
646
- modelId: z.ZodString;
647
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
648
- "image-input": "image-input";
649
- }>>;
650
- }, z.core.$strict>;
651
- }, z.core.$strict>], "lane">>;
652
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
653
- mode: z.ZodLiteral<"none">;
654
- }, z.core.$strict>, z.ZodObject<{
655
- mode: z.ZodLiteral<"result-document">;
656
- contract: z.ZodString;
657
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
658
- }, z.core.$strict>], "mode">>;
659
- limits: z.ZodOptional<z.ZodObject<{
660
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
661
- maxTokens: z.ZodOptional<z.ZodNumber>;
662
- }, z.core.$strip>>;
663
- preparation: z.ZodObject<{
664
- reference: z.ZodString;
665
- requestDigest: z.ZodString;
666
- artifactDigest: z.ZodOptional<z.ZodString>;
667
- }, z.core.$strict>;
668
- agentMemory: z.ZodEnum<{
669
- none: "none";
670
- read: "read";
671
- "read-write": "read-write";
672
- }>;
673
- egressPolicy: z.ZodObject<{
674
- policyRevision: z.ZodString;
675
- activity: z.ZodObject<{
676
- delivery: z.ZodLiteral<"latest-value">;
677
- maxCoalesceMs: z.ZodNumber;
678
- maxEventBytes: z.ZodNumber;
679
- }, z.core.$strict>;
680
- reliable: z.ZodObject<{
681
- maxPendingEventsPerAgent: z.ZodNumber;
682
- maxPendingBytesPerAgent: z.ZodNumber;
683
- maxPendingBytesPerTenant: z.ZodNumber;
684
- }, z.core.$strict>;
685
- transfers: z.ZodObject<{
686
- workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
687
- maxBytes: z.ZodNumber;
688
- allowedMimeTypes: z.ZodArray<z.ZodString>;
689
- }, z.core.$strict>]>;
690
- transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
691
- maxBytes: z.ZodNumber;
692
- allowedMimeTypes: z.ZodArray<z.ZodString>;
693
- }, z.core.$strict>]>;
694
- artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
695
- maxBytes: z.ZodNumber;
696
- allowedMimeTypes: z.ZodArray<z.ZodString>;
697
- }, z.core.$strict>]>;
698
- }, z.core.$strict>;
699
- }, z.core.$strict>;
700
- messageEgress: z.ZodOptional<z.ZodObject<{
701
- mode: z.ZodLiteral<"required">;
702
- contract: z.ZodString;
703
- contentType: z.ZodEnum<{
704
- "text/markdown": "text/markdown";
705
- "text/plain": "text/plain";
706
- }>;
707
- maxBytes: z.ZodNumber;
708
- }, z.core.$strict>>;
709
- }, z.core.$strict>;
710
- }, z.core.$strip>, z.ZodObject<{
711
- v: z.ZodNumber;
712
- id: z.ZodUUID;
713
- ts: z.ZodISODateTime;
714
- type: z.ZodLiteral<"agent.egress.ack">;
715
- task_id: z.ZodOptional<z.ZodString>;
716
- session_ref: z.ZodOptional<z.ZodString>;
717
- seq: z.ZodNumber;
718
- payload: z.ZodObject<{
719
- agentRef: z.ZodObject<{
720
- agentId: z.ZodString;
721
- profileRevision: z.ZodString;
722
- }, z.core.$strict>;
723
- sessionRef: z.ZodString;
724
- policyRevision: z.ZodString;
725
- eventId: z.ZodUUID;
726
- cursor: z.ZodNumber;
727
- receiptId: z.ZodUUID;
728
- }, z.core.$strict>;
729
- }, z.core.$strip>, z.ZodObject<{
730
- v: z.ZodNumber;
731
- id: z.ZodUUID;
732
- ts: z.ZodISODateTime;
733
- type: z.ZodLiteral<"agent.message.disposition">;
734
- task_id: z.ZodString;
735
- session_ref: z.ZodOptional<z.ZodString>;
736
- seq: z.ZodNumber;
737
- payload: z.ZodObject<{
738
- agentRef: z.ZodObject<{
739
- agentId: z.ZodString;
740
- profileRevision: z.ZodString;
741
- }, z.core.$strict>;
742
- sessionRef: z.ZodString;
743
- contract: z.ZodString;
744
- messageId: z.ZodUUID;
745
- cursor: z.ZodNumber;
746
- contentHash: z.ZodString;
747
- outcome: z.ZodEnum<{
748
- accepted: "accepted";
749
- held: "held";
750
- refused: "refused";
751
- }>;
752
- receiptId: z.ZodUUID;
753
- reasonCode: z.ZodOptional<z.ZodString>;
754
- }, z.core.$strict>;
755
- }, z.core.$strip>, z.ZodObject<{
756
- v: z.ZodNumber;
757
- id: z.ZodUUID;
758
- ts: z.ZodISODateTime;
759
- type: z.ZodLiteral<"agent.content.read">;
760
- task_id: z.ZodOptional<z.ZodString>;
761
- session_ref: z.ZodOptional<z.ZodString>;
762
- seq: z.ZodNumber;
763
- payload: z.ZodObject<{
764
- requestId: z.ZodUUID;
765
- surface: z.ZodEnum<{
766
- artifact: "artifact";
767
- transcript: "transcript";
768
- workspace: "workspace";
769
- }>;
770
- actor: z.ZodObject<{
771
- kind: z.ZodEnum<{
772
- agent: "agent";
773
- system: "system";
774
- user: "user";
775
- }>;
776
- id: z.ZodString;
777
- }, z.core.$strict>;
778
- agentRef: z.ZodObject<{
779
- agentId: z.ZodString;
780
- profileRevision: z.ZodString;
781
- }, z.core.$strict>;
782
- sessionRef: z.ZodString;
783
- runtime: z.ZodEnum<{
784
- claude: "claude";
785
- codex: "codex";
786
- pi: "pi";
787
- }>;
788
- cwd: z.ZodString;
789
- policyRevision: z.ZodString;
790
- target: z.ZodString;
791
- mimeType: z.ZodString;
792
- decodeAs: z.ZodEnum<{
793
- bytes: "bytes";
794
- utf8: "utf8";
795
- }>;
796
- policy: z.ZodObject<{
797
- maxBytes: z.ZodNumber;
798
- allowedMimeTypes: z.ZodArray<z.ZodString>;
799
- }, z.core.$strict>;
800
- }, z.core.$strict>;
801
- }, z.core.$strip>, z.ZodObject<{
802
- v: z.ZodNumber;
803
- id: z.ZodUUID;
804
- ts: z.ZodISODateTime;
805
- type: z.ZodLiteral<"agent.home.projection">;
806
- task_id: z.ZodOptional<z.ZodNever>;
807
- session_ref: z.ZodOptional<z.ZodString>;
808
- seq: z.ZodNumber;
809
- payload: z.ZodObject<{
810
- requestId: z.ZodUUID;
811
- agentRef: z.ZodObject<{
812
- agentId: z.ZodString;
813
- profileRevision: z.ZodString;
814
- }, z.core.$strict>;
815
- projectionHash: z.ZodString;
816
- projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
817
- }, z.core.$strict>;
818
- }, z.core.$strip>, z.ZodObject<{
819
- v: z.ZodNumber;
820
- id: z.ZodUUID;
821
- ts: z.ZodISODateTime;
822
- type: z.ZodLiteral<"agent.input.preparation">;
823
- task_id: z.ZodOptional<z.ZodNever>;
824
- session_ref: z.ZodOptional<z.ZodString>;
825
- seq: z.ZodNumber;
826
- payload: z.ZodObject<{
827
- agentMemory: z.ZodEnum<{
828
- none: "none";
829
- read: "read";
830
- "read-write": "read-write";
831
- }>;
832
- requestId: z.ZodUUID;
833
- agentRef: z.ZodObject<{
834
- agentId: z.ZodString;
835
- profileRevision: z.ZodString;
836
- }, z.core.$strict>;
837
- profileId: z.ZodString;
838
- policyRevision: z.ZodString;
839
- source: z.ZodObject<{
840
- revision: z.ZodString;
841
- digest: z.ZodString;
842
- }, z.core.$strict>;
843
- selection: z.ZodObject<{
844
- model: z.ZodObject<{
845
- id: z.ZodString;
846
- name: z.ZodString;
847
- api: z.ZodLiteral<"openai-completions">;
848
- provider: z.ZodString;
849
- baseUrl: z.ZodString;
850
- reasoning: z.ZodBoolean;
851
- input: z.ZodArray<z.ZodEnum<{
852
- image: "image";
853
- text: "text";
854
- }>>;
855
- cost: z.ZodObject<{
856
- input: z.ZodNumber;
857
- output: z.ZodNumber;
858
- cacheRead: z.ZodNumber;
859
- cacheWrite: z.ZodNumber;
860
- }, z.core.$strict>;
861
- contextWindow: z.ZodNumber;
862
- maxTokens: z.ZodNumber;
863
- thinkingLevelMap: z.ZodOptional<z.ZodObject<{
864
- off: z.ZodNullable<z.ZodString>;
865
- minimal: z.ZodNullable<z.ZodString>;
866
- low: z.ZodNullable<z.ZodString>;
867
- medium: z.ZodNullable<z.ZodString>;
868
- high: z.ZodNullable<z.ZodString>;
869
- xhigh: z.ZodNullable<z.ZodString>;
870
- max: z.ZodNullable<z.ZodString>;
871
- }, z.core.$strict>>;
872
- compat: z.ZodOptional<z.ZodObject<{
873
- supportsStore: z.ZodOptional<z.ZodBoolean>;
874
- supportsDeveloperRole: z.ZodOptional<z.ZodBoolean>;
875
- supportsReasoningEffort: z.ZodOptional<z.ZodBoolean>;
876
- supportsUsageInStreaming: z.ZodOptional<z.ZodBoolean>;
877
- maxTokensField: z.ZodOptional<z.ZodEnum<{
878
- max_completion_tokens: "max_completion_tokens";
879
- max_tokens: "max_tokens";
880
- }>>;
881
- thinkingFormat: z.ZodOptional<z.ZodEnum<{
882
- "ant-ling": "ant-ling";
883
- baseten: "baseten";
884
- "chat-template": "chat-template";
885
- deepseek: "deepseek";
886
- openai: "openai";
887
- openrouter: "openrouter";
888
- qwen: "qwen";
889
- "qwen-chat-template": "qwen-chat-template";
890
- "string-thinking": "string-thinking";
891
- together: "together";
892
- zai: "zai";
893
- }>>;
894
- zaiToolStream: z.ZodOptional<z.ZodBoolean>;
895
- }, z.core.$strict>>;
896
- }, z.core.$strict>;
897
- options: z.ZodObject<{
898
- cacheRetention: z.ZodEnum<{
899
- long: "long";
900
- none: "none";
901
- short: "short";
902
- }>;
903
- maxTokens: z.ZodNumber;
904
- temperature: z.ZodOptional<z.ZodNumber>;
905
- toolChoice: z.ZodOptional<z.ZodEnum<{
906
- auto: "auto";
907
- none: "none";
908
- }>>;
909
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
910
- high: "high";
911
- low: "low";
912
- max: "max";
913
- medium: "medium";
914
- minimal: "minimal";
915
- xhigh: "xhigh";
916
- }>>;
917
- }, z.core.$strict>;
918
- }, z.core.$strict>;
919
- deadlineAt: z.ZodISODateTime;
920
- context: z.ZodUnion<readonly [z.ZodObject<{
921
- inline: z.ZodString;
922
- }, z.core.$strict>, z.ZodObject<{
923
- blobRef: z.ZodObject<{
924
- blobId: z.ZodString;
925
- contentHash: z.ZodString;
926
- size: z.ZodNumber;
927
- contentType: z.ZodString;
928
- url: z.ZodOptional<z.ZodString>;
929
- }, z.core.$strip>;
930
- contentHash: z.ZodString;
931
- }, z.core.$strict>]>;
932
- requiredToolsets: z.ZodArray<z.ZodString>;
933
- accountingPolicyRef: z.ZodOptional<z.ZodObject<{
934
- revision: z.ZodString;
935
- ruledRuntime: z.ZodString;
936
- ruledTarget: z.ZodObject<{
937
- endpoint: z.ZodString;
938
- modelId: z.ZodString;
939
- }, z.core.$strict>;
940
- ruledResidualKeys: z.ZodArray<z.ZodString>;
941
- }, z.core.$strict>>;
942
- }, z.core.$strict>;
943
- }, z.core.$strip>, z.ZodObject<{
944
- v: z.ZodNumber;
945
- id: z.ZodUUID;
946
- ts: z.ZodISODateTime;
947
- type: z.ZodLiteral<"provider.provisioning.available">;
948
- task_id: z.ZodOptional<z.ZodNever>;
949
- session_ref: z.ZodOptional<z.ZodString>;
950
- seq: z.ZodNumber;
951
- payload: z.ZodObject<{
952
- requestId: z.ZodUUID;
953
- }, z.core.$strict>;
954
- }, z.core.$strip>, z.ZodObject<{
955
- v: z.ZodNumber;
956
- id: z.ZodUUID;
957
- ts: z.ZodISODateTime;
958
- type: z.ZodLiteral<"agent.memory.intent.available">;
959
- task_id: z.ZodOptional<z.ZodNever>;
960
- session_ref: z.ZodOptional<z.ZodString>;
961
- seq: z.ZodNumber;
962
- payload: z.ZodObject<{
963
- intentId: z.ZodUUID;
964
- agentRef: z.ZodObject<{
965
- agentId: z.ZodString;
966
- profileRevision: z.ZodString;
967
- }, z.core.$strict>;
968
- }, z.core.$strict>;
969
- }, z.core.$strip>, z.ZodObject<{
970
- v: z.ZodNumber;
971
- id: z.ZodUUID;
972
- ts: z.ZodISODateTime;
973
- type: z.ZodLiteral<"task.approve">;
974
- task_id: z.ZodString;
975
- session_ref: z.ZodOptional<z.ZodString>;
976
- seq: z.ZodNumber;
977
- payload: z.ZodObject<{
978
- approvalId: z.ZodOptional<z.ZodString>;
979
- }, z.core.$strip>;
980
- }, z.core.$strip>, z.ZodObject<{
981
- v: z.ZodNumber;
982
- id: z.ZodUUID;
983
- ts: z.ZodISODateTime;
984
- type: z.ZodLiteral<"task.reject">;
985
- task_id: z.ZodString;
986
- session_ref: z.ZodOptional<z.ZodString>;
987
- seq: z.ZodNumber;
988
- payload: z.ZodObject<{
989
- reason: z.ZodOptional<z.ZodString>;
990
- approvalId: z.ZodOptional<z.ZodString>;
991
- }, z.core.$strip>;
992
- }, z.core.$strip>, z.ZodObject<{
993
- v: z.ZodNumber;
994
- id: z.ZodUUID;
995
- ts: z.ZodISODateTime;
996
- type: z.ZodLiteral<"task.cancel">;
997
- task_id: z.ZodString;
998
- session_ref: z.ZodOptional<z.ZodString>;
999
- seq: z.ZodNumber;
1000
- payload: z.ZodObject<{
1001
- reason: z.ZodOptional<z.ZodString>;
1002
- }, z.core.$strip>;
1003
- }, z.core.$strip>, z.ZodObject<{
1004
- v: z.ZodNumber;
1005
- id: z.ZodUUID;
1006
- ts: z.ZodISODateTime;
1007
- type: z.ZodLiteral<"task.steer">;
1008
- task_id: z.ZodString;
1009
- session_ref: z.ZodOptional<z.ZodString>;
1010
- seq: z.ZodNumber;
1011
- payload: z.ZodObject<{
1012
- text: z.ZodString;
1013
- }, z.core.$strip>;
1014
- }, z.core.$strip>, z.ZodObject<{
1015
- v: z.ZodNumber;
1016
- id: z.ZodUUID;
1017
- ts: z.ZodISODateTime;
1018
- type: z.ZodLiteral<"task.claim">;
1019
- task_id: z.ZodString;
1020
- session_ref: z.ZodOptional<z.ZodString>;
1021
- seq: z.ZodOptional<z.ZodNumber>;
1022
- payload: z.ZodObject<{
1023
- deviceId: z.ZodString;
1024
- agentId: z.ZodOptional<z.ZodString>;
1025
- agentRef: z.ZodOptional<z.ZodObject<{
1026
- agentId: z.ZodString;
1027
- profileRevision: z.ZodString;
1028
- }, z.core.$strict>>;
1029
- runtime: z.ZodOptional<z.ZodEnum<{
1030
- claude: "claude";
1031
- codex: "codex";
1032
- pi: "pi";
1033
- }>>;
1034
- harnessId: z.ZodOptional<z.ZodString>;
1035
- capabilities: z.ZodOptional<z.ZodObject<{
1036
- steer: z.ZodOptional<z.ZodBoolean>;
1037
- resume: z.ZodOptional<z.ZodBoolean>;
1038
- approvalInteractive: z.ZodOptional<z.ZodBoolean>;
1039
- mcpToolsets: z.ZodOptional<z.ZodBoolean>;
1040
- messageDraft: z.ZodOptional<z.ZodBoolean>;
1041
- }, z.core.$strip>>;
1042
- }, z.core.$strip>;
1043
- }, z.core.$strip>, z.ZodObject<{
1044
- v: z.ZodNumber;
1045
- id: z.ZodUUID;
1046
- ts: z.ZodISODateTime;
1047
- type: z.ZodLiteral<"task.started">;
1048
- task_id: z.ZodString;
1049
- session_ref: z.ZodOptional<z.ZodString>;
1050
- seq: z.ZodOptional<z.ZodNumber>;
1051
- payload: z.ZodObject<{}, z.core.$strip>;
1052
- }, z.core.$strip>, z.ZodObject<{
1053
- v: z.ZodNumber;
1054
- id: z.ZodUUID;
1055
- ts: z.ZodISODateTime;
1056
- type: z.ZodLiteral<"task.decline">;
1057
- task_id: z.ZodString;
1058
- session_ref: z.ZodOptional<z.ZodString>;
1059
- seq: z.ZodOptional<z.ZodNumber>;
1060
- payload: z.ZodObject<{
1061
- reason: z.ZodString;
1062
- retryable: z.ZodOptional<z.ZodBoolean>;
1063
- agentRef: z.ZodOptional<z.ZodObject<{
1064
- agentId: z.ZodString;
1065
- profileRevision: z.ZodString;
1066
- }, z.core.$strict>>;
1067
- code: z.ZodOptional<z.ZodEnum<{
1068
- agent_home_reader_busy: "agent_home_reader_busy";
1069
- agent_home_writer_busy: "agent_home_writer_busy";
1070
- }>>;
1071
- }, z.core.$strip>;
1072
- }, z.core.$strip>, z.ZodObject<{
1073
- v: z.ZodNumber;
1074
- id: z.ZodUUID;
1075
- ts: z.ZodISODateTime;
1076
- type: z.ZodLiteral<"task.progress">;
1077
- task_id: z.ZodString;
1078
- session_ref: z.ZodOptional<z.ZodString>;
1079
- seq: z.ZodOptional<z.ZodNumber>;
1080
- payload: z.ZodObject<{
1081
- seq: z.ZodNumber;
1082
- events: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
1083
- type: z.ZodLiteral<"progress">;
1084
- text: z.ZodString;
1085
- }, z.core.$strip>, z.ZodObject<{
1086
- type: z.ZodLiteral<"tool_use">;
1087
- tool: z.ZodString;
1088
- mcp: z.ZodOptional<z.ZodObject<{
1089
- server: z.ZodString;
1090
- tool: z.ZodString;
1091
- }, z.core.$strict>>;
1092
- input: z.ZodOptional<z.ZodUnknown>;
1093
- toolCallId: z.ZodOptional<z.ZodString>;
1094
- spill: z.ZodOptional<z.ZodObject<{
1095
- field: z.ZodEnum<{
1096
- input: "input";
1097
- output: "output";
1098
- }>;
1099
- totalBytes: z.ZodNumber;
1100
- omittedBytes: z.ZodNumber;
1101
- contentType: z.ZodLiteral<"application/json">;
1102
- blob: z.ZodOptional<z.ZodObject<{
1103
- blobId: z.ZodString;
1104
- contentHash: z.ZodString;
1105
- size: z.ZodNumber;
1106
- contentType: z.ZodString;
1107
- url: z.ZodOptional<z.ZodString>;
1108
- }, z.core.$strip>>;
1109
- unstoredReason: z.ZodOptional<z.ZodString>;
1110
- }, z.core.$strict>>;
1111
- }, z.core.$strip>, z.ZodObject<{
1112
- type: z.ZodLiteral<"tool_result">;
1113
- tool: z.ZodString;
1114
- mcp: z.ZodOptional<z.ZodObject<{
1115
- server: z.ZodString;
1116
- tool: z.ZodString;
1117
- }, z.core.$strict>>;
1118
- output: z.ZodOptional<z.ZodUnknown>;
1119
- toolCallId: z.ZodOptional<z.ZodString>;
1120
- isError: z.ZodOptional<z.ZodBoolean>;
1121
- spill: z.ZodOptional<z.ZodObject<{
1122
- field: z.ZodEnum<{
1123
- input: "input";
1124
- output: "output";
1125
- }>;
1126
- totalBytes: z.ZodNumber;
1127
- omittedBytes: z.ZodNumber;
1128
- contentType: z.ZodLiteral<"application/json">;
1129
- blob: z.ZodOptional<z.ZodObject<{
1130
- blobId: z.ZodString;
1131
- contentHash: z.ZodString;
1132
- size: z.ZodNumber;
1133
- contentType: z.ZodString;
1134
- url: z.ZodOptional<z.ZodString>;
1135
- }, z.core.$strip>>;
1136
- unstoredReason: z.ZodOptional<z.ZodString>;
1137
- }, z.core.$strict>>;
1138
- }, z.core.$strip>, z.ZodObject<{
1139
- type: z.ZodLiteral<"artifact">;
1140
- name: z.ZodString;
1141
- contentType: z.ZodString;
1142
- }, z.core.$strip>, z.ZodObject<{
1143
- type: z.ZodLiteral<"needs_approval">;
1144
- summary: z.ZodString;
1145
- }, z.core.$strip>, z.ZodObject<{
1146
- type: z.ZodLiteral<"turn_end">;
1147
- }, z.core.$strip>, z.ZodObject<{
1148
- type: z.ZodLiteral<"error">;
1149
- message: z.ZodString;
1150
- }, z.core.$strip>, z.ZodObject<{
1151
- type: z.ZodLiteral<"usage">;
1152
- inputTokens: z.ZodOptional<z.ZodNumber>;
1153
- cachedInputTokens: z.ZodOptional<z.ZodNumber>;
1154
- outputTokens: z.ZodOptional<z.ZodNumber>;
1155
- reasoningTokens: z.ZodOptional<z.ZodNumber>;
1156
- totalTokens: z.ZodOptional<z.ZodNumber>;
1157
- contextTokens: z.ZodOptional<z.ZodNumber>;
1158
- contextWindow: z.ZodOptional<z.ZodNumber>;
1159
- contextSource: z.ZodOptional<z.ZodEnum<{
1160
- estimate: "estimate";
1161
- provider: "provider";
1162
- }>>;
1163
- }, z.core.$strip>], "type">, z.ZodObject<{
1164
- type: z.ZodString;
1165
- }, z.core.$loose>]>>;
1166
- }, z.core.$strip>;
1167
- }, z.core.$strip>, z.ZodObject<{
1168
- v: z.ZodNumber;
1169
- id: z.ZodUUID;
1170
- ts: z.ZodISODateTime;
1171
- type: z.ZodLiteral<"task.artifact">;
1172
- task_id: z.ZodString;
1173
- session_ref: z.ZodOptional<z.ZodString>;
1174
- seq: z.ZodOptional<z.ZodNumber>;
1175
- payload: z.ZodObject<{
1176
- name: z.ZodString;
1177
- contentType: z.ZodString;
1178
- inline: z.ZodOptional<z.ZodString>;
1179
- blobRef: z.ZodOptional<z.ZodObject<{
1180
- blobId: z.ZodString;
1181
- contentHash: z.ZodString;
1182
- size: z.ZodNumber;
1183
- contentType: z.ZodString;
1184
- url: z.ZodOptional<z.ZodString>;
1185
- }, z.core.$strip>>;
1186
- }, z.core.$strip>;
1187
- }, z.core.$strip>, z.ZodObject<{
1188
- v: z.ZodNumber;
1189
- id: z.ZodUUID;
1190
- ts: z.ZodISODateTime;
1191
- type: z.ZodLiteral<"task.await_approval">;
1192
- task_id: z.ZodString;
1193
- session_ref: z.ZodOptional<z.ZodString>;
1194
- seq: z.ZodOptional<z.ZodNumber>;
1195
- payload: z.ZodObject<{
1196
- summary: z.ZodString;
1197
- approvalId: z.ZodOptional<z.ZodString>;
1198
- }, z.core.$strip>;
1199
- }, z.core.$strip>, z.ZodObject<{
1200
- v: z.ZodNumber;
1201
- id: z.ZodUUID;
1202
- ts: z.ZodISODateTime;
1203
- type: z.ZodLiteral<"task.complete">;
1204
- task_id: z.ZodString;
1205
- session_ref: z.ZodOptional<z.ZodString>;
1206
- seq: z.ZodOptional<z.ZodNumber>;
1207
- payload: z.ZodObject<{
1208
- harnessId: z.ZodOptional<z.ZodString>;
1209
- summary: z.ZodString;
1210
- finalMessage: z.ZodOptional<z.ZodString>;
1211
- sessionRef: z.ZodString;
1212
- artifactRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1213
- blobId: z.ZodString;
1214
- contentHash: z.ZodString;
1215
- size: z.ZodNumber;
1216
- contentType: z.ZodString;
1217
- url: z.ZodOptional<z.ZodString>;
1218
- }, z.core.$strip>>>;
1219
- document: z.ZodOptional<z.ZodUnknown>;
1220
- usage: z.ZodOptional<z.ZodObject<{
1221
- runtime: z.ZodEnum<{
1222
- claude: "claude";
1223
- codex: "codex";
1224
- pi: "pi";
1225
- }>;
1226
- provider: z.ZodOptional<z.ZodString>;
1227
- model: z.ZodOptional<z.ZodString>;
1228
- promptTokens: z.ZodOptional<z.ZodNumber>;
1229
- completionTokens: z.ZodOptional<z.ZodNumber>;
1230
- durationMs: z.ZodOptional<z.ZodNumber>;
1231
- clientVersion: z.ZodString;
1232
- reportedAt: z.ZodISODateTime;
1233
- }, z.core.$strip>>;
1234
- preparedObservation: z.ZodOptional<z.ZodObject<{
1235
- requestDigest: z.ZodString;
1236
- initialPromptTokens: z.ZodNumber;
1237
- maxPromptTokens: z.ZodNumber;
1238
- }, z.core.$strict>>;
1239
- agentRef: z.ZodOptional<z.ZodObject<{
1240
- agentId: z.ZodString;
1241
- profileRevision: z.ZodString;
1242
- }, z.core.$strict>>;
1243
- agentHomeProjection: z.ZodOptional<z.ZodObject<{
1244
- profileRevision: z.ZodString;
1245
- projectionHash: z.ZodString;
1246
- }, z.core.$strict>>;
1247
- agentHomeMemoryChange: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1248
- outcome: z.ZodLiteral<"unchanged">;
1249
- }, z.core.$strict>, z.ZodObject<{
1250
- outcome: z.ZodLiteral<"reader-attributed">;
1251
- paths: z.ZodArray<z.ZodString>;
1252
- }, z.core.$strict>, z.ZodObject<{
1253
- outcome: z.ZodLiteral<"unattributed">;
1254
- paths: z.ZodArray<z.ZodString>;
1255
- }, z.core.$strict>, z.ZodObject<{
1256
- outcome: z.ZodLiteral<"unmeasured">;
1257
- }, z.core.$strict>], "outcome">>;
1258
- }, z.core.$strip>;
1259
- }, z.core.$strip>, z.ZodObject<{
1260
- v: z.ZodNumber;
1261
- id: z.ZodUUID;
1262
- ts: z.ZodISODateTime;
1263
- type: z.ZodLiteral<"task.fail">;
1264
- task_id: z.ZodString;
1265
- session_ref: z.ZodOptional<z.ZodString>;
1266
- seq: z.ZodOptional<z.ZodNumber>;
1267
- payload: z.ZodObject<{
1268
- recovery: z.ZodOptional<z.ZodObject<{
1269
- kind: z.ZodLiteral<"daemon_interrupted">;
1270
- offerId: z.ZodUUID;
1271
- }, z.core.$strict>>;
1272
- harnessId: z.ZodOptional<z.ZodString>;
1273
- reason: z.ZodString;
1274
- retryable: z.ZodOptional<z.ZodBoolean>;
1275
- usage: z.ZodOptional<z.ZodObject<{
1276
- runtime: z.ZodEnum<{
1277
- claude: "claude";
1278
- codex: "codex";
1279
- pi: "pi";
1280
- }>;
1281
- provider: z.ZodOptional<z.ZodString>;
1282
- model: z.ZodOptional<z.ZodString>;
1283
- promptTokens: z.ZodOptional<z.ZodNumber>;
1284
- completionTokens: z.ZodOptional<z.ZodNumber>;
1285
- durationMs: z.ZodOptional<z.ZodNumber>;
1286
- clientVersion: z.ZodString;
1287
- reportedAt: z.ZodISODateTime;
1288
- }, z.core.$strip>>;
1289
- preparedObservation: z.ZodOptional<z.ZodObject<{
1290
- requestDigest: z.ZodString;
1291
- initialPromptTokens: z.ZodNumber;
1292
- maxPromptTokens: z.ZodNumber;
1293
- }, z.core.$strict>>;
1294
- agentRef: z.ZodOptional<z.ZodObject<{
1295
- agentId: z.ZodString;
1296
- profileRevision: z.ZodString;
1297
- }, z.core.$strict>>;
1298
- agentHomeProjection: z.ZodOptional<z.ZodObject<{
1299
- profileRevision: z.ZodString;
1300
- projectionHash: z.ZodString;
1301
- }, z.core.$strict>>;
1302
- agentHomeMemoryChange: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1303
- outcome: z.ZodLiteral<"unchanged">;
1304
- }, z.core.$strict>, z.ZodObject<{
1305
- outcome: z.ZodLiteral<"reader-attributed">;
1306
- paths: z.ZodArray<z.ZodString>;
1307
- }, z.core.$strict>, z.ZodObject<{
1308
- outcome: z.ZodLiteral<"unattributed">;
1309
- paths: z.ZodArray<z.ZodString>;
1310
- }, z.core.$strict>, z.ZodObject<{
1311
- outcome: z.ZodLiteral<"unmeasured">;
1312
- }, z.core.$strict>], "outcome">>;
1313
- }, z.core.$strip>;
1314
- }, z.core.$strip>, z.ZodObject<{
1315
- v: z.ZodNumber;
1316
- id: z.ZodUUID;
1317
- ts: z.ZodISODateTime;
1318
- type: z.ZodLiteral<"task.cancelled">;
1319
- task_id: z.ZodString;
1320
- session_ref: z.ZodOptional<z.ZodString>;
1321
- seq: z.ZodOptional<z.ZodNumber>;
1322
- payload: z.ZodObject<{
1323
- harnessId: z.ZodOptional<z.ZodString>;
1324
- reason: z.ZodOptional<z.ZodString>;
1325
- usage: z.ZodOptional<z.ZodObject<{
1326
- runtime: z.ZodEnum<{
1327
- claude: "claude";
1328
- codex: "codex";
1329
- pi: "pi";
1330
- }>;
1331
- provider: z.ZodOptional<z.ZodString>;
1332
- model: z.ZodOptional<z.ZodString>;
1333
- promptTokens: z.ZodOptional<z.ZodNumber>;
1334
- completionTokens: z.ZodOptional<z.ZodNumber>;
1335
- durationMs: z.ZodOptional<z.ZodNumber>;
1336
- clientVersion: z.ZodString;
1337
- reportedAt: z.ZodISODateTime;
1338
- }, z.core.$strip>>;
1339
- agentRef: z.ZodOptional<z.ZodObject<{
1340
- agentId: z.ZodString;
1341
- profileRevision: z.ZodString;
1342
- }, z.core.$strict>>;
1343
- agentHomeProjection: z.ZodOptional<z.ZodObject<{
1344
- profileRevision: z.ZodString;
1345
- projectionHash: z.ZodString;
1346
- }, z.core.$strict>>;
1347
- agentHomeMemoryChange: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1348
- outcome: z.ZodLiteral<"unchanged">;
1349
- }, z.core.$strict>, z.ZodObject<{
1350
- outcome: z.ZodLiteral<"reader-attributed">;
1351
- paths: z.ZodArray<z.ZodString>;
1352
- }, z.core.$strict>, z.ZodObject<{
1353
- outcome: z.ZodLiteral<"unattributed">;
1354
- paths: z.ZodArray<z.ZodString>;
1355
- }, z.core.$strict>, z.ZodObject<{
1356
- outcome: z.ZodLiteral<"unmeasured">;
1357
- }, z.core.$strict>], "outcome">>;
1358
- }, z.core.$strip>;
1359
- }, z.core.$strip>, z.ZodObject<{
1360
- v: z.ZodNumber;
1361
- id: z.ZodUUID;
1362
- ts: z.ZodISODateTime;
1363
- type: z.ZodLiteral<"task.approval_resolved">;
1364
- task_id: z.ZodString;
1365
- session_ref: z.ZodOptional<z.ZodString>;
1366
- seq: z.ZodOptional<z.ZodNumber>;
1367
- payload: z.ZodObject<{
1368
- approvalId: z.ZodString;
1369
- decision: z.ZodEnum<{
1370
- approve: "approve";
1371
- reject: "reject";
1372
- }>;
1373
- resolvedBy: z.ZodEnum<{
1374
- local: "local";
1375
- }>;
1376
- at: z.ZodISODateTime;
1377
- }, z.core.$strip>;
1378
- }, z.core.$strip>, z.ZodObject<{
1379
- v: z.ZodNumber;
1380
- id: z.ZodUUID;
1381
- ts: z.ZodISODateTime;
1382
- type: z.ZodLiteral<"agent.egress.reliable">;
1383
- task_id: z.ZodOptional<z.ZodString>;
1384
- session_ref: z.ZodOptional<z.ZodString>;
1385
- seq: z.ZodOptional<z.ZodNumber>;
1386
- payload: z.ZodObject<{
1387
- agentRef: z.ZodObject<{
1388
- agentId: z.ZodString;
1389
- profileRevision: z.ZodString;
1390
- }, z.core.$strict>;
1391
- sessionRef: z.ZodString;
1392
- policyRevision: z.ZodString;
1393
- eventId: z.ZodUUID;
1394
- cursor: z.ZodNumber;
1395
- payload: z.ZodJSONSchema;
1396
- contentHash: z.ZodString;
1397
- byteCount: z.ZodNumber;
1398
- }, z.core.$strict>;
1399
- }, z.core.$strip>, z.ZodObject<{
1400
- v: z.ZodNumber;
1401
- id: z.ZodUUID;
1402
- ts: z.ZodISODateTime;
1403
- type: z.ZodLiteral<"agent.message.draft">;
1404
- task_id: z.ZodString;
1405
- session_ref: z.ZodOptional<z.ZodString>;
1406
- seq: z.ZodOptional<z.ZodNumber>;
1407
- payload: z.ZodObject<{
1408
- agentRef: z.ZodObject<{
1409
- agentId: z.ZodString;
1410
- profileRevision: z.ZodString;
1411
- }, z.core.$strict>;
1412
- revision: z.ZodNumber;
1413
- offset: z.ZodNumber;
1414
- text: z.ZodString;
1415
- overflow: z.ZodOptional<z.ZodLiteral<true>>;
1416
- }, z.core.$strict>;
1417
- }, z.core.$strip>, z.ZodObject<{
1418
- v: z.ZodNumber;
1419
- id: z.ZodUUID;
1420
- ts: z.ZodISODateTime;
1421
- type: z.ZodLiteral<"agent.message.publish">;
1422
- task_id: z.ZodString;
1423
- session_ref: z.ZodOptional<z.ZodString>;
1424
- seq: z.ZodOptional<z.ZodNumber>;
1425
- payload: z.ZodObject<{
1426
- agentRef: z.ZodObject<{
1427
- agentId: z.ZodString;
1428
- profileRevision: z.ZodString;
1429
- }, z.core.$strict>;
1430
- sessionRef: z.ZodString;
1431
- contract: z.ZodString;
1432
- messageId: z.ZodUUID;
1433
- cursor: z.ZodNumber;
1434
- contentType: z.ZodEnum<{
1435
- "text/markdown": "text/markdown";
1436
- "text/plain": "text/plain";
1437
- }>;
1438
- body: z.ZodString;
1439
- contentHash: z.ZodString;
1440
- byteCount: z.ZodNumber;
1441
- }, z.core.$strict>;
1442
- }, z.core.$strip>, z.ZodObject<{
1443
- v: z.ZodNumber;
1444
- id: z.ZodUUID;
1445
- ts: z.ZodISODateTime;
1446
- type: z.ZodLiteral<"agent.content.receipt">;
1447
- task_id: z.ZodOptional<z.ZodString>;
1448
- session_ref: z.ZodOptional<z.ZodString>;
1449
- seq: z.ZodOptional<z.ZodNumber>;
1450
- payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
1451
- requestId: z.ZodUUID;
1452
- eventId: z.ZodUUID;
1453
- cursor: z.ZodNumber;
1454
- surface: z.ZodEnum<{
1455
- artifact: "artifact";
1456
- transcript: "transcript";
1457
- workspace: "workspace";
1458
- }>;
1459
- actor: z.ZodObject<{
1460
- kind: z.ZodEnum<{
1461
- agent: "agent";
1462
- system: "system";
1463
- user: "user";
1464
- }>;
1465
- id: z.ZodString;
1466
- }, z.core.$strict>;
1467
- agentRef: z.ZodObject<{
1468
- agentId: z.ZodString;
1469
- profileRevision: z.ZodString;
1470
- }, z.core.$strict>;
1471
- sessionRef: z.ZodString;
1472
- runtime: z.ZodEnum<{
1473
- claude: "claude";
1474
- codex: "codex";
1475
- pi: "pi";
1476
- }>;
1477
- cwd: z.ZodString;
1478
- policyRevision: z.ZodString;
1479
- target: z.ZodString;
1480
- mimeType: z.ZodString;
1481
- decodeAs: z.ZodEnum<{
1482
- bytes: "bytes";
1483
- utf8: "utf8";
1484
- }>;
1485
- decision: z.ZodLiteral<"allowed">;
1486
- byteCount: z.ZodNumber;
1487
- contentHash: z.ZodString;
1488
- blobRef: z.ZodObject<{
1489
- blobId: z.ZodString;
1490
- contentHash: z.ZodString;
1491
- size: z.ZodNumber;
1492
- contentType: z.ZodString;
1493
- url: z.ZodOptional<z.ZodString>;
1494
- }, z.core.$strip>;
1495
- }, z.core.$strict>, z.ZodObject<{
1496
- requestId: z.ZodUUID;
1497
- eventId: z.ZodUUID;
1498
- cursor: z.ZodNumber;
1499
- surface: z.ZodEnum<{
1500
- artifact: "artifact";
1501
- transcript: "transcript";
1502
- workspace: "workspace";
1503
- }>;
1504
- actor: z.ZodObject<{
1505
- kind: z.ZodEnum<{
1506
- agent: "agent";
1507
- system: "system";
1508
- user: "user";
1509
- }>;
1510
- id: z.ZodString;
1511
- }, z.core.$strict>;
1512
- agentRef: z.ZodObject<{
1513
- agentId: z.ZodString;
1514
- profileRevision: z.ZodString;
1515
- }, z.core.$strict>;
1516
- sessionRef: z.ZodString;
1517
- runtime: z.ZodEnum<{
1518
- claude: "claude";
1519
- codex: "codex";
1520
- pi: "pi";
1521
- }>;
1522
- cwd: z.ZodString;
1523
- policyRevision: z.ZodString;
1524
- target: z.ZodString;
1525
- mimeType: z.ZodString;
1526
- decodeAs: z.ZodEnum<{
1527
- bytes: "bytes";
1528
- utf8: "utf8";
1529
- }>;
1530
- decision: z.ZodLiteral<"denied">;
1531
- byteCount: z.ZodLiteral<0>;
1532
- reason: z.ZodEnum<{
1533
- "absolute-target": "absolute-target";
1534
- "byte-limit": "byte-limit";
1535
- "capability-missing": "capability-missing";
1536
- "dot-segment": "dot-segment";
1537
- "identity-mismatch": "identity-mismatch";
1538
- "invalid-request": "invalid-request";
1539
- "mime-not-allowlisted": "mime-not-allowlisted";
1540
- "non-relative-target": "non-relative-target";
1541
- "not-regular-file": "not-regular-file";
1542
- "path-escape": "path-escape";
1543
- "policy-disabled": "policy-disabled";
1544
- "policy-revision-mismatch": "policy-revision-mismatch";
1545
- "root-invalid": "root-invalid";
1546
- "root-not-allowlisted": "root-not-allowlisted";
1547
- "sensitive-name": "sensitive-name";
1548
- symlink: "symlink";
1549
- "target-missing": "target-missing";
1550
- "text-decode-failed": "text-decode-failed";
1551
- "text-not-allowlisted": "text-not-allowlisted";
1552
- }>;
1553
- }, z.core.$strict>], "decision">;
1554
- }, z.core.$strip>], "type">>;
159
+ messages: z.ZodArray<typeof EnvelopeSchema>;
1555
160
  }, z.core.$strip>;
1556
161
  export type MessagesSendRequest = z.infer<typeof MessagesSendRequestSchema>;
1557
162
  /**
@@ -2115,6 +720,14 @@ export declare const BYOK_RECORDS_PATH = "/byok/records";
2115
720
  export declare const BYOK_RECORD_ROUTE = "/byok/records/:kind/:key";
2116
721
  /** Client builder for a truth record path. Mirrors the `:kind/:key` template, each segment URL-encoded. */
2117
722
  export declare function byokRecordPath(kind: string, key: string): string;
723
+ /** `POST /byok/e2ee/member-key` — device proof: register the device's member key bundle and pairing MAC (#654). */
724
+ export declare const BYOK_E2EE_MEMBER_KEY_PATH = "/byok/e2ee/member-key";
725
+ /** `POST /byok/e2ee/chain` (device proof: append) and `GET` (device: read) — the member chain. */
726
+ export declare const BYOK_E2EE_CHAIN_PATH = "/byok/e2ee/chain";
727
+ /** `POST /byok/e2ee/key-packages` (device proof: put) and `GET` (device: this device's packages). */
728
+ export declare const BYOK_E2EE_KEY_PACKAGES_PATH = "/byok/e2ee/key-packages";
729
+ /** `GET /byok/e2ee/pairing-mac` — device: the client pairing MAC relayed to this device. */
730
+ export declare const BYOK_E2EE_PAIRING_MAC_PATH = "/byok/e2ee/pairing-mac";
2118
731
  /** `GET /byok/skill-packs` — skill-pack manifest catalogue. */
2119
732
  export declare const BYOK_SKILL_PACKS_PATH = "/byok/skill-packs";
2120
733
  /** Router template for a skill-pack file — `GET /byok/skill-packs/:name/files/:path`. */