@interop/wallet-core 0.62.0 → 0.66.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 (321) hide show
  1. package/README.md +41 -16
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +119 -35
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +227 -160
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +18 -8
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +37 -64
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +85 -38
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +155 -98
  17. package/dist/clientAnnex/forgetLast.js.map +1 -1
  18. package/dist/clientAnnex/gc.d.ts +3 -2
  19. package/dist/clientAnnex/gc.d.ts.map +1 -1
  20. package/dist/clientAnnex/gc.js +16 -7
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +65 -14
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +397 -298
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/index.d.ts +23 -7
  27. package/dist/clientAnnex/index.d.ts.map +1 -1
  28. package/dist/clientAnnex/index.js +26 -7
  29. package/dist/clientAnnex/index.js.map +1 -1
  30. package/dist/clientAnnex/ladder.d.ts +58 -0
  31. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  32. package/dist/clientAnnex/ladder.js +249 -41
  33. package/dist/clientAnnex/ladder.js.map +1 -1
  34. package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
  35. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  36. package/dist/clientAnnex/ladderAnchored.js +391 -346
  37. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  38. package/dist/clientAnnex/log.d.ts +237 -53
  39. package/dist/clientAnnex/log.d.ts.map +1 -1
  40. package/dist/clientAnnex/log.js +533 -198
  41. package/dist/clientAnnex/log.js.map +1 -1
  42. package/dist/clientAnnex/mend.d.ts +12 -6
  43. package/dist/clientAnnex/mend.d.ts.map +1 -1
  44. package/dist/clientAnnex/mend.js +44 -72
  45. package/dist/clientAnnex/mend.js.map +1 -1
  46. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
  47. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  48. package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
  49. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  50. package/dist/clientAnnex/spaceCapability.d.ts +123 -0
  51. package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
  52. package/dist/clientAnnex/spaceCapability.js +152 -0
  53. package/dist/clientAnnex/spaceCapability.js.map +1 -0
  54. package/dist/clientAnnex/stages.d.ts +63 -0
  55. package/dist/clientAnnex/stages.d.ts.map +1 -0
  56. package/dist/clientAnnex/stages.js +64 -0
  57. package/dist/clientAnnex/stages.js.map +1 -0
  58. package/dist/clientAnnex/zcap.d.ts +1 -1
  59. package/dist/clientAnnex/zcap.d.ts.map +1 -1
  60. package/dist/clientAnnex/zcap.js +42 -35
  61. package/dist/clientAnnex/zcap.js.map +1 -1
  62. package/dist/clients/policy.d.ts +15 -1
  63. package/dist/clients/policy.d.ts.map +1 -1
  64. package/dist/clients/policy.js +12 -6
  65. package/dist/clients/policy.js.map +1 -1
  66. package/dist/clients/revocation.d.ts +18 -10
  67. package/dist/clients/revocation.d.ts.map +1 -1
  68. package/dist/clients/revocation.js +13 -5
  69. package/dist/clients/revocation.js.map +1 -1
  70. package/dist/clients/rosterPolicy.d.ts +10 -2
  71. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  72. package/dist/clients/rosterPolicy.js +41 -24
  73. package/dist/clients/rosterPolicy.js.map +1 -1
  74. package/dist/descriptors/acquire.d.ts.map +1 -1
  75. package/dist/descriptors/acquire.js +6 -23
  76. package/dist/descriptors/acquire.js.map +1 -1
  77. package/dist/descriptors/cipher.d.ts.map +1 -1
  78. package/dist/descriptors/cipher.js +5 -0
  79. package/dist/descriptors/cipher.js.map +1 -1
  80. package/dist/descriptors/errors.d.ts +43 -0
  81. package/dist/descriptors/errors.d.ts.map +1 -0
  82. package/dist/descriptors/errors.js +45 -0
  83. package/dist/descriptors/errors.js.map +1 -0
  84. package/dist/descriptors/index.d.ts +5 -0
  85. package/dist/descriptors/index.d.ts.map +1 -1
  86. package/dist/descriptors/index.js +5 -0
  87. package/dist/descriptors/index.js.map +1 -1
  88. package/dist/enrollment/enrollment.d.ts +37 -10
  89. package/dist/enrollment/enrollment.d.ts.map +1 -1
  90. package/dist/enrollment/enrollment.js +52 -15
  91. package/dist/enrollment/enrollment.js.map +1 -1
  92. package/dist/genesis/accountGenesis.d.ts +42 -11
  93. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  94. package/dist/genesis/accountGenesis.js +80 -22
  95. package/dist/genesis/accountGenesis.js.map +1 -1
  96. package/dist/genesis/index.d.ts +3 -1
  97. package/dist/genesis/index.d.ts.map +1 -1
  98. package/dist/genesis/index.js +3 -1
  99. package/dist/genesis/index.js.map +1 -1
  100. package/dist/identity/agents.d.ts +17 -1
  101. package/dist/identity/agents.d.ts.map +1 -1
  102. package/dist/identity/agents.js +23 -7
  103. package/dist/identity/agents.js.map +1 -1
  104. package/dist/identity/index.d.ts +3 -1
  105. package/dist/identity/index.d.ts.map +1 -1
  106. package/dist/identity/index.js +3 -1
  107. package/dist/identity/index.js.map +1 -1
  108. package/dist/index.d.ts +6 -3
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +6 -3
  111. package/dist/index.js.map +1 -1
  112. package/dist/keyring/index.d.ts +2 -1
  113. package/dist/keyring/index.d.ts.map +1 -1
  114. package/dist/keyring/index.js +2 -1
  115. package/dist/keyring/index.js.map +1 -1
  116. package/dist/keyring/record.d.ts.map +1 -1
  117. package/dist/keyring/record.js +3 -6
  118. package/dist/keyring/record.js.map +1 -1
  119. package/dist/keyring/unlockSpace.d.ts +14 -5
  120. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  121. package/dist/keyring/unlockSpace.js +31 -36
  122. package/dist/keyring/unlockSpace.js.map +1 -1
  123. package/dist/keys/index.d.ts +22 -8
  124. package/dist/keys/index.d.ts.map +1 -1
  125. package/dist/keys/index.js +20 -6
  126. package/dist/keys/index.js.map +1 -1
  127. package/dist/keys/rosterLogStore.d.ts +15 -12
  128. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  129. package/dist/keys/rosterLogStore.js +21 -16
  130. package/dist/keys/rosterLogStore.js.map +1 -1
  131. package/dist/keys/rosterStore.d.ts +3 -6
  132. package/dist/keys/rosterStore.d.ts.map +1 -1
  133. package/dist/keys/rosterStore.js +10 -9
  134. package/dist/keys/rosterStore.js.map +1 -1
  135. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  136. package/dist/keys/spaceEpochs.js +2 -3
  137. package/dist/keys/spaceEpochs.js.map +1 -1
  138. package/dist/keys/userKeyCascade.d.ts +8 -5
  139. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  140. package/dist/keys/userKeyCascade.js +7 -6
  141. package/dist/keys/userKeyCascade.js.map +1 -1
  142. package/dist/keys/userKeyRoster.d.ts +95 -8
  143. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  144. package/dist/keys/userKeyRoster.js +278 -35
  145. package/dist/keys/userKeyRoster.js.map +1 -1
  146. package/dist/keys/userKeyRosterCascade.d.ts +117 -16
  147. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  148. package/dist/keys/userKeyRosterCascade.js +184 -43
  149. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  150. package/dist/keys/wasLabelsStore.d.ts +9 -2
  151. package/dist/keys/wasLabelsStore.d.ts.map +1 -1
  152. package/dist/keys/wasLabelsStore.js +14 -6
  153. package/dist/keys/wasLabelsStore.js.map +1 -1
  154. package/dist/log.d.ts +7 -2
  155. package/dist/log.d.ts.map +1 -1
  156. package/dist/log.js +6 -1
  157. package/dist/log.js.map +1 -1
  158. package/dist/recovery/index.d.ts +13 -9
  159. package/dist/recovery/index.d.ts.map +1 -1
  160. package/dist/recovery/index.js +12 -8
  161. package/dist/recovery/index.js.map +1 -1
  162. package/dist/recovery/recoveryCode.d.ts +27 -7
  163. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  164. package/dist/recovery/recoveryCode.js +18 -6
  165. package/dist/recovery/recoveryCode.js.map +1 -1
  166. package/dist/recovery/recoveryDelegation.d.ts +23 -0
  167. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  168. package/dist/recovery/recoveryDelegation.js +66 -46
  169. package/dist/recovery/recoveryDelegation.js.map +1 -1
  170. package/dist/recovery/recoveryWebvh.d.ts +75 -63
  171. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  172. package/dist/recovery/recoveryWebvh.js +127 -116
  173. package/dist/recovery/recoveryWebvh.js.map +1 -1
  174. package/dist/request/appKey.d.ts +35 -1
  175. package/dist/request/appKey.d.ts.map +1 -1
  176. package/dist/request/appKey.js +29 -10
  177. package/dist/request/appKey.js.map +1 -1
  178. package/dist/request/classify.d.ts +32 -8
  179. package/dist/request/classify.d.ts.map +1 -1
  180. package/dist/request/classify.js +39 -14
  181. package/dist/request/classify.js.map +1 -1
  182. package/dist/request/ephemeralExchange.d.ts +1 -6
  183. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  184. package/dist/request/ephemeralExchange.js.map +1 -1
  185. package/dist/request/onboarding.d.ts.map +1 -1
  186. package/dist/request/onboarding.js +2 -2
  187. package/dist/request/onboarding.js.map +1 -1
  188. package/dist/request/parse.d.ts.map +1 -1
  189. package/dist/request/parse.js +2 -3
  190. package/dist/request/parse.js.map +1 -1
  191. package/dist/resourceLog/controller.d.ts +34 -12
  192. package/dist/resourceLog/controller.d.ts.map +1 -1
  193. package/dist/resourceLog/controller.js +79 -86
  194. package/dist/resourceLog/controller.js.map +1 -1
  195. package/dist/resourceLog/document.d.ts +182 -0
  196. package/dist/resourceLog/document.d.ts.map +1 -0
  197. package/dist/resourceLog/document.js +159 -0
  198. package/dist/resourceLog/document.js.map +1 -0
  199. package/dist/resourceLog/errors.d.ts +47 -8
  200. package/dist/resourceLog/errors.d.ts.map +1 -1
  201. package/dist/resourceLog/errors.js +54 -8
  202. package/dist/resourceLog/errors.js.map +1 -1
  203. package/dist/resourceLog/index.d.ts +7 -3
  204. package/dist/resourceLog/index.d.ts.map +1 -1
  205. package/dist/resourceLog/index.js +7 -3
  206. package/dist/resourceLog/index.js.map +1 -1
  207. package/dist/resourceLog/ladderRungs.d.ts +35 -0
  208. package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
  209. package/dist/resourceLog/ladderRungs.js +352 -0
  210. package/dist/resourceLog/ladderRungs.js.map +1 -0
  211. package/dist/resourceLog/license.d.ts +42 -17
  212. package/dist/resourceLog/license.d.ts.map +1 -1
  213. package/dist/resourceLog/license.js +38 -24
  214. package/dist/resourceLog/license.js.map +1 -1
  215. package/dist/space/activity.d.ts +15 -15
  216. package/dist/space/activity.d.ts.map +1 -1
  217. package/dist/space/activity.js +15 -15
  218. package/dist/space/activity.js.map +1 -1
  219. package/dist/space/collections.d.ts +11 -0
  220. package/dist/space/collections.d.ts.map +1 -1
  221. package/dist/space/collections.js +13 -0
  222. package/dist/space/collections.js.map +1 -1
  223. package/dist/space/deleteSpace.d.ts +28 -0
  224. package/dist/space/deleteSpace.d.ts.map +1 -0
  225. package/dist/space/deleteSpace.js +44 -0
  226. package/dist/space/deleteSpace.js.map +1 -0
  227. package/dist/space/errors.d.ts.map +1 -1
  228. package/dist/space/errors.js +0 -1
  229. package/dist/space/errors.js.map +1 -1
  230. package/dist/space/index.d.ts +6 -0
  231. package/dist/space/index.d.ts.map +1 -1
  232. package/dist/space/index.js +6 -0
  233. package/dist/space/index.js.map +1 -1
  234. package/dist/space/plaintextCollection.d.ts +43 -0
  235. package/dist/space/plaintextCollection.d.ts.map +1 -0
  236. package/dist/space/plaintextCollection.js +17 -0
  237. package/dist/space/plaintextCollection.js.map +1 -0
  238. package/dist/stages.d.ts +23 -0
  239. package/dist/stages.d.ts.map +1 -0
  240. package/dist/stages.js +23 -0
  241. package/dist/stages.js.map +1 -0
  242. package/dist/sync/index.d.ts +7 -0
  243. package/dist/sync/index.d.ts.map +1 -1
  244. package/dist/sync/index.js +7 -0
  245. package/dist/sync/index.js.map +1 -1
  246. package/dist/sync/push.js +4 -4
  247. package/dist/sync/push.js.map +1 -1
  248. package/dist/sync/remint.js +2 -2
  249. package/dist/sync/remint.js.map +1 -1
  250. package/dist/sync/types.d.ts +41 -1
  251. package/dist/sync/types.d.ts.map +1 -1
  252. package/dist/sync/types.js +47 -1
  253. package/dist/sync/types.js.map +1 -1
  254. package/dist/unlock/index.d.ts +5 -1
  255. package/dist/unlock/index.d.ts.map +1 -1
  256. package/dist/unlock/index.js +5 -1
  257. package/dist/unlock/index.js.map +1 -1
  258. package/dist/unlock/retire.d.ts +35 -7
  259. package/dist/unlock/retire.d.ts.map +1 -1
  260. package/dist/unlock/retire.js +52 -14
  261. package/dist/unlock/retire.js.map +1 -1
  262. package/dist/unlock/standingClient.d.ts.map +1 -1
  263. package/dist/unlock/standingClient.js +5 -1
  264. package/dist/unlock/standingClient.js.map +1 -1
  265. package/dist/unlock/standingWebvh.d.ts +217 -35
  266. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  267. package/dist/unlock/standingWebvh.js +469 -210
  268. package/dist/unlock/standingWebvh.js.map +1 -1
  269. package/dist/webvh/accountEntry.d.ts +146 -0
  270. package/dist/webvh/accountEntry.d.ts.map +1 -0
  271. package/dist/webvh/accountEntry.js +239 -0
  272. package/dist/webvh/accountEntry.js.map +1 -0
  273. package/dist/webvh/didWeb.d.ts +12 -7
  274. package/dist/webvh/didWeb.d.ts.map +1 -1
  275. package/dist/webvh/didWeb.js +2 -2
  276. package/dist/webvh/didWeb.js.map +1 -1
  277. package/dist/webvh/didWebProjection.d.ts +164 -0
  278. package/dist/webvh/didWebProjection.d.ts.map +1 -0
  279. package/dist/webvh/didWebProjection.js +230 -0
  280. package/dist/webvh/didWebProjection.js.map +1 -0
  281. package/dist/webvh/didWebvh.d.ts +275 -136
  282. package/dist/webvh/didWebvh.d.ts.map +1 -1
  283. package/dist/webvh/didWebvh.js +307 -340
  284. package/dist/webvh/didWebvh.js.map +1 -1
  285. package/dist/webvh/enrollClient.d.ts +65 -0
  286. package/dist/webvh/enrollClient.d.ts.map +1 -0
  287. package/dist/webvh/enrollClient.js +172 -0
  288. package/dist/webvh/enrollClient.js.map +1 -0
  289. package/dist/webvh/index.d.ts +37 -12
  290. package/dist/webvh/index.d.ts.map +1 -1
  291. package/dist/webvh/index.js +33 -10
  292. package/dist/webvh/index.js.map +1 -1
  293. package/dist/webvh/listClients.d.ts +1 -35
  294. package/dist/webvh/listClients.d.ts.map +1 -1
  295. package/dist/webvh/listClients.js +2 -30
  296. package/dist/webvh/listClients.js.map +1 -1
  297. package/dist/webvh/revokeClient.d.ts +41 -11
  298. package/dist/webvh/revokeClient.d.ts.map +1 -1
  299. package/dist/webvh/revokeClient.js +99 -48
  300. package/dist/webvh/revokeClient.js.map +1 -1
  301. package/dist/webvh/standingZcap.d.ts +61 -14
  302. package/dist/webvh/standingZcap.d.ts.map +1 -1
  303. package/dist/webvh/standingZcap.js +91 -0
  304. package/dist/webvh/standingZcap.js.map +1 -1
  305. package/dist/webvh/verifyLog.d.ts +59 -5
  306. package/dist/webvh/verifyLog.d.ts.map +1 -1
  307. package/dist/webvh/verifyLog.js +76 -11
  308. package/dist/webvh/verifyLog.js.map +1 -1
  309. package/dist/webvh/wasIdStore.d.ts +8 -8
  310. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  311. package/dist/webvh/wasIdStore.js +39 -14
  312. package/dist/webvh/wasIdStore.js.map +1 -1
  313. package/dist/webvh/zcap.d.ts +14 -1
  314. package/dist/webvh/zcap.d.ts.map +1 -1
  315. package/dist/webvh/zcap.js +3 -27
  316. package/dist/webvh/zcap.js.map +1 -1
  317. package/package.json +2 -2
  318. package/dist/webvh/keyAgreement.d.ts +0 -97
  319. package/dist/webvh/keyAgreement.d.ts.map +0 -1
  320. package/dist/webvh/keyAgreement.js +0 -71
  321. package/dist/webvh/keyAgreement.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { rotateRosterToDocumentAndCascade } from '../keys/index.js';
