@interop/wallet-core 0.51.0 → 0.52.1

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 (239) hide show
  1. package/README.md +7 -11
  2. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts +2 -2
  3. package/dist/clientAnnex/credentialAnchoredGenesis.d.ts.map +1 -1
  4. package/dist/clientAnnex/credentialAnchoredGenesis.js +1 -1
  5. package/dist/clientAnnex/forget.d.ts +18 -6
  6. package/dist/clientAnnex/forget.d.ts.map +1 -1
  7. package/dist/clientAnnex/forget.js +19 -6
  8. package/dist/clientAnnex/forget.js.map +1 -1
  9. package/dist/clientAnnex/forgetLast.d.ts +33 -20
  10. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  11. package/dist/clientAnnex/forgetLast.js +43 -17
  12. package/dist/clientAnnex/forgetLast.js.map +1 -1
  13. package/dist/clientAnnex/gc.d.ts +3 -3
  14. package/dist/clientAnnex/gc.d.ts.map +1 -1
  15. package/dist/clientAnnex/gc.js +2 -2
  16. package/dist/clientAnnex/gc.js.map +1 -1
  17. package/dist/clientAnnex/index.d.ts +5 -5
  18. package/dist/clientAnnex/index.d.ts.map +1 -1
  19. package/dist/clientAnnex/index.js +4 -4
  20. package/dist/clientAnnex/index.js.map +1 -1
  21. package/dist/clientAnnex/ladder.d.ts +19 -11
  22. package/dist/clientAnnex/ladder.d.ts.map +1 -1
  23. package/dist/clientAnnex/ladder.js +77 -14
  24. package/dist/clientAnnex/ladder.js.map +1 -1
  25. package/dist/clientAnnex/ladderAnchored.d.ts +36 -7
  26. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  27. package/dist/clientAnnex/ladderAnchored.js +80 -18
  28. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  29. package/dist/clientAnnex/log.d.ts +6 -6
  30. package/dist/clientAnnex/log.d.ts.map +1 -1
  31. package/dist/clientAnnex/log.js +8 -8
  32. package/dist/clientAnnex/log.js.map +1 -1
  33. package/dist/clientAnnex/recoveryLadderAnchored.d.ts +7 -7
  34. package/dist/clientAnnex/recoveryLadderAnchored.js +9 -9
  35. package/dist/clientAnnex/recoveryLadderAnchored.js.map +1 -1
  36. package/dist/clientAnnex/selfEnroll.d.ts +6 -4
  37. package/dist/clientAnnex/selfEnroll.d.ts.map +1 -1
  38. package/dist/clientAnnex/selfEnroll.js +19 -7
  39. package/dist/clientAnnex/selfEnroll.js.map +1 -1
  40. package/dist/clients/listing.d.ts +1 -1
  41. package/dist/clients/listing.d.ts.map +1 -1
  42. package/dist/clients/listing.js +1 -1
  43. package/dist/clients/listing.js.map +1 -1
  44. package/dist/clients/revocation.d.ts +1 -1
  45. package/dist/clients/rosterPolicy.d.ts +1 -1
  46. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  47. package/dist/descriptors/acquire.js +1 -1
  48. package/dist/descriptors/logSource.d.ts +1 -2
  49. package/dist/descriptors/logSource.d.ts.map +1 -1
  50. package/dist/descriptors/logSource.js +2 -2
  51. package/dist/descriptors/logSource.js.map +1 -1
  52. package/dist/enrollment/enrollment.d.ts +1 -1
  53. package/dist/enrollment/enrollment.d.ts.map +1 -1
  54. package/dist/enrollment/enrollment.js +2 -1
  55. package/dist/enrollment/enrollment.js.map +1 -1
  56. package/dist/genesis/accountGenesis.d.ts +1 -1
  57. package/dist/genesis/accountGenesis.d.ts.map +1 -1
  58. package/dist/genesis/accountGenesis.js +1 -1
  59. package/dist/index.d.ts +1 -3
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +1 -3
  62. package/dist/index.js.map +1 -1
  63. package/dist/keyring/kdf.d.ts +6 -20
  64. package/dist/keyring/kdf.d.ts.map +1 -1
  65. package/dist/keyring/kdf.js +8 -5
  66. package/dist/keyring/kdf.js.map +1 -1
  67. package/dist/keyring/unlockSpace.js +1 -1
  68. package/dist/keys/rosterLogStore.d.ts +16 -14
  69. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  70. package/dist/keys/rosterLogStore.js +149 -32
  71. package/dist/keys/rosterLogStore.js.map +1 -1
  72. package/dist/keys/rosterStore.d.ts +8 -7
  73. package/dist/keys/rosterStore.d.ts.map +1 -1
  74. package/dist/keys/rosterStore.js +6 -6
  75. package/dist/keys/rosterStore.js.map +1 -1
  76. package/dist/keys/spaceEpochs.d.ts +1 -1
  77. package/dist/keys/spaceEpochs.js +1 -1
  78. package/dist/keys/userKeyRoster.d.ts +3 -3
  79. package/dist/keys/userKeyRoster.d.ts.map +1 -1
  80. package/dist/keys/userKeyRoster.js +3 -3
  81. package/dist/keys/userKeyRoster.js.map +1 -1
  82. package/dist/recovery/index.d.ts +2 -2
  83. package/dist/recovery/index.js +2 -2
  84. package/dist/recovery/recoveryDelegation.js +1 -1
  85. package/dist/recovery/recoveryDelegation.js.map +1 -1
  86. package/dist/recovery/recoveryWebvh.d.ts +4 -4
  87. package/dist/recovery/recoveryWebvh.js +5 -5
  88. package/dist/request/appKey.d.ts +9 -3
  89. package/dist/request/appKey.d.ts.map +1 -1
  90. package/dist/request/appKey.js +13 -8
  91. package/dist/request/appKey.js.map +1 -1
  92. package/dist/request/classify.d.ts.map +1 -1
  93. package/dist/request/classify.js +13 -1
  94. package/dist/request/classify.js.map +1 -1
  95. package/dist/request/ephemeralExchange.d.ts +6 -1
  96. package/dist/request/ephemeralExchange.d.ts.map +1 -1
  97. package/dist/request/ephemeralExchange.js +6 -1
  98. package/dist/request/ephemeralExchange.js.map +1 -1
  99. package/dist/request/exchangeClient.d.ts +0 -23
  100. package/dist/request/exchangeClient.d.ts.map +1 -1
  101. package/dist/request/exchangeClient.js +30 -1
  102. package/dist/request/exchangeClient.js.map +1 -1
  103. package/dist/request/index.d.ts +4 -1
  104. package/dist/request/index.d.ts.map +1 -1
  105. package/dist/request/index.js +4 -1
  106. package/dist/request/index.js.map +1 -1
  107. package/dist/request/interactionRequest.d.ts +23 -0
  108. package/dist/request/interactionRequest.d.ts.map +1 -0
  109. package/dist/request/interactionRequest.js +46 -0
  110. package/dist/request/interactionRequest.js.map +1 -0
  111. package/dist/request/interactionUrl.d.ts +3 -14
  112. package/dist/request/interactionUrl.d.ts.map +1 -1
  113. package/dist/request/interactionUrl.js +20 -1
  114. package/dist/request/interactionUrl.js.map +1 -1
  115. package/dist/resourceLog/controller.d.ts +48 -49
  116. package/dist/resourceLog/controller.d.ts.map +1 -1
  117. package/dist/resourceLog/controller.js +40 -20
  118. package/dist/resourceLog/controller.js.map +1 -1
  119. package/dist/resourceLog/errors.d.ts +12 -78
  120. package/dist/resourceLog/errors.d.ts.map +1 -1
  121. package/dist/resourceLog/errors.js +12 -79
  122. package/dist/resourceLog/errors.js.map +1 -1
  123. package/dist/resourceLog/index.d.ts +17 -22
  124. package/dist/resourceLog/index.d.ts.map +1 -1
  125. package/dist/resourceLog/index.js +16 -21
  126. package/dist/resourceLog/index.js.map +1 -1
  127. package/dist/resourceLog/license.d.ts +27 -26
  128. package/dist/resourceLog/license.d.ts.map +1 -1
  129. package/dist/resourceLog/license.js +31 -30
  130. package/dist/resourceLog/license.js.map +1 -1
  131. package/dist/unlock/index.d.ts +6 -6
  132. package/dist/unlock/index.d.ts.map +1 -1
  133. package/dist/unlock/index.js +5 -5
  134. package/dist/unlock/retire.d.ts +29 -28
  135. package/dist/unlock/retire.d.ts.map +1 -1
  136. package/dist/unlock/retire.js +25 -16
  137. package/dist/unlock/retire.js.map +1 -1
  138. package/dist/unlock/standingClient.d.ts +1 -1
  139. package/dist/unlock/standingClient.js +3 -3
  140. package/dist/unlock/standingWebvh.d.ts +28 -10
  141. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  142. package/dist/unlock/standingWebvh.js +75 -37
  143. package/dist/unlock/standingWebvh.js.map +1 -1
  144. package/dist/unlock/unlockRecord.js +1 -1
  145. package/dist/webvh/delegatedLogStore.d.ts +2 -2
  146. package/dist/webvh/delegatedLogStore.js +2 -2
  147. package/dist/webvh/didWeb.js +1 -1
  148. package/dist/webvh/didWeb.js.map +1 -1
  149. package/dist/webvh/didWebvh.d.ts +3 -3
  150. package/dist/webvh/didWebvh.d.ts.map +1 -1
  151. package/dist/webvh/didWebvh.js +5 -5
  152. package/dist/webvh/didWebvh.js.map +1 -1
  153. package/dist/webvh/listClients.js +1 -1
  154. package/dist/webvh/listClients.js.map +1 -1
  155. package/dist/webvh/verifyLog.d.ts +1 -1
  156. package/dist/webvh/verifyLog.d.ts.map +1 -1
  157. package/dist/webvh/verifyLog.js +1 -2
  158. package/dist/webvh/verifyLog.js.map +1 -1
  159. package/package.json +5 -9
  160. package/dist/display/alignment.d.ts +0 -55
  161. package/dist/display/alignment.d.ts.map +0 -1
  162. package/dist/display/alignment.js +0 -117
  163. package/dist/display/alignment.js.map +0 -1
  164. package/dist/display/credentialName.d.ts +0 -42
  165. package/dist/display/credentialName.d.ts.map +0 -1
  166. package/dist/display/credentialName.js +0 -106
  167. package/dist/display/credentialName.js.map +0 -1
  168. package/dist/display/displayFields.d.ts +0 -59
  169. package/dist/display/displayFields.d.ts.map +0 -1
  170. package/dist/display/displayFields.js +0 -136
  171. package/dist/display/displayFields.js.map +0 -1
  172. package/dist/display/evidence.d.ts +0 -50
  173. package/dist/display/evidence.d.ts.map +0 -1
  174. package/dist/display/evidence.js +0 -67
  175. package/dist/display/evidence.js.map +0 -1
  176. package/dist/display/image.d.ts +0 -18
  177. package/dist/display/image.d.ts.map +0 -1
  178. package/dist/display/image.js +0 -23
  179. package/dist/display/image.js.map +0 -1
  180. package/dist/display/index.d.ts +0 -38
  181. package/dist/display/index.d.ts.map +0 -1
  182. package/dist/display/index.js +0 -32
  183. package/dist/display/index.js.map +0 -1
  184. package/dist/display/issuer.d.ts +0 -105
  185. package/dist/display/issuer.d.ts.map +0 -1
  186. package/dist/display/issuer.js +0 -126
  187. package/dist/display/issuer.js.map +0 -1
  188. package/dist/display/obv3.d.ts +0 -82
  189. package/dist/display/obv3.d.ts.map +0 -1
  190. package/dist/display/obv3.js +0 -117
  191. package/dist/display/obv3.js.map +0 -1
  192. package/dist/display/parse.d.ts +0 -66
  193. package/dist/display/parse.d.ts.map +0 -1
  194. package/dist/display/parse.js +0 -104
  195. package/dist/display/parse.js.map +0 -1
  196. package/dist/display/subject.d.ts +0 -79
  197. package/dist/display/subject.d.ts.map +0 -1
  198. package/dist/display/subject.js +0 -124
  199. package/dist/display/subject.js.map +0 -1
  200. package/dist/display/text.d.ts +0 -53
  201. package/dist/display/text.d.ts.map +0 -1
  202. package/dist/display/text.js +0 -78
  203. package/dist/display/text.js.map +0 -1
  204. package/dist/display/types.d.ts +0 -55
  205. package/dist/display/types.d.ts.map +0 -1
  206. package/dist/display/types.js +0 -41
  207. package/dist/display/types.js.map +0 -1
  208. package/dist/display/validity.d.ts +0 -51
  209. package/dist/display/validity.d.ts.map +0 -1
  210. package/dist/display/validity.js +0 -51
  211. package/dist/display/validity.js.map +0 -1
  212. package/dist/display/verificationView.d.ts +0 -115
  213. package/dist/display/verificationView.d.ts.map +0 -1
  214. package/dist/display/verificationView.js +0 -199
  215. package/dist/display/verificationView.js.map +0 -1
  216. package/dist/resourceLog/append.d.ts +0 -112
  217. package/dist/resourceLog/append.d.ts.map +0 -1
  218. package/dist/resourceLog/append.js +0 -197
  219. package/dist/resourceLog/append.js.map +0 -1
  220. package/dist/resourceLog/entry.d.ts +0 -68
  221. package/dist/resourceLog/entry.d.ts.map +0 -1
  222. package/dist/resourceLog/entry.js +0 -167
  223. package/dist/resourceLog/entry.js.map +0 -1
  224. package/dist/resourceLog/pin.d.ts +0 -82
  225. package/dist/resourceLog/pin.d.ts.map +0 -1
  226. package/dist/resourceLog/pin.js +0 -57
  227. package/dist/resourceLog/pin.js.map +0 -1
  228. package/dist/resourceLog/seal.d.ts +0 -97
  229. package/dist/resourceLog/seal.d.ts.map +0 -1
  230. package/dist/resourceLog/seal.js +0 -113
  231. package/dist/resourceLog/seal.js.map +0 -1
  232. package/dist/resourceLog/verify.d.ts +0 -96
  233. package/dist/resourceLog/verify.d.ts.map +0 -1
  234. package/dist/resourceLog/verify.js +0 -474
  235. package/dist/resourceLog/verify.js.map +0 -1
  236. package/dist/resourceLog/vmFragment.d.ts +0 -33
  237. package/dist/resourceLog/vmFragment.d.ts.map +0 -1
  238. package/dist/resourceLog/vmFragment.js +0 -39
  239. package/dist/resourceLog/vmFragment.js.map +0 -1
