@interop/wallet-core 0.70.0 → 0.72.0

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 (165) hide show
  1. package/README.md +19 -11
  2. package/dist/clientAnnex/forget.d.ts.map +1 -1
  3. package/dist/clientAnnex/forget.js +4 -3
  4. package/dist/clientAnnex/forget.js.map +1 -1
  5. package/dist/clientAnnex/forgetLast.d.ts +55 -35
  6. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  7. package/dist/clientAnnex/forgetLast.js +87 -35
  8. package/dist/clientAnnex/forgetLast.js.map +1 -1
  9. package/dist/clientAnnex/gc.d.ts +48 -19
  10. package/dist/clientAnnex/gc.d.ts.map +1 -1
  11. package/dist/clientAnnex/gc.js +82 -31
  12. package/dist/clientAnnex/gc.js.map +1 -1
  13. package/dist/clientAnnex/grantRevocation.d.ts +137 -0
  14. package/dist/clientAnnex/grantRevocation.d.ts.map +1 -0
  15. package/dist/clientAnnex/grantRevocation.js +135 -0
  16. package/dist/clientAnnex/grantRevocation.js.map +1 -0
  17. package/dist/clientAnnex/index.d.ts +4 -2
  18. package/dist/clientAnnex/index.d.ts.map +1 -1
  19. package/dist/clientAnnex/index.js +2 -1
  20. package/dist/clientAnnex/index.js.map +1 -1
  21. package/dist/clientAnnex/ladderAnchored.d.ts +0 -22
  22. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  23. package/dist/clientAnnex/ladderAnchored.js +8 -34
  24. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  25. package/dist/clientAnnex/log.d.ts +65 -13
  26. package/dist/clientAnnex/log.d.ts.map +1 -1
  27. package/dist/clientAnnex/log.js +160 -67
  28. package/dist/clientAnnex/log.js.map +1 -1
  29. package/dist/clientAnnex/mend.js +51 -24
  30. package/dist/clientAnnex/mend.js.map +1 -1
  31. package/dist/clientAnnex/selfEnroll.js +1 -1
  32. package/dist/clientAnnex/selfEnroll.js.map +1 -1
  33. package/dist/clientAnnex/zcap.js +1 -1
  34. package/dist/clientAnnex/zcap.js.map +1 -1
  35. package/dist/clients/grantState.d.ts +6 -3
  36. package/dist/clients/grantState.d.ts.map +1 -1
  37. package/dist/clients/grantState.js +6 -3
  38. package/dist/clients/grantState.js.map +1 -1
  39. package/dist/clients/policy.d.ts.map +1 -1
  40. package/dist/clients/policy.js +3 -0
  41. package/dist/clients/policy.js.map +1 -1
  42. package/dist/enrollment/enrollment.js +1 -1
  43. package/dist/enrollment/enrollment.js.map +1 -1
  44. package/dist/index.d.ts +0 -3
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +0 -3
  47. package/dist/index.js.map +1 -1
  48. package/dist/keyring/fetch.d.ts +6 -2
  49. package/dist/keyring/fetch.d.ts.map +1 -1
  50. package/dist/keyring/fetch.js +7 -3
  51. package/dist/keyring/fetch.js.map +1 -1
  52. package/dist/keyring/index.d.ts +8 -6
  53. package/dist/keyring/index.d.ts.map +1 -1
  54. package/dist/keyring/index.js +8 -6
  55. package/dist/keyring/index.js.map +1 -1
  56. package/dist/keyring/kdf.d.ts +2 -2
  57. package/dist/keyring/kdf.d.ts.map +1 -1
  58. package/dist/keyring/kdf.js +2 -2
  59. package/dist/keyring/kdf.js.map +1 -1
  60. package/dist/keyring/unlockSpace.d.ts +45 -68
  61. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  62. package/dist/keyring/unlockSpace.js +66 -88
  63. package/dist/keyring/unlockSpace.js.map +1 -1
  64. package/dist/keys/userKey.js +1 -1
  65. package/dist/keys/userKey.js.map +1 -1
  66. package/dist/menders/derive.d.ts +85 -0
  67. package/dist/menders/derive.d.ts.map +1 -0
  68. package/dist/menders/derive.js +138 -0
  69. package/dist/menders/derive.js.map +1 -0
  70. package/dist/menders/ids.d.ts +20 -0
  71. package/dist/menders/ids.d.ts.map +1 -0
  72. package/dist/menders/ids.js +85 -0
  73. package/dist/menders/ids.js.map +1 -0
  74. package/dist/menders/index.d.ts +42 -0
  75. package/dist/menders/index.d.ts.map +1 -0
  76. package/dist/menders/index.js +37 -0
  77. package/dist/menders/index.js.map +1 -0
  78. package/dist/menders/registry.d.ts +84 -0
  79. package/dist/menders/registry.d.ts.map +1 -0
  80. package/dist/menders/registry.js +62 -0
  81. package/dist/menders/registry.js.map +1 -0
  82. package/dist/menders/runner.d.ts +143 -0
  83. package/dist/menders/runner.d.ts.map +1 -0
  84. package/dist/menders/runner.js +222 -0
  85. package/dist/menders/runner.js.map +1 -0
  86. package/dist/menders/types.d.ts +146 -0
  87. package/dist/menders/types.d.ts.map +1 -0
  88. package/dist/menders/types.js +2 -0
  89. package/dist/menders/types.js.map +1 -0
  90. package/dist/menders/vocabulary.d.ts +88 -0
  91. package/dist/menders/vocabulary.d.ts.map +1 -0
  92. package/dist/menders/vocabulary.js +83 -0
  93. package/dist/menders/vocabulary.js.map +1 -0
  94. package/dist/recovery/index.d.ts +1 -1
  95. package/dist/recovery/index.js +1 -1
  96. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  97. package/dist/recovery/recoveryWebvh.js +11 -17
  98. package/dist/recovery/recoveryWebvh.js.map +1 -1
  99. package/dist/resourceLog/document.d.ts.map +1 -1
  100. package/dist/resourceLog/document.js +30 -6
  101. package/dist/resourceLog/document.js.map +1 -1
  102. package/dist/space/activity.d.ts +70 -0
  103. package/dist/space/activity.d.ts.map +1 -1
  104. package/dist/space/activity.js +82 -0
  105. package/dist/space/activity.js.map +1 -1
  106. package/dist/space/deleteSpace.d.ts.map +1 -1
  107. package/dist/space/deleteSpace.js +6 -5
  108. package/dist/space/deleteSpace.js.map +1 -1
  109. package/dist/space/index.d.ts +1 -1
  110. package/dist/space/index.d.ts.map +1 -1
  111. package/dist/space/index.js +1 -1
  112. package/dist/space/index.js.map +1 -1
  113. package/dist/testing.d.ts +78 -0
  114. package/dist/testing.d.ts.map +1 -0
  115. package/dist/testing.js +89 -0
  116. package/dist/testing.js.map +1 -0
  117. package/dist/unlock/index.d.ts +2 -2
  118. package/dist/unlock/index.d.ts.map +1 -1
  119. package/dist/unlock/index.js +1 -1
  120. package/dist/unlock/retire.d.ts +20 -5
  121. package/dist/unlock/retire.d.ts.map +1 -1
  122. package/dist/unlock/retire.js.map +1 -1
  123. package/dist/unlock/standingClient.d.ts +1 -1
  124. package/dist/unlock/standingClient.d.ts.map +1 -1
  125. package/dist/unlock/standingClient.js +3 -3
  126. package/dist/unlock/standingClient.js.map +1 -1
  127. package/dist/unlock/standingWebvh.d.ts +22 -2
  128. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  129. package/dist/unlock/standingWebvh.js +22 -2
  130. package/dist/unlock/standingWebvh.js.map +1 -1
  131. package/dist/webvh/didWebvh.d.ts +33 -0
  132. package/dist/webvh/didWebvh.d.ts.map +1 -1
  133. package/dist/webvh/didWebvh.js +50 -11
  134. package/dist/webvh/didWebvh.js.map +1 -1
  135. package/dist/webvh/enrollClient.d.ts.map +1 -1
  136. package/dist/webvh/enrollClient.js +4 -16
  137. package/dist/webvh/enrollClient.js.map +1 -1
  138. package/dist/webvh/index.d.ts +14 -4
  139. package/dist/webvh/index.d.ts.map +1 -1
  140. package/dist/webvh/index.js +14 -4
  141. package/dist/webvh/index.js.map +1 -1
  142. package/dist/webvh/listClients.d.ts +47 -0
  143. package/dist/webvh/listClients.d.ts.map +1 -1
  144. package/dist/webvh/listClients.js +40 -1
  145. package/dist/webvh/listClients.js.map +1 -1
  146. package/dist/webvh/standingZcap.d.ts +66 -0
  147. package/dist/webvh/standingZcap.d.ts.map +1 -1
  148. package/dist/webvh/standingZcap.js +96 -0
  149. package/dist/webvh/standingZcap.js.map +1 -1
  150. package/dist/webvh/zcap.d.ts +1 -1
  151. package/dist/webvh/zcap.js +1 -1
  152. package/dist/webvh/zcap.js.map +1 -1
  153. package/package.json +18 -12
  154. package/dist/identity/agents.d.ts +0 -100
  155. package/dist/identity/agents.d.ts.map +0 -1
  156. package/dist/identity/agents.js +0 -120
  157. package/dist/identity/agents.js.map +0 -1
  158. package/dist/identity/index.d.ts +0 -24
  159. package/dist/identity/index.d.ts.map +0 -1
  160. package/dist/identity/index.js +0 -23
  161. package/dist/identity/index.js.map +0 -1
  162. package/dist/identity/keyResolver.d.ts +0 -30
  163. package/dist/identity/keyResolver.d.ts.map +0 -1
  164. package/dist/identity/keyResolver.js +0 -25
  165. package/dist/identity/keyResolver.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/menders/runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EACjB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,yBAAyB,CAAA;AAE7D;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IACrE;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA;IAC9C;;OAEG;IACH,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC/B;;;;OAIG;IACH,MAAM,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC9B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAA;CAChD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,SAAS,MAAM,GAAG,MAAM,KAC7B,qBAAqB,CAAC,QAAQ,CAAC,CAqBnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,wBAAsB,cAAc,CAClC,IAAI,EACJ,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,IAAI,SAAS,gBAAgB,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC5D,EACA,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,aAAa,EACb,IAAI,EACJ,SAAS,EACV,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC9C,OAAO,EAAE,YAAY,CAAA;IACrB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAA;IAC9B,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;IAC3D,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IACnC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;CACvD,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAqChC;AA6HD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAQhD"}
