@byok-sdk/protocol 0.32.0 → 0.33.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/agent-memory-projection.d.ts +229 -3
- package/dist/capability-constants.d.ts +11 -0
- package/dist/constants.js +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/http-api.d.ts +82 -7
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +208 -4
- package/dist/sealed-payload.d.ts +91 -19
- package/dist/sealed-split-table.d.ts +49 -3
- package/dist/version.d.ts +1 -1
- package/dist/wire-additions.d.ts +4 -3
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ export type AgentMemoryProjectionSnapshot = z.infer<typeof AgentMemoryProjection
|
|
|
34
34
|
* The snapshot is a one-way copy of local `MEMORY.md` plus local `notes/`, not
|
|
35
35
|
* a remote authoring, merge, import, history, or RAG contract.
|
|
36
36
|
*/
|
|
37
|
-
export declare const
|
|
37
|
+
export declare const AgentMemoryProjectionPlainMutationSchema: z.ZodObject<{
|
|
38
38
|
taskId: z.ZodString;
|
|
39
39
|
agentRef: z.ZodObject<{
|
|
40
40
|
agentId: z.ZodString;
|
|
@@ -56,7 +56,131 @@ export declare const AgentMemoryProjectionMutationSchema: z.ZodObject<{
|
|
|
56
56
|
redactedByteCount: z.ZodNumber;
|
|
57
57
|
redactedBytes: z.ZodString;
|
|
58
58
|
}, z.core.$strict>;
|
|
59
|
+
sealed: z.ZodOptional<z.ZodNever>;
|
|
59
60
|
}, z.core.$strict>;
|
|
61
|
+
export type AgentMemoryProjectionPlainMutation = z.infer<typeof AgentMemoryProjectionPlainMutationSchema>;
|
|
62
|
+
/**
|
|
63
|
+
* The mutation under a grant that names a sealing scope (#1045 C4). The
|
|
64
|
+
* redacted snapshot is sealed, inline only, under the Agent's memory scope;
|
|
65
|
+
* its plaintext hash and byte count are not carried. The AAD binds
|
|
66
|
+
* `{ agentId, writerEpoch, sourceSeq, mutationId }`, so the Host cannot move
|
|
67
|
+
* a snapshot to another Agent, epoch or position.
|
|
68
|
+
*/
|
|
69
|
+
export declare const AgentMemoryProjectionSealedMutationSchema: z.ZodObject<{
|
|
70
|
+
taskId: z.ZodString;
|
|
71
|
+
agentRef: z.ZodObject<{
|
|
72
|
+
agentId: z.ZodString;
|
|
73
|
+
profileRevision: z.ZodString;
|
|
74
|
+
}, z.core.$strict>;
|
|
75
|
+
sessionRef: z.ZodString;
|
|
76
|
+
runtimeId: z.ZodEnum<{
|
|
77
|
+
claude: "claude";
|
|
78
|
+
codex: "codex";
|
|
79
|
+
pi: "pi";
|
|
80
|
+
}>;
|
|
81
|
+
grantRef: z.ZodString;
|
|
82
|
+
writerEpoch: z.ZodNumber;
|
|
83
|
+
sourceSeq: z.ZodNumber;
|
|
84
|
+
mutationId: z.ZodUUID;
|
|
85
|
+
policyRevision: z.ZodString;
|
|
86
|
+
sealed: z.ZodObject<{
|
|
87
|
+
v: z.ZodLiteral<1>;
|
|
88
|
+
suite: z.ZodLiteral<"byok-sealed-v1.hkdf-sha256.aes-256-gcm">;
|
|
89
|
+
category: z.ZodLiteral<"memory-projection">;
|
|
90
|
+
scope: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
epoch: z.ZodNumber;
|
|
93
|
+
keyId: z.ZodString;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
chainHead: z.ZodObject<{
|
|
96
|
+
seq: z.ZodNumber;
|
|
97
|
+
hash: z.ZodString;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
sender: z.ZodString;
|
|
100
|
+
salt: z.ZodString;
|
|
101
|
+
nonce: z.ZodString;
|
|
102
|
+
paddedLength: z.ZodNumber;
|
|
103
|
+
contentMac: z.ZodString;
|
|
104
|
+
ciphertext: z.ZodOptional<z.ZodString>;
|
|
105
|
+
ciphertextRef: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
blobId: z.ZodString;
|
|
107
|
+
contentHash: z.ZodString;
|
|
108
|
+
size: z.ZodNumber;
|
|
109
|
+
contentType: z.ZodString;
|
|
110
|
+
}, z.core.$strict>>;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export type AgentMemoryProjectionSealedMutation = z.infer<typeof AgentMemoryProjectionSealedMutationSchema>;
|
|
115
|
+
/** Narrow with `mutation.sealed !== undefined`. */
|
|
116
|
+
export declare const AgentMemoryProjectionMutationSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
117
|
+
taskId: z.ZodString;
|
|
118
|
+
agentRef: z.ZodObject<{
|
|
119
|
+
agentId: z.ZodString;
|
|
120
|
+
profileRevision: z.ZodString;
|
|
121
|
+
}, z.core.$strict>;
|
|
122
|
+
sessionRef: z.ZodString;
|
|
123
|
+
runtimeId: z.ZodEnum<{
|
|
124
|
+
claude: "claude";
|
|
125
|
+
codex: "codex";
|
|
126
|
+
pi: "pi";
|
|
127
|
+
}>;
|
|
128
|
+
grantRef: z.ZodString;
|
|
129
|
+
writerEpoch: z.ZodNumber;
|
|
130
|
+
sourceSeq: z.ZodNumber;
|
|
131
|
+
mutationId: z.ZodUUID;
|
|
132
|
+
policyRevision: z.ZodString;
|
|
133
|
+
snapshot: z.ZodObject<{
|
|
134
|
+
redactedHash: z.ZodString;
|
|
135
|
+
redactedByteCount: z.ZodNumber;
|
|
136
|
+
redactedBytes: z.ZodString;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
sealed: z.ZodOptional<z.ZodNever>;
|
|
139
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
140
|
+
taskId: z.ZodString;
|
|
141
|
+
agentRef: z.ZodObject<{
|
|
142
|
+
agentId: z.ZodString;
|
|
143
|
+
profileRevision: z.ZodString;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
sessionRef: z.ZodString;
|
|
146
|
+
runtimeId: z.ZodEnum<{
|
|
147
|
+
claude: "claude";
|
|
148
|
+
codex: "codex";
|
|
149
|
+
pi: "pi";
|
|
150
|
+
}>;
|
|
151
|
+
grantRef: z.ZodString;
|
|
152
|
+
writerEpoch: z.ZodNumber;
|
|
153
|
+
sourceSeq: z.ZodNumber;
|
|
154
|
+
mutationId: z.ZodUUID;
|
|
155
|
+
policyRevision: z.ZodString;
|
|
156
|
+
sealed: z.ZodObject<{
|
|
157
|
+
v: z.ZodLiteral<1>;
|
|
158
|
+
suite: z.ZodLiteral<"byok-sealed-v1.hkdf-sha256.aes-256-gcm">;
|
|
159
|
+
category: z.ZodLiteral<"memory-projection">;
|
|
160
|
+
scope: z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
epoch: z.ZodNumber;
|
|
163
|
+
keyId: z.ZodString;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
chainHead: z.ZodObject<{
|
|
166
|
+
seq: z.ZodNumber;
|
|
167
|
+
hash: z.ZodString;
|
|
168
|
+
}, z.core.$strict>;
|
|
169
|
+
sender: z.ZodString;
|
|
170
|
+
salt: z.ZodString;
|
|
171
|
+
nonce: z.ZodString;
|
|
172
|
+
paddedLength: z.ZodNumber;
|
|
173
|
+
contentMac: z.ZodString;
|
|
174
|
+
ciphertext: z.ZodOptional<z.ZodString>;
|
|
175
|
+
ciphertextRef: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
blobId: z.ZodString;
|
|
177
|
+
contentHash: z.ZodString;
|
|
178
|
+
size: z.ZodNumber;
|
|
179
|
+
contentType: z.ZodString;
|
|
180
|
+
}, z.core.$strict>>;
|
|
181
|
+
}, z.core.$strict>;
|
|
182
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
183
|
+
}, z.core.$strict>]>;
|
|
60
184
|
export type AgentMemoryProjectionMutation = z.infer<typeof AgentMemoryProjectionMutationSchema>;
|
|
61
185
|
/** Stable meter receipt for one accepted redacted snapshot; it never carries the snapshot body. */
|
|
62
186
|
export declare const AgentMemoryProjectionMeteringReceiptSchema: z.ZodObject<{
|
|
@@ -66,13 +190,79 @@ export declare const AgentMemoryProjectionMeteringReceiptSchema: z.ZodObject<{
|
|
|
66
190
|
}, z.core.$strict>;
|
|
67
191
|
export type AgentMemoryProjectionMeteringReceipt = z.infer<typeof AgentMemoryProjectionMeteringReceiptSchema>;
|
|
68
192
|
/** Immutable commit readback. It repeats identity and redacted metadata, never redacted bytes. */
|
|
69
|
-
export declare const
|
|
193
|
+
export declare const AgentMemoryProjectionPlainReceiptSchema: z.ZodObject<{
|
|
194
|
+
taskId: z.ZodString;
|
|
195
|
+
agentRef: z.ZodObject<{
|
|
196
|
+
agentId: z.ZodString;
|
|
197
|
+
profileRevision: z.ZodString;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
sessionRef: z.ZodString;
|
|
200
|
+
runtimeId: z.ZodEnum<{
|
|
201
|
+
claude: "claude";
|
|
202
|
+
codex: "codex";
|
|
203
|
+
pi: "pi";
|
|
204
|
+
}>;
|
|
205
|
+
grantRef: z.ZodString;
|
|
206
|
+
writerEpoch: z.ZodNumber;
|
|
207
|
+
sourceSeq: z.ZodNumber;
|
|
208
|
+
mutationId: z.ZodUUID;
|
|
209
|
+
policyRevision: z.ZodString;
|
|
210
|
+
outcome: z.ZodEnum<{
|
|
211
|
+
accepted: "accepted";
|
|
212
|
+
idempotent: "idempotent";
|
|
213
|
+
}>;
|
|
214
|
+
tenantId: z.ZodString;
|
|
215
|
+
deviceId: z.ZodString;
|
|
216
|
+
redactedHash: z.ZodString;
|
|
217
|
+
redactedByteCount: z.ZodNumber;
|
|
218
|
+
metering: z.ZodObject<{
|
|
219
|
+
meteringReceiptId: z.ZodUUID;
|
|
220
|
+
acceptedRedactedBytes: z.ZodNumber;
|
|
221
|
+
recordedAt: z.ZodISODateTime;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
}, z.core.$strict>;
|
|
224
|
+
export type AgentMemoryProjectionPlainReceipt = z.infer<typeof AgentMemoryProjectionPlainReceiptSchema>;
|
|
225
|
+
/** Stable meter receipt for one accepted sealed snapshot: the Host meters the padded length it stores. */
|
|
226
|
+
export declare const AgentMemoryProjectionSealedMeteringReceiptSchema: z.ZodObject<{
|
|
227
|
+
meteringReceiptId: z.ZodUUID;
|
|
228
|
+
acceptedPaddedBytes: z.ZodNumber;
|
|
229
|
+
recordedAt: z.ZodISODateTime;
|
|
230
|
+
}, z.core.$strict>;
|
|
231
|
+
export type AgentMemoryProjectionSealedMeteringReceipt = z.infer<typeof AgentMemoryProjectionSealedMeteringReceiptSchema>;
|
|
232
|
+
/** Immutable commit readback of a sealed snapshot: identity and the sealed member's `contentMac` and padded length. */
|
|
233
|
+
export declare const AgentMemoryProjectionSealedReceiptSchema: z.ZodObject<{
|
|
234
|
+
taskId: z.ZodString;
|
|
235
|
+
agentRef: z.ZodObject<{
|
|
236
|
+
agentId: z.ZodString;
|
|
237
|
+
profileRevision: z.ZodString;
|
|
238
|
+
}, z.core.$strict>;
|
|
239
|
+
sessionRef: z.ZodString;
|
|
240
|
+
runtimeId: z.ZodEnum<{
|
|
241
|
+
claude: "claude";
|
|
242
|
+
codex: "codex";
|
|
243
|
+
pi: "pi";
|
|
244
|
+
}>;
|
|
245
|
+
grantRef: z.ZodString;
|
|
246
|
+
writerEpoch: z.ZodNumber;
|
|
247
|
+
sourceSeq: z.ZodNumber;
|
|
248
|
+
mutationId: z.ZodUUID;
|
|
249
|
+
policyRevision: z.ZodString;
|
|
70
250
|
outcome: z.ZodEnum<{
|
|
71
251
|
accepted: "accepted";
|
|
72
252
|
idempotent: "idempotent";
|
|
73
253
|
}>;
|
|
74
254
|
tenantId: z.ZodString;
|
|
75
255
|
deviceId: z.ZodString;
|
|
256
|
+
contentMac: z.ZodString;
|
|
257
|
+
paddedLength: z.ZodNumber;
|
|
258
|
+
metering: z.ZodObject<{
|
|
259
|
+
meteringReceiptId: z.ZodUUID;
|
|
260
|
+
acceptedPaddedBytes: z.ZodNumber;
|
|
261
|
+
recordedAt: z.ZodISODateTime;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
}, z.core.$strict>;
|
|
264
|
+
export type AgentMemoryProjectionSealedReceipt = z.infer<typeof AgentMemoryProjectionSealedReceiptSchema>;
|
|
265
|
+
export declare const AgentMemoryProjectionReceiptSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
76
266
|
taskId: z.ZodString;
|
|
77
267
|
agentRef: z.ZodObject<{
|
|
78
268
|
agentId: z.ZodString;
|
|
@@ -89,6 +279,12 @@ export declare const AgentMemoryProjectionReceiptSchema: z.ZodObject<{
|
|
|
89
279
|
sourceSeq: z.ZodNumber;
|
|
90
280
|
mutationId: z.ZodUUID;
|
|
91
281
|
policyRevision: z.ZodString;
|
|
282
|
+
outcome: z.ZodEnum<{
|
|
283
|
+
accepted: "accepted";
|
|
284
|
+
idempotent: "idempotent";
|
|
285
|
+
}>;
|
|
286
|
+
tenantId: z.ZodString;
|
|
287
|
+
deviceId: z.ZodString;
|
|
92
288
|
redactedHash: z.ZodString;
|
|
93
289
|
redactedByteCount: z.ZodNumber;
|
|
94
290
|
metering: z.ZodObject<{
|
|
@@ -96,7 +292,37 @@ export declare const AgentMemoryProjectionReceiptSchema: z.ZodObject<{
|
|
|
96
292
|
acceptedRedactedBytes: z.ZodNumber;
|
|
97
293
|
recordedAt: z.ZodISODateTime;
|
|
98
294
|
}, z.core.$strict>;
|
|
99
|
-
}, z.core.$strict
|
|
295
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
296
|
+
taskId: z.ZodString;
|
|
297
|
+
agentRef: z.ZodObject<{
|
|
298
|
+
agentId: z.ZodString;
|
|
299
|
+
profileRevision: z.ZodString;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
sessionRef: z.ZodString;
|
|
302
|
+
runtimeId: z.ZodEnum<{
|
|
303
|
+
claude: "claude";
|
|
304
|
+
codex: "codex";
|
|
305
|
+
pi: "pi";
|
|
306
|
+
}>;
|
|
307
|
+
grantRef: z.ZodString;
|
|
308
|
+
writerEpoch: z.ZodNumber;
|
|
309
|
+
sourceSeq: z.ZodNumber;
|
|
310
|
+
mutationId: z.ZodUUID;
|
|
311
|
+
policyRevision: z.ZodString;
|
|
312
|
+
outcome: z.ZodEnum<{
|
|
313
|
+
accepted: "accepted";
|
|
314
|
+
idempotent: "idempotent";
|
|
315
|
+
}>;
|
|
316
|
+
tenantId: z.ZodString;
|
|
317
|
+
deviceId: z.ZodString;
|
|
318
|
+
contentMac: z.ZodString;
|
|
319
|
+
paddedLength: z.ZodNumber;
|
|
320
|
+
metering: z.ZodObject<{
|
|
321
|
+
meteringReceiptId: z.ZodUUID;
|
|
322
|
+
acceptedPaddedBytes: z.ZodNumber;
|
|
323
|
+
recordedAt: z.ZodISODateTime;
|
|
324
|
+
}, z.core.$strict>;
|
|
325
|
+
}, z.core.$strict>]>;
|
|
100
326
|
export type AgentMemoryProjectionReceipt = z.infer<typeof AgentMemoryProjectionReceiptSchema>;
|
|
101
327
|
/**
|
|
102
328
|
* Server-side erase result. The returned epoch is the minimum legal epoch for
|
|
@@ -49,6 +49,13 @@ export declare const AGENT_INPUT_PREPARATION_CAPABILITY: "agent-input-preparatio
|
|
|
49
49
|
* `WIRE_ADDITIONS`.
|
|
50
50
|
*/
|
|
51
51
|
export declare const SEALED_PAYLOAD_CAPABILITY: 'sealed-payload-v1';
|
|
52
|
+
/**
|
|
53
|
+
* Sealed payload v2 (#1045): the `agent-message` and `memory-projection`
|
|
54
|
+
* categories. A device advertises it before a Host may send it an offer whose
|
|
55
|
+
* `sealing` names either category, or a sealed message disposition; a server
|
|
56
|
+
* advertises it before a device may send it a sealed `agent.message.publish`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const SEALED_PAYLOAD_V2_CAPABILITY: 'sealed-payload-v2';
|
|
52
59
|
/**
|
|
53
60
|
* A server advertises it before a device may send a sealed task output that
|
|
54
61
|
* names its ciphertext blob (`sealed.ciphertextRef`) instead of carrying it
|
|
@@ -60,6 +67,8 @@ export declare const SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY: 'sealed-output-cip
|
|
|
60
67
|
* machine-readable runtime failure class (#869).
|
|
61
68
|
*/
|
|
62
69
|
export declare const RUNTIME_FAILURE_CLASS_CAPABILITY: 'runtime-failure-class';
|
|
70
|
+
/** A server advertises it before a device may send `task.fail.failure.scope` (#1271). */
|
|
71
|
+
export declare const RUNTIME_QUOTA_SCOPE_CAPABILITY: 'runtime-quota-scope';
|
|
63
72
|
/**
|
|
64
73
|
* The connection understands the typed pre-claim runtime-unavailable cause
|
|
65
74
|
* (#1103 D8): `task.decline.runtimeUnavailable`, `conn.hello.runtimeUnavailable`
|
|
@@ -76,6 +85,8 @@ export declare const RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY: 'runtime-unavailable-
|
|
|
76
85
|
* schema-free consumers.
|
|
77
86
|
*/
|
|
78
87
|
export declare const RUNTIME_FAILURE_CLASSES: readonly ['auth', 'quota', 'rate_limited', 'billing', 'model_unavailable', 'input_too_large', 'invalid_request', 'overloaded', 'provider', 'runtime_exited', 'limit_reached', 'output_schema', 'unknown'];
|
|
88
|
+
/** The values of a `quota` failure's `scope` (#1271), shared by schema and schema-free consumers. */
|
|
89
|
+
export declare const RUNTIME_QUOTA_SCOPES: readonly ['account', 'model'];
|
|
79
90
|
/** Single value authority shared by schema validation and schema-free consumers. */
|
|
80
91
|
export declare const PREPARED_AGENT_MEMORY_MODES: readonly ['none', 'read', 'read-write'];
|
|
81
92
|
export declare function isPreparedAgentMemoryMode(value: unknown): value is (typeof PREPARED_AGENT_MEMORY_MODES)[number];
|
package/dist/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var INPUT_PREPARATION_WIRE_VERSION=9;var AGENT_EGRESS_POLICY_CAPABILITY="agent-egress-policy";var AGENT_EGRESS_RELIABLE_ACK_CAPABILITY="agent-egress-reliable-ack";var AGENT_EGRESS_FRESH_SESSION_CAPABILITY="agent-egress-fresh-session";var AGENT_MESSAGE_EGRESS_CAPABILITY="agent-message-egress";var AGENT_CONTENT_WORKSPACE_READ_CAPABILITY="agent-content-workspace-read";var AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY="agent-content-transcript-read";var AGENT_CONTENT_ARTIFACT_READ_CAPABILITY="agent-content-artifact-read";var AGENT_HOME_PROJECTION_CAPABILITY="agent-home-projection";var TERMINAL_PROJECTION_SELECTION_CAPABILITY="terminal-projection-selection";var HOST_MCP_TASK_CONTEXT_CAPABILITY="host-mcp-task-context";var PROVIDER_PROFILE_BINDING_CAPABILITY="provider-profile-binding";var PROVIDER_PROVISIONING_CAPABILITY="provider-provisioning.v1";var AGENT_MEMORY_INTENT_CAPABILITY="agent-memory-intent.v1";var AGENT_MEMORY_PROJECTION_CAPABILITY="agent.memory.projection";var AGENT_MEMORY_SELECTION_CAPABILITY="agent-memory-selection";var AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY="agent-memory-read-if-admitted";var AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY="agent-memory-read-write-if-admitted";var AGENT_INPUT_PREPARATION_CAPABILITY=`agent-input-preparation-v${INPUT_PREPARATION_WIRE_VERSION}`;var SEALED_PAYLOAD_CAPABILITY="sealed-payload-v1";var SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY="sealed-output-ciphertext-ref";var RUNTIME_FAILURE_CLASS_CAPABILITY="runtime-failure-class";var RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY="runtime-unavailable-cause";var RUNTIME_FAILURE_CLASSES=["auth","quota","rate_limited","billing","model_unavailable","input_too_large","invalid_request","overloaded","provider","runtime_exited","limit_reached","output_schema","unknown"];var PREPARED_AGENT_MEMORY_MODES=["none","read","read-write"];function isPreparedAgentMemoryMode(value){return typeof value==="string"&&PREPARED_AGENT_MEMORY_MODES.some(mode=>mode===value)}var MAILBOX_READ_AHEAD_MAX_SEQS=4096;var MAILBOX_READ_AHEAD_CAPABILITY="mailbox-read-ahead";var PROTOCOL_VERSION=4;var AGENT_HOME_READERS_CAPABILITY="agent-home-readers";var CUSTOM_HARNESS_CAPABILITY="custom-harness";var CAPABILITY_FLAGS=["steer","blob-upload","dispatch-selection",PROVIDER_PROFILE_BINDING_CAPABILITY,"toolset-selection","agent-home-contract",AGENT_HOME_READERS_CAPABILITY,AGENT_EGRESS_POLICY_CAPABILITY,AGENT_EGRESS_RELIABLE_ACK_CAPABILITY,AGENT_MESSAGE_EGRESS_CAPABILITY,AGENT_EGRESS_FRESH_SESSION_CAPABILITY,AGENT_CONTENT_WORKSPACE_READ_CAPABILITY,AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY,AGENT_CONTENT_ARTIFACT_READ_CAPABILITY,AGENT_HOME_PROJECTION_CAPABILITY,AGENT_INPUT_PREPARATION_CAPABILITY,TERMINAL_PROJECTION_SELECTION_CAPABILITY,HOST_MCP_TASK_CONTEXT_CAPABILITY,CUSTOM_HARNESS_CAPABILITY,MAILBOX_READ_AHEAD_CAPABILITY,PROVIDER_PROVISIONING_CAPABILITY,AGENT_MEMORY_INTENT_CAPABILITY,AGENT_MEMORY_SELECTION_CAPABILITY,AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY,AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY,"agent-message-draft",SEALED_PAYLOAD_CAPABILITY,SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY,RUNTIME_FAILURE_CLASS_CAPABILITY,RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY];var TASK_STATES=["Offered","Claimed","Running","AwaitApproval","Complete","Failed","Cancelled"];var TASK_TRANSITIONS={Offered:["Claimed","Cancelled","Failed"],Claimed:["Running","Failed","Cancelled"],Running:["AwaitApproval","Complete","Failed","Cancelled"],AwaitApproval:["Running","Failed","Cancelled"],Complete:[],Failed:[],Cancelled:[]};function canTransition(from,to){return TASK_TRANSITIONS[from].includes(to)}var TASK_FAIL_REASON_MAX_BYTES=2048;var REDACTED="[redacted]";var VALUE=String.raw`(?:"(?:\\[^\n]|[^"\\\n])*(?:\\)?"?|'(?:\\[^\n]|[^'\\\n])*(?:\\)?'?|[^\s"'\[\u2026,;&|][^\s"',;&|]*)`;var GAP="[ \\t]{0,16}";var RULES=[[new RegExp(String.raw`\b((?:proxy-)?authorization)(["']?${GAP}[:=]${GAP})(?:(?:bearer|basic|token|digest)[ \t]{1,16})?${VALUE}`,"gi"),`$1$2${REDACTED}`],[/\b(bearer)[ \t]{1,16}[A-Za-z0-9._~+/=-]{8,}/gi,`$1 ${REDACTED}`],[new RegExp(String.raw`(key|token|secret|passw(?:or)?d[\w.-]{0,64})(["']?${GAP}[:=]${GAP})${VALUE}`,"gi"),`$1$2${REDACTED}`],[/:\/\/[^\s/?#@]{1,256}@/g,`://${REDACTED}@`],[/\bsk-[A-Za-z0-9_-]{16,}/g,REDACTED],[/\bxai-[A-Za-z0-9_-]{16,}/g,REDACTED],[/\bAIza[0-9A-Za-z_-]{30,}/g,REDACTED],[/\bgh[pousr]_[A-Za-z0-9]{20,}/g,REDACTED],[/\bgithub_pat_[A-Za-z0-9_]{20,}/g,REDACTED],[/\bAKIA[0-9A-Z]{16}/g,REDACTED],[/\beyJ[A-Za-z0-9_-]{10,}(?:\.[A-Za-z0-9_-]*){0,2}/g,REDACTED]];var encoder=new TextEncoder;var decoder=new TextDecoder("utf-8");function redact(text){let out=text;for(const[pattern,replacement]of RULES)out=out.replace(pattern,replacement);return out}function boundFailureReason(reason){const redacted=redact(reason);const bytes=encoder.encode(redacted);if(bytes.length<=TASK_FAIL_REASON_MAX_BYTES)return redacted;let keep=TASK_FAIL_REASON_MAX_BYTES-encoder.encode(`\u2026[truncated ${bytes.length} bytes]`).length;while(keep>0&&((bytes[keep]??0)&192)===128)keep-=1;return `${decoder.decode(bytes.subarray(0,keep))}\u2026[truncated ${bytes.length-keep} bytes]`}var AGENT_MEMORY_MAX_SNAPSHOT_BYTES=1024*1024;var AGENT_MEMORY_MAX_SNAPSHOT_FILES=128;var RUNTIME_IDS=Object.freeze(["pi","claude","codex"]);var RUNTIME_UNAVAILABLE_CAUSES=Object.freeze(["not_installed","not_executable","probe_timeout","probe_failed","app_server_unavailable","acp_unavailable","platform_unsupported","environment_unavailable","version_blocked","runtime_not_configured","runtime_not_allowed","none_available"]);var TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH=160;
|
|
1
|
+
var INPUT_PREPARATION_WIRE_VERSION=9;var AGENT_EGRESS_POLICY_CAPABILITY="agent-egress-policy";var AGENT_EGRESS_RELIABLE_ACK_CAPABILITY="agent-egress-reliable-ack";var AGENT_EGRESS_FRESH_SESSION_CAPABILITY="agent-egress-fresh-session";var AGENT_MESSAGE_EGRESS_CAPABILITY="agent-message-egress";var AGENT_CONTENT_WORKSPACE_READ_CAPABILITY="agent-content-workspace-read";var AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY="agent-content-transcript-read";var AGENT_CONTENT_ARTIFACT_READ_CAPABILITY="agent-content-artifact-read";var AGENT_HOME_PROJECTION_CAPABILITY="agent-home-projection";var TERMINAL_PROJECTION_SELECTION_CAPABILITY="terminal-projection-selection";var HOST_MCP_TASK_CONTEXT_CAPABILITY="host-mcp-task-context";var PROVIDER_PROFILE_BINDING_CAPABILITY="provider-profile-binding";var PROVIDER_PROVISIONING_CAPABILITY="provider-provisioning.v1";var AGENT_MEMORY_INTENT_CAPABILITY="agent-memory-intent.v1";var AGENT_MEMORY_PROJECTION_CAPABILITY="agent.memory.projection";var AGENT_MEMORY_SELECTION_CAPABILITY="agent-memory-selection";var AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY="agent-memory-read-if-admitted";var AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY="agent-memory-read-write-if-admitted";var AGENT_INPUT_PREPARATION_CAPABILITY=`agent-input-preparation-v${INPUT_PREPARATION_WIRE_VERSION}`;var SEALED_PAYLOAD_CAPABILITY="sealed-payload-v1";var SEALED_PAYLOAD_V2_CAPABILITY="sealed-payload-v2";var SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY="sealed-output-ciphertext-ref";var RUNTIME_FAILURE_CLASS_CAPABILITY="runtime-failure-class";var RUNTIME_QUOTA_SCOPE_CAPABILITY="runtime-quota-scope";var RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY="runtime-unavailable-cause";var RUNTIME_FAILURE_CLASSES=["auth","quota","rate_limited","billing","model_unavailable","input_too_large","invalid_request","overloaded","provider","runtime_exited","limit_reached","output_schema","unknown"];var RUNTIME_QUOTA_SCOPES=["account","model"];var PREPARED_AGENT_MEMORY_MODES=["none","read","read-write"];function isPreparedAgentMemoryMode(value){return typeof value==="string"&&PREPARED_AGENT_MEMORY_MODES.some(mode=>mode===value)}var MAILBOX_READ_AHEAD_MAX_SEQS=4096;var MAILBOX_READ_AHEAD_CAPABILITY="mailbox-read-ahead";var PROTOCOL_VERSION=4;var AGENT_HOME_READERS_CAPABILITY="agent-home-readers";var CUSTOM_HARNESS_CAPABILITY="custom-harness";var CAPABILITY_FLAGS=["steer","blob-upload","dispatch-selection",PROVIDER_PROFILE_BINDING_CAPABILITY,"toolset-selection","agent-home-contract",AGENT_HOME_READERS_CAPABILITY,AGENT_EGRESS_POLICY_CAPABILITY,AGENT_EGRESS_RELIABLE_ACK_CAPABILITY,AGENT_MESSAGE_EGRESS_CAPABILITY,AGENT_EGRESS_FRESH_SESSION_CAPABILITY,AGENT_CONTENT_WORKSPACE_READ_CAPABILITY,AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY,AGENT_CONTENT_ARTIFACT_READ_CAPABILITY,AGENT_HOME_PROJECTION_CAPABILITY,AGENT_INPUT_PREPARATION_CAPABILITY,TERMINAL_PROJECTION_SELECTION_CAPABILITY,HOST_MCP_TASK_CONTEXT_CAPABILITY,CUSTOM_HARNESS_CAPABILITY,MAILBOX_READ_AHEAD_CAPABILITY,PROVIDER_PROVISIONING_CAPABILITY,AGENT_MEMORY_INTENT_CAPABILITY,AGENT_MEMORY_SELECTION_CAPABILITY,AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY,AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY,"agent-message-draft",SEALED_PAYLOAD_CAPABILITY,SEALED_PAYLOAD_V2_CAPABILITY,SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY,RUNTIME_FAILURE_CLASS_CAPABILITY,RUNTIME_QUOTA_SCOPE_CAPABILITY,RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY];var TASK_STATES=["Offered","Claimed","Running","AwaitApproval","Complete","Failed","Cancelled"];var TASK_TRANSITIONS={Offered:["Claimed","Cancelled","Failed"],Claimed:["Running","Failed","Cancelled"],Running:["AwaitApproval","Complete","Failed","Cancelled"],AwaitApproval:["Running","Failed","Cancelled"],Complete:[],Failed:[],Cancelled:[]};function canTransition(from,to){return TASK_TRANSITIONS[from].includes(to)}var TASK_FAIL_REASON_MAX_BYTES=2048;var REDACTED="[redacted]";var VALUE=String.raw`(?:"(?:\\[^\n]|[^"\\\n])*(?:\\)?"?|'(?:\\[^\n]|[^'\\\n])*(?:\\)?'?|[^\s"'\[\u2026,;&|][^\s"',;&|]*)`;var GAP="[ \\t]{0,16}";var RULES=[[new RegExp(String.raw`\b((?:proxy-)?authorization)(["']?${GAP}[:=]${GAP})(?:(?:bearer|basic|token|digest)[ \t]{1,16})?${VALUE}`,"gi"),`$1$2${REDACTED}`],[/\b(bearer)[ \t]{1,16}[A-Za-z0-9._~+/=-]{8,}/gi,`$1 ${REDACTED}`],[new RegExp(String.raw`(key|token|secret|passw(?:or)?d[\w.-]{0,64})(["']?${GAP}[:=]${GAP})${VALUE}`,"gi"),`$1$2${REDACTED}`],[/:\/\/[^\s/?#@]{1,256}@/g,`://${REDACTED}@`],[/\bsk-[A-Za-z0-9_-]{16,}/g,REDACTED],[/\bxai-[A-Za-z0-9_-]{16,}/g,REDACTED],[/\bAIza[0-9A-Za-z_-]{30,}/g,REDACTED],[/\bgh[pousr]_[A-Za-z0-9]{20,}/g,REDACTED],[/\bgithub_pat_[A-Za-z0-9_]{20,}/g,REDACTED],[/\bAKIA[0-9A-Z]{16}/g,REDACTED],[/\beyJ[A-Za-z0-9_-]{10,}(?:\.[A-Za-z0-9_-]*){0,2}/g,REDACTED]];var encoder=new TextEncoder;var decoder=new TextDecoder("utf-8");function redact(text){let out=text;for(const[pattern,replacement]of RULES)out=out.replace(pattern,replacement);return out}function boundFailureReason(reason){const redacted=redact(reason);const bytes=encoder.encode(redacted);if(bytes.length<=TASK_FAIL_REASON_MAX_BYTES)return redacted;let keep=TASK_FAIL_REASON_MAX_BYTES-encoder.encode(`\u2026[truncated ${bytes.length} bytes]`).length;while(keep>0&&((bytes[keep]??0)&192)===128)keep-=1;return `${decoder.decode(bytes.subarray(0,keep))}\u2026[truncated ${bytes.length-keep} bytes]`}var AGENT_MEMORY_MAX_SNAPSHOT_BYTES=1024*1024;var AGENT_MEMORY_MAX_SNAPSHOT_FILES=128;var RUNTIME_IDS=Object.freeze(["pi","claude","codex"]);var RUNTIME_UNAVAILABLE_CAUSES=Object.freeze(["not_installed","not_executable","probe_timeout","probe_failed","app_server_unavailable","acp_unavailable","platform_unsupported","environment_unavailable","version_blocked","runtime_not_configured","runtime_not_allowed","none_available"]);var TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH=160;
|
|
2
2
|
|
|
3
|
-
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_HOME_PROJECTION_CAPABILITY, AGENT_HOME_READERS_CAPABILITY, AGENT_INPUT_PREPARATION_CAPABILITY, AGENT_MEMORY_INTENT_CAPABILITY, AGENT_MEMORY_MAX_SNAPSHOT_BYTES, AGENT_MEMORY_MAX_SNAPSHOT_FILES, AGENT_MEMORY_PROJECTION_CAPABILITY, AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY, AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY, AGENT_MEMORY_SELECTION_CAPABILITY, AGENT_MESSAGE_EGRESS_CAPABILITY, CAPABILITY_FLAGS, CUSTOM_HARNESS_CAPABILITY, HOST_MCP_TASK_CONTEXT_CAPABILITY, INPUT_PREPARATION_WIRE_VERSION, MAILBOX_READ_AHEAD_CAPABILITY, MAILBOX_READ_AHEAD_MAX_SEQS, PREPARED_AGENT_MEMORY_MODES, PROTOCOL_VERSION, PROVIDER_PROFILE_BINDING_CAPABILITY, PROVIDER_PROVISIONING_CAPABILITY, RUNTIME_FAILURE_CLASSES, RUNTIME_FAILURE_CLASS_CAPABILITY, RUNTIME_IDS, RUNTIME_UNAVAILABLE_CAUSES, RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY, SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY, SEALED_PAYLOAD_CAPABILITY, TASK_FAIL_REASON_MAX_BYTES, TASK_STATES, TASK_TRANSITIONS, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_PROJECTION_SELECTION_CAPABILITY, boundFailureReason, canTransition, isPreparedAgentMemoryMode };
|
|
3
|
+
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_HOME_PROJECTION_CAPABILITY, AGENT_HOME_READERS_CAPABILITY, AGENT_INPUT_PREPARATION_CAPABILITY, AGENT_MEMORY_INTENT_CAPABILITY, AGENT_MEMORY_MAX_SNAPSHOT_BYTES, AGENT_MEMORY_MAX_SNAPSHOT_FILES, AGENT_MEMORY_PROJECTION_CAPABILITY, AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY, AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY, AGENT_MEMORY_SELECTION_CAPABILITY, AGENT_MESSAGE_EGRESS_CAPABILITY, CAPABILITY_FLAGS, CUSTOM_HARNESS_CAPABILITY, HOST_MCP_TASK_CONTEXT_CAPABILITY, INPUT_PREPARATION_WIRE_VERSION, MAILBOX_READ_AHEAD_CAPABILITY, MAILBOX_READ_AHEAD_MAX_SEQS, PREPARED_AGENT_MEMORY_MODES, PROTOCOL_VERSION, PROVIDER_PROFILE_BINDING_CAPABILITY, PROVIDER_PROVISIONING_CAPABILITY, RUNTIME_FAILURE_CLASSES, RUNTIME_FAILURE_CLASS_CAPABILITY, RUNTIME_IDS, RUNTIME_QUOTA_SCOPES, RUNTIME_QUOTA_SCOPE_CAPABILITY, RUNTIME_UNAVAILABLE_CAUSES, RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY, SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY, SEALED_PAYLOAD_CAPABILITY, SEALED_PAYLOAD_V2_CAPABILITY, TASK_FAIL_REASON_MAX_BYTES, TASK_STATES, TASK_TRANSITIONS, TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH, TERMINAL_PROJECTION_SELECTION_CAPABILITY, boundFailureReason, canTransition, isPreparedAgentMemoryMode };
|
|
4
4
|
//# sourceMappingURL=constants.js.map
|
|
5
5
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/capability-constants.ts","../src/version.ts","../src/task-state.ts","../src/failure-reason.ts","../src/constants.ts"],"names":[],"mappings":"AAWO,IAAM,8BAAA,CAAiC,EAIvC,IAAM,8BAAA,CAAiC,sBAEvC,IAAM,oCAAA,CAAuC,4BAG7C,IAAM,qCAAA,CAAwC,iCAGxC,+BAAA,CAAkC,uBAExC,IAAM,uCAAA,CAA0C,+BAEhD,IAAM,y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,IAAI,CAAC,CAAC,CAAA,iBAAA,EAAoB,KAAA,CAAM,MAAA,CAAS,IAAI,CAAA,OAAA,CAC1F,CClEO,IAAM,+BAAA,CAAkC,IAAA,CAAO,SAEzC,+BAAA,CAAkC,IAGxC,IAAM,WAAA,CAAc,MAAA,CAAO,MAAA,CAAO,CAAC,IAAA,CAAM,QAAA,CAAU,OAAO,CAAU,EAUpE,IAAM,2BAA6B,MAAA,CAAO,MAAA,CAAO,CAEtD,eAAA,CAEA,gBAAA,CAEA,eAAA,CAEA,eAEA,wBAAA,CAEA,iBAAA,CAEA,sBAAA,CAEA,yBAAA,CAEA,iBAAA,CAEA,wBAAA,CAEA,sBAEA,gBACF,CAAU,EAMH,IAAM,yCAAA,CAA4C","file":"constants.js","sourcesContent":["/**\n * The ONE version of the input-preparation contract, shared by this relay wire\n * (the `agent.input.preparation` payload and the completion receipt summary)\n * and by the device-local request, receipt and artifact\n * (`@byok-sdk/client`'s `INPUT_PREPARATION_VERSION`, which is this value).\n *\n * The relay wire carries no version field of its own, so a version change is\n * made visible where admission actually happens: in the capability token\n * below. See `INPUT_PREPARATION_VERSION` in the client for what each version\n * changed.\n */\nexport const INPUT_PREPARATION_WIRE_VERSION = 9 as const;\n\n\n/** Additive daemon capability names. Server/cloud admission consumes these exactly. */\nexport const AGENT_EGRESS_POLICY_CAPABILITY = 'agent-egress-policy' as const;\n\nexport const AGENT_EGRESS_RELIABLE_ACK_CAPABILITY = 'agent-egress-reliable-ack' as const;\n\n/** Admits the distinct offer whose runtime mints its session only after start. */\nexport const AGENT_EGRESS_FRESH_SESSION_CAPABILITY = 'agent-egress-fresh-session' as const;\n\n/** Admits the distinct Agent-authored message lane; activity policy remains independent. */\nexport const AGENT_MESSAGE_EGRESS_CAPABILITY = 'agent-message-egress' as const;\n\nexport const AGENT_CONTENT_WORKSPACE_READ_CAPABILITY = 'agent-content-workspace-read' as const;\n\nexport const AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY = 'agent-content-transcript-read' as const;\n\nexport const AGENT_CONTENT_ARTIFACT_READ_CAPABILITY = 'agent-content-artifact-read' as const;\n\n/** Capability required before a task-free Agent-home projection is admitted. */\nexport const AGENT_HOME_PROJECTION_CAPABILITY = 'agent-home-projection' as const;\n\n/** Capability required before an offer may select terminal projection behavior. */\nexport const TERMINAL_PROJECTION_SELECTION_CAPABILITY = 'terminal-projection-selection' as const;\n\n/** Contract §8.1's capability gate for `byok-task-assertion-v1` tool authority. */\nexport const HOST_MCP_TASK_CONTEXT_CAPABILITY = 'host-mcp-task-context' as const;\n\n/** Daemon capability required before an exact local provider profile may be offered. */\nexport const PROVIDER_PROFILE_BINDING_CAPABILITY = 'provider-profile-binding' as const;\n\n/** Device capability required before a Host may enqueue `provider.provisioning.available`. */\nexport const PROVIDER_PROVISIONING_CAPABILITY = 'provider-provisioning.v1' as const;\n\n/** Device capability required before a Host may enqueue `agent.memory.intent.available`. */\nexport const AGENT_MEMORY_INTENT_CAPABILITY = 'agent-memory-intent.v1' as const;\n\n/** Capability required before the optional hosted Agent-memory projection can be used. */\nexport const AGENT_MEMORY_PROJECTION_CAPABILITY = 'agent.memory.projection' as const;\n\n/** Device capability required before an ordinary Agent offer may carry `agentMemory`. */\nexport const AGENT_MEMORY_SELECTION_CAPABILITY = 'agent-memory-selection' as const;\n\n/** Device capability required before an ordinary Agent offer may carry `agentMemory: 'read-if-admitted'`. */\nexport const AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY = 'agent-memory-read-if-admitted' as const;\n\n/** Device capability required before an ordinary Agent offer may carry `agentMemory: 'read-write-if-admitted'`. */\nexport const AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY = 'agent-memory-read-write-if-admitted' as const;\n\n/** Exact capability of the single input-preparation wire authority. */\nexport const AGENT_INPUT_PREPARATION_CAPABILITY =\n `agent-input-preparation-v${INPUT_PREPARATION_WIRE_VERSION}` as const;\n\n/**\n * Sealed payload v1 (#654). A device advertises it before a Host may send it\n * a sealed offer or steer; a server advertises it before a device may send it\n * sealed task output or a sealed decline code. Both gates read\n * `WIRE_ADDITIONS`.\n */\nexport const SEALED_PAYLOAD_CAPABILITY = 'sealed-payload-v1' as const;\n\n/**\n * A server advertises it before a device may send a sealed task output that\n * names its ciphertext blob (`sealed.ciphertextRef`) instead of carrying it\n * inline. The server then holds the blob for the life of the task.\n */\nexport const SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY = 'sealed-output-ciphertext-ref' as const;\n\n/**\n * A server advertises it before a device may send `task.fail.failure`, the\n * machine-readable runtime failure class (#869).\n */\nexport const RUNTIME_FAILURE_CLASS_CAPABILITY = 'runtime-failure-class' as const;\n\n/**\n * The connection understands the typed pre-claim runtime-unavailable cause\n * (#1103 D8): `task.decline.runtimeUnavailable`, `conn.hello.runtimeUnavailable`\n * and the presence projection. A daemon declares it when it emits the cause.\n * Older peers ignore the unknown flag; absence means the peer may not read\n * the cause, so a Host falls back to `retryable` and treats the cause as\n * unknown. It never infers availability or allow from absence.\n */\nexport const RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY = 'runtime-unavailable-cause' as const;\n/**\n * The closed classes of `task.fail.failure.class`: the vendored OAR\n * `FailureClass` values. `unknown` means the runtime gave no structured\n * evidence. Single value authority shared by schema validation and\n * schema-free consumers.\n */\nexport const RUNTIME_FAILURE_CLASSES = [\n 'auth', 'quota', 'rate_limited', 'billing', 'model_unavailable', 'input_too_large', 'invalid_request',\n 'overloaded', 'provider', 'runtime_exited', 'limit_reached', 'output_schema', 'unknown',\n] as const;\n\n/** Single value authority shared by schema validation and schema-free consumers. */\nexport const PREPARED_AGENT_MEMORY_MODES = ['none', 'read', 'read-write'] as const;\n\nexport function isPreparedAgentMemoryMode(value: unknown): value is (typeof PREPARED_AGENT_MEMORY_MODES)[number] {\n return typeof value === 'string' && PREPARED_AGENT_MEMORY_MODES.some(mode => mode === value);\n}\n","/** Bounded volatile navigation; only cursor is a durable acknowledgement. */\nexport const MAILBOX_READ_AHEAD_MAX_SEQS = 4096;\nexport const MAILBOX_READ_AHEAD_CAPABILITY = 'mailbox-read-ahead';\n\n/**\n * Wire protocol version. Every v4 change is a version bump, a gated addition\n * or a strip-safe addition: see docs/protocol.md \"Freeze rule\", which is the\n * one statement of the rule, and `src/wire-additions.ts`, which declares the\n * receiver-capability gates and additions. No v4 release has been published\n * yet, so `src/__tests__/compat.test.ts` has no published v4 decoder to prove\n * additions against; cross-release gates stay unproven until one exists.\n *\n * v4 completes the ADR-034 cutover and retires the approval paths kept for\n * pre-M5 peers. It removes the v3 handshake answer, the runtime-only offers\n * (with and without toolsets) with their sealed twins, and the\n * `strict-agent-only` flag: every offer is Agent-bound. `approvalId` is\n * required on `task.await_approval`, `task.approve` and `task.reject`, so a\n * decision resolves only the approval it names. `task.approval_resolved` is\n * baseline: the daemon reports every locally resolved approval, and the\n * server no longer infers one from later task activity. The three approval\n * capability flags of v3 are gone. A v3 envelope is rejected; there is no v3 reader. Drain, then\n * upgrade server and client together.\n *\n * v3 made `schema` required on the `terminalProjection.mode:\n * 'result-document'` arm (`terminal-projection.ts`, `result-schema.ts`): the\n * offer freezes the outcome schema, and the outcome reaches the Host only as\n * `task.complete.document`. That narrows a strict shape, so it is a wire\n * major. A v2 envelope is rejected; there is no v2 reader and no capability\n * negotiation between the two result-document shapes. Drain, then upgrade\n * server and client together. Every addition v2 declared is part of the v3\n * baseline, and the v2 `result-document` capability flag is gone: every v3\n * server keeps `task.complete.document`.\n *\n * v2 removed the task offer's `policy` (`PermissionPolicy`), the runtime\n * capability `permissionModes` and the input-preparation `permissionMode`.\n * Sessions run without an SDK permission gate; each local agent keeps its\n * own guardrails. A v1 envelope is rejected; there is no v1 reader.\n * v2 also removed the egress policy's `metadata-status` activity mode, its\n * `activity.mode` field and the `sanitizer_rejected` drop reason. Agent\n * egress goes to the Host as the runtime produced it.\n * v2 also removed the input-preparation artifact's `toolImplementationKinds`\n * and the readiness reason `executor_identity_unproven`. The SDK does not\n * attest tool executables. The artifact names its counted tools in\n * `toolNames`.\n */\nexport const PROTOCOL_VERSION = 4;\n\n/**\n * The device runs `homeAccess: 'memory-reader'` Agent offers: each reader\n * Attempt gets its own run directory under the Agent home, and readers are\n * counted apart from the one writer. The Agent offers are strict, so a host\n * must refuse a reader offer to a device without this flag before it creates\n * the task.\n */\nexport const AGENT_HOME_READERS_CAPABILITY = 'agent-home-readers' as const;\n\n/**\n * Capability flags. The daemon sends its flags in `conn.hello`; the server\n * sends its own on every long-poll response (`EventsPollResponse`). Additional\n * flags may be introduced without a protocol version bump; unrecognized flags\n * must be ignored by both sides.\n *\n * `dispatch-selection` (additive-minor) is a correctness gate for the\n * optional offer `dispatchSelection` control field. An older v1 daemon\n * legally strips unknown optional fields, so a server must never send an\n * authoritative provider/model selection unless the target connection\n * advertises this flag. Absence means reject before task creation, not send\n * an offer that could reach a different provider.\n *\n * `toolset-selection` (additive-minor) means the daemon understands an\n * offer's `requiredToolsets` and can resolve its logical ids against local\n * MCP configuration.\n */\nexport const CUSTOM_HARNESS_CAPABILITY = 'custom-harness' as const;\n\nexport const CAPABILITY_FLAGS = [\n 'steer',\n 'blob-upload',\n 'dispatch-selection',\n PROVIDER_PROFILE_BINDING_CAPABILITY,\n 'toolset-selection',\n 'agent-home-contract',\n AGENT_HOME_READERS_CAPABILITY,\n AGENT_EGRESS_POLICY_CAPABILITY,\n AGENT_EGRESS_RELIABLE_ACK_CAPABILITY,\n AGENT_MESSAGE_EGRESS_CAPABILITY,\n AGENT_EGRESS_FRESH_SESSION_CAPABILITY,\n AGENT_CONTENT_WORKSPACE_READ_CAPABILITY,\n AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY,\n AGENT_CONTENT_ARTIFACT_READ_CAPABILITY,\n AGENT_HOME_PROJECTION_CAPABILITY,\n AGENT_INPUT_PREPARATION_CAPABILITY,\n TERMINAL_PROJECTION_SELECTION_CAPABILITY,\n HOST_MCP_TASK_CONTEXT_CAPABILITY,\n CUSTOM_HARNESS_CAPABILITY,\n MAILBOX_READ_AHEAD_CAPABILITY,\n PROVIDER_PROVISIONING_CAPABILITY,\n AGENT_MEMORY_INTENT_CAPABILITY,\n AGENT_MEMORY_SELECTION_CAPABILITY,\n AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY,\n AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY,\n 'agent-message-draft',\n SEALED_PAYLOAD_CAPABILITY,\n SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY,\n RUNTIME_FAILURE_CLASS_CAPABILITY,\n RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY,\n] as const;\n\nexport type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number];\nimport {\n AGENT_EGRESS_POLICY_CAPABILITY,\n AGENT_EGRESS_RELIABLE_ACK_CAPABILITY,\n AGENT_EGRESS_FRESH_SESSION_CAPABILITY,\n AGENT_MESSAGE_EGRESS_CAPABILITY,\n AGENT_CONTENT_WORKSPACE_READ_CAPABILITY,\n AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY,\n AGENT_CONTENT_ARTIFACT_READ_CAPABILITY,\n AGENT_HOME_PROJECTION_CAPABILITY,\n TERMINAL_PROJECTION_SELECTION_CAPABILITY,\n HOST_MCP_TASK_CONTEXT_CAPABILITY,\n PROVIDER_PROFILE_BINDING_CAPABILITY,\n PROVIDER_PROVISIONING_CAPABILITY,\n AGENT_MEMORY_INTENT_CAPABILITY,\n AGENT_MEMORY_SELECTION_CAPABILITY,\n AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY,\n AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY,\n AGENT_INPUT_PREPARATION_CAPABILITY,\n SEALED_PAYLOAD_CAPABILITY,\n SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY,\n RUNTIME_FAILURE_CLASS_CAPABILITY,\n RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY,\n} from './capability-constants';\n","export const TASK_STATES = [\n 'Offered',\n 'Claimed',\n 'Running',\n 'AwaitApproval',\n 'Complete',\n 'Failed',\n 'Cancelled',\n] as const;\n\nexport type TaskState = (typeof TASK_STATES)[number];\n\n/**\n * Legal state transitions for a task. `Complete` / `Failed` / `Cancelled` are\n * terminal (no outgoing edges). `Running` and `AwaitApproval` form a loop:\n * the daemon can request approval mid-run and resume once the server\n * approves (or fail/cancel out of the approval wait).\n *\n * `Offered -> Failed` (M1 gap #5, \"Declined vs. Failed\"): a daemon that\n * declines an offer pre-claim (`task.decline`) reports it through the\n * existing `Failed` state rather than a new `Declined` state. A decline and\n * a post-claim failure are the same outcome from the dispatcher's point of\n * view — this attempt produced no result, `reason`/`retryable` say why and\n * whether retrying elsewhere makes sense — so reusing `Failed` keeps the\n * state machine minimal instead of forking every terminal-state consumer\n * into \"Failed or Declined, handle both\". See docs/protocol.md for the full\n * writeup.\n */\nexport const TASK_TRANSITIONS: Readonly<Record<TaskState, readonly TaskState[]>> = {\n Offered: ['Claimed', 'Cancelled', 'Failed'],\n Claimed: ['Running', 'Failed', 'Cancelled'],\n Running: ['AwaitApproval', 'Complete', 'Failed', 'Cancelled'],\n AwaitApproval: ['Running', 'Failed', 'Cancelled'],\n Complete: [],\n Failed: [],\n Cancelled: [],\n};\n\n/** Whether `from -> to` is a legal transition per {@link TASK_TRANSITIONS}. */\nexport function canTransition(from: TaskState, to: TaskState): boolean {\n return TASK_TRANSITIONS[from].includes(to);\n}\n","/**\n * The single authority for the display text of a `task.fail` `reason` (#1124).\n *\n * A runtime's stderr tail can carry credentials a runtime or proxy printed\n * while failing. The `task.fail` schema applies this to `reason` on every\n * parse, so `createEnvelope` bounds what a daemon sends (sealed or not) and\n * every decode bounds what a receiver holds. The raw tail stays local, on the\n * adapter's `RuntimeExecutionFailure`. The result is a fixed point: applying\n * it to its own output changes nothing, so a bounded envelope round-trips\n * byte-for-byte.\n *\n * Every pattern starts at a literal and its runs never backtrack into a\n * failure, so the cost stays linear in the input length.\n */\n\n/** Maximum UTF-8 bytes of a `task.fail` `reason` after normalization, truncation marker included. */\nexport const TASK_FAIL_REASON_MAX_BYTES = 2048;\n\nconst REDACTED = '[redacted]';\n\n// A secret value: a quoted string (an unclosed quote runs to the end of the\n// line), or an unquoted run. A backslash and its following character belong\n// to the value together, so an escaped quote cannot expose a secret suffix.\n// A dangling backslash in an unclosed value is consumed too. Every alternative\n// succeeds greedily without backtracking. An unquoted value never starts with `[` or `…`, so a\n// redaction or truncation marker is never mistaken for a value on a second pass.\nconst VALUE = String.raw`(?:\"(?:\\\\[^\\n]|[^\"\\\\\\n])*(?:\\\\)?\"?|'(?:\\\\[^\\n]|[^'\\\\\\n])*(?:\\\\)?'?|[^\\s\"'\\[\\u2026,;&|][^\\s\"',;&|]*)`;\n\n// Bounded runs keep a failed match from rescanning a long run at every literal.\nconst GAP = '[ \\\\t]{0,16}';\n\nconst RULES: ReadonlyArray<readonly [RegExp, string]> = [\n // `Authorization: Bearer …`, `proxy-authorization=Basic …`, JSON `\"authorization\": \"…\"`.\n [new RegExp(String.raw`\\b((?:proxy-)?authorization)([\"']?${GAP}[:=]${GAP})(?:(?:bearer|basic|token|digest)[ \\t]{1,16})?${VALUE}`, 'gi'), `$1$2${REDACTED}`],\n [/\\b(bearer)[ \\t]{1,16}[A-Za-z0-9._~+/=-]{8,}/gi, `$1 ${REDACTED}`],\n // `ANTHROPIC_API_KEY=…`, `x-api-key: …`, `GITHUB_TOKEN=…`, `client_secret: …`, `DB_PASSWORD_FILE=…`.\n [new RegExp(String.raw`(key|token|secret|passw(?:or)?d[\\w.-]{0,64})([\"']?${GAP}[:=]${GAP})${VALUE}`, 'gi'), `$1$2${REDACTED}`],\n // URL userinfo: `postgres://user:pass@host`, `https://token@host`.\n [/:\\/\\/[^\\s/?#@]{1,256}@/g, `://${REDACTED}@`],\n // Provider key shapes.\n [/\\bsk-[A-Za-z0-9_-]{16,}/g, REDACTED],\n [/\\bxai-[A-Za-z0-9_-]{16,}/g, REDACTED],\n [/\\bAIza[0-9A-Za-z_-]{30,}/g, REDACTED],\n [/\\bgh[pousr]_[A-Za-z0-9]{20,}/g, REDACTED],\n [/\\bgithub_pat_[A-Za-z0-9_]{20,}/g, REDACTED],\n [/\\bAKIA[0-9A-Z]{16}/g, REDACTED],\n // JWT-like tokens.\n [/\\beyJ[A-Za-z0-9_-]{10,}(?:\\.[A-Za-z0-9_-]*){0,2}/g, REDACTED],\n];\n\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder('utf-8');\n\nfunction redact(text: string): string {\n let out = text;\n for (const [pattern, replacement] of RULES) out = out.replace(pattern, replacement);\n return out;\n}\n\n/**\n * Redact credentials from a failure reason, then cap it at\n * {@link TASK_FAIL_REASON_MAX_BYTES} UTF-8 bytes on a code-point boundary\n * with a `…[truncated N bytes]` marker, where N counts the dropped redacted\n * bytes.\n */\nexport function boundFailureReason(reason: string): string {\n const redacted = redact(reason);\n const bytes = encoder.encode(redacted);\n if (bytes.length <= TASK_FAIL_REASON_MAX_BYTES) return redacted;\n // Reserve the widest marker this input can need; the final one is no wider.\n let keep = TASK_FAIL_REASON_MAX_BYTES - encoder.encode(`\\u2026[truncated ${bytes.length} bytes]`).length;\n while (keep > 0 && ((bytes[keep] ?? 0) & 0xc0) === 0x80) keep -= 1;\n return `${decoder.decode(bytes.subarray(0, keep))}\\u2026[truncated ${bytes.length - keep} bytes]`;\n}\n","/** Schema-free protocol values. Import this entry when runtime schemas are unnecessary. */\nexport * from './version';\nexport * from './task-state';\nexport * from './capability-constants';\nexport * from './failure-reason';\n\n/** Maximum raw UTF-8 content bytes in one local Host Agent-memory export; no truncation. */\nexport const AGENT_MEMORY_MAX_SNAPSHOT_BYTES = 1024 * 1024;\n/** Maximum memory files in one local Host export, including MEMORY.md. */\nexport const AGENT_MEMORY_MAX_SNAPSHOT_FILES = 128;\n\n/** The frozen wire runtime ids. Any other adapter id is a custom harness (`harnessId`). */\nexport const RUNTIME_IDS = Object.freeze(['pi', 'claude', 'codex'] as const);\n\n/**\n * Why a runtime is unavailable before claim (#1103 D6). Append-only: a cause is\n * never renamed, removed or given a new meaning. The wire reads an unknown\n * well-formed token as `unknown` and keeps it verbatim (#1121), so a newer\n * device can add one without a protocol bump. Names are snake_case, unlike the\n * kebab-case detection kinds, because the mapping is explicit and never a\n * string transformation.\n */\nexport const RUNTIME_UNAVAILABLE_CAUSES = Object.freeze([\n /** Detection: `not-found`. */\n 'not_installed',\n /** Detection: `not-executable`. */\n 'not_executable',\n /** Detection: `timeout`. */\n 'probe_timeout',\n /** Detection: `probe-failed`. */\n 'probe_failed',\n /** Detection: `refused` / `app_server_unavailable`. */\n 'app_server_unavailable',\n /** Detection: `refused` / `acp_unavailable`. */\n 'acp_unavailable',\n /** Detection: `refused` / `platform_unsupported`. */\n 'platform_unsupported',\n /** The login-shell environment capture failed (#1095). */\n 'environment_unavailable',\n /** A Host-configured version policy blocked the installed token (#1103). */\n 'version_blocked',\n /** The offer named an id this daemon has no adapter for. */\n 'runtime_not_configured',\n /** The device runtime allowlist excludes the requested id. */\n 'runtime_not_allowed',\n /** Automatic selection exhausted every candidate. */\n 'none_available',\n] as const);\n\n/** One append-only `runtime_unavailable` cause. */\nexport type RuntimeUnavailableCause = (typeof RUNTIME_UNAVAILABLE_CAUSES)[number];\n\n/** Maximum length of a served model name. */\nexport const TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH = 160;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/capability-constants.ts","../src/version.ts","../src/task-state.ts","../src/failure-reason.ts","../src/constants.ts"],"names":[],"mappings":"AAWO,IAAM,8BAAA,CAAiC,EAIvC,IAAM,8BAAA,CAAiC,0BAEjC,oCAAA,CAAuC,4BAG7C,IAAM,qCAAA,CAAwC,6BAG9C,IAAM,gCAAkC,uBAExC,IAAM,uCAAA,CAA0C,+BAEhD,IAAM,wCAAA,CAA2C,gCAEjD,IAAM,sCAAA,CAAyC,8BAG/C,IAAM,gCAAA,CAAmC,4BAGnC,wCAAA,CAA2C,gCAGjD,IAAM,gCAAA,CAAmC,wBAGzC,IAAM,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AAA,CAAS,CAAA,CAAG,IAAI,CAAC,CAAC,CAAA,iBAAA,EAAoB,MAAM,MAAA,CAAS,IAAI,CAAA,OAAA,CAC1F,CClEO,IAAM,+BAAA,CAAkC,IAAA,CAAO,KAE/C,IAAM,+BAAA,CAAkC,IAGxC,IAAM,WAAA,CAAc,MAAA,CAAO,OAAO,CAAC,IAAA,CAAM,QAAA,CAAU,OAAO,CAAU,MAU9D,0BAAA,CAA6B,MAAA,CAAO,MAAA,CAAO,CAEtD,eAAA,CAEA,gBAAA,CAEA,gBAEA,cAAA,CAEA,wBAAA,CAEA,iBAAA,CAEA,sBAAA,CAEA,yBAAA,CAEA,iBAAA,CAEA,wBAAA,CAEA,qBAAA,CAEA,gBACF,CAAU,EAMH,IAAM,yCAAA,CAA4C","file":"constants.js","sourcesContent":["/**\n * The ONE version of the input-preparation contract, shared by this relay wire\n * (the `agent.input.preparation` payload and the completion receipt summary)\n * and by the device-local request, receipt and artifact\n * (`@byok-sdk/client`'s `INPUT_PREPARATION_VERSION`, which is this value).\n *\n * The relay wire carries no version field of its own, so a version change is\n * made visible where admission actually happens: in the capability token\n * below. See `INPUT_PREPARATION_VERSION` in the client for what each version\n * changed.\n */\nexport const INPUT_PREPARATION_WIRE_VERSION = 9 as const;\n\n\n/** Additive daemon capability names. Server/cloud admission consumes these exactly. */\nexport const AGENT_EGRESS_POLICY_CAPABILITY = 'agent-egress-policy' as const;\n\nexport const AGENT_EGRESS_RELIABLE_ACK_CAPABILITY = 'agent-egress-reliable-ack' as const;\n\n/** Admits the distinct offer whose runtime mints its session only after start. */\nexport const AGENT_EGRESS_FRESH_SESSION_CAPABILITY = 'agent-egress-fresh-session' as const;\n\n/** Admits the distinct Agent-authored message lane; activity policy remains independent. */\nexport const AGENT_MESSAGE_EGRESS_CAPABILITY = 'agent-message-egress' as const;\n\nexport const AGENT_CONTENT_WORKSPACE_READ_CAPABILITY = 'agent-content-workspace-read' as const;\n\nexport const AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY = 'agent-content-transcript-read' as const;\n\nexport const AGENT_CONTENT_ARTIFACT_READ_CAPABILITY = 'agent-content-artifact-read' as const;\n\n/** Capability required before a task-free Agent-home projection is admitted. */\nexport const AGENT_HOME_PROJECTION_CAPABILITY = 'agent-home-projection' as const;\n\n/** Capability required before an offer may select terminal projection behavior. */\nexport const TERMINAL_PROJECTION_SELECTION_CAPABILITY = 'terminal-projection-selection' as const;\n\n/** Contract §8.1's capability gate for `byok-task-assertion-v1` tool authority. */\nexport const HOST_MCP_TASK_CONTEXT_CAPABILITY = 'host-mcp-task-context' as const;\n\n/** Daemon capability required before an exact local provider profile may be offered. */\nexport const PROVIDER_PROFILE_BINDING_CAPABILITY = 'provider-profile-binding' as const;\n\n/** Device capability required before a Host may enqueue `provider.provisioning.available`. */\nexport const PROVIDER_PROVISIONING_CAPABILITY = 'provider-provisioning.v1' as const;\n\n/** Device capability required before a Host may enqueue `agent.memory.intent.available`. */\nexport const AGENT_MEMORY_INTENT_CAPABILITY = 'agent-memory-intent.v1' as const;\n\n/** Capability required before the optional hosted Agent-memory projection can be used. */\nexport const AGENT_MEMORY_PROJECTION_CAPABILITY = 'agent.memory.projection' as const;\n\n/** Device capability required before an ordinary Agent offer may carry `agentMemory`. */\nexport const AGENT_MEMORY_SELECTION_CAPABILITY = 'agent-memory-selection' as const;\n\n/** Device capability required before an ordinary Agent offer may carry `agentMemory: 'read-if-admitted'`. */\nexport const AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY = 'agent-memory-read-if-admitted' as const;\n\n/** Device capability required before an ordinary Agent offer may carry `agentMemory: 'read-write-if-admitted'`. */\nexport const AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY = 'agent-memory-read-write-if-admitted' as const;\n\n/** Exact capability of the single input-preparation wire authority. */\nexport const AGENT_INPUT_PREPARATION_CAPABILITY =\n `agent-input-preparation-v${INPUT_PREPARATION_WIRE_VERSION}` as const;\n\n/**\n * Sealed payload v1 (#654). A device advertises it before a Host may send it\n * a sealed offer or steer; a server advertises it before a device may send it\n * sealed task output or a sealed decline code. Both gates read\n * `WIRE_ADDITIONS`.\n */\nexport const SEALED_PAYLOAD_CAPABILITY = 'sealed-payload-v1' as const;\n\n/**\n * Sealed payload v2 (#1045): the `agent-message` and `memory-projection`\n * categories. A device advertises it before a Host may send it an offer whose\n * `sealing` names either category, or a sealed message disposition; a server\n * advertises it before a device may send it a sealed `agent.message.publish`.\n */\nexport const SEALED_PAYLOAD_V2_CAPABILITY = 'sealed-payload-v2' as const;\n\n/**\n * A server advertises it before a device may send a sealed task output that\n * names its ciphertext blob (`sealed.ciphertextRef`) instead of carrying it\n * inline. The server then holds the blob for the life of the task.\n */\nexport const SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY = 'sealed-output-ciphertext-ref' as const;\n\n/**\n * A server advertises it before a device may send `task.fail.failure`, the\n * machine-readable runtime failure class (#869).\n */\nexport const RUNTIME_FAILURE_CLASS_CAPABILITY = 'runtime-failure-class' as const;\n\n/** A server advertises it before a device may send `task.fail.failure.scope` (#1271). */\nexport const RUNTIME_QUOTA_SCOPE_CAPABILITY = 'runtime-quota-scope' as const;\n\n/**\n * The connection understands the typed pre-claim runtime-unavailable cause\n * (#1103 D8): `task.decline.runtimeUnavailable`, `conn.hello.runtimeUnavailable`\n * and the presence projection. A daemon declares it when it emits the cause.\n * Older peers ignore the unknown flag; absence means the peer may not read\n * the cause, so a Host falls back to `retryable` and treats the cause as\n * unknown. It never infers availability or allow from absence.\n */\nexport const RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY = 'runtime-unavailable-cause' as const;\n/**\n * The closed classes of `task.fail.failure.class`: the vendored OAR\n * `FailureClass` values. `unknown` means the runtime gave no structured\n * evidence. Single value authority shared by schema validation and\n * schema-free consumers.\n */\nexport const RUNTIME_FAILURE_CLASSES = [\n 'auth', 'quota', 'rate_limited', 'billing', 'model_unavailable', 'input_too_large', 'invalid_request',\n 'overloaded', 'provider', 'runtime_exited', 'limit_reached', 'output_schema', 'unknown',\n] as const;\n\n/** The values of a `quota` failure's `scope` (#1271), shared by schema and schema-free consumers. */\nexport const RUNTIME_QUOTA_SCOPES = ['account', 'model'] as const;\n\n/** Single value authority shared by schema validation and schema-free consumers. */\nexport const PREPARED_AGENT_MEMORY_MODES = ['none', 'read', 'read-write'] as const;\n\nexport function isPreparedAgentMemoryMode(value: unknown): value is (typeof PREPARED_AGENT_MEMORY_MODES)[number] {\n return typeof value === 'string' && PREPARED_AGENT_MEMORY_MODES.some(mode => mode === value);\n}\n","/** Bounded volatile navigation; only cursor is a durable acknowledgement. */\nexport const MAILBOX_READ_AHEAD_MAX_SEQS = 4096;\nexport const MAILBOX_READ_AHEAD_CAPABILITY = 'mailbox-read-ahead';\n\n/**\n * Wire protocol version. Every v4 change is a version bump, a gated addition\n * or a strip-safe addition: see docs/protocol.md \"Freeze rule\", which is the\n * one statement of the rule, and `src/wire-additions.ts`, which declares the\n * receiver-capability gates and additions. No v4 release has been published\n * yet, so `src/__tests__/compat.test.ts` has no published v4 decoder to prove\n * additions against; cross-release gates stay unproven until one exists.\n *\n * v4 completes the ADR-034 cutover and retires the approval paths kept for\n * pre-M5 peers. It removes the v3 handshake answer, the runtime-only offers\n * (with and without toolsets) with their sealed twins, and the\n * `strict-agent-only` flag: every offer is Agent-bound. `approvalId` is\n * required on `task.await_approval`, `task.approve` and `task.reject`, so a\n * decision resolves only the approval it names. `task.approval_resolved` is\n * baseline: the daemon reports every locally resolved approval, and the\n * server no longer infers one from later task activity. The three approval\n * capability flags of v3 are gone. A v3 envelope is rejected; there is no v3 reader. Drain, then\n * upgrade server and client together.\n *\n * v3 made `schema` required on the `terminalProjection.mode:\n * 'result-document'` arm (`terminal-projection.ts`, `result-schema.ts`): the\n * offer freezes the outcome schema, and the outcome reaches the Host only as\n * `task.complete.document`. That narrows a strict shape, so it is a wire\n * major. A v2 envelope is rejected; there is no v2 reader and no capability\n * negotiation between the two result-document shapes. Drain, then upgrade\n * server and client together. Every addition v2 declared is part of the v3\n * baseline, and the v2 `result-document` capability flag is gone: every v3\n * server keeps `task.complete.document`.\n *\n * v2 removed the task offer's `policy` (`PermissionPolicy`), the runtime\n * capability `permissionModes` and the input-preparation `permissionMode`.\n * Sessions run without an SDK permission gate; each local agent keeps its\n * own guardrails. A v1 envelope is rejected; there is no v1 reader.\n * v2 also removed the egress policy's `metadata-status` activity mode, its\n * `activity.mode` field and the `sanitizer_rejected` drop reason. Agent\n * egress goes to the Host as the runtime produced it.\n * v2 also removed the input-preparation artifact's `toolImplementationKinds`\n * and the readiness reason `executor_identity_unproven`. The SDK does not\n * attest tool executables. The artifact names its counted tools in\n * `toolNames`.\n */\nexport const PROTOCOL_VERSION = 4;\n\n/**\n * The device runs `homeAccess: 'memory-reader'` Agent offers: each reader\n * Attempt gets its own run directory under the Agent home, and readers are\n * counted apart from the one writer. The Agent offers are strict, so a host\n * must refuse a reader offer to a device without this flag before it creates\n * the task.\n */\nexport const AGENT_HOME_READERS_CAPABILITY = 'agent-home-readers' as const;\n\n/**\n * Capability flags. The daemon sends its flags in `conn.hello`; the server\n * sends its own on every long-poll response (`EventsPollResponse`). Additional\n * flags may be introduced without a protocol version bump; unrecognized flags\n * must be ignored by both sides.\n *\n * `dispatch-selection` (additive-minor) is a correctness gate for the\n * optional offer `dispatchSelection` control field. An older v1 daemon\n * legally strips unknown optional fields, so a server must never send an\n * authoritative provider/model selection unless the target connection\n * advertises this flag. Absence means reject before task creation, not send\n * an offer that could reach a different provider.\n *\n * `toolset-selection` (additive-minor) means the daemon understands an\n * offer's `requiredToolsets` and can resolve its logical ids against local\n * MCP configuration.\n */\nexport const CUSTOM_HARNESS_CAPABILITY = 'custom-harness' as const;\n\nexport const CAPABILITY_FLAGS = [\n 'steer',\n 'blob-upload',\n 'dispatch-selection',\n PROVIDER_PROFILE_BINDING_CAPABILITY,\n 'toolset-selection',\n 'agent-home-contract',\n AGENT_HOME_READERS_CAPABILITY,\n AGENT_EGRESS_POLICY_CAPABILITY,\n AGENT_EGRESS_RELIABLE_ACK_CAPABILITY,\n AGENT_MESSAGE_EGRESS_CAPABILITY,\n AGENT_EGRESS_FRESH_SESSION_CAPABILITY,\n AGENT_CONTENT_WORKSPACE_READ_CAPABILITY,\n AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY,\n AGENT_CONTENT_ARTIFACT_READ_CAPABILITY,\n AGENT_HOME_PROJECTION_CAPABILITY,\n AGENT_INPUT_PREPARATION_CAPABILITY,\n TERMINAL_PROJECTION_SELECTION_CAPABILITY,\n HOST_MCP_TASK_CONTEXT_CAPABILITY,\n CUSTOM_HARNESS_CAPABILITY,\n MAILBOX_READ_AHEAD_CAPABILITY,\n PROVIDER_PROVISIONING_CAPABILITY,\n AGENT_MEMORY_INTENT_CAPABILITY,\n AGENT_MEMORY_SELECTION_CAPABILITY,\n AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY,\n AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY,\n 'agent-message-draft',\n SEALED_PAYLOAD_CAPABILITY,\n SEALED_PAYLOAD_V2_CAPABILITY,\n SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY,\n RUNTIME_FAILURE_CLASS_CAPABILITY,\n RUNTIME_QUOTA_SCOPE_CAPABILITY,\n RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY,\n] as const;\n\nexport type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number];\nimport {\n AGENT_EGRESS_POLICY_CAPABILITY,\n AGENT_EGRESS_RELIABLE_ACK_CAPABILITY,\n AGENT_EGRESS_FRESH_SESSION_CAPABILITY,\n AGENT_MESSAGE_EGRESS_CAPABILITY,\n AGENT_CONTENT_WORKSPACE_READ_CAPABILITY,\n AGENT_CONTENT_TRANSCRIPT_READ_CAPABILITY,\n AGENT_CONTENT_ARTIFACT_READ_CAPABILITY,\n AGENT_HOME_PROJECTION_CAPABILITY,\n TERMINAL_PROJECTION_SELECTION_CAPABILITY,\n HOST_MCP_TASK_CONTEXT_CAPABILITY,\n PROVIDER_PROFILE_BINDING_CAPABILITY,\n PROVIDER_PROVISIONING_CAPABILITY,\n AGENT_MEMORY_INTENT_CAPABILITY,\n AGENT_MEMORY_SELECTION_CAPABILITY,\n AGENT_MEMORY_READ_IF_ADMITTED_CAPABILITY,\n AGENT_MEMORY_READ_WRITE_IF_ADMITTED_CAPABILITY,\n AGENT_INPUT_PREPARATION_CAPABILITY,\n SEALED_PAYLOAD_CAPABILITY,\n SEALED_PAYLOAD_V2_CAPABILITY,\n SEALED_OUTPUT_CIPHERTEXT_REF_CAPABILITY,\n RUNTIME_FAILURE_CLASS_CAPABILITY,\n RUNTIME_QUOTA_SCOPE_CAPABILITY,\n RUNTIME_UNAVAILABLE_CAUSE_CAPABILITY,\n} from './capability-constants';\n","export const TASK_STATES = [\n 'Offered',\n 'Claimed',\n 'Running',\n 'AwaitApproval',\n 'Complete',\n 'Failed',\n 'Cancelled',\n] as const;\n\nexport type TaskState = (typeof TASK_STATES)[number];\n\n/**\n * Legal state transitions for a task. `Complete` / `Failed` / `Cancelled` are\n * terminal (no outgoing edges). `Running` and `AwaitApproval` form a loop:\n * the daemon can request approval mid-run and resume once the server\n * approves (or fail/cancel out of the approval wait).\n *\n * `Offered -> Failed` (M1 gap #5, \"Declined vs. Failed\"): a daemon that\n * declines an offer pre-claim (`task.decline`) reports it through the\n * existing `Failed` state rather than a new `Declined` state. A decline and\n * a post-claim failure are the same outcome from the dispatcher's point of\n * view — this attempt produced no result, `reason`/`retryable` say why and\n * whether retrying elsewhere makes sense — so reusing `Failed` keeps the\n * state machine minimal instead of forking every terminal-state consumer\n * into \"Failed or Declined, handle both\". See docs/protocol.md for the full\n * writeup.\n */\nexport const TASK_TRANSITIONS: Readonly<Record<TaskState, readonly TaskState[]>> = {\n Offered: ['Claimed', 'Cancelled', 'Failed'],\n Claimed: ['Running', 'Failed', 'Cancelled'],\n Running: ['AwaitApproval', 'Complete', 'Failed', 'Cancelled'],\n AwaitApproval: ['Running', 'Failed', 'Cancelled'],\n Complete: [],\n Failed: [],\n Cancelled: [],\n};\n\n/** Whether `from -> to` is a legal transition per {@link TASK_TRANSITIONS}. */\nexport function canTransition(from: TaskState, to: TaskState): boolean {\n return TASK_TRANSITIONS[from].includes(to);\n}\n","/**\n * The single authority for the display text of a `task.fail` `reason` (#1124).\n *\n * A runtime's stderr tail can carry credentials a runtime or proxy printed\n * while failing. The `task.fail` schema applies this to `reason` on every\n * parse, so `createEnvelope` bounds what a daemon sends (sealed or not) and\n * every decode bounds what a receiver holds. The raw tail stays local, on the\n * adapter's `RuntimeExecutionFailure`. The result is a fixed point: applying\n * it to its own output changes nothing, so a bounded envelope round-trips\n * byte-for-byte.\n *\n * Every pattern starts at a literal and its runs never backtrack into a\n * failure, so the cost stays linear in the input length.\n */\n\n/** Maximum UTF-8 bytes of a `task.fail` `reason` after normalization, truncation marker included. */\nexport const TASK_FAIL_REASON_MAX_BYTES = 2048;\n\nconst REDACTED = '[redacted]';\n\n// A secret value: a quoted string (an unclosed quote runs to the end of the\n// line), or an unquoted run. A backslash and its following character belong\n// to the value together, so an escaped quote cannot expose a secret suffix.\n// A dangling backslash in an unclosed value is consumed too. Every alternative\n// succeeds greedily without backtracking. An unquoted value never starts with `[` or `…`, so a\n// redaction or truncation marker is never mistaken for a value on a second pass.\nconst VALUE = String.raw`(?:\"(?:\\\\[^\\n]|[^\"\\\\\\n])*(?:\\\\)?\"?|'(?:\\\\[^\\n]|[^'\\\\\\n])*(?:\\\\)?'?|[^\\s\"'\\[\\u2026,;&|][^\\s\"',;&|]*)`;\n\n// Bounded runs keep a failed match from rescanning a long run at every literal.\nconst GAP = '[ \\\\t]{0,16}';\n\nconst RULES: ReadonlyArray<readonly [RegExp, string]> = [\n // `Authorization: Bearer …`, `proxy-authorization=Basic …`, JSON `\"authorization\": \"…\"`.\n [new RegExp(String.raw`\\b((?:proxy-)?authorization)([\"']?${GAP}[:=]${GAP})(?:(?:bearer|basic|token|digest)[ \\t]{1,16})?${VALUE}`, 'gi'), `$1$2${REDACTED}`],\n [/\\b(bearer)[ \\t]{1,16}[A-Za-z0-9._~+/=-]{8,}/gi, `$1 ${REDACTED}`],\n // `ANTHROPIC_API_KEY=…`, `x-api-key: …`, `GITHUB_TOKEN=…`, `client_secret: …`, `DB_PASSWORD_FILE=…`.\n [new RegExp(String.raw`(key|token|secret|passw(?:or)?d[\\w.-]{0,64})([\"']?${GAP}[:=]${GAP})${VALUE}`, 'gi'), `$1$2${REDACTED}`],\n // URL userinfo: `postgres://user:pass@host`, `https://token@host`.\n [/:\\/\\/[^\\s/?#@]{1,256}@/g, `://${REDACTED}@`],\n // Provider key shapes.\n [/\\bsk-[A-Za-z0-9_-]{16,}/g, REDACTED],\n [/\\bxai-[A-Za-z0-9_-]{16,}/g, REDACTED],\n [/\\bAIza[0-9A-Za-z_-]{30,}/g, REDACTED],\n [/\\bgh[pousr]_[A-Za-z0-9]{20,}/g, REDACTED],\n [/\\bgithub_pat_[A-Za-z0-9_]{20,}/g, REDACTED],\n [/\\bAKIA[0-9A-Z]{16}/g, REDACTED],\n // JWT-like tokens.\n [/\\beyJ[A-Za-z0-9_-]{10,}(?:\\.[A-Za-z0-9_-]*){0,2}/g, REDACTED],\n];\n\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder('utf-8');\n\nfunction redact(text: string): string {\n let out = text;\n for (const [pattern, replacement] of RULES) out = out.replace(pattern, replacement);\n return out;\n}\n\n/**\n * Redact credentials from a failure reason, then cap it at\n * {@link TASK_FAIL_REASON_MAX_BYTES} UTF-8 bytes on a code-point boundary\n * with a `…[truncated N bytes]` marker, where N counts the dropped redacted\n * bytes.\n */\nexport function boundFailureReason(reason: string): string {\n const redacted = redact(reason);\n const bytes = encoder.encode(redacted);\n if (bytes.length <= TASK_FAIL_REASON_MAX_BYTES) return redacted;\n // Reserve the widest marker this input can need; the final one is no wider.\n let keep = TASK_FAIL_REASON_MAX_BYTES - encoder.encode(`\\u2026[truncated ${bytes.length} bytes]`).length;\n while (keep > 0 && ((bytes[keep] ?? 0) & 0xc0) === 0x80) keep -= 1;\n return `${decoder.decode(bytes.subarray(0, keep))}\\u2026[truncated ${bytes.length - keep} bytes]`;\n}\n","/** Schema-free protocol values. Import this entry when runtime schemas are unnecessary. */\nexport * from './version';\nexport * from './task-state';\nexport * from './capability-constants';\nexport * from './failure-reason';\n\n/** Maximum raw UTF-8 content bytes in one local Host Agent-memory export; no truncation. */\nexport const AGENT_MEMORY_MAX_SNAPSHOT_BYTES = 1024 * 1024;\n/** Maximum memory files in one local Host export, including MEMORY.md. */\nexport const AGENT_MEMORY_MAX_SNAPSHOT_FILES = 128;\n\n/** The frozen wire runtime ids. Any other adapter id is a custom harness (`harnessId`). */\nexport const RUNTIME_IDS = Object.freeze(['pi', 'claude', 'codex'] as const);\n\n/**\n * Why a runtime is unavailable before claim (#1103 D6). Append-only: a cause is\n * never renamed, removed or given a new meaning. The wire reads an unknown\n * well-formed token as `unknown` and keeps it verbatim (#1121), so a newer\n * device can add one without a protocol bump. Names are snake_case, unlike the\n * kebab-case detection kinds, because the mapping is explicit and never a\n * string transformation.\n */\nexport const RUNTIME_UNAVAILABLE_CAUSES = Object.freeze([\n /** Detection: `not-found`. */\n 'not_installed',\n /** Detection: `not-executable`. */\n 'not_executable',\n /** Detection: `timeout`. */\n 'probe_timeout',\n /** Detection: `probe-failed`. */\n 'probe_failed',\n /** Detection: `refused` / `app_server_unavailable`. */\n 'app_server_unavailable',\n /** Detection: `refused` / `acp_unavailable`. */\n 'acp_unavailable',\n /** Detection: `refused` / `platform_unsupported`. */\n 'platform_unsupported',\n /** The login-shell environment capture failed (#1095). */\n 'environment_unavailable',\n /** A Host-configured version policy blocked the installed token (#1103). */\n 'version_blocked',\n /** The offer named an id this daemon has no adapter for. */\n 'runtime_not_configured',\n /** The device runtime allowlist excludes the requested id. */\n 'runtime_not_allowed',\n /** Automatic selection exhausted every candidate. */\n 'none_available',\n] as const);\n\n/** One append-only `runtime_unavailable` cause. */\nexport type RuntimeUnavailableCause = (typeof RUNTIME_UNAVAILABLE_CAUSES)[number];\n\n/** Maximum length of a served model name. */\nexport const TERMINAL_INFERENCE_USAGE_MODEL_MAX_LENGTH = 160;\n"]}
|
package/dist/http-api.d.ts
CHANGED
|
@@ -691,7 +691,7 @@ export declare const InputPreparationStatusQuerySchema: z.ZodObject<{
|
|
|
691
691
|
profileRevision: z.ZodString;
|
|
692
692
|
}, z.core.$strict>;
|
|
693
693
|
export type InputPreparationStatusQuery = z.infer<typeof InputPreparationStatusQuerySchema>;
|
|
694
|
-
export declare const AgentMemoryProjectionCommitRequestSchema: z.ZodObject<{
|
|
694
|
+
export declare const AgentMemoryProjectionCommitRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
695
695
|
taskId: z.ZodString;
|
|
696
696
|
agentRef: z.ZodObject<{
|
|
697
697
|
agentId: z.ZodString;
|
|
@@ -713,15 +713,84 @@ export declare const AgentMemoryProjectionCommitRequestSchema: z.ZodObject<{
|
|
|
713
713
|
redactedByteCount: z.ZodNumber;
|
|
714
714
|
redactedBytes: z.ZodString;
|
|
715
715
|
}, z.core.$strict>;
|
|
716
|
-
|
|
716
|
+
sealed: z.ZodOptional<z.ZodNever>;
|
|
717
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
718
|
+
taskId: z.ZodString;
|
|
719
|
+
agentRef: z.ZodObject<{
|
|
720
|
+
agentId: z.ZodString;
|
|
721
|
+
profileRevision: z.ZodString;
|
|
722
|
+
}, z.core.$strict>;
|
|
723
|
+
sessionRef: z.ZodString;
|
|
724
|
+
runtimeId: z.ZodEnum<{
|
|
725
|
+
claude: "claude";
|
|
726
|
+
codex: "codex";
|
|
727
|
+
pi: "pi";
|
|
728
|
+
}>;
|
|
729
|
+
grantRef: z.ZodString;
|
|
730
|
+
writerEpoch: z.ZodNumber;
|
|
731
|
+
sourceSeq: z.ZodNumber;
|
|
732
|
+
mutationId: z.ZodUUID;
|
|
733
|
+
policyRevision: z.ZodString;
|
|
734
|
+
sealed: z.ZodObject<{
|
|
735
|
+
v: z.ZodLiteral<1>;
|
|
736
|
+
suite: z.ZodLiteral<"byok-sealed-v1.hkdf-sha256.aes-256-gcm">;
|
|
737
|
+
category: z.ZodLiteral<"memory-projection">;
|
|
738
|
+
scope: z.ZodObject<{
|
|
739
|
+
id: z.ZodString;
|
|
740
|
+
epoch: z.ZodNumber;
|
|
741
|
+
keyId: z.ZodString;
|
|
742
|
+
}, z.core.$strict>;
|
|
743
|
+
chainHead: z.ZodObject<{
|
|
744
|
+
seq: z.ZodNumber;
|
|
745
|
+
hash: z.ZodString;
|
|
746
|
+
}, z.core.$strict>;
|
|
747
|
+
sender: z.ZodString;
|
|
748
|
+
salt: z.ZodString;
|
|
749
|
+
nonce: z.ZodString;
|
|
750
|
+
paddedLength: z.ZodNumber;
|
|
751
|
+
contentMac: z.ZodString;
|
|
752
|
+
ciphertext: z.ZodOptional<z.ZodString>;
|
|
753
|
+
ciphertextRef: z.ZodOptional<z.ZodObject<{
|
|
754
|
+
blobId: z.ZodString;
|
|
755
|
+
contentHash: z.ZodString;
|
|
756
|
+
size: z.ZodNumber;
|
|
757
|
+
contentType: z.ZodString;
|
|
758
|
+
}, z.core.$strict>>;
|
|
759
|
+
}, z.core.$strict>;
|
|
760
|
+
snapshot: z.ZodOptional<z.ZodNever>;
|
|
761
|
+
}, z.core.$strict>]>;
|
|
717
762
|
export type AgentMemoryProjectionCommitRequest = z.infer<typeof AgentMemoryProjectionCommitRequestSchema>;
|
|
718
|
-
export declare const AgentMemoryProjectionCommitResponseSchema: z.ZodObject<{
|
|
763
|
+
export declare const AgentMemoryProjectionCommitResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
764
|
+
taskId: z.ZodString;
|
|
765
|
+
agentRef: z.ZodObject<{
|
|
766
|
+
agentId: z.ZodString;
|
|
767
|
+
profileRevision: z.ZodString;
|
|
768
|
+
}, z.core.$strict>;
|
|
769
|
+
sessionRef: z.ZodString;
|
|
770
|
+
runtimeId: z.ZodEnum<{
|
|
771
|
+
claude: "claude";
|
|
772
|
+
codex: "codex";
|
|
773
|
+
pi: "pi";
|
|
774
|
+
}>;
|
|
775
|
+
grantRef: z.ZodString;
|
|
776
|
+
writerEpoch: z.ZodNumber;
|
|
777
|
+
sourceSeq: z.ZodNumber;
|
|
778
|
+
mutationId: z.ZodUUID;
|
|
779
|
+
policyRevision: z.ZodString;
|
|
719
780
|
outcome: z.ZodEnum<{
|
|
720
781
|
accepted: "accepted";
|
|
721
782
|
idempotent: "idempotent";
|
|
722
783
|
}>;
|
|
723
784
|
tenantId: z.ZodString;
|
|
724
785
|
deviceId: z.ZodString;
|
|
786
|
+
redactedHash: z.ZodString;
|
|
787
|
+
redactedByteCount: z.ZodNumber;
|
|
788
|
+
metering: z.ZodObject<{
|
|
789
|
+
meteringReceiptId: z.ZodUUID;
|
|
790
|
+
acceptedRedactedBytes: z.ZodNumber;
|
|
791
|
+
recordedAt: z.ZodISODateTime;
|
|
792
|
+
}, z.core.$strict>;
|
|
793
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
725
794
|
taskId: z.ZodString;
|
|
726
795
|
agentRef: z.ZodObject<{
|
|
727
796
|
agentId: z.ZodString;
|
|
@@ -738,14 +807,20 @@ export declare const AgentMemoryProjectionCommitResponseSchema: z.ZodObject<{
|
|
|
738
807
|
sourceSeq: z.ZodNumber;
|
|
739
808
|
mutationId: z.ZodUUID;
|
|
740
809
|
policyRevision: z.ZodString;
|
|
741
|
-
|
|
742
|
-
|
|
810
|
+
outcome: z.ZodEnum<{
|
|
811
|
+
accepted: "accepted";
|
|
812
|
+
idempotent: "idempotent";
|
|
813
|
+
}>;
|
|
814
|
+
tenantId: z.ZodString;
|
|
815
|
+
deviceId: z.ZodString;
|
|
816
|
+
contentMac: z.ZodString;
|
|
817
|
+
paddedLength: z.ZodNumber;
|
|
743
818
|
metering: z.ZodObject<{
|
|
744
819
|
meteringReceiptId: z.ZodUUID;
|
|
745
|
-
|
|
820
|
+
acceptedPaddedBytes: z.ZodNumber;
|
|
746
821
|
recordedAt: z.ZodISODateTime;
|
|
747
822
|
}, z.core.$strict>;
|
|
748
|
-
}, z.core.$strict>;
|
|
823
|
+
}, z.core.$strict>]>;
|
|
749
824
|
export type AgentMemoryProjectionCommitResponse = z.infer<typeof AgentMemoryProjectionCommitResponseSchema>;
|
|
750
825
|
/** `POST /byok/pair` — one-time device pairing (§6). */
|
|
751
826
|
export declare const BYOK_PAIR_PATH = "/byok/pair";
|