2
- import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from './standingWebvh.js';
2
+ import { readPublishedLogOrThrow } from '../webvh/didWebvh.js';
3
+ import { assertLadderVmClaimed, attributeUnlockLadderInventory, ladderVmClaimOf, removeUnlockKey, unlockKeyVmId } from './standingWebvh.js';
3
4
  /**
4
5
  * Retires one standing unlock credential from an account. See the module doc
5
6
  * for the order and the convergence story. Once the inventory edit lands, a
@@ -8,15 +9,23 @@ import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from
8
9
  *
9
10
  * @param options {object}
10
11
  * @param options.idStore {WebvhIdStore} the account's `id` collection store
11
- * @param options.updateKeys {ClientWebvhUpdateKeys} the RETIRING (enrolled)
12
- * client's own did:webvh update-key seeds, which sign the inventory edit
12
+ * @param options.signer {AccountLogSigner} who signs the inventory edit:
13
+ * the retiring enrolled client's own did:webvh update-key seeds, or the
14
+ * ACTING (surviving or successor) credential's ladder seed
13
15
  * @param options.unlockKeys {StandingUnlockKeys} the retired credential's
14
16
  * public inventory (its key-agreement publication and its recorded update
15
17
  * key, which the inventory edit treats as a ladder anchor rather than truth
16
18
  * -- see `removeUnlockKey`)
17
19
  * @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
18
20
  * seed, when the ceremony holds the credential's secret; it strengthens the
19
- * ladder attribution but is not required
21
+ * ladder attribution, and it is what a retry supplies after a seedless run
22
+ * refused with `UnclaimedLadderVmRetirementError`
23
+ * @param [options.projectionStore] {object} an `id`-collection store the
24
+ * caller may write through, passed straight to the inventory edit: the
25
+ * post-strike `did:web` projection is PUT through it immediately before
26
+ * that entry publishes, so a ladder-signed retirement does not leave
27
+ * `did.json` naming the retired credential. Best-effort, and omitted the
28
+ * behavior is unchanged (see `removeUnlockKey`)
20
29
  * @param [options.expectedDid] {string} the account DID from the caller's
21
30
  * stored account pointer; supplied, the inventory edit refuses a `did.jsonl`
22
31
  * resolving to any other account
@@ -46,7 +55,10 @@ import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from
46
55
  * re-mint (stage 0), run against the PRE-edit document with the ladder VM
47
56
  * ids this retirement is about to strike. Fail-closed: a throw aborts the
48
57
  * retirement before the document edit. Absent, the stage is skipped and no
49
- * log read happens for it (the no-WAS path)
58
+ * log read happens for it (the no-WAS path). It is also skipped on the
59
+ * ladder arm: every unlock record is signed by its own credential's ladder
60
+ * VM, so this strike rots no sibling record, and there is nothing to
61
+ * re-mint (`decisions/0019`)
50
62
  * @param [options.retireClientAnnexInventory] {Function} `({ document }) =>
51
63
  * Promise<ClientAnnexInventoryRetirement>` -- the annex reach (stage 1b in
52
64
  * the module doc), run against the post-edit document; a throw is caught
@@ -56,7 +68,7 @@ import { attributeUnlockLadderInventory, readLogOrThrow, removeUnlockKey } from
56
68
  * the session keeps operating without a re-login
57
69
  * @returns {Promise<UnlockCredentialRetirementResult>}
58
70
  */
