@openvtc/trust-tasks 0.21.5 → 0.21.7

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.
@@ -0,0 +1,379 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/restore/status/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * The kind of deployment an agent's state lives in, as a backup restore classifies it: plain (an unencrypted store), hardened (the store encrypted under a key derived from the agent's seed), or tee (seed and signing keys sealed to an attested trusted execution environment).
11
+ */
12
+ export type DeploymentEnvironment = "plain" | "hardened" | "tee";
13
+
14
+ /**
15
+ * An administrator asks a Verifiable Trust Agent whether its current state derives from a backup restore, and which software version it runs. The payload carries nothing. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
16
+ */
17
+ export interface VTARestoreStatusPayload {
18
+ /**
19
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
20
+ */
21
+ ext?: Ext;
22
+ }
23
+ /**
24
+ * Carried in a Trust Task document whose type is https://trusttasks.org/spec/vta/restore/status/0.1#response. Failures use trust-task-error, not this shape.
25
+ */
26
+ export interface VTARestoreStatusResponsePayload {
27
+ /**
28
+ * The agent's software version, as its build reports it.
29
+ */
30
+ version: string;
31
+ /**
32
+ * Whether the agent's current state derives from a backup restore. Always present, so 'not restored' is stated rather than inferred from an absent member. True exactly when `restore` is present.
33
+ */
34
+ restored: boolean;
35
+ restore?: RestoreRecord;
36
+ /**
37
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
38
+ */
39
+ ext?: Ext;
40
+ }
41
+ /**
42
+ * The restore the agent's current state derives from. Present exactly when `restored` is true.
43
+ */
44
+ export interface RestoreRecord {
45
+ /**
46
+ * When the restored state was applied — the boot at which it replaced the agent's previous state.
47
+ */
48
+ appliedAt: string;
49
+ /**
50
+ * When the restore was committed and staged for the next boot.
51
+ */
52
+ stagedAt: string;
53
+ /**
54
+ * The DID of the administrator who committed the restore.
55
+ */
56
+ stagedBy: string;
57
+ /**
58
+ * The DID of the agent the backup was taken from, when the backup records one. Differs from the responding agent's own DID when a restore replaced its identity.
59
+ */
60
+ sourceDid?: string;
61
+ sourceEnvironment?: DeploymentEnvironment;
62
+ targetEnvironment: DeploymentEnvironment;
63
+ /**
64
+ * Identifiers of keys whose records came back without their material: keys the agent generated internally and never exports, so no backup carries them. Absent when none were lost.
65
+ *
66
+ * @maxItems 10000
67
+ */
68
+ internalKeysLost?: string[];
69
+ /**
70
+ * DIDs whose hosting registrations the restore detached because it replaced a different identity; each must be registered with its host again. Absent when none were.
71
+ *
72
+ * @maxItems 10000
73
+ */
74
+ hostedDidsDetached?: string[];
75
+ }
76
+
77
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
78
+ export type { Ext };
79
+
80
+ /** Trust Task type URI. */
81
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/restore/status/0.1" as const;
82
+
83
+ /** Stable alias for this specification's request payload shape. */
84
+ export type Payload = VTARestoreStatusPayload;
85
+
86
+ /** Trust Task response type URI (request type URI + "#response"). */
87
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/restore/status/0.1#response" as const;
88
+
89
+ /** Stable alias for this specification's success-response payload shape. */
90
+ export type Response = VTARestoreStatusResponsePayload;
91
+
92
+ /**
93
+ * This specification's payload schema, as a value.
94
+ *
95
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
96
+ * rather than only as a `.json` file because TypeScript types are erased
97
+ * at runtime: without a schema a consumer has nothing to validate, and
98
+ * every REQUIRED payload member is optional in practice. Cross-file
99
+ * `$ref`s are already inlined, so it needs no resolver.
100
+ */
101
+ export const PAYLOAD_SCHEMA = {
102
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
103
+ "$id": "https://trusttasks.org/spec/vta/restore/status/0.1",
104
+ "title": "VTA Restore — Status — payload",
105
+ "description": "An administrator asks a Verifiable Trust Agent whether its current state derives from a backup restore, and which software version it runs. The payload carries nothing. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "properties": {
109
+ "ext": {
110
+ "$ref": "#/$defs/Ext",
111
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
112
+ }
113
+ },
114
+ "$defs": {
115
+ "DeploymentEnvironment": {
116
+ "title": "DeploymentEnvironment",
117
+ "description": "The kind of deployment an agent's state lives in, as a backup restore classifies it: plain (an unencrypted store), hardened (the store encrypted under a key derived from the agent's seed), or tee (seed and signing keys sealed to an attested trusted execution environment).",
118
+ "type": "string",
119
+ "enum": [
120
+ "plain",
121
+ "hardened",
122
+ "tee"
123
+ ]
124
+ },
125
+ "RestoreRecord": {
126
+ "title": "RestoreRecord",
127
+ "description": "The backup restore the agent's current state derives from (VTI-VTA-051). `sourceEnvironment` is the kind of deployment the backup was taken from, present when the backup records it; `targetEnvironment` is the kind the restore was applied to — this agent's.",
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "appliedAt",
132
+ "stagedAt",
133
+ "stagedBy",
134
+ "targetEnvironment"
135
+ ],
136
+ "properties": {
137
+ "appliedAt": {
138
+ "type": "string",
139
+ "format": "date-time",
140
+ "description": "When the restored state was applied — the boot at which it replaced the agent's previous state."
141
+ },
142
+ "stagedAt": {
143
+ "type": "string",
144
+ "format": "date-time",
145
+ "description": "When the restore was committed and staged for the next boot."
146
+ },
147
+ "stagedBy": {
148
+ "type": "string",
149
+ "pattern": "^did:",
150
+ "maxLength": 2048,
151
+ "description": "The DID of the administrator who committed the restore."
152
+ },
153
+ "sourceDid": {
154
+ "type": "string",
155
+ "pattern": "^did:",
156
+ "maxLength": 2048,
157
+ "description": "The DID of the agent the backup was taken from, when the backup records one. Differs from the responding agent's own DID when a restore replaced its identity."
158
+ },
159
+ "sourceEnvironment": {
160
+ "$ref": "#/$defs/DeploymentEnvironment"
161
+ },
162
+ "targetEnvironment": {
163
+ "$ref": "#/$defs/DeploymentEnvironment"
164
+ },
165
+ "internalKeysLost": {
166
+ "type": "array",
167
+ "items": {
168
+ "type": "string",
169
+ "minLength": 1,
170
+ "maxLength": 256
171
+ },
172
+ "maxItems": 10000,
173
+ "description": "Identifiers of keys whose records came back without their material: keys the agent generated internally and never exports, so no backup carries them. Absent when none were lost."
174
+ },
175
+ "hostedDidsDetached": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "string",
179
+ "pattern": "^did:",
180
+ "maxLength": 2048
181
+ },
182
+ "maxItems": 10000,
183
+ "description": "DIDs whose hosting registrations the restore detached because it replaced a different identity; each must be registered with its host again. Absent when none were."
184
+ }
185
+ }
186
+ },
187
+ "Response": {
188
+ "$anchor": "response",
189
+ "title": "VTA Restore Status — response payload",
190
+ "description": "Carried in a Trust Task document whose type is https://trusttasks.org/spec/vta/restore/status/0.1#response. Failures use trust-task-error, not this shape.",
191
+ "type": "object",
192
+ "additionalProperties": false,
193
+ "required": [
194
+ "version",
195
+ "restored"
196
+ ],
197
+ "properties": {
198
+ "version": {
199
+ "type": "string",
200
+ "minLength": 1,
201
+ "maxLength": 64,
202
+ "description": "The agent's software version, as its build reports it."
203
+ },
204
+ "restored": {
205
+ "type": "boolean",
206
+ "description": "Whether the agent's current state derives from a backup restore. Always present, so 'not restored' is stated rather than inferred from an absent member. True exactly when `restore` is present."
207
+ },
208
+ "restore": {
209
+ "$ref": "#/$defs/RestoreRecord",
210
+ "description": "The restore the agent's current state derives from. Present exactly when `restored` is true."
211
+ },
212
+ "ext": {
213
+ "$ref": "#/$defs/Ext",
214
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
215
+ }
216
+ }
217
+ },
218
+ "Ext": {
219
+ "title": "Ext",
220
+ "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.",
221
+ "type": "object",
222
+ "minProperties": 1,
223
+ "additionalProperties": true,
224
+ "propertyNames": {
225
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
226
+ }
227
+ }
228
+ }
229
+ } as const;
230
+
231
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
232
+ export const RESPONSE_PAYLOAD_SCHEMA = {
233
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
234
+ "$ref": "#/$defs/Response",
235
+ "$defs": {
236
+ "DeploymentEnvironment": {
237
+ "title": "DeploymentEnvironment",
238
+ "description": "The kind of deployment an agent's state lives in, as a backup restore classifies it: plain (an unencrypted store), hardened (the store encrypted under a key derived from the agent's seed), or tee (seed and signing keys sealed to an attested trusted execution environment).",
239
+ "type": "string",
240
+ "enum": [
241
+ "plain",
242
+ "hardened",
243
+ "tee"
244
+ ]
245
+ },
246
+ "RestoreRecord": {
247
+ "title": "RestoreRecord",
248
+ "description": "The backup restore the agent's current state derives from (VTI-VTA-051). `sourceEnvironment` is the kind of deployment the backup was taken from, present when the backup records it; `targetEnvironment` is the kind the restore was applied to — this agent's.",
249
+ "type": "object",
250
+ "additionalProperties": false,
251
+ "required": [
252
+ "appliedAt",
253
+ "stagedAt",
254
+ "stagedBy",
255
+ "targetEnvironment"
256
+ ],
257
+ "properties": {
258
+ "appliedAt": {
259
+ "type": "string",
260
+ "format": "date-time",
261
+ "description": "When the restored state was applied — the boot at which it replaced the agent's previous state."
262
+ },
263
+ "stagedAt": {
264
+ "type": "string",
265
+ "format": "date-time",
266
+ "description": "When the restore was committed and staged for the next boot."
267
+ },
268
+ "stagedBy": {
269
+ "type": "string",
270
+ "pattern": "^did:",
271
+ "maxLength": 2048,
272
+ "description": "The DID of the administrator who committed the restore."
273
+ },
274
+ "sourceDid": {
275
+ "type": "string",
276
+ "pattern": "^did:",
277
+ "maxLength": 2048,
278
+ "description": "The DID of the agent the backup was taken from, when the backup records one. Differs from the responding agent's own DID when a restore replaced its identity."
279
+ },
280
+ "sourceEnvironment": {
281
+ "$ref": "#/$defs/DeploymentEnvironment"
282
+ },
283
+ "targetEnvironment": {
284
+ "$ref": "#/$defs/DeploymentEnvironment"
285
+ },
286
+ "internalKeysLost": {
287
+ "type": "array",
288
+ "items": {
289
+ "type": "string",
290
+ "minLength": 1,
291
+ "maxLength": 256
292
+ },
293
+ "maxItems": 10000,
294
+ "description": "Identifiers of keys whose records came back without their material: keys the agent generated internally and never exports, so no backup carries them. Absent when none were lost."
295
+ },
296
+ "hostedDidsDetached": {
297
+ "type": "array",
298
+ "items": {
299
+ "type": "string",
300
+ "pattern": "^did:",
301
+ "maxLength": 2048
302
+ },
303
+ "maxItems": 10000,
304
+ "description": "DIDs whose hosting registrations the restore detached because it replaced a different identity; each must be registered with its host again. Absent when none were."
305
+ }
306
+ }
307
+ },
308
+ "Response": {
309
+ "$anchor": "response",
310
+ "title": "VTA Restore Status — response payload",
311
+ "description": "Carried in a Trust Task document whose type is https://trusttasks.org/spec/vta/restore/status/0.1#response. Failures use trust-task-error, not this shape.",
312
+ "type": "object",
313
+ "additionalProperties": false,
314
+ "required": [
315
+ "version",
316
+ "restored"
317
+ ],
318
+ "properties": {
319
+ "version": {
320
+ "type": "string",
321
+ "minLength": 1,
322
+ "maxLength": 64,
323
+ "description": "The agent's software version, as its build reports it."
324
+ },
325
+ "restored": {
326
+ "type": "boolean",
327
+ "description": "Whether the agent's current state derives from a backup restore. Always present, so 'not restored' is stated rather than inferred from an absent member. True exactly when `restore` is present."
328
+ },
329
+ "restore": {
330
+ "$ref": "#/$defs/RestoreRecord",
331
+ "description": "The restore the agent's current state derives from. Present exactly when `restored` is true."
332
+ },
333
+ "ext": {
334
+ "$ref": "#/$defs/Ext",
335
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
336
+ }
337
+ }
338
+ },
339
+ "Ext": {
340
+ "title": "Ext",
341
+ "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.",
342
+ "type": "object",
343
+ "minProperties": 1,
344
+ "additionalProperties": true,
345
+ "propertyNames": {
346
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
347
+ }
348
+ }
349
+ }
350
+ } as const;
351
+
352
+ /**
353
+ * SPEC.md §7.2 policy for the request variant, from this specification's
354
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
355
+ * per-specification and cannot be derived from the document alone, and
356
+ * item 2 needs the schema this carries.
357
+ */
358
+ export const SPEC = {
359
+ typeUri: TYPE_URI,
360
+ isBearer: false,
361
+ isProofRequired: true,
362
+ isRecipientRequired: true,
363
+ isIssuedAtRequired: true,
364
+ payloadSchema: PAYLOAD_SCHEMA,
365
+ } as const;
366
+
367
+ /**
368
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
369
+ * tracks the *issuer* party's requirement because a response swaps the
370
+ * parties (§7.3 item 5).
371
+ */
372
+ export const RESPONSE_SPEC = {
373
+ typeUri: RESPONSE_TYPE_URI,
374
+ isBearer: false,
375
+ isProofRequired: true,
376
+ isRecipientRequired: true,
377
+ isIssuedAtRequired: true,
378
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
379
+ } as const;