@byok-sdk/protocol 0.13.0 → 0.15.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,62 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * Maximum UTF-16 length of {@link AgentEventSpillSchema}'s `unstoredReason`.
4
+ * The reason is a bounded diagnostic string, not a place to inline the
5
+ * content that failed to store: the whole point of a spill descriptor is
6
+ * that the event stays under the daemon's inline-event cap even when the
7
+ * blob upload failed.
8
+ */
9
+ export declare const AGENT_EVENT_SPILL_UNSTORED_REASON_MAX_LENGTH = 512;
10
+ /**
11
+ * Additive descriptor attached to a `tool_use` / `tool_result` event whose
12
+ * `input` / `output` was too large to travel inline and was therefore
13
+ * REPLACED, at the daemon's ingestion boundary, by a bounded head/tail
14
+ * preview (`{ preview: { head, tail } }`). See
15
+ * `packages/client/src/daemon/event-spill.ts` for the producer and
16
+ * `DaemonConfig.maxInlineEventBytes` for the cap.
17
+ *
18
+ * Presence of this field is the ONLY signal that the inline field is a
19
+ * projection rather than the whole value — a consumer that reads
20
+ * `tool_result.output` (or `tool_use.input`) without checking `spill` is
21
+ * reading a preview and calling it the result.
22
+ *
23
+ * Exactly one of `blob` / `unstoredReason` is present, and the union is
24
+ * closed on purpose:
25
+ *
26
+ * - `blob` — the full `JSON.stringify(<field>)` bytes are readable from the
27
+ * blob plane (protocol §7) under that `BlobRef`; `contentHash` is the
28
+ * sha256 of exactly those bytes, so a consumer can verify what it read
29
+ * back is what was omitted.
30
+ * - `unstoredReason` — the omitted bytes are not readable from this event:
31
+ * either the upload failed, or it succeeded but the returned locator did
32
+ * not fit the daemon's inline cap. Either way the content is not reachable
33
+ * through this event; the reason says which. This exists so an unreadable
34
+ * omission is observable rather than silently indistinguishable from a
35
+ * small output.
36
+ *
37
+ * `.strict()` because this is an SDK-authored descriptor with a closed
38
+ * shape, not free-form runtime data: an unrecognized key here means a
39
+ * producer and a consumer disagree about what the omission means, which is
40
+ * exactly the case that must fail loudly.
41
+ */
42
+ export declare const AgentEventSpillSchema: z.ZodObject<{
43
+ field: z.ZodEnum<{
44
+ input: "input";
45
+ output: "output";
46
+ }>;
47
+ totalBytes: z.ZodNumber;
48
+ omittedBytes: z.ZodNumber;
49
+ contentType: z.ZodLiteral<"application/json">;
50
+ blob: z.ZodOptional<z.ZodObject<{
51
+ blobId: z.ZodString;
52
+ contentHash: z.ZodString;
53
+ size: z.ZodNumber;
54
+ contentType: z.ZodString;
55
+ url: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>>;
57
+ unstoredReason: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strict>;
59
+ export type AgentEventSpill = z.infer<typeof AgentEventSpillSchema>;
2
60
  /**
3
61
  * Normalized event shape that every runtime adapter (pi / claude / codex)
4
62
  * translates its native JSONL output into. This is the interior of a
@@ -12,12 +70,46 @@ export declare const AgentEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
70
  tool: z.ZodString;
13
71
  input: z.ZodOptional<z.ZodUnknown>;
14
72
  toolCallId: z.ZodOptional<z.ZodString>;
73
+ spill: z.ZodOptional<z.ZodObject<{
74
+ field: z.ZodEnum<{
75
+ input: "input";
76
+ output: "output";
77
+ }>;
78
+ totalBytes: z.ZodNumber;
79
+ omittedBytes: z.ZodNumber;
80
+ contentType: z.ZodLiteral<"application/json">;
81
+ blob: z.ZodOptional<z.ZodObject<{
82
+ blobId: z.ZodString;
83
+ contentHash: z.ZodString;
84
+ size: z.ZodNumber;
85
+ contentType: z.ZodString;
86
+ url: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>>;
88
+ unstoredReason: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strict>>;
15
90
  }, z.core.$strip>, z.ZodObject<{
16
91
  type: z.ZodLiteral<"tool_result">;
17
92
  tool: z.ZodString;
18
93
  output: z.ZodOptional<z.ZodUnknown>;
19
94
  toolCallId: z.ZodOptional<z.ZodString>;
20
95
  isError: z.ZodOptional<z.ZodBoolean>;
96
+ spill: z.ZodOptional<z.ZodObject<{
97
+ field: z.ZodEnum<{
98
+ input: "input";
99
+ output: "output";
100
+ }>;
101
+ totalBytes: z.ZodNumber;
102
+ omittedBytes: z.ZodNumber;
103
+ contentType: z.ZodLiteral<"application/json">;
104
+ blob: z.ZodOptional<z.ZodObject<{
105
+ blobId: z.ZodString;
106
+ contentHash: z.ZodString;
107
+ size: z.ZodNumber;
108
+ contentType: z.ZodString;
109
+ url: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$strip>>;
111
+ unstoredReason: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strict>>;
21
113
  }, z.core.$strip>, z.ZodObject<{
22
114
  type: z.ZodLiteral<"artifact">;
23
115
  name: z.ZodString;
@@ -106,12 +198,46 @@ export declare const AgentEventOrUnknownSchema: z.ZodUnion<readonly [z.ZodDiscri
106
198
  tool: z.ZodString;
107
199
  input: z.ZodOptional<z.ZodUnknown>;
108
200
  toolCallId: z.ZodOptional<z.ZodString>;
201
+ spill: z.ZodOptional<z.ZodObject<{
202
+ field: z.ZodEnum<{
203
+ input: "input";
204
+ output: "output";
205
+ }>;
206
+ totalBytes: z.ZodNumber;
207
+ omittedBytes: z.ZodNumber;
208
+ contentType: z.ZodLiteral<"application/json">;
209
+ blob: z.ZodOptional<z.ZodObject<{
210
+ blobId: z.ZodString;
211
+ contentHash: z.ZodString;
212
+ size: z.ZodNumber;
213
+ contentType: z.ZodString;
214
+ url: z.ZodOptional<z.ZodString>;
215
+ }, z.core.$strip>>;
216
+ unstoredReason: z.ZodOptional<z.ZodString>;
217
+ }, z.core.$strict>>;
109
218
  }, z.core.$strip>, z.ZodObject<{
110
219
  type: z.ZodLiteral<"tool_result">;
111
220
  tool: z.ZodString;
112
221
  output: z.ZodOptional<z.ZodUnknown>;
113
222
  toolCallId: z.ZodOptional<z.ZodString>;
114
223
  isError: z.ZodOptional<z.ZodBoolean>;
224
+ spill: z.ZodOptional<z.ZodObject<{
225
+ field: z.ZodEnum<{
226
+ input: "input";
227
+ output: "output";
228
+ }>;
229
+ totalBytes: z.ZodNumber;
230
+ omittedBytes: z.ZodNumber;
231
+ contentType: z.ZodLiteral<"application/json">;
232
+ blob: z.ZodOptional<z.ZodObject<{
233
+ blobId: z.ZodString;
234
+ contentHash: z.ZodString;
235
+ size: z.ZodNumber;
236
+ contentType: z.ZodString;
237
+ url: z.ZodOptional<z.ZodString>;
238
+ }, z.core.$strip>>;
239
+ unstoredReason: z.ZodOptional<z.ZodString>;
240
+ }, z.core.$strict>>;
115
241
  }, z.core.$strip>, z.ZodObject<{
116
242
  type: z.ZodLiteral<"artifact">;
117
243
  name: z.ZodString;
@@ -46,6 +46,17 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
46
  permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
47
  }, z.core.$strip>>;
48
48
  }, z.core.$strip>>>;
49
+ harnesses: z.ZodOptional<z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ version: z.ZodOptional<z.ZodString>;
52
+ capabilities: z.ZodObject<{
53
+ steer: z.ZodOptional<z.ZodBoolean>;
54
+ resume: z.ZodOptional<z.ZodBoolean>;
55
+ approvalInteractive: z.ZodOptional<z.ZodBoolean>;
56
+ mcpToolsets: z.ZodOptional<z.ZodBoolean>;
57
+ permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ }, z.core.$strip>;
59
+ }, z.core.$strip>>>;
49
60
  configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
61
  cursor: z.ZodOptional<z.ZodNumber>;
51
62
  }, z.core.$strip>;
@@ -97,6 +108,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
97
108
  codex: "codex";
98
109
  pi: "pi";
99
110
  }>>;
111
+ harnessId: z.ZodOptional<z.ZodString>;
100
112
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
101
113
  lane: z.ZodLiteral<"subscription">;
102
114
  runtimeId: z.ZodEnum<{
@@ -165,6 +177,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
165
177
  codex: "codex";
166
178
  pi: "pi";
167
179
  }>>;
180
+ harnessId: z.ZodOptional<z.ZodString>;
168
181
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
169
182
  lane: z.ZodLiteral<"subscription">;
170
183
  runtimeId: z.ZodEnum<{
@@ -239,6 +252,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
239
252
  codex: "codex";
240
253
  pi: "pi";
241
254
  }>>;
255
+ harnessId: z.ZodOptional<z.ZodString>;
242
256
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
243
257
  lane: z.ZodLiteral<"subscription">;
244
258
  runtimeId: z.ZodEnum<{
@@ -317,6 +331,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
317
331
  codex: "codex";
318
332
  pi: "pi";
319
333
  }>>;
334
+ harnessId: z.ZodOptional<z.ZodString>;
320
335
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
321
336
  lane: z.ZodLiteral<"subscription">;
322
337
  runtimeId: z.ZodEnum<{
@@ -435,6 +450,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
435
450
  codex: "codex";
436
451
  pi: "pi";
437
452
  }>>;
453
+ harnessId: z.ZodOptional<z.ZodString>;
438
454
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
439
455
  lane: z.ZodLiteral<"subscription">;
440
456
  runtimeId: z.ZodEnum<{
@@ -685,6 +701,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
685
701
  codex: "codex";
686
702
  pi: "pi";
687
703
  }>>;
704
+ harnessId: z.ZodOptional<z.ZodString>;
688
705
  capabilities: z.ZodOptional<z.ZodObject<{
689
706
  steer: z.ZodOptional<z.ZodBoolean>;
690
707
  resume: z.ZodOptional<z.ZodBoolean>;
@@ -736,12 +753,46 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
736
753
  tool: z.ZodString;
737
754
  input: z.ZodOptional<z.ZodUnknown>;
738
755
  toolCallId: z.ZodOptional<z.ZodString>;
756
+ spill: z.ZodOptional<z.ZodObject<{
757
+ field: z.ZodEnum<{
758
+ input: "input";
759
+ output: "output";
760
+ }>;
761
+ totalBytes: z.ZodNumber;
762
+ omittedBytes: z.ZodNumber;
763
+ contentType: z.ZodLiteral<"application/json">;
764
+ blob: z.ZodOptional<z.ZodObject<{
765
+ blobId: z.ZodString;
766
+ contentHash: z.ZodString;
767
+ size: z.ZodNumber;
768
+ contentType: z.ZodString;
769
+ url: z.ZodOptional<z.ZodString>;
770
+ }, z.core.$strip>>;
771
+ unstoredReason: z.ZodOptional<z.ZodString>;
772
+ }, z.core.$strict>>;
739
773
  }, z.core.$strip>, z.ZodObject<{
740
774
  type: z.ZodLiteral<"tool_result">;
741
775
  tool: z.ZodString;
742
776
  output: z.ZodOptional<z.ZodUnknown>;
743
777
  toolCallId: z.ZodOptional<z.ZodString>;
744
778
  isError: z.ZodOptional<z.ZodBoolean>;
779
+ spill: z.ZodOptional<z.ZodObject<{
780
+ field: z.ZodEnum<{
781
+ input: "input";
782
+ output: "output";
783
+ }>;
784
+ totalBytes: z.ZodNumber;
785
+ omittedBytes: z.ZodNumber;
786
+ contentType: z.ZodLiteral<"application/json">;
787
+ blob: z.ZodOptional<z.ZodObject<{
788
+ blobId: z.ZodString;
789
+ contentHash: z.ZodString;
790
+ size: z.ZodNumber;
791
+ contentType: z.ZodString;
792
+ url: z.ZodOptional<z.ZodString>;
793
+ }, z.core.$strip>>;
794
+ unstoredReason: z.ZodOptional<z.ZodString>;
795
+ }, z.core.$strict>>;
745
796
  }, z.core.$strip>, z.ZodObject<{
746
797
  type: z.ZodLiteral<"artifact">;
747
798
  name: z.ZodString;
@@ -806,6 +857,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
806
857
  session_ref: z.ZodOptional<z.ZodString>;
807
858
  seq: z.ZodOptional<z.ZodNumber>;
808
859
  payload: z.ZodObject<{
860
+ harnessId: z.ZodOptional<z.ZodString>;
809
861
  summary: z.ZodString;
810
862
  sessionRef: z.ZodString;
811
863
  artifactRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -844,6 +896,11 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
844
896
  session_ref: z.ZodOptional<z.ZodString>;
845
897
  seq: z.ZodOptional<z.ZodNumber>;
846
898
  payload: z.ZodObject<{
899
+ recovery: z.ZodOptional<z.ZodObject<{
900
+ kind: z.ZodLiteral<"daemon_interrupted">;
901
+ offerId: z.ZodUUID;
902
+ }, z.core.$strict>>;
903
+ harnessId: z.ZodOptional<z.ZodString>;
847
904
  reason: z.ZodString;
848
905
  retryable: z.ZodOptional<z.ZodBoolean>;
849
906
  usage: z.ZodOptional<z.ZodObject<{
@@ -874,6 +931,7 @@ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
874
931
  session_ref: z.ZodOptional<z.ZodString>;
875
932
  seq: z.ZodOptional<z.ZodNumber>;
876
933
  payload: z.ZodObject<{
934
+ harnessId: z.ZodOptional<z.ZodString>;
877
935
  reason: z.ZodOptional<z.ZodString>;
878
936
  usage: z.ZodOptional<z.ZodObject<{
879
937
  runtime: z.ZodEnum<{
@@ -105,6 +105,7 @@ export declare const BlobDownloadUrlResponseSchema: z.ZodObject<{
105
105
  }, z.core.$strip>;
106
106
  export type BlobDownloadUrlResponse = z.infer<typeof BlobDownloadUrlResponseSchema>;
107
107
  export declare const EventsPollQuerySchema: z.ZodObject<{
108
+ afterSeq: z.ZodOptional<z.ZodNumber>;
108
109
  cursor: z.ZodOptional<z.ZodNumber>;
109
110
  }, z.core.$strip>;
110
111
  export type EventsPollQuery = z.infer<typeof EventsPollQuerySchema>;
@@ -139,6 +140,17 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
139
140
  permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
141
  }, z.core.$strip>>;
141
142
  }, z.core.$strip>>>;
143
+ harnesses: z.ZodOptional<z.ZodArray<z.ZodObject<{
144
+ id: z.ZodString;
145
+ version: z.ZodOptional<z.ZodString>;
146
+ capabilities: z.ZodObject<{
147
+ steer: z.ZodOptional<z.ZodBoolean>;
148
+ resume: z.ZodOptional<z.ZodBoolean>;
149
+ approvalInteractive: z.ZodOptional<z.ZodBoolean>;
150
+ mcpToolsets: z.ZodOptional<z.ZodBoolean>;
151
+ permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
152
+ }, z.core.$strip>;
153
+ }, z.core.$strip>>>;
142
154
  configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
143
155
  cursor: z.ZodOptional<z.ZodNumber>;
144
156
  }, z.core.$strip>;
@@ -190,6 +202,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
190
202
  codex: "codex";
191
203
  pi: "pi";
192
204
  }>>;
205
+ harnessId: z.ZodOptional<z.ZodString>;
193
206
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
194
207
  lane: z.ZodLiteral<"subscription">;
195
208
  runtimeId: z.ZodEnum<{
@@ -258,6 +271,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
258
271
  codex: "codex";
259
272
  pi: "pi";
260
273
  }>>;
274
+ harnessId: z.ZodOptional<z.ZodString>;
261
275
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
262
276
  lane: z.ZodLiteral<"subscription">;
263
277
  runtimeId: z.ZodEnum<{
@@ -332,6 +346,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
332
346
  codex: "codex";
333
347
  pi: "pi";
334
348
  }>>;
349
+ harnessId: z.ZodOptional<z.ZodString>;
335
350
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
336
351
  lane: z.ZodLiteral<"subscription">;
337
352
  runtimeId: z.ZodEnum<{
@@ -410,6 +425,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
410
425
  codex: "codex";
411
426
  pi: "pi";
412
427
  }>>;
428
+ harnessId: z.ZodOptional<z.ZodString>;
413
429
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
414
430
  lane: z.ZodLiteral<"subscription">;
415
431
  runtimeId: z.ZodEnum<{
@@ -528,6 +544,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
528
544
  codex: "codex";
529
545
  pi: "pi";
530
546
  }>>;
547
+ harnessId: z.ZodOptional<z.ZodString>;
531
548
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
532
549
  lane: z.ZodLiteral<"subscription">;
533
550
  runtimeId: z.ZodEnum<{
@@ -778,6 +795,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
778
795
  codex: "codex";
779
796
  pi: "pi";
780
797
  }>>;
798
+ harnessId: z.ZodOptional<z.ZodString>;
781
799
  capabilities: z.ZodOptional<z.ZodObject<{
782
800
  steer: z.ZodOptional<z.ZodBoolean>;
783
801
  resume: z.ZodOptional<z.ZodBoolean>;
@@ -829,12 +847,46 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
829
847
  tool: z.ZodString;
830
848
  input: z.ZodOptional<z.ZodUnknown>;
831
849
  toolCallId: z.ZodOptional<z.ZodString>;
850
+ spill: z.ZodOptional<z.ZodObject<{
851
+ field: z.ZodEnum<{
852
+ input: "input";
853
+ output: "output";
854
+ }>;
855
+ totalBytes: z.ZodNumber;
856
+ omittedBytes: z.ZodNumber;
857
+ contentType: z.ZodLiteral<"application/json">;
858
+ blob: z.ZodOptional<z.ZodObject<{
859
+ blobId: z.ZodString;
860
+ contentHash: z.ZodString;
861
+ size: z.ZodNumber;
862
+ contentType: z.ZodString;
863
+ url: z.ZodOptional<z.ZodString>;
864
+ }, z.core.$strip>>;
865
+ unstoredReason: z.ZodOptional<z.ZodString>;
866
+ }, z.core.$strict>>;
832
867
  }, z.core.$strip>, z.ZodObject<{
833
868
  type: z.ZodLiteral<"tool_result">;
834
869
  tool: z.ZodString;
835
870
  output: z.ZodOptional<z.ZodUnknown>;
836
871
  toolCallId: z.ZodOptional<z.ZodString>;
837
872
  isError: z.ZodOptional<z.ZodBoolean>;
873
+ spill: z.ZodOptional<z.ZodObject<{
874
+ field: z.ZodEnum<{
875
+ input: "input";
876
+ output: "output";
877
+ }>;
878
+ totalBytes: z.ZodNumber;
879
+ omittedBytes: z.ZodNumber;
880
+ contentType: z.ZodLiteral<"application/json">;
881
+ blob: z.ZodOptional<z.ZodObject<{
882
+ blobId: z.ZodString;
883
+ contentHash: z.ZodString;
884
+ size: z.ZodNumber;
885
+ contentType: z.ZodString;
886
+ url: z.ZodOptional<z.ZodString>;
887
+ }, z.core.$strip>>;
888
+ unstoredReason: z.ZodOptional<z.ZodString>;
889
+ }, z.core.$strict>>;
838
890
  }, z.core.$strip>, z.ZodObject<{
839
891
  type: z.ZodLiteral<"artifact">;
840
892
  name: z.ZodString;
@@ -899,6 +951,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
899
951
  session_ref: z.ZodOptional<z.ZodString>;
900
952
  seq: z.ZodOptional<z.ZodNumber>;
901
953
  payload: z.ZodObject<{
954
+ harnessId: z.ZodOptional<z.ZodString>;
902
955
  summary: z.ZodString;
903
956
  sessionRef: z.ZodString;
904
957
  artifactRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -937,6 +990,11 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
937
990
  session_ref: z.ZodOptional<z.ZodString>;
938
991
  seq: z.ZodOptional<z.ZodNumber>;
939
992
  payload: z.ZodObject<{
993
+ recovery: z.ZodOptional<z.ZodObject<{
994
+ kind: z.ZodLiteral<"daemon_interrupted">;
995
+ offerId: z.ZodUUID;
996
+ }, z.core.$strict>>;
997
+ harnessId: z.ZodOptional<z.ZodString>;
940
998
  reason: z.ZodString;
941
999
  retryable: z.ZodOptional<z.ZodBoolean>;
942
1000
  usage: z.ZodOptional<z.ZodObject<{
@@ -967,6 +1025,7 @@ export declare const EventsPollResponseSchema: z.ZodObject<{
967
1025
  session_ref: z.ZodOptional<z.ZodString>;
968
1026
  seq: z.ZodOptional<z.ZodNumber>;
969
1027
  payload: z.ZodObject<{
1028
+ harnessId: z.ZodOptional<z.ZodString>;
970
1029
  reason: z.ZodOptional<z.ZodString>;
971
1030
  usage: z.ZodOptional<z.ZodObject<{
972
1031
  runtime: z.ZodEnum<{
@@ -1209,6 +1268,17 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1209
1268
  permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1210
1269
  }, z.core.$strip>>;
1211
1270
  }, z.core.$strip>>>;
1271
+ harnesses: z.ZodOptional<z.ZodArray<z.ZodObject<{
1272
+ id: z.ZodString;
1273
+ version: z.ZodOptional<z.ZodString>;
1274
+ capabilities: z.ZodObject<{
1275
+ steer: z.ZodOptional<z.ZodBoolean>;
1276
+ resume: z.ZodOptional<z.ZodBoolean>;
1277
+ approvalInteractive: z.ZodOptional<z.ZodBoolean>;
1278
+ mcpToolsets: z.ZodOptional<z.ZodBoolean>;
1279
+ permissionModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1280
+ }, z.core.$strip>;
1281
+ }, z.core.$strip>>>;
1212
1282
  configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1213
1283
  cursor: z.ZodOptional<z.ZodNumber>;
1214
1284
  }, z.core.$strip>;
@@ -1260,6 +1330,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1260
1330
  codex: "codex";
1261
1331
  pi: "pi";
1262
1332
  }>>;
1333
+ harnessId: z.ZodOptional<z.ZodString>;
1263
1334
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1264
1335
  lane: z.ZodLiteral<"subscription">;
1265
1336
  runtimeId: z.ZodEnum<{
@@ -1328,6 +1399,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1328
1399
  codex: "codex";
1329
1400
  pi: "pi";
1330
1401
  }>>;
1402
+ harnessId: z.ZodOptional<z.ZodString>;
1331
1403
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1332
1404
  lane: z.ZodLiteral<"subscription">;
1333
1405
  runtimeId: z.ZodEnum<{
@@ -1402,6 +1474,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1402
1474
  codex: "codex";
1403
1475
  pi: "pi";
1404
1476
  }>>;
1477
+ harnessId: z.ZodOptional<z.ZodString>;
1405
1478
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1406
1479
  lane: z.ZodLiteral<"subscription">;
1407
1480
  runtimeId: z.ZodEnum<{
@@ -1480,6 +1553,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1480
1553
  codex: "codex";
1481
1554
  pi: "pi";
1482
1555
  }>>;
1556
+ harnessId: z.ZodOptional<z.ZodString>;
1483
1557
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1484
1558
  lane: z.ZodLiteral<"subscription">;
1485
1559
  runtimeId: z.ZodEnum<{
@@ -1598,6 +1672,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1598
1672
  codex: "codex";
1599
1673
  pi: "pi";
1600
1674
  }>>;
1675
+ harnessId: z.ZodOptional<z.ZodString>;
1601
1676
  dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1602
1677
  lane: z.ZodLiteral<"subscription">;
1603
1678
  runtimeId: z.ZodEnum<{
@@ -1848,6 +1923,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1848
1923
  codex: "codex";
1849
1924
  pi: "pi";
1850
1925
  }>>;
1926
+ harnessId: z.ZodOptional<z.ZodString>;
1851
1927
  capabilities: z.ZodOptional<z.ZodObject<{
1852
1928
  steer: z.ZodOptional<z.ZodBoolean>;
1853
1929
  resume: z.ZodOptional<z.ZodBoolean>;
@@ -1899,12 +1975,46 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1899
1975
  tool: z.ZodString;
1900
1976
  input: z.ZodOptional<z.ZodUnknown>;
1901
1977
  toolCallId: z.ZodOptional<z.ZodString>;
1978
+ spill: z.ZodOptional<z.ZodObject<{
1979
+ field: z.ZodEnum<{
1980
+ input: "input";
1981
+ output: "output";
1982
+ }>;
1983
+ totalBytes: z.ZodNumber;
1984
+ omittedBytes: z.ZodNumber;
1985
+ contentType: z.ZodLiteral<"application/json">;
1986
+ blob: z.ZodOptional<z.ZodObject<{
1987
+ blobId: z.ZodString;
1988
+ contentHash: z.ZodString;
1989
+ size: z.ZodNumber;
1990
+ contentType: z.ZodString;
1991
+ url: z.ZodOptional<z.ZodString>;
1992
+ }, z.core.$strip>>;
1993
+ unstoredReason: z.ZodOptional<z.ZodString>;
1994
+ }, z.core.$strict>>;
1902
1995
  }, z.core.$strip>, z.ZodObject<{
1903
1996
  type: z.ZodLiteral<"tool_result">;
1904
1997
  tool: z.ZodString;
1905
1998
  output: z.ZodOptional<z.ZodUnknown>;
1906
1999
  toolCallId: z.ZodOptional<z.ZodString>;
1907
2000
  isError: z.ZodOptional<z.ZodBoolean>;
2001
+ spill: z.ZodOptional<z.ZodObject<{
2002
+ field: z.ZodEnum<{
2003
+ input: "input";
2004
+ output: "output";
2005
+ }>;
2006
+ totalBytes: z.ZodNumber;
2007
+ omittedBytes: z.ZodNumber;
2008
+ contentType: z.ZodLiteral<"application/json">;
2009
+ blob: z.ZodOptional<z.ZodObject<{
2010
+ blobId: z.ZodString;
2011
+ contentHash: z.ZodString;
2012
+ size: z.ZodNumber;
2013
+ contentType: z.ZodString;
2014
+ url: z.ZodOptional<z.ZodString>;
2015
+ }, z.core.$strip>>;
2016
+ unstoredReason: z.ZodOptional<z.ZodString>;
2017
+ }, z.core.$strict>>;
1908
2018
  }, z.core.$strip>, z.ZodObject<{
1909
2019
  type: z.ZodLiteral<"artifact">;
1910
2020
  name: z.ZodString;
@@ -1969,6 +2079,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
1969
2079
  session_ref: z.ZodOptional<z.ZodString>;
1970
2080
  seq: z.ZodOptional<z.ZodNumber>;
1971
2081
  payload: z.ZodObject<{
2082
+ harnessId: z.ZodOptional<z.ZodString>;
1972
2083
  summary: z.ZodString;
1973
2084
  sessionRef: z.ZodString;
1974
2085
  artifactRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2007,6 +2118,11 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
2007
2118
  session_ref: z.ZodOptional<z.ZodString>;
2008
2119
  seq: z.ZodOptional<z.ZodNumber>;
2009
2120
  payload: z.ZodObject<{
2121
+ recovery: z.ZodOptional<z.ZodObject<{
2122
+ kind: z.ZodLiteral<"daemon_interrupted">;
2123
+ offerId: z.ZodUUID;
2124
+ }, z.core.$strict>>;
2125
+ harnessId: z.ZodOptional<z.ZodString>;
2010
2126
  reason: z.ZodString;
2011
2127
  retryable: z.ZodOptional<z.ZodBoolean>;
2012
2128
  usage: z.ZodOptional<z.ZodObject<{
@@ -2037,6 +2153,7 @@ export declare const MessagesSendRequestSchema: z.ZodObject<{
2037
2153
  session_ref: z.ZodOptional<z.ZodString>;
2038
2154
  seq: z.ZodOptional<z.ZodNumber>;
2039
2155
  payload: z.ZodObject<{
2156
+ harnessId: z.ZodOptional<z.ZodString>;
2040
2157
  reason: z.ZodOptional<z.ZodString>;
2041
2158
  usage: z.ZodOptional<z.ZodObject<{
2042
2159
  runtime: z.ZodEnum<{
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { MAILBOX_READ_AHEAD_MAX_SEQS, MAILBOX_READ_AHEAD_CAPABILITY } from './version';
1
2
  export { PROTOCOL_VERSION, CAPABILITY_FLAGS, STRICT_AGENT_ONLY_CAPABILITY } from './version';
2
3
  export type { CapabilityFlag } from './version';
3
4
  export { BlobRefSchema, CONTENT_HASH_RE } from './blob';
@@ -6,8 +7,8 @@ export { PermissionPolicySchema, PERMISSION_MODES } from './permission';
6
7
  export type { PermissionPolicy, PermissionMode } from './permission';
7
8
  export { PROVIDER_PROFILE_BINDING_CAPABILITY, PROVIDER_MODEL_CAPABILITIES, ProviderProfileRefSchema, ProviderProfileRevisionSchema, ProviderProfileHashSchema, ProviderModelCapabilitySchema, ProviderProfileBindingSchema, } from './provider-profile-binding';
8
9
  export type { ProviderProfileRef, ProviderProfileRevision, ProviderProfileHash, ProviderModelCapability, ProviderProfileBinding, } from './provider-profile-binding';
9
- export { AgentEventSchema, UnknownAgentEventSchema, AgentEventOrUnknownSchema, KNOWN_AGENT_EVENT_TYPES, isKnownAgentEvent, partitionAgentEvents, } from './agent-event';
10
- export type { AgentEvent, UnknownAgentEvent, AgentEventOrUnknown } from './agent-event';
10
+ export { AgentEventSchema, AgentEventSpillSchema, AGENT_EVENT_SPILL_UNSTORED_REASON_MAX_LENGTH, UnknownAgentEventSchema, AgentEventOrUnknownSchema, KNOWN_AGENT_EVENT_TYPES, isKnownAgentEvent, partitionAgentEvents, } from './agent-event';
11
+ export type { AgentEvent, AgentEventSpill, UnknownAgentEvent, AgentEventOrUnknown } from './agent-event';
11
12
  export { AgentEgressPolicySchema, AgentEgressActivityPolicySchema, AgentReliableQuotaPolicySchema, ContentReadPolicySchema, AgentEgressLaneSchema, AgentEgressDropReasonSchema, AgentContentReadSurfaceSchema, AgentContentActorKindSchema, AgentContentActorSchema, AgentContentDecodeAsSchema, AgentContentMimeTypeSchema, AgentContentReadDecisionSchema, AgentContentReadDenialReasonSchema, AgentEgressContentHashSchema, AgentEgressPolicyRevisionSchema, AgentMessageContractSchema, AgentMessageContentTypeSchema, AgentMessageDestinationBindingSchema, AgentMessageFreshnessCursorSchema, AgentMessageServerContextSchema, AgentMessageEgressRequirementSchema, AGENT_MESSAGE_MAX_BYTES, AGENT_MESSAGE_EGRESS_CAPABILITY, AGENT_EGRESS_POLICY_CAPABILITY, AGENT_EGRESS_RELIABLE_ACK_CAPABILITY, AGENT_EGRESS_FRESH_SESSION_CAPABILITY, AGENT_CONTENT_WORKSPACE_READ_CAPABILITY, AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY, AGENT_CONTENT_ARTIFACT_READ_CAPABILITY, } from './agent-egress';
12
13
  export type { AgentEgressPolicy, AgentEgressActivityPolicy, AgentReliableQuotaPolicy, ContentReadPolicy, AgentEgressLane, AgentEgressDropReason, AgentMessageContentType, AgentMessageEgressRequirement, AgentMessageServerContext, AgentContentReadSurface, AgentContentActorKind, AgentContentActor, AgentContentDecodeAs, AgentContentReadDecision, AgentContentReadDenialReason, } from './agent-egress';
13
14
  export { AGENT_HOME_PROJECTION_CAPABILITY, AGENT_HOME_PROJECTION_MAX_BYTES, AGENT_HOME_PROJECTION_PROFILE_REVISION_MAXIMUM, AgentHomeProjectionProfileRevisionSchema, AgentHomeProjectionHashSchema, AgentHomeProjectionOutcomeSchema, AgentHomeProjectionValueSchema, } from './agent-home-projection';
@@ -18,7 +19,7 @@ export { TERMINAL_PROJECTION_SELECTION_CAPABILITY, TerminalProjectionContractSch
18
19
  export type { TerminalProjectionSelection } from './terminal-projection';
19
20
  export { TASK_STATES, TASK_TRANSITIONS, canTransition } from './task-state';
20
21
  export type { TaskState } from './task-state';
21
- export { MESSAGE_TYPES, MESSAGE_PAYLOAD_SCHEMAS, SERVER_TO_DAEMON_TYPES, DAEMON_TO_SERVER_TYPES, RuntimeIdSchema, ProtocolVersionNumberSchema, RuntimeInfoSchema, RuntimeCapabilitiesSchema, AgentRefSchema, AgentHomeProjectionAgentRefSchema, AGENT_REF_MAX_BYTES, DispatchSelectionSchema, ToolsetIdSchema, ConfiguredToolsetsSchema, RequiredToolsetsSchema, CONFIGURED_TOOLSETS_MAX_ITEMS, ConnHelloPayloadSchema, ConnAckPayloadSchema, TaskOfferPayloadSchema, TaskOfferWithToolsetsPayloadSchema, TaskOfferForAgentPayloadSchema, TaskOfferForAgentWithEgressPayloadSchema, TaskOfferForAgentWithEgressFreshPayloadSchema, AgentEgressReliablePayloadSchema, AgentEgressAckPayloadSchema, AgentMessagePublishPayloadSchema, AgentMessageDispositionPayloadSchema, AgentContentReadPayloadSchema, AgentContentReceiptPayloadSchema, AgentHomeProjectionPayloadSchema, TaskApprovePayloadSchema, TaskRejectPayloadSchema, TaskCancelPayloadSchema, TaskSteerPayloadSchema, TaskClaimPayloadSchema, TaskStartedPayloadSchema, TaskDeclinePayloadSchema, TaskProgressPayloadSchema, TaskArtifactPayloadSchema, TaskAwaitApprovalPayloadSchema, TaskCompletePayloadSchema, TaskFailPayloadSchema, TaskCancelledPayloadSchema, TaskApprovalResolvedPayloadSchema, RESULT_DOCUMENT_MAX_BYTES, checkResultDocument, TerminalInferenceUsageSchema, TERMINAL_INFERENCE_USAGE_MAX_TOKENS, TERMINAL_INFERENCE_USAGE_MAX_DURATION_MS, TERMINAL_INFERENCE_USAGE_PROVIDER_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_CLIENT_VERSION_MAX_LENGTH, } from './messages';
22
+ export { MESSAGE_TYPES, TASK_OFFER_TYPES, isTaskOfferType, MESSAGE_PAYLOAD_SCHEMAS, SERVER_TO_DAEMON_TYPES, DAEMON_TO_SERVER_TYPES, RuntimeIdSchema, ProtocolVersionNumberSchema, RuntimeInfoSchema, HarnessIdSchema, HarnessInfoSchema, HarnessInventorySchema, RuntimeCapabilitiesSchema, AgentRefSchema, AgentHomeProjectionAgentRefSchema, AGENT_REF_MAX_BYTES, DispatchSelectionSchema, ToolsetIdSchema, ConfiguredToolsetsSchema, RequiredToolsetsSchema, CONFIGURED_TOOLSETS_MAX_ITEMS, ConnHelloPayloadSchema, ConnAckPayloadSchema, TaskOfferPayloadSchema, TaskOfferWithToolsetsPayloadSchema, TaskOfferForAgentPayloadSchema, TaskOfferForAgentWithEgressPayloadSchema, TaskOfferForAgentWithEgressFreshPayloadSchema, AgentEgressReliablePayloadSchema, AgentEgressAckPayloadSchema, AgentMessagePublishPayloadSchema, AgentMessageDispositionPayloadSchema, AgentContentReadPayloadSchema, AgentContentReceiptPayloadSchema, AgentHomeProjectionPayloadSchema, TaskApprovePayloadSchema, TaskRejectPayloadSchema, TaskCancelPayloadSchema, TaskSteerPayloadSchema, TaskClaimPayloadSchema, TaskStartedPayloadSchema, TaskDeclinePayloadSchema, TaskProgressPayloadSchema, TaskArtifactPayloadSchema, TaskAwaitApprovalPayloadSchema, TaskCompletePayloadSchema, TaskFailPayloadSchema, TaskCancelledPayloadSchema, TaskApprovalResolvedPayloadSchema, RESULT_DOCUMENT_MAX_BYTES, checkResultDocument, TerminalInferenceUsageSchema, TERMINAL_INFERENCE_USAGE_MAX_TOKENS, TERMINAL_INFERENCE_USAGE_MAX_DURATION_MS, TERMINAL_INFERENCE_USAGE_PROVIDER_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_CLIENT_VERSION_MAX_LENGTH, } from './messages';
22
23
  export type { ResultDocumentCheck, MessageType, RuntimeId, RuntimeInfo, RuntimeCapabilities, AgentRef, AgentHomeProjectionAgentRef, DispatchSelection, ToolsetId, ConnHelloPayload, ConnAckPayload, TaskOfferPayload, TaskOfferWithToolsetsPayload, TaskOfferForAgentPayload, TaskOfferForAgentWithEgressPayload, TaskOfferForAgentWithEgressFreshPayload, AgentEgressReliablePayload, AgentEgressAckPayload, AgentMessagePublishPayload, AgentMessageDispositionPayload, AgentContentReadPayload, AgentContentReceiptPayload, AgentHomeProjectionPayload, TaskApprovePayload, TaskRejectPayload, TaskCancelPayload, TaskSteerPayload, TaskClaimPayload, TaskStartedPayload, TaskDeclinePayload, TaskProgressPayload, TaskArtifactPayload, TaskAwaitApprovalPayload, TaskCompletePayload, TaskFailPayload, TaskCancelledPayload, TaskApprovalResolvedPayload, TerminalInferenceUsage, } from './messages';
23
24
  export { EnvelopeSchema, isServerToDaemonType } from './envelope';
24
25
  export type { Envelope } from './envelope';
@@ -27,3 +28,6 @@ export { encodeEnvelope, decodeEnvelope, createEnvelope, parseMessage } from './
27
28
  export type { CreateEnvelopeOptions } from './codec';
28
29
  export { PairRequestSchema, PairResponseTenantIdSchema, PAIR_RESPONSE_TENANT_ID_MAX_LENGTH, PairResponseSchema, ChallengeRequestSchema, ChallengeResponseSchema, TokenRequestSchema, TokenResponseSchema, PresencePublishRequestSchema, CreateBlobRequestSchema, CreateBlobResponseSchema, BlobDownloadUrlResponseSchema, EventsPollQuerySchema, EventsPollResponseSchema, MessagesSendRequestSchema, MessagesSendResponseSchema, AgentHomeProjectionCompletionRequestSchema, AgentHomeProjectionStatusSchema, AgentHomeProjectionReadbackSchema, AgentMemoryProjectionCommitRequestSchema, AgentMemoryProjectionCommitResponseSchema, MAX_MESSAGES_PER_BATCH, BYOK_PAIR_PATH, BYOK_CHALLENGE_PATH, BYOK_TOKEN_PATH, BYOK_CAPABILITIES_PATH, BYOK_EVENTS_PATH, BYOK_MESSAGES_PATH, BYOK_AGENT_HOME_PROJECTIONS_PATH, BYOK_AGENT_HOME_PROJECTION_COMPLETION_ROUTE, byokAgentHomeProjectionCompletionPath, BYOK_AGENT_MEMORY_PROJECTIONS_PATH, BYOK_PRESENCE_PATH, BYOK_ACTIVITY_PATH, BYOK_BOARD_PATH, BYOK_BOARD_STREAM_PATH, BYOK_BOARD_CLAIM_ROUTE, BYOK_BOARD_UNCLAIM_ROUTE, BYOK_BOARD_STATUS_ROUTE, BYOK_RECORDS_PATH, BYOK_RECORD_ROUTE, byokRecordPath, BYOK_SKILL_PACKS_PATH, BYOK_SKILL_PACK_FILE_ROUTE, byokSkillPackFilePath, BYOK_BLOBS_PATH, BYOK_BLOB_FINALIZE_ROUTE, BYOK_BLOB_URL_ROUTE, BYOK_BLOB_CONTENT_ROUTE, byokBlobFinalizePath, byokBlobUrlPath, byokBlobContentPath, } from './http-api';
29
30
  export type { PairRequest, PairResponse, ChallengeRequest, ChallengeResponse, TokenRequest, TokenResponse, PresencePublishRequest, CreateBlobRequest, CreateBlobResponse, BlobDownloadUrlResponse, EventsPollQuery, EventsPollResponse, MessagesSendRequest, MessagesSendResponse, AgentHomeProjectionCompletionRequest, AgentHomeProjectionStatus, AgentHomeProjectionReadback, AgentMemoryProjectionCommitRequest, AgentMemoryProjectionCommitResponse, } from './http-api';
31
+ export type { TaskOfferType } from './messages';
32
+ export type { HarnessId, HarnessInfo } from './messages';
33
+ export { CUSTOM_HARNESS_CAPABILITY } from './version';