@interop/wallet-core 0.51.0 → 0.53.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 (292) hide show
  1. package/README.md +7 -11
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +2 -2
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +1 -1
  5. package/dist/clientAnnex/forget.d.ts +18 -6
  6. package/dist/clientAnnex/forget.d.ts.map +1 -1
  7. package/dist/clientAnnex/forget.js +19 -6
  8. package/dist/clientAnnex/forget.js.map +1 -1
  9. package/dist/clientAnnex/forgetLast.d.ts +51 -30
  10. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  11. package/dist/clientAnnex/forgetLast.js +72 -26
  12. package/dist/clientAnnex/forgetLast.js.map +1 -1
  13. package/dist/clientAnnex/gc.d.ts +3 -3
  14. package/dist/clientAnnex/gc.d.ts.map +1 -1
  15. package/dist/clientAnnex/gc.js +2 -2
  16. package/dist/clientAnnex/gc.js.map +1 -1
  17. package/dist/clientAnnex/index.d.ts +6 -6
  18. package/dist/clientAnnex/index.d.ts.map +1 -1
  19. package/dist/clientAnnex/index.js +5 -5
  20. package/dist/clientAnnex/index.js.map +1 -1
  21. package/dist/clientAnnex/ladder.d.ts +19 -11
  22. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  23. package/dist/clientAnnex/ladder.js +77 -14
  24. package/dist/clientAnnex/ladder.js.map +1 -1
  25. package/dist/clientAnnex/ladderAnchored.d.ts +146 -10
  26. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  27. package/dist/clientAnnex/ladderAnchored.js +230 -26
  28. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  29. package/dist/clientAnnex/log.d.ts +6 -6
  30. package/dist/clientAnnex/log.d.ts.map +1 -1
  31. package/dist/clientAnnex/log.js +8 -8
  32. package/dist/clientAnnex/log.js.map +1 -1
  33. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +18 -7
  34. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  35. package/dist/clientAnnex/recoveryLadderAnchored.js +54 -14
  36. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  37. package/dist/clientAnnex/selfEnroll.d.ts +67 -6
  38. package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
  39. package/dist/clientAnnex/selfEnroll.js +91 -15
  40. package/dist/clientAnnex/selfEnroll.js.map +1 -1
  41. package/dist/clients/listing.d.ts +1 -1
  42. package/dist/clients/listing.d.ts.map +1 -1
  43. package/dist/clients/listing.js +1 -1
  44. package/dist/clients/listing.js.map +1 -1
  45. package/dist/clients/revocation.d.ts +1 -1
  46. package/dist/clients/rosterPolicy.d.ts +1 -1
  47. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  48. package/dist/clients/rosterPolicy.js +10 -7
  49. package/dist/clients/rosterPolicy.js.map +1 -1
  50. package/dist/descriptors/acquire.js +1 -1
  51. package/dist/descriptors/logSource.d.ts +6 -4
  52. package/dist/descriptors/logSource.d.ts.map +1 -1
  53. package/dist/descriptors/logSource.js +7 -4
  54. package/dist/descriptors/logSource.js.map +1 -1
  55. package/dist/enrollment/enrollment.d.ts +1 -1
  56. package/dist/enrollment/enrollment.d.ts.map +1 -1
  57. package/dist/enrollment/enrollment.js +2 -1
  58. package/dist/enrollment/enrollment.js.map +1 -1
  59. package/dist/genesis/accountGenesis.d.ts +1 -1
  60. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  61. package/dist/genesis/accountGenesis.js +1 -1
  62. package/dist/index.d.ts +8 -3
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +7 -3
  65. package/dist/index.js.map +1 -1
  66. package/dist/keyring/kdf.d.ts +6 -20
  67. package/dist/keyring/kdf.d.ts.map +1 -1
  68. package/dist/keyring/kdf.js +8 -5
  69. package/dist/keyring/kdf.js.map +1 -1
  70. package/dist/keyring/unlockSpace.js +1 -1
  71. package/dist/keys/clientKeyRecord.d.ts +68 -1
  72. package/dist/keys/clientKeyRecord.d.ts.map +1 -1
  73. package/dist/keys/clientKeyRecord.js +155 -20
  74. package/dist/keys/clientKeyRecord.js.map +1 -1
  75. package/dist/keys/index.d.ts +2 -2
  76. package/dist/keys/index.d.ts.map +1 -1
  77. package/dist/keys/index.js +1 -1
  78. package/dist/keys/index.js.map +1 -1
  79. package/dist/keys/rosterLogStore.d.ts +16 -14
  80. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  81. package/dist/keys/rosterLogStore.js +164 -32
  82. package/dist/keys/rosterLogStore.js.map +1 -1
  83. package/dist/keys/rosterStore.d.ts +8 -7
  84. package/dist/keys/rosterStore.d.ts.map +1 -1
  85. package/dist/keys/rosterStore.js +6 -6
  86. package/dist/keys/rosterStore.js.map +1 -1
  87. package/dist/keys/spaceEpochs.d.ts +1 -1
  88. package/dist/keys/spaceEpochs.js +1 -1
  89. package/dist/keys/userKeyRoster.d.ts +3 -3
  90. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  91. package/dist/keys/userKeyRoster.js +3 -3
  92. package/dist/keys/userKeyRoster.js.map +1 -1
  93. package/dist/log.d.ts +49 -0
  94. package/dist/log.d.ts.map +1 -0
  95. package/dist/log.js +53 -0
  96. package/dist/log.js.map +1 -0
  97. package/dist/recovery/index.d.ts +2 -2
  98. package/dist/recovery/index.js +2 -2
  99. package/dist/recovery/recoveryDelegation.d.ts +6 -2
  100. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  101. package/dist/recovery/recoveryDelegation.js +32 -6
  102. package/dist/recovery/recoveryDelegation.js.map +1 -1
  103. package/dist/recovery/recoveryWebvh.d.ts +67 -8
  104. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  105. package/dist/recovery/recoveryWebvh.js +114 -19
  106. package/dist/recovery/recoveryWebvh.js.map +1 -1
  107. package/dist/request/appKey.d.ts +9 -3
  108. package/dist/request/appKey.d.ts.map +1 -1
  109. package/dist/request/appKey.js +13 -8
  110. package/dist/request/appKey.js.map +1 -1
  111. package/dist/request/capabilityRequest.d.ts +9 -1
  112. package/dist/request/capabilityRequest.d.ts.map +1 -1
  113. package/dist/request/capabilityRequest.js +13 -2
  114. package/dist/request/capabilityRequest.js.map +1 -1
  115. package/dist/request/classify.d.ts +37 -1
  116. package/dist/request/classify.d.ts.map +1 -1
  117. package/dist/request/classify.js +74 -3
  118. package/dist/request/classify.js.map +1 -1
  119. package/dist/request/ephemeralExchange.d.ts +5 -18
  120. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  121. package/dist/request/ephemeralExchange.js +9 -3
  122. package/dist/request/ephemeralExchange.js.map +1 -1
  123. package/dist/request/exchangeClient.d.ts +0 -23
  124. package/dist/request/exchangeClient.d.ts.map +1 -1
  125. package/dist/request/exchangeClient.js +30 -1
  126. package/dist/request/exchangeClient.js.map +1 -1
  127. package/dist/request/index.d.ts +4 -1
  128. package/dist/request/index.d.ts.map +1 -1
  129. package/dist/request/index.js +4 -1
  130. package/dist/request/index.js.map +1 -1
  131. package/dist/request/interactionRequest.d.ts +23 -0
  132. package/dist/request/interactionRequest.d.ts.map +1 -0
  133. package/dist/request/interactionRequest.js +46 -0
  134. package/dist/request/interactionRequest.js.map +1 -0
  135. package/dist/request/interactionUrl.d.ts +3 -14
  136. package/dist/request/interactionUrl.d.ts.map +1 -1
  137. package/dist/request/interactionUrl.js +24 -3
  138. package/dist/request/interactionUrl.js.map +1 -1
  139. package/dist/request/parse.d.ts +0 -10
  140. package/dist/request/parse.d.ts.map +1 -1
  141. package/dist/request/parse.js +15 -1
  142. package/dist/request/parse.js.map +1 -1
  143. package/dist/request/processRequest.d.ts.map +1 -1
  144. package/dist/request/processRequest.js +2 -1
  145. package/dist/request/processRequest.js.map +1 -1
  146. package/dist/request/types.d.ts +23 -2
  147. package/dist/request/types.d.ts.map +1 -1
  148. package/dist/resourceLog/controller.d.ts +48 -49
  149. package/dist/resourceLog/controller.d.ts.map +1 -1
  150. package/dist/resourceLog/controller.js +41 -20
  151. package/dist/resourceLog/controller.js.map +1 -1
  152. package/dist/resourceLog/errors.d.ts +12 -78
  153. package/dist/resourceLog/errors.d.ts.map +1 -1
  154. package/dist/resourceLog/errors.js +12 -79
  155. package/dist/resourceLog/errors.js.map +1 -1
  156. package/dist/resourceLog/index.d.ts +17 -22
  157. package/dist/resourceLog/index.d.ts.map +1 -1
  158. package/dist/resourceLog/index.js +16 -21
  159. package/dist/resourceLog/index.js.map +1 -1
  160. package/dist/resourceLog/license.d.ts +42 -27
  161. package/dist/resourceLog/license.d.ts.map +1 -1
  162. package/dist/resourceLog/license.js +53 -30
  163. package/dist/resourceLog/license.js.map +1 -1
  164. package/dist/space/activity.d.ts +48 -1
  165. package/dist/space/activity.d.ts.map +1 -1
  166. package/dist/space/activity.js +52 -4
  167. package/dist/space/activity.js.map +1 -1
  168. package/dist/space/index.d.ts +1 -1
  169. package/dist/space/index.d.ts.map +1 -1
  170. package/dist/space/index.js +1 -1
  171. package/dist/space/index.js.map +1 -1
  172. package/dist/sync/pull.d.ts +0 -22
  173. package/dist/sync/pull.d.ts.map +1 -1
  174. package/dist/sync/pull.js +30 -2
  175. package/dist/sync/pull.js.map +1 -1
  176. package/dist/unlock/index.d.ts +7 -7
  177. package/dist/unlock/index.d.ts.map +1 -1
  178. package/dist/unlock/index.js +6 -6
  179. package/dist/unlock/index.js.map +1 -1
  180. package/dist/unlock/retire.d.ts +29 -28
  181. package/dist/unlock/retire.d.ts.map +1 -1
  182. package/dist/unlock/retire.js +25 -16
  183. package/dist/unlock/retire.js.map +1 -1
  184. package/dist/unlock/standingClient.d.ts +1 -1
  185. package/dist/unlock/standingClient.js +3 -3
  186. package/dist/unlock/standingWebvh.d.ts +28 -10
  187. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  188. package/dist/unlock/standingWebvh.js +75 -37
  189. package/dist/unlock/standingWebvh.js.map +1 -1
  190. package/dist/unlock/unlockRecord.d.ts +37 -0
  191. package/dist/unlock/unlockRecord.d.ts.map +1 -1
  192. package/dist/unlock/unlockRecord.js +54 -1
  193. package/dist/unlock/unlockRecord.js.map +1 -1
  194. package/dist/webvh/delegatedLogStore.d.ts +2 -2
  195. package/dist/webvh/delegatedLogStore.js +2 -2
  196. package/dist/webvh/didWeb.js +1 -1
  197. package/dist/webvh/didWeb.js.map +1 -1
  198. package/dist/webvh/didWebvh.d.ts +33 -3
  199. package/dist/webvh/didWebvh.d.ts.map +1 -1
  200. package/dist/webvh/didWebvh.js +40 -11
  201. package/dist/webvh/didWebvh.js.map +1 -1
  202. package/dist/webvh/index.d.ts +1 -1
  203. package/dist/webvh/index.d.ts.map +1 -1
  204. package/dist/webvh/index.js +1 -1
  205. package/dist/webvh/index.js.map +1 -1
  206. package/dist/webvh/listClients.js +1 -1
  207. package/dist/webvh/listClients.js.map +1 -1
  208. package/dist/webvh/verifyLog.d.ts +1 -1
  209. package/dist/webvh/verifyLog.d.ts.map +1 -1
  210. package/dist/webvh/verifyLog.js +1 -2
  211. package/dist/webvh/verifyLog.js.map +1 -1
  212. package/package.json +9 -11
  213. package/dist/display/alignment.d.ts +0 -55
  214. package/dist/display/alignment.d.ts.map +0 -1
  215. package/dist/display/alignment.js +0 -117
  216. package/dist/display/alignment.js.map +0 -1
  217. package/dist/display/credentialName.d.ts +0 -42
  218. package/dist/display/credentialName.d.ts.map +0 -1
  219. package/dist/display/credentialName.js +0 -106
  220. package/dist/display/credentialName.js.map +0 -1
  221. package/dist/display/displayFields.d.ts +0 -59
  222. package/dist/display/displayFields.d.ts.map +0 -1
  223. package/dist/display/displayFields.js +0 -136
  224. package/dist/display/displayFields.js.map +0 -1
  225. package/dist/display/evidence.d.ts +0 -50
  226. package/dist/display/evidence.d.ts.map +0 -1
  227. package/dist/display/evidence.js +0 -67
  228. package/dist/display/evidence.js.map +0 -1
  229. package/dist/display/image.d.ts +0 -18
  230. package/dist/display/image.d.ts.map +0 -1
  231. package/dist/display/image.js +0 -23
  232. package/dist/display/image.js.map +0 -1
  233. package/dist/display/index.d.ts +0 -38
  234. package/dist/display/index.d.ts.map +0 -1
  235. package/dist/display/index.js +0 -32
  236. package/dist/display/index.js.map +0 -1
  237. package/dist/display/issuer.d.ts +0 -105
  238. package/dist/display/issuer.d.ts.map +0 -1
  239. package/dist/display/issuer.js +0 -126
  240. package/dist/display/issuer.js.map +0 -1
  241. package/dist/display/obv3.d.ts +0 -82
  242. package/dist/display/obv3.d.ts.map +0 -1
  243. package/dist/display/obv3.js +0 -117
  244. package/dist/display/obv3.js.map +0 -1
  245. package/dist/display/parse.d.ts +0 -66
  246. package/dist/display/parse.d.ts.map +0 -1
  247. package/dist/display/parse.js +0 -104
  248. package/dist/display/parse.js.map +0 -1
  249. package/dist/display/subject.d.ts +0 -79
  250. package/dist/display/subject.d.ts.map +0 -1
  251. package/dist/display/subject.js +0 -124
  252. package/dist/display/subject.js.map +0 -1
  253. package/dist/display/text.d.ts +0 -53
  254. package/dist/display/text.d.ts.map +0 -1
  255. package/dist/display/text.js +0 -78
  256. package/dist/display/text.js.map +0 -1
  257. package/dist/display/types.d.ts +0 -55
  258. package/dist/display/types.d.ts.map +0 -1
  259. package/dist/display/types.js +0 -41
  260. package/dist/display/types.js.map +0 -1
  261. package/dist/display/validity.d.ts +0 -51
  262. package/dist/display/validity.d.ts.map +0 -1
  263. package/dist/display/validity.js +0 -51
  264. package/dist/display/validity.js.map +0 -1
  265. package/dist/display/verificationView.d.ts +0 -115
  266. package/dist/display/verificationView.d.ts.map +0 -1
  267. package/dist/display/verificationView.js +0 -199
  268. package/dist/display/verificationView.js.map +0 -1
  269. package/dist/resourceLog/append.d.ts +0 -112
  270. package/dist/resourceLog/append.d.ts.map +0 -1
  271. package/dist/resourceLog/append.js +0 -197
  272. package/dist/resourceLog/append.js.map +0 -1
  273. package/dist/resourceLog/entry.d.ts +0 -68
  274. package/dist/resourceLog/entry.d.ts.map +0 -1
  275. package/dist/resourceLog/entry.js +0 -167
  276. package/dist/resourceLog/entry.js.map +0 -1
  277. package/dist/resourceLog/pin.d.ts +0 -82
  278. package/dist/resourceLog/pin.d.ts.map +0 -1
  279. package/dist/resourceLog/pin.js +0 -57
  280. package/dist/resourceLog/pin.js.map +0 -1
  281. package/dist/resourceLog/seal.d.ts +0 -97
  282. package/dist/resourceLog/seal.d.ts.map +0 -1
  283. package/dist/resourceLog/seal.js +0 -113
  284. package/dist/resourceLog/seal.js.map +0 -1
  285. package/dist/resourceLog/verify.d.ts +0 -96
  286. package/dist/resourceLog/verify.d.ts.map +0 -1
  287. package/dist/resourceLog/verify.js +0 -474
  288. package/dist/resourceLog/verify.js.map +0 -1
  289. package/dist/resourceLog/vmFragment.d.ts +0 -33
  290. package/dist/resourceLog/vmFragment.d.ts.map +0 -1
  291. package/dist/resourceLog/vmFragment.js +0 -39
  292. package/dist/resourceLog/vmFragment.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import type { DIDDoc, DIDLog } from '@interop/did-method-webvh';
