@openvtc/trust-tasks 0.26.10 → 0.26.12

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 (84) hide show
  1. package/CHANGELOG.md +351 -0
  2. package/dist/_shared/components.d.ts +18 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +14 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +14 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/rooms/keys/act/0.2/payload.d.ts +546 -0
  9. package/dist/rooms/keys/act/0.2/payload.d.ts.map +1 -0
  10. package/dist/rooms/keys/act/0.2/payload.js +305 -0
  11. package/dist/rooms/keys/act/0.2/payload.js.map +1 -0
  12. package/dist/rooms/keys/act/0.3/payload.d.ts +546 -0
  13. package/dist/rooms/keys/act/0.3/payload.d.ts.map +1 -0
  14. package/dist/rooms/keys/act/0.3/payload.js +305 -0
  15. package/dist/rooms/keys/act/0.3/payload.js.map +1 -0
  16. package/dist/rooms/keys/file-key/0.2/payload.d.ts +306 -0
  17. package/dist/rooms/keys/file-key/0.2/payload.d.ts.map +1 -0
  18. package/dist/rooms/keys/file-key/0.2/payload.js +167 -0
  19. package/dist/rooms/keys/file-key/0.2/payload.js.map +1 -0
  20. package/dist/rooms/keys/open/0.2/payload.d.ts +323 -0
  21. package/dist/rooms/keys/open/0.2/payload.d.ts.map +1 -0
  22. package/dist/rooms/keys/open/0.2/payload.js +171 -0
  23. package/dist/rooms/keys/open/0.2/payload.js.map +1 -0
  24. package/dist/rooms/owner/group/add/0.2/payload.d.ts +417 -0
  25. package/dist/rooms/owner/group/add/0.2/payload.d.ts.map +1 -0
  26. package/dist/rooms/owner/group/add/0.2/payload.js +218 -0
  27. package/dist/rooms/owner/group/add/0.2/payload.js.map +1 -0
  28. package/dist/vta/_shared/0.6/witness-party.d.ts +16 -0
  29. package/dist/vta/_shared/0.6/witness-party.d.ts.map +1 -0
  30. package/dist/vta/_shared/0.6/witness-party.js +6 -0
  31. package/dist/vta/_shared/0.6/witness-party.js.map +1 -0
  32. package/dist/vta/witness/accept/0.2/payload.d.ts +499 -0
  33. package/dist/vta/witness/accept/0.2/payload.d.ts.map +1 -0
  34. package/dist/vta/witness/accept/0.2/payload.js +278 -0
  35. package/dist/vta/witness/accept/0.2/payload.js.map +1 -0
  36. package/dist/vta/witness/open/0.2/payload.d.ts +500 -0
  37. package/dist/vta/witness/open/0.2/payload.d.ts.map +1 -0
  38. package/dist/vta/witness/open/0.2/payload.js +259 -0
  39. package/dist/vta/witness/open/0.2/payload.js.map +1 -0
  40. package/dist/vta/witness/present/0.2/payload.d.ts +303 -0
  41. package/dist/vta/witness/present/0.2/payload.d.ts.map +1 -0
  42. package/dist/vta/witness/present/0.2/payload.js +170 -0
  43. package/dist/vta/witness/present/0.2/payload.js.map +1 -0
  44. package/dist/vtc/members/personhood/assert/0.2/payload.d.ts +536 -0
  45. package/dist/vtc/members/personhood/assert/0.2/payload.d.ts.map +1 -0
  46. package/dist/vtc/members/personhood/assert/0.2/payload.js +228 -0
  47. package/dist/vtc/members/personhood/assert/0.2/payload.js.map +1 -0
  48. package/dist/vtc/members/registry-consent/0.1/payload.d.ts +311 -0
  49. package/dist/vtc/members/registry-consent/0.1/payload.d.ts.map +1 -0
  50. package/dist/vtc/members/registry-consent/0.1/payload.js +183 -0
  51. package/dist/vtc/members/registry-consent/0.1/payload.js.map +1 -0
  52. package/dist/vtc/members/update/0.1/payload.d.ts +3 -3
  53. package/dist/vtc/members/update/0.1/payload.js +1 -1
  54. package/dist/vtc/members/update/0.1/payload.js.map +1 -1
  55. package/dist/witness/_shared/0.1/outcome-evidence.d.ts +16 -0
  56. package/dist/witness/_shared/0.1/outcome-evidence.d.ts.map +1 -0
  57. package/dist/witness/_shared/0.1/outcome-evidence.js +6 -0
  58. package/dist/witness/_shared/0.1/outcome-evidence.js.map +1 -0
  59. package/dist/witness/session/0.2/payload.d.ts +274 -0
  60. package/dist/witness/session/0.2/payload.d.ts.map +1 -0
  61. package/dist/witness/session/0.2/payload.js +152 -0
  62. package/dist/witness/session/0.2/payload.js.map +1 -0
  63. package/dist/witness/session/submit/0.2/payload.d.ts +295 -0
  64. package/dist/witness/session/submit/0.2/payload.d.ts.map +1 -0
  65. package/dist/witness/session/submit/0.2/payload.js +166 -0
  66. package/dist/witness/session/submit/0.2/payload.js.map +1 -0
  67. package/package.json +1 -1
  68. package/src/_shared/components.ts +17 -0
  69. package/src/index.ts +14 -0
  70. package/src/rooms/keys/act/0.2/payload.ts +380 -0
  71. package/src/rooms/keys/act/0.3/payload.ts +380 -0
  72. package/src/rooms/keys/file-key/0.2/payload.ts +224 -0
  73. package/src/rooms/keys/open/0.2/payload.ts +237 -0
  74. package/src/rooms/owner/group/add/0.2/payload.ts +288 -0
  75. package/src/vta/_shared/0.6/witness-party.ts +17 -0
  76. package/src/vta/witness/accept/0.2/payload.ts +330 -0
  77. package/src/vta/witness/open/0.2/payload.ts +336 -0
  78. package/src/vta/witness/present/0.2/payload.ts +210 -0
  79. package/src/vtc/members/personhood/assert/0.2/payload.ts +421 -0
  80. package/src/vtc/members/registry-consent/0.1/payload.ts +231 -0
  81. package/src/vtc/members/update/0.1/payload.ts +2 -2
  82. package/src/witness/_shared/0.1/outcome-evidence.ts +17 -0
  83. package/src/witness/session/0.2/payload.ts +197 -0
  84. package/src/witness/session/submit/0.2/payload.ts +212 -0
