@noy-db/hub 0.2.0-pre.15 → 0.2.0-pre.16

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 (197) hide show
  1. package/dist/aggregate/index.cjs +106 -10
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +2 -2
  4. package/dist/aggregate/index.d.ts +2 -2
  5. package/dist/aggregate/index.js +1 -1
  6. package/dist/attestation/index.cjs.map +1 -1
  7. package/dist/attestation/index.d.cts +3 -3
  8. package/dist/attestation/index.d.ts +3 -3
  9. package/dist/attestation/index.js +4 -4
  10. package/dist/blobs/index.cjs.map +1 -1
  11. package/dist/blobs/index.d.cts +4 -4
  12. package/dist/blobs/index.d.ts +4 -4
  13. package/dist/blobs/index.js +3 -3
  14. package/dist/bundle/index.cjs +181 -46
  15. package/dist/bundle/index.cjs.map +1 -1
  16. package/dist/bundle/index.d.cts +5 -5
  17. package/dist/bundle/index.d.ts +5 -5
  18. package/dist/bundle/index.js +7 -7
  19. package/dist/{chunk-BIYRQQV6.js → chunk-3YWP3WBP.js} +3 -3
  20. package/dist/{chunk-VU7SWWT5.js → chunk-42FEUPZQ.js} +10 -6
  21. package/dist/chunk-42FEUPZQ.js.map +1 -0
  22. package/dist/{chunk-7EFFHEN5.js → chunk-667MB6AH.js} +118 -47
  23. package/dist/chunk-667MB6AH.js.map +1 -0
  24. package/dist/{chunk-A5ZOOZFB.js → chunk-6H2ZUNR7.js} +2 -2
  25. package/dist/{chunk-7HT2MEZ5.js → chunk-7BQ4QWYX.js} +3 -3
  26. package/dist/{chunk-DQU36Q7I.js → chunk-7Z7KSVA5.js} +13 -4
  27. package/dist/chunk-7Z7KSVA5.js.map +1 -0
  28. package/dist/{chunk-WBAYSNUQ.js → chunk-BI6ETQPF.js} +2 -2
  29. package/dist/{chunk-56DJ7JVK.js → chunk-BR3AMFGS.js} +2 -2
  30. package/dist/{chunk-COFPAMX6.js → chunk-DLZ2ONOD.js} +3 -3
  31. package/dist/{chunk-EYVQHAGH.js → chunk-DUREQF5W.js} +2 -2
  32. package/dist/{chunk-PE4AQGFH.js → chunk-E2CDVKMH.js} +3 -3
  33. package/dist/{chunk-GC4V7RU7.js → chunk-F3BPIPLS.js} +1 -1
  34. package/dist/{chunk-GC4V7RU7.js.map → chunk-F3BPIPLS.js.map} +1 -1
  35. package/dist/{chunk-L2FE64BU.js → chunk-FFXM3ZIF.js} +2 -2
  36. package/dist/{chunk-5LQG6ZO2.js → chunk-G4SCICH5.js} +8 -3
  37. package/dist/chunk-G4SCICH5.js.map +1 -0
  38. package/dist/{chunk-WGHU7BLI.js → chunk-GNI5STXQ.js} +2 -2
  39. package/dist/{chunk-C5T5AFWN.js → chunk-HBXJ37ZY.js} +11 -5
  40. package/dist/chunk-HBXJ37ZY.js.map +1 -0
  41. package/dist/{chunk-7PS7EOCF.js → chunk-IXBIFDEW.js} +2 -2
  42. package/dist/{chunk-LX3CB26H.js → chunk-KABJXG2F.js} +2 -2
  43. package/dist/{chunk-3EWXMOK3.js → chunk-L2BNJ6HM.js} +26 -11
  44. package/dist/chunk-L2BNJ6HM.js.map +1 -0
  45. package/dist/{chunk-DKO2QFSA.js → chunk-OB2ZJQ2D.js} +2 -2
  46. package/dist/{chunk-KIP6JLTF.js → chunk-OMAMZKKD.js} +2 -2
  47. package/dist/{chunk-EGD5DXFT.js → chunk-OQSRJG6A.js} +13 -1
  48. package/dist/chunk-OQSRJG6A.js.map +1 -0
  49. package/dist/{chunk-KI6HAJWL.js → chunk-QSUK7YWK.js} +2 -2
  50. package/dist/{chunk-YHPM5D7Y.js → chunk-QVIEAYTP.js} +61 -2
  51. package/dist/chunk-QVIEAYTP.js.map +1 -0
  52. package/dist/{chunk-NSCVNK5K.js → chunk-SCJPI4Z5.js} +3 -3
  53. package/dist/{chunk-NU6Q3FOR.js → chunk-TKIY625R.js} +11 -1
  54. package/dist/{chunk-NU6Q3FOR.js.map → chunk-TKIY625R.js.map} +1 -1
  55. package/dist/{chunk-OHVFWCJP.js → chunk-VLMPU56Q.js} +48 -18
  56. package/dist/chunk-VLMPU56Q.js.map +1 -0
  57. package/dist/{chunk-6AJBSQU4.js → chunk-XL35NSEN.js} +2 -2
  58. package/dist/consent/index.d.cts +4 -4
  59. package/dist/consent/index.d.ts +4 -4
  60. package/dist/derivations/index.cjs +24 -3
  61. package/dist/derivations/index.cjs.map +1 -1
  62. package/dist/derivations/index.d.cts +5 -5
  63. package/dist/derivations/index.d.ts +5 -5
  64. package/dist/derivations/index.js +2 -2
  65. package/dist/{dev-unlock-nVkuRLLe.d.cts → dev-unlock-8XzcD2Z4.d.cts} +1 -1
  66. package/dist/{dev-unlock-iAS8z9jc.d.ts → dev-unlock-DR3upLd1.d.ts} +1 -1
  67. package/dist/{executor-HSSRXDOB.js → executor-AZLS3KBK.js} +4 -4
  68. package/dist/{fanout-sidecar-N6OJX6QR.js → fanout-sidecar-67CMI3UT.js} +2 -2
  69. package/dist/guards/index.cjs +9 -5
  70. package/dist/guards/index.cjs.map +1 -1
  71. package/dist/guards/index.d.cts +5 -5
  72. package/dist/guards/index.d.ts +5 -5
  73. package/dist/guards/index.js +1 -1
  74. package/dist/{hash-DHOnRarj.d.ts → hash-CDjye9KV.d.ts} +1 -1
  75. package/dist/{hash-Cv6byZs7.d.cts → hash-DuQ88_5W.d.cts} +1 -1
  76. package/dist/history/index.cjs.map +1 -1
  77. package/dist/history/index.d.cts +5 -5
  78. package/dist/history/index.d.ts +5 -5
  79. package/dist/history/index.js +2 -2
  80. package/dist/i18n/index.cjs.map +1 -1
  81. package/dist/i18n/index.d.cts +4 -4
  82. package/dist/i18n/index.d.ts +4 -4
  83. package/dist/i18n/index.js +3 -3
  84. package/dist/{immutable-guard-yBEOYmif.d.cts → immutable-guard-CRPvu24K.d.cts} +16 -1
  85. package/dist/{immutable-guard-BehB1YGB.d.ts → immutable-guard-Dov3WvwF.d.ts} +16 -1
  86. package/dist/{index-D95VK1Qy.d.cts → index-C8Bk3-VF.d.cts} +1 -1
  87. package/dist/{index-XNB2r6bX.d.ts → index-nP99bXLg.d.ts} +1 -1
  88. package/dist/index.cjs +273 -52
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +13 -12
  91. package/dist/index.d.ts +13 -12
  92. package/dist/index.js +27 -25
  93. package/dist/index.js.map +1 -1
  94. package/dist/{issue-ADVS4OVP.js → issue-RZP3VI6O.js} +4 -4
  95. package/dist/{ledger-CWSE3BLF.js → ledger-A3LL253R.js} +3 -3
  96. package/dist/materialized-views/index.cjs +407 -5
  97. package/dist/materialized-views/index.cjs.map +1 -1
  98. package/dist/materialized-views/index.d.cts +5 -5
  99. package/dist/materialized-views/index.d.ts +5 -5
  100. package/dist/materialized-views/index.js +5 -5
  101. package/dist/noydb-WCMY2ZOW.js +35 -0
  102. package/dist/overlay-views/index.cjs +47 -17
  103. package/dist/overlay-views/index.cjs.map +1 -1
  104. package/dist/overlay-views/index.d.cts +26 -8
  105. package/dist/overlay-views/index.d.ts +26 -8
  106. package/dist/overlay-views/index.js +1 -1
  107. package/dist/periods/index.cjs.map +1 -1
  108. package/dist/periods/index.d.cts +4 -4
  109. package/dist/periods/index.d.ts +4 -4
  110. package/dist/periods/index.js +3 -3
  111. package/dist/{public-envelope-SYHEYQ3X.js → public-envelope-YP2UWMLG.js} +3 -3
  112. package/dist/query/index.cjs +24 -10
  113. package/dist/query/index.cjs.map +1 -1
  114. package/dist/query/index.d.cts +2 -2
  115. package/dist/query/index.d.ts +2 -2
  116. package/dist/query/index.js +2 -2
  117. package/dist/{registry-XGLNADIE.js → registry-EB6SISTA.js} +2 -2
  118. package/dist/{registry-DK5YWAAA.js → registry-UTA4CLQS.js} +2 -2
  119. package/dist/{revoke-ZDFKMR5E.js → revoke-HNMQZSCL.js} +4 -4
  120. package/dist/session/index.d.cts +5 -5
  121. package/dist/session/index.d.ts +5 -5
  122. package/dist/shadow/index.d.cts +4 -4
  123. package/dist/shadow/index.d.ts +4 -4
  124. package/dist/{signer-P5D7Y72U.js → signer-DCMNKXSF.js} +3 -3
  125. package/dist/snapshots/index.d.cts +4 -4
  126. package/dist/snapshots/index.d.ts +4 -4
  127. package/dist/snapshots/index.js +3 -3
  128. package/dist/{stale-JH67FU57.js → stale-W5PQTRYH.js} +2 -2
  129. package/dist/store/index.d.cts +4 -4
  130. package/dist/store/index.d.ts +4 -4
  131. package/dist/{strategy-CbneC7bS.d.ts → strategy-BtW8fAjz.d.cts} +1 -1
  132. package/dist/{strategy-CbneC7bS.d.cts → strategy-BtW8fAjz.d.ts} +1 -1
  133. package/dist/sync/index.cjs.map +1 -1
  134. package/dist/sync/index.d.cts +3 -3
  135. package/dist/sync/index.d.ts +3 -3
  136. package/dist/sync/index.js +2 -2
  137. package/dist/team/index.cjs.map +1 -1
  138. package/dist/team/index.d.cts +4 -4
  139. package/dist/team/index.d.ts +4 -4
  140. package/dist/team/index.js +5 -5
  141. package/dist/tx/index.cjs +66 -3
  142. package/dist/tx/index.cjs.map +1 -1
  143. package/dist/tx/index.d.cts +22 -6
  144. package/dist/tx/index.d.ts +22 -6
  145. package/dist/tx/index.js +7 -3
  146. package/dist/tx/index.js.map +1 -1
  147. package/dist/{types-BpPV5uyy.d.cts → types-Bze6vkwm.d.cts} +371 -139
  148. package/dist/{types-4t1-tWS4.d.ts → types-DrmBTscX.d.ts} +371 -139
  149. package/dist/{ulid-DAfenvFd.d.ts → ulid-DbBVrNSt.d.ts} +1 -1
  150. package/dist/{ulid-CiPrpGqm.d.cts → ulid-DfZlAh0u.d.cts} +1 -1
  151. package/dist/{vault-group-KOM7QRJG.js → vault-group-DX2HFQMX.js} +2 -2
  152. package/dist/{with-derivation-DBqJB3dQ.d.cts → with-derivation-CCqAchD5.d.cts} +1 -1
  153. package/dist/{with-derivation-OK9M2sJE.d.ts → with-derivation-_lySGdlm.d.ts} +1 -1
  154. package/dist/{with-materialized-view-NzuxYPDF.d.cts → with-materialized-view--4PsvMDu.d.cts} +1 -1
  155. package/dist/{with-materialized-view-Dt-ufPWQ.d.ts → with-materialized-view-QT1Tp7NO.d.ts} +1 -1
  156. package/dist/{with-overlayed-view-eDvMs6LO.d.ts → with-overlayed-view-BEXfpzSb.d.ts} +1 -1
  157. package/dist/{with-overlayed-view-CC0_ocy-.d.cts → with-overlayed-view-DlH5qmeB.d.cts} +1 -1
  158. package/package.json +3 -3
  159. package/dist/chunk-3EWXMOK3.js.map +0 -1
  160. package/dist/chunk-5LQG6ZO2.js.map +0 -1
  161. package/dist/chunk-7EFFHEN5.js.map +0 -1
  162. package/dist/chunk-C5T5AFWN.js.map +0 -1
  163. package/dist/chunk-DQU36Q7I.js.map +0 -1
  164. package/dist/chunk-EGD5DXFT.js.map +0 -1
  165. package/dist/chunk-OHVFWCJP.js.map +0 -1
  166. package/dist/chunk-VU7SWWT5.js.map +0 -1
  167. package/dist/chunk-YHPM5D7Y.js.map +0 -1
  168. package/dist/noydb-GZGFBA4E.js +0 -35
  169. /package/dist/{chunk-BIYRQQV6.js.map → chunk-3YWP3WBP.js.map} +0 -0
  170. /package/dist/{chunk-A5ZOOZFB.js.map → chunk-6H2ZUNR7.js.map} +0 -0
  171. /package/dist/{chunk-7HT2MEZ5.js.map → chunk-7BQ4QWYX.js.map} +0 -0
  172. /package/dist/{chunk-WBAYSNUQ.js.map → chunk-BI6ETQPF.js.map} +0 -0
  173. /package/dist/{chunk-56DJ7JVK.js.map → chunk-BR3AMFGS.js.map} +0 -0
  174. /package/dist/{chunk-COFPAMX6.js.map → chunk-DLZ2ONOD.js.map} +0 -0
  175. /package/dist/{chunk-EYVQHAGH.js.map → chunk-DUREQF5W.js.map} +0 -0
  176. /package/dist/{chunk-PE4AQGFH.js.map → chunk-E2CDVKMH.js.map} +0 -0
  177. /package/dist/{chunk-L2FE64BU.js.map → chunk-FFXM3ZIF.js.map} +0 -0
  178. /package/dist/{chunk-WGHU7BLI.js.map → chunk-GNI5STXQ.js.map} +0 -0
  179. /package/dist/{chunk-7PS7EOCF.js.map → chunk-IXBIFDEW.js.map} +0 -0
  180. /package/dist/{chunk-LX3CB26H.js.map → chunk-KABJXG2F.js.map} +0 -0
  181. /package/dist/{chunk-DKO2QFSA.js.map → chunk-OB2ZJQ2D.js.map} +0 -0
  182. /package/dist/{chunk-KIP6JLTF.js.map → chunk-OMAMZKKD.js.map} +0 -0
  183. /package/dist/{chunk-KI6HAJWL.js.map → chunk-QSUK7YWK.js.map} +0 -0
  184. /package/dist/{chunk-NSCVNK5K.js.map → chunk-SCJPI4Z5.js.map} +0 -0
  185. /package/dist/{chunk-6AJBSQU4.js.map → chunk-XL35NSEN.js.map} +0 -0
  186. /package/dist/{executor-HSSRXDOB.js.map → executor-AZLS3KBK.js.map} +0 -0
  187. /package/dist/{fanout-sidecar-N6OJX6QR.js.map → fanout-sidecar-67CMI3UT.js.map} +0 -0
  188. /package/dist/{issue-ADVS4OVP.js.map → issue-RZP3VI6O.js.map} +0 -0
  189. /package/dist/{ledger-CWSE3BLF.js.map → ledger-A3LL253R.js.map} +0 -0
  190. /package/dist/{noydb-GZGFBA4E.js.map → noydb-WCMY2ZOW.js.map} +0 -0
  191. /package/dist/{public-envelope-SYHEYQ3X.js.map → public-envelope-YP2UWMLG.js.map} +0 -0
  192. /package/dist/{registry-DK5YWAAA.js.map → registry-EB6SISTA.js.map} +0 -0
  193. /package/dist/{registry-XGLNADIE.js.map → registry-UTA4CLQS.js.map} +0 -0
  194. /package/dist/{revoke-ZDFKMR5E.js.map → revoke-HNMQZSCL.js.map} +0 -0
  195. /package/dist/{signer-P5D7Y72U.js.map → signer-DCMNKXSF.js.map} +0 -0
  196. /package/dist/{stale-JH67FU57.js.map → stale-W5PQTRYH.js.map} +0 -0
  197. /package/dist/{vault-group-KOM7QRJG.js.map → vault-group-DX2HFQMX.js.map} +0 -0
