@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
@@ -0,0 +1,46 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * Opens a VCALM interaction URL end to end: resolves its protocols map, begins
6
+ * the exchange it names, and hands back the Verifiable Presentation Request the
7
+ * exchange is actually asking for. This is the answering wallet's counterpart
8
+ * of `createEphemeralExchange` (`ephemeralExchange.ts`): a requester stores a
9
+ * VPR on an ephemeral exchange and prints the interaction URL; this opens it.
10
+ *
11
+ * Classification is deliberately not done here. The caller runs its own
12
+ * `classifyRequest` over the returned `request` -- freewallet's App
13
+ * Connect-aware classifier must refuse an `AppConnectQuery` that arrives with
14
+ * no attested origin, and the shared classifier here would silently filter it
15
+ * out instead.
16
+ */
17
+ import { fetchInteractionProtocols, isInteractionUrl, parseInteractionUrl } from './interactionUrl.js';
18
+ import { startExchange, vcApiExchangeUrl } from './exchangeClient.js';
19
+ /**
20
+ * Resolves an interaction URL to the Verifiable Presentation Request it names.
21
+ * Throws a plain `Error` when the text is not an interaction URL, or when the
22
+ * resolved protocols map names no usable exchange (`interact` or `vcapi`); a
23
+ * `404` on either the protocols fetch or the exchange's begin POST surfaces as
24
+ * {@link EphemeralExchangeGoneError} (dispatch on `err.name`), since either
25
+ * one means the exchange expired or the link is wrong.
26
+ *
27
+ * @param options {object}
28
+ * @param options.url {string}
29
+ * @param [options.fetch] {FetchLike}
30
+ * @returns {Promise<{ interactionUrl: string, exchangeUrl: string, request: IVPRDetails }>}
31
+ */
32
+ export async function openInteractionRequest({ url, fetch = globalThis.fetch }) {
33
+ if (!isInteractionUrl(url)) {
34
+ throw new Error(`Not an interaction URL: ${url}`);
35
+ }
36
+ const interactionUrl = parseInteractionUrl(url);
37
+ const protocols = await fetchInteractionProtocols(interactionUrl, { fetch });
38
+ const exchangeUrl = vcApiExchangeUrl({ protocols });
39
+ if (!exchangeUrl) {
40
+ throw new Error(`The interaction URL's protocols map names no usable exchange ` +
41
+ `("interact" or "vcapi"): ${interactionUrl}`);
42
+ }
43
+ const request = await startExchange({ exchangeUrl, fetch });
44
+ return { interactionUrl, exchangeUrl, request };
45
+ }
46
+ //# sourceMappingURL=interactionRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactionRequest.js","sourceRoot":"","sources":["../../src/request/interactionRequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGrE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,GAAG,EACH,KAAK,GAAG,UAAU,CAAC,KAAK,EAIzB;IAKC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC,CAAA;IACnD,CAAC;IACD,MAAM,cAAc,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAA;IAC/C,MAAM,SAAS,GAAG,MAAM,yBAAyB,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC5E,MAAM,WAAW,GAAG,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;IACnD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,+DAA+D;YAC7D,4BAA4B,cAAc,EAAE,CAC/C,CAAA;IACH,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;IAC3D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,CAAA;AACjD,CAAC"}
@@ -1,16 +1,3 @@
1
- /*!
2
- * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
- */
4
- /**
5
- * VCALM `interaction:` URL handling: detecting an interaction URL, normalizing
6
- * it to its inner HTTPS URL, and fetching the protocols map it advertises. An
7
- * interaction URL is a level of indirection a verifier / issuer hands the wallet
8
- * (over a deep link or QR code) that resolves to a `protocols` map naming the
9
- * real exchange endpoints.
10
- *
11
- * Ported verbatim from DCW's `app/lib/interactionUrl.ts`, with the network
12
- * transport injected ({@link FetchLike}, default `globalThis.fetch`).
13
- */
14
1
  import type { FetchLike } from './types.js';
