@interop/wallet-core 0.62.0 → 0.65.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 (312) 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 +55 -34
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +102 -56
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +16 -2
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +11 -9
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +62 -18
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +92 -26
  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 +7 -7
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +38 -5
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +346 -236
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/index.d.ts +21 -5
  27. package/dist/clientAnnex/index.d.ts.map +1 -1
  28. package/dist/clientAnnex/index.js +24 -5
  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 +222 -33
  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 +162 -43
  39. package/dist/clientAnnex/log.d.ts.map +1 -1
  40. package/dist/clientAnnex/log.js +423 -192
  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 +26 -12
  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 +10 -6
  124. package/dist/keys/index.d.ts.map +1 -1
  125. package/dist/keys/index.js +9 -5
  126. package/dist/keys/index.js.map +1 -1
  127. package/dist/keys/rosterLogStore.d.ts +12 -11
  128. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  129. package/dist/keys/rosterLogStore.js +15 -13
  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/userKeyRoster.d.ts +57 -7
  139. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  140. package/dist/keys/userKeyRoster.js +222 -17
  141. package/dist/keys/userKeyRoster.js.map +1 -1
  142. package/dist/keys/userKeyRosterCascade.d.ts +7 -6
  143. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  144. package/dist/keys/userKeyRosterCascade.js +7 -6
  145. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  146. package/dist/keys/wasLabelsStore.d.ts +9 -2
  147. package/dist/keys/wasLabelsStore.d.ts.map +1 -1
  148. package/dist/keys/wasLabelsStore.js +14 -6
  149. package/dist/keys/wasLabelsStore.js.map +1 -1
  150. package/dist/log.d.ts +7 -2
  151. package/dist/log.d.ts.map +1 -1
  152. package/dist/log.js +6 -1
  153. package/dist/log.js.map +1 -1
  154. package/dist/recovery/index.d.ts +12 -8
  155. package/dist/recovery/index.d.ts.map +1 -1
  156. package/dist/recovery/index.js +11 -7
  157. package/dist/recovery/index.js.map +1 -1
  158. package/dist/recovery/recoveryCode.d.ts +27 -7
  159. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  160. package/dist/recovery/recoveryCode.js +18 -6
  161. package/dist/recovery/recoveryCode.js.map +1 -1
  162. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  163. package/dist/recovery/recoveryDelegation.js +21 -34
  164. package/dist/recovery/recoveryDelegation.js.map +1 -1
  165. package/dist/recovery/recoveryWebvh.d.ts +75 -63
  166. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  167. package/dist/recovery/recoveryWebvh.js +127 -116
  168. package/dist/recovery/recoveryWebvh.js.map +1 -1
  169. package/dist/request/classify.d.ts +32 -8
  170. package/dist/request/classify.d.ts.map +1 -1
  171. package/dist/request/classify.js +39 -14
  172. package/dist/request/classify.js.map +1 -1
  173. package/dist/request/ephemeralExchange.d.ts +1 -6
  174. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  175. package/dist/request/ephemeralExchange.js.map +1 -1
  176. package/dist/request/onboarding.d.ts.map +1 -1
  177. package/dist/request/onboarding.js +2 -2
  178. package/dist/request/onboarding.js.map +1 -1
  179. package/dist/request/parse.d.ts.map +1 -1
  180. package/dist/request/parse.js +2 -3
  181. package/dist/request/parse.js.map +1 -1
  182. package/dist/resourceLog/controller.d.ts +34 -12
  183. package/dist/resourceLog/controller.d.ts.map +1 -1
  184. package/dist/resourceLog/controller.js +79 -86
  185. package/dist/resourceLog/controller.js.map +1 -1
  186. package/dist/resourceLog/document.d.ts +182 -0
  187. package/dist/resourceLog/document.d.ts.map +1 -0
  188. package/dist/resourceLog/document.js +159 -0
  189. package/dist/resourceLog/document.js.map +1 -0
  190. package/dist/resourceLog/errors.d.ts +47 -8
  191. package/dist/resourceLog/errors.d.ts.map +1 -1
  192. package/dist/resourceLog/errors.js +54 -8
  193. package/dist/resourceLog/errors.js.map +1 -1
  194. package/dist/resourceLog/index.d.ts +7 -3
  195. package/dist/resourceLog/index.d.ts.map +1 -1
  196. package/dist/resourceLog/index.js +7 -3
  197. package/dist/resourceLog/index.js.map +1 -1
  198. package/dist/resourceLog/ladderRungs.d.ts +35 -0
  199. package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
  200. package/dist/resourceLog/ladderRungs.js +352 -0
  201. package/dist/resourceLog/ladderRungs.js.map +1 -0
  202. package/dist/resourceLog/license.d.ts +42 -17
  203. package/dist/resourceLog/license.d.ts.map +1 -1
  204. package/dist/resourceLog/license.js +38 -24
  205. package/dist/resourceLog/license.js.map +1 -1
  206. package/dist/space/activity.d.ts +15 -15
  207. package/dist/space/activity.d.ts.map +1 -1
  208. package/dist/space/activity.js +15 -15
  209. package/dist/space/activity.js.map +1 -1
  210. package/dist/space/collections.d.ts +11 -0
  211. package/dist/space/collections.d.ts.map +1 -1
  212. package/dist/space/collections.js +13 -0
  213. package/dist/space/collections.js.map +1 -1
  214. package/dist/space/deleteSpace.d.ts +28 -0
  215. package/dist/space/deleteSpace.d.ts.map +1 -0
  216. package/dist/space/deleteSpace.js +44 -0
  217. package/dist/space/deleteSpace.js.map +1 -0
  218. package/dist/space/errors.d.ts.map +1 -1
  219. package/dist/space/errors.js +0 -1
  220. package/dist/space/errors.js.map +1 -1
  221. package/dist/space/index.d.ts +6 -0
  222. package/dist/space/index.d.ts.map +1 -1
  223. package/dist/space/index.js +6 -0
  224. package/dist/space/index.js.map +1 -1
  225. package/dist/space/plaintextCollection.d.ts +43 -0
  226. package/dist/space/plaintextCollection.d.ts.map +1 -0
  227. package/dist/space/plaintextCollection.js +17 -0
  228. package/dist/space/plaintextCollection.js.map +1 -0
  229. package/dist/stages.d.ts +23 -0
  230. package/dist/stages.d.ts.map +1 -0
  231. package/dist/stages.js +23 -0
  232. package/dist/stages.js.map +1 -0
  233. package/dist/sync/index.d.ts +7 -0
  234. package/dist/sync/index.d.ts.map +1 -1
  235. package/dist/sync/index.js +7 -0
  236. package/dist/sync/index.js.map +1 -1
  237. package/dist/sync/push.js +4 -4
  238. package/dist/sync/push.js.map +1 -1
  239. package/dist/sync/remint.js +2 -2
  240. package/dist/sync/remint.js.map +1 -1
  241. package/dist/sync/types.d.ts +41 -1
  242. package/dist/sync/types.d.ts.map +1 -1
  243. package/dist/sync/types.js +47 -1
  244. package/dist/sync/types.js.map +1 -1
  245. package/dist/unlock/index.d.ts +5 -1
  246. package/dist/unlock/index.d.ts.map +1 -1
  247. package/dist/unlock/index.js +5 -1
  248. package/dist/unlock/index.js.map +1 -1
  249. package/dist/unlock/retire.d.ts +35 -7
  250. package/dist/unlock/retire.d.ts.map +1 -1
  251. package/dist/unlock/retire.js +52 -14
  252. package/dist/unlock/retire.js.map +1 -1
  253. package/dist/unlock/standingClient.d.ts.map +1 -1
  254. package/dist/unlock/standingClient.js +5 -1
  255. package/dist/unlock/standingClient.js.map +1 -1
  256. package/dist/unlock/standingWebvh.d.ts +217 -35
  257. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  258. package/dist/unlock/standingWebvh.js +469 -210
  259. package/dist/unlock/standingWebvh.js.map +1 -1
  260. package/dist/webvh/accountEntry.d.ts +146 -0
  261. package/dist/webvh/accountEntry.d.ts.map +1 -0
  262. package/dist/webvh/accountEntry.js +239 -0
  263. package/dist/webvh/accountEntry.js.map +1 -0
  264. package/dist/webvh/didWeb.d.ts +12 -7
  265. package/dist/webvh/didWeb.d.ts.map +1 -1
  266. package/dist/webvh/didWeb.js +2 -2
  267. package/dist/webvh/didWeb.js.map +1 -1
  268. package/dist/webvh/didWebProjection.d.ts +164 -0
  269. package/dist/webvh/didWebProjection.d.ts.map +1 -0
  270. package/dist/webvh/didWebProjection.js +230 -0
  271. package/dist/webvh/didWebProjection.js.map +1 -0
  272. package/dist/webvh/didWebvh.d.ts +275 -136
  273. package/dist/webvh/didWebvh.d.ts.map +1 -1
  274. package/dist/webvh/didWebvh.js +307 -340
  275. package/dist/webvh/didWebvh.js.map +1 -1
  276. package/dist/webvh/enrollClient.d.ts +65 -0
  277. package/dist/webvh/enrollClient.d.ts.map +1 -0
  278. package/dist/webvh/enrollClient.js +172 -0
  279. package/dist/webvh/enrollClient.js.map +1 -0
  280. package/dist/webvh/index.d.ts +37 -12
  281. package/dist/webvh/index.d.ts.map +1 -1
  282. package/dist/webvh/index.js +33 -10
  283. package/dist/webvh/index.js.map +1 -1
  284. package/dist/webvh/listClients.d.ts +1 -35
  285. package/dist/webvh/listClients.d.ts.map +1 -1
  286. package/dist/webvh/listClients.js +2 -30
  287. package/dist/webvh/listClients.js.map +1 -1
  288. package/dist/webvh/revokeClient.d.ts +41 -11
  289. package/dist/webvh/revokeClient.d.ts.map +1 -1
  290. package/dist/webvh/revokeClient.js +99 -48
  291. package/dist/webvh/revokeClient.js.map +1 -1
  292. package/dist/webvh/standingZcap.d.ts +61 -14
  293. package/dist/webvh/standingZcap.d.ts.map +1 -1
  294. package/dist/webvh/standingZcap.js +91 -0
  295. package/dist/webvh/standingZcap.js.map +1 -1
  296. package/dist/webvh/verifyLog.d.ts +59 -5
  297. package/dist/webvh/verifyLog.d.ts.map +1 -1
  298. package/dist/webvh/verifyLog.js +76 -11
  299. package/dist/webvh/verifyLog.js.map +1 -1
  300. package/dist/webvh/wasIdStore.d.ts +8 -8
  301. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  302. package/dist/webvh/wasIdStore.js +39 -14
  303. package/dist/webvh/wasIdStore.js.map +1 -1
  304. package/dist/webvh/zcap.d.ts +14 -1
  305. package/dist/webvh/zcap.d.ts.map +1 -1
  306. package/dist/webvh/zcap.js +3 -27
  307. package/dist/webvh/zcap.js.map +1 -1
  308. package/package.json +2 -2
  309. package/dist/webvh/keyAgreement.d.ts +0 -97
  310. package/dist/webvh/keyAgreement.d.ts.map +0 -1
  311. package/dist/webvh/keyAgreement.js +0 -71
  312. package/dist/webvh/keyAgreement.js.map +0 -1
