@byok-sdk/protocol 0.17.0 → 0.19.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.
@@ -651,6 +651,94 @@ export declare const TaskOfferForAgentWithEgressFreshPayloadSchema: z.ZodObject<
651
651
  }, z.core.$strict>>;
652
652
  }, z.core.$strict>;
653
653
  export type TaskOfferForAgentWithEgressFreshPayload = z.infer<typeof TaskOfferForAgentWithEgressFreshPayloadSchema>;
654
+ /**
655
+ * Strict offer for an already-counted prepared Execution.
656
+ *
657
+ * A DISTINCT message type, not a `preparation` field added to
658
+ * `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.
664
+ *
665
+ * It carries no `instruction`: the user request is already inside the frozen
666
+ * envelope the referenced record retained, and an offer that carried both would
667
+ * have two answers to what the runtime is about to send. `sessionRef` is absent
668
+ * for the same structural reason the adapter refuses the pair — a prepared
669
+ * Execution never resumes.
670
+ *
671
+ * Every value under `preparation` is the Host RE-PRESENTING what the device
672
+ * already told it. The device compares each one against its own durable record
673
+ * and declines non-retryably on any difference; nothing here is authority.
674
+ */
675
+ export declare const TaskOfferPreparedPayloadSchema: z.ZodObject<{
676
+ policy: z.ZodObject<{
677
+ mode: z.ZodEnum<{
678
+ auto: "auto";
679
+ confirm: "confirm";
680
+ plan: "plan";
681
+ readonly: "readonly";
682
+ }>;
683
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
684
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
685
+ workspaceRoot: z.ZodOptional<z.ZodString>;
686
+ network: z.ZodOptional<z.ZodBoolean>;
687
+ }, z.core.$strict>;
688
+ agentRef: z.ZodObject<{
689
+ agentId: z.ZodString;
690
+ profileRevision: z.ZodString;
691
+ }, z.core.$strict>;
692
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
693
+ runtime: z.ZodOptional<z.ZodEnum<{
694
+ claude: "claude";
695
+ codex: "codex";
696
+ pi: "pi";
697
+ }>>;
698
+ harnessId: z.ZodOptional<z.ZodString>;
699
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
700
+ lane: z.ZodLiteral<"subscription">;
701
+ runtimeId: z.ZodEnum<{
702
+ claude: "claude";
703
+ codex: "codex";
704
+ }>;
705
+ providerId: z.ZodNull;
706
+ modelId: z.ZodString;
707
+ }, z.core.$strict>, z.ZodObject<{
708
+ lane: z.ZodLiteral<"byok">;
709
+ runtimeId: z.ZodLiteral<"pi">;
710
+ providerId: z.ZodString;
711
+ modelId: z.ZodString;
712
+ }, z.core.$strict>, z.ZodObject<{
713
+ lane: z.ZodLiteral<"byok-profile">;
714
+ runtimeId: z.ZodLiteral<"pi">;
715
+ providerProfile: z.ZodObject<{
716
+ profileRef: z.ZodString;
717
+ profileRevision: z.ZodString;
718
+ profileHash: z.ZodString;
719
+ modelId: z.ZodString;
720
+ requiredCapabilities: z.ZodArray<z.ZodEnum<{
721
+ "image-input": "image-input";
722
+ }>>;
723
+ }, z.core.$strict>;
724
+ }, z.core.$strict>], "lane">>;
725
+ terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
726
+ mode: z.ZodLiteral<"none">;
727
+ }, z.core.$strict>, z.ZodObject<{
728
+ mode: z.ZodLiteral<"result-document">;
729
+ contract: z.ZodString;
730
+ }, z.core.$strict>], "mode">>;
731
+ limits: z.ZodOptional<z.ZodObject<{
732
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
733
+ maxTokens: z.ZodOptional<z.ZodNumber>;
734
+ }, z.core.$strip>>;
735
+ preparation: z.ZodObject<{
736
+ reference: z.ZodString;
737
+ requestDigest: z.ZodString;
738
+ artifactDigest: z.ZodOptional<z.ZodString>;
739
+ }, z.core.$strict>;
740
+ }, z.core.$strict>;
741
+ export type TaskOfferPreparedPayload = z.infer<typeof TaskOfferPreparedPayloadSchema>;
654
742
  /** Daemon -> cloud: one durable reliable-lane item after local sanitization. */