15
2
  /**
16
3
  * Detects whether a URL is a VCALM interaction URL.
@@ -40,7 +27,9 @@ export declare function parseInteractionUrl(url: string): string;
40
27
  * Fetches the interaction protocols response from a VCALM interaction URL. Sends
41
28
  * GET with `Accept: application/json` per the VCALM spec, and returns the
42
29
  * protocols map. Logs a warning if the `iuv` param value is not `1`; throws if
43
- * the response is not ok or the `protocols` key is missing.
30
+ * the response is not ok or the `protocols` key is missing. A `404` is reported
31
+ * as {@link EphemeralExchangeGoneError} (dispatch on `err.name`): the
32
+ * interaction URL points at an exchange that expired or was never there.
44
33
  *
45
34
  * @param interactionUrl {string}
46
35
  * @param [options] {object}
@@ -1 +1 @@
1
- {"version":3,"file":"interactionUrl.d.ts","sourceRoot":"","sources":["../../src/request/interactionUrl.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAI3C;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAUrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWvD;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,yBAAyB,CAC7C,cAAc,EAAE,MAAM,EACtB,EAAE,KAAwB,EAAE,GAAE;IAAE,KAAK,CAAC,EAAE,SAAS,CAAA;CAAO,GACvD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA+BjC"}
1
+ {"version":3,"file":"interactionUrl.d.ts","sourceRoot":"","sources":["../../src/request/interactionUrl.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAI3C;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAUrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWvD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,yBAAyB,CAC7C,cAAc,EAAE,MAAM,EACtB,EAAE,KAAwB,EAAE,GAAE;IAAE,KAAK,CAAC,EAAE,SAAS,CAAA;CAAO,GACvD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAoCjC"}
@@ -1,3 +1,17 @@
1
+ /*!
2
+ * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
+ */
4
+ /**
5
+ * VCALM `interaction:` URL handling: detecting an interaction URL, normalizing
6
+ * it to its inner HTTPS URL, and fetching the protocols map it advertises. An
7
+ * interaction URL is a level of indirection a verifier / issuer hands the wallet
8
+ * (over a deep link or QR code) that resolves to a `protocols` map naming the
9
+ * real exchange endpoints.
10
+ *
11
+ * Ported verbatim from DCW's `app/lib/interactionUrl.ts`, with the network
12
+ * transport injected ({@link FetchLike}, default `globalThis.fetch`).
13
+ */
14
+ import { EphemeralExchangeGoneError } from './ephemeralExchange.js';
1
15
  const INTERACTION_SCHEME_PREFIX = 'interaction:';
2
16
  /**
3
17
  * Detects whether a URL is a VCALM interaction URL.
@@ -49,7 +63,9 @@ export function parseInteractionUrl(url) {
49
63
  * Fetches the interaction protocols response from a VCALM interaction URL. Sends
50
64
  * GET with `Accept: application/json` per the VCALM spec, and returns the
51
65
  * protocols map. Logs a warning if the `iuv` param value is not `1`; throws if
52
- * the response is not ok or the `protocols` key is missing.
66
+ * the response is not ok or the `protocols` key is missing. A `404` is reported
67
+ * as {@link EphemeralExchangeGoneError} (dispatch on `err.name`): the
68
+ * interaction URL points at an exchange that expired or was never there.
53
69
  *
54
70
  * @param interactionUrl {string}
55
71
  * @param [options] {object}
@@ -71,6 +87,9 @@ export async function fetchInteractionProtocols(interactionUrl, { fetch = global
71
87
  const response = await fetch(interactionUrl, {
72
88
  headers: { Accept: 'application/json' }
73
89
  });
90
+ if (response.status === 404) {
91
+ throw new EphemeralExchangeGoneError(`The interaction URL ${interactionUrl} is no longer available.`);
92
+ }
74
93
  if (!response.ok) {
75
94
  throw new Error(`Interaction URL fetch failed: ${response.status} ${response.statusText}`);
76
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interactionUrl.js","sourceRoot":"","sources":["../../src/request/interactionUrl.ts"],"names":[],"mappings":"AAeA,MAAM,yBAAyB,GAAG,cAAc,CAAA;AAEhD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,IAAI,GAAG,CAAC,UAAU,CAAC,yBAAyB,CAAC,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3B,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,yBAAyB,CAAC,EAAE,CAAC;QAC/C,OAAO,G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c) 2026 Interop Alliance. All rights reserved.
3
3
  */