@@ -0,0 +1,182 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The account-document reading conventions every reader shares, in one place:
6
+ * how a verification relation resolves (string references into
7
+ * `verificationMethod`, embedded methods verbatim), which
8
+ * `capabilityDelegation` members are ladder VMs, and which `keyAgreement`
9
+ * methods are the account's credential inventory.
10
+ *
11
+ * Each of those rules is a wire-level convention of the account document, so
12
+ * a second implementation of one is a place the readers can disagree: the
13
+ * ceremony-tail license's inventory comparison and the client listing's
14
+ * ladder-VM recognition must answer identically over the same document, and
15
+ * so must the roster's recipient resolver and the client listing's marker
16
+ * filter. They are consumers of the readers here rather than re-readings of
17
+ * the document.
18
+ *
19
+ * Deliberately dependency-light -- it imports nothing at all -- so both the
20
+ * layer-0 controller adapter beside it and the `webvh` and `keys` layers
21
+ * above can share the readers without pulling the ceremony or signing graph.
22
+ * Its public home is `@interop/wallet-core/webvh`, which re-exports the
23
+ * `keyAgreement` readers and the ladder recognition; this subpath exports
24
+ * none of them, so each name has one owner.
25
+ */
26
+ /**
27
+ * The materialized shape the relation readers return: a verification method
28
+ * carrying either the key itself (`publicKeyMultibase`) or, for a
29
+ * low-entropy-derived standing unlock credential, its hash commitment
30
+ * (`publicKeyCommitment`). The `type` rides along so a consumer can tell the
31
+ * two published flavors apart (`Multikey` vs `MultikeyCommitment`) instead of
32
+ * inferring the flavor from which property happens to be present.
33
+ */
34
+ export interface ResolvedKeyAgreementMethod {
35
+ id?: string;
36
+ type?: string;
37
+ controller?: string;
38
+ publicKeyMultibase?: string;
39
+ publicKeyCommitment?: string;
40
+ }
41
+ /**
42
+ * A locally verified did:webvh document, read for the verification relations
43
+ * it publishes and the methods they resolve to. Structural on purpose: a
44
+ * resolved `DIDDoc` satisfies it, and so does any narrower document shape a
45
+ * wallet already holds.
46
+ */
47
+ export interface AccountDocument {
48
+ verificationMethod?: ResolvedKeyAgreementMethod[];
49
+ assertionMethod?: Array<string | ResolvedKeyAgreementMethod>;
50
+ keyAgreement?: Array<string | ResolvedKeyAgreementMethod>;
51
+ capabilityInvocation?: Array<string | ResolvedKeyAgreementMethod>;
52
+ capabilityDelegation?: Array<string | ResolvedKeyAgreementMethod>;
53
+ }
54
+ /**
55
+ * The document shape the `keyAgreement` readers take, kept as the published
56
+ * name the `webvh` and `keys` subpaths surface. It is {@link AccountDocument}
57
+ * itself: every member is optional, so a caller holding only the
58
+ * `keyAgreement` half satisfies it unchanged.
59
+ */
60
+ export type KeyAgreementDocument = AccountDocument;
61
+ /**
62
+ * The verification relations a document reader may resolve.
63
+ */
64
+ export type DocumentRelation = Exclude<keyof AccountDocument, 'verificationMethod'>;
65
+ /**
66
+ * The relationship references of a resolved document as verification-method
67
+ * ids, tolerating embedded objects beside string references.
68
+ *
69
+ * @param relation {Array} the relationship array, when present
70
+ * @returns {string[]}
71
+ */
72
+ export declare function relationIds(relation: Array<string | {
73
+ id?: string;
74
+ }> | undefined): string[];
75
+ /**
76
+ * The verification methods one relation publishes, materialized: string
77
+ * references resolved against `verificationMethod` (a reference nothing backs
78
+ * is dropped), embedded methods taken verbatim. Document order is preserved,
79
+ * and nothing is filtered -- deciding which of these methods belongs to whom
80
+ * is each caller's own rule.
81
+ *
82
+ * @param options {object}
83
+ * @param options.doc {AccountDocument} a locally verified document
84
+ * @param options.relation {DocumentRelation} the relation to resolve
85
+ * @returns {ResolvedKeyAgreementMethod[]}
86
+ */
87
+ export declare function resolvedRelationMethods({ doc, relation }: {
88
+ doc: AccountDocument;
89
+ relation: DocumentRelation;
90
+ }): ResolvedKeyAgreementMethod[];
91
+ /**
92
+ * The `keyAgreement` verification methods a document publishes, materialized:
93
+ * string references resolved against `verificationMethod` (a reference nothing
94
+ * backs is dropped), embedded methods taken verbatim. Document order is
95
+ * preserved, and nothing is filtered -- deciding which of these methods belongs
96
+ * to whom is each caller's own rule.
97
+ *
98
+ * @param options {object}
99
+ * @param options.doc {KeyAgreementDocument} a locally verified document
100
+ * @returns {ResolvedKeyAgreementMethod[]}
101
+ */
102
+ export declare function resolvedKeyAgreementMethods({ doc }: {
103
+ doc: KeyAgreementDocument;
104
+ }): ResolvedKeyAgreementMethod[];
105
+ /**
106
+ * The CREDENTIAL-CLASS `keyAgreement` methods a document publishes: those the
107
+ * account DID itself controls. The rule is structural, and it is the exact
108
+ * complement of the client marker: an enrolled client's key-agreement method
109
+ * carries `controller: did:key:<its signing multibase>`
110
+ * (`clientKeyAgreementController`), while a standing unlock credential's
111
+ * carries the account DID. Both published flavors match -- a passphrase's
112
+ * `MultikeyCommitment` and the verbatim `Multikey` a passkey or a recovery
113
+ * code publishes -- because the class is decided by the controller alone.
114
+ *
115
+ * Nothing here tells one credential from another. A recovery code's entry is
116
+ * indistinguishable from a passkey's by construction (both are unmarked and
117
+ * verbatim), so a caller retiring this class retires every credential the
118
+ * account stands on, which is what the transient and remembered recovery
119
+ * continuations want.
120
+ *
121
+ * @param options {object}
122
+ * @param options.doc {KeyAgreementDocument} a locally verified document
123
+ * @param options.did {string} the account DID the document resolves to
124
+ * @returns {ResolvedKeyAgreementMethod[]} in document order
125
+ */
126
+ export declare function credentialKeyAgreementMethods({ doc, did }: {
127
+ doc: KeyAgreementDocument;
128
+ did: string;
129
+ }): ResolvedKeyAgreementMethod[];
130
+ /**
131
+ * The ladder-VM recognition convention: a `capabilityDelegation` member
132
+ * absent from `capabilityInvocation` is a ladder VM -- the stable sibling key
133
+ * a standing credential publishes for as long as it stands
134
+ * (`ladderVerificationMethod` is the one write-side builder). The
135
+ * asymmetry is the convention rather than a marker property because it is
136
+ * what actually carries the authority: zcap's `delegator.id` cannot identify
137
+ * the signer, so a verifier classifies the VM from the resolved document it
138
+ * already holds -- a zero-I/O read -- and the same asymmetry is what keeps
139
+ * the VM structurally out of every client listing (those key on
140
+ * `capabilityInvocation`). An enrolled client publishes its signing key under
141
+ * both relations, so it can never match.
142
+ *
143
+ * Returns every matching verification-method id, in document order. A ladder
144
+ * VM's life is keyed to its credential rather than to the account's client
145
+ * census: the standing establishment installs it, the credential's retirement
146
+ * strikes it, and enrollment leaves it alone. So the count is one per
147
+ * standing credential, co-resident with however many clients the account has
148
+ * enrolled, and a stale third-party VM can stand beside them.
149
+ *
150
+ * @param options {object}
151
+ * @param options.doc {object} a locally verified document
152
+ * @returns {string[]} the ladder VMs' verification-method ids
153
+ */
154
+ export declare function ladderVmIds({ doc }: {
155
+ doc: {
156
+ capabilityInvocation?: Array<string | {
157
+ id?: string;
158
+ }>;
159
+ capabilityDelegation?: Array<string | {
160
+ id?: string;
161
+ }>;
162
+ };
163
+ }): string[];
164
+ /**
165
+ * The ladder VMs' verification methods, materialized: the
166
+ * `capabilityDelegation` methods {@link ladderVmIds} names, resolved the way
167
+ * every other relation read resolves. Recognition therefore has exactly one
168
+ * definition -- a reader needing the ladder keys themselves (their
169
+ * `publicKeyMultibase`) asks here rather than re-deriving the asymmetry.
170
+ *
171
+ * A method the recognition cannot name -- an embedded `capabilityDelegation`
172
+ * entry carrying no `id`, or a reference nothing backs -- is not a ladder VM
173
+ * here, the same refuse-not-guess answer the id-keyed recognition gives.
174
+ *
175
+ * @param options {object}
176
+ * @param options.doc {AccountDocument} a locally verified document
177
+ * @returns {ResolvedKeyAgreementMethod[]} in document order
178
+ */
179
+ export declare function ladderVmMethods({ doc }: {
180
+ doc: AccountDocument;
181
+ }): ResolvedKeyAgreementMethod[];
182
+ //# sourceMappingURL=document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/resourceLog/document.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACzC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,kBAAkB,CAAC,EAAE,0BAA0B,EAAE,CAAA;IACjD,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,0BAA0B,CAAC,CAAA;IAC5D,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,0BAA0B,CAAC,CAAA;IACzD,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,0BAA0B,CAAC,CAAA;IACjE,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,0BAA0B,CAAC,CAAA;CAClE;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAA;AAElD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,MAAM,eAAe,EACrB,oBAAoB,CACrB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,GACpD,MAAM,EAAE,CASV;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,GAAG,EACH,QAAQ,EACT,EAAE;IACD,GAAG,EAAE,eAAe,CAAA;IACpB,QAAQ,EAAE,gBAAgB,CAAA;CAC3B,GAAG,0BAA0B,EAAE,CAe/B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,oBAAoB,CAAA;CAC1B,GAAG,0BAA0B,EAAE,CAE/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,GAAG,EACH,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,oBAAoB,CAAA;IACzB,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,0BAA0B,EAAE,CAI/B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACJ,EAAE;IACD,GAAG,EAAE;QACH,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG;YAAE,EAAE,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;QACtD,oBAAoB,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG;YAAE,EAAE,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KACvD,CAAA;CACF,GAAG,MAAM,EAAE,CAGX;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,EAC9B,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,eAAe,CAAA;CACrB,GAAG,0BAA0B,EAAE,CAM/B"}
@@ -0,0 +1,159 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * The account-document reading conventions every reader shares, in one place:
6
+ * how a verification relation resolves (string references into
7
+ * `verificationMethod`, embedded methods verbatim), which
8
+ * `capabilityDelegation` members are ladder VMs, and which `keyAgreement`
9
+ * methods are the account's credential inventory.
10
+ *
11
+ * Each of those rules is a wire-level convention of the account document, so
12
+ * a second implementation of one is a place the readers can disagree: the
13
+ * ceremony-tail license's inventory comparison and the client listing's
14
+ * ladder-VM recognition must answer identically over the same document, and
15
+ * so must the roster's recipient resolver and the client listing's marker
16
+ * filter. They are consumers of the readers here rather than re-readings of
17
+ * the document.
18
+ *
19
+ * Deliberately dependency-light -- it imports nothing at all -- so both the
20
+ * layer-0 controller adapter beside it and the `webvh` and `keys` layers
21
+ * above can share the readers without pulling the ceremony or signing graph.
22
+ * Its public home is `@interop/wallet-core/webvh`, which re-exports the
23
+ * `keyAgreement` readers and the ladder recognition; this subpath exports
24
+ * none of them, so each name has one owner.
25
+ */
26
+ /**
27
+ * The relationship references of a resolved document as verification-method
28
+ * ids, tolerating embedded objects beside string references.
29
+ *
30
+ * @param relation {Array} the relationship array, when present
31
+ * @returns {string[]}
32
+ */
33
+ export function relationIds(relation) {
34
+ const ids = [];
35
+ for (const entry of relation ?? []) {
36
+ const id = typeof entry === 'string' ? entry : entry?.id;
37
+ if (id) {
38
+ ids.push(id);
39
+ }
40
+ }
41
+ return ids;
42
+ }
43
+ /**
44
+ * The verification methods one relation publishes, materialized: string
45
+ * references resolved against `verificationMethod` (a reference nothing backs
46
+ * is dropped), embedded methods taken verbatim. Document order is preserved,
47
+ * and nothing is filtered -- deciding which of these methods belongs to whom
48
+ * is each caller's own rule.
49
+ *
50
+ * @param options {object}
51
+ * @param options.doc {AccountDocument} a locally verified document
52
+ * @param options.relation {DocumentRelation} the relation to resolve
53
+ * @returns {ResolvedKeyAgreementMethod[]}
54
+ */
55
+ export function resolvedRelationMethods({ doc, relation }) {
56
+ const byId = new Map();
57
+ for (const method of doc.verificationMethod ?? []) {
58
+ if (typeof method?.id === 'string') {
59
+ byId.set(method.id, method);
60
+ }
61
+ }
62
+ const methods = [];
63
+ for (const entry of doc[relation] ?? []) {
64
+ const method = typeof entry === 'string' ? byId.get(entry) : entry;
65
+ if (method) {
66
+ methods.push(method);
67
+ }
68
+ }
69
+ return methods;
70
+ }
71
+ /**
72
+ * The `keyAgreement` verification methods a document publishes, materialized:
73
+ * string references resolved against `verificationMethod` (a reference nothing
74
+ * backs is dropped), embedded methods taken verbatim. Document order is
75
+ * preserved, and nothing is filtered -- deciding which of these methods belongs
76
+ * to whom is each caller's own rule.
77
+ *
78
+ * @param options {object}
79
+ * @param options.doc {KeyAgreementDocument} a locally verified document
80
+ * @returns {ResolvedKeyAgreementMethod[]}
81
+ */
82
+ export function resolvedKeyAgreementMethods({ doc }) {
83
+ return resolvedRelationMethods({ doc, relation: 'keyAgreement' });
84
+ }
85
+ /**
86
+ * The CREDENTIAL-CLASS `keyAgreement` methods a document publishes: those the
87
+ * account DID itself controls. The rule is structural, and it is the exact
88
+ * complement of the client marker: an enrolled client's key-agreement method
89
+ * carries `controller: did:key:<its signing multibase>`
90
+ * (`clientKeyAgreementController`), while a standing unlock credential's
91
+ * carries the account DID. Both published flavors match -- a passphrase's
92
+ * `MultikeyCommitment` and the verbatim `Multikey` a passkey or a recovery
93
+ * code publishes -- because the class is decided by the controller alone.
94
+ *
95
+ * Nothing here tells one credential from another. A recovery code's entry is
96
+ * indistinguishable from a passkey's by construction (both are unmarked and
97
+ * verbatim), so a caller retiring this class retires every credential the
98
+ * account stands on, which is what the transient and remembered recovery
99
+ * continuations want.
100
+ *
101
+ * @param options {object}
102
+ * @param options.doc {KeyAgreementDocument} a locally verified document
103
+ * @param options.did {string} the account DID the document resolves to
104
+ * @returns {ResolvedKeyAgreementMethod[]} in document order
105
+ */
106
+ export function credentialKeyAgreementMethods({ doc, did }) {
107
+ return resolvedKeyAgreementMethods({ doc }).filter(method => method.controller === did);
108
+ }
109
+ /**
110
+ * The ladder-VM recognition convention: a `capabilityDelegation` member
111
+ * absent from `capabilityInvocation` is a ladder VM -- the stable sibling key
112
+ * a standing credential publishes for as long as it stands
113
+ * (`ladderVerificationMethod` is the one write-side builder). The
114
+ * asymmetry is the convention rather than a marker property because it is
115
+ * what actually carries the authority: zcap's `delegator.id` cannot identify
116
+ * the signer, so a verifier classifies the VM from the resolved document it
117
+ * already holds -- a zero-I/O read -- and the same asymmetry is what keeps
118
+ * the VM structurally out of every client listing (those key on
119
+ * `capabilityInvocation`). An enrolled client publishes its signing key under
120
+ * both relations, so it can never match.
121
+ *
122
+ * Returns every matching verification-method id, in document order. A ladder
123
+ * VM's life is keyed to its credential rather than to the account's client
124
+ * census: the standing establishment installs it, the credential's retirement
125
+ * strikes it, and enrollment leaves it alone. So the count is one per
126
+ * standing credential, co-resident with however many clients the account has
127
+ * enrolled, and a stale third-party VM can stand beside them.
128
+ *
129
+ * @param options {object}
130
+ * @param options.doc {object} a locally verified document
131
+ * @returns {string[]} the ladder VMs' verification-method ids
132
+ */
133
+ export function ladderVmIds({ doc }) {
134
+ const invocable = new Set(relationIds(doc.capabilityInvocation));
135
+ return relationIds(doc.capabilityDelegation).filter(id => !invocable.has(id));
136
+ }
137
+ /**
138
+ * The ladder VMs' verification methods, materialized: the
139
+ * `capabilityDelegation` methods {@link ladderVmIds} names, resolved the way
140
+ * every other relation read resolves. Recognition therefore has exactly one
141
+ * definition -- a reader needing the ladder keys themselves (their
142
+ * `publicKeyMultibase`) asks here rather than re-deriving the asymmetry.
143
+ *
144
+ * A method the recognition cannot name -- an embedded `capabilityDelegation`
145
+ * entry carrying no `id`, or a reference nothing backs -- is not a ladder VM
146
+ * here, the same refuse-not-guess answer the id-keyed recognition gives.
147
+ *
148
+ * @param options {object}
149
+ * @param options.doc {AccountDocument} a locally verified document
150
+ * @returns {ResolvedKeyAgreementMethod[]} in document order
151
+ */
152
+ export function ladderVmMethods({ doc }) {
153
+ const ids = new Set(ladderVmIds({ doc }));
154
+ return resolvedRelationMethods({
155
+ doc,
156
+ relation: 'capabilityDelegation'
157
+ }).filter(method => typeof method.id === 'string' && ids.has(method.id));
158
+ }
159
+ //# sourceMappingURL=document.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/resourceLog/document.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAgDH;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,QAAqD;IAErD,MAAM,GAAG,GAAa,EAAE,CAAA;IACxB,KAAK,MAAM,KAAK,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAA;QACxD,IAAI,EAAE,EAAE,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,EACtC,GAAG,EACH,QAAQ,EAIT;IACC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAsC,CAAA;IAC1D,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,kBAAkB,IAAI,EAAE,EAAE,CAAC;QAClD,IAAI,OAAO,MAAM,EAAE,EAAE,KAAK,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAiC,EAAE,CAAA;IAChD,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;QAClE,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,GAAG,EAGJ;IACC,OAAO,uBAAuB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAA;AACnE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,6BAA6B,CAAC,EAC5C,GAAG,EACH,GAAG,EAIJ;IACC,OAAO,2BAA2B,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAChD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,KAAK,GAAG,CACpC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,GAAG,EAMJ;IACC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAA;IAChE,OAAO,WAAW,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/E,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,GAAG,EAGJ;IACC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;IACzC,OAAO,uBAAuB,CAAC;QAC7B,GAAG;QACH,QAAQ,EAAE,sBAAsB;KACjC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;AAC1E,CAAC"}
@@ -3,14 +3,18 @@
3
3
  */
