@interop/wallet-core 0.62.0 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/README.md +41 -16
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +46 -26
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +91 -39
  5. package/dist/clientAnnex/credentialAnchoredGenesis.js.map +1 -1
  6. package/dist/clientAnnex/establish.d.ts +119 -35
  7. package/dist/clientAnnex/establish.d.ts.map +1 -1
  8. package/dist/clientAnnex/establish.js +227 -160
  9. package/dist/clientAnnex/establish.js.map +1 -1
  10. package/dist/clientAnnex/forget.d.ts +18 -8
  11. package/dist/clientAnnex/forget.d.ts.map +1 -1
  12. package/dist/clientAnnex/forget.js +37 -64
  13. package/dist/clientAnnex/forget.js.map +1 -1
  14. package/dist/clientAnnex/forgetLast.d.ts +85 -38
  15. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  16. package/dist/clientAnnex/forgetLast.js +155 -98
  17. package/dist/clientAnnex/forgetLast.js.map +1 -1
  18. package/dist/clientAnnex/gc.d.ts +3 -2
  19. package/dist/clientAnnex/gc.d.ts.map +1 -1
  20. package/dist/clientAnnex/gc.js +16 -7
  21. package/dist/clientAnnex/gc.js.map +1 -1
  22. package/dist/clientAnnex/heal.d.ts +65 -14
  23. package/dist/clientAnnex/heal.d.ts.map +1 -1
  24. package/dist/clientAnnex/heal.js +397 -298
  25. package/dist/clientAnnex/heal.js.map +1 -1
  26. package/dist/clientAnnex/index.d.ts +23 -7
  27. package/dist/clientAnnex/index.d.ts.map +1 -1
  28. package/dist/clientAnnex/index.js +26 -7
  29. package/dist/clientAnnex/index.js.map +1 -1
  30. package/dist/clientAnnex/ladder.d.ts +58 -0
  31. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  32. package/dist/clientAnnex/ladder.js +249 -41
  33. package/dist/clientAnnex/ladder.js.map +1 -1
  34. package/dist/clientAnnex/ladderAnchored.d.ts +148 -22
  35. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  36. package/dist/clientAnnex/ladderAnchored.js +391 -346
  37. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  38. package/dist/clientAnnex/log.d.ts +237 -53
  39. package/dist/clientAnnex/log.d.ts.map +1 -1
  40. package/dist/clientAnnex/log.js +533 -198
  41. package/dist/clientAnnex/log.js.map +1 -1
  42. package/dist/clientAnnex/mend.d.ts +12 -6
  43. package/dist/clientAnnex/mend.d.ts.map +1 -1
  44. package/dist/clientAnnex/mend.js +44 -72
  45. package/dist/clientAnnex/mend.js.map +1 -1
  46. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +6 -4
  47. package/dist/clientAnnex/recoveryLadderAnchored.d.ts.map +1 -1
  48. package/dist/clientAnnex/recoveryLadderAnchored.js +56 -35
  49. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  50. package/dist/clientAnnex/spaceCapability.d.ts +123 -0
  51. package/dist/clientAnnex/spaceCapability.d.ts.map +1 -0
  52. package/dist/clientAnnex/spaceCapability.js +152 -0
  53. package/dist/clientAnnex/spaceCapability.js.map +1 -0
  54. package/dist/clientAnnex/stages.d.ts +63 -0
  55. package/dist/clientAnnex/stages.d.ts.map +1 -0
  56. package/dist/clientAnnex/stages.js +64 -0
  57. package/dist/clientAnnex/stages.js.map +1 -0
  58. package/dist/clientAnnex/zcap.d.ts +1 -1
  59. package/dist/clientAnnex/zcap.d.ts.map +1 -1
  60. package/dist/clientAnnex/zcap.js +42 -35
  61. package/dist/clientAnnex/zcap.js.map +1 -1
  62. package/dist/clients/policy.d.ts +15 -1
  63. package/dist/clients/policy.d.ts.map +1 -1
  64. package/dist/clients/policy.js +12 -6
  65. package/dist/clients/policy.js.map +1 -1
  66. package/dist/clients/revocation.d.ts +18 -10
  67. package/dist/clients/revocation.d.ts.map +1 -1
  68. package/dist/clients/revocation.js +13 -5
  69. package/dist/clients/revocation.js.map +1 -1
  70. package/dist/clients/rosterPolicy.d.ts +10 -2
  71. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  72. package/dist/clients/rosterPolicy.js +41 -24
  73. package/dist/clients/rosterPolicy.js.map +1 -1
  74. package/dist/descriptors/acquire.d.ts.map +1 -1
  75. package/dist/descriptors/acquire.js +6 -23
  76. package/dist/descriptors/acquire.js.map +1 -1
  77. package/dist/descriptors/cipher.d.ts.map +1 -1
  78. package/dist/descriptors/cipher.js +5 -0
  79. package/dist/descriptors/cipher.js.map +1 -1
  80. package/dist/descriptors/errors.d.ts +43 -0
  81. package/dist/descriptors/errors.d.ts.map +1 -0
  82. package/dist/descriptors/errors.js +45 -0
  83. package/dist/descriptors/errors.js.map +1 -0
  84. package/dist/descriptors/index.d.ts +5 -0
  85. package/dist/descriptors/index.d.ts.map +1 -1
  86. package/dist/descriptors/index.js +5 -0
  87. package/dist/descriptors/index.js.map +1 -1
  88. package/dist/enrollment/enrollment.d.ts +37 -10
  89. package/dist/enrollment/enrollment.d.ts.map +1 -1
  90. package/dist/enrollment/enrollment.js +52 -15
  91. package/dist/enrollment/enrollment.js.map +1 -1
  92. package/dist/genesis/accountGenesis.d.ts +42 -11
  93. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  94. package/dist/genesis/accountGenesis.js +80 -22
  95. package/dist/genesis/accountGenesis.js.map +1 -1
  96. package/dist/genesis/index.d.ts +3 -1
  97. package/dist/genesis/index.d.ts.map +1 -1
  98. package/dist/genesis/index.js +3 -1
  99. package/dist/genesis/index.js.map +1 -1
  100. package/dist/identity/agents.d.ts +17 -1
  101. package/dist/identity/agents.d.ts.map +1 -1
  102. package/dist/identity/agents.js +23 -7
  103. package/dist/identity/agents.js.map +1 -1
  104. package/dist/identity/index.d.ts +3 -1
  105. package/dist/identity/index.d.ts.map +1 -1
  106. package/dist/identity/index.js +3 -1
  107. package/dist/identity/index.js.map +1 -1
  108. package/dist/index.d.ts +6 -3
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +6 -3
  111. package/dist/index.js.map +1 -1
  112. package/dist/keyring/index.d.ts +2 -1
  113. package/dist/keyring/index.d.ts.map +1 -1
  114. package/dist/keyring/index.js +2 -1
  115. package/dist/keyring/index.js.map +1 -1
  116. package/dist/keyring/record.d.ts.map +1 -1
  117. package/dist/keyring/record.js +3 -6
  118. package/dist/keyring/record.js.map +1 -1
  119. package/dist/keyring/unlockSpace.d.ts +14 -5
  120. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  121. package/dist/keyring/unlockSpace.js +31 -36
  122. package/dist/keyring/unlockSpace.js.map +1 -1
  123. package/dist/keys/index.d.ts +22 -8
  124. package/dist/keys/index.d.ts.map +1 -1
  125. package/dist/keys/index.js +20 -6
  126. package/dist/keys/index.js.map +1 -1
  127. package/dist/keys/rosterLogStore.d.ts +15 -12
  128. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  129. package/dist/keys/rosterLogStore.js +21 -16
  130. package/dist/keys/rosterLogStore.js.map +1 -1
  131. package/dist/keys/rosterStore.d.ts +3 -6
  132. package/dist/keys/rosterStore.d.ts.map +1 -1
  133. package/dist/keys/rosterStore.js +10 -9
  134. package/dist/keys/rosterStore.js.map +1 -1
  135. package/dist/keys/spaceEpochs.d.ts.map +1 -1
  136. package/dist/keys/spaceEpochs.js +2 -3
  137. package/dist/keys/spaceEpochs.js.map +1 -1
  138. package/dist/keys/userKeyCascade.d.ts +8 -5
  139. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  140. package/dist/keys/userKeyCascade.js +7 -6
  141. package/dist/keys/userKeyCascade.js.map +1 -1
  142. package/dist/keys/userKeyRoster.d.ts +95 -8
  143. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  144. package/dist/keys/userKeyRoster.js +278 -35
  145. package/dist/keys/userKeyRoster.js.map +1 -1
  146. package/dist/keys/userKeyRosterCascade.d.ts +117 -16
  147. package/dist/keys/userKeyRosterCascade.d.ts.map +1 -1
  148. package/dist/keys/userKeyRosterCascade.js +184 -43
  149. package/dist/keys/userKeyRosterCascade.js.map +1 -1
  150. package/dist/keys/wasLabelsStore.d.ts +9 -2
  151. package/dist/keys/wasLabelsStore.d.ts.map +1 -1
  152. package/dist/keys/wasLabelsStore.js +14 -6
  153. package/dist/keys/wasLabelsStore.js.map +1 -1
  154. package/dist/log.d.ts +7 -2
  155. package/dist/log.d.ts.map +1 -1
  156. package/dist/log.js +6 -1
  157. package/dist/log.js.map +1 -1
  158. package/dist/recovery/index.d.ts +13 -9
  159. package/dist/recovery/index.d.ts.map +1 -1
  160. package/dist/recovery/index.js +12 -8
  161. package/dist/recovery/index.js.map +1 -1
  162. package/dist/recovery/recoveryCode.d.ts +27 -7
  163. package/dist/recovery/recoveryCode.d.ts.map +1 -1
  164. package/dist/recovery/recoveryCode.js +18 -6
  165. package/dist/recovery/recoveryCode.js.map +1 -1
  166. package/dist/recovery/recoveryDelegation.d.ts +23 -0
  167. package/dist/recovery/recoveryDelegation.d.ts.map +1 -1
  168. package/dist/recovery/recoveryDelegation.js +66 -46
  169. package/dist/recovery/recoveryDelegation.js.map +1 -1
  170. package/dist/recovery/recoveryWebvh.d.ts +75 -63
  171. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  172. package/dist/recovery/recoveryWebvh.js +127 -116
  173. package/dist/recovery/recoveryWebvh.js.map +1 -1
  174. package/dist/request/appKey.d.ts +35 -1
  175. package/dist/request/appKey.d.ts.map +1 -1
  176. package/dist/request/appKey.js +29 -10
  177. package/dist/request/appKey.js.map +1 -1
  178. package/dist/request/classify.d.ts +32 -8
  179. package/dist/request/classify.d.ts.map +1 -1
  180. package/dist/request/classify.js +39 -14
  181. package/dist/request/classify.js.map +1 -1
  182. package/dist/request/ephemeralExchange.d.ts +1 -6
  183. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  184. package/dist/request/ephemeralExchange.js.map +1 -1
  185. package/dist/request/onboarding.d.ts.map +1 -1
  186. package/dist/request/onboarding.js +2 -2
  187. package/dist/request/onboarding.js.map +1 -1
  188. package/dist/request/parse.d.ts.map +1 -1
  189. package/dist/request/parse.js +2 -3
  190. package/dist/request/parse.js.map +1 -1
  191. package/dist/resourceLog/controller.d.ts +34 -12
  192. package/dist/resourceLog/controller.d.ts.map +1 -1
  193. package/dist/resourceLog/controller.js +79 -86
  194. package/dist/resourceLog/controller.js.map +1 -1
  195. package/dist/resourceLog/document.d.ts +182 -0
  196. package/dist/resourceLog/document.d.ts.map +1 -0
  197. package/dist/resourceLog/document.js +159 -0
  198. package/dist/resourceLog/document.js.map +1 -0
  199. package/dist/resourceLog/errors.d.ts +47 -8
  200. package/dist/resourceLog/errors.d.ts.map +1 -1
  201. package/dist/resourceLog/errors.js +54 -8
  202. package/dist/resourceLog/errors.js.map +1 -1
  203. package/dist/resourceLog/index.d.ts +7 -3
  204. package/dist/resourceLog/index.d.ts.map +1 -1
  205. package/dist/resourceLog/index.js +7 -3
  206. package/dist/resourceLog/index.js.map +1 -1
  207. package/dist/resourceLog/ladderRungs.d.ts +35 -0
  208. package/dist/resourceLog/ladderRungs.d.ts.map +1 -0
  209. package/dist/resourceLog/ladderRungs.js +352 -0
  210. package/dist/resourceLog/ladderRungs.js.map +1 -0
  211. package/dist/resourceLog/license.d.ts +42 -17
  212. package/dist/resourceLog/license.d.ts.map +1 -1
  213. package/dist/resourceLog/license.js +38 -24
  214. package/dist/resourceLog/license.js.map +1 -1
  215. package/dist/space/activity.d.ts +15 -15
  216. package/dist/space/activity.d.ts.map +1 -1
  217. package/dist/space/activity.js +15 -15
  218. package/dist/space/activity.js.map +1 -1
  219. package/dist/space/collections.d.ts +11 -0
  220. package/dist/space/collections.d.ts.map +1 -1
  221. package/dist/space/collections.js +13 -0
  222. package/dist/space/collections.js.map +1 -1
  223. package/dist/space/deleteSpace.d.ts +28 -0
  224. package/dist/space/deleteSpace.d.ts.map +1 -0
  225. package/dist/space/deleteSpace.js +44 -0
  226. package/dist/space/deleteSpace.js.map +1 -0
  227. package/dist/space/errors.d.ts.map +1 -1
  228. package/dist/space/errors.js +0 -1
  229. package/dist/space/errors.js.map +1 -1
  230. package/dist/space/index.d.ts +6 -0
  231. package/dist/space/index.d.ts.map +1 -1
  232. package/dist/space/index.js +6 -0
  233. package/dist/space/index.js.map +1 -1
  234. package/dist/space/plaintextCollection.d.ts +43 -0
  235. package/dist/space/plaintextCollection.d.ts.map +1 -0
  236. package/dist/space/plaintextCollection.js +17 -0
  237. package/dist/space/plaintextCollection.js.map +1 -0
  238. package/dist/stages.d.ts +23 -0
  239. package/dist/stages.d.ts.map +1 -0
  240. package/dist/stages.js +23 -0
  241. package/dist/stages.js.map +1 -0
  242. package/dist/sync/index.d.ts +7 -0
  243. package/dist/sync/index.d.ts.map +1 -1
  244. package/dist/sync/index.js +7 -0
  245. package/dist/sync/index.js.map +1 -1
  246. package/dist/sync/push.js +4 -4
  247. package/dist/sync/push.js.map +1 -1
  248. package/dist/sync/remint.js +2 -2
  249. package/dist/sync/remint.js.map +1 -1
  250. package/dist/sync/types.d.ts +41 -1
  251. package/dist/sync/types.d.ts.map +1 -1
  252. package/dist/sync/types.js +47 -1
  253. package/dist/sync/types.js.map +1 -1
  254. package/dist/unlock/index.d.ts +5 -1
  255. package/dist/unlock/index.d.ts.map +1 -1
  256. package/dist/unlock/index.js +5 -1
  257. package/dist/unlock/index.js.map +1 -1
  258. package/dist/unlock/retire.d.ts +35 -7
  259. package/dist/unlock/retire.d.ts.map +1 -1
  260. package/dist/unlock/retire.js +52 -14
  261. package/dist/unlock/retire.js.map +1 -1
  262. package/dist/unlock/standingClient.d.ts.map +1 -1
  263. package/dist/unlock/standingClient.js +5 -1
  264. package/dist/unlock/standingClient.js.map +1 -1
  265. package/dist/unlock/standingWebvh.d.ts +217 -35
  266. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  267. package/dist/unlock/standingWebvh.js +469 -210
  268. package/dist/unlock/standingWebvh.js.map +1 -1
  269. package/dist/webvh/accountEntry.d.ts +146 -0
  270. package/dist/webvh/accountEntry.d.ts.map +1 -0
  271. package/dist/webvh/accountEntry.js +239 -0
  272. package/dist/webvh/accountEntry.js.map +1 -0
  273. package/dist/webvh/didWeb.d.ts +12 -7
  274. package/dist/webvh/didWeb.d.ts.map +1 -1
  275. package/dist/webvh/didWeb.js +2 -2
  276. package/dist/webvh/didWeb.js.map +1 -1
  277. package/dist/webvh/didWebProjection.d.ts +164 -0
  278. package/dist/webvh/didWebProjection.d.ts.map +1 -0
  279. package/dist/webvh/didWebProjection.js +230 -0
  280. package/dist/webvh/didWebProjection.js.map +1 -0
  281. package/dist/webvh/didWebvh.d.ts +275 -136
  282. package/dist/webvh/didWebvh.d.ts.map +1 -1
  283. package/dist/webvh/didWebvh.js +307 -340
  284. package/dist/webvh/didWebvh.js.map +1 -1
  285. package/dist/webvh/enrollClient.d.ts +65 -0
  286. package/dist/webvh/enrollClient.d.ts.map +1 -0
  287. package/dist/webvh/enrollClient.js +172 -0
  288. package/dist/webvh/enrollClient.js.map +1 -0
  289. package/dist/webvh/index.d.ts +37 -12
  290. package/dist/webvh/index.d.ts.map +1 -1
  291. package/dist/webvh/index.js +33 -10
  292. package/dist/webvh/index.js.map +1 -1
  293. package/dist/webvh/listClients.d.ts +1 -35
  294. package/dist/webvh/listClients.d.ts.map +1 -1
  295. package/dist/webvh/listClients.js +2 -30
  296. package/dist/webvh/listClients.js.map +1 -1
  297. package/dist/webvh/revokeClient.d.ts +41 -11
  298. package/dist/webvh/revokeClient.d.ts.map +1 -1
  299. package/dist/webvh/revokeClient.js +99 -48
  300. package/dist/webvh/revokeClient.js.map +1 -1
  301. package/dist/webvh/standingZcap.d.ts +61 -14
  302. package/dist/webvh/standingZcap.d.ts.map +1 -1
  303. package/dist/webvh/standingZcap.js +91 -0
  304. package/dist/webvh/standingZcap.js.map +1 -1
  305. package/dist/webvh/verifyLog.d.ts +59 -5
  306. package/dist/webvh/verifyLog.d.ts.map +1 -1
  307. package/dist/webvh/verifyLog.js +76 -11
  308. package/dist/webvh/verifyLog.js.map +1 -1
  309. package/dist/webvh/wasIdStore.d.ts +8 -8
  310. package/dist/webvh/wasIdStore.d.ts.map +1 -1
  311. package/dist/webvh/wasIdStore.js +39 -14
  312. package/dist/webvh/wasIdStore.js.map +1 -1
  313. package/dist/webvh/zcap.d.ts +14 -1
  314. package/dist/webvh/zcap.d.ts.map +1 -1
  315. package/dist/webvh/zcap.js +3 -27
  316. package/dist/webvh/zcap.js.map +1 -1
  317. package/package.json +2 -2
  318. package/dist/webvh/keyAgreement.d.ts +0 -97
  319. package/dist/webvh/keyAgreement.d.ts.map +0 -1
  320. package/dist/webvh/keyAgreement.js +0 -71
  321. package/dist/webvh/keyAgreement.js.map +0 -1
