@noy-db/hub 0.4.0 → 0.6.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (438) hide show
  1. package/dist/api-67SBPMMH.js +20 -0
  2. package/dist/attestation/index.js +18 -18
  3. package/dist/{backup-X7F3TCFV.js → backup-GAYWQAFN.js} +16 -11
  4. package/dist/backup-GAYWQAFN.js.map +1 -0
  5. package/dist/blobs/index.js +20 -20
  6. package/dist/broker/index.js +12 -12
  7. package/dist/bundle-handle-5OUAI7CV.js +36 -0
  8. package/dist/bundle-handle-5OUAI7CV.js.map +1 -0
  9. package/dist/cargo/index.js +36 -36
  10. package/dist/{chunk-DQZXPGGZ.js → chunk-24UICKTB.js} +3 -3
  11. package/dist/{chunk-77AEMXFA.js → chunk-24ZLWWEO.js} +1 -1
  12. package/dist/chunk-24ZLWWEO.js.map +1 -0
  13. package/dist/{chunk-2BET5QTS.js → chunk-27TCYH6G.js} +5 -5
  14. package/dist/{chunk-MSMJJB4J.js → chunk-2KIV7BEK.js} +2 -2
  15. package/dist/{chunk-6ZNSB3H6.js → chunk-2LGDCNFJ.js} +2 -2
  16. package/dist/{chunk-GTYFIVIZ.js → chunk-35EBKWQU.js} +5 -5
  17. package/dist/chunk-35EBKWQU.js.map +1 -0
  18. package/dist/{chunk-WBKZUO5V.js → chunk-3737A6EA.js} +3 -3
  19. package/dist/{chunk-ZBYFMI6D.js → chunk-3CLZY46Y.js} +638 -300
  20. package/dist/chunk-3CLZY46Y.js.map +1 -0
  21. package/dist/{chunk-HLKXPJ4V.js → chunk-3EO7RZLJ.js} +6 -6
  22. package/dist/{chunk-JYJFGD2H.js → chunk-3FSX6LDG.js} +2 -2
  23. package/dist/{chunk-MXUT7FTE.js → chunk-3HYWYLXL.js} +2 -2
  24. package/dist/{chunk-IVYQAVWO.js → chunk-3IIPWA75.js} +11 -11
  25. package/dist/{chunk-7H3WWH6J.js → chunk-3UK6STWO.js} +3 -3
  26. package/dist/chunk-46V67XP5.js +117 -0
  27. package/dist/chunk-46V67XP5.js.map +1 -0
  28. package/dist/{chunk-NJ4DYYO5.js → chunk-4HDYQL3J.js} +2 -2
  29. package/dist/{chunk-P4JO3H6R.js → chunk-4MQDV3HZ.js} +2 -2
  30. package/dist/{chunk-X4MVWPHV.js → chunk-4UVDI4XE.js} +3 -3
  31. package/dist/{chunk-LXRTP3AQ.js → chunk-4VCWI42L.js} +2 -2
  32. package/dist/{chunk-QJNCB5SK.js → chunk-747LRSOO.js} +2 -2
  33. package/dist/{chunk-3HUYRN24.js → chunk-7F4DBNSP.js} +3 -3
  34. package/dist/{chunk-UADPR6F4.js → chunk-7G6VDWXB.js} +3 -3
  35. package/dist/{chunk-PTHKZWEH.js → chunk-AHLJSVRL.js} +2 -2
  36. package/dist/{chunk-NFZGZ4AK.js → chunk-AR2JDFAE.js} +2 -2
  37. package/dist/{chunk-3ECU57YH.js → chunk-BPTZ4K5L.js} +11 -11
  38. package/dist/{chunk-KRCBZYTZ.js → chunk-CCZJJ4I2.js} +4 -4
  39. package/dist/{chunk-NYEFP7DY.js → chunk-CJ73OLMW.js} +2 -2
  40. package/dist/{chunk-Q36YXK77.js → chunk-CYQOUTMY.js} +3 -3
  41. package/dist/{chunk-RBTVFPHF.js → chunk-DCMQR46R.js} +5 -5
  42. package/dist/{chunk-TG634KCO.js → chunk-DG27IUVI.js} +2 -2
  43. package/dist/{chunk-E23UGFVC.js → chunk-DMQCLZ4Z.js} +8 -6
  44. package/dist/chunk-DMQCLZ4Z.js.map +1 -0
  45. package/dist/{chunk-ZNWSG7XC.js → chunk-DPJTDNUF.js} +68 -34
  46. package/dist/chunk-DPJTDNUF.js.map +1 -0
  47. package/dist/{chunk-V6UQZA2H.js → chunk-E6427JU2.js} +2 -2
  48. package/dist/{chunk-JEI6JJNI.js → chunk-EK7DT5BT.js} +220 -13
  49. package/dist/chunk-EK7DT5BT.js.map +1 -0
  50. package/dist/chunk-EPFF7LOX.js +14 -0
  51. package/dist/chunk-EPFF7LOX.js.map +1 -0
  52. package/dist/{chunk-TWPK7KUJ.js → chunk-F3GVO44K.js} +6 -6
  53. package/dist/{chunk-QD46HPZG.js → chunk-FAXZQ5UF.js} +2 -2
  54. package/dist/{chunk-IG6KUWBX.js → chunk-FNSMZQS4.js} +2 -2
  55. package/dist/{chunk-BLBAQRBM.js → chunk-FUHKW252.js} +2 -2
  56. package/dist/{chunk-SU6SGWXM.js → chunk-FY343IZR.js} +8 -8
  57. package/dist/{chunk-KPZS5QAQ.js → chunk-GQ3BX5EA.js} +9 -1
  58. package/dist/chunk-GQ3BX5EA.js.map +1 -0
  59. package/dist/{chunk-DAFBJS4Y.js → chunk-GS5RT2KK.js} +4 -4
  60. package/dist/{chunk-5UQ7Y6SQ.js → chunk-HFKGIBMD.js} +3 -3
  61. package/dist/{chunk-QZWTRENR.js → chunk-HNGSV2YC.js} +133 -1
  62. package/dist/chunk-HNGSV2YC.js.map +1 -0
  63. package/dist/chunk-HNHCQ556.js +63 -0
  64. package/dist/chunk-HNHCQ556.js.map +1 -0
  65. package/dist/chunk-HS7HNYBD.js +91 -0
  66. package/dist/chunk-HS7HNYBD.js.map +1 -0
  67. package/dist/{chunk-SHEEBRZ4.js → chunk-HVQGCKY4.js} +2 -2
  68. package/dist/{chunk-35NMVJ7I.js → chunk-HXGUIPQB.js} +3 -3
  69. package/dist/{chunk-ERGECZEI.js → chunk-JEM2IGS3.js} +9 -9
  70. package/dist/chunk-JH3OHQM4.js +260 -0
  71. package/dist/chunk-JH3OHQM4.js.map +1 -0
  72. package/dist/{chunk-L3YYLT4E.js → chunk-JIUVJ4M7.js} +2 -2
  73. package/dist/{chunk-55LX6FSX.js → chunk-JRCYZEHU.js} +2 -2
  74. package/dist/{chunk-SFBYQMZM.js → chunk-JSRU5W2M.js} +5 -5
  75. package/dist/{chunk-NM5UYF6Q.js → chunk-JXIDGFKS.js} +2 -2
  76. package/dist/{chunk-VYYM3MEN.js → chunk-KHKKD62N.js} +16 -2
  77. package/dist/chunk-KHKKD62N.js.map +1 -0
  78. package/dist/{chunk-FQ5CHJR7.js → chunk-KUDZVJKQ.js} +21 -2
  79. package/dist/chunk-KUDZVJKQ.js.map +1 -0
  80. package/dist/{chunk-RO5NM6UI.js → chunk-KZ3KMDN3.js} +2 -2
  81. package/dist/{chunk-HZZP2ZIG.js → chunk-LBGPO5RL.js} +6 -6
  82. package/dist/{chunk-ZFG5EBI3.js → chunk-LTU4FLHG.js} +57 -27
  83. package/dist/chunk-LTU4FLHG.js.map +1 -0
  84. package/dist/{chunk-CLE3TMIS.js → chunk-MC2LFTQM.js} +5 -2
  85. package/dist/{chunk-467SWYT5.js → chunk-MJWCLSQL.js} +17 -8
  86. package/dist/chunk-MJWCLSQL.js.map +1 -0
  87. package/dist/{chunk-W3G5REIU.js → chunk-MSWYQLMQ.js} +2 -2
  88. package/dist/{chunk-WK7ULBTP.js → chunk-MVOWXQHN.js} +5 -3
  89. package/dist/chunk-MVOWXQHN.js.map +1 -0
  90. package/dist/{chunk-2J6UEN2V.js → chunk-MXZ5TSTR.js} +118 -4
  91. package/dist/chunk-MXZ5TSTR.js.map +1 -0
  92. package/dist/{chunk-SGDPRCC4.js → chunk-MZ5ZFO2D.js} +3 -3
  93. package/dist/{chunk-NBXFCQX4.js → chunk-NQCNSVGI.js} +9 -9
  94. package/dist/chunk-NQCNSVGI.js.map +1 -0
  95. package/dist/{chunk-EFJAAFBW.js → chunk-NQRJ5AJO.js} +2 -2
  96. package/dist/{chunk-Q2SEJMP2.js → chunk-NVU7ZMPN.js} +2 -2
  97. package/dist/{chunk-ZTLOXFPB.js → chunk-OF3L2SD6.js} +2 -2
  98. package/dist/{chunk-LLYIMSQQ.js → chunk-OMSAULZM.js} +11 -11
  99. package/dist/{chunk-SF2ZIRD6.js → chunk-OSFPNKY4.js} +3 -3
  100. package/dist/{chunk-WUHEP3HH.js → chunk-P7NGLLUF.js} +5 -5
  101. package/dist/{chunk-RQ4ZI4ZI.js → chunk-PGAPBZEK.js} +7 -7
  102. package/dist/{chunk-T2MOJF76.js → chunk-PP5CO2PR.js} +6 -6
  103. package/dist/{chunk-Q5YJCVJY.js → chunk-RLWY6Z44.js} +227 -41
  104. package/dist/chunk-RLWY6Z44.js.map +1 -0
  105. package/dist/{chunk-QGIBI6GL.js → chunk-ROWL352P.js} +5 -5
  106. package/dist/{chunk-ZHDSUZQU.js → chunk-RPXL6KSX.js} +4 -4
  107. package/dist/{chunk-DTFA5DO4.js → chunk-SKONR2OL.js} +3 -3
  108. package/dist/{chunk-AT2JJEKJ.js → chunk-SRGJET2F.js} +16 -5
  109. package/dist/chunk-SRGJET2F.js.map +1 -0
  110. package/dist/{chunk-4ZKNC6A6.js → chunk-T4GPR2IR.js} +2 -2
  111. package/dist/{chunk-NLYALJMY.js → chunk-TFZ7LLOQ.js} +113 -36
  112. package/dist/chunk-TFZ7LLOQ.js.map +1 -0
  113. package/dist/{chunk-TS5XLBZR.js → chunk-TLNNHG3A.js} +4 -4
  114. package/dist/{chunk-6UBZ6I5Z.js → chunk-UHXCLPGC.js} +2 -2
  115. package/dist/{chunk-KD4HGBJV.js → chunk-V5C5NNBR.js} +4 -4
  116. package/dist/{chunk-WYUAEZSC.js → chunk-VBY6ZLJT.js} +15 -14
  117. package/dist/chunk-VBY6ZLJT.js.map +1 -0
  118. package/dist/{chunk-AKKRXT23.js → chunk-VCETL77O.js} +34 -16
  119. package/dist/chunk-VCETL77O.js.map +1 -0
  120. package/dist/{chunk-5GQEU4DN.js → chunk-VJFMXYKP.js} +2 -2
  121. package/dist/{chunk-5DRROK5W.js → chunk-VMCCGUQB.js} +2 -2
  122. package/dist/{chunk-IXNCZTWA.js → chunk-W3TVWF6N.js} +2 -2
  123. package/dist/{chunk-W66AM5IB.js → chunk-WLYIROCJ.js} +2 -2
  124. package/dist/{chunk-OWHP3H5C.js → chunk-XB7LUDKM.js} +4 -4
  125. package/dist/{chunk-KYRDJI5O.js → chunk-XBLKM73C.js} +10 -10
  126. package/dist/{chunk-MHMLXJ3I.js → chunk-YAWK6AWF.js} +2 -2
  127. package/dist/{chunk-PWPYO73B.js → chunk-ZGGVOADG.js} +5 -5
  128. package/dist/{chunk-YGK2HMLR.js → chunk-ZK4CO2KZ.js} +9 -9
  129. package/dist/chunk-ZK4CO2KZ.js.map +1 -0
  130. package/dist/{chunk-DSDXAKIP.js → chunk-ZVF37PKE.js} +34 -5
  131. package/dist/chunk-ZVF37PKE.js.map +1 -0
  132. package/dist/{chunk-IFOH7RBI.js → chunk-ZWMO5GL5.js} +5 -5
  133. package/dist/{chunk-LRRX57UA.js → chunk-ZXJXDHNK.js} +4 -4
  134. package/dist/classified/index.js +5 -5
  135. package/dist/{classified-marker-LE54HWSX.js → classified-marker-MH3ON5OL.js} +3 -3
  136. package/dist/collection-facade-AHT7FATG.js +45 -0
  137. package/dist/{computed-AB45PS4V.js → computed-6G5M3UPH.js} +3 -3
  138. package/dist/consent/index.js +9 -9
  139. package/dist/cover/index.js +3 -3
  140. package/dist/custody/index.js +11 -11
  141. package/dist/{dead-filter-V3LVWYEJ.js → dead-filter-U575NGSH.js} +2 -2
  142. package/dist/debug/index.js +1 -1
  143. package/dist/{delegation-JDUMAF6L.js → delegation-PDYL6RWT.js} +10 -10
  144. package/dist/derivations/index.js +12 -12
  145. package/dist/derive-AKT4KU36.js +22 -0
  146. package/dist/directory/index.js +10 -10
  147. package/dist/{dispatch-6TV3DGO6.js → dispatch-4XIJSFTT.js} +5 -5
  148. package/dist/{dispatch-W7NWQ637.js → dispatch-N5HGVUGU.js} +18 -18
  149. package/dist/{enclave-YFCLPIDR.js → enclave-OPK24QDR.js} +13 -9
  150. package/dist/executor-3JZ4POTW.js +28 -0
  151. package/dist/executor-CYJQLKKI.js +9 -0
  152. package/dist/executor-S4QIKEHW.js +9 -0
  153. package/dist/export-accessible-CPTP5STN.js +23 -0
  154. package/dist/extract-partition-TWXPHVU7.js +38 -0
  155. package/dist/{fanout-sidecar-273RDMYS.js → fanout-sidecar-T2ZGLQFE.js} +9 -9
  156. package/dist/find-RBBYKXI7.js +11 -0
  157. package/dist/forget/index.js +9 -9
  158. package/dist/guards/index.js +6 -6
  159. package/dist/history/index.js +15 -15
  160. package/dist/i18n/index.js +14 -14
  161. package/dist/index.d.ts +35 -7
  162. package/dist/index.js +279 -202
  163. package/dist/index.js.map +1 -1
  164. package/dist/indexing/index.js +3 -3
  165. package/dist/introspection/index.js +12 -12
  166. package/dist/issue-N74C55X6.js +19 -0
  167. package/dist/kernel/collection-config.d.ts +4 -0
  168. package/dist/kernel/collection.d.ts +34 -8
  169. package/dist/kernel/cutover-transform.d.ts +64 -0
  170. package/dist/kernel/enclave/crypto.d.ts +24 -0
  171. package/dist/kernel/enclave/index.d.ts +2 -1
  172. package/dist/kernel/errors.d.ts +138 -0
  173. package/dist/kernel/noydb.d.ts +10 -1
  174. package/dist/kernel/put-many-atomic.d.ts +45 -0
  175. package/dist/kernel/secret-mode.d.ts +59 -0
  176. package/dist/kernel/types.d.ts +98 -7
  177. package/dist/kernel/validation.d.ts +33 -0
  178. package/dist/kernel/vault.d.ts +32 -6
  179. package/dist/{ledger-XE7JF2I2.js → ledger-DONWFC5M.js} +11 -11
  180. package/dist/liberate-KICI7AJN.js +24 -0
  181. package/dist/{link-set-CGYC3OH5.js → link-set-2TTP4VLO.js} +11 -11
  182. package/dist/managed-secret-EAOYWRYF.js +27 -0
  183. package/dist/materialized-views/index.js +19 -19
  184. package/dist/money/index.js +3 -3
  185. package/dist/noydb-6W2XGQCS.js +83 -0
  186. package/dist/overlay-views/index.js +6 -6
  187. package/dist/periods/index.js +16 -16
  188. package/dist/pod/index.js +121 -12
  189. package/dist/policy/index.js +4 -4
  190. package/dist/port/to/index.d.ts +3 -1
  191. package/dist/port/to/locator.d.ts +84 -0
  192. package/dist/port/with/device-seal-strategy.d.ts +16 -0
  193. package/dist/port/with/strategies.d.ts +2 -0
  194. package/dist/port/with/write-hooks.d.ts +6 -0
  195. package/dist/portability/index.js +8 -8
  196. package/dist/{post-register-LY35EDTJ.js → post-register-ORQOQJCS.js} +6 -6
  197. package/dist/query/index.js +4 -4
  198. package/dist/reduce/index.js +4 -4
  199. package/dist/register-LHETZRJM.js +32 -0
  200. package/dist/registry-AMAZ6QRZ.js +19 -0
  201. package/dist/registry-CZVINVQH.js +9 -0
  202. package/dist/registry-IKUR2MXD.js +9 -0
  203. package/dist/registry-JRIN447B.js +18 -0
  204. package/dist/request-withdrawal-2DN2RGCO.js +31 -0
  205. package/dist/{reveal-T34ADTPY.js → reveal-AG4SCHUQ.js} +6 -6
  206. package/dist/revoke-ZX4NM2CJ.js +24 -0
  207. package/dist/satellites/index.js +1 -1
  208. package/dist/schema-update/index.js +6 -6
  209. package/dist/sealed-record/index.js +12 -12
  210. package/dist/search/index.js +4 -4
  211. package/dist/{seed-JOV54PB3.js → seed-IRCDGIRK.js} +15 -15
  212. package/dist/seed-IRCDGIRK.js.map +1 -0
  213. package/dist/sequence/index.js +9 -9
  214. package/dist/session/index.js +9 -9
  215. package/dist/shadow/index.js +2 -2
  216. package/dist/signer-7KHD4OL2.js +25 -0
  217. package/dist/snapshots/index.js +10 -10
  218. package/dist/{stale-T3V7XEOB.js → stale-K734VACF.js} +10 -10
  219. package/dist/storage-4H2GF6RQ.js +23 -0
  220. package/dist/{store-coordination-provider-AHGFEMFA.js → store-coordination-provider-4SKLSFUG.js} +3 -3
  221. package/dist/sync/index.js +10 -10
  222. package/dist/team/index.js +27 -15
  223. package/dist/tiers/index.js +10 -10
  224. package/dist/to/index.js +28 -3
  225. package/dist/to/index.js.map +1 -1
  226. package/dist/transactions/index.js +3 -3
  227. package/dist/util/index.js +1 -1
  228. package/dist/{verify-7XWHJWUN.js → verify-RO5RTZOJ.js} +5 -5
  229. package/dist/walk-MQHYNDLZ.js +21 -0
  230. package/dist/with-audit/guards/registry.d.ts +8 -1
  231. package/dist/with-audit/guards/types.d.ts +5 -0
  232. package/dist/with-audit/periods/index.d.ts +1 -1
  233. package/dist/with-audit/periods/periods.d.ts +7 -0
  234. package/dist/with-commit/tx/atomic-eligibility.d.ts +13 -11
  235. package/dist/with-formula/derivations/registry.d.ts +6 -0
  236. package/dist/with-formula/derivations/types.d.ts +5 -0
  237. package/dist/with-lookup/indexing/eager-indexes.d.ts +10 -0
  238. package/dist/with-party/team/device-seal.d.ts +25 -0
  239. package/dist/with-party/team/echo-ceremony.d.ts +74 -0
  240. package/dist/with-party/team/echo-secret.d.ts +56 -0
  241. package/dist/with-party/team/index.d.ts +8 -0
  242. package/dist/with-party/team/keyring.d.ts +71 -9
  243. package/dist/with-party/team/rotate-recover.d.ts +99 -5
  244. package/dist/with-pod/bundle-handle.d.ts +9 -0
  245. package/dist/with-pod/bundle.d.ts +100 -2
  246. package/dist/with-pod/format.d.ts +92 -1
  247. package/dist/with-pod/index.d.ts +22 -1
  248. package/dist/with-pod/open.d.ts +117 -0
  249. package/dist/with-pod/redirect.d.ts +78 -0
  250. package/dist/with-pod/signature.d.ts +13 -0
  251. package/dist/with-shape/introspection/behaviors.d.ts +100 -0
  252. package/dist/with-shape/introspection/derivation-key.d.ts +17 -0
  253. package/dist/with-shape/introspection/describe.d.ts +36 -0
  254. package/dist/with-shape/introspection/index.d.ts +1 -0
  255. package/dist/with-shape/introspection/subsystem-matrix.d.ts +22 -0
  256. package/dist/with-shape/introspection/types.d.ts +2 -1
  257. package/dist/with-shape/links/names.d.ts +14 -0
  258. package/dist/with-shape/manifest/derive.d.ts +86 -0
  259. package/dist/with-shape/manifest/reserved-collections.d.ts +27 -0
  260. package/dist/with-shape/manifest/storage.d.ts +62 -0
  261. package/dist/with-shape/manifest/sync.d.ts +135 -0
  262. package/dist/with-shape/manifest/types.d.ts +49 -0
  263. package/dist/with-shape/manifest/writer.d.ts +32 -0
  264. package/dist/with-shape/persisted-schemas/field-ids.d.ts +29 -0
  265. package/dist/with-shape/persisted-schemas/register.d.ts +3 -0
  266. package/dist/with-shape/persisted-schemas/types.d.ts +17 -0
  267. package/dist/with-shape/schema-update/fence-controller.d.ts +34 -0
  268. package/dist/with-shape/schema-update/fence.d.ts +9 -0
  269. package/dist/with-shape/schema-update/strategies.d.ts +18 -2
  270. package/dist/with-shape/schema-update/types.d.ts +11 -0
  271. package/dist/with-sync/engine.d.ts +17 -0
  272. package/dist/with-sync/presence.d.ts +31 -1
  273. package/dist/withdraw-accessible-JSDQHXHE.js +28 -0
  274. package/dist/withdraw-accessible-JSDQHXHE.js.map +1 -0
  275. package/package.json +3 -3
  276. package/dist/api-SI2IVBQO.js +0 -20
  277. package/dist/backup-X7F3TCFV.js.map +0 -1
  278. package/dist/chunk-2J6UEN2V.js.map +0 -1
  279. package/dist/chunk-467SWYT5.js.map +0 -1
  280. package/dist/chunk-4JQK3L4V.js +0 -41
  281. package/dist/chunk-4JQK3L4V.js.map +0 -1
  282. package/dist/chunk-77AEMXFA.js.map +0 -1
  283. package/dist/chunk-AKKRXT23.js.map +0 -1
  284. package/dist/chunk-AT2JJEKJ.js.map +0 -1
  285. package/dist/chunk-DSDXAKIP.js.map +0 -1
  286. package/dist/chunk-E23UGFVC.js.map +0 -1
  287. package/dist/chunk-FQ5CHJR7.js.map +0 -1
  288. package/dist/chunk-GTYFIVIZ.js.map +0 -1
  289. package/dist/chunk-JEI6JJNI.js.map +0 -1
  290. package/dist/chunk-JQ2AX4T5.js +0 -23
  291. package/dist/chunk-JQ2AX4T5.js.map +0 -1
  292. package/dist/chunk-KPZS5QAQ.js.map +0 -1
  293. package/dist/chunk-NBXFCQX4.js.map +0 -1
  294. package/dist/chunk-NLYALJMY.js.map +0 -1
  295. package/dist/chunk-Q5YJCVJY.js.map +0 -1
  296. package/dist/chunk-QZWTRENR.js.map +0 -1
  297. package/dist/chunk-S7GIXBXV.js +0 -129
  298. package/dist/chunk-S7GIXBXV.js.map +0 -1
  299. package/dist/chunk-SBHN6QUT.js +0 -25
  300. package/dist/chunk-SBHN6QUT.js.map +0 -1
  301. package/dist/chunk-VYYM3MEN.js.map +0 -1
  302. package/dist/chunk-WK7ULBTP.js.map +0 -1
  303. package/dist/chunk-WYUAEZSC.js.map +0 -1
  304. package/dist/chunk-YGK2HMLR.js.map +0 -1
  305. package/dist/chunk-ZBYFMI6D.js.map +0 -1
  306. package/dist/chunk-ZFG5EBI3.js.map +0 -1
  307. package/dist/chunk-ZNWSG7XC.js.map +0 -1
  308. package/dist/collection-facade-DO2AABZT.js +0 -45
  309. package/dist/derive-ZPGVLE2Q.js +0 -22
  310. package/dist/executor-FPHKWDWT.js +0 -28
  311. package/dist/executor-IEBLTBCW.js +0 -9
  312. package/dist/executor-RM7XWQDU.js +0 -9
  313. package/dist/export-accessible-EKM3HGB2.js +0 -23
  314. package/dist/extract-partition-LS4ET5A6.js +0 -38
  315. package/dist/find-OZMTRIK3.js +0 -11
  316. package/dist/issue-LIA7FXBJ.js +0 -19
  317. package/dist/liberate-WZ3RHVKW.js +0 -24
  318. package/dist/noydb-ZLPVCDES.js +0 -81
  319. package/dist/register-6RIBIT3I.js +0 -25
  320. package/dist/registry-7Y5WF7GS.js +0 -9
  321. package/dist/registry-BWD2ED52.js +0 -8
  322. package/dist/registry-MUSL4AW6.js +0 -19
  323. package/dist/registry-RON4WHAP.js +0 -18
  324. package/dist/request-withdrawal-FT3ORAWN.js +0 -31
  325. package/dist/revoke-HC7WG3HE.js +0 -24
  326. package/dist/seed-JOV54PB3.js.map +0 -1
  327. package/dist/signer-CTWOH6KT.js +0 -25
  328. package/dist/storage-LLNLPWWB.js +0 -23
  329. package/dist/walk-G3NFEP5L.js +0 -21
  330. package/dist/withdraw-accessible-ANSVG6XG.js +0 -28
  331. /package/dist/{api-SI2IVBQO.js.map → api-67SBPMMH.js.map} +0 -0
  332. /package/dist/{chunk-DQZXPGGZ.js.map → chunk-24UICKTB.js.map} +0 -0
  333. /package/dist/{chunk-2BET5QTS.js.map → chunk-27TCYH6G.js.map} +0 -0
  334. /package/dist/{chunk-MSMJJB4J.js.map → chunk-2KIV7BEK.js.map} +0 -0
  335. /package/dist/{chunk-6ZNSB3H6.js.map → chunk-2LGDCNFJ.js.map} +0 -0
  336. /package/dist/{chunk-WBKZUO5V.js.map → chunk-3737A6EA.js.map} +0 -0
  337. /package/dist/{chunk-HLKXPJ4V.js.map → chunk-3EO7RZLJ.js.map} +0 -0
  338. /package/dist/{chunk-JYJFGD2H.js.map → chunk-3FSX6LDG.js.map} +0 -0
  339. /package/dist/{chunk-MXUT7FTE.js.map → chunk-3HYWYLXL.js.map} +0 -0
  340. /package/dist/{chunk-IVYQAVWO.js.map → chunk-3IIPWA75.js.map} +0 -0
  341. /package/dist/{chunk-7H3WWH6J.js.map → chunk-3UK6STWO.js.map} +0 -0
  342. /package/dist/{chunk-NJ4DYYO5.js.map → chunk-4HDYQL3J.js.map} +0 -0
  343. /package/dist/{chunk-P4JO3H6R.js.map → chunk-4MQDV3HZ.js.map} +0 -0
  344. /package/dist/{chunk-X4MVWPHV.js.map → chunk-4UVDI4XE.js.map} +0 -0
  345. /package/dist/{chunk-LXRTP3AQ.js.map → chunk-4VCWI42L.js.map} +0 -0
  346. /package/dist/{chunk-QJNCB5SK.js.map → chunk-747LRSOO.js.map} +0 -0
  347. /package/dist/{chunk-3HUYRN24.js.map → chunk-7F4DBNSP.js.map} +0 -0
  348. /package/dist/{chunk-UADPR6F4.js.map → chunk-7G6VDWXB.js.map} +0 -0
  349. /package/dist/{chunk-PTHKZWEH.js.map → chunk-AHLJSVRL.js.map} +0 -0
  350. /package/dist/{chunk-NFZGZ4AK.js.map → chunk-AR2JDFAE.js.map} +0 -0
  351. /package/dist/{chunk-3ECU57YH.js.map → chunk-BPTZ4K5L.js.map} +0 -0
  352. /package/dist/{chunk-KRCBZYTZ.js.map → chunk-CCZJJ4I2.js.map} +0 -0
  353. /package/dist/{chunk-NYEFP7DY.js.map → chunk-CJ73OLMW.js.map} +0 -0
  354. /package/dist/{chunk-Q36YXK77.js.map → chunk-CYQOUTMY.js.map} +0 -0
  355. /package/dist/{chunk-RBTVFPHF.js.map → chunk-DCMQR46R.js.map} +0 -0
  356. /package/dist/{chunk-TG634KCO.js.map → chunk-DG27IUVI.js.map} +0 -0
  357. /package/dist/{chunk-V6UQZA2H.js.map → chunk-E6427JU2.js.map} +0 -0
  358. /package/dist/{chunk-TWPK7KUJ.js.map → chunk-F3GVO44K.js.map} +0 -0
  359. /package/dist/{chunk-QD46HPZG.js.map → chunk-FAXZQ5UF.js.map} +0 -0
  360. /package/dist/{chunk-IG6KUWBX.js.map → chunk-FNSMZQS4.js.map} +0 -0
  361. /package/dist/{chunk-BLBAQRBM.js.map → chunk-FUHKW252.js.map} +0 -0
  362. /package/dist/{chunk-SU6SGWXM.js.map → chunk-FY343IZR.js.map} +0 -0
  363. /package/dist/{chunk-DAFBJS4Y.js.map → chunk-GS5RT2KK.js.map} +0 -0
  364. /package/dist/{chunk-5UQ7Y6SQ.js.map → chunk-HFKGIBMD.js.map} +0 -0
  365. /package/dist/{chunk-SHEEBRZ4.js.map → chunk-HVQGCKY4.js.map} +0 -0
  366. /package/dist/{chunk-35NMVJ7I.js.map → chunk-HXGUIPQB.js.map} +0 -0
  367. /package/dist/{chunk-ERGECZEI.js.map → chunk-JEM2IGS3.js.map} +0 -0
  368. /package/dist/{chunk-L3YYLT4E.js.map → chunk-JIUVJ4M7.js.map} +0 -0
  369. /package/dist/{chunk-55LX6FSX.js.map → chunk-JRCYZEHU.js.map} +0 -0
  370. /package/dist/{chunk-SFBYQMZM.js.map → chunk-JSRU5W2M.js.map} +0 -0
  371. /package/dist/{chunk-NM5UYF6Q.js.map → chunk-JXIDGFKS.js.map} +0 -0
  372. /package/dist/{chunk-RO5NM6UI.js.map → chunk-KZ3KMDN3.js.map} +0 -0
  373. /package/dist/{chunk-HZZP2ZIG.js.map → chunk-LBGPO5RL.js.map} +0 -0
  374. /package/dist/{chunk-CLE3TMIS.js.map → chunk-MC2LFTQM.js.map} +0 -0
  375. /package/dist/{chunk-W3G5REIU.js.map → chunk-MSWYQLMQ.js.map} +0 -0
  376. /package/dist/{chunk-SGDPRCC4.js.map → chunk-MZ5ZFO2D.js.map} +0 -0
  377. /package/dist/{chunk-EFJAAFBW.js.map → chunk-NQRJ5AJO.js.map} +0 -0
  378. /package/dist/{chunk-Q2SEJMP2.js.map → chunk-NVU7ZMPN.js.map} +0 -0
  379. /package/dist/{chunk-ZTLOXFPB.js.map → chunk-OF3L2SD6.js.map} +0 -0
  380. /package/dist/{chunk-LLYIMSQQ.js.map → chunk-OMSAULZM.js.map} +0 -0
  381. /package/dist/{chunk-SF2ZIRD6.js.map → chunk-OSFPNKY4.js.map} +0 -0
  382. /package/dist/{chunk-WUHEP3HH.js.map → chunk-P7NGLLUF.js.map} +0 -0
  383. /package/dist/{chunk-RQ4ZI4ZI.js.map → chunk-PGAPBZEK.js.map} +0 -0
  384. /package/dist/{chunk-T2MOJF76.js.map → chunk-PP5CO2PR.js.map} +0 -0
  385. /package/dist/{chunk-QGIBI6GL.js.map → chunk-ROWL352P.js.map} +0 -0
  386. /package/dist/{chunk-ZHDSUZQU.js.map → chunk-RPXL6KSX.js.map} +0 -0
  387. /package/dist/{chunk-DTFA5DO4.js.map → chunk-SKONR2OL.js.map} +0 -0
  388. /package/dist/{chunk-4ZKNC6A6.js.map → chunk-T4GPR2IR.js.map} +0 -0
  389. /package/dist/{chunk-TS5XLBZR.js.map → chunk-TLNNHG3A.js.map} +0 -0
  390. /package/dist/{chunk-6UBZ6I5Z.js.map → chunk-UHXCLPGC.js.map} +0 -0
  391. /package/dist/{chunk-KD4HGBJV.js.map → chunk-V5C5NNBR.js.map} +0 -0
  392. /package/dist/{chunk-5GQEU4DN.js.map → chunk-VJFMXYKP.js.map} +0 -0
  393. /package/dist/{chunk-5DRROK5W.js.map → chunk-VMCCGUQB.js.map} +0 -0
  394. /package/dist/{chunk-IXNCZTWA.js.map → chunk-W3TVWF6N.js.map} +0 -0
  395. /package/dist/{chunk-W66AM5IB.js.map → chunk-WLYIROCJ.js.map} +0 -0
  396. /package/dist/{chunk-OWHP3H5C.js.map → chunk-XB7LUDKM.js.map} +0 -0
  397. /package/dist/{chunk-KYRDJI5O.js.map → chunk-XBLKM73C.js.map} +0 -0
  398. /package/dist/{chunk-MHMLXJ3I.js.map → chunk-YAWK6AWF.js.map} +0 -0
  399. /package/dist/{chunk-PWPYO73B.js.map → chunk-ZGGVOADG.js.map} +0 -0
  400. /package/dist/{chunk-IFOH7RBI.js.map → chunk-ZWMO5GL5.js.map} +0 -0
  401. /package/dist/{chunk-LRRX57UA.js.map → chunk-ZXJXDHNK.js.map} +0 -0
  402. /package/dist/{classified-marker-LE54HWSX.js.map → classified-marker-MH3ON5OL.js.map} +0 -0
  403. /package/dist/{collection-facade-DO2AABZT.js.map → collection-facade-AHT7FATG.js.map} +0 -0
  404. /package/dist/{computed-AB45PS4V.js.map → computed-6G5M3UPH.js.map} +0 -0
  405. /package/dist/{dead-filter-V3LVWYEJ.js.map → dead-filter-U575NGSH.js.map} +0 -0
  406. /package/dist/{delegation-JDUMAF6L.js.map → delegation-PDYL6RWT.js.map} +0 -0
  407. /package/dist/{derive-ZPGVLE2Q.js.map → derive-AKT4KU36.js.map} +0 -0
  408. /package/dist/{dispatch-6TV3DGO6.js.map → dispatch-4XIJSFTT.js.map} +0 -0
  409. /package/dist/{dispatch-W7NWQ637.js.map → dispatch-N5HGVUGU.js.map} +0 -0
  410. /package/dist/{enclave-YFCLPIDR.js.map → enclave-OPK24QDR.js.map} +0 -0
  411. /package/dist/{executor-FPHKWDWT.js.map → executor-3JZ4POTW.js.map} +0 -0
  412. /package/dist/{executor-IEBLTBCW.js.map → executor-CYJQLKKI.js.map} +0 -0
  413. /package/dist/{executor-RM7XWQDU.js.map → executor-S4QIKEHW.js.map} +0 -0
  414. /package/dist/{export-accessible-EKM3HGB2.js.map → export-accessible-CPTP5STN.js.map} +0 -0
  415. /package/dist/{extract-partition-LS4ET5A6.js.map → extract-partition-TWXPHVU7.js.map} +0 -0
  416. /package/dist/{fanout-sidecar-273RDMYS.js.map → fanout-sidecar-T2ZGLQFE.js.map} +0 -0
  417. /package/dist/{find-OZMTRIK3.js.map → find-RBBYKXI7.js.map} +0 -0
  418. /package/dist/{issue-LIA7FXBJ.js.map → issue-N74C55X6.js.map} +0 -0
  419. /package/dist/{ledger-XE7JF2I2.js.map → ledger-DONWFC5M.js.map} +0 -0
  420. /package/dist/{liberate-WZ3RHVKW.js.map → liberate-KICI7AJN.js.map} +0 -0
  421. /package/dist/{link-set-CGYC3OH5.js.map → link-set-2TTP4VLO.js.map} +0 -0
  422. /package/dist/{noydb-ZLPVCDES.js.map → managed-secret-EAOYWRYF.js.map} +0 -0
  423. /package/dist/{register-6RIBIT3I.js.map → noydb-6W2XGQCS.js.map} +0 -0
  424. /package/dist/{post-register-LY35EDTJ.js.map → post-register-ORQOQJCS.js.map} +0 -0
  425. /package/dist/{registry-7Y5WF7GS.js.map → register-LHETZRJM.js.map} +0 -0
  426. /package/dist/{registry-BWD2ED52.js.map → registry-AMAZ6QRZ.js.map} +0 -0
  427. /package/dist/{registry-MUSL4AW6.js.map → registry-CZVINVQH.js.map} +0 -0
  428. /package/dist/{registry-RON4WHAP.js.map → registry-IKUR2MXD.js.map} +0 -0
  429. /package/dist/{request-withdrawal-FT3ORAWN.js.map → registry-JRIN447B.js.map} +0 -0
  430. /package/dist/{revoke-HC7WG3HE.js.map → request-withdrawal-2DN2RGCO.js.map} +0 -0
  431. /package/dist/{reveal-T34ADTPY.js.map → reveal-AG4SCHUQ.js.map} +0 -0
  432. /package/dist/{signer-CTWOH6KT.js.map → revoke-ZX4NM2CJ.js.map} +0 -0
  433. /package/dist/{stale-T3V7XEOB.js.map → signer-7KHD4OL2.js.map} +0 -0
  434. /package/dist/{storage-LLNLPWWB.js.map → stale-K734VACF.js.map} +0 -0
  435. /package/dist/{walk-G3NFEP5L.js.map → storage-4H2GF6RQ.js.map} +0 -0
  436. /package/dist/{store-coordination-provider-AHGFEMFA.js.map → store-coordination-provider-4SKLSFUG.js.map} +0 -0
  437. /package/dist/{verify-7XWHJWUN.js.map → verify-RO5RTZOJ.js.map} +0 -0
  438. /package/dist/{withdraw-accessible-ANSVG6XG.js.map → walk-MQHYNDLZ.js.map} +0 -0