@@ -1,11 +1,11 @@
1
- import { T as TransferSealPayload } from '../ulid-CiPrpGqm.cjs';
2
- export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-CiPrpGqm.cjs';
3
- import { bw as Vault, b3 as NoydbStore, bs as SealingKeyProvider, bx as RecoveryEnrollmentInput, by as ShamirRecoveryProvider } from '../types-BpPV5uyy.cjs';
4
- export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-CbneC7bS.cjs';
1
+ import { T as TransferSealPayload } from '../ulid-DfZlAh0u.cjs';
2
+ export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-DfZlAh0u.cjs';
3
+ import { bs as Vault, a$ as NoydbStore, bo as SealingKeyProvider, bt as RecoveryEnrollmentInput, bu as ShamirRecoveryProvider } from '../types-Bze6vkwm.cjs';
4
+ export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-BtW8fAjz.cjs';
5
5
  import '../lazy-builder-eYZzLEL1.cjs';
6
6
  import '../predicate-BmhBSPCH.cjs';
7
7
  import '../strategy-BSxFXGzb.cjs';
8
- import '../index-D95VK1Qy.cjs';
8
+ import '../index-C8Bk3-VF.cjs';
9
9
  import '@noy-db/attestation';
10
10
 
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { T as TransferSealPayload } from '../ulid-DAfenvFd.js';
2
- export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-DAfenvFd.js';
3
- import { bw as Vault, b3 as NoydbStore, bs as SealingKeyProvider, bx as RecoveryEnrollmentInput, by as ShamirRecoveryProvider } from '../types-4t1-tWS4.js';
4
- export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-CbneC7bS.js';
1
+ import { T as TransferSealPayload } from '../ulid-DbBVrNSt.js';
2
+ export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-DbBVrNSt.js';
3
+ import { bs as Vault, a$ as NoydbStore, bo as SealingKeyProvider, bt as RecoveryEnrollmentInput, bu as ShamirRecoveryProvider } from '../types-DrmBTscX.js';
4
+ export { X as AdoptionStateError, Y as BackupCorruptedError, Z as BackupLedgerError, _ as BundleIntegrityError, $ as BundleSealMismatchError, a0 as BundleVersionConflictError, a1 as PartitionExtractionError, a2 as TransferSealError } from '../strategy-BtW8fAjz.js';
5
5
  import '../lazy-builder-ChSqcF5t.js';