@@ -1,55 +1,22 @@
1
1
  import { ResourceLogIntegrityError } from '@interop/vh-resource-log';
2
+ import { credentialKeyAgreementMethods, ladderVmMethods, resolvedRelationMethods } from './document.js';
3
+ import { attributeLadderRungsPerVersion, entrySignerKeysOf } from './ladderRungs.js';
2
4
  import { assertLadderAppendLicensed } from './license.js';
3
5
  /**
4
- * Resolves one relation entry: an embedded verification method verbatim, a
5
- * string reference through the given `verificationMethod` index.
6
+ * Collects a document's `assertionMethod` key multibases, over the shared
7
+ * relation reader (embedded verification methods verbatim, string references
8
+ * resolved against `verificationMethod`).
6
9
  *
7
- * @param entry {string | ControllerVerificationMethod}
8
- * @param byId {Map<string, ControllerVerificationMethod>}
9
- * @returns {ControllerVerificationMethod | undefined}
10
- */
11
- function resolveMethod(entry, byId) {
12
- return typeof entry === 'string' ? byId.get(entry) : entry;
13
- }
14
- /**
15
- * Indexes a document's `verificationMethod` array by id.
16
- *
17
- * @param doc {ControllerDocument}
18
- * @returns {Map<string, ControllerVerificationMethod>}
19
- */
20
- function methodsById(doc) {
21
- const byId = new Map();
22
- for (const method of doc.verificationMethod ?? []) {
23
- if (typeof method?.id === 'string') {
24
- byId.set(method.id, method);
25
- }
26
- }
27
- return byId;
28
- }
29
- /**
30
- * A relation entry's verification-method id: the string reference itself, or
31
- * an embedded method's `id`.
32
- *
33
- * @param entry {string | ControllerVerificationMethod}
34
- * @returns {string | undefined}
35
- */
36
- function relationIdOf(entry) {
37
- return typeof entry === 'string' ? entry : entry?.id;
38
- }
39
- /**
40
- * Collects a document's `assertionMethod` key multibases: embedded
41
- * verification methods verbatim, string references resolved against
42
- * `verificationMethod`.
43
- *
44
- * @param doc {ControllerDocument}
10
+ * @param doc {AccountDocument}
45
11
  * @returns {Set<string>}
46
12
  */
