@byok-sdk/protocol 0.19.0 → 0.21.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.
@@ -25,8 +25,41 @@ import { z } from 'zod';
25
25
  * freeze-rule asymmetry. Adding a field post-freeze is therefore a
26
26
  * breaking change, exactly like `PermissionPolicySchema`.
27
27
  */
28
- /** Capability required before a task-free remote input preparation is admitted. */
29
- export declare const AGENT_INPUT_PREPARATION_CAPABILITY: 'agent-input-preparation';
28
+ /**
29
+ * The ONE version of the input-preparation contract, shared by this relay wire
30
+ * (the `agent.input.preparation` payload and the completion receipt summary)
31
+ * and by the device-local request, receipt and artifact
32
+ * (`@byok-sdk/client`'s `INPUT_PREPARATION_VERSION`, which is this value).
33
+ *
34
+ * The relay wire carries no version field of its own, so a version change is
35
+ * made visible where admission actually happens: in the capability token
36
+ * below. See `INPUT_PREPARATION_VERSION` in the client for what each version
37
+ * changed.
38
+ */
39
+ export declare const INPUT_PREPARATION_WIRE_VERSION: 6;
40
+ /**
41
+ * Capability required before a task-free remote input preparation — or a
42
+ * prepared Execution — is admitted: `agent-input-preparation-v<N>`, where
43
+ * `<N>` is {@link INPUT_PREPARATION_WIRE_VERSION}.
44
+ *
45
+ * The version is IN the token because the relay wire has none. A device
46
+ * declares exactly the one token of the contract it speaks, and a cloud admits
47
+ * exactly the one token of the contract it speaks, so a device and a cloud on
48
+ * different contract versions never exchange a preparation at all: the cloud
49
+ * refuses at enqueue (`agent_capability_missing`, before any receipt or
50
+ * mailbox row) instead of relaying a payload the other side would refuse with
51
+ * a strict-schema 422 and a device would then redeliver forever. There is no
52
+ * dual token and no accepted older one. The retired unversioned token
53
+ * `agent-input-preparation` (versions up to 4) is admitted nowhere.
54
+ *
55
+ * The token gates NEW admissions only. A row enqueued before a version cut is
56
+ * still in flight afterwards, and its completion is accepted only by a cloud
57
+ * on the same version as the device answering it; across the cut it is a 422
58
+ * and a stalled device cursor. Draining in-flight rows and upgrading cloud and
59
+ * devices as a pair is the operator precondition for the cut (`docs/spec.md`,
60
+ * bounded admission); nothing here parses an older receipt.
61
+ */
62
+ export declare const AGENT_INPUT_PREPARATION_CAPABILITY: "agent-input-preparation-v6";
30
63
  /** The preparation surface uses the package-wide lowercase `sha256:<hex>` transport form. */
31
64
  export declare const InputPreparationContentHashSchema: z.ZodString;
32
65
  /**
@@ -424,13 +457,20 @@ export declare const InputPreparationContextDocumentSchema: z.ZodObject<{
424
457
  }, z.core.$strict>], "role">>;
425
458
  }, z.core.$strict>;
426
459
  export type InputPreparationContextDocument = z.infer<typeof InputPreparationContextDocumentSchema>;
427
- /** Durable lifecycle state of one local preparation record. */
460
+ /**
461
+ * Durable lifecycle state of one local preparation record.
462
+ *
463
+ * `prepared` is the one successful terminal state: the artifact is compiled,
464
+ * persisted, and — when the device has an optional counter configured — its
465
+ * counter answered. A device with no counter reaches `prepared` without ever
466
+ * entering `counting`.
467
+ */
428
468
  export declare const InputPreparationStateSchema: z.ZodEnum<{
429
469
  cancelled: "cancelled";
430
- counted: "counted";
431
470
  counter_interrupted: "counter_interrupted";
432
471
  counting: "counting";
433
472
  failed: "failed";
473
+ prepared: "prepared";
434
474
  reserved: "reserved";
435
475
  }>;
