@byok-sdk/protocol 0.5.0 → 0.6.1

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.
@@ -41,6 +41,32 @@ export declare const TokenResponseSchema: z.ZodObject<{
41
41
  expiresAt: z.ZodISODateTime;
42
42
  }, z.core.$strip>;
43
43
  export type TokenResponse = z.infer<typeof TokenResponseSchema>;
44
+ /** The hosted default is byte-bounded independently; this caps protocol input before it reaches a handler. */
45
+ export declare const PRESENCE_DETAIL_MAX_LENGTH = 512;
46
+ export declare const PRESENCE_RUNTIME_VERSION_MAX_LENGTH = 128;
47
+ export declare const PresencePublishRequestSchema: z.ZodObject<{
48
+ level: z.ZodEnum<{
49
+ error: "error";
50
+ offline: "offline";
51
+ online: "online";
52
+ thinking: "thinking";
53
+ working: "working";
54
+ }>;
55
+ detail: z.ZodOptional<z.ZodString>;
56
+ configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
+ clientVersion: z.ZodOptional<z.ZodString>;
58
+ protocolVersions: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
59
+ runtimes: z.ZodOptional<z.ZodArray<z.ZodObject<{
60
+ id: z.ZodEnum<{
61
+ claude: "claude";
62
+ codex: "codex";
63
+ pi: "pi";
64
+ }>;
65
+ version: z.ZodOptional<z.ZodString>;
66
+ authPresent: z.ZodOptional<z.ZodBoolean>;
67
+ }, z.core.$strip>>>;
68
+ }, z.core.$strip>;
69
+ export type PresencePublishRequest = z.infer<typeof PresencePublishRequestSchema>;
44
70
  /**
45
71
  * Revocation is server-side only (dashboard/API call on the SaaS's own
46
72
  * device registry) — there is no wire message for it. A revoked device's
@@ -83,6 +109,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
83
109
  capabilities: z.ZodArray<z.ZodString>;
84
110
  deviceId: z.ZodString;
85
111
  productId: z.ZodString;
112
+ clientVersion: z.ZodOptional<z.ZodString>;
86
113
  runtimes: z.ZodOptional<z.ZodArray<z.ZodObject<{
87
114
  id: z.ZodEnum<{
88
115
  claude: "claude";
@@ -228,6 +255,222 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
228
255
  }, z.core.$strip>>;
229
256
  requiredToolsets: z.ZodArray<z.ZodString>;
230
257
  }, z.core.$strict>;
258
+ }, z.core.$strip>, z.ZodObject<{
259
+ v: z.ZodNumber;
260
+ id: z.ZodUUID;
261
+ ts: z.ZodISODateTime;
262
+ type: z.ZodLiteral<"task.offer_for_agent">;
263
+ task_id: z.ZodString;
264
+ session_ref: z.ZodOptional<z.ZodString>;
265
+ seq: z.ZodNumber;
266
+ payload: z.ZodObject<{
267
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
268
+ blobRef: z.ZodObject<{
269
+ blobId: z.ZodString;
270
+ contentHash: z.ZodString;
271
+ size: z.ZodNumber;
272
+ contentType: z.ZodString;
273
+ url: z.ZodOptional<z.ZodString>;
274
+ }, z.core.$strip>;
275
+ }, z.core.$strict>]>;
276
+ policy: z.ZodObject<{
277
+ mode: z.ZodEnum<{
278
+ auto: "auto";
279
+ confirm: "confirm";
280
+ plan: "plan";
281
+ readonly: "readonly";
282
+ }>;
283
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
284
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
285
+ workspaceRoot: z.ZodOptional<z.ZodString>;
286
+ network: z.ZodOptional<z.ZodBoolean>;
287
+ }, z.core.$strict>;
288
+ agentRef: z.ZodObject<{
289
+ agentId: z.ZodString;
290
+ profileRevision: z.ZodString;
291
+ }, z.core.$strict>;
292
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
293
+ runtime: z.ZodOptional<z.ZodEnum<{
294
+ claude: "claude";
295
+ codex: "codex";
296
+ pi: "pi";
297
+ }>>;
298
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
299
+ lane: z.ZodLiteral<"subscription">;
300
+ runtimeId: z.ZodEnum<{
301
+ claude: "claude";
302
+ codex: "codex";
303
+ }>;
304
+ providerId: z.ZodNull;
305
+ modelId: z.ZodString;
306
+ }, z.core.$strict>, z.ZodObject<{
307
+ lane: z.ZodLiteral<"byok">;
308
+ runtimeId: z.ZodLiteral<"pi">;
309
+ providerId: z.ZodString;
310
+ modelId: z.ZodString;
311
+ }, z.core.$strict>], "lane">>;
312
+ sessionRef: z.ZodOptional<z.ZodString>;
313
+ limits: z.ZodOptional<z.ZodObject<{
314
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
315
+ maxTokens: z.ZodOptional<z.ZodNumber>;
316
+ }, z.core.$strip>>;
317
+ }, z.core.$strict>;
318
+ }, z.core.$strip>, z.ZodObject<{
319
+ v: z.ZodNumber;
320
+ id: z.ZodUUID;
321
+ ts: z.ZodISODateTime;
322
+ type: z.ZodLiteral<"task.offer_for_agent_with_egress">;
323
+ task_id: z.ZodString;
324
+ session_ref: z.ZodOptional<z.ZodString>;
325
+ seq: z.ZodNumber;
326
+ payload: z.ZodObject<{
327
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
328
+ blobRef: z.ZodObject<{
329
+ blobId: z.ZodString;
330
+ contentHash: z.ZodString;
331
+ size: z.ZodNumber;
332
+ contentType: z.ZodString;
333
+ url: z.ZodOptional<z.ZodString>;
334
+ }, z.core.$strip>;
335
+ }, z.core.$strict>]>;
336
+ policy: z.ZodObject<{
337
+ mode: z.ZodEnum<{
338
+ auto: "auto";
339
+ confirm: "confirm";
340
+ plan: "plan";
341
+ readonly: "readonly";
342
+ }>;
343
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
345
+ workspaceRoot: z.ZodOptional<z.ZodString>;
346
+ network: z.ZodOptional<z.ZodBoolean>;
347
+ }, z.core.$strict>;
348
+ agentRef: z.ZodObject<{
349
+ agentId: z.ZodString;
350
+ profileRevision: z.ZodString;
351
+ }, z.core.$strict>;
352
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
353
+ runtime: z.ZodOptional<z.ZodEnum<{
354
+ claude: "claude";
355
+ codex: "codex";
356
+ pi: "pi";
357
+ }>>;
358
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
359
+ lane: z.ZodLiteral<"subscription">;
360
+ runtimeId: z.ZodEnum<{
361
+ claude: "claude";
362
+ codex: "codex";
363
+ }>;
364
+ providerId: z.ZodNull;
365
+ modelId: z.ZodString;
366
+ }, z.core.$strict>, z.ZodObject<{
367
+ lane: z.ZodLiteral<"byok">;
368
+ runtimeId: z.ZodLiteral<"pi">;
369
+ providerId: z.ZodString;
370
+ modelId: z.ZodString;
371
+ }, z.core.$strict>], "lane">>;
372
+ limits: z.ZodOptional<z.ZodObject<{
373
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
374
+ maxTokens: z.ZodOptional<z.ZodNumber>;
375
+ }, z.core.$strip>>;
376
+ sessionRef: z.ZodString;
377
+ egressPolicy: z.ZodObject<{
378
+ policyRevision: z.ZodString;
379
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
380
+ mode: z.ZodLiteral<"metadata-status">;
381
+ delivery: z.ZodLiteral<"latest-value">;
382
+ }, z.core.$strict>, z.ZodObject<{
383
+ mode: z.ZodLiteral<"contentful-trajectory">;
384
+ delivery: z.ZodLiteral<"latest-value">;
385
+ maxCoalesceMs: z.ZodNumber;
386
+ maxEventBytes: z.ZodNumber;
387
+ }, z.core.$strict>], "mode">;
388
+ reliable: z.ZodObject<{
389
+ maxPendingEventsPerAgent: z.ZodNumber;
390
+ maxPendingBytesPerAgent: z.ZodNumber;
391
+ maxPendingBytesPerTenant: z.ZodNumber;
392
+ }, z.core.$strict>;
393
+ transfers: z.ZodObject<{
394
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
395
+ maxBytes: z.ZodNumber;
396
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
397
+ }, z.core.$strict>]>;
398
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
399
+ maxBytes: z.ZodNumber;
400
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
401
+ }, z.core.$strict>]>;
402
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
403
+ maxBytes: z.ZodNumber;
404
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
405
+ }, z.core.$strict>]>;
406
+ }, z.core.$strict>;
407
+ }, z.core.$strict>;
408
+ }, z.core.$strict>;
409
+ }, z.core.$strip>, z.ZodObject<{
410
+ v: z.ZodNumber;
411
+ id: z.ZodUUID;
412
+ ts: z.ZodISODateTime;
413
+ type: z.ZodLiteral<"agent.egress.ack">;
414
+ task_id: z.ZodOptional<z.ZodString>;
415
+ session_ref: z.ZodOptional<z.ZodString>;
416
+ seq: z.ZodNumber;
417
+ payload: z.ZodObject<{
418
+ agentRef: z.ZodObject<{
419
+ agentId: z.ZodString;
420
+ profileRevision: z.ZodString;
421
+ }, z.core.$strict>;
422
+ sessionRef: z.ZodString;
423
+ policyRevision: z.ZodString;
424
+ eventId: z.ZodUUID;
425
+ cursor: z.ZodNumber;
426
+ receiptId: z.ZodUUID;
427
+ }, z.core.$strict>;
428
+ }, z.core.$strip>, z.ZodObject<{
429
+ v: z.ZodNumber;
430
+ id: z.ZodUUID;
431
+ ts: z.ZodISODateTime;
432
+ type: z.ZodLiteral<"agent.content.read">;
433
+ task_id: z.ZodOptional<z.ZodString>;
434
+ session_ref: z.ZodOptional<z.ZodString>;
435
+ seq: z.ZodNumber;
436
+ payload: z.ZodObject<{
437
+ requestId: z.ZodUUID;
438
+ surface: z.ZodEnum<{
439
+ artifact: "artifact";
440
+ transcript: "transcript";
441
+ workspace: "workspace";
442
+ }>;
443
+ actor: z.ZodObject<{
444
+ kind: z.ZodEnum<{
445
+ agent: "agent";
446
+ system: "system";
447
+ user: "user";
448
+ }>;
449
+ id: z.ZodString;
450
+ }, z.core.$strict>;
451
+ agentRef: z.ZodObject<{
452
+ agentId: z.ZodString;
453
+ profileRevision: z.ZodString;
454
+ }, z.core.$strict>;
455
+ sessionRef: z.ZodString;
456
+ runtime: z.ZodEnum<{
457
+ claude: "claude";
458
+ codex: "codex";
459
+ pi: "pi";
460
+ }>;
461
+ cwd: z.ZodString;
462
+ policyRevision: z.ZodString;
463
+ target: z.ZodString;
464
+ mimeType: z.ZodString;
465
+ decodeAs: z.ZodEnum<{
466
+ bytes: "bytes";
467
+ utf8: "utf8";
468
+ }>;
469
+ policy: z.ZodObject<{
470
+ maxBytes: z.ZodNumber;
471
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
472
+ }, z.core.$strict>;
473
+ }, z.core.$strict>;
231
474
  }, z.core.$strip>, z.ZodObject<{
232
475
  v: z.ZodNumber;
233
476
  id: z.ZodUUID;
@@ -284,6 +527,10 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
284
527
  payload: z.ZodObject<{
285
528
  deviceId: z.ZodString;
286
529
  agentId: z.ZodOptional<z.ZodString>;
530
+ agentRef: z.ZodOptional<z.ZodObject<{
531
+ agentId: z.ZodString;
532
+ profileRevision: z.ZodString;
533
+ }, z.core.$strict>>;
287
534
  runtime: z.ZodOptional<z.ZodEnum<{
288
535
  claude: "claude";
289
536
  codex: "codex";
@@ -317,6 +564,10 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
317
564
  payload: z.ZodObject<{
318
565
  reason: z.ZodString;
319
566
  retryable: z.ZodOptional<z.ZodBoolean>;
567
+ agentRef: z.ZodOptional<z.ZodObject<{
568
+ agentId: z.ZodString;
569
+ profileRevision: z.ZodString;
570
+ }, z.core.$strict>>;
320
571
  }, z.core.$strip>;
321
572
  }, z.core.$strip>, z.ZodObject<{
322
573
  v: z.ZodNumber;
@@ -416,6 +667,24 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
416
667
  url: z.ZodOptional<z.ZodString>;
417
668
  }, z.core.$strip>>>;
418
669
  document: z.ZodOptional<z.ZodUnknown>;
670
+ usage: z.ZodOptional<z.ZodObject<{
671
+ runtime: z.ZodEnum<{
672
+ claude: "claude";
673
+ codex: "codex";
674
+ pi: "pi";
675
+ }>;
676
+ provider: z.ZodOptional<z.ZodString>;
677
+ model: z.ZodOptional<z.ZodString>;
678
+ promptTokens: z.ZodOptional<z.ZodNumber>;
679
+ completionTokens: z.ZodOptional<z.ZodNumber>;
680
+ durationMs: z.ZodOptional<z.ZodNumber>;
681
+ clientVersion: z.ZodString;
682
+ reportedAt: z.ZodISODateTime;
683
+ }, z.core.$strip>>;
684
+ agentRef: z.ZodOptional<z.ZodObject<{
685
+ agentId: z.ZodString;
686
+ profileRevision: z.ZodString;
687
+ }, z.core.$strict>>;
419
688
  }, z.core.$strip>;
420
689
  }, z.core.$strip>, z.ZodObject<{
421
690
  v: z.ZodNumber;
@@ -428,6 +697,24 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
428
697
  payload: z.ZodObject<{
429
698
  reason: z.ZodString;
430
699
  retryable: z.ZodOptional<z.ZodBoolean>;
700
+ usage: z.ZodOptional<z.ZodObject<{
701
+ runtime: z.ZodEnum<{
702
+ claude: "claude";
703
+ codex: "codex";
704
+ pi: "pi";
705
+ }>;
706
+ provider: z.ZodOptional<z.ZodString>;
707
+ model: z.ZodOptional<z.ZodString>;
708
+ promptTokens: z.ZodOptional<z.ZodNumber>;
709
+ completionTokens: z.ZodOptional<z.ZodNumber>;
710
+ durationMs: z.ZodOptional<z.ZodNumber>;
711
+ clientVersion: z.ZodString;
712
+ reportedAt: z.ZodISODateTime;
713
+ }, z.core.$strip>>;
714
+ agentRef: z.ZodOptional<z.ZodObject<{
715
+ agentId: z.ZodString;
716
+ profileRevision: z.ZodString;
717
+ }, z.core.$strict>>;
431
718
  }, z.core.$strip>;
432
719
  }, z.core.$strip>, z.ZodObject<{
433
720
  v: z.ZodNumber;
@@ -439,6 +726,24 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
439
726
  seq: z.ZodOptional<z.ZodNumber>;
440
727
  payload: z.ZodObject<{
441
728
  reason: z.ZodOptional<z.ZodString>;
729
+ usage: z.ZodOptional<z.ZodObject<{
730
+ runtime: z.ZodEnum<{
731
+ claude: "claude";
732
+ codex: "codex";
733
+ pi: "pi";
734
+ }>;
735
+ provider: z.ZodOptional<z.ZodString>;
736
+ model: z.ZodOptional<z.ZodString>;
737
+ promptTokens: z.ZodOptional<z.ZodNumber>;
738
+ completionTokens: z.ZodOptional<z.ZodNumber>;
739
+ durationMs: z.ZodOptional<z.ZodNumber>;
740
+ clientVersion: z.ZodString;
741
+ reportedAt: z.ZodISODateTime;
742
+ }, z.core.$strip>>;
743
+ agentRef: z.ZodOptional<z.ZodObject<{
744
+ agentId: z.ZodString;
745
+ profileRevision: z.ZodString;
746
+ }, z.core.$strict>>;
442
747
  }, z.core.$strip>;
443
748
  }, z.core.$strip>, z.ZodObject<{
444
749
  v: z.ZodNumber;
@@ -459,6 +764,139 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
459
764
  }>;
460
765
  at: z.ZodISODateTime;
461
766
  }, z.core.$strip>;
767
+ }, z.core.$strip>, z.ZodObject<{
768
+ v: z.ZodNumber;
769
+ id: z.ZodUUID;
770
+ ts: z.ZodISODateTime;
771
+ type: z.ZodLiteral<"agent.egress.reliable">;
772
+ task_id: z.ZodOptional<z.ZodString>;
773
+ session_ref: z.ZodOptional<z.ZodString>;
774
+ seq: z.ZodOptional<z.ZodNumber>;
775
+ payload: z.ZodObject<{
776
+ agentRef: z.ZodObject<{
777
+ agentId: z.ZodString;
778
+ profileRevision: z.ZodString;
779
+ }, z.core.$strict>;
780
+ sessionRef: z.ZodString;
781
+ policyRevision: z.ZodString;
782
+ eventId: z.ZodUUID;
783
+ cursor: z.ZodNumber;
784
+ payload: z.ZodJSONSchema;
785
+ contentHash: z.ZodString;
786
+ byteCount: z.ZodNumber;
787
+ }, z.core.$strict>;
788
+ }, z.core.$strip>, z.ZodObject<{
789
+ v: z.ZodNumber;
790
+ id: z.ZodUUID;
791
+ ts: z.ZodISODateTime;
792
+ type: z.ZodLiteral<"agent.content.receipt">;
793
+ task_id: z.ZodOptional<z.ZodString>;
794
+ session_ref: z.ZodOptional<z.ZodString>;
795
+ seq: z.ZodOptional<z.ZodNumber>;
796
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
797
+ requestId: z.ZodUUID;
798
+ eventId: z.ZodUUID;
799
+ cursor: z.ZodNumber;
800
+ surface: z.ZodEnum<{
801
+ artifact: "artifact";
802
+ transcript: "transcript";
803
+ workspace: "workspace";
804
+ }>;
805
+ actor: z.ZodObject<{
806
+ kind: z.ZodEnum<{
807
+ agent: "agent";
808
+ system: "system";
809
+ user: "user";
810
+ }>;
811
+ id: z.ZodString;
812
+ }, z.core.$strict>;
813
+ agentRef: z.ZodObject<{
814
+ agentId: z.ZodString;
815
+ profileRevision: z.ZodString;
816
+ }, z.core.$strict>;
817
+ sessionRef: z.ZodString;
818
+ runtime: z.ZodEnum<{
819
+ claude: "claude";
820
+ codex: "codex";
821
+ pi: "pi";
822
+ }>;
823
+ cwd: z.ZodString;
824
+ policyRevision: z.ZodString;
825
+ target: z.ZodString;
826
+ mimeType: z.ZodString;
827
+ decodeAs: z.ZodEnum<{
828
+ bytes: "bytes";
829
+ utf8: "utf8";
830
+ }>;
831
+ decision: z.ZodLiteral<"allowed">;
832
+ byteCount: z.ZodNumber;
833
+ contentHash: z.ZodString;
834
+ blobRef: z.ZodObject<{
835
+ blobId: z.ZodString;
836
+ contentHash: z.ZodString;
837
+ size: z.ZodNumber;
838
+ contentType: z.ZodString;
839
+ url: z.ZodOptional<z.ZodString>;
840
+ }, z.core.$strip>;
841
+ }, z.core.$strict>, z.ZodObject<{
842
+ requestId: z.ZodUUID;
843
+ eventId: z.ZodUUID;
844
+ cursor: z.ZodNumber;
845
+ surface: z.ZodEnum<{
846
+ artifact: "artifact";
847
+ transcript: "transcript";
848
+ workspace: "workspace";
849
+ }>;
850
+ actor: z.ZodObject<{
851
+ kind: z.ZodEnum<{
852
+ agent: "agent";
853
+ system: "system";
854
+ user: "user";
855
+ }>;
856
+ id: z.ZodString;
857
+ }, z.core.$strict>;
858
+ agentRef: z.ZodObject<{
859
+ agentId: z.ZodString;
860
+ profileRevision: z.ZodString;
861
+ }, z.core.$strict>;
862
+ sessionRef: z.ZodString;
863
+ runtime: z.ZodEnum<{
864
+ claude: "claude";
865
+ codex: "codex";
866
+ pi: "pi";
867
+ }>;
868
+ cwd: z.ZodString;
869
+ policyRevision: z.ZodString;
870
+ target: z.ZodString;
871
+ mimeType: z.ZodString;
872
+ decodeAs: z.ZodEnum<{
873
+ bytes: "bytes";
874
+ utf8: "utf8";
875
+ }>;
876
+ decision: z.ZodLiteral<"denied">;
877
+ byteCount: z.ZodLiteral<0>;
878
+ reason: z.ZodEnum<{
879
+ "absolute-target": "absolute-target";
880
+ "byte-limit": "byte-limit";
881
+ "capability-missing": "capability-missing";
882
+ "dot-segment": "dot-segment";
883
+ "identity-mismatch": "identity-mismatch";
884
+ "invalid-request": "invalid-request";
885
+ "mime-not-allowlisted": "mime-not-allowlisted";
886
+ "non-relative-target": "non-relative-target";
887
+ "not-regular-file": "not-regular-file";
888
+ "path-escape": "path-escape";
889
+ "policy-disabled": "policy-disabled";
890
+ "policy-revision-mismatch": "policy-revision-mismatch";
891
+ "root-invalid": "root-invalid";
892
+ "root-not-allowlisted": "root-not-allowlisted";
893
+ "sensitive-name": "sensitive-name";
894
+ symlink: "symlink";
895
+ "target-missing": "target-missing";
896
+ "text-decode-failed": "text-decode-failed";
897
+ "text-not-allowlisted": "text-not-allowlisted";
898
+ }>;
899
+ }, z.core.$strict>], "decision">;
462
900
  }, z.core.$strip>], "type">>;
463
901
  cursor: z.ZodNumber;
464
902
  capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -487,6 +925,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
487
925
  capabilities: z.ZodArray<z.ZodString>;
488
926
  deviceId: z.ZodString;
489
927
  productId: z.ZodString;
928
+ clientVersion: z.ZodOptional<z.ZodString>;
490
929
  runtimes: z.ZodOptional<z.ZodArray<z.ZodObject<{
491
930
  id: z.ZodEnum<{
492
931
  claude: "claude";
@@ -632,6 +1071,222 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
632
1071
  }, z.core.$strip>>;
633
1072
  requiredToolsets: z.ZodArray<z.ZodString>;
634
1073
  }, z.core.$strict>;
1074
+ }, z.core.$strip>, z.ZodObject<{
1075
+ v: z.ZodNumber;
1076
+ id: z.ZodUUID;
1077
+ ts: z.ZodISODateTime;
1078
+ type: z.ZodLiteral<"task.offer_for_agent">;
1079
+ task_id: z.ZodString;
1080
+ session_ref: z.ZodOptional<z.ZodString>;
1081
+ seq: z.ZodNumber;
1082
+ payload: z.ZodObject<{
1083
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1084
+ blobRef: z.ZodObject<{
1085
+ blobId: z.ZodString;
1086
+ contentHash: z.ZodString;
1087
+ size: z.ZodNumber;
1088
+ contentType: z.ZodString;
1089
+ url: z.ZodOptional<z.ZodString>;
1090
+ }, z.core.$strip>;
1091
+ }, z.core.$strict>]>;
1092
+ policy: z.ZodObject<{
1093
+ mode: z.ZodEnum<{
1094
+ auto: "auto";
1095
+ confirm: "confirm";
1096
+ plan: "plan";
1097
+ readonly: "readonly";
1098
+ }>;
1099
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1100
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1101
+ workspaceRoot: z.ZodOptional<z.ZodString>;
1102
+ network: z.ZodOptional<z.ZodBoolean>;
1103
+ }, z.core.$strict>;
1104
+ agentRef: z.ZodObject<{
1105
+ agentId: z.ZodString;
1106
+ profileRevision: z.ZodString;
1107
+ }, z.core.$strict>;
1108
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1109
+ runtime: z.ZodOptional<z.ZodEnum<{
1110
+ claude: "claude";
1111
+ codex: "codex";
1112
+ pi: "pi";
1113
+ }>>;
1114
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1115
+ lane: z.ZodLiteral<"subscription">;
1116
+ runtimeId: z.ZodEnum<{
1117
+ claude: "claude";
1118
+ codex: "codex";
1119
+ }>;
1120
+ providerId: z.ZodNull;
1121
+ modelId: z.ZodString;
1122
+ }, z.core.$strict>, z.ZodObject<{
1123
+ lane: z.ZodLiteral<"byok">;
1124
+ runtimeId: z.ZodLiteral<"pi">;
1125
+ providerId: z.ZodString;
1126
+ modelId: z.ZodString;
1127
+ }, z.core.$strict>], "lane">>;
1128
+ sessionRef: z.ZodOptional<z.ZodString>;
1129
+ limits: z.ZodOptional<z.ZodObject<{
1130
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
1131
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1132
+ }, z.core.$strip>>;
1133
+ }, z.core.$strict>;
1134
+ }, z.core.$strip>, z.ZodObject<{
1135
+ v: z.ZodNumber;
1136
+ id: z.ZodUUID;
1137
+ ts: z.ZodISODateTime;
1138
+ type: z.ZodLiteral<"task.offer_for_agent_with_egress">;
1139
+ task_id: z.ZodString;
1140
+ session_ref: z.ZodOptional<z.ZodString>;
1141
+ seq: z.ZodNumber;
1142
+ payload: z.ZodObject<{
1143
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1144
+ blobRef: z.ZodObject<{
1145
+ blobId: z.ZodString;
1146
+ contentHash: z.ZodString;
1147
+ size: z.ZodNumber;
1148
+ contentType: z.ZodString;
1149
+ url: z.ZodOptional<z.ZodString>;
1150
+ }, z.core.$strip>;
1151
+ }, z.core.$strict>]>;
1152
+ policy: z.ZodObject<{
1153
+ mode: z.ZodEnum<{
1154
+ auto: "auto";
1155
+ confirm: "confirm";
1156
+ plan: "plan";
1157
+ readonly: "readonly";
1158
+ }>;
1159
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1160
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1161
+ workspaceRoot: z.ZodOptional<z.ZodString>;
1162
+ network: z.ZodOptional<z.ZodBoolean>;
1163
+ }, z.core.$strict>;
1164
+ agentRef: z.ZodObject<{
1165
+ agentId: z.ZodString;
1166
+ profileRevision: z.ZodString;
1167
+ }, z.core.$strict>;
1168
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1169
+ runtime: z.ZodOptional<z.ZodEnum<{
1170
+ claude: "claude";
1171
+ codex: "codex";
1172
+ pi: "pi";
1173
+ }>>;
1174
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1175
+ lane: z.ZodLiteral<"subscription">;
1176
+ runtimeId: z.ZodEnum<{
1177
+ claude: "claude";
1178
+ codex: "codex";
1179
+ }>;
1180
+ providerId: z.ZodNull;
1181
+ modelId: z.ZodString;
1182
+ }, z.core.$strict>, z.ZodObject<{
1183
+ lane: z.ZodLiteral<"byok">;
1184
+ runtimeId: z.ZodLiteral<"pi">;
1185
+ providerId: z.ZodString;
1186
+ modelId: z.ZodString;
1187
+ }, z.core.$strict>], "lane">>;
1188
+ limits: z.ZodOptional<z.ZodObject<{
1189
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
1190
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1191
+ }, z.core.$strip>>;
1192
+ sessionRef: z.ZodString;
1193
+ egressPolicy: z.ZodObject<{
1194
+ policyRevision: z.ZodString;
1195
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
1196
+ mode: z.ZodLiteral<"metadata-status">;
1197
+ delivery: z.ZodLiteral<"latest-value">;
1198
+ }, z.core.$strict>, z.ZodObject<{
1199
+ mode: z.ZodLiteral<"contentful-trajectory">;
1200
+ delivery: z.ZodLiteral<"latest-value">;
1201
+ maxCoalesceMs: z.ZodNumber;
1202
+ maxEventBytes: z.ZodNumber;
1203
+ }, z.core.$strict>], "mode">;
1204
+ reliable: z.ZodObject<{
1205
+ maxPendingEventsPerAgent: z.ZodNumber;
1206
+ maxPendingBytesPerAgent: z.ZodNumber;
1207
+ maxPendingBytesPerTenant: z.ZodNumber;
1208
+ }, z.core.$strict>;
1209
+ transfers: z.ZodObject<{
1210
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1211
+ maxBytes: z.ZodNumber;
1212
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1213
+ }, z.core.$strict>]>;
1214
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1215
+ maxBytes: z.ZodNumber;
1216
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1217
+ }, z.core.$strict>]>;
1218
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1219
+ maxBytes: z.ZodNumber;
1220
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1221
+ }, z.core.$strict>]>;
1222
+ }, z.core.$strict>;
1223
+ }, z.core.$strict>;
1224
+ }, z.core.$strict>;
1225
+ }, z.core.$strip>, z.ZodObject<{
1226
+ v: z.ZodNumber;
1227
+ id: z.ZodUUID;
1228
+ ts: z.ZodISODateTime;
1229
+ type: z.ZodLiteral<"agent.egress.ack">;
1230
+ task_id: z.ZodOptional<z.ZodString>;
1231
+ session_ref: z.ZodOptional<z.ZodString>;
1232
+ seq: z.ZodNumber;
1233
+ payload: z.ZodObject<{
1234
+ agentRef: z.ZodObject<{
1235
+ agentId: z.ZodString;
1236
+ profileRevision: z.ZodString;
1237
+ }, z.core.$strict>;
1238
+ sessionRef: z.ZodString;
1239
+ policyRevision: z.ZodString;
1240
+ eventId: z.ZodUUID;
1241
+ cursor: z.ZodNumber;
1242
+ receiptId: z.ZodUUID;
1243
+ }, z.core.$strict>;
1244
+ }, z.core.$strip>, z.ZodObject<{
1245
+ v: z.ZodNumber;
1246
+ id: z.ZodUUID;
1247
+ ts: z.ZodISODateTime;
1248
+ type: z.ZodLiteral<"agent.content.read">;
1249
+ task_id: z.ZodOptional<z.ZodString>;
1250
+ session_ref: z.ZodOptional<z.ZodString>;
1251
+ seq: z.ZodNumber;
1252
+ payload: z.ZodObject<{
1253
+ requestId: z.ZodUUID;
1254
+ surface: z.ZodEnum<{
1255
+ artifact: "artifact";
1256
+ transcript: "transcript";
1257
+ workspace: "workspace";
1258
+ }>;
1259
+ actor: z.ZodObject<{
1260
+ kind: z.ZodEnum<{
1261
+ agent: "agent";
1262
+ system: "system";
1263
+ user: "user";
1264
+ }>;
1265
+ id: z.ZodString;
1266
+ }, z.core.$strict>;
1267
+ agentRef: z.ZodObject<{
1268
+ agentId: z.ZodString;
1269
+ profileRevision: z.ZodString;
1270
+ }, z.core.$strict>;
1271
+ sessionRef: z.ZodString;
1272
+ runtime: z.ZodEnum<{
1273
+ claude: "claude";
1274
+ codex: "codex";
1275
+ pi: "pi";
1276
+ }>;
1277
+ cwd: z.ZodString;
1278
+ policyRevision: z.ZodString;
1279
+ target: z.ZodString;
1280
+ mimeType: z.ZodString;
1281
+ decodeAs: z.ZodEnum<{
1282
+ bytes: "bytes";
1283
+ utf8: "utf8";
1284
+ }>;
1285
+ policy: z.ZodObject<{
1286
+ maxBytes: z.ZodNumber;
1287
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1288
+ }, z.core.$strict>;
1289
+ }, z.core.$strict>;
635
1290
  }, z.core.$strip>, z.ZodObject<{
636
1291
  v: z.ZodNumber;
637
1292
  id: z.ZodUUID;
@@ -688,6 +1343,10 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
688
1343
  payload: z.ZodObject<{
689
1344
  deviceId: z.ZodString;
690
1345
  agentId: z.ZodOptional<z.ZodString>;
1346
+ agentRef: z.ZodOptional<z.ZodObject<{
1347
+ agentId: z.ZodString;
1348
+ profileRevision: z.ZodString;
1349
+ }, z.core.$strict>>;
691
1350
  runtime: z.ZodOptional<z.ZodEnum<{
692
1351
  claude: "claude";
693
1352
  codex: "codex";
@@ -721,6 +1380,10 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
721
1380
  payload: z.ZodObject<{
722
1381
  reason: z.ZodString;
723
1382
  retryable: z.ZodOptional<z.ZodBoolean>;
1383
+ agentRef: z.ZodOptional<z.ZodObject<{
1384
+ agentId: z.ZodString;
1385
+ profileRevision: z.ZodString;
1386
+ }, z.core.$strict>>;
724
1387
  }, z.core.$strip>;
725
1388
  }, z.core.$strip>, z.ZodObject<{
726
1389
  v: z.ZodNumber;
@@ -820,6 +1483,24 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
820
1483
  url: z.ZodOptional<z.ZodString>;
821
1484
  }, z.core.$strip>>>;
822
1485
  document: z.ZodOptional<z.ZodUnknown>;
1486
+ usage: z.ZodOptional<z.ZodObject<{
1487
+ runtime: z.ZodEnum<{
1488
+ claude: "claude";
1489
+ codex: "codex";
1490
+ pi: "pi";
1491
+ }>;
1492
+ provider: z.ZodOptional<z.ZodString>;
1493
+ model: z.ZodOptional<z.ZodString>;
1494
+ promptTokens: z.ZodOptional<z.ZodNumber>;
1495
+ completionTokens: z.ZodOptional<z.ZodNumber>;
1496
+ durationMs: z.ZodOptional<z.ZodNumber>;
1497
+ clientVersion: z.ZodString;
1498
+ reportedAt: z.ZodISODateTime;
1499
+ }, z.core.$strip>>;
1500
+ agentRef: z.ZodOptional<z.ZodObject<{
1501
+ agentId: z.ZodString;
1502
+ profileRevision: z.ZodString;
1503
+ }, z.core.$strict>>;
823
1504
  }, z.core.$strip>;
824
1505
  }, z.core.$strip>, z.ZodObject<{
825
1506
  v: z.ZodNumber;
@@ -832,6 +1513,24 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
832
1513
  payload: z.ZodObject<{
833
1514
  reason: z.ZodString;
834
1515
  retryable: z.ZodOptional<z.ZodBoolean>;
1516
+ usage: z.ZodOptional<z.ZodObject<{
1517
+ runtime: z.ZodEnum<{
1518
+ claude: "claude";
1519
+ codex: "codex";
1520
+ pi: "pi";
1521
+ }>;
1522
+ provider: z.ZodOptional<z.ZodString>;
1523
+ model: z.ZodOptional<z.ZodString>;
1524
+ promptTokens: z.ZodOptional<z.ZodNumber>;
1525
+ completionTokens: z.ZodOptional<z.ZodNumber>;
1526
+ durationMs: z.ZodOptional<z.ZodNumber>;
1527
+ clientVersion: z.ZodString;
1528
+ reportedAt: z.ZodISODateTime;
1529
+ }, z.core.$strip>>;
1530
+ agentRef: z.ZodOptional<z.ZodObject<{
1531
+ agentId: z.ZodString;
1532
+ profileRevision: z.ZodString;
1533
+ }, z.core.$strict>>;
835
1534
  }, z.core.$strip>;
836
1535
  }, z.core.$strip>, z.ZodObject<{
837
1536
  v: z.ZodNumber;
@@ -843,6 +1542,24 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
843
1542
  seq: z.ZodOptional<z.ZodNumber>;
844
1543
  payload: z.ZodObject<{
845
1544
  reason: z.ZodOptional<z.ZodString>;
1545
+ usage: z.ZodOptional<z.ZodObject<{
1546
+ runtime: z.ZodEnum<{
1547
+ claude: "claude";
1548
+ codex: "codex";
1549
+ pi: "pi";
1550
+ }>;
1551
+ provider: z.ZodOptional<z.ZodString>;
1552
+ model: z.ZodOptional<z.ZodString>;
1553
+ promptTokens: z.ZodOptional<z.ZodNumber>;
1554
+ completionTokens: z.ZodOptional<z.ZodNumber>;
1555
+ durationMs: z.ZodOptional<z.ZodNumber>;
1556
+ clientVersion: z.ZodString;
1557
+ reportedAt: z.ZodISODateTime;
1558
+ }, z.core.$strip>>;
1559
+ agentRef: z.ZodOptional<z.ZodObject<{
1560
+ agentId: z.ZodString;
1561
+ profileRevision: z.ZodString;
1562
+ }, z.core.$strict>>;
846
1563
  }, z.core.$strip>;
847
1564
  }, z.core.$strip>, z.ZodObject<{
848
1565
  v: z.ZodNumber;
@@ -863,6 +1580,139 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
863
1580
  }>;
864
1581
  at: z.ZodISODateTime;
865
1582
  }, z.core.$strip>;
1583
+ }, z.core.$strip>, z.ZodObject<{
1584
+ v: z.ZodNumber;
1585
+ id: z.ZodUUID;
1586
+ ts: z.ZodISODateTime;
1587
+ type: z.ZodLiteral<"agent.egress.reliable">;
1588
+ task_id: z.ZodOptional<z.ZodString>;
1589
+ session_ref: z.ZodOptional<z.ZodString>;
1590
+ seq: z.ZodOptional<z.ZodNumber>;
1591
+ payload: z.ZodObject<{
1592
+ agentRef: z.ZodObject<{
1593
+ agentId: z.ZodString;
1594
+ profileRevision: z.ZodString;
1595
+ }, z.core.$strict>;
1596
+ sessionRef: z.ZodString;
1597
+ policyRevision: z.ZodString;
1598
+ eventId: z.ZodUUID;
1599
+ cursor: z.ZodNumber;
1600
+ payload: z.ZodJSONSchema;
1601
+ contentHash: z.ZodString;
1602
+ byteCount: z.ZodNumber;
1603
+ }, z.core.$strict>;
1604
+ }, z.core.$strip>, z.ZodObject<{
1605
+ v: z.ZodNumber;
1606
+ id: z.ZodUUID;
1607
+ ts: z.ZodISODateTime;
1608
+ type: z.ZodLiteral<"agent.content.receipt">;
1609
+ task_id: z.ZodOptional<z.ZodString>;
1610
+ session_ref: z.ZodOptional<z.ZodString>;
1611
+ seq: z.ZodOptional<z.ZodNumber>;
1612
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
1613
+ requestId: z.ZodUUID;
1614
+ eventId: z.ZodUUID;
1615
+ cursor: z.ZodNumber;
1616
+ surface: z.ZodEnum<{
1617
+ artifact: "artifact";
1618
+ transcript: "transcript";
1619
+ workspace: "workspace";
1620
+ }>;
1621
+ actor: z.ZodObject<{
1622
+ kind: z.ZodEnum<{
1623
+ agent: "agent";
1624
+ system: "system";
1625
+ user: "user";
1626
+ }>;
1627
+ id: z.ZodString;
1628
+ }, z.core.$strict>;
1629
+ agentRef: z.ZodObject<{
1630
+ agentId: z.ZodString;
1631
+ profileRevision: z.ZodString;
1632
+ }, z.core.$strict>;
1633
+ sessionRef: z.ZodString;
1634
+ runtime: z.ZodEnum<{
1635
+ claude: "claude";
1636
+ codex: "codex";
1637
+ pi: "pi";
1638
+ }>;
1639
+ cwd: z.ZodString;
1640
+ policyRevision: z.ZodString;
1641
+ target: z.ZodString;
1642
+ mimeType: z.ZodString;
1643
+ decodeAs: z.ZodEnum<{
1644
+ bytes: "bytes";
1645
+ utf8: "utf8";
1646
+ }>;
1647
+ decision: z.ZodLiteral<"allowed">;
1648
+ byteCount: z.ZodNumber;
1649
+ contentHash: z.ZodString;
1650
+ blobRef: z.ZodObject<{
1651
+ blobId: z.ZodString;
1652
+ contentHash: z.ZodString;
1653
+ size: z.ZodNumber;
1654
+ contentType: z.ZodString;
1655
+ url: z.ZodOptional<z.ZodString>;
1656
+ }, z.core.$strip>;
1657
+ }, z.core.$strict>, z.ZodObject<{
1658
+ requestId: z.ZodUUID;
1659
+ eventId: z.ZodUUID;
1660
+ cursor: z.ZodNumber;
1661
+ surface: z.ZodEnum<{
1662
+ artifact: "artifact";
1663
+ transcript: "transcript";
1664
+ workspace: "workspace";
1665
+ }>;
1666
+ actor: z.ZodObject<{
1667
+ kind: z.ZodEnum<{
1668
+ agent: "agent";
1669
+ system: "system";
1670
+ user: "user";
1671
+ }>;
1672
+ id: z.ZodString;
1673
+ }, z.core.$strict>;
1674
+ agentRef: z.ZodObject<{
1675
+ agentId: z.ZodString;
1676
+ profileRevision: z.ZodString;
1677
+ }, z.core.$strict>;
1678
+ sessionRef: z.ZodString;
1679
+ runtime: z.ZodEnum<{
1680
+ claude: "claude";
1681
+ codex: "codex";
1682
+ pi: "pi";
1683
+ }>;
1684
+ cwd: z.ZodString;
1685
+ policyRevision: z.ZodString;
1686
+ target: z.ZodString;
1687
+ mimeType: z.ZodString;
1688
+ decodeAs: z.ZodEnum<{
1689
+ bytes: "bytes";
1690
+ utf8: "utf8";
1691
+ }>;
1692
+ decision: z.ZodLiteral<"denied">;
1693
+ byteCount: z.ZodLiteral<0>;
1694
+ reason: z.ZodEnum<{
1695
+ "absolute-target": "absolute-target";
1696
+ "byte-limit": "byte-limit";
1697
+ "capability-missing": "capability-missing";
1698
+ "dot-segment": "dot-segment";
1699
+ "identity-mismatch": "identity-mismatch";
1700
+ "invalid-request": "invalid-request";
1701
+ "mime-not-allowlisted": "mime-not-allowlisted";
1702
+ "non-relative-target": "non-relative-target";
1703
+ "not-regular-file": "not-regular-file";
1704
+ "path-escape": "path-escape";
1705
+ "policy-disabled": "policy-disabled";
1706
+ "policy-revision-mismatch": "policy-revision-mismatch";
1707
+ "root-invalid": "root-invalid";
1708
+ "root-not-allowlisted": "root-not-allowlisted";
1709
+ "sensitive-name": "sensitive-name";
1710
+ symlink: "symlink";
1711
+ "target-missing": "target-missing";
1712
+ "text-decode-failed": "text-decode-failed";
1713
+ "text-not-allowlisted": "text-not-allowlisted";
1714
+ }>;
1715
+ }, z.core.$strict>], "decision">;
866
1716
  }, z.core.$strip>], "type">>;
867
1717
  }, z.core.$strip>;
868
1718
  export type MessagesSendRequest = z.infer<typeof MessagesSendRequestSchema>;