@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
@@ -12,11 +12,10 @@
12
12
  * `recovery/recoveryWebvh.ts`.
13
13
  */
14
14
  import { deriveNextKeyHash, updateDID } from '@interop/did-method-webvh';
15
- import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE, pinOfLog, relationIds, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
16
- import { ladderVmIds } from '../webvh/listClients.js';
17
- import { credentialKeyAgreementMethods } from '../webvh/keyAgreement.js';
15
+ import { assertCarryOverCommitments, ladderVerificationMethod, MULTIKEY_VM_TYPE, publishEntryPinned, readPublishedLogOrThrow, updateKeySigner, withLogConflictRetry } from '../webvh/didWebvh.js';
16
+ import { credentialKeyAgreementMethods, ladderVmIds, relationIds } from '../resourceLog/document.js';
18
17
  import { unlockKeyVerificationMethod, unlockKeyVmId } from '../unlock/standingWebvh.js';
19
- import { publishLogOnly, readLogOrThrow, RecoveryKeyNotCommittedError, recoveryVmId, retiredCredentialVmIdsFromLog } from '../recovery/recoveryWebvh.js';
18
+ import { RecoveryKeyNotCommittedError, recoveryVmId, retiredCredentialVmIdsFromLog } from '../recovery/recoveryWebvh.js';
20
19
  import { assertNextKeyHashesRemain, attributeRetiredCredentialRungs, ladderRung, ladderVmKeyMultibase, retiredCredentialRungsBeforeKey } from './ladder.js';
21
20
  import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