@@ -1,29 +1,33 @@
1
1
  import {
2
2
  hashFields,
3
3
  validateSatelliteDeclaration
4
- } from "./chunk-SHEEBRZ4.js";
4
+ } from "./chunk-HVQGCKY4.js";
5
5
  import {
6
6
  resolveStaleOnRead
7
- } from "./chunk-NJ4DYYO5.js";
7
+ } from "./chunk-4HDYQL3J.js";
8
+ import {
9
+ isManifestReservedCollection
10
+ } from "./chunk-EPFF7LOX.js";
8
11
  import {
9
12
  LinkIntegrityError,
13
+ declareLink,
10
14
  isLinkCollectionName,
11
15
  linkCollectionName,
12
16
  linkRowKey
13
- } from "./chunk-4JQK3L4V.js";
17
+ } from "./chunk-HNHCQ556.js";
14
18
  import {
15
19
  isBaseLive,
16
20
  liveBaseIdSet
17
21
  } from "./chunk-GYGLAVCX.js";
18
22
  import {
19
23
  loadFence
20
- } from "./chunk-WK7ULBTP.js";
24
+ } from "./chunk-MVOWXQHN.js";
21
25
  import {
22
26
  VectorSet,
23
27
  buildPersistedIndexCallbacks,
24
28
  encodeVecId,
25
29
  syncTierSearch
26
- } from "./chunk-PWPYO73B.js";
30
+ } from "./chunk-ZGGVOADG.js";
27
31
  import {
28
32
  SchemaUpdateGate
29
33
  } from "./chunk-6LJY7X5A.js";
