@openvtc/trust-tasks 0.28.23 → 0.28.24

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 (100) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/_shared/components.d.ts +520 -0
  3. package/dist/_shared/components.d.ts.map +1 -1
  4. package/dist/index.d.ts +45 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +45 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/messaging/mux/_shared/0.1/mux.d.ts +16 -0
  9. package/dist/messaging/mux/_shared/0.1/mux.d.ts.map +1 -0
  10. package/dist/messaging/mux/_shared/0.1/mux.js +6 -0
  11. package/dist/messaging/mux/_shared/0.1/mux.js.map +1 -0
  12. package/dist/messaging/mux/attach/0.1/payload.d.ts +996 -0
  13. package/dist/messaging/mux/attach/0.1/payload.d.ts.map +1 -0
  14. package/dist/messaging/mux/attach/0.1/payload.js +594 -0
  15. package/dist/messaging/mux/attach/0.1/payload.js.map +1 -0
  16. package/dist/messaging/mux/detach/0.1/payload.d.ts +398 -0
  17. package/dist/messaging/mux/detach/0.1/payload.d.ts.map +1 -0
  18. package/dist/messaging/mux/detach/0.1/payload.js +215 -0
  19. package/dist/messaging/mux/detach/0.1/payload.js.map +1 -0
  20. package/dist/messaging/mux/event/0.1/payload.d.ts +513 -0
  21. package/dist/messaging/mux/event/0.1/payload.d.ts.map +1 -0
  22. package/dist/messaging/mux/event/0.1/payload.js +260 -0
  23. package/dist/messaging/mux/event/0.1/payload.js.map +1 -0
  24. package/dist/messaging/mux/grant/0.1/payload.d.ts +1008 -0
  25. package/dist/messaging/mux/grant/0.1/payload.d.ts.map +1 -0
  26. package/dist/messaging/mux/grant/0.1/payload.js +606 -0
  27. package/dist/messaging/mux/grant/0.1/payload.js.map +1 -0
  28. package/dist/messaging/mux/list/0.1/payload.d.ts +1241 -0
  29. package/dist/messaging/mux/list/0.1/payload.d.ts.map +1 -0
  30. package/dist/messaging/mux/list/0.1/payload.js +715 -0
  31. package/dist/messaging/mux/list/0.1/payload.js.map +1 -0
  32. package/dist/messaging/mux/notice/0.1/payload.d.ts +489 -0
  33. package/dist/messaging/mux/notice/0.1/payload.d.ts.map +1 -0
  34. package/dist/messaging/mux/notice/0.1/payload.js +249 -0
  35. package/dist/messaging/mux/notice/0.1/payload.js.map +1 -0
  36. package/dist/messaging/mux/revoke/0.1/payload.d.ts +585 -0
  37. package/dist/messaging/mux/revoke/0.1/payload.d.ts.map +1 -0
  38. package/dist/messaging/mux/revoke/0.1/payload.js +311 -0
  39. package/dist/messaging/mux/revoke/0.1/payload.js.map +1 -0
  40. package/dist/messaging/mux/revoke-all/0.1/payload.d.ts +682 -0
  41. package/dist/messaging/mux/revoke-all/0.1/payload.d.ts.map +1 -0
  42. package/dist/messaging/mux/revoke-all/0.1/payload.js +397 -0
  43. package/dist/messaging/mux/revoke-all/0.1/payload.js.map +1 -0
  44. package/dist/messaging/mux/update/0.1/payload.d.ts +995 -0
  45. package/dist/messaging/mux/update/0.1/payload.d.ts.map +1 -0
  46. package/dist/messaging/mux/update/0.1/payload.js +586 -0
  47. package/dist/messaging/mux/update/0.1/payload.js.map +1 -0
  48. package/dist/vta/_shared/0.1/memory-record.d.ts +22 -0
  49. package/dist/vta/_shared/0.1/memory-record.d.ts.map +1 -0
  50. package/dist/vta/_shared/0.1/memory-record.js +6 -0
  51. package/dist/vta/_shared/0.1/memory-record.js.map +1 -0
  52. package/dist/vta/memory/delete/0.1/payload.d.ts +13 -2
  53. package/dist/vta/memory/delete/0.1/payload.d.ts.map +1 -1
  54. package/dist/vta/memory/delete/0.1/payload.js +1 -1
  55. package/dist/vta/memory/delete/0.1/payload.js.map +1 -1
  56. package/dist/vta/memory/delete/0.2/payload.d.ts +415 -0
  57. package/dist/vta/memory/delete/0.2/payload.d.ts.map +1 -0
  58. package/dist/vta/memory/delete/0.2/payload.js +224 -0
  59. package/dist/vta/memory/delete/0.2/payload.js.map +1 -0
  60. package/dist/vta/memory/get/0.1/payload.d.ts +646 -0
  61. package/dist/vta/memory/get/0.1/payload.d.ts.map +1 -0
  62. package/dist/vta/memory/get/0.1/payload.js +349 -0
  63. package/dist/vta/memory/get/0.1/payload.js.map +1 -0
  64. package/dist/vta/memory/list/0.1/payload.d.ts +13 -2
  65. package/dist/vta/memory/list/0.1/payload.d.ts.map +1 -1
  66. package/dist/vta/memory/list/0.1/payload.js +1 -1
  67. package/dist/vta/memory/list/0.1/payload.js.map +1 -1
  68. package/dist/vta/memory/list/0.2/payload.d.ts +693 -0
  69. package/dist/vta/memory/list/0.2/payload.d.ts.map +1 -0
  70. package/dist/vta/memory/list/0.2/payload.js +363 -0
  71. package/dist/vta/memory/list/0.2/payload.js.map +1 -0
  72. package/dist/vta/memory/put/0.1/payload.d.ts +13 -2
  73. package/dist/vta/memory/put/0.1/payload.d.ts.map +1 -1
  74. package/dist/vta/memory/put/0.1/payload.js +1 -1
  75. package/dist/vta/memory/put/0.1/payload.js.map +1 -1
  76. package/dist/vta/memory/put/0.2/payload.d.ts +490 -0
  77. package/dist/vta/memory/put/0.2/payload.d.ts.map +1 -0
  78. package/dist/vta/memory/put/0.2/payload.js +264 -0
  79. package/dist/vta/memory/put/0.2/payload.js.map +1 -0
  80. package/package.json +1 -1
  81. package/src/_shared/components.ts +581 -0
  82. package/src/index.ts +45 -0
  83. package/src/messaging/mux/_shared/0.1/mux.ts +17 -0
  84. package/src/messaging/mux/attach/0.1/payload.ts +682 -0
  85. package/src/messaging/mux/detach/0.1/payload.ts +278 -0
  86. package/src/messaging/mux/event/0.1/payload.ts +371 -0
  87. package/src/messaging/mux/grant/0.1/payload.ts +710 -0
  88. package/src/messaging/mux/list/0.1/payload.ts +793 -0
  89. package/src/messaging/mux/notice/0.1/payload.ts +362 -0
  90. package/src/messaging/mux/revoke/0.1/payload.ts +389 -0
  91. package/src/messaging/mux/revoke-all/0.1/payload.ts +452 -0
  92. package/src/messaging/mux/update/0.1/payload.ts +644 -0
  93. package/src/vta/_shared/0.1/memory-record.ts +23 -0
  94. package/src/vta/memory/delete/0.1/payload.ts +14 -3
  95. package/src/vta/memory/delete/0.2/payload.ts +288 -0
  96. package/src/vta/memory/get/0.1/payload.ts +414 -0
  97. package/src/vta/memory/list/0.1/payload.ts +14 -3
  98. package/src/vta/memory/list/0.2/payload.ts +445 -0
  99. package/src/vta/memory/put/0.1/payload.ts +14 -3
  100. package/src/vta/memory/put/0.2/payload.ts +333 -0