4
4
  /**
5
- * The controller-document view a resource-log verifier authorizes against:
6
- * the profile's root of authority, resolved and verified by the reader
7
- * independently of the host serving the log. The interface is the seam --
8
- * verification consumes only the account DID, the ordered controller-log
9
- * version list, per-version `assertionMethod` membership, and the
10
- * per-version credential-posture view the ceremony-tail license reads -- and
11
- * the
12
- * did:webvh adapter builds it from an already-verified account log (the
13
- * `verifyAccountLog` output), answering anchored-version lookups from that
14
- * verified history rather than from any wire fetch. Handing the verifier a
15
- * view instead of a resolver is what enforces the profile's rule that
16
- * controller-document material never comes from the channel the log came
17
- * from.
5
+ * The did:webvh side of `@interop/vh-resource-log`'s controller port: the
6
+ * wallet-core EXTENDED controller view -- the library's generic port plus the
7
+ * per-version credential-inventory accessor the ceremony-tail license reads,
8
+ * plus the library's `admitAppend` admission hook made mandatory and
9
+ * carrying that license -- and the adapter that builds it from an
10
+ * already-verified account log (the `verifyAccountLog` output), answering
11
+ * version lookups from that verified history rather than from any wire
12
+ * fetch. Handing the verifier a view instead of a resolver is what
13
+ * enforces the profile's rule that controller-document material never comes
14
+ * from the channel the log came from; supplying the hook is the obligation
15
+ * the library's port states for any controller document that can list
16
+ * ladder-shaped verification methods -- a bare view does not lack ladder
17
+ * keys, it lacks the ability to recognize them.
18
18
  */
19
19
  import type { DIDLog } from '@interop/did-method-webvh';
20
+ import { type ResourceLogController } from '@interop/vh-resource-log';
20
21
  /**
21
- * The credential-posture view at one controller-log version, consumed by the
22
+ * The credential-inventory view at one controller-log version, consumed by the
22
23
  * ceremony-tail license on ladder-signed appends (clause B of the ladder
23
24
  * VM's authority clauses). `ladderKeys` holds the ladder VMs' signing-key
24
25
  * multibases, recognized by relation asymmetry -- a `capabilityDelegation`
25
26
  * member absent from `capabilityInvocation` is the ladder VM -- and is how a
26
27
  * verifier tells a ladder-signed proof from an enrolled client's.
27
- * `postureKeys` is S(V), the credential-posture key set: the `keyAgreement`
28
+ * `inventoryKeys` is S(V), the credential-inventory key set: the `keyAgreement`
28
29
  * methods whose `controller` is the account DID (the deliberately unmarked
29
30
  * credential entries -- verbatim `Multikey` keys and `MultikeyCommitment`
30
31
  * commitments alike, keyed by their key material), union the ladder VMs. A
31
- * document entry is posture-changing iff S(V) differs from S(V-1) in either
32
+ * document entry is inventory-changing iff S(V) differs from S(V-1) in either
32
33
  * direction; ordinary client enrollment and revocation are excluded
33
34
  * structurally, because a client's `keyAgreement` twin carries the `did:key`
34
35
  * controller marker rather than the account DID.
35
36
  */