6
6
  import '../predicate-BmhBSPCH.js';
7
7
  import '../strategy-BSxFXGzb.js';
8
- import '../index-XNB2r6bX.js';
8
+ import '../index-nP99bXLg.js';
9
9
  import '@noy-db/attestation';
10
10
 
11
11
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SCHEMAS_COLLECTION,
3
3
  resolveManagedSecret
4
- } from "../chunk-WGHU7BLI.js";
4
+ } from "../chunk-GNI5STXQ.js";
5
5
  import {
6
6
  COMPRESSION_BROTLI,
7
7
  COMPRESSION_GZIP,
@@ -20,11 +20,11 @@ import {
20
20
  resetBrotliSupportCache,
21
21
  validateBundleHeader,
22
22
  writeNoydbBundle
23
- } from "../chunk-L2FE64BU.js";
24
- import "../chunk-DKO2QFSA.js";
23
+ } from "../chunk-FFXM3ZIF.js";
24
+ import "../chunk-OB2ZJQ2D.js";
25
25
  import {
26
26
  createOwnerKeyring
27
- } from "../chunk-A5ZOOZFB.js";
27
+ } from "../chunk-6H2ZUNR7.js";
28
28
  import {
29
29
  generateULID,
30
30
  isULID
@@ -32,7 +32,7 @@ import {
32
32
  import {
33
33
  LEDGER_COLLECTION,
34
34
  LedgerStore
35
- } from "../chunk-56DJ7JVK.js";
35
+ } from "../chunk-BR3AMFGS.js";
36
36
  import {
37
37
  canonicalJson,
38
38
  envelopePayloadHash,
@@ -41,7 +41,7 @@ import {
41
41
  import {
42
42
  NOYDB_BACKUP_VERSION,
43
43
  NOYDB_FORMAT_VERSION
44
- } from "../chunk-GC4V7RU7.js";
44
+ } from "../chunk-F3BPIPLS.js";
45
45
  import {
46
46
  base64ToBuffer,
47
47
  bufferToBase64,
@@ -532,7 +532,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
532
532
  }
533
533
  }
534
534
  if (isManaged(opts)) {
535
- const { createNoydb } = await import("../noydb-GZGFBA4E.js");
535
+ const { createNoydb } = await import("../noydb-WCMY2ZOW.js");
536
536
  const db = await createNoydb({
537
537
  store,
538
538
  user: userId,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ATTESTATIONS_COLLECTION,
3
3
  loadOrCreateSigner
4
- } from "./chunk-7PS7EOCF.js";
4
+ } from "./chunk-IXBIFDEW.js";
5
5
  import {
6
6
  generateULID
7
7
  } from "./chunk-FZU343FL.js";
8
8
  import {
9
9
  NOYDB_FORMAT_VERSION
10
- } from "./chunk-GC4V7RU7.js";
10
+ } from "./chunk-F3BPIPLS.js";
11
11
  import {
12
12
  encrypt
13
13
  } from "./chunk-YULZKK4F.js";
@@ -56,4 +56,4 @@ async function issueAttestationCore(ctx, args) {
56
56
  export {
57
57
  issueAttestationCore
58
58
  };
59
- //# sourceMappingURL=chunk-BIYRQQV6.js.map
59
+ //# sourceMappingURL=chunk-3YWP3WBP.js.map
@@ -20,7 +20,7 @@ function recordId(record) {
20
20
  return typeof id === "string" ? id : "";
21
21
  }
22
22
  function immutableGuard(config) {
23
- const { collection, after, appendOnly, amendmentRoles } = config;
23
+ const { collection, after, appendOnly, amendmentRoles, amendmentInvariant } = config;
24
24
  if (appendOnly && after !== void 0) {
25
25
  throw new ValidationError("immutableGuard: `after` and `appendOnly` are mutually exclusive");
26
26
  }
@@ -46,12 +46,16 @@ function immutableGuard(config) {
46
46
  }
47
47
  },
48
48
  // The authorized override: inside an amendment transaction the
49
- // check/onDelete are skipped and the change is ledgered. No extra
50
- // invariant — the amendment itself is the sanctioned exception.
49
+ // check/onDelete are skipped and the change is ledgered. By default
50
+ // there is no extra invariant — the amendment itself is the
51
+ // sanctioned exception. Callers may supply `amendmentInvariant` to
52
+ // keep a constraint inviolable even under amendment (e.g. forbid
53
+ // deletes, or preserve a cross-record sum); a throw reverts the
54
+ // amendment and surfaces as `InvariantError`.
51
55
  amendment: {
52
56
  roles: amendmentRoles ?? ["admin", "owner"],
53
- invariant: () => {
54
- }
57
+ invariant: amendmentInvariant ?? (() => {
58
+ })
55
59
  }
56
60
  };
57
61
  return withGuard(spec);
@@ -61,4 +65,4 @@ export {
61
65
  withGuard,
62
66
  immutableGuard
63
67
  };
64
- //# sourceMappingURL=chunk-VU7SWWT5.js.map
68
+ //# sourceMappingURL=chunk-42FEUPZQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/guards/with-guard.ts","../src/guards/immutable-guard.ts"],"sourcesContent":["import { ValidationError } from '../errors.js'\nimport type { GuardStrategy, GuardStrategyHandle } from './types.js'\n\n/**\n * Register a guard for a collection. Guards run on every `put()` /\n * `delete()` for the named collection (after permissions, before\n * encryption) and may:\n *\n * - `check` — block writes by throwing (typically `RecordLockedError`)\n * - `frozenFields` — freeze specific fields once a condition is true\n * - `amendment` — declare an authorized-override path with invariant\n *\n * Pass the returned handle to `createNoydb({ strategies: [...] })`.\n *\n * @see docs/superpowers/specs/2026-05-18-guards-design.md\n */\nexport function withGuard<T extends Record<string, unknown>>(\n strategy: GuardStrategy<T>,\n): GuardStrategyHandle<T> {\n if (!strategy.collection || strategy.collection.length === 0) {\n throw new ValidationError('withGuard: collection name is required')\n }\n return {\n __noydb_strategy: 'guard',\n spec: strategy,\n }\n}\n","/**\n * `immutableGuard` — declarative WORM / append-only sugar over the guard\n * subsystem.\n *\n * Issued fiscal documents (invoices, DDTs) must be immutable after issue.\n * That is expressible today with a hand-rolled `withGuard` (block on\n * `check`/`onDelete`, allow an admin `amendment`), but the boilerplate is\n * repetitive and easy to get subtly wrong. `immutableGuard` generates\n * exactly that guard from a declarative config, reusing the guard\n * machinery wholesale — `check`/`onDelete` rejection, the ledgered\n * `amendment` override, and composition with `periods`/`history`.\n *\n * ```ts\n * createNoydb({ guardStrategies: [\n * immutableGuard({\n * collection: 'invoices',\n * after: (r) => r.status === 'issued', // immutable once issued\n * }),\n * ] })\n * ```\n *\n * A record is mutable until `after(record)` holds; from then on, updates\n * and deletes throw `RecordLockedError` unless performed inside an\n * `amendment` transaction by an authorized role (the override is\n * ledgered by the guard amendment mechanism). `appendOnly: true` is\n * shorthand for `after: () => true` — immutable from creation.\n */\n\nimport { withGuard } from './with-guard.js'\nimport type { GuardStrategy, GuardStrategyHandle, GuardContext, GuardChange } from './types.js'\nimport { RecordLockedError, ValidationError } from '../errors.js'\n\nexport interface ImmutableGuardConfig<T extends Record<string, unknown>> {\n /** The collection to make WORM. */\n collection: string\n /**\n * A record becomes immutable once this predicate holds. Evaluated on\n * the *existing* (already-persisted) record, so the write that first\n * makes it true is still allowed; subsequent writes are blocked.\n * Mutually exclusive with `appendOnly`.\n */\n after?: (record: T) => boolean\n /** Shorthand for `after: () => true` — immutable from creation. */\n appendOnly?: boolean\n /** Roles permitted to override via an amendment transaction. Default `['admin', 'owner']`. */\n amendmentRoles?: ReadonlyArray<'admin' | 'owner'>\n /**\n * Optional set-level invariant run over the amendment change-set after\n * the writes execute. Signature matches `GuardStrategy.amendment.invariant`\n * exactly: it receives every {before, after} pair touching this\n * collection in the amendment plus the guard context; throwing reverts\n * the whole amendment and surfaces as `InvariantError`.\n *\n * Use this to keep a constraint inviolable EVEN under amendment — e.g.\n * forbid deleting an issued document by re-throwing on any\n * `before !== null && after === null` change, or assert a cross-record\n * sum is preserved. When omitted the amendment is unconditionally\n * allowed (the amendment itself is the sanctioned, ledgered override) —\n * this is the backward-compatible default.\n */\n amendmentInvariant?: (\n changes: ReadonlyArray<GuardChange<T>>,\n ctx: GuardContext<T>,\n ) => Promise<void> | void\n}\n\nfunction recordId(record: Record<string, unknown> | null): string {\n const id = record?.id\n return typeof id === 'string' ? id : ''\n}\n\n/**\n * Build an immutability guard. Pass the returned handle to\n * `createNoydb({ guardStrategies: [...] })`.\n */\nexport function immutableGuard<T extends Record<string, unknown>>(\n config: ImmutableGuardConfig<T>,\n): GuardStrategyHandle<T> {\n const { collection, after, appendOnly, amendmentRoles, amendmentInvariant } = config\n if (appendOnly && after !== undefined) {\n throw new ValidationError('immutableGuard: `after` and `appendOnly` are mutually exclusive')\n }\n if (!appendOnly && after === undefined) {\n throw new ValidationError('immutableGuard: provide `after` or `appendOnly: true`')\n }\n\n const isImmutable: (record: T) => boolean = appendOnly ? () => true : after!\n const reason = appendOnly ? 'append-only collection' : 'record is immutable after issue'\n\n const spec: GuardStrategy<T> = {\n collection,\n // Block updates to an already-immutable record. Inserts (existing\n // null) and the transition write that first makes the record\n // immutable are allowed — `after` reads the prior state.\n check: (incoming: T, ctx: GuardContext<T>) => {\n if (ctx.existing !== null && isImmutable(ctx.existing)) {\n throw new RecordLockedError(collection, recordId(incoming as Record<string, unknown>), reason)\n }\n },\n // Block deletes of an immutable record.\n onDelete: (existing: T) => {\n if (isImmutable(existing)) {\n throw new RecordLockedError(collection, recordId(existing as Record<string, unknown>), reason)\n }\n },\n // The authorized override: inside an amendment transaction the\n // check/onDelete are skipped and the change is ledgered. By default\n // there is no extra invariant — the amendment itself is the\n // sanctioned exception. Callers may supply `amendmentInvariant` to\n // keep a constraint inviolable even under amendment (e.g. forbid\n // deletes, or preserve a cross-record sum); a throw reverts the\n // amendment and surfaces as `InvariantError`.\n amendment: {\n roles: amendmentRoles ?? ['admin', 'owner'],\n invariant: amendmentInvariant ?? (() => {\n /* allow — the amendment is the override, and is ledgered */\n }),\n },\n }\n\n return withGuard<T>(spec)\n}\n"],"mappings":";;;;;;AAgBO,SAAS,UACd,UACwB;AACxB,MAAI,CAAC,SAAS,cAAc,SAAS,WAAW,WAAW,GAAG;AAC5D,UAAM,IAAI,gBAAgB,wCAAwC;AAAA,EACpE;AACA,SAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,MAAM;AAAA,EACR;AACF;;;ACwCA,SAAS,SAAS,QAAgD;AAChE,QAAM,KAAK,QAAQ;AACnB,SAAO,OAAO,OAAO,WAAW,KAAK;AACvC;AAMO,SAAS,eACd,QACwB;AACxB,QAAM,EAAE,YAAY,OAAO,YAAY,gBAAgB,mBAAmB,IAAI;AAC9E,MAAI,cAAc,UAAU,QAAW;AACrC,UAAM,IAAI,gBAAgB,iEAAiE;AAAA,EAC7F;AACA,MAAI,CAAC,cAAc,UAAU,QAAW;AACtC,UAAM,IAAI,gBAAgB,uDAAuD;AAAA,EACnF;AAEA,QAAM,cAAsC,aAAa,MAAM,OAAO;AACtE,QAAM,SAAS,aAAa,2BAA2B;AAEvD,QAAM,OAAyB;AAAA,IAC7B;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,CAAC,UAAa,QAAyB;AAC5C,UAAI,IAAI,aAAa,QAAQ,YAAY,IAAI,QAAQ,GAAG;AACtD,cAAM,IAAI,kBAAkB,YAAY,SAAS,QAAmC,GAAG,MAAM;AAAA,MAC/F;AAAA,IACF;AAAA;AAAA,IAEA,UAAU,CAAC,aAAgB;AACzB,UAAI,YAAY,QAAQ,GAAG;AACzB,cAAM,IAAI,kBAAkB,YAAY,SAAS,QAAmC,GAAG,MAAM;AAAA,MAC/F;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,WAAW;AAAA,MACT,OAAO,kBAAkB,CAAC,SAAS,OAAO;AAAA,MAC1C,WAAW,uBAAuB,MAAM;AAAA,MAExC;AAAA,IACF;AAAA,EACF;AAEA,SAAO,UAAa,IAAI;AAC1B;","names":[]}
@@ -7,10 +7,10 @@ import {
7
7
  import {
8
8
  TxContext,
9
9
  revertExecuted
10
- } from "./chunk-YHPM5D7Y.js";
10
+ } from "./chunk-QVIEAYTP.js";
11
11
  import {
12
12
  OverlayedCollection
13
- } from "./chunk-OHVFWCJP.js";
13
+ } from "./chunk-VLMPU56Q.js";
14
14
  import {
15
15
  LazyQuery,
16
16
  decodeIdxId,
@@ -22,22 +22,22 @@ import {
22
22
  resolveManagedSecret,
23
23
  savePersistedSchema,
24
24
  saveSealedPassphrase
25
- } from "./chunk-WGHU7BLI.js";
25
+ } from "./chunk-GNI5STXQ.js";
26
26
  import {
27
27
  loadPublicEnvelope,
28
28
  readPublicEnvelope,
29
29
  savePublicEnvelope,
30
30
  validatePublicEnvelopeInput
31
- } from "./chunk-DKO2QFSA.js";
31
+ } from "./chunk-OB2ZJQ2D.js";
32
32
  import {
33
33
  PERIODS_COLLECTION
34
- } from "./chunk-KI6HAJWL.js";
34
+ } from "./chunk-QSUK7YWK.js";
35
35
  import {
36
36
  getAtPath,
37
37
  isDictCollectionName,
38
38
  resolvePolicy,
39
39
  setAtPathInPlace
40
- } from "./chunk-7HT2MEZ5.js";
40
+ } from "./chunk-7BQ4QWYX.js";
41
41
  import {
42
42
  ManagedRecoveryNotEnrolledError,
43
43
  PolicyDeniedError,
@@ -59,7 +59,7 @@ import {
59
59
  saveShamirRecoveryEntries,
60
60
  updateAuthenticator,
61
61
  writeMagicLinkGrant
62
- } from "./chunk-COFPAMX6.js";
62
+ } from "./chunk-DLZ2ONOD.js";
63
63
  import {
64
64
  assertTierAccess,
65
65
  dekKey
@@ -88,7 +88,7 @@ import {
88
88
  rotateKeys,
89
89
  saveUserEnvelope,
90
90
  updateKeyringIdentity
91
- } from "./chunk-A5ZOOZFB.js";
91
+ } from "./chunk-6H2ZUNR7.js";
92
92
  import {
93
93
  INDEXED_STORE_POLICY
94
94
  } from "./chunk-2QR2PQTT.js";