4
4
  /**
5
5
  * The one refusal class the resource-log layer still owns after the generic
6
- * client side moved to `@interop/vh-resource-log`: the ceremony-tail license
7
- * refusal. The generic taxonomy (`ResourceLogIntegrityError`,
8
- * `ResourceLogContinuityError`, `ResourceLogClosedError`,
9
- * `LogNotConfirmedError`, and the store port's `ResourceLogConflictError`)
10
- * is the library's; wallet-core re-exports none of it -- one owner per name.
11
- * Like every class in that taxonomy, this one assigns its `name` string
12
- * explicitly and is matched by `err.name` across package boundaries (the
13
- * WC-64 rule; minified class names do not survive bundling).
6
+ * client side moved to `@interop/vh-resource-log` -- the ceremony-tail
7
+ * license refusal -- and the shared read-side classification of that
8
+ * library's taxonomy ({@link isResourceLogRefusal}: which refusals a caller
9
+ * must not paper over with a cached copy). The generic taxonomy
10
+ * (`ResourceLogIntegrityError`, `ResourceLogContinuityError`,
11
+ * `ResourceLogClosedError`, `LogNotConfirmedError`, and the store port's
12
+ * `ResourceLogConflictError`) is the library's; wallet-core re-exports none
13
+ * of it -- one owner per name. Like every class in that taxonomy, this one
14
+ * assigns its `name` string explicitly and is matched by `err.name` across
15
+ * package boundaries (the WC-64 rule; minified class names do not survive
16
+ * bundling), which is also why the predicate compares names rather than
17
+ * constructors and why this file stays import-free.
14
18
  */