36
- export interface ControllerPosture {
37
+ export interface ControllerInventory {
37
38
  ladderKeys: Set<string>;
38
- postureKeys: Set<string>;
39
+ inventoryKeys: Set<string>;
39
40
  }
40
41
  /**
41
- * What log verification consumes of the independently verified controller
42
- * document: the DID the entry proofs must sign under, the verified controller
43
- * log's `versionId` list in order (empty for an unversioned static
44
- * controller, degrading every anchor rule to current-document verification),
45
- * the set of `assertionMethod` key multibases at a given version --
46
- * membership there is the whole authorization rule, so `keyAgreement`-only
47
- * recovery keys and `authentication`-only convenience keys are excluded
48
- * structurally -- and the credential-posture view at a given version, which
49
- * is what evaluating the ceremony-tail license and recognizing a
50
- * ladder-signed append require (both invisible through the
51
- * `assertionMethod` accessor alone).
42
+ * The wallet-core extended controller view: the library's generic port plus
43
+ * the credential-inventory accessor at a given version, which is what
44
+ * evaluating the ceremony-tail license and recognizing a ladder-signed
45
+ * append require (both invisible through the `assertionMethod` accessor
46
+ * alone), plus the library's optional `admitAppend` admission hook made
47
+ * mandatory -- an account did:webvh document can list ladder VMs, so a view
48
+ * over one must carry the license (the port's stated obligation). The
49
+ * pre-append license check in the log-governed descriptor store calls
50
+ * `inventoryAt` directly, which is why the accessor stays on the type
51
+ * beside the hook: a verify-time refusal alone would poison the served log
52
+ * for every reader.
52
53
  */
53
- export interface ResourceLogController {
54
- did: string;
55
- versionIds: string[];
56
- /**
57
- * Resolves the `assertionMethod` public-key multibases at a controller-log
58
- * version (`undefined`: the current document, the unversioned-controller
59
- * degradation).
60
- *
61
- * @param [versionId] {string}
62
- * @returns {Promise<Set<string>>}
63
- */
64
- assertionKeysAt(versionId?: string): Promise<Set<string>>;
54
+ export interface WebvhResourceLogController extends ResourceLogController {
65
55
  /**
66
- * Resolves the credential-posture view at a controller-log version
56
+ * Resolves the credential-inventory view at a controller-log version
67
57
  * (`undefined`: the current document): the ladder VM key multibases and
68
- * the posture set S(V) the ceremony-tail license compares across
58
+ * the inventory set S(V) the ceremony-tail license compares across
69
59
  * versions.
70
60
  *
71
61
  * @param [versionId] {string}
72
- * @returns {Promise<ControllerPosture>}
62
+ * @returns {Promise<ControllerInventory>}
73
63
  */
74
- postureAt(versionId?: string): Promise<ControllerPosture>;
64
+ inventoryAt(versionId?: string): Promise<ControllerInventory>;
65
+ admitAppend: NonNullable<ResourceLogController['admitAppend']>;
75
66
  }
76
67
  /**
77
68
  * Builds the controller view over an already-verified did:webvh account log
@@ -79,17 +70,25 @@ export interface ResourceLogController {
79
70
  * not verified against the account pointer). Because every verified entry
80
71
  * carries its resolved document in `state`, the per-version `assertionMethod`
81
72
  * sets are read straight off those entries in one linear pass over the log
82
- * rather than replaying resolution once per version. An anchored lookup at a
83
- * version the log does not carry refuses instead of guessing, and `undefined`
73
+ * rather than replaying resolution once per version. A lookup at a version
74
+ * the log does not carry refuses instead of guessing, and `undefined`
84
75
  * answers from the last entry (the current document).
85
76
  *
77
+ * The returned view carries the `admitAppend` hook: it resolves the
78
+ * inventory at the proof's controller versionId, and where the signing key
79
+ * is a ladder VM there it runs the ceremony-tail license
80
+ * (`assertLadderAppendLicensed`) --
81
+ * so ordinary client-signed appends admit untouched, and a ladder-signed
82
+ * append outside the license refuses with `ResourceLogLicenseError`,
83
+ * propagated with its class intact by the library's verifier.
84
+ *
86
85
  * @param options {object}
87
86
  * @param options.did {string} the account's did:webvh, as verified
88
87
  * @param options.log {DIDLog} the verified account log
89
- * @returns {ResourceLogController}
88
+ * @returns {WebvhResourceLogController}
90
89
  */
91
90
  export declare function webvhResourceLogController({ did, log }: {
92
91
  did: string;
93
92
  log: DIDLog;
94
- }): ResourceLogController;
93
+ }): WebvhResourceLogController;
95
94
  //# sourceMappingURL=controller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/resourceLog/controller.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAGvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB;;;;;;;OAOG;IACH,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACzD;;;;;;;;OAQG;IACH,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;CAC1D;AA6ID;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,qBAAqB,CAwCxB"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/resourceLog/controller.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAA;AAGjC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACvE;;;;;;;;OAQG;IACH,WAAW,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC7D,WAAW,EAAE,WAAW,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAAA;CAC/D;AAgJD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,0BAA0B,CAwD7B"}
