@openvtc/trust-tasks 0.26.11 → 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 (69) hide show
  1. package/CHANGELOG.md +274 -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 +11 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +11 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/rooms/keys/act/0.3/payload.d.ts +546 -0
  9. package/dist/rooms/keys/act/0.3/payload.d.ts.map +1 -0
  10. package/dist/rooms/keys/act/0.3/payload.js +305 -0
  11. package/dist/rooms/keys/act/0.3/payload.js.map +1 -0
  12. package/dist/rooms/owner/group/add/0.2/payload.d.ts +417 -0
  13. package/dist/rooms/owner/group/add/0.2/payload.d.ts.map +1 -0
  14. package/dist/rooms/owner/group/add/0.2/payload.js +218 -0
  15. package/dist/rooms/owner/group/add/0.2/payload.js.map +1 -0
  16. package/dist/vta/_shared/0.6/witness-party.d.ts +16 -0
  17. package/dist/vta/_shared/0.6/witness-party.d.ts.map +1 -0
  18. package/dist/vta/_shared/0.6/witness-party.js +6 -0
  19. package/dist/vta/_shared/0.6/witness-party.js.map +1 -0
  20. package/dist/vta/witness/accept/0.2/payload.d.ts +499 -0
  21. package/dist/vta/witness/accept/0.2/payload.d.ts.map +1 -0
  22. package/dist/vta/witness/accept/0.2/payload.js +278 -0
  23. package/dist/vta/witness/accept/0.2/payload.js.map +1 -0
  24. package/dist/vta/witness/open/0.2/payload.d.ts +500 -0
  25. package/dist/vta/witness/open/0.2/payload.d.ts.map +1 -0
  26. package/dist/vta/witness/open/0.2/payload.js +259 -0
  27. package/dist/vta/witness/open/0.2/payload.js.map +1 -0
  28. package/dist/vta/witness/present/0.2/payload.d.ts +303 -0
  29. package/dist/vta/witness/present/0.2/payload.d.ts.map +1 -0
  30. package/dist/vta/witness/present/0.2/payload.js +170 -0
  31. package/dist/vta/witness/present/0.2/payload.js.map +1 -0
  32. package/dist/vtc/members/personhood/assert/0.2/payload.d.ts +536 -0
  33. package/dist/vtc/members/personhood/assert/0.2/payload.d.ts.map +1 -0
  34. package/dist/vtc/members/personhood/assert/0.2/payload.js +228 -0
  35. package/dist/vtc/members/personhood/assert/0.2/payload.js.map +1 -0
  36. package/dist/vtc/members/registry-consent/0.1/payload.d.ts +311 -0
  37. package/dist/vtc/members/registry-consent/0.1/payload.d.ts.map +1 -0
  38. package/dist/vtc/members/registry-consent/0.1/payload.js +183 -0
  39. package/dist/vtc/members/registry-consent/0.1/payload.js.map +1 -0
  40. package/dist/vtc/members/update/0.1/payload.d.ts +3 -3
  41. package/dist/vtc/members/update/0.1/payload.js +1 -1
  42. package/dist/vtc/members/update/0.1/payload.js.map +1 -1
  43. package/dist/witness/_shared/0.1/outcome-evidence.d.ts +16 -0
  44. package/dist/witness/_shared/0.1/outcome-evidence.d.ts.map +1 -0
  45. package/dist/witness/_shared/0.1/outcome-evidence.js +6 -0
  46. package/dist/witness/_shared/0.1/outcome-evidence.js.map +1 -0
  47. package/dist/witness/session/0.2/payload.d.ts +274 -0
  48. package/dist/witness/session/0.2/payload.d.ts.map +1 -0
  49. package/dist/witness/session/0.2/payload.js +152 -0
  50. package/dist/witness/session/0.2/payload.js.map +1 -0
  51. package/dist/witness/session/submit/0.2/payload.d.ts +295 -0
  52. package/dist/witness/session/submit/0.2/payload.d.ts.map +1 -0
  53. package/dist/witness/session/submit/0.2/payload.js +166 -0
  54. package/dist/witness/session/submit/0.2/payload.js.map +1 -0
  55. package/package.json +1 -1
  56. package/src/_shared/components.ts +17 -0
  57. package/src/index.ts +11 -0
  58. package/src/rooms/keys/act/0.3/payload.ts +380 -0
  59. package/src/rooms/owner/group/add/0.2/payload.ts +288 -0
  60. package/src/vta/_shared/0.6/witness-party.ts +17 -0
  61. package/src/vta/witness/accept/0.2/payload.ts +330 -0
  62. package/src/vta/witness/open/0.2/payload.ts +336 -0
  63. package/src/vta/witness/present/0.2/payload.ts +210 -0
  64. package/src/vtc/members/personhood/assert/0.2/payload.ts +421 -0
  65. package/src/vtc/members/registry-consent/0.1/payload.ts +231 -0
  66. package/src/vtc/members/update/0.1/payload.ts +2 -2
  67. package/src/witness/_shared/0.1/outcome-evidence.ts +17 -0
  68. package/src/witness/session/0.2/payload.ts +197 -0
  69. package/src/witness/session/submit/0.2/payload.ts +212 -0
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/witness/session/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * Opens one participating party's witness session as its own exchange, nested in a relationship exchange via parentThreadId. A session is bilateral — a witnessed exchange between two parties runs two sessions with the same witness, each naming the same parties pair. The response issues the session challenge; the request document's id is the value that party's VWC later carries as taskContext.
11
+ */
12
+ export interface WitnessSessionPayload {
13
+ /**
14
+ * The relationship DIDs of the exchange to be witnessed — the pairwise values the relationship proposal exchanged, in either order.
15
+ *
16
+ * @minItems 2
17
+ * @maxItems 2
18
+ */
19
+ parties: [string, string];
20
+ ext?: Ext;
21
+ }
22
+ /**
23
+ * The session challenge, issued under the REQUIRED proof. The presentation under witness/session/submit binds to {challenge, domain}. It reaches only the party that opened this session — which is why each party opens its own.
24
+ */
25
+ export interface WitnessSessionResponsePayload {
26
+ /**
27
+ * A fresh, unpredictable, single-use value this session's presentation binds to. A witness MUST NOT reuse a challenge across sessions — including across the two sessions of one witnessed exchange, where a shared value would let either party's presentation satisfy the other's session.
28
+ */
29
+ challenge: string;
30
+ /**
31
+ * The domain the presentations bind alongside the challenge, identifying this witness's verification context.
32
+ */
33
+ domain: string;
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/witness/session/0.2" as const;
42
+
43
+ /** Stable alias for this specification's request payload shape. */
44
+ export type Payload = WitnessSessionPayload;
45
+
46
+ /** Trust Task response type URI (request type URI + "#response"). */
47
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/witness/session/0.2#response" as const;
48
+
49
+ /** Stable alias for this specification's success-response payload shape. */
50
+ export type Response = WitnessSessionResponsePayload;
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/witness/session/0.2",
64
+ "title": "Witness Session — payload",
65
+ "description": "Opens one participating party's witness session as its own exchange, nested in a relationship exchange via parentThreadId. A session is bilateral — a witnessed exchange between two parties runs two sessions with the same witness, each naming the same parties pair. The response issues the session challenge; the request document's id is the value that party's VWC later carries as taskContext.",
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": [
69
+ "parties"
70
+ ],
71
+ "properties": {
72
+ "parties": {
73
+ "type": "array",
74
+ "minItems": 2,
75
+ "maxItems": 2,
76
+ "items": {
77
+ "type": "string",
78
+ "pattern": "^did:"
79
+ },
80
+ "description": "The relationship DIDs of the exchange to be witnessed — the pairwise values the relationship proposal exchanged, in either order."
81
+ },
82
+ "ext": {
83
+ "$ref": "#/$defs/Ext"
84
+ }
85
+ },
86
+ "$defs": {
87
+ "Response": {
88
+ "$anchor": "response",
89
+ "title": "Witness Session — response payload",
90
+ "description": "The session challenge, issued under the REQUIRED proof. The presentation under witness/session/submit binds to {challenge, domain}. It reaches only the party that opened this session — which is why each party opens its own.",
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": [
94
+ "challenge",
95
+ "domain"
96
+ ],
97
+ "properties": {
98
+ "challenge": {
99
+ "type": "string",
100
+ "minLength": 16,
101
+ "description": "A fresh, unpredictable, single-use value this session's presentation binds to. A witness MUST NOT reuse a challenge across sessions — including across the two sessions of one witnessed exchange, where a shared value would let either party's presentation satisfy the other's session."
102
+ },
103
+ "domain": {
104
+ "type": "string",
105
+ "minLength": 1,
106
+ "description": "The domain the presentations bind alongside the challenge, identifying this witness's verification context."
107
+ },
108
+ "ext": {
109
+ "$ref": "#/$defs/Ext"
110
+ }
111
+ }
112
+ },
113
+ "Ext": {
114
+ "title": "Ext",
115
+ "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.",
116
+ "type": "object",
117
+ "minProperties": 1,
118
+ "additionalProperties": true,
119
+ "propertyNames": {
120
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
121
+ }
122
+ }
123
+ }
124
+ } as const;
125
+
126
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
127
+ export const RESPONSE_PAYLOAD_SCHEMA = {
128
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
129
+ "$ref": "#/$defs/Response",
130
+ "$defs": {
131
+ "Response": {
132
+ "$anchor": "response",
133
+ "title": "Witness Session — response payload",
134
+ "description": "The session challenge, issued under the REQUIRED proof. The presentation under witness/session/submit binds to {challenge, domain}. It reaches only the party that opened this session — which is why each party opens its own.",
135
+ "type": "object",
136
+ "additionalProperties": false,
137
+ "required": [
138
+ "challenge",
139
+ "domain"
140
+ ],
141
+ "properties": {
142
+ "challenge": {
143
+ "type": "string",
144
+ "minLength": 16,
145
+ "description": "A fresh, unpredictable, single-use value this session's presentation binds to. A witness MUST NOT reuse a challenge across sessions — including across the two sessions of one witnessed exchange, where a shared value would let either party's presentation satisfy the other's session."
146
+ },
147
+ "domain": {
148
+ "type": "string",
149
+ "minLength": 1,
150
+ "description": "The domain the presentations bind alongside the challenge, identifying this witness's verification context."
151
+ },
152
+ "ext": {
153
+ "$ref": "#/$defs/Ext"
154
+ }
155
+ }
156
+ },
157
+ "Ext": {
158
+ "title": "Ext",
159
+ "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.",
160
+ "type": "object",
161
+ "minProperties": 1,
162
+ "additionalProperties": true,
163
+ "propertyNames": {
164
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
165
+ }
166
+ }
167
+ }
168
+ } as const;
169
+
170
+ /**
171
+ * SPEC.md §7.2 policy for the request variant, from this specification's
172
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
173
+ * per-specification and cannot be derived from the document alone, and
174
+ * item 2 needs the schema this carries.
175
+ */
176
+ export const SPEC = {
177
+ typeUri: TYPE_URI,
178
+ isBearer: false,
179
+ isProofRequired: false,
180
+ isRecipientRequired: true,
181
+ isIssuedAtRequired: true,
182
+ payloadSchema: PAYLOAD_SCHEMA,
183
+ } as const;
184
+
185
+ /**
186
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
187
+ * tracks the *issuer* party's requirement because a response swaps the
188
+ * parties (§7.3 item 5).
189
+ */
190
+ export const RESPONSE_SPEC = {
191
+ typeUri: RESPONSE_TYPE_URI,
192
+ isBearer: false,
193
+ isProofRequired: true,
194
+ isRecipientRequired: true,
195
+ isIssuedAtRequired: true,
196
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
197
+ } as const;
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/witness/session/submit/0.2/payload.schema.json
4
+ */
5
+
6
+ import type { DigestMultibase, Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A participating party submits its presentation — and, optionally, a member presentation by its member DID — bound to its session challenge; the witness's mandatory response delivers the Verifiable Witness Credential and its digest. The response is the outcome evidence a VWC presentation must ship.
11
+ */
12
+ export interface WitnessSessionSubmitPayload {
13
+ /**
14
+ * A W3C Verifiable Presentation of the submitting party's own relationship credential material (opaque here), bound to the session's challenge and domain. A presentation not bound to this session is rejected with witness/session/submit:challengeMismatch.
15
+ */
16
+ vp: {};
17
+ /**
18
+ * OPTIONAL. A W3C Verifiable Presentation (opaque here) whose holder is the member DID — neither of the session's parties, and not the witness — under a proof by that DID for authentication covering the session's challenge and domain, as vp's does, and carrying the credentials that show the member eligible under the witness's policy, typically a membership credential naming the member DID. It links the pairwise relationship DID to the member DID at the witness, which must keep neither it nor the member DID. A witness that relies on it and finds it failing any check answers witness/session/submit:presentationInvalid.
19
+ */
20
+ memberPresentation?: {};
21
+ ext?: Ext;
22
+ }
23
+ /**
24
+ * The Verifiable Witness Credential and its digest, delivered under the REQUIRED proof. This document is the session's terminal success form and the outcome evidence a VWC presentation must ship.
25
+ */
26
+ export interface WitnessSessionSubmitResponsePayload {
27
+ /**
28
+ * A signed Verifiable Witness Credential: a DTG Verifiable Statement Credential (`type` including `StatementCredential`) under the predicate `https://registry.trustoverip.org/dtg/vsc/witnessed/1` (opaque here; its schema belongs to the DTG Credentials Core Specification). Its issuer is the witness, with `issuerScope` `directed` or `public`; its `credentialSubject.id` is the submitting party, the issuer of the relationship credential the witness observed; and its `credentialSubject.object.digestMultibase` is that credential's digest. Its taskContext MUST equal the id of the witness/session document that opened this session — the innermost exchange that attests the witnessing (SPEC.md §4.9.1) — and its taskDigestMultibase MUST be that document's task digest (SPEC.md §4.9.3). The id locates the session document; the digest binds it, because an id is a name anyone can reuse on a counterfeit.
29
+ */
30
+ vwc: {};
31
+ /**
32
+ * Digest over the RFC 8785 canonicalization of the delivered credential, computed by the witness. It binds this evidence to one specific credential rather than to the session alone, so a verifier pairing a presented VWC with this response can check it is the credential this session issued and not another the same witness signed. This covers the credential whole, proof included — unlike the task digest of SPEC.md §4.9.3, which excludes the top-level proof of the Trust Task document it names. The inputs differ because the questions do: this value identifies one delivered artifact, a task digest identifies what a document says whether or not it was signed.
33
+ */
34
+ vwcDigestMultibase: DigestMultibase;
35
+ ext?: Ext;
36
+ }
37
+
38
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
39
+ export type { DigestMultibase, Ext };
40
+
41
+ /** Trust Task type URI. */
42
+ export const TYPE_URI = "https://trusttasks.org/spec/witness/session/submit/0.2" as const;
43
+
44
+ /** Stable alias for this specification's request payload shape. */
45
+ export type Payload = WitnessSessionSubmitPayload;
46
+
47
+ /** Trust Task response type URI (request type URI + "#response"). */
48
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/witness/session/submit/0.2#response" as const;
49
+
50
+ /** Stable alias for this specification's success-response payload shape. */
51
+ export type Response = WitnessSessionSubmitResponsePayload;
52
+
53
+ /**
54
+ * This specification's payload schema, as a value.
55
+ *
56
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
57
+ * rather than only as a `.json` file because TypeScript types are erased
58
+ * at runtime: without a schema a consumer has nothing to validate, and
59
+ * every REQUIRED payload member is optional in practice. Cross-file
60
+ * `$ref`s are already inlined, so it needs no resolver.
61
+ */
62
+ export const PAYLOAD_SCHEMA = {
63
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
64
+ "$id": "https://trusttasks.org/spec/witness/session/submit/0.2",
65
+ "title": "Witness Session Submit — payload",
66
+ "description": "A participating party submits its presentation — and, optionally, a member presentation by its member DID — bound to its session challenge; the witness's mandatory response delivers the Verifiable Witness Credential and its digest. The response is the outcome evidence a VWC presentation must ship.",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "required": [
70
+ "vp"
71
+ ],
72
+ "properties": {
73
+ "vp": {
74
+ "type": "object",
75
+ "description": "A W3C Verifiable Presentation of the submitting party's own relationship credential material (opaque here), bound to the session's challenge and domain. A presentation not bound to this session is rejected with witness/session/submit:challengeMismatch."
76
+ },
77
+ "memberPresentation": {
78
+ "type": "object",
79
+ "description": "OPTIONAL. A W3C Verifiable Presentation (opaque here) whose holder is the member DID — neither of the session's parties, and not the witness — under a proof by that DID for authentication covering the session's challenge and domain, as vp's does, and carrying the credentials that show the member eligible under the witness's policy, typically a membership credential naming the member DID. It links the pairwise relationship DID to the member DID at the witness, which must keep neither it nor the member DID. A witness that relies on it and finds it failing any check answers witness/session/submit:presentationInvalid."
80
+ },
81
+ "ext": {
82
+ "$ref": "#/$defs/Ext"
83
+ }
84
+ },
85
+ "$defs": {
86
+ "Response": {
87
+ "$anchor": "response",
88
+ "title": "Witness Session Submit — response payload",
89
+ "description": "The Verifiable Witness Credential and its digest, delivered under the REQUIRED proof. This document is the session's terminal success form and the outcome evidence a VWC presentation must ship.",
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": [
93
+ "vwc",
94
+ "vwcDigestMultibase"
95
+ ],
96
+ "properties": {
97
+ "vwc": {
98
+ "type": "object",
99
+ "description": "A signed Verifiable Witness Credential: a DTG Verifiable Statement Credential (`type` including `StatementCredential`) under the predicate `https://registry.trustoverip.org/dtg/vsc/witnessed/1` (opaque here; its schema belongs to the DTG Credentials Core Specification). Its issuer is the witness, with `issuerScope` `directed` or `public`; its `credentialSubject.id` is the submitting party, the issuer of the relationship credential the witness observed; and its `credentialSubject.object.digestMultibase` is that credential's digest. Its taskContext MUST equal the id of the witness/session document that opened this session — the innermost exchange that attests the witnessing (SPEC.md §4.9.1) — and its taskDigestMultibase MUST be that document's task digest (SPEC.md §4.9.3). The id locates the session document; the digest binds it, because an id is a name anyone can reuse on a counterfeit."
100
+ },
101
+ "vwcDigestMultibase": {
102
+ "$ref": "#/$defs/DigestMultibase",
103
+ "description": "Digest over the RFC 8785 canonicalization of the delivered credential, computed by the witness. It binds this evidence to one specific credential rather than to the session alone, so a verifier pairing a presented VWC with this response can check it is the credential this session issued and not another the same witness signed. This covers the credential whole, proof included — unlike the task digest of SPEC.md §4.9.3, which excludes the top-level proof of the Trust Task document it names. The inputs differ because the questions do: this value identifies one delivered artifact, a task digest identifies what a document says whether or not it was signed."
104
+ },
105
+ "ext": {
106
+ "$ref": "#/$defs/Ext"
107
+ }
108
+ }
109
+ },
110
+ "Ext": {
111
+ "title": "Ext",
112
+ "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.",
113
+ "type": "object",
114
+ "minProperties": 1,
115
+ "additionalProperties": true,
116
+ "propertyNames": {
117
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
118
+ }
119
+ },
120
+ "DigestMultibase": {
121
+ "title": "DigestMultibase",
122
+ "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`.",
123
+ "type": "string",
124
+ "minLength": 16,
125
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
126
+ "examples": [
127
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
128
+ ]
129
+ }
130
+ }
131
+ } as const;
132
+
133
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
134
+ export const RESPONSE_PAYLOAD_SCHEMA = {
135
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
136
+ "$ref": "#/$defs/Response",
137
+ "$defs": {
138
+ "Response": {
139
+ "$anchor": "response",
140
+ "title": "Witness Session Submit — response payload",
141
+ "description": "The Verifiable Witness Credential and its digest, delivered under the REQUIRED proof. This document is the session's terminal success form and the outcome evidence a VWC presentation must ship.",
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "required": [
145
+ "vwc",
146
+ "vwcDigestMultibase"
147
+ ],
148
+ "properties": {
149
+ "vwc": {
150
+ "type": "object",
151
+ "description": "A signed Verifiable Witness Credential: a DTG Verifiable Statement Credential (`type` including `StatementCredential`) under the predicate `https://registry.trustoverip.org/dtg/vsc/witnessed/1` (opaque here; its schema belongs to the DTG Credentials Core Specification). Its issuer is the witness, with `issuerScope` `directed` or `public`; its `credentialSubject.id` is the submitting party, the issuer of the relationship credential the witness observed; and its `credentialSubject.object.digestMultibase` is that credential's digest. Its taskContext MUST equal the id of the witness/session document that opened this session — the innermost exchange that attests the witnessing (SPEC.md §4.9.1) — and its taskDigestMultibase MUST be that document's task digest (SPEC.md §4.9.3). The id locates the session document; the digest binds it, because an id is a name anyone can reuse on a counterfeit."
152
+ },
153
+ "vwcDigestMultibase": {
154
+ "$ref": "#/$defs/DigestMultibase",
155
+ "description": "Digest over the RFC 8785 canonicalization of the delivered credential, computed by the witness. It binds this evidence to one specific credential rather than to the session alone, so a verifier pairing a presented VWC with this response can check it is the credential this session issued and not another the same witness signed. This covers the credential whole, proof included — unlike the task digest of SPEC.md §4.9.3, which excludes the top-level proof of the Trust Task document it names. The inputs differ because the questions do: this value identifies one delivered artifact, a task digest identifies what a document says whether or not it was signed."
156
+ },
157
+ "ext": {
158
+ "$ref": "#/$defs/Ext"
159
+ }
160
+ }
161
+ },
162
+ "Ext": {
163
+ "title": "Ext",
164
+ "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.",
165
+ "type": "object",
166
+ "minProperties": 1,
167
+ "additionalProperties": true,
168
+ "propertyNames": {
169
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
170
+ }
171
+ },
172
+ "DigestMultibase": {
173
+ "title": "DigestMultibase",
174
+ "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`.",
175
+ "type": "string",
176
+ "minLength": 16,
177
+ "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$",
178
+ "examples": [
179
+ "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
180
+ ]
181
+ }
182
+ }
183
+ } as const;
184
+
185
+ /**
186
+ * SPEC.md §7.2 policy for the request variant, from this specification's
187
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
188
+ * per-specification and cannot be derived from the document alone, and
189
+ * item 2 needs the schema this carries.
190
+ */
191
+ export const SPEC = {
192
+ typeUri: TYPE_URI,
193
+ isBearer: false,
194
+ isProofRequired: true,
195
+ isRecipientRequired: true,
196
+ isIssuedAtRequired: true,
197
+ payloadSchema: PAYLOAD_SCHEMA,
198
+ } as const;
199
+
200
+ /**
201
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
202
+ * tracks the *issuer* party's requirement because a response swaps the
203
+ * parties (§7.3 item 5).
204
+ */
205
+ export const RESPONSE_SPEC = {
206
+ typeUri: RESPONSE_TYPE_URI,
207
+ isBearer: false,
208
+ isProofRequired: true,
209
+ isRecipientRequired: true,
210
+ isIssuedAtRequired: true,
211
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
212
+ } as const;