@@ -0,0 +1,330 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/witness/accept/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { CarriedDocument, DigestMultibase, EvidenceDocument, Ext, OutcomeEvidence, SessionId } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A client hands its VTA the witness's answer to the submission; the VTA verifies the Verifiable Witness Credential it carries against the session, and stores it in the credential vault with its evidence.
11
+ */
12
+ export interface VTAWitnessAcceptPayload {
13
+ sessionId: SessionId;
14
+ /**
15
+ * The witness/session/submit/0.2 #response the witness returned, exactly as received, under the witness's proof. It carries the VWC and its vwcDigestMultibase.
16
+ */
17
+ response: CarriedDocument;
18
+ ext?: Ext;
19
+ }
20
+ /**
21
+ * The stored VWC's vault handle, its digest, and the evidence documents that carry it. Sent only once the VWC is verified and stored.
22
+ */
23
+ export interface VTAWitnessAcceptResponsePayload {
24
+ sessionId: SessionId;
25
+ /**
26
+ * The credential-vault handle the VWC is now stored under, with its evidence.
27
+ */
28
+ credentialId: string;
29
+ /**
30
+ * The witness that issued the VWC: the session's witness, since a VWC issued by any other party is refused, not stored.
31
+ */
32
+ witness: string;
33
+ /**
34
+ * The digest the witness returned for the VWC, which the VTA has checked against the VWC it stored: over the RFC 8785 canonicalization of the VWC, proof included.
35
+ */
36
+ vwcDigestMultibase: DigestMultibase;
37
+ /**
38
+ * The two documents a holder ships with the VWC so a verifier can pair it with the session that produced it: `session`, the witness/session/0.2 document as the VTA built it, and `outcome`, the witness/session/submit/0.2 #response as received, which carries the VWC. Each is carried exactly as sent or received, never re-serialised.
39
+ */
40
+ evidence: OutcomeEvidence;
41
+ ext?: Ext;
42
+ }
43
+
44
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
45
+ export type { CarriedDocument, DigestMultibase, EvidenceDocument, Ext, OutcomeEvidence, SessionId };
46
+
47
+ /** Trust Task type URI. */
48
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/witness/accept/0.2" as const;
49
+
50
+ /** Stable alias for this specification's request payload shape. */
51
+ export type Payload = VTAWitnessAcceptPayload;
52
+
53
+ /** Trust Task response type URI (request type URI + "#response"). */
54
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/witness/accept/0.2#response" as const;
55
+
56
+ /** Stable alias for this specification's success-response payload shape. */
57
+ export type Response = VTAWitnessAcceptResponsePayload;
58
+
59
+ /**
60
+ * This specification's payload schema, as a value.
61
+ *
62
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
63
+ * rather than only as a `.json` file because TypeScript types are erased
64
+ * at runtime: without a schema a consumer has nothing to validate, and
65
+ * every REQUIRED payload member is optional in practice. Cross-file
66
+ * `$ref`s are already inlined, so it needs no resolver.
67
+ */
68
+ export const PAYLOAD_SCHEMA = {
69
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
70
+ "$id": "https://trusttasks.org/spec/vta/witness/accept/0.2",
71
+ "title": "VTA Witness — Accept — payload",
72
+ "description": "A client hands its VTA the witness's answer to the submission; the VTA verifies the Verifiable Witness Credential it carries against the session, and stores it in the credential vault with its evidence.",
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": [
76
+ "sessionId",
77
+ "response"
78
+ ],
79
+ "properties": {
80
+ "sessionId": {
81
+ "$ref": "#/$defs/SessionId"
82
+ },
83
+ "response": {
84
+ "$ref": "#/$defs/CarriedDocument",
85
+ "description": "The witness/session/submit/0.2 #response the witness returned, exactly as received, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
86
+ },
87
+ "ext": {
88
+ "$ref": "#/$defs/Ext"
89
+ }
90
+ },
91
+ "$defs": {
92
+ "Response": {
93
+ "$anchor": "response",
94
+ "title": "VTA Witness — Accept — response payload",
95
+ "description": "The stored VWC's vault handle, its digest, and the evidence documents that carry it. Sent only once the VWC is verified and stored.",
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "required": [
99
+ "sessionId",
100
+ "credentialId",
101
+ "witness",
102
+ "vwcDigestMultibase",
103
+ "evidence"
104
+ ],
105
+ "properties": {
106
+ "sessionId": {
107
+ "$ref": "#/$defs/SessionId"
108
+ },
109
+ "credentialId": {
110
+ "type": "string",
111
+ "minLength": 1,
112
+ "maxLength": 256,
113
+ "description": "The credential-vault handle the VWC is now stored under, with its evidence."
114
+ },
115
+ "witness": {
116
+ "type": "string",
117
+ "pattern": "^did:",
118
+ "description": "The witness that issued the VWC: the session's witness, since a VWC issued by any other party is refused, not stored."
119
+ },
120
+ "vwcDigestMultibase": {
121
+ "$ref": "#/$defs/DigestMultibase",
122
+ "description": "The digest the witness returned for the VWC, which the VTA has checked against the VWC it stored: over the RFC 8785 canonicalization of the VWC, proof included."
123
+ },
124
+ "evidence": {
125
+ "$ref": "#/$defs/OutcomeEvidence",
126
+ "description": "The two documents a holder ships with the VWC so a verifier can pair it with the session that produced it: `session`, the witness/session/0.2 document as the VTA built it, and `outcome`, the witness/session/submit/0.2 #response as received, which carries the VWC. Each is carried exactly as sent or received, never re-serialised."
127
+ },
128
+ "ext": {
129
+ "$ref": "#/$defs/Ext"
130
+ }
131
+ }
132
+ },
133
+ "Ext": {
134
+ "title": "Ext",
135
+ "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.",
136
+ "type": "object",
137
+ "minProperties": 1,
138
+ "additionalProperties": true,
139
+ "propertyNames": {
140
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
141
+ }
142
+ },
143
+ "OutcomeEvidence": {
144
+ "title": "OutcomeEvidence",
145
+ "description": "One witnessing session's outcome evidence. `session` is the initiating witness/session document; `outcome` is the terminal witness/session/submit #response that the initiating document's own specification declares as its outcome evidence, under the witness's proof, delivering the VWC and its vwcDigestMultibase. A consumer pairs them with a presented VWC by SPEC §4.9.4's four checks and the witnessing checks of witness/session/submit (This response is the outcome evidence).",
146
+ "type": "object",
147
+ "additionalProperties": false,
148
+ "required": [
149
+ "session",
150
+ "outcome"
151
+ ],
152
+ "properties": {
153
+ "session": {
154
+ "$ref": "#/$defs/EvidenceDocument",
155
+ "description": "The witness/session document that opened the session. The VWC's taskContext is its id and its taskDigestMultibase is computed over it (SPEC §4.9.3)."
156
+ },
157
+ "outcome": {
158
+ "$ref": "#/$defs/EvidenceDocument",
159
+ "description": "The witness/session/submit #response that closed the session, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
160
+ }
161
+ }
162
+ },
163
+ "EvidenceDocument": {
164
+ "title": "EvidenceDocument",
165
+ "description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried exactly as it was sent or received, never re-serialised: a task digest and a proof are taken over its members, and a re-serialised copy reproduces neither reliably. Typed as an open object so every member survives; the checks that give it meaning belong to the task that reads it.",
166
+ "type": "object",
167
+ "minProperties": 1
168
+ },
169
+ "DigestMultibase": {
170
+ "title": "DigestMultibase",
171
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
172
+ "type": "string",
173
+ "minLength": 16,
174
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
175
+ "examples": [
176
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
177
+ ]
178
+ },
179
+ "SessionId": {
180
+ "title": "SessionId",
181
+ "description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
182
+ "type": "string",
183
+ "minLength": 1,
184
+ "maxLength": 256
185
+ },
186
+ "CarriedDocument": {
187
+ "title": "CarriedDocument",
188
+ "description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
189
+ "type": "object",
190
+ "minProperties": 1
191
+ }
192
+ }
193
+ } as const;
194
+
195
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
196
+ export const RESPONSE_PAYLOAD_SCHEMA = {
197
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
198
+ "$ref": "#/$defs/Response",
199
+ "$defs": {
200
+ "Response": {
201
+ "$anchor": "response",
202
+ "title": "VTA Witness — Accept — response payload",
203
+ "description": "The stored VWC's vault handle, its digest, and the evidence documents that carry it. Sent only once the VWC is verified and stored.",
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": [
207
+ "sessionId",
208
+ "credentialId",
209
+ "witness",
210
+ "vwcDigestMultibase",
211
+ "evidence"
212
+ ],
213
+ "properties": {
214
+ "sessionId": {
215
+ "$ref": "#/$defs/SessionId"
216
+ },
217
+ "credentialId": {
218
+ "type": "string",
219
+ "minLength": 1,
220
+ "maxLength": 256,
221
+ "description": "The credential-vault handle the VWC is now stored under, with its evidence."
222
+ },
223
+ "witness": {
224
+ "type": "string",
225
+ "pattern": "^did:",
226
+ "description": "The witness that issued the VWC: the session's witness, since a VWC issued by any other party is refused, not stored."
227
+ },
228
+ "vwcDigestMultibase": {
229
+ "$ref": "#/$defs/DigestMultibase",
230
+ "description": "The digest the witness returned for the VWC, which the VTA has checked against the VWC it stored: over the RFC 8785 canonicalization of the VWC, proof included."
231
+ },
232
+ "evidence": {
233
+ "$ref": "#/$defs/OutcomeEvidence",
234
+ "description": "The two documents a holder ships with the VWC so a verifier can pair it with the session that produced it: `session`, the witness/session/0.2 document as the VTA built it, and `outcome`, the witness/session/submit/0.2 #response as received, which carries the VWC. Each is carried exactly as sent or received, never re-serialised."
235
+ },
236
+ "ext": {
237
+ "$ref": "#/$defs/Ext"
238
+ }
239
+ }
240
+ },
241
+ "Ext": {
242
+ "title": "Ext",
243
+ "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.",
244
+ "type": "object",
245
+ "minProperties": 1,
246
+ "additionalProperties": true,
247
+ "propertyNames": {
248
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
249
+ }
250
+ },
251
+ "OutcomeEvidence": {
252
+ "title": "OutcomeEvidence",
253
+ "description": "One witnessing session's outcome evidence. `session` is the initiating witness/session document; `outcome` is the terminal witness/session/submit #response that the initiating document's own specification declares as its outcome evidence, under the witness's proof, delivering the VWC and its vwcDigestMultibase. A consumer pairs them with a presented VWC by SPEC §4.9.4's four checks and the witnessing checks of witness/session/submit (This response is the outcome evidence).",
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "required": [
257
+ "session",
258
+ "outcome"
259
+ ],
260
+ "properties": {
261
+ "session": {
262
+ "$ref": "#/$defs/EvidenceDocument",
263
+ "description": "The witness/session document that opened the session. The VWC's taskContext is its id and its taskDigestMultibase is computed over it (SPEC §4.9.3)."
264
+ },
265
+ "outcome": {
266
+ "$ref": "#/$defs/EvidenceDocument",
267
+ "description": "The witness/session/submit #response that closed the session, under the witness's proof. It carries the VWC and its vwcDigestMultibase."
268
+ }
269
+ }
270
+ },
271
+ "EvidenceDocument": {
272
+ "title": "EvidenceDocument",
273
+ "description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried exactly as it was sent or received, never re-serialised: a task digest and a proof are taken over its members, and a re-serialised copy reproduces neither reliably. Typed as an open object so every member survives; the checks that give it meaning belong to the task that reads it.",
274
+ "type": "object",
275
+ "minProperties": 1
276
+ },
277
+ "DigestMultibase": {
278
+ "title": "DigestMultibase",
279
+ "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
280
+ "type": "string",
281
+ "minLength": 16,
282
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
283
+ "examples": [
284
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
285
+ ]
286
+ },
287
+ "SessionId": {
288
+ "title": "SessionId",
289
+ "description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
290
+ "type": "string",
291
+ "minLength": 1,
292
+ "maxLength": 256
293
+ },
294
+ "CarriedDocument": {
295
+ "title": "CarriedDocument",
296
+ "description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
297
+ "type": "object",
298
+ "minProperties": 1
299
+ }
300
+ }
301
+ } as const;
302
+
303
+ /**
304
+ * SPEC.md §7.2 policy for the request variant, from this specification's
305
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
306
+ * per-specification and cannot be derived from the document alone, and
307
+ * item 2 needs the schema this carries.
308
+ */
309
+ export const SPEC = {
310
+ typeUri: TYPE_URI,
311
+ isBearer: false,
312
+ isProofRequired: true,
313
+ isRecipientRequired: true,
314
+ isIssuedAtRequired: true,
315
+ payloadSchema: PAYLOAD_SCHEMA,
316
+ } as const;
317
+
318
+ /**
319
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
320
+ * tracks the *issuer* party's requirement because a response swaps the
321
+ * parties (§7.3 item 5).
322
+ */
323
+ export const RESPONSE_SPEC = {
324
+ typeUri: RESPONSE_TYPE_URI,
325
+ isBearer: false,
326
+ isProofRequired: false,
327
+ isRecipientRequired: true,
328
+ isIssuedAtRequired: true,
329
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
330
+ } as const;
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/witness/open/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { CarriedDocument, Ext, SessionId } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A client asks its VTA to open a witnessed session for one of its principal's relationships: the VTA checks custody and the credentials to be presented, and returns the witness/session document, built and signed as the principal's relationship DID, for the client to send to the witness.
11
+ */
12
+ export interface VTAWitnessOpenPayload {
13
+ /**
14
+ * The witness to be witnessed by, as its public DID: the recipient of every document of the session, and the issuer of every answer the VTA will accept for it. Chosen by the caller, because which witness observes an exchange is the parties' privacy decision.
15
+ */
16
+ witness: string;
17
+ /**
18
+ * The principal's relationship DID for this relationship: the participating party, the issuer of every document of the session, and the DID the client sends them from. The VTA must hold a key of it in a context the caller may act in.
19
+ */
20
+ relationshipDid: string;
21
+ /**
22
+ * The other party's relationship DID. With relationshipDid it forms the session's `parties`, and it is the subject of the relationship credential presented.
23
+ */
24
+ counterpartyDid: string;
25
+ /**
26
+ * The threadId of the relationship exchange the session is nested in, set as `parentThreadId` on every document of the session, as witness/session requires of a producer.
27
+ */
28
+ relationshipThreadId: string;
29
+ /**
30
+ * The credential-vault handle of the relationship credential (VRC) to present: issued by relationshipDid, naming counterpartyDid. Bound to the session here, so a later step cannot present another.
31
+ */
32
+ relationshipCredentialId: string;
33
+ membership?: Membership;
34
+ /**
35
+ * The credential-vault handle to store the VWC under at vta/witness/accept. Absent, the VTA derives one.
36
+ */
37
+ storeAs?: string;
38
+ ext?: Ext;
39
+ }
40
+ /**
41
+ * The membership evidence to present beside the relationship credential, for a witness whose policy asks for it. Absent, none is presented. Bound to the session here.
42
+ */
43
+ export interface Membership {
44
+ /**
45
+ * The credential-vault handle of the membership credential.
46
+ */
47
+ credentialId: string;
48
+ /**
49
+ * The member DID the membership credential names, when it is not relationshipDid. The VTA must hold a key of it in a context the caller may act in. Naming it is the caller's explicit choice to disclose it to the witness.
50
+ */
51
+ memberDid?: string;
52
+ }
53
+ /**
54
+ * The session id and the witness/session document to send.
55
+ */
56
+ export interface VTAWitnessOpenResponsePayload {
57
+ sessionId: SessionId;
58
+ /**
59
+ * The witness/session/0.2 document, issued and signed by relationshipDid and addressed to the witness, for the client to send from relationshipDid unaltered. Its id is sessionId.
60
+ */
61
+ document: CarriedDocument;
62
+ /**
63
+ * When the VTA's record of the session expires. The client must hand back the witness's answers before then.
64
+ */
65
+ expiresAt: string;
66
+ ext?: Ext;
67
+ }
68
+
69
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
70
+ export type { CarriedDocument, Ext, SessionId };
71
+
72
+ /** Trust Task type URI. */
73
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/witness/open/0.2" as const;
74
+
75
+ /** Stable alias for this specification's request payload shape. */
76
+ export type Payload = VTAWitnessOpenPayload;
77
+
78
+ /** Trust Task response type URI (request type URI + "#response"). */
79
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/witness/open/0.2#response" as const;
80
+
81
+ /** Stable alias for this specification's success-response payload shape. */
82
+ export type Response = VTAWitnessOpenResponsePayload;
83
+
84
+ /**
85
+ * This specification's payload schema, as a value.
86
+ *
87
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
88
+ * rather than only as a `.json` file because TypeScript types are erased
89
+ * at runtime: without a schema a consumer has nothing to validate, and
90
+ * every REQUIRED payload member is optional in practice. Cross-file
91
+ * `$ref`s are already inlined, so it needs no resolver.
92
+ */
93
+ export const PAYLOAD_SCHEMA = {
94
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
95
+ "$id": "https://trusttasks.org/spec/vta/witness/open/0.2",
96
+ "title": "VTA Witness — Open — payload",
97
+ "description": "A client asks its VTA to open a witnessed session for one of its principal's relationships: the VTA checks custody and the credentials to be presented, and returns the witness/session document, built and signed as the principal's relationship DID, for the client to send to the witness.",
98
+ "type": "object",
99
+ "additionalProperties": false,
100
+ "required": [
101
+ "witness",
102
+ "relationshipDid",
103
+ "counterpartyDid",
104
+ "relationshipThreadId",
105
+ "relationshipCredentialId"
106
+ ],
107
+ "properties": {
108
+ "witness": {
109
+ "type": "string",
110
+ "pattern": "^did:",
111
+ "description": "The witness to be witnessed by, as its public DID: the recipient of every document of the session, and the issuer of every answer the VTA will accept for it. Chosen by the caller, because which witness observes an exchange is the parties' privacy decision."
112
+ },
113
+ "relationshipDid": {
114
+ "type": "string",
115
+ "pattern": "^did:",
116
+ "description": "The principal's relationship DID for this relationship: the participating party, the issuer of every document of the session, and the DID the client sends them from. The VTA must hold a key of it in a context the caller may act in."
117
+ },
118
+ "counterpartyDid": {
119
+ "type": "string",
120
+ "pattern": "^did:",
121
+ "description": "The other party's relationship DID. With relationshipDid it forms the session's `parties`, and it is the subject of the relationship credential presented."
122
+ },
123
+ "relationshipThreadId": {
124
+ "type": "string",
125
+ "minLength": 1,
126
+ "maxLength": 256,
127
+ "description": "The threadId of the relationship exchange the session is nested in, set as `parentThreadId` on every document of the session, as witness/session requires of a producer."
128
+ },
129
+ "relationshipCredentialId": {
130
+ "type": "string",
131
+ "minLength": 1,
132
+ "maxLength": 256,
133
+ "description": "The credential-vault handle of the relationship credential (VRC) to present: issued by relationshipDid, naming counterpartyDid. Bound to the session here, so a later step cannot present another."
134
+ },
135
+ "membership": {
136
+ "$ref": "#/$defs/Membership",
137
+ "description": "The membership evidence to present beside the relationship credential, for a witness whose policy asks for it. Absent, none is presented. Bound to the session here."
138
+ },
139
+ "storeAs": {
140
+ "type": "string",
141
+ "minLength": 1,
142
+ "maxLength": 256,
143
+ "description": "The credential-vault handle to store the VWC under at vta/witness/accept. Absent, the VTA derives one."
144
+ },
145
+ "ext": {
146
+ "$ref": "#/$defs/Ext"
147
+ }
148
+ },
149
+ "$defs": {
150
+ "Membership": {
151
+ "title": "Membership",
152
+ "description": "A membership credential (VMC) held in the credential vault, and the DID it names. When memberDid is absent the VMC names relationshipDid and rides in the relationship presentation. When memberDid is present the VMC names that DID, and the VTA builds a second presentation — the member presentation, carried in witness/session/submit/0.2's memberPresentation — signed by memberDid and bound to the same session, which discloses memberDid to the witness.",
153
+ "type": "object",
154
+ "additionalProperties": false,
155
+ "required": [
156
+ "credentialId"
157
+ ],
158
+ "properties": {
159
+ "credentialId": {
160
+ "type": "string",
161
+ "minLength": 1,
162
+ "maxLength": 256,
163
+ "description": "The credential-vault handle of the membership credential."
164
+ },
165
+ "memberDid": {
166
+ "type": "string",
167
+ "pattern": "^did:",
168
+ "description": "The member DID the membership credential names, when it is not relationshipDid. The VTA must hold a key of it in a context the caller may act in. Naming it is the caller's explicit choice to disclose it to the witness."
169
+ }
170
+ }
171
+ },
172
+ "Response": {
173
+ "$anchor": "response",
174
+ "title": "VTA Witness — Open — response payload",
175
+ "description": "The session id and the witness/session document to send.",
176
+ "type": "object",
177
+ "additionalProperties": false,
178
+ "required": [
179
+ "sessionId",
180
+ "document",
181
+ "expiresAt"
182
+ ],
183
+ "properties": {
184
+ "sessionId": {
185
+ "$ref": "#/$defs/SessionId"
186
+ },
187
+ "document": {
188
+ "$ref": "#/$defs/CarriedDocument",
189
+ "description": "The witness/session/0.2 document, issued and signed by relationshipDid and addressed to the witness, for the client to send from relationshipDid unaltered. Its id is sessionId."
190
+ },
191
+ "expiresAt": {
192
+ "type": "string",
193
+ "format": "date-time",
194
+ "description": "When the VTA's record of the session expires. The client must hand back the witness's answers before then."
195
+ },
196
+ "ext": {
197
+ "$ref": "#/$defs/Ext"
198
+ }
199
+ }
200
+ },
201
+ "Ext": {
202
+ "title": "Ext",
203
+ "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
+ "type": "object",
205
+ "minProperties": 1,
206
+ "additionalProperties": true,
207
+ "propertyNames": {
208
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
209
+ }
210
+ },
211
+ "CarriedDocument": {
212
+ "title": "CarriedDocument",
213
+ "description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
214
+ "type": "object",
215
+ "minProperties": 1
216
+ },
217
+ "SessionId": {
218
+ "title": "SessionId",
219
+ "description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
220
+ "type": "string",
221
+ "minLength": 1,
222
+ "maxLength": 256
223
+ }
224
+ }
225
+ } as const;
226
+
227
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
228
+ export const RESPONSE_PAYLOAD_SCHEMA = {
229
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
230
+ "$ref": "#/$defs/Response",
231
+ "$defs": {
232
+ "Membership": {
233
+ "title": "Membership",
234
+ "description": "A membership credential (VMC) held in the credential vault, and the DID it names. When memberDid is absent the VMC names relationshipDid and rides in the relationship presentation. When memberDid is present the VMC names that DID, and the VTA builds a second presentation — the member presentation, carried in witness/session/submit/0.2's memberPresentation — signed by memberDid and bound to the same session, which discloses memberDid to the witness.",
235
+ "type": "object",
236
+ "additionalProperties": false,
237
+ "required": [
238
+ "credentialId"
239
+ ],
240
+ "properties": {
241
+ "credentialId": {
242
+ "type": "string",
243
+ "minLength": 1,
244
+ "maxLength": 256,
245
+ "description": "The credential-vault handle of the membership credential."
246
+ },
247
+ "memberDid": {
248
+ "type": "string",
249
+ "pattern": "^did:",
250
+ "description": "The member DID the membership credential names, when it is not relationshipDid. The VTA must hold a key of it in a context the caller may act in. Naming it is the caller's explicit choice to disclose it to the witness."
251
+ }
252
+ }
253
+ },
254
+ "Response": {
255
+ "$anchor": "response",
256
+ "title": "VTA Witness — Open — response payload",
257
+ "description": "The session id and the witness/session document to send.",
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "required": [
261
+ "sessionId",
262
+ "document",
263
+ "expiresAt"
264
+ ],
265
+ "properties": {
266
+ "sessionId": {
267
+ "$ref": "#/$defs/SessionId"
268
+ },
269
+ "document": {
270
+ "$ref": "#/$defs/CarriedDocument",
271
+ "description": "The witness/session/0.2 document, issued and signed by relationshipDid and addressed to the witness, for the client to send from relationshipDid unaltered. Its id is sessionId."
272
+ },
273
+ "expiresAt": {
274
+ "type": "string",
275
+ "format": "date-time",
276
+ "description": "When the VTA's record of the session expires. The client must hand back the witness's answers before then."
277
+ },
278
+ "ext": {
279
+ "$ref": "#/$defs/Ext"
280
+ }
281
+ }
282
+ },
283
+ "Ext": {
284
+ "title": "Ext",
285
+ "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.",
286
+ "type": "object",
287
+ "minProperties": 1,
288
+ "additionalProperties": true,
289
+ "propertyNames": {
290
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
291
+ }
292
+ },
293
+ "CarriedDocument": {
294
+ "title": "CarriedDocument",
295
+ "description": "A whole Trust Task document — `id`, `type`, `payload` and every other member, `proof` included — carried between the VTA and the witness by the client: one the VTA built and signed for the client to send, or one the witness returned for the client to hand back. Typed as an open object so every member survives a round trip: carried exactly as built or received, never re-serialised, because its proof is over itself. Its envelope is checked by the VTA against the session record (CONVENTIONS.md §3), not by this schema.",
296
+ "type": "object",
297
+ "minProperties": 1
298
+ },
299
+ "SessionId": {
300
+ "title": "SessionId",
301
+ "description": "The id of the witness/session document the VTA built in vta/witness/open: the session's name, the thread every document of the session is on, and the value the VWC carries as taskContext. The VTA keys its state for the session by it.",
302
+ "type": "string",
303
+ "minLength": 1,
304
+ "maxLength": 256
305
+ }
306
+ }
307
+ } as const;
308
+
309
+ /**
310
+ * SPEC.md §7.2 policy for the request variant, from this specification's
311
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
312
+ * per-specification and cannot be derived from the document alone, and
313
+ * item 2 needs the schema this carries.
314
+ */
315
+ export const SPEC = {
316
+ typeUri: TYPE_URI,
317
+ isBearer: false,
318
+ isProofRequired: true,
319
+ isRecipientRequired: true,
320
+ isIssuedAtRequired: true,
321
+ payloadSchema: PAYLOAD_SCHEMA,
322
+ } as const;
323
+
324
+ /**
325
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
326
+ * tracks the *issuer* party's requirement because a response swaps the
327
+ * parties (§7.3 item 5).
328
+ */
329
+ export const RESPONSE_SPEC = {
330
+ typeUri: RESPONSE_TYPE_URI,
331
+ isBearer: false,
332
+ isProofRequired: false,
333
+ isRecipientRequired: true,
334
+ isIssuedAtRequired: true,
335
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
336
+ } as const;