@@ -1,4 +1,5 @@
1
- import { ResourceLogIntegrityError } from './errors.js';
1
+ import { ResourceLogIntegrityError } from '@interop/vh-resource-log';
2
+ import { assertLadderAppendLicensed } from './license.js';
2
3
  /**
3
4
  * Resolves one relation entry: an embedded verification method verbatim, a
4
5
  * string reference through the given `verificationMethod` index.
@@ -55,21 +56,21 @@ function assertionKeysOf(doc) {
55
56
  return keys;
56
57
  }
57
58
  /**
58
- * Collects a document's credential-posture view (see
59
- * {@link ControllerPosture}): the ladder VMs by relation asymmetry
59
+ * Collects a document's credential-inventory view (see
60
+ * {@link ControllerInventory}): the ladder VMs by relation asymmetry
60
61
  * (`capabilityDelegation` members absent from `capabilityInvocation`,
61
62
  * compared by verification-method id), and S(V) as the account-controlled
62
63
  * `keyAgreement` methods' key material -- `publicKeyCommitment` where the
63
64
  * entry is a commitment, `publicKeyMultibase` where it is verbatim (the two
64
65
  * value spaces are disjoint) -- union the ladder keys. A `keyAgreement`
65
66
  * method carrying neither is skipped: an unidentifiable entry must not make
66
- * two distinct postures compare equal.
67
+ * two distinct inventories compare equal.
67
68
  *
68
69
  * @param doc {ControllerDocument}
69
- * @param did {string} the account DID posture entries are controlled by
70
- * @returns {ControllerPosture}
70
+ * @param did {string} the account DID inventory entries are controlled by
71
+ * @returns {ControllerInventory}
71
72
  */
