@byok-sdk/protocol 0.7.0 → 0.8.0-beta.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.
@@ -406,6 +406,95 @@ export declare const TaskOfferForAgentWithEgressPayloadSchema: z.ZodObject<{
406
406
  }, z.core.$strict>;
407
407
  }, z.core.$strict>;
408
408
  export type TaskOfferForAgentWithEgressPayload = z.infer<typeof TaskOfferForAgentWithEgressPayloadSchema>;
409
+ /**
410
+ * Strict fresh-session Agent egress offer. It deliberately omits `sessionRef`:
411
+ * the selected runtime is the sole authority that can mint that identity after
412
+ * start. This distinct message prevents a missing resume reference from being
413
+ * interpreted as a fresh execution by an older daemon.
414
+ */
415
+ export declare const TaskOfferForAgentWithEgressFreshPayloadSchema: z.ZodObject<{
416
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
417
+ blobRef: z.ZodObject<{
418
+ blobId: z.ZodString;
419
+ contentHash: z.ZodString;
420
+ size: z.ZodNumber;
421
+ contentType: z.ZodString;
422
+ url: z.ZodOptional<z.ZodString>;
423
+ }, z.core.$strip>;
424
+ }, z.core.$strict>]>;
425
+ policy: z.ZodObject<{
426
+ mode: z.ZodEnum<{
427
+ auto: "auto";
428
+ confirm: "confirm";
429
+ plan: "plan";
430
+ readonly: "readonly";
431
+ }>;
432
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
433
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
434
+ workspaceRoot: z.ZodOptional<z.ZodString>;
435
+ network: z.ZodOptional<z.ZodBoolean>;
436
+ }, z.core.$strict>;
437
+ agentRef: z.ZodObject<{
438
+ agentId: z.ZodString;
439
+ profileRevision: z.ZodString;
440
+ }, z.core.$strict>;
441
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
442
+ runtime: z.ZodOptional<z.ZodEnum<{
443
+ claude: "claude";
444
+ codex: "codex";
445
+ pi: "pi";
446
+ }>>;
447
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
448
+ lane: z.ZodLiteral<"subscription">;
449
+ runtimeId: z.ZodEnum<{
450
+ claude: "claude";
451
+ codex: "codex";
452
+ }>;
453
+ providerId: z.ZodNull;
454
+ modelId: z.ZodString;
455
+ }, z.core.$strict>, z.ZodObject<{
456
+ lane: z.ZodLiteral<"byok">;
457
+ runtimeId: z.ZodLiteral<"pi">;
458
+ providerId: z.ZodString;
459
+ modelId: z.ZodString;
460
+ }, z.core.$strict>], "lane">>;
461
+ limits: z.ZodOptional<z.ZodObject<{
462
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
463
+ maxTokens: z.ZodOptional<z.ZodNumber>;
464
+ }, z.core.$strip>>;
465
+ egressPolicy: z.ZodObject<{
466
+ policyRevision: z.ZodString;
467
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
468
+ mode: z.ZodLiteral<"metadata-status">;
469
+ delivery: z.ZodLiteral<"latest-value">;
470
+ }, z.core.$strict>, z.ZodObject<{
471
+ mode: z.ZodLiteral<"contentful-trajectory">;
472
+ delivery: z.ZodLiteral<"latest-value">;
473
+ maxCoalesceMs: z.ZodNumber;
474
+ maxEventBytes: z.ZodNumber;
475
+ }, z.core.$strict>], "mode">;
476
+ reliable: z.ZodObject<{
477
+ maxPendingEventsPerAgent: z.ZodNumber;
478
+ maxPendingBytesPerAgent: z.ZodNumber;
479
+ maxPendingBytesPerTenant: z.ZodNumber;
480
+ }, z.core.$strict>;
481
+ transfers: z.ZodObject<{
482
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
483
+ maxBytes: z.ZodNumber;
484
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
485
+ }, z.core.$strict>]>;
486
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
487
+ maxBytes: z.ZodNumber;
488
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
489
+ }, z.core.$strict>]>;
490
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
491
+ maxBytes: z.ZodNumber;
492
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
493
+ }, z.core.$strict>]>;
494
+ }, z.core.$strict>;
495
+ }, z.core.$strict>;
496
+ }, z.core.$strict>;
497
+ export type TaskOfferForAgentWithEgressFreshPayload = z.infer<typeof TaskOfferForAgentWithEgressFreshPayloadSchema>;
409
498
  /** Daemon -> cloud: one durable reliable-lane item after local sanitization. */
410
499
  export declare const AgentEgressReliablePayloadSchema: z.ZodObject<{
411
500
  agentRef: z.ZodObject<{
@@ -1372,6 +1461,88 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
1372
1461
  }, z.core.$strict>;
1373
1462
  }, z.core.$strict>;
1374
1463
  }, z.core.$strict>;