@@ -0,0 +1,222 @@
1
+ /**
2
+ * The `errorName` a normalized entry carries when a registration resolves
3
+ * with entries that do not match the invariants it reports.
4
+ */
5
+ export const MEND_REPORT_SHAPE_ERROR = 'MendReportShapeError';
6
+ /**
7
+ * Creates a report accumulator. Generic over the wallet's ceremony-id
8
+ * union, which defaults to `string`.
9
+ *
10
+ * @returns {MendReportAccumulator}
11
+ */
12
+ export function mendReportAccumulator() {
13
+ const recorded = [];
14
+ let resolveSettled = () => undefined;
15
+ const settled = new Promise(resolve => {
16
+ resolveSettled = resolve;
17
+ });
18
+ let assembled;
19
+ return {
20
+ report(entry) {
21
+ recorded.push(entry);
22
+ },
23
+ entries: () => [...recorded],
24
+ settle() {
25
+ if (!assembled) {
26
+ assembled = [...recorded];
27
+ resolveSettled(assembled);
28
+ }
29
+ return assembled;
30
+ },
31
+ settled
32
+ };
33
+ }
34
+ /**
35
+ * Runs one registration block: the registrations listed under `trigger`
36
+ * whose every reported invariant declares an authority the session holds
37
+ * and admits this login route, in list order.
38
+ *
39
+ * The discipline, in one place. An optional `seed` registration runs first,
40
+ * and its failure aborts the block: nothing behind it runs, which is what a
41
+ * rejected chain seed does today. Past the seed, a registration that throws
42
+ * warns once per reported invariant with that declaration's own `warn`
43
+ * string, reports `failed` for each of them, and the block carries on to
44
+ * the next registration. Only `err.name` rides a report: a thrown error's
45
+ * message routinely carries a DID or a Space id, so the error itself goes
46
+ * to the logger alone.
47
+ *
48
+ * A registration that resolves with the wrong number of entries, or with an
49
+ * entry whose `invariant` is not the id it reports at that position, is a
50
+ * programming error. It warns and is normalized to `failed` entries
51
+ * carrying {@link MEND_REPORT_SHAPE_ERROR} rather than throwing, so a
52
+ * mismatched adapter cannot tear a login.
53
+ *
54
+ * `trigger` is one of the two chain values, so a `ceremony-tail` entry is
55
+ * out of reach here. Such an entry has no registration at all: its body
56
+ * stays inside its ceremony's sequenced code and it reports from there.
57
+ *
58
+ * `Deps` is the wallet's own type, one object per registration block,
59
+ * handed to the seed and to every `converge` unread. This runner never
60
+ * inspects it, and the raw passphrase does not cross into this package.
61
+ *
62
+ * `registrations` overrides which registrations the block runs, for a wallet
63
+ * that runs one trigger's list in parts (a settle point partway through, say).
64
+ * The same authority and route tests still admit each one, and one listed
65
+ * under another trigger is refused, so the override narrows the block and
66
+ * never widens it.
67
+ *
68
+ * A registry may index converge-free sites beside its registrations -- a
69
+ * wallet's routing entries, or an entry whose own call site fires it -- and
70
+ * such a site is never executed here, whichever list the block runs from.
71
+ *
72
+ * @param options {object}
73
+ * @param options.registry {MenderRegistry} the wallet's declarations and
74
+ * its registrations
75
+ * @param options.trigger {ChainTrigger} which chain is running
76
+ * @param options.held {ReadonlyArray<Authority>} the session's held
77
+ * authorities, from `heldAuthorities`
78
+ * @param options.route {LoginRoute} the login route each declaration's
79
+ * `when` predicate reads
80
+ * @param options.deps {Deps} passed to the seed and to every `converge`
81
+ * @param options.logger {Logger} the wallet's own sink, so its warn
82
+ * copy keeps the wallet's namespace
83
+ * @param [options.registrations] {ReadonlyArray<Registration>} the
84
+ * registrations to run, in place of the ones the registry lists under
85
+ * `trigger`. Each is admitted by the same authority and route tests
86
+ * @param [options.seed] {Registration} the step whose failure aborts the
87
+ * block. Admitted by the same authority and route tests as any other
88
+ * registration; one it does not pass is skipped rather than failed
89
+ * @param [options.onOutcome] {(entry: MendReportEntry) => void} called
90
+ * once per reported entry, in order. The single place a chain entry's
91
+ * outcome is reported
92
+ * @returns {Promise<MendReport>} the block's entries in order. It never
93
+ * rejects; a seed failure resolves with the seed's `failed` entries alone
94
+ * @throws {TypeError} when the seed or an override registration is listed
95
+ * under a trigger other than `trigger`, a programming error
96
+ */
97
+ export async function runMenderBlock({ registry, trigger, held, route, deps, logger, registrations, seed, onOutcome }) {
98
+ const report = [];
99
+ const collect = (entries) => {
100
+ for (const entry of entries) {
101
+ report.push(entry);
102
+ onOutcome?.(entry);
103
+ }
104
+ };
105
+ for (const supplied of [...(seed ? [seed] : []), ...(registrations ?? [])]) {
106
+ if (supplied.trigger !== trigger) {
107
+ throw new TypeError(`A ${supplied.trigger} registration was handed to the ${trigger} block`);
108
+ }
109
+ }
110
+ const admitted = (site) => registry.admits({ site, held, route });
111
+ const listed = (registrations?.filter(admitted) ?? registry.dueAt({ held, trigger, route })).filter((isRegistration));
112
+ // One ordered list, the seed first: the seed is the one step whose throw
113
+ // ends the block.
114
+ const steps = seed && admitted(seed) ? [seed, ...listed] : listed;
115
+ for (const registration of steps) {
116
+ const outcome = await runRegistration({
117
+ registry,
118
+ registration,
119
+ deps,
120
+ logger,
121
+ trigger
122
+ });
123
+ collect(outcome.entries);
124
+ if (outcome.threw && registration === seed) {
125
+ return report;
126
+ }
127
+ }
128
+ return report;
129
+ }
130
+ /**
131
+ * Runs one registration under the block's discipline, returning its entries
132
+ * and whether it threw.
133
+ */
134
+ async function runRegistration({ registry, registration, deps, logger, trigger }) {
135
+ try {
136
+ const entries = await registration.converge(deps);
137
+ if (!matchesReports({ registration, entries })) {
138
+ logger.warn('A mender registration returned entries that do not match the invariants it reports', { trigger, reports: [...registration.reports] });
139
+ // A malformed return is a defect in the adapter rather than a mend
140
+ // failure: the step ran to completion, so a malformed seed does not
141
+ // abort the block.
142
+ return {
143
+ entries: failedEntries({
144
+ registry,
145
+ registration,
146
+ errorName: MEND_REPORT_SHAPE_ERROR
147
+ }),
148
+ threw: false
149
+ };
150
+ }
151
+ return { entries, threw: false };
152
+ }
153
+ catch (err) {
154
+ for (const id of registration.reports) {
155
+ logger.warn(registry.byId(id)?.warn ?? `Could not converge ${id}`, {
156
+ invariant: id,
157
+ trigger,
158
+ err
159
+ });
160
+ }
161
+ return {
162
+ entries: failedEntries({
163
+ registry,
164
+ registration,
165
+ errorName: errorNameOf(err)
166
+ }),
167
+ threw: true
168
+ };
169
+ }
170
+ }
171
+ /**
172
+ * Whether a site carries a converger, so the block can run it. A wallet's
173
+ * registry indexes its converge-free sites beside its registrations.
174
+ *
175
+ * @param site {RegistrationSite}
176
+ * @returns {boolean}
177
+ */
178
+ function isRegistration(site) {
179
+ return typeof site.converge === 'function';
180
+ }
181
+ /**
182
+ * Whether a registration's entries name the invariants it reports, in that
183
+ * order.
184
+ */
185
+ function matchesReports({ registration, entries }) {
186
+ return (entries.length === registration.reports.length &&
187
+ entries.every((entry, index) => entry.invariant === registration.reports[index]));
188
+ }
189
+ /**
190
+ * One `failed` entry per reported invariant, carrying the declaration's
191
+ * ceremonies where it names any.
192
+ */
193
+ function failedEntries({ registry, registration, errorName }) {
194
+ return registration.reports.map(id => {
195
+ const ceremonies = registry.byId(id)?.ceremonies;
196
+ return {
197
+ invariant: id,
198
+ outcome: 'failed',
199
+ errorName,
200
+ ...(ceremonies && ceremonies.length > 0 ? { ceremonies } : {})
201
+ };
202
+ });
203
+ }
204
+ /**
205
+ * The thrown value's class name alone. Its message may carry a DID or a
206
+ * Space id, so a report keeps the name and the logger keeps the error. A
207
+ * value that is not an `Error` still yields a name, so a report site never
208
+ * carries `undefined` where a name belongs.
209
+ *
210
+ * @param err {unknown}
211
+ * @returns {string}
212
+ */
213
+ export function errorNameOf(err) {
214
+ if (err instanceof Error) {
215
+ return err.name;
216
+ }
217
+ if (typeof err === 'object' && err !== null && 'name' in err) {
218
+ return String(err.name);
219
+ }
220
+ return 'Error';
221
+ }
222
+ //# sourceMappingURL=runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/menders/runner.ts"],"names":[],"mappings":"AAyBA;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAAsB,CAAA;AA+B7D;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IAGnC,MAAM,QAAQ,GAAqC,EAAE,CAAA;IACrD,IAAI,cAAc,GAA2C,GAAG,EAAE,CAAC,SAAS,CAAA;IAC5E,MAAM,OAAO,GAAG,IAAI,OAAO,CAAuB,OAAO,CAAC,EAAE;QAC1D,cAAc,GAAG,OAAO,CAAA;IAC1B,CAAC,CAAC,CAAA;IACF,IAAI,SAA2C,CAAA;IAC/C,OAAO;QACL,MAAM,CAAC,KAAK;YACV,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtB,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC;QAC5B,MAAM;YACJ,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,SAAS,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAA;gBACzB,cAAc,CAAC,SAAS,CAAC,CA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,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/D,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QACzB,OAAO,GAAG,CAAC,IAAI,CAAA;IACjB,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;QAC7D,OAAO,MAAM,CAAE,GAAyB,CAAC,IAAI,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -0,0 +1,146 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The mender registry's structural types. A declaration is data: what must
6
+ * hold between ceremonies and, where the detector is separable, how to see
7
+ * it. A registration is code: the one place a callable `converge` lives,
8
+ * reporting one or more declared invariants. The registry is the
9
+ * declaration table plus the per-trigger registration lists, and the
10
+ * derived-set helpers read the converge-free `RegistrationSite` shape a
11
+ * registration extends, so an index of sites and a list of registrations
12
+ * feed the same readers.
13
+ */
14
+ import type { InvariantId } from './ids.js';
15
+ import type { AccountShape, Authority, Evidence, GapKind, MendOutcomeKind, Trigger } from './vocabulary.js';
16
+ /**
17
+ * The login route a declaration's `when` predicate reads: the popup axis
18
+ * alone today, the CHAPI popup being the one route on which several chain
19
+ * entries stand down.
20
+ */
21
+ export interface LoginRoute {
22
+ popup: boolean;
23
+ }
24
+ /**
25
+ * One invariant: a predicate over the account's server-held state (for a
26
+ * few entries, over this browser's local state) that must hold between
27
+ * ceremonies. Generic over the dependencies a wallet's detectors take and
28
+ * over the wallet's ceremony-id union, which defaults to `string` for a
29
+ * wallet that declares none.
30
+ */
31
+ export interface InvariantDeclaration<Deps, Ceremony extends string = string> {
32
+ /**
33
+ * The stable kebab-case key, naming the predicate rather than the code.
34
+ */
35
+ id: InvariantId;
36
+ /**
37
+ * One present-tense sentence stating what holds.
38
+ */
39
+ statement: string;
40
+ /**
41
+ * The account shapes on which a violation can stand un-mended.
42
+ */
43
+ standsOn: ReadonlyArray<AccountShape>;
44
+ /**
45
+ * The one authority a converger needs. A runtime filter at the two chain
46
+ * triggers; a declaration-time claim, checked by the entry's own call
47
+ * site, everywhere else.
48
+ */
49
+ authority: Authority;
50
+ /**
51
+ * Where the predicate is checked today.
52
+ */
53
+ triggers: ReadonlyArray<Trigger>;
54
+ /**
55
+ * The ceremonies whose torn runs can violate the predicate. May be
56
+ * empty: several invariants are violated by ordinary drift.
57
+ */
58
+ ceremonies: ReadonlyArray<Ceremony>;
59
+ /**
60
+ * What the detector trusts.
61
+ */
62
+ evidence: ReadonlyArray<Evidence>;
63
+ /**
64
+ * The warning a runner logs when a registration reporting this invariant
65
+ * throws.
66
+ */
67
+ warn: string;
68
+ /**
69
+ * The popup axis: whether the entry runs on this login route. Absent
70
+ * means every route.
71
+ */
72
+ when?(route: LoginRoute): boolean;
73
+ /**
74
+ * The separable detector, reading state alone. `undetermined` is what a
75
+ * transport failure returns, so a converger is never invited to write on
76
+ * a flap.
77
+ */
78
+ holdsWhen?(deps: Deps): Promise<'holds' | 'violated' | 'undetermined'>;
79
+ }
80
+ /**
81
+ * Where a registration sits: the trigger it is listed under and the
82
+ * invariants it reports, in report order. A routing site behind the
83
+ * client-key-record probe says so, since only a browser holding such a
84
+ * record reaches it; the guard is a routing-site member alone, so a chain
85
+ * or ceremony-tail site cannot carry one and the chain readers never have
86
+ * to honor it.
87
+ */
88
+ export type RegistrationSite = {
89
+ trigger: Exclude<Trigger, 'login-routing'>;
90
+ reports: ReadonlyArray<InvariantId>;
91
+ guardedBy?: undefined;
92
+ } | {
93
+ trigger: 'login-routing';
94
+ reports: ReadonlyArray<InvariantId>;
95
+ guardedBy?: 'client-key-record';
96
+ };
97
+ /**
98
+ * A registration: the code that converges the invariants it reports.
99
+ * `converge` returns exactly one entry per id in `reports`, in that order.
100
+ */
101
+ export type Registration<Deps, Ceremony extends string = string> = RegistrationSite & {
102
+ converge(deps: Deps): Promise<ReadonlyArray<MendReportEntry<Ceremony>>>;
103
+ };
104
+ /**
105
+ * The outcome of one mend attempt. `detail` is scalar only, so a later emit
106
+ * through the mender event channel needs no reshaping and no account
107
+ * identifier rides a report.
108
+ */
109
+ export interface MendOutcome {
110
+ outcome: MendOutcomeKind;
111
+ detail?: Record<string, string | number | boolean | undefined>;
112
+ /**
113
+ * The thrown error's class name alone; its message may carry a DID or a
114
+ * Space id, which a report never does.
115
+ */
116
+ errorName?: string;
117
+ }
118
+ /**
119
+ * One reported invariant's outcome.
120
+ */
121
+ export interface MendReportEntry<Ceremony extends string = string> extends MendOutcome {
122
+ invariant: InvariantId;
123
+ ceremonies?: ReadonlyArray<Ceremony>;
124
+ }
125
+ /**
126
+ * A login's or a ceremony's mend report.
127
+ */
128
+ export type MendReport<Ceremony extends string = string> = ReadonlyArray<MendReportEntry<Ceremony>>;
129
+ /**
130
+ * One declared gap, keyed by `{ invariant, tornState }`: one predicate can
131
+ * hold several torn states, and each is its own gap.
132
+ */
133
+ export interface InvariantGap {
134
+ invariant: InvariantId;
135
+ /**
136
+ * One sentence of prose naming the torn state.
137
+ */
138
+ tornState: string;
139
+ standsOn: ReadonlyArray<AccountShape>;
140
+ /**
141
+ * The tracking work item.
142
+ */
143
+ item: string;
144
+ kind: GapKind;
145
+ }
146
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/menders/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,eAAe,EACf,OAAO,EACR,MAAM,iBAAi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rB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;CACxE,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAA;IAC9D;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe,CAC9B,QAAQ,SAAS,MAAM,GAAG,MAAM,CAChC,SAAQ,WAAW;IACnB,SAAS,EAAE,WAAW,CAAA;IACtB,UAAU,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,aAAa,CACtE,eAAe,CAAC,QAAQ,CAAC,CAC1B,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,WAAW,CAAA;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;CACd"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/menders/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,88 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The closed vocabularies the mender registry is keyed on: the authority a
6
+ * converger needs, the trigger sites that check an invariant today, the
7
+ * account shapes a violation can stand on, the evidence a detector trusts,
8
+ * the mend outcomes, and the two gap kinds. Each is an `as const` array with
9
+ * its union, so extending one is a compile error rather than a drift. All
10
+ * are code-only; nothing persists them.
11
+ */
12
+ /**
13
+ * The one authority context a converger needs. `enrolled` and `ladder` are
14
+ * the two kinds the wallets' account-ceremony context resolves; `account`
15
+ * means either kind converges the invariant; `none` means no account
16
+ * authority at all (local cleanup, reads, writes the visit's own generation
17
+ * delegation covers).
18
+ */
19
+ export declare const AUTHORITIES: readonly ["none", "account", "enrolled", "ladder"];
20
+ /**
21
+ * One value of {@link AUTHORITIES}.
22
+ */
23
+ export type Authority = (typeof AUTHORITIES)[number];
24
+ /**
25
+ * Where an invariant is checked today. The two chain triggers are the
26
+ * login-time chains a remembered and a transient login seed; `login-routing`
27
+ * entries are invoked by name at a routing call site before or during
28
+ * session assembly and may refuse the login; `ceremony-tail` entries execute
29
+ * inside a ceremony's own sequenced code and only report through the
30
+ * registry.
31
+ */
32
+ export declare const TRIGGERS: readonly ["remembered-login-chain", "transient-login-chain", "login-routing", "ceremony-tail"];
33
+ /**
34
+ * One value of {@link TRIGGERS}.
35
+ */
36
+ export type Trigger = (typeof TRIGGERS)[number];
37
+ /**
38
+ * The two triggers a runner batches registrations for, and the only two the
39
+ * held-authority filter applies to.
40
+ */
41
+ export declare const CHAIN_TRIGGERS: readonly ["remembered-login-chain", "transient-login-chain"];
42
+ /**
43
+ * One value of {@link CHAIN_TRIGGERS}.
44
+ */
45
+ export type ChainTrigger = (typeof CHAIN_TRIGGERS)[number];
46
+ /**
47
+ * The account shapes a violation can stand on un-mended: `client-less` (a
48
+ * credential-anchored account with no enrolled client) and `enrolled` (an
49
+ * account with at least one enrolled client).
50
+ */
51
+ export declare const ACCOUNT_SHAPES: readonly ["client-less", "enrolled"];
52
+ /**
53
+ * One value of {@link ACCOUNT_SHAPES}.
54
+ */
55
+ export type AccountShape = (typeof ACCOUNT_SHAPES)[number];
56
+ /**
57
+ * What a detector trusts when it decides an invariant is violated. A
58
+ * `verified-log` read is checked under the visit's continuity pins; every
59
+ * `served-*` value and `host-listing` is host state taken as served; the two
60
+ * `local-*` values are this browser's own state and clock.
61
+ */
62
+ export declare const EVIDENCE: readonly ["verified-log", "served-registry", "served-unlock-record", "host-listing", "served-body", "served-projection", "local-record", "local-clock"];
63
+ /**
64
+ * One value of {@link EVIDENCE}.
65
+ */
66
+ export type Evidence = (typeof EVIDENCE)[number];
67
+ /**
68
+ * The outcome of one mend attempt, shared with the mender event channel so
69
+ * a report entry and an emitted event cannot diverge.
70
+ */
71
+ export declare const MEND_OUTCOMES: readonly ["clean", "noop", "partial", "refused", "failed"];
72
+ /**
73
+ * One value of {@link MEND_OUTCOMES}.
74
+ */
75
+ export type MendOutcomeKind = (typeof MEND_OUTCOMES)[number];
76
+ /**
77
+ * The two kinds of declared gap. `none`: no registration reports the
78
+ * invariant on any trigger, whether because no converger is built or because
79
+ * the code that converges it is not an addressable symbol. `unreachable`: a
80
+ * registration reports it, but only on triggers a credential-only visit on
81
+ * the affected account shape cannot fire.
82
+ */
83
+ export declare const GAP_KINDS: readonly ["none", "unreachable"];
84
+ /**
85
+ * One value of {@link GAP_KINDS}.
86
+ */
87
+ export type GapKind = (typeof GAP_KINDS)[number];
88
+ //# sourceMappingURL=vocabulary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/menders/vocabulary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,oDAAqD,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,gGAKX,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,cAAc,8DAGjB,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,cAAc,sCAAuC,CAAA;AAElE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,yJASX,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,aAAa,4DAMhB,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,kCAAmC,CAAA;AAEzD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA"}
@@ -0,0 +1,83 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The closed vocabularies the mender registry is keyed on: the authority a
6
+ * converger needs, the trigger sites that check an invariant today, the
7
+ * account shapes a violation can stand on, the evidence a detector trusts,
8
+ * the mend outcomes, and the two gap kinds. Each is an `as const` array with
9
+ * its union, so extending one is a compile error rather than a drift. All
10
+ * are code-only; nothing persists them.
11
+ */
12
+ /**
13
+ * The one authority context a converger needs. `enrolled` and `ladder` are
14
+ * the two kinds the wallets' account-ceremony context resolves; `account`
15
+ * means either kind converges the invariant; `none` means no account
16
+ * authority at all (local cleanup, reads, writes the visit's own generation
17
+ * delegation covers).
18
+ */
19
+ export const AUTHORITIES = ['none', 'account', 'enrolled', 'ladder'];
20
+ /**
21
+ * Where an invariant is checked today. The two chain triggers are the
22
+ * login-time chains a remembered and a transient login seed; `login-routing`
23
+ * entries are invoked by name at a routing call site before or during
24
+ * session assembly and may refuse the login; `ceremony-tail` entries execute
25
+ * inside a ceremony's own sequenced code and only report through the
26
+ * registry.
27
+ */
28
+ export const TRIGGERS = [
29
+ 'remembered-login-chain',
30
+ 'transient-login-chain',
31
+ 'login-routing',
32
+ 'ceremony-tail'
33
+ ];
34
+ /**
35
+ * The two triggers a runner batches registrations for, and the only two the
36
+ * held-authority filter applies to.
37
+ */
38
+ export const CHAIN_TRIGGERS = [
39
+ 'remembered-login-chain',
40
+ 'transient-login-chain'
41
+ ];
42
+ /**
43
+ * The account shapes a violation can stand on un-mended: `client-less` (a
44
+ * credential-anchored account with no enrolled client) and `enrolled` (an
45
+ * account with at least one enrolled client).
46
+ */
47
+ export const ACCOUNT_SHAPES = ['client-less', 'enrolled'];
48
+ /**
49
+ * What a detector trusts when it decides an invariant is violated. A
50
+ * `verified-log` read is checked under the visit's continuity pins; every
51
+ * `served-*` value and `host-listing` is host state taken as served; the two
52
+ * `local-*` values are this browser's own state and clock.
53
+ */
54
+ export const EVIDENCE = [
55
+ 'verified-log',
56
+ 'served-registry',
57
+ 'served-unlock-record',
58
+ 'host-listing',
59
+ 'served-body',
60
+ 'served-projection',
61
+ 'local-record',
62
+ 'local-clock'
63
+ ];
64
+ /**
65
+ * The outcome of one mend attempt, shared with the mender event channel so
66
+ * a report entry and an emitted event cannot diverge.
67
+ */
68
+ export const MEND_OUTCOMES = [
69
+ 'clean',
70
+ 'noop',
71
+ 'partial',
72
+ 'refused',
73
+ 'failed'
74
+ ];
75
+ /**
76
+ * The two kinds of declared gap. `none`: no registration reports the
77
+ * invariant on any trigger, whether because no converger is built or because
78
+ * the code that converges it is not an addressable symbol. `unreachable`: a
79
+ * registration reports it, but only on triggers a credential-only visit on
80
+ * the affected account shape cannot fire.
81
+ */
82
+ export const GAP_KINDS = ['none', 'unreachable'];
83
+ //# sourceMappingURL=vocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/menders/vocabulary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAA;AAO7E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,wBAAwB;IACxB,uBAAuB;IACvB,eAAe;IACf,eAAe;CACP,CAAA;AAOV;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,wBAAwB;IACxB,uBAAuB;CACf,CAAA;AAOV;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,UAAU,CAAU,CAAA;AAOlE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,cAAc;IACd,iBAAiB;IACjB,sBAAsB;IACtB,cAAc;IACd,aAAa;IACb,mBAAmB;IACnB,cAAc;IACd,aAAa;CACL,CAAA;AAOV;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO;IACP,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;CACA,CAAA;AAOV;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,aAAa,CAAU,CAAA"}
@@ -41,7 +41,7 @@
41
41
  * delegations stand for. A bridge is signed by its own credential's ladder