655
743
  export declare const AgentEgressReliablePayloadSchema: z.ZodObject<{
656
744
  agentRef: z.ZodObject<{
@@ -880,6 +968,153 @@ export declare const AgentHomeProjectionPayloadSchema: z.ZodObject<{
880
968
  projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
881
969
  }, z.core.$strict>;
882
970
  export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPayloadSchema>;
971
+ /**
972
+ * Server -> daemon: one task-free, exact-device remote input preparation.
973
+ *
974
+ * 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.
980
+ *
981
+ * What is deliberately NOT here (§17 B): `tools`, `toolExecutors`, runtime or
982
+ * compiler identity, `tenantId` and `deviceId`. The first three are local
983
+ * observations; the last two come from the device's own authenticated record,
984
+ * never from the payload — a sender that could name them could redirect a
985
+ * preparation's binding to a device it does not own.
986
+ *
987
+ * `deadlineAt` may only ever be TIGHTENED locally: the device clamps to
988
+ * `min(deadlineAt - now, limits.preparationDeadlineMs)`, so a generous Host
989
+ * deadline cannot enlarge a configured local bound.
990
+ *
991
+ * `permissionMode` is DECLARED by the requester and validated by the device;
992
+ * the device never infers it. A preparation counts tokens for one concrete
993
+ * tool manifest, and that manifest is the policy-filtered set for exactly one
994
+ * mode (`mcp/projection.ts`'s `filterMcpObservationForPolicy`) — so a
995
+ * preparation whose mode is unstated is a count of a manifest nobody named.
996
+ * The device applies the declared mode to its own observation and records it
997
+ * in the artifact binding; it is not a grant, and it authorizes nothing.
998
+ */
999
+ export declare const AgentInputPreparationPayloadSchema: z.ZodObject<{
1000
+ requestId: z.ZodUUID;
1001
+ agentRef: z.ZodObject<{
1002
+ agentId: z.ZodString;
1003
+ profileRevision: z.ZodString;
1004
+ }, z.core.$strict>;
1005
+ profileId: z.ZodString;
1006
+ policyRevision: z.ZodString;
1007
+ source: z.ZodObject<{
1008
+ revision: z.ZodString;
1009
+ digest: z.ZodString;
1010
+ }, z.core.$strict>;
1011
+ selection: z.ZodObject<{
1012
+ model: z.ZodObject<{
1013
+ id: z.ZodString;
1014
+ name: z.ZodString;
1015
+ api: z.ZodLiteral<"openai-completions">;
1016
+ provider: z.ZodString;
1017
+ baseUrl: z.ZodString;
1018
+ reasoning: z.ZodBoolean;
1019
+ input: z.ZodArray<z.ZodEnum<{
1020
+ image: "image";
1021
+ text: "text";
1022
+ }>>;
1023
+ cost: z.ZodObject<{
1024
+ input: z.ZodNumber;
1025
+ output: z.ZodNumber;
1026
+ cacheRead: z.ZodNumber;
1027
+ cacheWrite: z.ZodNumber;
1028
+ }, z.core.$strict>;
1029
+ contextWindow: z.ZodNumber;
1030
+ maxTokens: z.ZodNumber;
1031
+ thinkingLevelMap: z.ZodOptional<z.ZodObject<{
1032
+ off: z.ZodNullable<z.ZodString>;
1033
+ minimal: z.ZodNullable<z.ZodString>;
1034
+ low: z.ZodNullable<z.ZodString>;
1035
+ medium: z.ZodNullable<z.ZodString>;
1036
+ high: z.ZodNullable<z.ZodString>;
1037
+ xhigh: z.ZodNullable<z.ZodString>;
1038
+ max: z.ZodNullable<z.ZodString>;
1039
+ }, z.core.$strict>>;
1040
+ compat: z.ZodOptional<z.ZodObject<{
1041
+ supportsStore: z.ZodOptional<z.ZodBoolean>;
1042
+ supportsDeveloperRole: z.ZodOptional<z.ZodBoolean>;
1043
+ supportsReasoningEffort: z.ZodOptional<z.ZodBoolean>;
1044
+ supportsUsageInStreaming: z.ZodOptional<z.ZodBoolean>;
1045
+ maxTokensField: z.ZodOptional<z.ZodEnum<{
1046
+ max_completion_tokens: "max_completion_tokens";
1047
+ max_tokens: "max_tokens";
1048
+ }>>;
1049
+ thinkingFormat: z.ZodOptional<z.ZodEnum<{
1050
+ "ant-ling": "ant-ling";
1051
+ baseten: "baseten";
1052
+ "chat-template": "chat-template";
1053
+ deepseek: "deepseek";
1054
+ openai: "openai";
1055
+ openrouter: "openrouter";
1056
+ qwen: "qwen";
1057
+ "qwen-chat-template": "qwen-chat-template";
1058
+ "string-thinking": "string-thinking";
1059
+ together: "together";
1060
+ zai: "zai";
1061
+ }>>;
1062
+ zaiToolStream: z.ZodOptional<z.ZodBoolean>;
1063
+ }, z.core.$strict>>;
1064
+ }, z.core.$strict>;
1065
+ options: z.ZodObject<{
1066
+ cacheRetention: z.ZodEnum<{
1067
+ long: "long";
1068
+ none: "none";
1069
+ short: "short";
1070
+ }>;
1071
+ maxTokens: z.ZodNumber;
1072
+ temperature: z.ZodOptional<z.ZodNumber>;
1073
+ toolChoice: z.ZodOptional<z.ZodEnum<{
1074
+ auto: "auto";
1075
+ none: "none";
1076
+ }>>;
1077
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
1078
+ high: "high";
1079
+ low: "low";
1080
+ max: "max";
1081
+ medium: "medium";
1082
+ minimal: "minimal";
1083
+ xhigh: "xhigh";
1084
+ }>>;
1085
+ }, z.core.$strict>;
1086
+ }, z.core.$strict>;
1087
+ deadlineAt: z.ZodISODateTime;
1088
+ context: z.ZodUnion<readonly [z.ZodObject<{
1089
+ inline: z.ZodString;
1090
+ }, z.core.$strict>, z.ZodObject<{
1091
+ blobRef: z.ZodObject<{
1092
+ blobId: z.ZodString;
1093
+ contentHash: z.ZodString;
1094
+ size: z.ZodNumber;
1095
+ contentType: z.ZodString;
1096
+ url: z.ZodOptional<z.ZodString>;
1097
+ }, z.core.$strip>;
1098
+ contentHash: z.ZodString;
1099
+ }, z.core.$strict>]>;
1100
+ requiredToolsets: z.ZodArray<z.ZodString>;
1101
+ permissionMode: z.ZodEnum<{
1102
+ auto: "auto";
1103
+ confirm: "confirm";
1104
+ plan: "plan";
1105
+ readonly: "readonly";
1106
+ }>;
1107
+ accountingPolicyRef: z.ZodOptional<z.ZodObject<{
1108
+ revision: z.ZodString;
1109
+ ruledRuntime: z.ZodString;
1110
+ ruledTarget: z.ZodObject<{
1111
+ endpoint: z.ZodString;
1112
+ modelId: z.ZodString;
1113
+ }, z.core.$strict>;
1114
+ ruledResidualKeys: z.ZodArray<z.ZodString>;
1115
+ }, z.core.$strict>>;
1116
+ }, z.core.$strict>;
1117
+ export type AgentInputPreparationPayload = z.infer<typeof AgentInputPreparationPayloadSchema>;
883
1118
  /**
884
1119
  * server -> daemon: approve a pending `task.await_approval` request.
885
1120
  *
@@ -1868,6 +2103,72 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
1868
2103
  maxBytes: z.ZodNumber;
1869
2104
  }, z.core.$strict>>;
1870
2105
  }, z.core.$strict>;
2106
+ readonly 'task.offer_prepared': z.ZodObject<{
2107
+ policy: z.ZodObject<{
2108
+ mode: z.ZodEnum<{
2109
+ auto: "auto";
2110
+ confirm: "confirm";
2111
+ plan: "plan";
2112
+ readonly: "readonly";
2113
+ }>;
2114
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2115
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2116
+ workspaceRoot: z.ZodOptional<z.ZodString>;
2117
+ network: z.ZodOptional<z.ZodBoolean>;
2118
+ }, z.core.$strict>;
2119
+ agentRef: z.ZodObject<{
2120
+ agentId: z.ZodString;
2121
+ profileRevision: z.ZodString;
2122
+ }, z.core.$strict>;
2123
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
2124
+ runtime: z.ZodOptional<z.ZodEnum<{
2125
+ claude: "claude";
2126
+ codex: "codex";
2127
+ pi: "pi";
2128
+ }>>;
2129
+ harnessId: z.ZodOptional<z.ZodString>;
2130
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2131
+ lane: z.ZodLiteral<"subscription">;
2132
+ runtimeId: z.ZodEnum<{
2133
+ claude: "claude";
2134
+ codex: "codex";
2135
+ }>;
2136
+ providerId: z.ZodNull;
2137
+ modelId: z.ZodString;
2138
+ }, z.core.$strict>, z.ZodObject<{
2139
+ lane: z.ZodLiteral<"byok">;
2140
+ runtimeId: z.ZodLiteral<"pi">;
2141
+ providerId: z.ZodString;
2142
+ modelId: z.ZodString;
2143
+ }, z.core.$strict>, z.ZodObject<{
2144
+ lane: z.ZodLiteral<"byok-profile">;
2145
+ runtimeId: z.ZodLiteral<"pi">;
2146
+ providerProfile: z.ZodObject<{
2147
+ profileRef: z.ZodString;
2148
+ profileRevision: z.ZodString;
2149
+ profileHash: z.ZodString;
2150
+ modelId: z.ZodString;
2151
+ requiredCapabilities: z.ZodArray<z.ZodEnum<{
2152
+ "image-input": "image-input";
2153
+ }>>;
2154
+ }, z.core.$strict>;
2155
+ }, z.core.$strict>], "lane">>;
2156
+ terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2157
+ mode: z.ZodLiteral<"none">;
2158
+ }, z.core.$strict>, z.ZodObject<{
2159
+ mode: z.ZodLiteral<"result-document">;
2160
+ contract: z.ZodString;
2161
+ }, z.core.$strict>], "mode">>;
2162
+ limits: z.ZodOptional<z.ZodObject<{
2163
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
2164
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2165
+ }, z.core.$strip>>;
2166
+ preparation: z.ZodObject<{
2167
+ reference: z.ZodString;
2168
+ requestDigest: z.ZodString;
2169
+ artifactDigest: z.ZodOptional<z.ZodString>;
2170
+ }, z.core.$strict>;
2171
+ }, z.core.$strict>;
1871
2172
  };
1872
2173
  export type TaskOfferType = keyof typeof TASK_OFFER_PAYLOAD_SCHEMAS;
1873
2174
  export declare const TASK_OFFER_TYPES: readonly TaskOfferType[];
@@ -2289,6 +2590,72 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2289
2590
  maxBytes: z.ZodNumber;
2290
2591
  }, z.core.$strict>>;
2291
2592
  }, z.core.$strict>;
2593
+ readonly 'task.offer_prepared': z.ZodObject<{
2594
+ policy: z.ZodObject<{
2595
+ mode: z.ZodEnum<{
2596
+ auto: "auto";
2597
+ confirm: "confirm";
2598
+ plan: "plan";
2599
+ readonly: "readonly";
2600
+ }>;
2601
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2602
+ denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
2603
+ workspaceRoot: z.ZodOptional<z.ZodString>;
2604
+ network: z.ZodOptional<z.ZodBoolean>;
2605
+ }, z.core.$strict>;
2606
+ agentRef: z.ZodObject<{
2607
+ agentId: z.ZodString;
2608
+ profileRevision: z.ZodString;
2609
+ }, z.core.$strict>;
2610
+ requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
2611
+ runtime: z.ZodOptional<z.ZodEnum<{
2612
+ claude: "claude";
2613
+ codex: "codex";
2614
+ pi: "pi";
2615
+ }>>;
2616
+ harnessId: z.ZodOptional<z.ZodString>;
2617
+ dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2618
+ lane: z.ZodLiteral<"subscription">;
2619
+ runtimeId: z.ZodEnum<{
2620
+ claude: "claude";
2621
+ codex: "codex";
2622
+ }>;
2623
+ providerId: z.ZodNull;
2624
+ modelId: z.ZodString;
2625
+ }, z.core.$strict>, z.ZodObject<{
2626
+ lane: z.ZodLiteral<"byok">;
2627
+ runtimeId: z.ZodLiteral<"pi">;
2628
+ providerId: z.ZodString;
2629
+ modelId: z.ZodString;
2630
+ }, z.core.$strict>, z.ZodObject<{
2631
+ lane: z.ZodLiteral<"byok-profile">;
2632
+ runtimeId: z.ZodLiteral<"pi">;
2633
+ providerProfile: z.ZodObject<{
2634
+ profileRef: z.ZodString;
2635
+ profileRevision: z.ZodString;
2636
+ profileHash: z.ZodString;
2637
+ modelId: z.ZodString;
2638
+ requiredCapabilities: z.ZodArray<z.ZodEnum<{
2639
+ "image-input": "image-input";
2640
+ }>>;
2641
+ }, z.core.$strict>;
2642
+ }, z.core.$strict>], "lane">>;
2643
+ terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
2644
+ mode: z.ZodLiteral<"none">;
2645
+ }, z.core.$strict>, z.ZodObject<{
2646
+ mode: z.ZodLiteral<"result-document">;
2647
+ contract: z.ZodString;
2648
+ }, z.core.$strict>], "mode">>;
2649
+ limits: z.ZodOptional<z.ZodObject<{
2650
+ maxDurationMs: z.ZodOptional<z.ZodNumber>;
2651
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2652
+ }, z.core.$strip>>;
2653
+ preparation: z.ZodObject<{
2654
+ reference: z.ZodString;
2655
+ requestDigest: z.ZodString;
2656
+ artifactDigest: z.ZodOptional<z.ZodString>;
2657
+ }, z.core.$strict>;
2658
+ }, z.core.$strict>;
2292
2659
  readonly 'conn.hello': z.ZodObject<{
2293
2660
  protocolVersions: z.ZodArray<z.ZodNumber>;
2294
2661
  capabilities: z.ZodArray<z.ZodString>;
@@ -2540,6 +2907,124 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
2540
2907
  projectionHash: z.ZodString;
2541
2908
  projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
2542
2909
  }, z.core.$strict>;
2910
+ readonly 'agent.input.preparation': z.ZodObject<{
2911
+ requestId: z.ZodUUID;
2912
+ agentRef: z.ZodObject<{
2913
+ agentId: z.ZodString;
2914
+ profileRevision: z.ZodString;
2915
+ }, z.core.$strict>;
2916
+ profileId: z.ZodString;
2917
+ policyRevision: z.ZodString;
2918
+ source: z.ZodObject<{
2919
+ revision: z.ZodString;
2920
+ digest: z.ZodString;
2921
+ }, z.core.$strict>;
2922
+ selection: z.ZodObject<{
2923
+ model: z.ZodObject<{
2924
+ id: z.ZodString;
2925
+ name: z.ZodString;
2926
+ api: z.ZodLiteral<"openai-completions">;
2927
+ provider: z.ZodString;
2928
+ baseUrl: z.ZodString;
2929
+ reasoning: z.ZodBoolean;
2930
+ input: z.ZodArray<z.ZodEnum<{
2931
+ image: "image";
2932
+ text: "text";
2933
+ }>>;
2934
+ cost: z.ZodObject<{
2935
+ input: z.ZodNumber;
2936
+ output: z.ZodNumber;
2937
+ cacheRead: z.ZodNumber;
2938
+ cacheWrite: z.ZodNumber;
2939
+ }, z.core.$strict>;
2940
+ contextWindow: z.ZodNumber;
2941
+ maxTokens: z.ZodNumber;
2942
+ thinkingLevelMap: z.ZodOptional<z.ZodObject<{
2943
+ off: z.ZodNullable<z.ZodString>;
2944
+ minimal: z.ZodNullable<z.ZodString>;
2945
+ low: z.ZodNullable<z.ZodString>;
2946
+ medium: z.ZodNullable<z.ZodString>;
2947
+ high: z.ZodNullable<z.ZodString>;
2948
+ xhigh: z.ZodNullable<z.ZodString>;
2949
+ max: z.ZodNullable<z.ZodString>;
2950
+ }, z.core.$strict>>;
2951
+ compat: z.ZodOptional<z.ZodObject<{
2952
+ supportsStore: z.ZodOptional<z.ZodBoolean>;
2953
+ supportsDeveloperRole: z.ZodOptional<z.ZodBoolean>;
2954
+ supportsReasoningEffort: z.ZodOptional<z.ZodBoolean>;
2955
+ supportsUsageInStreaming: z.ZodOptional<z.ZodBoolean>;
2956
+ maxTokensField: z.ZodOptional<z.ZodEnum<{
2957
+ max_completion_tokens: "max_completion_tokens";
2958
+ max_tokens: "max_tokens";
2959
+ }>>;
2960
+ thinkingFormat: z.ZodOptional<z.ZodEnum<{
2961
+ "ant-ling": "ant-ling";
2962
+ baseten: "baseten";
2963
+ "chat-template": "chat-template";
2964
+ deepseek: "deepseek";
2965
+ openai: "openai";
2966
+ openrouter: "openrouter";
2967
+ qwen: "qwen";
2968
+ "qwen-chat-template": "qwen-chat-template";
2969
+ "string-thinking": "string-thinking";
2970
+ together: "together";
2971
+ zai: "zai";
2972
+ }>>;
2973
+ zaiToolStream: z.ZodOptional<z.ZodBoolean>;
2974
+ }, z.core.$strict>>;
2975
+ }, z.core.$strict>;
2976
+ options: z.ZodObject<{
2977
+ cacheRetention: z.ZodEnum<{
2978
+ long: "long";
2979
+ none: "none";
2980
+ short: "short";
2981
+ }>;
2982
+ maxTokens: z.ZodNumber;
2983
+ temperature: z.ZodOptional<z.ZodNumber>;
2984
+ toolChoice: z.ZodOptional<z.ZodEnum<{
2985
+ auto: "auto";
2986
+ none: "none";
2987
+ }>>;
2988
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
2989
+ high: "high";
2990
+ low: "low";
2991
+ max: "max";
2992
+ medium: "medium";
2993
+ minimal: "minimal";
2994
+ xhigh: "xhigh";
2995
+ }>>;
2996
+ }, z.core.$strict>;
2997
+ }, z.core.$strict>;
2998
+ deadlineAt: z.ZodISODateTime;
2999
+ context: z.ZodUnion<readonly [z.ZodObject<{
3000
+ inline: z.ZodString;
3001
+ }, z.core.$strict>, z.ZodObject<{
3002
+ blobRef: z.ZodObject<{
3003
+ blobId: z.ZodString;
3004
+ contentHash: z.ZodString;
3005
+ size: z.ZodNumber;
3006
+ contentType: z.ZodString;
3007
+ url: z.ZodOptional<z.ZodString>;
3008
+ }, z.core.$strip>;
3009
+ contentHash: z.ZodString;
3010
+ }, z.core.$strict>]>;
3011
+ requiredToolsets: z.ZodArray<z.ZodString>;
3012
+ permissionMode: z.ZodEnum<{
3013
+ auto: "auto";
3014
+ confirm: "confirm";
3015
+ plan: "plan";
3016
+ readonly: "readonly";
3017
+ }>;
3018
+ accountingPolicyRef: z.ZodOptional<z.ZodObject<{
3019
+ revision: z.ZodString;
3020
+ ruledRuntime: z.ZodString;
3021
+ ruledTarget: z.ZodObject<{
3022
+ endpoint: z.ZodString;
3023
+ modelId: z.ZodString;
3024
+ }, z.core.$strict>;
3025
+ ruledResidualKeys: z.ZodArray<z.ZodString>;
3026
+ }, z.core.$strict>>;
3027
+ }, z.core.$strict>;
2543
3028
  readonly 'task.approve': z.ZodObject<{
2544
3029
  approvalId: z.ZodOptional<z.ZodString>;
2545
3030
  }, z.core.$strip>;
@@ -2771,7 +3256,7 @@ export declare const MESSAGE_TYPES: MessageType[];
2771
3256
  * (`envelope.ts`) to decide which branches require envelope `seq` (M1
2772
3257
  * redelivery cursor).
2773
3258
  */
2774
- 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.message.disposition", "agent.content.read", "agent.home.projection", "task.approve", "task.reject", "task.cancel", "task.steer"];
3259
+ 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", "task.offer_prepared", "agent.egress.ack", "agent.message.disposition", "agent.content.read", "agent.home.projection", "agent.input.preparation", "task.approve", "task.reject", "task.cancel", "task.steer"];
2775
3260
  /**
2776
3261
  * Message types the daemon sends to the server — the flip side of
2777
3262
  * {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The device-level half of the task lane's capability gate (contract §8.1).
3
+ *
4
+ * Contract §8.1 fixes ONE name, `host-mcp-task-context`, carried on two
5
+ * independent channels that must both be in place before a host may route a
6
+ * tool invocation through the task lane:
7
+ *
8
+ * 1. **Deployment level** — the ADR-010 `CapabilityDeclarationSchema` a
9
+ * deployment serves (`@byok-sdk/cloud`'s `CLOUD_CAPABILITIES`). §8.2(1)
10
+ * governs it: a deployment declares the capability only once it is
11
+ * completely implemented.
12
+ * 2. **Device level** — this constant: a `conn.hello` capability string a host
13
+ * consumes through `declaresCapabilities`. §8.3 governs it: a device whose
14
+ * build cannot serve the lane simply does not advertise it, and the host
15
+ * answers `unavailable` rather than reaching for the device assertion the
16
+ * task lane does not accept.
17
+ *
18
+ * It lives in `@byok-sdk/protocol` for the same reason every other daemon
19
+ * capability flag does: this package is the wire vocabulary both sides compile
20
+ * against, and a name spelled twice is a name that can drift. It is registered
21
+ * in `CAPABILITY_FLAGS` (`./version`), which is what makes it a value a daemon
22
+ * can actually send.
23
+ *
24
+ * The spelling satisfies `@byok-sdk/core`'s `CAPABILITY_NAME_PATTERN`
25
+ * (`/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/`) on purpose: the deployment-level channel
26
+ * carries this exact literal, so a name legal in only one of the two channels
27
+ * would leave them naming different things.
28
+ */
29
+ /** Contract §8.1's capability gate for `byok-task-assertion-v1` tool authority. */
30
+ export declare const HOST_MCP_TASK_CONTEXT_CAPABILITY: 'host-mcp-task-context';
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", "terminal-projection-selection", "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", "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.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "BYOK SDK wire protocol: envelope schema, message types, and codec helpers",
5
5
  "type": "module",
6
6
  "license": "MIT",