2
2
  import type { ClientWebvhUpdateKeys, WebvhEnrollmentKeys, WebvhIdStore } from '../webvh/didWebvh.js';
3
- import type { ResourceLogPinStore } from '../resourceLog/index.js';
3
+ import type { ResourceLogPinStore } from '@interop/vh-resource-log';
4
4
  import { type RevokedClientKeys } from '../webvh/revokeClient.js';
5
5
  import { type UnlockKeyAgreementPublication, type UnlockLogStore } from '../unlock/standingWebvh.js';
6
6
  /**
@@ -12,7 +12,7 @@ import { type UnlockKeyAgreementPublication, type UnlockLogStore } from '../unlo
12
12
  * what the first durable self-enrollment's reveal-and-commit entry,
13
13
  * re-stating `updateKeys` containing rung 0, requires --
14
14
  * and the ladder VM (the stable sibling) is published under `assertionMethod`
15
- * and `capabilityDelegation` only. The credential's `keyAgreement` posture
15
+ * and `capabilityDelegation` only. The credential's `keyAgreement`
16
16
  * entry is FOLDED INTO GENESIS -- no enrolled client exists to run the
17
17
  * separate bind entry ({@link publishUnlockKey}) -- so the genesis
18
18
  * `keyAgreement` array holds only the credential's entry.
@@ -106,22 +106,139 @@ export declare function ensureLadderAnchoredDidWebvh(options: {
106
106
  * @param options.newClientUpdateSeeds {ClientWebvhUpdateKeys} the new
107
107
  * client's update-key seeds (minted by the self-enrolling flow, which
108
108
  * therefore holds them and can sign the add entry)
109
+ * @param options.onCommitted {function}
110
+ * `(committed: { builtOnHead: { scid, versionId } }) => Promise<void>` --
111
+ * the REQUIRED persist-before-publish seam. It runs once per attempt, after
112
+ * the reveal-and-commit entry stands (published here, or standing from a
113
+ * torn earlier run) and BEFORE the add entry -- the ceremony's pivot -- is
114
+ * built. The caller durably writes the pending client-key record there (the
115
+ * `pending` codec group of `keys/clientKeyRecord.ts`: ceremony
116
+ * `'self-enrollment'`, the handed-back `builtOnHead`), so the add entry can
117
+ * never publish a client whose seed nothing can re-derive, per the
118
+ * post-pivot derivability rule (`decisions/0010`). A throw propagates and
119
+ * the add entry is withheld. What a throw leaves behind is inert: the
120
+ * standing reveal entry's committed hashes for the unpersisted client stay
121
+ * in `nextKeyHashes` forever as orphans, but they commit keys of a lost
122
+ * random seed -- nothing can reveal them, so they are no re-seizure
123
+ * credential, and the per-entry staged-hash attribution passes over them.
124
+ * The seam must be idempotent: the conflict retry and a resumed run invoke
125
+ * it again. `builtOnHead` is the head of the log snapshot the add entry is
126
+ * about to be built on -- the SCID from the log's parameters and the latest
127
+ * entry's `versionId` -- which a resume hands back as this call's
128
+ * `builtOnHead` marker. The caveat to hold on to: the idempotent COMPLETED
129
+ * branch (the new client's update key already authorized) returns without
130
+ * ever entering the seam, so a caller resuming across processes must be
131
+ * able to treat an already-complete continuation as success on its own
132
+ * @param [options.builtOnHead] {object} `{ scid, versionId }` -- the resume
133
+ * marker a pending record recorded, from an earlier run's `onCommitted`.
134
+ * Supplied, the attempt's first read is refused with
135
+ * {@link BuiltOnHeadNotReachedError} unless the served log carries that
136
+ * SCID and an entry with that `versionId`. The chain-head pin cannot stand
137
+ * in for it: the pin is written non-atomically after the add entry
138
+ * publishes, and the continuity check accepts a log served at exactly the
139
+ * pinned length -- so only this marker stops a resume rebuilding the add
140
+ * entry over a log that never reached the head the pending record was
141
+ * written against. The marker covers the pre-pivot half of that gap only:
142
+ * a served log CONTAINING the recorded head but truncated behind the torn
143
+ * run's own add entry still passes it and is resumed onto, and the menders
144
+ * for that residual half are the ordinary ones -- this client's own
145
+ * chain-head pin once the add publish wrote it, and any other enrolled
146
+ * client's pinned read of the same log. Both members must be non-empty
147
+ * strings; a malformed marker is refused with a `TypeError` before any
148
+ * read, since a resume with an uncomparable marker is a resume with no
149
+ * fork guard
109
150
  * @param [options.expectedDid] {string} the account DID the log must resolve
110
151
  * to, from the credential-authenticated pointer
111
- * @returns {Promise<{ did: string, webDoc?: object }>} the account DID and,
112
- * when the add entry ran here, the final `did.json` projection for the
113
- * enrolled session to republish
152
+ * @param [options.pinStore] {ResourceLogPinStore} this client's chain-head
153
+ * pins; every read both entries are built on is checked against the pinned
154
+ * head (a served prefix is refused before the reveal entry lands, not only
155
+ * by a verify that follows both entries), and the pin advances to each
156
+ * entry as it publishes
157
+ * @param [options.logId] {string} the account log's pin slot
158
+ * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
159
+ * supplied
160
+ * @returns {Promise<{ did: string, webDoc?: object, committed: boolean }>}
161
+ * the account DID, the final `did.json` projection when the add entry ran
162
+ * here, and `committed` -- whether THIS call published the pivot entry
163
+ * (`false` exactly on the idempotent completed branch, where a torn earlier
164
+ * run had already published it). It is an observability signal, not a
165
+ * success flag: a returning call means the continuation stands either way,
166
+ * so a caller clears its pending record on the RETURN, whatever `committed`
167
+ * says. Its absence from a return value is a build skew, which is why it is
168
+ * stated rather than inferred
114
169
  */
