@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,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/app-state/get/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 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.
|
|
8
|
+
*/
|
|
9
|
+
export type Namespace = string;
|
|
10
|
+
/**
|
|
11
|
+
* 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.
|
|
12
|
+
*/
|
|
13
|
+
export type Key = string;
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
16
|
+
*/
|
|
17
|
+
export type Version = number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Read one application-state record by its `(contextId, namespace, key)` address. Returns the record with its value and its version; the version is what a subsequent conditional write supplies as `expectedVersion`.
|
|
21
|
+
*/
|
|
22
|
+
export interface VTAApplicationStateGetPayload {
|
|
23
|
+
/**
|
|
24
|
+
* The VTA context the record is scoped to; the isolation boundary.
|
|
25
|
+
*/
|
|
26
|
+
contextId: string;
|
|
27
|
+
namespace: Namespace;
|
|
28
|
+
key: Key;
|
|
29
|
+
/**
|
|
30
|
+
* Defaults to false. When true, a tombstone at this address is returned as a record with `deleted: true` instead of being reported as absent. Lets a consumer distinguish "deleted, and here is the version that deleted it" from "never existed, or deleted so long ago the tombstone was reaped" — a distinction a repair path needs and a normal read does not.
|
|
31
|
+
*/
|
|
32
|
+
includeDeleted?: boolean;
|
|
33
|
+
ext?: Ext;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
37
|
+
*/
|
|
38
|
+
export interface Ext {
|
|
39
|
+
[k: string]: unknown | undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Success response to vta/app-state/get. Type https://trusttasks.org/spec/vta/app-state/get/1.0#response. An absent record is not a success: it is reported as a trust-task-error carrying vta/app-state/get:notFound.
|
|
43
|
+
*/
|
|
44
|
+
export interface VTAApplicationStateGetResponsePayload {
|
|
45
|
+
record: AppStateRecord;
|
|
46
|
+
ext?: Ext1;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The record at the requested address, with its `value` populated (unless it is a tombstone returned under `includeDeleted`).
|
|
50
|
+
*/
|
|
51
|
+
export interface AppStateRecord {
|
|
52
|
+
/**
|
|
53
|
+
* The VTA context the record is scoped to; the isolation boundary.
|
|
54
|
+
*/
|
|
55
|
+
contextId: string;
|
|
56
|
+
namespace: Namespace;
|
|
57
|
+
key: Key;
|
|
58
|
+
version: Version;
|
|
59
|
+
/**
|
|
60
|
+
* 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.
|
|
61
|
+
*/
|
|
62
|
+
value?: {
|
|
63
|
+
[k: string]: unknown | undefined;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* 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.
|
|
67
|
+
*/
|
|
68
|
+
valueBytes?: number;
|
|
69
|
+
/**
|
|
70
|
+
* 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`.
|
|
71
|
+
*/
|
|
72
|
+
deleted: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded.
|
|
75
|
+
*/
|
|
76
|
+
createdAt?: string;
|
|
77
|
+
/**
|
|
78
|
+
* When the write that produced this `version` was applied. For a tombstone, when the delete was applied.
|
|
79
|
+
*/
|
|
80
|
+
updatedAt: string;
|
|
81
|
+
/**
|
|
82
|
+
* When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.
|
|
83
|
+
*/
|
|
84
|
+
deletedAt?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
88
|
+
*/
|
|
89
|
+
export interface Ext1 {
|
|
90
|
+
[k: string]: unknown | undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Trust Task type URI. */
|
|
94
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/app-state/get/1.0" as const;
|
|
95
|
+
|
|
96
|
+
/** Stable alias for this specification's request payload shape. */
|
|
97
|
+
export type Payload = VTAApplicationStateGetPayload;
|
|
98
|
+
|
|
99
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
100
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/app-state/get/1.0#response" as const;
|
|
101
|
+
|
|
102
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
103
|
+
export type Response = VTAApplicationStateGetResponsePayload;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* This specification's payload schema, as a value.
|
|
107
|
+
*
|
|
108
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
109
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
110
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
111
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
112
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
113
|
+
*/
|
|
114
|
+
export const PAYLOAD_SCHEMA = {
|
|
115
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
116
|
+
"$id": "https://trusttasks.org/spec/vta/app-state/get/1.0",
|
|
117
|
+
"title": "VTA Application State Get — payload",
|
|
118
|
+
"description": "Read one application-state record by its `(contextId, namespace, key)` address. Returns the record with its value and its version; the version is what a subsequent conditional write supplies as `expectedVersion`.",
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": [
|
|
122
|
+
"contextId",
|
|
123
|
+
"namespace",
|
|
124
|
+
"key"
|
|
125
|
+
],
|
|
126
|
+
"properties": {
|
|
127
|
+
"contextId": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"minLength": 1,
|
|
130
|
+
"description": "The VTA context the record is scoped to; the isolation boundary."
|
|
131
|
+
},
|
|
132
|
+
"namespace": {
|
|
133
|
+
"$ref": "#/$defs/Namespace"
|
|
134
|
+
},
|
|
135
|
+
"key": {
|
|
136
|
+
"$ref": "#/$defs/Key"
|
|
137
|
+
},
|
|
138
|
+
"includeDeleted": {
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"description": "Defaults to false. When true, a tombstone at this address is returned as a record with `deleted: true` instead of being reported as absent. Lets a consumer distinguish \"deleted, and here is the version that deleted it\" from \"never existed, or deleted so long ago the tombstone was reaped\" — a distinction a repair path needs and a normal read does not."
|
|
141
|
+
},
|
|
142
|
+
"ext": {
|
|
143
|
+
"$ref": "#/$defs/Ext",
|
|
144
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"$defs": {
|
|
148
|
+
"Response": {
|
|
149
|
+
"$anchor": "response",
|
|
150
|
+
"title": "VTA Application State Get — response payload",
|
|
151
|
+
"description": "Success response to vta/app-state/get. Type https://trusttasks.org/spec/vta/app-state/get/1.0#response. An absent record is not a success: it is reported as a trust-task-error carrying vta/app-state/get:notFound.",
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"required": [
|
|
155
|
+
"record"
|
|
156
|
+
],
|
|
157
|
+
"properties": {
|
|
158
|
+
"record": {
|
|
159
|
+
"$ref": "#/$defs/AppStateRecord",
|
|
160
|
+
"description": "The record at the requested address, with its `value` populated (unless it is a tombstone returned under `includeDeleted`)."
|
|
161
|
+
},
|
|
162
|
+
"ext": {
|
|
163
|
+
"$ref": "#/$defs/Ext",
|
|
164
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"Ext": {
|
|
169
|
+
"title": "Ext",
|
|
170
|
+
"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.",
|
|
171
|
+
"type": "object",
|
|
172
|
+
"minProperties": 1,
|
|
173
|
+
"additionalProperties": true,
|
|
174
|
+
"propertyNames": {
|
|
175
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"AppStateRecord": {
|
|
179
|
+
"title": "AppStateRecord",
|
|
180
|
+
"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.",
|
|
181
|
+
"type": "object",
|
|
182
|
+
"additionalProperties": false,
|
|
183
|
+
"required": [
|
|
184
|
+
"contextId",
|
|
185
|
+
"namespace",
|
|
186
|
+
"key",
|
|
187
|
+
"version",
|
|
188
|
+
"deleted",
|
|
189
|
+
"updatedAt"
|
|
190
|
+
],
|
|
191
|
+
"properties": {
|
|
192
|
+
"contextId": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"minLength": 1,
|
|
195
|
+
"description": "The VTA context the record is scoped to; the isolation boundary."
|
|
196
|
+
},
|
|
197
|
+
"namespace": {
|
|
198
|
+
"$ref": "#/$defs/Namespace"
|
|
199
|
+
},
|
|
200
|
+
"key": {
|
|
201
|
+
"$ref": "#/$defs/Key"
|
|
202
|
+
},
|
|
203
|
+
"version": {
|
|
204
|
+
"$ref": "#/$defs/Version",
|
|
205
|
+
"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."
|
|
206
|
+
},
|
|
207
|
+
"value": {
|
|
208
|
+
"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."
|
|
209
|
+
},
|
|
210
|
+
"valueBytes": {
|
|
211
|
+
"type": "integer",
|
|
212
|
+
"minimum": 0,
|
|
213
|
+
"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."
|
|
214
|
+
},
|
|
215
|
+
"deleted": {
|
|
216
|
+
"type": "boolean",
|
|
217
|
+
"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`."
|
|
218
|
+
},
|
|
219
|
+
"createdAt": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"format": "date-time",
|
|
222
|
+
"description": "When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded."
|
|
223
|
+
},
|
|
224
|
+
"updatedAt": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"format": "date-time",
|
|
227
|
+
"description": "When the write that produced this `version` was applied. For a tombstone, when the delete was applied."
|
|
228
|
+
},
|
|
229
|
+
"deletedAt": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"format": "date-time",
|
|
232
|
+
"description": "When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten."
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"Version": {
|
|
237
|
+
"title": "Version",
|
|
238
|
+
"description": "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
|
|
239
|
+
"type": "integer",
|
|
240
|
+
"minimum": 1
|
|
241
|
+
},
|
|
242
|
+
"Key": {
|
|
243
|
+
"title": "Key",
|
|
244
|
+
"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.",
|
|
245
|
+
"type": "string",
|
|
246
|
+
"minLength": 1,
|
|
247
|
+
"maxLength": 512,
|
|
248
|
+
"pattern": "^[^\\u0000]+$"
|
|
249
|
+
},
|
|
250
|
+
"Namespace": {
|
|
251
|
+
"title": "Namespace",
|
|
252
|
+
"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.",
|
|
253
|
+
"type": "string",
|
|
254
|
+
"minLength": 1,
|
|
255
|
+
"maxLength": 64,
|
|
256
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
} as const;
|
|
260
|
+
|
|
261
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
262
|
+
export const RESPONSE_PAYLOAD_SCHEMA = {
|
|
263
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
264
|
+
"$ref": "#/$defs/Response",
|
|
265
|
+
"$defs": {
|
|
266
|
+
"Response": {
|
|
267
|
+
"$anchor": "response",
|
|
268
|
+
"title": "VTA Application State Get — response payload",
|
|
269
|
+
"description": "Success response to vta/app-state/get. Type https://trusttasks.org/spec/vta/app-state/get/1.0#response. An absent record is not a success: it is reported as a trust-task-error carrying vta/app-state/get:notFound.",
|
|
270
|
+
"type": "object",
|
|
271
|
+
"additionalProperties": false,
|
|
272
|
+
"required": [
|
|
273
|
+
"record"
|
|
274
|
+
],
|
|
275
|
+
"properties": {
|
|
276
|
+
"record": {
|
|
277
|
+
"$ref": "#/$defs/AppStateRecord",
|
|
278
|
+
"description": "The record at the requested address, with its `value` populated (unless it is a tombstone returned under `includeDeleted`)."
|
|
279
|
+
},
|
|
280
|
+
"ext": {
|
|
281
|
+
"$ref": "#/$defs/Ext",
|
|
282
|
+
"description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"Ext": {
|
|
287
|
+
"title": "Ext",
|
|
288
|
+
"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.",
|
|
289
|
+
"type": "object",
|
|
290
|
+
"minProperties": 1,
|
|
291
|
+
"additionalProperties": true,
|
|
292
|
+
"propertyNames": {
|
|
293
|
+
"pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"AppStateRecord": {
|
|
297
|
+
"title": "AppStateRecord",
|
|
298
|
+
"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.",
|
|
299
|
+
"type": "object",
|
|
300
|
+
"additionalProperties": false,
|
|
301
|
+
"required": [
|
|
302
|
+
"contextId",
|
|
303
|
+
"namespace",
|
|
304
|
+
"key",
|
|
305
|
+
"version",
|
|
306
|
+
"deleted",
|
|
307
|
+
"updatedAt"
|
|
308
|
+
],
|
|
309
|
+
"properties": {
|
|
310
|
+
"contextId": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"minLength": 1,
|
|
313
|
+
"description": "The VTA context the record is scoped to; the isolation boundary."
|
|
314
|
+
},
|
|
315
|
+
"namespace": {
|
|
316
|
+
"$ref": "#/$defs/Namespace"
|
|
317
|
+
},
|
|
318
|
+
"key": {
|
|
319
|
+
"$ref": "#/$defs/Key"
|
|
320
|
+
},
|
|
321
|
+
"version": {
|
|
322
|
+
"$ref": "#/$defs/Version",
|
|
323
|
+
"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."
|
|
324
|
+
},
|
|
325
|
+
"value": {
|
|
326
|
+
"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."
|
|
327
|
+
},
|
|
328
|
+
"valueBytes": {
|
|
329
|
+
"type": "integer",
|
|
330
|
+
"minimum": 0,
|
|
331
|
+
"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."
|
|
332
|
+
},
|
|
333
|
+
"deleted": {
|
|
334
|
+
"type": "boolean",
|
|
335
|
+
"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`."
|
|
336
|
+
},
|
|
337
|
+
"createdAt": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"format": "date-time",
|
|
340
|
+
"description": "When the record was first created at this address. MAY be absent on a tombstone whose body has been discarded."
|
|
341
|
+
},
|
|
342
|
+
"updatedAt": {
|
|
343
|
+
"type": "string",
|
|
344
|
+
"format": "date-time",
|
|
345
|
+
"description": "When the write that produced this `version` was applied. For a tombstone, when the delete was applied."
|
|
346
|
+
},
|
|
347
|
+
"deletedAt": {
|
|
348
|
+
"type": "string",
|
|
349
|
+
"format": "date-time",
|
|
350
|
+
"description": "When the record was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten."
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"Version": {
|
|
355
|
+
"title": "Version",
|
|
356
|
+
"description": "A value of the namespace's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.",
|
|
357
|
+
"type": "integer",
|
|
358
|
+
"minimum": 1
|
|
359
|
+
},
|
|
360
|
+
"Key": {
|
|
361
|
+
"title": "Key",
|
|
362
|
+
"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.",
|
|
363
|
+
"type": "string",
|
|
364
|
+
"minLength": 1,
|
|
365
|
+
"maxLength": 512,
|
|
366
|
+
"pattern": "^[^\\u0000]+$"
|
|
367
|
+
},
|
|
368
|
+
"Namespace": {
|
|
369
|
+
"title": "Namespace",
|
|
370
|
+
"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.",
|
|
371
|
+
"type": "string",
|
|
372
|
+
"minLength": 1,
|
|
373
|
+
"maxLength": 64,
|
|
374
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
} as const;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
381
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
382
|
+
* per-specification and cannot be derived from the document alone, and
|
|
383
|
+
* item 2 needs the schema this carries.
|
|
384
|
+
*/
|
|
385
|
+
export const SPEC = {
|
|
386
|
+
typeUri: TYPE_URI,
|
|
387
|
+
isBearer: false,
|
|
388
|
+
isProofRequired: false,
|
|
389
|
+
isRecipientRequired: true,
|
|
390
|
+
payloadSchema: PAYLOAD_SCHEMA,
|
|
391
|
+
} as const;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
395
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
396
|
+
* parties (§7.3 item 5).
|
|
397
|
+
*/
|
|
398
|
+
export const RESPONSE_SPEC = {
|
|
399
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
400
|
+
isBearer: false,
|
|
401
|
+
isProofRequired: false,
|
|
402
|
+
isRecipientRequired: true,
|
|
403
|
+
payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
|
|
404
|
+
} as const;
|