@openvtc/trust-tasks 0.16.7 → 0.16.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/dist/_shared/components.d.ts +2 -2
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/device/list/0.1/payload.d.ts +4 -4
  5. package/dist/device/list/0.1/payload.d.ts.map +1 -1
  6. package/dist/device/list/0.1/payload.js +6 -2
  7. package/dist/device/list/0.1/payload.js.map +1 -1
  8. package/dist/device/list/0.2/payload.d.ts +4 -4
  9. package/dist/device/list/0.2/payload.d.ts.map +1 -1
  10. package/dist/device/list/0.2/payload.js +6 -2
  11. package/dist/device/list/0.2/payload.js.map +1 -1
  12. package/dist/device/register/0.1/payload.d.ts +4 -4
  13. package/dist/device/register/0.1/payload.d.ts.map +1 -1
  14. package/dist/device/register/0.1/payload.js +6 -2
  15. package/dist/device/register/0.1/payload.js.map +1 -1
  16. package/dist/device/register/0.2/payload.d.ts +4 -4
  17. package/dist/device/register/0.2/payload.d.ts.map +1 -1
  18. package/dist/device/register/0.2/payload.js +6 -2
  19. package/dist/device/register/0.2/payload.js.map +1 -1
  20. package/dist/index.d.ts +12 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +12 -0
  23. package/dist/index.js.map +1 -1
  24. package/dist/rooms/keys/commit/0.1/payload.d.ts +266 -0
  25. package/dist/rooms/keys/commit/0.1/payload.d.ts.map +1 -0
  26. package/dist/rooms/keys/commit/0.1/payload.js +146 -0
  27. package/dist/rooms/keys/commit/0.1/payload.js.map +1 -0
  28. package/dist/rooms/keys/key-package/0.1/payload.d.ts +272 -0
  29. package/dist/rooms/keys/key-package/0.1/payload.d.ts.map +1 -0
  30. package/dist/rooms/keys/key-package/0.1/payload.js +147 -0
  31. package/dist/rooms/keys/key-package/0.1/payload.js.map +1 -0
  32. package/dist/rooms/keys/open/0.1/payload.d.ts +323 -0
  33. package/dist/rooms/keys/open/0.1/payload.d.ts.map +1 -0
  34. package/dist/rooms/keys/open/0.1/payload.js +171 -0
  35. package/dist/rooms/keys/open/0.1/payload.js.map +1 -0
  36. package/dist/rooms/keys/present/0.1/payload.d.ts +306 -0
  37. package/dist/rooms/keys/present/0.1/payload.d.ts.map +1 -0
  38. package/dist/rooms/keys/present/0.1/payload.js +165 -0
  39. package/dist/rooms/keys/present/0.1/payload.js.map +1 -0
  40. package/dist/rooms/keys/welcome/0.1/payload.d.ts +276 -0
  41. package/dist/rooms/keys/welcome/0.1/payload.d.ts.map +1 -0
  42. package/dist/rooms/keys/welcome/0.1/payload.js +148 -0
  43. package/dist/rooms/keys/welcome/0.1/payload.js.map +1 -0
  44. package/dist/rooms/records/curate/0.1/payload.d.ts +500 -0
  45. package/dist/rooms/records/curate/0.1/payload.d.ts.map +1 -0
  46. package/dist/rooms/records/curate/0.1/payload.js +277 -0
  47. package/dist/rooms/records/curate/0.1/payload.js.map +1 -0
  48. package/dist/vta/backup/abort/1.0/payload.d.ts +262 -0
  49. package/dist/vta/backup/abort/1.0/payload.d.ts.map +1 -0
  50. package/dist/vta/backup/abort/1.0/payload.js +146 -0
  51. package/dist/vta/backup/abort/1.0/payload.js.map +1 -0
  52. package/dist/vta/backup/complete-export/1.0/payload.d.ts +262 -0
  53. package/dist/vta/backup/complete-export/1.0/payload.d.ts.map +1 -0
  54. package/dist/vta/backup/complete-export/1.0/payload.js +146 -0
  55. package/dist/vta/backup/complete-export/1.0/payload.js.map +1 -0
  56. package/dist/vta/backup/finalize-import/1.0/payload.d.ts +477 -0
  57. package/dist/vta/backup/finalize-import/1.0/payload.d.ts.map +1 -0
  58. package/dist/vta/backup/finalize-import/1.0/payload.js +249 -0
  59. package/dist/vta/backup/finalize-import/1.0/payload.js.map +1 -0
  60. package/dist/vta/backup/initiate-export/1.0/payload.d.ts +514 -0
  61. package/dist/vta/backup/initiate-export/1.0/payload.d.ts.map +1 -0
  62. package/dist/vta/backup/initiate-export/1.0/payload.js +267 -0
  63. package/dist/vta/backup/initiate-export/1.0/payload.js.map +1 -0
  64. package/dist/vta/backup/initiate-import/1.0/payload.d.ts +510 -0
  65. package/dist/vta/backup/initiate-import/1.0/payload.d.ts.map +1 -0
  66. package/dist/vta/backup/initiate-import/1.0/payload.js +266 -0
  67. package/dist/vta/backup/initiate-import/1.0/payload.js.map +1 -0
  68. package/dist/vta/management/reload-services/1.0/payload.d.ts +230 -0
  69. package/dist/vta/management/reload-services/1.0/payload.d.ts.map +1 -0
  70. package/dist/vta/management/reload-services/1.0/payload.js +130 -0
  71. package/dist/vta/management/reload-services/1.0/payload.js.map +1 -0
  72. package/package.json +1 -1
  73. package/src/_shared/components.ts +6 -2
  74. package/src/device/list/0.1/payload.ts +6 -2
  75. package/src/device/list/0.2/payload.ts +6 -2
  76. package/src/device/register/0.1/payload.ts +6 -2
  77. package/src/device/register/0.2/payload.ts +6 -2
  78. package/src/index.ts +12 -0
  79. package/src/rooms/keys/commit/0.1/payload.ts +195 -0
  80. package/src/rooms/keys/key-package/0.1/payload.ts +196 -0
  81. package/src/rooms/keys/open/0.1/payload.ts +237 -0
  82. package/src/rooms/keys/present/0.1/payload.ts +224 -0
  83. package/src/rooms/keys/welcome/0.1/payload.ts +201 -0
  84. package/src/rooms/records/curate/0.1/payload.ts +357 -0
  85. package/src/vta/backup/abort/1.0/payload.ts +191 -0
  86. package/src/vta/backup/complete-export/1.0/payload.ts +191 -0
  87. package/src/vta/backup/finalize-import/1.0/payload.ts +333 -0
  88. package/src/vta/backup/initiate-export/1.0/payload.ts +350 -0
  89. package/src/vta/backup/initiate-import/1.0/payload.ts +349 -0
  90. package/src/vta/management/reload-services/1.0/payload.ts +167 -0
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/open/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * An agent asks the party holding its principal's room keys to open one sealed record. The key never crosses to the agent: this is a decryption oracle, not a key-release call.
11
+ */
12
+ export interface RoomsKeysOpenPayload {
13
+ /**
14
+ * The room the record belongs to. Part of the record's associated data, so a caller naming the wrong room gets an authentication failure rather than someone else's plaintext.
15
+ */
16
+ roomId: string;
17
+ /**
18
+ * The record's key within the room.
19
+ */
20
+ key: string;
21
+ /**
22
+ * The record's version. Bound into the associated data, so a record served at a different version does not open.
23
+ */
24
+ version: number;
25
+ /**
26
+ * The sealed record exactly as the host returned it.
27
+ */
28
+ sealed: {
29
+ /**
30
+ * base64url.
31
+ */
32
+ ciphertext: string;
33
+ /**
34
+ * base64url.
35
+ */
36
+ nonce: string;
37
+ /**
38
+ * The epoch it was sealed under. The oracle refuses an epoch it holds no key for rather than guessing.
39
+ */
40
+ epoch: number;
41
+ };
42
+ /**
43
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
44
+ */
45
+ ext?: Ext;
46
+ }
47
+ /**
48
+ * Success response to rooms/keys/open. Type https://trusttasks.org/spec/rooms/keys/open/0.1#response.
49
+ */
50
+ export interface RoomsKeysOpenResponsePayload {
51
+ /**
52
+ * The opened record, base64url. The only thing that crosses back — never the key.
53
+ */
54
+ plaintext: string;
55
+ ext?: Ext;
56
+ }
57
+
58
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
59
+ export type { Ext };
60
+
61
+ /** Trust Task type URI. */
62
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/open/0.1" as const;
63
+
64
+ /** Stable alias for this specification's request payload shape. */
65
+ export type Payload = RoomsKeysOpenPayload;
66
+
67
+ /** Trust Task response type URI (request type URI + "#response"). */
68
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/open/0.1#response" as const;
69
+
70
+ /** Stable alias for this specification's success-response payload shape. */
71
+ export type Response = RoomsKeysOpenResponsePayload;
72
+
73
+ /**
74
+ * This specification's payload schema, as a value.
75
+ *
76
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
77
+ * rather than only as a `.json` file because TypeScript types are erased
78
+ * at runtime: without a schema a consumer has nothing to validate, and
79
+ * every REQUIRED payload member is optional in practice. Cross-file
80
+ * `$ref`s are already inlined, so it needs no resolver.
81
+ */
82
+ export const PAYLOAD_SCHEMA = {
83
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
84
+ "$id": "https://trusttasks.org/spec/rooms/keys/open/0.1",
85
+ "title": "Rooms Keys Open — payload",
86
+ "description": "An agent asks the party holding its principal's room keys to open one sealed record. The key never crosses to the agent: this is a decryption oracle, not a key-release call.",
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "required": [
90
+ "roomId",
91
+ "key",
92
+ "version",
93
+ "sealed"
94
+ ],
95
+ "properties": {
96
+ "roomId": {
97
+ "type": "string",
98
+ "description": "The room the record belongs to. Part of the record's associated data, so a caller naming the wrong room gets an authentication failure rather than someone else's plaintext."
99
+ },
100
+ "key": {
101
+ "type": "string",
102
+ "maxLength": 512,
103
+ "description": "The record's key within the room."
104
+ },
105
+ "version": {
106
+ "type": "integer",
107
+ "minimum": 1,
108
+ "description": "The record's version. Bound into the associated data, so a record served at a different version does not open."
109
+ },
110
+ "sealed": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "required": [
114
+ "ciphertext",
115
+ "nonce",
116
+ "epoch"
117
+ ],
118
+ "description": "The sealed record exactly as the host returned it.",
119
+ "properties": {
120
+ "ciphertext": {
121
+ "type": "string",
122
+ "description": "base64url."
123
+ },
124
+ "nonce": {
125
+ "type": "string",
126
+ "description": "base64url."
127
+ },
128
+ "epoch": {
129
+ "type": "integer",
130
+ "minimum": 1,
131
+ "description": "The epoch it was sealed under. The oracle refuses an epoch it holds no key for rather than guessing."
132
+ }
133
+ }
134
+ },
135
+ "ext": {
136
+ "$ref": "#/$defs/Ext",
137
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
138
+ }
139
+ },
140
+ "$defs": {
141
+ "Response": {
142
+ "$anchor": "response",
143
+ "title": "Rooms Keys Open — response payload",
144
+ "description": "Success response to rooms/keys/open. Type https://trusttasks.org/spec/rooms/keys/open/0.1#response.",
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "required": [
148
+ "plaintext"
149
+ ],
150
+ "properties": {
151
+ "plaintext": {
152
+ "type": "string",
153
+ "description": "The opened record, base64url. The only thing that crosses back — never the key."
154
+ },
155
+ "ext": {
156
+ "$ref": "#/$defs/Ext"
157
+ }
158
+ }
159
+ },
160
+ "Ext": {
161
+ "title": "Ext",
162
+ "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.",
163
+ "type": "object",
164
+ "minProperties": 1,
165
+ "additionalProperties": true,
166
+ "propertyNames": {
167
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
168
+ }
169
+ }
170
+ }
171
+ } as const;
172
+
173
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
174
+ export const RESPONSE_PAYLOAD_SCHEMA = {
175
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
176
+ "$ref": "#/$defs/Response",
177
+ "$defs": {
178
+ "Response": {
179
+ "$anchor": "response",
180
+ "title": "Rooms Keys Open — response payload",
181
+ "description": "Success response to rooms/keys/open. Type https://trusttasks.org/spec/rooms/keys/open/0.1#response.",
182
+ "type": "object",
183
+ "additionalProperties": false,
184
+ "required": [
185
+ "plaintext"
186
+ ],
187
+ "properties": {
188
+ "plaintext": {
189
+ "type": "string",
190
+ "description": "The opened record, base64url. The only thing that crosses back — never the key."
191
+ },
192
+ "ext": {
193
+ "$ref": "#/$defs/Ext"
194
+ }
195
+ }
196
+ },
197
+ "Ext": {
198
+ "title": "Ext",
199
+ "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.",
200
+ "type": "object",
201
+ "minProperties": 1,
202
+ "additionalProperties": true,
203
+ "propertyNames": {
204
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
205
+ }
206
+ }
207
+ }
208
+ } as const;
209
+
210
+ /**
211
+ * SPEC.md §7.2 policy for the request variant, from this specification's
212
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
213
+ * per-specification and cannot be derived from the document alone, and
214
+ * item 2 needs the schema this carries.
215
+ */
216
+ export const SPEC = {
217
+ typeUri: TYPE_URI,
218
+ isBearer: false,
219
+ isProofRequired: true,
220
+ isRecipientRequired: true,
221
+ isIssuedAtRequired: true,
222
+ payloadSchema: PAYLOAD_SCHEMA,
223
+ } as const;
224
+
225
+ /**
226
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
227
+ * tracks the *issuer* party's requirement because a response swaps the
228
+ * parties (§7.3 item 5).
229
+ */
230
+ export const RESPONSE_SPEC = {
231
+ typeUri: RESPONSE_TYPE_URI,
232
+ isBearer: false,
233
+ isProofRequired: true,
234
+ isRecipientRequired: true,
235
+ isIssuedAtRequired: true,
236
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
237
+ } as const;
@@ -0,0 +1,224 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/present/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * An agent asks the party holding its principal's room credentials to produce a presentation for one room operation. The credentials never cross to the agent; only the presentation does, and it is bound to the operation it was asked for.
11
+ */
12
+ export interface RoomsKeysPresentPayload {
13
+ /**
14
+ * The room to present for.
15
+ */
16
+ roomId: string;
17
+ /**
18
+ * The action the presentation must confer. Named here so the produced presentation can be scoped to it: a presentation minted for `read` should not be reusable for `write`, and a holder that mints one covering everything has handed the agent its own standing.
19
+ */
20
+ action: "read" | "write" | "curate" | "admin";
21
+ /**
22
+ * The party the presentation is for, so it cannot be replayed elsewhere. A host's identifier, normally.
23
+ */
24
+ audience?: string;
25
+ /**
26
+ * Freshness value from the verifier, echoed into the presentation. Without one a captured presentation is replayable for as long as its credentials live.
27
+ */
28
+ nonce?: string;
29
+ /**
30
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
31
+ */
32
+ ext?: Ext;
33
+ }
34
+ /**
35
+ * Success response to rooms/keys/present. Type https://trusttasks.org/spec/rooms/keys/present/0.1#response.
36
+ */
37
+ export interface RoomsKeysPresentResponsePayload {
38
+ /**
39
+ * The presentation to send to the host: a membership credential, an authority chain, and — where the room withholds the subject — a same-subject binding.
40
+ */
41
+ presentation: {
42
+ [k: string]: unknown | undefined;
43
+ };
44
+ /**
45
+ * When the presentation stops being accepted, so a caller can avoid presenting a stale one.
46
+ */
47
+ expiresAt?: string;
48
+ ext?: Ext;
49
+ }
50
+
51
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
52
+ export type { Ext };
53
+
54
+ /** Trust Task type URI. */
55
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/present/0.1" as const;
56
+
57
+ /** Stable alias for this specification's request payload shape. */
58
+ export type Payload = RoomsKeysPresentPayload;
59
+
60
+ /** Trust Task response type URI (request type URI + "#response"). */
61
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/present/0.1#response" as const;
62
+
63
+ /** Stable alias for this specification's success-response payload shape. */
64
+ export type Response = RoomsKeysPresentResponsePayload;
65
+
66
+ /**
67
+ * This specification's payload schema, as a value.
68
+ *
69
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
70
+ * rather than only as a `.json` file because TypeScript types are erased
71
+ * at runtime: without a schema a consumer has nothing to validate, and
72
+ * every REQUIRED payload member is optional in practice. Cross-file
73
+ * `$ref`s are already inlined, so it needs no resolver.
74
+ */
75
+ export const PAYLOAD_SCHEMA = {
76
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
77
+ "$id": "https://trusttasks.org/spec/rooms/keys/present/0.1",
78
+ "title": "Rooms Keys Present — payload",
79
+ "description": "An agent asks the party holding its principal's room credentials to produce a presentation for one room operation. The credentials never cross to the agent; only the presentation does, and it is bound to the operation it was asked for.",
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": [
83
+ "roomId",
84
+ "action"
85
+ ],
86
+ "properties": {
87
+ "roomId": {
88
+ "type": "string",
89
+ "description": "The room to present for."
90
+ },
91
+ "action": {
92
+ "type": "string",
93
+ "enum": [
94
+ "read",
95
+ "write",
96
+ "curate",
97
+ "admin"
98
+ ],
99
+ "description": "The action the presentation must confer. Named here so the produced presentation can be scoped to it: a presentation minted for `read` should not be reusable for `write`, and a holder that mints one covering everything has handed the agent its own standing."
100
+ },
101
+ "audience": {
102
+ "type": "string",
103
+ "description": "The party the presentation is for, so it cannot be replayed elsewhere. A host's identifier, normally."
104
+ },
105
+ "nonce": {
106
+ "type": "string",
107
+ "maxLength": 512,
108
+ "description": "Freshness value from the verifier, echoed into the presentation. Without one a captured presentation is replayable for as long as its credentials live."
109
+ },
110
+ "ext": {
111
+ "$ref": "#/$defs/Ext",
112
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
113
+ }
114
+ },
115
+ "$defs": {
116
+ "Response": {
117
+ "$anchor": "response",
118
+ "title": "Rooms Keys Present — response payload",
119
+ "description": "Success response to rooms/keys/present. Type https://trusttasks.org/spec/rooms/keys/present/0.1#response.",
120
+ "type": "object",
121
+ "additionalProperties": false,
122
+ "required": [
123
+ "presentation"
124
+ ],
125
+ "properties": {
126
+ "presentation": {
127
+ "type": "object",
128
+ "additionalProperties": true,
129
+ "description": "The presentation to send to the host: a membership credential, an authority chain, and — where the room withholds the subject — a same-subject binding."
130
+ },
131
+ "expiresAt": {
132
+ "type": "string",
133
+ "format": "date-time",
134
+ "description": "When the presentation stops being accepted, so a caller can avoid presenting a stale one."
135
+ },
136
+ "ext": {
137
+ "$ref": "#/$defs/Ext"
138
+ }
139
+ }
140
+ },
141
+ "Ext": {
142
+ "title": "Ext",
143
+ "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.",
144
+ "type": "object",
145
+ "minProperties": 1,
146
+ "additionalProperties": true,
147
+ "propertyNames": {
148
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
149
+ }
150
+ }
151
+ }
152
+ } as const;
153
+
154
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
155
+ export const RESPONSE_PAYLOAD_SCHEMA = {
156
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
157
+ "$ref": "#/$defs/Response",
158
+ "$defs": {
159
+ "Response": {
160
+ "$anchor": "response",
161
+ "title": "Rooms Keys Present — response payload",
162
+ "description": "Success response to rooms/keys/present. Type https://trusttasks.org/spec/rooms/keys/present/0.1#response.",
163
+ "type": "object",
164
+ "additionalProperties": false,
165
+ "required": [
166
+ "presentation"
167
+ ],
168
+ "properties": {
169
+ "presentation": {
170
+ "type": "object",
171
+ "additionalProperties": true,
172
+ "description": "The presentation to send to the host: a membership credential, an authority chain, and — where the room withholds the subject — a same-subject binding."
173
+ },
174
+ "expiresAt": {
175
+ "type": "string",
176
+ "format": "date-time",
177
+ "description": "When the presentation stops being accepted, so a caller can avoid presenting a stale one."
178
+ },
179
+ "ext": {
180
+ "$ref": "#/$defs/Ext"
181
+ }
182
+ }
183
+ },
184
+ "Ext": {
185
+ "title": "Ext",
186
+ "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.",
187
+ "type": "object",
188
+ "minProperties": 1,
189
+ "additionalProperties": true,
190
+ "propertyNames": {
191
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
192
+ }
193
+ }
194
+ }
195
+ } as const;
196
+
197
+ /**
198
+ * SPEC.md §7.2 policy for the request variant, from this specification's
199
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
200
+ * per-specification and cannot be derived from the document alone, and
201
+ * item 2 needs the schema this carries.
202
+ */
203
+ export const SPEC = {
204
+ typeUri: TYPE_URI,
205
+ isBearer: false,
206
+ isProofRequired: true,
207
+ isRecipientRequired: true,
208
+ isIssuedAtRequired: true,
209
+ payloadSchema: PAYLOAD_SCHEMA,
210
+ } as const;
211
+
212
+ /**
213
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
214
+ * tracks the *issuer* party's requirement because a response swaps the
215
+ * parties (§7.3 item 5).
216
+ */
217
+ export const RESPONSE_SPEC = {
218
+ typeUri: RESPONSE_TYPE_URI,
219
+ isBearer: false,
220
+ isProofRequired: true,
221
+ isRecipientRequired: true,
222
+ isIssuedAtRequired: true,
223
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
224
+ } as const;
@@ -0,0 +1,201 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/rooms/keys/welcome/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * A room's owner delivers an MLS Welcome to the agent that will hold a new member's room keys, so it can join the group. The Welcome carries the group's secrets sealed to the recipient's KeyPackage; a recipient that accepts one it was not invited to has been handed key material it should have refused.
11
+ */
12
+ export interface RoomsKeysWelcomePayload {
13
+ /**
14
+ * The room being joined.
15
+ */
16
+ roomId: string;
17
+ /**
18
+ * The MLS Welcome message, base64url.
19
+ */
20
+ welcome: string;
21
+ /**
22
+ * The group's ratchet tree, base64url, where the Welcome does not carry it as an extension. A joiner needs the tree to derive the group's secrets; omit it only where the group uses the ratchet-tree extension.
23
+ */
24
+ ratchetTree?: string;
25
+ /**
26
+ * The invitation credential (VIC) the room issued to the joining party, serialized per the governing profile. This is what makes the Welcome acceptable: joining is a two-party act, and a recipient with no matching invitation MUST refuse.
27
+ */
28
+ invitation?: string;
29
+ /**
30
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
31
+ */
32
+ ext?: Ext;
33
+ }
34
+ /**
35
+ * Success response to rooms/keys/welcome. Type https://trusttasks.org/spec/rooms/keys/welcome/0.1#response.
36
+ */
37
+ export interface RoomsKeysWelcomeResponsePayload {
38
+ /**
39
+ * The MLS epoch the recipient joined at. The sender needs this to know which commits the recipient still lacks.
40
+ */
41
+ epoch: number;
42
+ ext?: Ext;
43
+ }
44
+
45
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
46
+ export type { Ext };
47
+
48
+ /** Trust Task type URI. */
49
+ export const TYPE_URI = "https://trusttasks.org/spec/rooms/keys/welcome/0.1" as const;
50
+
51
+ /** Stable alias for this specification's request payload shape. */
52
+ export type Payload = RoomsKeysWelcomePayload;
53
+
54
+ /** Trust Task response type URI (request type URI + "#response"). */
55
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/rooms/keys/welcome/0.1#response" as const;
56
+
57
+ /** Stable alias for this specification's success-response payload shape. */
58
+ export type Response = RoomsKeysWelcomeResponsePayload;
59
+
60
+ /**
61
+ * This specification's payload schema, as a value.
62
+ *
63
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
64
+ * rather than only as a `.json` file because TypeScript types are erased
65
+ * at runtime: without a schema a consumer has nothing to validate, and
66
+ * every REQUIRED payload member is optional in practice. Cross-file
67
+ * `$ref`s are already inlined, so it needs no resolver.
68
+ */
69
+ export const PAYLOAD_SCHEMA = {
70
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
71
+ "$id": "https://trusttasks.org/spec/rooms/keys/welcome/0.1",
72
+ "title": "Rooms Keys Welcome — payload",
73
+ "description": "A room's owner delivers an MLS Welcome to the agent that will hold a new member's room keys, so it can join the group. The Welcome carries the group's secrets sealed to the recipient's KeyPackage; a recipient that accepts one it was not invited to has been handed key material it should have refused.",
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": [
77
+ "roomId",
78
+ "welcome"
79
+ ],
80
+ "properties": {
81
+ "roomId": {
82
+ "type": "string",
83
+ "description": "The room being joined."
84
+ },
85
+ "welcome": {
86
+ "type": "string",
87
+ "description": "The MLS Welcome message, base64url."
88
+ },
89
+ "ratchetTree": {
90
+ "type": "string",
91
+ "description": "The group's ratchet tree, base64url, where the Welcome does not carry it as an extension. A joiner needs the tree to derive the group's secrets; omit it only where the group uses the ratchet-tree extension."
92
+ },
93
+ "invitation": {
94
+ "type": "string",
95
+ "description": "The invitation credential (VIC) the room issued to the joining party, serialized per the governing profile. This is what makes the Welcome acceptable: joining is a two-party act, and a recipient with no matching invitation MUST refuse."
96
+ },
97
+ "ext": {
98
+ "$ref": "#/$defs/Ext",
99
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
100
+ }
101
+ },
102
+ "$defs": {
103
+ "Response": {
104
+ "$anchor": "response",
105
+ "title": "Rooms Keys Welcome — response payload",
106
+ "description": "Success response to rooms/keys/welcome. Type https://trusttasks.org/spec/rooms/keys/welcome/0.1#response.",
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "required": [
110
+ "epoch"
111
+ ],
112
+ "properties": {
113
+ "epoch": {
114
+ "type": "integer",
115
+ "minimum": 0,
116
+ "description": "The MLS epoch the recipient joined at. The sender needs this to know which commits the recipient still lacks."
117
+ },
118
+ "ext": {
119
+ "$ref": "#/$defs/Ext"
120
+ }
121
+ }
122
+ },
123
+ "Ext": {
124
+ "title": "Ext",
125
+ "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.",
126
+ "type": "object",
127
+ "minProperties": 1,
128
+ "additionalProperties": true,
129
+ "propertyNames": {
130
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
131
+ }
132
+ }
133
+ }
134
+ } as const;
135
+
136
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
137
+ export const RESPONSE_PAYLOAD_SCHEMA = {
138
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
139
+ "$ref": "#/$defs/Response",
140
+ "$defs": {
141
+ "Response": {
142
+ "$anchor": "response",
143
+ "title": "Rooms Keys Welcome — response payload",
144
+ "description": "Success response to rooms/keys/welcome. Type https://trusttasks.org/spec/rooms/keys/welcome/0.1#response.",
145
+ "type": "object",
146
+ "additionalProperties": false,
147
+ "required": [
148
+ "epoch"
149
+ ],
150
+ "properties": {
151
+ "epoch": {
152
+ "type": "integer",
153
+ "minimum": 0,
154
+ "description": "The MLS epoch the recipient joined at. The sender needs this to know which commits the recipient still lacks."
155
+ },
156
+ "ext": {
157
+ "$ref": "#/$defs/Ext"
158
+ }
159
+ }
160
+ },
161
+ "Ext": {
162
+ "title": "Ext",
163
+ "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.",
164
+ "type": "object",
165
+ "minProperties": 1,
166
+ "additionalProperties": true,
167
+ "propertyNames": {
168
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
169
+ }
170
+ }
171
+ }
172
+ } as const;
173
+
174
+ /**
175
+ * SPEC.md §7.2 policy for the request variant, from this specification's
176
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
177
+ * per-specification and cannot be derived from the document alone, and
178
+ * item 2 needs the schema this carries.
179
+ */
180
+ export const SPEC = {
181
+ typeUri: TYPE_URI,
182
+ isBearer: false,
183
+ isProofRequired: true,
184
+ isRecipientRequired: true,
185
+ isIssuedAtRequired: true,
186
+ payloadSchema: PAYLOAD_SCHEMA,
187
+ } as const;
188
+
189
+ /**
190
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
191
+ * tracks the *issuer* party's requirement because a response swaps the
192
+ * parties (§7.3 item 5).
193
+ */
194
+ export const RESPONSE_SPEC = {
195
+ typeUri: RESPONSE_TYPE_URI,
196
+ isBearer: false,
197
+ isProofRequired: true,
198
+ isRecipientRequired: true,
199
+ isIssuedAtRequired: true,
200
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
201
+ } as const;