@@ -31,38 +35,41 @@ import {
31
35
  NO_CLASSIFIED,
32
36
  guardClassifiedCompat,
33
37
  resolveClassifiedFields
34
- } from "./chunk-DAFBJS4Y.js";
38
+ } from "./chunk-GS5RT2KK.js";
35
39
  import {
36
40
  NO_TIERS,
37
41
  classifySealedShred,
38
42
  syncDerivedOutputs
39
- } from "./chunk-RQ4ZI4ZI.js";
43
+ } from "./chunk-PGAPBZEK.js";
40
44
  import {
41
45
  NO_PORTABILITY
42
- } from "./chunk-BLBAQRBM.js";
46
+ } from "./chunk-FUHKW252.js";
43
47
  import {
44
48
  NO_CARGO,
45
49
  runDrainBarrier
46
- } from "./chunk-TG634KCO.js";
50
+ } from "./chunk-DG27IUVI.js";
47
51
  import {
48
- resolveManagedSecret,
49
52
  saveSealedSecret
50
- } from "./chunk-CLE3TMIS.js";
53
+ } from "./chunk-MC2LFTQM.js";
51
54
  import {
55
+ fallbackDerivationName,
52
56
  jsonSchemaToFields
53
- } from "./chunk-VYYM3MEN.js";
57
+ } from "./chunk-KHKKD62N.js";
54
58
  import {
55
59
  derivePersistedSchema,
56
60
  isZod4Schema
57
- } from "./chunk-6ZNSB3H6.js";
61
+ } from "./chunk-2LGDCNFJ.js";
62
+ import {
63
+ loadPersistedSchema
64
+ } from "./chunk-V5C5NNBR.js";
58
65
  import {
59
66
  CustodyApi,
60
67
  NO_CUSTODY
61
- } from "./chunk-TS5XLBZR.js";
68
+ } from "./chunk-TLNNHG3A.js";
62
69
  import {
63
70
  DEFAULT_POSTURE,
64
71
  ViaGraph
65
- } from "./chunk-4ZKNC6A6.js";
72
+ } from "./chunk-T4GPR2IR.js";
66
73
  import {
67
74
  buildLookupAltIndex,
68
75
  buildLookupSnapshotRows,
@@ -86,30 +93,31 @@ import {
86
93
  selfWriteFieldEqual,
87
94
  touchFor,
88
95
  updateReferencingRecords
89
- } from "./chunk-LRRX57UA.js";
96
+ } from "./chunk-ZXJXDHNK.js";
90
97
  import {
91
98
  OverlayedCollection
92
- } from "./chunk-ZTLOXFPB.js";
99
+ } from "./chunk-OF3L2SD6.js";
93
100
  import {
94
101
  INDEXED_STORE_POLICY,
95
102
  NO_SYNC
96
103
  } from "./chunk-55LKVALY.js";
97
104
  import {
98
105
  NO_ATTESTATION
99
- } from "./chunk-5GQEU4DN.js";
106
+ } from "./chunk-VJFMXYKP.js";
100
107
  import {
101
108
  NO_CONSENT
102
109
  } from "./chunk-PEOZ34EM.js";
103
110
  import {
104
- NO_PERIODS
105
- } from "./chunk-ZFG5EBI3.js";
111
+ NO_PERIODS,
112
+ purgeMarkersOn
113
+ } from "./chunk-LTU4FLHG.js";
106
114
  import {
107
115
  PERIODS_COLLECTION,
108
116
  PERIOD_ARCHIVES_COLLECTION,
109
117
  PERIOD_FREEZES_COLLECTION,
110
118
  PERIOD_TARGET_PURGES_COLLECTION,
111
119
  periodExclusiveUpperBound
112
- } from "./chunk-NM5UYF6Q.js";
120
+ } from "./chunk-JXIDGFKS.js";
113
121
  import {
114
122
  NO_SHADOW
115
123
  } from "./chunk-SMY5X46Z.js";
@@ -118,9 +126,8 @@ import {
118
126
  } from "./chunk-DZFQVICS.js";
119
127
  import {
120
128
  TxContext,
121
- bestEffortRevert,
122
- revertExecuted
123
- } from "./chunk-GTYFIVIZ.js";
129
+ bestEffortRevert
130
+ } from "./chunk-35EBKWQU.js";
124
131
  import {
125
132
  lazy
126
133
  } from "./chunk-5D2ALSM5.js";
@@ -128,29 +135,32 @@ import {
128
135
  InvertedIndex,
129
136
  MemoryIndexStore,
130
137
  NO_SEARCH
131
- } from "./chunk-KYRDJI5O.js";
138
+ } from "./chunk-XBLKM73C.js";
132
139
  import {
133
140
  NO_SEQUENCE,
134
141
  SEQUENCE_COLLECTION,
135
142
  compileSequenceFormat,
136
143
  resolveSequenceKey
137
- } from "./chunk-NBXFCQX4.js";
144
+ } from "./chunk-NQCNSVGI.js";
138
145
  import {
139
146
  Query,
140
147
  ScanBuilder
141
- } from "./chunk-WBKZUO5V.js";
148
+ } from "./chunk-3737A6EA.js";
142
149
  import {
143
150
  EXPORT_AUDIT_COLLECTION,
144
151
  NO_BLOBS,
145
152
  createExportBlobsHandle,
146
153
  runCompaction
147
- } from "./chunk-WUHEP3HH.js";
154
+ } from "./chunk-P7NGLLUF.js";
148
155
  import {
149
156
  LazyQuery,
150
157
  NO_INDEXING,
151
158
  decodeIdxId,
152
159
  encodeIdxId
153
- } from "./chunk-L3YYLT4E.js";
160
+ } from "./chunk-JIUVJ4M7.js";
161
+ import {
162
+ normalizeIndexDefs
163
+ } from "./chunk-GQ3BX5EA.js";
154
164
  import {
155
165
  IMPLICIT_LAZY,
156
166
  Lru,
@@ -170,7 +180,7 @@ import {
170
180
  } from "./chunk-PVEWA2DU.js";
171
181
  import {
172
182
  dictCollectionName
173
- } from "./chunk-OWHP3H5C.js";
183
+ } from "./chunk-XB7LUDKM.js";
174
184
  import {
175
185
  NO_I18N,
176
186
  getAtPath,
@@ -178,11 +188,11 @@ import {
178
188
  isDictKeyDescriptor,
179
189
  isI18nTextDescriptor,
180
190
  isStaticDictDescriptor
181
- } from "./chunk-UADPR6F4.js";
191
+ } from "./chunk-7G6VDWXB.js";
182
192
  import {
183
193
  isViaInstalled,
184
194
  viaBinder
185
- } from "./chunk-6UBZ6I5Z.js";
195
+ } from "./chunk-UHXCLPGC.js";
186
196
  import {
187
197
  NO_TEAM,
188
198
  describeAllUsersAuth,
@@ -205,7 +215,7 @@ import {
205
215
  saveShamirRecoveryEntries,
206
216
  updateAuthenticator,
207
217
  writeMagicLinkGrant
208
- } from "./chunk-ZNWSG7XC.js";
218
+ } from "./chunk-DPJTDNUF.js";
209
219
  import {
210
220
  assertKeyringOpenAllowed,
211
221
  buildRecipientKeyringFile,
@@ -220,15 +230,15 @@ import {
220
230
  listUsers,
221
231
  loadKeyring,
222
232
  updateKeyringIdentity
223
- } from "./chunk-Q5YJCVJY.js";
233
+ } from "./chunk-RLWY6Z44.js";
224
234
  import {
225
235
  persistDirectoryConfig,
226
236
  readDirectoryConfig
227
- } from "./chunk-2BET5QTS.js";
237
+ } from "./chunk-27TCYH6G.js";
228
238
  import {
229
239
  NO_BROKER,
230
240
  buildCredentialBrokerHandle
231
- } from "./chunk-IXNCZTWA.js";
241
+ } from "./chunk-W3TVWF6N.js";
232
242
  import {
233
243
  NO_SESSION
234
244
  } from "./chunk-VKQCVU2Z.js";
