@openvtc/trust-tasks 0.28.23 → 0.28.25

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 +85 -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,1008 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/messaging/mux/grant/0.1/payload.schema.json
4
+ */
5
+ import type { DataIntegrityProof, Ext, GrantId, GrantStatement, MuxDataIntegrityProof, MuxDid, MuxScopeValue, StatementScope } from "../../../../_shared/components.js";
6
+ /**
7
+ * Store or replace grants: each a grant statement in which a member DID, with an embedded Data Integrity proof, delegates to a principal the carrying of its messages, under the member's current epoch and an explicit scope and expiry. The outer document members are owned by the framework — SPEC §6.3.
8
+ */
9
+ export interface MessagingMuxGrantPayload {
10
+ /**
11
+ * The grant statements to store; the member DID is each statement's `issuer`. Each is checked and answered on its own; the batch is never all-or-nothing.
12
+ *
13
+ * @minItems 1
14
+ * @maxItems 256
15
+ */
16
+ grants: [GrantStatement, ...GrantStatement[]];
17
+ /**
18
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
19
+ */
20
+ ext?: Ext;
21
+ }
22
+ /**
23
+ * The success response to a messaging/mux/grant request: one outcome per submitted grant, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/grant/0.1#response.
24
+ */
25
+ export interface MessagingMuxGrantResponsePayload {
26
+ /**
27
+ * @maxItems 256
28
+ */
29
+ results: GrantOutcome[];
30
+ /**
31
+ * Ecosystem-defined extension members per SPEC.md §4.5.1.
32
+ */
33
+ ext?: Ext;
34
+ }
35
+ /**
36
+ * The outcome for one submitted grant.
37
+ */
38
+ export interface GrantOutcome {
39
+ status: "stored" | "refused";
40
+ /**
41
+ * The grant's identifier, from its statement.
42
+ */
43
+ grantId: GrantId;
44
+ /**
45
+ * The member DID: the statement's `issuer`.
46
+ */
47
+ did: MuxDid;
48
+ /**
49
+ * The principal DID, from the statement.
50
+ */
51
+ principal: MuxDid;
52
+ /**
53
+ * Present exactly when `status` is `refused`: the first check the grant failed, in the order the specification lists them.
54
+ */
55
+ code?: "messaging/mux:statementProofInvalid" | "messaging/mux:didUnresolvable" | "messaging/mux:proofPurposeInvalid" | "messaging/mux:audienceMismatch" | "messaging/mux:principalMismatch" | "messaging/mux:notYetValid" | "messaging/mux:statementExpired" | "messaging/mux:lifetimeTooLong" | "messaging/mux:emptyScope" | "messaging/mux:accountUnavailable" | "messaging/mux:scopeNotPermitted" | "messaging/mux/grant:epochMismatch" | "messaging/mux/grant:replayed" | "messaging/mux/grant:grantIdReused" | "messaging/mux/grant:didQuota" | "messaging/mux/grant:principalQuota" | "messaging/mux/grant:contended";
56
+ /**
57
+ * Present exactly when `code` is `messaging/mux/grant:epochMismatch`: the member DID's current epoch, under which the member re-signs.
58
+ */
59
+ currentEpoch?: number;
60
+ /**
61
+ * Present exactly when `code` is `messaging/mux/grant:replayed`: the instant a replacement grant's `iat` must be strictly later than — the principal's replay floor for this member, or the `iat` of the grant it would replace, whichever is later.
62
+ */
63
+ replayFloorAt?: string;
64
+ /**
65
+ * Present when this grant replaced an earlier grant for the same member and principal, in whatever state that grant was. Replacing raises the principal's replay floor, so the replaced statement can never be stored again.
66
+ */
67
+ replacedGrantId?: GrantId;
68
+ /**
69
+ * Present exactly when `status` is `stored`: whether the member was attached at once to a connection the principal holds.
70
+ */
71
+ attachedNow?: boolean;
72
+ }
73
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
74
+ export type { DataIntegrityProof, Ext, GrantId, GrantStatement, MuxDataIntegrityProof, MuxDid, MuxScopeValue, StatementScope };
75
+ /** Trust Task type URI. */
76
+ export declare const TYPE_URI: "https://trusttasks.org/spec/messaging/mux/grant/0.1";
77
+ /**
78
+ * The earlier version of this specification that this one declares it
79
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
80
+ * `null`. Only the direct declaration — follow the chain with
81
+ * `extendsChain` / `readForSpec`.
82
+ */
83
+ export declare const EXTENDS: string | null;
84
+ /**
85
+ * Why this version is deprecated, or `null` while it is current. A
86
+ * superseded or retired version is still supported, and is withdrawn from
87
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
88
+ * Versions").
89
+ */
90
+ export declare const DEPRECATION: string | null;
91
+ /** Stable alias for this specification's request payload shape. */
92
+ export type Payload = MessagingMuxGrantPayload;
93
+ /** Trust Task response type URI (request type URI + "#response"). */
94
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/messaging/mux/grant/0.1#response";
95
+ /** Stable alias for this specification's success-response payload shape. */
96
+ export type Response = MessagingMuxGrantResponsePayload;
97
+ /**
98
+ * This specification's payload schema, as a value.
99
+ *
100
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
101
+ * rather than only as a `.json` file because TypeScript types are erased
102
+ * at runtime: without a schema a consumer has nothing to validate, and
103
+ * every REQUIRED payload member is optional in practice. Cross-file
104
+ * `$ref`s are already inlined, so it needs no resolver.
105
+ */
106
+ export declare const PAYLOAD_SCHEMA: {
107
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
108
+ readonly $id: "https://trusttasks.org/spec/messaging/mux/grant/0.1";
109
+ readonly title: "Messaging — Mux Grant — payload";
110
+ readonly description: "Store or replace grants: each a grant statement in which a member DID, with an embedded Data Integrity proof, delegates to a principal the carrying of its messages, under the member's current epoch and an explicit scope and expiry. The outer document members are owned by the framework — SPEC §6.3.";
111
+ readonly type: "object";
112
+ readonly additionalProperties: false;
113
+ readonly required: readonly ["grants"];
114
+ readonly properties: {
115
+ readonly grants: {
116
+ readonly type: "array";
117
+ readonly minItems: 1;
118
+ readonly maxItems: 256;
119
+ readonly description: "The grant statements to store; the member DID is each statement's `issuer`. Each is checked and answered on its own; the batch is never all-or-nothing.";
120
+ readonly items: {
121
+ readonly $ref: "#/$defs/GrantStatement";
122
+ };
123
+ };
124
+ readonly ext: {
125
+ readonly $ref: "#/$defs/Ext";
126
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
127
+ };
128
+ };
129
+ readonly $defs: {
130
+ readonly Response: {
131
+ readonly $anchor: "response";
132
+ readonly title: "Messaging — Mux Grant — response payload";
133
+ readonly description: "The success response to a messaging/mux/grant request: one outcome per submitted grant, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/grant/0.1#response.";
134
+ readonly type: "object";
135
+ readonly additionalProperties: false;
136
+ readonly required: readonly ["results"];
137
+ readonly properties: {
138
+ readonly results: {
139
+ readonly type: "array";
140
+ readonly maxItems: 256;
141
+ readonly items: {
142
+ readonly $ref: "#/$defs/GrantOutcome";
143
+ };
144
+ };
145
+ readonly ext: {
146
+ readonly $ref: "#/$defs/Ext";
147
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
148
+ };
149
+ };
150
+ };
151
+ readonly GrantOutcome: {
152
+ readonly title: "GrantOutcome";
153
+ readonly type: "object";
154
+ readonly additionalProperties: false;
155
+ readonly required: readonly ["status", "grantId", "did", "principal"];
156
+ readonly description: "The outcome for one submitted grant.";
157
+ readonly properties: {
158
+ readonly status: {
159
+ readonly type: "string";
160
+ readonly enum: readonly ["stored", "refused"];
161
+ };
162
+ readonly grantId: {
163
+ readonly $ref: "#/$defs/GrantId";
164
+ readonly description: "The grant's identifier, from its statement.";
165
+ };
166
+ readonly did: {
167
+ readonly $ref: "#/$defs/MuxDid";
168
+ readonly description: "The member DID: the statement's `issuer`.";
169
+ };
170
+ readonly principal: {
171
+ readonly $ref: "#/$defs/MuxDid";
172
+ readonly description: "The principal DID, from the statement.";
173
+ };
174
+ readonly code: {
175
+ readonly type: "string";
176
+ readonly enum: readonly ["messaging/mux:statementProofInvalid", "messaging/mux:didUnresolvable", "messaging/mux:proofPurposeInvalid", "messaging/mux:audienceMismatch", "messaging/mux:principalMismatch", "messaging/mux:notYetValid", "messaging/mux:statementExpired", "messaging/mux:lifetimeTooLong", "messaging/mux:emptyScope", "messaging/mux:accountUnavailable", "messaging/mux:scopeNotPermitted", "messaging/mux/grant:epochMismatch", "messaging/mux/grant:replayed", "messaging/mux/grant:grantIdReused", "messaging/mux/grant:didQuota", "messaging/mux/grant:principalQuota", "messaging/mux/grant:contended"];
177
+ readonly description: "Present exactly when `status` is `refused`: the first check the grant failed, in the order the specification lists them.";
178
+ };
179
+ readonly currentEpoch: {
180
+ readonly type: "integer";
181
+ readonly minimum: 0;
182
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:epochMismatch`: the member DID's current epoch, under which the member re-signs.";
183
+ };
184
+ readonly replayFloorAt: {
185
+ readonly type: "string";
186
+ readonly format: "date-time";
187
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:replayed`: the instant a replacement grant's `iat` must be strictly later than — the principal's replay floor for this member, or the `iat` of the grant it would replace, whichever is later.";
188
+ };
189
+ readonly replacedGrantId: {
190
+ readonly $ref: "#/$defs/GrantId";
191
+ readonly description: "Present when this grant replaced an earlier grant for the same member and principal, in whatever state that grant was. Replacing raises the principal's replay floor, so the replaced statement can never be stored again.";
192
+ };
193
+ readonly attachedNow: {
194
+ readonly type: "boolean";
195
+ readonly description: "Present exactly when `status` is `stored`: whether the member was attached at once to a connection the principal holds.";
196
+ };
197
+ };
198
+ };
199
+ readonly GrantId: {
200
+ readonly title: "GrantId";
201
+ readonly type: "string";
202
+ readonly minLength: 1;
203
+ readonly maxLength: 128;
204
+ readonly pattern: "^[A-Za-z0-9._:-]+$";
205
+ readonly 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.";
206
+ };
207
+ readonly MuxDid: {
208
+ readonly title: "MuxDid";
209
+ readonly type: "string";
210
+ readonly minLength: 7;
211
+ readonly maxLength: 2048;
212
+ readonly pattern: "^did:[a-z0-9]+:\\S+$";
213
+ readonly 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.";
214
+ };
215
+ readonly Ext: {
216
+ readonly title: "Ext";
217
+ readonly 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.";
218
+ readonly type: "object";
219
+ readonly minProperties: 1;
220
+ readonly additionalProperties: true;
221
+ readonly propertyNames: {
222
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
223
+ };
224
+ };
225
+ readonly GrantStatement: {
226
+ readonly title: "GrantStatement";
227
+ readonly type: "object";
228
+ readonly additionalProperties: false;
229
+ readonly required: readonly ["type", "issuer", "audience", "grantId", "principal", "scope", "epoch", "iat", "exp", "proof"];
230
+ readonly 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.";
231
+ readonly properties: {
232
+ readonly type: {
233
+ readonly type: "string";
234
+ readonly const: "muxGrant";
235
+ readonly description: "Always `muxGrant`; names the statement kind, so a statement of one kind is never accepted as another.";
236
+ };
237
+ readonly issuer: {
238
+ readonly $ref: "#/$defs/MuxDid";
239
+ readonly description: "The member DID: the signer, and the DID the statement concerns.";
240
+ };
241
+ readonly audience: {
242
+ readonly $ref: "#/$defs/MuxDid";
243
+ readonly description: "The mediator's DID. A statement names exactly one mediator and is refused by every other.";
244
+ };
245
+ readonly grantId: {
246
+ readonly $ref: "#/$defs/GrantId";
247
+ };
248
+ readonly principal: {
249
+ readonly $ref: "#/$defs/MuxDid";
250
+ readonly description: "The principal DID that may carry the member's traffic. MUST differ from `issuer`.";
251
+ };
252
+ readonly scope: {
253
+ readonly $ref: "#/$defs/StatementScope";
254
+ };
255
+ readonly epoch: {
256
+ readonly type: "integer";
257
+ readonly minimum: 0;
258
+ readonly description: "The member DID's current epoch at the mediator. Only messaging/mux/revoke-all advances it.";
259
+ };
260
+ readonly iat: {
261
+ readonly type: "integer";
262
+ readonly minimum: 0;
263
+ readonly 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.";
264
+ };
265
+ readonly exp: {
266
+ readonly type: "integer";
267
+ readonly minimum: 0;
268
+ readonly description: "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future.";
269
+ };
270
+ readonly proof: {
271
+ readonly $ref: "#/$defs/MuxDataIntegrityProof";
272
+ };
273
+ };
274
+ };
275
+ readonly MuxDataIntegrityProof: {
276
+ readonly title: "MuxDataIntegrityProof";
277
+ readonly type: "object";
278
+ readonly additionalProperties: false;
279
+ readonly required: readonly ["type", "cryptosuite", "verificationMethod", "proofPurpose", "proofValue"];
280
+ readonly 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.";
281
+ readonly properties: {
282
+ readonly type: {
283
+ readonly type: "string";
284
+ readonly const: "DataIntegrityProof";
285
+ };
286
+ readonly cryptosuite: {
287
+ readonly type: "string";
288
+ readonly enum: readonly ["eddsa-jcs-2022", "eddsa-rdfc-2022"];
289
+ readonly description: "The W3C Data Integrity EdDSA cryptosuite used.";
290
+ };
291
+ readonly verificationMethod: {
292
+ readonly type: "string";
293
+ readonly minLength: 5;
294
+ readonly maxLength: 2048;
295
+ readonly pattern: "^did:\\S+#\\S+$";
296
+ readonly 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.";
297
+ };
298
+ readonly proofPurpose: {
299
+ readonly type: "string";
300
+ readonly minLength: 1;
301
+ readonly maxLength: 64;
302
+ readonly 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.";
303
+ };
304
+ readonly created: {
305
+ readonly type: "string";
306
+ readonly format: "date-time";
307
+ readonly 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.";
308
+ };
309
+ readonly proofValue: {
310
+ readonly type: "string";
311
+ readonly minLength: 2;
312
+ readonly maxLength: 4096;
313
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
314
+ readonly description: "The multibase (base58btc) signature.";
315
+ };
316
+ };
317
+ };
318
+ readonly StatementScope: {
319
+ readonly title: "StatementScope";
320
+ readonly type: "array";
321
+ readonly maxItems: 16;
322
+ readonly items: {
323
+ readonly $ref: "#/$defs/MuxScopeValue";
324
+ };
325
+ readonly 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.";
326
+ };
327
+ readonly MuxScopeValue: {
328
+ readonly title: "MuxScopeValue";
329
+ readonly type: "string";
330
+ readonly enum: readonly ["receive", "pickup", "delete", "send"];
331
+ readonly 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.";
332
+ };
333
+ };
334
+ };
335
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
336
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
337
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
338
+ readonly $ref: "#/$defs/Response";
339
+ readonly $defs: {
340
+ readonly Response: {
341
+ readonly $anchor: "response";
342
+ readonly title: "Messaging — Mux Grant — response payload";
343
+ readonly description: "The success response to a messaging/mux/grant request: one outcome per submitted grant, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/grant/0.1#response.";
344
+ readonly type: "object";
345
+ readonly additionalProperties: false;
346
+ readonly required: readonly ["results"];
347
+ readonly properties: {
348
+ readonly results: {
349
+ readonly type: "array";
350
+ readonly maxItems: 256;
351
+ readonly items: {
352
+ readonly $ref: "#/$defs/GrantOutcome";
353
+ };
354
+ };
355
+ readonly ext: {
356
+ readonly $ref: "#/$defs/Ext";
357
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
358
+ };
359
+ };
360
+ };
361
+ readonly GrantOutcome: {
362
+ readonly title: "GrantOutcome";
363
+ readonly type: "object";
364
+ readonly additionalProperties: false;
365
+ readonly required: readonly ["status", "grantId", "did", "principal"];
366
+ readonly description: "The outcome for one submitted grant.";
367
+ readonly properties: {
368
+ readonly status: {
369
+ readonly type: "string";
370
+ readonly enum: readonly ["stored", "refused"];
371
+ };
372
+ readonly grantId: {
373
+ readonly $ref: "#/$defs/GrantId";
374
+ readonly description: "The grant's identifier, from its statement.";
375
+ };
376
+ readonly did: {
377
+ readonly $ref: "#/$defs/MuxDid";
378
+ readonly description: "The member DID: the statement's `issuer`.";
379
+ };
380
+ readonly principal: {
381
+ readonly $ref: "#/$defs/MuxDid";
382
+ readonly description: "The principal DID, from the statement.";
383
+ };
384
+ readonly code: {
385
+ readonly type: "string";
386
+ readonly enum: readonly ["messaging/mux:statementProofInvalid", "messaging/mux:didUnresolvable", "messaging/mux:proofPurposeInvalid", "messaging/mux:audienceMismatch", "messaging/mux:principalMismatch", "messaging/mux:notYetValid", "messaging/mux:statementExpired", "messaging/mux:lifetimeTooLong", "messaging/mux:emptyScope", "messaging/mux:accountUnavailable", "messaging/mux:scopeNotPermitted", "messaging/mux/grant:epochMismatch", "messaging/mux/grant:replayed", "messaging/mux/grant:grantIdReused", "messaging/mux/grant:didQuota", "messaging/mux/grant:principalQuota", "messaging/mux/grant:contended"];
387
+ readonly description: "Present exactly when `status` is `refused`: the first check the grant failed, in the order the specification lists them.";
388
+ };
389
+ readonly currentEpoch: {
390
+ readonly type: "integer";
391
+ readonly minimum: 0;
392
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:epochMismatch`: the member DID's current epoch, under which the member re-signs.";
393
+ };
394
+ readonly replayFloorAt: {
395
+ readonly type: "string";
396
+ readonly format: "date-time";
397
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:replayed`: the instant a replacement grant's `iat` must be strictly later than — the principal's replay floor for this member, or the `iat` of the grant it would replace, whichever is later.";
398
+ };
399
+ readonly replacedGrantId: {
400
+ readonly $ref: "#/$defs/GrantId";
401
+ readonly description: "Present when this grant replaced an earlier grant for the same member and principal, in whatever state that grant was. Replacing raises the principal's replay floor, so the replaced statement can never be stored again.";
402
+ };
403
+ readonly attachedNow: {
404
+ readonly type: "boolean";
405
+ readonly description: "Present exactly when `status` is `stored`: whether the member was attached at once to a connection the principal holds.";
406
+ };
407
+ };
408
+ };
409
+ readonly GrantId: {
410
+ readonly title: "GrantId";
411
+ readonly type: "string";
412
+ readonly minLength: 1;
413
+ readonly maxLength: 128;
414
+ readonly pattern: "^[A-Za-z0-9._:-]+$";
415
+ readonly 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.";
416
+ };
417
+ readonly MuxDid: {
418
+ readonly title: "MuxDid";
419
+ readonly type: "string";
420
+ readonly minLength: 7;
421
+ readonly maxLength: 2048;
422
+ readonly pattern: "^did:[a-z0-9]+:\\S+$";
423
+ readonly 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.";
424
+ };
425
+ readonly Ext: {
426
+ readonly title: "Ext";
427
+ readonly 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.";
428
+ readonly type: "object";
429
+ readonly minProperties: 1;
430
+ readonly additionalProperties: true;
431
+ readonly propertyNames: {
432
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
433
+ };
434
+ };
435
+ readonly GrantStatement: {
436
+ readonly title: "GrantStatement";
437
+ readonly type: "object";
438
+ readonly additionalProperties: false;
439
+ readonly required: readonly ["type", "issuer", "audience", "grantId", "principal", "scope", "epoch", "iat", "exp", "proof"];
440
+ readonly 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.";
441
+ readonly properties: {
442
+ readonly type: {
443
+ readonly type: "string";
444
+ readonly const: "muxGrant";
445
+ readonly description: "Always `muxGrant`; names the statement kind, so a statement of one kind is never accepted as another.";
446
+ };
447
+ readonly issuer: {
448
+ readonly $ref: "#/$defs/MuxDid";
449
+ readonly description: "The member DID: the signer, and the DID the statement concerns.";
450
+ };
451
+ readonly audience: {
452
+ readonly $ref: "#/$defs/MuxDid";
453
+ readonly description: "The mediator's DID. A statement names exactly one mediator and is refused by every other.";
454
+ };
455
+ readonly grantId: {
456
+ readonly $ref: "#/$defs/GrantId";
457
+ };
458
+ readonly principal: {
459
+ readonly $ref: "#/$defs/MuxDid";
460
+ readonly description: "The principal DID that may carry the member's traffic. MUST differ from `issuer`.";
461
+ };
462
+ readonly scope: {
463
+ readonly $ref: "#/$defs/StatementScope";
464
+ };
465
+ readonly epoch: {
466
+ readonly type: "integer";
467
+ readonly minimum: 0;
468
+ readonly description: "The member DID's current epoch at the mediator. Only messaging/mux/revoke-all advances it.";
469
+ };
470
+ readonly iat: {
471
+ readonly type: "integer";
472
+ readonly minimum: 0;
473
+ readonly 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.";
474
+ };
475
+ readonly exp: {
476
+ readonly type: "integer";
477
+ readonly minimum: 0;
478
+ readonly description: "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future.";
479
+ };
480
+ readonly proof: {
481
+ readonly $ref: "#/$defs/MuxDataIntegrityProof";
482
+ };
483
+ };
484
+ };
485
+ readonly MuxDataIntegrityProof: {
486
+ readonly title: "MuxDataIntegrityProof";
487
+ readonly type: "object";
488
+ readonly additionalProperties: false;
489
+ readonly required: readonly ["type", "cryptosuite", "verificationMethod", "proofPurpose", "proofValue"];
490
+ readonly 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.";
491
+ readonly properties: {
492
+ readonly type: {
493
+ readonly type: "string";
494
+ readonly const: "DataIntegrityProof";
495
+ };
496
+ readonly cryptosuite: {
497
+ readonly type: "string";
498
+ readonly enum: readonly ["eddsa-jcs-2022", "eddsa-rdfc-2022"];
499
+ readonly description: "The W3C Data Integrity EdDSA cryptosuite used.";
500
+ };
501
+ readonly verificationMethod: {
502
+ readonly type: "string";
503
+ readonly minLength: 5;
504
+ readonly maxLength: 2048;
505
+ readonly pattern: "^did:\\S+#\\S+$";
506
+ readonly 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.";
507
+ };
508
+ readonly proofPurpose: {
509
+ readonly type: "string";
510
+ readonly minLength: 1;
511
+ readonly maxLength: 64;
512
+ readonly 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.";
513
+ };
514
+ readonly created: {
515
+ readonly type: "string";
516
+ readonly format: "date-time";
517
+ readonly 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.";
518
+ };
519
+ readonly proofValue: {
520
+ readonly type: "string";
521
+ readonly minLength: 2;
522
+ readonly maxLength: 4096;
523
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
524
+ readonly description: "The multibase (base58btc) signature.";
525
+ };
526
+ };
527
+ };
528
+ readonly StatementScope: {
529
+ readonly title: "StatementScope";
530
+ readonly type: "array";
531
+ readonly maxItems: 16;
532
+ readonly items: {
533
+ readonly $ref: "#/$defs/MuxScopeValue";
534
+ };
535
+ readonly 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.";
536
+ };
537
+ readonly MuxScopeValue: {
538
+ readonly title: "MuxScopeValue";
539
+ readonly type: "string";
540
+ readonly enum: readonly ["receive", "pickup", "delete", "send"];
541
+ readonly 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.";
542
+ };
543
+ };
544
+ };
545
+ /**
546
+ * SPEC.md §7.2 policy for the request variant, from this specification's
547
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
548
+ * per-specification and cannot be derived from the document alone, and
549
+ * item 2 needs the schema this carries.
550
+ */
551
+ export declare const SPEC: {
552
+ readonly typeUri: "https://trusttasks.org/spec/messaging/mux/grant/0.1";
553
+ readonly isBearer: false;
554
+ readonly isProofRequired: true;
555
+ readonly isRecipientRequired: true;
556
+ readonly isIssuedAtRequired: true;
557
+ readonly payloadSchema: {
558
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
559
+ readonly $id: "https://trusttasks.org/spec/messaging/mux/grant/0.1";
560
+ readonly title: "Messaging — Mux Grant — payload";
561
+ readonly description: "Store or replace grants: each a grant statement in which a member DID, with an embedded Data Integrity proof, delegates to a principal the carrying of its messages, under the member's current epoch and an explicit scope and expiry. The outer document members are owned by the framework — SPEC §6.3.";
562
+ readonly type: "object";
563
+ readonly additionalProperties: false;
564
+ readonly required: readonly ["grants"];
565
+ readonly properties: {
566
+ readonly grants: {
567
+ readonly type: "array";
568
+ readonly minItems: 1;
569
+ readonly maxItems: 256;
570
+ readonly description: "The grant statements to store; the member DID is each statement's `issuer`. Each is checked and answered on its own; the batch is never all-or-nothing.";
571
+ readonly items: {
572
+ readonly $ref: "#/$defs/GrantStatement";
573
+ };
574
+ };
575
+ readonly ext: {
576
+ readonly $ref: "#/$defs/Ext";
577
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
578
+ };
579
+ };
580
+ readonly $defs: {
581
+ readonly Response: {
582
+ readonly $anchor: "response";
583
+ readonly title: "Messaging — Mux Grant — response payload";
584
+ readonly description: "The success response to a messaging/mux/grant request: one outcome per submitted grant, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/grant/0.1#response.";
585
+ readonly type: "object";
586
+ readonly additionalProperties: false;
587
+ readonly required: readonly ["results"];
588
+ readonly properties: {
589
+ readonly results: {
590
+ readonly type: "array";
591
+ readonly maxItems: 256;
592
+ readonly items: {
593
+ readonly $ref: "#/$defs/GrantOutcome";
594
+ };
595
+ };
596
+ readonly ext: {
597
+ readonly $ref: "#/$defs/Ext";
598
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
599
+ };
600
+ };
601
+ };
602
+ readonly GrantOutcome: {
603
+ readonly title: "GrantOutcome";
604
+ readonly type: "object";
605
+ readonly additionalProperties: false;
606
+ readonly required: readonly ["status", "grantId", "did", "principal"];
607
+ readonly description: "The outcome for one submitted grant.";
608
+ readonly properties: {
609
+ readonly status: {
610
+ readonly type: "string";
611
+ readonly enum: readonly ["stored", "refused"];
612
+ };
613
+ readonly grantId: {
614
+ readonly $ref: "#/$defs/GrantId";
615
+ readonly description: "The grant's identifier, from its statement.";
616
+ };
617
+ readonly did: {
618
+ readonly $ref: "#/$defs/MuxDid";
619
+ readonly description: "The member DID: the statement's `issuer`.";
620
+ };
621
+ readonly principal: {
622
+ readonly $ref: "#/$defs/MuxDid";
623
+ readonly description: "The principal DID, from the statement.";
624
+ };
625
+ readonly code: {
626
+ readonly type: "string";
627
+ readonly enum: readonly ["messaging/mux:statementProofInvalid", "messaging/mux:didUnresolvable", "messaging/mux:proofPurposeInvalid", "messaging/mux:audienceMismatch", "messaging/mux:principalMismatch", "messaging/mux:notYetValid", "messaging/mux:statementExpired", "messaging/mux:lifetimeTooLong", "messaging/mux:emptyScope", "messaging/mux:accountUnavailable", "messaging/mux:scopeNotPermitted", "messaging/mux/grant:epochMismatch", "messaging/mux/grant:replayed", "messaging/mux/grant:grantIdReused", "messaging/mux/grant:didQuota", "messaging/mux/grant:principalQuota", "messaging/mux/grant:contended"];
628
+ readonly description: "Present exactly when `status` is `refused`: the first check the grant failed, in the order the specification lists them.";
629
+ };
630
+ readonly currentEpoch: {
631
+ readonly type: "integer";
632
+ readonly minimum: 0;
633
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:epochMismatch`: the member DID's current epoch, under which the member re-signs.";
634
+ };
635
+ readonly replayFloorAt: {
636
+ readonly type: "string";
637
+ readonly format: "date-time";
638
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:replayed`: the instant a replacement grant's `iat` must be strictly later than — the principal's replay floor for this member, or the `iat` of the grant it would replace, whichever is later.";
639
+ };
640
+ readonly replacedGrantId: {
641
+ readonly $ref: "#/$defs/GrantId";
642
+ readonly description: "Present when this grant replaced an earlier grant for the same member and principal, in whatever state that grant was. Replacing raises the principal's replay floor, so the replaced statement can never be stored again.";
643
+ };
644
+ readonly attachedNow: {
645
+ readonly type: "boolean";
646
+ readonly description: "Present exactly when `status` is `stored`: whether the member was attached at once to a connection the principal holds.";
647
+ };
648
+ };
649
+ };
650
+ readonly GrantId: {
651
+ readonly title: "GrantId";
652
+ readonly type: "string";
653
+ readonly minLength: 1;
654
+ readonly maxLength: 128;
655
+ readonly pattern: "^[A-Za-z0-9._:-]+$";
656
+ readonly 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.";
657
+ };
658
+ readonly MuxDid: {
659
+ readonly title: "MuxDid";
660
+ readonly type: "string";
661
+ readonly minLength: 7;
662
+ readonly maxLength: 2048;
663
+ readonly pattern: "^did:[a-z0-9]+:\\S+$";
664
+ readonly 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.";
665
+ };
666
+ readonly Ext: {
667
+ readonly title: "Ext";
668
+ readonly 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.";
669
+ readonly type: "object";
670
+ readonly minProperties: 1;
671
+ readonly additionalProperties: true;
672
+ readonly propertyNames: {
673
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
674
+ };
675
+ };
676
+ readonly GrantStatement: {
677
+ readonly title: "GrantStatement";
678
+ readonly type: "object";
679
+ readonly additionalProperties: false;
680
+ readonly required: readonly ["type", "issuer", "audience", "grantId", "principal", "scope", "epoch", "iat", "exp", "proof"];
681
+ readonly 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.";
682
+ readonly properties: {
683
+ readonly type: {
684
+ readonly type: "string";
685
+ readonly const: "muxGrant";
686
+ readonly description: "Always `muxGrant`; names the statement kind, so a statement of one kind is never accepted as another.";
687
+ };
688
+ readonly issuer: {
689
+ readonly $ref: "#/$defs/MuxDid";
690
+ readonly description: "The member DID: the signer, and the DID the statement concerns.";
691
+ };
692
+ readonly audience: {
693
+ readonly $ref: "#/$defs/MuxDid";
694
+ readonly description: "The mediator's DID. A statement names exactly one mediator and is refused by every other.";
695
+ };
696
+ readonly grantId: {
697
+ readonly $ref: "#/$defs/GrantId";
698
+ };
699
+ readonly principal: {
700
+ readonly $ref: "#/$defs/MuxDid";
701
+ readonly description: "The principal DID that may carry the member's traffic. MUST differ from `issuer`.";
702
+ };
703
+ readonly scope: {
704
+ readonly $ref: "#/$defs/StatementScope";
705
+ };
706
+ readonly epoch: {
707
+ readonly type: "integer";
708
+ readonly minimum: 0;
709
+ readonly description: "The member DID's current epoch at the mediator. Only messaging/mux/revoke-all advances it.";
710
+ };
711
+ readonly iat: {
712
+ readonly type: "integer";
713
+ readonly minimum: 0;
714
+ readonly 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.";
715
+ };
716
+ readonly exp: {
717
+ readonly type: "integer";
718
+ readonly minimum: 0;
719
+ readonly description: "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future.";
720
+ };
721
+ readonly proof: {
722
+ readonly $ref: "#/$defs/MuxDataIntegrityProof";
723
+ };
724
+ };
725
+ };
726
+ readonly MuxDataIntegrityProof: {
727
+ readonly title: "MuxDataIntegrityProof";
728
+ readonly type: "object";
729
+ readonly additionalProperties: false;
730
+ readonly required: readonly ["type", "cryptosuite", "verificationMethod", "proofPurpose", "proofValue"];
731
+ readonly 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.";
732
+ readonly properties: {
733
+ readonly type: {
734
+ readonly type: "string";
735
+ readonly const: "DataIntegrityProof";
736
+ };
737
+ readonly cryptosuite: {
738
+ readonly type: "string";
739
+ readonly enum: readonly ["eddsa-jcs-2022", "eddsa-rdfc-2022"];
740
+ readonly description: "The W3C Data Integrity EdDSA cryptosuite used.";
741
+ };
742
+ readonly verificationMethod: {
743
+ readonly type: "string";
744
+ readonly minLength: 5;
745
+ readonly maxLength: 2048;
746
+ readonly pattern: "^did:\\S+#\\S+$";
747
+ readonly 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.";
748
+ };
749
+ readonly proofPurpose: {
750
+ readonly type: "string";
751
+ readonly minLength: 1;
752
+ readonly maxLength: 64;
753
+ readonly 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.";
754
+ };
755
+ readonly created: {
756
+ readonly type: "string";
757
+ readonly format: "date-time";
758
+ readonly 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.";
759
+ };
760
+ readonly proofValue: {
761
+ readonly type: "string";
762
+ readonly minLength: 2;
763
+ readonly maxLength: 4096;
764
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
765
+ readonly description: "The multibase (base58btc) signature.";
766
+ };
767
+ };
768
+ };
769
+ readonly StatementScope: {
770
+ readonly title: "StatementScope";
771
+ readonly type: "array";
772
+ readonly maxItems: 16;
773
+ readonly items: {
774
+ readonly $ref: "#/$defs/MuxScopeValue";
775
+ };
776
+ readonly 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.";
777
+ };
778
+ readonly MuxScopeValue: {
779
+ readonly title: "MuxScopeValue";
780
+ readonly type: "string";
781
+ readonly enum: readonly ["receive", "pickup", "delete", "send"];
782
+ readonly 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.";
783
+ };
784
+ };
785
+ };
786
+ };
787
+ /**
788
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
789
+ * tracks the *issuer* party's requirement because a response swaps the
790
+ * parties (§7.3 item 5).
791
+ */
792
+ export declare const RESPONSE_SPEC: {
793
+ readonly typeUri: "https://trusttasks.org/spec/messaging/mux/grant/0.1#response";
794
+ readonly isBearer: false;
795
+ readonly isProofRequired: false;
796
+ readonly isRecipientRequired: true;
797
+ readonly isIssuedAtRequired: true;
798
+ readonly payloadSchema: {
799
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
800
+ readonly $ref: "#/$defs/Response";
801
+ readonly $defs: {
802
+ readonly Response: {
803
+ readonly $anchor: "response";
804
+ readonly title: "Messaging — Mux Grant — response payload";
805
+ readonly description: "The success response to a messaging/mux/grant request: one outcome per submitted grant, in request order. Carried in a Trust Task document whose type is https://trusttasks.org/spec/messaging/mux/grant/0.1#response.";
806
+ readonly type: "object";
807
+ readonly additionalProperties: false;
808
+ readonly required: readonly ["results"];
809
+ readonly properties: {
810
+ readonly results: {
811
+ readonly type: "array";
812
+ readonly maxItems: 256;
813
+ readonly items: {
814
+ readonly $ref: "#/$defs/GrantOutcome";
815
+ };
816
+ };
817
+ readonly ext: {
818
+ readonly $ref: "#/$defs/Ext";
819
+ readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
820
+ };
821
+ };
822
+ };
823
+ readonly GrantOutcome: {
824
+ readonly title: "GrantOutcome";
825
+ readonly type: "object";
826
+ readonly additionalProperties: false;
827
+ readonly required: readonly ["status", "grantId", "did", "principal"];
828
+ readonly description: "The outcome for one submitted grant.";
829
+ readonly properties: {
830
+ readonly status: {
831
+ readonly type: "string";
832
+ readonly enum: readonly ["stored", "refused"];
833
+ };
834
+ readonly grantId: {
835
+ readonly $ref: "#/$defs/GrantId";
836
+ readonly description: "The grant's identifier, from its statement.";
837
+ };
838
+ readonly did: {
839
+ readonly $ref: "#/$defs/MuxDid";
840
+ readonly description: "The member DID: the statement's `issuer`.";
841
+ };
842
+ readonly principal: {
843
+ readonly $ref: "#/$defs/MuxDid";
844
+ readonly description: "The principal DID, from the statement.";
845
+ };
846
+ readonly code: {
847
+ readonly type: "string";
848
+ readonly enum: readonly ["messaging/mux:statementProofInvalid", "messaging/mux:didUnresolvable", "messaging/mux:proofPurposeInvalid", "messaging/mux:audienceMismatch", "messaging/mux:principalMismatch", "messaging/mux:notYetValid", "messaging/mux:statementExpired", "messaging/mux:lifetimeTooLong", "messaging/mux:emptyScope", "messaging/mux:accountUnavailable", "messaging/mux:scopeNotPermitted", "messaging/mux/grant:epochMismatch", "messaging/mux/grant:replayed", "messaging/mux/grant:grantIdReused", "messaging/mux/grant:didQuota", "messaging/mux/grant:principalQuota", "messaging/mux/grant:contended"];
849
+ readonly description: "Present exactly when `status` is `refused`: the first check the grant failed, in the order the specification lists them.";
850
+ };
851
+ readonly currentEpoch: {
852
+ readonly type: "integer";
853
+ readonly minimum: 0;
854
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:epochMismatch`: the member DID's current epoch, under which the member re-signs.";
855
+ };
856
+ readonly replayFloorAt: {
857
+ readonly type: "string";
858
+ readonly format: "date-time";
859
+ readonly description: "Present exactly when `code` is `messaging/mux/grant:replayed`: the instant a replacement grant's `iat` must be strictly later than — the principal's replay floor for this member, or the `iat` of the grant it would replace, whichever is later.";
860
+ };
861
+ readonly replacedGrantId: {
862
+ readonly $ref: "#/$defs/GrantId";
863
+ readonly description: "Present when this grant replaced an earlier grant for the same member and principal, in whatever state that grant was. Replacing raises the principal's replay floor, so the replaced statement can never be stored again.";
864
+ };
865
+ readonly attachedNow: {
866
+ readonly type: "boolean";
867
+ readonly description: "Present exactly when `status` is `stored`: whether the member was attached at once to a connection the principal holds.";
868
+ };
869
+ };
870
+ };
871
+ readonly GrantId: {
872
+ readonly title: "GrantId";
873
+ readonly type: "string";
874
+ readonly minLength: 1;
875
+ readonly maxLength: 128;
876
+ readonly pattern: "^[A-Za-z0-9._:-]+$";
877
+ readonly 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.";
878
+ };
879
+ readonly MuxDid: {
880
+ readonly title: "MuxDid";
881
+ readonly type: "string";
882
+ readonly minLength: 7;
883
+ readonly maxLength: 2048;
884
+ readonly pattern: "^did:[a-z0-9]+:\\S+$";
885
+ readonly 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.";
886
+ };
887
+ readonly Ext: {
888
+ readonly title: "Ext";
889
+ readonly 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.";
890
+ readonly type: "object";
891
+ readonly minProperties: 1;
892
+ readonly additionalProperties: true;
893
+ readonly propertyNames: {
894
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
895
+ };
896
+ };
897
+ readonly GrantStatement: {
898
+ readonly title: "GrantStatement";
899
+ readonly type: "object";
900
+ readonly additionalProperties: false;
901
+ readonly required: readonly ["type", "issuer", "audience", "grantId", "principal", "scope", "epoch", "iat", "exp", "proof"];
902
+ readonly 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.";
903
+ readonly properties: {
904
+ readonly type: {
905
+ readonly type: "string";
906
+ readonly const: "muxGrant";
907
+ readonly description: "Always `muxGrant`; names the statement kind, so a statement of one kind is never accepted as another.";
908
+ };
909
+ readonly issuer: {
910
+ readonly $ref: "#/$defs/MuxDid";
911
+ readonly description: "The member DID: the signer, and the DID the statement concerns.";
912
+ };
913
+ readonly audience: {
914
+ readonly $ref: "#/$defs/MuxDid";
915
+ readonly description: "The mediator's DID. A statement names exactly one mediator and is refused by every other.";
916
+ };
917
+ readonly grantId: {
918
+ readonly $ref: "#/$defs/GrantId";
919
+ };
920
+ readonly principal: {
921
+ readonly $ref: "#/$defs/MuxDid";
922
+ readonly description: "The principal DID that may carry the member's traffic. MUST differ from `issuer`.";
923
+ };
924
+ readonly scope: {
925
+ readonly $ref: "#/$defs/StatementScope";
926
+ };
927
+ readonly epoch: {
928
+ readonly type: "integer";
929
+ readonly minimum: 0;
930
+ readonly description: "The member DID's current epoch at the mediator. Only messaging/mux/revoke-all advances it.";
931
+ };
932
+ readonly iat: {
933
+ readonly type: "integer";
934
+ readonly minimum: 0;
935
+ readonly 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.";
936
+ };
937
+ readonly exp: {
938
+ readonly type: "integer";
939
+ readonly minimum: 0;
940
+ readonly description: "JWT NumericDate (RFC 7519 §2): when the statement stops being accepted. REQUIRED; MUST be after `iat` and in the future.";
941
+ };
942
+ readonly proof: {
943
+ readonly $ref: "#/$defs/MuxDataIntegrityProof";
944
+ };
945
+ };
946
+ };
947
+ readonly MuxDataIntegrityProof: {
948
+ readonly title: "MuxDataIntegrityProof";
949
+ readonly type: "object";
950
+ readonly additionalProperties: false;
951
+ readonly required: readonly ["type", "cryptosuite", "verificationMethod", "proofPurpose", "proofValue"];
952
+ readonly 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.";
953
+ readonly properties: {
954
+ readonly type: {
955
+ readonly type: "string";
956
+ readonly const: "DataIntegrityProof";
957
+ };
958
+ readonly cryptosuite: {
959
+ readonly type: "string";
960
+ readonly enum: readonly ["eddsa-jcs-2022", "eddsa-rdfc-2022"];
961
+ readonly description: "The W3C Data Integrity EdDSA cryptosuite used.";
962
+ };
963
+ readonly verificationMethod: {
964
+ readonly type: "string";
965
+ readonly minLength: 5;
966
+ readonly maxLength: 2048;
967
+ readonly pattern: "^did:\\S+#\\S+$";
968
+ readonly 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.";
969
+ };
970
+ readonly proofPurpose: {
971
+ readonly type: "string";
972
+ readonly minLength: 1;
973
+ readonly maxLength: 64;
974
+ readonly 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.";
975
+ };
976
+ readonly created: {
977
+ readonly type: "string";
978
+ readonly format: "date-time";
979
+ readonly 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.";
980
+ };
981
+ readonly proofValue: {
982
+ readonly type: "string";
983
+ readonly minLength: 2;
984
+ readonly maxLength: 4096;
985
+ readonly pattern: "^z[1-9A-HJ-NP-Za-km-z]+$";
986
+ readonly description: "The multibase (base58btc) signature.";
987
+ };
988
+ };
989
+ };
990
+ readonly StatementScope: {
991
+ readonly title: "StatementScope";
992
+ readonly type: "array";
993
+ readonly maxItems: 16;
994
+ readonly items: {
995
+ readonly $ref: "#/$defs/MuxScopeValue";
996
+ };
997
+ readonly 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.";
998
+ };
999
+ readonly MuxScopeValue: {
1000
+ readonly title: "MuxScopeValue";
1001
+ readonly type: "string";
1002
+ readonly enum: readonly ["receive", "pickup", "delete", "send"];
1003
+ readonly 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.";
1004
+ };
1005
+ };
1006
+ };
1007
+ };
1008
+ //# sourceMappingURL=payload.d.ts.map