1464
+ readonly 'task.offer_for_agent_with_egress_fresh': z.ZodObject<{
1465
+ instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1466
+ blobRef: z.ZodObject<{
1467
+ blobId: z.ZodString;
1468
+ contentHash: z.ZodString;
1469
+ size: z.ZodNumber;
1470
+ contentType: z.ZodString;
1471
+ url: z.ZodOptional<z.ZodString>;
1472
+ }, z.core.$strip>;
1473
+ }, z.core.$strict>]>;
1474
+ policy: z.ZodObject<{
1475
+ mode: z.ZodEnum<{
1476
+ auto: "auto";
1477
+ confirm: "confirm";
1478
+ plan: "plan";
1479
+ readonly: "readonly";
1480
+ }>;
1481
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1482
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1483
+ workspaceRoot: z.ZodOptional<z.ZodString>;
1484
+ network: z.ZodOptional<z.ZodBoolean>;
1485
+ }, z.core.$strict>;
1486
+ agentRef: z.ZodObject<{
1487
+ agentId: z.ZodString;
1488
+ profileRevision: z.ZodString;
1489
+ }, z.core.$strict>;
1490
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
1491
+ runtime: z.ZodOptional<z.ZodEnum<{
1492
+ claude: "claude";
1493
+ codex: "codex";
1494
+ pi: "pi";
1495
+ }>>;
1496
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1497
+ lane: z.ZodLiteral<"subscription">;
1498
+ runtimeId: z.ZodEnum<{
1499
+ claude: "claude";
1500
+ codex: "codex";
1501
+ }>;
1502
+ providerId: z.ZodNull;
1503
+ modelId: z.ZodString;
1504
+ }, z.core.$strict>, z.ZodObject<{
1505
+ lane: z.ZodLiteral<"byok">;
1506
+ runtimeId: z.ZodLiteral<"pi">;
1507
+ providerId: z.ZodString;
1508
+ modelId: z.ZodString;
1509
+ }, z.core.$strict>], "lane">>;
1510
+ limits: z.ZodOptional<z.ZodObject<{
1511
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
1512
+ maxTokens: z.ZodOptional<z.ZodNumber>;
1513
+ }, z.core.$strip>>;
1514
+ egressPolicy: z.ZodObject<{
1515
+ policyRevision: z.ZodString;
1516
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
1517
+ mode: z.ZodLiteral<"metadata-status">;
1518
+ delivery: z.ZodLiteral<"latest-value">;
1519
+ }, z.core.$strict>, z.ZodObject<{
1520
+ mode: z.ZodLiteral<"contentful-trajectory">;
1521
+ delivery: z.ZodLiteral<"latest-value">;
1522
+ maxCoalesceMs: z.ZodNumber;
1523
+ maxEventBytes: z.ZodNumber;
1524
+ }, z.core.$strict>], "mode">;
1525
+ reliable: z.ZodObject<{
1526
+ maxPendingEventsPerAgent: z.ZodNumber;
1527
+ maxPendingBytesPerAgent: z.ZodNumber;
1528
+ maxPendingBytesPerTenant: z.ZodNumber;
1529
+ }, z.core.$strict>;
1530
+ transfers: z.ZodObject<{
1531
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1532
+ maxBytes: z.ZodNumber;
1533
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1534
+ }, z.core.$strict>]>;
1535
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1536
+ maxBytes: z.ZodNumber;
1537
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1538
+ }, z.core.$strict>]>;
1539
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
1540
+ maxBytes: z.ZodNumber;
1541
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
1542
+ }, z.core.$strict>]>;
1543
+ }, z.core.$strict>;
1544
+ }, z.core.$strict>;
1545
+ }, z.core.$strict>;
1375
1546
  readonly 'agent.egress.reliable': z.ZodObject<{
1376
1547
  agentRef: z.ZodObject<{
1377
1548
  agentId: z.ZodString;
@@ -1727,7 +1898,7 @@ export declare const MESSAGE_TYPES: MessageType[];
1727
1898
  * (`envelope.ts`) to decide which branches require envelope `seq` (M1
1728
1899
  * redelivery cursor).
1729
1900
  */
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"];
1901
+ 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", "task.offer_for_agent_with_egress_fresh", "agent.egress.ack", "agent.content.read", "task.approve", "task.reject", "task.cancel", "task.steer"];
1731
1902
  /**
1732
1903
  * Message types the daemon sends to the server — the flip side of
1733
1904
  * {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's
package/dist/version.d.ts CHANGED
@@ -101,5 +101,5 @@ export declare const PROTOCOL_VERSION = 1;
101
101
  * boundary for long-poll: an older daemon skips it as unknown and therefore
102
102
  * cannot accidentally execute the instruction without the required tools.
103
103
  */
104
- export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', 'toolset-selection', 'agent-home-contract', "agent-egress-policy", "agent-egress-reliable-ack", "agent-content-workspace-read", "agent-content-transcript-read", "agent-content-artifact-read"];
104
+ export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', 'toolset-selection', 'agent-home-contract', "agent-egress-policy", "agent-egress-reliable-ack", "agent-egress-fresh-session", "agent-content-workspace-read", "agent-content-transcript-read", "agent-content-artifact-read"];
105
105
  export type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byok-sdk/protocol",
3
- "version": "0.7.0",
3
+ "version": "0.8.0-beta.0",
4
4
  "description": "BYOK SDK wire protocol: envelope schema, message types, and codec helpers",
5
5
  "type": "module",
6
6
  "license": "MIT",