@@ -1,97 +0,0 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * The sealing sweep (App Connect spec `#log-authorization`): after a
6
- * controller-document edit removes a member's append authority, every
7
- * co-managed resource log must gain an entry anchored at (or past) the
8
- * post-removal document version -- the "sealing append" that proves the
9
- * surviving writers extended the log under the new membership. An ordinary
10
- * post-edit write (a roster rotation) is that append by construction; the gap
11
- * this module closes is the run where no such write happens -- a rotation
12
- * that no-ops because the retiree held no current-epoch wrap (an orphan
13
- * client, or any re-run), leaving the log's head still anchored pre-removal.
14
- *
15
- * Both halves are computed from durable state alone, keeping every cascade's
16
- * no-checkpoint convergence rule: the membership change is read off the
17
- * controller view (the latest version whose `assertionMethod` set lost a
18
- * member against its predecessor -- only assertion removals affect append
19
- * authority, so a spent recovery code's `keyAgreement`-only method never
20
- * registers here), and the log's side is the verified head's effective anchor
21
- * ({@link VerifiedResourceLog}`.headAnchorIndex`). "Sealed" is simply "head
22
- * anchor at or past the removal", so the backstop append is idempotent and a
23
- * torn sweep is finished by a naive re-run.
24
- */
25
- import type { ResourceLogStore } from '@interop/was-client/log';
26
- import type { ResourceLogController } from './controller.js';
27
- import type { ResourceLogSigner } from './entry.js';
28
- import type { ResourceLogPinStore } from './pin.js';
29
- import type { VerifiedResourceLog } from './verify.js';
30
- /**
31
- * The controller's latest membership change: the largest index into
32
- * `controller.versionIds` whose `assertionMethod` key set LOST a member
33
- * against its predecessor's, or `0` when no version ever removed one (the
34
- * genesis version has no predecessor and can never register as a removal, so
35
- * `0` doubles as "nothing to seal against" -- every anchor satisfies it). An
36
- * unversioned controller resolves `0` for the same reason: with no version
37
- * history there is no removal to locate.
38
- *
39
- * @param options {object}
40
- * @param options.controller {ResourceLogController} the verified controller
41
- * view
42
- * @returns {Promise<number>}
43
- */
44
- export declare function latestAssertionRemovalIndex({ controller }: {
45
- controller: ResourceLogController;
46
- }): Promise<number>;
47
- /**
48
- * Seals one resource log against the controller's latest membership change,
49
- * idempotently: when the verified head already anchors at or past the latest
50
- * `assertionMethod` removal (or the controller never removed one, or the log
51
- * does not exist yet, or the controller is unversioned) nothing is written;
52
- * otherwise the head state is re-appended VERBATIM as a no-op entry whose
53
- * only job is its post-removal anchor -- ordinary entries may repeat state
54
- * (only terminal entries are state-constrained), so the resource itself is
55
- * untouched. A closed log that needs sealing propagates the append path's
56
- * `ResourceLogClosedError`.
57
- *
58
- * `sealed` reports whether this call found the log unsealed (and it now is,
59
- * by this call's append or a concurrent writer's -- the rebase hook converges
60
- * rather than duplicating); `verified` is the log as last verified, `null`
61
- * when it was never read (absent, or nothing to seal against).
62
- *
63
- * @param options {object}
64
- * @param options.store {ResourceLogStore} the log's transport seam
65
- * @param options.controller {ResourceLogController} the verified controller
66
- * view
67
- * @param options.expectedMethod {string} the format identifier expected
68
- * @param options.pinStore {ResourceLogPinStore} this client's chain-head
69
- * pin for this log
70
- * @param options.logId {string} the pin-slot key for this log, from
71
- * `resourceLogPinId`
72
- * @param options.signer {ResourceLogSigner} this client's enrolled signing
73
- * key
74
- * @param [options.versionTime] {string} RFC3339 UTC; defaults to now
75
- * @param [options.verified] {VerifiedResourceLog} a log view the caller
76
- * verified moments ago (the most recent read or confirmed append on the same
77
- * store), letting the sweep skip its own read. Staleness is safe in both
78
- * directions: entry anchors are verifier-enforced monotone, so a stale head
79
- * anchoring at or past the removal means the true head does too, and an
80
- * unsealed verdict is re-checked by the append path's own read before
81
- * anything is written
82
- * @returns {Promise<{ sealed: boolean, verified: VerifiedResourceLog | null }>}
83
- */
84
- export declare function sealResourceLog({ store, controller, expectedMethod, pinStore, logId, signer, versionTime, verified: knownVerified }: {
85
- store: ResourceLogStore;
86
- controller: ResourceLogController;
87
- expectedMethod: string;
88
- pinStore: ResourceLogPinStore;
89
- logId: string;
90
- signer: ResourceLogSigner;
91
- versionTime?: string;
92
- verified?: VerifiedResourceLog;
93
- }): Promise<{
94
- sealed: boolean;
95
- verified: VerifiedResourceLog | null;
96
- }>;
97
- //# sourceMappingURL=seal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seal.d.ts","sourceRoot":"","sources":["../../src/resourceLog/seal.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,2BAA2B,CAAC,EAChD,UAAU,EACX,EAAE;IACD,UAAU,EAAE,qBAAqB,CAAA;CAClC,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,eAAe,CAAC,EACpC,KAAK,EACL,UAAU,EACV,cAAc,EACd,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,QAAQ,EAAE,aAAa,EACxB,EAAE;IACD,KAAK,EAAE,gBAAgB,CAAA;IACvB,UAAU,EAAE,qBAAqB,CAAA;IACjC,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,mBAAmB,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,iBAAiB,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAC/B,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAA;CAAE,CAAC,CA6CrE"}
@@ -1,113 +0,0 @@
1
- import { appendResourceLog, readResourceLog } from './append.js';
2
- /**
3
- * The controller's latest membership change: the largest index into
4
- * `controller.versionIds` whose `assertionMethod` key set LOST a member
5
- * against its predecessor's, or `0` when no version ever removed one (the
6
- * genesis version has no predecessor and can never register as a removal, so
7
- * `0` doubles as "nothing to seal against" -- every anchor satisfies it). An
8
- * unversioned controller resolves `0` for the same reason: with no version
9
- * history there is no removal to locate.
10
- *
11
- * @param options {object}
12
- * @param options.controller {ResourceLogController} the verified controller
13
- * view
14
- * @returns {Promise<number>}
15
- */
16
- export async function latestAssertionRemovalIndex({ controller }) {
17
- let removalIndex = 0;
18
- let previous = null;
19
- for (const [index, versionId] of controller.versionIds.entries()) {
20
- const keys = await controller.assertionKeysAt(versionId);
21
- if (previous !== null) {
22
- for (const key of previous) {
23
- if (!keys.has(key)) {
24
- removalIndex = index;
25
- break;
26
- }
27
- }
28
- }
29
- previous = keys;
30
- }
31
- return removalIndex;
32
- }
33
- /**
34
- * Seals one resource log against the controller's latest membership change,
35
- * idempotently: when the verified head already anchors at or past the latest
36
- * `assertionMethod` removal (or the controller never removed one, or the log
37
- * does not exist yet, or the controller is unversioned) nothing is written;
38
- * otherwise the head state is re-appended VERBATIM as a no-op entry whose
39
- * only job is its post-removal anchor -- ordinary entries may repeat state
40
- * (only terminal entries are state-constrained), so the resource itself is
41
- * untouched. A closed log that needs sealing propagates the append path's
42
- * `ResourceLogClosedError`.
43
- *
44
- * `sealed` reports whether this call found the log unsealed (and it now is,
45
- * by this call's append or a concurrent writer's -- the rebase hook converges
46
- * rather than duplicating); `verified` is the log as last verified, `null`
47
- * when it was never read (absent, or nothing to seal against).
48
- *
49
- * @param options {object}
50
- * @param options.store {ResourceLogStore} the log's transport seam
51
- * @param options.controller {ResourceLogController} the verified controller
52
- * view
53
- * @param options.expectedMethod {string} the format identifier expected
54
- * @param options.pinStore {ResourceLogPinStore} this client's chain-head
55
- * pin for this log
56
- * @param options.logId {string} the pin-slot key for this log, from
57
- * `resourceLogPinId`
58
- * @param options.signer {ResourceLogSigner} this client's enrolled signing
59
- * key
60
- * @param [options.versionTime] {string} RFC3339 UTC; defaults to now
61
- * @param [options.verified] {VerifiedResourceLog} a log view the caller
62
- * verified moments ago (the most recent read or confirmed append on the same
63
- * store), letting the sweep skip its own read. Staleness is safe in both
64
- * directions: entry anchors are verifier-enforced monotone, so a stale head
65
- * anchoring at or past the removal means the true head does too, and an
66
- * unsealed verdict is re-checked by the append path's own read before
67
- * anything is written
68
- * @returns {Promise<{ sealed: boolean, verified: VerifiedResourceLog | null }>}
69
- */
70
- export async function sealResourceLog({ store, controller, expectedMethod, pinStore, logId, signer, versionTime, verified: knownVerified }) {
71
- if (controller.versionIds.length === 0) {
72
- return { sealed: false, verified: null };
73
- }
74
- const removalIndex = await latestAssertionRemovalIndex({ controller });
75
- if (removalIndex === 0) {
76
- return { sealed: false, verified: knownVerified ?? null };
77
- }
78
- let verified = knownVerified ?? null;
79
- if (verified === null) {
80
- const current = await readResourceLog({
81
- store,
82
- controller,
83
- expectedMethod,
84
- pinStore,
85
- logId
86
- });
87
- if (current === null) {
88
- return { sealed: false, verified: null };
89
- }
90
- verified = current.verified;
91
- }
92
- if (verified.headAnchorIndex !== null &&
93
- verified.headAnchorIndex >= removalIndex) {
94
- return { sealed: false, verified };
95
- }
96
- const confirmed = await appendResourceLog({
97
- store,
98
- controller,
99
- expectedMethod,
100
- pinStore,
101
- logId,
102
- signer,
103
- // The rebase hook doubles as the convergence check: a concurrent writer
104
- // whose entry already anchors past the removal sealed the log for us.
105
- buildState: rebased => rebased.headAnchorIndex !== null &&
106
- rebased.headAnchorIndex >= removalIndex
107
- ? null
108
- : rebased.head.state,
109
- ...(versionTime === undefined ? {} : { versionTime })
110
- });
111
- return { sealed: true, verified: confirmed };
112
- }
113
- //# sourceMappingURL=seal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seal.js","sourceRoot":"","sources":["../../src/resourceLog/seal.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAMhE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,EAChD,UAAU,EAGX;IACC,IAAI,YAAY,GAAG,CAAC,CAAA;IACpB,IAAI,QAAQ,GAAuB,IAAI,CAAA;IACvC,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;QACjE,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;QACxD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;gBAC3B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBACnB,YAAY,GAAG,KAAK,CAAA;oBACpB,MAAK;gBACP,CAAC;YACH,CAAC;QACH,CAAC;QACD,QAAQ,GAAG,IAAI,CAAA;IACjB,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,EACpC,KAAK,EACL,UAAU,EACV,cAAc,EACd,QAAQ,EACR,KAAK,EACL,MAAM,EACN,WAAW,EACX,QAAQ,EAAE,aAAa,EAUxB;IACC,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;IAC1C,CAAC;IACD,MAAM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AAE,QAAQ,EAAE,SAAS,EAAE,CAAA;AAC9C,CAAC"}
@@ -1,96 +0,0 @@
1
- import type { ResourceLogEntry } from '@interop/was-client/log';
2
- import type { ResourceLogController } from './controller.js';
3
- import type { ResourceLogHeadPin } from './pin.js';
4
- /**
5
- * What full verification resolves to. `state` is the profile's definition of
6
- * the resource's current state -- the verified head entry's `state` -- and
7
- * `pin` is the record the caller must store as its new chain-head pin.
8
- * `terminal` is the head's `nextLog` when the log is closed by a handover
9
- * entry (appends must be refused), `previousLog` the genesis back-reference
10
- * when this log is a handover successor. `headAnchorIndex` is the head's
11
- * effective anchor -- the verifier's anchor floor after the whole loop, which
12
- * monotonicity makes the head entry's own anchor -- as an index into the
13
- * controller's `versionIds` (`null` on an unversioned controller, whose
14
- * entries carry no anchors); the sealing sweep compares it against the
15
- * controller's latest membership change.
16
- */
17
- export interface VerifiedResourceLog {
18
- entries: ResourceLogEntry[];
19
- method: string;
20
- scid: string;
21
- head: ResourceLogEntry;
22
- state: ResourceLogEntry['state'];
23
- pin: ResourceLogHeadPin;
24
- headAnchorIndex: number | null;
25
- terminal: {
26
- method: string;
27
- scid: string;
28
- } | null;
29
- previousLog: {
30
- scid: string;
31
- head: string;
32
- } | null;
33
- }
34
- /**
35
- * Whether an entry is a terminal handover entry: its `parameters` carry a
36
- * `nextLog` member. Position, exact member set, and state equality are the
37
- * verifier's checks; this is only the discriminant.
38
- *
39
- * @param entry {ResourceLogEntry}
40
- * @returns {boolean}
41
- */
42
- export declare function isTerminalResourceLogEntry(entry: ResourceLogEntry): boolean;
43
- /**
44
- * Runs the profile's full verification over a parsed log, in order: parse
45
- * shape, genesis (SCID recomputation, format identifier), chain-hash
46
- * recomputation, per-entry proofs, the external-authorization rule with
47
- * anchor monotonicity, termination, and continuity against the chain-head
48
- * pin. Throws {@link ResourceLogIntegrityError} on fabrication-class
49
- * failures, {@link ResourceLogContinuityError} on pin conflicts, and
50
- * `ResourceLogLicenseError` on a ladder-signed append outside the
51
- * ceremony-tail license; any failure rejects the whole log.
52
- *
53
- * The controller view is the independently verified controller document --
54
- * never material served beside the log. An unversioned controller (empty
55
- * `versionIds`) degrades every anchor rule to current-document verification
56
- * and requires anchorless proofs.
57
- *
58
- * @param options {object}
59
- * @param options.entries {ResourceLogEntry[]} the parsed served log
60
- * @param options.controller {ResourceLogController} the verified controller
61
- * view ({@link webvhResourceLogController})
62
- * @param options.expectedMethod {string} the format identifier this caller
63
- * expects (`RESOURCE_LOG_METHOD`; also confirmed against any `history`
64
- * dispatch hint the caller followed)
65
- * @param [options.pin] {ResourceLogHeadPin} the held chain-head pin, when
66
- * this client has verified the log before
67
- * @returns {Promise<VerifiedResourceLog>}
68
- */
69
- export declare function verifyResourceLog({ entries, controller, expectedMethod, pin }: {
70
- entries: ResourceLogEntry[];
71
- controller: ResourceLogController;
72
- expectedMethod: string;
73
- pin?: ResourceLogHeadPin | null;
74
- }): Promise<VerifiedResourceLog>;
75
- /**
76
- * Verifies a handover link from both sides: the prior log's terminal entry
77
- * and the successor log's genesis back-reference. Both logs must already have
78
- * passed {@link verifyResourceLog}. Checks: the terminal `nextLog` names the
79
- * successor's SCID and method; the successor's `previousLog` names the prior
80
- * log's SCID; and the successor's `previousLog.head` is the `versionId` of
81
- * the terminal entry's immediate predecessor -- the terminal entry chains
82
- * directly off the head the successor references. A verified handover is the
83
- * one transition that replaces a chain-head pin wholesale (the caller stores
84
- * `successor.pin`).
85
- *
86
- * @param options {object}
87
- * @param options.prior {VerifiedResourceLog} the closed log
88
- * @param options.successor {VerifiedResourceLog} the log its terminal entry
89
- * names
90
- * @returns {void}
91
- */
92
- export declare function verifyResourceLogHandover({ prior, successor }: {
93
- prior: VerifiedResourceLog;
94
- successor: VerifiedResourceLog;
95
- }): void;
96
- //# sourceMappingURL=verify.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/resourceLog/verify.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,gBA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