@@ -242,10 +252,10 @@ import {
242
252
  assertCutoverTierSafe,
243
253
  assertTierWritable,
244
254
  liveRecordIsElevated
245
- } from "./chunk-JYJFGD2H.js";
255
+ } from "./chunk-3FSX6LDG.js";
246
256
  import {
247
257
  sha256Hex
248
- } from "./chunk-DQZXPGGZ.js";
258
+ } from "./chunk-24UICKTB.js";
249
259
  import {
250
260
  NO_FORGET,
251
261
  addSubjectRef,
@@ -254,10 +264,10 @@ import {
254
264
  readDottedPath,
255
265
  rebuildSubjectIndex,
256
266
  removeSubjectRef
257
- } from "./chunk-ZHDSUZQU.js";
267
+ } from "./chunk-RPXL6KSX.js";
258
268
  import {
259
269
  NO_SEALED_RECORD
260
- } from "./chunk-QD46HPZG.js";
270
+ } from "./chunk-FAXZQ5UF.js";
261
271
  import {
262
272
  RecordCodec,
263
273
  SEALED_CEK_NS,
@@ -268,20 +278,20 @@ import {
268
278
  queryByDet,
269
279
  resolveStableCek,
270
280
  validateSchemaInput
271
- } from "./chunk-SU6SGWXM.js";
281
+ } from "./chunk-FY343IZR.js";
272
282
  import {
273
283
  buildDeleteMarker,
274
284
  buildTombstone,
275
285
  isDeleteMarker,
276
286
  isTombstone
277
- } from "./chunk-EFJAAFBW.js";
287
+ } from "./chunk-NQRJ5AJO.js";
278
288
  import {
279
289
  encrypt
280
- } from "./chunk-AKKRXT23.js";
290
+ } from "./chunk-VCETL77O.js";
281
291
  import {
282
292
  NOYDB_FORMAT_VERSION,
283
293
  SealedHandle
284
- } from "./chunk-77AEMXFA.js";
294
+ } from "./chunk-24ZLWWEO.js";
285
295
  import {
286
296
  AlreadyElevatedError,
287
297
  AttestationError,
@@ -291,6 +301,7 @@ import {
291
301
  ConflictError,
292
302
  DebugPlaintextError,
293
303
  DictKeyInUseError,
304
+ EchoCeremonyRequiredError,
294
305
  ElevationExpiredError,
295
306
  ExportCapabilityError,
296
307
  FieldNotQueryableError,
@@ -321,8 +332,9 @@ import {
321
332
  UniqueConstraintError,
322
333
  UnsupportedIndexOptionError,
323
334
  UnsupportedTierCompositionError,
324
- ValidationError
325
- } from "./chunk-QZWTRENR.js";
335
+ ValidationError,
336
+ isConflictError
337
+ } from "./chunk-HNGSV2YC.js";
326
338
 
327
339
  // src/with-commit/tx/strategy.ts
328
340
  var NOT_ENABLED = new Error(
@@ -386,9 +398,91 @@ function resolveStrategies(options) {
386
398
  return resolved;
387
399
  }
388
400
 
401
+ // src/kernel/secret-mode.ts
402
+ function validateSecretModeOptions(options) {
403
+ const encrypted = options.encrypt !== false;
404
+ const managed = options.secretMode === "managed";
405
+ const echo = options.secretMode === "echo";
406
+ if (options.secret && options.getKeyring) {
407
+ throw new ValidationError("Provide either `secret` or `getKeyring`, not both");
408
+ }
409
+ if (managed) {
410
+ if (options.secret) {
411
+ throw new ValidationError(
412
+ '`secretMode: "managed"` is mutually exclusive with `secret` \u2014 managed mode generates the secret itself. Drop `secret`.'
413
+ );
414
+ }
415
+ if (options.getKeyring) {
416
+ throw new ValidationError(
417
+ '`secretMode: "managed"` is mutually exclusive with `getKeyring` \u2014 a custom unlock callback would bypass the sealing flow. Drop `getKeyring`.'
418
+ );
419
+ }
420
+ if (!options.sealingKey) {
421
+ throw new ValidationError(
422
+ '`secretMode: "managed"` requires `sealingKey: SealingKeyProvider` (see @noy-db/seal-macos-keychain / @noy-db/seal-aws-kms / etc.).'
423
+ );
424
+ }
425
+ }
426
+ if (echo && typeof options.secret === "string") {
427
+ throw new ValidationError(
428
+ "secretMode 'echo' requires a structured { prompt, echo, key } secret \u2014 a single string can never unlock an echo vault (AG-1)."
429
+ );
430
+ }
431
+ if (echo && typeof options.secret === "object" && options.secret !== null) {
432
+ const parts = options.secret;
433
+ if (typeof parts.prompt !== "string" || typeof parts.echo !== "string" || typeof parts.key !== "string") {
434
+ throw new ValidationError(
435
+ "secretMode 'echo' requires a structured secret with all three fields present as strings: prompt, echo, key."
436
+ );
437
+ }
438
+ }
439
+ if (!echo && options.secret !== void 0 && typeof options.secret !== "string") {
440
+ throw new ValidationError("A { prompt, echo, key } secret requires secretMode: 'echo'.");
441
+ }
442
+ if (!echo && options.deviceSeal !== void 0) {
443
+ throw new ValidationError("deviceSeal is only meaningful with secretMode: 'echo'.");
444
+ }
445
+ if (!echo && options.echoSecretPolicy !== void 0) {
446
+ throw new ValidationError("echoSecretPolicy is only meaningful with secretMode: 'echo'.");
447
+ }
448
+ if (!echo && options.echoMaskHint !== void 0) {
449
+ throw new ValidationError("echoMaskHint is only meaningful with secretMode: 'echo'.");
450
+ }
451
+ if (echo && options.sealingKey !== void 0) {
452
+ throw new ValidationError(
453
+ "secretMode 'echo' is mutually exclusive with `sealingKey` \u2014 that provider belongs to managed mode."
454
+ );
455
+ }
456
+ if (echo && options.secret === void 0 && options.getKeyring === void 0) {
457
+ throw new ValidationError(
458
+ "secretMode 'echo' requires either a structured secret or a getKeyring ceremony hook."
459
+ );
460
+ }
461
+ if (encrypted && !managed && !options.secret && !options.getKeyring) {
462
+ throw new ValidationError("A secret (secret) or getKeyring callback is required when encryption is enabled");
463
+ }
464
+ }
465
+ async function resolveEffectiveSecret(options, store, vault) {
466
+ if (options.secretMode === "managed") {
467
+ const { resolveManagedSecret } = await import("./managed-secret-EAOYWRYF.js");
468
+ return resolveManagedSecret(store, vault, options.sealingKey);
469
+ }
470
+ return options.secret;
471
+ }
472
+ function ownerKeyringOptions(options, secret) {
473
+ return {
474
+ userId: options.user,
475
+ secret,
476
+ validate: options.secretMode === "managed" ? false : options.validateSecret === true,
477
+ ...options.deviceSeal !== void 0 && { deviceSeal: options.deviceSeal },
478
+ ...options.echoSecretPolicy !== void 0 && { echoSecretPolicy: options.echoSecretPolicy },
479
+ ...options.echoMaskHint !== void 0 && { echoMaskHint: options.echoMaskHint }
480
+ };
481
+ }
482
+
389
483
  // src/port/by/default-provider.ts
390
484
  async function createDefaultCoordinationProvider(store) {
391
- const { StoreCoordinationProvider } = await import("./store-coordination-provider-AHGFEMFA.js");
485
+ const { StoreCoordinationProvider } = await import("./store-coordination-provider-4SKLSFUG.js");
392
486
  return new StoreCoordinationProvider(store);
393
487
  }
394
488
 
@@ -835,6 +929,40 @@ async function countLiveEnvelopes(adapter, vault, name, storeCiphertext) {
835
929
  return n;
836
930
  }
837
931
 
932
+ // src/kernel/cutover-transform.ts
933
+ async function applyCutoverTransform(ctx) {
934
+ const ids = await ctx.adapter.list(ctx.vault, ctx.name);
935
+ await assertCutoverTierSafe(ctx.adapter, ctx.vault, ctx.name, ctx.tiers !== null);
936
+ let count = 0;
937
+ for (const id of ids) {
938
+ const env = await ctx.adapter.get(ctx.vault, ctx.name, id);
939
+ if (!env || isTombstone(env, ctx.storeCiphertext) || isDeleteMarker(env)) continue;
940
+ const decoded = await ctx.codec.decryptRecord(env, { skipValidation: true, id });
941
+ if (decoded === null) continue;
942
+ const record = decoded;
943
+ const next = ctx.transform(record);
944
+ const nextVersion = (env._v ?? 0) + 1;
945
+ const cek = ctx.perRecordCek ? await ctx.resolveRecordCek(id) : void 0;
946
+ const migEnvelope = await ctx.codec.encryptRecord(next, nextVersion, cek, void 0, void 0, ctx.vdigFields !== null ? { id, prev: env } : void 0, id);
947
+ await ctx.adapter.put(ctx.vault, ctx.name, id, migEnvelope);
948
+ await ctx.onRecordMutated(id, "put", "cutover");
949
+ if (ctx.ledger) {
950
+ await ctx.ledger.append({
951
+ op: "migration",
952
+ collection: ctx.name,
953
+ id,
954
+ version: nextVersion,
955
+ actor: ctx.keyring.userId,
956
+ payloadHash: await ctx.envelopePayloadHash(migEnvelope),
957
+ reason: "schema:coordinated-cutover"
958
+ }).catch(() => {
959
+ });
960
+ }
961
+ count++;
962
+ }
963
+ return count;
964
+ }
965
+
838
966
  // src/with-lookup/indexing/collection-facade.ts
839
967
  function readPersistedValue(record, field) {
840
968
  if (!field.includes(".")) return record[field];
@@ -1474,6 +1602,16 @@ async function deriveZodFields(schema) {
1474
1602
  }
1475
1603
  return result;
1476
1604
  }
1605
+ async function resolveDescribeFieldIds(store, vaultName, collectionName, getDEK) {
1606
+ let dek;
1607
+ try {
1608
+ dek = await getDEK(collectionName);
1609
+ } catch {
1610
+ return {};
1611
+ }
1612
+ const persisted = await loadPersistedSchema(store, vaultName, collectionName, dek);
1613
+ return persisted?.fieldIds !== void 0 ? { fieldIds: persisted.fieldIds } : {};
1614
+ }
1477
1615
  function deriveWidget(opts) {
1478
1616
  if (opts.resolvedWidget !== void 0) return opts.resolvedWidget;
1479
1617
  switch (opts.semanticType) {
@@ -1498,7 +1636,7 @@ function deriveWidget(opts) {
1498
1636
  return "text";
1499
1637
  }
1500
1638
  function buildDescription(input) {
1501
- const { collection, fieldMeta, moneyFields, dictKeyFields, lookupFields, computed, refs, zodFields, dictLabels, meta, i18nFields, classified, taint } = input;
1639
+ const { collection, fieldMeta, moneyFields, dictKeyFields, lookupFields, computed, refs, zodFields, dictLabels, meta, i18nFields, classified, taint, fieldIds } = input;
1502
1640
  const lookupFragments = input.viaFragments?.["lookup"]?.lookupFields;
1503
1641
  const blobFragments = input.viaFragments?.["blob"]?.blobFields;
1504
1642
  if (zodFields !== void 0 && Object.keys(zodFields).length > 0 && fieldMeta !== void 0) {
@@ -1665,6 +1803,7 @@ function buildDescription(input) {
1665
1803
  const editable = !isComputed && key !== "id" && blobBlock === void 0;
1666
1804
  const field = {
1667
1805
  key,
1806
+ ...fieldIds?.[key] !== void 0 ? { id: fieldIds[key] } : {},
1668
1807
  type,
1669
1808
  optional: zod?.optional ?? false,
1670
1809
  ...zod?.constraints !== void 0 ? { constraints: zod.constraints } : {},
@@ -1710,6 +1849,109 @@ function buildDescription(input) {
1710
1849
  };
1711
1850
  }
1712
1851
 
1852
+ // src/kernel/put-many-atomic.ts
1853
+ var toRevertLeg = ({ op, priorEnvelope }) => ({
1854
+ vaultName: op.vaultName,
1855
+ collectionName: op.collectionName,
1856
+ id: op.id,
1857
+ prior: priorEnvelope
1858
+ });
1859
+ async function runPutManyAtomic(ctx, entries) {
1860
+ const { store, vault, name } = ctx;
1861
+ const priors = /* @__PURE__ */ new Map();
1862
+ let duplicateId = false;
1863
+ for (const [id, , opts] of entries) {
1864
+ if (priors.has(id)) duplicateId = true;
1865
+ else priors.set(id, await store.get(vault, name, id));
1866
+ if (opts?.expectedVersion !== void 0) {
1867
+ const actual = priors.get(id)?._v ?? 0;
1868
+ if (actual !== opts.expectedVersion) {
1869
+ throw new ConflictError(
1870
+ actual,
1871
+ `putMany atomic: ${vault}/${name}/${id} expected v${opts.expectedVersion}, found v${actual}`
1872
+ );
1873
+ }
1874
+ }
1875
+ }
1876
+ if (!duplicateId && store.capabilities?.txAtomic === true && typeof store.tx === "function" && ctx.host._txAtomicSafe("put")) {
1877
+ return commitViaStoreTx(ctx, entries, priors);
1878
+ }
1879
+ return commitSequentially(ctx, entries, priors);
1880
+ }
1881
+ async function commitViaStoreTx(ctx, entries, priors) {
1882
+ const { host, store, vault, name } = ctx;
1883
+ await host._assertWriteGates();
1884
+ const executed = [];
1885
+ const legs = [];
1886
+ for (const [id, record] of entries) {
1887
+ const prior = priors.get(id) ?? null;
1888
+ executed.push({ op: { type: "put", vaultName: vault, collectionName: name, id }, priorEnvelope: prior });
1889
+ const prepared = await host._preparePut(id, record);
1890
+ legs.push({
1891
+ prepared,
1892
+ // Every leg carries CAS against the Phase-1 snapshot, so a writer
1893
+ // landing between prepare and the batch reaching the store loses.
1894
+ txOp: { type: "put", vault, collection: name, id, expectedVersion: prior?._v ?? 0, envelope: prepared.envelope }
1895
+ });
1896
+ }
1897
+ await store.tx(legs.map((l) => l.txOp));
1898
+ try {
1899
+ for (const leg of legs) {
1900
+ await host._finalizePut(leg.prepared);
1901
+ await host._fireAtomicAfterWrite("put", leg.prepared);
1902
+ }
1903
+ } catch (err) {
1904
+ await bestEffortRevert(executed.map(toRevertLeg), store);
1905
+ for (const { op } of [...executed].reverse()) {
1906
+ try {
1907
+ await host._invalidateCacheEntry(op.id);
1908
+ } catch {
1909
+ }
1910
+ }
1911
+ throw err;
1912
+ }
1913
+ return { ok: true, success: entries.map(([id]) => id), failures: [] };
1914
+ }
1915
+ async function commitSequentially(ctx, entries, priors) {
1916
+ const { host, store, vault, name, derivationSource } = ctx;
1917
+ const txCtx = derivationSource?.createTxContext() ?? null;
1918
+ if (txCtx !== null && derivationSource) {
1919
+ derivationSource.setActiveTxContext(txCtx);
1920
+ }
1921
+ const localExecuted = [];
1922
+ try {
1923
+ for (const [id, record] of entries) {
1924
+ const entry = {
1925
+ op: { type: "put", vaultName: vault, collectionName: name, id },
1926
+ priorEnvelope: priors.get(id) ?? null
1927
+ };
1928
+ if (txCtx !== null) txCtx._executed.push(entry);
1929
+ else localExecuted.push(entry);
1930
+ await host.put(id, record);
1931
+ }
1932
+ return { ok: true, success: entries.map(([id]) => id), failures: [] };
1933
+ } catch (err) {
1934
+ const executedForRevert = txCtx !== null ? txCtx._executed : localExecuted;
1935
+ await bestEffortRevert(executedForRevert.map(toRevertLeg), store);
1936
+ for (const { op } of [...executedForRevert].reverse()) {
1937
+ if (op.vaultName !== vault) continue;
1938
+ try {
1939
+ if (op.collectionName === name) {
1940
+ await host._invalidateCacheEntry(op.id);
1941
+ } else if (derivationSource) {
1942
+ await derivationSource.getCollection(op.collectionName)._invalidateCacheEntry(op.id);
1943
+ }
1944
+ } catch {
1945
+ }
1946
+ }
1947
+ throw err;
1948
+ } finally {
1949
+ if (txCtx !== null && derivationSource) {
1950
+ derivationSource.clearActiveTxContext(txCtx);
1951
+ }
1952
+ }
1953
+ }
1954
+
1713
1955
  // src/kernel/via/compose.ts
1714
1956
  function via(...descriptors) {
1715
1957
  if (descriptors.length === 0) {
@@ -2174,7 +2416,7 @@ function resolveCollectionConfig(opts) {
2174
2416
  }
2175
2417
 
2176
2418
  // src/with-formula/computed/lazy.ts
2177
- var loadComputed = lazy(() => import("./computed-AB45PS4V.js"));
2419
+ var loadComputed = lazy(() => import("./computed-6G5M3UPH.js"));
2178
2420
  async function loadEvalComputedFields() {
2179
2421
  return (await loadComputed()).evalComputedFields;
2180
2422
  }
@@ -2275,6 +2517,8 @@ var Collection = class {
2275
2517
  * `null` when no `unique:true` indexes are declared on this collection, or when the collection is in lazy mode (which throws at registration).
2276
2518
  */
2277
2519
  uniqueConstraints;
2520
+ declaredIndexes;
2521
+ // declared index defs, normalized (introspection only)
2278
2522
  /**
2279
2523
  * True once `_idx/*` side-cars have been bulk-loaded into
2280
2524
  * `persistedIndexes`. Flipped by `ensurePersistedIndexesLoaded()` on
@@ -2596,12 +2840,7 @@ var Collection = class {
2596
2840
  );
2597
2841
  }
2598
2842
  if (this.sensitiveFields.size > 0 && opts.indexes) {
2599
- const indexedFields = /* @__PURE__ */ new Set();
2600
- for (const def of opts.indexes) {
2601
- if (typeof def === "string") indexedFields.add(def);
2602
- else if (Array.isArray(def)) for (const f of def) indexedFields.add(f);
2603
- else for (const f of def.fields) indexedFields.add(f);
2604
- }
2843
+ const indexedFields = new Set(normalizeIndexDefs(opts.indexes).flatMap((d) => d.fields));
2605
2844
  const leaked = [...this.sensitiveFields].filter((f) => indexedFields.has(f));
2606
2845
  if (leaked.length > 0) {
2607
2846
  console.warn(
@@ -2705,6 +2944,7 @@ var Collection = class {
2705
2944
  defs: opts.indexes ?? [],
2706
2945
  lazy: this.lazy
2707
2946
  });
2947
+ this.declaredIndexes = normalizeIndexDefs(opts.indexes ?? []);
2708
2948
  this.indexes?.setCanonicalizer((f, v) => this.via?.canonicalizeIndexKey(f, v));
2709
2949
  this.persistedIndexes?.setCanonicalizer((f, v) => this.via?.canonicalizeIndexKey(f, v));
2710
2950
  this.uniqueConstraints = buildUniqueConstraintSet(this.name, opts.indexes, {
@@ -2735,6 +2975,10 @@ var Collection = class {
2735
2975
  getMeta() {
2736
2976
  return this.meta;
2737
2977
  }
2978
+ getDeclaredIndexes() {
2979
+ return this.declaredIndexes;
2980
+ }
2981
+ // declared index defs, normalized; consumed by walk.ts
2738
2982
  /**
2739
2983
  * Aggregate all collection-level configuration options that are actively set
2740
2984
  * into a {@link CollectionConfig} snapshot. Returns `undefined` when no options
@@ -2830,8 +3074,10 @@ var Collection = class {
2830
3074
  ...this.i18nFields !== void 0 ? { i18nFields: this.i18nFields } : {},
2831
3075
  ...this.classified !== void 0 ? { classified: this.classified.byField } : {},
2832
3076
  ...this.via?.taint !== void 0 ? { taint: this.via.taint } : {},
2833
- ...this.via ? { viaFragments: this.via.describeFragments() } : {}
3077
+ ...this.via ? { viaFragments: this.via.describeFragments() } : {},
2834
3078
  // #650 Task 7
3079
+ ...await resolveDescribeFieldIds(this.adapter, this.vault, this.name, this.getDEK)
3080
+ // #946
2835
3081
  });
2836
3082
  }
2837
3083
  /** JSON Schema for this collection with describe() metadata as x- extensions. */
@@ -2952,7 +3198,7 @@ var Collection = class {
2952
3198
  }
2953
3199
  await this.onAccess?.("find", "*");
2954
3200
  if (hits.length === 0) return [];
2955
- const { verifyDigestField } = await import("./verify-7XWHJWUN.js");
3201
+ const { verifyDigestField } = await import("./verify-RO5RTZOJ.js");
2956
3202
  const policy = {
2957
3203
  normalize: spec.verifyNormalize ?? "password",
2958
3204
  notLastN: spec.notLastN ?? 0,
@@ -3158,7 +3404,7 @@ var Collection = class {
3158
3404
  }
3159
3405
  }
3160
3406
  if (this.materializedViewSource !== void 0) {
3161
- const { resolveStaleMVOnRead } = await import("./stale-T3V7XEOB.js");
3407
+ const { resolveStaleMVOnRead } = await import("./stale-K734VACF.js");
3162
3408
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
3163
3409
  }
3164
3410
  let record;
@@ -3688,7 +3934,7 @@ var Collection = class {
3688
3934
  */
3689
3935
  async dispatchMaterializedViews(id, record, wave) {
3690
3936
  if (this.materializedViewSource === void 0) return;
3691
- const { dispatchMaterializedViews } = await import("./dispatch-6TV3DGO6.js");
3937
+ const { dispatchMaterializedViews } = await import("./dispatch-4XIJSFTT.js");
3692
3938
  return dispatchMaterializedViews(this.#mvDispatchCtx(this.materializedViewSource), id, record, wave);
3693
3939
  }
3694
3940
  /**
@@ -3861,7 +4107,7 @@ var Collection = class {
3861
4107
  * dispatch wave's per-target dedup; `undefined` on the local-write path (byte-identical). */
3862
4108
  async dispatchDerivations(id, record, version, wave) {
3863
4109
  if (this.derivationSource === void 0) return;
3864
- const { dispatchDerivations } = await import("./dispatch-W7NWQ637.js");
4110
+ const { dispatchDerivations } = await import("./dispatch-N5HGVUGU.js");
3865
4111
  return dispatchDerivations({
3866
4112
  ...this.#derivationDeleteCtx(this.derivationSource),
3867
4113
  via: this.via,
@@ -3905,38 +4151,28 @@ var Collection = class {
3905
4151
  }
3906
4152
  }
3907
4153
  /**
3908
- * @internal — bulk-rewrite every record through a cutover transform. Raw adapter path (bypasses the write gate + guards — the transform is trusted and runs only during the `migrating` phase). Bumps each record's `_v` and appends a ledger `op:'migration'` entry. #708: refuses BEFORE any rewrite if a live record is elevated (assertCutoverTierSafe) — demote it first.
4154
+ * @internal — bulk-rewrite every record through a cutover transform. Body
4155
+ * lives in `./cutover-transform.js` (kernel-surface line ceiling); this is
4156
+ * a thin context-passing delegator. See {@link applyCutoverTransform} for
4157
+ * the full behavior doc.
3909
4158
  */
3910
4159
  async _applyCutoverTransform(transform) {
3911
- const ids = await this.adapter.list(this.vault, this.name);
3912
- await assertCutoverTierSafe(this.adapter, this.vault, this.name, this.tiers !== null);
3913
- let count = 0;
3914
- for (const id of ids) {
3915
- const env = await this.adapter.get(this.vault, this.name, id);
3916
- if (!env || isTombstone(env, this.storeCiphertext) || isDeleteMarker(env)) continue;
3917
- const decoded = await this.codec.decryptRecord(env, { skipValidation: true, id });
3918
- if (decoded === null) continue;
3919
- const record = decoded;
3920
- const next = transform(record);
3921
- const nextVersion = (env._v ?? 0) + 1;
3922
- const cek = this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
3923
- await this.adapter.put(this.vault, this.name, id, await this.codec.encryptRecord(next, nextVersion, cek, void 0, void 0, this.vdigFields !== null ? { id, prev: env } : void 0, id));
3924
- await this._onRecordMutated(id, "put", "cutover");
3925
- if (this.ledger) {
3926
- await this.ledger.append({
3927
- op: "migration",
3928
- collection: this.name,
3929
- id,
3930
- version: nextVersion,
3931
- actor: this.keyring.userId,
3932
- payloadHash: "",
3933
- reason: "schema:coordinated-cutover"
3934
- }).catch(() => {
3935
- });
3936
- }
3937
- count++;
3938
- }
3939
- return count;
4160
+ return applyCutoverTransform({
4161
+ adapter: this.adapter,
4162
+ vault: this.vault,
4163
+ name: this.name,
4164
+ tiers: this.tiers,
4165
+ storeCiphertext: this.storeCiphertext,
4166
+ codec: this.codec,
4167
+ perRecordCek: this.perRecordCek,
4168
+ vdigFields: this.vdigFields,
4169
+ ledger: this.ledger,
4170
+ keyring: this.keyring,
4171
+ resolveRecordCek: this.resolveRecordCek.bind(this),
4172
+ onRecordMutated: this._onRecordMutated.bind(this),
4173
+ envelopePayloadHash: (envelope) => this.strategies.history.envelopePayloadHash(envelope),
4174
+ transform
4175
+ });
3940
4176
  }
3941
4177
  /** @internal Untracked delete body — call {@link delete}, not this. */
3942
4178
  async _deleteInternal(id) {
@@ -4186,7 +4422,7 @@ var Collection = class {
4186
4422
  */
4187
4423
  async dispatchArrayDerivationsOnDelete(id, eraseRecordShapeToo = false) {
4188
4424
  if (this.derivationSource === void 0) return 0;
4189
- const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-W7NWQ637.js");
4425
+ const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-N5HGVUGU.js");
4190
4426
  return dispatchArrayDerivationsOnDelete(this.#derivationDeleteCtx(this.derivationSource), id, eraseRecordShapeToo);
4191
4427
  }
4192
4428
  /**
@@ -4200,7 +4436,7 @@ var Collection = class {
4200
4436
  */
4201
4437
  async dispatchMaterializedViewsOnDelete(id) {
4202
4438
  if (this.materializedViewSource === void 0) return { deleted: 0, residueUndecodable: [], residueDeclined: [] };
4203
- const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-6TV3DGO6.js");
4439
+ const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-4XIJSFTT.js");
4204
4440
  return dispatchMaterializedViewsOnDelete(this.#mvDispatchCtx(this.materializedViewSource), id);
4205
4441
  }
4206
4442
  /**
@@ -4220,7 +4456,7 @@ var Collection = class {
4220
4456
  );
4221
4457
  }
4222
4458
  if (this.materializedViewSource !== void 0) {
4223
- const { resolveStaleMVOnRead } = await import("./stale-T3V7XEOB.js");
4459
+ const { resolveStaleMVOnRead } = await import("./stale-K734VACF.js");
4224
4460
  await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
4225
4461
  }
4226
4462
  await this.ensureHydrated();
@@ -4308,8 +4544,11 @@ var Collection = class {
4308
4544
  * **True tx-atomic putMany** — pass `{ atomic: true }` to switch
4309
4545
  * to the transaction executor: pre-flight CAS against every
4310
4546
  * item's `expectedVersion`, then commit all ops with best-effort
4311
- * revert on mid-batch failure. Atomic mode throws on failure rather
4312
- * than returning a mixed-results object.
4547
+ * revert on mid-batch failure. On a store that declares `txAtomic`
4548
+ * the whole batch is instead submitted as ONE `store.tx()` call with
4549
+ * per-leg CAS (#921) — genuinely all-or-nothing, with history/ledger/
4550
+ * change events firing after the batch is durable. Atomic mode throws
4551
+ * on failure rather than returning a mixed-results object.
4313
4552
  *
4314
4553
  * ## Change events
4315
4554
  *
@@ -4334,66 +4573,20 @@ var Collection = class {
4334
4573
  return { ok: failures.length === 0, success, failures };
4335
4574
  }
4336
4575
  /**
4337
- * Atomic-mode implementation of {@link putMany}. Pre-flights every
4338
- * `expectedVersion`, executes all puts in declaration order, and
4339
- * reverts executed ops via the raw adapter on mid-batch failure.
4340
- * See `runTransaction` for the shared semantics + crash-window caveat.
4576
+ * Atomic-mode implementation of {@link putMany} both branches live in
4577
+ * `kernel/put-many-atomic.ts`: #921 delegates the batch through ONE
4578
+ * `store.tx()` on a `txAtomic` store when the single-collection
4579
+ * reduction of the #906 gate admits it (store bits + no duplicate ids +
4580
+ * `_txAtomicSafe('put')`); anything else keeps the sequential pre-flight
4581
+ * → execute → best-effort-revert loop.
4341
4582
  *
4342
4583
  * @internal
4343
4584
  */
4344
- async putManyAtomic(entries) {
4345
- const priors = /* @__PURE__ */ new Map();
4346
- for (const [id, , opts] of entries) {
4347
- if (!priors.has(id)) {
4348
- priors.set(id, await this.adapter.get(this.vault, this.name, id));
4349
- }
4350
- if (opts?.expectedVersion !== void 0) {
4351
- const env = priors.get(id) ?? null;
4352
- const actual = env?._v ?? 0;
4353
- if (actual !== opts.expectedVersion) {
4354
- throw new ConflictError(
4355
- actual,
4356
- `putMany atomic: ${this.vault}/${this.name}/${id} expected v${opts.expectedVersion}, found v${actual}`
4357
- );
4358
- }
4359
- }
4360
- }
4361
- const txCtx = this.derivationSource?.createTxContext() ?? null;
4362
- if (txCtx !== null && this.derivationSource) {
4363
- this.derivationSource.setActiveTxContext(txCtx);
4364
- }
4365
- const localExecuted = [];
4366
- try {
4367
- for (const [id, record] of entries) {
4368
- const entry = {
4369
- op: { type: "put", vaultName: this.vault, collectionName: this.name, id },
4370
- priorEnvelope: priors.get(id) ?? null
4371
- };
4372
- if (txCtx !== null) txCtx._executed.push(entry);
4373
- else localExecuted.push(entry);
4374
- await this.put(id, record);
4375
- }
4376
- return { ok: true, success: entries.map(([id]) => id), failures: [] };
4377
- } catch (err) {
4378
- const executedForRevert = txCtx !== null ? txCtx._executed : localExecuted;
4379
- await revertExecuted(executedForRevert, this.adapter);
4380
- for (const { op } of [...executedForRevert].reverse()) {
4381
- if (op.vaultName !== this.vault) continue;
4382
- try {
4383
- if (op.collectionName === this.name) {
4384
- await this._invalidateCacheEntry(op.id);
4385
- } else if (this.derivationSource) {
4386
- await this.derivationSource.getCollection(op.collectionName)._invalidateCacheEntry(op.id);
4387
- }
4388
- } catch {
4389
- }
4390
- }
4391
- throw err;
4392
- } finally {
4393
- if (txCtx !== null && this.derivationSource) {
4394
- this.derivationSource.clearActiveTxContext(txCtx);
4395
- }
4396
- }
4585
+ putManyAtomic(entries) {
4586
+ return runPutManyAtomic(
4587
+ { host: this, store: this.adapter, vault: this.vault, name: this.name, derivationSource: this.derivationSource },
4588
+ entries
4589
+ );
4397
4590
  }
4398
4591
  /**
4399
4592
  * Get many records in one call. Returns a `Map<id, T | null>` —
@@ -5373,14 +5566,14 @@ var Collection = class {
5373
5566
  /** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
5374
5567
  async _ensureClassifiedMarker() {
5375
5568
  if (this._markerPersisted || this.vdigFields === null) return;
5376
- const { persistClassifiedMarkerForFields } = await import("./classified-marker-LE54HWSX.js");
5569
+ const { persistClassifiedMarkerForFields } = await import("./classified-marker-MH3ON5OL.js");
5377
5570
  await persistClassifiedMarkerForFields(this.adapter, this.vault, this.name, this.vdigFields, await this.getDEK(this.name));
5378
5571
  this._markerPersisted = true;
5379
5572
  }
5380
5573
  /** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
5381
5574
  async _classifiedMarkerDigestOnly() {
5382
5575
  if (this._markerDigestOnlyCache !== void 0) return this._markerDigestOnlyCache;
5383
- const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-LE54HWSX.js");
5576
+ const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-MH3ON5OL.js");
5384
5577
  this._markerDigestOnlyCache = await readClassifiedMarkerDigestOnly(this.adapter, this.vault, this.name, await this.getDEK(this.name));
5385
5578
  return this._markerDigestOnlyCache;
5386
5579
  }
@@ -5479,11 +5672,33 @@ var Collection = class {
5479
5672
  await this.schemaFence?.assertWritable(this.name);
5480
5673
  }
5481
5674
  // @internal #906 — the two refusals `put()`/`delete()` assert BEFORE anything else: the schema-update gate (an opt-in but persistent `reject` decision) and the schema fence (stale generation → MigrationRequiredError; draining/migrating vault or pending per-collection cutover → SchemaFenceError). Neither lives in the prepare halves, and the atomic commit path calls those directly — so it asserts here, per op, mirroring put()/delete() exactly (the fence does a fresh store read per call, so per-op matches today's cost model). Deliberately NOT moved into the prepare halves: that would double-assert on the OCC path.
5675
+ /**
5676
+ * @internal #931 — the after-write OBSERVERS `put()`/`delete()` fire in
5677
+ * their wrappers (user `onAfterWrite` hooks, then the `afterPut`/
5678
+ * `afterDelete` observe bus), replayed for one atomic-path leg after its
5679
+ * finalize. Neither can refuse a completed write, so since #931 they no
5680
+ * longer gate `_txAtomicSafe`; skipping them silently would still be a
5681
+ * policy hole (forget's subject index and the cross-tab write relay are
5682
+ * both wired this way), so the atomic path calls this per leg. The
5683
+ * WriteEvent is built from the prepared carrier — same prior basis the
5684
+ * wrappers use — and the same re-entrancy guards apply (`runAfter`
5685
+ * suppresses nested hook firing; the bus gate checks `dispatching`).
5686
+ */
5687
+ async _fireAtomicAfterWrite(opType, prepared) {
5688
+ const hooksActive = this.#hooksActive();
5689
+ const busPoint = opType === "put" ? "afterPut" : "afterDelete";
5690
+ const busActive = (this.subsystemBus?.hasHandlers(busPoint) ?? false) && !(this.subsystemBus?.dispatching ?? false);
5691
+ if (!hooksActive && !busActive) return;
5692
+ const base = { vault: this.vault, collection: this.name, userId: this.keyring.userId, timestamp: Date.now(), txId: this.#txIdForHook() };
5693
+ const event = opType === "put" ? { ...base, op: prepared.prior ? "update" : "create", docId: prepared.id, before: prepared.prior?.record ?? null, after: prepared.event, baseVersion: prepared.prior?.version ?? 0, version: prepared.version } : { ...base, op: "delete", docId: prepared.id, before: prepared.existing?.record ?? null, after: null, baseVersion: prepared.existing?.version ?? 0, version: (prepared.existing?.version ?? 0) + 1 };
5694
+ if (hooksActive) await this.writeHooks.runAfter(event);
5695
+ if (busActive) await this.subsystemBus.dispatch(busPoint, event);
5696
+ }
5482
5697
  _txAtomicSafe(opType) {
5483
- if (this.materializedViewSource !== void 0 && this.materializedViewSource.registry().mvsForSource(this.name).length > 0 || this.derivationSource !== void 0 && this.derivationSource.registry().strategiesForSource(this.name).length > 0 || this.crdtMode !== void 0 || this.uniqueConstraints !== null || this.#hooksActive() || (this.subsystemBus?.hasHandlers(opType === "put" ? "afterPut" : "afterDelete") ?? false)) return false;
5484
- return opType === "put" ? Object.keys(this._refs).length === 0 : this.refEnforcer === void 0;
5698
+ if (this.materializedViewSource !== void 0 && this.materializedViewSource.registry().mvsForSource(this.name).length > 0 || this.derivationSource !== void 0 && this.derivationSource.registry().strategiesForSource(this.name).length > 0 || this.crdtMode !== void 0 || this.uniqueConstraints !== null || this.writeHooks !== void 0 && this.writeHooks.hasBeforeHandlers && !this.writeHooks.suppressed) return false;
5699
+ return opType === "put" ? Object.keys(this._refs).length === 0 : this.refEnforcer === void 0 || !this.refEnforcer._deleteCascadesPossible(this.name);
5485
5700
  }
5486
- // @internal #893/#906-prep atomic-commit eligibility gate (Task 4) — false on any derivation/MV source (any lifecycle), CRDT mode, unique constraints, or refs on this write direction. Put uses precise outbound `_refs`; delete deliberately uses blanket `refEnforcer` presence, NOT `refRegistry.getInbound()` — `enforceRefsOnDelete` (with-shape/links/vault-facade.ts) cascades from THREE sources (lookup-ref edges, classic inbound refs, managed links), and only the blanket check is >= as strict as all three. #906: also false while user write-hooks or an `afterPut`/`afterDelete` bus handler are live note both signals are db-GLOBAL (one `onAfterWrite` anywhere, including the auto-registered cross-tab write relay, keeps every collection on the OCC path) both fire in `put()`/`delete()`, which the atomic path bypasses (a `beforeWrite` hook can REFUSE a write, so silently skipping them would be a policy hole). See atomic-eligibility.ts.
5701
+ // @internal #893/#906-prep atomic-commit eligibility gate (Task 4) — false on any derivation/MV source (any lifecycle), CRDT mode, unique constraints, or refs on this write direction. Put uses precise outbound `_refs`; delete (#922) consults the enforcer's `_deleteCascadesPossible(name)` — Vault unions ALL THREE cascade sources `enforceRefsOnDelete` (with-shape/links/vault-facade.ts) fires from (lookup-ref edges, classic inbound refs, managed links); anything narrower (e.g. `getInbound` alone) would admit unsafe atomic deletes, because `_prepareDelete` runs those cascades DURING prepare. #931 narrows #906's hooks blanket: only BEFORE-hooks gate (they can REFUSE a write, which only `put()`/`delete()` honors); after-hooks and the `afterPut`/`afterDelete` observe bus cannot refuse, so the atomic path fires them itself post-finalize via `_fireAtomicAfterWrite` instead of forfeiting the batch (the pre-#931 db-global blanket cost multi-tab write-relay and forget-subject apps the atomic path entirely). See atomic-eligibility.ts.
5487
5702
  _reconcileReadState(patch) {
5488
5703
  if (patch.dictKeyFields) this.dictKeyFields = { ...patch.dictKeyFields, ...this.dictKeyFields };
5489
5704
  if (patch.i18nFields) this.i18nFields = { ...patch.i18nFields, ...this.i18nFields };
@@ -5889,7 +6104,7 @@ var DeferredNumberingStore = class {
5889
6104
  try {
5890
6105
  await this.writeJson(NUMBERING_HEAD_COLLECTION, series, { series, lastSerial: serial, watermark: now.earliest }, headEnv?._v ?? 0);
5891
6106
  } catch (err) {
5892
- if (err instanceof ConflictError) return [];
6107
+ if (isConflictError(err)) return [];
5893
6108
  throw err;
5894
6109
  }
5895
6110
  for (const { id, entry } of settled) {
@@ -6833,7 +7048,7 @@ var VaultLinks = class {
6833
7048
  // src/with-shape/links/lazy-handle.ts
6834
7049
  function makeLazyLinkSetHandle(d) {
6835
7050
  let engine = null;
6836
- const load = () => engine ??= import("./link-set-CGYC3OH5.js").then(
7051
+ const load = () => engine ??= import("./link-set-2TTP4VLO.js").then(
6837
7052
  ({ LinkSet }) => new LinkSet(d.adapter, d.vault, d.name, d.spec, d.encrypted, d.getDEK, d.actor, d.emitter, d.endpointExists)
6838
7053
  );
6839
7054
  return {
@@ -7261,6 +7476,115 @@ function reconcileViaAttach(coll, graph, name, vaultCtx, plan) {
7261
7476
  reconcileCollectionReadState(coll, vaultCtx, plan, hadI18n, hadLookup);
7262
7477
  }
7263
7478
 
7479
+ // src/with-shape/introspection/behaviors.ts
7480
+ function buildBehaviorSummary(registries) {
7481
+ return {
7482
+ guards: buildGuardEntries(registries.guards),
7483
+ derivations: buildDerivationEntries(registries.derivations),
7484
+ materializedViews: buildMaterializedViewEntries(registries.materializedViews),
7485
+ overlays: buildOverlayEntries(registries.overlays),
7486
+ satellites: buildSatelliteEntries(registries.satellites)
7487
+ };
7488
+ }
7489
+ function buildGuardEntries(registry) {
7490
+ if (!registry) return [];
7491
+ const all = registry.all();
7492
+ const used = /* @__PURE__ */ new Set();
7493
+ for (const spec of all) {
7494
+ if (spec.name !== void 0) used.add(spec.name);
7495
+ }
7496
+ const unnamedOccurrence = /* @__PURE__ */ new Map();
7497
+ return all.map((spec) => {
7498
+ let name = spec.name;
7499
+ if (name === void 0) {
7500
+ let occurrence = (unnamedOccurrence.get(spec.collection) ?? 0) + 1;
7501
+ let candidate = `${spec.collection}#${occurrence}`;
7502
+ while (used.has(candidate)) {
7503
+ occurrence++;
7504
+ candidate = `${spec.collection}#${occurrence}`;
7505
+ }
7506
+ unnamedOccurrence.set(spec.collection, occurrence);
7507
+ name = candidate;
7508
+ used.add(name);
7509
+ }
7510
+ return {
7511
+ name,
7512
+ collection: spec.collection,
7513
+ ...spec.frozenFields ? { frozenFields: { fields: spec.frozenFields.fields } } : {},
7514
+ ...spec.amendment ? { amendment: { roles: spec.amendment.roles } } : {}
7515
+ };
7516
+ });
7517
+ }
7518
+ function buildDerivationEntries(registry) {
7519
+ if (!registry) return [];
7520
+ const all = registry.all();
7521
+ const usedNames = /* @__PURE__ */ new Set();
7522
+ for (const { spec } of all) {
7523
+ if (spec.name !== void 0) usedNames.add(spec.name);
7524
+ }
7525
+ const entries = all.map(({ spec }) => {
7526
+ const outputCollections = Object.values(spec.outputs).map((o) => o.collection);
7527
+ const name = spec.name ?? fallbackDerivationName(outputCollections, spec.source, usedNames);
7528
+ if (spec.name === void 0) usedNames.add(name);
7529
+ const outputs = {};
7530
+ for (const [key, output] of Object.entries(spec.outputs)) {
7531
+ outputs[key] = output.shape === "record" ? { shape: "record", collection: output.collection, ...output.optional !== void 0 ? { optional: output.optional } : {}, ...output.denorm ? { denorm: output.denorm } : {} } : { shape: "array", collection: output.collection, ...output.maxFanout !== void 0 ? { maxFanout: output.maxFanout } : {} };
7532
+ }
7533
+ return {
7534
+ name,
7535
+ source: spec.source,
7536
+ ...spec.sources ? { sources: spec.sources } : {},
7537
+ ...spec.triggerBy ? { triggerBy: spec.triggerBy } : {},
7538
+ ...spec.rollup ? { rollup: { from: spec.rollup.from, key: spec.rollup.key, field: spec.rollup.field } } : {},
7539
+ deterministic: true,
7540
+ outputs,
7541
+ lifecycle: spec.lifecycle,
7542
+ ...spec.strict !== void 0 ? { strict: spec.strict } : {}
7543
+ };
7544
+ });
7545
+ return entries;
7546
+ }
7547
+ function buildMaterializedViewEntries(registry) {
7548
+ if (!registry) return [];
7549
+ return registry.all().map(({ spec }) => ({
7550
+ name: spec.name,
7551
+ spec: stripFunctions(spec)
7552
+ }));
7553
+ }
7554
+ function buildOverlayEntries(registry) {
7555
+ if (!registry) return [];
7556
+ return registry.all().map((spec) => ({
7557
+ name: spec.name,
7558
+ base: spec.base,
7559
+ overlay: spec.overlay,
7560
+ shadowField: spec.shadowField,
7561
+ shadowValue: spec.shadowValue,
7562
+ ...spec.mergeMode ? { mergeMode: spec.mergeMode } : {}
7563
+ }));
7564
+ }
7565
+ function buildSatelliteEntries(registry) {
7566
+ if (!registry) return [];
7567
+ return registry.allSpecs().map((spec) => ({
7568
+ name: spec.satellite,
7569
+ base: spec.base,
7570
+ fields: spec.fields,
7571
+ ...spec.joined !== void 0 ? { joined: spec.joined } : {}
7572
+ }));
7573
+ }
7574
+ function stripFunctions(value) {
7575
+ if (typeof value === "function") return void 0;
7576
+ if (Array.isArray(value)) return value.map(stripFunctions).filter((v) => v !== void 0);
7577
+ if (value !== null && typeof value === "object") {
7578
+ const out = {};
7579
+ for (const [k, v] of Object.entries(value)) {
7580
+ const stripped = stripFunctions(v);
7581
+ if (stripped !== void 0) out[k] = stripped;
7582
+ }
7583
+ return out;
7584
+ }
7585
+ return value;
7586
+ }
7587
+
7264
7588
  // src/with-shape/satellites/registry.ts
7265
7589
  var SatelliteRegistry = class {
7266
7590
  byBase = /* @__PURE__ */ new Map();
@@ -7371,7 +7695,7 @@ function declareSatellite(ctx, collectionName, options, existingRegistry) {
7371
7695
  ctx.forEachSyncEngine((e) => e.remirrorPairResolvers([spec.base, spec.satellite]));
7372
7696
  const registry = reg;
7373
7697
  const baseSchema = ctx.getBaseSchema(spec.base);
7374
- void import("./post-register-LY35EDTJ.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
7698
+ void import("./post-register-ORQOQJCS.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
7375
7699
  });
7376
7700
  return reg;
7377
7701
  }
@@ -7703,6 +8027,21 @@ async function migrateSatelliteCek(name, coll) {
7703
8027
  }
7704
8028
 
7705
8029
  // src/with-shape/schema-update/fence-controller.ts
8030
+ function schemaBumpAuditHook(getLedger, actor) {
8031
+ return async (generation) => {
8032
+ const ledger = getLedger();
8033
+ if (!ledger) return;
8034
+ await ledger.append({
8035
+ op: "lifecycle",
8036
+ collection: "",
8037
+ id: "",
8038
+ version: 0,
8039
+ actor,
8040
+ payloadHash: "",
8041
+ reason: `schema:generation-bump=${generation}`
8042
+ });
8043
+ };
8044
+ }
7706
8045
  var SchemaFenceController = class {
7707
8046
  #coordination;
7708
8047
  #vault;
@@ -7712,6 +8051,7 @@ var SchemaFenceController = class {
7712
8051
  #staleMs;
7713
8052
  #quiesceTimeoutMs;
7714
8053
  #emit;
8054
+ #auditBump;
7715
8055
  #snapshot = 0;
7716
8056
  #pending = /* @__PURE__ */ new Map();
7717
8057
  constructor(opts) {
@@ -7724,6 +8064,7 @@ var SchemaFenceController = class {
7724
8064
  this.#quiesceTimeoutMs = opts.quiesceTimeoutMs ?? 6e4;
7725
8065
  this.#emit = opts.emit ?? (() => {
7726
8066
  });
8067
+ this.#auditBump = opts.auditBump;
7727
8068
  }
7728
8069
  /** Capture the generation snapshot at vault-open. */
7729
8070
  async init() {
@@ -7786,6 +8127,8 @@ var SchemaFenceController = class {
7786
8127
  this.#pending.clear();
7787
8128
  await this.#setState(nextVersion, "normal");
7788
8129
  this.#snapshot = nextVersion;
8130
+ if (this.#auditBump) await this.#auditBump(nextVersion).catch(() => {
8131
+ });
7789
8132
  }
7790
8133
  );
7791
8134
  return { migrated };
@@ -7873,6 +8216,13 @@ var VaultAttestation = class {
7873
8216
  }
7874
8217
  };
7875
8218
 
8219
+ // src/with-shape/introspection/subsystem-matrix.ts
8220
+ function buildSubsystemMatrix(strategies, registries) {
8221
+ const matrix = {};
8222
+ for (const key of STRATEGY_KEYS) matrix[key] = strategies[key] !== STRATEGY_DEFAULTS[key];
8223
+ return { ...matrix, ...registries };
8224
+ }
8225
+
7876
8226
  // src/kernel/vault.ts
7877
8227
  var COLLECTION_PASSTHROUGH_KEYS = [
7878
8228
  "indexes",
@@ -8118,7 +8468,8 @@ var Vault = class {
8118
8468
  onFlush: () => this.noydb._writeQueueTracker.onFlush(),
8119
8469
  clientId: this.noydb._clientId,
8120
8470
  sessionId: this.noydb._sessionId,
8121
- emit: (e) => this.emitter.emit("schema:fence-changed", { vault: this.name, ...e })
8471
+ emit: (e) => this.emitter.emit("schema:fence-changed", { vault: this.name, ...e }),
8472
+ auditBump: schemaBumpAuditHook(() => this.getLedgerOrNull(), this.keyring.userId)
8122
8473
  });
8123
8474
  this.emitter = opts.emitter;
8124
8475
  this.onDirty = opts.onDirty;
@@ -8283,7 +8634,7 @@ var Vault = class {
8283
8634
  if (isDictCollectionName(collectionName)) throw new ReservedCollectionNameError(collectionName);
8284
8635
  if (collectionName === SEQUENCE_COLLECTION) throw new ReservedCollectionNameError(collectionName);
8285
8636
  if (isLinkCollectionName(collectionName)) throw new ReservedCollectionNameError(collectionName);
8286
- if (isSecretBearingReservedCollection(collectionName)) throw new ReservedCollectionNameError(collectionName);
8637
+ if (isSecretBearingReservedCollection(collectionName) || isManifestReservedCollection(collectionName)) throw new ReservedCollectionNameError(collectionName);
8287
8638
  if (this.satelliteRegistry?.byJoined(collectionName)) {
8288
8639
  throw new SatelliteConfigError(`"${collectionName}" is a joined handle \u2014 use vault.joined('${collectionName}'), not vault.collection().`);
8289
8640
  }
@@ -8327,14 +8678,15 @@ var Vault = class {
8327
8678
  const strategies = options.schemaUpdate ?? [];
8328
8679
  const work = (async () => {
8329
8680
  const dek = await this.getDEK(collectionName);
8330
- const { persistSchemaIfNeeded } = await import("./register-6RIBIT3I.js");
8681
+ const { persistSchemaIfNeeded } = await import("./register-LHETZRJM.js");
8331
8682
  const result = await persistSchemaIfNeeded({
8332
8683
  store: this.adapter,
8333
8684
  vault: this.name,
8334
8685
  collectionName,
8335
8686
  validator,
8336
8687
  dek,
8337
- strategies
8688
+ strategies,
8689
+ manifestSync: { getDEK: this.getDEK, lookupDEK: async (name) => this.keyring.deks.get(name), getLedgerOrNull: () => this._getLedgerOrNull() }
8338
8690
  });
8339
8691
  const decision = result.decision ?? { action: "allow" };
8340
8692
  if (decision.action === "cutover") {
@@ -8476,12 +8828,13 @@ var Vault = class {
8476
8828
  const work = (async () => {
8477
8829
  try {
8478
8830
  const dek = await this.getDEK(collectionName);
8479
- await (await import("./register-6RIBIT3I.js")).persistSchemaIfNeeded({
8831
+ await (await import("./register-LHETZRJM.js")).persistSchemaIfNeeded({
8480
8832
  store: this.adapter,
8481
8833
  vault: this.name,
8482
8834
  collectionName,
8483
8835
  validator,
8484
- dek
8836
+ dek,
8837
+ manifestSync: { getDEK: this.getDEK, lookupDEK: async (name) => this.keyring.deks.get(name), getLedgerOrNull: () => this._getLedgerOrNull() }
8485
8838
  });
8486
8839
  } catch (err) {
8487
8840
  console.warn(
@@ -8631,7 +8984,7 @@ var Vault = class {
8631
8984
  *
8632
8985
  * Emits no ledger/event itself — its callers (#604's `freezePeriod`, #615's
8633
8986
  * `purgePeriodTargets`) own the audit record. The sweep body is shared via
8634
- * {@link _purgeMarkersOn}, which #615 also aims at push-only sync targets.
8987
+ * `purgeMarkersOn`, which #615 also aims at push-only sync targets.
8635
8988
  *
8636
8989
  * Purges the local adapter only. Markers already pushed to the vault's
8637
8990
  * push-only (`backup`/`archive`) sync targets are reclaimed by #615's
@@ -8639,25 +8992,7 @@ var Vault = class {
8639
8992
  * them would re-open the resurrection window — the deferred half of #611).
8640
8993
  */
8641
8994
  async _purgeDeleteMarkers(before, collections) {
8642
- return this._purgeMarkersOn(this.adapter, before, collections);
8643
- }
8644
- /**
8645
- * @internal #615. Sweep delete markers with `_ts < before` off ANY store
8646
- * (local adapter or a push-only sync target). Returns the count removed.
8647
- */
8648
- async _purgeMarkersOn(store, before, collections) {
8649
- const snapshot = await store.loadAll(this.name);
8650
- let removed = 0;
8651
- for (const [coll, records] of Object.entries(snapshot)) {
8652
- if (collections && !collections.includes(coll)) continue;
8653
- for (const [id, env] of Object.entries(records)) {
8654
- if (isDeleteMarker(env) && env._ts < before) {
8655
- await store.delete(this.name, coll, id);
8656
- removed++;
8657
- }
8658
- }
8659
- }
8660
- return removed;
8995
+ return purgeMarkersOn(this.adapter, this.name, before, collections);
8661
8996
  }
8662
8997
  /**
8663
8998
  * @internal #613. Relocate this closed period's in-window records (those
@@ -8683,7 +9018,7 @@ var Vault = class {
8683
9018
  async _purgePeriodTargets(before) {
8684
9019
  const out = [];
8685
9020
  for (const t of this.getPurgeableTargets()) {
8686
- const purgedCount = await this._purgeMarkersOn(t.store, before);
9021
+ const purgedCount = await purgeMarkersOn(t.store, this.name, before);
8687
9022
  out.push({ ...t.label !== void 0 ? { label: t.label } : {}, role: t.role, purgedCount });
8688
9023
  }
8689
9024
  return out;
@@ -8869,24 +9204,7 @@ var Vault = class {
8869
9204
  * (`'cascade'` default, `'strict'`, `'warn'`).
8870
9205
  */
8871
9206
  link(name, spec) {
8872
- const a = typeof spec.a === "string" ? spec.a : spec.a.target;
8873
- const b = typeof spec.b === "string" ? spec.b : spec.b.target;
8874
- for (const [slot, target] of [["a", a], ["b", b]]) {
8875
- if (!target || target.startsWith("_") || target.includes("/")) {
8876
- throw new ValidationError(
8877
- `vault.link("${name}"): endpoint "${slot}" must be a simple collection name, got "${target}".`
8878
- );
8879
- }
8880
- }
8881
- const resolved = { a, b, ...spec.onDelete ? { onDelete: spec.onDelete } : {} };
8882
- const existing = this.linkRegistry.get(name);
8883
- if (existing) {
8884
- if (existing.a !== resolved.a || existing.b !== resolved.b || (existing.onDelete ?? "cascade") !== (resolved.onDelete ?? "cascade")) {
8885
- throw new ValidationError(`vault.link("${name}"): conflicting re-declaration.`);
8886
- }
8887
- return;
8888
- }
8889
- this.linkRegistry.set(name, resolved);
9207
+ declareLink(this.linkRegistry, name, spec);
8890
9208
  }
8891
9209
  /**
8892
9210
  * Access a declared link set. Throws if `name` was not first
@@ -9176,6 +9494,19 @@ var Vault = class {
9176
9494
  publishRevocationList() {
9177
9495
  return this.attestation.publishRevocationList();
9178
9496
  }
9497
+ /**
9498
+ * @internal #943 — read-only access to this vault's persisted document
9499
+ * signer, for pod export signing. Never mints and does NOT require the
9500
+ * `withAttestation()` opt-in (role-agnostic, pure read): if no signer has
9501
+ * ever been minted, resolves to `null` (unsigned pod) rather than throwing
9502
+ * or minting one. Dynamic-imports `signer.js` (the S4 gate escape hatch —
9503
+ * see `_ensureFenceCoordination` above) since it is a with-* service path.
9504
+ */
9505
+ // eslint-disable-next-line @typescript-eslint/consistent-type-imports
9506
+ async _loadPodSigner() {
9507
+ const { loadSigner } = await import("./signer-7KHD4OL2.js");
9508
+ return loadSigner(this.adapter, this.name, this.getDEK);
9509
+ }
9179
9510
  async writeExportAudit(entry) {
9180
9511
  const json = JSON.stringify(entry);
9181
9512
  const envelope = this.encrypted ? await (async () => {
@@ -9230,6 +9561,27 @@ var Vault = class {
9230
9561
  async enforceRefsOnDelete(collectionName, id) {
9231
9562
  return this.linksEnforcer.enforceRefsOnDelete(this.graph, collectionName, id);
9232
9563
  }
9564
+ /**
9565
+ * #922 — can a delete on `collectionName` trigger ANY cross-record work in
9566
+ * `enforceRefsOnDelete` above? Unions ALL THREE of its cascade sources —
9567
+ * lookup-ref edges (`graph.referencingEdgesOf`), classic inbound refs
9568
+ * (`refRegistry.getInbound`), and managed link sets whose either endpoint
9569
+ * is this collection. `Collection._txAtomicSafe('delete')` consults this
9570
+ * instead of the pre-#922 blanket enforcer-presence check: `_prepareDelete`
9571
+ * runs those cascades DURING prepare (not abortable), so a delete may take
9572
+ * the atomic tx path only when all three sources are provably absent.
9573
+ * Registry state only — no store reads, safe to call at commit time.
9574
+ *
9575
+ * @internal
9576
+ */
9577
+ _deleteCascadesPossible(collectionName) {
9578
+ if (this.graph.referencingEdgesOf(collectionName).length > 0) return true;
9579
+ if (this.refRegistry.getInbound(collectionName).length > 0) return true;
9580
+ for (const spec of this.linkRegistry.values()) {
9581
+ if (spec.a === collectionName || spec.b === collectionName) return true;
9582
+ }
9583
+ return false;
9584
+ }
9233
9585
  // ─── Join resolver) ────────────────────
9234
9586
  /**
9235
9587
  * Look up the `RefDescriptor` the left collection declared for a
@@ -9635,7 +9987,7 @@ var Vault = class {
9635
9987
  async _initGuards(handles) {
9636
9988
  if (handles.length === 0) return;
9637
9989
  const [{ GuardRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
9638
- import("./registry-BWD2ED52.js"),
9990
+ import("./registry-IKUR2MXD.js"),
9639
9991
  import("./read-only-facade-CHCKSEPD.js")
9640
9992
  ]);
9641
9993
  const registry = new GuardRegistry();
@@ -9663,7 +10015,7 @@ var Vault = class {
9663
10015
  async _initDerivations(handles) {
9664
10016
  if (handles.length === 0) return;
9665
10017
  const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
9666
- import("./registry-RON4WHAP.js"),
10018
+ import("./registry-JRIN447B.js"),
9667
10019
  import("./read-only-facade-CHCKSEPD.js")
9668
10020
  ]);
9669
10021
  const registry = new DerivationRegistry();
@@ -9695,7 +10047,7 @@ var Vault = class {
9695
10047
  */
9696
10048
  async _initMaterializedViews(handles) {
9697
10049
  if (handles.length === 0) return;
9698
- const { MaterializedViewRegistry } = await import("./registry-MUSL4AW6.js");
10050
+ const { MaterializedViewRegistry } = await import("./registry-AMAZ6QRZ.js");
9699
10051
  const registry = new MaterializedViewRegistry();
9700
10052
  this.materializedViewRegistry = registry;
9701
10053
  const db = this;
@@ -9720,7 +10072,7 @@ var Vault = class {
9720
10072
  */
9721
10073
  async _initOverlayedViews(handles) {
9722
10074
  if (handles.length === 0) return;
9723
- const { OverlayedViewRegistry } = await import("./registry-7Y5WF7GS.js");
10075
+ const { OverlayedViewRegistry } = await import("./registry-CZVINVQH.js");
9724
10076
  const registry = new OverlayedViewRegistry();
9725
10077
  const mvRegistry = this.materializedViewRegistry;
9726
10078
  const overlayNames = /* @__PURE__ */ new Set();
@@ -9748,6 +10100,21 @@ var Vault = class {
9748
10100
  _getOverlayedViewRegistry() {
9749
10101
  return this.overlayedViewRegistry;
9750
10102
  }
10103
+ /**
10104
+ * Read-only enumeration of the five behavior registries — guards,
10105
+ * derivations, materialized views, overlays, satellites — each entry
10106
+ * carrying its name and the serializable half of its spec (never a
10107
+ * function body). @see with-shape/introspection/behaviors.ts
10108
+ */
10109
+ listBehaviors() {
10110
+ return buildBehaviorSummary({
10111
+ guards: this.guardRegistry,
10112
+ derivations: this.derivationRegistry,
10113
+ materializedViews: this.materializedViewRegistry,
10114
+ overlays: this.overlayedViewRegistry,
10115
+ satellites: this.satelliteRegistry
10116
+ });
10117
+ }
9751
10118
  /** @internal — ctx for `putDerivedOutput`'s frozen-period skip+audit (#638 Task 5). */
9752
10119
  _dispatchCtx(source) {
9753
10120
  return { emit: (e, p) => this.emitter.emit(e, p), source, audit: ledgerAuditHook(this.getLedgerOrNull() ?? void 0, this.keyring.userId) };
@@ -9767,14 +10134,14 @@ var Vault = class {
9767
10134
  if (!reg) {
9768
10135
  throw new Error(`refreshView: no MV registered with name "${name}"`);
9769
10136
  }
9770
- const { MaterializedViewExecutor } = await import("./executor-FPHKWDWT.js");
10137
+ const { MaterializedViewExecutor } = await import("./executor-3JZ4POTW.js");
9771
10138
  const result = await MaterializedViewExecutor.refresh(reg, {
9772
10139
  getCollection: (n) => this.collection(n),
9773
10140
  getActiveTxContext: () => this.noydb._activeTxContextOrNull,
9774
10141
  getQueryContext: () => this,
9775
10142
  dispatchCtx: this._dispatchCtx({ collection: name, id: "refreshView" })
9776
10143
  });
9777
- const { clearMVStaleFully } = await import("./stale-T3V7XEOB.js");
10144
+ const { clearMVStaleFully } = await import("./stale-K734VACF.js");
9778
10145
  await clearMVStaleFully(this.adapter, this.name, registry, name);
9779
10146
  return result;
9780
10147
  }
@@ -9787,7 +10154,7 @@ var Vault = class {
9787
10154
  if (registry === null) return { derived: 0, failed: 0, skippedFrozen: 0 };
9788
10155
  const strategies = registry.strategiesForSource(sourceCollection);
9789
10156
  if (strategies.length === 0) return { derived: 0, failed: 0, skippedFrozen: 0 };
9790
- const { DerivationExecutor } = await import("./executor-IEBLTBCW.js");
10157
+ const { DerivationExecutor } = await import("./executor-S4QIKEHW.js");
9791
10158
  const sourceColl = this.collection(sourceCollection);
9792
10159
  const records = await sourceColl.list();
9793
10160
  const ctx = { vault: this.derivationFacade ?? new (await import("./read-only-facade-CHCKSEPD.js")).ReadOnlyVaultFacade(this, "derivation") };
@@ -9814,7 +10181,7 @@ var Vault = class {
9814
10181
  if (!outSpec) continue;
9815
10182
  const outputColl = this.collection(outSpec.collection);
9816
10183
  if (out.kind === "array") {
9817
- const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-273RDMYS.js");
10184
+ const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-T2ZGLQFE.js");
9818
10185
  const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key, this.getDEK, this.encrypted);
9819
10186
  const prevKeys = new Set(prior?.keys ?? []);
9820
10187
  const newKeysList = out.entries.map((e) => e.key);
@@ -10041,7 +10408,7 @@ var Vault = class {
10041
10408
  * collection.
10042
10409
  */
10043
10410
  async delegate(opts) {
10044
- const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-JDUMAF6L.js");
10411
+ const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-PDYL6RWT.js");
10045
10412
  if (!this.keyring.kek) {
10046
10413
  throw new ValidationError(
10047
10414
  "issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (secret) first."
@@ -10063,7 +10430,7 @@ var Vault = class {
10063
10430
  * if the id does not exist.
10064
10431
  */
10065
10432
  async revokeDelegation(id) {
10066
- const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-JDUMAF6L.js");
10433
+ const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-PDYL6RWT.js");
10067
10434
  await revokeDelegation(this.adapter, this.name, id);
10068
10435
  void DELEGATIONS_COLLECTION;
10069
10436
  }
@@ -10311,7 +10678,7 @@ var Vault = class {
10311
10678
  * @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
10312
10679
  */
10313
10680
  async dumpSchema(opts = {}) {
10314
- const { dumpVaultSchema } = await import("./walk-G3NFEP5L.js");
10681
+ const { dumpVaultSchema } = await import("./walk-MQHYNDLZ.js");
10315
10682
  return dumpVaultSchema(this, opts);
10316
10683
  }
10317
10684
  /**
@@ -10351,12 +10718,12 @@ var Vault = class {
10351
10718
  refRegistry: this.refRegistry,
10352
10719
  getDEK: this.getDEK,
10353
10720
  keyring: this.keyring,
10354
- subsystems: {
10721
+ subsystems: buildSubsystemMatrix(this.strategies, {
10355
10722
  guards: this.guardRegistry !== null,
10356
10723
  derivations: this.derivationRegistry !== null,
10357
10724
  materializedViews: this.materializedViewRegistry !== null,
10358
10725
  overlayViews: this.overlayedViewRegistry !== null
10359
- },
10726
+ }),
10360
10727
  ...this.vaultMeta !== void 0 ? { vaultMeta: this.vaultMeta } : {},
10361
10728
  mvRegistry: this.materializedViewRegistry,
10362
10729
  overlayRegistry: this.overlayedViewRegistry,
@@ -10407,30 +10774,8 @@ var Vault = class {
10407
10774
  * separate vault instances now.
10408
10775
  */
10409
10776
  async getBundleHandle() {
10410
- const existing = await this.adapter.get(this.name, "_meta", "handle");
10411
- if (existing) {
10412
- try {
10413
- const parsed = JSON.parse(existing._data);
10414
- if (parsed !== null && typeof parsed === "object" && "handle" in parsed) {
10415
- const handle2 = parsed.handle;
10416
- if (typeof handle2 === "string" && /^[0-9A-HJKMNP-TV-Z]{26}$/.test(handle2)) {
10417
- return handle2;
10418
- }
10419
- }
10420
- } catch {
10421
- }
10422
- }
10423
- const { generateULID: generateULID2 } = await import("./ulid-PTAIMDG4.js");
10424
- const handle = generateULID2();
10425
- const envelope = {
10426
- _noydb: NOYDB_FORMAT_VERSION,
10427
- _v: 1,
10428
- _ts: (/* @__PURE__ */ new Date()).toISOString(),
10429
- _iv: "",
10430
- _data: JSON.stringify({ handle })
10431
- };
10432
- await this.adapter.put(this.name, "_meta", "handle", envelope);
10433
- return handle;
10777
+ const { buildBundleHandle } = await import("./bundle-handle-5OUAI7CV.js");
10778
+ return buildBundleHandle(this.adapter, this.name);
10434
10779
  }
10435
10780
  /**
10436
10781
  * Read the owner-curated cover for this vault (or `undefined` if
@@ -10461,7 +10806,7 @@ var Vault = class {
10461
10806
  * both modes round-trip cleanly.
10462
10807
  */
10463
10808
  async dump() {
10464
- const { dumpVault } = await import("./backup-X7F3TCFV.js");
10809
+ const { dumpVault } = await import("./backup-GAYWQAFN.js");
10465
10810
  return dumpVault(this.backupContext());
10466
10811
  }
10467
10812
  /**
@@ -10513,7 +10858,7 @@ var Vault = class {
10513
10858
  * — there's no chain to verify against.
10514
10859
  */
10515
10860
  async load(backupJson) {
10516
- const { loadVault } = await import("./backup-X7F3TCFV.js");
10861
+ const { loadVault } = await import("./backup-GAYWQAFN.js");
10517
10862
  return loadVault(this.backupContext(), backupJson);
10518
10863
  }
10519
10864
  /**
@@ -10545,7 +10890,7 @@ var Vault = class {
10545
10890
  * way to detect tampering of an in-place vault.
10546
10891
  */
10547
10892
  async verifyBackupIntegrity() {
10548
- const { verifyBackupIntegrity } = await import("./backup-X7F3TCFV.js");
10893
+ const { verifyBackupIntegrity } = await import("./backup-GAYWQAFN.js");
10549
10894
  return verifyBackupIntegrity(this.backupContext());
10550
10895
  }
10551
10896
  /**
@@ -10763,7 +11108,7 @@ var Vault = class {
10763
11108
  * is the live validator object, not a serialization of it).
10764
11109
  */
10765
11110
  async exportJSON(opts = {}) {
10766
- const { exportVaultJSON } = await import("./backup-X7F3TCFV.js");
11111
+ const { exportVaultJSON } = await import("./backup-GAYWQAFN.js");
10767
11112
  return exportVaultJSON(this.backupContext(), opts);
10768
11113
  }
10769
11114
  };
@@ -10879,6 +11224,14 @@ var WriteHookRegistry = class {
10879
11224
  get hasHandlers() {
10880
11225
  return this.#before.length > 0 || this.#after.length > 0;
10881
11226
  }
11227
+ /**
11228
+ * True when any BEFORE hook is registered — the refusal-capable kind. #931:
11229
+ * the atomic-commit eligibility gate keys on this alone; after-hooks are
11230
+ * observers and fire post-finalize on the atomic path instead of gating it.
11231
+ */
11232
+ get hasBeforeHandlers() {
11233
+ return this.#before.length > 0;
11234
+ }
10882
11235
  onBeforeWrite(handler) {
10883
11236
  this.#before.push(handler);
10884
11237
  return () => {
@@ -12652,7 +13005,7 @@ var Noydb = class {
12652
13005
  if (!facade) return;
12653
13006
  const ctx = { existing, vault: facade, userId: e.userId, role: e.role };
12654
13007
  await registry.runChecks(e.collection, incoming, ctx);
12655
- const { GuardExecutor } = await import("./executor-RM7XWQDU.js");
13008
+ const { GuardExecutor } = await import("./executor-CYJQLKKI.js");
12656
13009
  for (const g of guards) {
12657
13010
  await GuardExecutor.checkFrozenFields(g, e.docId, existing, incoming, e.computedFieldNames);
12658
13011
  }
@@ -13123,6 +13476,7 @@ var Noydb = class {
13123
13476
  "Noydb.listAccessibleVaults(): a secret (secret) is required when encryption is enabled."
13124
13477
  );
13125
13478
  }
13479
+ const probeSecret = this.options.secret;
13126
13480
  const minRank = ROLE_RANK[options.minRole ?? "client"];
13127
13481
  const universe = await adapter.listVaults();
13128
13482
  const accessible = [];
@@ -13131,10 +13485,16 @@ var Noydb = class {
13131
13485
  try {
13132
13486
  keyring = await loadKeyring(adapter, vault, {
13133
13487
  userId: this.options.user,
13134
- secret: this.options.secret
13488
+ secret: probeSecret
13135
13489
  });
13136
13490
  } catch (err) {
13137
- if (err instanceof NoAccessError || err instanceof InvalidKeyError || err instanceof KeyringCorruptError) {
13491
+ if (err instanceof NoAccessError || err instanceof InvalidKeyError || err instanceof KeyringCorruptError || // Mixed universe (#940): a string secret probing an echo keyring
13492
+ // throws EchoCeremonyRequiredError, echo parts probing a standard
13493
+ // keyring throw ValidationError — both from `deriveKekForKeyring`,
13494
+ // both meaning "no accessible key material here", exactly like a
13495
+ // wrong secret. `createNoydb` already rejects a secret/mode shape
13496
+ // mismatch, so neither can be a caller misconfiguration.
13497
+ err instanceof EchoCeremonyRequiredError || err instanceof ValidationError) {
13138
13498
  continue;
13139
13499
  }
13140
13500
  throw err;
@@ -13358,6 +13718,10 @@ var Noydb = class {
13358
13718
  get _store() {
13359
13719
  return this.options.store;
13360
13720
  }
13721
+ /** The default store this instance was opened with (#948). */
13722
+ get store() {
13723
+ return this.options.store;
13724
+ }
13361
13725
  /**
13362
13726
  * Currently-running multi-record transaction, or `null` outside
13363
13727
  * Phase 2. `Collection.dispatchDerivations` consults this so a
@@ -13419,6 +13783,25 @@ var Noydb = class {
13419
13783
  }
13420
13784
  return engine.status();
13421
13785
  }
13786
+ /**
13787
+ * Enumerate the sync targets wired for `vault` (#948) — the primary engine
13788
+ * (keyed by vault name) plus any additional targets (keyed `vault::label`
13789
+ * or `vault::role`). No preset name: a resolved `SyncPolicy` doesn't retain
13790
+ * which preset (if any) produced it.
13791
+ */
13792
+ listSyncTargets(vault) {
13793
+ const targets = [];
13794
+ for (const [key, engine] of this.syncEngines) {
13795
+ if (key === vault || key.startsWith(`${vault}::`)) {
13796
+ targets.push({
13797
+ label: engine.label,
13798
+ role: engine.role,
13799
+ policy: engine.policy ? { push: { mode: engine.policy.push.mode }, pull: { mode: engine.policy.pull.mode } } : void 0
13800
+ });
13801
+ }
13802
+ }
13803
+ return targets;
13804
+ }
13422
13805
  getSyncEngine(vault) {
13423
13806
  const engine = this.syncEngines.get(vault);
13424
13807
  if (!engine) {
@@ -13896,16 +14279,7 @@ var Noydb = class {
13896
14279
  return keyring2;
13897
14280
  }
13898
14281
  await assertKeyringOpenAllowed(this.options.store, vault, this.options.user, opts.create);
13899
- let effectiveSecret;
13900
- if (this.options.secretMode === "managed") {
13901
- effectiveSecret = await resolveManagedSecret(
13902
- this.options.store,
13903
- vault,
13904
- this.options.sealingKey
13905
- );
13906
- } else {
13907
- effectiveSecret = this.options.secret;
13908
- }
14282
+ const effectiveSecret = await resolveEffectiveSecret(this.options, this.options.store, vault);
13909
14283
  if (!effectiveSecret) {
13910
14284
  throw new ValidationError("A secret (secret) or getKeyring callback is required when encryption is enabled");
13911
14285
  }
@@ -13914,22 +14288,10 @@ var Noydb = class {
13914
14288
  keyring = await loadKeyring(this.options.store, vault, { userId: this.options.user, secret: effectiveSecret });
13915
14289
  } catch (err) {
13916
14290
  if (err instanceof NoAccessError) {
13917
- keyring = await createOwnerKeyring(this.options.store, vault, {
13918
- userId: this.options.user,
13919
- secret: effectiveSecret,
13920
- // Managed mode generates 256-bit base64 strings that don't satisfy
13921
- // the human-secret strength rules (no spaces, no "words").
13922
- // Skip validation in managed mode — the entropy floor is already
13923
- // 256 bits by construction.
13924
- validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
13925
- });
14291
+ keyring = await createOwnerKeyring(this.options.store, vault, ownerKeyringOptions(this.options, effectiveSecret));
13926
14292
  } else if (err instanceof InvalidKeyError && this.options.onInvalidKey === "reset") {
13927
14293
  await this.options.store.delete(vault, "_keyring", this.options.user);
13928
- keyring = await createOwnerKeyring(this.options.store, vault, {
13929
- userId: this.options.user,
13930
- secret: effectiveSecret,
13931
- validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
13932
- });
14294
+ keyring = await createOwnerKeyring(this.options.store, vault, ownerKeyringOptions(this.options, effectiveSecret));
13933
14295
  } else {
13934
14296
  throw err;
13935
14297
  }
@@ -13964,33 +14326,9 @@ var Noydb = class {
13964
14326
  };
13965
14327
  async function createNoydb(options) {
13966
14328
  if (!options.store) options = { ...options, store: memoryStore() };
13967
- const encrypted = options.encrypt !== false;
13968
- const managed = options.secretMode === "managed";
13969
- if (options.secret && options.getKeyring) {
13970
- throw new ValidationError("Provide either `secret` or `getKeyring`, not both");
13971
- }
13972
- if (managed) {
13973
- if (options.secret) {
13974
- throw new ValidationError(
13975
- '`secretMode: "managed"` is mutually exclusive with `secret` \u2014 managed mode generates the secret itself. Drop `secret`.'
13976
- );
13977
- }
13978
- if (options.getKeyring) {
13979
- throw new ValidationError(
13980
- '`secretMode: "managed"` is mutually exclusive with `getKeyring` \u2014 a custom unlock callback would bypass the sealing flow. Drop `getKeyring`.'
13981
- );
13982
- }
13983
- if (!options.sealingKey) {
13984
- throw new ValidationError(
13985
- '`secretMode: "managed"` requires `sealingKey: SealingKeyProvider` (see @noy-db/seal-macos-keychain / @noy-db/seal-aws-kms / etc.).'
13986
- );
13987
- }
13988
- }
13989
- if (encrypted && !managed && !options.secret && !options.getKeyring) {
13990
- throw new ValidationError("A secret (secret) or getKeyring callback is required when encryption is enabled");
13991
- }
14329
+ validateSecretModeOptions(options);
13992
14330
  if (!options.coordinationStrategy) options = { ...options, coordinationStrategy: await createDefaultCoordinationProvider(options.store) };
13993
- if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-SI2IVBQO.js")).createUserApi };
14331
+ if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-67SBPMMH.js")).createUserApi };
13994
14332
  if (!options.policyFactory) {
13995
14333
  const policyModule = await import("./policy/index.js");
13996
14334
  options = { ...options, policyFactory: policyModule.createNoydbPolicy, policyCheckGateFn: policyModule.checkGate };
@@ -14025,4 +14363,4 @@ export {
14025
14363
  Noydb,
14026
14364
  createNoydb
14027
14365
  };
14028
- //# sourceMappingURL=chunk-ZBYFMI6D.js.map
14366
+ //# sourceMappingURL=chunk-3CLZY46Y.js.map