@byok-sdk/protocol 0.6.0 → 0.7.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.
@@ -71,6 +71,17 @@ export declare const CONFIGURED_TOOLSETS_MAX_ITEMS = 64;
71
71
  */
72
72
  export declare const ToolsetIdSchema: z.ZodString;
73
73
  export type ToolsetId = z.infer<typeof ToolsetIdSchema>;
74
+ /** Stable Agent identity carried across transport and storage. */
75
+ export declare const AGENT_REF_MAX_BYTES = 160;
76
+ /**
77
+ * Agent ids are opaque to the SDK but must remain one safe pathname segment;
78
+ * the SDK owns the deterministic `<hostStorageRoot>/agents/<agentId>` mapping.
79
+ */
80
+ export declare const AgentRefSchema: z.ZodObject<{
81
+ agentId: z.ZodString;
82
+ profileRevision: z.ZodString;
83
+ }, z.core.$strict>;
84
+ export type AgentRef = z.infer<typeof AgentRefSchema>;
74
85
  /**
75
86
  * Device-local inventory projected for discovery. IDs only: executable MCP
76
87
  * definitions, arguments, environment and credentials never enter this shape.
@@ -248,6 +259,327 @@ export declare const TaskOfferWithToolsetsPayloadSchema: z.ZodObject<{
248
259
  requiredToolsets: z.ZodArray<z.ZodString>;
249
260
  }, z.core.$strict>;
250
261
  export type TaskOfferWithToolsetsPayload = z.infer<typeof TaskOfferWithToolsetsPayloadSchema>;
262
+ /**
263
+ * Strict additive offer for a durable host-owned Agent. An older daemon that
264
+ * does not advertise `agent-home-contract` skips this distinct message type
265
+ * instead of stripping identity and applying legacy workspace semantics.
266
+ */
267
+ export declare const TaskOfferForAgentPayloadSchema: z.ZodObject<{
268
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
269
+ blobRef: z.ZodObject<{
270
+ blobId: z.ZodString;
271
+ contentHash: z.ZodString;
272
+ size: z.ZodNumber;
273
+ contentType: z.ZodString;
274
+ url: z.ZodOptional<z.ZodString>;
275
+ }, z.core.$strip>;
276
+ }, z.core.$strict>]>;
277
+ policy: z.ZodObject<{
278
+ mode: z.ZodEnum<{
279
+ auto: "auto";
280
+ confirm: "confirm";
281
+ plan: "plan";
282
+ readonly: "readonly";
283
+ }>;
284
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
285
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
286
+ workspaceRoot: z.ZodOptional<z.ZodString>;
287
+ network: z.ZodOptional<z.ZodBoolean>;
288
+ }, z.core.$strict>;
289
+ agentRef: z.ZodObject<{
290
+ agentId: z.ZodString;
291
+ profileRevision: z.ZodString;
292
+ }, z.core.$strict>;
293
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
294
+ runtime: z.ZodOptional<z.ZodEnum<{
295
+ claude: "claude";
296
+ codex: "codex";
297
+ pi: "pi";
298
+ }>>;
299
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
300
+ lane: z.ZodLiteral<"subscription">;
301
+ runtimeId: z.ZodEnum<{
302
+ claude: "claude";
303
+ codex: "codex";
304
+ }>;
305
+ providerId: z.ZodNull;
306
+ modelId: z.ZodString;
307
+ }, z.core.$strict>, z.ZodObject<{
308
+ lane: z.ZodLiteral<"byok">;
309
+ runtimeId: z.ZodLiteral<"pi">;
310
+ providerId: z.ZodString;
311
+ modelId: z.ZodString;
312
+ }, z.core.$strict>], "lane">>;
313
+ sessionRef: z.ZodOptional<z.ZodString>;
314
+ limits: z.ZodOptional<z.ZodObject<{
315
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
316
+ maxTokens: z.ZodOptional<z.ZodNumber>;
317
+ }, z.core.$strip>>;
318
+ }, z.core.$strict>;
319
+ export type TaskOfferForAgentPayload = z.infer<typeof TaskOfferForAgentPayloadSchema>;
320
+ /**
321
+ * Strict Agent offer which consumes the typed egress policy. It is a distinct
322
+ * message so an older Agent-home daemon cannot strip control data and proceed
323
+ * with an unconsumed egress declaration.
324
+ */
325
+ export declare const TaskOfferForAgentWithEgressPayloadSchema: z.ZodObject<{
326
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
327
+ blobRef: z.ZodObject<{
328
+ blobId: z.ZodString;
329
+ contentHash: z.ZodString;
330
+ size: z.ZodNumber;
331
+ contentType: z.ZodString;
332
+ url: z.ZodOptional<z.ZodString>;
333
+ }, z.core.$strip>;
334
+ }, z.core.$strict>]>;
335
+ policy: z.ZodObject<{
336
+ mode: z.ZodEnum<{
337
+ auto: "auto";
338
+ confirm: "confirm";
339
+ plan: "plan";
340
+ readonly: "readonly";
341
+ }>;
342
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
343
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
+ workspaceRoot: z.ZodOptional<z.ZodString>;
345
+ network: z.ZodOptional<z.ZodBoolean>;
346
+ }, z.core.$strict>;
347
+ agentRef: z.ZodObject<{
348
+ agentId: z.ZodString;
349
+ profileRevision: z.ZodString;
350
+ }, z.core.$strict>;
351
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
352
+ runtime: z.ZodOptional<z.ZodEnum<{
353
+ claude: "claude";
354
+ codex: "codex";
355
+ pi: "pi";
356
+ }>>;
357
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
358
+ lane: z.ZodLiteral<"subscription">;
359
+ runtimeId: z.ZodEnum<{
360
+ claude: "claude";
361
+ codex: "codex";
362
+ }>;
363
+ providerId: z.ZodNull;
364
+ modelId: z.ZodString;
365
+ }, z.core.$strict>, z.ZodObject<{
366
+ lane: z.ZodLiteral<"byok">;
367
+ runtimeId: z.ZodLiteral<"pi">;
368
+ providerId: z.ZodString;
369
+ modelId: z.ZodString;
370
+ }, z.core.$strict>], "lane">>;
371
+ limits: z.ZodOptional<z.ZodObject<{
372
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
373
+ maxTokens: z.ZodOptional<z.ZodNumber>;
374
+ }, z.core.$strip>>;
375
+ sessionRef: z.ZodString;
376
+ egressPolicy: z.ZodObject<{
377
+ policyRevision: z.ZodString;
378
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
379
+ mode: z.ZodLiteral<"metadata-status">;
380
+ delivery: z.ZodLiteral<"latest-value">;
381
+ }, z.core.$strict>, z.ZodObject<{
382
+ mode: z.ZodLiteral<"contentful-trajectory">;
383
+ delivery: z.ZodLiteral<"latest-value">;
384
+ maxCoalesceMs: z.ZodNumber;
385
+ maxEventBytes: z.ZodNumber;
386
+ }, z.core.$strict>], "mode">;
387
+ reliable: z.ZodObject<{
388
+ maxPendingEventsPerAgent: z.ZodNumber;
389
+ maxPendingBytesPerAgent: z.ZodNumber;
390
+ maxPendingBytesPerTenant: z.ZodNumber;
391
+ }, z.core.$strict>;
392
+ transfers: z.ZodObject<{
393
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
394
+ maxBytes: z.ZodNumber;
395
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
396
+ }, z.core.$strict>]>;
397
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
398
+ maxBytes: z.ZodNumber;
399
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
400
+ }, z.core.$strict>]>;
401
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
402
+ maxBytes: z.ZodNumber;
403
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
404
+ }, z.core.$strict>]>;
405
+ }, z.core.$strict>;
406
+ }, z.core.$strict>;
407
+ }, z.core.$strict>;
408
+ export type TaskOfferForAgentWithEgressPayload = z.infer<typeof TaskOfferForAgentWithEgressPayloadSchema>;
409
+ /** Daemon -> cloud: one durable reliable-lane item after local sanitization. */
410
+ export declare const AgentEgressReliablePayloadSchema: z.ZodObject<{
411
+ agentRef: z.ZodObject<{
412
+ agentId: z.ZodString;
413
+ profileRevision: z.ZodString;
414
+ }, z.core.$strict>;
415
+ sessionRef: z.ZodString;
416
+ policyRevision: z.ZodString;
417
+ eventId: z.ZodUUID;
418
+ cursor: z.ZodNumber;
419
+ payload: z.ZodJSONSchema;
420
+ contentHash: z.ZodString;
421
+ byteCount: z.ZodNumber;
422
+ }, z.core.$strict>;
423
+ export type AgentEgressReliablePayload = z.infer<typeof AgentEgressReliablePayloadSchema>;
424
+ /** Cloud -> daemon: exact acknowledgement for one reliable egress record. */
425
+ export declare const AgentEgressAckPayloadSchema: z.ZodObject<{
426
+ agentRef: z.ZodObject<{
427
+ agentId: z.ZodString;
428
+ profileRevision: z.ZodString;
429
+ }, z.core.$strict>;
430
+ sessionRef: z.ZodString;
431
+ policyRevision: z.ZodString;
432
+ eventId: z.ZodUUID;
433
+ cursor: z.ZodNumber;
434
+ receiptId: z.ZodUUID;
435
+ }, z.core.$strict>;
436
+ export type AgentEgressAckPayload = z.infer<typeof AgentEgressAckPayloadSchema>;
437
+ /** Server -> daemon: one exact, independently-capability-gated content read. */
438
+ export declare const AgentContentReadPayloadSchema: z.ZodObject<{
439
+ requestId: z.ZodUUID;
440
+ surface: z.ZodEnum<{
441
+ artifact: "artifact";
442
+ transcript: "transcript";
443
+ workspace: "workspace";
444
+ }>;
445
+ actor: z.ZodObject<{
446
+ kind: z.ZodEnum<{
447
+ agent: "agent";
448
+ system: "system";
449
+ user: "user";
450
+ }>;
451
+ id: z.ZodString;
452
+ }, z.core.$strict>;
453
+ agentRef: z.ZodObject<{
454
+ agentId: z.ZodString;
455
+ profileRevision: z.ZodString;
456
+ }, z.core.$strict>;
457
+ sessionRef: z.ZodString;
458
+ runtime: z.ZodEnum<{
459
+ claude: "claude";
460
+ codex: "codex";
461
+ pi: "pi";
462
+ }>;
463
+ cwd: z.ZodString;
464
+ policyRevision: z.ZodString;
465
+ target: z.ZodString;
466
+ mimeType: z.ZodString;
467
+ decodeAs: z.ZodEnum<{
468
+ bytes: "bytes";
469
+ utf8: "utf8";
470
+ }>;
471
+ policy: z.ZodObject<{
472
+ maxBytes: z.ZodNumber;
473
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
474
+ }, z.core.$strict>;
475
+ }, z.core.$strict>;
476
+ export type AgentContentReadPayload = z.infer<typeof AgentContentReadPayloadSchema>;
477
+ /** Daemon -> cloud: durable, content-free content-read audit fact. */
478
+ export declare const AgentContentReceiptPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
479
+ requestId: z.ZodUUID;
480
+ eventId: z.ZodUUID;
481
+ cursor: z.ZodNumber;
482
+ surface: z.ZodEnum<{
483
+ artifact: "artifact";
484
+ transcript: "transcript";
485
+ workspace: "workspace";
486
+ }>;
487
+ actor: z.ZodObject<{
488
+ kind: z.ZodEnum<{
489
+ agent: "agent";
490
+ system: "system";
491
+ user: "user";
492
+ }>;
493
+ id: z.ZodString;
494
+ }, z.core.$strict>;
495
+ agentRef: z.ZodObject<{
496
+ agentId: z.ZodString;
497
+ profileRevision: z.ZodString;
498
+ }, z.core.$strict>;
499
+ sessionRef: z.ZodString;
500
+ runtime: z.ZodEnum<{
501
+ claude: "claude";
502
+ codex: "codex";
503
+ pi: "pi";
504
+ }>;
505
+ cwd: z.ZodString;
506
+ policyRevision: z.ZodString;
507
+ target: z.ZodString;
508
+ mimeType: z.ZodString;
509
+ decodeAs: z.ZodEnum<{
510
+ bytes: "bytes";
511
+ utf8: "utf8";
512
+ }>;
513
+ decision: z.ZodLiteral<"allowed">;
514
+ byteCount: z.ZodNumber;
515
+ contentHash: z.ZodString;
516
+ blobRef: z.ZodObject<{
517
+ blobId: z.ZodString;
518
+ contentHash: z.ZodString;
519
+ size: z.ZodNumber;
520
+ contentType: z.ZodString;
521
+ url: z.ZodOptional<z.ZodString>;
522
+ }, z.core.$strip>;
523
+ }, z.core.$strict>, z.ZodObject<{
524
+ requestId: z.ZodUUID;
525
+ eventId: z.ZodUUID;
526
+ cursor: z.ZodNumber;
527
+ surface: z.ZodEnum<{
528
+ artifact: "artifact";
529
+ transcript: "transcript";
530
+ workspace: "workspace";
531
+ }>;
532
+ actor: z.ZodObject<{
533
+ kind: z.ZodEnum<{
534
+ agent: "agent";
535
+ system: "system";
536
+ user: "user";
537
+ }>;
538
+ id: z.ZodString;
539
+ }, z.core.$strict>;
540
+ agentRef: z.ZodObject<{
541
+ agentId: z.ZodString;
542
+ profileRevision: z.ZodString;
543
+ }, z.core.$strict>;
544
+ sessionRef: z.ZodString;
545
+ runtime: z.ZodEnum<{
546
+ claude: "claude";
547
+ codex: "codex";
548
+ pi: "pi";
549
+ }>;
550
+ cwd: z.ZodString;
551
+ policyRevision: z.ZodString;
552
+ target: z.ZodString;
553
+ mimeType: z.ZodString;
554
+ decodeAs: z.ZodEnum<{
555
+ bytes: "bytes";
556
+ utf8: "utf8";
557
+ }>;
558
+ decision: z.ZodLiteral<"denied">;
559
+ byteCount: z.ZodLiteral<0>;
560
+ reason: z.ZodEnum<{
561
+ "absolute-target": "absolute-target";
562
+ "byte-limit": "byte-limit";
563
+ "capability-missing": "capability-missing";
564
+ "dot-segment": "dot-segment";
565
+ "identity-mismatch": "identity-mismatch";
566
+ "invalid-request": "invalid-request";
567
+ "mime-not-allowlisted": "mime-not-allowlisted";
568
+ "non-relative-target": "non-relative-target";
569
+ "not-regular-file": "not-regular-file";
570
+ "path-escape": "path-escape";
571
+ "policy-disabled": "policy-disabled";
572
+ "policy-revision-mismatch": "policy-revision-mismatch";
573
+ "root-invalid": "root-invalid";
574
+ "root-not-allowlisted": "root-not-allowlisted";
575
+ "sensitive-name": "sensitive-name";
576
+ symlink: "symlink";
577
+ "target-missing": "target-missing";
578
+ "text-decode-failed": "text-decode-failed";
579
+ "text-not-allowlisted": "text-not-allowlisted";
580
+ }>;
581
+ }, z.core.$strict>], "decision">;
582
+ export type AgentContentReceiptPayload = z.infer<typeof AgentContentReceiptPayloadSchema>;
251
583
  /**
252
584
  * server -> daemon: approve a pending `task.await_approval` request.
253
585
  *
@@ -337,9 +669,8 @@ export type TaskSteerPayload = z.infer<typeof TaskSteerPayloadSchema>;
337
669
  * (above) rather than introducing a second capability shape. Same source of
338
670
  * truth as `conn.hello.runtimes[].capabilities`, different scope: `conn.hello`
339
671
  * is CONNECTION-level discovery ("what could this device run"), which no
340
- * server-side control decision may read, because it is transport-shaped — a
341
- * long-poll-only daemon never sends `conn.hello` at all and it describes a
342
- * device, not a task. This field is task-shaped: it shares a lifecycle with
672
+ * server-side task control decision may read, because it describes a device,
673
+ * not the adapter that claimed this task. This field is task-shaped: it shares a lifecycle with
343
674
  * the task↔runtime binding the claim itself establishes, so a control gate
344
675
  * (`steerTask()`, `packages/server`'s `hub.ts`) can key off it and stay
345
676
  * correct across reconnects, adapter-set changes, and transports. Plain
@@ -350,6 +681,10 @@ export type TaskSteerPayload = z.infer<typeof TaskSteerPayloadSchema>;
350
681
  export declare const TaskClaimPayloadSchema: z.ZodObject<{
351
682
  deviceId: z.ZodString;
352
683
  agentId: z.ZodOptional<z.ZodString>;
684
+ agentRef: z.ZodOptional<z.ZodObject<{
685
+ agentId: z.ZodString;
686
+ profileRevision: z.ZodString;
687
+ }, z.core.$strict>>;
353
688
  runtime: z.ZodOptional<z.ZodEnum<{
354
689
  claude: "claude";
355
690
  codex: "codex";
@@ -390,6 +725,10 @@ export type TaskStartedPayload = z.infer<typeof TaskStartedPayloadSchema>;
390
725
  export declare const TaskDeclinePayloadSchema: z.ZodObject<{
391
726
  reason: z.ZodString;
392
727
  retryable: z.ZodOptional<z.ZodBoolean>;
728
+ agentRef: z.ZodOptional<z.ZodObject<{
729
+ agentId: z.ZodString;
730
+ profileRevision: z.ZodString;
731
+ }, z.core.$strict>>;
393
732
  }, z.core.$strip>;
394
733
  export type TaskDeclinePayload = z.infer<typeof TaskDeclinePayloadSchema>;
395
734
  /**
@@ -651,6 +990,10 @@ export declare const TaskCompletePayloadSchema: z.ZodObject<{
651
990
  clientVersion: z.ZodString;
652
991
  reportedAt: z.ZodISODateTime;
653
992
  }, z.core.$strip>>;
993
+ agentRef: z.ZodOptional<z.ZodObject<{
994
+ agentId: z.ZodString;
995
+ profileRevision: z.ZodString;
996
+ }, z.core.$strict>>;
654
997
  }, z.core.$strip>;
655
998
  export type TaskCompletePayload = z.infer<typeof TaskCompletePayloadSchema>;
656
999
  /** daemon -> server: task failed. */