47
13
  function assertionKeysOf(doc) {
48
- const byId = methodsById(doc);
49
14
  const keys = new Set();
50
- for (const entry of doc.assertionMethod ?? []) {
51
- const method = resolveMethod(entry, byId);
52
- if (method && typeof method.publicKeyMultibase === 'string') {
15
+ for (const method of resolvedRelationMethods({
16
+ doc,
17
+ relation: 'assertionMethod'
18
+ })) {
19
+ if (typeof method.publicKeyMultibase === 'string') {
53
20
  keys.add(method.publicKeyMultibase);
54
21
  }
55
22
  }
@@ -57,45 +24,41 @@ function assertionKeysOf(doc) {
57
24
  }
58
25
  /**
59
26
  * Collects a document's credential-inventory view (see
60
- * {@link ControllerInventory}): the ladder VMs by relation asymmetry
61
- * (`capabilityDelegation` members absent from `capabilityInvocation`,
62
- * compared by verification-method id), and S(V) as the account-controlled
63
- * `keyAgreement` methods' key material -- `publicKeyCommitment` where the
64
- * entry is a commitment, `publicKeyMultibase` where it is verbatim (the two
65
- * value spaces are disjoint) -- union the ladder keys. A `keyAgreement`
66
- * method carrying neither is skipped: an unidentifiable entry must not make
67
- * two distinct inventories compare equal.
27
+ * {@link ControllerInventory}) over the shared account-document readers, so
28
+ * ladder recognition and the credential class have one definition here and in
29
+ * every other reader: `ladderVmMethods` names the ladder VMs by relation
30
+ * asymmetry, and `credentialKeyAgreementMethods` names the account-controlled
31
+ * `keyAgreement` methods. S(V) is those methods' key material --
32
+ * `publicKeyCommitment` where the entry is a commitment,
33
+ * `publicKeyMultibase` where it is verbatim (the two value spaces are
34
+ * disjoint) -- union the ladder keys. A `keyAgreement` method carrying
35
+ * neither is skipped: an unidentifiable entry must not make two distinct
36
+ * inventories compare equal.
68
37
  *
69
- * @param doc {ControllerDocument}
70
- * @param did {string} the account DID inventory entries are controlled by
71
- * @returns {ControllerInventory}
38
+ * The enrolled-client set the license's third shape compares across versions
39
+ * is read from the same document in the same pass: the `capabilityInvocation`
40
+ * methods' key multibases. That relation is the client census by definition --
41
+ * a ladder VM is absent from it by the recognition asymmetry, and a
42
+ * credential's `keyAgreement` entry was never in it -- so the two sets this
43
+ * function returns cannot overlap by construction.
44
+ *
45
+ * @param options {object}
46
+ * @param options.doc {AccountDocument}
47
+ * @param options.did {string} the account DID inventory entries are
48
+ * controlled by
49
+ * @param options.entry {DIDLogEntry} the version's own log entry, read for
50
+ * the update keys that signed it
51
+ * @returns {Omit<ControllerInventory, 'ladderRungKeys'>}
72
52
  */
73
- function inventoryOf(doc, did) {
74
- const byId = methodsById(doc);
75
- const invocable = new Set();
76
- for (const entry of doc.capabilityInvocation ?? []) {
77
- const id = relationIdOf(entry);
78
- if (id !== undefined) {
79
- invocable.add(id);
80
- }
81
- }
53
+ function inventoryOf({ doc, did, entry }) {
82
54
  const ladderKeys = new Set();
83
- for (const entry of doc.capabilityDelegation ?? []) {
84
- const id = relationIdOf(entry);
85
- if (id !== undefined && invocable.has(id)) {
86
- continue;
87
- }
88
- const method = resolveMethod(entry, byId);
89
- if (method && typeof method.publicKeyMultibase === 'string') {
55
+ for (const method of ladderVmMethods({ doc })) {
56
+ if (typeof method.publicKeyMultibase === 'string') {
90
57
  ladderKeys.add(method.publicKeyMultibase);
91
58
  }
92
59
  }
93
60
  const inventoryKeys = new Set(ladderKeys);
94
- for (const entry of doc.keyAgreement ?? []) {
95
- const method = resolveMethod(entry, byId);
96
- if (!method || method.controller !== did) {
97
- continue;
98
- }
61
+ for (const method of credentialKeyAgreementMethods({ doc, did })) {
99
62
  if (typeof method.publicKeyCommitment === 'string') {
100
63
  inventoryKeys.add(method.publicKeyCommitment);
101
64
  }
@@ -103,7 +66,21 @@ function inventoryOf(doc, did) {
103
66
  inventoryKeys.add(method.publicKeyMultibase);
104
67
  }
105
68
  }
106
- return { ladderKeys, inventoryKeys };
69
+ const enrolledClientKeys = new Set();
70
+ for (const method of resolvedRelationMethods({
71
+ doc,
72
+ relation: 'capabilityInvocation'
73
+ })) {
74
+ if (typeof method.publicKeyMultibase === 'string') {
75
+ enrolledClientKeys.add(method.publicKeyMultibase);
76
+ }
77
+ }
78
+ return {
79
+ ladderKeys,
80
+ inventoryKeys,
81
+ enrolledClientKeys,
82
+ entrySignerKeys: entrySignerKeysOf(entry)
83
+ };
107
84
  }
108
85
  /**
109
86
  * Builds the controller view over an already-verified did:webvh account log
@@ -132,11 +109,18 @@ export function webvhResourceLogController({ did, log }) {
132
109
  const versionIds = log.map(entry => entry.versionId);
133
110
  const keysByVersion = new Map();
134
111
  const inventoryByVersion = new Map();
135
- for (const entry of log) {
112
+ const positionByVersion = new Map();
113
+ for (const [position, entry] of log.entries()) {
136
114
  const doc = entry.state;
137
115
  keysByVersion.set(entry.versionId, assertionKeysOf(doc));
138
- inventoryByVersion.set(entry.versionId, inventoryOf(doc, did));
116
+ inventoryByVersion.set(entry.versionId, inventoryOf({ doc, did, entry }));
117
+ positionByVersion.set(entry.versionId, position);
139
118
  }
119
+ // The rung attribution hashes committed keys, so it cannot run in the sync
120
+ // pass above. It is computed once on the first inventory read and shared by
121
+ // every later one: the walk is a pure function of the log, and a log is read
122
+ // fresh and never mutated in place.
123
+ let rungSnapshots;
140
124
  const head = log.length === 0 ? undefined : log[log.length - 1];
141
125
  function versionRefusal(versionId) {
142
126
  return new ResourceLogIntegrityError(`The controller document did not resolve at version ` +
@@ -154,14 +138,23 @@ export function webvhResourceLogController({ did, log }) {
154
138
  }
155
139
  return Promise.resolve(resolved);
156
140
  },
157
- inventoryAt(versionId) {
158
- const resolved = versionId === undefined
159
- ? head && inventoryByVersion.get(head.versionId)
160
- : inventoryByVersion.get(versionId);
161
- if (!resolved) {
162
- return Promise.reject(versionRefusal(versionId));
141
+ async inventoryAt(versionId) {
142
+ const resolvedVersionId = versionId === undefined ? head?.versionId : versionId;
143
+ const resolved = resolvedVersionId === undefined
144
+ ? undefined
145
+ : inventoryByVersion.get(resolvedVersionId);
146
+ const position = resolvedVersionId === undefined
147
+ ? undefined
148
+ : positionByVersion.get(resolvedVersionId);
149
+ if (!resolved || position === undefined) {
150
+ throw versionRefusal(versionId);
163
151
  }
164
- return Promise.resolve(resolved);
152
+ rungSnapshots ??= attributeLadderRungsPerVersion(log);
153
+ const snapshots = await rungSnapshots;
154
+ return {
155
+ ...resolved,
156
+ ladderRungKeys: snapshots[position] ?? new Map()
157
+ };
165
158
  },
166
159
  async admitAppend({ keyMultibase, controllerVersionId, controllerVersionIndex, headControllerVersionIndex, proofKeys }) {
167
160
  const inventory = await view.inventoryAt(controllerVersionId);
@@ -1 +1 @@
1
- {"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/resourceLog/controller.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAyEzD;;;;;;;GAOG;AACH,SAAS,aAAa,CACpB,KAA4C,EAC5C,IAA+C;IAE/C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC5D,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAClB,GAAuB;IAEvB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAwC,CAAA;IAC5D,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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AAG,CAAC,CAAA;YACrD,MAAM,SAAS,GAAG,MAAM,aAAa,CAAA;YACrC,OAAO;gBACL,GAAG,QAAQ;gBACX,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,IAAI,GAAG,EAAE;aACjD,CAAA;QACH,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,EAChB,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,SAAS,EACV;YACC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAA;YAC7D,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC3C,MAAM,0BAA0B,CAAC;oBAC/B,UAAU,EAAE,IAAI;oBAChB,sBAAsB;oBACtB,0BAA0B;oBAC1B,SAAS;iBACV,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;KACF,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -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;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