15
19
  /**
16
20
  * A ladder-signed append outside the ceremony-tail license: it is not the
@@ -27,4 +31,39 @@ export declare class ResourceLogLicenseError extends Error {
27
31
  cause?: unknown;
28
32
  });
29
33
  }
34
+ /**
35
+ * Whether a resource-log refusal is one a caller must NOT paper over with a
36
+ * cached copy: a fabricated log (`ResourceLogIntegrityError`), or a log that
37
+ * is not the continuation of the pinned history
38
+ * (`ResourceLogContinuityError`) -- EXCEPT continuity reason `rollback`.
39
+ *
40
+ * This is the one implementation of the rollback carve-out ARCHITECTURE.md
41
+ * states once as policy. A rollback is reconcilable divergence, possibly
42
+ * nothing worse than replication lag: the pin is never regressed and nothing
43
+ * rolled back is adopted, so serving the cached copy while a lagging replica
44
+ * catches up is exactly the offline case, and refusing there would lock a
45
+ * healthy account out of its own start. A `fork` or an SCID/method switch is
46
+ * a refusal like fabrication.
47
+ *
48
+ * `ResourceLogLicenseError` is deliberately absent, so a license refusal on a
49
+ * READ lands in the soft transport class (warn, serve cached). Ratified
50
+ * behavior, not omission: the log is not corrupt and the signer genuinely
51
+ * holds the credential, so the append is unlicensed rather than forged. The
52
+ * two shapes that argues against -- a compromised still-listed key holder,
53
+ * and a genuine unlicensed entry N masking a forged entry N+1 under whole-log
54
+ * first-failure semantics -- were weighed and accepted (WC-149). The
55
+ * pre-write half of the license is where the class does its work: a
56
+ * conformant writer is refused before an unlicensed entry can land.
57
+ *
58
+ * Matched on `err.name` rather than `instanceof`: these errors are raised
59
+ * inside app-injected seams that can resolve to a different copy of this
60
+ * package (linked, or duplicated through a dependency tree), and an
61
+ * `instanceof` miss would drop a security refusal into a caller's
62
+ * warn-and-proceed branch. Callers add only the names the generic taxonomy
63
+ * does not carry.
64
+ *
65
+ * @param err {unknown}
66
+ * @returns {boolean}
67
+ */
68
+ export declare function isResourceLogRefusal(err: unknown): boolean;
30
69
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;GASG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAS1D"}
@@ -3,14 +3,18 @@
3
3
  */
