@interop/wallet-core 0.66.0 → 0.68.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 (257) hide show
  1. package/README.md +12 -8
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +6 -10
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +34 -56
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +46 -29
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +111 -86
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +7 -16
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +13 -24
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +33 -129
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +43 -182
  17. package/dist/clientAnnex/forgetLast.js.map +1 -1
  18. package/dist/clientAnnex/gc.d.ts +26 -12
  19. package/dist/clientAnnex/gc.d.ts.map +1 -1
  20. package/dist/clientAnnex/gc.js +60 -57
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +75 -18
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +79 -147
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/index.d.ts +8 -8
  27. package/dist/clientAnnex/index.d.ts.map +1 -1
  28. package/dist/clientAnnex/index.js +5 -5
  29. package/dist/clientAnnex/index.js.map +1 -1
  30. package/dist/clientAnnex/ladder.d.ts +51 -4
  31. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  32. package/dist/clientAnnex/ladder.js +283 -47
  33. package/dist/clientAnnex/ladder.js.map +1 -1
  34. package/dist/clientAnnex/ladderAnchored.d.ts +62 -73
  35. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  36. package/dist/clientAnnex/ladderAnchored.js +103 -117
  37. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  38. package/dist/clientAnnex/log.d.ts +123 -125
  39. package/dist/clientAnnex/log.d.ts.map +1 -1
  40. package/dist/clientAnnex/log.js +174 -233
  41. package/dist/clientAnnex/log.js.map +1 -1
  42. package/dist/clientAnnex/mend.d.ts +0 -4
  43. package/dist/clientAnnex/mend.d.ts.map +1 -1
  44. package/dist/clientAnnex/mend.js +50 -51
  45. package/dist/clientAnnex/mend.js.map +1 -1
  46. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +25 -13
  47. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  48. package/dist/clientAnnex/recoveryLadderAnchored.js +80 -303
  49. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  50. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts +13 -5
  51. package/dist/clientAnnex/rosterDeliveredEpochs.d.ts.map +1 -1
  52. package/dist/clientAnnex/rosterDeliveredEpochs.js +18 -9
  53. package/dist/clientAnnex/rosterDeliveredEpochs.js.map +1 -1
  54. package/dist/clientAnnex/selfEnroll.d.ts +6 -10
  55. package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
  56. package/dist/clientAnnex/selfEnroll.js +13 -18
  57. package/dist/clientAnnex/selfEnroll.js.map +1 -1
  58. package/dist/clientAnnex/zcap.d.ts +19 -0
  59. package/dist/clientAnnex/zcap.d.ts.map +1 -1
  60. package/dist/clientAnnex/zcap.js +80 -12
  61. package/dist/clientAnnex/zcap.js.map +1 -1
  62. package/dist/clients/index.d.ts +3 -2
  63. package/dist/clients/index.d.ts.map +1 -1
  64. package/dist/clients/index.js +3 -2
  65. package/dist/clients/index.js.map +1 -1
  66. package/dist/clients/listing.d.ts.map +1 -1
  67. package/dist/clients/listing.js +33 -15
  68. package/dist/clients/listing.js.map +1 -1
  69. package/dist/clients/policy.d.ts +18 -0
  70. package/dist/clients/policy.d.ts.map +1 -1
  71. package/dist/clients/policy.js +22 -8
  72. package/dist/clients/policy.js.map +1 -1
  73. package/dist/clients/revocation.d.ts +18 -30
  74. package/dist/clients/revocation.d.ts.map +1 -1
  75. package/dist/clients/revocation.js +12 -27
  76. package/dist/clients/revocation.js.map +1 -1
  77. package/dist/clients/rosterPolicy.d.ts +6 -1
  78. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  79. package/dist/clients/rosterPolicy.js +27 -30
  80. package/dist/clients/rosterPolicy.js.map +1 -1
  81. package/dist/descriptors/errors.d.ts +6 -5
  82. package/dist/descriptors/errors.d.ts.map +1 -1
  83. package/dist/descriptors/errors.js +6 -5
  84. package/dist/descriptors/errors.js.map +1 -1
  85. package/dist/descriptors/index.d.ts +7 -3
  86. package/dist/descriptors/index.d.ts.map +1 -1
  87. package/dist/descriptors/index.js +7 -3
  88. package/dist/descriptors/index.js.map +1 -1
  89. package/dist/descriptors/logSource.d.ts +28 -6
  90. package/dist/descriptors/logSource.d.ts.map +1 -1
  91. package/dist/descriptors/logSource.js +33 -7
  92. package/dist/descriptors/logSource.js.map +1 -1
  93. package/dist/enrollment/enrollment.d.ts.map +1 -1
  94. package/dist/enrollment/enrollment.js +3 -7
  95. package/dist/enrollment/enrollment.js.map +1 -1
  96. package/dist/genesis/accountGenesis.d.ts +11 -16
  97. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  98. package/dist/genesis/accountGenesis.js +43 -47
  99. package/dist/genesis/accountGenesis.js.map +1 -1
  100. package/dist/genesis/kmsAuthentication.d.ts +50 -0
  101. package/dist/genesis/kmsAuthentication.d.ts.map +1 -0
  102. package/dist/genesis/kmsAuthentication.js +49 -0
  103. package/dist/genesis/kmsAuthentication.js.map +1 -0
  104. package/dist/keyring/kdf.d.ts +16 -20
  105. package/dist/keyring/kdf.d.ts.map +1 -1
  106. package/dist/keyring/kdf.js +2 -2
  107. package/dist/keyring/kdf.js.map +1 -1
  108. package/dist/keyring/unlockSpace.d.ts +8 -30
  109. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  110. package/dist/keyring/unlockSpace.js +8 -31
  111. package/dist/keyring/unlockSpace.js.map +1 -1
  112. package/dist/keys/clientKeyRecord.d.ts +2 -1
  113. package/dist/keys/clientKeyRecord.d.ts.map +1 -1
  114. package/dist/keys/clientKeyRecord.js +28 -11
  115. package/dist/keys/clientKeyRecord.js.map +1 -1
  116. package/dist/keys/index.d.ts +6 -2
  117. package/dist/keys/index.d.ts.map +1 -1
  118. package/dist/keys/index.js +5 -1
  119. package/dist/keys/index.js.map +1 -1
  120. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  121. package/dist/keys/rosterLogStore.js +14 -5
  122. package/dist/keys/rosterLogStore.js.map +1 -1
  123. package/dist/keys/spaceEpochs.d.ts +92 -3
  124. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  125. package/dist/keys/spaceEpochs.js +110 -4
  126. package/dist/keys/spaceEpochs.js.map +1 -1
  127. package/dist/keys/userKeyRoster.d.ts +30 -3
  128. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  129. package/dist/keys/userKeyRoster.js +90 -15
  130. package/dist/keys/userKeyRoster.js.map +1 -1
  131. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  132. package/dist/keys/userKeyRosterCascade.js +5 -1
  133. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  134. package/dist/recovery/continuation.d.ts +250 -0
  135. package/dist/recovery/continuation.d.ts.map +1 -0
  136. package/dist/recovery/continuation.js +467 -0
  137. package/dist/recovery/continuation.js.map +1 -0
  138. package/dist/recovery/index.d.ts +12 -8
  139. package/dist/recovery/index.d.ts.map +1 -1
  140. package/dist/recovery/index.js +11 -7
  141. package/dist/recovery/index.js.map +1 -1
  142. package/dist/recovery/recoveryDelegation.d.ts +23 -126
  143. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  144. package/dist/recovery/recoveryDelegation.js +1 -266
  145. package/dist/recovery/recoveryDelegation.js.map +1 -1
  146. package/dist/recovery/recoveryWebvh.d.ts +52 -107
  147. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  148. package/dist/recovery/recoveryWebvh.js +54 -403
  149. package/dist/recovery/recoveryWebvh.js.map +1 -1
  150. package/dist/request/classify.d.ts +3 -14
  151. package/dist/request/classify.d.ts.map +1 -1
  152. package/dist/request/classify.js +19 -40
  153. package/dist/request/classify.js.map +1 -1
  154. package/dist/request/index.d.ts +1 -0
  155. package/dist/request/index.d.ts.map +1 -1
  156. package/dist/request/index.js +1 -0
  157. package/dist/request/index.js.map +1 -1
  158. package/dist/request/onboarding.d.ts.map +1 -1
  159. package/dist/request/onboarding.js +19 -27
  160. package/dist/request/onboarding.js.map +1 -1
  161. package/dist/request/parse.d.ts +5 -3
  162. package/dist/request/parse.d.ts.map +1 -1
  163. package/dist/request/parse.js +7 -6
  164. package/dist/request/parse.js.map +1 -1
  165. package/dist/request/processRequest.d.ts.map +1 -1
  166. package/dist/request/processRequest.js +2 -1
  167. package/dist/request/processRequest.js.map +1 -1
  168. package/dist/request/queryPredicates.d.ts +98 -0
  169. package/dist/request/queryPredicates.d.ts.map +1 -0
  170. package/dist/request/queryPredicates.js +107 -0
  171. package/dist/request/queryPredicates.js.map +1 -0
  172. package/dist/resourceLog/document.d.ts +39 -0
  173. package/dist/resourceLog/document.d.ts.map +1 -1
  174. package/dist/resourceLog/document.js +41 -0
  175. package/dist/resourceLog/document.js.map +1 -1
  176. package/dist/resourceLog/index.d.ts +2 -2
  177. package/dist/resourceLog/index.js +2 -2
  178. package/dist/resourceLog/ladderRungs.d.ts.map +1 -1
  179. package/dist/resourceLog/ladderRungs.js +3 -2
  180. package/dist/resourceLog/ladderRungs.js.map +1 -1
  181. package/dist/sync/contactsConflict.d.ts.map +1 -1
  182. package/dist/sync/contactsConflict.js +8 -2
  183. package/dist/sync/contactsConflict.js.map +1 -1
  184. package/dist/sync/engine.d.ts +38 -23
  185. package/dist/sync/engine.d.ts.map +1 -1
  186. package/dist/sync/engine.js +36 -5
  187. package/dist/sync/engine.js.map +1 -1
  188. package/dist/sync/index.d.ts +9 -12
  189. package/dist/sync/index.d.ts.map +1 -1
  190. package/dist/sync/index.js +8 -11
  191. package/dist/sync/index.js.map +1 -1
  192. package/dist/sync/push.d.ts.map +1 -1
  193. package/dist/sync/push.js +1 -2
  194. package/dist/sync/push.js.map +1 -1
  195. package/dist/sync/remint.d.ts +0 -31
  196. package/dist/sync/remint.d.ts.map +1 -1
  197. package/dist/sync/remint.js +32 -1
  198. package/dist/sync/remint.js.map +1 -1
  199. package/dist/sync/types.d.ts +4 -41
  200. package/dist/sync/types.d.ts.map +1 -1
  201. package/dist/sync/types.js +4 -47
  202. package/dist/sync/types.js.map +1 -1
  203. package/dist/unlock/index.d.ts +1 -1
  204. package/dist/unlock/index.d.ts.map +1 -1
  205. package/dist/unlock/index.js +1 -1
  206. package/dist/unlock/index.js.map +1 -1
  207. package/dist/unlock/retire.d.ts +16 -64
  208. package/dist/unlock/retire.d.ts.map +1 -1
  209. package/dist/unlock/retire.js +7 -86
  210. package/dist/unlock/retire.js.map +1 -1
  211. package/dist/unlock/standingWebvh.d.ts +27 -61
  212. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  213. package/dist/unlock/standingWebvh.js +40 -92
  214. package/dist/unlock/standingWebvh.js.map +1 -1
  215. package/dist/unlock/unlockRecord.d.ts.map +1 -1
  216. package/dist/unlock/unlockRecord.js +69 -44
  217. package/dist/unlock/unlockRecord.js.map +1 -1
  218. package/dist/webvh/accountEntry.d.ts +68 -19
  219. package/dist/webvh/accountEntry.d.ts.map +1 -1
  220. package/dist/webvh/accountEntry.js +117 -37
  221. package/dist/webvh/accountEntry.js.map +1 -1
  222. package/dist/webvh/delegatedLogStore.d.ts +24 -13
  223. package/dist/webvh/delegatedLogStore.d.ts.map +1 -1
  224. package/dist/webvh/delegatedLogStore.js +40 -11
  225. package/dist/webvh/delegatedLogStore.js.map +1 -1
  226. package/dist/webvh/didWebvh.d.ts +91 -86
  227. package/dist/webvh/didWebvh.d.ts.map +1 -1
  228. package/dist/webvh/didWebvh.js +117 -142
  229. package/dist/webvh/didWebvh.js.map +1 -1
  230. package/dist/webvh/enrollClient.d.ts +2 -8
  231. package/dist/webvh/enrollClient.d.ts.map +1 -1
  232. package/dist/webvh/enrollClient.js +22 -31
  233. package/dist/webvh/enrollClient.js.map +1 -1
  234. package/dist/webvh/index.d.ts +12 -8
  235. package/dist/webvh/index.d.ts.map +1 -1
  236. package/dist/webvh/index.js +10 -7
  237. package/dist/webvh/index.js.map +1 -1
  238. package/dist/webvh/listClients.d.ts.map +1 -1
  239. package/dist/webvh/listClients.js +102 -65
  240. package/dist/webvh/listClients.js.map +1 -1
  241. package/dist/webvh/mergeMethods.d.ts +84 -0
  242. package/dist/webvh/mergeMethods.d.ts.map +1 -0
  243. package/dist/webvh/mergeMethods.js +46 -0
  244. package/dist/webvh/mergeMethods.js.map +1 -0
  245. package/dist/webvh/revokeClient.d.ts +15 -11
  246. package/dist/webvh/revokeClient.d.ts.map +1 -1
  247. package/dist/webvh/revokeClient.js +130 -57
  248. package/dist/webvh/revokeClient.js.map +1 -1
  249. package/dist/webvh/verifyLog.d.ts +45 -4
  250. package/dist/webvh/verifyLog.d.ts.map +1 -1
  251. package/dist/webvh/verifyLog.js +62 -21
  252. package/dist/webvh/verifyLog.js.map +1 -1
  253. package/dist/webvh/wasIdStore.d.ts +16 -3
  254. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  255. package/dist/webvh/wasIdStore.js +18 -3
  256. package/dist/webvh/wasIdStore.js.map +1 -1
  257. package/package.json +11 -11
