@openvtc/trust-tasks 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/vta/_shared/0.1/app-state-record.d.ts +17 -0
- package/dist/vta/_shared/0.1/app-state-record.d.ts.map +1 -0
- package/dist/vta/_shared/0.1/app-state-record.js +6 -0
- package/dist/vta/_shared/0.1/app-state-record.js.map +1 -0
- package/dist/vta/app-state/delete/1.0/payload.d.ts +488 -0
- package/dist/vta/app-state/delete/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/delete/1.0/payload.js +248 -0
- package/dist/vta/app-state/delete/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/get/1.0/payload.d.ts +611 -0
- package/dist/vta/app-state/get/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/get/1.0/payload.js +306 -0
- package/dist/vta/app-state/get/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/get-many/1.0/payload.d.ts +716 -0
- package/dist/vta/app-state/get-many/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/get-many/1.0/payload.js +350 -0
- package/dist/vta/app-state/get-many/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/list/1.0/payload.d.ts +778 -0
- package/dist/vta/app-state/list/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/list/1.0/payload.js +368 -0
- package/dist/vta/app-state/list/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/put/1.0/payload.d.ts +560 -0
- package/dist/vta/app-state/put/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/put/1.0/payload.js +291 -0
- package/dist/vta/app-state/put/1.0/payload.js.map +1 -0
- package/dist/vta/app-state/put-many/1.0/payload.d.ts +856 -0
- package/dist/vta/app-state/put-many/1.0/payload.d.ts.map +1 -0
- package/dist/vta/app-state/put-many/1.0/payload.js +455 -0
- package/dist/vta/app-state/put-many/1.0/payload.js.map +1 -0
- package/dist/vta/webvh/servers/retire-orphan/0.1/payload.d.ts +317 -0
- package/dist/vta/webvh/servers/retire-orphan/0.1/payload.d.ts.map +1 -0
- package/dist/vta/webvh/servers/retire-orphan/0.1/payload.js +170 -0
- package/dist/vta/webvh/servers/retire-orphan/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +8 -0
- package/src/vta/_shared/0.1/app-state-record.ts +17 -0
- package/src/vta/app-state/delete/1.0/payload.ts +323 -0
- package/src/vta/app-state/get/1.0/payload.ts +404 -0
- package/src/vta/app-state/get-many/1.0/payload.ts +469 -0
- package/src/vta/app-state/list/1.0/payload.ts +509 -0
- package/src/vta/app-state/put/1.0/payload.ts +382 -0
- package/src/vta/app-state/put-many/1.0/payload.ts +584 -0
- package/src/vta/webvh/servers/retire-orphan/0.1/payload.ts +223 -0
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/app-state/get-many/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Required, unlike in list: a batch read addresses records by key, and a key is only unique within a namespace.
|
|
7
|
+
*/
|
|
8
|
+
export type Namespace = string;
|
|
9
|
+
/**
|
|
10
|
+
* Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.
|
|
11
|
+
*/
|
|
12
|
+
export type Key = string;
|
|
13
|
+
/**
|
|
14
|
+
* Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.
|
|
15
|
+
*/
|
|
16
|
+
export type Namespace1 = string;
|
|
17
|
+
/**
|
|
18
|
+
* The namespace counter value this record's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.
|
|
19
|
+
*/
|
|
20
|
+
export type Version = number;
|
|
21
|
+
/**
|
|
22
|
+
* Read up to 256 application-state records from one namespace in a single round trip. A rebuild or a reconnect is N records, and round-tripping each one separately is the difference between a usable reconnect and an unusable one.
|
|
23
|
+
*/
|
|
24
|
+
export interface VTAApplicationStateGetManyPayload {
|
|
25
|
+
/**
|
|
26
|
+
* The VTA context the records are scoped to; the isolation boundary.
|
|
27
|
+
*/
|
|
28
|
+
contextId: string;
|
|
29
|
+
namespace: Namespace;
|
|
30
|
+
/**
|
|
31
|
+
* The keys to read. Duplicates are refused rather than deduplicated, because a caller that sent one did not mean to and would otherwise never find out.
|
|
32
|
+
*
|
|
33
|
+
* @minItems 1
|
|
34
|
+
* @maxItems 256
|
|
35
|
+
*/
|
|
36
|
+
keys: [Key, ...Key[]];
|
|
37
|
+
/**
|
|
38
|
+
* Defaults to false. When true, an address holding a tombstone yields a record with `deleted: true` rather than appearing in `missing`.
|
|
39
|
+
*/
|
|
40
|
+
includeDeleted?: boolean;
|
|
41
|
+
ext?: Ext;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
45
|
+
*/
|
|
46
|
+
export interface Ext {
|
|
47
|
+
[k: string]: unknown | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Success response to vta/app-state/get-many. Type https://trusttasks.org/spec/vta/app-state/get-many/1.0#response. Every requested key appears in exactly one of `records`, `missing` or `deferred`, so a caller can account for all of them without comparing sets itself.
|
|
51
|
+
*/
|
|
52
|
+
export interface VTAApplicationStateGetManyResponsePayload {
|
|
53
|
+
/**
|
|
54
|
+
* The records found, each with its `value`, in the order the keys were requested. May be empty.
|
|
55
|
+
*/
|
|
56
|
+
records: AppStateRecord[];
|
|
57
|
+
/**
|
|
58
|
+
* Requested keys holding no record — and, unless `includeDeleted` was set, keys holding only a tombstone. Reported rather than silently omitted, so a caller need not diff the request against the response to notice.
|
|
59
|
+
*/
|
|
60
|
+
missing: Key[];
|
|
61
|
+
/**
|
|
62
|
+
* Requested keys the maintainer did not evaluate because the response had reached its size budget. The caller re-requests exactly these. This exists because the per-record cap multiplied by the key ceiling exceeds any sane response limit, and the alternative — refusing the whole batch — would make a caller guess at a batch size instead of being told one.
|
|
63
|
+
*/
|
|
64
|
+
deferred?: Key[];
|
|
65
|
+
ext?: Ext1;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A record as the maintainer holds it. `value` is absent in three distinct situations and a consumer MUST NOT conflate them: the record is a tombstone (`deleted` is true); the caller asked for a metadata-only view (`list` without `includeValues`); or the value genuinely is the JSON literal `null`, in which case `value` is PRESENT and null. This is why `deleted` is required rather than defaulted — a consumer that has to infer deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.
|
|
69
|
+
*/
|
|
70
|
+
export interface AppStateRecord {
|
|
71
|
+
/**
|
|
72
|
+
* The VTA context the record is scoped to; the isolation boundary.
|
|
73
|
+
*/
|
|
74
|
+
contextId: string;
|
|
75
|
+
namespace: Namespace1;
|
|
76
|
+
key: Key;
|
|
77
|
+
version: Version;
|
|
78
|
+
/**
|
|
79
|
+
* The stored JSON, in whatever shape the owning application chose. Any JSON value, including `null`. The maintainer neither validates nor interprets it. Absent when this is a tombstone or a metadata-only view — see this definition's description for why that is not the same as a null value.
|
|
80
|
+
*/
|
|
81
|
+
value?: {
|
|
82
|
+
[k: string]: unknown | undefined;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Size of the stored value in bytes, measured as the maintainer measures it for the per-record cap (see `vta/app-state/put`). Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.
|
|
86
|
+
*/
|
|
87
|
+
valueBytes?: number;
|
|
88
|
+
/**
|
|
89
|
+
* True when this is a tombstone: the record was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/app-state/list`.
|
|
90
|
+
*/
|
|
91
|
+
deleted: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded.
|
|
94
|
+
*/
|
|
95
|
+
createdAt?: string;
|
|
96
|
+
/**
|
|
97
|
+
* When the write that produced this `version` was applied. For a tombstone, when the delete was applied.
|
|
98
|
+
*/
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
/**
|
|
101
|
+
* When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.
|
|
102
|
+
*/
|
|
103
|
+
deletedAt?: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
107
|
+
*/
|
|
108
|
+
export interface Ext1 {
|
|
109
|
+
[k: string]: unknown | undefined;
|
|
110
|
+
}
|
|
111
|
+
/** Trust Task type URI. */
|
|
112
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/vta/app-state/get-many/1.0";
|
|
113
|
+
/** Stable alias for this specification's request payload shape. */
|
|
114
|
+
export type Payload = VTAApplicationStateGetManyPayload;
|
|
115
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
116
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vta/app-state/get-many/1.0#response";
|
|
117
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
118
|
+
export type Response = VTAApplicationStateGetManyResponsePayload;
|
|
119
|
+
/**
|
|
120
|
+
* This specification's payload schema, as a value.
|
|
121
|
+
*
|
|
122
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
123
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
124
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
125
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
126
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
127
|
+
*/
|
|
128
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
129
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
130
|
+
readonly $id: "https://trusttasks.org/spec/vta/app-state/get-many/1.0";
|
|
131
|
+
readonly title: "VTA Application State Get-Many — payload";
|
|
132
|
+
readonly description: "Read up to 256 application-state records from one namespace in a single round trip. A rebuild or a reconnect is N records, and round-tripping each one separately is the difference between a usable reconnect and an unusable one.";
|
|
133
|
+
readonly type: "object";
|
|
134
|
+
readonly additionalProperties: false;
|
|
135
|
+
readonly required: readonly ["contextId", "namespace", "keys"];
|
|
136
|
+
readonly properties: {
|
|
137
|
+
readonly contextId: {
|
|
138
|
+
readonly type: "string";
|
|
139
|
+
readonly minLength: 1;
|
|
140
|
+
readonly description: "The VTA context the records are scoped to; the isolation boundary.";
|
|
141
|
+
};
|
|
142
|
+
readonly namespace: {
|
|
143
|
+
readonly $ref: "#/$defs/Namespace";
|
|
144
|
+
readonly description: "Required, unlike in list: a batch read addresses records by key, and a key is only unique within a namespace.";
|
|
145
|
+
};
|
|
146
|
+
readonly keys: {
|
|
147
|
+
readonly type: "array";
|
|
148
|
+
readonly minItems: 1;
|
|
149
|
+
readonly maxItems: 256;
|
|
150
|
+
readonly uniqueItems: true;
|
|
151
|
+
readonly items: {
|
|
152
|
+
readonly $ref: "#/$defs/Key";
|
|
153
|
+
};
|
|
154
|
+
readonly description: "The keys to read. Duplicates are refused rather than deduplicated, because a caller that sent one did not mean to and would otherwise never find out.";
|
|
155
|
+
};
|
|
156
|
+
readonly includeDeleted: {
|
|
157
|
+
readonly type: "boolean";
|
|
158
|
+
readonly description: "Defaults to false. When true, an address holding a tombstone yields a record with `deleted: true` rather than appearing in `missing`.";
|
|
159
|
+
};
|
|
160
|
+
readonly ext: {
|
|
161
|
+
readonly $ref: "#/$defs/Ext";
|
|
162
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
readonly $defs: {
|
|
166
|
+
readonly Response: {
|
|
167
|
+
readonly $anchor: "response";
|
|
168
|
+
readonly title: "VTA Application State Get-Many — response payload";
|
|
169
|
+
readonly description: "Success response to vta/app-state/get-many. Type https://trusttasks.org/spec/vta/app-state/get-many/1.0#response. Every requested key appears in exactly one of `records`, `missing` or `deferred`, so a caller can account for all of them without comparing sets itself.";
|
|
170
|
+
readonly type: "object";
|
|
171
|
+
readonly additionalProperties: false;
|
|
172
|
+
readonly required: readonly ["records", "missing"];
|
|
173
|
+
readonly properties: {
|
|
174
|
+
readonly records: {
|
|
175
|
+
readonly type: "array";
|
|
176
|
+
readonly items: {
|
|
177
|
+
readonly $ref: "#/$defs/AppStateRecord";
|
|
178
|
+
};
|
|
179
|
+
readonly description: "The records found, each with its `value`, in the order the keys were requested. May be empty.";
|
|
180
|
+
};
|
|
181
|
+
readonly missing: {
|
|
182
|
+
readonly type: "array";
|
|
183
|
+
readonly items: {
|
|
184
|
+
readonly $ref: "#/$defs/Key";
|
|
185
|
+
};
|
|
186
|
+
readonly description: "Requested keys holding no record — and, unless `includeDeleted` was set, keys holding only a tombstone. Reported rather than silently omitted, so a caller need not diff the request against the response to notice.";
|
|
187
|
+
};
|
|
188
|
+
readonly deferred: {
|
|
189
|
+
readonly type: "array";
|
|
190
|
+
readonly items: {
|
|
191
|
+
readonly $ref: "#/$defs/Key";
|
|
192
|
+
};
|
|
193
|
+
readonly description: "Requested keys the maintainer did not evaluate because the response had reached its size budget. The caller re-requests exactly these. This exists because the per-record cap multiplied by the key ceiling exceeds any sane response limit, and the alternative — refusing the whole batch — would make a caller guess at a batch size instead of being told one.";
|
|
194
|
+
};
|
|
195
|
+
readonly ext: {
|
|
196
|
+
readonly $ref: "#/$defs/Ext";
|
|
197
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
readonly Ext: {
|
|
202
|
+
readonly title: "Ext";
|
|
203
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
204
|
+
readonly type: "object";
|
|
205
|
+
readonly minProperties: 1;
|
|
206
|
+
readonly additionalProperties: true;
|
|
207
|
+
readonly propertyNames: {
|
|
208
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
readonly Key: {
|
|
212
|
+
readonly title: "Key";
|
|
213
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
214
|
+
readonly type: "string";
|
|
215
|
+
readonly minLength: 1;
|
|
216
|
+
readonly maxLength: 512;
|
|
217
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
218
|
+
};
|
|
219
|
+
readonly AppStateRecord: {
|
|
220
|
+
readonly title: "AppStateRecord";
|
|
221
|
+
readonly description: "A record as the maintainer holds it. `value` is absent in three distinct situations and a consumer MUST NOT conflate them: the record is a tombstone (`deleted` is true); the caller asked for a metadata-only view (`list` without `includeValues`); or the value genuinely is the JSON literal `null`, in which case `value` is PRESENT and null. This is why `deleted` is required rather than defaulted — a consumer that has to infer deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
222
|
+
readonly type: "object";
|
|
223
|
+
readonly additionalProperties: false;
|
|
224
|
+
readonly required: readonly ["contextId", "namespace", "key", "version", "deleted", "updatedAt"];
|
|
225
|
+
readonly properties: {
|
|
226
|
+
readonly contextId: {
|
|
227
|
+
readonly type: "string";
|
|
228
|
+
readonly minLength: 1;
|
|
229
|
+
readonly description: "The VTA context the record is scoped to; the isolation boundary.";
|
|
230
|
+
};
|
|
231
|
+
readonly namespace: {
|
|
232
|
+
readonly $ref: "#/$defs/Namespace";
|
|
233
|
+
};
|
|
234
|
+
readonly key: {
|
|
235
|
+
readonly $ref: "#/$defs/Key";
|
|
236
|
+
};
|
|
237
|
+
readonly version: {
|
|
238
|
+
readonly $ref: "#/$defs/Version";
|
|
239
|
+
readonly description: "The namespace counter value this record's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
240
|
+
};
|
|
241
|
+
readonly value: {
|
|
242
|
+
readonly description: "The stored JSON, in whatever shape the owning application chose. Any JSON value, including `null`. The maintainer neither validates nor interprets it. Absent when this is a tombstone or a metadata-only view — see this definition's description for why that is not the same as a null value.";
|
|
243
|
+
};
|
|
244
|
+
readonly valueBytes: {
|
|
245
|
+
readonly type: "integer";
|
|
246
|
+
readonly minimum: 0;
|
|
247
|
+
readonly description: "Size of the stored value in bytes, measured as the maintainer measures it for the per-record cap (see `vta/app-state/put`). Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
248
|
+
};
|
|
249
|
+
readonly deleted: {
|
|
250
|
+
readonly type: "boolean";
|
|
251
|
+
readonly description: "True when this is a tombstone: the record was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/app-state/list`.";
|
|
252
|
+
};
|
|
253
|
+
readonly createdAt: {
|
|
254
|
+
readonly type: "string";
|
|
255
|
+
readonly format: "date-time";
|
|
256
|
+
readonly description: "When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded.";
|
|
257
|
+
};
|
|
258
|
+
readonly updatedAt: {
|
|
259
|
+
readonly type: "string";
|
|
260
|
+
readonly format: "date-time";
|
|
261
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
262
|
+
};
|
|
263
|
+
readonly deletedAt: {
|
|
264
|
+
readonly type: "string";
|
|
265
|
+
readonly format: "date-time";
|
|
266
|
+
readonly description: "When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
readonly Version: {
|
|
271
|
+
readonly title: "Version";
|
|
272
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
273
|
+
readonly type: "integer";
|
|
274
|
+
readonly minimum: 1;
|
|
275
|
+
};
|
|
276
|
+
readonly Namespace: {
|
|
277
|
+
readonly title: "Namespace";
|
|
278
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
279
|
+
readonly type: "string";
|
|
280
|
+
readonly minLength: 1;
|
|
281
|
+
readonly maxLength: 64;
|
|
282
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
287
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
288
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
289
|
+
readonly $ref: "#/$defs/Response";
|
|
290
|
+
readonly $defs: {
|
|
291
|
+
readonly Response: {
|
|
292
|
+
readonly $anchor: "response";
|
|
293
|
+
readonly title: "VTA Application State Get-Many — response payload";
|
|
294
|
+
readonly description: "Success response to vta/app-state/get-many. Type https://trusttasks.org/spec/vta/app-state/get-many/1.0#response. Every requested key appears in exactly one of `records`, `missing` or `deferred`, so a caller can account for all of them without comparing sets itself.";
|
|
295
|
+
readonly type: "object";
|
|
296
|
+
readonly additionalProperties: false;
|
|
297
|
+
readonly required: readonly ["records", "missing"];
|
|
298
|
+
readonly properties: {
|
|
299
|
+
readonly records: {
|
|
300
|
+
readonly type: "array";
|
|
301
|
+
readonly items: {
|
|
302
|
+
readonly $ref: "#/$defs/AppStateRecord";
|
|
303
|
+
};
|
|
304
|
+
readonly description: "The records found, each with its `value`, in the order the keys were requested. May be empty.";
|
|
305
|
+
};
|
|
306
|
+
readonly missing: {
|
|
307
|
+
readonly type: "array";
|
|
308
|
+
readonly items: {
|
|
309
|
+
readonly $ref: "#/$defs/Key";
|
|
310
|
+
};
|
|
311
|
+
readonly description: "Requested keys holding no record — and, unless `includeDeleted` was set, keys holding only a tombstone. Reported rather than silently omitted, so a caller need not diff the request against the response to notice.";
|
|
312
|
+
};
|
|
313
|
+
readonly deferred: {
|
|
314
|
+
readonly type: "array";
|
|
315
|
+
readonly items: {
|
|
316
|
+
readonly $ref: "#/$defs/Key";
|
|
317
|
+
};
|
|
318
|
+
readonly description: "Requested keys the maintainer did not evaluate because the response had reached its size budget. The caller re-requests exactly these. This exists because the per-record cap multiplied by the key ceiling exceeds any sane response limit, and the alternative — refusing the whole batch — would make a caller guess at a batch size instead of being told one.";
|
|
319
|
+
};
|
|
320
|
+
readonly ext: {
|
|
321
|
+
readonly $ref: "#/$defs/Ext";
|
|
322
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
readonly Ext: {
|
|
327
|
+
readonly title: "Ext";
|
|
328
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
329
|
+
readonly type: "object";
|
|
330
|
+
readonly minProperties: 1;
|
|
331
|
+
readonly additionalProperties: true;
|
|
332
|
+
readonly propertyNames: {
|
|
333
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
readonly Key: {
|
|
337
|
+
readonly title: "Key";
|
|
338
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
339
|
+
readonly type: "string";
|
|
340
|
+
readonly minLength: 1;
|
|
341
|
+
readonly maxLength: 512;
|
|
342
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
343
|
+
};
|
|
344
|
+
readonly AppStateRecord: {
|
|
345
|
+
readonly title: "AppStateRecord";
|
|
346
|
+
readonly description: "A record as the maintainer holds it. `value` is absent in three distinct situations and a consumer MUST NOT conflate them: the record is a tombstone (`deleted` is true); the caller asked for a metadata-only view (`list` without `includeValues`); or the value genuinely is the JSON literal `null`, in which case `value` is PRESENT and null. This is why `deleted` is required rather than defaulted — a consumer that has to infer deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
347
|
+
readonly type: "object";
|
|
348
|
+
readonly additionalProperties: false;
|
|
349
|
+
readonly required: readonly ["contextId", "namespace", "key", "version", "deleted", "updatedAt"];
|
|
350
|
+
readonly properties: {
|
|
351
|
+
readonly contextId: {
|
|
352
|
+
readonly type: "string";
|
|
353
|
+
readonly minLength: 1;
|
|
354
|
+
readonly description: "The VTA context the record is scoped to; the isolation boundary.";
|
|
355
|
+
};
|
|
356
|
+
readonly namespace: {
|
|
357
|
+
readonly $ref: "#/$defs/Namespace";
|
|
358
|
+
};
|
|
359
|
+
readonly key: {
|
|
360
|
+
readonly $ref: "#/$defs/Key";
|
|
361
|
+
};
|
|
362
|
+
readonly version: {
|
|
363
|
+
readonly $ref: "#/$defs/Version";
|
|
364
|
+
readonly description: "The namespace counter value this record's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
365
|
+
};
|
|
366
|
+
readonly value: {
|
|
367
|
+
readonly description: "The stored JSON, in whatever shape the owning application chose. Any JSON value, including `null`. The maintainer neither validates nor interprets it. Absent when this is a tombstone or a metadata-only view — see this definition's description for why that is not the same as a null value.";
|
|
368
|
+
};
|
|
369
|
+
readonly valueBytes: {
|
|
370
|
+
readonly type: "integer";
|
|
371
|
+
readonly minimum: 0;
|
|
372
|
+
readonly description: "Size of the stored value in bytes, measured as the maintainer measures it for the per-record cap (see `vta/app-state/put`). Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
373
|
+
};
|
|
374
|
+
readonly deleted: {
|
|
375
|
+
readonly type: "boolean";
|
|
376
|
+
readonly description: "True when this is a tombstone: the record was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/app-state/list`.";
|
|
377
|
+
};
|
|
378
|
+
readonly createdAt: {
|
|
379
|
+
readonly type: "string";
|
|
380
|
+
readonly format: "date-time";
|
|
381
|
+
readonly description: "When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded.";
|
|
382
|
+
};
|
|
383
|
+
readonly updatedAt: {
|
|
384
|
+
readonly type: "string";
|
|
385
|
+
readonly format: "date-time";
|
|
386
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
387
|
+
};
|
|
388
|
+
readonly deletedAt: {
|
|
389
|
+
readonly type: "string";
|
|
390
|
+
readonly format: "date-time";
|
|
391
|
+
readonly description: "When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
readonly Version: {
|
|
396
|
+
readonly title: "Version";
|
|
397
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
398
|
+
readonly type: "integer";
|
|
399
|
+
readonly minimum: 1;
|
|
400
|
+
};
|
|
401
|
+
readonly Namespace: {
|
|
402
|
+
readonly title: "Namespace";
|
|
403
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
404
|
+
readonly type: "string";
|
|
405
|
+
readonly minLength: 1;
|
|
406
|
+
readonly maxLength: 64;
|
|
407
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
413
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
414
|
+
* per-specification and cannot be derived from the document alone, and
|
|
415
|
+
* item 2 needs the schema this carries.
|
|
416
|
+
*/
|
|
417
|
+
export declare const SPEC: {
|
|
418
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/app-state/get-many/1.0";
|
|
419
|
+
readonly isBearer: false;
|
|
420
|
+
readonly isProofRequired: false;
|
|
421
|
+
readonly isRecipientRequired: true;
|
|
422
|
+
readonly payloadSchema: {
|
|
423
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
424
|
+
readonly $id: "https://trusttasks.org/spec/vta/app-state/get-many/1.0";
|
|
425
|
+
readonly title: "VTA Application State Get-Many — payload";
|
|
426
|
+
readonly description: "Read up to 256 application-state records from one namespace in a single round trip. A rebuild or a reconnect is N records, and round-tripping each one separately is the difference between a usable reconnect and an unusable one.";
|
|
427
|
+
readonly type: "object";
|
|
428
|
+
readonly additionalProperties: false;
|
|
429
|
+
readonly required: readonly ["contextId", "namespace", "keys"];
|
|
430
|
+
readonly properties: {
|
|
431
|
+
readonly contextId: {
|
|
432
|
+
readonly type: "string";
|
|
433
|
+
readonly minLength: 1;
|
|
434
|
+
readonly description: "The VTA context the records are scoped to; the isolation boundary.";
|
|
435
|
+
};
|
|
436
|
+
readonly namespace: {
|
|
437
|
+
readonly $ref: "#/$defs/Namespace";
|
|
438
|
+
readonly description: "Required, unlike in list: a batch read addresses records by key, and a key is only unique within a namespace.";
|
|
439
|
+
};
|
|
440
|
+
readonly keys: {
|
|
441
|
+
readonly type: "array";
|
|
442
|
+
readonly minItems: 1;
|
|
443
|
+
readonly maxItems: 256;
|
|
444
|
+
readonly uniqueItems: true;
|
|
445
|
+
readonly items: {
|
|
446
|
+
readonly $ref: "#/$defs/Key";
|
|
447
|
+
};
|
|
448
|
+
readonly description: "The keys to read. Duplicates are refused rather than deduplicated, because a caller that sent one did not mean to and would otherwise never find out.";
|
|
449
|
+
};
|
|
450
|
+
readonly includeDeleted: {
|
|
451
|
+
readonly type: "boolean";
|
|
452
|
+
readonly description: "Defaults to false. When true, an address holding a tombstone yields a record with `deleted: true` rather than appearing in `missing`.";
|
|
453
|
+
};
|
|
454
|
+
readonly ext: {
|
|
455
|
+
readonly $ref: "#/$defs/Ext";
|
|
456
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
readonly $defs: {
|
|
460
|
+
readonly Response: {
|
|
461
|
+
readonly $anchor: "response";
|
|
462
|
+
readonly title: "VTA Application State Get-Many — response payload";
|
|
463
|
+
readonly description: "Success response to vta/app-state/get-many. Type https://trusttasks.org/spec/vta/app-state/get-many/1.0#response. Every requested key appears in exactly one of `records`, `missing` or `deferred`, so a caller can account for all of them without comparing sets itself.";
|
|
464
|
+
readonly type: "object";
|
|
465
|
+
readonly additionalProperties: false;
|
|
466
|
+
readonly required: readonly ["records", "missing"];
|
|
467
|
+
readonly properties: {
|
|
468
|
+
readonly records: {
|
|
469
|
+
readonly type: "array";
|
|
470
|
+
readonly items: {
|
|
471
|
+
readonly $ref: "#/$defs/AppStateRecord";
|
|
472
|
+
};
|
|
473
|
+
readonly description: "The records found, each with its `value`, in the order the keys were requested. May be empty.";
|
|
474
|
+
};
|
|
475
|
+
readonly missing: {
|
|
476
|
+
readonly type: "array";
|
|
477
|
+
readonly items: {
|
|
478
|
+
readonly $ref: "#/$defs/Key";
|
|
479
|
+
};
|
|
480
|
+
readonly description: "Requested keys holding no record — and, unless `includeDeleted` was set, keys holding only a tombstone. Reported rather than silently omitted, so a caller need not diff the request against the response to notice.";
|
|
481
|
+
};
|
|
482
|
+
readonly deferred: {
|
|
483
|
+
readonly type: "array";
|
|
484
|
+
readonly items: {
|
|
485
|
+
readonly $ref: "#/$defs/Key";
|
|
486
|
+
};
|
|
487
|
+
readonly description: "Requested keys the maintainer did not evaluate because the response had reached its size budget. The caller re-requests exactly these. This exists because the per-record cap multiplied by the key ceiling exceeds any sane response limit, and the alternative — refusing the whole batch — would make a caller guess at a batch size instead of being told one.";
|
|
488
|
+
};
|
|
489
|
+
readonly ext: {
|
|
490
|
+
readonly $ref: "#/$defs/Ext";
|
|
491
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
readonly Ext: {
|
|
496
|
+
readonly title: "Ext";
|
|
497
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
498
|
+
readonly type: "object";
|
|
499
|
+
readonly minProperties: 1;
|
|
500
|
+
readonly additionalProperties: true;
|
|
501
|
+
readonly propertyNames: {
|
|
502
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
readonly Key: {
|
|
506
|
+
readonly title: "Key";
|
|
507
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
508
|
+
readonly type: "string";
|
|
509
|
+
readonly minLength: 1;
|
|
510
|
+
readonly maxLength: 512;
|
|
511
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
512
|
+
};
|
|
513
|
+
readonly AppStateRecord: {
|
|
514
|
+
readonly title: "AppStateRecord";
|
|
515
|
+
readonly description: "A record as the maintainer holds it. `value` is absent in three distinct situations and a consumer MUST NOT conflate them: the record is a tombstone (`deleted` is true); the caller asked for a metadata-only view (`list` without `includeValues`); or the value genuinely is the JSON literal `null`, in which case `value` is PRESENT and null. This is why `deleted` is required rather than defaulted — a consumer that has to infer deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
516
|
+
readonly type: "object";
|
|
517
|
+
readonly additionalProperties: false;
|
|
518
|
+
readonly required: readonly ["contextId", "namespace", "key", "version", "deleted", "updatedAt"];
|
|
519
|
+
readonly properties: {
|
|
520
|
+
readonly contextId: {
|
|
521
|
+
readonly type: "string";
|
|
522
|
+
readonly minLength: 1;
|
|
523
|
+
readonly description: "The VTA context the record is scoped to; the isolation boundary.";
|
|
524
|
+
};
|
|
525
|
+
readonly namespace: {
|
|
526
|
+
readonly $ref: "#/$defs/Namespace";
|
|
527
|
+
};
|
|
528
|
+
readonly key: {
|
|
529
|
+
readonly $ref: "#/$defs/Key";
|
|
530
|
+
};
|
|
531
|
+
readonly version: {
|
|
532
|
+
readonly $ref: "#/$defs/Version";
|
|
533
|
+
readonly description: "The namespace counter value this record's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
534
|
+
};
|
|
535
|
+
readonly value: {
|
|
536
|
+
readonly description: "The stored JSON, in whatever shape the owning application chose. Any JSON value, including `null`. The maintainer neither validates nor interprets it. Absent when this is a tombstone or a metadata-only view — see this definition's description for why that is not the same as a null value.";
|
|
537
|
+
};
|
|
538
|
+
readonly valueBytes: {
|
|
539
|
+
readonly type: "integer";
|
|
540
|
+
readonly minimum: 0;
|
|
541
|
+
readonly description: "Size of the stored value in bytes, measured as the maintainer measures it for the per-record cap (see `vta/app-state/put`). Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
542
|
+
};
|
|
543
|
+
readonly deleted: {
|
|
544
|
+
readonly type: "boolean";
|
|
545
|
+
readonly description: "True when this is a tombstone: the record was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/app-state/list`.";
|
|
546
|
+
};
|
|
547
|
+
readonly createdAt: {
|
|
548
|
+
readonly type: "string";
|
|
549
|
+
readonly format: "date-time";
|
|
550
|
+
readonly description: "When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded.";
|
|
551
|
+
};
|
|
552
|
+
readonly updatedAt: {
|
|
553
|
+
readonly type: "string";
|
|
554
|
+
readonly format: "date-time";
|
|
555
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
556
|
+
};
|
|
557
|
+
readonly deletedAt: {
|
|
558
|
+
readonly type: "string";
|
|
559
|
+
readonly format: "date-time";
|
|
560
|
+
readonly description: "When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
readonly Version: {
|
|
565
|
+
readonly title: "Version";
|
|
566
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
567
|
+
readonly type: "integer";
|
|
568
|
+
readonly minimum: 1;
|
|
569
|
+
};
|
|
570
|
+
readonly Namespace: {
|
|
571
|
+
readonly title: "Namespace";
|
|
572
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
573
|
+
readonly type: "string";
|
|
574
|
+
readonly minLength: 1;
|
|
575
|
+
readonly maxLength: 64;
|
|
576
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
583
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
584
|
+
* parties (§7.3 item 5).
|
|
585
|
+
*/
|
|
586
|
+
export declare const RESPONSE_SPEC: {
|
|
587
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/app-state/get-many/1.0#response";
|
|
588
|
+
readonly isBearer: false;
|
|
589
|
+
readonly isProofRequired: false;
|
|
590
|
+
readonly isRecipientRequired: true;
|
|
591
|
+
readonly payloadSchema: {
|
|
592
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
593
|
+
readonly $ref: "#/$defs/Response";
|
|
594
|
+
readonly $defs: {
|
|
595
|
+
readonly Response: {
|
|
596
|
+
readonly $anchor: "response";
|
|
597
|
+
readonly title: "VTA Application State Get-Many — response payload";
|
|
598
|
+
readonly description: "Success response to vta/app-state/get-many. Type https://trusttasks.org/spec/vta/app-state/get-many/1.0#response. Every requested key appears in exactly one of `records`, `missing` or `deferred`, so a caller can account for all of them without comparing sets itself.";
|
|
599
|
+
readonly type: "object";
|
|
600
|
+
readonly additionalProperties: false;
|
|
601
|
+
readonly required: readonly ["records", "missing"];
|
|
602
|
+
readonly properties: {
|
|
603
|
+
readonly records: {
|
|
604
|
+
readonly type: "array";
|
|
605
|
+
readonly items: {
|
|
606
|
+
readonly $ref: "#/$defs/AppStateRecord";
|
|
607
|
+
};
|
|
608
|
+
readonly description: "The records found, each with its `value`, in the order the keys were requested. May be empty.";
|
|
609
|
+
};
|
|
610
|
+
readonly missing: {
|
|
611
|
+
readonly type: "array";
|
|
612
|
+
readonly items: {
|
|
613
|
+
readonly $ref: "#/$defs/Key";
|
|
614
|
+
};
|
|
615
|
+
readonly description: "Requested keys holding no record — and, unless `includeDeleted` was set, keys holding only a tombstone. Reported rather than silently omitted, so a caller need not diff the request against the response to notice.";
|
|
616
|
+
};
|
|
617
|
+
readonly deferred: {
|
|
618
|
+
readonly type: "array";
|
|
619
|
+
readonly items: {
|
|
620
|
+
readonly $ref: "#/$defs/Key";
|
|
621
|
+
};
|
|
622
|
+
readonly description: "Requested keys the maintainer did not evaluate because the response had reached its size budget. The caller re-requests exactly these. This exists because the per-record cap multiplied by the key ceiling exceeds any sane response limit, and the alternative — refusing the whole batch — would make a caller guess at a batch size instead of being told one.";
|
|
623
|
+
};
|
|
624
|
+
readonly ext: {
|
|
625
|
+
readonly $ref: "#/$defs/Ext";
|
|
626
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
readonly Ext: {
|
|
631
|
+
readonly title: "Ext";
|
|
632
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
633
|
+
readonly type: "object";
|
|
634
|
+
readonly minProperties: 1;
|
|
635
|
+
readonly additionalProperties: true;
|
|
636
|
+
readonly propertyNames: {
|
|
637
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
readonly Key: {
|
|
641
|
+
readonly title: "Key";
|
|
642
|
+
readonly description: "Application-chosen identifier for a record within a namespace. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `list` is a byte-prefix comparison over the UTF-8 encoding. Applications SHOULD use `/`-delimited hierarchical keys (`community/acme`, `contact/z6Mk…`) so that `prefix` can address a record family, but the delimiter is a convention between an application and itself — the maintainer attaches no meaning to it.";
|
|
643
|
+
readonly type: "string";
|
|
644
|
+
readonly minLength: 1;
|
|
645
|
+
readonly maxLength: 512;
|
|
646
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
647
|
+
};
|
|
648
|
+
readonly AppStateRecord: {
|
|
649
|
+
readonly title: "AppStateRecord";
|
|
650
|
+
readonly description: "A record as the maintainer holds it. `value` is absent in three distinct situations and a consumer MUST NOT conflate them: the record is a tombstone (`deleted` is true); the caller asked for a metadata-only view (`list` without `includeValues`); or the value genuinely is the JSON literal `null`, in which case `value` is PRESENT and null. This is why `deleted` is required rather than defaulted — a consumer that has to infer deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
651
|
+
readonly type: "object";
|
|
652
|
+
readonly additionalProperties: false;
|
|
653
|
+
readonly required: readonly ["contextId", "namespace", "key", "version", "deleted", "updatedAt"];
|
|
654
|
+
readonly properties: {
|
|
655
|
+
readonly contextId: {
|
|
656
|
+
readonly type: "string";
|
|
657
|
+
readonly minLength: 1;
|
|
658
|
+
readonly description: "The VTA context the record is scoped to; the isolation boundary.";
|
|
659
|
+
};
|
|
660
|
+
readonly namespace: {
|
|
661
|
+
readonly $ref: "#/$defs/Namespace";
|
|
662
|
+
};
|
|
663
|
+
readonly key: {
|
|
664
|
+
readonly $ref: "#/$defs/Key";
|
|
665
|
+
};
|
|
666
|
+
readonly version: {
|
|
667
|
+
readonly $ref: "#/$defs/Version";
|
|
668
|
+
readonly description: "The namespace counter value this record's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
669
|
+
};
|
|
670
|
+
readonly value: {
|
|
671
|
+
readonly description: "The stored JSON, in whatever shape the owning application chose. Any JSON value, including `null`. The maintainer neither validates nor interprets it. Absent when this is a tombstone or a metadata-only view — see this definition's description for why that is not the same as a null value.";
|
|
672
|
+
};
|
|
673
|
+
readonly valueBytes: {
|
|
674
|
+
readonly type: "integer";
|
|
675
|
+
readonly minimum: 0;
|
|
676
|
+
readonly description: "Size of the stored value in bytes, measured as the maintainer measures it for the per-record cap (see `vta/app-state/put`). Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
677
|
+
};
|
|
678
|
+
readonly deleted: {
|
|
679
|
+
readonly type: "boolean";
|
|
680
|
+
readonly description: "True when this is a tombstone: the record was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/app-state/list`.";
|
|
681
|
+
};
|
|
682
|
+
readonly createdAt: {
|
|
683
|
+
readonly type: "string";
|
|
684
|
+
readonly format: "date-time";
|
|
685
|
+
readonly description: "When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded.";
|
|
686
|
+
};
|
|
687
|
+
readonly updatedAt: {
|
|
688
|
+
readonly type: "string";
|
|
689
|
+
readonly format: "date-time";
|
|
690
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
691
|
+
};
|
|
692
|
+
readonly deletedAt: {
|
|
693
|
+
readonly type: "string";
|
|
694
|
+
readonly format: "date-time";
|
|
695
|
+
readonly description: "When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
696
|
+
};
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
readonly Version: {
|
|
700
|
+
readonly title: "Version";
|
|
701
|
+
readonly description: "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
702
|
+
readonly type: "integer";
|
|
703
|
+
readonly minimum: 1;
|
|
704
|
+
};
|
|
705
|
+
readonly Namespace: {
|
|
706
|
+
readonly title: "Namespace";
|
|
707
|
+
readonly description: "Scopes one application's records within a context, so several tools can share a context without colliding — `openvtc`, `cnm`, an agent runtime. The maintainer MUST NOT interpret the value; it is an opaque partition name. Namespaces are first-come and unreserved, so an application SHOULD pick a stable, specific one: a future per-namespace ACL would grant on this exact string, which makes renaming a namespace a migration rather than an edit.";
|
|
708
|
+
readonly type: "string";
|
|
709
|
+
readonly minLength: 1;
|
|
710
|
+
readonly maxLength: 64;
|
|
711
|
+
readonly pattern: "^[a-z][a-z0-9]*(-[a-z0-9]+)*$";
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
};
|
|
716
|
+
//# sourceMappingURL=payload.d.ts.map
|