@byok-sdk/protocol 0.23.0 → 0.25.0-rc.1
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/README.md +1 -1
- package/dist/agent-egress.d.ts +13 -16
- package/dist/agent-event.d.ts +13 -1
- package/dist/agent-memory-intent.d.ts +717 -0
- package/dist/codec.d.ts +4 -0
- package/dist/envelope.d.ts +27 -99
- package/dist/http-api.d.ts +56 -218
- package/dist/index.d.ts +6 -6
- package/dist/index.js +223 -97
- package/dist/index.js.map +1 -1
- package/dist/input-preparation.d.ts +15 -64
- package/dist/messages.d.ts +58 -314
- package/dist/version.d.ts +20 -11
- package/package.json +2 -2
- package/dist/permission.d.ts +0 -39
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Host-approved Agent memory intents — the wire half.
|
|
4
|
+
*
|
|
5
|
+
* A Host (the only approval authority) approves one exact memory operation on
|
|
6
|
+
* one device-local Agent home. The device (the only memory content authority)
|
|
7
|
+
* applies it with its existing sha256 CAS at most once and reports a terminal,
|
|
8
|
+
* content-free completion. This package defines only:
|
|
9
|
+
*
|
|
10
|
+
* - the device capability that gates the task-free server -> daemon notice
|
|
11
|
+
* `agent.memory.intent.available`, whose strict payload is exactly
|
|
12
|
+
* `{ intentId, agentRef }` (see `messages.ts`);
|
|
13
|
+
* - the immutable intent a Host releases over its own device routes;
|
|
14
|
+
* - the fetch request/response a device exchanges with those routes;
|
|
15
|
+
* - the terminal completion a device reports and the durable readback a Host
|
|
16
|
+
* returns for it.
|
|
17
|
+
*
|
|
18
|
+
* Notice-and-fetch is the point: memory content never rides the mailbox or the
|
|
19
|
+
* device journal. The only field that carries content is `content` on a
|
|
20
|
+
* `release` of a `replace` intent.
|
|
21
|
+
*
|
|
22
|
+
* Path authority stays with the device. This schema applies only the syntactic
|
|
23
|
+
* bounds the device ledger relies on (at most 1024 ASCII bytes that need no
|
|
24
|
+
* JSON escaping); the exact memory path rule (`MEMORY.md` or
|
|
25
|
+
* `notes/<safe>/…md`) and the `MEMORY.md` delete ban are evaluated by the
|
|
26
|
+
* device and reported as `path_invalid` / `memory_md_not_deletable`. Host-only
|
|
27
|
+
* path policy is Host vocabulary and stays out of this package, as do
|
|
28
|
+
* audiences, route paths and product names.
|
|
29
|
+
*
|
|
30
|
+
* `operationDigest` is pinned to `@byok-sdk/core`
|
|
31
|
+
* `agentMemoryIntentOperationDigest(...)`, which a device recomputes with its
|
|
32
|
+
* own enrolled tenant and device ids.
|
|
33
|
+
*/
|
|
34
|
+
/** Device capability required before a Host may enqueue `agent.memory.intent.available`. */
|
|
35
|
+
export declare const AGENT_MEMORY_INTENT_CAPABILITY: 'agent-memory-intent.v1';
|
|
36
|
+
/** Maximum UTF-8 byte length of a released `replace` body (one memory file): 256 KiB. */
|
|
37
|
+
export declare const AGENT_MEMORY_INTENT_CONTENT_MAX_BYTES = 262144;
|
|
38
|
+
/** Maximum byte length of an intent `path` (ASCII, so bytes = characters). */
|
|
39
|
+
export declare const AGENT_MEMORY_INTENT_PATH_MAX_BYTES = 1024;
|
|
40
|
+
/** Maximum byte length of an opaque `approvalRef` (ASCII, so bytes = characters). */
|
|
41
|
+
export declare const AGENT_MEMORY_INTENT_APPROVAL_REF_MAX_BYTES = 128;
|
|
42
|
+
/** A memory file revision: `sha256:` over the file bytes (a missing file is the empty-bytes digest). */
|
|
43
|
+
export declare const AgentMemoryIntentRevisionSchema: z.ZodString;
|
|
44
|
+
export type AgentMemoryIntentRevision = z.infer<typeof AgentMemoryIntentRevisionSchema>;
|
|
45
|
+
/** The identity-and-operation binding; see `@byok-sdk/core` `agentMemoryIntentOperationDigest`. */
|
|
46
|
+
export declare const AgentMemoryIntentOperationDigestSchema: z.ZodString;
|
|
47
|
+
export type AgentMemoryIntentOperationDigest = z.infer<typeof AgentMemoryIntentOperationDigestSchema>;
|
|
48
|
+
/**
|
|
49
|
+
* Syntactic bound only: 1..1024 printable ASCII characters that need no JSON
|
|
50
|
+
* escaping (no `"`, no `\`, no control characters). The device applies the
|
|
51
|
+
* exact memory path rule.
|
|
52
|
+
*/
|
|
53
|
+
export declare const AgentMemoryIntentPathSchema: z.ZodString;
|
|
54
|
+
export type AgentMemoryIntentPath = z.infer<typeof AgentMemoryIntentPathSchema>;
|
|
55
|
+
/** Opaque audit correlation. The device records it and never evaluates it. */
|
|
56
|
+
export declare const AgentMemoryIntentApprovalRefSchema: z.ZodString;
|
|
57
|
+
export type AgentMemoryIntentApprovalRef = z.infer<typeof AgentMemoryIntentApprovalRefSchema>;
|
|
58
|
+
/** A `replace` body: well-formed Unicode whose UTF-8 encoding is at most 256 KiB. */
|
|
59
|
+
export declare const AgentMemoryIntentContentSchema: z.ZodString;
|
|
60
|
+
export type AgentMemoryIntentContent = z.infer<typeof AgentMemoryIntentContentSchema>;
|
|
61
|
+
export declare const AGENT_MEMORY_INTENT_OPERATIONS: readonly ['replace', 'delete'];
|
|
62
|
+
export declare const AgentMemoryIntentOperationSchema: z.ZodEnum<{
|
|
63
|
+
delete: "delete";
|
|
64
|
+
replace: "replace";
|
|
65
|
+
}>;
|
|
66
|
+
export type AgentMemoryIntentOperation = z.infer<typeof AgentMemoryIntentOperationSchema>;
|
|
67
|
+
/**
|
|
68
|
+
* The immutable Host-approved intent.
|
|
69
|
+
*
|
|
70
|
+
* - `replace`: `targetRevision` is the digest of the approved body and must
|
|
71
|
+
* differ from `baseRevision`; `content` appears only inside a `release`.
|
|
72
|
+
* - `delete`: `targetRevision` is `null` and there is never `content`.
|
|
73
|
+
*/
|
|
74
|
+
export declare const AgentMemoryIntentV1Schema: z.ZodObject<{
|
|
75
|
+
intentId: z.ZodUUID;
|
|
76
|
+
agentRef: z.ZodObject<{
|
|
77
|
+
agentId: z.ZodString;
|
|
78
|
+
profileRevision: z.ZodString;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
path: z.ZodString;
|
|
81
|
+
operation: z.ZodEnum<{
|
|
82
|
+
delete: "delete";
|
|
83
|
+
replace: "replace";
|
|
84
|
+
}>;
|
|
85
|
+
baseRevision: z.ZodString;
|
|
86
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
87
|
+
content: z.ZodOptional<z.ZodString>;
|
|
88
|
+
approvalRef: z.ZodString;
|
|
89
|
+
operationDigest: z.ZodString;
|
|
90
|
+
}, z.core.$strict>;
|
|
91
|
+
export type AgentMemoryIntentV1 = z.infer<typeof AgentMemoryIntentV1Schema>;
|
|
92
|
+
/**
|
|
93
|
+
* Codes a Host decides on its own authority. They are the only `withheld`
|
|
94
|
+
* codes and the only codes a `host_terminal` readback may carry.
|
|
95
|
+
*/
|
|
96
|
+
export declare const AGENT_MEMORY_INTENT_HOST_TERMINAL_CODES: readonly ['intent_revoked', 'intent_expired', 'placement_changed', 'profile_revision_changed'];
|
|
97
|
+
export declare const AgentMemoryIntentHostTerminalCodeSchema: z.ZodEnum<{
|
|
98
|
+
intent_expired: "intent_expired";
|
|
99
|
+
intent_revoked: "intent_revoked";
|
|
100
|
+
placement_changed: "placement_changed";
|
|
101
|
+
profile_revision_changed: "profile_revision_changed";
|
|
102
|
+
}>;
|
|
103
|
+
export type AgentMemoryIntentHostTerminalCode = z.infer<typeof AgentMemoryIntentHostTerminalCodeSchema>;
|
|
104
|
+
/**
|
|
105
|
+
* Closed rejection set. A code names the failed check, never a value. Every
|
|
106
|
+
* `rejected` completion means the device wrote no `applying` record and made
|
|
107
|
+
* zero memory writes.
|
|
108
|
+
*/
|
|
109
|
+
export declare const AGENT_MEMORY_INTENT_REJECTION_CODES: readonly ["intent_invalid", "path_invalid", "memory_md_not_deletable", "content_invalid", "intent_digest_mismatch", "agent_ref_mismatch", "agent_home_unavailable", "intent_revoked", "intent_expired", "placement_changed", "profile_revision_changed"];
|
|
110
|
+
export declare const AgentMemoryIntentRejectionCodeSchema: z.ZodEnum<{
|
|
111
|
+
agent_home_unavailable: "agent_home_unavailable";
|
|
112
|
+
agent_ref_mismatch: "agent_ref_mismatch";
|
|
113
|
+
content_invalid: "content_invalid";
|
|
114
|
+
intent_digest_mismatch: "intent_digest_mismatch";
|
|
115
|
+
intent_expired: "intent_expired";
|
|
116
|
+
intent_invalid: "intent_invalid";
|
|
117
|
+
intent_revoked: "intent_revoked";
|
|
118
|
+
memory_md_not_deletable: "memory_md_not_deletable";
|
|
119
|
+
path_invalid: "path_invalid";
|
|
120
|
+
placement_changed: "placement_changed";
|
|
121
|
+
profile_revision_changed: "profile_revision_changed";
|
|
122
|
+
}>;
|
|
123
|
+
export type AgentMemoryIntentRejectionCode = z.infer<typeof AgentMemoryIntentRejectionCodeSchema>;
|
|
124
|
+
/** One device observation of the target file. The observation instant is not on the wire. */
|
|
125
|
+
export declare const AgentMemoryIntentFileObservationSchema: z.ZodObject<{
|
|
126
|
+
exists: z.ZodBoolean;
|
|
127
|
+
revision: z.ZodString;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
export type AgentMemoryIntentFileObservation = z.infer<typeof AgentMemoryIntentFileObservationSchema>;
|
|
130
|
+
/**
|
|
131
|
+
* The terminal, content-free result of one intent, reported by the device.
|
|
132
|
+
*
|
|
133
|
+
* - `applied`: the live-path CAS returned success; `result` is the file after it.
|
|
134
|
+
* - `conflict`: the live-path CAS refused on revision; this attempt wrote nothing.
|
|
135
|
+
* - `rejected`: no `applying` record was written; zero writes.
|
|
136
|
+
* - `uncertain`: whether this intent wrote is unknown; `observed` is only the
|
|
137
|
+
* current file, never provenance.
|
|
138
|
+
*
|
|
139
|
+
* There is no non-terminal outcome.
|
|
140
|
+
*/
|
|
141
|
+
export declare const AgentMemoryIntentCompletionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
142
|
+
intentId: z.ZodUUID;
|
|
143
|
+
agentRef: z.ZodObject<{
|
|
144
|
+
agentId: z.ZodString;
|
|
145
|
+
profileRevision: z.ZodString;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
path: z.ZodString;
|
|
148
|
+
operation: z.ZodEnum<{
|
|
149
|
+
delete: "delete";
|
|
150
|
+
replace: "replace";
|
|
151
|
+
}>;
|
|
152
|
+
operationDigest: z.ZodString;
|
|
153
|
+
outcome: z.ZodLiteral<"applied">;
|
|
154
|
+
result: z.ZodObject<{
|
|
155
|
+
exists: z.ZodBoolean;
|
|
156
|
+
revision: z.ZodString;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
159
|
+
intentId: z.ZodUUID;
|
|
160
|
+
agentRef: z.ZodObject<{
|
|
161
|
+
agentId: z.ZodString;
|
|
162
|
+
profileRevision: z.ZodString;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
path: z.ZodString;
|
|
165
|
+
operation: z.ZodEnum<{
|
|
166
|
+
delete: "delete";
|
|
167
|
+
replace: "replace";
|
|
168
|
+
}>;
|
|
169
|
+
operationDigest: z.ZodString;
|
|
170
|
+
outcome: z.ZodLiteral<"conflict">;
|
|
171
|
+
observed: z.ZodObject<{
|
|
172
|
+
exists: z.ZodBoolean;
|
|
173
|
+
revision: z.ZodString;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
176
|
+
intentId: z.ZodUUID;
|
|
177
|
+
agentRef: z.ZodObject<{
|
|
178
|
+
agentId: z.ZodString;
|
|
179
|
+
profileRevision: z.ZodString;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
path: z.ZodString;
|
|
182
|
+
operation: z.ZodEnum<{
|
|
183
|
+
delete: "delete";
|
|
184
|
+
replace: "replace";
|
|
185
|
+
}>;
|
|
186
|
+
operationDigest: z.ZodString;
|
|
187
|
+
outcome: z.ZodLiteral<"rejected">;
|
|
188
|
+
code: z.ZodEnum<{
|
|
189
|
+
agent_home_unavailable: "agent_home_unavailable";
|
|
190
|
+
agent_ref_mismatch: "agent_ref_mismatch";
|
|
191
|
+
content_invalid: "content_invalid";
|
|
192
|
+
intent_digest_mismatch: "intent_digest_mismatch";
|
|
193
|
+
intent_expired: "intent_expired";
|
|
194
|
+
intent_invalid: "intent_invalid";
|
|
195
|
+
intent_revoked: "intent_revoked";
|
|
196
|
+
memory_md_not_deletable: "memory_md_not_deletable";
|
|
197
|
+
path_invalid: "path_invalid";
|
|
198
|
+
placement_changed: "placement_changed";
|
|
199
|
+
profile_revision_changed: "profile_revision_changed";
|
|
200
|
+
}>;
|
|
201
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
202
|
+
intentId: z.ZodUUID;
|
|
203
|
+
agentRef: z.ZodObject<{
|
|
204
|
+
agentId: z.ZodString;
|
|
205
|
+
profileRevision: z.ZodString;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
path: z.ZodString;
|
|
208
|
+
operation: z.ZodEnum<{
|
|
209
|
+
delete: "delete";
|
|
210
|
+
replace: "replace";
|
|
211
|
+
}>;
|
|
212
|
+
operationDigest: z.ZodString;
|
|
213
|
+
outcome: z.ZodLiteral<"uncertain">;
|
|
214
|
+
observed: z.ZodObject<{
|
|
215
|
+
exists: z.ZodBoolean;
|
|
216
|
+
revision: z.ZodString;
|
|
217
|
+
}, z.core.$strict>;
|
|
218
|
+
}, z.core.$strict>], "outcome">;
|
|
219
|
+
export type AgentMemoryIntentCompletion = z.infer<typeof AgentMemoryIntentCompletionSchema>;
|
|
220
|
+
/**
|
|
221
|
+
* How the Host's durable record relates to the completion it was handed:
|
|
222
|
+
*
|
|
223
|
+
* - `recorded`: this completion became the intent's first terminal fact.
|
|
224
|
+
* - `idempotent`: an identical completion was already recorded.
|
|
225
|
+
* - `conflict`: a different completion is already recorded; it is returned.
|
|
226
|
+
* - `host_terminal`: the Host had already terminated the intent on its own
|
|
227
|
+
* authority ({@link AGENT_MEMORY_INTENT_HOST_TERMINAL_CODES}).
|
|
228
|
+
*/
|
|
229
|
+
export declare const AGENT_MEMORY_INTENT_READBACK_DISPOSITIONS: readonly ['recorded', 'idempotent', 'conflict', 'host_terminal'];
|
|
230
|
+
export declare const AgentMemoryIntentReadbackDispositionSchema: z.ZodEnum<{
|
|
231
|
+
conflict: "conflict";
|
|
232
|
+
host_terminal: "host_terminal";
|
|
233
|
+
idempotent: "idempotent";
|
|
234
|
+
recorded: "recorded";
|
|
235
|
+
}>;
|
|
236
|
+
export type AgentMemoryIntentReadbackDisposition = z.infer<typeof AgentMemoryIntentReadbackDispositionSchema>;
|
|
237
|
+
/**
|
|
238
|
+
* The Host's durable terminal readback for one intent. `completion` is the
|
|
239
|
+
* terminal fact the Host has STORED; on `host_terminal` it is always a
|
|
240
|
+
* `rejected` completion carrying a Host code. `recordedAt` is the Host record
|
|
241
|
+
* time, never a device observation time.
|
|
242
|
+
*/
|
|
243
|
+
export declare const AgentMemoryIntentReadbackSchema: z.ZodObject<{
|
|
244
|
+
tenantId: z.ZodString;
|
|
245
|
+
deviceId: z.ZodString;
|
|
246
|
+
intentId: z.ZodUUID;
|
|
247
|
+
disposition: z.ZodEnum<{
|
|
248
|
+
conflict: "conflict";
|
|
249
|
+
host_terminal: "host_terminal";
|
|
250
|
+
idempotent: "idempotent";
|
|
251
|
+
recorded: "recorded";
|
|
252
|
+
}>;
|
|
253
|
+
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
254
|
+
intentId: z.ZodUUID;
|
|
255
|
+
agentRef: z.ZodObject<{
|
|
256
|
+
agentId: z.ZodString;
|
|
257
|
+
profileRevision: z.ZodString;
|
|
258
|
+
}, z.core.$strict>;
|
|
259
|
+
path: z.ZodString;
|
|
260
|
+
operation: z.ZodEnum<{
|
|
261
|
+
delete: "delete";
|
|
262
|
+
replace: "replace";
|
|
263
|
+
}>;
|
|
264
|
+
operationDigest: z.ZodString;
|
|
265
|
+
outcome: z.ZodLiteral<"applied">;
|
|
266
|
+
result: z.ZodObject<{
|
|
267
|
+
exists: z.ZodBoolean;
|
|
268
|
+
revision: z.ZodString;
|
|
269
|
+
}, z.core.$strict>;
|
|
270
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
271
|
+
intentId: z.ZodUUID;
|
|
272
|
+
agentRef: z.ZodObject<{
|
|
273
|
+
agentId: z.ZodString;
|
|
274
|
+
profileRevision: z.ZodString;
|
|
275
|
+
}, z.core.$strict>;
|
|
276
|
+
path: z.ZodString;
|
|
277
|
+
operation: z.ZodEnum<{
|
|
278
|
+
delete: "delete";
|
|
279
|
+
replace: "replace";
|
|
280
|
+
}>;
|
|
281
|
+
operationDigest: z.ZodString;
|
|
282
|
+
outcome: z.ZodLiteral<"conflict">;
|
|
283
|
+
observed: z.ZodObject<{
|
|
284
|
+
exists: z.ZodBoolean;
|
|
285
|
+
revision: z.ZodString;
|
|
286
|
+
}, z.core.$strict>;
|
|
287
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
288
|
+
intentId: z.ZodUUID;
|
|
289
|
+
agentRef: z.ZodObject<{
|
|
290
|
+
agentId: z.ZodString;
|
|
291
|
+
profileRevision: z.ZodString;
|
|
292
|
+
}, z.core.$strict>;
|
|
293
|
+
path: z.ZodString;
|
|
294
|
+
operation: z.ZodEnum<{
|
|
295
|
+
delete: "delete";
|
|
296
|
+
replace: "replace";
|
|
297
|
+
}>;
|
|
298
|
+
operationDigest: z.ZodString;
|
|
299
|
+
outcome: z.ZodLiteral<"rejected">;
|
|
300
|
+
code: z.ZodEnum<{
|
|
301
|
+
agent_home_unavailable: "agent_home_unavailable";
|
|
302
|
+
agent_ref_mismatch: "agent_ref_mismatch";
|
|
303
|
+
content_invalid: "content_invalid";
|
|
304
|
+
intent_digest_mismatch: "intent_digest_mismatch";
|
|
305
|
+
intent_expired: "intent_expired";
|
|
306
|
+
intent_invalid: "intent_invalid";
|
|
307
|
+
intent_revoked: "intent_revoked";
|
|
308
|
+
memory_md_not_deletable: "memory_md_not_deletable";
|
|
309
|
+
path_invalid: "path_invalid";
|
|
310
|
+
placement_changed: "placement_changed";
|
|
311
|
+
profile_revision_changed: "profile_revision_changed";
|
|
312
|
+
}>;
|
|
313
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
314
|
+
intentId: z.ZodUUID;
|
|
315
|
+
agentRef: z.ZodObject<{
|
|
316
|
+
agentId: z.ZodString;
|
|
317
|
+
profileRevision: z.ZodString;
|
|
318
|
+
}, z.core.$strict>;
|
|
319
|
+
path: z.ZodString;
|
|
320
|
+
operation: z.ZodEnum<{
|
|
321
|
+
delete: "delete";
|
|
322
|
+
replace: "replace";
|
|
323
|
+
}>;
|
|
324
|
+
operationDigest: z.ZodString;
|
|
325
|
+
outcome: z.ZodLiteral<"uncertain">;
|
|
326
|
+
observed: z.ZodObject<{
|
|
327
|
+
exists: z.ZodBoolean;
|
|
328
|
+
revision: z.ZodString;
|
|
329
|
+
}, z.core.$strict>;
|
|
330
|
+
}, z.core.$strict>], "outcome">;
|
|
331
|
+
recordedAt: z.ZodISODateTime;
|
|
332
|
+
}, z.core.$strict>;
|
|
333
|
+
export type AgentMemoryIntentReadback = z.infer<typeof AgentMemoryIntentReadbackSchema>;
|
|
334
|
+
/**
|
|
335
|
+
* `held`: the device reserved a ledger slot and may receive a release.
|
|
336
|
+
* `none`: the device could not reserve; the Host must not change intent state
|
|
337
|
+
* or release content.
|
|
338
|
+
*/
|
|
339
|
+
export declare const AGENT_MEMORY_INTENT_RESERVATIONS: readonly ['held', 'none'];
|
|
340
|
+
export declare const AgentMemoryIntentReservationSchema: z.ZodEnum<{
|
|
341
|
+
held: "held";
|
|
342
|
+
none: "none";
|
|
343
|
+
}>;
|
|
344
|
+
export type AgentMemoryIntentReservation = z.infer<typeof AgentMemoryIntentReservationSchema>;
|
|
345
|
+
/**
|
|
346
|
+
* The SDK half of a fetch. Device authentication (the tenant and device a Host
|
|
347
|
+
* trusts) is Host transport vocabulary and is not part of this schema.
|
|
348
|
+
*/
|
|
349
|
+
export declare const AgentMemoryIntentFetchRequestSchema: z.ZodObject<{
|
|
350
|
+
intentId: z.ZodUUID;
|
|
351
|
+
reservation: z.ZodEnum<{
|
|
352
|
+
held: "held";
|
|
353
|
+
none: "none";
|
|
354
|
+
}>;
|
|
355
|
+
}, z.core.$strict>;
|
|
356
|
+
export type AgentMemoryIntentFetchRequest = z.infer<typeof AgentMemoryIntentFetchRequestSchema>;
|
|
357
|
+
export declare const AGENT_MEMORY_INTENT_FETCH_DISPOSITIONS: readonly ['release', 'withheld', 'terminal', 'deferred'];
|
|
358
|
+
export type AgentMemoryIntentFetchDisposition = (typeof AGENT_MEMORY_INTENT_FETCH_DISPOSITIONS)[number];
|
|
359
|
+
/** Which fetch dispositions a Host may answer for each request reservation. */
|
|
360
|
+
export declare const AGENT_MEMORY_INTENT_FETCH_DISPOSITIONS_BY_RESERVATION: {
|
|
361
|
+
readonly held: readonly ["release", "withheld", "terminal"];
|
|
362
|
+
readonly none: readonly ["terminal", "deferred"];
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* A Host fetch answer, independent of the request reservation. A device must
|
|
366
|
+
* parse with {@link agentMemoryIntentFetchResponseSchemaFor} so a `release` or
|
|
367
|
+
* `withheld` answer to a `none` request (or a `deferred` answer to a `held`
|
|
368
|
+
* request) is refused.
|
|
369
|
+
*/
|
|
370
|
+
export declare const AgentMemoryIntentFetchResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
371
|
+
disposition: z.ZodLiteral<"release">;
|
|
372
|
+
intent: z.ZodObject<{
|
|
373
|
+
intentId: z.ZodUUID;
|
|
374
|
+
agentRef: z.ZodObject<{
|
|
375
|
+
agentId: z.ZodString;
|
|
376
|
+
profileRevision: z.ZodString;
|
|
377
|
+
}, z.core.$strict>;
|
|
378
|
+
path: z.ZodString;
|
|
379
|
+
operation: z.ZodEnum<{
|
|
380
|
+
delete: "delete";
|
|
381
|
+
replace: "replace";
|
|
382
|
+
}>;
|
|
383
|
+
baseRevision: z.ZodString;
|
|
384
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
385
|
+
content: z.ZodOptional<z.ZodString>;
|
|
386
|
+
approvalRef: z.ZodString;
|
|
387
|
+
operationDigest: z.ZodString;
|
|
388
|
+
}, z.core.$strict>;
|
|
389
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
390
|
+
disposition: z.ZodLiteral<"withheld">;
|
|
391
|
+
intent: z.ZodObject<{
|
|
392
|
+
intentId: z.ZodUUID;
|
|
393
|
+
agentRef: z.ZodObject<{
|
|
394
|
+
agentId: z.ZodString;
|
|
395
|
+
profileRevision: z.ZodString;
|
|
396
|
+
}, z.core.$strict>;
|
|
397
|
+
path: z.ZodString;
|
|
398
|
+
operation: z.ZodEnum<{
|
|
399
|
+
delete: "delete";
|
|
400
|
+
replace: "replace";
|
|
401
|
+
}>;
|
|
402
|
+
baseRevision: z.ZodString;
|
|
403
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
404
|
+
content: z.ZodOptional<z.ZodString>;
|
|
405
|
+
approvalRef: z.ZodString;
|
|
406
|
+
operationDigest: z.ZodString;
|
|
407
|
+
}, z.core.$strict>;
|
|
408
|
+
code: z.ZodEnum<{
|
|
409
|
+
intent_expired: "intent_expired";
|
|
410
|
+
intent_revoked: "intent_revoked";
|
|
411
|
+
placement_changed: "placement_changed";
|
|
412
|
+
profile_revision_changed: "profile_revision_changed";
|
|
413
|
+
}>;
|
|
414
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
415
|
+
disposition: z.ZodLiteral<"terminal">;
|
|
416
|
+
intent: z.ZodObject<{
|
|
417
|
+
intentId: z.ZodUUID;
|
|
418
|
+
agentRef: z.ZodObject<{
|
|
419
|
+
agentId: z.ZodString;
|
|
420
|
+
profileRevision: z.ZodString;
|
|
421
|
+
}, z.core.$strict>;
|
|
422
|
+
path: z.ZodString;
|
|
423
|
+
operation: z.ZodEnum<{
|
|
424
|
+
delete: "delete";
|
|
425
|
+
replace: "replace";
|
|
426
|
+
}>;
|
|
427
|
+
baseRevision: z.ZodString;
|
|
428
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
429
|
+
content: z.ZodOptional<z.ZodString>;
|
|
430
|
+
approvalRef: z.ZodString;
|
|
431
|
+
operationDigest: z.ZodString;
|
|
432
|
+
}, z.core.$strict>;
|
|
433
|
+
readback: z.ZodObject<{
|
|
434
|
+
tenantId: z.ZodString;
|
|
435
|
+
deviceId: z.ZodString;
|
|
436
|
+
intentId: z.ZodUUID;
|
|
437
|
+
disposition: z.ZodEnum<{
|
|
438
|
+
conflict: "conflict";
|
|
439
|
+
host_terminal: "host_terminal";
|
|
440
|
+
idempotent: "idempotent";
|
|
441
|
+
recorded: "recorded";
|
|
442
|
+
}>;
|
|
443
|
+
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
444
|
+
intentId: z.ZodUUID;
|
|
445
|
+
agentRef: z.ZodObject<{
|
|
446
|
+
agentId: z.ZodString;
|
|
447
|
+
profileRevision: z.ZodString;
|
|
448
|
+
}, z.core.$strict>;
|
|
449
|
+
path: z.ZodString;
|
|
450
|
+
operation: z.ZodEnum<{
|
|
451
|
+
delete: "delete";
|
|
452
|
+
replace: "replace";
|
|
453
|
+
}>;
|
|
454
|
+
operationDigest: z.ZodString;
|
|
455
|
+
outcome: z.ZodLiteral<"applied">;
|
|
456
|
+
result: z.ZodObject<{
|
|
457
|
+
exists: z.ZodBoolean;
|
|
458
|
+
revision: z.ZodString;
|
|
459
|
+
}, z.core.$strict>;
|
|
460
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
461
|
+
intentId: z.ZodUUID;
|
|
462
|
+
agentRef: z.ZodObject<{
|
|
463
|
+
agentId: z.ZodString;
|
|
464
|
+
profileRevision: z.ZodString;
|
|
465
|
+
}, z.core.$strict>;
|
|
466
|
+
path: z.ZodString;
|
|
467
|
+
operation: z.ZodEnum<{
|
|
468
|
+
delete: "delete";
|
|
469
|
+
replace: "replace";
|
|
470
|
+
}>;
|
|
471
|
+
operationDigest: z.ZodString;
|
|
472
|
+
outcome: z.ZodLiteral<"conflict">;
|
|
473
|
+
observed: z.ZodObject<{
|
|
474
|
+
exists: z.ZodBoolean;
|
|
475
|
+
revision: z.ZodString;
|
|
476
|
+
}, z.core.$strict>;
|
|
477
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
478
|
+
intentId: z.ZodUUID;
|
|
479
|
+
agentRef: z.ZodObject<{
|
|
480
|
+
agentId: z.ZodString;
|
|
481
|
+
profileRevision: z.ZodString;
|
|
482
|
+
}, z.core.$strict>;
|
|
483
|
+
path: z.ZodString;
|
|
484
|
+
operation: z.ZodEnum<{
|
|
485
|
+
delete: "delete";
|
|
486
|
+
replace: "replace";
|
|
487
|
+
}>;
|
|
488
|
+
operationDigest: z.ZodString;
|
|
489
|
+
outcome: z.ZodLiteral<"rejected">;
|
|
490
|
+
code: z.ZodEnum<{
|
|
491
|
+
agent_home_unavailable: "agent_home_unavailable";
|
|
492
|
+
agent_ref_mismatch: "agent_ref_mismatch";
|
|
493
|
+
content_invalid: "content_invalid";
|
|
494
|
+
intent_digest_mismatch: "intent_digest_mismatch";
|
|
495
|
+
intent_expired: "intent_expired";
|
|
496
|
+
intent_invalid: "intent_invalid";
|
|
497
|
+
intent_revoked: "intent_revoked";
|
|
498
|
+
memory_md_not_deletable: "memory_md_not_deletable";
|
|
499
|
+
path_invalid: "path_invalid";
|
|
500
|
+
placement_changed: "placement_changed";
|
|
501
|
+
profile_revision_changed: "profile_revision_changed";
|
|
502
|
+
}>;
|
|
503
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
504
|
+
intentId: z.ZodUUID;
|
|
505
|
+
agentRef: z.ZodObject<{
|
|
506
|
+
agentId: z.ZodString;
|
|
507
|
+
profileRevision: z.ZodString;
|
|
508
|
+
}, z.core.$strict>;
|
|
509
|
+
path: z.ZodString;
|
|
510
|
+
operation: z.ZodEnum<{
|
|
511
|
+
delete: "delete";
|
|
512
|
+
replace: "replace";
|
|
513
|
+
}>;
|
|
514
|
+
operationDigest: z.ZodString;
|
|
515
|
+
outcome: z.ZodLiteral<"uncertain">;
|
|
516
|
+
observed: z.ZodObject<{
|
|
517
|
+
exists: z.ZodBoolean;
|
|
518
|
+
revision: z.ZodString;
|
|
519
|
+
}, z.core.$strict>;
|
|
520
|
+
}, z.core.$strict>], "outcome">;
|
|
521
|
+
recordedAt: z.ZodISODateTime;
|
|
522
|
+
}, z.core.$strict>;
|
|
523
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
524
|
+
disposition: z.ZodLiteral<"deferred">;
|
|
525
|
+
intent: z.ZodObject<{
|
|
526
|
+
intentId: z.ZodUUID;
|
|
527
|
+
agentRef: z.ZodObject<{
|
|
528
|
+
agentId: z.ZodString;
|
|
529
|
+
profileRevision: z.ZodString;
|
|
530
|
+
}, z.core.$strict>;
|
|
531
|
+
path: z.ZodString;
|
|
532
|
+
operation: z.ZodEnum<{
|
|
533
|
+
delete: "delete";
|
|
534
|
+
replace: "replace";
|
|
535
|
+
}>;
|
|
536
|
+
baseRevision: z.ZodString;
|
|
537
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
538
|
+
content: z.ZodOptional<z.ZodString>;
|
|
539
|
+
approvalRef: z.ZodString;
|
|
540
|
+
operationDigest: z.ZodString;
|
|
541
|
+
}, z.core.$strict>;
|
|
542
|
+
}, z.core.$strict>], "disposition">;
|
|
543
|
+
export type AgentMemoryIntentFetchResponse = z.infer<typeof AgentMemoryIntentFetchResponseSchema>;
|
|
544
|
+
/** The fetch answer schema bound to the reservation the device sent. */
|
|
545
|
+
export declare function agentMemoryIntentFetchResponseSchemaFor(reservation: AgentMemoryIntentReservation): z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
546
|
+
disposition: z.ZodLiteral<"release">;
|
|
547
|
+
intent: z.ZodObject<{
|
|
548
|
+
intentId: z.ZodUUID;
|
|
549
|
+
agentRef: z.ZodObject<{
|
|
550
|
+
agentId: z.ZodString;
|
|
551
|
+
profileRevision: z.ZodString;
|
|
552
|
+
}, z.core.$strict>;
|
|
553
|
+
path: z.ZodString;
|
|
554
|
+
operation: z.ZodEnum<{
|
|
555
|
+
delete: "delete";
|
|
556
|
+
replace: "replace";
|
|
557
|
+
}>;
|
|
558
|
+
baseRevision: z.ZodString;
|
|
559
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
560
|
+
content: z.ZodOptional<z.ZodString>;
|
|
561
|
+
approvalRef: z.ZodString;
|
|
562
|
+
operationDigest: z.ZodString;
|
|
563
|
+
}, z.core.$strict>;
|
|
564
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
565
|
+
disposition: z.ZodLiteral<"withheld">;
|
|
566
|
+
intent: z.ZodObject<{
|
|
567
|
+
intentId: z.ZodUUID;
|
|
568
|
+
agentRef: z.ZodObject<{
|
|
569
|
+
agentId: z.ZodString;
|
|
570
|
+
profileRevision: z.ZodString;
|
|
571
|
+
}, z.core.$strict>;
|
|
572
|
+
path: z.ZodString;
|
|
573
|
+
operation: z.ZodEnum<{
|
|
574
|
+
delete: "delete";
|
|
575
|
+
replace: "replace";
|
|
576
|
+
}>;
|
|
577
|
+
baseRevision: z.ZodString;
|
|
578
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
579
|
+
content: z.ZodOptional<z.ZodString>;
|
|
580
|
+
approvalRef: z.ZodString;
|
|
581
|
+
operationDigest: z.ZodString;
|
|
582
|
+
}, z.core.$strict>;
|
|
583
|
+
code: z.ZodEnum<{
|
|
584
|
+
intent_expired: "intent_expired";
|
|
585
|
+
intent_revoked: "intent_revoked";
|
|
586
|
+
placement_changed: "placement_changed";
|
|
587
|
+
profile_revision_changed: "profile_revision_changed";
|
|
588
|
+
}>;
|
|
589
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
590
|
+
disposition: z.ZodLiteral<"terminal">;
|
|
591
|
+
intent: z.ZodObject<{
|
|
592
|
+
intentId: z.ZodUUID;
|
|
593
|
+
agentRef: z.ZodObject<{
|
|
594
|
+
agentId: z.ZodString;
|
|
595
|
+
profileRevision: z.ZodString;
|
|
596
|
+
}, z.core.$strict>;
|
|
597
|
+
path: z.ZodString;
|
|
598
|
+
operation: z.ZodEnum<{
|
|
599
|
+
delete: "delete";
|
|
600
|
+
replace: "replace";
|
|
601
|
+
}>;
|
|
602
|
+
baseRevision: z.ZodString;
|
|
603
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
604
|
+
content: z.ZodOptional<z.ZodString>;
|
|
605
|
+
approvalRef: z.ZodString;
|
|
606
|
+
operationDigest: z.ZodString;
|
|
607
|
+
}, z.core.$strict>;
|
|
608
|
+
readback: z.ZodObject<{
|
|
609
|
+
tenantId: z.ZodString;
|
|
610
|
+
deviceId: z.ZodString;
|
|
611
|
+
intentId: z.ZodUUID;
|
|
612
|
+
disposition: z.ZodEnum<{
|
|
613
|
+
conflict: "conflict";
|
|
614
|
+
host_terminal: "host_terminal";
|
|
615
|
+
idempotent: "idempotent";
|
|
616
|
+
recorded: "recorded";
|
|
617
|
+
}>;
|
|
618
|
+
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
619
|
+
intentId: z.ZodUUID;
|
|
620
|
+
agentRef: z.ZodObject<{
|
|
621
|
+
agentId: z.ZodString;
|
|
622
|
+
profileRevision: z.ZodString;
|
|
623
|
+
}, z.core.$strict>;
|
|
624
|
+
path: z.ZodString;
|
|
625
|
+
operation: z.ZodEnum<{
|
|
626
|
+
delete: "delete";
|
|
627
|
+
replace: "replace";
|
|
628
|
+
}>;
|
|
629
|
+
operationDigest: z.ZodString;
|
|
630
|
+
outcome: z.ZodLiteral<"applied">;
|
|
631
|
+
result: z.ZodObject<{
|
|
632
|
+
exists: z.ZodBoolean;
|
|
633
|
+
revision: z.ZodString;
|
|
634
|
+
}, z.core.$strict>;
|
|
635
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
636
|
+
intentId: z.ZodUUID;
|
|
637
|
+
agentRef: z.ZodObject<{
|
|
638
|
+
agentId: z.ZodString;
|
|
639
|
+
profileRevision: z.ZodString;
|
|
640
|
+
}, z.core.$strict>;
|
|
641
|
+
path: z.ZodString;
|
|
642
|
+
operation: z.ZodEnum<{
|
|
643
|
+
delete: "delete";
|
|
644
|
+
replace: "replace";
|
|
645
|
+
}>;
|
|
646
|
+
operationDigest: z.ZodString;
|
|
647
|
+
outcome: z.ZodLiteral<"conflict">;
|
|
648
|
+
observed: z.ZodObject<{
|
|
649
|
+
exists: z.ZodBoolean;
|
|
650
|
+
revision: z.ZodString;
|
|
651
|
+
}, z.core.$strict>;
|
|
652
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
653
|
+
intentId: z.ZodUUID;
|
|
654
|
+
agentRef: z.ZodObject<{
|
|
655
|
+
agentId: z.ZodString;
|
|
656
|
+
profileRevision: z.ZodString;
|
|
657
|
+
}, z.core.$strict>;
|
|
658
|
+
path: z.ZodString;
|
|
659
|
+
operation: z.ZodEnum<{
|
|
660
|
+
delete: "delete";
|
|
661
|
+
replace: "replace";
|
|
662
|
+
}>;
|
|
663
|
+
operationDigest: z.ZodString;
|
|
664
|
+
outcome: z.ZodLiteral<"rejected">;
|
|
665
|
+
code: z.ZodEnum<{
|
|
666
|
+
agent_home_unavailable: "agent_home_unavailable";
|
|
667
|
+
agent_ref_mismatch: "agent_ref_mismatch";
|
|
668
|
+
content_invalid: "content_invalid";
|
|
669
|
+
intent_digest_mismatch: "intent_digest_mismatch";
|
|
670
|
+
intent_expired: "intent_expired";
|
|
671
|
+
intent_invalid: "intent_invalid";
|
|
672
|
+
intent_revoked: "intent_revoked";
|
|
673
|
+
memory_md_not_deletable: "memory_md_not_deletable";
|
|
674
|
+
path_invalid: "path_invalid";
|
|
675
|
+
placement_changed: "placement_changed";
|
|
676
|
+
profile_revision_changed: "profile_revision_changed";
|
|
677
|
+
}>;
|
|
678
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
679
|
+
intentId: z.ZodUUID;
|
|
680
|
+
agentRef: z.ZodObject<{
|
|
681
|
+
agentId: z.ZodString;
|
|
682
|
+
profileRevision: z.ZodString;
|
|
683
|
+
}, z.core.$strict>;
|
|
684
|
+
path: z.ZodString;
|
|
685
|
+
operation: z.ZodEnum<{
|
|
686
|
+
delete: "delete";
|
|
687
|
+
replace: "replace";
|
|
688
|
+
}>;
|
|
689
|
+
operationDigest: z.ZodString;
|
|
690
|
+
outcome: z.ZodLiteral<"uncertain">;
|
|
691
|
+
observed: z.ZodObject<{
|
|
692
|
+
exists: z.ZodBoolean;
|
|
693
|
+
revision: z.ZodString;
|
|
694
|
+
}, z.core.$strict>;
|
|
695
|
+
}, z.core.$strict>], "outcome">;
|
|
696
|
+
recordedAt: z.ZodISODateTime;
|
|
697
|
+
}, z.core.$strict>;
|
|
698
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
699
|
+
disposition: z.ZodLiteral<"deferred">;
|
|
700
|
+
intent: z.ZodObject<{
|
|
701
|
+
intentId: z.ZodUUID;
|
|
702
|
+
agentRef: z.ZodObject<{
|
|
703
|
+
agentId: z.ZodString;
|
|
704
|
+
profileRevision: z.ZodString;
|
|
705
|
+
}, z.core.$strict>;
|
|
706
|
+
path: z.ZodString;
|
|
707
|
+
operation: z.ZodEnum<{
|
|
708
|
+
delete: "delete";
|
|
709
|
+
replace: "replace";
|
|
710
|
+
}>;
|
|
711
|
+
baseRevision: z.ZodString;
|
|
712
|
+
targetRevision: z.ZodNullable<z.ZodString>;
|
|
713
|
+
content: z.ZodOptional<z.ZodString>;
|
|
714
|
+
approvalRef: z.ZodString;
|
|
715
|
+
operationDigest: z.ZodString;
|
|
716
|
+
}, z.core.$strict>;
|
|
717
|
+
}, z.core.$strict>], "disposition">;
|