@@ -1,22 +1,7 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * The transient-recovery continuation -- the ladder-anchored variant of the
6
- * recovery subpath's `recoverWebvhClient`, split out beside the rest of the
7
- * annex-anchored ceremonies: a code spent on a non-remembered browser mints
8
- * no enrolled client, and the ladder VM the fresh credential's own bind
9
- * publishes is what anchors the account, so it lands client-less and
10
- * ladder-anchored. The enrolled-client
11
- * continuation and the recovery-key inventory edits stay in
12
- * `recovery/recoveryWebvh.ts`.
13
- */
14
- import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
15
- import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE, publishEntryPinned, readPublishedLogOrThrow, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
16
- import { credentialKeyAgreementMethods, ladderVmIds, relationIds } from '../resourceLog/document.js';
1
+ import { ladderVerificationMethod, withLogConflictRetry } from '../webvh/didWebvh.js';
17
2
  import { unlockKeyVerificationMethod, unlockKeyVmId } from '../unlock/standingWebvh.js';
18
- import { RecoveryKeyNotCommittedError, recoveryVmId, retiredCredentialVmIdsFromLog } from '../recovery/recoveryWebvh.js';
19
- import { assertNextKeyHashesRemain, attributeRetiredCredentialRungs, ladderRung, ladderVmKeyMultibase, retiredCredentialRungsBeforeKey } from './ladder.js';
3
+ import { recoveryContinuationOnce } from '../recovery/continuation.js';
4
+ import { ladderRung, ladderVmKeyMultibase } from './ladder.js';
20
5
  import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