436
476
  export type InputPreparationState = z.infer<typeof InputPreparationStateSchema>;
@@ -440,11 +480,14 @@ export type InputPreparationState = z.infer<typeof InputPreparationStateSchema>;
440
480
  *
441
481
  * `ready` means the preparation CAN BE CONSUMED — the artifact is intact and
442
482
  * unexpired, the native compiler's projection is content-complete, every
443
- * residual key is ruled by an applicable Host accounting policy, the count is
444
- * present and bound to that exact projection, and every executor identity is
445
- * attested. It is deliberately NOT Host budget admission: the device performs
446
- * no budget arithmetic, so a ready receipt says the evidence holds, never that
447
- * the spend is allowed.
483
+ * residual key is ruled by an applicable Host accounting policy, D is text
484
+ * only, every executor identity is attested, and — only when the device has an
485
+ * optional counter configured — that count is provider-authoritative and
486
+ * covered. No count is required: the size evidence is
487
+ * `artifact.requestBytes`, the exact byte length of the frozen D. It is
488
+ * deliberately NOT Host budget admission: the device performs no budget
489
+ * arithmetic, so a ready receipt says the evidence holds, never that the
490
+ * spend fits a window.
448
491
  */
449
492
  export declare const InputPreparationReadinessReasonSchema: z.ZodEnum<{
450
493
  accounting_policy_inapplicable: "accounting_policy_inapplicable";
@@ -454,11 +497,11 @@ export declare const InputPreparationReadinessReasonSchema: z.ZodEnum<{
454
497
  counter_authority_not_production: "counter_authority_not_production";
455
498
  counter_coverage_incomplete: "counter_coverage_incomplete";
456
499
  counter_interrupted: "counter_interrupted";
457
- counter_missing: "counter_missing";
458
500
  executor_identity_unproven: "executor_identity_unproven";
459
501
  failed: "failed";
460
- not_counted: "not_counted";
502
+ not_prepared: "not_prepared";
461
503
  projection_unknown: "projection_unknown";
504
+ request_content_not_text: "request_content_not_text";
462
505
  residual_not_ruled: "residual_not_ruled";
463
506
  runtime_contract_superseded: "runtime_contract_superseded";
464
507
  }>;
@@ -529,7 +572,9 @@ export declare const InputPreparationCounterProviderEvidenceSchema: z.ZodObject<
529
572
  }, z.core.$strict>;
530
573
  }, z.core.$strict>;