@@ -0,0 +1,793 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/messaging/mux/list/0.1/payload.schema.json
4
+ */
5
+
6
+ import type { AttachView, DataIntegrityProof, Ext, GrantId, GrantState, GrantStatement, GrantView, MuxDataIntegrityProof, MuxDid, MuxRole, MuxScope, MuxScopeValue, StatementScope } from "../../../../_shared/components.js";
7
+
8
+
9
+ /**
10
+ * List the delegations a requester holds as a principal, or those on a member DID it controls, a page at a time. The outer document members are owned by the framework — SPEC §6.3.
11
+ */
12
+ export interface MessagingMuxListPayload {
13
+ /**
14
+ * `principal`: the grants delegated to the requester, and the session attaches on this connection. `member`: the grants on a member DID, and its current epoch.
15
+ */
16
+ as: MuxRole;
17
+ /**
18
+ * As `principal`: only grants from this member DID. As `member`: the member DID to list; absent means the requester itself.
19
+ */
20
+ did?: MuxDid;
21
+ /**
22
+ * An opaque continuation token from a previous response's `nextCursor`, bound to the requester and the other request members; a responder MUST NOT accept a cursor it did not issue.
23
+ */
24
+ cursor?: string;
25
+ /**
26
+ * The most grants to return, at most 500; the responder chooses a default (100) and MAY return fewer.
27
+ */
28
+ limit?: number;
29
+ /**
30
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
31
+ */
32
+ ext?: Ext;
33
+ }
34
+ /**
35
+ * The success response to a messaging/mux/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/list/0.1#response.
36
+ */
37
+ export interface MessagingMuxListResponsePayload {
38
+ /**
39
+ * The view answered, echoing the request.
40
+ */
41
+ as: MuxRole;
42
+ /**
43
+ * Grants in every state, ordered by member DID then grant identifier as principal, and by principal DID then grant identifier as member.
44
+ *
45
+ * @maxItems 500
46
+ */
47
+ grants: GrantView[];
48
+ /**
49
+ * Principal view, first page only: the session attaches on the connection that carried the request. Absent when the request did not arrive on a mux connection.
50
+ *
51
+ * @maxItems 5000
52
+ */
53
+ attachments?: AttachView[];
54
+ /**
55
+ * Member view only: the member DID's current epoch, which a new grant must carry.
56
+ */
57
+ epoch?: number;
58
+ /**
59
+ * Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`.
60
+ */
61
+ nextCursor?: string;
62
+ /**
63
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
64
+ */
65
+ ext?: Ext;
66
+ }
67
+
68
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
69
+ export type { AttachView, DataIntegrityProof, Ext, GrantId, GrantState, GrantStatement, GrantView, MuxDataIntegrityProof, MuxDid, MuxRole, MuxScope, MuxScopeValue, StatementScope };
70
+
71
+ /** Trust Task type URI. */
72
+ export const TYPE_URI = "https://trusttasks.org/spec/messaging/mux/list/0.1" as const;
73
+
74
+ /**
75
+ * The earlier version of this specification that this one declares it
76
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
77
+ * `null`. Only the direct declaration — follow the chain with
78
+ * `extendsChain` / `readForSpec`.
79
+ */
80
+ export const EXTENDS: string | null = null;
81
+
82
+ /**
83
+ * Why this version is deprecated, or `null` while it is current. A
84
+ * superseded or retired version is still supported, and is withdrawn from
85
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
86
+ * Versions").
87
+ */
88
+ export const DEPRECATION: string | null = null;
89
+
90
+ /** Stable alias for this specification's request payload shape. */
91
+ export type Payload = MessagingMuxListPayload;
92
+
93
+ /** Trust Task response type URI (request type URI + "#response"). */
94
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/messaging/mux/list/0.1#response" as const;
95
+
96
+ /** Stable alias for this specification's success-response payload shape. */
97
+ export type Response = MessagingMuxListResponsePayload;
98
+
99
+ /**
100
+ * This specification's payload schema, as a value.
101
+ *
102
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
103
+ * rather than only as a `.json` file because TypeScript types are erased
104
+ * at runtime: without a schema a consumer has nothing to validate, and
105
+ * every REQUIRED payload member is optional in practice. Cross-file
106
+ * `$ref`s are already inlined, so it needs no resolver.
107
+ */
108
+ export const PAYLOAD_SCHEMA = {
109
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
110
+ "$id": "https://trusttasks.org/spec/messaging/mux/list/0.1",
111
+ "title": "Messaging — Mux List — payload",
112
+ "description": "List the delegations a requester holds as a principal, or those on a member DID it controls, a page at a time. The outer document members are owned by the framework — SPEC §6.3.",
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "required": [
116
+ "as"
117
+ ],
118
+ "properties": {
119
+ "as": {
120
+ "$ref": "#/$defs/MuxRole",
121
+ "description": "`principal`: the grants delegated to the requester, and the session attaches on this connection. `member`: the grants on a member DID, and its current epoch."
122
+ },
123
+ "did": {
124
+ "$ref": "#/$defs/MuxDid",
125
+ "description": "As `principal`: only grants from this member DID. As `member`: the member DID to list; absent means the requester itself."
126
+ },
127
+ "cursor": {
128
+ "type": "string",
129
+ "minLength": 1,
130
+ "maxLength": 1024,
131
+ "description": "An opaque continuation token from a previous response's `nextCursor`, bound to the requester and the other request members; a responder MUST NOT accept a cursor it did not issue."
132
+ },
133
+ "limit": {
134
+ "type": "integer",
135
+ "minimum": 1,
136
+ "maximum": 500,
137
+ "description": "The most grants to return, at most 500; the responder chooses a default (100) and MAY return fewer."
138
+ },
139
+ "ext": {
140
+ "$ref": "#/$defs/Ext",
141
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
142
+ }
143
+ },
144
+ "$defs": {
145
+ "Response": {
146
+ "$anchor": "response",
147
+ "title": "Messaging — Mux List — response payload",
148
+ "description": "The success response to a messaging/mux/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/list/0.1#response.",
149
+ "type": "object",
150
+ "additionalProperties": false,
151
+ "required": [
152
+ "as",
153
+ "grants"
154
+ ],
155
+ "properties": {
156
+ "as": {
157
+ "$ref": "#/$defs/MuxRole",
158
+ "description": "The view answered, echoing the request."
159
+ },
160
+ "grants": {
161
+ "type": "array",
162
+ "maxItems": 500,
163
+ "items": {
164
+ "$ref": "#/$defs/GrantView"
165
+ },
166
+ "description": "Grants in every state, ordered by member DID then grant identifier as principal, and by principal DID then grant identifier as member."
167
+ },
168
+ "attachments": {
169
+ "type": "array",
170
+ "maxItems": 5000,
171
+ "items": {
172
+ "$ref": "#/$defs/AttachView"
173
+ },
174
+ "description": "Principal view, first page only: the session attaches on the connection that carried the request. Absent when the request did not arrive on a mux connection."
175
+ },
176
+ "epoch": {
177
+ "type": "integer",
178
+ "minimum": 0,
179
+ "description": "Member view only: the member DID's current epoch, which a new grant must carry."
180
+ },
181
+ "nextCursor": {
182
+ "type": "string",
183
+ "maxLength": 1024,
184
+ "description": "Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`."
185
+ },
186
+ "ext": {
187
+ "$ref": "#/$defs/Ext",
188
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
189
+ }
190
+ }
191
+ },
192
+ "Ext": {
193
+ "title": "Ext",
194
+ "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.",
195
+ "type": "object",
196
+ "minProperties": 1,
197
+ "additionalProperties": true,
198
+ "propertyNames": {
199
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
200
+ }
201
+ },
202
+ "AttachView": {
203
+ "title": "AttachView",
204
+ "type": "object",
205
+ "additionalProperties": false,
206
+ "required": [
207
+ "did",
208
+ "scope",
209
+ "expiresAt",
210
+ "deliveryActive"
211
+ ],
212
+ "description": "One session attach on a connection.",
213
+ "properties": {
214
+ "did": {
215
+ "$ref": "#/$defs/MuxDid",
216
+ "description": "The member DID."
217
+ },
218
+ "scope": {
219
+ "$ref": "#/$defs/MuxScope"
220
+ },
221
+ "expiresAt": {
222
+ "type": "string",
223
+ "format": "date-time",
224
+ "description": "When the attach lapses: its signed `exp`."
225
+ },
226
+ "deliveryActive": {
227
+ "type": "boolean",
228
+ "description": "False while live traffic for the member goes elsewhere — to the member DID's own direct connection, which takes precedence over a mux connection."
229
+ }
230
+ }
231
+ },
232
+ "MuxScope": {
233
+ "title": "MuxScope",
234
+ "type": "array",
235
+ "minItems": 1,
236
+ "maxItems": 16,
237
+ "items": {
238
+ "$ref": "#/$defs/MuxScopeValue"
239
+ },
240
+ "description": "A set of capabilities: a non-empty JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses into one. Never empty: an empty scope is refused, never read as \"all\". There is no default scope anywhere — every attach and every grant names its scope explicitly. A scope is always bounded by the member DID's own access-control capabilities at the mediator."
241
+ },
242
+ "MuxScopeValue": {
243
+ "title": "MuxScopeValue",
244
+ "type": "string",
245
+ "enum": [
246
+ "receive",
247
+ "pickup",
248
+ "delete",
249
+ "send"
250
+ ],
251
+ "description": "One capability a member DID extends to a principal's connection. `receive`: live delivery of the member's inbound messages on the connection. `pickup`: message-pickup status and delivery requests naming the member as `recipient_did`, and inclusion in a raw-TSP inbox drain. `delete`: deleting the member's stored messages, including delete-on-ack and delete-on-send; a member without `delete` keeps its messages in its inbox until something holding `delete` collects them. `send`: the mediator accepts on this connection frames whose sender is the member DID — the frame is still signed or authcrypted with the member's own keys; the scope only lets the mediator accept it on this socket."
252
+ },
253
+ "MuxDid": {
254
+ "title": "MuxDid",
255
+ "type": "string",
256
+ "minLength": 7,
257
+ "maxLength": 2048,
258
+ "pattern": "^did:[a-z0-9]+:\\S+$",
259
+ "description": "A DID, carried verbatim and compared by exact string equality. Unlike the messaging family's `Vid`, never a hash: the mediator resolves it to verify a statement signed by it. For a member DID reached over TSP, the TSP VID is the DID itself."
260
+ },
261
+ "GrantView": {
262
+ "title": "GrantView",
263
+ "type": "object",
264
+ "additionalProperties": false,
265
+ "required": [
266
+ "statement",
267
+ "state",
268
+ "scope",
269
+ "expiresAt"
270
+ ],
271
+ "description": "The mediator's view of one stored grant, as messaging/mux/list and messaging/mux/update return it: the grant statement verbatim, with the state and the effective scope and expiry beside it.",
272
+ "properties": {
273
+ "statement": {
274
+ "$ref": "#/$defs/GrantStatement",
275
+ "description": "The grant statement exactly as the member signed it and the mediator stored it, proof included, so either party can re-verify it."
276
+ },
277
+ "state": {
278
+ "$ref": "#/$defs/GrantState"
279
+ },
280
+ "scope": {
281
+ "$ref": "#/$defs/MuxScope",
282
+ "description": "The effective scope: the signed scope, or the narrower one messaging/mux/update set."
283
+ },
284
+ "expiresAt": {
285
+ "type": "string",
286
+ "format": "date-time",
287
+ "description": "The effective expiry: the signed `exp` rendered as RFC 3339, or the earlier one messaging/mux/update set."
288
+ },
289
+ "narrowed": {
290
+ "type": "boolean",
291
+ "description": "True when messaging/mux/update narrowed the effective scope or expiry below what the statement signs."
292
+ },
293
+ "attachedNow": {
294
+ "type": "boolean",
295
+ "description": "Principal view only: whether the member is attached through this grant to the connection that carried the list request."
296
+ }
297
+ }
298
+ },
299
+ "GrantState": {
300
+ "title": "GrantState",
301
+ "type": "string",
302
+ "enum": [
303
+ "active",
304
+ "suspended",
305
+ "staleKey",
306
+ "expired",
307
+ "epochRevoked"
308
+ ],
309
+ "description": "A stored grant's state. `active`: valid; the member is attached whenever the principal is connected. `suspended`: the member DID proved control with a key that signed none of its active grants (the unknown-key rule); terminal — the grant cannot be resumed and must be recreated by a fresh member signature. `staleKey`: the key that signed the grant is no longer in the member DID's current authentication relationship; terminal — it does not become active again if the key reappears. `expired`: an active grant past its effective expiry; computed when read, never stored. `epochRevoked`: the member DID advanced its epoch with messaging/mux/revoke-all. A grant revoked with messaging/mux/revoke has no state: it is deleted. A dead grant (every state but `active`) stays listable for the mediator's retention window after its effective expiry, then is pruned."
310
+ },
311
+ "GrantStatement": {
312
+ "title": "GrantStatement",
313
+ "type": "object",
314
+ "additionalProperties": false,
315
+ "required": [
316
+ "type",
317
+ "issuer",
318
+ "audience",
319
+ "grantId",
320
+ "principal",
321
+ "scope",
322
+ "epoch",
323
+ "iat",
324
+ "exp",
325
+ "proof"
326
+ ],
327
+ "description": "A member DID's standing statement that the named principal may carry its traffic at this mediator, on any connection, until `exp`, within `scope`, under the member's current `epoch`. Signed by the member with an embedded Data Integrity proof whose purpose is `authentication`, and stored verbatim by the mediator as the only evidence of the delegation.",
328
+ "properties": {
329
+ "type": {
330
+ "type": "string",
331
+ "const": "muxGrant",
332
+ "description": "Always `muxGrant`; names the statement kind, so a statement of one kind is never accepted as another."
333
+ },
334
+ "issuer": {
335
+ "$ref": "#/$defs/MuxDid",
336
+ "description": "The member DID: the signer, and the DID the statement concerns."
337
+ },
338
+ "audience": {
339
+ "$ref": "#/$defs/MuxDid",
340
+ "description": "The mediator's DID. A statement names exactly one mediator and is refused by every other."
341
+ },
342
+ "grantId": {
343
+ "$ref": "#/$defs/GrantId"
344
+ },
345
+ "principal": {
346
+ "$ref": "#/$defs/MuxDid",
347
+ "description": "The principal DID that may carry the member's traffic. MUST differ from `issuer`."
348
+ },
349
+ "scope": {
350
+ "$ref": "#/$defs/StatementScope"
351
+ },
352
+ "epoch": {
353
+ "type": "integer",
354
+ "minimum": 0,
355
+ "description": "The member DID's current epoch at the mediator. Only messaging/mux/revoke-all advances it."
356
+ },
357
+ "iat": {
358
+ "type": "integer",
359
+ "minimum": 0,
360
+ "description": "JWT NumericDate (RFC 7519 §2), whole seconds since 1970-01-01T00:00:00Z UTC: when the statement was signed. MUST NOT be more than 60 seconds in the mediator's future."
361
+ },
362
+ "exp": {
363
+ "type": "integer",
364
+ "minimum": 0,
365
+ "description": "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future."
366
+ },
367
+ "proof": {
368
+ "$ref": "#/$defs/MuxDataIntegrityProof"
369
+ }
370
+ }
371
+ },
372
+ "MuxDataIntegrityProof": {
373
+ "title": "MuxDataIntegrityProof",
374
+ "type": "object",
375
+ "additionalProperties": false,
376
+ "required": [
377
+ "type",
378
+ "cryptosuite",
379
+ "verificationMethod",
380
+ "proofPurpose",
381
+ "proofValue"
382
+ ],
383
+ "description": "The W3C Data Integrity proof embedded in a mux statement, made by the member DID: the format and verifier Trust Tasks already use for document proofs (SPEC §4.7). The proof covers the whole statement except `proof` itself, as the cryptosuite defines. Closed: a member Data Integrity defines but this list omits is refused.",
384
+ "properties": {
385
+ "type": {
386
+ "type": "string",
387
+ "const": "DataIntegrityProof"
388
+ },
389
+ "cryptosuite": {
390
+ "type": "string",
391
+ "enum": [
392
+ "eddsa-jcs-2022",
393
+ "eddsa-rdfc-2022"
394
+ ],
395
+ "description": "The W3C Data Integrity EdDSA cryptosuite used."
396
+ },
397
+ "verificationMethod": {
398
+ "type": "string",
399
+ "minLength": 5,
400
+ "maxLength": 2048,
401
+ "pattern": "^did:\\S+#\\S+$",
402
+ "description": "The DID URL of the verification method that signed. MUST be controlled by the statement's `issuer` and listed in that DID's current `authentication` relationship."
403
+ },
404
+ "proofPurpose": {
405
+ "type": "string",
406
+ "minLength": 1,
407
+ "maxLength": 64,
408
+ "description": "MUST be `authentication`. Any other value is refused with `messaging/mux:proofPurposeInvalid` — a proof made for another relationship (an `assertionMethod` credential signature, say) is never accepted as control of the DID."
409
+ },
410
+ "created": {
411
+ "type": "string",
412
+ "format": "date-time",
413
+ "description": "OPTIONAL: when the proof was made, as Data Integrity defines it. Covered by the proof; the statement's own `iat` is what the mediator checks."
414
+ },
415
+ "proofValue": {
416
+ "type": "string",
417
+ "minLength": 2,
418
+ "maxLength": 4096,
419
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
420
+ "description": "The multibase (base58btc) signature."
421
+ }
422
+ }
423
+ },
424
+ "StatementScope": {
425
+ "title": "StatementScope",
426
+ "type": "array",
427
+ "maxItems": 16,
428
+ "items": {
429
+ "$ref": "#/$defs/MuxScopeValue"
430
+ },
431
+ "description": "The scope a member DID signs into a statement: a JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses. It MUST NOT be empty; an empty signed scope is refused with the task's `emptyScope` code, never read as \"all\". Unlike MuxScope, emptiness is not a schema failure here, so that the refusal is reported per statement rather than failing the whole batch."
432
+ },
433
+ "GrantId": {
434
+ "title": "GrantId",
435
+ "type": "string",
436
+ "minLength": 1,
437
+ "maxLength": 128,
438
+ "pattern": "^[A-Za-z0-9._:-]+$",
439
+ "description": "A grant's identifier, chosen by the member DID's signer and carried in its grant statement; a UUID is RECOMMENDED. A mediator refuses a grant whose identifier is already on the member DID's record."
440
+ },
441
+ "MuxRole": {
442
+ "title": "MuxRole",
443
+ "type": "string",
444
+ "enum": [
445
+ "principal",
446
+ "member"
447
+ ],
448
+ "description": "The side of a delegation a requester acts as. `principal`: the DID that authenticated the connection and to which members' traffic is delegated. `member`: a DID whose traffic is delegated."
449
+ }
450
+ }
451
+ } as const;
452
+
453
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
454
+ export const RESPONSE_PAYLOAD_SCHEMA = {
455
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
456
+ "$ref": "#/$defs/Response",
457
+ "$defs": {
458
+ "Response": {
459
+ "$anchor": "response",
460
+ "title": "Messaging — Mux List — response payload",
461
+ "description": "The success response to a messaging/mux/list request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/list/0.1#response.",
462
+ "type": "object",
463
+ "additionalProperties": false,
464
+ "required": [
465
+ "as",
466
+ "grants"
467
+ ],
468
+ "properties": {
469
+ "as": {
470
+ "$ref": "#/$defs/MuxRole",
471
+ "description": "The view answered, echoing the request."
472
+ },
473
+ "grants": {
474
+ "type": "array",
475
+ "maxItems": 500,
476
+ "items": {
477
+ "$ref": "#/$defs/GrantView"
478
+ },
479
+ "description": "Grants in every state, ordered by member DID then grant identifier as principal, and by principal DID then grant identifier as member."
480
+ },
481
+ "attachments": {
482
+ "type": "array",
483
+ "maxItems": 5000,
484
+ "items": {
485
+ "$ref": "#/$defs/AttachView"
486
+ },
487
+ "description": "Principal view, first page only: the session attaches on the connection that carried the request. Absent when the request did not arrive on a mux connection."
488
+ },
489
+ "epoch": {
490
+ "type": "integer",
491
+ "minimum": 0,
492
+ "description": "Member view only: the member DID's current epoch, which a new grant must carry."
493
+ },
494
+ "nextCursor": {
495
+ "type": "string",
496
+ "maxLength": 1024,
497
+ "description": "Continuation token for the next page; pass it back as `cursor`. Absent on the last page — never `null`."
498
+ },
499
+ "ext": {
500
+ "$ref": "#/$defs/Ext",
501
+ "description": "Ecosystem-defined extension members per SPEC.md §4.5.1."
502
+ }
503
+ }
504
+ },
505
+ "Ext": {
506
+ "title": "Ext",
507
+ "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.",
508
+ "type": "object",
509
+ "minProperties": 1,
510
+ "additionalProperties": true,
511
+ "propertyNames": {
512
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
513
+ }
514
+ },
515
+ "AttachView": {
516
+ "title": "AttachView",
517
+ "type": "object",
518
+ "additionalProperties": false,
519
+ "required": [
520
+ "did",
521
+ "scope",
522
+ "expiresAt",
523
+ "deliveryActive"
524
+ ],
525
+ "description": "One session attach on a connection.",
526
+ "properties": {
527
+ "did": {
528
+ "$ref": "#/$defs/MuxDid",
529
+ "description": "The member DID."
530
+ },
531
+ "scope": {
532
+ "$ref": "#/$defs/MuxScope"
533
+ },
534
+ "expiresAt": {
535
+ "type": "string",
536
+ "format": "date-time",
537
+ "description": "When the attach lapses: its signed `exp`."
538
+ },
539
+ "deliveryActive": {
540
+ "type": "boolean",
541
+ "description": "False while live traffic for the member goes elsewhere — to the member DID's own direct connection, which takes precedence over a mux connection."
542
+ }
543
+ }
544
+ },
545
+ "MuxScope": {
546
+ "title": "MuxScope",
547
+ "type": "array",
548
+ "minItems": 1,
549
+ "maxItems": 16,
550
+ "items": {
551
+ "$ref": "#/$defs/MuxScopeValue"
552
+ },
553
+ "description": "A set of capabilities: a non-empty JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses into one. Never empty: an empty scope is refused, never read as \"all\". There is no default scope anywhere — every attach and every grant names its scope explicitly. A scope is always bounded by the member DID's own access-control capabilities at the mediator."
554
+ },
555
+ "MuxScopeValue": {
556
+ "title": "MuxScopeValue",
557
+ "type": "string",
558
+ "enum": [
559
+ "receive",
560
+ "pickup",
561
+ "delete",
562
+ "send"
563
+ ],
564
+ "description": "One capability a member DID extends to a principal's connection. `receive`: live delivery of the member's inbound messages on the connection. `pickup`: message-pickup status and delivery requests naming the member as `recipient_did`, and inclusion in a raw-TSP inbox drain. `delete`: deleting the member's stored messages, including delete-on-ack and delete-on-send; a member without `delete` keeps its messages in its inbox until something holding `delete` collects them. `send`: the mediator accepts on this connection frames whose sender is the member DID — the frame is still signed or authcrypted with the member's own keys; the scope only lets the mediator accept it on this socket."
565
+ },
566
+ "MuxDid": {
567
+ "title": "MuxDid",
568
+ "type": "string",
569
+ "minLength": 7,
570
+ "maxLength": 2048,
571
+ "pattern": "^did:[a-z0-9]+:\\S+$",
572
+ "description": "A DID, carried verbatim and compared by exact string equality. Unlike the messaging family's `Vid`, never a hash: the mediator resolves it to verify a statement signed by it. For a member DID reached over TSP, the TSP VID is the DID itself."
573
+ },
574
+ "GrantView": {
575
+ "title": "GrantView",
576
+ "type": "object",
577
+ "additionalProperties": false,
578
+ "required": [
579
+ "statement",
580
+ "state",
581
+ "scope",
582
+ "expiresAt"
583
+ ],
584
+ "description": "The mediator's view of one stored grant, as messaging/mux/list and messaging/mux/update return it: the grant statement verbatim, with the state and the effective scope and expiry beside it.",
585
+ "properties": {
586
+ "statement": {
587
+ "$ref": "#/$defs/GrantStatement",
588
+ "description": "The grant statement exactly as the member signed it and the mediator stored it, proof included, so either party can re-verify it."
589
+ },
590
+ "state": {
591
+ "$ref": "#/$defs/GrantState"
592
+ },
593
+ "scope": {
594
+ "$ref": "#/$defs/MuxScope",
595
+ "description": "The effective scope: the signed scope, or the narrower one messaging/mux/update set."
596
+ },
597
+ "expiresAt": {
598
+ "type": "string",
599
+ "format": "date-time",
600
+ "description": "The effective expiry: the signed `exp` rendered as RFC 3339, or the earlier one messaging/mux/update set."
601
+ },
602
+ "narrowed": {
603
+ "type": "boolean",
604
+ "description": "True when messaging/mux/update narrowed the effective scope or expiry below what the statement signs."
605
+ },
606
+ "attachedNow": {
607
+ "type": "boolean",
608
+ "description": "Principal view only: whether the member is attached through this grant to the connection that carried the list request."
609
+ }
610
+ }
611
+ },
612
+ "GrantState": {
613
+ "title": "GrantState",
614
+ "type": "string",
615
+ "enum": [
616
+ "active",
617
+ "suspended",
618
+ "staleKey",
619
+ "expired",
620
+ "epochRevoked"
621
+ ],
622
+ "description": "A stored grant's state. `active`: valid; the member is attached whenever the principal is connected. `suspended`: the member DID proved control with a key that signed none of its active grants (the unknown-key rule); terminal — the grant cannot be resumed and must be recreated by a fresh member signature. `staleKey`: the key that signed the grant is no longer in the member DID's current authentication relationship; terminal — it does not become active again if the key reappears. `expired`: an active grant past its effective expiry; computed when read, never stored. `epochRevoked`: the member DID advanced its epoch with messaging/mux/revoke-all. A grant revoked with messaging/mux/revoke has no state: it is deleted. A dead grant (every state but `active`) stays listable for the mediator's retention window after its effective expiry, then is pruned."
623
+ },
624
+ "GrantStatement": {
625
+ "title": "GrantStatement",
626
+ "type": "object",
627
+ "additionalProperties": false,
628
+ "required": [
629
+ "type",
630
+ "issuer",
631
+ "audience",
632
+ "grantId",
633
+ "principal",
634
+ "scope",
635
+ "epoch",
636
+ "iat",
637
+ "exp",
638
+ "proof"
639
+ ],
640
+ "description": "A member DID's standing statement that the named principal may carry its traffic at this mediator, on any connection, until `exp`, within `scope`, under the member's current `epoch`. Signed by the member with an embedded Data Integrity proof whose purpose is `authentication`, and stored verbatim by the mediator as the only evidence of the delegation.",
641
+ "properties": {
642
+ "type": {
643
+ "type": "string",
644
+ "const": "muxGrant",
645
+ "description": "Always `muxGrant`; names the statement kind, so a statement of one kind is never accepted as another."
646
+ },
647
+ "issuer": {
648
+ "$ref": "#/$defs/MuxDid",
649
+ "description": "The member DID: the signer, and the DID the statement concerns."
650
+ },
651
+ "audience": {
652
+ "$ref": "#/$defs/MuxDid",
653
+ "description": "The mediator's DID. A statement names exactly one mediator and is refused by every other."
654
+ },
655
+ "grantId": {
656
+ "$ref": "#/$defs/GrantId"
657
+ },
658
+ "principal": {
659
+ "$ref": "#/$defs/MuxDid",
660
+ "description": "The principal DID that may carry the member's traffic. MUST differ from `issuer`."
661
+ },
662
+ "scope": {
663
+ "$ref": "#/$defs/StatementScope"
664
+ },
665
+ "epoch": {
666
+ "type": "integer",
667
+ "minimum": 0,
668
+ "description": "The member DID's current epoch at the mediator. Only messaging/mux/revoke-all advances it."
669
+ },
670
+ "iat": {
671
+ "type": "integer",
672
+ "minimum": 0,
673
+ "description": "JWT NumericDate (RFC 7519 §2), whole seconds since 1970-01-01T00:00:00Z UTC: when the statement was signed. MUST NOT be more than 60 seconds in the mediator's future."
674
+ },
675
+ "exp": {
676
+ "type": "integer",
677
+ "minimum": 0,
678
+ "description": "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future."
679
+ },
680
+ "proof": {
681
+ "$ref": "#/$defs/MuxDataIntegrityProof"
682
+ }
683
+ }
684
+ },
685
+ "MuxDataIntegrityProof": {
686
+ "title": "MuxDataIntegrityProof",
687
+ "type": "object",
688
+ "additionalProperties": false,
689
+ "required": [
690
+ "type",
691
+ "cryptosuite",
692
+ "verificationMethod",
693
+ "proofPurpose",
694
+ "proofValue"
695
+ ],
696
+ "description": "The W3C Data Integrity proof embedded in a mux statement, made by the member DID: the format and verifier Trust Tasks already use for document proofs (SPEC §4.7). The proof covers the whole statement except `proof` itself, as the cryptosuite defines. Closed: a member Data Integrity defines but this list omits is refused.",
697
+ "properties": {
698
+ "type": {
699
+ "type": "string",
700
+ "const": "DataIntegrityProof"
701
+ },
702
+ "cryptosuite": {
703
+ "type": "string",
704
+ "enum": [
705
+ "eddsa-jcs-2022",
706
+ "eddsa-rdfc-2022"
707
+ ],
708
+ "description": "The W3C Data Integrity EdDSA cryptosuite used."
709
+ },
710
+ "verificationMethod": {
711
+ "type": "string",
712
+ "minLength": 5,
713
+ "maxLength": 2048,
714
+ "pattern": "^did:\\S+#\\S+$",
715
+ "description": "The DID URL of the verification method that signed. MUST be controlled by the statement's `issuer` and listed in that DID's current `authentication` relationship."
716
+ },
717
+ "proofPurpose": {
718
+ "type": "string",
719
+ "minLength": 1,
720
+ "maxLength": 64,
721
+ "description": "MUST be `authentication`. Any other value is refused with `messaging/mux:proofPurposeInvalid` — a proof made for another relationship (an `assertionMethod` credential signature, say) is never accepted as control of the DID."
722
+ },
723
+ "created": {
724
+ "type": "string",
725
+ "format": "date-time",
726
+ "description": "OPTIONAL: when the proof was made, as Data Integrity defines it. Covered by the proof; the statement's own `iat` is what the mediator checks."
727
+ },
728
+ "proofValue": {
729
+ "type": "string",
730
+ "minLength": 2,
731
+ "maxLength": 4096,
732
+ "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
733
+ "description": "The multibase (base58btc) signature."
734
+ }
735
+ }
736
+ },
737
+ "StatementScope": {
738
+ "title": "StatementScope",
739
+ "type": "array",
740
+ "maxItems": 16,
741
+ "items": {
742
+ "$ref": "#/$defs/MuxScopeValue"
743
+ },
744
+ "description": "The scope a member DID signs into a statement: a JSON array of MuxScopeValue, compared as a set — order is not significant and a repeated value collapses. It MUST NOT be empty; an empty signed scope is refused with the task's `emptyScope` code, never read as \"all\". Unlike MuxScope, emptiness is not a schema failure here, so that the refusal is reported per statement rather than failing the whole batch."
745
+ },
746
+ "GrantId": {
747
+ "title": "GrantId",
748
+ "type": "string",
749
+ "minLength": 1,
750
+ "maxLength": 128,
751
+ "pattern": "^[A-Za-z0-9._:-]+$",
752
+ "description": "A grant's identifier, chosen by the member DID's signer and carried in its grant statement; a UUID is RECOMMENDED. A mediator refuses a grant whose identifier is already on the member DID's record."
753
+ },
754
+ "MuxRole": {
755
+ "title": "MuxRole",
756
+ "type": "string",
757
+ "enum": [
758
+ "principal",
759
+ "member"
760
+ ],
761
+ "description": "The side of a delegation a requester acts as. `principal`: the DID that authenticated the connection and to which members' traffic is delegated. `member`: a DID whose traffic is delegated."
762
+ }
763
+ }
764
+ } as const;
765
+
766
+ /**
767
+ * SPEC.md §7.2 policy for the request variant, from this specification's
768
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
769
+ * per-specification and cannot be derived from the document alone, and
770
+ * item 2 needs the schema this carries.
771
+ */
772
+ export const SPEC = {
773
+ typeUri: TYPE_URI,
774
+ isBearer: false,
775
+ isProofRequired: false,
776
+ isRecipientRequired: true,
777
+ isIssuedAtRequired: false,
778
+ payloadSchema: PAYLOAD_SCHEMA,
779
+ } as const;
780
+
781
+ /**
782
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
783
+ * tracks the *issuer* party's requirement because a response swaps the
784
+ * parties (§7.3 item 5).
785
+ */
786
+ export const RESPONSE_SPEC = {
787
+ typeUri: RESPONSE_TYPE_URI,
788
+ isBearer: false,
789
+ isProofRequired: false,
790
+ isRecipientRequired: true,
791
+ isIssuedAtRequired: false,
792
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
793
+ } as const;