4
4
  /**
5
5
  * The one refusal class the resource-log layer still owns after the generic
6
- * client side moved to `@interop/vh-resource-log`: the ceremony-tail license
7
- * refusal. The generic taxonomy (`ResourceLogIntegrityError`,
8
- * `ResourceLogContinuityError`, `ResourceLogClosedError`,
9
- * `LogNotConfirmedError`, and the store port's `ResourceLogConflictError`)
10
- * is the library's; wallet-core re-exports none of it -- one owner per name.
11
- * Like every class in that taxonomy, this one assigns its `name` string
12
- * explicitly and is matched by `err.name` across package boundaries (the
13
- * WC-64 rule; minified class names do not survive bundling).
6
+ * client side moved to `@interop/vh-resource-log` -- the ceremony-tail
7
+ * license refusal -- and the shared read-side classification of that
8
+ * library's taxonomy ({@link isResourceLogRefusal}: which refusals a caller
9
+ * must not paper over with a cached copy). The generic taxonomy
10
+ * (`ResourceLogIntegrityError`, `ResourceLogContinuityError`,
11
+ * `ResourceLogClosedError`, `LogNotConfirmedError`, and the store port's
12
+ * `ResourceLogConflictError`) is the library's; wallet-core re-exports none
13
+ * of it -- one owner per name. Like every class in that taxonomy, this one
14
+ * assigns its `name` string explicitly and is matched by `err.name` across
15
+ * package boundaries (the WC-64 rule; minified class names do not survive
16
+ * bundling), which is also why the predicate compares names rather than
17
+ * constructors and why this file stays import-free.
14
18
  */