42
42
  * VM, so no ceremony re-mints another credential's.
43
43
  *
44
- * Kept out of the root export: this subpath pulls the webkms-client / ezcap /
44
+ * Kept out of the root export: this subpath pulls the capability-agent / ezcap /
45
45
  * was-client dependency graph (the same isolation pattern as `./keyring`).
46
46
  */
47
47
  export { decodeRecoveryCode, formatRecoveryCode, generateRecoveryCode, normalizeRecoveryCode, RECOVERY_CODE_BYTES, RECOVERY_KDF, RecoveryCodeInvalidError, recoveryClientFromCode } from './recoveryCode.js';
@@ -41,7 +41,7 @@
41
41
  * delegations stand for. A bridge is signed by its own credential's ladder
42
42
  * VM, so no ceremony re-mints another credential's.
43
43
  *
44
- * Kept out of the root export: this subpath pulls the webkms-client / ezcap /
44
+ * Kept out of the root export: this subpath pulls the capability-agent / ezcap /
45
45
  * was-client dependency graph (the same isolation pattern as `./keyring`).
46
46
  */
47
47
  export { decodeRecoveryCode, formatRecoveryCode, generateRecoveryCode, normalizeRecoveryCode, RECOVERY_CODE_BYTES, RECOVERY_KDF, RecoveryCodeInvalidError, recoveryClientFromCode } from './recoveryCode.js';
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryWebvh.d.ts","sourceRoot":"","sources":["../../src/recovery/recoveryWebvh.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAM/D,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC9B,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,YAAY,EACZ,6BAA6B,EAC9B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC9B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,WAA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E,mBAAmB,CAAA;IAClC,oBAAoB,EAAE,qBAAqB,CAAA;IAC3C,WAAW,EAAE,6BAA6B,CAAA;IAC1C,WAAW,EAAE,CAAC,SAAS,EAAE;QACvB,WAAW,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;KACjD,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,OAAO,CAAC;IACV,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,sBAAsB,EAAE,MAAM,EAAE,CAAA;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,wBAAwB,EAAE,MAAM,EAAE,CAAA;CACnC,CAAC,CA2DD"}
@@ -1,4 +1,4 @@
1
- import { assertCanonicalClientKeys, markedVerificationMethodPair, withLogConflictRetry } from '../webvh/didWebvh.js';
1
+ import { assertCanonicalClientKeys, clientAdditionFields, withLogConflictRetry } from '../webvh/didWebvh.js';
2
2
  import { publishUnlockKey, removeUnlockKey } from '../unlock/standingWebvh.js';