531
574
  /**
532
- * Counter evidence exactly as the device's adapter reported it.
575
+ * Counter evidence exactly as the device's OPTIONAL adapter reported it.
576
+ * Absent when the device has no counter configured, which is a legal, ready-
577
+ * capable state: the size evidence is `artifact.requestBytes`.
533
578
  *
534
579
  * `authority: 'test_fixture'` is a first-class value, not a debug flag: a
535
580
  * fixture result can never produce a ready receipt, which is what keeps an
@@ -542,10 +587,6 @@ export declare const InputPreparationCounterEvidenceSchema: z.ZodObject<{
542
587
  provider: "provider";
543
588
  test_fixture: "test_fixture";
544
589
  }>;
545
- kind: z.ZodEnum<{
546
- bound: "bound";
547
- count: "count";
548
- }>;
549
590
  value: z.ZodNumber;
550
591
  coverage: z.ZodObject<{
551
592
  covered: z.ZodBoolean;
@@ -739,10 +780,10 @@ export declare const InputPreparationReceiptSummarySchema: z.ZodObject<{
739
780
  reference: z.ZodString;
740
781
  state: z.ZodEnum<{
741
782
  cancelled: "cancelled";
742
- counted: "counted";
743
783
  counter_interrupted: "counter_interrupted";
744
784
  counting: "counting";
745
785
  failed: "failed";
786
+ prepared: "prepared";
746
787
  reserved: "reserved";
747
788
  }>;
748
789
  binding: z.ZodObject<{
@@ -825,10 +866,6 @@ export declare const InputPreparationReceiptSummarySchema: z.ZodObject<{
825
866
  provider: "provider";
826
867
  test_fixture: "test_fixture";
827
868
  }>;
828
- kind: z.ZodEnum<{
829
- bound: "bound";
830
- count: "count";
831
- }>;
832
869
  value: z.ZodNumber;
833
870
  coverage: z.ZodObject<{
834
871
  covered: z.ZodBoolean;
@@ -860,11 +897,11 @@ export declare const InputPreparationReceiptSummarySchema: z.ZodObject<{
860
897
  counter_authority_not_production: "counter_authority_not_production";
861
898
  counter_coverage_incomplete: "counter_coverage_incomplete";
862
899
  counter_interrupted: "counter_interrupted";
863
- counter_missing: "counter_missing";
864
900
  executor_identity_unproven: "executor_identity_unproven";
865
901
  failed: "failed";
866
- not_counted: "not_counted";
902
+ not_prepared: "not_prepared";
867
903
  projection_unknown: "projection_unknown";
904
+ request_content_not_text: "request_content_not_text";
868
905
  residual_not_ruled: "residual_not_ruled";
869
906
  runtime_contract_superseded: "runtime_contract_superseded";
870
907
  }>>;
@@ -895,7 +932,7 @@ export declare const InputPreparationReferenceSchema: z.ZodString;
895
932
  * `artifactDigest` is optional for one structural reason, not as a compatibility
896
933
  * seam: a receipt discloses `artifact` only once there is one
897
934
  * ({@link InputPreparationArtifactSummarySchema} is optional on the receipt), so
898
- * a Host holding a not-yet-counted receipt has no envelope digest to re-present.
935
+ * a Host holding a not-yet-prepared receipt has no envelope digest to re-present.
899
936
  * When it is present it is compared like everything else.
900
937
  */