15
19
  /**
16
20
  * A ladder-signed append outside the ceremony-tail license: it is not the
@@ -28,4 +32,46 @@ export class ResourceLogLicenseError extends Error {
28
32
  this.name = 'ResourceLogLicenseError';
29
33
  }
30
34
  }
35
+ /**
36
+ * Whether a resource-log refusal is one a caller must NOT paper over with a
37
+ * cached copy: a fabricated log (`ResourceLogIntegrityError`), or a log that
38
+ * is not the continuation of the pinned history
39
+ * (`ResourceLogContinuityError`) -- EXCEPT continuity reason `rollback`.
40
+ *
41
+ * This is the one implementation of the rollback carve-out ARCHITECTURE.md
42
+ * states once as policy. A rollback is reconcilable divergence, possibly
43
+ * nothing worse than replication lag: the pin is never regressed and nothing
44
+ * rolled back is adopted, so serving the cached copy while a lagging replica
45
+ * catches up is exactly the offline case, and refusing there would lock a
46
+ * healthy account out of its own start. A `fork` or an SCID/method switch is
47
+ * a refusal like fabrication.
48
+ *
49
+ * `ResourceLogLicenseError` is deliberately absent, so a license refusal on a
50
+ * READ lands in the soft transport class (warn, serve cached). Ratified
51
+ * behavior, not omission: the log is not corrupt and the signer genuinely
52
+ * holds the credential, so the append is unlicensed rather than forged. The
53
+ * two shapes that argues against -- a compromised still-listed key holder,
54
+ * and a genuine unlicensed entry N masking a forged entry N+1 under whole-log
55
+ * first-failure semantics -- were weighed and accepted (WC-149). The
56
+ * pre-write half of the license is where the class does its work: a
57
+ * conformant writer is refused before an unlicensed entry can land.
58
+ *
59
+ * Matched on `err.name` rather than `instanceof`: these errors are raised
60
+ * inside app-injected seams that can resolve to a different copy of this
61
+ * package (linked, or duplicated through a dependency tree), and an
62
+ * `instanceof` miss would drop a security refusal into a caller's
63
+ * warn-and-proceed branch. Callers add only the names the generic taxonomy
64
+ * does not carry.
65
+ *
66
+ * @param err {unknown}
67
+ * @returns {boolean}
68
+ */
69
+ export function isResourceLogRefusal(err) {
70
+ const candidate = err;
71
+ if (candidate?.name === 'ResourceLogIntegrityError') {
72
+ return true;
73
+ }
74
+ return (candidate?.name === 'ResourceLogContinuityError' &&
75
+ candidate.reason !== 'rollback');
76
+ }
31
77
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/resourceLog/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;GASG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,MAAM,SAAS,GAAG,GAAkD,CAAA;IACpE,IAAI,SAAS,EAAE,IAAI,KAAK,2BAA2B,EAAE,CAAC;QACpD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,CACL,SAAS,EAAE,IAAI,KAAK,4BAA4B;QAChD,SAAS,CAAC,MAAM,KAAK,UAAU,CAChC,CAAA;AACH,CAAC"}
@@ -7,8 +7,11 @@
7
7
  * `@interop/vh-resource-log` -- the did:webvh controller adapter (the
8
8
  * library's controller port extended with the per-version
9
9
  * credential-inventory view, supplying the mandatory `admitAppend` admission
10
- * hook), and the ceremony-tail license the hook carries
11
- * (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`).
10
+ * hook), the ceremony-tail license the hook carries
11
+ * (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`),
12
+ * and the import-free account-document leaf both are built on (`document.ts`
13
+ * -- relation resolution, ladder-VM recognition, the credential class),
14
+ * whose public home is `webvh`, which re-exports it.
12
15
  * Everything generic -- the JSON Lines codec, the store port and