22
21
  /**
@@ -102,8 +101,10 @@ import { clientAnnexDidParts, servicesPointedAtClientAnnex } from './log.js';
102
101
  * @param options.credentialKeyAgreement {UnlockKeyAgreementPublication} the
103
102
  * fresh credential's key-agreement publication (a commitment for a
104
103
  * passphrase-derived key)
105
- * @param options.replacement {RecoveryPublicKeys} the replacement code's
106
- * public halves, committed and published in the same continuation
104
+ * @param options.replacement {ReplacementRecoveryPublicKeys} the
105
+ * replacement code's public halves -- its key-agreement key, its rung-0
106
+ * update key, and its ladder VM key -- committed and published in the same
107
+ * continuation
107
108
  * @param [options.expectedDid] {string} the account DID the log must resolve
108
109
  * to, where the recovering flow already knows it
109
110
  * @param options.onCommitted {function}
@@ -153,14 +154,12 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
153
154
  // Each attempt's own read is what the CAS publish is built on, so the
154
155
  // continuity check runs here -- and again on a conflict-retry re-run -- not
155
156
  // only on the verify that follows both entries.
156
- const pinned = {
157
- ...(pinStore ? { pinStore } : {}),
158
- ...(logId !== undefined ? { logId } : {})
159
- };
160
- let published = await readLogOrThrow({
161
- store,
162
- ...(expectedDid !== undefined ? { expectedDid } : {}),
163
- ...pinned
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.'
164
163
  });
165
164
  const rung0 = await ladderRung({ ladderSeed, index: 0 });
166
165
  const rung1 = await ladderRung({ ladderSeed, index: 1 });
@@ -237,22 +236,23 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
237
236
  ])
238
237
  ]
239
238
  });
240
- await publishLogOnly({
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({
241
243
  store,
242
244
  log: updated.log,
243
- ifMatch: published.etag
245
+ ifMatch: published.etag,
246
+ pinStore,
247
+ logId
244
248
  });
245
- // Advance the pin to what the reveal entry just published, so the re-read
246
- // below (and any read after a tear here) refuses a host that rolls the
247
- // log back behind it.
248
- if (pinStore && logId !== undefined) {
249
- await pinStore.write({ logId, pin: pinOfLog(updated.log) });
250
- }
251
249
  // The same account the reveal entry just extended, under the same pin.
252
- published = await readLogOrThrow({
253
- store,
250
+ published = await readPublishedLogOrThrow({
251
+ idStore: store,
254
252
  expectedDid: published.did,
255
- ...pinned
253
+ pinStore,
254
+ logId,
255
+ missingMessage: 'did:webvh: did.jsonl is missing; nothing to recover.'
256
256
  });
257
257
  }
258
258
  // The persist-before-publish seam: the replacement code's record and the
@@ -293,7 +293,19 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
293
293
  // controller (an enrolled client's carries the client marker instead), less
294
294
  // the ids this entry itself adds. The spent code's own id is reported
295
295
  // separately: the caller already retires that one by name.
296
- const addedVmIds = [ladderVmId, credentialVmId, replacementVmId];
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
+ ];
297
309
  const struckCredentialVmIds = credentialKeyAgreementMethods({ doc, did })
298
310
  .map(method => method.id)
299
311
  .filter((id) => typeof id === 'string')
@@ -320,7 +332,11 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
320
332
  type: MULTIKEY_VM_TYPE,
321
333
  controller: did,
322
334
  publicKeyMultibase: replacement.keyAgreementKeyMultibase
323
- }
335
+ },
336
+ ladderVerificationMethod({
337
+ controller: did,
338
+ publicKeyMultibase: replacement.ladderVmKeyMultibase
339
+ })
324
340
  ];
325
341
  const existingMethods = (doc.verificationMethod ?? []);
326
342
  const verificationMethods = [
@@ -365,14 +381,18 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
365
381
  // `capabilityInvocation` -- which is also what keeps it out of every
366
382
  // client listing.
367
383
  authentication: withoutRemoved(doc.authentication),
368
- assertionMethod: withoutRemoved(doc.assertionMethod, [ladderVmId]),
384
+ assertionMethod: withoutRemoved(doc.assertionMethod, [
385
+ ladderVmId,
386
+ replacementLadderVmId
387
+ ]),
369
388
  keyAgreement: withoutRemoved(doc.keyAgreement, [
370
389
  credentialVmId,
371
390
  replacementVmId
372
391
  ]),
373
392
  capabilityInvocation: withoutRemoved(doc.capabilityInvocation),
374
393
  capabilityDelegation: withoutRemoved(doc.capabilityDelegation, [
375
- ladderVmId
394
+ ladderVmId,
395
+ replacementLadderVmId
376
396
  ]),
377
397
  // Atomic with the retirement above: the pointer and the ladder-VM set
378
398
  // change in one entry, so no window exists in which the document points
@@ -385,12 +405,13 @@ async function recoverWebvhLadderAnchoredOnce({ store, recovery, ladderSeed, cre
385
405
  });
386
406
  // Conditional on the read this entry was built on: the re-read above when
387
407
  // the commit entry ran here, the first read when it was skipped.
388
- await publishLogOnly({ store, log: updated.log, ifMatch: published.etag });
389
- // Advance the pin to what this entry just published, so a host rolling the
390
- // log back straight afterwards is refused on the next read.
391
- if (pinStore && logId !== undefined) {
392
- await pinStore.write({ logId, pin: pinOfLog(updated.log) });
393
- }
408
+ await publishEntryPinned({
409
+ store,
410
+ log: updated.log,
411
+ ifMatch: published.etag,
412
+ pinStore,
413
+ logId
414
+ });
394
415
  return {
395
416
  did: updated.did,
396
417
  doc: updated.doc,
@@ -1 +1 @@
1
- {"version":3,"file":"recoveryLadderAnchored.js","sourceRoot":"","sources":["../../src/clientAnnex/recoveryLadderAnchored.ts"],"names":[],"mappings":"A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QACtB,gBAAgB,EAAE,MAAM,CAAC,YAAY;QACrC,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;QACzD,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAA;AACH,CAAC"}
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,mEAAmE;YACjE,oEAAoE;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,CAAC,MAAM;KACvB,CAAA;AACH,CAAC"}
@@ -0,0 +1,123 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * Single-verb Space capabilities: the short-lived children a transient
6
+ * session mints so it can destroy (or probe) a Space it has no root
7
+ * invocation over. Two shapes, one mint, both target-exact:
8
+ *
9
+ * - Three links, over a stored parent. The parent is the management zcap an
10
+ * unlock identity delegated to the account at bind time. The child's
11
+ * `invocationTarget` is the parent's own, copied verbatim from the parent's
12
+ * bytes rather than rebuilt, so a deployment whose stored parent carries a
13
+ * target this client would build differently still lands on the bytes the
14
+ * server checks.
15
+ * - Two links, over a Space's synthesized root. The child's
16
+ * `invocationTarget` is the bare Space URL, built with was-client's path
17
+ * builders so a sub-path deployment keeps its prefix.
18
+ *
19
+ * `allowedAction` is exactly one HTTP verb -- `DELETE` for the deletion
20
+ * child, `GET` for the probe child -- which is what a storage server's
21
+ * admission predicate keys on. The delegatee is the caller's: the ladder
22
+ * VM's bare did:key on a transient session (it re-derives from the ladder
23
+ * seed and resolves from its own bytes, so it outlives the account log it
24
+ * was minted beside), the account did:webvh on a remembered one.
25
+ *
26
+ * Nothing here is stored. A child is minted immediately before its own
27
+ * request and dropped; on a torn run it lapses by its short TTL, so no
28
+ * revocation is owed.
29
+ *
30
+ * Two checks stay with the caller rather than here: that the parent's
31
+ * `controller` is the delegator this client signs as, and that the parent's
32
+ * target names the Space the caller means on the deployment it is talking
33
+ * to. The caller holds the deployment URL and the delegator DID; this module
34
+ * holds neither, and guessing either would rebuild the very bytes the
35
+ * verbatim copy exists to preserve.
36
+ */
37
+ import type { IZcap } from '@interop/data-integrity-core';
38
+ import type { ZcapClient } from '@interop/ezcap';
39
+ /**
40
+ * The single-verb Space capability's lifetime: ten minutes, long enough for
41
+ * the request it is minted for and twice `@interop/zcap`'s 300-second clock
42
+ * skew allowance. A child's `expires` is the earlier of this and its
43
+ * parent's, since the library refuses a child less restrictive than its
44
+ * parent with no skew allowance.
45
+ */
46
+ export declare const DELETION_ZCAP_TTL_MS: number;
47
+ /**
48
+ * The two verbs a single-verb Space capability may carry: the deletion
49
+ * child's `DELETE` and the probe child's `GET`.
50
+ */
51
+ export type SpaceCapabilityVerb = 'DELETE' | 'GET';
52
+ /**
53
+ * The typed refusal of a mint over a parent capability whose own `expires`
54
+ * has already passed: the child would verify nowhere, so nothing is minted
55
+ * and nothing is sent. Matched on `name` -- error classes do not survive
56
+ * crossing package copies. The parent's `expires` and `id` ride the error so
57
+ * a caller can name the lapsed capability in its own copy without re-reading
58
+ * the parent.
59
+ */
60
+ export declare class ExpiredParentCapabilityError extends Error {
61
+ readonly parentExpires: string;
62
+ readonly parentId: string | undefined;
63
+ constructor({ message, parentExpires, parentId }: {
64
+ message: string;
65
+ parentExpires: string;
66
+ parentId: string | undefined;
67
+ });
68
+ }
69
+ /**
70
+ * Mints a single-verb child of a STORED parent capability -- the three-link
71
+ * shape, used on an unlock Space whose management zcap the account already
72
+ * holds. The child's `invocationTarget` is the parent's unchanged.
73
+ *
74
+ * @param options {object}
75
+ * @param options.zcapClient {ZcapClient} the delegating signer (the ladder
76
+ * VM's client on a transient session, an enrolled client's on a remembered
77
+ * one)
78
+ * @param options.parent {IZcap} the stored parent capability
79
+ * @param options.verb {SpaceCapabilityVerb} the child's one allowed action
80
+ * @param options.controller {string} the delegatee DID
81
+ * @param [options.ttlMs] {number} the child's requested lifetime
82
+ * @param [options.now] {number} the clock the child is minted against
83
+ * (epoch milliseconds); a caller holding server-relative time passes it
84
+ * so the proof's `created` and the child's `expires` come off one clock
85
+ * @returns {Promise<IZcap>}
86
+ */
87
+ export declare function mintSpaceVerbCapability({ zcapClient, parent, verb, controller, ttlMs, now }: {
88
+ zcapClient: ZcapClient;
89
+ parent: IZcap;
90
+ verb: SpaceCapabilityVerb;
91
+ controller: string;
92
+ ttlMs?: number;
93
+ now?: number;
94
+ }): Promise<IZcap>;
95
+ /**
96
+ * Mints a single-verb child of a Space's SYNTHESIZED ROOT -- the two-link
97
+ * shape, used on the account Space and an auxiliary annex Space, where the
98
+ * session holds no stored parent. The child's `invocationTarget` is the bare
99
+ * Space URL, with no trailing slash, so the deletion child covers the Space
100
+ * itself rather than its items subtree.
101
+ *
102
+ * @param options {object}
103
+ * @param options.zcapClient {ZcapClient} the delegating signer
104
+ * @param options.storageServerUrl {string} the Space's storage server
105
+ * @param options.spaceId {string}
106
+ * @param options.verb {SpaceCapabilityVerb} the child's one allowed action
107
+ * @param options.controller {string} the delegatee DID
108
+ * @param [options.ttlMs] {number} the child's requested lifetime
109
+ * @param [options.now] {number} the clock the child is minted against
110
+ * (epoch milliseconds); a caller holding server-relative time passes it
111
+ * so the proof's `created` and the child's `expires` come off one clock
112
+ * @returns {Promise<IZcap>}
113
+ */
114
+ export declare function mintSpaceRootVerbCapability({ zcapClient, storageServerUrl, spaceId, verb, controller, ttlMs, now }: {
115
+ zcapClient: ZcapClient;
116
+ storageServerUrl: string;
117
+ spaceId: string;
118
+ verb: SpaceCapabilityVerb;
119
+ controller: string;
120
+ ttlMs?: number;
121
+ now?: number;
122
+ }): Promise<IZcap>;
123
+ //# sourceMappingURL=spaceCapability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaceCapability.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/spaceCapability.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAiB,CAAA;AAElD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,KAAK,CAAA;AAElD;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;gBAEzB,EACV,OAAO,EACP,aAAa,EACb,QAAQ,EACT,EAAE;QACD,OAAO,EAAE,MAAM,CAAA;QACf,aAAa,EAAE,MAAM,CAAA;QACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;KAC7B;CAMF;AA+ED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,uBAAuB,CAAC,EAC5C,UAAU,EACV,MAAM,EACN,IAAI,EACJ,UAAU,EACV,KAA4B,EAC5B,GAAgB,EACjB,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,KAAK,CAAA;IACb,IAAI,EAAE,mBAAmB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,KAAK,CAAC,CAkBjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAA4B,EAC5B,GAAgB,EACjB,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,mBAAmB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,GAAG,OAAO,CAAC,KAAK,CAAC,CAajB"}
@@ -0,0 +1,152 @@
1
+ import { rootCapabilityId, spacePath, toUrl } from '@interop/was-client/paths';
2
+ /**
3
+ * The single-verb Space capability's lifetime: ten minutes, long enough for
4
+ * the request it is minted for and twice `@interop/zcap`'s 300-second clock
5
+ * skew allowance. A child's `expires` is the earlier of this and its
6
+ * parent's, since the library refuses a child less restrictive than its
7
+ * parent with no skew allowance.
8
+ */
9
+ export const DELETION_ZCAP_TTL_MS = 10 * 60 * 1000;
10
+ /**
11
+ * The typed refusal of a mint over a parent capability whose own `expires`
12
+ * has already passed: the child would verify nowhere, so nothing is minted
13
+ * and nothing is sent. Matched on `name` -- error classes do not survive
14
+ * crossing package copies. The parent's `expires` and `id` ride the error so
15
+ * a caller can name the lapsed capability in its own copy without re-reading
16
+ * the parent.
17
+ */
18
+ export class ExpiredParentCapabilityError extends Error {
19
+ parentExpires;
20
+ parentId;
21
+ constructor({ message, parentExpires, parentId }) {
22
+ super(message);
23
+ this.name = 'ExpiredParentCapabilityError';
24
+ this.parentExpires = parentExpires;
25
+ this.parentId = parentId;
26
+ }
27
+ }
28
+ /**
29
+ * The child's expiry: `min(now + ttlMs, parent.expires)`. A parent already
30
+ * expired is refused rather than minted from, since the child would verify
31
+ * nowhere.
32
+ *
33
+ * @param options {object}
34
+ * @param options.ttlMs {number}
35
+ * @param [options.parent] {IZcap} the stored parent capability, absent on
36
+ * the root-parented shape (a synthesized root has no expiry)
37
+ * @param options.now {number} epoch milliseconds
38
+ * @returns {Date}
39
+ */
40
+ function childExpires({ ttlMs, parent, now }) {
41
+ const requested = now + ttlMs;
42
+ const parentExpires = Date.parse(parent?.expires ?? '');
43
+ if (Number.isNaN(parentExpires)) {
44
+ return new Date(requested);
45
+ }
46
+ if (parentExpires <= now) {
47
+ const expiresIso = new Date(parentExpires).toISOString();
48
+ throw new ExpiredParentCapabilityError({
49
+ message: 'single-verb Space capability: the parent capability expired at ' +
50
+ `${expiresIso}; refusing to mint a child that verifies nowhere.`,
51
+ parentExpires: expiresIso,
52
+ parentId: parent?.id
53
+ });
54
+ }
55
+ return new Date(Math.min(requested, parentExpires));
56
+ }
57
+ /**
58
+ * Refuses a child the parent cannot authorize. A parent's `allowedAction` may
59
+ * be a single string, a list, or absent (which delegates every action), so
60
+ * the check normalizes before asking. Refusing locally is what keeps the
61
+ * failure legible: an unauthorized invocation comes back from the storage
62
+ * server as a 404, indistinguishable from a Space that is simply gone, so a
63
+ * child that verifies nowhere must never be minted and sent.
64
+ *
65
+ * @param options {object}
66
+ * @param options.parent {IZcap}
67
+ * @param options.verb {SpaceCapabilityVerb}
68
+ * @returns {void}
69
+ */
70
+ function assertParentAllows({ parent, verb }) {
71
+ const allowed = parent
72
+ .allowedAction;
73
+ if (allowed === undefined) {
74
+ return;
75
+ }
76
+ const actions = Array.isArray(allowed) ? allowed : [allowed];
77
+ if (actions.length === 0 || actions.includes(verb)) {
78
+ return;
79
+ }
80
+ throw new Error(`single-verb Space capability: the parent capability allows ` +
81
+ `${actions.join(', ')} and not ${verb}; refusing to mint a child that ` +
82
+ 'verifies nowhere.');
83
+ }
84
+ /**
85
+ * Mints a single-verb child of a STORED parent capability -- the three-link
86
+ * shape, used on an unlock Space whose management zcap the account already
87
+ * holds. The child's `invocationTarget` is the parent's unchanged.
88
+ *
89
+ * @param options {object}
90
+ * @param options.zcapClient {ZcapClient} the delegating signer (the ladder
91
+ * VM's client on a transient session, an enrolled client's on a remembered
92
+ * one)
93
+ * @param options.parent {IZcap} the stored parent capability
94
+ * @param options.verb {SpaceCapabilityVerb} the child's one allowed action
95
+ * @param options.controller {string} the delegatee DID
96
+ * @param [options.ttlMs] {number} the child's requested lifetime
97
+ * @param [options.now] {number} the clock the child is minted against
98
+ * (epoch milliseconds); a caller holding server-relative time passes it
99
+ * so the proof's `created` and the child's `expires` come off one clock
100
+ * @returns {Promise<IZcap>}
101
+ */
102
+ export async function mintSpaceVerbCapability({ zcapClient, parent, verb, controller, ttlMs = DELETION_ZCAP_TTL_MS, now = Date.now() }) {
103
+ const invocationTarget = parent
104
+ .invocationTarget;
105
+ if (invocationTarget === undefined) {
106
+ throw new Error('single-verb Space capability: the parent capability names no ' +
107
+ '`invocationTarget`.');
108
+ }
109
+ assertParentAllows({ parent, verb });
110
+ return (await zcapClient.delegate({
111
+ capability: parent,
112
+ invocationTarget,
113
+ controller,
114
+ allowedActions: [verb],
115
+ expires: childExpires({ ttlMs, parent, now }),
116
+ now
117
+ }));
118
+ }
119
+ /**
120
+ * Mints a single-verb child of a Space's SYNTHESIZED ROOT -- the two-link
121
+ * shape, used on the account Space and an auxiliary annex Space, where the
122
+ * session holds no stored parent. The child's `invocationTarget` is the bare
123
+ * Space URL, with no trailing slash, so the deletion child covers the Space
124
+ * itself rather than its items subtree.
125
+ *
126
+ * @param options {object}
127
+ * @param options.zcapClient {ZcapClient} the delegating signer
128
+ * @param options.storageServerUrl {string} the Space's storage server
129
+ * @param options.spaceId {string}
130
+ * @param options.verb {SpaceCapabilityVerb} the child's one allowed action
131
+ * @param options.controller {string} the delegatee DID
132
+ * @param [options.ttlMs] {number} the child's requested lifetime
133
+ * @param [options.now] {number} the clock the child is minted against
134
+ * (epoch milliseconds); a caller holding server-relative time passes it
135
+ * so the proof's `created` and the child's `expires` come off one clock
136
+ * @returns {Promise<IZcap>}
137
+ */
138
+ export async function mintSpaceRootVerbCapability({ zcapClient, storageServerUrl, spaceId, verb, controller, ttlMs = DELETION_ZCAP_TTL_MS, now = Date.now() }) {
139
+ const spaceUrl = toUrl({
140
+ serverUrl: storageServerUrl,
141
+ path: spacePath(spaceId)
142
+ });
143
+ return (await zcapClient.delegate({
144
+ capability: rootCapabilityId(spaceUrl),
145
+ invocationTarget: spaceUrl,
146
+ controller,
147
+ allowedActions: [verb],
148
+ expires: childExpires({ ttlMs, now }),
149
+ now
150
+ }));
151
+ }
152
+ //# sourceMappingURL=spaceCapability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaceCapability.js","sourceRoot":"","sources":["../../src/clientAnnex/spaceCapability.ts"],"names":[],"mappings":"AAsCA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAQlD;;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O,EACP,IAAI,EACJ,UAAU,EACV,KAAK,GAAG,oBAAoB,EAC5B,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,EASjB;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC;QACrB,SAAS,EAAE,gBAAgB;QAC3B,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC;KACzB,CAAC,CAAA;IACF,OAAO,CAAC,MAAM,UAAU,CAAC,QAAQ,CAAC;QAChC,UAAU,EAAE,gBAAgB,CAAC,QAAQ,CAAC;QACtC,gBAAgB,EAAE,QAAQ;QAC1B,UAAU;QACV,cAAc,EAAE,CAAC,IAAI,CAAC;QACtB,OAAO,EAAE,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACrC,GAAG;KACJ,CAAC,CAAU,CAAA;AACd,CAAC"}
@@ -0,0 +1,63 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The stage vocabulary of the credential-anchored ceremonies: the ordered
6
+ * tuples their `onStage` notifiers report from, the aliases, and the union
7
+ * types derived from them. The ceremonies emit from these types, so a
8
+ * mistyped stage name fails the type check, and a consumer's progress
9
+ * display derives its step list from the tuples instead of re-declaring the
10
+ * names as bare strings.
11
+ *
12
+ * The vocabulary sits in a leaf module of its own rather than beside the
13
+ * code that emits it, because a progress display needs the names and none of
14
+ * the ceremony: an app store importing them from `establish.js` would pull
15
+ * that whole module graph into its bundle.
16
+ */
17
+ import { KMS_AUTHENTICATION_STAGE } from '../stages.js';
18
+ export { KMS_AUTHENTICATION_STAGE };
19
+ /**
20
+ * The controller-promotion stage, emitted by the genesis ceremony when it
21
+ * promotes and by the establishment when the promotion is deferred to it.
22
+ * Declared once so the two emitters cannot drift apart.
23
+ */
24
+ export declare const CONTROLLER_PROMOTION_STAGE = "controller-promotion";
25
+ /**
26
+ * The stages `ensureCredentialAnchoredAccountGenesis` reports, in the order
27
+ * they fire, up to but not including the controller promotion (which a
28
+ * caller may defer -- see {@link CONTROLLER_PROMOTION_STAGE}).
29
+ */
30
+ export declare const CREDENTIAL_ANCHORED_GENESIS_STAGES: readonly ["space-provisioning", "kms-authentication", "webvh-genesis", "roster-genesis", "collection-epochs"];
31
+ /**
32
+ * A stage name the credential-anchored genesis may emit.
33
+ */
34
+ export type CredentialAnchoredGenesisStage = (typeof CREDENTIAL_ANCHORED_GENESIS_STAGES)[number] | typeof CONTROLLER_PROMOTION_STAGE;
35
+ /**
36
+ * The establishment's stage names in the order they fire: its own marks with
37
+ * the genesis ceremony's spliced in where that ceremony runs (stage 2).
38
+ *
39
+ * Two kinds of name are absent by construction. The stages whose body is a
40
+ * caller's own closure (`beforePromotion`, `promoteKeystore`) are the
41
+ * caller's to name and mark, since only the caller knows what its closure
42
+ * does; and an alias below fires in place of a listed name rather than
43
+ * beside it.
44
+ */
45
+ export declare const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES: readonly ["interim-bind", "space-provisioning", "kms-authentication", "webvh-genesis", "roster-genesis", "collection-epochs", "account-log-read", "annex-generation", "record-rebind", "controller-promotion"];
46
+ /**
47
+ * A stage the establishment reports as a step of its own.
48
+ */
49
+ export type CredentialAnchoredEstablishmentStage = (typeof CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES)[number];
50
+ /**
51
+ * Stage names that fire in place of a listed stage rather than beside it,
52
+ * and the stage each stands in for. The heal branch delivers the collection
53
+ * epochs off an adopted roster instead of minting them, so its mark closes
54
+ * the boundary `collection-epochs` closes on a fresh run.
55
+ */
56
+ export declare const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES: {
57
+ readonly 'roster-delivered-epochs': "collection-epochs";
58
+ };
59
+ /**
60
+ * Every name the establishment may emit: the stages above plus the aliases.
61
+ */
62
+ export type CredentialAnchoredEstablishmentStageName = CredentialAnchoredEstablishmentStage | keyof typeof CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES;
63
+ //# sourceMappingURL=stages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/stages.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD,OAAO,EAAE,wBAAwB,EAAE,CAAA;AAEnC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,yBAAyB,CAAA;AAEhE;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,+GAMrC,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,GACnD,OAAO,0BAA0B,CAAA;AAErC;;;;;;;;;GASG;AACH,eAAO,MAAM,wCAAwC,gNAO3C,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAC9C,CAAC,OAAO,wCAAwC,CAAC,CAAC,MAAM,CAAC,CAAA;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,+CAA+C;;CAEa,CAAA;AAEzE;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAChD,oCAAoC,GACpC,MAAM,OAAO,+CAA+C,CAAA"}
@@ -0,0 +1,64 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The stage vocabulary of the credential-anchored ceremonies: the ordered
6
+ * tuples their `onStage` notifiers report from, the aliases, and the union
7
+ * types derived from them. The ceremonies emit from these types, so a
8
+ * mistyped stage name fails the type check, and a consumer's progress
9
+ * display derives its step list from the tuples instead of re-declaring the
10
+ * names as bare strings.
11
+ *
12
+ * The vocabulary sits in a leaf module of its own rather than beside the
13
+ * code that emits it, because a progress display needs the names and none of
14
+ * the ceremony: an app store importing them from `establish.js` would pull
15
+ * that whole module graph into its bundle.
16
+ */
17
+ import { KMS_AUTHENTICATION_STAGE } from '../stages.js';
18
+ export { KMS_AUTHENTICATION_STAGE };
19
+ /**
20
+ * The controller-promotion stage, emitted by the genesis ceremony when it
21
+ * promotes and by the establishment when the promotion is deferred to it.
22
+ * Declared once so the two emitters cannot drift apart.
23
+ */
24
+ export const CONTROLLER_PROMOTION_STAGE = 'controller-promotion';
25
+ /**
26
+ * The stages `ensureCredentialAnchoredAccountGenesis` reports, in the order
27
+ * they fire, up to but not including the controller promotion (which a
28
+ * caller may defer -- see {@link CONTROLLER_PROMOTION_STAGE}).
29
+ */
30
+ export const CREDENTIAL_ANCHORED_GENESIS_STAGES = [
31
+ 'space-provisioning',
32
+ KMS_AUTHENTICATION_STAGE,
33
+ 'webvh-genesis',
34
+ 'roster-genesis',
35
+ 'collection-epochs'
36
+ ];
37
+ /**
38
+ * The establishment's stage names in the order they fire: its own marks with
39
+ * the genesis ceremony's spliced in where that ceremony runs (stage 2).
40
+ *
41
+ * Two kinds of name are absent by construction. The stages whose body is a
42
+ * caller's own closure (`beforePromotion`, `promoteKeystore`) are the
43
+ * caller's to name and mark, since only the caller knows what its closure
44
+ * does; and an alias below fires in place of a listed name rather than
45
+ * beside it.
46
+ */
47
+ export const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGES = [
48
+ 'interim-bind',
49
+ ...CREDENTIAL_ANCHORED_GENESIS_STAGES,
50
+ 'account-log-read',
51
+ 'annex-generation',
52
+ 'record-rebind',
53
+ CONTROLLER_PROMOTION_STAGE
54
+ ];
55
+ /**
56
+ * Stage names that fire in place of a listed stage rather than beside it,
57
+ * and the stage each stands in for. The heal branch delivers the collection
58
+ * epochs off an adopted roster instead of minting them, so its mark closes
59
+ * the boundary `collection-epochs` closes on a fresh run.
60
+ */
61
+ export const CREDENTIAL_ANCHORED_ESTABLISHMENT_STAGE_ALIASES = {
62
+ 'roster-delivered-epochs': 'collection-epochs'
63
+ };
64
+ //# sourceMappingURL=stages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stages.js","sourceRoot":"","sources":["../../src/clientAnnex/stages.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD,OAAO,EAAE,wBAAwB,EAAE,CAAA;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAA;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,oBAAoB;IACpB,wBAAwB;IACxB,eAAe;IACf,gBAAgB;IAChB,mBAAmB;CACX,CAAA;AASV;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG;IACtD,cAAc;IACd,GAAG,kCAAkC;IACrC,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,0BAA0B;CAClB,CAAA;AAQV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAG;IAC7D,yBAAyB,EAAE,mBAAmB;CACyB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { ZcapClient } from '@interop/ezcap';
1
+ import type { ZcapClient } from '@interop/ezcap';
2
2
  import type { ICapabilityAgent } from '../webvh/zcap.js';
3
3
  /**
4
4
  * A ZcapClient signing with the account ladder's document-visible
@@ -1 +1 @@
1
- {"version":3,"file":"zcap.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,UAAU,EACV,UAAU,EACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,UAAU,CAAC,CAqBtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA4B5B"}
1
+ {"version":3,"file":"zcap.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/zcap.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAgDxD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,UAAU,EACV,UAAU,EACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,UAAU,CAAC,CAGtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACX,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;CACvB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkB5B"}