115
170
  export declare function selfEnrollWebvhClient(options: {
116
171
  store: UnlockLogStore;
117
172
  ladderSeed: Uint8Array;
118
173
  newClientKeys: WebvhEnrollmentKeys;
119
174
  newClientUpdateSeeds: ClientWebvhUpdateKeys;
175
+ onCommitted: (committed: {
176
+ builtOnHead: {
177
+ scid: string;
178
+ versionId: string;
179
+ };
180
+ }) => Promise<void>;
181
+ builtOnHead?: {
182
+ scid: string;
183
+ versionId: string;
184
+ };
120
185
  expectedDid?: string;
186
+ pinStore?: ResourceLogPinStore;
187
+ logId?: string;
121
188
  }): Promise<{
122
189
  did: string;
123
190
  webDoc?: object;
191
+ committed: boolean;
124
192
  }>;
193
+ /**
194
+ * Refuses a malformed resume marker before any read. A marker whose members
195
+ * are missing or empty could not be compared against anything, so accepting
196
+ * one would hand a resume the mint-skip WITHOUT the fork guard the marker
197
+ * exists to apply -- fail-open exactly where the guard matters.
198
+ *
199
+ * @param options {object}
200
+ * @param options.builtOnHead {unknown} the supplied marker
201
+ * @returns {void}
202
+ */
203
+ export declare function assertBuiltOnHeadShape({ builtOnHead }: {
204
+ builtOnHead: unknown;
205
+ }): void;
206
+ /**
207
+ * Thrown when a resumed self-enrollment is served an account log that has not
208
+ * reached the head its pending record was written against -- a different SCID,
209
+ * or no entry carrying the recorded `versionId`. Rebuilding the add entry over
210
+ * such a log would fork the account off a head the ceremony already committed
211
+ * to, which the chain-head pin alone does not catch: the pin is written
212
+ * non-atomically after the add entry publishes, so a run torn between the two
213
+ * leaves a pin one entry behind, and the continuity check accepts a served log
214
+ * at exactly the pinned length.
215
+ *
216
+ * **`name` is a stable contract.** It is always the string
217
+ * `'BuiltOnHeadNotReachedError'`, and a consumer should match on that rather
218
+ * than on `instanceof`: a wallet app that links this package (or holds two
219
+ * copies of it through a dependency tree) gets a different class object for
220
+ * the same error, so `instanceof` silently fails there while the name does
221
+ * not.
222
+ */
223
+ export declare class BuiltOnHeadNotReachedError extends Error {
224
+ /**
225
+ * The head the pending record recorded, which the served log did not reach.
226
+ */
227
+ builtOnHead: {
228
+ scid: string;
229
+ versionId: string;
230
+ };
231
+ /**
232
+ * @param options {object}
233
+ * @param options.builtOnHead {object} the recorded `{ scid, versionId }`
234
+ */
235
+ constructor({ builtOnHead }: {
236
+ builtOnHead: {
237
+ scid: string;
238
+ versionId: string;
239
+ };
240
+ });
241
+ }
125
242
  /**
126
243
  * Thrown when the client being forgotten is the account's LAST enrolled
127
244
  * durable client. Removing it through this entry would leave the document
@@ -147,7 +264,7 @@ export declare class LastDurableClientForgetError extends Error {
147
264
  * reverse, collapsed to a single entry because a removal reveals no new key.
148
265
  * The signer is the credential's current ladder rung, recovered from the log
149
266
  * itself ({@link attributeLadderRung}): its hash stands committed by the
150
- * credential's posture (or the rung is already revealed), which is exactly
267
+ * credential's inventory (or the rung is already revealed), which is exactly
151
268
  * what lets it reveal itself in the entry it signs under prerotation. The
152
269
  * entry's members are the revocation removal's, verbatim
153
270
  * (`clientRemovalTarget` / `clientRemovalFields`, shared with
@@ -161,10 +278,10 @@ export declare class LastDurableClientForgetError extends Error {
161
278
  * the rung is revealed and the client still stands. The honest residue is the
162
279
  * acting rung itself -- no entry can remove its own signing key, so the rung
163
280
  * stands REVEALED in `updateKeys` afterwards (the same standing state the
164
- * ladder-anchored postures live in). That is credential-held authority, not
281
+ * ladder-anchored accounts live in). That is credential-held authority, not
165
282
  * the forgotten client's: only the ladder seed derives it, the credential's
166
283
  * next self-enrollment consumes and retires it, and retiring the credential
167
- * itself strikes it (`attributeLadderPosture`).
284
+ * itself strikes it (`attributeLadderInventory`).
168
285
  *
169
286
  * Forgetting the LAST enrolled durable client is refused
170
287
  * ({@link LastDurableClientForgetError}): that transition -- to the
@@ -187,6 +304,13 @@ export declare class LastDurableClientForgetError extends Error {
187
304
  * excluded from the staged-hash attribution
188
305
  * @param [options.expectedDid] {string} the account DID the log must resolve
189
306
  * to, from the caller's stored account pointer
307
+ * @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
308
+ * pins: the read inside each attempt is checked against the pinned head
309
+ * (a served truncated prefix is refused as a `rollback` before anything is
310
+ * built on it), and the pin advances to the head this entry publishes
311
+ * @param [options.logId] {string} the account log's pin slot
312
+ * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
313
+ * supplied
190
314
  * @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog }>} the account
191
315
  * DID and the document and log as the removal entry leaves them (unchanged
192
316
  * on the idempotent no-op path)
@@ -197,6 +321,8 @@ export declare function forgetWebvhClient(options: {
197
321
  forgottenClient: RevokedClientKeys;
198
322
  knownLatentHashes?: string[];
199
323
  expectedDid?: string;
324
+ pinStore?: ResourceLogPinStore;
325
+ logId?: string;
200
326
  }): Promise<{
201
327
  did: string;
202
328
  doc: DIDDoc;
@@ -223,6 +349,8 @@ export declare function forgetLastWebvhClient(options: {
223
349
  forgottenClient: RevokedClientKeys;
224
350
  knownLatentHashes?: string[];
225
351
  expectedDid?: string;
352
+ pinStore?: ResourceLogPinStore;
353
+ logId?: string;
226
354
  }): Promise<{
227
355
  did: string;
228
356
  doc: DIDDoc;
@@ -232,14 +360,14 @@ export declare function forgetLastWebvhClient(options: {
232
360
  * THE LADDER-VM INSTALL ENTRY (the two-entry transition ceremony's first
233
361
  * entry): publishes the credential's ladder VM -- the stable sibling, under
234
362
  * `assertionMethod` and `capabilityDelegation` only -- while the last durable
235
- * client's whole footprint stays untouched: the both-present transitional
363
+ * client's whole inventory stays untouched: the both-present transitional
236
364
  * state the no-neither invariant permits. The entry is ladder-signed by the
237
365
  * attributed rung, which reveals itself into `updateKeys` with its own hash
238
366
  * kept committed (the carry-over convention), exactly the removal entry's
239
367
  * rung math -- so a torn ceremony's re-run re-attributes the now-revealed
240
368
  * rung and carries on.
241
369
  *
242
- * This entry is what makes the transition's document version POSTURE-CHANGING
370
+ * This entry is what makes the transition's document version INVENTORY-CHANGING
243
371
  * under the ceremony-tail license (the ladder-VM set gains a member), so the
244
372
  * ceremony's ONE ladder-signed roster append anchors here -- and it is what
245
373
  * lets the delegation revocations that follow verify their ladder-signed
@@ -258,6 +386,12 @@ export declare function forgetLastWebvhClient(options: {
258
386
  * @param options.ladderSeed {Uint8Array} the credential's ladder seed
259
387
  * @param [options.expectedDid] {string} the account DID the log must resolve
260
388
  * to, from the caller's stored account pointer
389
+ * @param [options.pinStore] {ResourceLogPinStore} the caller's chain-head
390
+ * pins: the read inside each attempt is checked against the pinned head,
391
+ * and the pin advances to the head this entry publishes
392
+ * @param [options.logId] {string} the account log's pin slot
393
+ * (`accountLogPinId({ spaceId })`); required whenever a `pinStore` is
394
+ * supplied
261
395
  * @returns {Promise<{ did: string, doc: DIDDoc, log: DIDLog, installed: boolean }>}
262
396
  * the account DID and the document and log as the install entry leaves them
263
397
  * (unchanged on the idempotent no-op path); `installed` says whether the
@@ -267,6 +401,8 @@ export declare function installLadderVmWebvh(options: {
267
401
  store: UnlockLogStore;
268
402
  ladderSeed: Uint8Array;
269
403
  expectedDid?: string;
404
+ pinStore?: ResourceLogPinStore;
405
+ logId?: string;
270
406
  }): Promise<{
271
407
  did: string;
272
408
  doc: DIDDoc;
@@ -1 +1 @@
1
- {"version":3,"file":"ladderAnchored.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/ladderAnchored.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EAEP,MAAM,2BAA2B,CAAA;AAiBlC,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAElE,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAGL,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACpB,MAAM,4BAA4B,CAAA;AAOnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,8BAA8B,CAAC,EACnD,YAAY,EACZ,OAAO,EACP,UAAU,EACV,YAAY,EACb,EAAE;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,UAAU,CAAA;IACtB,YAAY,EAAE,6BAA6B,CAAA;CAC5C,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;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