@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.
package/dist/index.d.ts CHANGED
@@ -13,21 +13,24 @@ export { AgentEgressPolicySchema, AgentEgressActivityPolicySchema, AgentReliable
13
13
  export type { AgentEgressPolicy, AgentEgressActivityPolicy, AgentReliableQuotaPolicy, ContentReadPolicy, AgentEgressLane, AgentEgressDropReason, AgentMessageContentType, AgentMessageEgressRequirement, AgentMessageServerContext, AgentContentReadSurface, AgentContentActorKind, AgentContentActor, AgentContentDecodeAs, AgentContentReadDecision, AgentContentReadDenialReason, } from './agent-egress';
14
14
  export { AGENT_HOME_PROJECTION_CAPABILITY, AGENT_HOME_PROJECTION_MAX_BYTES, AGENT_HOME_PROJECTION_PROFILE_REVISION_MAXIMUM, AgentHomeProjectionProfileRevisionSchema, AgentHomeProjectionHashSchema, AgentHomeProjectionOutcomeSchema, AgentHomeProjectionValueSchema, } from './agent-home-projection';
15
15
  export type { AgentHomeProjectionProfileRevision, AgentHomeProjectionHash, AgentHomeProjectionOutcome, AgentHomeProjectionValue, } from './agent-home-projection';
16
+ export { AGENT_INPUT_PREPARATION_CAPABILITY, InputPreparationContentHashSchema, InputPreparationPermissionModeSchema, InputPreparationPolicyRevisionSchema, InputPreparationProfileIdSchema, InputPreparationSourceSchema, InputPreparationModelCostSchema, InputPreparationModelSchema, InputPreparationOptionsSchema, InputPreparationSelectionSchema, InputPreparationContextFileSchema, InputPreparationDocsPathsSchema, InputPreparationSkillSchema, InputPreparationPromptSnapshotSchema, InputPreparationUserMessageSchema, InputPreparationHostCanonicalAssistantMessageSchema, InputPreparationMessageSchema, InputPreparationContextDocumentSchema, InputPreparationStateSchema, InputPreparationReadinessReasonSchema, InputPreparationRuntimeIdentitySchema, InputPreparationCounterTargetSchema, InputPreparationAccountingPolicyRefSchema, InputPreparationCounterProviderEvidenceSchema, InputPreparationCounterEvidenceSchema, InputPreparationResidualValueClassSchema, InputPreparationResidualKeySchema, InputPreparationProjectionSchema, InputPreparationToolImplementationKindSchema, InputPreparationArtifactSummarySchema, InputPreparationBindingSchema, InputPreparationReceiptSummarySchema, InputPreparationReferenceSchema, InputPreparationOfferBindingSchema, InputPreparationRejectionReasonSchema, } from './input-preparation';
17
+ export type { InputPreparationPermissionMode, InputPreparationSource, InputPreparationModel, InputPreparationOptions, InputPreparationSelection, InputPreparationSkill, InputPreparationMessage, InputPreparationContextDocument, InputPreparationState, InputPreparationReadinessReason, InputPreparationAccountingPolicyRef, InputPreparationResidualValueClass, InputPreparationRuntimeIdentity, InputPreparationReceiptSummary, InputPreparationOfferBinding, InputPreparationRejectionReason, } from './input-preparation';
16
18
  export { AGENT_MEMORY_PROJECTION_CAPABILITY, AGENT_MEMORY_PROJECTION_MAX_REDACTED_BYTES, AGENT_MEMORY_PROJECTION_MAX_ORDERING_VALUE, AgentMemoryProjectionGrantRefSchema, AgentMemoryProjectionSessionRefSchema, AgentMemoryProjectionWriterEpochSchema, AgentMemoryProjectionSourceSeqSchema, AgentMemoryProjectionSnapshotSchema, AgentMemoryProjectionMeteringReceiptSchema, AgentMemoryProjectionMutationSchema, AgentMemoryProjectionReceiptSchema, AgentMemoryProjectionEraseResultSchema, agentMemoryProjectionBase64UrlByteLength, } from './agent-memory-projection';
17
19
  export type { AgentMemoryProjectionGrantRef, AgentMemoryProjectionSessionRef, AgentMemoryProjectionWriterEpoch, AgentMemoryProjectionSourceSeq, AgentMemoryProjectionSnapshot, AgentMemoryProjectionMeteringReceipt, AgentMemoryProjectionMutation, AgentMemoryProjectionReceipt, AgentMemoryProjectionEraseResult, } from './agent-memory-projection';
20
+ export { HOST_MCP_TASK_CONTEXT_CAPABILITY } from './task-assertion';
18
21
  export { TERMINAL_PROJECTION_SELECTION_CAPABILITY, TerminalProjectionContractSchema, TerminalProjectionSelectionSchema, } from './terminal-projection';
19
22
  export type { TerminalProjectionSelection } from './terminal-projection';
20
23
  export { TASK_STATES, TASK_TRANSITIONS, canTransition } from './task-state';
21
24
  export type { TaskState } from './task-state';
22
- export { MESSAGE_TYPES, TASK_OFFER_TYPES, isTaskOfferType, MESSAGE_PAYLOAD_SCHEMAS, SERVER_TO_DAEMON_TYPES, DAEMON_TO_SERVER_TYPES, RuntimeIdSchema, ProtocolVersionNumberSchema, RuntimeInfoSchema, HarnessIdSchema, HarnessInfoSchema, HarnessInventorySchema, RuntimeCapabilitiesSchema, AgentRefSchema, AgentHomeProjectionAgentRefSchema, AGENT_REF_MAX_BYTES, DispatchSelectionSchema, ToolsetIdSchema, ConfiguredToolsetsSchema, RequiredToolsetsSchema, CONFIGURED_TOOLSETS_MAX_ITEMS, ConnHelloPayloadSchema, ConnAckPayloadSchema, TaskOfferPayloadSchema, TaskOfferWithToolsetsPayloadSchema, TaskOfferForAgentPayloadSchema, TaskOfferForAgentWithEgressPayloadSchema, TaskOfferForAgentWithEgressFreshPayloadSchema, AgentEgressReliablePayloadSchema, AgentEgressAckPayloadSchema, AgentMessagePublishPayloadSchema, AgentMessageDispositionPayloadSchema, AgentContentReadPayloadSchema, AgentContentReceiptPayloadSchema, AgentHomeProjectionPayloadSchema, TaskApprovePayloadSchema, TaskRejectPayloadSchema, TaskCancelPayloadSchema, TaskSteerPayloadSchema, TaskClaimPayloadSchema, TaskStartedPayloadSchema, TaskDeclinePayloadSchema, TaskProgressPayloadSchema, TaskArtifactPayloadSchema, TaskAwaitApprovalPayloadSchema, TaskCompletePayloadSchema, TaskFailPayloadSchema, TaskCancelledPayloadSchema, TaskApprovalResolvedPayloadSchema, RESULT_DOCUMENT_MAX_BYTES, checkResultDocument, TerminalInferenceUsageSchema, TERMINAL_INFERENCE_USAGE_MAX_TOKENS, TERMINAL_INFERENCE_USAGE_MAX_DURATION_MS, TERMINAL_INFERENCE_USAGE_PROVIDER_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_CLIENT_VERSION_MAX_LENGTH, } from './messages';
23
- export type { ResultDocumentCheck, MessageType, RuntimeId, RuntimeInfo, RuntimeCapabilities, AgentRef, AgentHomeProjectionAgentRef, DispatchSelection, ToolsetId, ConnHelloPayload, ConnAckPayload, TaskOfferPayload, TaskOfferWithToolsetsPayload, TaskOfferForAgentPayload, TaskOfferForAgentWithEgressPayload, TaskOfferForAgentWithEgressFreshPayload, AgentEgressReliablePayload, AgentEgressAckPayload, AgentMessagePublishPayload, AgentMessageDispositionPayload, AgentContentReadPayload, AgentContentReceiptPayload, AgentHomeProjectionPayload, TaskApprovePayload, TaskRejectPayload, TaskCancelPayload, TaskSteerPayload, TaskClaimPayload, TaskStartedPayload, TaskDeclinePayload, TaskProgressPayload, TaskArtifactPayload, TaskAwaitApprovalPayload, TaskCompletePayload, TaskFailPayload, TaskCancelledPayload, TaskApprovalResolvedPayload, TerminalInferenceUsage, } from './messages';
25
+ export { MESSAGE_TYPES, TASK_OFFER_TYPES, isTaskOfferType, MESSAGE_PAYLOAD_SCHEMAS, SERVER_TO_DAEMON_TYPES, DAEMON_TO_SERVER_TYPES, RuntimeIdSchema, ProtocolVersionNumberSchema, RuntimeInfoSchema, HarnessIdSchema, HarnessInfoSchema, HarnessInventorySchema, RuntimeCapabilitiesSchema, AgentRefSchema, AgentHomeProjectionAgentRefSchema, AGENT_REF_MAX_BYTES, DispatchSelectionSchema, ToolsetIdSchema, ConfiguredToolsetsSchema, RequiredToolsetsSchema, CONFIGURED_TOOLSETS_MAX_ITEMS, ConnHelloPayloadSchema, ConnAckPayloadSchema, TaskOfferPayloadSchema, TaskOfferWithToolsetsPayloadSchema, TaskOfferForAgentPayloadSchema, TaskOfferForAgentWithEgressPayloadSchema, TaskOfferForAgentWithEgressFreshPayloadSchema, TaskOfferPreparedPayloadSchema, AgentEgressReliablePayloadSchema, AgentEgressAckPayloadSchema, AgentMessagePublishPayloadSchema, AgentMessageDispositionPayloadSchema, AgentContentReadPayloadSchema, AgentContentReceiptPayloadSchema, AgentHomeProjectionPayloadSchema, AgentInputPreparationPayloadSchema, TaskApprovePayloadSchema, TaskRejectPayloadSchema, TaskCancelPayloadSchema, TaskSteerPayloadSchema, TaskClaimPayloadSchema, TaskStartedPayloadSchema, TaskDeclinePayloadSchema, TaskProgressPayloadSchema, TaskArtifactPayloadSchema, TaskAwaitApprovalPayloadSchema, TaskCompletePayloadSchema, TaskFailPayloadSchema, TaskCancelledPayloadSchema, TaskApprovalResolvedPayloadSchema, RESULT_DOCUMENT_MAX_BYTES, checkResultDocument, TerminalInferenceUsageSchema, TERMINAL_INFERENCE_USAGE_MAX_TOKENS, TERMINAL_INFERENCE_USAGE_MAX_DURATION_MS, TERMINAL_INFERENCE_USAGE_PROVIDER_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_CLIENT_VERSION_MAX_LENGTH, } from './messages';
26
+ export type { ResultDocumentCheck, MessageType, RuntimeId, RuntimeInfo, RuntimeCapabilities, AgentRef, AgentHomeProjectionAgentRef, DispatchSelection, ToolsetId, ConnHelloPayload, ConnAckPayload, TaskOfferPayload, TaskOfferWithToolsetsPayload, TaskOfferForAgentPayload, TaskOfferForAgentWithEgressPayload, TaskOfferForAgentWithEgressFreshPayload, TaskOfferPreparedPayload, AgentEgressReliablePayload, AgentEgressAckPayload, AgentMessagePublishPayload, AgentMessageDispositionPayload, AgentContentReadPayload, AgentContentReceiptPayload, AgentHomeProjectionPayload, AgentInputPreparationPayload, TaskApprovePayload, TaskRejectPayload, TaskCancelPayload, TaskSteerPayload, TaskClaimPayload, TaskStartedPayload, TaskDeclinePayload, TaskProgressPayload, TaskArtifactPayload, TaskAwaitApprovalPayload, TaskCompletePayload, TaskFailPayload, TaskCancelledPayload, TaskApprovalResolvedPayload, TerminalInferenceUsage, } from './messages';
24
27
  export { EnvelopeSchema, isServerToDaemonType } from './envelope';
25
28
  export type { Envelope } from './envelope';
26
29
  export { ProtocolError, EnvelopeParseError, UnknownMessageTypeError, EnvelopeValidationError, } from './errors';
27
30
  export { encodeEnvelope, decodeEnvelope, createEnvelope, parseMessage } from './codec';
28
31
  export type { CreateEnvelopeOptions } from './codec';
29
- export { PairRequestSchema, PairResponseTenantIdSchema, PAIR_RESPONSE_TENANT_ID_MAX_LENGTH, PairResponseSchema, ChallengeRequestSchema, ChallengeResponseSchema, TokenRequestSchema, TokenResponseSchema, PresencePublishRequestSchema, CreateBlobRequestSchema, CreateBlobResponseSchema, BlobDownloadUrlResponseSchema, EventsPollQuerySchema, EventsPollResponseSchema, MessagesSendRequestSchema, MessagesSendResponseSchema, AgentHomeProjectionCompletionRequestSchema, AgentHomeProjectionStatusSchema, AgentHomeProjectionReadbackSchema, AgentMemoryProjectionCommitRequestSchema, AgentMemoryProjectionCommitResponseSchema, MAX_MESSAGES_PER_BATCH, BYOK_PAIR_PATH, BYOK_CHALLENGE_PATH, BYOK_TOKEN_PATH, BYOK_CAPABILITIES_PATH, BYOK_EVENTS_PATH, BYOK_MESSAGES_PATH, BYOK_AGENT_HOME_PROJECTIONS_PATH, BYOK_AGENT_HOME_PROJECTION_COMPLETION_ROUTE, byokAgentHomeProjectionCompletionPath, BYOK_AGENT_MEMORY_PROJECTIONS_PATH, BYOK_PRESENCE_PATH, BYOK_ACTIVITY_PATH, BYOK_BOARD_PATH, BYOK_BOARD_STREAM_PATH, BYOK_BOARD_CLAIM_ROUTE, BYOK_BOARD_UNCLAIM_ROUTE, BYOK_BOARD_STATUS_ROUTE, BYOK_RECORDS_PATH, BYOK_RECORD_ROUTE, byokRecordPath, BYOK_SKILL_PACKS_PATH, BYOK_SKILL_PACK_FILE_ROUTE, byokSkillPackFilePath, BYOK_BLOBS_PATH, BYOK_BLOB_FINALIZE_ROUTE, BYOK_BLOB_URL_ROUTE, BYOK_BLOB_CONTENT_ROUTE, byokBlobFinalizePath, byokBlobUrlPath, byokBlobContentPath, } from './http-api';
30
- export type { PairRequest, PairResponse, ChallengeRequest, ChallengeResponse, TokenRequest, TokenResponse, PresencePublishRequest, CreateBlobRequest, CreateBlobResponse, BlobDownloadUrlResponse, EventsPollQuery, EventsPollResponse, MessagesSendRequest, MessagesSendResponse, AgentHomeProjectionCompletionRequest, AgentHomeProjectionStatus, AgentHomeProjectionReadback, AgentMemoryProjectionCommitRequest, AgentMemoryProjectionCommitResponse, } from './http-api';
32
+ export { PairRequestSchema, PairResponseTenantIdSchema, PAIR_RESPONSE_TENANT_ID_MAX_LENGTH, PairResponseSchema, ChallengeRequestSchema, ChallengeResponseSchema, TokenRequestSchema, TokenResponseSchema, PresencePublishRequestSchema, CreateBlobRequestSchema, CreateBlobResponseSchema, BlobDownloadUrlResponseSchema, EventsPollQuerySchema, EventsPollResponseSchema, MessagesSendRequestSchema, MessagesSendResponseSchema, AgentHomeProjectionCompletionRequestSchema, AgentHomeProjectionStatusSchema, AgentHomeProjectionReadbackSchema, AgentMemoryProjectionCommitRequestSchema, AgentMemoryProjectionCommitResponseSchema, MAX_MESSAGES_PER_BATCH, BYOK_PAIR_PATH, BYOK_CHALLENGE_PATH, BYOK_TOKEN_PATH, BYOK_CAPABILITIES_PATH, BYOK_EVENTS_PATH, BYOK_MESSAGES_PATH, BYOK_AGENT_HOME_PROJECTIONS_PATH, BYOK_AGENT_HOME_PROJECTION_COMPLETION_ROUTE, byokAgentHomeProjectionCompletionPath, BYOK_AGENT_MEMORY_PROJECTIONS_PATH, BYOK_PRESENCE_PATH, BYOK_ACTIVITY_PATH, BYOK_BOARD_PATH, BYOK_BOARD_STREAM_PATH, BYOK_BOARD_CLAIM_ROUTE, BYOK_BOARD_UNCLAIM_ROUTE, BYOK_BOARD_STATUS_ROUTE, BYOK_RECORDS_PATH, BYOK_RECORD_ROUTE, byokRecordPath, BYOK_SKILL_PACKS_PATH, BYOK_SKILL_PACK_FILE_ROUTE, byokSkillPackFilePath, BYOK_BLOBS_PATH, BYOK_BLOB_FINALIZE_ROUTE, BYOK_BLOB_URL_ROUTE, BYOK_BLOB_CONTENT_ROUTE, byokBlobFinalizePath, byokBlobUrlPath, byokBlobContentPath, BYOK_INPUT_PREPARATIONS_PATH, BYOK_INPUT_PREPARATION_COMPLETION_ROUTE, BYOK_INPUT_PREPARATION_STATUS_ROUTE, byokInputPreparationCompletionPath, byokInputPreparationStatusPath, InputPreparationCompletionRequestSchema, InputPreparationStatusSchema, InputPreparationReadbackSchema, InputPreparationStatusQuerySchema, } from './http-api';
33
+ export type { PairRequest, PairResponse, ChallengeRequest, ChallengeResponse, TokenRequest, TokenResponse, PresencePublishRequest, CreateBlobRequest, CreateBlobResponse, BlobDownloadUrlResponse, EventsPollQuery, EventsPollResponse, MessagesSendRequest, MessagesSendResponse, AgentHomeProjectionCompletionRequest, AgentHomeProjectionStatus, AgentHomeProjectionReadback, AgentMemoryProjectionCommitRequest, AgentMemoryProjectionCommitResponse, InputPreparationCompletionRequest, InputPreparationStatus, InputPreparationReadback, InputPreparationStatusQuery, } from './http-api';
31
34
  export type { TaskOfferType } from './messages';
32
35
  export type { HarnessId, HarnessInfo } from './messages';
33
36
  export { CUSTOM_HARNESS_CAPABILITY } from './version';
package/dist/index.js CHANGED
@@ -113,6 +113,336 @@ var AgentHomeProjectionValueSchema = z.json().refine(
113
113
  (value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= AGENT_HOME_PROJECTION_MAX_BYTES,
114
114
  `projection must not exceed ${AGENT_HOME_PROJECTION_MAX_BYTES} UTF-8 JSON bytes`
115
115
  );
116
+ var PERMISSION_MODES = ["auto", "confirm", "readonly", "plan"];
117
+ var PermissionPolicySchema = z.object({
118
+ mode: z.enum(PERMISSION_MODES),
119
+ allowTools: z.array(z.string()).optional(),
120
+ denyTools: z.array(z.string()).optional(),
121
+ workspaceRoot: z.string().optional(),
122
+ network: z.boolean().optional()
123
+ }).strict();
124
+
125
+ // src/input-preparation.ts
126
+ var AGENT_INPUT_PREPARATION_CAPABILITY = "agent-input-preparation";
127
+ var InputPreparationContentHashSchema = AgentEgressContentHashSchema;
128
+ var OPAQUE_ID = z.string().min(1).max(512).regex(/^[^\u0000-\u001f\u007f]+$/u, "control identifiers must not contain control characters");
129
+ var OPAQUE_TEXT = z.string().min(1).max(2048).regex(/^[^\u0000-\u001f\u007f]+$/u, "control text must not contain control characters");
130
+ var InputPreparationPolicyRevisionSchema = OPAQUE_ID;
131
+ var InputPreparationProfileIdSchema = OPAQUE_ID;
132
+ var InputPreparationPermissionModeSchema = z.enum(PERMISSION_MODES);
133
+ var InputPreparationSourceSchema = z.object({ revision: OPAQUE_ID, digest: OPAQUE_ID }).strict();
134
+ var InputPreparationModelCostSchema = z.object({
135
+ input: z.number().finite(),
136
+ output: z.number().finite(),
137
+ cacheRead: z.number().finite(),
138
+ cacheWrite: z.number().finite()
139
+ }).strict();
140
+ var THINKING_EFFORT = z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/u).nullable();
141
+ var InputPreparationThinkingLevelMapSchema = z.object({
142
+ off: THINKING_EFFORT,
143
+ minimal: THINKING_EFFORT,
144
+ low: THINKING_EFFORT,
145
+ medium: THINKING_EFFORT,
146
+ high: THINKING_EFFORT,
147
+ xhigh: THINKING_EFFORT,
148
+ max: THINKING_EFFORT
149
+ }).strict();
150
+ var InputPreparationModelCompatSchema = z.object({
151
+ supportsStore: z.boolean().optional(),
152
+ supportsDeveloperRole: z.boolean().optional(),
153
+ supportsReasoningEffort: z.boolean().optional(),
154
+ supportsUsageInStreaming: z.boolean().optional(),
155
+ maxTokensField: z.enum(["max_completion_tokens", "max_tokens"]).optional(),
156
+ thinkingFormat: z.enum([
157
+ "openai",
158
+ "openrouter",
159
+ "deepseek",
160
+ "together",
161
+ "baseten",
162
+ "zai",
163
+ "qwen",
164
+ "chat-template",
165
+ "qwen-chat-template",
166
+ "string-thinking",
167
+ "ant-ling"
168
+ ]).optional(),
169
+ zaiToolStream: z.boolean().optional()
170
+ }).strict();
171
+ var InputPreparationModelSchema = z.object({
172
+ id: OPAQUE_ID,
173
+ name: OPAQUE_ID,
174
+ api: z.literal("openai-completions"),
175
+ provider: OPAQUE_ID,
176
+ baseUrl: OPAQUE_TEXT,
177
+ reasoning: z.boolean(),
178
+ input: z.array(z.enum(["text", "image"])).min(1).max(8),
179
+ cost: InputPreparationModelCostSchema,
180
+ contextWindow: z.number().int().positive(),
181
+ maxTokens: z.number().int().positive(),
182
+ thinkingLevelMap: InputPreparationThinkingLevelMapSchema.optional(),
183
+ compat: InputPreparationModelCompatSchema.optional()
184
+ }).strict();
185
+ var InputPreparationOptionsSchema = z.object({
186
+ cacheRetention: z.enum(["none", "short", "long"]),
187
+ maxTokens: z.number().int().positive(),
188
+ temperature: z.number().finite().optional(),
189
+ toolChoice: z.enum(["auto", "none"]).optional(),
190
+ reasoningEffort: z.enum(["minimal", "low", "medium", "high", "xhigh", "max"]).optional()
191
+ }).strict();
192
+ var InputPreparationSelectionSchema = z.object({ model: InputPreparationModelSchema, options: InputPreparationOptionsSchema }).strict();
193
+ var CONTEXT_PATH = z.string().max(4096).regex(/^[^\u0000]*$/u, "paths must not contain a NUL character");
194
+ var InputPreparationContextFileSchema = z.object({ path: CONTEXT_PATH, content: z.string() }).strict();
195
+ var InputPreparationDocsPathsSchema = z.object({ readmePath: CONTEXT_PATH, docsPath: CONTEXT_PATH, examplesPath: CONTEXT_PATH }).strict();
196
+ var InputPreparationSkillSchema = z.object({
197
+ name: OPAQUE_ID,
198
+ description: z.string().max(4096),
199
+ filePath: CONTEXT_PATH,
200
+ disableModelInvocation: z.boolean()
201
+ }).strict();
202
+ var InputPreparationPromptSnapshotSchema = z.object({
203
+ customPrompt: z.string().optional(),
204
+ appendSystemPrompt: z.string().optional(),
205
+ cwd: CONTEXT_PATH,
206
+ toolSnippets: z.record(z.string(), z.string()),
207
+ toolGuidelines: z.record(z.string(), z.array(z.string()).max(512)),
208
+ promptGuidelines: z.array(z.string()).max(512),
209
+ contextFiles: z.array(InputPreparationContextFileSchema).max(512),
210
+ skills: z.array(InputPreparationSkillSchema).max(512),
211
+ docsPaths: InputPreparationDocsPathsSchema
212
+ }).strict();
213
+ var InputPreparationUserMessageSchema = z.object({
214
+ role: z.literal("user"),
215
+ content: z.string(),
216
+ timestamp: z.number().int()
217
+ }).strict();
218
+ var InputPreparationHostCanonicalAssistantMessageSchema = z.object({
219
+ role: z.literal("assistant"),
220
+ origin: z.literal("host_canonical"),
221
+ content: z.string(),
222
+ timestamp: z.number().int()
223
+ }).strict();
224
+ var InputPreparationMessageSchema = z.discriminatedUnion("role", [
225
+ InputPreparationUserMessageSchema,
226
+ InputPreparationHostCanonicalAssistantMessageSchema
227
+ ]);
228
+ var InputPreparationContextDocumentSchema = z.object({
229
+ prompt: InputPreparationPromptSnapshotSchema,
230
+ messages: z.array(InputPreparationMessageSchema).max(4096)
231
+ }).strict();
232
+ var InputPreparationStateSchema = z.enum([
233
+ "reserved",
234
+ "counting",
235
+ "counted",
236
+ "cancelled",
237
+ "failed",
238
+ "counter_interrupted"
239
+ ]);
240
+ var InputPreparationReadinessReasonSchema = z.enum([
241
+ "not_counted",
242
+ "counter_interrupted",
243
+ "cancelled",
244
+ "failed",
245
+ "artifact_expired",
246
+ "counter_authority_not_production",
247
+ "counter_coverage_incomplete",
248
+ /** No counter evidence is persisted on the record. */
249
+ "counter_missing",
250
+ /** The native compiler's projection kind is not `content_complete`. */
251
+ "projection_unknown",
252
+ /** The artifact carries a residual key the accounting policy does not rule on. */
253
+ "residual_not_ruled",
254
+ /** The request named no accounting policy. There is no default. */
255
+ "accounting_policy_missing",
256
+ /** The named policy was ruled for a different runtime, endpoint or model. */
257
+ "accounting_policy_inapplicable",
258
+ "executor_identity_unproven",
259
+ /**
260
+ * The record was prepared against a runtime contract this build no longer
261
+ * speaks: its binding declares a prepared-compiler version other than the one
262
+ * this build prepares and consumes against. The artifact is not re-read
263
+ * through the current contract and is not translated — a projection frozen
264
+ * under another compiler's classification table is evidence about a request
265
+ * this build cannot re-derive.
266
+ */
267
+ "runtime_contract_superseded"
268
+ ]);
269
+ var InputPreparationRuntimeIdentitySchema = z.object({
270
+ packageName: OPAQUE_ID,
271
+ packageVersion: OPAQUE_ID,
272
+ upstreamBase: OPAQUE_ID,
273
+ upstreamCommit: OPAQUE_ID,
274
+ forkBuild: z.number().int().nonnegative(),
275
+ envelopeFormat: OPAQUE_ID,
276
+ requestFormat: OPAQUE_ID,
277
+ compilerVersion: z.number().int().nonnegative()
278
+ }).strict();
279
+ var InputPreparationCounterTargetSchema = z.object({ endpoint: OPAQUE_TEXT, modelId: OPAQUE_ID }).strict();
280
+ var InputPreparationAccountingPolicyRefSchema = z.object({
281
+ revision: OPAQUE_ID,
282
+ /** The runtime identity string this ruling was made for. */
283
+ ruledRuntime: OPAQUE_ID,
284
+ /** The endpoint/model this ruling was made for. */
285
+ ruledTarget: InputPreparationCounterTargetSchema,
286
+ /** Every residual key the Host's accounting already accounts for. */
287
+ ruledResidualKeys: z.array(OPAQUE_ID).max(64)
288
+ }).strict();
289
+ var InputPreparationCounterProviderEvidenceSchema = z.object({
290
+ projectionDigest: z.string().regex(/^[0-9a-f]{64}$/u, "a projection digest is lowercase sha-256 hex"),
291
+ endpoint: OPAQUE_TEXT,
292
+ modelId: OPAQUE_ID,
293
+ asserted: z.object({
294
+ httpStatus: z.number().int(),
295
+ usageFields: z.record(OPAQUE_ID, z.number().finite()),
296
+ responseDigest: OPAQUE_ID
297
+ }).strict()
298
+ }).strict();
299
+ var InputPreparationCounterEvidenceSchema = z.object({
300
+ method: OPAQUE_ID,
301
+ methodVersion: OPAQUE_ID,
302
+ authority: z.enum(["provider", "test_fixture"]),
303
+ kind: z.enum(["count", "bound"]),
304
+ value: z.number().int().nonnegative(),
305
+ coverage: z.object({ covered: z.boolean(), reason: z.string().max(512).optional() }).strict(),
306
+ providerEvidence: InputPreparationCounterProviderEvidenceSchema,
307
+ target: InputPreparationCounterTargetSchema,
308
+ calledAt: z.iso.datetime({ offset: true }),
309
+ completedAt: z.iso.datetime({ offset: true })
310
+ }).strict();
311
+ var InputPreparationToolImplementationKindSchema = z.string().regex(/^(?:attested|unavailable:[a-z_]{1,64})$/u, 'a tool implementation kind is "attested" or "unavailable:<reason>"');
312
+ var InputPreparationResidualValueClassSchema = z.enum([
313
+ "constant",
314
+ "boolean",
315
+ "bounded_integer",
316
+ "bounded_number",
317
+ "finite_number",
318
+ "closed_enum",
319
+ "nonempty_string",
320
+ "object_shape"
321
+ ]);
322
+ var InputPreparationResidualKeySchema = z.object({ key: OPAQUE_ID, valueClass: InputPreparationResidualValueClassSchema }).strict();
323
+ var InputPreparationProjectionSchema = z.object({
324
+ version: z.literal(3),
325
+ kind: z.enum(["content_complete", "unknown"]),
326
+ digest: z.string().regex(/^[0-9a-f]{64}$/u, "a projection digest is lowercase sha-256 hex")
327
+ }).strict();
328
+ var InputPreparationArtifactSummarySchema = z.object({
329
+ requestDigest: OPAQUE_ID,
330
+ envelopeDigest: OPAQUE_ID,
331
+ toolManifestDigest: OPAQUE_ID,
332
+ requestBytes: z.number().int().nonnegative(),
333
+ projectionBytes: z.number().int().nonnegative(),
334
+ projection: InputPreparationProjectionSchema,
335
+ residual: z.array(InputPreparationResidualKeySchema).max(64),
336
+ observationDigest: OPAQUE_ID,
337
+ toolBindingDigest: OPAQUE_ID,
338
+ toolImplementationKinds: z.record(OPAQUE_ID, InputPreparationToolImplementationKindSchema)
339
+ }).strict();
340
+ var InputPreparationBindingSchema = z.object({
341
+ scopeId: OPAQUE_ID,
342
+ deviceId: OPAQUE_ID,
343
+ agentRef: OPAQUE_ID,
344
+ profileId: OPAQUE_ID,
345
+ profileRevision: OPAQUE_ID,
346
+ source: InputPreparationSourceSchema,
347
+ target: InputPreparationCounterTargetSchema,
348
+ policyRevision: OPAQUE_ID,
349
+ /**
350
+ * The mode the counted manifest was filtered for. Recorded on the binding
351
+ * rather than only inside the request digest so a consumer can COMPARE it
352
+ * without re-deriving the digest: an Execution offered under a different
353
+ * mode is an Execution whose registered tool set differs from the one
354
+ * these tokens were counted for.
355
+ */
356
+ permissionMode: InputPreparationPermissionModeSchema,
357
+ runtime: InputPreparationRuntimeIdentitySchema,
358
+ requestDigest: OPAQUE_ID,
359
+ /**
360
+ * The Host's accounting ruling this preparation was requested under,
361
+ * copied verbatim. Absent when the request named none — never filled in,
362
+ * and never narrowed to one the device would have chosen.
363
+ */
364
+ accountingPolicyRef: InputPreparationAccountingPolicyRefSchema.optional()
365
+ }).strict();
366
+ var InputPreparationReceiptSummarySchema = z.object({
367
+ reference: OPAQUE_ID,
368
+ state: InputPreparationStateSchema,
369
+ binding: InputPreparationBindingSchema,
370
+ artifact: InputPreparationArtifactSummarySchema.optional(),
371
+ counter: InputPreparationCounterEvidenceSchema.optional(),
372
+ ready: z.boolean(),
373
+ readinessReasons: z.array(InputPreparationReadinessReasonSchema).max(16),
374
+ detail: OPAQUE_ID.optional(),
375
+ artifactExpiresAt: z.iso.datetime({ offset: true })
376
+ }).strict().superRefine((value, ctx) => {
377
+ if (value.ready !== (value.readinessReasons.length === 0)) {
378
+ ctx.addIssue({
379
+ code: "custom",
380
+ path: ["ready"],
381
+ message: "ready must be true exactly when readinessReasons is empty"
382
+ });
383
+ }
384
+ });
385
+ var InputPreparationReferenceSchema = OPAQUE_ID;
386
+ var InputPreparationOfferBindingSchema = z.object({
387
+ reference: InputPreparationReferenceSchema,
388
+ /** `InputPreparationBindingSchema.requestDigest`, as the receipt reported it. */
389
+ requestDigest: OPAQUE_ID,
390
+ /** `InputPreparationArtifactSummarySchema.envelopeDigest`, when the receipt carried one. */
391
+ artifactDigest: OPAQUE_ID.optional()
392
+ }).strict();
393
+ var InputPreparationRejectionReasonSchema = z.enum([
394
+ "input_preparation_unconfigured",
395
+ "bad_request",
396
+ "authority_unavailable",
397
+ "scope_denied",
398
+ "policy_revision_mismatch",
399
+ "runtime_identity_unavailable",
400
+ "unsupported_input",
401
+ "limit_exceeded",
402
+ "request_conflict",
403
+ "not_found",
404
+ "counter_unavailable",
405
+ "counter_interrupted",
406
+ "durable_write_failed",
407
+ "cancelled",
408
+ "context_unresolvable",
409
+ "context_hash_mismatch",
410
+ "toolsets_unobservable",
411
+ "deadline_elapsed",
412
+ /**
413
+ * The device could not prove a non-writable launch directory (or a trusted
414
+ * launcher) for the MCP toolset servers this preparation names, so it
415
+ * refused rather than observing them in a directory the agent's own uid can
416
+ * write. The specific `TrustedLaunchCwdUnavailableReason` travels in the
417
+ * receipt's `detail`; it is not widened into a spawn.
418
+ */
419
+ "launch_boundary_unavailable",
420
+ /**
421
+ * A repeat of an already-recorded `requestId` arrived after the facts its
422
+ * executor fingerprints were frozen against changed — a toolset definition
423
+ * revision, the launch attestation, or an implementation identity that no
424
+ * longer measures the same. The recorded receipt is not re-derived and no
425
+ * server is re-probed; the repeat is refused so the caller mints a new
426
+ * preparation instead of silently receiving one bound to stale evidence.
427
+ */
428
+ "observation_drift",
429
+ /**
430
+ * The declared `permissionMode` is not one this device admits: it exceeds
431
+ * the operator's configured ceiling. The requester's declaration is INTENT,
432
+ * not authorization — it goes through the same merge that admits a task
433
+ * offer's `policy.mode` — and an unadmitted mode refuses rather than being
434
+ * silently narrowed to one the device would allow.
435
+ */
436
+ "permission_mode_denied",
437
+ /**
438
+ * The device compiled the input, then found that the `prompt_prepared` frame
439
+ * the runtime would have to be handed exceeds the single-frame byte cap that
440
+ * runtime enforces. The bound belongs to the runtime, not to the operator's
441
+ * retention policy, so it is decided first and nothing is retained: a
442
+ * preparation that could never be delivered is not a smaller preparation.
443
+ */
444
+ "rpc_frame_too_large"
445
+ ]);
116
446
  var TERMINAL_PROJECTION_SELECTION_CAPABILITY = "terminal-projection-selection";
117
447
  var TerminalProjectionContractSchema = z.string().min(1).max(128).regex(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/u, "terminal projection contracts must be opaque lowercase ids");
118
448
  var TerminalProjectionSelectionSchema = z.discriminatedUnion("mode", [
@@ -122,6 +452,9 @@ var TerminalProjectionSelectionSchema = z.discriminatedUnion("mode", [
122
452
  contract: TerminalProjectionContractSchema
123
453
  }).strict()
124
454
  ]);
455
+
456
+ // src/task-assertion.ts
457
+ var HOST_MCP_TASK_CONTEXT_CAPABILITY = "host-mcp-task-context";
125
458
  var PROVIDER_PROFILE_BINDING_CAPABILITY = "provider-profile-binding";
126
459
  var ProviderProfileRefSchema = z.string().min(1).max(64).regex(/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/u, "provider profile refs must be lowercase portable identifiers");
127
460
  var ProviderProfileRevisionSchema = z.string().regex(/^(?:0|[1-9][0-9]{0,19})$/u, "provider profile revision must be canonical decimal");
@@ -166,7 +499,9 @@ var CAPABILITY_FLAGS = [
166
499
  AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY,
167
500
  AGENT_CONTENT_ARTIFACT_READ_CAPABILITY,
168
501
  AGENT_HOME_PROJECTION_CAPABILITY,
502
+ AGENT_INPUT_PREPARATION_CAPABILITY,
169
503
  TERMINAL_PROJECTION_SELECTION_CAPABILITY,
504
+ HOST_MCP_TASK_CONTEXT_CAPABILITY,
170
505
  CUSTOM_HARNESS_CAPABILITY,
171
506
  MAILBOX_READ_AHEAD_CAPABILITY
172
507
  ];
@@ -178,14 +513,6 @@ var BlobRefSchema = z.object({
178
513
  contentType: z.string(),
179
514
  url: z.string().optional()
180
515
  });
181
- var PERMISSION_MODES = ["auto", "confirm", "readonly", "plan"];
182
- var PermissionPolicySchema = z.object({
183
- mode: z.enum(PERMISSION_MODES),
184
- allowTools: z.array(z.string()).optional(),
185
- denyTools: z.array(z.string()).optional(),
186
- workspaceRoot: z.string().optional(),
187
- network: z.boolean().optional()
188
- }).strict();
189
516
  var AGENT_EVENT_SPILL_UNSTORED_REASON_MAX_LENGTH = 512;
190
517
  var AgentEventSpillSchema = z.object({
191
518
  /** Which field of the event was replaced by a preview. */
@@ -410,6 +737,10 @@ var TaskOfferForAgentWithEgressFreshPayloadSchema = TaskOfferForAgentPayloadSche
410
737
  egressPolicy: AgentEgressPolicySchema,
411
738
  messageEgress: AgentMessageEgressRequirementSchema.optional()
412
739
  }).strict();
740
+ var TaskOfferPreparedPayloadSchema = TaskOfferForAgentPayloadSchema.omit({
741
+ instruction: true,
742
+ sessionRef: true
743
+ }).extend({ preparation: InputPreparationOfferBindingSchema }).strict();
413
744
  var EGRESS_SAFE_VALUE = z.json().refine(
414
745
  (value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 256 * 1024,
415
746
  "sanitized egress payload exceeds 256KiB"
@@ -541,6 +872,37 @@ var AgentHomeProjectionPayloadSchema = z.object({
541
872
  projectionHash: AgentHomeProjectionHashSchema,
542
873
  projection: AgentHomeProjectionValueSchema
543
874
  }).strict();
875
+ var InputPreparationInlineContextSchema = z.object({
876
+ inline: z.string().refine(isWithinInlineByteLimit, `inline context must not exceed ${MAX_INLINE_BYTES} UTF-8 bytes`)
877
+ }).strict();
878
+ var InputPreparationBlobContextSchema = z.object({ blobRef: BlobRefSchema, contentHash: InputPreparationContentHashSchema }).strict().superRefine((value, ctx) => {
879
+ if (value.blobRef.contentHash !== value.contentHash) {
880
+ ctx.addIssue({
881
+ code: "custom",
882
+ path: ["blobRef", "contentHash"],
883
+ message: "blobRef contentHash must equal contentHash"
884
+ });
885
+ }
886
+ });
887
+ var AgentInputPreparationPayloadSchema = z.object({
888
+ requestId: z.uuid(),
889
+ agentRef: AgentRefSchema,
890
+ profileId: InputPreparationProfileIdSchema,
891
+ policyRevision: InputPreparationPolicyRevisionSchema,
892
+ source: InputPreparationSourceSchema,
893
+ selection: InputPreparationSelectionSchema,
894
+ deadlineAt: z.iso.datetime({ offset: true }),
895
+ context: z.union([InputPreparationInlineContextSchema, InputPreparationBlobContextSchema]),
896
+ requiredToolsets: RequiredToolsetsSchema,
897
+ permissionMode: InputPreparationPermissionModeSchema,
898
+ /**
899
+ * The Host's accounting ruling for this preparation, carried verbatim onto
900
+ * the receipt's binding. Optional and defaulted NOWHERE: a payload that
901
+ * omits it produces a receipt that says `accounting_policy_missing`, which
902
+ * is the honest answer — the device rules on no residual key by itself.
903
+ */
904
+ accountingPolicyRef: InputPreparationAccountingPolicyRefSchema.optional()
905
+ }).strict();
544
906
  var TaskApprovePayloadSchema = z.object({
545
907
  approvalId: z.string().optional()
546
908
  });
@@ -695,7 +1057,8 @@ var TASK_OFFER_PAYLOAD_SCHEMAS = {
695
1057
  "task.offer_with_toolsets": TaskOfferWithToolsetsPayloadSchema,
696
1058
  "task.offer_for_agent": TaskOfferForAgentPayloadSchema,
697
1059
  "task.offer_for_agent_with_egress": TaskOfferForAgentWithEgressPayloadSchema,
698
- "task.offer_for_agent_with_egress_fresh": TaskOfferForAgentWithEgressFreshPayloadSchema
1060
+ "task.offer_for_agent_with_egress_fresh": TaskOfferForAgentWithEgressFreshPayloadSchema,
1061
+ "task.offer_prepared": TaskOfferPreparedPayloadSchema
699
1062
  };
700
1063
  var TASK_OFFER_TYPES = Object.freeze(
701
1064
  Object.keys(TASK_OFFER_PAYLOAD_SCHEMAS)
@@ -714,6 +1077,7 @@ var MESSAGE_PAYLOAD_SCHEMAS = {
714
1077
  "agent.content.read": AgentContentReadPayloadSchema,
715
1078
  "agent.content.receipt": AgentContentReceiptPayloadSchema,
716
1079
  "agent.home.projection": AgentHomeProjectionPayloadSchema,
1080
+ "agent.input.preparation": AgentInputPreparationPayloadSchema,
717
1081
  "task.approve": TaskApprovePayloadSchema,
718
1082
  "task.reject": TaskRejectPayloadSchema,
719
1083
  "task.cancel": TaskCancelPayloadSchema,
@@ -737,10 +1101,12 @@ var SERVER_TO_DAEMON_TYPES = [
737
1101
  "task.offer_for_agent",
738
1102
  "task.offer_for_agent_with_egress",
739
1103
  "task.offer_for_agent_with_egress_fresh",
1104
+ "task.offer_prepared",
740
1105
  "agent.egress.ack",
741
1106
  "agent.message.disposition",
742
1107
  "agent.content.read",
743
1108
  "agent.home.projection",
1109
+ "agent.input.preparation",
744
1110
  "task.approve",
745
1111
  "task.reject",
746
1112
  "task.cancel",
@@ -890,10 +1256,12 @@ var EnvelopeSchema = z.discriminatedUnion("type", [
890
1256
  envelopeShape("task.offer_for_agent", REQUIRED_TASK_ID, REQUIRED_SEQ),
891
1257
  envelopeShape("task.offer_for_agent_with_egress", REQUIRED_TASK_ID, REQUIRED_SEQ),
892
1258
  envelopeShape("task.offer_for_agent_with_egress_fresh", REQUIRED_TASK_ID, REQUIRED_SEQ),
1259
+ envelopeShape("task.offer_prepared", REQUIRED_TASK_ID, REQUIRED_SEQ),
893
1260
  envelopeShape("agent.egress.ack", OPTIONAL_TASK_ID, REQUIRED_SEQ),
894
1261
  envelopeShape("agent.message.disposition", REQUIRED_TASK_ID, REQUIRED_SEQ),
895
1262
  envelopeShape("agent.content.read", OPTIONAL_TASK_ID, REQUIRED_SEQ),
896
1263
  envelopeShape("agent.home.projection", FORBIDDEN_TASK_ID, REQUIRED_SEQ),
1264
+ envelopeShape("agent.input.preparation", FORBIDDEN_TASK_ID, REQUIRED_SEQ),
897
1265
  envelopeShape("task.approve", REQUIRED_TASK_ID, REQUIRED_SEQ),
898
1266
  envelopeShape("task.reject", REQUIRED_TASK_ID, REQUIRED_SEQ),
899
1267
  envelopeShape("task.cancel", REQUIRED_TASK_ID, REQUIRED_SEQ),
@@ -1123,6 +1491,53 @@ var AgentHomeProjectionReadbackSchema = z.object({
1123
1491
  status: AgentHomeProjectionStatusSchema,
1124
1492
  completedAt: z.iso.datetime({ offset: true }).optional()
1125
1493
  }).strict();
1494
+ var InputPreparationCompletionRequestSchema = z.discriminatedUnion("outcome", [
1495
+ z.object({
1496
+ outcome: z.literal("prepared"),
1497
+ requestId: z.uuid(),
1498
+ agentRef: AgentRefSchema,
1499
+ profileId: InputPreparationProfileIdSchema,
1500
+ policyRevision: InputPreparationPolicyRevisionSchema,
1501
+ receipt: InputPreparationReceiptSummarySchema
1502
+ }).strict(),
1503
+ z.object({
1504
+ outcome: z.literal("rejected"),
1505
+ requestId: z.uuid(),
1506
+ agentRef: AgentRefSchema,
1507
+ profileId: InputPreparationProfileIdSchema,
1508
+ policyRevision: InputPreparationPolicyRevisionSchema,
1509
+ reason: InputPreparationRejectionReasonSchema
1510
+ }).strict()
1511
+ ]);
1512
+ var InputPreparationStatusSchema = z.enum(["pending", "prepared", "rejected"]);
1513
+ var InputPreparationReadbackSchema = z.object({
1514
+ tenantId: z.string().min(1),
1515
+ deviceId: z.string().min(1),
1516
+ requestId: z.uuid(),
1517
+ agentRef: AgentRefSchema,
1518
+ profileId: InputPreparationProfileIdSchema,
1519
+ policyRevision: InputPreparationPolicyRevisionSchema,
1520
+ status: InputPreparationStatusSchema,
1521
+ receipt: InputPreparationReceiptSummarySchema.optional(),
1522
+ reason: InputPreparationRejectionReasonSchema.optional(),
1523
+ completedAt: z.iso.datetime({ offset: true }).optional()
1524
+ }).strict().superRefine((value, ctx) => {
1525
+ const expectsReceipt = value.status === "prepared";
1526
+ const expectsReason = value.status === "rejected";
1527
+ if (expectsReceipt !== (value.receipt !== void 0)) {
1528
+ ctx.addIssue({ code: "custom", path: ["receipt"], message: 'receipt is present exactly when status is "prepared"' });
1529
+ }
1530
+ if (expectsReason !== (value.reason !== void 0)) {
1531
+ ctx.addIssue({ code: "custom", path: ["reason"], message: 'reason is present exactly when status is "rejected"' });
1532
+ }
1533
+ if (value.status !== "pending" !== (value.completedAt !== void 0)) {
1534
+ ctx.addIssue({ code: "custom", path: ["completedAt"], message: "completedAt is present exactly when the status is terminal" });
1535
+ }
1536
+ });
1537
+ var InputPreparationStatusQuerySchema = z.object({
1538
+ agentId: z.string().min(1),
1539
+ profileRevision: z.string().min(1)
1540
+ }).strict();
1126
1541
  var AgentMemoryProjectionCommitRequestSchema = AgentMemoryProjectionMutationSchema;
1127
1542
  var AgentMemoryProjectionCommitResponseSchema = AgentMemoryProjectionReceiptSchema;
1128
1543
  var BYOK_PAIR_PATH = "/byok/pair";
@@ -1136,6 +1551,15 @@ var BYOK_AGENT_HOME_PROJECTION_COMPLETION_ROUTE = "/byok/agent-home-projections/
1136
1551
  function byokAgentHomeProjectionCompletionPath(requestId) {
1137
1552
  return `${BYOK_AGENT_HOME_PROJECTIONS_PATH}/${encodeURIComponent(requestId)}/completion`;
1138
1553
  }
1554
+ var BYOK_INPUT_PREPARATIONS_PATH = "/byok/input-preparations";
1555
+ var BYOK_INPUT_PREPARATION_COMPLETION_ROUTE = "/byok/input-preparations/:requestId/completion";
1556
+ var BYOK_INPUT_PREPARATION_STATUS_ROUTE = "/byok/input-preparations/:requestId";
1557
+ function byokInputPreparationCompletionPath(requestId) {
1558
+ return `${BYOK_INPUT_PREPARATIONS_PATH}/${encodeURIComponent(requestId)}/completion`;
1559
+ }
1560
+ function byokInputPreparationStatusPath(requestId) {
1561
+ return `${BYOK_INPUT_PREPARATIONS_PATH}/${encodeURIComponent(requestId)}`;
1562
+ }
1139
1563
  var BYOK_AGENT_MEMORY_PROJECTIONS_PATH = "/byok/agent-memory-projections";
1140
1564
  var BYOK_PRESENCE_PATH = "/byok/presence";
1141
1565
  var BYOK_ACTIVITY_PATH = "/byok/activity";
@@ -1168,6 +1592,6 @@ function byokBlobContentPath(blobId) {
1168
1592
  return `/byok/blobs/${blobId}/content`;
1169
1593
  }
1170
1594
 
1171
- export { AGENT_CONTENT_ARTIFACT_READ_CAPABILITY, AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY, AGENT_CONTENT_WORKSPACE_READ_CAPABILITY, AGENT_EGRESS_FRESH_SESSION_CAPABILITY, AGENT_EGRESS_POLICY_CAPABILITY, AGENT_EGRESS_RELIABLE_ACK_CAPABILITY, AGENT_EVENT_SPILL_UNSTORED_REASON_MAX_LENGTH, AGENT_HOME_PROJECTION_CAPABILITY, AGENT_HOME_PROJECTION_MAX_BYTES, AGENT_HOME_PROJECTION_PROFILE_REVISION_MAXIMUM, AGENT_MEMORY_PROJECTION_CAPABILITY, AGENT_MEMORY_PROJECTION_MAX_ORDERING_VALUE, AGENT_MEMORY_PROJECTION_MAX_REDACTED_BYTES, AGENT_MESSAGE_EGRESS_CAPABILITY, AGENT_MESSAGE_MAX_BYTES, AGENT_REF_MAX_BYTES, AgentContentActorKindSchema, AgentContentActorSchema, AgentContentDecodeAsSchema, AgentContentMimeTypeSchema, AgentContentReadDecisionSchema, AgentContentReadDenialReasonSchema, AgentContentReadPayloadSchema, AgentContentReadSurfaceSchema, AgentContentReceiptPayloadSchema, AgentEgressAckPayloadSchema, AgentEgressActivityPolicySchema, AgentEgressContentHashSchema, AgentEgressDropReasonSchema, AgentEgressLaneSchema, AgentEgressPolicyRevisionSchema, AgentEgressPolicySchema, AgentEgressReliablePayloadSchema, AgentEventOrUnknownSchema, AgentEventSchema, AgentEventSpillSchema, AgentHomeProjectionAgentRefSchema, AgentHomeProjectionCompletionRequestSchema, AgentHomeProjectionHashSchema, AgentHomeProjectionOutcomeSchema, AgentHomeProjectionPayloadSchema, AgentHomeProjectionProfileRevisionSchema, AgentHomeProjectionReadbackSchema, AgentHomeProjectionStatusSchema, AgentHomeProjectionValueSchema, AgentMemoryProjectionCommitRequestSchema, AgentMemoryProjectionCommitResponseSchema, AgentMemoryProjectionEraseResultSchema, AgentMemoryProjectionGrantRefSchema, AgentMemoryProjectionMeteringReceiptSchema, AgentMemoryProjectionMutationSchema, AgentMemoryProjectionReceiptSchema, AgentMemoryProjectionSessionRefSchema, AgentMemoryProjectionSnapshotSchema, AgentMemoryProjectionSourceSeqSchema, AgentMemoryProjectionWriterEpochSchema, AgentMessageContentTypeSchema, AgentMessageContractSchema, AgentMessageDestinationBindingSchema, AgentMessageDispositionPayloadSchema, AgentMessageEgressRequirementSchema, AgentMessageFreshnessCursorSchema, AgentMessagePublishPayloadSchema, AgentMessageServerContextSchema, AgentRefSchema, AgentReliableQuotaPolicySchema, BYOK_ACTIVITY_PATH, BYOK_AGENT_HOME_PROJECTIONS_PATH, BYOK_AGENT_HOME_PROJECTION_COMPLETION_ROUTE, BYOK_AGENT_MEMORY_PROJECTIONS_PATH, BYOK_BLOBS_PATH, BYOK_BLOB_CONTENT_ROUTE, BYOK_BLOB_FINALIZE_ROUTE, BYOK_BLOB_URL_ROUTE, BYOK_BOARD_CLAIM_ROUTE, BYOK_BOARD_PATH, BYOK_BOARD_STATUS_ROUTE, BYOK_BOARD_STREAM_PATH, BYOK_BOARD_UNCLAIM_ROUTE, BYOK_CAPABILITIES_PATH, BYOK_CHALLENGE_PATH, BYOK_EVENTS_PATH, BYOK_MESSAGES_PATH, BYOK_PAIR_PATH, BYOK_PRESENCE_PATH, BYOK_RECORDS_PATH, BYOK_RECORD_ROUTE, BYOK_SKILL_PACKS_PATH, BYOK_SKILL_PACK_FILE_ROUTE, BYOK_TOKEN_PATH, BlobDownloadUrlResponseSchema, BlobRefSchema, CAPABILITY_FLAGS, CONFIGURED_TOOLSETS_MAX_ITEMS, CONTENT_HASH_RE, CUSTOM_HARNESS_CAPABILITY, ChallengeRequestSchema, ChallengeResponseSchema, ConfiguredToolsetsSchema, ConnAckPayloadSchema, ConnHelloPayloadSchema, ContentReadPolicySchema, CreateBlobRequestSchema, CreateBlobResponseSchema, DAEMON_TO_SERVER_TYPES, DispatchSelectionSchema, EnvelopeParseError, EnvelopeSchema, EnvelopeValidationError, EventsPollQuerySchema, EventsPollResponseSchema, HarnessIdSchema, HarnessInfoSchema, HarnessInventorySchema, KNOWN_AGENT_EVENT_TYPES, MAILBOX_READ_AHEAD_CAPABILITY, MAILBOX_READ_AHEAD_MAX_SEQS, MAX_MESSAGES_PER_BATCH, MESSAGE_PAYLOAD_SCHEMAS, MESSAGE_TYPES, MessagesSendRequestSchema, MessagesSendResponseSchema, PAIR_RESPONSE_TENANT_ID_MAX_LENGTH, PERMISSION_MODES, PROTOCOL_VERSION, PROVIDER_MODEL_CAPABILITIES, PROVIDER_PROFILE_BINDING_CAPABILITY, PairRequestSchema, PairResponseSchema, PairResponseTenantIdSchema, PermissionPolicySchema, PresencePublishRequestSchema, ProtocolError, ProtocolVersionNumberSchema, ProviderModelCapabilitySchema, ProviderProfileBindingSchema, ProviderProfileHashSchema, ProviderProfileRefSchema, ProviderProfileRevisionSchema, RESULT_DOCUMENT_MAX_BYTES, RequiredToolsetsSchema, RuntimeCapabilitiesSchema, RuntimeIdSchema, RuntimeInfoSchema, SERVER_TO_DAEMON_TYPES, STRICT_AGENT_ONLY_CAPABILITY, TASK_OFFER_TYPES, TASK_STATES, TASK_TRANSITIONS, TERMINAL_INFERENCE_USAGE_CLIENT_VERSION_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_MAX_DURATION_MS, TERMINAL_INFERENCE_USAGE_MAX_TOKENS, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_PROVIDER_MAX_LENGTH, TERMINAL_PROJECTION_SELECTION_CAPABILITY, TaskApprovalResolvedPayloadSchema, TaskApprovePayloadSchema, TaskArtifactPayloadSchema, TaskAwaitApprovalPayloadSchema, TaskCancelPayloadSchema, TaskCancelledPayloadSchema, TaskClaimPayloadSchema, TaskCompletePayloadSchema, TaskDeclinePayloadSchema, TaskFailPayloadSchema, TaskOfferForAgentPayloadSchema, TaskOfferForAgentWithEgressFreshPayloadSchema, TaskOfferForAgentWithEgressPayloadSchema, TaskOfferPayloadSchema, TaskOfferWithToolsetsPayloadSchema, TaskProgressPayloadSchema, TaskRejectPayloadSchema, TaskStartedPayloadSchema, TaskSteerPayloadSchema, TerminalInferenceUsageSchema, TerminalProjectionContractSchema, TerminalProjectionSelectionSchema, TokenRequestSchema, TokenResponseSchema, ToolsetIdSchema, UnknownAgentEventSchema, UnknownMessageTypeError, agentMemoryProjectionBase64UrlByteLength, byokAgentHomeProjectionCompletionPath, byokBlobContentPath, byokBlobFinalizePath, byokBlobUrlPath, byokRecordPath, byokSkillPackFilePath, canTransition, checkResultDocument, createEnvelope, decodeEnvelope, encodeEnvelope, isKnownAgentEvent, isServerToDaemonType, isTaskOfferType, parseMessage, partitionAgentEvents };
1595
+ export { AGENT_CONTENT_ARTIFACT_READ_CAPABILITY, AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY, AGENT_CONTENT_WORKSPACE_READ_CAPABILITY, AGENT_EGRESS_FRESH_SESSION_CAPABILITY, AGENT_EGRESS_POLICY_CAPABILITY, AGENT_EGRESS_RELIABLE_ACK_CAPABILITY, AGENT_EVENT_SPILL_UNSTORED_REASON_MAX_LENGTH, AGENT_HOME_PROJECTION_CAPABILITY, AGENT_HOME_PROJECTION_MAX_BYTES, AGENT_HOME_PROJECTION_PROFILE_REVISION_MAXIMUM, AGENT_INPUT_PREPARATION_CAPABILITY, AGENT_MEMORY_PROJECTION_CAPABILITY, AGENT_MEMORY_PROJECTION_MAX_ORDERING_VALUE, AGENT_MEMORY_PROJECTION_MAX_REDACTED_BYTES, AGENT_MESSAGE_EGRESS_CAPABILITY, AGENT_MESSAGE_MAX_BYTES, AGENT_REF_MAX_BYTES, AgentContentActorKindSchema, AgentContentActorSchema, AgentContentDecodeAsSchema, AgentContentMimeTypeSchema, AgentContentReadDecisionSchema, AgentContentReadDenialReasonSchema, AgentContentReadPayloadSchema, AgentContentReadSurfaceSchema, AgentContentReceiptPayloadSchema, AgentEgressAckPayloadSchema, AgentEgressActivityPolicySchema, AgentEgressContentHashSchema, AgentEgressDropReasonSchema, AgentEgressLaneSchema, AgentEgressPolicyRevisionSchema, AgentEgressPolicySchema, AgentEgressReliablePayloadSchema, AgentEventOrUnknownSchema, AgentEventSchema, AgentEventSpillSchema, AgentHomeProjectionAgentRefSchema, AgentHomeProjectionCompletionRequestSchema, AgentHomeProjectionHashSchema, AgentHomeProjectionOutcomeSchema, AgentHomeProjectionPayloadSchema, AgentHomeProjectionProfileRevisionSchema, AgentHomeProjectionReadbackSchema, AgentHomeProjectionStatusSchema, AgentHomeProjectionValueSchema, AgentInputPreparationPayloadSchema, AgentMemoryProjectionCommitRequestSchema, AgentMemoryProjectionCommitResponseSchema, AgentMemoryProjectionEraseResultSchema, AgentMemoryProjectionGrantRefSchema, AgentMemoryProjectionMeteringReceiptSchema, AgentMemoryProjectionMutationSchema, AgentMemoryProjectionReceiptSchema, AgentMemoryProjectionSessionRefSchema, AgentMemoryProjectionSnapshotSchema, AgentMemoryProjectionSourceSeqSchema, AgentMemoryProjectionWriterEpochSchema, AgentMessageContentTypeSchema, AgentMessageContractSchema, AgentMessageDestinationBindingSchema, AgentMessageDispositionPayloadSchema, AgentMessageEgressRequirementSchema, AgentMessageFreshnessCursorSchema, AgentMessagePublishPayloadSchema, AgentMessageServerContextSchema, AgentRefSchema, AgentReliableQuotaPolicySchema, BYOK_ACTIVITY_PATH, BYOK_AGENT_HOME_PROJECTIONS_PATH, BYOK_AGENT_HOME_PROJECTION_COMPLETION_ROUTE, BYOK_AGENT_MEMORY_PROJECTIONS_PATH, BYOK_BLOBS_PATH, BYOK_BLOB_CONTENT_ROUTE, BYOK_BLOB_FINALIZE_ROUTE, BYOK_BLOB_URL_ROUTE, BYOK_BOARD_CLAIM_ROUTE, BYOK_BOARD_PATH, BYOK_BOARD_STATUS_ROUTE, BYOK_BOARD_STREAM_PATH, BYOK_BOARD_UNCLAIM_ROUTE, BYOK_CAPABILITIES_PATH, BYOK_CHALLENGE_PATH, BYOK_EVENTS_PATH, BYOK_INPUT_PREPARATIONS_PATH, BYOK_INPUT_PREPARATION_COMPLETION_ROUTE, BYOK_INPUT_PREPARATION_STATUS_ROUTE, BYOK_MESSAGES_PATH, BYOK_PAIR_PATH, BYOK_PRESENCE_PATH, BYOK_RECORDS_PATH, BYOK_RECORD_ROUTE, BYOK_SKILL_PACKS_PATH, BYOK_SKILL_PACK_FILE_ROUTE, BYOK_TOKEN_PATH, BlobDownloadUrlResponseSchema, BlobRefSchema, CAPABILITY_FLAGS, CONFIGURED_TOOLSETS_MAX_ITEMS, CONTENT_HASH_RE, CUSTOM_HARNESS_CAPABILITY, ChallengeRequestSchema, ChallengeResponseSchema, ConfiguredToolsetsSchema, ConnAckPayloadSchema, ConnHelloPayloadSchema, ContentReadPolicySchema, CreateBlobRequestSchema, CreateBlobResponseSchema, DAEMON_TO_SERVER_TYPES, DispatchSelectionSchema, EnvelopeParseError, EnvelopeSchema, EnvelopeValidationError, EventsPollQuerySchema, EventsPollResponseSchema, HOST_MCP_TASK_CONTEXT_CAPABILITY, HarnessIdSchema, HarnessInfoSchema, HarnessInventorySchema, InputPreparationAccountingPolicyRefSchema, InputPreparationArtifactSummarySchema, InputPreparationBindingSchema, InputPreparationCompletionRequestSchema, InputPreparationContentHashSchema, InputPreparationContextDocumentSchema, InputPreparationContextFileSchema, InputPreparationCounterEvidenceSchema, InputPreparationCounterProviderEvidenceSchema, InputPreparationCounterTargetSchema, InputPreparationDocsPathsSchema, InputPreparationHostCanonicalAssistantMessageSchema, InputPreparationMessageSchema, InputPreparationModelCostSchema, InputPreparationModelSchema, InputPreparationOfferBindingSchema, InputPreparationOptionsSchema, InputPreparationPermissionModeSchema, InputPreparationPolicyRevisionSchema, InputPreparationProfileIdSchema, InputPreparationProjectionSchema, InputPreparationPromptSnapshotSchema, InputPreparationReadbackSchema, InputPreparationReadinessReasonSchema, InputPreparationReceiptSummarySchema, InputPreparationReferenceSchema, InputPreparationRejectionReasonSchema, InputPreparationResidualKeySchema, InputPreparationResidualValueClassSchema, InputPreparationRuntimeIdentitySchema, InputPreparationSelectionSchema, InputPreparationSkillSchema, InputPreparationSourceSchema, InputPreparationStateSchema, InputPreparationStatusQuerySchema, InputPreparationStatusSchema, InputPreparationToolImplementationKindSchema, InputPreparationUserMessageSchema, KNOWN_AGENT_EVENT_TYPES, MAILBOX_READ_AHEAD_CAPABILITY, MAILBOX_READ_AHEAD_MAX_SEQS, MAX_MESSAGES_PER_BATCH, MESSAGE_PAYLOAD_SCHEMAS, MESSAGE_TYPES, MessagesSendRequestSchema, MessagesSendResponseSchema, PAIR_RESPONSE_TENANT_ID_MAX_LENGTH, PERMISSION_MODES, PROTOCOL_VERSION, PROVIDER_MODEL_CAPABILITIES, PROVIDER_PROFILE_BINDING_CAPABILITY, PairRequestSchema, PairResponseSchema, PairResponseTenantIdSchema, PermissionPolicySchema, PresencePublishRequestSchema, ProtocolError, ProtocolVersionNumberSchema, ProviderModelCapabilitySchema, ProviderProfileBindingSchema, ProviderProfileHashSchema, ProviderProfileRefSchema, ProviderProfileRevisionSchema, RESULT_DOCUMENT_MAX_BYTES, RequiredToolsetsSchema, RuntimeCapabilitiesSchema, RuntimeIdSchema, RuntimeInfoSchema, SERVER_TO_DAEMON_TYPES, STRICT_AGENT_ONLY_CAPABILITY, TASK_OFFER_TYPES, TASK_STATES, TASK_TRANSITIONS, TERMINAL_INFERENCE_USAGE_CLIENT_VERSION_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_MAX_DURATION_MS, TERMINAL_INFERENCE_USAGE_MAX_TOKENS, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_INFERENCE_USAGE_PROVIDER_MAX_LENGTH, TERMINAL_PROJECTION_SELECTION_CAPABILITY, TaskApprovalResolvedPayloadSchema, TaskApprovePayloadSchema, TaskArtifactPayloadSchema, TaskAwaitApprovalPayloadSchema, TaskCancelPayloadSchema, TaskCancelledPayloadSchema, TaskClaimPayloadSchema, TaskCompletePayloadSchema, TaskDeclinePayloadSchema, TaskFailPayloadSchema, TaskOfferForAgentPayloadSchema, TaskOfferForAgentWithEgressFreshPayloadSchema, TaskOfferForAgentWithEgressPayloadSchema, TaskOfferPayloadSchema, TaskOfferPreparedPayloadSchema, TaskOfferWithToolsetsPayloadSchema, TaskProgressPayloadSchema, TaskRejectPayloadSchema, TaskStartedPayloadSchema, TaskSteerPayloadSchema, TerminalInferenceUsageSchema, TerminalProjectionContractSchema, TerminalProjectionSelectionSchema, TokenRequestSchema, TokenResponseSchema, ToolsetIdSchema, UnknownAgentEventSchema, UnknownMessageTypeError, agentMemoryProjectionBase64UrlByteLength, byokAgentHomeProjectionCompletionPath, byokBlobContentPath, byokBlobFinalizePath, byokBlobUrlPath, byokInputPreparationCompletionPath, byokInputPreparationStatusPath, byokRecordPath, byokSkillPackFilePath, canTransition, checkResultDocument, createEnvelope, decodeEnvelope, encodeEnvelope, isKnownAgentEvent, isServerToDaemonType, isTaskOfferType, parseMessage, partitionAgentEvents };
1172
1596
  //# sourceMappingURL=index.js.map
1173
1597
  //# sourceMappingURL=index.js.map