@@ -98,7 +98,7 @@ import {
98
98
  import {
99
99
  LEDGER_COLLECTION,
100
100
  LEDGER_DELTAS_COLLECTION
101
- } from "./chunk-56DJ7JVK.js";
101
+ } from "./chunk-BR3AMFGS.js";
102
102
  import {
103
103
  sha256Hex as sha256Hex2
104
104
  } from "./chunk-Z6FNBOTC.js";
@@ -111,10 +111,10 @@ import {
111
111
  decodeMoneyFields,
112
112
  quantizeMoneyFields,
113
113
  validateMoneyFieldPaths
114
- } from "./chunk-EYVQHAGH.js";
114
+ } from "./chunk-DUREQF5W.js";
115
115
  import {
116
116
  canonicalGroupKey
117
- } from "./chunk-3EWXMOK3.js";
117
+ } from "./chunk-L2BNJ6HM.js";
118
118
  import {
119
119
  readPath
120
120
  } from "./chunk-CJORTUJ2.js";
@@ -122,11 +122,11 @@ import {
122
122
  EXPORT_AUDIT_COLLECTION,
123
123
  createExportBlobsHandle,
124
124
  runCompaction
125
- } from "./chunk-6AJBSQU4.js";
125
+ } from "./chunk-XL35NSEN.js";
126
126
  import {
127
127
  NOYDB_BACKUP_VERSION,
128
128
  NOYDB_FORMAT_VERSION
129
- } from "./chunk-GC4V7RU7.js";
129
+ } from "./chunk-F3BPIPLS.js";
130
130
  import {
131
131
  decrypt,
132
132
  encrypt,
@@ -1319,7 +1319,7 @@ var Collection = class {
1319
1319
  }
1320
1320
  }