901
938
  export declare const InputPreparationOfferBindingSchema: z.ZodObject<{
@@ -922,6 +959,7 @@ export declare const InputPreparationRejectionReasonSchema: z.ZodEnum<{
922
959
  counter_unavailable: "counter_unavailable";
923
960
  deadline_elapsed: "deadline_elapsed";
924
961
  durable_write_failed: "durable_write_failed";
962
+ input_preparation_record_log_unsupported: "input_preparation_record_log_unsupported";
925
963
  input_preparation_unconfigured: "input_preparation_unconfigured";
926
964
  launch_boundary_unavailable: "launch_boundary_unavailable";
927
965
  limit_exceeded: "limit_exceeded";
@@ -272,10 +272,11 @@ export declare const RequiredToolsetsSchema: z.ZodArray<z.ZodString>;
272
272
  /**
273
273
  * Additive v1 offer variant for tasks whose semantics require local MCP
274
274
  * tools. This is a distinct message type rather than an optional field on
275
- * `task.offer`: an older v1 daemon skips an unknown message type, whereas it
276
- * would legally strip an unknown optional control field and run the task
277
- * without its required tools. The whole payload is strict because every
278
- * field here affects execution authority.
275
+ * `task.offer`, so an older daemon can never strip an unknown optional control
276
+ * field and run the task without its required tools. An unknown type is not
277
+ * silently skipped either: on long-poll it freezes the cursor, so the enqueue
278
+ * capability gate is the real compatibility boundary. The whole payload is
279
+ * strict because every field here affects execution authority.
279
280
  */
280
281
  export declare const TaskOfferWithToolsetsPayloadSchema: z.ZodObject<{
281
282
  instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -656,11 +657,10 @@ export type TaskOfferForAgentWithEgressFreshPayload = z.infer<typeof TaskOfferFo
656
657
  *
657
658
  * A DISTINCT message type, not a `preparation` field added to
658
659
  * `task.offer_for_agent`, for the same N/N-1 reason the toolset and egress
659
- * variants are distinct: an older daemon skips a message type it does not know
660
- * (`UnknownMessageTypeError`, and the long-poll transport skips that entry
661
- * whole), whereas it would legally STRIP an unknown optional field and run the
662
- * task as an ordinary instruction offer — compiling a request of its own
663
- * against tokens that were already counted for a different one.
660
+ * variants are distinct. On long-poll, both an unknown message type and an
661
+ * unknown key on a strict payload freeze the cursor. The enqueue capability
662
+ * gate is the compatibility boundary: v6 requires a drain and paired upgrade,
663
+ * with no dual token or dual read.
664
664
  *
665
665
  * It carries no `instruction`: the user request is already inside the frozen
666
666
  * envelope the referenced record retained, and an offer that carried both would
@@ -737,6 +737,46 @@ export declare const TaskOfferPreparedPayloadSchema: z.ZodObject<{
737
737
  requestDigest: z.ZodString;
738
738
  artifactDigest: z.ZodOptional<z.ZodString>;
739
739
  }, z.core.$strict>;
740
+ egressPolicy: z.ZodObject<{
741
+ policyRevision: z.ZodString;
742
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
743
+ mode: z.ZodLiteral<"metadata-status">;
744
+ delivery: z.ZodLiteral<"latest-value">;
745
+ }, z.core.$strict>, z.ZodObject<{
746
+ mode: z.ZodLiteral<"contentful-trajectory">;
747
+ delivery: z.ZodLiteral<"latest-value">;
748
+ maxCoalesceMs: z.ZodNumber;
749
+ maxEventBytes: z.ZodNumber;
750
+ }, z.core.$strict>], "mode">;
751
+ reliable: z.ZodObject<{
752
+ maxPendingEventsPerAgent: z.ZodNumber;
753
+ maxPendingBytesPerAgent: z.ZodNumber;
754
+ maxPendingBytesPerTenant: z.ZodNumber;
755
+ }, z.core.$strict>;
756
+ transfers: z.ZodObject<{
757
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
758
+ maxBytes: z.ZodNumber;
759
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
760
+ }, z.core.$strict>]>;
761
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
762
+ maxBytes: z.ZodNumber;
763
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
764
+ }, z.core.$strict>]>;
765
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
766
+ maxBytes: z.ZodNumber;
767
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
768
+ }, z.core.$strict>]>;
769
+ }, z.core.$strict>;
770
+ }, z.core.$strict>;
771
+ messageEgress: z.ZodOptional<z.ZodObject<{
772
+ mode: z.ZodLiteral<"required">;
773
+ contract: z.ZodString;
774
+ contentType: z.ZodEnum<{
775
+ "text/markdown": "text/markdown";
776
+ "text/plain": "text/plain";
777
+ }>;
778
+ maxBytes: z.ZodNumber;
779
+ }, z.core.$strict>>;
740
780
  }, z.core.$strict>;
741
781
  export type TaskOfferPreparedPayload = z.infer<typeof TaskOfferPreparedPayloadSchema>;
742
782
  /** Daemon -> cloud: one durable reliable-lane item after local sanitization. */
@@ -972,11 +1012,12 @@ export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPaylo
972
1012
  * Server -> daemon: one task-free, exact-device remote input preparation.
973
1013
  *
974
1014
  * Distinct message type rather than an optional field on an existing one, for
975
- * the same N/N-1 reason `task.offer_with_toolsets` is: a daemon that predates
976
- * this contract SKIPS an unknown type outright (`parseMessage` ->
977
- * `UnknownMessageTypeError`), whereas it would legally STRIP an unknown
978
- * optional field and then answer as though a preparation it never performed
979
- * had somehow been handled.
1015
+ * the same N/N-1 reason `task.offer_with_toolsets` is: an optional field could be
1016
+ * legally STRIPPED by a daemon that predates this contract, which would then
1017
+ * answer as though a preparation it never performed had somehow been handled.
1018
+ * An unknown type (`parseMessage` -> `UnknownMessageTypeError`) is not skipped
1019
+ * cleanly either: on long-poll it freezes the cursor, so the enqueue capability
1020
+ * gate is the compatibility boundary.
980
1021
  *
