@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,5 +1,20 @@
1
1
  import { z } from 'zod';
2
- import { type MessageType } from './messages';
2
+ import { MESSAGE_PAYLOAD_SCHEMAS, type MessageType } from './messages';
3
+ /**
4
+ * The schema `envelopeShape` returns, written out so declaration emit names
5
+ * each branch of `EnvelopeSchema` instead of copying every payload type.
6
+ * Type-only: it must stay equal to the inferred `z.object` type below.
7
+ */
8
+ type EnvelopeShape<T extends MessageType, TaskId extends z.ZodTypeAny, Seq extends z.ZodTypeAny> = z.ZodObject<{
9
+ v: z.ZodNumber;
10
+ id: z.ZodUUID;
11
+ ts: z.ZodISODateTime;
12
+ type: z.ZodLiteral<T>;
13
+ task_id: TaskId;
14
+ session_ref: z.ZodOptional<z.ZodString>;
15
+ seq: Seq;
16
+ payload: (typeof MESSAGE_PAYLOAD_SCHEMAS)[T];
17
+ }, z.core.$strip>;
3
18
  /**
4
19
  * The wire envelope: common transport fields plus a `payload` whose shape is
5
20
  * determined by `type`. Unknown top-level fields are tolerated (stripped) for
@@ -16,1406 +31,8 @@ import { type MessageType } from './messages';
16
31
  * optional for daemon -> server types (M1 redelivery cursor; see
17
32
  * `conn.hello.cursor` in `messages.ts`).
18
33
  */