21
6
  /**
22
7
  * THE TRANSIENT-RECOVERY CONTINUATION (run by the code-derived client through
@@ -88,8 +73,18 @@ import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
88
73
  * completed branch WITHOUT re-entering `onCommitted`, so it must be able to
89
74
  * treat an already-complete continuation as success on its own.
90
75
  *
76
+ * A fresh credential whose `keyAgreement` id already stands in the document
77
+ * (the same passphrase re-typed) is refused before the reveal entry with
78
+ * `RecoveryCredentialStandingError`: this entry retires every pre-recovery
79
+ * credential, and one it re-bound instead would keep its old rung
80
+ * commitments under a struck ladder VM.
81
+ *
91
82
  * @param options {object}
92
- * @param options.store {RecoveryLogStore} public log read + delegated PUT
83
+ * @param options.store {RecoveryLogStore} public log read + delegated PUT.
84
+ * Every read both entries are built on is checked against the store's
85
+ * chain-head pin (a served prefix is refused before the reveal entry lands,
86
+ * not only by a verify that follows both entries), and the pin advances to
87
+ * each entry as it publishes
93
88
  * @param options.recovery {object} the spent code's update seed and public
94
89
  * halves
95
90
  * @param options.recovery.updateSeed {Uint8Array}
@@ -113,14 +108,6 @@ import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
113
108
  * REQUIRED: the add entry points the `#DelegatedClients` service entry at
114
109
  * it, and a caller that named no generation would republish the stranding
115
110
  * this ordering exists to prevent
116
- * @param [options.pinStore] {ResourceLogPinStore} this caller's chain-head
117
- * pins; every read both entries are built on is checked against the pinned
118
- * head (a served prefix is refused before the reveal entry lands, not only
119
- * by a verify that follows both entries), and the pin advances to each
120
- * entry as it publishes
121
- * @param [options.logId] {string} the account log's pin slot
122
- * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
123
- * supplied
124
111
  * @returns {Promise<object>} the account DID, the post-continuation
125
112
  * document and log (the rotation's recipient source and anchor), the
126
113
  * `keyAgreement` verification-method ids this entry struck for
@@ -141,285 +128,75 @@ export async function recoverWebvhLadderAnchored(options) {
141
128
  'code and the fresh credential record must be persisted before the ' +
142
129
  'add entry publishes the ladder VM.');
143
130
  }
144
- return withLogConflictRetry(() => recoverWebvhLadderAnchoredOnce(options));
145
- }
146
- /**
147
- * One attempt of {@link recoverWebvhLadderAnchored}, re-invoked by the
148
- * conflict retry.
149
- *
150
- * @param options {object} see {@link recoverWebvhLadderAnchored}
151
- * @returns {Promise<object>} see {@link recoverWebvhLadderAnchored}
152
- */
153
- async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, credentialKeyAgreement, replacement, expectedDid, onCommitted, pinStore, logId }) {
154
- // Each attempt's own read is what the CAS publish is built on, so the
155
- // continuity check runs here -- and again on a conflict-retry re-run -- not
156
- // only on the verify that follows both entries.
157
- let published = await readPublishedLogOrThrow({
158
- idStore: store,
159
- expectedDid,
160
- pinStore,
161
- logId,
162
- missingMessage: 'did:webvh: did.jsonl is missing; nothing to recover.'
163
- });
164
- const rung0 = await ladderRung({ ladderSeed, index: 0 });
165
- const rung1 = await ladderRung({ ladderSeed, index: 1 });
166
- const ladderVmKey = await ladderVmKeyMultibase({ ladderSeed });
167
- // Derived before the completion check, because a resume recomputes the
168
- // strike with the same protected sets the first run used.
169
- const recoveryHash = await deriveNextKeyHash(recovery.updateKeyMultibase);
170
- const rung0Hash = await deriveNextKeyHash(rung0.keyMultibase);
171
- const rung1Hash = await deriveNextKeyHash(rung1.keyMultibase);
172
- const replacementHash = await deriveNextKeyHash(replacement.updateKeyMultibase);
173
- // Already complete (a torn earlier run finished the add entry): the fresh
174
- // ladder's rung 0 is authorized, which only the add entry writes.
175
- if (published.updateKeys.includes(rung0.keyMultibase)) {
176
- // The add entry already struck the pre-recovery credentials, so the
177
- // document names none of them any more. The report is derived from the
178
- // log instead (`retiredCredentialVmIdsFromLog`), so a resume tells the
179
- // caller exactly what the first run told it.
180
- const retired = retiredCredentialVmIdsFromLog({
181
- log: published.log,
182
- did: published.did,
183
- successorKeyMultibase: rung0.keyMultibase,
184
- spentVmId: recoveryVmId({
185
- did: published.did,
186
- keyAgreementKeyMultibase: recovery.keyAgreementKeyMultibase
187
- })
188
- });
189
- // The strike is recomputed by re-running it over the log as it stood just
190
- // before the add entry, with the same protected sets, so a resume reports
191
- // exactly what the first run reported rather than a second definition of
192
- // the same question.
193
- const strike = await retiredCredentialRungsBeforeKey({
194
- log: published.log,
195
- authorizedKeyMultibase: rung0.keyMultibase,
196
- credentialVmIds: retired,
197
- protectedHashes: [rung0Hash, rung1Hash, replacementHash],
198
- protectedKeys: [rung0.keyMultibase]
199
- });
200
- return {
201
- did: published.did,
202
- doc: published.doc,
203
- log: published.log,
204
- retiredCredentialVmIds: retired,
205
- struckRungHashes: strike.struckHashes,
206
- unclaimedCredentialVmIds: strike.unclaimedCredentialVmIds
207
- };
208
- }
209
- // The reveal-and-commit entry, skipped when a torn earlier run already
210
- // published it (the revealed key authorized AND every needed hash
211
- // committed).
212
- const revealed = published.updateKeys.includes(recovery.updateKeyMultibase);
213
- const committed = [rung0Hash, rung1Hash, replacementHash].every(hash => published.nextKeyHashes.includes(hash));
214
- if (!revealed || !committed) {
215
- if (!revealed && !published.nextKeyHashes.includes(recoveryHash)) {
216
- throw new RecoveryKeyNotCommittedError();
217
- }
218
- await assertCarryOverCommitments({ published });
219
- const signer = await updateKeySigner({ seed: recovery.updateSeed });
220
- const updated = await updateDID({
221
- log: published.log,
222
- signer,
223
- alsoKnownAsWeb: true,
224
- updateKeys: [
225
- ...new Set([...published.updateKeys, recovery.updateKeyMultibase])
226
- ],
227
- // The spent code's own hash is kept through this entry (so a resumed
228
- // commit can re-state the revealed key); the add entry drops it.
229
- nextKeyHashes: [
230
- ...new Set([
231
- ...published.nextKeyHashes,
232
- recoveryHash,
233
- rung0Hash,
234
- rung1Hash,
235
- replacementHash
236
- ])
237
- ]
238
- });
239
- // The publish advances the pin to what the reveal entry just published,
240
- // so the re-read below (and any read after a tear here) refuses a host
241
- // that rolls the log back behind it.
242
- await publishEntryPinned({
243
- store,
244
- log: updated.log,
245
- ifMatch: published.etag,
246
- pinStore,
247
- logId
248
- });
249
- // The same account the reveal entry just extended, under the same pin.
250
- published = await readPublishedLogOrThrow({
251
- idStore: store,
252
- expectedDid: published.did,
253
- pinStore,
254
- logId,
255
- missingMessage: 'did:webvh: did.jsonl is missing; nothing to recover.'
256
- });
257
- }
258
- // The persist-before-publish seam: the replacement code's record and the
259
- // fresh credential's unlock record (the ladder seed inside) become durable
260
- // HERE, before the add entry publishes the ladder VM that seed backs.
261
- const persisted = await onCommitted();
262
- // Refuses a malformed pointer target before the entry is built.
263
- clientAnnexDidParts({ did: persisted.clientAnnexDid });
264
- // The add-and-retire entry: the ladder VM, the fresh credential's
265
- // keyAgreement inventory, and the replacement code's inventory in; the spent
266
- // code's VM, update key, and hash out; every pre-recovery standing
267
- // credential fully retired -- its ladder VM and its keyAgreement member
268
- // both. Signed by rung 0, whose hash the commit entry just committed.
269
- const { did, doc } = published;
270
- const spentVmId = recoveryVmId({
271
- did,
272
- keyAgreementKeyMultibase: recovery.keyAgreementKeyMultibase
273
- });
274
- const replacementVmId = recoveryVmId({
275
- did,
276
- keyAgreementKeyMultibase: replacement.keyAgreementKeyMultibase
277
- });
278
- const ladderVms = ladderVmIds({ doc });
279
- const ladderVm = ladderVerificationMethod({
280
- controller: did,
281
- publicKeyMultibase: ladderVmKey
282
- });
283
- const ladderVmId = `${did}#${ladderVmKey}`;
284
- const credentialVm = unlockKeyVerificationMethod({
285
- did,
286
- keyAgreement: credentialKeyAgreement
287
- });
288
- const credentialVmId = unlockKeyVmId({
289
- did,
290
- keyAgreement: credentialKeyAgreement
291
- });
292
- // Every pre-recovery credential's keyAgreement member, by the account-DID
293
- // controller (an enrolled client's carries the client marker instead), less
294
- // the ids this entry itself adds. The spent code's own id is reported
295
- // separately: the caller already retires that one by name.
296
- // The replacement code's ladder VM, published beside its key-agreement
297
- // member: a code is a standing credential with a ladder, and its own bridge
298
- // delegation is signed by this VM, so a replacement without it could never
299
- // spend (`decisions/0019`, `decisions/0020`). Its rung-0 hash is already
300
- // committed by the reveal-and-commit entry, which this entry carries
301
- // through.
302
- const replacementLadderVmId = `${did}#${replacement.ladderVmKeyMultibase}`;
303
- const addedVmIds = [
304
- ladderVmId,
305
- credentialVmId,
306
- replacementVmId,
307
- replacementLadderVmId
308
- ];
309
- const struckCredentialVmIds = credentialKeyAgreementMethods({ doc, did })
310
- .map(method => method.id)
311
- .filter((id) => typeof id === 'string')
312
- .filter(id => !addedVmIds.includes(id));
313
- const retiredCredentialVmIds = struckCredentialVmIds.filter(id => id !== spentVmId);
314
- // Each retired credential's committed rungs and any revealed rung of its
315
- // own go in the SAME entry. Striking the VM alone rots a ladder-signed
316
- // bridge, but a bridge an enrolled client minted outlives the strike, and
317
- // that client survives this entry -- so a committed rung left standing is a
318
- // reveal the retired credential could still perform. The anchoring is
319
- // log-only (this browser holds no registry), and an unanchorable credential
320
- // is reported rather than struck.
321
- const strike = await attributeRetiredCredentialRungs({
322
- log: published.log,
323
- credentialVmIds: retiredCredentialVmIds,
324
- protectedHashes: [rung0Hash, rung1Hash, replacementHash],
325
- protectedKeys: [rung0.keyMultibase]
326
- });
327
- const addedMethods = [
328
- ladderVm,
329
- credentialVm,
330
- {
331
- id: replacementVmId,
332
- type: MULTIKEY_VM_TYPE,
333
- controller: did,
334
- publicKeyMultibase: replacement.keyAgreementKeyMultibase
131
+ const { ladderSeed, credentialKeyAgreement, onCommitted, expectedDid, ...shared } = options;
132
+ // The fresh ladder: rung 0 is the successor key the add entry authorizes
133
+ // and signs with, rung 1 its staged partner (the ladder-anchored genesis
134
+ // configuration), and the VM the stable sibling the entry installs.
135
+ const [rung0, rung1, ladderVmKey] = await Promise.all([
136
+ ladderRung({ ladderSeed, index: 0 }),
137
+ ladderRung({ ladderSeed, index: 1 }),
138
+ ladderVmKeyMultibase({ ladderSeed })
139
+ ]);
140
+ const outcome = await withLogConflictRetry(() => recoveryContinuationOnce({
141
+ ...shared,
142
+ successor: {
143
+ updateKeyMultibase: rung0.keyMultibase,
144
+ updateSeed: rung0.seed,
145
+ stagedKeyMultibase: rung1.keyMultibase
335
146
  },
336
- ladderVerificationMethod({
337
- controller: did,
338
- publicKeyMultibase: replacement.ladderVmKeyMultibase
339
- })
340
- ];
341
- const existingMethods = (doc.verificationMethod ?? []);
342
- const verificationMethods = [
343
- ...existingMethods.filter(method => method.id !== spentVmId &&
344
- !addedMethods.some(added => added.id === method.id) &&
345
- (method.id === undefined ||
346
- (!ladderVms.includes(method.id) &&
347
- !struckCredentialVmIds.includes(method.id)))),
348
- ...addedMethods
349
- ];
350
- // The retirement filter runs over the EXISTING relation ids only, and the
351
- // added ids join afterwards: a resumed run's fresh ladder VM already stands
352
- // in `doc.capabilityDelegation`, so filtering the union would strike the
353
- // very method this entry is publishing.
354
- const withoutRemoved = (relation, added) => [
355
- ...new Set([
356
- ...relationIds(relation).filter(referencedId => referencedId !== spentVmId &&
357
- !ladderVms.includes(referencedId) &&
358
- !struckCredentialVmIds.includes(referencedId)),
359
- ...(added ?? [])
360
- ])
361
- ];
362
- const signer = await updateKeySigner({ seed: rung0.seed });
363
- const updated = await updateDID({
364
- log: published.log,
365
- signer,
366
- alsoKnownAsWeb: true,
367
- updateKeys: [
368
- ...new Set([
369
- ...published.updateKeys.filter(key => key !== recovery.updateKeyMultibase &&
370
- !strike.struckKeys.includes(key)),
371
- rung0.keyMultibase
372
- ])
147
+ // The persist-before-publish seam: the replacement code's record and
148
+ // the fresh credential's unlock record (the ladder seed inside) become
149
+ // durable HERE, before the add entry publishes the ladder VM that seed
150
+ // backs.
151
+ onCommitted,
152
+ // A passphrase the account already stands on is refused before the
153
+ // reveal entry: this continuation retires that credential, and
154
+ // re-binding it would leave its old rungs standing under a new VM.
155
+ credentialVmIds: did => [
156
+ unlockKeyVmId({ did, keyAgreement: credentialKeyAgreement })
373
157
  ],
374
- nextKeyHashes: assertNextKeyHashesRemain({
375
- nextKeyHashes: published.nextKeyHashes.filter(hash => hash !== recoveryHash && !strike.struckHashes.includes(hash)),
376
- ceremony: 'the transient-recovery add-and-retire entry'
377
- }),
378
- verificationMethods,
379
- // The ladder VM's relation asymmetry: `assertionMethod` and
158
+ // The ladder VM (under the relation asymmetry: `assertionMethod` and
380
159
  // `capabilityDelegation` only -- no `authentication`, no
381
160
  // `capabilityInvocation` -- which is also what keeps it out of every
382
- // client listing.
383
- authentication: withoutRemoved(doc.authentication),
384
- assertionMethod: withoutRemoved(doc.assertionMethod, [
385
- ladderVmId,
386
- replacementLadderVmId
387
- ]),
388
- keyAgreement: withoutRemoved(doc.keyAgreement, [
389
- credentialVmId,
390
- replacementVmId
391
- ]),
392
- capabilityInvocation: withoutRemoved(doc.capabilityInvocation),
393
- capabilityDelegation: withoutRemoved(doc.capabilityDelegation, [
394
- ladderVmId,
395
- replacementLadderVmId
396
- ]),
397
- // Atomic with the retirement above: the pointer and the ladder-VM set
398
- // change in one entry, so no window exists in which the document points
399
- // at a generation the surviving record cannot reach.
400
- services: servicesPointedAtClientAnnex({
401
- doc,
402
- accountDid: did,
403
- clientAnnexDid: persisted.clientAnnexDid
404
- })
405
- });
406
- // Conditional on the read this entry was built on: the re-read above when
407
- // the commit entry ran here, the first read when it was skipped.
408
- await publishEntryPinned({
409
- store,
410
- log: updated.log,
411
- ifMatch: published.etag,
412
- pinStore,
413
- logId
414
- });
415
- return {
416
- did: updated.did,
417
- doc: updated.doc,
418
- log: updated.log,
419
- retiredCredentialVmIds,
420
- struckRungHashes: strike.struckHashes,
421
- unclaimedCredentialVmIds: strike.unclaimedCredentialVmIds,
422
- webDoc: updated.webDoc
423
- };
161
+ // client listing) and the fresh credential's keyAgreement inventory in;
162
+ // the core appends the replacement code's after them. Atomic with the
163
+ // retirement: the `#DelegatedClients` pointer and the ladder-VM set
164
+ // change in one entry, so no window exists in which the document
165
+ // points at a generation the surviving record cannot reach.
166
+ added: ({ did, doc, persisted }) => {
167
+ // Refuses a malformed pointer target before the entry is built.
168
+ clientAnnexDidParts({ did: persisted.clientAnnexDid });
169
+ const ladderVmId = `${did}#${ladderVmKey}`;
170
+ const credentialVmId = unlockKeyVmId({
171
+ did,
172
+ keyAgreement: credentialKeyAgreement
173
+ });
174
+ return {
175
+ methods: [
176
+ ladderVerificationMethod({
177
+ controller: did,
178
+ publicKeyMultibase: ladderVmKey
179
+ }),
180
+ unlockKeyVerificationMethod({
181
+ did,
182
+ keyAgreement: credentialKeyAgreement
183
+ })
184
+ ],
185
+ assertionMethod: [ladderVmId],
186
+ keyAgreement: [credentialVmId],
187
+ capabilityDelegation: [ladderVmId],
188
+ services: servicesPointedAtClientAnnex({
189
+ doc,
190
+ accountDid: did,
191
+ clientAnnexDid: persisted.clientAnnexDid
192
+ })
193
+ };
194
+ },
195
+ ...(expectedDid !== undefined ? { expectedDid } : {})
196
+ }));
197
+ // `committed` is the remembered variant's signal; this one has no
198
+ // cross-process resume for it to serve.
199
+ const { committed: _committed, ...rest } = outcome;
200
+ return rest;
424
201
  }
425
202
  //# sourceMappingURL=recoveryLadderAnchored.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAMxE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,6BAA6B,EAC7B,WAAW,EACX,WAAW,EACZ,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,2BAA2B,EAC3B,aAAa,EAEd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,4BAA4B,EAC5B,YAAY,EACZ,6BAA6B,EAI9B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,UAAU,EACV,oBAAoB,EACpB,+BAA+B,EAChC,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,OAUhD;IASC,uEAAuE;IACvE,wEAAwE;IACxE,oEAAoE;IACpE,6DAA6D;IAC7D,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,MAAM,IAAI,SAAS,CACjB,mEAA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,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,2BAA2B,EAC3B,aAAa,EAEd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAMtE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,OAQhD;IASC,uEAAuE;IACvE,wEAAwE;IACxE,oEAAoE;IACpE,6DAA6D;IAC7D,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,MAAM,IAAI,SAAS,CACjB,mEAAmE;YACjE,oEAAoE;YACpE,oCAAoC,CACvC,CAAA;IACH,CAAC;IACD,MAAM,EACJ,UAAU,EACV,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,GAAG,MAAM,EACV,GAAG,OAAO,CAAA;IACX,yEAAyE;IACzE,yEAAyE;IACzE,oEAAoE;IACpE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpD,UAAU,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACpC,UAAU,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAA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C;gBAC9B,oBAAoB,EAAE,CAAC,UAAU,CAAC;gBAClC,QAAQ,EAAE,4BAA4B,CAAC;oBACrC,GAAG;oBACH,UAAU,EAAE,GAAG;oBACf,cAAc,EAAE,SAAS,CAAC,cAAc;iBACzC,CAAC;aACH,CAAA;QACH,CAAC;QACD,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC,CACH,CAAA;IACD,kEAAkE;IAClE,wCAAwC;IACxC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAA;IAClD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -6,8 +6,12 @@
6
6
  * roster delivers after the ensure, not the minted candidate**. The ensure
7
7
  * adopts a roster another run landed first, and epoch[0] is create-if-absent,
8
8
  * so installing under this run's candidate would key a collection to a key
9
- * nobody holds. One function, two callers: the credential-anchored
10
- * establishment's adopted-roster arm, and the mend entry point's roster arm.
9
+ * nobody holds. The key-versus-roster test itself is `ensureWalletSpaceEpochs`'s
10
+ * mint gate, which this stage hands the settled descriptor; what this stage
11
+ * owns is the ensure-then-re-read order around it and the mint guard. One
12
+ * function, two callers: the credential-anchored establishment's
13
+ * adopted-roster arm, and the mend entry point's roster arm, each supplying
14
+ * the mint preconditions through the required `beforeMint` seam.
11
15
  *
12
16
  * The stage order: ensure the roster (create-if-absent with the supplied
13
17
  * candidate; the entry proof rides the caller's store signer -- the ladder VM
@@ -93,12 +97,16 @@ export type RosterDeliveredEpochsResult = {
93
97
  * delegation); absent, requests invoke the root capability
94
98
  * @param [options.collectionIds] {string[]} the fan-out's collection set
95
99
  * override, threaded through to `ensureWalletSpaceEpochs`
96
- * @param [options.beforeMint] {Function} `() => Promise<void>` -- the mint
100
+ * @param options.beforeMint {Function} `() => Promise<void>` -- the mint
97
101
  * guard, awaited exactly when THIS run's own decide-read observed the
98
102
  * roster absent and is about to install the candidate as epoch[0]. A
99
103
  * throw refuses the mint and propagates unchanged (never folded into the
100
104
  * create-race adoption), so a caller's mint preconditions run against the
101
- * same observation the mint acts on
105
+ * same observation the mint acts on. Required: a served absent roster is
106
+ * the one observation that can turn this stage into a single-recipient
107
+ * roster genesis evicting every other standing credential, so no caller
108
+ * gets the mint without stating what licenses it. A call without the seam
109
+ * is refused with a `TypeError` before any read
102
110
  * @returns {Promise<RosterDeliveredEpochsResult>}
103
111
  */
104
112
  export declare function ensureRosterDeliveredEpochs({ store, candidateUserKey, clientKeyAgreementKey, was, spaceId, capability, collectionIds, beforeMint }: {
@@ -109,6 +117,6 @@ export declare function ensureRosterDeliveredEpochs({ store, candidateUserKey, c
109
117
  spaceId: string;
110
118
  capability?: IZcap;
111
119
  collectionIds?: string[];
112
- beforeMint?: () => Promise<void>;
120
+ beforeMint: () => Promise<void>;
113
121
  }): Promise<RosterDeliveredEpochsResult>;
114
122
  //# sourceMappingURL=rosterDeliveredEpochs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rosterDeliveredEpochs.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AAczB;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GACnC;IACE,OAAO,EAAE,WAAW,GAAG,qBAAqB,CAAA;IAC5C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,oBAAoB,CAAA;IACtC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,uBAAuB,CAAA;CAChC,GACD;IACE,OAAO,EAAE,SAAS,CAAA;IAClB,gBAAgB,EAAE,oBAAoB,CAAA;IACtC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,KAAK,EACL,gBAAgB,EAChB,qBAAqB,EACrB,GAAG,EACH,OAAO,EACP,UAAU,EACV,aAAa,EACb,UAAU,EACX,EAAE;IACD,KAAK,EAAE,yBAAyB,CAAA;IAChC,gBAAgB,EAAE,OAAO,CAAA;IACzB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACjC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAuEvC"}
1
+ {"version":3,"file":"rosterDeliveredEpochs.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AAczB;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GACnC;IACE,OAAO,EAAE,WAAW,GAAG,qBAAqB,CAAA;IAC5C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,oBAAoB,CAAA;IACtC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,uBAAuB,CAAA;CAChC,GACD;IACE,OAAO,EAAE,SAAS,CAAA;IAClB,gBAAgB,EAAE,oBAAoB,CAAA;IACtC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,KAAK,EACL,gBAAgB,EAChB,qBAAqB,EACrB,GAAG,EACH,OAAO,EACP,UAAU,EACV,aAAa,EACb,UAAU,EACX,EAAE;IACD,KAAK,EAAE,yBAAyB,CAAA;IAChC,gBAAgB,EAAE,OAAO,CAAA;IACzB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,GAAG,EAAE,SAAS,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAChC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAoFvC"}
@@ -34,15 +34,23 @@ const CREATE_RACE_ERROR_NAMES = new Set([
34
34
  * delegation); absent, requests invoke the root capability
35
35
  * @param [options.collectionIds] {string[]} the fan-out's collection set
36
36
  * override, threaded through to `ensureWalletSpaceEpochs`
37
- * @param [options.beforeMint] {Function} `() => Promise<void>` -- the mint
37
+ * @param options.beforeMint {Function} `() => Promise<void>` -- the mint
38
38
  * guard, awaited exactly when THIS run's own decide-read observed the
39
39
  * roster absent and is about to install the candidate as epoch[0]. A
40
40
  * throw refuses the mint and propagates unchanged (never folded into the
41
41
  * create-race adoption), so a caller's mint preconditions run against the
42
- * same observation the mint acts on
42
+ * same observation the mint acts on. Required: a served absent roster is
43
+ * the one observation that can turn this stage into a single-recipient
44
+ * roster genesis evicting every other standing credential, so no caller
45
+ * gets the mint without stating what licenses it. A call without the seam
46
+ * is refused with a `TypeError` before any read
43
47
  * @returns {Promise<RosterDeliveredEpochsResult>}
44
48
  */
45
49
  export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, clientKeyAgreementKey, was, spaceId, capability, collectionIds, beforeMint }) {
50
+ if (typeof beforeMint !== 'function') {
51
+ throw new TypeError('ensureRosterDeliveredEpochs requires a beforeMint seam: the mint ' +
52
+ 'preconditions that license installing the candidate as epoch[0].');
53
+ }
46
54
  // The ensure: create-if-absent with the candidate, the mint guard fired
47
55
  // on this run's own absent observation. A read failure is a transport
48
56
  // error and rethrows unchanged; only the guarded create's lost race is
@@ -55,9 +63,7 @@ export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, cli
55
63
  descriptor = current.descriptor;
56
64
  }
57
65
  else {
58
- if (beforeMint !== undefined) {
59
- await beforeMint();
60
- }
66
+ await beforeMint();
61
67
  descriptor = await ensureUserKeyRoster({
62
68
  store,
63
69
  userKey: candidateUserKey,
@@ -66,7 +72,7 @@ export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, cli
66
72
  }
67
73
  }
68
74
  catch (err) {
69
- if (!CREATE_RACE_ERROR_NAMES.has(err.name ?? '')) {
75
+ if (!CREATE_RACE_ERROR_NAMES.has(err?.name ?? '')) {
70
76
  throw err;
71
77
  }
72
78
  const reread = await store.read();
@@ -91,19 +97,22 @@ export async function ensureRosterDeliveredEpochs({ store, candidateUserKey, cli
91
97
  userKey = read.userKey;
92
98
  }
93
99
  catch (err) {
94
- if (err.name === 'UserKeyRosterUnwrapError') {
100
+ if (err?.name === 'UserKeyRosterUnwrapError') {
95
101
  return { outcome: 'no-wrap', rosterDescriptor: descriptor, error: err };
96
102
  }
97
103
  throw err;
98
104
  }
99
105
  // The fan-out, under the DELIVERED key -- create-if-absent per collection,
100
106
  // so this call is also the completion test's re-entry on an epoch-less
101
- // encrypted collection behind a present roster. Per-collection failures
102
- // ride the result's `failed` list to the caller.
107
+ // encrypted collection behind a present roster. The settled descriptor
108
+ // rides along so the fan-out's own mint gate stands between the key and
109
+ // the install. Per-collection failures ride the result's `failed` list to
110
+ // the caller.
103
111
  const epochs = await ensureWalletSpaceEpochs({
104
112
  was,
105
113
  spaceId,
106
114
  userKey,
115
+ rosterDescriptor: descriptor,
107
116
  ...(capability !== undefined ? { capability } : {}),
108
117
  ...(collectionIds !== undefined ? { collectionIds } : {})
109
118
  });
@@ -1 +1 @@
1
- {"version":3,"file":"rosterDeliveredEpochs.js","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"AA0CA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,yBAAyB;IACzB,uBAAuB;CACxB,CAAC,CAAA;AAiCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,EAChD,KAAK,EACL,gBAAgB,EAChB,qBAAqB,EACrB,GAAG,EACH,OAAO,EACP,UAAU,EACV,aAAa,EACb,UAAU,EAUX;IACC,wEAAwE;IACxE,sEAAsE;IACtE,uEAAuE;IACvE,gCAAgC;IAChC,IAAI,UAAgC,CAAA;IACpC,IAAI,kBAAkB,GAAG,KAAK,CAAA;IAC9B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAA;QAClC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,UAAU,GAAG,OAAO,CAA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AAuE;IACvE,wEAAwE;IACxE,iDAAiD;IACjD,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC;QAC3C,GAAG;QACH,OAAO;QACP,OAAO;QACP,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,WAAW;QACjE,OAAO;QACP,gBAAgB,EAAE,UAAU;QAC5B,MAAM;QACN,MAAM;KACP,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"rosterDeliveredEpochs.js","sourceRoot":"","sources":["../../src/clientAnnex/rosterDeliveredEpochs.ts"],"names":[],"mappings":"AA8CA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,yBAAyB;IACzB,uBAAuB;CACxB,CAAC,CAAA;AAiCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,EAChD,KAAK,EACL,gBAAgB,EAChB,qBAAqB,EACrB,GAAG,EACH,OAAO,EACP,UAAU,EACV,aAAa,EACb,UAAU,EAUX;IACC,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,SAAS,CACjB,mEAAmE;YACjE,kEAAkE,CACrE,CAAA;IACH,CAAC;IACD,wEAAwE;IACxE,sEAAsE;IACtE,uEAAuE;IACvE,gCAAgC;IAChC,IAAI,UAAgC,CAAA;IACpC,IAAI,kBAAkB,GAAG,KA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AAK,EAAE,GAAG,EAAE,CAAA;QACzE,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;IAED,2EAA2E;IAC3E,uEAAuE;IACvE,uEAAuE;IACvE,wEAAwE;IACxE,0EAA0E;IAC1E,cAAc;IACd,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC;QAC3C,GAAG;QACH,OAAO;QACP,OAAO;QACP,gBAAgB,EAAE,UAAU;QAC5B,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,WAAW;QACjE,OAAO;QACP,gBAAgB,EAAE,UAAU;QAC5B,MAAM;QACN,MAAM;KACP,CAAA;AACH,CAAC"}
@@ -44,7 +44,6 @@
44
44
  import type { IKeyAgreementKey } from '@interop/data-integrity-core';
45
45
  import type { UserKey } from '../keys/userKey.js';
46
46
  import type { AccountPointer } from '../keyring/record.js';
47
- import { type ResourceLogPinStore } from '@interop/vh-resource-log';
48
47
  import type { ClientWebvhUpdateKeys } from '../webvh/didWebvh.js';
49
48
  import type { UnlockLogStore } from '../unlock/standingWebvh.js';
50
49
  /**
@@ -65,13 +64,11 @@ import type { UnlockLogStore } from '../unlock/standingWebvh.js';
65
64
  * with
66
65
  * @param options.logStore {UnlockLogStore} the public log read plus the
67
66
  * delegated `did.jsonl` PUT, built by the app around the record's bridge
68
- * delegation
69
- * @param [options.accountLogPinStore] {ResourceLogPinStore} this client's
70
- * chain-head pin for the account log, checked on every read the two log
71
- * entries are built on and advanced as each publishes, then checked again
72
- * by the verify that follows. A fresh browser normally has none (this is
73
- * its first contact), which is exactly the pin's trust-on-first-use
74
- * establishment
67
+ * delegation. It carries this client's chain-head pin for the account log,
68
+ * checked on every read the two log entries are built on and advanced as
69
+ * each publishes, then checked again by the verify that follows. A fresh
70
+ * browser normally holds no pin yet (this is its first contact), which is
71
+ * exactly the pin's trust-on-first-use establishment
75
72
  * @param options.onCommitted {function}
76
73
  * `(committed: { builtOnHead, clientSeed, webvhUpdateKeys }) =>
77
74
  * Promise<void>` -- the REQUIRED persist-before-publish seam. The caller
@@ -111,12 +108,11 @@ import type { UnlockLogStore } from '../unlock/standingWebvh.js';
111
108
  * cleared. The member exists so a build skew that dropped it surfaces
112
109
  * instead of reading as `false`
113
110
  */
114
- export declare function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore, accountLogPinStore, onCommitted, resume }: {
111
+ export declare function selfEnrollClientCore({ pointer, ladderSeed, credentialKeyAgreementKey, logStore, onCommitted, resume }: {
115
112
  pointer: AccountPointer;
116
113
  ladderSeed: Uint8Array;
117
114
  credentialKeyAgreementKey: IKeyAgreementKey;
118
115
  logStore: UnlockLogStore;
119
- accountLogPinStore?: ResourceLogPinStore;
120
116
  onCommitted: (committed: {
121
117
  builtOnHead: {
122
118
  scid: string;
@@ -1 +1 @@
1
- {"version":3,"file":"selfEnroll.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/selfEnroll.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AASpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAA;AAMjC,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,sBAAsB,CAAA;AAW7B,OAAO,KAAK,EAAE,cAAc,EAA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