@openvtc/trust-tasks 0.16.7 → 0.16.9

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/dist/_shared/components.d.ts +2 -2
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +6 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +6 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +6 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +6 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +12 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +12 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/rooms/keys/commit/0.1/payload.d.ts +266 -0
  25. package/dist/rooms/keys/commit/0.1/payload.d.ts.map +1 -0
  26. package/dist/rooms/keys/commit/0.1/payload.js +146 -0
  27. package/dist/rooms/keys/commit/0.1/payload.js.map +1 -0
  28. package/dist/rooms/keys/key-package/0.1/payload.d.ts +272 -0
  29. package/dist/rooms/keys/key-package/0.1/payload.d.ts.map +1 -0
  30. package/dist/rooms/keys/key-package/0.1/payload.js +147 -0
  31. package/dist/rooms/keys/key-package/0.1/payload.js.map +1 -0
  32. package/dist/rooms/keys/open/0.1/payload.d.ts +323 -0
  33. package/dist/rooms/keys/open/0.1/payload.d.ts.map +1 -0
  34. package/dist/rooms/keys/open/0.1/payload.js +171 -0
  35. package/dist/rooms/keys/open/0.1/payload.js.map +1 -0
  36. package/dist/rooms/keys/present/0.1/payload.d.ts +306 -0
  37. package/dist/rooms/keys/present/0.1/payload.d.ts.map +1 -0
  38. package/dist/rooms/keys/present/0.1/payload.js +165 -0
  39. package/dist/rooms/keys/present/0.1/payload.js.map +1 -0
  40. package/dist/rooms/keys/welcome/0.1/payload.d.ts +276 -0
  41. package/dist/rooms/keys/welcome/0.1/payload.d.ts.map +1 -0
  42. package/dist/rooms/keys/welcome/0.1/payload.js +148 -0
  43. package/dist/rooms/keys/welcome/0.1/payload.js.map +1 -0
  44. package/dist/rooms/records/curate/0.1/payload.d.ts +500 -0
  45. package/dist/rooms/records/curate/0.1/payload.d.ts.map +1 -0
  46. package/dist/rooms/records/curate/0.1/payload.js +277 -0
  47. package/dist/rooms/records/curate/0.1/payload.js.map +1 -0
  48. package/dist/vta/backup/abort/1.0/payload.d.ts +262 -0
  49. package/dist/vta/backup/abort/1.0/payload.d.ts.map +1 -0
  50. package/dist/vta/backup/abort/1.0/payload.js +146 -0
  51. package/dist/vta/backup/abort/1.0/payload.js.map +1 -0
  52. package/dist/vta/backup/complete-export/1.0/payload.d.ts +262 -0
  53. package/dist/vta/backup/complete-export/1.0/payload.d.ts.map +1 -0
  54. package/dist/vta/backup/complete-export/1.0/payload.js +146 -0
  55. package/dist/vta/backup/complete-export/1.0/payload.js.map +1 -0
  56. package/dist/vta/backup/finalize-import/1.0/payload.d.ts +477 -0
  57. package/dist/vta/backup/finalize-import/1.0/payload.d.ts.map +1 -0
  58. package/dist/vta/backup/finalize-import/1.0/payload.js +249 -0
  59. package/dist/vta/backup/finalize-import/1.0/payload.js.map +1 -0
  60. package/dist/vta/backup/initiate-export/1.0/payload.d.ts +514 -0
  61. package/dist/vta/backup/initiate-export/1.0/payload.d.ts.map +1 -0
  62. package/dist/vta/backup/initiate-export/1.0/payload.js +267 -0
  63. package/dist/vta/backup/initiate-export/1.0/payload.js.map +1 -0
  64. package/dist/vta/backup/initiate-import/1.0/payload.d.ts +510 -0
  65. package/dist/vta/backup/initiate-import/1.0/payload.d.ts.map +1 -0
  66. package/dist/vta/backup/initiate-import/1.0/payload.js +266 -0
  67. package/dist/vta/backup/initiate-import/1.0/payload.js.map +1 -0
  68. package/dist/vta/management/reload-services/1.0/payload.d.ts +230 -0
  69. package/dist/vta/management/reload-services/1.0/payload.d.ts.map +1 -0
  70. package/dist/vta/management/reload-services/1.0/payload.js +130 -0
  71. package/dist/vta/management/reload-services/1.0/payload.js.map +1 -0
  72. package/package.json +1 -1
  73. package/src/_shared/components.ts +6 -2
  74. package/src/device/list/0.1/payload.ts +6 -2
  75. package/src/device/list/0.2/payload.ts +6 -2
  76. package/src/device/register/0.1/payload.ts +6 -2
  77. package/src/device/register/0.2/payload.ts +6 -2
  78. package/src/index.ts +12 -0
  79. package/src/rooms/keys/commit/0.1/payload.ts +195 -0
  80. package/src/rooms/keys/key-package/0.1/payload.ts +196 -0
  81. package/src/rooms/keys/open/0.1/payload.ts +237 -0
  82. package/src/rooms/keys/present/0.1/payload.ts +224 -0
  83. package/src/rooms/keys/welcome/0.1/payload.ts +201 -0
  84. package/src/rooms/records/curate/0.1/payload.ts +357 -0
  85. package/src/vta/backup/abort/1.0/payload.ts +191 -0
  86. package/src/vta/backup/complete-export/1.0/payload.ts +191 -0
  87. package/src/vta/backup/finalize-import/1.0/payload.ts +333 -0
  88. package/src/vta/backup/initiate-export/1.0/payload.ts +350 -0
  89. package/src/vta/backup/initiate-import/1.0/payload.ts +349 -0
  90. package/src/vta/management/reload-services/1.0/payload.ts +167 -0
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/backup/complete-export/1.0/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Acknowledges that an export bundle was downloaded, so the recipient can release the staged bytes and retire the transport token. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTABackupCompleteExportPayload {
13
+ /**
14
+ * Handle from the initiate-export descriptor. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.
15
+ */
16
+ bundleId: string;
17
+ /**
18
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
19
+ */
20
+ ext?: Ext;
21
+ }
22
+ export interface VTABackupCompleteExportResponsePayload {
23
+ /**
24
+ * Echoed so the response stands alone as a record.
25
+ */
26
+ bundleId: string;
27
+ /**
28
+ * Whether the byte stream was actually fetched before this acknowledgement. Required, not optional: false is the honest answer when the operator skipped the download or the slot expired first, and an absent member would let that be read as success.
29
+ */
30
+ downloaded: boolean;
31
+ /**
32
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
33
+ */
34
+ ext?: Ext;
35
+ }
36
+
37
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
38
+ export type { Ext };
39
+
40
+ /** Trust Task type URI. */
41
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/backup/complete-export/1.0" as const;
42
+
43
+ /** Stable alias for this specification's request payload shape. */
44
+ export type Payload = VTABackupCompleteExportPayload;
45
+
46
+ /** Trust Task response type URI (request type URI + "#response"). */
47
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/backup/complete-export/1.0#response" as const;
48
+
49
+ /** Stable alias for this specification's success-response payload shape. */
50
+ export type Response = VTABackupCompleteExportResponsePayload;
51
+
52
+ /**
53
+ * This specification's payload schema, as a value.
54
+ *
55
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
56
+ * rather than only as a `.json` file because TypeScript types are erased
57
+ * at runtime: without a schema a consumer has nothing to validate, and
58
+ * every REQUIRED payload member is optional in practice. Cross-file
59
+ * `$ref`s are already inlined, so it needs no resolver.
60
+ */
61
+ export const PAYLOAD_SCHEMA = {
62
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
63
+ "$id": "https://trusttasks.org/spec/vta/backup/complete-export/1.0",
64
+ "title": "VTA Backup — Complete Export — payload",
65
+ "description": "Acknowledges that an export bundle was downloaded, so the recipient can release the staged bytes and retire the transport token. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": [
69
+ "bundleId"
70
+ ],
71
+ "properties": {
72
+ "bundleId": {
73
+ "type": "string",
74
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
75
+ "description": "Handle from the initiate-export descriptor. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one."
76
+ },
77
+ "ext": {
78
+ "$ref": "#/$defs/Ext",
79
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
80
+ }
81
+ },
82
+ "$defs": {
83
+ "Response": {
84
+ "$anchor": "response",
85
+ "title": "VTA Backup Complete Export — response payload",
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": [
89
+ "bundleId",
90
+ "downloaded"
91
+ ],
92
+ "properties": {
93
+ "bundleId": {
94
+ "type": "string",
95
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
96
+ "description": "Echoed so the response stands alone as a record."
97
+ },
98
+ "downloaded": {
99
+ "type": "boolean",
100
+ "description": "Whether the byte stream was actually fetched before this acknowledgement. Required, not optional: false is the honest answer when the operator skipped the download or the slot expired first, and an absent member would let that be read as success."
101
+ },
102
+ "ext": {
103
+ "$ref": "#/$defs/Ext",
104
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
105
+ }
106
+ }
107
+ },
108
+ "Ext": {
109
+ "title": "Ext",
110
+ "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.",
111
+ "type": "object",
112
+ "minProperties": 1,
113
+ "additionalProperties": true,
114
+ "propertyNames": {
115
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
116
+ }
117
+ }
118
+ }
119
+ } as const;
120
+
121
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
122
+ export const RESPONSE_PAYLOAD_SCHEMA = {
123
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
124
+ "$ref": "#/$defs/Response",
125
+ "$defs": {
126
+ "Response": {
127
+ "$anchor": "response",
128
+ "title": "VTA Backup Complete Export — response payload",
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": [
132
+ "bundleId",
133
+ "downloaded"
134
+ ],
135
+ "properties": {
136
+ "bundleId": {
137
+ "type": "string",
138
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
139
+ "description": "Echoed so the response stands alone as a record."
140
+ },
141
+ "downloaded": {
142
+ "type": "boolean",
143
+ "description": "Whether the byte stream was actually fetched before this acknowledgement. Required, not optional: false is the honest answer when the operator skipped the download or the slot expired first, and an absent member would let that be read as success."
144
+ },
145
+ "ext": {
146
+ "$ref": "#/$defs/Ext",
147
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
148
+ }
149
+ }
150
+ },
151
+ "Ext": {
152
+ "title": "Ext",
153
+ "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.",
154
+ "type": "object",
155
+ "minProperties": 1,
156
+ "additionalProperties": true,
157
+ "propertyNames": {
158
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
159
+ }
160
+ }
161
+ }
162
+ } as const;
163
+
164
+ /**
165
+ * SPEC.md §7.2 policy for the request variant, from this specification's
166
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
167
+ * per-specification and cannot be derived from the document alone, and
168
+ * item 2 needs the schema this carries.
169
+ */
170
+ export const SPEC = {
171
+ typeUri: TYPE_URI,
172
+ isBearer: false,
173
+ isProofRequired: true,
174
+ isRecipientRequired: true,
175
+ isIssuedAtRequired: true,
176
+ payloadSchema: PAYLOAD_SCHEMA,
177
+ } as const;
178
+
179
+ /**
180
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
181
+ * tracks the *issuer* party's requirement because a response swaps the
182
+ * parties (§7.3 item 5).
183
+ */
184
+ export const RESPONSE_SPEC = {
185
+ typeUri: RESPONSE_TYPE_URI,
186
+ isBearer: false,
187
+ isProofRequired: true,
188
+ isRecipientRequired: true,
189
+ isIssuedAtRequired: true,
190
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
191
+ } as const;
@@ -0,0 +1,333 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/backup/finalize-import/1.0/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Supplies the password for an uploaded bundle and asks the recipient to decrypt it and adopt what is inside, or to rehearse that without committing. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface VTABackupFinalizeImportPayload {
13
+ /**
14
+ * Handle from the initiate-import descriptor. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one.
15
+ */
16
+ bundleId: string;
17
+ /**
18
+ * Key-derivation input that unlocks the bundle. Supplied here rather than at initiate-import so the key never travels alongside the slot holding the ciphertext. `writeOnly` is the machine-readable form of the rule in Data carried: this member goes in and never comes back, so a generated client must not surface it in a response type, and a recipient must never log, echo or persist it.
19
+ */
20
+ password: string;
21
+ /**
22
+ * True commits and replaces the agent's state; false rehearses and mutates nothing. Absent means true — stated in prose rather than as a schema `default` on purpose, because a materialised default makes an omitted member indistinguishable from a deliberate one, and this is the member separating a rehearsal from an irreversible replacement. See Defaulting.
23
+ */
24
+ confirm?: boolean;
25
+ /**
26
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
27
+ */
28
+ ext?: Ext;
29
+ }
30
+ /**
31
+ * Counts and a status, never contents. This document is the operator-held record of a replacement the agent's own trail no longer describes.
32
+ */
33
+ export interface VTABackupFinalizeImportResponsePayload {
34
+ /**
35
+ * Echoed so the response stands alone as a record.
36
+ */
37
+ bundleId: string;
38
+ /**
39
+ * Which the recipient did. Reported rather than left to be inferred from the request, so that a response is complete evidence on its own: `committed` says the agent was replaced, `preview` says it was not.
40
+ */
41
+ status: "preview" | "committed";
42
+ /**
43
+ * Identifier of the agent the bundle was exported from. The one identifier a preview returns, because the common import error is a valid bundle from the wrong agent and this is what shows it. Absent where the bundle does not record one.
44
+ */
45
+ sourceDid?: string;
46
+ /**
47
+ * How many keys the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it.
48
+ */
49
+ keyCount: number;
50
+ /**
51
+ * How many access-control entries the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it.
52
+ */
53
+ aclCount: number;
54
+ /**
55
+ * How many trust contexts the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it.
56
+ */
57
+ contextCount: number;
58
+ /**
59
+ * How many audit entries the bundle holds. Zero for a bundle exported without its trail, which is a legitimate outcome and not a sign of a truncated bundle.
60
+ */
61
+ auditCount: number;
62
+ /**
63
+ * How many secrets the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it.
64
+ */
65
+ importedSecretCount?: number;
66
+ /**
67
+ * Operator-facing text elaborating on the outcome. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put bundle contents or a secret in it.
68
+ */
69
+ message?: string;
70
+ /**
71
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
72
+ */
73
+ ext?: Ext;
74
+ }
75
+
76
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
77
+ export type { Ext };
78
+
79
+ /** Trust Task type URI. */
80
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/backup/finalize-import/1.0" as const;
81
+
82
+ /** Stable alias for this specification's request payload shape. */
83
+ export type Payload = VTABackupFinalizeImportPayload;
84
+
85
+ /** Trust Task response type URI (request type URI + "#response"). */
86
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/backup/finalize-import/1.0#response" as const;
87
+
88
+ /** Stable alias for this specification's success-response payload shape. */
89
+ export type Response = VTABackupFinalizeImportResponsePayload;
90
+
91
+ /**
92
+ * This specification's payload schema, as a value.
93
+ *
94
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
95
+ * rather than only as a `.json` file because TypeScript types are erased
96
+ * at runtime: without a schema a consumer has nothing to validate, and
97
+ * every REQUIRED payload member is optional in practice. Cross-file
98
+ * `$ref`s are already inlined, so it needs no resolver.
99
+ */
100
+ export const PAYLOAD_SCHEMA = {
101
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
102
+ "$id": "https://trusttasks.org/spec/vta/backup/finalize-import/1.0",
103
+ "title": "VTA Backup — Finalize Import — payload",
104
+ "description": "Supplies the password for an uploaded bundle and asks the recipient to decrypt it and adopt what is inside, or to rehearse that without committing. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3.",
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": [
108
+ "bundleId",
109
+ "password"
110
+ ],
111
+ "properties": {
112
+ "bundleId": {
113
+ "type": "string",
114
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
115
+ "description": "Handle from the initiate-import descriptor. Opaque: a producer quotes what it was given and must not derive, guess or enumerate one."
116
+ },
117
+ "password": {
118
+ "type": "string",
119
+ "minLength": 15,
120
+ "maxLength": 1024,
121
+ "writeOnly": true,
122
+ "description": "Key-derivation input that unlocks the bundle. Supplied here rather than at initiate-import so the key never travels alongside the slot holding the ciphertext. `writeOnly` is the machine-readable form of the rule in Data carried: this member goes in and never comes back, so a generated client must not surface it in a response type, and a recipient must never log, echo or persist it.",
123
+ "$comment": "No example value anywhere in this directory: a specimen password is the one thing implementers copy. minLength mirrors the export floor so a bundle that could be created can be read back."
124
+ },
125
+ "confirm": {
126
+ "type": "boolean",
127
+ "description": "True commits and replaces the agent's state; false rehearses and mutates nothing. Absent means true — stated in prose rather than as a schema `default` on purpose, because a materialised default makes an omitted member indistinguishable from a deliberate one, and this is the member separating a rehearsal from an irreversible replacement. See Defaulting."
128
+ },
129
+ "ext": {
130
+ "$ref": "#/$defs/Ext",
131
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
132
+ }
133
+ },
134
+ "$defs": {
135
+ "Response": {
136
+ "$anchor": "response",
137
+ "title": "VTA Backup Finalize Import — response payload",
138
+ "type": "object",
139
+ "additionalProperties": false,
140
+ "description": "Counts and a status, never contents. This document is the operator-held record of a replacement the agent's own trail no longer describes.",
141
+ "required": [
142
+ "bundleId",
143
+ "status",
144
+ "keyCount",
145
+ "aclCount",
146
+ "contextCount",
147
+ "auditCount"
148
+ ],
149
+ "properties": {
150
+ "bundleId": {
151
+ "type": "string",
152
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
153
+ "description": "Echoed so the response stands alone as a record."
154
+ },
155
+ "status": {
156
+ "type": "string",
157
+ "enum": [
158
+ "preview",
159
+ "committed"
160
+ ],
161
+ "description": "Which the recipient did. Reported rather than left to be inferred from the request, so that a response is complete evidence on its own: `committed` says the agent was replaced, `preview` says it was not."
162
+ },
163
+ "sourceDid": {
164
+ "type": "string",
165
+ "minLength": 1,
166
+ "maxLength": 2048,
167
+ "description": "Identifier of the agent the bundle was exported from. The one identifier a preview returns, because the common import error is a valid bundle from the wrong agent and this is what shows it. Absent where the bundle does not record one."
168
+ },
169
+ "keyCount": {
170
+ "type": "integer",
171
+ "minimum": 0,
172
+ "description": "How many keys the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
173
+ },
174
+ "aclCount": {
175
+ "type": "integer",
176
+ "minimum": 0,
177
+ "description": "How many access-control entries the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
178
+ },
179
+ "contextCount": {
180
+ "type": "integer",
181
+ "minimum": 0,
182
+ "description": "How many trust contexts the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
183
+ },
184
+ "auditCount": {
185
+ "type": "integer",
186
+ "minimum": 0,
187
+ "description": "How many audit entries the bundle holds. Zero for a bundle exported without its trail, which is a legitimate outcome and not a sign of a truncated bundle."
188
+ },
189
+ "importedSecretCount": {
190
+ "type": "integer",
191
+ "minimum": 0,
192
+ "description": "How many secrets the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
193
+ },
194
+ "message": {
195
+ "type": "string",
196
+ "maxLength": 1024,
197
+ "description": "Operator-facing text elaborating on the outcome. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put bundle contents or a secret in it."
198
+ },
199
+ "ext": {
200
+ "$ref": "#/$defs/Ext",
201
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
202
+ }
203
+ }
204
+ },
205
+ "Ext": {
206
+ "title": "Ext",
207
+ "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.",
208
+ "type": "object",
209
+ "minProperties": 1,
210
+ "additionalProperties": true,
211
+ "propertyNames": {
212
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
213
+ }
214
+ }
215
+ }
216
+ } as const;
217
+
218
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
219
+ export const RESPONSE_PAYLOAD_SCHEMA = {
220
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
221
+ "$ref": "#/$defs/Response",
222
+ "$defs": {
223
+ "Response": {
224
+ "$anchor": "response",
225
+ "title": "VTA Backup Finalize Import — response payload",
226
+ "type": "object",
227
+ "additionalProperties": false,
228
+ "description": "Counts and a status, never contents. This document is the operator-held record of a replacement the agent's own trail no longer describes.",
229
+ "required": [
230
+ "bundleId",
231
+ "status",
232
+ "keyCount",
233
+ "aclCount",
234
+ "contextCount",
235
+ "auditCount"
236
+ ],
237
+ "properties": {
238
+ "bundleId": {
239
+ "type": "string",
240
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
241
+ "description": "Echoed so the response stands alone as a record."
242
+ },
243
+ "status": {
244
+ "type": "string",
245
+ "enum": [
246
+ "preview",
247
+ "committed"
248
+ ],
249
+ "description": "Which the recipient did. Reported rather than left to be inferred from the request, so that a response is complete evidence on its own: `committed` says the agent was replaced, `preview` says it was not."
250
+ },
251
+ "sourceDid": {
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "maxLength": 2048,
255
+ "description": "Identifier of the agent the bundle was exported from. The one identifier a preview returns, because the common import error is a valid bundle from the wrong agent and this is what shows it. Absent where the bundle does not record one."
256
+ },
257
+ "keyCount": {
258
+ "type": "integer",
259
+ "minimum": 0,
260
+ "description": "How many keys the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
261
+ },
262
+ "aclCount": {
263
+ "type": "integer",
264
+ "minimum": 0,
265
+ "description": "How many access-control entries the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
266
+ },
267
+ "contextCount": {
268
+ "type": "integer",
269
+ "minimum": 0,
270
+ "description": "How many trust contexts the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
271
+ },
272
+ "auditCount": {
273
+ "type": "integer",
274
+ "minimum": 0,
275
+ "description": "How many audit entries the bundle holds. Zero for a bundle exported without its trail, which is a legitimate outcome and not a sign of a truncated bundle."
276
+ },
277
+ "importedSecretCount": {
278
+ "type": "integer",
279
+ "minimum": 0,
280
+ "description": "How many secrets the bundle holds. A count, not an inventory — enough to recognise a bundle as plausibly the right one, and not enough to learn what is in it."
281
+ },
282
+ "message": {
283
+ "type": "string",
284
+ "maxLength": 1024,
285
+ "description": "Operator-facing text elaborating on the outcome. Advisory: a producer must not parse it or derive behaviour from it, and a recipient must not put bundle contents or a secret in it."
286
+ },
287
+ "ext": {
288
+ "$ref": "#/$defs/Ext",
289
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
290
+ }
291
+ }
292
+ },
293
+ "Ext": {
294
+ "title": "Ext",
295
+ "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.",
296
+ "type": "object",
297
+ "minProperties": 1,
298
+ "additionalProperties": true,
299
+ "propertyNames": {
300
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
301
+ }
302
+ }
303
+ }
304
+ } as const;
305
+
306
+ /**
307
+ * SPEC.md §7.2 policy for the request variant, from this specification's
308
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
309
+ * per-specification and cannot be derived from the document alone, and
310
+ * item 2 needs the schema this carries.
311
+ */
312
+ export const SPEC = {
313
+ typeUri: TYPE_URI,
314
+ isBearer: false,
315
+ isProofRequired: true,
316
+ isRecipientRequired: true,
317
+ isIssuedAtRequired: true,
318
+ payloadSchema: PAYLOAD_SCHEMA,
319
+ } as const;
320
+
321
+ /**
322
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
323
+ * tracks the *issuer* party's requirement because a response swaps the
324
+ * parties (§7.3 item 5).
325
+ */
326
+ export const RESPONSE_SPEC = {
327
+ typeUri: RESPONSE_TYPE_URI,
328
+ isBearer: false,
329
+ isProofRequired: true,
330
+ isRecipientRequired: true,
331
+ isIssuedAtRequired: true,
332
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
333
+ } as const;