19
- export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
20
- v: z.ZodNumber;
21
- id: z.ZodUUID;
22
- ts: z.ZodISODateTime;
23
- type: z.ZodLiteral<"conn.hello">;
24
- task_id: z.ZodOptional<z.ZodString>;
25
- session_ref: z.ZodOptional<z.ZodString>;
26
- seq: z.ZodOptional<z.ZodNumber>;
27
- payload: z.ZodObject<{
28
- protocolVersions: z.ZodArray<z.ZodNumber>;
29
- capabilities: z.ZodArray<z.ZodString>;
30
- deviceId: z.ZodString;
31
- productId: z.ZodString;
32
- clientVersion: z.ZodOptional<z.ZodString>;
33
- runtimes: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
- id: z.ZodEnum<{
35
- claude: "claude";
36
- codex: "codex";
37
- pi: "pi";
38
- }>;
39
- version: z.ZodOptional<z.ZodString>;
40
- authPresent: z.ZodOptional<z.ZodBoolean>;
41
- capabilities: z.ZodOptional<z.ZodObject<{
42
- steer: z.ZodOptional<z.ZodBoolean>;
43
- resume: z.ZodOptional<z.ZodBoolean>;
44
- approvalInteractive: z.ZodOptional<z.ZodBoolean>;
45
- mcpToolsets: z.ZodOptional<z.ZodBoolean>;
46
- messageDraft: z.ZodOptional<z.ZodBoolean>;
47
- }, z.core.$strip>>;
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
- messageDraft: z.ZodOptional<z.ZodBoolean>;
58
- }, z.core.$strip>;
59
- }, z.core.$strip>>>;
60
- configuredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
- cursor: z.ZodOptional<z.ZodNumber>;
62
- }, z.core.$strip>;
63
- }, z.core.$strip>, z.ZodObject<{
64
- v: z.ZodNumber;
65
- id: z.ZodUUID;
66
- ts: z.ZodISODateTime;
67
- type: z.ZodLiteral<"conn.ack">;
68
- task_id: z.ZodOptional<z.ZodString>;
69
- session_ref: z.ZodOptional<z.ZodString>;
70
- seq: z.ZodNumber;
71
- payload: z.ZodObject<{
72
- protocolVersion: z.ZodNumber;
73
- capabilities: z.ZodArray<z.ZodString>;
74
- serverTime: z.ZodISODateTime;
75
- }, z.core.$strip>;
76
- }, z.core.$strip>, z.ZodObject<{
77
- v: z.ZodNumber;
78
- id: z.ZodUUID;
79
- ts: z.ZodISODateTime;
80
- type: z.ZodLiteral<"task.offer">;
81
- task_id: z.ZodString;
82
- session_ref: z.ZodOptional<z.ZodString>;
83
- seq: z.ZodNumber;
84
- payload: z.ZodObject<{
85
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
86
- blobRef: z.ZodObject<{
87
- blobId: z.ZodString;
88
- contentHash: z.ZodString;
89
- size: z.ZodNumber;
90
- contentType: z.ZodString;
91
- url: z.ZodOptional<z.ZodString>;
92
- }, z.core.$strip>;
93
- }, z.core.$strict>]>;
94
- runtime: z.ZodOptional<z.ZodEnum<{
95
- claude: "claude";
96
- codex: "codex";
97
- pi: "pi";
98
- }>>;
99
- harnessId: z.ZodOptional<z.ZodString>;
100
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
101
- lane: z.ZodLiteral<"subscription">;
102
- runtimeId: z.ZodEnum<{
103
- claude: "claude";
104
- codex: "codex";
105
- }>;
106
- providerId: z.ZodNull;
107
- modelId: z.ZodString;
108
- }, z.core.$strict>, z.ZodObject<{
109
- lane: z.ZodLiteral<"byok">;
110
- runtimeId: z.ZodLiteral<"pi">;
111
- providerId: z.ZodString;
112
- modelId: z.ZodString;
113
- }, z.core.$strict>, z.ZodObject<{
114
- lane: z.ZodLiteral<"byok-profile">;
115
- runtimeId: z.ZodLiteral<"pi">;
116
- providerProfile: z.ZodObject<{
117
- profileRef: z.ZodString;
118
- profileRevision: z.ZodString;
119
- profileHash: z.ZodString;
120
- modelId: z.ZodString;
121
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
122
- "image-input": "image-input";
123
- }>>;
124
- }, z.core.$strict>;
125
- }, z.core.$strict>], "lane">>;
126
- sessionRef: z.ZodOptional<z.ZodString>;
127
- workspaceHint: z.ZodOptional<z.ZodString>;
128
- limits: z.ZodOptional<z.ZodObject<{
129
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
130
- maxTokens: z.ZodOptional<z.ZodNumber>;
131
- }, z.core.$strip>>;
132
- }, z.core.$strip>;
133
- }, z.core.$strip>, z.ZodObject<{
134
- v: z.ZodNumber;
135
- id: z.ZodUUID;
136
- ts: z.ZodISODateTime;
137
- type: z.ZodLiteral<"task.offer_with_toolsets">;
138
- task_id: z.ZodString;
139
- session_ref: z.ZodOptional<z.ZodString>;
140
- seq: z.ZodNumber;
141
- payload: z.ZodObject<{
142
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
143
- blobRef: z.ZodObject<{
144
- blobId: z.ZodString;
145
- contentHash: z.ZodString;
146
- size: z.ZodNumber;
147
- contentType: z.ZodString;
148
- url: z.ZodOptional<z.ZodString>;
149
- }, z.core.$strip>;
150
- }, z.core.$strict>]>;
151
- runtime: z.ZodOptional<z.ZodEnum<{
152
- claude: "claude";
153
- codex: "codex";
154
- pi: "pi";
155
- }>>;
156
- harnessId: z.ZodOptional<z.ZodString>;
157
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
158
- lane: z.ZodLiteral<"subscription">;
159
- runtimeId: z.ZodEnum<{
160
- claude: "claude";
161
- codex: "codex";
162
- }>;
163
- providerId: z.ZodNull;
164
- modelId: z.ZodString;
165
- }, z.core.$strict>, z.ZodObject<{
166
- lane: z.ZodLiteral<"byok">;
167
- runtimeId: z.ZodLiteral<"pi">;
168
- providerId: z.ZodString;
169
- modelId: z.ZodString;
170
- }, z.core.$strict>, z.ZodObject<{
171
- lane: z.ZodLiteral<"byok-profile">;
172
- runtimeId: z.ZodLiteral<"pi">;
173
- providerProfile: z.ZodObject<{
174
- profileRef: z.ZodString;
175
- profileRevision: z.ZodString;
176
- profileHash: z.ZodString;
177
- modelId: z.ZodString;
178
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
179
- "image-input": "image-input";
180
- }>>;
181
- }, z.core.$strict>;
182
- }, z.core.$strict>], "lane">>;
183
- sessionRef: z.ZodOptional<z.ZodString>;
184
- workspaceHint: z.ZodOptional<z.ZodString>;
185
- limits: z.ZodOptional<z.ZodObject<{
186
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
187
- maxTokens: z.ZodOptional<z.ZodNumber>;
188
- }, z.core.$strip>>;
189
- requiredToolsets: z.ZodArray<z.ZodString>;
190
- }, z.core.$strict>;
191
- }, z.core.$strip>, z.ZodObject<{
192
- v: z.ZodNumber;
193
- id: z.ZodUUID;
194
- ts: z.ZodISODateTime;
195
- type: z.ZodLiteral<"task.offer_for_agent">;
196
- task_id: z.ZodString;
197
- session_ref: z.ZodOptional<z.ZodString>;
198
- seq: z.ZodNumber;
199
- payload: z.ZodObject<{
200
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
201
- blobRef: z.ZodObject<{
202
- blobId: z.ZodString;
203
- contentHash: z.ZodString;
204
- size: z.ZodNumber;
205
- contentType: z.ZodString;
206
- url: z.ZodOptional<z.ZodString>;
207
- }, z.core.$strip>;
208
- }, z.core.$strict>]>;
209
- agentRef: z.ZodObject<{
210
- agentId: z.ZodString;
211
- profileRevision: z.ZodString;
212
- }, z.core.$strict>;
213
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
214
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
- runtime: z.ZodOptional<z.ZodEnum<{
216
- claude: "claude";
217
- codex: "codex";
218
- pi: "pi";
219
- }>>;
220
- harnessId: z.ZodOptional<z.ZodString>;
221
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
222
- lane: z.ZodLiteral<"subscription">;
223
- runtimeId: z.ZodEnum<{
224
- claude: "claude";
225
- codex: "codex";
226
- }>;
227
- providerId: z.ZodNull;
228
- modelId: z.ZodString;
229
- }, z.core.$strict>, z.ZodObject<{
230
- lane: z.ZodLiteral<"byok">;
231
- runtimeId: z.ZodLiteral<"pi">;
232
- providerId: z.ZodString;
233
- modelId: z.ZodString;
234
- }, z.core.$strict>, z.ZodObject<{
235
- lane: z.ZodLiteral<"byok-profile">;
236
- runtimeId: z.ZodLiteral<"pi">;
237
- providerProfile: z.ZodObject<{
238
- profileRef: z.ZodString;
239
- profileRevision: z.ZodString;
240
- profileHash: z.ZodString;
241
- modelId: z.ZodString;
242
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
243
- "image-input": "image-input";
244
- }>>;
245
- }, z.core.$strict>;
246
- }, z.core.$strict>], "lane">>;
247
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
248
- mode: z.ZodLiteral<"none">;
249
- }, z.core.$strict>, z.ZodObject<{
250
- mode: z.ZodLiteral<"result-document">;
251
- contract: z.ZodString;
252
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
253
- }, z.core.$strict>], "mode">>;
254
- sessionRef: z.ZodOptional<z.ZodString>;
255
- limits: z.ZodOptional<z.ZodObject<{
256
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
257
- maxTokens: z.ZodOptional<z.ZodNumber>;
258
- }, z.core.$strip>>;
259
- }, z.core.$strict>;
260
- }, z.core.$strip>, z.ZodObject<{
261
- v: z.ZodNumber;
262
- id: z.ZodUUID;
263
- ts: z.ZodISODateTime;
264
- type: z.ZodLiteral<"task.offer_for_agent_with_egress">;
265
- task_id: z.ZodString;
266
- session_ref: z.ZodOptional<z.ZodString>;
267
- seq: z.ZodNumber;
268
- payload: z.ZodObject<{
269
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
270
- blobRef: z.ZodObject<{
271
- blobId: z.ZodString;
272
- contentHash: z.ZodString;
273
- size: z.ZodNumber;
274
- contentType: z.ZodString;
275
- url: z.ZodOptional<z.ZodString>;
276
- }, z.core.$strip>;
277
- }, z.core.$strict>]>;
278
- agentRef: z.ZodObject<{
279
- agentId: z.ZodString;
280
- profileRevision: z.ZodString;
281
- }, z.core.$strict>;
282
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
283
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
284
- runtime: z.ZodOptional<z.ZodEnum<{
285
- claude: "claude";
286
- codex: "codex";
287
- pi: "pi";
288
- }>>;
289
- harnessId: z.ZodOptional<z.ZodString>;
290
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
291
- lane: z.ZodLiteral<"subscription">;
292
- runtimeId: z.ZodEnum<{
293
- claude: "claude";
294
- codex: "codex";
295
- }>;
296
- providerId: z.ZodNull;
297
- modelId: z.ZodString;
298
- }, z.core.$strict>, z.ZodObject<{
299
- lane: z.ZodLiteral<"byok">;
300
- runtimeId: z.ZodLiteral<"pi">;
301
- providerId: z.ZodString;
302
- modelId: z.ZodString;
303
- }, z.core.$strict>, z.ZodObject<{
304
- lane: z.ZodLiteral<"byok-profile">;
305
- runtimeId: z.ZodLiteral<"pi">;
306
- providerProfile: z.ZodObject<{
307
- profileRef: z.ZodString;
308
- profileRevision: z.ZodString;
309
- profileHash: z.ZodString;
310
- modelId: z.ZodString;
311
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
312
- "image-input": "image-input";
313
- }>>;
314
- }, z.core.$strict>;
315
- }, z.core.$strict>], "lane">>;
316
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
317
- mode: z.ZodLiteral<"none">;
318
- }, z.core.$strict>, z.ZodObject<{
319
- mode: z.ZodLiteral<"result-document">;
320
- contract: z.ZodString;
321
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
322
- }, z.core.$strict>], "mode">>;
323
- limits: z.ZodOptional<z.ZodObject<{
324
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
325
- maxTokens: z.ZodOptional<z.ZodNumber>;
326
- }, z.core.$strip>>;
327
- sessionRef: z.ZodString;
328
- egressPolicy: z.ZodObject<{
329
- policyRevision: z.ZodString;
330
- activity: z.ZodObject<{
331
- delivery: z.ZodLiteral<"latest-value">;
332
- maxCoalesceMs: z.ZodNumber;
333
- maxEventBytes: z.ZodNumber;
334
- }, z.core.$strict>;
335
- reliable: z.ZodObject<{
336
- maxPendingEventsPerAgent: z.ZodNumber;
337
- maxPendingBytesPerAgent: z.ZodNumber;
338
- maxPendingBytesPerTenant: z.ZodNumber;
339
- }, z.core.$strict>;
340
- transfers: z.ZodObject<{
341
- workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
342
- maxBytes: z.ZodNumber;
343
- allowedMimeTypes: z.ZodArray<z.ZodString>;
344
- }, z.core.$strict>]>;
345
- transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
346
- maxBytes: z.ZodNumber;
347
- allowedMimeTypes: z.ZodArray<z.ZodString>;
348
- }, z.core.$strict>]>;
349
- artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
350
- maxBytes: z.ZodNumber;
351
- allowedMimeTypes: z.ZodArray<z.ZodString>;
352
- }, z.core.$strict>]>;
353
- }, z.core.$strict>;
354
- }, z.core.$strict>;
355
- messageEgress: z.ZodOptional<z.ZodObject<{
356
- mode: z.ZodLiteral<"required">;
357
- contract: z.ZodString;
358
- contentType: z.ZodEnum<{
359
- "text/markdown": "text/markdown";
360
- "text/plain": "text/plain";
361
- }>;
362
- maxBytes: z.ZodNumber;
363
- }, z.core.$strict>>;
364
- }, z.core.$strict>;
365
- }, z.core.$strip>, z.ZodObject<{
366
- v: z.ZodNumber;
367
- id: z.ZodUUID;
368
- ts: z.ZodISODateTime;
369
- type: z.ZodLiteral<"task.offer_for_agent_with_egress_fresh">;
370
- task_id: z.ZodString;
371
- session_ref: z.ZodOptional<z.ZodString>;
372
- seq: z.ZodNumber;
373
- payload: z.ZodObject<{
374
- instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
375
- blobRef: z.ZodObject<{
376
- blobId: z.ZodString;
377
- contentHash: z.ZodString;
378
- size: z.ZodNumber;
379
- contentType: z.ZodString;
380
- url: z.ZodOptional<z.ZodString>;
381
- }, z.core.$strip>;
382
- }, z.core.$strict>]>;
383
- agentRef: z.ZodObject<{
384
- agentId: z.ZodString;
385
- profileRevision: z.ZodString;
386
- }, z.core.$strict>;
387
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
388
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
389
- runtime: z.ZodOptional<z.ZodEnum<{
390
- claude: "claude";
391
- codex: "codex";
392
- pi: "pi";
393
- }>>;
394
- harnessId: z.ZodOptional<z.ZodString>;
395
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
396
- lane: z.ZodLiteral<"subscription">;
397
- runtimeId: z.ZodEnum<{
398
- claude: "claude";
399
- codex: "codex";
400
- }>;
401
- providerId: z.ZodNull;
402
- modelId: z.ZodString;
403
- }, z.core.$strict>, z.ZodObject<{
404
- lane: z.ZodLiteral<"byok">;
405
- runtimeId: z.ZodLiteral<"pi">;
406
- providerId: z.ZodString;
407
- modelId: z.ZodString;
408
- }, z.core.$strict>, z.ZodObject<{
409
- lane: z.ZodLiteral<"byok-profile">;
410
- runtimeId: z.ZodLiteral<"pi">;
411
- providerProfile: z.ZodObject<{
412
- profileRef: z.ZodString;
413
- profileRevision: z.ZodString;
414
- profileHash: z.ZodString;
415
- modelId: z.ZodString;
416
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
417
- "image-input": "image-input";
418
- }>>;
419
- }, z.core.$strict>;
420
- }, z.core.$strict>], "lane">>;
421
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
422
- mode: z.ZodLiteral<"none">;
423
- }, z.core.$strict>, z.ZodObject<{
424
- mode: z.ZodLiteral<"result-document">;
425
- contract: z.ZodString;
426
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
427
- }, z.core.$strict>], "mode">>;
428
- limits: z.ZodOptional<z.ZodObject<{
429
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
430
- maxTokens: z.ZodOptional<z.ZodNumber>;
431
- }, z.core.$strip>>;
432
- egressPolicy: z.ZodObject<{
433
- policyRevision: z.ZodString;
434
- activity: z.ZodObject<{
435
- delivery: z.ZodLiteral<"latest-value">;
436
- maxCoalesceMs: z.ZodNumber;
437
- maxEventBytes: z.ZodNumber;
438
- }, z.core.$strict>;
439
- reliable: z.ZodObject<{
440
- maxPendingEventsPerAgent: z.ZodNumber;
441
- maxPendingBytesPerAgent: z.ZodNumber;
442
- maxPendingBytesPerTenant: z.ZodNumber;
443
- }, z.core.$strict>;
444
- transfers: z.ZodObject<{
445
- workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
446
- maxBytes: z.ZodNumber;
447
- allowedMimeTypes: z.ZodArray<z.ZodString>;
448
- }, z.core.$strict>]>;
449
- transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
450
- maxBytes: z.ZodNumber;
451
- allowedMimeTypes: z.ZodArray<z.ZodString>;
452
- }, z.core.$strict>]>;
453
- artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
454
- maxBytes: z.ZodNumber;
455
- allowedMimeTypes: z.ZodArray<z.ZodString>;
456
- }, z.core.$strict>]>;
457
- }, z.core.$strict>;
458
- }, z.core.$strict>;
459
- messageEgress: z.ZodOptional<z.ZodObject<{
460
- mode: z.ZodLiteral<"required">;
461
- contract: z.ZodString;
462
- contentType: z.ZodEnum<{
463
- "text/markdown": "text/markdown";
464
- "text/plain": "text/plain";
465
- }>;
466
- maxBytes: z.ZodNumber;
467
- }, z.core.$strict>>;
468
- }, z.core.$strict>;
469
- }, z.core.$strip>, z.ZodObject<{
470
- v: z.ZodNumber;
471
- id: z.ZodUUID;
472
- ts: z.ZodISODateTime;
473
- type: z.ZodLiteral<"task.offer_prepared">;
474
- task_id: z.ZodString;
475
- session_ref: z.ZodOptional<z.ZodString>;
476
- seq: z.ZodNumber;
477
- payload: z.ZodObject<{
478
- agentRef: z.ZodObject<{
479
- agentId: z.ZodString;
480
- profileRevision: z.ZodString;
481
- }, z.core.$strict>;
482
- homeAccess: z.ZodOptional<z.ZodLiteral<"memory-reader">>;
483
- requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
484
- runtime: z.ZodOptional<z.ZodEnum<{
485
- claude: "claude";
486
- codex: "codex";
487
- pi: "pi";
488
- }>>;
489
- harnessId: z.ZodOptional<z.ZodString>;
490
- dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
491
- lane: z.ZodLiteral<"subscription">;
492
- runtimeId: z.ZodEnum<{
493
- claude: "claude";
494
- codex: "codex";
495
- }>;
496
- providerId: z.ZodNull;
497
- modelId: z.ZodString;
498
- }, z.core.$strict>, z.ZodObject<{
499
- lane: z.ZodLiteral<"byok">;
500
- runtimeId: z.ZodLiteral<"pi">;
501
- providerId: z.ZodString;
502
- modelId: z.ZodString;
503
- }, z.core.$strict>, z.ZodObject<{
504
- lane: z.ZodLiteral<"byok-profile">;
505
- runtimeId: z.ZodLiteral<"pi">;
506
- providerProfile: z.ZodObject<{
507
- profileRef: z.ZodString;
508
- profileRevision: z.ZodString;
509
- profileHash: z.ZodString;
510
- modelId: z.ZodString;
511
- requiredCapabilities: z.ZodArray<z.ZodEnum<{
512
- "image-input": "image-input";
513
- }>>;
514
- }, z.core.$strict>;
515
- }, z.core.$strict>], "lane">>;
516
- terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
517
- mode: z.ZodLiteral<"none">;
518
- }, z.core.$strict>, z.ZodObject<{
519
- mode: z.ZodLiteral<"result-document">;
520
- contract: z.ZodString;
521
- schema: z.ZodCustom<import("./result-schema").ResultSchema, import("./result-schema").ResultSchema>;
522
- }, z.core.$strict>], "mode">>;
523
- limits: z.ZodOptional<z.ZodObject<{
524
- maxDurationMs: z.ZodOptional<z.ZodNumber>;
525
- maxTokens: z.ZodOptional<z.ZodNumber>;
526
- }, z.core.$strip>>;
527
- preparation: z.ZodObject<{
528
- reference: z.ZodString;
529
- requestDigest: z.ZodString;
530
- artifactDigest: z.ZodOptional<z.ZodString>;
531
- }, z.core.$strict>;
532
- agentMemory: z.ZodEnum<{
533
- none: "none";
534
- read: "read";
535
- "read-write": "read-write";
536
- }>;
537
- egressPolicy: z.ZodObject<{
538
- policyRevision: z.ZodString;
539
- activity: z.ZodObject<{
540
- delivery: z.ZodLiteral<"latest-value">;
541
- maxCoalesceMs: z.ZodNumber;
542
- maxEventBytes: z.ZodNumber;
543
- }, z.core.$strict>;
544
- reliable: z.ZodObject<{
545
- maxPendingEventsPerAgent: z.ZodNumber;
546
- maxPendingBytesPerAgent: z.ZodNumber;
547
- maxPendingBytesPerTenant: z.ZodNumber;
548
- }, z.core.$strict>;
549
- transfers: z.ZodObject<{
550
- workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
551
- maxBytes: z.ZodNumber;
552
- allowedMimeTypes: z.ZodArray<z.ZodString>;
553
- }, z.core.$strict>]>;
554
- transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
555
- maxBytes: z.ZodNumber;
556
- allowedMimeTypes: z.ZodArray<z.ZodString>;
557
- }, z.core.$strict>]>;
558
- artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
559
- maxBytes: z.ZodNumber;
560
- allowedMimeTypes: z.ZodArray<z.ZodString>;
561
- }, z.core.$strict>]>;
562
- }, z.core.$strict>;
563
- }, z.core.$strict>;
564
- messageEgress: z.ZodOptional<z.ZodObject<{
565
- mode: z.ZodLiteral<"required">;
566
- contract: z.ZodString;
567
- contentType: z.ZodEnum<{
568
- "text/markdown": "text/markdown";
569
- "text/plain": "text/plain";
570
- }>;
571
- maxBytes: z.ZodNumber;
572
- }, z.core.$strict>>;
573
- }, z.core.$strict>;
574
- }, z.core.$strip>, z.ZodObject<{
575
- v: z.ZodNumber;
576
- id: z.ZodUUID;
577
- ts: z.ZodISODateTime;
578
- type: z.ZodLiteral<"agent.egress.ack">;
579
- task_id: z.ZodOptional<z.ZodString>;
580
- session_ref: z.ZodOptional<z.ZodString>;
581
- seq: z.ZodNumber;
582
- payload: z.ZodObject<{
583
- agentRef: z.ZodObject<{
584
- agentId: z.ZodString;
585
- profileRevision: z.ZodString;
586
- }, z.core.$strict>;
587
- sessionRef: z.ZodString;
588
- policyRevision: z.ZodString;
589
- eventId: z.ZodUUID;
590
- cursor: z.ZodNumber;
591
- receiptId: z.ZodUUID;
592
- }, z.core.$strict>;
593
- }, z.core.$strip>, z.ZodObject<{
594
- v: z.ZodNumber;
595
- id: z.ZodUUID;
596
- ts: z.ZodISODateTime;
597
- type: z.ZodLiteral<"agent.message.disposition">;
598
- task_id: z.ZodString;
599
- session_ref: z.ZodOptional<z.ZodString>;
600
- seq: z.ZodNumber;
601
- payload: z.ZodObject<{
602
- agentRef: z.ZodObject<{
603
- agentId: z.ZodString;
604
- profileRevision: z.ZodString;
605
- }, z.core.$strict>;
606
- sessionRef: z.ZodString;
607
- contract: z.ZodString;
608
- messageId: z.ZodUUID;
609
- cursor: z.ZodNumber;
610
- contentHash: z.ZodString;
611
- outcome: z.ZodEnum<{
612
- accepted: "accepted";
613
- held: "held";
614
- refused: "refused";
615
- }>;
616
- receiptId: z.ZodUUID;
617
- reasonCode: z.ZodOptional<z.ZodString>;
618
- }, z.core.$strict>;
619
- }, z.core.$strip>, z.ZodObject<{
620
- v: z.ZodNumber;
621
- id: z.ZodUUID;
622
- ts: z.ZodISODateTime;
623
- type: z.ZodLiteral<"agent.content.read">;
624
- task_id: z.ZodOptional<z.ZodString>;
625
- session_ref: z.ZodOptional<z.ZodString>;
626
- seq: z.ZodNumber;
627
- payload: z.ZodObject<{
628
- requestId: z.ZodUUID;
629
- surface: z.ZodEnum<{
630
- artifact: "artifact";
631
- transcript: "transcript";
632
- workspace: "workspace";
633
- }>;
634
- actor: z.ZodObject<{
635
- kind: z.ZodEnum<{
636
- agent: "agent";
637
- system: "system";
638
- user: "user";
639
- }>;
640
- id: z.ZodString;
641
- }, z.core.$strict>;
642
- agentRef: z.ZodObject<{
643
- agentId: z.ZodString;
644
- profileRevision: z.ZodString;
645
- }, z.core.$strict>;
646
- sessionRef: z.ZodString;
647
- runtime: z.ZodEnum<{
648
- claude: "claude";
649
- codex: "codex";
650
- pi: "pi";
651
- }>;
652
- cwd: z.ZodString;
653
- policyRevision: z.ZodString;
654
- target: z.ZodString;
655
- mimeType: z.ZodString;
656
- decodeAs: z.ZodEnum<{
657
- bytes: "bytes";
658
- utf8: "utf8";
659
- }>;
660
- policy: z.ZodObject<{
661
- maxBytes: z.ZodNumber;
662
- allowedMimeTypes: z.ZodArray<z.ZodString>;
663
- }, z.core.$strict>;
664
- }, z.core.$strict>;
665
- }, z.core.$strip>, z.ZodObject<{
666
- v: z.ZodNumber;
667
- id: z.ZodUUID;
668
- ts: z.ZodISODateTime;
669
- type: z.ZodLiteral<"agent.home.projection">;
670
- task_id: z.ZodOptional<z.ZodNever>;
671
- session_ref: z.ZodOptional<z.ZodString>;
672
- seq: z.ZodNumber;
673
- payload: z.ZodObject<{
674
- requestId: z.ZodUUID;
675
- agentRef: z.ZodObject<{
676
- agentId: z.ZodString;
677
- profileRevision: z.ZodString;
678
- }, z.core.$strict>;
679
- projectionHash: z.ZodString;
680
- projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
681
- }, z.core.$strict>;
682
- }, z.core.$strip>, z.ZodObject<{
683
- v: z.ZodNumber;
684
- id: z.ZodUUID;
685
- ts: z.ZodISODateTime;
686
- type: z.ZodLiteral<"agent.input.preparation">;
687
- task_id: z.ZodOptional<z.ZodNever>;
688
- session_ref: z.ZodOptional<z.ZodString>;
689
- seq: z.ZodNumber;
690
- payload: z.ZodObject<{
691
- agentMemory: z.ZodEnum<{
692
- none: "none";
693
- read: "read";
694
- "read-write": "read-write";
695
- }>;
696
- requestId: z.ZodUUID;
697
- agentRef: z.ZodObject<{
698
- agentId: z.ZodString;
699
- profileRevision: z.ZodString;
700
- }, z.core.$strict>;
701
- profileId: z.ZodString;
702
- policyRevision: z.ZodString;
703
- source: z.ZodObject<{
704
- revision: z.ZodString;
705
- digest: z.ZodString;
706
- }, z.core.$strict>;
707
- selection: z.ZodObject<{
708
- model: z.ZodObject<{
709
- id: z.ZodString;
710
- name: z.ZodString;
711
- api: z.ZodLiteral<"openai-completions">;
712
- provider: z.ZodString;
713
- baseUrl: z.ZodString;
714
- reasoning: z.ZodBoolean;
715
- input: z.ZodArray<z.ZodEnum<{
716
- image: "image";
717
- text: "text";
718
- }>>;
719
- cost: z.ZodObject<{
720
- input: z.ZodNumber;
721
- output: z.ZodNumber;
722
- cacheRead: z.ZodNumber;
723
- cacheWrite: z.ZodNumber;
724
- }, z.core.$strict>;
725
- contextWindow: z.ZodNumber;
726
- maxTokens: z.ZodNumber;
727
- thinkingLevelMap: z.ZodOptional<z.ZodObject<{
728
- off: z.ZodNullable<z.ZodString>;
729
- minimal: z.ZodNullable<z.ZodString>;
730
- low: z.ZodNullable<z.ZodString>;
731
- medium: z.ZodNullable<z.ZodString>;
732
- high: z.ZodNullable<z.ZodString>;
733
- xhigh: z.ZodNullable<z.ZodString>;
734
- max: z.ZodNullable<z.ZodString>;
735
- }, z.core.$strict>>;
736
- compat: z.ZodOptional<z.ZodObject<{
737
- supportsStore: z.ZodOptional<z.ZodBoolean>;
738
- supportsDeveloperRole: z.ZodOptional<z.ZodBoolean>;
739
- supportsReasoningEffort: z.ZodOptional<z.ZodBoolean>;
740
- supportsUsageInStreaming: z.ZodOptional<z.ZodBoolean>;
741
- maxTokensField: z.ZodOptional<z.ZodEnum<{
742
- max_completion_tokens: "max_completion_tokens";
743
- max_tokens: "max_tokens";
744
- }>>;
745
- thinkingFormat: z.ZodOptional<z.ZodEnum<{
746
- "ant-ling": "ant-ling";
747
- baseten: "baseten";
748
- "chat-template": "chat-template";
749
- deepseek: "deepseek";
750
- openai: "openai";
751
- openrouter: "openrouter";
752
- qwen: "qwen";
753
- "qwen-chat-template": "qwen-chat-template";
754
- "string-thinking": "string-thinking";
755
- together: "together";
756
- zai: "zai";
757
- }>>;
758
- zaiToolStream: z.ZodOptional<z.ZodBoolean>;
759
- }, z.core.$strict>>;
760
- }, z.core.$strict>;
761
- options: z.ZodObject<{
762
- cacheRetention: z.ZodEnum<{
763
- long: "long";
764
- none: "none";
765
- short: "short";
766
- }>;
767
- maxTokens: z.ZodNumber;
768
- temperature: z.ZodOptional<z.ZodNumber>;
769
- toolChoice: z.ZodOptional<z.ZodEnum<{
770
- auto: "auto";
771
- none: "none";
772
- }>>;
773
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
774
- high: "high";
775
- low: "low";
776
- max: "max";
777
- medium: "medium";
778
- minimal: "minimal";
779
- xhigh: "xhigh";
780
- }>>;
781
- }, z.core.$strict>;
782
- }, z.core.$strict>;
783
- deadlineAt: z.ZodISODateTime;
784
- context: z.ZodUnion<readonly [z.ZodObject<{
785
- inline: z.ZodString;
786
- }, z.core.$strict>, z.ZodObject<{
787
- blobRef: 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
- contentHash: z.ZodString;
795
- }, z.core.$strict>]>;
796
- requiredToolsets: z.ZodArray<z.ZodString>;
797
- accountingPolicyRef: z.ZodOptional<z.ZodObject<{
798
- revision: z.ZodString;
799
- ruledRuntime: z.ZodString;
800
- ruledTarget: z.ZodObject<{
801
- endpoint: z.ZodString;
802
- modelId: z.ZodString;
803
- }, z.core.$strict>;
804
- ruledResidualKeys: z.ZodArray<z.ZodString>;
805
- }, z.core.$strict>>;
806
- }, z.core.$strict>;
807
- }, z.core.$strip>, z.ZodObject<{
808
- v: z.ZodNumber;
809
- id: z.ZodUUID;
810
- ts: z.ZodISODateTime;
811
- type: z.ZodLiteral<"provider.provisioning.available">;
812
- task_id: z.ZodOptional<z.ZodNever>;
813
- session_ref: z.ZodOptional<z.ZodString>;
814
- seq: z.ZodNumber;
815
- payload: z.ZodObject<{
816
- requestId: z.ZodUUID;
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.memory.intent.available">;
823
- task_id: z.ZodOptional<z.ZodNever>;
824
- session_ref: z.ZodOptional<z.ZodString>;
825
- seq: z.ZodNumber;
826
- payload: z.ZodObject<{
827
- intentId: z.ZodUUID;
828
- agentRef: z.ZodObject<{
829
- agentId: z.ZodString;
830
- profileRevision: z.ZodString;
831
- }, z.core.$strict>;
832
- }, z.core.$strict>;
833
- }, z.core.$strip>, z.ZodObject<{
834
- v: z.ZodNumber;
835
- id: z.ZodUUID;
836
- ts: z.ZodISODateTime;
837
- type: z.ZodLiteral<"task.approve">;
838
- task_id: z.ZodString;
839
- session_ref: z.ZodOptional<z.ZodString>;
840
- seq: z.ZodNumber;
841
- payload: z.ZodObject<{
842
- approvalId: z.ZodOptional<z.ZodString>;
843
- }, z.core.$strip>;
844
- }, z.core.$strip>, z.ZodObject<{
845
- v: z.ZodNumber;
846
- id: z.ZodUUID;
847
- ts: z.ZodISODateTime;
848
- type: z.ZodLiteral<"task.reject">;
849
- task_id: z.ZodString;
850
- session_ref: z.ZodOptional<z.ZodString>;
851
- seq: z.ZodNumber;
852
- payload: z.ZodObject<{
853
- reason: z.ZodOptional<z.ZodString>;
854
- approvalId: z.ZodOptional<z.ZodString>;
855
- }, z.core.$strip>;
856
- }, z.core.$strip>, z.ZodObject<{
857
- v: z.ZodNumber;
858
- id: z.ZodUUID;
859
- ts: z.ZodISODateTime;
860
- type: z.ZodLiteral<"task.cancel">;
861
- task_id: z.ZodString;
862
- session_ref: z.ZodOptional<z.ZodString>;
863
- seq: z.ZodNumber;
864
- payload: z.ZodObject<{
865
- reason: z.ZodOptional<z.ZodString>;
866
- }, z.core.$strip>;
867
- }, z.core.$strip>, z.ZodObject<{
868
- v: z.ZodNumber;
869
- id: z.ZodUUID;
870
- ts: z.ZodISODateTime;
871
- type: z.ZodLiteral<"task.steer">;
872
- task_id: z.ZodString;
873
- session_ref: z.ZodOptional<z.ZodString>;
874
- seq: z.ZodNumber;
875
- payload: z.ZodObject<{
876
- text: z.ZodString;
877
- }, z.core.$strip>;
878
- }, z.core.$strip>, z.ZodObject<{
879
- v: z.ZodNumber;
880
- id: z.ZodUUID;
881
- ts: z.ZodISODateTime;
882
- type: z.ZodLiteral<"task.claim">;
883
- task_id: z.ZodString;
884
- session_ref: z.ZodOptional<z.ZodString>;
885
- seq: z.ZodOptional<z.ZodNumber>;
886
- payload: z.ZodObject<{
887
- deviceId: z.ZodString;
888
- agentId: z.ZodOptional<z.ZodString>;
889
- agentRef: z.ZodOptional<z.ZodObject<{
890
- agentId: z.ZodString;
891
- profileRevision: z.ZodString;
892
- }, z.core.$strict>>;
893
- runtime: z.ZodOptional<z.ZodEnum<{
894
- claude: "claude";
895
- codex: "codex";
896
- pi: "pi";
897
- }>>;
898
- harnessId: z.ZodOptional<z.ZodString>;
899
- capabilities: z.ZodOptional<z.ZodObject<{
900
- steer: z.ZodOptional<z.ZodBoolean>;
901
- resume: z.ZodOptional<z.ZodBoolean>;
902
- approvalInteractive: z.ZodOptional<z.ZodBoolean>;
903
- mcpToolsets: z.ZodOptional<z.ZodBoolean>;
904
- messageDraft: z.ZodOptional<z.ZodBoolean>;
905
- }, z.core.$strip>>;
906
- }, z.core.$strip>;
907
- }, z.core.$strip>, z.ZodObject<{
908
- v: z.ZodNumber;
909
- id: z.ZodUUID;
910
- ts: z.ZodISODateTime;
911
- type: z.ZodLiteral<"task.started">;
912
- task_id: z.ZodString;
913
- session_ref: z.ZodOptional<z.ZodString>;
914
- seq: z.ZodOptional<z.ZodNumber>;
915
- payload: z.ZodObject<{}, z.core.$strip>;
916
- }, z.core.$strip>, z.ZodObject<{
917
- v: z.ZodNumber;
918
- id: z.ZodUUID;
919
- ts: z.ZodISODateTime;
920
- type: z.ZodLiteral<"task.decline">;
921
- task_id: z.ZodString;
922
- session_ref: z.ZodOptional<z.ZodString>;
923
- seq: z.ZodOptional<z.ZodNumber>;
924
- payload: z.ZodObject<{
925
- reason: z.ZodString;
926
- retryable: z.ZodOptional<z.ZodBoolean>;
927
- agentRef: z.ZodOptional<z.ZodObject<{
928
- agentId: z.ZodString;
929
- profileRevision: z.ZodString;
930
- }, z.core.$strict>>;
931
- code: z.ZodOptional<z.ZodEnum<{
932
- agent_home_reader_busy: "agent_home_reader_busy";
933
- agent_home_writer_busy: "agent_home_writer_busy";
934
- }>>;
935
- }, z.core.$strip>;
936
- }, z.core.$strip>, z.ZodObject<{
937
- v: z.ZodNumber;
938
- id: z.ZodUUID;
939
- ts: z.ZodISODateTime;
940
- type: z.ZodLiteral<"task.progress">;
941
- task_id: z.ZodString;
942
- session_ref: z.ZodOptional<z.ZodString>;
943
- seq: z.ZodOptional<z.ZodNumber>;
944
- payload: z.ZodObject<{
945
- seq: z.ZodNumber;
946
- events: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
947
- type: z.ZodLiteral<"progress">;
948
- text: z.ZodString;
949
- }, z.core.$strip>, z.ZodObject<{
950
- type: z.ZodLiteral<"tool_use">;
951
- tool: z.ZodString;
952
- mcp: z.ZodOptional<z.ZodObject<{
953
- server: z.ZodString;
954
- tool: z.ZodString;
955
- }, z.core.$strict>>;
956
- input: z.ZodOptional<z.ZodUnknown>;
957
- toolCallId: z.ZodOptional<z.ZodString>;
958
- spill: z.ZodOptional<z.ZodObject<{
959
- field: z.ZodEnum<{
960
- input: "input";
961
- output: "output";
962
- }>;
963
- totalBytes: z.ZodNumber;
964
- omittedBytes: z.ZodNumber;
965
- contentType: z.ZodLiteral<"application/json">;
966
- blob: z.ZodOptional<z.ZodObject<{
967
- blobId: z.ZodString;
968
- contentHash: z.ZodString;
969
- size: z.ZodNumber;
970
- contentType: z.ZodString;
971
- url: z.ZodOptional<z.ZodString>;
972
- }, z.core.$strip>>;
973
- unstoredReason: z.ZodOptional<z.ZodString>;
974
- }, z.core.$strict>>;
975
- }, z.core.$strip>, z.ZodObject<{
976
- type: z.ZodLiteral<"tool_result">;
977
- tool: z.ZodString;
978
- mcp: z.ZodOptional<z.ZodObject<{
979
- server: z.ZodString;
980
- tool: z.ZodString;
981
- }, z.core.$strict>>;
982
- output: z.ZodOptional<z.ZodUnknown>;
983
- toolCallId: z.ZodOptional<z.ZodString>;
984
- isError: z.ZodOptional<z.ZodBoolean>;
985
- spill: z.ZodOptional<z.ZodObject<{
986
- field: z.ZodEnum<{
987
- input: "input";
988
- output: "output";
989
- }>;
990
- totalBytes: z.ZodNumber;
991
- omittedBytes: z.ZodNumber;
992
- contentType: z.ZodLiteral<"application/json">;
993
- blob: z.ZodOptional<z.ZodObject<{
994
- blobId: z.ZodString;
995
- contentHash: z.ZodString;
996
- size: z.ZodNumber;
997
- contentType: z.ZodString;
998
- url: z.ZodOptional<z.ZodString>;
999
- }, z.core.$strip>>;
1000
- unstoredReason: z.ZodOptional<z.ZodString>;
1001
- }, z.core.$strict>>;
1002
- }, z.core.$strip>, z.ZodObject<{
1003
- type: z.ZodLiteral<"artifact">;
1004
- name: z.ZodString;
1005
- contentType: z.ZodString;
1006
- }, z.core.$strip>, z.ZodObject<{
1007
- type: z.ZodLiteral<"needs_approval">;
1008
- summary: z.ZodString;
1009
- }, z.core.$strip>, z.ZodObject<{
1010
- type: z.ZodLiteral<"turn_end">;
1011
- }, z.core.$strip>, z.ZodObject<{
1012
- type: z.ZodLiteral<"error">;
1013
- message: z.ZodString;
1014
- }, z.core.$strip>, z.ZodObject<{
1015
- type: z.ZodLiteral<"usage">;
1016
- inputTokens: z.ZodOptional<z.ZodNumber>;
1017
- cachedInputTokens: z.ZodOptional<z.ZodNumber>;
1018
- outputTokens: z.ZodOptional<z.ZodNumber>;
1019
- reasoningTokens: z.ZodOptional<z.ZodNumber>;
1020
- totalTokens: z.ZodOptional<z.ZodNumber>;
1021
- contextTokens: z.ZodOptional<z.ZodNumber>;
1022
- contextWindow: z.ZodOptional<z.ZodNumber>;
1023
- contextSource: z.ZodOptional<z.ZodEnum<{
1024
- estimate: "estimate";
1025
- provider: "provider";
1026
- }>>;
1027
- }, z.core.$strip>], "type">, z.ZodObject<{
1028
- type: z.ZodString;
1029
- }, z.core.$loose>]>>;
1030
- }, z.core.$strip>;
1031
- }, z.core.$strip>, z.ZodObject<{
1032
- v: z.ZodNumber;
1033
- id: z.ZodUUID;
1034
- ts: z.ZodISODateTime;
1035
- type: z.ZodLiteral<"task.artifact">;
1036
- task_id: z.ZodString;
1037
- session_ref: z.ZodOptional<z.ZodString>;
1038
- seq: z.ZodOptional<z.ZodNumber>;
1039
- payload: z.ZodObject<{
1040
- name: z.ZodString;
1041
- contentType: z.ZodString;
1042
- inline: z.ZodOptional<z.ZodString>;
1043
- blobRef: z.ZodOptional<z.ZodObject<{
1044
- blobId: z.ZodString;
1045
- contentHash: z.ZodString;
1046
- size: z.ZodNumber;
1047
- contentType: z.ZodString;
1048
- url: z.ZodOptional<z.ZodString>;
1049
- }, z.core.$strip>>;
1050
- }, z.core.$strip>;
1051
- }, z.core.$strip>, z.ZodObject<{
1052
- v: z.ZodNumber;
1053
- id: z.ZodUUID;
1054
- ts: z.ZodISODateTime;
1055
- type: z.ZodLiteral<"task.await_approval">;
1056
- task_id: z.ZodString;
1057
- session_ref: z.ZodOptional<z.ZodString>;
1058
- seq: z.ZodOptional<z.ZodNumber>;
1059
- payload: z.ZodObject<{
1060
- summary: z.ZodString;
1061
- approvalId: z.ZodOptional<z.ZodString>;
1062
- }, z.core.$strip>;
1063
- }, z.core.$strip>, z.ZodObject<{
1064
- v: z.ZodNumber;
1065
- id: z.ZodUUID;
1066
- ts: z.ZodISODateTime;
1067
- type: z.ZodLiteral<"task.complete">;
1068
- task_id: z.ZodString;
1069
- session_ref: z.ZodOptional<z.ZodString>;
1070
- seq: z.ZodOptional<z.ZodNumber>;
1071
- payload: z.ZodObject<{
1072
- harnessId: z.ZodOptional<z.ZodString>;
1073
- summary: z.ZodString;
1074
- finalMessage: z.ZodOptional<z.ZodString>;
1075
- sessionRef: z.ZodString;
1076
- artifactRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1077
- blobId: z.ZodString;
1078
- contentHash: z.ZodString;
1079
- size: z.ZodNumber;
1080
- contentType: z.ZodString;
1081
- url: z.ZodOptional<z.ZodString>;
1082
- }, z.core.$strip>>>;
1083
- document: z.ZodOptional<z.ZodUnknown>;
1084
- usage: z.ZodOptional<z.ZodObject<{
1085
- runtime: z.ZodEnum<{
1086
- claude: "claude";
1087
- codex: "codex";
1088
- pi: "pi";
1089
- }>;
1090
- provider: z.ZodOptional<z.ZodString>;
1091
- model: z.ZodOptional<z.ZodString>;
1092
- promptTokens: z.ZodOptional<z.ZodNumber>;
1093
- completionTokens: z.ZodOptional<z.ZodNumber>;
1094
- durationMs: z.ZodOptional<z.ZodNumber>;
1095
- clientVersion: z.ZodString;
1096
- reportedAt: z.ZodISODateTime;
1097
- }, z.core.$strip>>;
1098
- preparedObservation: z.ZodOptional<z.ZodObject<{
1099
- requestDigest: z.ZodString;
1100
- initialPromptTokens: z.ZodNumber;
1101
- maxPromptTokens: z.ZodNumber;
1102
- }, z.core.$strict>>;
1103
- agentRef: z.ZodOptional<z.ZodObject<{
1104
- agentId: z.ZodString;
1105
- profileRevision: z.ZodString;
1106
- }, z.core.$strict>>;
1107
- agentHomeProjection: z.ZodOptional<z.ZodObject<{
1108
- profileRevision: z.ZodString;
1109
- projectionHash: z.ZodString;
1110
- }, z.core.$strict>>;
1111
- agentHomeMemoryChange: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1112
- outcome: z.ZodLiteral<"unchanged">;
1113
- }, z.core.$strict>, z.ZodObject<{
1114
- outcome: z.ZodLiteral<"reader-attributed">;
1115
- paths: z.ZodArray<z.ZodString>;
1116
- }, z.core.$strict>, z.ZodObject<{
1117
- outcome: z.ZodLiteral<"unattributed">;
1118
- paths: z.ZodArray<z.ZodString>;
1119
- }, z.core.$strict>, z.ZodObject<{
1120
- outcome: z.ZodLiteral<"unmeasured">;
1121
- }, z.core.$strict>], "outcome">>;
1122
- }, z.core.$strip>;
1123
- }, z.core.$strip>, z.ZodObject<{
1124
- v: z.ZodNumber;
1125
- id: z.ZodUUID;
1126
- ts: z.ZodISODateTime;
1127
- type: z.ZodLiteral<"task.fail">;
1128
- task_id: z.ZodString;
1129
- session_ref: z.ZodOptional<z.ZodString>;
1130
- seq: z.ZodOptional<z.ZodNumber>;
1131
- payload: z.ZodObject<{
1132
- recovery: z.ZodOptional<z.ZodObject<{
1133
- kind: z.ZodLiteral<"daemon_interrupted">;
1134
- offerId: z.ZodUUID;
1135
- }, z.core.$strict>>;
1136
- harnessId: z.ZodOptional<z.ZodString>;
1137
- reason: z.ZodString;
1138
- retryable: z.ZodOptional<z.ZodBoolean>;
1139
- usage: z.ZodOptional<z.ZodObject<{
1140
- runtime: z.ZodEnum<{
1141
- claude: "claude";
1142
- codex: "codex";
1143
- pi: "pi";
1144
- }>;
1145
- provider: z.ZodOptional<z.ZodString>;
1146
- model: z.ZodOptional<z.ZodString>;
1147
- promptTokens: z.ZodOptional<z.ZodNumber>;
1148
- completionTokens: z.ZodOptional<z.ZodNumber>;
1149
- durationMs: z.ZodOptional<z.ZodNumber>;
1150
- clientVersion: z.ZodString;
1151
- reportedAt: z.ZodISODateTime;
1152
- }, z.core.$strip>>;
1153
- preparedObservation: z.ZodOptional<z.ZodObject<{
1154
- requestDigest: z.ZodString;
1155
- initialPromptTokens: z.ZodNumber;
1156
- maxPromptTokens: z.ZodNumber;
1157
- }, z.core.$strict>>;
1158
- agentRef: z.ZodOptional<z.ZodObject<{
1159
- agentId: z.ZodString;
1160
- profileRevision: z.ZodString;
1161
- }, z.core.$strict>>;
1162
- agentHomeProjection: z.ZodOptional<z.ZodObject<{
1163
- profileRevision: z.ZodString;
1164
- projectionHash: z.ZodString;
1165
- }, z.core.$strict>>;
1166
- agentHomeMemoryChange: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1167
- outcome: z.ZodLiteral<"unchanged">;
1168
- }, z.core.$strict>, z.ZodObject<{
1169
- outcome: z.ZodLiteral<"reader-attributed">;
1170
- paths: z.ZodArray<z.ZodString>;
1171
- }, z.core.$strict>, z.ZodObject<{
1172
- outcome: z.ZodLiteral<"unattributed">;
1173
- paths: z.ZodArray<z.ZodString>;
1174
- }, z.core.$strict>, z.ZodObject<{
1175
- outcome: z.ZodLiteral<"unmeasured">;
1176
- }, z.core.$strict>], "outcome">>;
1177
- }, z.core.$strip>;
1178
- }, z.core.$strip>, z.ZodObject<{
1179
- v: z.ZodNumber;
1180
- id: z.ZodUUID;
1181
- ts: z.ZodISODateTime;
1182
- type: z.ZodLiteral<"task.cancelled">;
1183
- task_id: z.ZodString;
1184
- session_ref: z.ZodOptional<z.ZodString>;
1185
- seq: z.ZodOptional<z.ZodNumber>;
1186
- payload: z.ZodObject<{
1187
- harnessId: z.ZodOptional<z.ZodString>;
1188
- reason: z.ZodOptional<z.ZodString>;
1189
- usage: z.ZodOptional<z.ZodObject<{
1190
- runtime: z.ZodEnum<{
1191
- claude: "claude";
1192
- codex: "codex";
1193
- pi: "pi";
1194
- }>;
1195
- provider: z.ZodOptional<z.ZodString>;
1196
- model: z.ZodOptional<z.ZodString>;
1197
- promptTokens: z.ZodOptional<z.ZodNumber>;
1198
- completionTokens: z.ZodOptional<z.ZodNumber>;
1199
- durationMs: z.ZodOptional<z.ZodNumber>;
1200
- clientVersion: z.ZodString;
1201
- reportedAt: z.ZodISODateTime;
1202
- }, z.core.$strip>>;
1203
- agentRef: z.ZodOptional<z.ZodObject<{
1204
- agentId: z.ZodString;
1205
- profileRevision: z.ZodString;
1206
- }, z.core.$strict>>;
1207
- agentHomeProjection: z.ZodOptional<z.ZodObject<{
1208
- profileRevision: z.ZodString;
1209
- projectionHash: z.ZodString;
1210
- }, z.core.$strict>>;
1211
- agentHomeMemoryChange: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1212
- outcome: z.ZodLiteral<"unchanged">;
1213
- }, z.core.$strict>, z.ZodObject<{
1214
- outcome: z.ZodLiteral<"reader-attributed">;
1215
- paths: z.ZodArray<z.ZodString>;
1216
- }, z.core.$strict>, z.ZodObject<{
1217
- outcome: z.ZodLiteral<"unattributed">;
1218
- paths: z.ZodArray<z.ZodString>;
1219
- }, z.core.$strict>, z.ZodObject<{
1220
- outcome: z.ZodLiteral<"unmeasured">;
1221
- }, z.core.$strict>], "outcome">>;
1222
- }, z.core.$strip>;
1223
- }, z.core.$strip>, z.ZodObject<{
1224
- v: z.ZodNumber;
1225
- id: z.ZodUUID;
1226
- ts: z.ZodISODateTime;
1227
- type: z.ZodLiteral<"task.approval_resolved">;
1228
- task_id: z.ZodString;
1229
- session_ref: z.ZodOptional<z.ZodString>;
1230
- seq: z.ZodOptional<z.ZodNumber>;
1231
- payload: z.ZodObject<{
1232
- approvalId: z.ZodString;
1233
- decision: z.ZodEnum<{
1234
- approve: "approve";
1235
- reject: "reject";
1236
- }>;
1237
- resolvedBy: z.ZodEnum<{
1238
- local: "local";
1239
- }>;
1240
- at: z.ZodISODateTime;
1241
- }, z.core.$strip>;
1242
- }, z.core.$strip>, z.ZodObject<{
1243
- v: z.ZodNumber;
1244
- id: z.ZodUUID;
1245
- ts: z.ZodISODateTime;
1246
- type: z.ZodLiteral<"agent.egress.reliable">;
1247
- task_id: z.ZodOptional<z.ZodString>;
1248
- session_ref: z.ZodOptional<z.ZodString>;
1249
- seq: z.ZodOptional<z.ZodNumber>;
1250
- payload: z.ZodObject<{
1251
- agentRef: z.ZodObject<{
1252
- agentId: z.ZodString;
1253
- profileRevision: z.ZodString;
1254
- }, z.core.$strict>;
1255
- sessionRef: z.ZodString;
1256
- policyRevision: z.ZodString;
1257
- eventId: z.ZodUUID;
1258
- cursor: z.ZodNumber;
1259
- payload: z.ZodJSONSchema;
1260
- contentHash: z.ZodString;
1261
- byteCount: z.ZodNumber;
1262
- }, z.core.$strict>;
1263
- }, z.core.$strip>, z.ZodObject<{
1264
- v: z.ZodNumber;
1265
- id: z.ZodUUID;
1266
- ts: z.ZodISODateTime;
1267
- type: z.ZodLiteral<"agent.message.draft">;
1268
- task_id: z.ZodString;
1269
- session_ref: z.ZodOptional<z.ZodString>;
1270
- seq: z.ZodOptional<z.ZodNumber>;
1271
- payload: z.ZodObject<{
1272
- agentRef: z.ZodObject<{
1273
- agentId: z.ZodString;
1274
- profileRevision: z.ZodString;
1275
- }, z.core.$strict>;
1276
- revision: z.ZodNumber;
1277
- offset: z.ZodNumber;
1278
- text: z.ZodString;
1279
- overflow: z.ZodOptional<z.ZodLiteral<true>>;
1280
- }, z.core.$strict>;
1281
- }, z.core.$strip>, z.ZodObject<{
1282
- v: z.ZodNumber;
1283
- id: z.ZodUUID;
1284
- ts: z.ZodISODateTime;
1285
- type: z.ZodLiteral<"agent.message.publish">;
1286
- task_id: z.ZodString;
1287
- session_ref: z.ZodOptional<z.ZodString>;
1288
- seq: z.ZodOptional<z.ZodNumber>;
1289
- payload: z.ZodObject<{
1290
- agentRef: z.ZodObject<{
1291
- agentId: z.ZodString;
1292
- profileRevision: z.ZodString;
1293
- }, z.core.$strict>;
1294
- sessionRef: z.ZodString;
1295
- contract: z.ZodString;
1296
- messageId: z.ZodUUID;
1297
- cursor: z.ZodNumber;
1298
- contentType: z.ZodEnum<{
1299
- "text/markdown": "text/markdown";
1300
- "text/plain": "text/plain";
1301
- }>;
1302
- body: z.ZodString;
1303
- contentHash: z.ZodString;
1304
- byteCount: z.ZodNumber;
1305
- }, z.core.$strict>;
1306
- }, z.core.$strip>, z.ZodObject<{
1307
- v: z.ZodNumber;
1308
- id: z.ZodUUID;
1309
- ts: z.ZodISODateTime;
1310
- type: z.ZodLiteral<"agent.content.receipt">;
1311
- task_id: z.ZodOptional<z.ZodString>;
1312
- session_ref: z.ZodOptional<z.ZodString>;
1313
- seq: z.ZodOptional<z.ZodNumber>;
1314
- payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
1315
- requestId: z.ZodUUID;
1316
- eventId: z.ZodUUID;
1317
- cursor: z.ZodNumber;
1318
- surface: z.ZodEnum<{
1319
- artifact: "artifact";
1320
- transcript: "transcript";
1321
- workspace: "workspace";
1322
- }>;
1323
- actor: z.ZodObject<{
1324
- kind: z.ZodEnum<{
1325
- agent: "agent";
1326
- system: "system";
1327
- user: "user";
1328
- }>;
1329
- id: z.ZodString;
1330
- }, z.core.$strict>;
1331
- agentRef: z.ZodObject<{
1332
- agentId: z.ZodString;
1333
- profileRevision: z.ZodString;
1334
- }, z.core.$strict>;
1335
- sessionRef: z.ZodString;
1336
- runtime: z.ZodEnum<{
1337
- claude: "claude";
1338
- codex: "codex";
1339
- pi: "pi";
1340
- }>;
1341
- cwd: z.ZodString;
1342
- policyRevision: z.ZodString;
1343
- target: z.ZodString;
1344
- mimeType: z.ZodString;
1345
- decodeAs: z.ZodEnum<{
1346
- bytes: "bytes";
1347
- utf8: "utf8";
1348
- }>;
1349
- decision: z.ZodLiteral<"allowed">;
1350
- byteCount: z.ZodNumber;
1351
- contentHash: z.ZodString;
1352
- blobRef: z.ZodObject<{
1353
- blobId: z.ZodString;
1354
- contentHash: z.ZodString;
1355
- size: z.ZodNumber;
1356
- contentType: z.ZodString;
1357
- url: z.ZodOptional<z.ZodString>;
1358
- }, z.core.$strip>;
1359
- }, z.core.$strict>, z.ZodObject<{
1360
- requestId: z.ZodUUID;
1361
- eventId: z.ZodUUID;
1362
- cursor: z.ZodNumber;
1363
- surface: z.ZodEnum<{
1364
- artifact: "artifact";
1365
- transcript: "transcript";
1366
- workspace: "workspace";
1367
- }>;
1368
- actor: z.ZodObject<{
1369
- kind: z.ZodEnum<{
1370
- agent: "agent";
1371
- system: "system";
1372
- user: "user";
1373
- }>;
1374
- id: z.ZodString;
1375
- }, z.core.$strict>;
1376
- agentRef: z.ZodObject<{
1377
- agentId: z.ZodString;
1378
- profileRevision: z.ZodString;
1379
- }, z.core.$strict>;
1380
- sessionRef: z.ZodString;
1381
- runtime: z.ZodEnum<{
1382
- claude: "claude";
1383
- codex: "codex";
1384
- pi: "pi";
1385
- }>;
1386
- cwd: z.ZodString;
1387
- policyRevision: z.ZodString;
1388
- target: z.ZodString;
1389
- mimeType: z.ZodString;
1390
- decodeAs: z.ZodEnum<{
1391
- bytes: "bytes";
1392
- utf8: "utf8";
1393
- }>;
1394
- decision: z.ZodLiteral<"denied">;
1395
- byteCount: z.ZodLiteral<0>;
1396
- reason: z.ZodEnum<{
1397
- "absolute-target": "absolute-target";
1398
- "byte-limit": "byte-limit";
1399
- "capability-missing": "capability-missing";
1400
- "dot-segment": "dot-segment";
1401
- "identity-mismatch": "identity-mismatch";
1402
- "invalid-request": "invalid-request";
1403
- "mime-not-allowlisted": "mime-not-allowlisted";
1404
- "non-relative-target": "non-relative-target";
1405
- "not-regular-file": "not-regular-file";
1406
- "path-escape": "path-escape";
1407
- "policy-disabled": "policy-disabled";
1408
- "policy-revision-mismatch": "policy-revision-mismatch";
1409
- "root-invalid": "root-invalid";
1410
- "root-not-allowlisted": "root-not-allowlisted";
1411
- "sensitive-name": "sensitive-name";
1412
- symlink: "symlink";
1413
- "target-missing": "target-missing";
1414
- "text-decode-failed": "text-decode-failed";
1415
- "text-not-allowlisted": "text-not-allowlisted";
1416
- }>;
1417
- }, z.core.$strict>], "decision">;
1418
- }, z.core.$strip>], "type">;
34
+ export declare const EnvelopeSchema: z.ZodDiscriminatedUnion<[EnvelopeShape<"conn.hello", z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"conn.ack", z.ZodOptional<z.ZodString>, z.ZodNumber>, EnvelopeShape<"task.offer", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_with_toolsets", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_for_agent", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_for_agent_with_egress", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_for_agent_with_egress_fresh", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_prepared", z.ZodString, z.ZodNumber>, EnvelopeShape<"agent.egress.ack", z.ZodOptional<z.ZodString>, z.ZodNumber>, EnvelopeShape<"agent.message.disposition", z.ZodString, z.ZodNumber>, EnvelopeShape<"agent.content.read", z.ZodOptional<z.ZodString>, z.ZodNumber>, EnvelopeShape<"agent.home.projection", z.ZodOptional<z.ZodNever>, z.ZodNumber>, EnvelopeShape<"agent.input.preparation", z.ZodOptional<z.ZodNever>, z.ZodNumber>, EnvelopeShape<"provider.provisioning.available", z.ZodOptional<z.ZodNever>, z.ZodNumber>, EnvelopeShape<"agent.memory.intent.available", z.ZodOptional<z.ZodNever>, z.ZodNumber>, EnvelopeShape<"task.approve", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.reject", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.cancel", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.steer", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.claim", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.started", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.decline", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.progress", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.artifact", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.await_approval", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.complete", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.fail", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.cancelled", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.approval_resolved", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"agent.egress.reliable", z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"agent.message.draft", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"agent.message.publish", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"agent.content.receipt", z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.offer_sealed", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_with_toolsets_sealed", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_for_agent_sealed", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_for_agent_with_egress_sealed", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.offer_for_agent_with_egress_fresh_sealed", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.steer_sealed", z.ZodString, z.ZodNumber>, EnvelopeShape<"task.complete_sealed", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.fail_sealed", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.decline_sealed", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.cancelled_sealed", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.progress_sealed", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.artifact_sealed", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"task.await_approval_sealed", z.ZodString, z.ZodOptional<z.ZodNumber>>, EnvelopeShape<"e2ee.key_package.available", z.ZodOptional<z.ZodNever>, z.ZodNumber>], "type">;
1419
35
  export type Envelope = z.infer<typeof EnvelopeSchema>;
1420
36
  /** `true` for every message type the server sends to the daemon (envelope `seq` is required for these). */
1421
37
  export declare function isServerToDaemonType(type: MessageType): boolean;
38
+ export {};