59
- export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys, ladderSeed, expectedDid, pinStore, logId, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintDependentRecords, retireClientAnnexInventory, onRotationAdopted }) {
71
+ export async function retireUnlockCredential({ idStore, signer, unlockKeys, ladderSeed, projectionStore, expectedDid, pinStore, logId, verb, rosterStore, userKey, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted, collections, remintDependentRecords, retireClientAnnexInventory, onRotationAdopted }) {
60
72
  // 0. The dependent-record re-mint, against the PRE-edit document: whatever
61
73
  // the doomed ladder VM signed for OTHER credentials is re-signed under a
62
74
  // key that outlives the edit. The pass is named the VM ids the attribution
@@ -70,11 +82,17 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
70
82
  };
71
83
  let dependentRecords;
72
84
  let expectedLadderVmIds;
73
- if (remintDependentRecords) {
74
- const published = await readLogOrThrow({
75
- store: idStore,
85
+ // The stage is the enrolled branch's alone. On the ladder arm a record's
86
+ // bridge and sibling are signed by its own credential's ladder VM, so this
87
+ // strike reaches no record but the retired credential's own, which the
88
+ // caller deletes with its unlock Space (`decisions/0019`).
89
+ const ranRemint = Boolean(remintDependentRecords) && signer.kind === 'client';
90
+ if (ranRemint && remintDependentRecords) {
91
+ const published = await readPublishedLogOrThrow({
92
+ idStore,
76
93
  ...(expectedDid !== undefined ? { expectedDid } : {}),
77
- ...pinned
94
+ ...pinned,
95
+ missingMessage: 'did:webvh: did.jsonl is missing; nothing to enroll into.'
78
96
  });
79
97
  const inventory = await attributeUnlockLadderInventory({
80
98
  log: published.log,
@@ -82,6 +100,24 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
82
100
  unlockKeys,
83
101
  ...(ladderSeed ? { ladderSeed } : {})
84
102
  });
103
+ // The gate, before the pass writes anything: a claim that strikes no
104
+ // ladder VM while VMs stand unclaimed refuses here, with the credential
105
+ // still standing and no sibling record touched.
106
+ await assertLadderVmClaimed({
107
+ log: published.log,
108
+ doc: published.doc,
109
+ credentialVmId: unlockKeyVmId({
110
+ did: published.did,
111
+ keyAgreement: unlockKeys.keyAgreement
112
+ }),
113
+ claim: await ladderVmClaimOf({
114
+ doc: published.doc,
115
+ did: published.did,
116
+ inventory,
117
+ ...(ladderSeed ? { ladderSeed } : {})
118
+ }),
119
+ anchorKeyMultibase: unlockKeys.updateKeyMultibase
120
+ });
85
121
  // What the edit's own attribution must resolve to: the pass below acts on
86
122
  // this list, so an edit that resolved a different one would strike
87
123
  // something the pass never covered.
@@ -96,10 +132,12 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
96
132
  // its remaining recipients from.
97
133
  const { did, doc, log, ladderVm } = await removeUnlockKey({
98
134
  idStore,
99
- updateKeys,
135
+ signer,
100
136
  unlockKeys,
101
137
  ...(ladderSeed ? { ladderSeed } : {}),
138
+ ...(projectionStore ? { projectionStore } : {}),
102
139
  ...(expectedLadderVmIds !== undefined ? { expectedLadderVmIds } : {}),
140
+ requireLadderVmClaim: true,
103
141
  ...(expectedDid !== undefined ? { expectedDid } : {}),
104
142
  ...pinned,
105
143
  ...(verb !== undefined ? { verb } : {})
@@ -119,7 +157,7 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
119
157
  }
120
158
  }
121
159
  // 2. The shared roster-and-cascade tail: the roster rotation onto the
122
- // post-edit document (with its post-edit controller floor and its seal
160
+ // post-edit document (with its post-edit minimum controller version and its seal
123
161
  // backstop), then the collection fan-out onto the fresh key.
124
162
  const tail = await rotateRosterToDocumentAndCascade({
125
163
  rosterStore,
@@ -141,7 +179,7 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
141
179
  collections: tail.collections,
142
180
  document: doc,
143
181
  ...(clientAnnex ? { clientAnnex } : {}),
144
- ...(remintDependentRecords ? { dependentRecords } : {})
182
+ ...(ranRemint ? { dependentRecords } : {})
145
183
  };
146
184
  }
147
185
  if (tail.rotated) {
@@ -156,7 +194,7 @@ export async function retireUnlockCredential({ idStore, updateKeys, unlockKeys,
156
194
  userKey: tail.userKey,
157
195
  rosterDescriptor: tail.rosterDescriptor,
158
196
  ...(clientAnnex ? { clientAnnex } : {}),
159
- ...(remintDependentRecords ? { dependentRecords } : {})
197
+ ...(ranRemint ? { dependentRecords } : {})
160
198
  };
161
199
  }
162
200
  //# sourceMappingURL=retire.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/unlock/retire.ts"],"names":[],"mappings":"AAiGA,OAAO,EACL,gCAAgC,EAKjC,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,8BAA8B,EAC9B,cAAc,EACd,eAAe,EAGhB,MAAM,oBAAoB,CAAA;AAwC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EA4BlB;IACC,2EAA2E;IAC3E,yEAAyE;IACzE,2EAA2E;IAC3E,wEAAwE;IACxE,0EAA0E;IAC1E,wEAAwE;IACxE,4CAA4C;IAC5C,MAAM,MAAM,GAAG;QACb,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAA;IACD,IAAI,gBAAyB,CAAA;IAC7B,IAAI,mBAAyC,CAAA;IAC7C,IAAI,sBAAsB,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,MAAM,cAAc,CAAC;YACrC,KAAK,EAAE,OAAO;YACd,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrD,GAAG,MAAM;SACV,CAA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AAa,EAAE,UAAU,CAAA;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,4BAA4B,CAAC,EACjD,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkBhC"}
1
+ {"version":3,"file":"standingClient.d.ts","sourceRoot":"","sources":["../../src/unlock/standingClient.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,yCAAyC,CAAA;AAI1E;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,aAAa,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,wBAAwB,EAAE,MAAM,CAAA;IAChC;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,4BAA4B,CAAC,EACjD,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAmBhC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,aAAa,EAAE,UAAU,CAAA;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,4BAA4B,CAAC,EACjD,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkBhC"}
@@ -22,6 +22,7 @@
22
22
  */
23
23
  import { hkdf } from '@noble/hashes/hkdf.js';
24
24
  import { sha256 } from '@noble/hashes/sha2.js';
25
+ import { rosterRecipientKid } from '../keys/userKeyRoster.js';
25
26
  import { agentsFromSeed } from '../identity/agents.js';
26
27
  /**
27
28
  * The HKDF salt for a standing credential's client-side expansions, and the
@@ -57,7 +58,10 @@ export async function unlockClientIdentityFromSeed({ clientSeed }) {
57
58
  clientDid: agents.keyAgent.id,
58
59
  signingKeyMultibase: signingKeyMultibase,
59
60
  keyAgreementKeyMultibase,
60
- recipientKid: `${agents.keyAgent.id}#${keyAgreementKeyMultibase}`
61
+ recipientKid: rosterRecipientKid({
62
+ signingKeyMultibase: signingKeyMultibase,
63
+ keyAgreementKeyMultibase
64
+ })
61
65
  };
62
66
  }
63
67
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"standingClient.js","sourceRoot":"","sources":["../../src/unlock/standingClient.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sCAAsC,CAAA;AAC1E,MAAM,yBAAyB,GAAG,aAAa,CAAA;AAC/C,MAAM,yBAAyB,GAAG,aAAa,CAAA;AAwB/C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,UAAU,EAGX;IACC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;IACzD,MAAM,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,GACpD,MAAM,CAAC,eAA6D,CAAA;IACtE,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;IAC3E,CAAC;IACD,MAAM,CAAC,EAAE,AAAD,EAAG,mBAAmB,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/D,OAAO;QACL,UAA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AAM,4BAA4B,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;IACnE,OAAO,EAAE,GAAG,QAAQ,EAAE,aAAa,EAAE,CAAA;AACvC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { DIDDoc, DIDLog, VerificationMethod } from '@interop/did-method-webvh';
2
- import type { ClientWebvhUpdateKeys, PublishedWebvhLog, WebvhIdStore } from '../webvh/didWebvh.js';
2
+ import type { AccountLogSigner } from '../webvh/accountEntry.js';
3
+ import type { WebvhIdStore } from '../webvh/didWebvh.js';
3
4
  import type { ResourceLogPinStore } from '@interop/vh-resource-log';
4
5
  import { type LadderStandingInventory } from '../clientAnnex/ladder.js';
5
6
  /**
@@ -9,6 +10,15 @@ import { type LadderStandingInventory } from '../clientAnnex/ladder.js';
9
10
  * it too.
10
11
  */
11
12
  export type UnlockLogStore = Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
13
+ /**
14
+ * Which half of a credential's inventory one bind entry carries. `'all'` is
15
+ * the merged entry: the `keyAgreement` member, the update-key commitment, and
16
+ * the ladder VM together. The split halves exist for a ceremony that must
17
+ * land the credential's decryption material before its authority: `'key'`
18
+ * publishes the `keyAgreement` member alone, `'authority'` installs the
19
+ * ladder VM and commits the rung-0 hash.
20
+ */
21
+ export type UnlockInventoryPart = 'all' | 'key' | 'authority';
12
22
  /**
13
23
  * The ladder inventory the removal edit resolved from the log diverges from
14
24
  * what the caller was told one read earlier. A ceremony that names its
@@ -28,17 +38,54 @@ export declare class LadderInventoryDriftError extends Error {
28
38
  attributed: string[];
29
39
  });
30
40
  }
41
+ /**
42
+ * A retirement whose ladder attribution could not claim the retired
43
+ * credential's ladder VM, refused with nothing written. The shape is the
44
+ * seedless strike claiming nothing: the credential still stands in the
45
+ * document, the walk struck no ladder VM, and ladder VMs stand there that it
46
+ * could not claim. A leftover VM would keep the retired credential's
47
+ * delegation authority alive -- under `capabilityDelegation` it can still
48
+ * sign a DELETE-only capability on the account Space -- and nothing
49
+ * downstream can tell such a leftover from a sibling credential's standing
50
+ * VM, so the retirement is the one place the state can be closed
51
+ * (`decisions/0015`).
52
+ *
53
+ * `unclaimedLadderVmIds` names every ladder VM the walk left unclaimed, and
54
+ * `anchorKeyMultibase` the update key the walk was anchored on (a recovery
55
+ * code's revocation anchors on the rung-0 multibase the registry recorded at
56
+ * issuance). On a
57
+ * multi-credential account that list carries the siblings' VMs beside the
58
+ * retired credential's, since telling them apart is exactly what the walk
59
+ * could not do. `retryableWithLadderSeed` says whether a retry supplying the
60
+ * credential's ladder seed can let attribution succeed. The gate raises this
61
+ * error only from a seedless claim (a seeded one either strikes the derived
62
+ * VM or proves there is none), so the hint is `true` from this library; the
63
+ * member is the wallets' read for the retry they offer.
64
+ * Matched on `name` (the error crosses app-injected seams that may resolve
65
+ * to another copy of this package).
66
+ */
67
+ export declare class UnclaimedLadderVmRetirementError extends Error {
68
+ readonly unclaimedLadderVmIds: string[];
69
+ readonly retryableWithLadderSeed: boolean;
70
+ readonly anchorKeyMultibase?: string;
71
+ constructor({ unclaimedLadderVmIds, retryableWithLadderSeed, anchorKeyMultibase }: {
72
+ unclaimedLadderVmIds: string[];
73
+ retryableWithLadderSeed: boolean;
74
+ anchorKeyMultibase?: string;
75
+ });
76
+ }
31
77
  /**
32
78
  * What the removal edit says about ladder VMs: `struck`, the ids this entry
33
79
  * removed from the document, and `unclaimed`, the ladder VMs still standing
34
80
  * afterwards that this credential's attribution could not claim.
35
81
  *
36
- * `unclaimed` is information rather than a gate, and the caller cannot read
37
- * an orphan out of it by subtraction alone: a VM standing here may perfectly
38
- * well be a SIBLING credential's, which this ladder has no business claiming.
39
- * What it does catch is the seedless strike whose attribution claims nothing
40
- * -- a retirement that returns clean while the credential's VM stands on --
41
- * which would otherwise be reported as a completed removal.
82
+ * `unclaimed` is information, and the caller cannot read an orphan out of it
83
+ * by subtraction alone: a VM standing here may perfectly well be a SIBLING
84
+ * credential's, which this ladder has no business claiming. The gate that
85
+ * refuses the seedless strike claiming nothing is narrower
86
+ * ({@link assertLadderVmClaimed}): it reads `struck` empty beside a
87
+ * non-empty `unclaimed` while the credential itself still stands, and it
88
+ * runs only for a credential that carries a ladder.
42
89
  */
43
90
  export interface LadderVmRemovalReport {
44
91
  struck: string[];
@@ -59,7 +106,7 @@ export type UnlockKeyAgreementPublication = {
59
106
  /**
60
107
  * A standing credential's public inventory as the document and log carry it:
61
108
  * its key-agreement publication and the update key whose hash stands in
62
- * `nextKeyHashes` (ladder rung 0 at bind time; a code's single derived key).
109
+ * `nextKeyHashes` (ladder rung 0 at bind time, for every credential kind).
63
110
  */
64
111
  export interface StandingUnlockKeys {
65
112
  keyAgreement: UnlockKeyAgreementPublication;
@@ -107,6 +154,134 @@ export declare function attributeUnlockLadderInventory({ log, did, unlockKeys, l
107
154
  unlockKeys: StandingUnlockKeys;
108
155
  ladderSeed?: Uint8Array;
109
156
  }): Promise<LadderStandingInventory>;
157
+ /**
158
+ * What of the document's ladder VMs a credential's attribution claims: the
159
+ * VM its seed derives (when the ceremony holds one), plus every VM the log
160
+ * attributes to its ladder. Resolved once here and shared by the removal
161
+ * edit, the retirement ceremony's pre-edit stage, and the read-only
162
+ * pre-flight, so the three agree on what is struck and what is left.
163
+ *
164
+ * `struck` is what the removal edit strikes: the derived id when it stands,
165
+ * and the attributed ids. `unclaimed` is every ladder VM standing in the
166
+ * document that neither the seed nor the attribution claims -- on a
167
+ * multi-credential account, the siblings' VMs at least. A supplied seed also
168
+ * cross-checks the attribution: a log attributing a VM the seed does not
169
+ * derive refuses with {@link LadderAttributionError}.
170
+ *
171
+ * @param options {object}
172
+ * @param options.doc {DIDDoc} the document the attribution ran over
173
+ * @param options.did {string} the account DID
174
+ * @param options.inventory {LadderStandingInventory} the credential's
175
+ * attributed ladder inventory ({@link attributeUnlockLadderInventory})
176
+ * @param [options.ladderSeed] {Uint8Array} the credential's ladder seed
177
+ * @returns {Promise<{ ladderVmId?: string, struck: string[], unclaimed:
178
+ * string[] }>} the seed-derived VM id when a seed was held
179
+ */
180
+ export declare function ladderVmClaimOf({ doc, did, inventory, ladderSeed }: {
181
+ doc: DIDDoc;
182
+ did: string;
183
+ inventory: LadderStandingInventory;
184
+ ladderSeed?: Uint8Array;
185
+ }): Promise<{
186
+ ladderVmId?: string;
187
+ struck: string[];
188
+ unclaimed: string[];
189
+ }>;
190
+ /**
191
+ * The retirement gate (`decisions/0015`): refuses, with
192
+ * {@link UnclaimedLadderVmRetirementError}, a retirement of a
193
+ * ladder-carrying credential whose SEEDLESS claim struck nothing while a
194
+ * ladder VM that COULD BE THIS CREDENTIAL'S stands unclaimed and the
195
+ * credential itself still stands in the document. Deliberately narrower than
196
+ * "`unclaimed` is non-empty", which every retirement on a healthy
197
+ * multi-credential account produces, and narrower again than the standing
198
+ * unclaimed set: a sibling credential's VM is nothing this retirement could
199
+ * leave behind.
200
+ *
201
+ * Which unclaimed VMs are candidates is
202
+ * {@link ladderVmIdsIntroducedWithCredential}'s question, read off the log's
203
+ * entry shapes rather than off an attribution that has already refused: a VM
204
+ * introduced by the entry that introduced this credential's `keyAgreement`
205
+ * member, or by the entry that committed or authorized its anchor (the split
206
+ * bind, whose key and authority entries sit two versions apart). None, and
207
+ * the credential never had a VM to leave standing, so the retirement
208
+ * completes and strikes what it can. That is the torn issuance's orphan -- a
209
+ * credential with a `keyAgreement` member, no ladder VM, and no committed
210
+ * rung -- which previously could never be removed at all, since a sibling's
211
+ * standing VM refused it forever.
212
+ *
213
+ * Two shapes pass ahead of that. A credential whose `keyAgreement` member is
214
+ * already gone is a completed retirement re-running. And a claim resolved
215
+ * WITH the seed never refuses: the derived VM is either standing (and
216
+ * struck) or absent, and an absent derived VM is proof the credential has
217
+ * nothing to claim -- the last-client transition torn between its strike and
218
+ * reinstall entries leaves exactly that, and a seeded retirement there must
219
+ * complete rather than wait on the transition's re-run. So the error's retry
220
+ * hint is `true` whenever this gate raises it.
221
+ *
222
+ * The caller decides whether the credential carries a ladder.
223
+ *
224
+ * @param options {object}
225
+ * @param options.log {DIDLog} the verified log the claim was resolved over
226
+ * @param options.doc {DIDDoc} the document the claim was resolved over
227
+ * @param options.credentialVmId {string} the credential's `keyAgreement`
228
+ * verification-method id ({@link unlockKeyVmId})
229
+ * @param options.claim {{ ladderVmId?: string, struck: string[], unclaimed:
230
+ * string[] }} from {@link ladderVmClaimOf}
231
+ * @param [options.anchorKeyMultibase] {string} the update key the walk was
232
+ * anchored on: the candidate reading's second anchor form, and named in
233
+ * the refusal
234
+ * @returns {Promise<void>}
235
+ */
236
+ export declare function assertLadderVmClaimed({ log, doc, credentialVmId, claim, anchorKeyMultibase }: {
237
+ log: DIDLog;
238
+ doc: DIDDoc;
239
+ credentialVmId: string;
240
+ claim: {
241
+ ladderVmId?: string;
242
+ struck: string[];
243
+ unclaimed: string[];
244
+ };
245
+ anchorKeyMultibase?: string;
246
+ }): Promise<void>;
247
+ /**
248
+ * The retirement gate run read-only, before anything is written: one pinned
249
+ * read of the account log, the credential's ladder attribution, and
250
+ * {@link assertLadderVmClaimed} over the result. A caller that establishes a
251
+ * replacement credential before it retires the old one (a passphrase change,
252
+ * a tap-confirmed passkey removal) runs this first, so a gate refusal lands
253
+ * the way an invalid-input check does -- nothing established, no
254
+ * pending-shaped registry entry written -- rather than after establishment,
255
+ * where the refusal would leave a torn state no seedless repair can clear.
256
+ * The in-ceremony gate stays as defense in depth, and it is what answers a
257
+ * log entry landing between the pre-flight and the retirement: the
258
+ * pre-flight's verdict holds for the head it read, and nothing binds the two
259
+ * reads.
260
+ *
261
+ * @param options {object}
262
+ * @param options.idStore {UnlockLogStore} the account's `id` collection
263
+ * read side
264
+ * @param options.unlockKeys {StandingUnlockKeys} the credential's recorded
265
+ * public inventory
266
+ * @param [options.ladderSeed] {Uint8Array} the credential's ladder seed,
267
+ * when the caller holds it
268
+ * @param [options.expectedDid] {string} the account DID the log must
269
+ * resolve to
270
+ * @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
271
+ * pins
272
+ * @param [options.logId] {string} the account log's pin slot; required
273
+ * whenever a `pinStore` is supplied
274
+ * @returns {Promise<LadderVmRemovalReport>} what the retirement would
275
+ * strike and what it would leave unclaimed
276
+ */
277
+ export declare function preflightUnlockCredentialRetirement({ idStore, unlockKeys, ladderSeed, expectedDid, pinStore, logId }: {
278
+ idStore: Pick<WebvhIdStore, 'getIdResourceRaw'>;
279
+ unlockKeys: StandingUnlockKeys;
280
+ ladderSeed?: Uint8Array;
281
+ expectedDid?: string;
282
+ pinStore?: ResourceLogPinStore;
283
+ logId?: string;
284
+ }): Promise<LadderVmRemovalReport>;
110
285
  /**
111
286
  * The credential's `keyAgreement` verification method: an ordinary unmarked
112
287
  * entry carrying either the key verbatim (a `Multikey` with
@@ -127,27 +302,6 @@ export declare function unlockKeyVerificationMethod({ did, keyAgreement }: {
127
302
  did: string;
128
303
  keyAgreement: UnlockKeyAgreementPublication;
129
304
  }): VerificationMethod;
130
- /**
131
- * Reads and resolves the published log through the narrow store seam.
132
- *
133
- * @param options {object}
134
- * @param options.store {UnlockLogStore}
135
- * @param [options.expectedDid] {string} the account DID the log must resolve
136
- * to, where the caller holds one
137
- * @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
138
- * pins; a served log that is a rollback, a fork, or an identity switch
139
- * against the pinned head is refused (`ResourceLogContinuityError`)
140
- * @param [options.logId] {string} the account log's pin slot
141
- * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
142
- * supplied
143
- * @returns {Promise<PublishedWebvhLog>}
144
- */
145
- export declare function readLogOrThrow({ store, expectedDid, pinStore, logId }: {
146
- store: UnlockLogStore;
147
- expectedDid?: string;
148
- pinStore?: ResourceLogPinStore;
149
- logId?: string;
150
- }): Promise<PublishedWebvhLog>;
151
305
  /**
152
306
  * BIND (run by an enrolled client, root authority): publishes a standing
153
307
  * credential's split configuration into the document -- one entry adding the
@@ -163,8 +317,13 @@ export declare function readLogOrThrow({ store, expectedDid, pinStore, logId }:
163
317
  * idempotence against the SAME seed, finds the completed stage and publishes
164
318
  * nothing -- where a mint-when-absent would publish a second VM that no
165
319
  * anchored attribution could later strike. A credential with no ladder at all
166
- * (a recovery code, whose inventory is one key-agreement method and one
167
- * update key) passes `null` and gets no VM.
320
+ * passes `null` and gets no VM.
321
+ *
322
+ * `part` splits the bind across two entries where a ceremony needs the
323
+ * credential's decryption material to precede its authority: `'key'`
324
+ * publishes the `keyAgreement` member alone, `'authority'` installs the
325
+ * ladder VM and commits the rung-0 hash, and `'all'` (the default) is the one
326
+ * merged entry every other caller writes.
168
327
  *
169
328
  * Idempotent: an inventory already published is a no-op, so re-running a torn
170
329
  * bind converges. The entry publishes conditionally on the log this call
@@ -173,13 +332,16 @@ export declare function readLogOrThrow({ store, expectedDid, pinStore, logId }:
173
332
  *
174
333
  * @param options {object}
175
334
  * @param options.idStore {WebvhIdStore}
176
- * @param options.updateKeys {ClientWebvhUpdateKeys} the BINDING client's own
177
- * did:webvh update-key seeds
335
+ * @param options.signer {AccountLogSigner} who signs the entry: the BINDING
336
+ * client's own did:webvh update-key seeds, or the acting credential's
337
+ * ladder seed
178
338
  * @param options.unlockKeys {StandingUnlockKeys} the credential's public
179
339
  * inventory
180
340
  * @param options.ladderSeed {Uint8Array | null} the credential's ladder
181
341
  * seed, whose VM this entry installs; `null` for a credential that carries
182
342
  * no ladder
343
+ * @param [options.part] {string} `'all'` (the default), `'key'`, or
344
+ * `'authority'` -- see above
183
345
  * @param [options.expectedDid] {string} the account DID the log must resolve
184
346
  * to, from the caller's stored account pointer
185
347
  * @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
@@ -197,9 +359,10 @@ export declare function readLogOrThrow({ store, expectedDid, pinStore, logId }:
197
359
  */
198
360
  export declare function publishUnlockKey(options: {
199
361
  idStore: WebvhIdStore;
200
- updateKeys: ClientWebvhUpdateKeys;
362
+ signer: AccountLogSigner;
201
363
  unlockKeys: StandingUnlockKeys;
202
364
  ladderSeed: Uint8Array | null;
365
+ part?: UnlockInventoryPart;
203
366
  expectedDid?: string;
204
367
  pinStore?: ResourceLogPinStore;
205
368
  logId?: string;
@@ -263,6 +426,15 @@ export declare function publishUnlockKey(options: {
263
426
  * @param options {object} see {@link publishUnlockKey}, plus:
264
427
  * @param [options.ladderSeed] {Uint8Array} the retired credential's ladder
265
428
  * seed, when in hand
429
+ * @param [options.projectionStore] {object} an `id`-collection store the
430
+ * caller may write through (a transient session's, bound to its generation
431
+ * delegation; an enrolled client's own root-invoking store). Supplied, the
432
+ * post-strike `did:web` projection is PUT through it immediately BEFORE
433
+ * this entry publishes, which is what keeps a ladder-signed removal from
434
+ * leaving `did.json` naming the retired credential. Best-effort: a failed
435
+ * PUT is warned and the removal proceeds. Omitted, the ladder arm leaves
436
+ * the projection to the next visit's `ensureDidWebProjection` and the
437
+ * client arm publishes it after the entry, as before
266
438
  * @param [options.expectedLadderVmIds] {string[]} the ladder VM ids the
267
439
  * caller already resolved for this credential, from its own read of the
268
440
  * log. Supplied, this edit's own attribution must match them as a set --
@@ -270,16 +442,26 @@ export declare function publishUnlockKey(options: {
270
442
  * {@link LadderInventoryDriftError} before writing anything. That is what
271
443
  * ties the retirement's stage-0 read (whose list the dependent-record
272
444
  * re-mint pass acted on) to this one, which is otherwise independent
445
+ * @param [options.requireLadderVmClaim] {boolean} the credential carries a
446
+ * ladder, so its VM must be claimed: the edit refuses with
447
+ * {@link UnclaimedLadderVmRetirementError} before writing when the claim
448
+ * struck nothing while ladder VMs stand unclaimed and the credential still
449
+ * stands ({@link assertLadderVmClaimed}). The retirement ceremony sets it,
450
+ * and so does a recovery code's removal, whose inventory carries the code's
451
+ * own ladder VM. The refusal names the recorded update key the walk was
452
+ * anchored on
273
453
  * @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog, ladderVm:
274
454
  * LadderVmRemovalReport }>} see {@link publishUnlockKey}, plus the ladder
275
455
  * VM report: what this entry struck, and what stands unclaimed after it
276
456
  */
277
457
  export declare function removeUnlockKey(options: {
278
458
  idStore: WebvhIdStore;
279
- updateKeys: ClientWebvhUpdateKeys;
459
+ signer: AccountLogSigner;
460
+ projectionStore?: Pick<WebvhIdStore, 'getIdResourceRaw' | 'putIdResource'>;
280
461
  unlockKeys: StandingUnlockKeys;
281
462
  ladderSeed?: Uint8Array;
282
463
  expectedLadderVmIds?: string[];
464
+ requireLadderVmClaim?: boolean;
283
465
  expectedDid?: string;
284
466
  pinStore?: ResourceLogPinStore;
285
467
  logId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"standingWebvh.d.ts","sourceRoot":"","sources":["../../src/unlock/standingWebvh.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACN,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAclC,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAMnE,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,0BAA0B,CAAA;AAEjC;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,YAAY,EACZ,kBAAkB,GAAG,eAAe,CACrC,CAAA;AAED;;;;;;;;;;GAUG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAA;gBAEjB,EACV,QAAQ,EACR,UAAU,EACX,EAAE;QACD,QAAQ,EAAE,MAAM,EAAE,CAAA;QAClB,UAAU,EAAE,MAAM,EAAE,CAAA;KACrB;CAYF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,6BAA6B,GACvC;IAAE,kBAAkB,EAAE,MAAM,CAAA;CAAE,GAAG;I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