13
16
  * `confirmAppend`, chain verification, the chain-head pin
14
17
  * (`ResourceLogPinStore` and `resourceLogPinId`; the named slot-key builders
@@ -19,6 +22,7 @@
19
22
  * export: this subpath pulls the did:webvh and ed25519 dependency graph.
20
23
  */
21
24
  export { webvhResourceLogController, type ControllerInventory, type WebvhResourceLogController } from './controller.js';
22
- export { ResourceLogLicenseError } from './errors.js';
25
+ export { isResourceLogRefusal, ResourceLogLicenseError } from './errors.js';
26
+ export { attributeLadderRungsPerVersion, type LadderRungKeys } from './ladderRungs.js';
23
27
  export { assertLadderAppendLicensed } from './license.js';
24
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAChC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAChC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAC9B,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
@@ -7,8 +7,11 @@
7
7
  * `@interop/vh-resource-log` -- the did:webvh controller adapter (the
8
8
  * library's controller port extended with the per-version
9
9
  * credential-inventory view, supplying the mandatory `admitAppend` admission
10
- * hook), and the ceremony-tail license the hook carries
11
- * (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`).
10
+ * hook), the ceremony-tail license the hook carries
11
+ * (`assertLadderAppendLicensed`, refusing with `ResourceLogLicenseError`),
12
+ * and the import-free account-document leaf both are built on (`document.ts`
13
+ * -- relation resolution, ladder-VM recognition, the credential class),
14
+ * whose public home is `webvh`, which re-exports it.
12
15
  * Everything generic -- the JSON Lines codec, the store port and
13
16
  * `confirmAppend`, chain verification, the chain-head pin
14
17
  * (`ResourceLogPinStore` and `resourceLogPinId`; the named slot-key builders
@@ -19,6 +22,7 @@
19
22
  * export: this subpath pulls the did:webvh and ed25519 dependency graph.
20
23
  */
21
24
  export { webvhResourceLogController } from './controller.js';
22
- export { ResourceLogLicenseError } from './errors.js';
25
+ export { isResourceLogRefusal, ResourceLogLicenseError } from './errors.js';
26
+ export { attributeLadderRungsPerVersion } from './ladderRungs.js';
23
27
  export { assertLadderAppendLicensed } from './license.js';
24
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,0BAA0B,EAG3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resourceLog/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,0BAA0B,EAG3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAE/B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { DIDLog, DIDLogEntry } from '@interop/did-method-webvh';
2
+ /**
3
+ * The rung keys attributed to each standing ladder VM, keyed by the ladder
4
+ * VM's own `publicKeyMultibase`. A ladder the walk could not attribute
5
+ * carries no entry at all, which is what makes an unattributed ladder refuse.
6
+ */
7
+ export type LadderRungKeys = Map<string, Set<string>>;
8
+ /**
9
+ * The update-key multibases that signed one log entry: the fragment of each
10
+ * proof's `did:key:<multibase>#<multibase>` verification method.
11
+ *
12
+ * @param entry {DIDLogEntry | undefined}
13
+ * @returns {Set<string>}
14
+ */
15
+ export declare function entrySignerKeysOf(entry: DIDLogEntry | undefined): Set<string>;
16
+ /**
17
+ * Attributes each standing ladder VM's rung keys, one snapshot per log entry:
18
+ * the returned array is indexed by entry position, and each snapshot names
19
+ * what the log attributes as of that version and no later one. A ladder is
20
+ * anchored at the entry introducing its VM and climbs from there by the
21
+ * last-position rule (the module header states both).
22
+ *
23
+ * A snapshot names a ladder's rungs that the version still authorizes in
24
+ * `updateKeys`, plus any rung that signed the version's own entry -- the one
25
+ * question the ceremony-tail license asks of this map, so a rung retired by
26
+ * the very entry it signed still answers it. A ladder left with no such rung
27
+ * is absent from that snapshot rather than present and empty, as is a ladder
28
+ * the walk refuses, so a caller cannot mistake "no rung attributed" for "this
29
+ * key signed nothing".
30
+ *
31
+ * @param log {DIDLog} a resolved, caller-verified account log
32
+ * @returns {Promise<LadderRungKeys[]>} one snapshot per entry, in log order
33
+ */
34
+ export declare function attributeLadderRungsPerVersion(log: DIDLog): Promise<LadderRungKeys[]>;
35
+ //# sourceMappingURL=ladderRungs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ladderRungs.d.ts","sourceRoot":"","sources":["../../src/resourceLog/ladderRungs.ts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAQpE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAErD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAU7E;AAgGD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,cAAc,EAAE,CAAC,CA+L3B"}