1321
1321
  if (this.materializedViewSource !== void 0) {
1322
- const { resolveStaleMVOnRead } = await import("./stale-JH67FU57.js");
1322
+ const { resolveStaleMVOnRead } = await import("./stale-W5PQTRYH.js");
1323
1323
  await resolveStaleMVOnRead(this.materializedViewSource, this.name);
1324
1324
  }
1325
1325
  let record;
@@ -1717,7 +1717,7 @@ var Collection = class {
1717
1717
  if (mode === "eager") {
1718
1718
  if (executor === null) {
1719
1719
  ;
1720
- ({ MaterializedViewExecutor: executor } = await import("./executor-HSSRXDOB.js"));
1720
+ ({ MaterializedViewExecutor: executor } = await import("./executor-AZLS3KBK.js"));
1721
1721
  }
1722
1722
  await executor.refresh(reg, {
1723
1723
  getCollection: (name) => this.materializedViewSource.getCollection(name),
@@ -1726,7 +1726,7 @@ var Collection = class {
1726
1726
  });
1727
1727
  } else if (mode === "lazy") {
1728
1728
  if (staleHelpers === null) {
1729
- staleHelpers = await import("./stale-JH67FU57.js");
1729
+ staleHelpers = await import("./stale-W5PQTRYH.js");
1730
1730
  }
1731
1731
  staleHelpers.markMVStale(registry, reg.spec.name);
1732
1732
  }
@@ -1757,9 +1757,18 @@ var Collection = class {
1757
1757
  if (DerivationExecutor === null) {
1758
1758
  ({ DerivationExecutor } = await import("./executor-6ZDSDZ6V.js"));
1759
1759
  }
1760
- const sourceWithId = { ...incoming, id };
1760
+ let sourceWithId;
1761
+ let sourceVersion = version;
1762
+ if (spec.source === this.name) {
1763
+ sourceWithId = { ...incoming, id };
1764
+ } else {
1765
+ const primary = await this.derivationSource.getCollection(spec.source).get(id);
1766
+ if (primary === null || primary === void 0) continue;
1767
+ sourceWithId = { ...primary, id };
1768
+ sourceVersion = 0;
1769
+ }
1761
1770
  const ctx = { vault: this.derivationSource.getReadOnlyFacade() };
1762
- const result = await DerivationExecutor.run(spec, sourceWithId, version, strategyHash, ctx);
1771
+ const result = await DerivationExecutor.run(spec, sourceWithId, sourceVersion, strategyHash, ctx);
1763
1772
  for (const key of Object.keys(spec.outputs)) {
1764
1773
  const out = result.outputs[key];
1765
1774
  if (!out) continue;
@@ -1774,7 +1783,7 @@ var Collection = class {
1774
1783
  const outputCollection = this.derivationSource.getCollection(outSpec.collection);
1775
1784
  const txCtx = this.derivationSource.getActiveTxContext();
1776
1785
  if (out.kind === "array") {
1777
- const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-N6OJX6QR.js");
1786
+ const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-67CMI3UT.js");
1778
1787
  const prior = await loadFanoutSidecar(
1779
1788
  this.adapter,
1780
1789
  this.vault,
@@ -2067,7 +2076,7 @@ var Collection = class {
2067
2076
  for (const [outputKey, outSpec] of Object.entries(spec.outputs)) {
2068
2077
  if (outSpec.shape !== "array") continue;
2069
2078
  if (helpers === null) {
2070
- helpers = await import("./fanout-sidecar-N6OJX6QR.js");
2079
+ helpers = await import("./fanout-sidecar-67CMI3UT.js");
2071
2080
  }
2072
2081
  const sidecar = await helpers.loadFanoutSidecar(
2073
2082
  this.adapter,
@@ -2107,7 +2116,7 @@ var Collection = class {
2107
2116
  if (mode === "eager") {
2108
2117
  if (executor === null) {
2109
2118
  ;
2110
- ({ MaterializedViewExecutor: executor } = await import("./executor-HSSRXDOB.js"));
2119
+ ({ MaterializedViewExecutor: executor } = await import("./executor-AZLS3KBK.js"));
2111
2120
  }
2112
2121
  await executor.refresh(reg, {
2113
2122
  getCollection: (name) => this.materializedViewSource.getCollection(name),
@@ -2116,7 +2125,7 @@ var Collection = class {
2116
2125
  });
2117
2126
  } else if (mode === "lazy") {
2118
2127
  if (staleHelpers === null) {
2119
- staleHelpers = await import("./stale-JH67FU57.js");
2128
+ staleHelpers = await import("./stale-W5PQTRYH.js");
2120
2129
  }
2121
2130
  staleHelpers.markMVStale(registry, reg.spec.name);
2122
2131
  }
@@ -2139,7 +2148,7 @@ var Collection = class {
2139
2148
  );
2140
2149
  }
2141
2150
  if (this.materializedViewSource !== void 0) {
2142
- const { resolveStaleMVOnRead } = await import("./stale-JH67FU57.js");
2151
+ const { resolveStaleMVOnRead } = await import("./stale-W5PQTRYH.js");
2143
2152
  await resolveStaleMVOnRead(this.materializedViewSource, this.name);
2144
2153
  }
2145
2154
  await this.ensureHydrated();
@@ -3784,6 +3793,21 @@ function withArchive(opts) {
3784
3793
  // src/sequence/index.ts
3785
3794
  var SEQUENCE_COLLECTION = "_sequences";
3786
3795
  var MAX_NEXT_ATTEMPTS = 16;
3796
+ function resolveSequenceKey(series, opts) {
3797
+ const partition = opts?.partition;
3798
+ if (!partition || partition.length === 0) return series;
3799
+ const parts = partition.map((p) => {
3800
+ if (typeof p === "number" && !Number.isFinite(p)) {
3801
+ throw new ValidationError(`sequence partition component must be a finite number, got ${p}`);
3802
+ }
3803
+ const s = String(p);
3804
+ if (s === "") {
3805
+ throw new ValidationError("sequence partition component must not be empty");
3806
+ }
3807
+ return encodeURIComponent(s);
3808
+ });
3809
+ return `${series}\0${parts.join("/")}`;
3810
+ }
3787
3811
  async function sleepBackoff(attempt) {
3788
3812
  const ceil = Math.min(2 ** attempt, 32);
3789
3813
  const ms = Math.floor(Math.random() * ceil);
@@ -3814,7 +3838,8 @@ var SequenceStore = class {
3814
3838
  handle(name) {
3815
3839
  return {
3816
3840
  next: () => this.next(name),
3817
- peek: () => this.peek(name)
3841
+ peek: () => this.peek(name),
3842
+ seedTo: (n) => this.seedTo(name, n)
3818
3843
  };
3819
3844
  }
3820
3845
  assertOnline() {
@@ -3867,6 +3892,30 @@ var SequenceStore = class {
3867
3892
  void lastConflict;
3868
3893
  throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS);
3869
3894
  }
3895
+ async seedTo(name, n) {
3896
+ this.assertOnline();
3897
+ if (n <= 0) return;
3898
+ let lastConflict;
3899
+ for (let attempt = 0; attempt < MAX_NEXT_ATTEMPTS; attempt++) {
3900
+ const { env, value } = await this.read(name);
3901
+ if (value >= n) return;
3902
+ const expectedVersion = env?._v ?? 0;
3903
+ const envelope = await this.encryptState({ value: n }, expectedVersion + 1);
3904
+ try {
3905
+ await this.adapter.put(this.vault, SEQUENCE_COLLECTION, name, envelope, expectedVersion);
3906
+ return;
3907
+ } catch (err) {
3908
+ if (err instanceof ConflictError) {
3909
+ lastConflict = err;
3910
+ if (attempt < MAX_NEXT_ATTEMPTS - 1) await sleepBackoff(attempt);
3911
+ continue;
3912
+ }
3913
+ throw err;
3914
+ }
3915
+ }
3916
+ void lastConflict;
3917
+ throw new SequenceContentionError(name, MAX_NEXT_ATTEMPTS);
3918
+ }
3870
3919
  };
3871
3920
 
3872
3921
  // src/numbering/index.ts
@@ -6005,17 +6054,23 @@ var Vault = class {
6005
6054
  * const cur = await vault.sequence('invoice-2026').peek() // current value, no allocation
6006
6055
  * ```
6007
6056
  */
6008
- sequence(name) {
6009
- if (this.numberingConfigs.has(name)) {
6057
+ sequence(series, opts) {
6058
+ if (series.includes("\0")) {
6059
+ throw new ValidationError(`sequence("${series}"): series name must not contain a null byte (\\x00).`);
6060
+ }
6061
+ if (this.numberingConfigs.has(series)) {
6010
6062
  const eng = this.deferred();
6011
6063
  return {
6012
- next: async (opts) => {
6013
- if (!opts?.for) {
6014
- throw new ValidationError(`sequence("${name}") is a deferred-numbering series; call next({ for: recordId }).`);
6064
+ next: async (nextOpts) => {
6065
+ if (!nextOpts?.for) {
6066
+ throw new ValidationError(`sequence("${series}") is a deferred-numbering series; call next({ for: recordId }).`);
6015
6067
  }
6016
- return (await eng.enqueue(name, opts.for)).assigned;
6068
+ return (await eng.enqueue(series, nextOpts.for)).assigned;
6017
6069
  },
6018
- peek: () => eng.peek(name)
6070
+ peek: () => eng.peek(series),
6071
+ seedTo: () => {
6072
+ throw new ValidationError(`sequence("${series}") is a deferred-numbering series; seedTo is CAS-only.`);
6073
+ }
6019
6074
  };
6020
6075
  }
6021
6076
  if (!this.sequenceStore) {
@@ -6027,7 +6082,7 @@ var Vault = class {
6027
6082
  actor: this.keyring.userId
6028
6083
  });
6029
6084
  }
6030
- return this.sequenceStore.handle(name);
6085
+ return this.sequenceStore.handle(resolveSequenceKey(series, opts));
6031
6086
  }
6032
6087
  /** @internal — lazily build the deferred-numbering engine with a cache-coherent stamp. */
6033
6088
  deferred() {
@@ -6142,12 +6197,12 @@ var Vault = class {
6142
6197
  if (!fieldSchema) {
6143
6198
  throw new AttestationError(`issueAttestation: collection '${collectionName}' has no attestation field-schema. Declare it via vault.collection('${collectionName}', { attestation: { fields: [...] } }).`);
6144
6199
  }
6145
- const { issueAttestationCore } = await import("./issue-ADVS4OVP.js");
6200
+ const { issueAttestationCore } = await import("./issue-RZP3VI6O.js");
6146
6201
  const out = await issueAttestationCore(this.makeIssueContext(), { collection: collectionName, id, fieldSchema });
6147
6202
  return { docId: out.docId, qr: out.qr, keyId: out.keyId, publicKeyB64: out.publicKeyB64 };
6148
6203
  }
6149
6204
  async getDocumentSigningPublicKey() {
6150
- const { loadSigner, loadOrCreateSigner } = await import("./signer-P5D7Y72U.js");
6205
+ const { loadSigner, loadOrCreateSigner } = await import("./signer-DCMNKXSF.js");
6151
6206
  const existing = await loadSigner(this.adapter, this.name, this.getDEK);
6152
6207
  if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 };
6153
6208
  if (this.keyring.role !== "owner") {
@@ -6173,19 +6228,19 @@ var Vault = class {
6173
6228
  };
6174
6229
  }
6175
6230
  async revokeAttestation(docId) {
6176
- const { revokeDocCore } = await import("./revoke-ZDFKMR5E.js");
6231
+ const { revokeDocCore } = await import("./revoke-HNMQZSCL.js");
6177
6232
  await revokeDocCore(this.makeRevokeContext(), docId);
6178
6233
  }
6179
6234
  async unrevokeAttestation(docId) {
6180
- const { unrevokeDocCore } = await import("./revoke-ZDFKMR5E.js");
6235
+ const { unrevokeDocCore } = await import("./revoke-HNMQZSCL.js");
6181
6236
  await unrevokeDocCore(this.makeRevokeContext(), docId);
6182
6237
  }
6183
6238
  async getRevokedDocIds() {
6184
- const { getRevokedDocIdsCore } = await import("./revoke-ZDFKMR5E.js");
6239
+ const { getRevokedDocIdsCore } = await import("./revoke-HNMQZSCL.js");
6185
6240
  return getRevokedDocIdsCore(this.makeRevokeContext());
6186
6241
  }
6187
6242
  async publishRevocationList() {
6188
- const { publishRevocationListCore } = await import("./revoke-ZDFKMR5E.js");
6243
+ const { publishRevocationListCore } = await import("./revoke-HNMQZSCL.js");
6189
6244
  return publishRevocationListCore(this.makeRevokeContext());
6190
6245
  }
6191
6246
  makeRevokeContext() {
@@ -6319,9 +6374,24 @@ var Vault = class {
6319
6374
  });
6320
6375
  }
6321
6376
  if (rule.mode === "cascade") {
6377
+ const txCtx = this.noydb._activeTxContextOrNull;
6322
6378
  for (const match of matches) {
6323
6379
  const matchId = match["id"] ?? null;
6324
6380
  if (matchId === null) continue;
6381
+ if (txCtx !== null) {
6382
+ const prior = await this.adapter.get(this.name, rule.collection, matchId);
6383
+ if (prior !== null) {
6384
+ txCtx._executed.push({
6385
+ op: {
6386
+ type: "delete",
6387
+ vaultName: this.name,
6388
+ collectionName: rule.collection,
6389
+ id: matchId
6390
+ },
6391
+ priorEnvelope: prior
6392
+ });
6393
+ }
6394
+ }
6325
6395
  await fromCollection.delete(matchId);
6326
6396
  }
6327
6397
  }
@@ -6502,7 +6572,7 @@ var Vault = class {
6502
6572
  async _initDerivations(handles) {
6503
6573
  if (handles.length === 0) return;
6504
6574
  const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
6505
- import("./registry-XGLNADIE.js"),
6575
+ import("./registry-EB6SISTA.js"),
6506
6576
  import("./read-only-facade-ITU6L7BL.js")
6507
6577
  ]);
6508
6578
  const registry = new DerivationRegistry();
@@ -6533,7 +6603,7 @@ var Vault = class {
6533
6603
  */
6534
6604
  async _initMaterializedViews(handles) {
6535
6605
  if (handles.length === 0) return;
6536
- const { MaterializedViewRegistry } = await import("./registry-DK5YWAAA.js");
6606
+ const { MaterializedViewRegistry } = await import("./registry-UTA4CLQS.js");
6537
6607
  const registry = new MaterializedViewRegistry();
6538
6608
  this.materializedViewRegistry = registry;
6539
6609
  const db = this;
@@ -6604,13 +6674,13 @@ var Vault = class {
6604
6674
  if (!reg) {
6605
6675
  throw new Error(`refreshView: no MV registered with name "${name}"`);
6606
6676
  }
6607
- const { MaterializedViewExecutor } = await import("./executor-HSSRXDOB.js");
6677
+ const { MaterializedViewExecutor } = await import("./executor-AZLS3KBK.js");
6608
6678
  const result = await MaterializedViewExecutor.refresh(reg, {
6609
6679
  getCollection: (n) => this.collection(n),
6610
6680
  getActiveTxContext: () => this.noydb._activeTxContextOrNull,
6611
6681
  getQueryContext: () => this
6612
6682
  });
6613
- const { clearMVStale } = await import("./stale-JH67FU57.js");
6683
+ const { clearMVStale } = await import("./stale-W5PQTRYH.js");
6614
6684
  clearMVStale(registry, name);
6615
6685
  return result;
6616
6686
  }
@@ -6651,7 +6721,7 @@ var Vault = class {
6651
6721
  if (!outSpec) continue;
6652
6722
  const outputColl = this.collection(outSpec.collection);
6653
6723
  if (out.kind === "array") {
6654
- const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-N6OJX6QR.js");
6724
+ const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-67CMI3UT.js");
6655
6725
  const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key);
6656
6726
  const prevKeys = new Set(prior?.keys ?? []);
6657
6727
  const newKeysList = out.entries.map((e) => e.key);
@@ -7363,7 +7433,7 @@ var Vault = class {
7363
7433
  * @see docs/subsystems/public-envelope.md
7364
7434
  */
7365
7435
  async getPublicEnvelope(opts = {}) {
7366
- const { readPublicEnvelope: readPublicEnvelope2 } = await import("./public-envelope-SYHEYQ3X.js");
7436
+ const { readPublicEnvelope: readPublicEnvelope2 } = await import("./public-envelope-YP2UWMLG.js");
7367
7437
  return readPublicEnvelope2(this.adapter, this.name, opts);
7368
7438
  }
7369
7439
  /**
@@ -8561,7 +8631,7 @@ var NOT_ENABLED5 = new Error(
8561
8631
  'Multi-record transactions require the tx strategy. Import `{ withTransactions }` from "@noy-db/hub/tx" and pass it to `createNoydb({ txStrategy: withTransactions() })`.'
8562
8632
  );
8563
8633
  var NO_TX = {
8564
- async runTransaction() {
8634
+ async runTransaction(_db, _fn, _options, _txInvariants) {
8565
8635
  throw NOT_ENABLED5;
8566
8636
  },
8567
8637
  async runDryRun() {
@@ -9572,7 +9642,7 @@ var Noydb = class {
9572
9642
  if (name === STATE_VAULT_NAME) throw new ReservedVaultNameError(name);
9573
9643
  const template = this.vaultTemplates.get(opts.sharding.vaultTemplate);
9574
9644
  if (!template) throw new VaultTemplateNotFoundError(opts.sharding.vaultTemplate);
9575
- const { VaultGroup } = await import("./vault-group-KOM7QRJG.js");
9645
+ const { VaultGroup } = await import("./vault-group-DX2HFQMX.js");
9576
9646
  const { StateManagementVault } = await import("./state-vault-TMXZRTY5.js");
9577
9647
  const stateVault = opts.registry ? void 0 : await StateManagementVault.open(this);
9578
9648
  const registry = opts.registry ?? stateVault.registry;
@@ -11102,6 +11172,7 @@ function normalizeSyncTargets(sync) {
11102
11172
 
11103
11173
  export {
11104
11174
  withArchive,
11175
+ resolveSequenceKey,
11105
11176
  SequenceStore,
11106
11177
  validateSchemaInput,
11107
11178
  validateSchemaOutput,
@@ -11140,4 +11211,4 @@ export {
11140
11211
  Noydb,
11141
11212
  createNoydb
11142
11213
  };
11143
- //# sourceMappingURL=chunk-7EFFHEN5.js.map
11214
+ //# sourceMappingURL=chunk-667MB6AH.js.map