@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,231 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vtc/members/registry-consent/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface VTCMembersRegistryConsentPayload {
10
+ /**
11
+ * The member's own decision on trust-registry publication: `true` consents to the community publishing their membership in its trust registry, `false` withdraws that consent. Applies to the member who signed the document, and to no one else.
12
+ */
13
+ publishConsent: boolean;
14
+ ext?: Ext;
15
+ }
16
+ export interface VTCMembersRegistryConsentResponsePayload {
17
+ /**
18
+ * The member whose consent this is: the document's signer.
19
+ */
20
+ did: string;
21
+ /**
22
+ * The consent now recorded on the member record.
23
+ */
24
+ publishConsent: boolean;
25
+ /**
26
+ * Whether this document changed the recorded consent. `false` when the member restated the value already recorded.
27
+ */
28
+ changed: boolean;
29
+ /**
30
+ * What the community did about its trust registry. `queued`: a registry sync job carrying the change is queued (publication on a grant, removal on a withdrawal). `notConfigured`: the community publishes to no trust registry at present; the consent is recorded and governs any registry configured later. `unchanged`: nothing to sync, because the consent did not change, or because the community does not publish this member on other grounds (consent permits publication; it does not oblige it).
31
+ */
32
+ registrySync: "queued" | "notConfigured" | "unchanged";
33
+ /**
34
+ * When the community recorded the consent now in force — this document's execution when `changed` is `true`, the earlier change otherwise.
35
+ */
36
+ effectiveAt: string;
37
+ ext?: Ext;
38
+ }
39
+
40
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
41
+ export type { Ext };
42
+
43
+ /** Trust Task type URI. */
44
+ export const TYPE_URI = "https://trusttasks.org/spec/vtc/members/registry-consent/0.1" as const;
45
+
46
+ /** Stable alias for this specification's request payload shape. */
47
+ export type Payload = VTCMembersRegistryConsentPayload;
48
+
49
+ /** Trust Task response type URI (request type URI + "#response"). */
50
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/members/registry-consent/0.1#response" as const;
51
+
52
+ /** Stable alias for this specification's success-response payload shape. */
53
+ export type Response = VTCMembersRegistryConsentResponsePayload;
54
+
55
+ /**
56
+ * This specification's payload schema, as a value.
57
+ *
58
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
59
+ * rather than only as a `.json` file because TypeScript types are erased
60
+ * at runtime: without a schema a consumer has nothing to validate, and
61
+ * every REQUIRED payload member is optional in practice. Cross-file
62
+ * `$ref`s are already inlined, so it needs no resolver.
63
+ */
64
+ export const PAYLOAD_SCHEMA = {
65
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
66
+ "$id": "https://trusttasks.org/spec/vtc/members/registry-consent/0.1",
67
+ "title": "VTC Members Registry Consent — payload",
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": [
71
+ "publishConsent"
72
+ ],
73
+ "properties": {
74
+ "publishConsent": {
75
+ "type": "boolean",
76
+ "description": "The member's own decision on trust-registry publication: `true` consents to the community publishing their membership in its trust registry, `false` withdraws that consent. Applies to the member who signed the document, and to no one else."
77
+ },
78
+ "ext": {
79
+ "$ref": "#/$defs/Ext"
80
+ }
81
+ },
82
+ "$defs": {
83
+ "Response": {
84
+ "$anchor": "response",
85
+ "title": "VTC Members Registry Consent — response payload",
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": [
89
+ "did",
90
+ "publishConsent",
91
+ "changed",
92
+ "registrySync",
93
+ "effectiveAt"
94
+ ],
95
+ "properties": {
96
+ "did": {
97
+ "type": "string",
98
+ "minLength": 1,
99
+ "description": "The member whose consent this is: the document's signer."
100
+ },
101
+ "publishConsent": {
102
+ "type": "boolean",
103
+ "description": "The consent now recorded on the member record."
104
+ },
105
+ "changed": {
106
+ "type": "boolean",
107
+ "description": "Whether this document changed the recorded consent. `false` when the member restated the value already recorded."
108
+ },
109
+ "registrySync": {
110
+ "type": "string",
111
+ "enum": [
112
+ "queued",
113
+ "notConfigured",
114
+ "unchanged"
115
+ ],
116
+ "description": "What the community did about its trust registry. `queued`: a registry sync job carrying the change is queued (publication on a grant, removal on a withdrawal). `notConfigured`: the community publishes to no trust registry at present; the consent is recorded and governs any registry configured later. `unchanged`: nothing to sync, because the consent did not change, or because the community does not publish this member on other grounds (consent permits publication; it does not oblige it)."
117
+ },
118
+ "effectiveAt": {
119
+ "type": "string",
120
+ "format": "date-time",
121
+ "description": "When the community recorded the consent now in force — this document's execution when `changed` is `true`, the earlier change otherwise."
122
+ },
123
+ "ext": {
124
+ "$ref": "#/$defs/Ext"
125
+ }
126
+ }
127
+ },
128
+ "Ext": {
129
+ "title": "Ext",
130
+ "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.",
131
+ "type": "object",
132
+ "minProperties": 1,
133
+ "additionalProperties": true,
134
+ "propertyNames": {
135
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
136
+ }
137
+ }
138
+ }
139
+ } as const;
140
+
141
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
142
+ export const RESPONSE_PAYLOAD_SCHEMA = {
143
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
144
+ "$ref": "#/$defs/Response",
145
+ "$defs": {
146
+ "Response": {
147
+ "$anchor": "response",
148
+ "title": "VTC Members Registry Consent — response payload",
149
+ "type": "object",
150
+ "additionalProperties": false,
151
+ "required": [
152
+ "did",
153
+ "publishConsent",
154
+ "changed",
155
+ "registrySync",
156
+ "effectiveAt"
157
+ ],
158
+ "properties": {
159
+ "did": {
160
+ "type": "string",
161
+ "minLength": 1,
162
+ "description": "The member whose consent this is: the document's signer."
163
+ },
164
+ "publishConsent": {
165
+ "type": "boolean",
166
+ "description": "The consent now recorded on the member record."
167
+ },
168
+ "changed": {
169
+ "type": "boolean",
170
+ "description": "Whether this document changed the recorded consent. `false` when the member restated the value already recorded."
171
+ },
172
+ "registrySync": {
173
+ "type": "string",
174
+ "enum": [
175
+ "queued",
176
+ "notConfigured",
177
+ "unchanged"
178
+ ],
179
+ "description": "What the community did about its trust registry. `queued`: a registry sync job carrying the change is queued (publication on a grant, removal on a withdrawal). `notConfigured`: the community publishes to no trust registry at present; the consent is recorded and governs any registry configured later. `unchanged`: nothing to sync, because the consent did not change, or because the community does not publish this member on other grounds (consent permits publication; it does not oblige it)."
180
+ },
181
+ "effectiveAt": {
182
+ "type": "string",
183
+ "format": "date-time",
184
+ "description": "When the community recorded the consent now in force — this document's execution when `changed` is `true`, the earlier change otherwise."
185
+ },
186
+ "ext": {
187
+ "$ref": "#/$defs/Ext"
188
+ }
189
+ }
190
+ },
191
+ "Ext": {
192
+ "title": "Ext",
193
+ "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.",
194
+ "type": "object",
195
+ "minProperties": 1,
196
+ "additionalProperties": true,
197
+ "propertyNames": {
198
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
199
+ }
200
+ }
201
+ }
202
+ } as const;
203
+
204
+ /**
205
+ * SPEC.md §7.2 policy for the request variant, from this specification's
206
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
207
+ * per-specification and cannot be derived from the document alone, and
208
+ * item 2 needs the schema this carries.
209
+ */
210
+ export const SPEC = {
211
+ typeUri: TYPE_URI,
212
+ isBearer: false,
213
+ isProofRequired: true,
214
+ isRecipientRequired: true,
215
+ isIssuedAtRequired: true,
216
+ payloadSchema: PAYLOAD_SCHEMA,
217
+ } as const;
218
+
219
+ /**
220
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
221
+ * tracks the *issuer* party's requirement because a response swaps the
222
+ * parties (§7.3 item 5).
223
+ */
224
+ export const RESPONSE_SPEC = {
225
+ typeUri: RESPONSE_TYPE_URI,
226
+ isBearer: false,
227
+ isProofRequired: true,
228
+ isRecipientRequired: true,
229
+ isIssuedAtRequired: true,
230
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
231
+ } as const;
@@ -20,7 +20,7 @@ export interface VTCMembersUpdatePayload {
20
20
  */
21
21
  label?: string | null;
22
22
  /**
23
- * New directory-publish consent.
23
+ * New directory-publish consent. May only withdraw consent (`true` → `false`) or restate the current value; `true` for a member whose record does not already carry it is refused with `consentGrantForbidden`. Consent is the member's own, given by `registryConsent` on `vtc/join-requests/submit`.
24
24
  */
25
25
  publishConsent?: boolean;
26
26
  departurePreference?: "purge" | "tombstone" | "historical" | "policydefault";
@@ -89,7 +89,7 @@ export const PAYLOAD_SCHEMA = {
89
89
  },
90
90
  "publishConsent": {
91
91
  "type": "boolean",
92
- "description": "New directory-publish consent."
92
+ "description": "New directory-publish consent. May only withdraw consent (`true` → `false`) or restate the current value; `true` for a member whose record does not already carry it is refused with `consentGrantForbidden`. Consent is the member's own, given by `registryConsent` on `vtc/join-requests/submit`."
93
93
  },
94
94
  "departurePreference": {
95
95
  "type": "string",
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/witness/_shared/0.1/outcome-evidence.schema.json
4
+ */
5
+
6
+ /**
7
+ * The outcome evidence of one witnessing session (SPEC §4.9.4): the witness/session document that opened it and the witness/session/submit #response that closed it, which together let a party outside the exchange pair a Verifiable Witness Credential with the session it cites. Defined once because more than one task carries it: the VTA that stores a VWC returns it (vta/witness/accept), and a holder presenting a VWC ships it beside the presentation (vtc/members/personhood/assert). Not itself a Trust Task specification: the `_shared` folder is skipped by the registry build and the codegen.
8
+ */
9
+ export interface WitnessingOutcomeEvidenceSharedDefinitions {
10
+ [k: string]: unknown | undefined;
11
+ }
12
+
13
+ /**
14
+ * The definitions this shared schema publishes, hoisted to one declaration each.
15
+ * See "../../../_shared/components.js".
16
+ */
17
+ export type { EvidenceDocument, OutcomeEvidence } from "../../../_shared/components.js";
@@ -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;