981
1022
  * What is deliberately NOT here (§17 B): `tools`, `toolExecutors`, runtime or
982
1023
  * compiler identity, `tenantId` and `deviceId`. The first three are local
@@ -1509,6 +1550,34 @@ export declare const TerminalInferenceUsageSchema: z.ZodObject<{
1509
1550
  reportedAt: z.ZodISODateTime;
1510
1551
  }, z.core.$strip>;
1511
1552
  export type TerminalInferenceUsage = z.infer<typeof TerminalInferenceUsageSchema>;
1553
+ /**
1554
+ * The prepared-only terminal observation: what the runtime reported about the
1555
+ * provider calls of ONE prepared Execution, bound to the frozen request it
1556
+ * launched.
1557
+ *
1558
+ * - `requestDigest` — the frozen artifact's own request digest
1559
+ * (`InputPreparationArtifactSummarySchema.requestDigest`), so the Host
1560
+ * compares these numbers against exactly the D whose `requestBytes` it
1561
+ * ruled on.
1562
+ * - `initialPromptTokens` — the prompt tokens of the FIRST provider call. It
1563
+ * is the only call whose request is D; every later call is an ordinary tool
1564
+ * continuation. Prompt tokens are the provider's whole prompt, cache reads
1565
+ * and writes included.
1566
+ * - `maxPromptTokens` — the largest prompt of any provider call of the
1567
+ * Execution, so `maxPromptTokens >= initialPromptTokens`.
1568
+ *
1569
+ * A separate field, deliberately NOT {@link TerminalInferenceUsageSchema}:
1570
+ * that one is telemetry and never task-state authority, while this one is the
1571
+ * evidence a Host checks its own budget ruling against. The device performs no
1572
+ * budget arithmetic over it. Strict, like every other control shape: an
1573
+ * unrecognized field is rejected, not stripped.
1574
+ */
1575
+ export declare const TerminalPreparedObservationSchema: z.ZodObject<{
1576
+ requestDigest: z.ZodString;
1577
+ initialPromptTokens: z.ZodNumber;
1578
+ maxPromptTokens: z.ZodNumber;
1579
+ }, z.core.$strict>;
1580
+ export type TerminalPreparedObservation = z.infer<typeof TerminalPreparedObservationSchema>;
1512
1581
  /**
1513
1582
  * daemon -> server: task finished successfully.
1514
1583
  *
@@ -1561,6 +1630,11 @@ export declare const TaskCompletePayloadSchema: z.ZodObject<{
1561
1630
  clientVersion: z.ZodString;
1562
1631
  reportedAt: z.ZodISODateTime;
1563
1632
  }, z.core.$strip>>;
1633
+ preparedObservation: z.ZodOptional<z.ZodObject<{
1634
+ requestDigest: z.ZodString;
1635
+ initialPromptTokens: z.ZodNumber;
1636
+ maxPromptTokens: z.ZodNumber;
1637
+ }, z.core.$strict>>;
1564
1638
  agentRef: z.ZodOptional<z.ZodObject<{
1565
1639
  agentId: z.ZodString;
1566
1640
  profileRevision: z.ZodString;
@@ -1590,6 +1664,11 @@ export declare const TaskFailPayloadSchema: z.ZodObject<{
1590
1664
  clientVersion: z.ZodString;
1591
1665
  reportedAt: z.ZodISODateTime;
1592
1666
  }, z.core.$strip>>;
1667
+ preparedObservation: z.ZodOptional<z.ZodObject<{
1668
+ requestDigest: z.ZodString;
1669
+ initialPromptTokens: z.ZodNumber;
1670
+ maxPromptTokens: z.ZodNumber;
1671
+ }, z.core.$strict>>;
1593
1672
  agentRef: z.ZodOptional<z.ZodObject<{
1594
1673
  agentId: z.ZodString;
1595
1674
  profileRevision: z.ZodString;
@@ -2168,6 +2247,46 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
2168
2247
  requestDigest: z.ZodString;
2169
2248
  artifactDigest: z.ZodOptional<z.ZodString>;
2170
2249
  }, z.core.$strict>;
2250
+ egressPolicy: z.ZodObject<{
2251
+ policyRevision: z.ZodString;
2252
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2253
+ mode: z.ZodLiteral<"metadata-status">;
2254
+ delivery: z.ZodLiteral<"latest-value">;
2255
+ }, z.core.$strict>, z.ZodObject<{
2256
+ mode: z.ZodLiteral<"contentful-trajectory">;
2257
+ delivery: z.ZodLiteral<"latest-value">;
2258
+ maxCoalesceMs: z.ZodNumber;
2259
+ maxEventBytes: z.ZodNumber;
2260
+ }, z.core.$strict>], "mode">;
2261
+ reliable: z.ZodObject<{
2262
+ maxPendingEventsPerAgent: z.ZodNumber;
2263
+ maxPendingBytesPerAgent: z.ZodNumber;
2264
+ maxPendingBytesPerTenant: z.ZodNumber;
2265
+ }, z.core.$strict>;
2266
+ transfers: z.ZodObject<{
2267
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
2268
+ maxBytes: z.ZodNumber;
2269
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
2270
+ }, z.core.$strict>]>;
2271
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
2272
+ maxBytes: z.ZodNumber;
2273
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
2274
+ }, z.core.$strict>]>;
2275
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
2276
+ maxBytes: z.ZodNumber;
2277
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
2278
+ }, z.core.$strict>]>;
2279
+ }, z.core.$strict>;
2280
+ }, z.core.$strict>;
2281
+ messageEgress: z.ZodOptional<z.ZodObject<{
2282
+ mode: z.ZodLiteral<"required">;
2283
+ contract: z.ZodString;
2284
+ contentType: z.ZodEnum<{
2285
+ "text/markdown": "text/markdown";
2286
+ "text/plain": "text/plain";
2287
+ }>;
2288
+ maxBytes: z.ZodNumber;
2289
+ }, z.core.$strict>>;
2171
2290
  }, z.core.$strict>;
2172
2291
  };
2173
2292
  export type TaskOfferType = keyof typeof TASK_OFFER_PAYLOAD_SCHEMAS;
@@ -2655,6 +2774,46 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2655
2774
  requestDigest: z.ZodString;
2656
2775
  artifactDigest: z.ZodOptional<z.ZodString>;
2657
2776
  }, z.core.$strict>;
2777
+ egressPolicy: z.ZodObject<{
2778
+ policyRevision: z.ZodString;
2779
+ activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
2780
+ mode: z.ZodLiteral<"metadata-status">;
2781
+ delivery: z.ZodLiteral<"latest-value">;
2782
+ }, z.core.$strict>, z.ZodObject<{
2783
+ mode: z.ZodLiteral<"contentful-trajectory">;
2784
+ delivery: z.ZodLiteral<"latest-value">;
2785
+ maxCoalesceMs: z.ZodNumber;
2786
+ maxEventBytes: z.ZodNumber;
2787
+ }, z.core.$strict>], "mode">;
2788
+ reliable: z.ZodObject<{
2789
+ maxPendingEventsPerAgent: z.ZodNumber;
2790
+ maxPendingBytesPerAgent: z.ZodNumber;
2791
+ maxPendingBytesPerTenant: z.ZodNumber;
2792
+ }, z.core.$strict>;
2793
+ transfers: z.ZodObject<{
2794
+ workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
2795
+ maxBytes: z.ZodNumber;
2796
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
2797
+ }, z.core.$strict>]>;
2798
+ transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
2799
+ maxBytes: z.ZodNumber;
2800
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
2801
+ }, z.core.$strict>]>;
2802
+ artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
2803
+ maxBytes: z.ZodNumber;
2804
+ allowedMimeTypes: z.ZodArray<z.ZodString>;
2805
+ }, z.core.$strict>]>;
2806
+ }, z.core.$strict>;
2807
+ }, z.core.$strict>;
2808
+ messageEgress: z.ZodOptional<z.ZodObject<{
2809
+ mode: z.ZodLiteral<"required">;
2810
+ contract: z.ZodString;
2811
+ contentType: z.ZodEnum<{
2812
+ "text/markdown": "text/markdown";
2813
+ "text/plain": "text/plain";
2814
+ }>;
2815
+ maxBytes: z.ZodNumber;
2816
+ }, z.core.$strict>>;
2658
2817
  }, z.core.$strict>;
2659
2818
  readonly 'conn.hello': z.ZodObject<{
2660
2819
  protocolVersions: z.ZodArray<z.ZodNumber>;
@@ -3183,6 +3342,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
3183
3342
  clientVersion: z.ZodString;
3184
3343
  reportedAt: z.ZodISODateTime;
3185
3344
  }, z.core.$strip>>;
3345
+ preparedObservation: z.ZodOptional<z.ZodObject<{
3346
+ requestDigest: z.ZodString;
3347
+ initialPromptTokens: z.ZodNumber;
3348
+ maxPromptTokens: z.ZodNumber;
3349
+ }, z.core.$strict>>;
3186
3350
  agentRef: z.ZodOptional<z.ZodObject<{
3187
3351
  agentId: z.ZodString;
3188
3352
  profileRevision: z.ZodString;
@@ -3210,6 +3374,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
3210
3374
  clientVersion: z.ZodString;
3211
3375
  reportedAt: z.ZodISODateTime;
3212
3376
  }, z.core.$strip>>;
3377
+ preparedObservation: z.ZodOptional<z.ZodObject<{
3378
+ requestDigest: z.ZodString;
3379
+ initialPromptTokens: z.ZodNumber;
3380
+ maxPromptTokens: z.ZodNumber;
3381
+ }, z.core.$strict>>;
3213
3382
  agentRef: z.ZodOptional<z.ZodObject<{
3214
3383
  agentId: z.ZodString;
3215
3384
  profileRevision: z.ZodString;
package/dist/version.d.ts CHANGED
@@ -107,5 +107,5 @@ export declare const STRICT_AGENT_ONLY_CAPABILITY: 'strict-agent-only';
107
107
  * cannot accidentally execute the instruction without the required tools.
108
108
  */
109
109
  export declare const CUSTOM_HARNESS_CAPABILITY: 'custom-harness';
110
- export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', "provider-profile-binding", 'toolset-selection', 'agent-home-contract', "strict-agent-only", "agent-egress-policy", "agent-egress-reliable-ack", "agent-message-egress", "agent-egress-fresh-session", "agent-content-workspace-read", "agent-content-transcript-read", "agent-content-artifact-read", "agent-home-projection", "agent-input-preparation", "terminal-projection-selection", "host-mcp-task-context", "custom-harness", "mailbox-read-ahead"];
110
+ export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', "provider-profile-binding", 'toolset-selection', 'agent-home-contract', "strict-agent-only", "agent-egress-policy", "agent-egress-reliable-ack", "agent-message-egress", "agent-egress-fresh-session", "agent-content-workspace-read", "agent-content-transcript-read", "agent-content-artifact-read", "agent-home-projection", "agent-input-preparation-v6", "terminal-projection-selection", "host-mcp-task-context", "custom-harness", "mailbox-read-ahead"];
111
111
  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.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "BYOK SDK wire protocol: envelope schema, message types, and codec helpers",
5
5
  "type": "module",
6
6
  "license": "MIT",