@@ -671,6 +1014,10 @@ export declare const TaskFailPayloadSchema: z.ZodObject<{
671
1014
  clientVersion: z.ZodString;
672
1015
  reportedAt: z.ZodISODateTime;
673
1016
  }, z.core.$strip>>;
1017
+ agentRef: z.ZodOptional<z.ZodObject<{
1018
+ agentId: z.ZodString;
1019
+ profileRevision: z.ZodString;
1020
+ }, z.core.$strict>>;
674
1021
  }, z.core.$strip>;
675
1022
  export type TaskFailPayload = z.infer<typeof TaskFailPayloadSchema>;
676
1023
  /**
@@ -708,6 +1055,10 @@ export declare const TaskCancelledPayloadSchema: z.ZodObject<{
708
1055
  clientVersion: z.ZodString;
709
1056
  reportedAt: z.ZodISODateTime;
710
1057
  }, z.core.$strip>>;
1058
+ agentRef: z.ZodOptional<z.ZodObject<{
1059
+ agentId: z.ZodString;
1060
+ profileRevision: z.ZodString;
1061
+ }, z.core.$strict>>;
711
1062
  }, z.core.$strip>;
712
1063
  export type TaskCancelledPayload = z.infer<typeof TaskCancelledPayloadSchema>;
713
1064
  /**
@@ -886,6 +1237,307 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
886
1237
  }, z.core.$strip>>;
887
1238
  requiredToolsets: z.ZodArray<z.ZodString>;
888
1239
  }, z.core.$strict>;
1240
+ readonly 'task.offer_for_agent': z.ZodObject<{
1241
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1242
+ blobRef: z.ZodObject<{
1243
+ blobId: z.ZodString;
1244
+ contentHash: z.ZodString;
1245
+ size: z.ZodNumber;
1246
+ contentType: z.ZodString;
1247
+ url: z.ZodOptional<z.ZodString>;
1248
+ }, z.core.$strip>;
1249
+ }, z.core.$strict>]>;
1250
+ policy: z.ZodObject<{
1251
+ mode: z.ZodEnum<{
1252
+ auto: "auto";
1253
+ confirm: "confirm";
1254
+ plan: "plan";
1255
+ readonly: "readonly";
1256
+ }>;
1257
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1258
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1259
+ workspaceRoot: z.ZodOptional<z.ZodString>;
1260
+ network: z.ZodOptional<z.ZodBoolean>;
1261
+ }, z.core.$strict>;
1262
+ agentRef: z.ZodObject<{
1263
+ agentId: z.ZodString;
1264
+ profileRevision: z.ZodString;
1265
+ }, z.core.$strict>;
1266
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1267
+ runtime: z.ZodOptional<z.ZodEnum<{
1268
+ claude: "claude";
1269
+ codex: "codex";
1270
+ pi: "pi";
1271
+ }>>;
1272
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1273
+ lane: z.ZodLiteral<"subscription">;
1274
+ runtimeId: z.ZodEnum<{
1275
+ claude: "claude";
1276
+ codex: "codex";
1277
+ }>;
1278
+ providerId: z.ZodNull;
1279
+ modelId: z.ZodString;
1280
+ }, z.core.$strict>, z.ZodObject<{
1281
+ lane: z.ZodLiteral<"byok">;
1282
+ runtimeId: z.ZodLiteral<"pi">;
1283
+ providerId: z.ZodString;
1284
+ modelId: z.ZodString;
1285
+ }, z.core.$strict>], "lane">>;
1286
+ sessionRef: z.ZodOptional<z.ZodString>;
1287
+ limits: z.ZodOptional<z.ZodObject<{
1288
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
1289
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1290
+ }, z.core.$strip>>;
1291
+ }, z.core.$strict>;
1292
+ readonly 'task.offer_for_agent_with_egress': z.ZodObject<{
1293
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1294
+ blobRef: z.ZodObject<{
1295
+ blobId: z.ZodString;
1296
+ contentHash: z.ZodString;
1297
+ size: z.ZodNumber;
1298
+ contentType: z.ZodString;
1299
+ url: z.ZodOptional<z.ZodString>;
1300
+ }, z.core.$strip>;
1301
+ }, z.core.$strict>]>;
1302
+ policy: z.ZodObject<{
1303
+ mode: z.ZodEnum<{
1304
+ auto: "auto";
1305
+ confirm: "confirm";
1306
+ plan: "plan";
1307
+ readonly: "readonly";
1308
+ }>;
1309
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1310
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1311
+ workspaceRoot: z.ZodOptional<z.ZodString>;
1312
+ network: z.ZodOptional<z.ZodBoolean>;
1313
+ }, z.core.$strict>;
1314
+ agentRef: z.ZodObject<{
1315
+ agentId: z.ZodString;
1316
+ profileRevision: z.ZodString;
1317
+ }, z.core.$strict>;
1318
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1319
+ runtime: z.ZodOptional<z.ZodEnum<{
1320
+ claude: "claude";
1321
+ codex: "codex";
1322
+ pi: "pi";
1323
+ }>>;
1324
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1325
+ lane: z.ZodLiteral<"subscription">;
1326
+ runtimeId: z.ZodEnum<{
1327
+ claude: "claude";
1328
+ codex: "codex";
1329
+ }>;
1330
+ providerId: z.ZodNull;
1331
+ modelId: z.ZodString;
1332
+ }, z.core.$strict>, z.ZodObject<{
1333
+ lane: z.ZodLiteral<"byok">;
1334
+ runtimeId: z.ZodLiteral<"pi">;
1335
+ providerId: z.ZodString;
1336
+ modelId: z.ZodString;
1337
+ }, z.core.$strict>], "lane">>;
1338
+ limits: z.ZodOptional<z.ZodObject<{
1339
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
1340
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1341
+ }, z.core.$strip>>;
1342
+ sessionRef: z.ZodString;
1343
+ egressPolicy: z.ZodObject<{
1344
+ policyRevision: z.ZodString;
1345
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
1346
+ mode: z.ZodLiteral<"metadata-status">;
1347
+ delivery: z.ZodLiteral<"latest-value">;
1348
+ }, z.core.$strict>, z.ZodObject<{
1349
+ mode: z.ZodLiteral<"contentful-trajectory">;
1350
+ delivery: z.ZodLiteral<"latest-value">;
1351
+ maxCoalesceMs: z.ZodNumber;
1352
+ maxEventBytes: z.ZodNumber;
1353
+ }, z.core.$strict>], "mode">;
1354
+ reliable: z.ZodObject<{
1355
+ maxPendingEventsPerAgent: z.ZodNumber;
1356
+ maxPendingBytesPerAgent: z.ZodNumber;
1357
+ maxPendingBytesPerTenant: z.ZodNumber;
1358
+ }, z.core.$strict>;
1359
+ transfers: z.ZodObject<{
1360
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1361
+ maxBytes: z.ZodNumber;
1362
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1363
+ }, z.core.$strict>]>;
1364
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1365
+ maxBytes: z.ZodNumber;
1366
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1367
+ }, z.core.$strict>]>;
1368
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1369
+ maxBytes: z.ZodNumber;
1370
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1371
+ }, z.core.$strict>]>;
1372
+ }, z.core.$strict>;
1373
+ }, z.core.$strict>;
1374
+ }, z.core.$strict>;
1375
+ readonly 'agent.egress.reliable': z.ZodObject<{
1376
+ agentRef: z.ZodObject<{
1377
+ agentId: z.ZodString;
1378
+ profileRevision: z.ZodString;
1379
+ }, z.core.$strict>;
1380
+ sessionRef: z.ZodString;
1381
+ policyRevision: z.ZodString;
1382
+ eventId: z.ZodUUID;
1383
+ cursor: z.ZodNumber;
1384
+ payload: z.ZodJSONSchema;
1385
+ contentHash: z.ZodString;
1386
+ byteCount: z.ZodNumber;
1387
+ }, z.core.$strict>;
1388
+ readonly 'agent.egress.ack': z.ZodObject<{
1389
+ agentRef: z.ZodObject<{
1390
+ agentId: z.ZodString;
1391
+ profileRevision: z.ZodString;
1392
+ }, z.core.$strict>;
1393
+ sessionRef: z.ZodString;
1394
+ policyRevision: z.ZodString;
1395
+ eventId: z.ZodUUID;
1396
+ cursor: z.ZodNumber;
1397
+ receiptId: z.ZodUUID;
1398
+ }, z.core.$strict>;
1399
+ readonly 'agent.content.read': z.ZodObject<{
1400
+ requestId: z.ZodUUID;
1401
+ surface: z.ZodEnum<{
1402
+ artifact: "artifact";
1403
+ transcript: "transcript";
1404
+ workspace: "workspace";
1405
+ }>;
1406
+ actor: z.ZodObject<{
1407
+ kind: z.ZodEnum<{
1408
+ agent: "agent";
1409
+ system: "system";
1410
+ user: "user";
1411
+ }>;
1412
+ id: z.ZodString;
1413
+ }, z.core.$strict>;
1414
+ agentRef: z.ZodObject<{
1415
+ agentId: z.ZodString;
1416
+ profileRevision: z.ZodString;
1417
+ }, z.core.$strict>;
1418
+ sessionRef: z.ZodString;
1419
+ runtime: z.ZodEnum<{
1420
+ claude: "claude";
1421
+ codex: "codex";
1422
+ pi: "pi";
1423
+ }>;
1424
+ cwd: z.ZodString;
1425
+ policyRevision: z.ZodString;
1426
+ target: z.ZodString;
1427
+ mimeType: z.ZodString;
1428
+ decodeAs: z.ZodEnum<{
1429
+ bytes: "bytes";
1430
+ utf8: "utf8";
1431
+ }>;
1432
+ policy: z.ZodObject<{
1433
+ maxBytes: z.ZodNumber;
1434
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1435
+ }, z.core.$strict>;
1436
+ }, z.core.$strict>;
1437
+ readonly 'agent.content.receipt': z.ZodDiscriminatedUnion<[z.ZodObject<{
1438
+ requestId: z.ZodUUID;
1439
+ eventId: z.ZodUUID;
1440
+ cursor: z.ZodNumber;
1441
+ surface: z.ZodEnum<{
1442
+ artifact: "artifact";
1443
+ transcript: "transcript";
1444
+ workspace: "workspace";
1445
+ }>;
1446
+ actor: z.ZodObject<{
1447
+ kind: z.ZodEnum<{
1448
+ agent: "agent";
1449
+ system: "system";
1450
+ user: "user";
1451
+ }>;
1452
+ id: z.ZodString;
1453
+ }, z.core.$strict>;
1454
+ agentRef: z.ZodObject<{
1455
+ agentId: z.ZodString;
1456
+ profileRevision: z.ZodString;
1457
+ }, z.core.$strict>;
1458
+ sessionRef: z.ZodString;
1459
+ runtime: z.ZodEnum<{
1460
+ claude: "claude";
1461
+ codex: "codex";
1462
+ pi: "pi";
1463
+ }>;
1464
+ cwd: z.ZodString;
1465
+ policyRevision: z.ZodString;
1466
+ target: z.ZodString;
1467
+ mimeType: z.ZodString;
1468
+ decodeAs: z.ZodEnum<{
1469
+ bytes: "bytes";
1470
+ utf8: "utf8";
1471
+ }>;
1472
+ decision: z.ZodLiteral<"allowed">;
1473
+ byteCount: z.ZodNumber;
1474
+ contentHash: z.ZodString;
1475
+ blobRef: z.ZodObject<{
1476
+ blobId: z.ZodString;
1477
+ contentHash: z.ZodString;
1478
+ size: z.ZodNumber;
1479
+ contentType: z.ZodString;
1480
+ url: z.ZodOptional<z.ZodString>;
1481
+ }, z.core.$strip>;
1482
+ }, z.core.$strict>, z.ZodObject<{
1483
+ requestId: z.ZodUUID;
1484
+ eventId: z.ZodUUID;
1485
+ cursor: z.ZodNumber;
1486
+ surface: z.ZodEnum<{
1487
+ artifact: "artifact";
1488
+ transcript: "transcript";
1489
+ workspace: "workspace";
1490
+ }>;
1491
+ actor: z.ZodObject<{
1492
+ kind: z.ZodEnum<{
1493
+ agent: "agent";
1494
+ system: "system";
1495
+ user: "user";
1496
+ }>;
1497
+ id: z.ZodString;
1498
+ }, z.core.$strict>;
1499
+ agentRef: z.ZodObject<{
1500
+ agentId: z.ZodString;
1501
+ profileRevision: z.ZodString;
1502
+ }, z.core.$strict>;
1503
+ sessionRef: z.ZodString;
1504
+ runtime: z.ZodEnum<{
1505
+ claude: "claude";
1506
+ codex: "codex";
1507
+ pi: "pi";
1508
+ }>;
1509
+ cwd: z.ZodString;
1510
+ policyRevision: z.ZodString;
1511
+ target: z.ZodString;
1512
+ mimeType: z.ZodString;
1513
+ decodeAs: z.ZodEnum<{
1514
+ bytes: "bytes";
1515
+ utf8: "utf8";
1516
+ }>;
1517
+ decision: z.ZodLiteral<"denied">;
1518
+ byteCount: z.ZodLiteral<0>;
1519
+ reason: z.ZodEnum<{
1520
+ "absolute-target": "absolute-target";
1521
+ "byte-limit": "byte-limit";
1522
+ "capability-missing": "capability-missing";
1523
+ "dot-segment": "dot-segment";
1524
+ "identity-mismatch": "identity-mismatch";
1525
+ "invalid-request": "invalid-request";
1526
+ "mime-not-allowlisted": "mime-not-allowlisted";
1527
+ "non-relative-target": "non-relative-target";
1528
+ "not-regular-file": "not-regular-file";
1529
+ "path-escape": "path-escape";
1530
+ "policy-disabled": "policy-disabled";
1531
+ "policy-revision-mismatch": "policy-revision-mismatch";
1532
+ "root-invalid": "root-invalid";
1533
+ "root-not-allowlisted": "root-not-allowlisted";
1534
+ "sensitive-name": "sensitive-name";
1535
+ symlink: "symlink";
1536
+ "target-missing": "target-missing";
1537
+ "text-decode-failed": "text-decode-failed";
1538
+ "text-not-allowlisted": "text-not-allowlisted";
1539
+ }>;
1540
+ }, z.core.$strict>], "decision">;
889
1541
  readonly 'task.approve': z.ZodObject<{
890
1542
  approvalId: z.ZodOptional<z.ZodString>;
891
1543
  }, z.core.$strip>;
@@ -902,6 +1554,10 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
902
1554
  readonly 'task.claim': z.ZodObject<{
903
1555
  deviceId: z.ZodString;
904
1556
  agentId: z.ZodOptional<z.ZodString>;
1557
+ agentRef: z.ZodOptional<z.ZodObject<{
1558
+ agentId: z.ZodString;
1559
+ profileRevision: z.ZodString;
1560
+ }, z.core.$strict>>;
905
1561
  runtime: z.ZodOptional<z.ZodEnum<{
906
1562
  claude: "claude";
907
1563
  codex: "codex";
@@ -919,6 +1575,10 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
919
1575
  readonly 'task.decline': z.ZodObject<{
920
1576
  reason: z.ZodString;
921
1577
  retryable: z.ZodOptional<z.ZodBoolean>;
1578
+ agentRef: z.ZodOptional<z.ZodObject<{
1579
+ agentId: z.ZodString;
1580
+ profileRevision: z.ZodString;
1581
+ }, z.core.$strict>>;
922
1582
  }, z.core.$strip>;
923
1583
  readonly 'task.progress': z.ZodObject<{
924
1584
  seq: z.ZodNumber;
@@ -1000,6 +1660,10 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
1000
1660
  clientVersion: z.ZodString;
1001
1661
  reportedAt: z.ZodISODateTime;
1002
1662
  }, z.core.$strip>>;
1663
+ agentRef: z.ZodOptional<z.ZodObject<{
1664
+ agentId: z.ZodString;
1665
+ profileRevision: z.ZodString;
1666
+ }, z.core.$strict>>;
1003
1667
  }, z.core.$strip>;
1004
1668
  readonly 'task.fail': z.ZodObject<{
1005
1669
  reason: z.ZodString;
@@ -1018,6 +1682,10 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
1018
1682
  clientVersion: z.ZodString;
1019
1683
  reportedAt: z.ZodISODateTime;
1020
1684
  }, z.core.$strip>>;
1685
+ agentRef: z.ZodOptional<z.ZodObject<{
1686
+ agentId: z.ZodString;
1687
+ profileRevision: z.ZodString;
1688
+ }, z.core.$strict>>;
1021
1689
  }, z.core.$strip>;
1022
1690
  readonly 'task.cancelled': z.ZodObject<{
1023
1691
  reason: z.ZodOptional<z.ZodString>;
@@ -1035,6 +1703,10 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
1035
1703
  clientVersion: z.ZodString;
1036
1704
  reportedAt: z.ZodISODateTime;
1037
1705
  }, z.core.$strip>>;
1706
+ agentRef: z.ZodOptional<z.ZodObject<{
1707
+ agentId: z.ZodString;
1708
+ profileRevision: z.ZodString;
1709
+ }, z.core.$strict>>;
1038
1710
  }, z.core.$strip>;
1039
1711
  readonly 'task.approval_resolved': z.ZodObject<{
1040
1712
  approvalId: z.ZodString;
@@ -1055,7 +1727,7 @@ export declare const MESSAGE_TYPES: MessageType[];
1055
1727
  * (`envelope.ts`) to decide which branches require envelope `seq` (M1
1056
1728
  * redelivery cursor).
1057
1729
  */
1058
- export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer", "task.offer_with_toolsets", "task.approve", "task.reject", "task.cancel", "task.steer"];
1730
+ export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer", "task.offer_with_toolsets", "task.offer_for_agent", "task.offer_for_agent_with_egress", "agent.egress.ack", "agent.content.read", "task.approve", "task.reject", "task.cancel", "task.steer"];
1059
1731
  /**
1060
1732
  * Message types the daemon sends to the server — the flip side of
1061
1733
  * {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's
@@ -1068,4 +1740,4 @@ export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer",
1068
1740
  * or anything unrecognized — is rejected before it's dispatched to any
1069
1741
  * handler or counted `accepted` on the `/byok/messages` wire.
1070
1742
  */
1071
- export declare const DAEMON_TO_SERVER_TYPES: readonly ["task.claim", "task.started", "task.decline", "task.progress", "task.artifact", "task.await_approval", "task.complete", "task.fail", "task.cancelled", "task.approval_resolved"];
1743
+ export declare const DAEMON_TO_SERVER_TYPES: readonly ["task.claim", "task.started", "task.decline", "task.progress", "task.artifact", "task.await_approval", "task.complete", "task.fail", "task.cancelled", "task.approval_resolved", "agent.egress.reliable", "agent.content.receipt"];