3
3
  import { recoveryContinuationOnce } from './continuation.js';
4
4
  // The continuation's shared core and the names both variants read live in
@@ -213,23 +213,17 @@ export async function recoverWebvhClient(options) {
213
213
  // client's key-agreement method alone carries the controller marker
214
214
  // (see clientKeyAgreementController) -- which is exactly what tells the
215
215
  // two simultaneously published keyAgreement methods apart. The marked
216
- // pair goes through the shared builder, which refuses a new client
217
- // whose key-agreement key is not its signing key's canonical twin; the
218
- // core appends the replacement code's unmarked method after it.
216
+ // pair and its relation membership come from the shared add-side
217
+ // builder, which refuses a new client whose key-agreement key is not
218
+ // its signing key's canonical twin; the core appends the replacement
219
+ // code's unmarked method after it.
219
220
  added: ({ did }) => {
220
- const signingVmId = `${did}#${newClientKeys.signingKeyMultibase}`;
221
- return {
222
- methods: markedVerificationMethodPair({
223
- controller: did,
224
- signingKeyMultibase: newClientKeys.signingKeyMultibase,
225
- keyAgreementKeyMultibase: newClientKeys.keyAgreementKeyMultibase
226
- }),
227
- authentication: [signingVmId],
228
- assertionMethod: [signingVmId],
229
- keyAgreement: [`${did}#${newClientKeys.keyAgreementKeyMultibase}`],
230
- capabilityInvocation: [signingVmId],
231
- capabilityDelegation: [signingVmId]
232
- };
221
+ const { methods, relations } = clientAdditionFields({
222
+ controller: did,
223
+ signingKeyMultibase: newClientKeys.signingKeyMultibase,
224
+ keyAgreementKeyMultibase: newClientKeys.keyAgreementKeyMultibase
225
+ });
226
+ return { methods, ...relations };
233
227
  },
234
228
  ...(expectedDid !== undefined ? { expectedDid } : {})
235
229
  }));