72
- function postureOf(doc, did) {
73
+ function inventoryOf(doc, did) {
73
74
  const byId = methodsById(doc);
74
75
  const invocable = new Set();
75
76
  for (const entry of doc.capabilityInvocation ?? []) {
@@ -89,20 +90,20 @@ function postureOf(doc, did) {
89
90
  ladderKeys.add(method.publicKeyMultibase);
90
91
  }
91
92
  }
92
- const postureKeys = new Set(ladderKeys);
93
+ const inventoryKeys = new Set(ladderKeys);
93
94
  for (const entry of doc.keyAgreement ?? []) {
94
95
  const method = resolveMethod(entry, byId);
95
96
  if (!method || method.controller !== did) {
96
97
  continue;
97
98
  }
98
99
  if (typeof method.publicKeyCommitment === 'string') {
99
- postureKeys.add(method.publicKeyCommitment);
100
+ inventoryKeys.add(method.publicKeyCommitment);
100
101
  }
101
102
  else if (typeof method.publicKeyMultibase === 'string') {
102
- postureKeys.add(method.publicKeyMultibase);
103
+ inventoryKeys.add(method.publicKeyMultibase);
103
104
  }
104
105
  }
105
- return { ladderKeys, postureKeys };
106
+ return { ladderKeys, inventoryKeys };
106
107
  }
107
108
  /**
108
109
  * Builds the controller view over an already-verified did:webvh account log
@@ -110,30 +111,38 @@ function postureOf(doc, did) {
110
111
  * not verified against the account pointer). Because every verified entry
111
112
  * carries its resolved document in `state`, the per-version `assertionMethod`
112
113
  * sets are read straight off those entries in one linear pass over the log
113
- * rather than replaying resolution once per version. An anchored lookup at a
114
- * version the log does not carry refuses instead of guessing, and `undefined`
114
+ * rather than replaying resolution once per version. A lookup at a version
115
+ * the log does not carry refuses instead of guessing, and `undefined`
115
116
  * answers from the last entry (the current document).
116
117
  *
118
+ * The returned view carries the `admitAppend` hook: it resolves the
119
+ * inventory at the proof's controller versionId, and where the signing key
120
+ * is a ladder VM there it runs the ceremony-tail license
121
+ * (`assertLadderAppendLicensed`) --
122
+ * so ordinary client-signed appends admit untouched, and a ladder-signed
123
+ * append outside the license refuses with `ResourceLogLicenseError`,
124
+ * propagated with its class intact by the library's verifier.
125
+ *
117
126
  * @param options {object}
118
127
  * @param options.did {string} the account's did:webvh, as verified
119
128
  * @param options.log {DIDLog} the verified account log
120
- * @returns {ResourceLogController}
129
+ * @returns {WebvhResourceLogController}
121
130
  */
122
131
  export function webvhResourceLogController({ did, log }) {
123
132
  const versionIds = log.map(entry => entry.versionId);
124
133
  const keysByVersion = new Map();
125
- const postureByVersion = new Map();
134
+ const inventoryByVersion = new Map();
126
135
  for (const entry of log) {
127
136
  const doc = entry.state;
128
137
  keysByVersion.set(entry.versionId, assertionKeysOf(doc));
129
- postureByVersion.set(entry.versionId, postureOf(doc, did));
138
+ inventoryByVersion.set(entry.versionId, inventoryOf(doc, did));
130
139
  }
131
140
  const head = log.length === 0 ? undefined : log[log.length - 1];
132
141
  function versionRefusal(versionId) {
133
142
  return new ResourceLogIntegrityError(`The controller document did not resolve at version ` +
134
143
  `"${versionId ?? '<head>'}" (no document returned).`);
135
144
  }
136
- return {
145
+ const view = {
137
146
  did,
138
147
  versionIds,
139
148
  assertionKeysAt(versionId) {
@@ -145,15 +154,26 @@ export function webvhResourceLogController({ did, log }) {
145
154
  }
146
155
  return Promise.resolve(resolved);
147
156
  },
148
- postureAt(versionId) {
157
+ inventoryAt(versionId) {
149
158
  const resolved = versionId === undefined
150
- ? head && postureByVersion.get(head.versionId)
151
- : postureByVersion.get(versionId);
159
+ ? head && inventoryByVersion.get(head.versionId)
160
+ : inventoryByVersion.get(versionId);
152
161
  if (!resolved) {
153
162
  return Promise.reject(versionRefusal(versionId));
154
163
  }
155
164
  return Promise.resolve(resolved);
165
+ },
166
+ async admitAppend({ keyMultibase, controllerVersionId, controllerVersionIndex, headControllerVersionIndex }) {
167
+ const inventory = await view.inventoryAt(controllerVersionId);
168
+ if (inventory.ladderKeys.has(keyMultibase)) {
169
+ await assertLadderAppendLicensed({
170
+ controller: view,
171
+ controllerVersionIndex,
172
+ headControllerVersionIndex
173
+ });
174
+ }
156
175
  }
157
176
  };
177
+ return view;
158
178
  }
159
179
  //# sourceMappingURL=controller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/resourceLog/controller.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAmFvD;;;;;;;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,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;GAMG;AACH,SAAS,YAAY,CACnB,KAA4C;IAE5C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAA;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,eAAe,CAAC,GAAuB;IAC9C,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;IAC7B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,eAAe,IAAI,EAAE,EAAE,CAAC;QAC9C,MAAM,MAA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H,CAAC;KACF,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -2,73 +2,24 @@
2
2
  * Copyright (c) 2026 Interop Alliance. All rights reserved.
3
3
  */
4
4
  /**
5
- * The resource-log refusal taxonomy, carried over from the roster's WC-1
6
- * detached-signature design onto the log design. Two adversarial classes plus
7
- * two admission refusals:
8
- *
9
- * - {@link ResourceLogIntegrityError} -- fabrication: the served log fails
10
- * verification on its own terms (parse shape, SCID, chain hashes, proofs,
11
- * or the external-authorization rule). Whoever produced it could not make a
12
- * log the account's clients would have made.
13
- * - {@link ResourceLogContinuityError} -- a served log that verifies but
14
- * conflicts with what this client has already accepted: a rollback behind
15
- * the chain-head pin, a fork off the pinned history, or an SCID/method
16
- * switch outside a verified handover. The log may be internally consistent;
17
- * it is not the continuation of the history this client pinned.
18
- * - {@link ResourceLogClosedError} -- an append refused because the verified
19
- * head is a terminal handover entry. Not an attack: the log's own authors
20
- * closed it, and a verifier of this profile must refuse to extend a closed
21
- * log even though nothing currently emits terminal entries.
22
- * - {@link ResourceLogLicenseError} -- a ladder-signed append outside the
23
- * ceremony-tail license. An admission refusal, not log corruption: the
24
- * append (attempted, or already served) is not licensed, and the same
25
- * append can become licensed after a posture-changing controller-document
26
- * entry -- callers must not treat it with the reject-the-whole-log
27
- * severity of the integrity class.
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).
28
14
  */
29
- /**
30
- * A served log failed verification: malformed entries, a non-verifying SCID,
31
- * a broken hash chain, a failing proof, or a signer the controller document
32
- * does not back at the entry's anchored version. Fabrication-class: refused
33
- * as something no enrolled client produced.
34
- */
35
- export declare class ResourceLogIntegrityError extends Error {
36
- constructor(message: string, options?: {
37
- cause?: unknown;
38
- });
39
- }
40
- /**
41
- * A served log conflicts with this client's chain-head pin: `rollback` (the
42
- * served head is behind the pinned head -- possibly replication lag; the pin
43
- * is never regressed and the caller may retry), `fork` (the served log
44
- * diverges from the pinned history -- both logs are transferable evidence of
45
- * equivocation, so the served entries ride along), `scid-switch` /
46
- * `method-switch` (a different log identity or format under the pinned
47
- * location, outside a verified handover).
48
- */
49
- export declare class ResourceLogContinuityError extends Error {
50
- reason: 'rollback' | 'fork' | 'scid-switch' | 'method-switch';
51
- pinnedHead: string;
52
- /**
53
- * On a `fork`, the full served log retained as evidence: every entry is
54
- * signed, so a conflicting pair of logs under one SCID is transferable,
55
- * independently verifiable proof of equivocation.
56
- */
57
- servedEntries?: unknown[];
58
- constructor({ reason, pinnedHead, servedEntries }: {
59
- reason: 'rollback' | 'fork' | 'scid-switch' | 'method-switch';
60
- pinnedHead: string;
61
- servedEntries?: unknown[];
62
- });
63
- }
64
15
  /**
65
16
  * A ladder-signed append outside the ceremony-tail license: it is not the
66
- * log's first entry, and it does not anchor at a posture-changing controller
67
- * document version no verified entry already anchors at or past. Above all
17
+ * log's first entry, and it does not carry an inventory-changing controller
18
+ * document version no verified entry already carries at or past. Above all
68
19
  * this refuses the silent-rekey shape -- a ladder-signed rotation against an
69
20
  * unchanged document. Write-time admission class: the log is not corrupt and
70
21
  * whoever signed the append genuinely holds the credential; the append is
71
- * merely unlicensed, and a retry after a posture-changing document entry may
22
+ * merely unlicensed, and a retry after a inventory-changing document entry may
72
23
  * succeed.
73
24
  */
74
25
  export declare class ResourceLogLicenseError extends Error {
@@ -76,21 +27,4 @@ export declare class ResourceLogLicenseError extends Error {
76
27
  cause?: unknown;
77
28
  });
78
29
  }
79
- /**
80
- * An append was refused because the log's verified head is a terminal
81
- * handover entry: the log is closed and names a successor, and this profile
82
- * forbids extending a history its authors have closed.
83
- */
84
- export declare class ResourceLogClosedError extends Error {
85
- nextLog: {
86
- method: string;
87
- scid: string;
88
- };
89
- constructor({ nextLog }: {
90
- nextLog: {
91
- method: string;
92
- scid: string;
93
- };
94
- });
95
- }
96
30
  //# 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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,aAAa,GAAG,eAAe,CAAA;IAC7D,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,EAAE,CAAA;gBACb,EACV,MAAM,EACN,UAAU,EACV,aAAa,EACd,EAAE;QACD,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,aAAa,GAAG,eAAe,CAAA;QAC7D,UAAU,EAAE,MAAM,CAAA;QAClB,aAAa,CAAC,EAAE,OAAO,EAAE,CAAA;KAC1B;CAUF;AAED;;;;;;;;;GASG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI3D;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;gBAC7B,EAAE,OAAO,EAAE,EAAE;QAAE,O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