@noy-db/hub 0.2.0-pre.17 → 0.2.0-pre.19

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 (301) hide show
  1. package/dist/aggregate/index.cjs +227 -3
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +3 -3
  4. package/dist/aggregate/index.d.ts +3 -3
  5. package/dist/aggregate/index.js +5 -4
  6. package/dist/aggregate/index.js.map +1 -1
  7. package/dist/attestation/index.cjs.map +1 -1
  8. package/dist/attestation/index.d.cts +5 -5
  9. package/dist/attestation/index.d.ts +5 -5
  10. package/dist/attestation/index.js +6 -6
  11. package/dist/blobs/index.cjs +4 -10
  12. package/dist/blobs/index.cjs.map +1 -1
  13. package/dist/blobs/index.d.cts +6 -6
  14. package/dist/blobs/index.d.ts +6 -6
  15. package/dist/blobs/index.js +6 -6
  16. package/dist/bundle/index.cjs +1587 -392
  17. package/dist/bundle/index.cjs.map +1 -1
  18. package/dist/bundle/index.d.cts +7 -7
  19. package/dist/bundle/index.d.ts +7 -7
  20. package/dist/bundle/index.js +10 -10
  21. package/dist/{chunk-NBBMMJ2H.js → chunk-3FSMVWBN.js} +4 -4
  22. package/dist/{chunk-HGVSHKZW.js → chunk-3Q2AOPLT.js} +100 -29
  23. package/dist/chunk-3Q2AOPLT.js.map +1 -0
  24. package/dist/{chunk-SHX5QBCI.js → chunk-4ULLGYPA.js} +3 -3
  25. package/dist/{chunk-CD2AVTEM.js → chunk-5IGWRMEC.js} +5 -5
  26. package/dist/{chunk-QO6RGLLD.js → chunk-6KESZO5D.js} +35 -7
  27. package/dist/chunk-6KESZO5D.js.map +1 -0
  28. package/dist/{chunk-GP3SDSH2.js → chunk-6OSOE6BY.js} +15 -2
  29. package/dist/chunk-6OSOE6BY.js.map +1 -0
  30. package/dist/{chunk-F4G63NTZ.js → chunk-7C6VFNIY.js} +2 -2
  31. package/dist/{chunk-XJV6OB4D.js → chunk-7HD67R6U.js} +2 -2
  32. package/dist/{chunk-UMLVJTYV.js → chunk-ADB7GPM3.js} +7 -4
  33. package/dist/chunk-ADB7GPM3.js.map +1 -0
  34. package/dist/{chunk-NYSYPFXJ.js → chunk-B6E5IRPJ.js} +3 -3
  35. package/dist/chunk-CYNTFU2D.js +129 -0
  36. package/dist/chunk-CYNTFU2D.js.map +1 -0
  37. package/dist/{chunk-ZEGSDPB7.js → chunk-DJF3FXW5.js} +35 -1
  38. package/dist/chunk-DJF3FXW5.js.map +1 -0
  39. package/dist/{chunk-3G3W65EQ.js → chunk-DY3EOJEN.js} +2 -2
  40. package/dist/{chunk-YYVZYTWW.js → chunk-E66DSTJP.js} +3 -3
  41. package/dist/{chunk-5LIROIDM.js → chunk-FBLAWK6A.js} +2 -2
  42. package/dist/{chunk-E77UKJYL.js → chunk-FPHRTW2Z.js} +5 -5
  43. package/dist/{state-vault-W2OEABNO.js → chunk-G4PYA575.js} +24 -7
  44. package/dist/chunk-G4PYA575.js.map +1 -0
  45. package/dist/{chunk-U5QCMH3W.js → chunk-GKQAU52M.js} +4 -4
  46. package/dist/{chunk-2FU2FTXD.js → chunk-GYAWXHFO.js} +2 -2
  47. package/dist/{chunk-ROPJVUG3.js → chunk-H42KZXNV.js} +5 -210
  48. package/dist/chunk-H42KZXNV.js.map +1 -0
  49. package/dist/{chunk-XPIHJ34I.js → chunk-IBVTH4JR.js} +4 -4
  50. package/dist/{chunk-C3HYQPV4.js → chunk-IVP5IVON.js} +2 -2
  51. package/dist/{chunk-BL5GYANC.js → chunk-KEDJDWWQ.js} +3 -3
  52. package/dist/{chunk-I5IUYN7B.js → chunk-KNKNOJFS.js} +3 -3
  53. package/dist/chunk-KNKNOJFS.js.map +1 -0
  54. package/dist/{chunk-D77ZQSQQ.js → chunk-KYGGXXT6.js} +829 -170
  55. package/dist/chunk-KYGGXXT6.js.map +1 -0
  56. package/dist/{chunk-J7RWBXFY.js → chunk-LSIIPKYT.js} +2 -2
  57. package/dist/{chunk-BSZOCSDZ.js → chunk-M3FPNTO2.js} +4 -4
  58. package/dist/{chunk-XMVHEWF6.js → chunk-MI36HL5G.js} +4 -4
  59. package/dist/{chunk-ROVO6NPJ.js → chunk-NN6IISZO.js} +58 -3
  60. package/dist/chunk-NN6IISZO.js.map +1 -0
  61. package/dist/{chunk-7H2GEJ3O.js → chunk-OBMYMKGO.js} +29 -6
  62. package/dist/{chunk-7H2GEJ3O.js.map → chunk-OBMYMKGO.js.map} +1 -1
  63. package/dist/{chunk-UNTGHX5A.js → chunk-OKOKPYWH.js} +2 -2
  64. package/dist/{chunk-WV7WV6JO.js → chunk-OY7RX2VL.js} +9 -15
  65. package/dist/chunk-OY7RX2VL.js.map +1 -0
  66. package/dist/{chunk-H2MRGONI.js → chunk-PTGQPWMV.js} +2 -2
  67. package/dist/{chunk-BJSLBUJ7.js → chunk-PWFTQHYX.js} +2 -2
  68. package/dist/{chunk-5AXTH4QZ.js → chunk-Q5MCHUXZ.js} +2 -2
  69. package/dist/{chunk-QHM6XEAH.js → chunk-S22UOMHM.js} +6 -6
  70. package/dist/{chunk-WIAOUFFB.js → chunk-S3XA7G35.js} +2 -2
  71. package/dist/{chunk-SISBMAPO.js → chunk-SHIUFIPW.js} +1 -1
  72. package/dist/chunk-SHIUFIPW.js.map +1 -0
  73. package/dist/{chunk-KCEHMDZF.js → chunk-U7JNBSS3.js} +3 -3
  74. package/dist/{chunk-ZNGPEV5J.js → chunk-V3VIRTTE.js} +3 -3
  75. package/dist/{chunk-TIDXB5DF.js → chunk-V5FZWQNN.js} +4 -4
  76. package/dist/chunk-VEIVAYJ7.js +361 -0
  77. package/dist/chunk-VEIVAYJ7.js.map +1 -0
  78. package/dist/{chunk-AEIKD3PP.js → chunk-VNUE6FHP.js} +3 -3
  79. package/dist/{chunk-DYYYUW5D.js → chunk-WFK2EVYU.js} +10 -2
  80. package/dist/chunk-WFK2EVYU.js.map +1 -0
  81. package/dist/{chunk-XMHUK5PN.js → chunk-X7FJMKT3.js} +2 -2
  82. package/dist/{chunk-FEJDVE3Z.js → chunk-XPH3FWME.js} +7 -2
  83. package/dist/{chunk-FEJDVE3Z.js.map → chunk-XPH3FWME.js.map} +1 -1
  84. package/dist/{chunk-SNMJ7SB3.js → chunk-Y5J63SMF.js} +5 -5
  85. package/dist/{chunk-M476FOQ7.js → chunk-YLRRU72W.js} +2 -2
  86. package/dist/{chunk-DWEBTE2W.js → chunk-YX333DPS.js} +4 -4
  87. package/dist/{chunk-BH3X5L6A.js → chunk-YZE6C3TQ.js} +3 -3
  88. package/dist/consent/index.cjs.map +1 -1
  89. package/dist/consent/index.d.cts +6 -6
  90. package/dist/consent/index.d.ts +6 -6
  91. package/dist/consent/index.js +3 -3
  92. package/dist/{crypto-7BN2HDWG.js → crypto-B46VNH6X.js} +3 -3
  93. package/dist/{delegation-MGH5SODX.js → delegation-5HON72PV.js} +5 -5
  94. package/dist/derivations/index.cjs +82 -2
  95. package/dist/derivations/index.cjs.map +1 -1
  96. package/dist/derivations/index.d.cts +7 -7
  97. package/dist/derivations/index.d.ts +7 -7
  98. package/dist/derivations/index.js +8 -6
  99. package/dist/{dev-unlock-iXbYFAWl.d.cts → dev-unlock-BR1rMOS-.d.cts} +1 -1
  100. package/dist/{dev-unlock-CI1ijTML.d.ts → dev-unlock-whL49sxV.d.ts} +1 -1
  101. package/dist/{errors-Dz64FA65.d.cts → errors-DL-zTrrF.d.cts} +29 -1
  102. package/dist/{errors-Dz64FA65.d.ts → errors-DL-zTrrF.d.ts} +29 -1
  103. package/dist/executor-44R5CUS2.js +12 -0
  104. package/dist/executor-AOACUK7Z.js +8 -0
  105. package/dist/executor-OKFLQCDW.js +8 -0
  106. package/dist/{fanout-sidecar-FIJJ46YG.js → fanout-sidecar-DCQWJQ6S.js} +2 -2
  107. package/dist/forget/index.cjs.map +1 -1
  108. package/dist/forget/index.d.cts +1 -1
  109. package/dist/forget/index.d.ts +1 -1
  110. package/dist/forget/index.js +4 -4
  111. package/dist/guards/index.cjs +80 -3
  112. package/dist/guards/index.cjs.map +1 -1
  113. package/dist/guards/index.d.cts +7 -7
  114. package/dist/guards/index.d.ts +7 -7
  115. package/dist/guards/index.js +8 -4
  116. package/dist/{hash-tEcM5fnv.d.cts → hash-BEUBmmI4.d.cts} +1 -1
  117. package/dist/{hash-blk7Bkes.d.ts → hash-Dtb7FwWd.d.ts} +1 -1
  118. package/dist/history/index.cjs.map +1 -1
  119. package/dist/history/index.d.cts +7 -7
  120. package/dist/history/index.d.ts +7 -7
  121. package/dist/history/index.js +5 -5
  122. package/dist/i18n/index.cjs +149 -132
  123. package/dist/i18n/index.cjs.map +1 -1
  124. package/dist/i18n/index.d.cts +6 -6
  125. package/dist/i18n/index.d.ts +6 -6
  126. package/dist/i18n/index.js +14 -14
  127. package/dist/{index-u-kWzSrL.d.cts → index-BM7O48Ur.d.cts} +85 -9
  128. package/dist/{index-C-SSRIxP.d.cts → index-BMmajblo.d.cts} +14 -0
  129. package/dist/{index-C-SSRIxP.d.ts → index-BMmajblo.d.ts} +14 -0
  130. package/dist/{index-DpU6KWof.d.ts → index-BelbyUwz.d.ts} +85 -9
  131. package/dist/index.cjs +2206 -992
  132. package/dist/index.cjs.map +1 -1
  133. package/dist/index.d.cts +29 -16
  134. package/dist/index.d.ts +29 -16
  135. package/dist/index.js +76 -54
  136. package/dist/index.js.map +1 -1
  137. package/dist/indexing/index.cjs.map +1 -1
  138. package/dist/indexing/index.js +4 -4
  139. package/dist/issue-EPA2PSWP.js +12 -0
  140. package/dist/{ledger-LFVLHE5H.js → ledger-LS6GXCBP.js} +5 -5
  141. package/dist/materialized-views/index.cjs +257 -4
  142. package/dist/materialized-views/index.cjs.map +1 -1
  143. package/dist/materialized-views/index.d.cts +7 -7
  144. package/dist/materialized-views/index.d.ts +7 -7
  145. package/dist/materialized-views/index.js +8 -7
  146. package/dist/noydb-BVKFP74P.js +38 -0
  147. package/dist/overlay-views/index.cjs.map +1 -1
  148. package/dist/overlay-views/index.d.cts +7 -7
  149. package/dist/overlay-views/index.d.ts +7 -7
  150. package/dist/overlay-views/index.js +4 -4
  151. package/dist/periods/index.cjs.map +1 -1
  152. package/dist/periods/index.d.cts +6 -6
  153. package/dist/periods/index.d.ts +6 -6
  154. package/dist/periods/index.js +5 -5
  155. package/dist/{public-envelope-RXZNP3V6.js → public-envelope-AGU6SS4Z.js} +4 -4
  156. package/dist/query/index.cjs +320 -28
  157. package/dist/query/index.cjs.map +1 -1
  158. package/dist/query/index.d.cts +3 -3
  159. package/dist/query/index.d.ts +3 -3
  160. package/dist/query/index.js +7 -6
  161. package/dist/read-only-facade-EX6WZZBP.js +7 -0
  162. package/dist/registry-ERNAMRDE.js +8 -0
  163. package/dist/registry-EXTHSXQW.js +8 -0
  164. package/dist/{registry-SECUWSGY.js → registry-RDPTFXQ7.js} +3 -3
  165. package/dist/{revoke-B54H2S2W.js → revoke-IFLXEZA5.js} +6 -6
  166. package/dist/sealed-record/index.cjs.map +1 -1
  167. package/dist/sealed-record/index.d.cts +1 -1
  168. package/dist/sealed-record/index.d.ts +1 -1
  169. package/dist/sealed-record/index.js +2 -2
  170. package/dist/session/index.cjs.map +1 -1
  171. package/dist/session/index.d.cts +7 -7
  172. package/dist/session/index.d.ts +7 -7
  173. package/dist/session/index.js +3 -3
  174. package/dist/shadow/index.cjs.map +1 -1
  175. package/dist/shadow/index.d.cts +6 -6
  176. package/dist/shadow/index.d.ts +6 -6
  177. package/dist/shadow/index.js +2 -2
  178. package/dist/{signer-YSXZT574.js → signer-UNWOUJAK.js} +5 -5
  179. package/dist/snapshots/index.cjs.map +1 -1
  180. package/dist/snapshots/index.d.cts +6 -6
  181. package/dist/snapshots/index.d.ts +6 -6
  182. package/dist/snapshots/index.js +4 -4
  183. package/dist/{stale-TOA36SRK.js → stale-NTEV5SLX.js} +2 -2
  184. package/dist/state-vault-TUTFRTOA.js +14 -0
  185. package/dist/state-vault-TUTFRTOA.js.map +1 -0
  186. package/dist/store/index.cjs +8 -0
  187. package/dist/store/index.cjs.map +1 -1
  188. package/dist/store/index.d.cts +13 -6
  189. package/dist/store/index.d.ts +13 -6
  190. package/dist/store/index.js +2 -2
  191. package/dist/{strategy-4M9jo172.d.ts → strategy-BDxQnnTX.d.ts} +315 -4
  192. package/dist/{strategy-CLC1j79g.d.cts → strategy-C5ol6NdV.d.cts} +315 -4
  193. package/dist/sync/index.cjs.map +1 -1
  194. package/dist/sync/index.d.cts +5 -5
  195. package/dist/sync/index.d.ts +5 -5
  196. package/dist/sync/index.js +4 -4
  197. package/dist/team/index.cjs.map +1 -1
  198. package/dist/team/index.d.cts +6 -6
  199. package/dist/team/index.d.ts +6 -6
  200. package/dist/team/index.js +8 -8
  201. package/dist/transition-guard-B1N82hMf.d.cts +165 -0
  202. package/dist/transition-guard-C__YeF3_.d.ts +165 -0
  203. package/dist/tx/index.cjs.map +1 -1
  204. package/dist/tx/index.d.cts +6 -6
  205. package/dist/tx/index.d.ts +6 -6
  206. package/dist/tx/index.js +3 -3
  207. package/dist/{types-CljIHm_J.d.ts → types-CraiZOyO.d.ts} +609 -305
  208. package/dist/{types-CrSpRDuG.d.cts → types-D-gr5t0G.d.cts} +609 -305
  209. package/dist/{ulid-CrI7PPbA.d.cts → ulid-DQnSAP5W.d.cts} +1 -1
  210. package/dist/{ulid-CWfL2Vfv.d.ts → ulid-FFRRHkVf.d.ts} +1 -1
  211. package/dist/util/index.cjs.map +1 -1
  212. package/dist/util/index.js +1 -1
  213. package/dist/{vault-group-DHAHFX2A.js → vault-group-27EV7KB4.js} +205 -8
  214. package/dist/vault-group-27EV7KB4.js.map +1 -0
  215. package/dist/{with-materialized-view-NzF71cG_.d.cts → with-materialized-view-BboqxyV3.d.cts} +1 -1
  216. package/dist/{with-materialized-view-B892zYZV.d.ts → with-materialized-view-CguCeVcT.d.ts} +1 -1
  217. package/dist/{with-overlayed-view-CR6m7CHe.d.ts → with-overlayed-view-DO08u_tx.d.ts} +1 -1
  218. package/dist/{with-overlayed-view-UI8qSGL4.d.cts → with-overlayed-view-mmsg5Of3.d.cts} +1 -1
  219. package/dist/with-rollup-_TyBzz3T.d.ts +47 -0
  220. package/dist/with-rollup-aaxOZcIb.d.cts +47 -0
  221. package/package.json +3 -3
  222. package/dist/chunk-D77ZQSQQ.js.map +0 -1
  223. package/dist/chunk-DYYYUW5D.js.map +0 -1
  224. package/dist/chunk-GP3SDSH2.js.map +0 -1
  225. package/dist/chunk-HGVSHKZW.js.map +0 -1
  226. package/dist/chunk-I5IUYN7B.js.map +0 -1
  227. package/dist/chunk-JDWE6JMX.js +0 -139
  228. package/dist/chunk-JDWE6JMX.js.map +0 -1
  229. package/dist/chunk-PDULVIBY.js +0 -63
  230. package/dist/chunk-PDULVIBY.js.map +0 -1
  231. package/dist/chunk-QO6RGLLD.js.map +0 -1
  232. package/dist/chunk-ROPJVUG3.js.map +0 -1
  233. package/dist/chunk-ROVO6NPJ.js.map +0 -1
  234. package/dist/chunk-SISBMAPO.js.map +0 -1
  235. package/dist/chunk-UMLVJTYV.js.map +0 -1
  236. package/dist/chunk-WV7WV6JO.js.map +0 -1
  237. package/dist/chunk-ZEGSDPB7.js.map +0 -1
  238. package/dist/executor-3W63Y44O.js +0 -11
  239. package/dist/executor-CFFWPWBJ.js +0 -8
  240. package/dist/executor-VDQQOR4F.js +0 -8
  241. package/dist/immutable-guard-B5M95nbq.d.ts +0 -82
  242. package/dist/immutable-guard-qN3zF8o1.d.cts +0 -82
  243. package/dist/issue-TTMGHQ2J.js +0 -12
  244. package/dist/noydb-36S6GQNC.js +0 -37
  245. package/dist/read-only-facade-ITU6L7BL.js +0 -7
  246. package/dist/registry-3YFLZ7WD.js +0 -8
  247. package/dist/registry-TGZISEWC.js +0 -8
  248. package/dist/state-vault-W2OEABNO.js.map +0 -1
  249. package/dist/vault-group-DHAHFX2A.js.map +0 -1
  250. package/dist/with-derivation-BZ2y4bzF.d.ts +0 -13
  251. package/dist/with-derivation-Bozs8DmD.d.cts +0 -13
  252. /package/dist/{chunk-NBBMMJ2H.js.map → chunk-3FSMVWBN.js.map} +0 -0
  253. /package/dist/{chunk-SHX5QBCI.js.map → chunk-4ULLGYPA.js.map} +0 -0
  254. /package/dist/{chunk-CD2AVTEM.js.map → chunk-5IGWRMEC.js.map} +0 -0
  255. /package/dist/{chunk-F4G63NTZ.js.map → chunk-7C6VFNIY.js.map} +0 -0
  256. /package/dist/{chunk-XJV6OB4D.js.map → chunk-7HD67R6U.js.map} +0 -0
  257. /package/dist/{chunk-NYSYPFXJ.js.map → chunk-B6E5IRPJ.js.map} +0 -0
  258. /package/dist/{chunk-3G3W65EQ.js.map → chunk-DY3EOJEN.js.map} +0 -0
  259. /package/dist/{chunk-YYVZYTWW.js.map → chunk-E66DSTJP.js.map} +0 -0
  260. /package/dist/{chunk-5LIROIDM.js.map → chunk-FBLAWK6A.js.map} +0 -0
  261. /package/dist/{chunk-E77UKJYL.js.map → chunk-FPHRTW2Z.js.map} +0 -0
  262. /package/dist/{chunk-U5QCMH3W.js.map → chunk-GKQAU52M.js.map} +0 -0
  263. /package/dist/{chunk-2FU2FTXD.js.map → chunk-GYAWXHFO.js.map} +0 -0
  264. /package/dist/{chunk-XPIHJ34I.js.map → chunk-IBVTH4JR.js.map} +0 -0
  265. /package/dist/{chunk-C3HYQPV4.js.map → chunk-IVP5IVON.js.map} +0 -0
  266. /package/dist/{chunk-BL5GYANC.js.map → chunk-KEDJDWWQ.js.map} +0 -0
  267. /package/dist/{chunk-J7RWBXFY.js.map → chunk-LSIIPKYT.js.map} +0 -0
  268. /package/dist/{chunk-BSZOCSDZ.js.map → chunk-M3FPNTO2.js.map} +0 -0
  269. /package/dist/{chunk-XMVHEWF6.js.map → chunk-MI36HL5G.js.map} +0 -0
  270. /package/dist/{chunk-UNTGHX5A.js.map → chunk-OKOKPYWH.js.map} +0 -0
  271. /package/dist/{chunk-H2MRGONI.js.map → chunk-PTGQPWMV.js.map} +0 -0
  272. /package/dist/{chunk-BJSLBUJ7.js.map → chunk-PWFTQHYX.js.map} +0 -0
  273. /package/dist/{chunk-5AXTH4QZ.js.map → chunk-Q5MCHUXZ.js.map} +0 -0
  274. /package/dist/{chunk-QHM6XEAH.js.map → chunk-S22UOMHM.js.map} +0 -0
  275. /package/dist/{chunk-WIAOUFFB.js.map → chunk-S3XA7G35.js.map} +0 -0
  276. /package/dist/{chunk-KCEHMDZF.js.map → chunk-U7JNBSS3.js.map} +0 -0
  277. /package/dist/{chunk-ZNGPEV5J.js.map → chunk-V3VIRTTE.js.map} +0 -0
  278. /package/dist/{chunk-TIDXB5DF.js.map → chunk-V5FZWQNN.js.map} +0 -0
  279. /package/dist/{chunk-AEIKD3PP.js.map → chunk-VNUE6FHP.js.map} +0 -0
  280. /package/dist/{chunk-XMHUK5PN.js.map → chunk-X7FJMKT3.js.map} +0 -0
  281. /package/dist/{chunk-SNMJ7SB3.js.map → chunk-Y5J63SMF.js.map} +0 -0
  282. /package/dist/{chunk-M476FOQ7.js.map → chunk-YLRRU72W.js.map} +0 -0
  283. /package/dist/{chunk-DWEBTE2W.js.map → chunk-YX333DPS.js.map} +0 -0
  284. /package/dist/{chunk-BH3X5L6A.js.map → chunk-YZE6C3TQ.js.map} +0 -0
  285. /package/dist/{crypto-7BN2HDWG.js.map → crypto-B46VNH6X.js.map} +0 -0
  286. /package/dist/{delegation-MGH5SODX.js.map → delegation-5HON72PV.js.map} +0 -0
  287. /package/dist/{executor-3W63Y44O.js.map → executor-44R5CUS2.js.map} +0 -0
  288. /package/dist/{executor-CFFWPWBJ.js.map → executor-AOACUK7Z.js.map} +0 -0
  289. /package/dist/{executor-VDQQOR4F.js.map → executor-OKFLQCDW.js.map} +0 -0
  290. /package/dist/{fanout-sidecar-FIJJ46YG.js.map → fanout-sidecar-DCQWJQ6S.js.map} +0 -0
  291. /package/dist/{issue-TTMGHQ2J.js.map → issue-EPA2PSWP.js.map} +0 -0
  292. /package/dist/{ledger-LFVLHE5H.js.map → ledger-LS6GXCBP.js.map} +0 -0
  293. /package/dist/{noydb-36S6GQNC.js.map → noydb-BVKFP74P.js.map} +0 -0
  294. /package/dist/{public-envelope-RXZNP3V6.js.map → public-envelope-AGU6SS4Z.js.map} +0 -0
  295. /package/dist/{read-only-facade-ITU6L7BL.js.map → read-only-facade-EX6WZZBP.js.map} +0 -0
  296. /package/dist/{registry-3YFLZ7WD.js.map → registry-ERNAMRDE.js.map} +0 -0
  297. /package/dist/{registry-SECUWSGY.js.map → registry-EXTHSXQW.js.map} +0 -0
  298. /package/dist/{registry-TGZISEWC.js.map → registry-RDPTFXQ7.js.map} +0 -0
  299. /package/dist/{revoke-B54H2S2W.js.map → revoke-IFLXEZA5.js.map} +0 -0
  300. /package/dist/{signer-YSXZT574.js.map → signer-UNWOUJAK.js.map} +0 -0
  301. /package/dist/{stale-TOA36SRK.js.map → stale-NTEV5SLX.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import { I as IndexStrategy, d as LazyQuery } from './lazy-builder-ChSqcF5t.js';
2
- import { L as LiveAggregation, b as AggregateSpec, a as AggregateResult, v as MoneyDescriptor, A as AggregateStrategy } from './strategy-4M9jo172.js';
2
+ import { c as OnMissingPolicy, a as I18nTextDescriptor, L as Layer, u as LiveAggregation, j as AggregateSpec, h as AggregateResult, N as MoneyDescriptor, A as AggregateStrategy } from './strategy-BDxQnnTX.js';
3
3
  import { C as CrdtStrategy, a as CrdtMode, b as CrdtState } from './strategy-BSxFXGzb.js';
4
- import { L as LedgerEntry, F as ForgetStrategy, S as SubjectRef, b as ForgetResult } from './index-C-SSRIxP.js';
5
- import { N as NoydbError } from './errors-Dz64FA65.js';
6
- import { L as LiveQuery, Q as Query, c as JoinStrategy, j as RefRegistry, R as RefDescriptor, d as JoinableSource, l as RefViolation, S as ScanBuilder } from './index-DpU6KWof.js';
4
+ import { L as LedgerEntry, F as ForgetStrategy, S as SubjectRef, b as ForgetResult } from './index-BMmajblo.js';
5
+ import { N as NoydbError } from './errors-DL-zTrrF.js';
6
+ import { L as LiveQuery, Q as Query, c as JoinStrategy, j as RefRegistry, R as RefDescriptor, d as JoinableSource, l as RefViolation, S as ScanBuilder } from './index-BelbyUwz.js';
7
7
  import { I as IndexDef, O as Operator, F as FieldClause, C as CollectionIndexes } from './predicate-BmhBSPCH.js';
8
8
  import { AttestationFieldSchema, RevocationList } from '@noy-db/attestation';
9
9
 
@@ -1607,284 +1607,6 @@ interface PeriodsStrategy {
1607
1607
  appendPeriodLedgerEntry(ledger: LedgerStore | null, actor: string, envelope: EncryptedEnvelope, periodName: string): Promise<void>;
1608
1608
  }
1609
1609
 
1610
- /**
1611
- * Per-layer i18n resolution policy.
1612
- *
1613
- * `onMissing` governs what happens when a multilingual field is resolved
1614
- * to a target locale that is absent. It may be a single scalar policy or
1615
- * a per-layer map, so a field can be lenient at the app read boundary but
1616
- * strict inside a materialized view.
1617
- *
1618
- * Effective policy for layer `λ`:
1619
- *
1620
- * ```
1621
- * explicit(λ) = typeof onMissing === 'object' ? onMissing[λ] : undefined
1622
- * scalar = typeof onMissing === 'string' ? onMissing : undefined
1623
- * policy(λ) = explicit(λ) ?? layerDefault(λ) ?? scalar ?? 'throw'
1624
- * ```
1625
- *
1626
- * - `layerDefault('guard') = 'substitute'` — guards are lenient unless
1627
- * EXPLICITLY overridden; they never inherit a scalar policy (a guard
1628
- * reading a display value must not hard-fail on a missing locale).
1629
- * - every other layer has no default, so it inherits the scalar, else
1630
- * falls back to `'throw'` (today's behavior — zero breaking change).
1631
- *
1632
- * @public
1633
- */
1634
- type OnMissing = 'substitute' | 'null' | 'throw';
1635
- /**
1636
- * The contexts in which a multilingual field is resolved. Each can carry
1637
- * its own `onMissing` policy.
1638
- *
1639
- * - `read` — ordinary app reads (`get`/`list`/query projection).
1640
- * - `guard` — a guard callback reading a value.
1641
- * - `join` — a joined record expanded onto a row.
1642
- * - `mv` — materialized-view input.
1643
- * - `derivation` — derivation input.
1644
- * - `export` — bundle/public-envelope export.
1645
- */
1646
- type Layer = 'read' | 'guard' | 'join' | 'mv' | 'derivation' | 'export';
1647
- /** Field-level policy: a single scalar, or a per-layer map. */
1648
- type OnMissingPolicy = OnMissing | Partial<Record<Layer, OnMissing>>;
1649
- /**
1650
- * Resolve the effective `OnMissing` for a layer from a field's declared
1651
- * policy. See module docs for the resolution rule.
1652
- */
1653
- declare function resolvePolicy(onMissing: OnMissingPolicy | undefined, layer: Layer): OnMissing;
1654
-
1655
- /**
1656
- * i18nText schema type —
1657
- *
1658
- * `i18nText({ languages, required })` creates a descriptor for a
1659
- * multi-language content field whose value is stored as a
1660
- * `{ [locale]: string }` map (e.g. `{ en: 'Consulting', th: 'ที่ปรึกษา' }`).
1661
- *
1662
- * On put, the descriptor validates that required languages are present.
1663
- * On read (when a `locale` option is passed), the map is collapsed to the
1664
- * caller's locale string via the fallback chain.
1665
- *
1666
- * Design decisions
1667
- * ────────────────
1668
- *
1669
- * **Descriptor pattern (not a Zod type).**
1670
- * `i18nText()` returns a plain descriptor object used in the collection's
1671
- * `i18nFields` option — same pattern as `ref()` / `dictKey()`. This keeps
1672
- * `@noy-db/core` at zero runtime dependencies and avoids Zod v3 field-type
1673
- * constraints. TypeScript inference is handled via the descriptor's type.
1674
- *
1675
- * **Enforcement at the collection boundary.**
1676
- * The `required` option is checked by `Collection.put()` via the compartment's
1677
- * registered `i18nFields`. Failed validation throws `MissingTranslationError`
1678
- * — a distinct class from `SchemaValidationError` so callers can tell
1679
- * "wrong shape" from "missing translations".
1680
- *
1681
- * **Resolution is post-decryption.**
1682
- * Locale resolution happens AFTER `decryptRecord()`, as a pure in-memory
1683
- * transform. No additional crypto work is needed. The resolved record is
1684
- * returned in place of the stored one, with i18nText fields replaced by
1685
- * their locale-resolved strings.
1686
- *
1687
- * **`locale: 'raw'`.**
1688
- * Passing `{ locale: 'raw' }` skips resolution and returns the full
1689
- * `{ [locale]: string }` map — useful for bilingual exports, admin UIs,
1690
- * and any context where all translations must be visible at once.
1691
- *
1692
- * **Out of scope.**
1693
- * Pluralization, RTL rendering, date/number formatting, per-locale CRDT
1694
- * merging.
1695
- */
1696
-
1697
- /** Flatten an intersection into a single object literal for nicer hovers. */
1698
- type Prettify<T> = {
1699
- [K in keyof T]: T[K];
1700
- } & {};
1701
- /**
1702
- * The stored shape of a multilingual field, inferred from its `required`
1703
- * mode — so the compiler forces you to handle an absent optional locale
1704
- * (`string | undefined`) instead of silently yielding `undefined`.
1705
- *
1706
- * Mirrors `i18nText({ languages, required })`:
1707
- * - `'all'` (default) — every locale required: `{ th: string; en: string }`
1708
- * - `'any'` — every locale optional: `{ th?: string; en?: string }`
1709
- * (the "at least one present" guarantee is runtime-only — not expressible
1710
- * in TypeScript — so each key is optional)
1711
- * - `readonly L[]` — listed locales required, the rest optional:
1712
- * `I18nMap<'th'|'en', ['th']>` → `{ th: string; en?: string }`
1713
- *
1714
- * @example
1715
- * ```ts
1716
- * type Lang = 'th' | 'en'
1717
- * interface Contact {
1718
- * name: I18nMap<Lang, 'any'> // { th?: string; en?: string }
1719
- * legalName: I18nMap<Lang, ['th']> // { th: string; en?: string }
1720
- * slug: I18nMap<Lang> // { th: string; en: string }
1721
- * }
1722
- * ```
1723
- *
1724
- * @public
1725
- */
1726
- type I18nMap<Langs extends string, Required extends 'all' | 'any' | readonly Langs[] = 'all'> = Required extends 'all' ? Record<Langs, string> : Required extends 'any' ? Partial<Record<Langs, string>> : Required extends readonly (infer R extends Langs)[] ? Prettify<Record<R, string> & Partial<Record<Exclude<Langs, R>, string>>> : never;
1727
- /**
1728
- * Options for `i18nText()`.
1729
- *
1730
- * `languages` declares the full set of supported locales. `required`
1731
- * controls which must be present on every `put()`.
1732
- *
1733
- * `autoTranslate` is the per-field opt-in for the `plaintextTranslator`
1734
- * hook. When `true` and a `plaintextTranslator` is configured
1735
- * on `createNoydb()`, missing translations are generated before `put()`.
1736
- * Default: `false`.
1737
- */
1738
- interface I18nTextOptions {
1739
- /** All supported locale codes (BCP 47). */
1740
- readonly languages: readonly string[];
1741
- /**
1742
- * Which locales must be present on every `put()`.
1743
- *
1744
- * - `'all'` — every declared language must be present.
1745
- * - `'any'` — at least one declared language must be present.
1746
- * - `string[]` — listed locales are required; others are optional.
1747
- */
1748
- readonly required: 'all' | 'any' | readonly string[];
1749
- /**
1750
- * Per-field opt-in for the `plaintextTranslator` hook.
1751
- * When `true`, missing required translations are auto-generated
1752
- * before `put()` if a translator is configured. Default: `false`.
1753
- */
1754
- readonly autoTranslate?: boolean;
1755
- /**
1756
- * What to do when this field is resolved to a locale that is absent.
1757
- * A single policy, or a per-layer map (read/guard/join/mv/derivation/
1758
- * export). Default `'throw'` — today's behavior, zero breaking change.
1759
- * See {@link OnMissingPolicy}.
1760
- *
1761
- * NOTE (current wiring): the `read` layer (`get`/`list`) is enforced.
1762
- * Guard, derivation, mv, join and export reads currently resolve
1763
- * through the same read path and so observe the `read`/scalar policy;
1764
- * dedicated per-layer enforcement for those contexts is a tracked
1765
- * follow-up (mv/join additionally require resolution to be injected
1766
- * into the query/aggregate pipeline, which today reads raw maps).
1767
- */
1768
- readonly onMissing?: OnMissingPolicy;
1769
- /**
1770
- * Ordered preferred-substitute locales used when `onMissing` resolves
1771
- * to `'substitute'` and the target locale is absent. `'any'` as an
1772
- * element means "first non-empty value". A caller-supplied `fallback`
1773
- * at read time takes precedence over this declared list.
1774
- */
1775
- readonly substitute?: readonly string[];
1776
- /**
1777
- * Per-locale script enforcement (write-time). `'auto'` infers the
1778
- * allowed Unicode scripts per locale (asymmetric Latin tolerance); an
1779
- * object overrides per slot. Absent ⇒ no check. See `./script.ts`.
1780
- */
1781
- readonly script?: 'auto' | Partial<Record<string, readonly string[]>>;
1782
- /**
1783
- * What to do when a slot's value contains characters outside its
1784
- * allowed script set. Default `'reject'`.
1785
- */
1786
- readonly onScriptViolation?: 'reject' | 'filter' | 'warn';
1787
- }
1788
- /**
1789
- * Descriptor returned by `i18nText()`. Attach to the collection's
1790
- * `i18nFields` option:
1791
- *
1792
- * ```ts
1793
- * const lineItems = company.collection<LineItem>('line-items', {
1794
- * i18nFields: {
1795
- * description: i18nText({ languages: ['en', 'th'], required: 'all' }),
1796
- * },
1797
- * })
1798
- * ```
1799
- */
1800
- interface I18nTextDescriptor {
1801
- readonly _noydbI18nText: true;
1802
- readonly options: I18nTextOptions;
1803
- }
1804
- /**
1805
- * Create an `I18nTextDescriptor` for a multi-language content field.
1806
- *
1807
- * @param options Language list + enforcement mode.
1808
- *
1809
- * @example
1810
- * ```ts
1811
- * i18nText({ languages: ['en', 'th'], required: 'all' })
1812
- * i18nText({ languages: ['en', 'th'], required: ['th'], autoTranslate: true })
1813
- * ```
1814
- */
1815
- declare function i18nText(options: I18nTextOptions): I18nTextDescriptor;
1816
- /** Runtime predicate for detecting an `I18nTextDescriptor`. */
1817
- declare function isI18nTextDescriptor(x: unknown): x is I18nTextDescriptor;
1818
- /**
1819
- * Validate that a value is a valid `{ [locale]: string }` map and that
1820
- * all required locales are present. Throws `MissingTranslationError`
1821
- * when the required constraint is violated.
1822
- *
1823
- * Called by `Collection.put()` for each registered `i18nField`.
1824
- *
1825
- * @param value The raw field value from the record being put.
1826
- * @param field The field name (used in the thrown error message).
1827
- * @param descriptor The `i18nText()` descriptor for this field.
1828
- */
1829
- declare function validateI18nTextValue(value: unknown, field: string, descriptor: I18nTextDescriptor): void;
1830
- /**
1831
- * Resolve an i18nText value (`{ [locale]: string }` map) to a string
1832
- * for the given locale.
1833
- *
1834
- * @param value The stored locale map.
1835
- * @param locale The requested locale code, or `'raw'` to return the map.
1836
- * @param fallback Single locale or ordered list; use `'any'` as the last
1837
- * element to fall back to any available translation.
1838
- * @param field Field name used in `LocaleNotSpecifiedError` messages.
1839
- * @returns The resolved string, OR the original map when `locale === 'raw'`.
1840
- */
1841
- /** Options for the policy-aware form of {@link resolveI18nText}. */
1842
- interface ResolveI18nOptions {
1843
- /** Effective policy for the resolution layer. Default `'throw'`. */
1844
- readonly policy?: OnMissing;
1845
- /** Declared substitute chain; applied only under policy `'substitute'`. */
1846
- readonly substitute?: readonly string[];
1847
- }
1848
- declare function resolveI18nText(value: Record<string, string>, locale: string, fallback?: string | readonly string[], field?: string): string | Record<string, string>;
1849
- declare function resolveI18nText(value: Record<string, string>, locale: string, fallback: string | readonly string[] | undefined, field: string | undefined, opts: ResolveI18nOptions): string | Record<string, string> | null;
1850
- /**
1851
- * Return all leaf values at `path`, expanding `[].` array wildcards.
1852
- *
1853
- * - `'name'` → `[obj.name]`
1854
- * - `'address.lineOne'` → `[obj.address.lineOne]`
1855
- * - `'contacts[].title'` → `[obj.contacts[0].title, obj.contacts[1].title, …]`
1856
- *
1857
- * Returns an empty array when the path does not resolve (missing key,
1858
- * wrong type, etc.). Used by `enforceI18nOnPut` to validate nested fields.
1859
- */
1860
- declare function getAtPath(obj: Record<string, unknown>, path: string): unknown[];
1861
- /**
1862
- * Mutate `obj` in-place, setting `value` at the nested `path`.
1863
- * Supports dot notation (`'address.lineOne'`) but not array wildcards —
1864
- * auto-translate on `contacts[].title` style paths is not supported.
1865
- */
1866
- declare function setAtPathInPlace(obj: Record<string, unknown>, path: string, value: unknown): void;
1867
- /**
1868
- * Apply locale resolution to a single record, returning a new copy.
1869
- *
1870
- * For each field registered as an `i18nText` descriptor:
1871
- * - If `locale === 'raw'`, the field value is left as the stored map.
1872
- * - Otherwise, the field value is replaced with the resolved string.
1873
- *
1874
- * Field paths support dot notation (`'address.lineOne'`) and array
1875
- * wildcards (`'contacts[].title'`). Top-level fields work as before.
1876
- *
1877
- * @param record The decrypted record.
1878
- * @param i18nFields Map of field path → `I18nTextDescriptor`.
1879
- * @param locale The requested locale (or `'raw'`).
1880
- * @param fallback Fallback chain (optional).
1881
- * @param layer Resolution layer (default `'read'`). Each field's
1882
- * `onMissing` policy is resolved for this layer, so the
1883
- * same record resolves leniently on a get but strictly
1884
- * inside an mv/derivation.
1885
- */
1886
- declare function applyI18nLocale(record: Record<string, unknown>, i18nFields: Record<string, I18nTextDescriptor>, locale: string, fallback?: string | readonly string[], layer?: Layer): Record<string, unknown>;
1887
-
1888
1610
  type EventHandler<T> = (data: T) => void;
1889
1611
  /** Typed event emitter for NOYDB events. */
1890
1612
  declare class NoydbEventEmitter {
@@ -3464,6 +3186,34 @@ interface HistoryStrategy {
3464
3186
  buildVaultInstant(engine: VaultEngine, timestamp: string): VaultInstant;
3465
3187
  }
3466
3188
 
3189
+ /**
3190
+ * Scan-mode full-text search (#308) — ranks **already-decrypted** records by
3191
+ * BM25 against a tokenized query. Pure client-side: nothing is written to the
3192
+ * store, so this adds **zero** leakage (unlike a store-usable blind index,
3193
+ * which is a separate, gated opt-in — see the #308 design note).
3194
+ *
3195
+ * O(n) over the collection; intended for small/medium collections (the pilot's
3196
+ * scale) where moving the existing userland scan into the DB is the win.
3197
+ */
3198
+
3199
+ interface SearchOptions {
3200
+ /** Top-N by score (default: all matches). */
3201
+ readonly limit?: number;
3202
+ /** `'any'` (default) = OR of query terms; `'all'` = every term must match. */
3203
+ readonly match?: 'any' | 'all';
3204
+ /** Treat the LAST query term as a prefix (typeahead). */
3205
+ readonly prefix?: boolean;
3206
+ }
3207
+ interface SearchResult<T> {
3208
+ readonly id: string;
3209
+ readonly score: number;
3210
+ readonly record: T;
3211
+ }
3212
+ interface SearchEntry<T> {
3213
+ readonly id: string;
3214
+ readonly record: T;
3215
+ }
3216
+
3467
3217
  interface LruOptions {
3468
3218
  /** Maximum number of entries before eviction. Required if `maxBytes` is unset. */
3469
3219
  maxRecords?: number;
@@ -3740,6 +3490,16 @@ interface ShardingConfig<T> {
3740
3490
  readonly vaultTemplate: string;
3741
3491
  /** When a write targets an unknown partition key, stamp a shard inline. Default `true`. */
3742
3492
  readonly autoCreate?: boolean;
3493
+ /**
3494
+ * Data-residency guard (#271): the geographic region a record's shard must
3495
+ * live in (e.g. `'eu'`). When set, `createShard` resolves the candidate
3496
+ * backend (via `routeStore`'s vault-prefix routing) and throws
3497
+ * `DataResidencyError` if its `capabilities.region` doesn't match — so a
3498
+ * shard never lands on a non-compliant backend. Advisory until a region is
3499
+ * declared on the backing store; pair with `routeStore({ vaultRoutes })`
3500
+ * and a region-encoded partition key (e.g. `eu-acme` → `firm--eu-`).
3501
+ */
3502
+ readonly regionOf?: (record: T) => string;
3743
3503
  }
3744
3504
  /** Options for `Noydb.openVaultGroup`. */
3745
3505
  interface VaultGroupOptions<T> {
@@ -3750,6 +3510,25 @@ interface VaultGroupOptions<T> {
3750
3510
  */
3751
3511
  readonly registry?: Collection<VaultRegistryRow>;
3752
3512
  readonly sharding: ShardingConfig<T>;
3513
+ /**
3514
+ * Lazy migrate-on-open (#271 fleet migration). When `true`, opening a shard
3515
+ * whose registry `schemaVersion` is behind the template's version runs that
3516
+ * shard's cutover inline (via `migrateShard`) before surfacing the handle.
3517
+ * Zero cost for shards never opened. Default `false` (use `migrateFleet`).
3518
+ */
3519
+ readonly migrateOnOpen?: boolean;
3520
+ }
3521
+ /** Result of `VaultGroup.migrateFleet` (#271 active batch runner). */
3522
+ interface FleetMigrationResult {
3523
+ /** The version migrated toward (the template's current version). */
3524
+ readonly target: number;
3525
+ /** vaultIds successfully migrated (or already current). */
3526
+ readonly migrated: string[];
3527
+ /** vaultIds whose cutover failed, with the error message. */
3528
+ readonly failed: {
3529
+ readonly vaultId: string;
3530
+ readonly error: string;
3531
+ }[];
3753
3532
  }
3754
3533
  /** Options for a cross-shard fan-out read. */
3755
3534
  interface FanoutQueryOptions {
@@ -3794,6 +3573,48 @@ interface CrossVaultLiveAggregation<R> extends LiveAggregation<R> {
3794
3573
  readonly skippedVaults: readonly SkippedVault[];
3795
3574
  readonly ready: Promise<void>;
3796
3575
  }
3576
+ /**
3577
+ * Context passed to a cross-vault `derive` callback (#271 Insight Vault).
3578
+ * One call per shard; identifies which shard the records came from.
3579
+ */
3580
+ interface CrossVaultDerivationContext {
3581
+ /** The shard's vault id (e.g. `firm-clients--acme`). */
3582
+ readonly vaultId: string;
3583
+ /** The shard's partition key (e.g. `acme`). */
3584
+ readonly partitionKey: string;
3585
+ /** The shard's schema/template version, from its registry row. */
3586
+ readonly schemaVersion: number;
3587
+ }
3588
+ /**
3589
+ * A push-model cross-vault derivation (#271, Insight Vault — Layer 4).
3590
+ *
3591
+ * For each eligible shard, `refreshInsights()` reads the shard's `source`
3592
+ * collection, runs `derive` on that shard's records, and writes the returned
3593
+ * summary row into a separate analytics ("Insight") vault — keyed by partition
3594
+ * key, one row per shard. The summary is re-encrypted under the Insight Vault's
3595
+ * own DEK; the shard's ciphertext never leaves its DEK boundary (the push model
3596
+ * that resolves the cross-vault DEK conflict). See the ZK note in the spec —
3597
+ * the Insight Vault backend sees aggregated structure across shards, a weaker
3598
+ * profile than per-shard vaults; opt-in.
3599
+ */
3600
+ interface CrossVaultDerivationSpec<R = Record<string, unknown>, S = Record<string, unknown>> {
3601
+ /** Collection read from each shard. */
3602
+ readonly source: string;
3603
+ /** Destination Insight Vault + collection for the per-shard summary rows. */
3604
+ readonly target: {
3605
+ readonly vault: string;
3606
+ readonly collection: string;
3607
+ };
3608
+ /** Per-shard reducer: that shard's source records + context → one summary row. */
3609
+ readonly derive: (records: R[], ctx: CrossVaultDerivationContext) => S;
3610
+ }
3611
+ /** The result of `refreshInsights()`. */
3612
+ interface RefreshInsightsResult {
3613
+ /** Number of summary rows written (one per eligible shard × registered derivation). */
3614
+ readonly written: number;
3615
+ /** Shards excluded (schema-drift, unprovisioned, or read error). */
3616
+ readonly skippedVaults: SkippedVault[];
3617
+ }
3797
3618
  /** A serializable blueprint captured from a VaultTemplate.configure run. */
3798
3619
  interface CapturedBlueprint {
3799
3620
  /** Sorted collection names declared by the template. */
@@ -3818,12 +3639,34 @@ interface SchemaManifestRow {
3818
3639
  interface DeploymentEvent {
3819
3640
  readonly id: string;
3820
3641
  readonly ts: number;
3821
- readonly type: 'shard-created' | 'manifest-recorded' | 'group-opened';
3642
+ readonly type: 'shard-created' | 'manifest-recorded' | 'group-opened' | 'migration-started' | 'migration-completed' | 'migration-failed';
3822
3643
  readonly group: string;
3823
3644
  readonly vaultId?: string;
3824
3645
  readonly templateName?: string;
3825
3646
  readonly version?: number;
3826
3647
  readonly actor?: string;
3648
+ /** Free-form detail (e.g. migration error message). */
3649
+ readonly detail?: string;
3650
+ }
3651
+ /**
3652
+ * One row in the StateManagement `migration-status` collection (#271 fleet
3653
+ * schema-migration runner), keyed by `vaultId`. Tracks each shard's progress
3654
+ * toward the template's current version so the active batch runner is
3655
+ * resumable and the staged rollout can verify a cohort before proceeding.
3656
+ */
3657
+ interface MigrationStatusRow {
3658
+ readonly vaultId: string;
3659
+ readonly group: string;
3660
+ /** The shard's registry schemaVersion at the time of this status. */
3661
+ readonly currentVersion: number;
3662
+ /** The version the runner is moving this shard to (the template's version). */
3663
+ readonly targetVersion: number;
3664
+ readonly status: 'pending' | 'running' | 'done' | 'failed';
3665
+ readonly startedAt?: number;
3666
+ readonly finishedAt?: number;
3667
+ /** Records migrated by the per-shard cutover (when status `done`). */
3668
+ readonly migrated?: number;
3669
+ readonly error?: string;
3827
3670
  }
3828
3671
 
3829
3672
  /**
@@ -3838,8 +3681,14 @@ declare class StateManagementVault {
3838
3681
  readonly registry: Collection<VaultRegistryRow>;
3839
3682
  readonly schemaManifest: Collection<SchemaManifestRow>;
3840
3683
  private constructor();
3841
- /** Idempotently open the reserved state vault and bind the three control-plane collections. */
3684
+ /** Idempotently open the reserved state vault and bind the control-plane collections. */
3842
3685
  static open(db: Noydb): Promise<StateManagementVault>;
3686
+ /** Read one shard's migration status (or null). */
3687
+ getMigrationStatus(vaultId: string): Promise<MigrationStatusRow | null>;
3688
+ /** All migration-status rows (hydrates first). */
3689
+ listMigrationStatus(): Promise<MigrationStatusRow[]>;
3690
+ /** Upsert one shard's migration status (keyed by vaultId). */
3691
+ upsertMigrationStatus(row: MigrationStatusRow): Promise<void>;
3843
3692
  /** Read-only query over the append-only deployment-events log. */
3844
3693
  queryEvents(): Query<DeploymentEvent>;
3845
3694
  /**
@@ -5544,12 +5393,14 @@ declare class VaultGroup<T> {
5544
5393
  /** @internal */ readonly registry: Collection<VaultRegistryRow>;
5545
5394
  /** @internal */ readonly sharding: ShardingConfig<T>;
5546
5395
  /** @internal */ readonly template: VaultTemplate;
5396
+ /** @internal — lazy migrate-on-open (#271). */ readonly migrateOnOpen: boolean;
5547
5397
  constructor(
5548
5398
  /** @internal */ db: Noydb,
5549
5399
  /** @internal */ name: string,
5550
5400
  /** @internal */ registry: Collection<VaultRegistryRow>,
5551
5401
  /** @internal */ sharding: ShardingConfig<T>,
5552
- /** @internal */ template: VaultTemplate);
5402
+ /** @internal */ template: VaultTemplate,
5403
+ /** @internal — lazy migrate-on-open (#271). */ migrateOnOpen?: boolean);
5553
5404
  /** @internal — set when the group is managed (no explicit registry). */
5554
5405
  private stateVault;
5555
5406
  /** @internal */
@@ -5572,8 +5423,14 @@ declare class VaultGroup<T> {
5572
5423
  * `liveBinding().isRelevant` already applies to the reactive path.
5573
5424
  */
5574
5425
  allRows(): Promise<VaultRegistryRow[]>;
5575
- /** Open an existing shard and apply the template. */
5426
+ /**
5427
+ * Open an existing shard and apply the template. When `migrateOnOpen` is set
5428
+ * (#271) and the shard's registry version is behind the template, its cutover
5429
+ * runs inline first — so a behind shard never surfaces a stale handle.
5430
+ */
5576
5431
  openShard(partitionKey: string): Promise<Vault>;
5432
+ /** @internal — open + configure with no migrate-on-open hook (used by the migration path itself to avoid recursion). */
5433
+ private _openShardRaw;
5577
5434
  /**
5578
5435
  * Idempotently provision a shard for `partitionKey`. Returns the
5579
5436
  * configured vault handle.
@@ -5581,8 +5438,12 @@ declare class VaultGroup<T> {
5581
5438
  * - row + vault present → no-op, return handle
5582
5439
  * - row present, vault gone → ShardProvisioningError
5583
5440
  * - row absent (vault present or not) → open-or-create, configure, write row
5441
+ *
5442
+ * When `region` is given (the routing `put` passes `sharding.regionOf(record)`),
5443
+ * the candidate backend's `capabilities.region` must match or this throws
5444
+ * `DataResidencyError` BEFORE provisioning (#271 data-residency guard).
5584
5445
  */
5585
- createShard(partitionKey: string): Promise<Vault>;
5446
+ createShard(partitionKey: string, region?: string): Promise<Vault>;
5586
5447
  /**
5587
5448
  * Drill down to a single shard's full Collection API. Throws if the shard is unknown.
5588
5449
  * Also throws ShardProvisioningError if the registry row exists but the vault has been deleted
@@ -5598,6 +5459,74 @@ declare class VaultGroup<T> {
5598
5459
  eligible: VaultRegistryRow[];
5599
5460
  skipped: SkippedVault[];
5600
5461
  }>;
5462
+ /** @internal — registered push-model cross-vault derivations (#271 Insight Vault). */
5463
+ private readonly crossVaultDerivations;
5464
+ /**
5465
+ * Register a push-model cross-vault derivation — the Insight Vault pattern
5466
+ * (#271, Layer 4). Drive it with {@link refreshInsights}.
5467
+ *
5468
+ * For each shard, `derive(records, ctx)` runs on that shard's `source`
5469
+ * records and its return value is written into the analytics
5470
+ * (`target.vault` / `target.collection`) vault, keyed by partition key —
5471
+ * one summary row per shard. The derivation runs in-process under THIS
5472
+ * group's `Noydb` (which already holds both the shard and Insight Vault
5473
+ * keyrings); the shard's decrypted records are reduced to a summary that is
5474
+ * re-encrypted under the Insight Vault's own DEK, so no shard ciphertext
5475
+ * crosses a DEK boundary.
5476
+ *
5477
+ * **Zero-knowledge note:** the Insight Vault backend sees aggregated
5478
+ * structure (totals, counts, timestamps) drawn from many shards — a weaker
5479
+ * ZK profile than the per-shard vaults. Opt-in; keep summaries to aggregate
5480
+ * scalars (no embeddings / no raw records).
5481
+ *
5482
+ * v1 is explicit-refresh (no write-path push); call `refreshInsights()`
5483
+ * after a batch of writes, or on a schedule.
5484
+ *
5485
+ * The `target.vault` must NOT be the group itself or one of its shards —
5486
+ * a summary writing back into client-shard data would breach the Insight
5487
+ * Vault's separate-DEK-boundary contract. Such a target throws a
5488
+ * `ValidationError` at registration (#271 Insight-write isolation).
5489
+ */
5490
+ withCrossVaultDerivation<R = Record<string, unknown>, S = Record<string, unknown>>(spec: CrossVaultDerivationSpec<R, S>): void;
5491
+ /**
5492
+ * Run every registered {@link withCrossVaultDerivation}: read each eligible
5493
+ * shard's source records, derive a per-shard summary, and write it into the
5494
+ * Insight Vault keyed by partition key. Shards behind `minVersion`,
5495
+ * unprovisioned, or whose read errors are reported in `skippedVaults` and
5496
+ * are not written (a stale summary is never left behind for a failed shard).
5497
+ */
5498
+ refreshInsights(options?: {
5499
+ minVersion?: number;
5500
+ concurrency?: number;
5501
+ }): Promise<RefreshInsightsResult>;
5502
+ /** @internal — the control-plane vault for migration status; lazily opened. */
5503
+ private ensureStateVault;
5504
+ /**
5505
+ * Migrate ONE shard to the template's current version (#271 fleet runner,
5506
+ * per-shard step). Opens the shard (applying the template, which arms the
5507
+ * M12 cutover), drains schema-write detection, runs `vault.runSchemaCutover()`
5508
+ * (the per-vault drain-barrier-transform protocol), then advances the
5509
+ * registry row's `schemaVersion` and records `migration-status`. A shard
5510
+ * already at the template version is a no-op (`status: 'done'`, migrated 0).
5511
+ * Never throws on a cutover failure — it records `status: 'failed'` and
5512
+ * returns the row, so a fleet run continues past a bad shard.
5513
+ */
5514
+ migrateShard(partitionKey: string): Promise<MigrationStatusRow>;
5515
+ /**
5516
+ * Active batch runner (#271): migrate every shard behind the template version
5517
+ * to it, in controlled batches. **Resumable + crash-safe** — shards already at
5518
+ * the target are skipped (the registry version is the source of truth), so a
5519
+ * re-run after a crash only picks up the unfinished + previously-failed shards.
5520
+ *
5521
+ * - `cohort` — restrict to these partition keys (the staged / canary rollout:
5522
+ * migrate a small cohort, verify the Insight Vault, then run the rest).
5523
+ * - `batchSize` — max shards migrated concurrently per batch (back-pressure).
5524
+ * Default 4. Batches run sequentially; shards within a batch run in parallel.
5525
+ */
5526
+ migrateFleet(options?: {
5527
+ cohort?: readonly string[];
5528
+ batchSize?: number;
5529
+ }): Promise<FleetMigrationResult>;
5601
5530
  }
5602
5531
  declare class ShardedCollection<T, R = T> {
5603
5532
  private readonly group;
@@ -5970,6 +5899,13 @@ declare class Noydb {
5970
5899
  * (its keyring exists in the store).
5971
5900
  */
5972
5901
  _shardVaultProvisioned(vaultId: string): Promise<boolean>;
5902
+ /**
5903
+ * @internal — the physical backend store a vault id maps to. A
5904
+ * `routeStore` resolves the vault-prefix route via its `resolveBackend`;
5905
+ * a plain store is its own backend. Used by the federation data-residency
5906
+ * guard to read the placement backend's `capabilities.region` (#271).
5907
+ */
5908
+ _resolveBackend(vaultId: string): NoydbStore;
5973
5909
  /**
5974
5910
  * Change the current user's passphrase for a vault.
5975
5911
  *
@@ -6862,6 +6798,27 @@ interface RecordOutputSpec {
6862
6798
  * `DerivationOutputShapeError` — same as v1.
6863
6799
  */
6864
6800
  optional?: boolean;
6801
+ /**
6802
+ * Field-level provenance for a **self-write** output (#376) — an output
6803
+ * whose `collection` equals the strategy's `source`, used by
6804
+ * reverse-denormalization (`triggerBy`) to patch a denormalized field
6805
+ * back onto the source record.
6806
+ *
6807
+ * `denorm` names the ONLY top-level fields the derivation owns on that
6808
+ * record. The engine merges just those fields from the `derive` return
6809
+ * value onto the current stored record (`{ ...current, ...pick(out, denorm) }`)
6810
+ * — the rest of the user's record is never clobbered by a stale snapshot.
6811
+ * The whole-record `_derivedFrom` provenance tag is NOT applied (the
6812
+ * record stays user-owned); the derivation only claims `denorm`.
6813
+ *
6814
+ * Cycle break is value-level: if the patch changes nothing, no write is
6815
+ * issued — so the self-write that re-fires the source-path derivation
6816
+ * terminates after one idempotent pass.
6817
+ *
6818
+ * REQUIRED when `collection === source` (validated at construction);
6819
+ * ignored for outputs to a different collection.
6820
+ */
6821
+ denorm?: readonly string[];
6865
6822
  }
6866
6823
  /**
6867
6824
  * Array-shape output — one source row produces a variable-length
@@ -6942,6 +6899,52 @@ interface DerivationStrategy<TSource extends Record<string, unknown>, TOutputs e
6942
6899
  * (validated at `withDerivation()` construction time).
6943
6900
  */
6944
6901
  sources?: ReadonlyArray<string>;
6902
+ /**
6903
+ * Foreign-key-keyed triggers for reverse-denormalization (#376). Unlike
6904
+ * `sources[]` (which re-fires at the SAME id), a `triggerBy` entry fans a
6905
+ * write to a PARENT collection OUT to every source record whose FK matches
6906
+ * the written parent's id.
6907
+ *
6908
+ * `{ collection, on }`: a write to `collection` (the parent, e.g.
6909
+ * `'buyers'`) re-fires this derivation once per source record where
6910
+ * `source[on] === writtenParentId` (`on` is the FK field ON the source,
6911
+ * e.g. `'buyerId'`). The matched source record — not the parent — is
6912
+ * passed to `derive`.
6913
+ *
6914
+ * Typical use: keep a denormalized field on the source in sync with a
6915
+ * parent change (a buyer rename → refresh `buyerName` on all their sales),
6916
+ * via a self-write output (`collection === source`) declaring `denorm`.
6917
+ *
6918
+ * Fan-out runs through `ctx.vault.collection(source).query().where(on,'==',id)`,
6919
+ * which uses the FK index when the source declares `withIndexing()` on
6920
+ * `on` (O(children)) and otherwise scans (O(N) — fine for small child
6921
+ * sets). Set `maxFanout` as a safety rail; exceeding it throws
6922
+ * `DerivationCapExceededError` before any write. `triggerBy` collections
6923
+ * participate in cycle detection like `source`/`sources`.
6924
+ *
6925
+ * Each `collection` must be non-empty and not equal `source`; `on` must
6926
+ * be a non-empty field name (validated at construction).
6927
+ */
6928
+ triggerBy?: ReadonlyArray<{
6929
+ collection: string;
6930
+ on: string;
6931
+ maxFanout?: number;
6932
+ }>;
6933
+ /**
6934
+ * @internal — set by `withRollup()` (#376 slice 2). Marks this strategy as
6935
+ * an aggregate-onto-parent rollup: a write OR delete of a `from` (child)
6936
+ * record recomputes `compute(children where child[key] === parentId)` and
6937
+ * patches it onto `source[field]` of the parent at `parentId` (= child[key]).
6938
+ * `source` is the parent (`into`) collection; the synthetic self-write
6939
+ * output carries `denorm: [field]`. Dispatch handles rollup specially (it
6940
+ * does not run the executor). Eager-only in this slice.
6941
+ */
6942
+ rollup?: {
6943
+ readonly from: string;
6944
+ readonly key: string;
6945
+ readonly field: string;
6946
+ readonly compute: (children: any[]) => unknown;
6947
+ };
6945
6948
  /** v1: only deterministic derivations supported. */
6946
6949
  deterministic: true;
6947
6950
  /**
@@ -7232,6 +7235,35 @@ interface MaterializedViewStrategy<TRow extends Record<string, unknown>> {
7232
7235
  * if declared alone.
7233
7236
  */
7234
7237
  moneyFields?: Record<string, MoneyDescriptor>;
7238
+ /**
7239
+ * Compute-time i18n resolution locale (#285, `mv` layer). UNION-mode only.
7240
+ *
7241
+ * An MV that **groups by** an `i18nText` field would otherwise bucket on the
7242
+ * raw `{ locale: string }` map — an unstable object key. Set `i18nLocale`
7243
+ * (with {@link i18nFields} describing those fields) and, before grouping, the
7244
+ * executor resolves each declared i18n group-key field to this locale at the
7245
+ * `mv` layer (`resolvePolicy(onMissing, 'mv')`), so buckets are stable strings.
7246
+ *
7247
+ * This is the **compute** path only: i18n fields *carried through* for display
7248
+ * stay raw — declare them on the OUTPUT collection and they resolve per-reader
7249
+ * at read time (the resolve-at-output model). Without `i18nLocale`, grouping by
7250
+ * a raw i18n field throws `LocaleNotSpecifiedError` (steer: group by a
7251
+ * `dictKey`/`staticDict` code — the stable key — and label at read).
7252
+ *
7253
+ * Query-form MVs do their own `groupBy` inside the `Query`, which carries no
7254
+ * locale yet (the join/query-locale slice, #285 §3) — so `i18nLocale` /
7255
+ * `i18nFields` on a query-form MV throw `MaterializedViewConfigError`.
7256
+ */
7257
+ i18nLocale?: string;
7258
+ /**
7259
+ * i18n descriptors for UNION-mode compute (#285), keyed by the OUTPUT field
7260
+ * name as it appears in the mapped row (NOT the source field). Mirrors
7261
+ * {@link moneyFields}: the concatenated mapped stream is a plain array with no
7262
+ * collection i18n context, so the descriptor (carrying `onMissing`/`substitute`
7263
+ * /`fallback`) must be declared here for the `mv`-layer resolution that
7264
+ * {@link i18nLocale} drives. Meaningless without `i18nLocale`.
7265
+ */
7266
+ i18nFields?: Record<string, I18nTextDescriptor>;
7235
7267
  /**
7236
7268
  * Pure function from a materialized row → stable id used in the
7237
7269
  * output collection. Required — explicit always beats default-with-pitfalls
@@ -7563,7 +7595,43 @@ interface NextOptions {
7563
7595
  interface SequenceOptions {
7564
7596
  /** Partition tuple. Each component is URI-encoded and `'/'`-joined. */
7565
7597
  readonly partition?: readonly (string | number)[];
7598
+ /**
7599
+ * Render template for the serial string (#375). When set, `vault.sequence`
7600
+ * returns a {@link FormattedSequenceHandle} whose `next()` resolves to
7601
+ * `{ serial, formatted }`. Tokens:
7602
+ * - `{seq}` — the allocated integer
7603
+ * - `{seq:0N}` — zero-padded to width N (e.g. `{seq:04}` → `0001`)
7604
+ * - `{partition.i}` — the i-th `partition` component (original value)
7605
+ *
7606
+ * Any other token, or a `{partition.i}` index beyond the supplied
7607
+ * `partition`, throws `ValidationError` at `vault.sequence()` construction.
7608
+ * Per-partition reset is inherent: a new partition tuple starts at 1.
7609
+ */
7610
+ readonly format?: string;
7566
7611
  }
7612
+ /**
7613
+ * A formatted sequence handle (#375). Identical to {@link SequenceHandle}
7614
+ * except `next()` also returns the rendered `formatted` string. `peek()` /
7615
+ * `seedTo()` operate on the underlying integer counter, unchanged.
7616
+ */
7617
+ interface FormattedSequenceHandle {
7618
+ /** Allocate the next value and return it with its rendered serial string. */
7619
+ next(opts?: NextOptions): Promise<{
7620
+ serial: number;
7621
+ formatted: string;
7622
+ }>;
7623
+ /** Read the current integer value without allocating. Returns 0 if never used. */
7624
+ peek(): Promise<number>;
7625
+ /** Set-if-greater on the underlying integer counter. See {@link SequenceHandle.seedTo}. */
7626
+ seedTo(n: number): Promise<void>;
7627
+ }
7628
+ /**
7629
+ * Validate a sequence `format` against the supplied partition and return a
7630
+ * pure `(serial) => string` renderer. Eager validation: every token is
7631
+ * checked now, so a bad pattern throws `ValidationError` at construction —
7632
+ * never at `next()` time.
7633
+ */
7634
+ declare function compileSequenceFormat(format: string, series: string, partition: readonly (string | number)[] | undefined): (serial: number) => string;
7567
7635
  /**
7568
7636
  * Resolve the CAS storage key for a (series, partition) pair.
7569
7637
  *
@@ -7639,6 +7707,78 @@ interface Assignment {
7639
7707
  serial: number;
7640
7708
  }
7641
7709
 
7710
+ /**
7711
+ * `_links_*` reserved collections — managed bidirectional many-to-many
7712
+ * junctions (#377 design B).
7713
+ *
7714
+ * Where `refArray` (design A) stores an id-array on one owning record,
7715
+ * `vault.link()` creates a first-class junction: a dedicated encrypted
7716
+ * `_links_<name>` collection whose rows are `{ a, b, meta? }` link tuples.
7717
+ * It is queryable from BOTH sides (`of(id)`), carries optional per-link
7718
+ * metadata, and cascades on endpoint delete.
7719
+ *
7720
+ * Each link is slot-typed: `a` is an id in the `a` endpoint collection,
7721
+ * `b` an id in the `b` endpoint collection (they may be the same
7722
+ * collection for self-links). A link's identity is the ordered pair
7723
+ * `(a, b)`; `of(id)` matches either slot.
7724
+ *
7725
+ * Rows are encrypted under a dedicated `_links_<name>` DEK — same
7726
+ * zero-knowledge stack as every other collection (the store sees only
7727
+ * ciphertext). Backup/restore rides the normal `loadAll` path.
7728
+ */
7729
+
7730
+ /** True for any reserved link-collection name. */
7731
+ declare function isLinkCollectionName(name: string): boolean;
7732
+ /** What happens to a link's rows when one of its endpoint records is deleted. */
7733
+ type LinkOnDelete = 'cascade' | 'strict' | 'warn';
7734
+ /**
7735
+ * Declaration for a link set, passed to `vault.link(name, spec)`. `a` and
7736
+ * `b` are the endpoint collection names (slot-typed). `onDelete` governs
7737
+ * what happens to link rows when an endpoint record is deleted:
7738
+ * `'cascade'` (default) removes the touching link rows, `'strict'` blocks
7739
+ * the endpoint delete while links exist, `'warn'` leaves orphan rows
7740
+ * (surfaced by `vault.checkIntegrity()`).
7741
+ */
7742
+ interface LinkSpec {
7743
+ readonly a: string;
7744
+ readonly b: string;
7745
+ readonly onDelete?: LinkOnDelete;
7746
+ }
7747
+ /** One link tuple as returned by `of()` / `list()`. */
7748
+ interface LinkRow {
7749
+ readonly a: string;
7750
+ readonly b: string;
7751
+ readonly meta?: Record<string, unknown>;
7752
+ }
7753
+ /** Public handle returned by `vault.links(name)`. */
7754
+ interface LinkSetHandle {
7755
+ /** Create (or overwrite the metadata of) the link `(aId, bId)`. Validates both endpoints exist. */
7756
+ connect(aId: string, bId: string, meta?: Record<string, unknown>): Promise<void>;
7757
+ /** Remove the link `(aId, bId)`. Idempotent — a no-op if it doesn't exist. */
7758
+ disconnect(aId: string, bId: string): Promise<void>;
7759
+ /** Whether the link `(aId, bId)` exists. */
7760
+ has(aId: string, bId: string): Promise<boolean>;
7761
+ /** All links touching `id` on EITHER endpoint. */
7762
+ of(id: string): Promise<LinkRow[]>;
7763
+ /** All links in the set. */
7764
+ list(): Promise<LinkRow[]>;
7765
+ }
7766
+ /** Thrown by `connect()` when an endpoint record does not exist. */
7767
+ declare class LinkEndpointError extends NoydbError {
7768
+ readonly link: string;
7769
+ readonly endpoint: string;
7770
+ readonly missingId: string;
7771
+ constructor(link: string, endpoint: string, missingId: string);
7772
+ }
7773
+ /** Thrown when a `strict` link blocks deletion of an endpoint that still has links. */
7774
+ declare class LinkIntegrityError extends NoydbError {
7775
+ readonly link: string;
7776
+ readonly endpoint: string;
7777
+ readonly id: string;
7778
+ readonly count: number;
7779
+ constructor(link: string, endpoint: string, id: string, count: number);
7780
+ }
7781
+
7642
7782
  /**
7643
7783
  * Vault-internal singleton that holds the guard graph and dispatches
7644
7784
  * per-collection guard execution. Owned by `Vault`; not exported.
@@ -7708,12 +7848,25 @@ declare class GuardRegistry {
7708
7848
 
7709
7849
  /**
7710
7850
  * Minimal read-only wrapper over a `Vault`. Used as `ctx.vault` inside
7711
- * guard callbacks so they can fetch related records without acquiring
7712
- * any write capability.
7851
+ * guard / derivation callbacks so they can fetch related records without
7852
+ * acquiring any write capability.
7853
+ *
7854
+ * The `layer` tags every `get`/`list` read with the resolution layer it
7855
+ * belongs to (#285). A guard-seeded facade reads at `'guard'`, a
7856
+ * derivation-seeded one at `'derivation'`, so i18nText / dictKey fields
7857
+ * resolve under that layer's `onMissing` policy instead of the `'read'`
7858
+ * policy — e.g. a guard read can `substitute` a missing locale (lenient
7859
+ * default) while the same field `throw`s on an ordinary app read.
7860
+ *
7861
+ * `query()` is left untagged: the query/aggregate pipeline reads raw
7862
+ * `{locale}` maps (no resolution call site), so a layer tag there would be
7863
+ * inert. Routing `mv`/`join` resolution through the pipeline is tracked
7864
+ * separately (#285 D2/D3).
7713
7865
  */
7714
7866
  declare class ReadOnlyVaultFacade implements ReadOnlyVaultFacade$1 {
7715
7867
  private readonly _vault;
7716
- constructor(vault: Vault);
7868
+ private readonly _layer;
7869
+ constructor(vault: Vault, layer?: Layer);
7717
7870
  collection<T = unknown>(name: string): {
7718
7871
  get(id: string): Promise<T | null>;
7719
7872
  list(): Promise<T[]>;
@@ -8910,13 +9063,17 @@ declare class Vault {
8910
9063
  */
8911
9064
  private overlayedViewRegistry;
8912
9065
  /**
8913
- * Cached read-only facade handed to guard callbacks via `ctx.vault`,
8914
- * and to derivation callbacks via `derive(source, ctx)`. Allocated
8915
- * eagerly inside `_initGuards()` and/or `_initDerivations()` so read
9066
+ * Cached read-only facades handed to guard callbacks via `ctx.vault`
9067
+ * and to derivation callbacks via `derive(source, ctx)`. Split by
9068
+ * resolution layer (#285): the guard facade reads at `layer:'guard'`,
9069
+ * the derivation facade at `layer:'derivation'`, so i18nText / dictKey
9070
+ * fields resolve under that layer's `onMissing` policy. Allocated
9071
+ * eagerly inside `_initGuards()` / `_initDerivations()` so read
8916
9072
  * accessors stay synchronous (callers in `tx/transaction.ts` rely on
8917
- * that). Stays `null` for vaults with neither subsystem configured.
9073
+ * that). Each stays `null` for vaults without that subsystem.
8918
9074
  */
8919
- private readOnlyFacade;
9075
+ private guardFacade;
9076
+ private derivationFacade;
8920
9077
  private getDEK;
8921
9078
  /**
8922
9079
  * Per-principal user envelope API.
@@ -9073,6 +9230,10 @@ declare class Vault {
9073
9230
  private readonly i18nFieldRegistry;
9074
9231
  /** Cache of DictionaryHandle instances, one per dictionary name. */
9075
9232
  private readonly dictionaryCache;
9233
+ /** Registered link specs (#377-B), keyed by link name; set by `vault.link()`. */
9234
+ private readonly linkRegistry;
9235
+ /** Cache of LinkSet handles, one per link name. */
9236
+ private readonly linkSetCache;
9076
9237
  /** — subscribers for cross-tier access events. */
9077
9238
  private readonly crossTierSubs;
9078
9239
  /** — currently-active elevation, or null. One per vault. */
@@ -9232,6 +9393,17 @@ declare class Vault {
9232
9393
  schemaUpdate?: readonly SchemaUpdateStrategy[];
9233
9394
  /** — declare the per-field schema for document attestation (issue side). */
9234
9395
  attestation?: AttestationFieldSchema;
9396
+ /**
9397
+ * Per-collection history & tamper-ledger scoping. Overrides the
9398
+ * vault-wide `history` config for THIS collection only (wholesale, not
9399
+ * merged). `enabled: false` suppresses per-record snapshots for this
9400
+ * collection; `ledger: false` excludes its writes from the vault-wide
9401
+ * hash-chained tamper ledger. Lets you confine version snapshots +
9402
+ * tamper-evidence to the few collections where they carry legal weight,
9403
+ * without paying snapshot + ledger-entry-per-write across operational /
9404
+ * derived collections. Defaults to the vault-wide `history` config. See #361.
9405
+ */
9406
+ historyConfig?: HistoryConfig;
9235
9407
  }): Collection<T>;
9236
9408
  /**
9237
9409
  * Await all background persisted-schema writes triggered by
@@ -9318,6 +9490,32 @@ declare class Vault {
9318
9490
  * ```
9319
9491
  */
9320
9492
  dictionary<Keys extends string = string>(name: string, options?: DictionaryOptions): DictionaryHandle<Keys>;
9493
+ /**
9494
+ * Declare a managed many-to-many link set (#377-B). Registers a
9495
+ * `_links_<name>` junction between two endpoint collections; access its
9496
+ * rows via `vault.links(name)`. Idempotent for an identical re-declaration;
9497
+ * a conflicting one throws. See {@link links}.
9498
+ *
9499
+ * ```ts
9500
+ * vault.link('saleLineLinks', { a: ref('saleLines'), b: ref('purchaseLines'), onDelete: 'cascade' })
9501
+ * ```
9502
+ *
9503
+ * `a` / `b` accept either a collection name or a `ref(target)` descriptor
9504
+ * (only its `target` is used — links manage their own integrity). `onDelete`
9505
+ * governs what happens to link rows when an endpoint record is deleted
9506
+ * (`'cascade'` default, `'strict'`, `'warn'`).
9507
+ */
9508
+ link(name: string, spec: {
9509
+ a: string | RefDescriptor;
9510
+ b: string | RefDescriptor;
9511
+ onDelete?: LinkSpec['onDelete'];
9512
+ }): void;
9513
+ /**
9514
+ * Access a declared link set (#377-B). Throws if `name` was not first
9515
+ * declared via {@link link}. Returns a cached {@link LinkSetHandle}:
9516
+ * `connect(a, b, meta?)`, `disconnect(a, b)`, `has(a, b)`, `of(id)`, `list()`.
9517
+ */
9518
+ links(name: string): LinkSetHandle;
9321
9519
  /**
9322
9520
  * Build a `JoinableSource` for a dictKey field, for use in dict joins
9323
9521
  *. Returns a source whose snapshot contains `{ key, ...labels }`
@@ -9473,7 +9671,19 @@ declare class Vault {
9473
9671
  * const n = await vault.sequence('invoice-2026').next() // 1, then 2, …
9474
9672
  * const cur = await vault.sequence('invoice-2026').peek() // current value, no allocation
9475
9673
  * ```
9674
+ *
9675
+ * Pass a `format` (#375) to emit a serial string instead of a bare
9676
+ * integer — `next()` then returns `{ serial, formatted }`. Per-partition
9677
+ * reset is inherent (a new partition tuple starts at 1):
9678
+ *
9679
+ * ```ts
9680
+ * const seq = vault.sequence('fatture', { partition: [2026], format: '{partition.0}/{seq:04}' })
9681
+ * await seq.next() // { serial: 1, formatted: '2026/0001' }
9682
+ * ```
9476
9683
  */
9684
+ sequence(series: string, opts: SequenceOptions & {
9685
+ format: string;
9686
+ }): FormattedSequenceHandle;
9477
9687
  sequence(series: string, opts?: SequenceOptions): SequenceHandle;
9478
9688
  /** @internal — lazily build the deferred-numbering engine with a cache-coherent stamp. */
9479
9689
  private deferred;
@@ -9566,6 +9776,13 @@ declare class Vault {
9566
9776
  * mutually-cascading collections don't recurse forever.
9567
9777
  */
9568
9778
  enforceRefsOnDelete(collectionName: string, id: string): Promise<void>;
9779
+ /**
9780
+ * @internal — apply link `onDelete` policy when an endpoint record is
9781
+ * deleted (#377-B). `'strict'` throws (blocks the delete), `'cascade'`
9782
+ * removes the touching link rows (tx-atomic when a transaction is active),
9783
+ * `'warn'` leaves orphans for `checkIntegrity()`.
9784
+ */
9785
+ private enforceLinksOnDelete;
9569
9786
  /**
9570
9787
  * Look up the `RefDescriptor` the left collection declared for a
9571
9788
  * given field name. Returns `null` when the field has no ref
@@ -9826,9 +10043,10 @@ declare class Vault {
9826
10043
  */
9827
10044
  _getReadOnlyFacade(): ReadOnlyVaultFacade | null;
9828
10045
  /**
9829
- * Internal lazy-allocator for the read-only facade. Used as a
9830
- * defensive fallback; in practice `_initGuards()` eagerly
9831
- * instantiates this, so the lazy path is a no-op.
10046
+ * Internal lazy-allocator for the derivation read-only facade
10047
+ * (`layer:'derivation'`). Used as a defensive fallback; in practice
10048
+ * `_initDerivations()` eagerly instantiates this, so the lazy path is
10049
+ * a no-op.
9832
10050
  */
9833
10051
  private _ensureReadOnlyFacade;
9834
10052
  /**
@@ -11216,6 +11434,34 @@ declare class Collection<T> {
11216
11434
  * output (carries `_derivedFrom`) — defensive guard against missed
11217
11435
  * cycle detection.
11218
11436
  */
11437
+ /**
11438
+ * @internal #376 — the RAW stored record (canonical-money form, i18n maps
11439
+ * intact), WITHOUT the locale resolution `get()` applies. Used as the
11440
+ * patch base for self-write reverse-denorm so writing back never clobbers
11441
+ * an i18n map or re-quantizes money incorrectly. Returns null for
11442
+ * missing / tombstoned records.
11443
+ */
11444
+ _getStoredRecord(id: string): Promise<T | null>;
11445
+ /**
11446
+ * @internal #376 — ids of records whose top-level `field` equals `value`.
11447
+ * Uses the FK index when the field is indexed (O(matches)); otherwise a
11448
+ * linear scan (O(N) — fine for small child sets; index the FK to scale).
11449
+ */
11450
+ _findMatchingIds(field: string, value: unknown): Promise<string[]>;
11451
+ /**
11452
+ * @internal #376 slice 2 — recompute a rollup aggregate onto the parent.
11453
+ * Gathers every child of `parentId`, runs `compute`, and patches only the
11454
+ * rollup `field` onto the parent's raw stored record (value-equality
11455
+ * guarded). No-op when the parent record does not exist.
11456
+ */
11457
+ private recomputeRollup;
11458
+ /**
11459
+ * @internal #376 slice 2 — fire any rollups for which THIS collection is the
11460
+ * child `from`, recomputing the affected parent after a child delete. Called
11461
+ * from the delete path with the just-removed record's key value. Other
11462
+ * derivation kinds do not react to deletes (unchanged).
11463
+ */
11464
+ private dispatchRollupsOnDelete;
11219
11465
  private dispatchDerivations;
11220
11466
  /**
11221
11467
  * Delete a record by ID. Runs inside the hub's write-queue tracker
@@ -11340,6 +11586,19 @@ declare class Collection<T> {
11340
11586
  * no-transform fast path in {@link list}.
11341
11587
  */
11342
11588
  private hasReadTransforms;
11589
+ /**
11590
+ * Scan-mode full-text search over a plain-text `field` (#308). Decrypts the
11591
+ * collection in memory and ranks records by BM25 against the tokenized query.
11592
+ * **Zero added store leakage** — pure client-side scan; nothing searchable is
11593
+ * written to the store. (A store-usable blind index for at-scale search is a
11594
+ * separate, gated opt-in — see the #308 design note.) Eager mode only.
11595
+ *
11596
+ * `opts.match` (`'any'` default | `'all'`), `opts.prefix` (last query term as
11597
+ * a prefix → typeahead), `opts.limit` (top-N). Returns `{ id, score, record }`
11598
+ * ranked by descending score. The default tokenizer is word-boundary based —
11599
+ * see `src/search/tokenize.ts` for the Thai/CJK caveat.
11600
+ */
11601
+ search(field: string, query: string, opts?: SearchOptions): Promise<SearchResult<T>[]>;
11343
11602
  /**
11344
11603
  * Put many records in one call. Each item is processed sequentially
11345
11604
  * through the normal `put()` path — meaning per-item validation,
@@ -11769,6 +12028,23 @@ declare class Collection<T> {
11769
12028
  * surface on `index:write-partial` the same way put does.
11770
12029
  */
11771
12030
  private maintainPersistedIndexesOnDelete;
12031
+ /**
12032
+ * @internal — hard-delete this record's persisted `_idx/<field>/<recordId>`
12033
+ * side-cars for the erasure path (#401). `forget()` crypto-shreds the body but
12034
+ * keeps the collection DEK, under which these side-cars are encrypted — so
12035
+ * without this they leave the indexed field VALUES readable after a "forget".
12036
+ *
12037
+ * Content-free: the side-car id is `encodeIdxId(def.key, id)`, so it needs no
12038
+ * body decode (the body is being shredded). Eager mode has no durable side-car
12039
+ * → no-op. The in-memory mirror is left as-is: it is ephemeral (rebuilt from
12040
+ * the now-deleted side-cars on reopen) and live reads skip the tombstone, so a
12041
+ * stale mirror hit cannot surface the erased record. Returns the count deleted
12042
+ * + the `def.key`s whose delete FAILED (residue that still leaks the value).
12043
+ */
12044
+ _purgePersistedIndexes(id: string): Promise<{
12045
+ purged: number;
12046
+ residue: string[];
12047
+ }>;
11772
12048
  /**
11773
12049
  * Bulk-load the persisted-index mirror from `_idx/<field>/*` side-cars
11774
12050
  * on first lazy-mode query. Idempotent — subsequent calls short-circuit
@@ -12862,13 +13138,15 @@ interface ExportStreamOptions {
12862
13138
  */
12863
13139
  readonly withLedgerHead?: boolean;
12864
13140
  /**
12865
- * When set to a BCP 47 locale string (e.g. `'th'`), `exportJSON()`
12866
- * resolves all `dictKey` labels to that locale and omits the raw
12867
- * `dictionaries` snapshot from the output. Has no effect
12868
- * on `exportStream()` format packages use the `chunk.dictionaries`
12869
- * snapshot directly and apply their own locale strategy.
13141
+ * Export locale (BCP 47, e.g. `'th'`). When set, records are read at this
13142
+ * locale through the **`export` layer** (#285): `i18nText` fields collapse to
13143
+ * the locale string (honoring each field's `export`-layer `onMissing` policy)
13144
+ * and `dictKey`/`staticDict` `<field>Label`s are resolved a single-locale
13145
+ * export. The raw `dictionaries` snapshot is then redundant and omitted. This
13146
+ * applies to BOTH `exportStream()` and `exportJSON()`.
12870
13147
  *
12871
- * Default: `undefined` — embed the raw snapshot under `_dictionaries`.
13148
+ * Default: `undefined` — raw `{locale}` maps + the `_dictionaries` snapshot
13149
+ * (a full, all-locale backup; format packages apply their own locale strategy).
12872
13150
  */
12873
13151
  readonly resolveLabels?: string;
12874
13152
  }
@@ -13403,6 +13681,15 @@ interface LocaleReadOptions {
13403
13681
  * element to fall back to any present translation.
13404
13682
  */
13405
13683
  readonly fallback?: string | readonly string[];
13684
+ /**
13685
+ * @internal — the resolution layer this read belongs to (`'read'` by
13686
+ * default). Threaded by layer-tagged read facades (guard / derivation)
13687
+ * so `applyI18nLocale` and dictKey `resolvePolicy` select that layer's
13688
+ * `onMissing` policy instead of the `'read'` policy. Not part of the
13689
+ * public read API — callers select policy via the field's `onMissing`
13690
+ * map, not by setting this. See #285.
13691
+ */
13692
+ readonly _layer?: Layer;
13406
13693
  }
13407
13694
  /**
13408
13695
  * Context passed to the consumer-supplied `plaintextTranslator` function.
@@ -13672,6 +13959,13 @@ interface StoreCapabilities {
13672
13959
  * numbering (use CAS `sequence().next()` or per-series).
13673
13960
  */
13674
13961
  serverWriteTime?: boolean;
13962
+ /**
13963
+ * Advisory geographic region this store serves (e.g. `'eu'`, `'us'`).
13964
+ * Purely declarative — no behavior change for stores that omit it. The
13965
+ * federation data-residency guard (#271) compares this against a
13966
+ * `sharding.regionOf(record)` to refuse non-compliant shard placement.
13967
+ */
13968
+ region?: string;
13675
13969
  auth: StoreAuth;
13676
13970
  /**
13677
13971
  * true — the store implements {@link NoydbStore.tx} and commits
@@ -14095,6 +14389,16 @@ interface HistoryConfig {
14095
14389
  readonly enabled?: boolean;
14096
14390
  /** Maximum history entries per record. Oldest pruned on overflow. Default: unlimited. */
14097
14391
  readonly maxVersions?: number;
14392
+ /**
14393
+ * Participate in the vault-wide hash-chained tamper ledger. Default:
14394
+ * `true` (every write of this collection appends a ledger entry when
14395
+ * `withHistory()` is active). Set `false` to exclude this collection's
14396
+ * writes from the chain — its puts/deletes leave no ledger entry,
14397
+ * confining tamper-evidence to the collections where it carries weight.
14398
+ * Independent of `enabled`, which gates per-record snapshots. Has no
14399
+ * effect when `withHistory()` is not active (there is no ledger). See #361.
14400
+ */
14401
+ readonly ledger?: boolean;
14098
14402
  }
14099
14403
  /** Options for querying history. */
14100
14404
  interface HistoryOptions {
@@ -14163,4 +14467,4 @@ interface DeleteManyResult {
14163
14467
  }>;
14164
14468
  }
14165
14469
 
14166
- export { DEFAULT_CHUNK_SIZE as $, createEnforcer as A, validateSessionPolicy as B, type BlobStrategy as C, DICT_COLLECTION_PREFIX as D, BLOB_CHUNKS_COLLECTION as E, BLOB_COLLECTION as F, BLOB_EVICTION_AUDIT_COLLECTION as G, BLOB_INDEX_COLLECTION as H, type I18nStrategy as I, BLOB_SLOTS_PREFIX as J, BLOB_VERSIONS_PREFIX as K, type Layer as L, type BlobEvictionEntry as M, type BlobFieldPolicy as N, type OnMissing as O, PolicyEnforcer as P, type BlobFieldsConfig as Q, type ResolveI18nOptions as R, type ScriptWarning as S, type BlobObject as T, type BlobPutOptions as U, type BlobResponseOptions as V, BlobSet as W, type BlobStrategyOpenArgs as X, type CompactRunOptions as Y, type CompactionContext as Z, type CompactionResult as _, type DictEntry as a, type Role as a$, EXPORT_AUDIT_COLLECTION as a0, ExportBlobsAbortedError as a1, type ExportBlobsAuditEntry as a2, type ExportBlobsHandle as a3, type ExportBlobsOptions as a4, type ExportedBlob as a5, type SlotInfo as a6, type SlotRecord as a7, type VersionRecord as a8, createExportBlobsHandle as a9, ReadOnlyVaultFacade as aA, type ShadowStrategy as aB, CollectionFrame as aC, VaultFrame as aD, type NoydbBundleStore as aE, type RetentionPolicy as aF, type SnapshotPolicy as aG, type SnapshotStrategy as aH, type SnapshotMeta as aI, type SnapshotMode as aJ, type DerivationStrategy as aK, type DerivationContext as aL, type ArrayOutputSpec as aM, DerivationRegistry as aN, type DerivationStrategyHandle as aO, type DerivedFromMeta as aP, type OutputSpec as aQ, type RecordOutputSpec as aR, type MaterializedViewStrategy as aS, type MaterializedViewStrategyHandle as aT, type OverlayedViewStrategy as aU, Collection as aV, type OverlayFieldMergeMode as aW, type OverlayFieldMergeRule as aX, OverlayedViewRegistry as aY, type OverlayedViewStrategyHandle as aZ, type SyncStrategy as a_, runCompaction as aa, type ConsentStrategy as ab, CONSENT_AUDIT_COLLECTION as ac, type ConsentAuditEntry as ad, type ConsentAuditFilter as ae, type ConsentContext as af, type ConsentOp as ag, loadConsentEntries as ah, writeConsentEntry as ai, type PeriodsStrategy as aj, type CarryForwardContext as ak, type ClosePeriodOptions as al, type OpenPeriodOptions as am, PERIODS_COLLECTION as an, type PeriodRecord as ao, type ReadOnlyCollection as ap, appendPeriodLedgerEntry as aq, assertTsWritable as ar, chainAnchor as as, loadPeriods as at, validatePeriodName as au, type GuardStrategy as av, type GuardChange as aw, type GuardContext as ax, GuardRegistry as ay, type GuardStrategyHandle as az, type DictKeyDescriptor as b, type CollectionStats as b$, type UnlockedKeyring as b0, type HistoryStrategy as b1, type NoydbStore as b2, type HistoryOptions as b3, type EncryptedEnvelope as b4, type PruneOptions as b5, type AppendInput as b6, type ChangeType as b7, CollectionInstant as b8, type DiffEntry as b9, type UserEnvelope as bA, type GateName as bB, type GatePolicy as bC, type VaultPolicy as bD, type ActiveTier as bE, type FactorProof as bF, type SchemaUpdateStrategy as bG, type TransformFn as bH, type PersistedSchemaEnvelope as bI, type UpdateDecision as bJ, type DirectoryConfig as bK, type UserVisibility as bL, type AccessibleVault as bM, type AffectedDocument as bN, type ArchivePolicy as bO, type ArchiveResult as bP, type ArchiveRunOptions as bQ, type ArchiveStrategy as bR, BUNDLE_STORE_POLICY as bS, type BuiltInGateName as bT, type CacheOptions as bU, type CacheStats as bV, type CapturedBlueprint as bW, type ChangeEvent as bX, type CollectionChangeEvent as bY, type CollectionConflictResolver as bZ, type CollectionDescriptor as b_, type JsonPatch as ba, type JsonPatchOp as bb, LedgerStore as bc, type VaultEngine as bd, VaultInstant as be, type VerifyResult as bf, applyPatch as bg, computePatch as bh, diff as bi, formatDiff as bj, type PublicEnvelope as bk, type SealingKeyProvider as bl, type BundleRecipient as bm, type RecipientSealer as bn, type RecipientHint as bo, Vault as bp, type RecoveryEnrollmentInput as bq, type ShamirRecoveryProvider as br, TxContext as bs, type MVQueryContext as bt, type RegisteredMV as bu, MaterializedViewRegistry as bv, type MaterializedFromMeta as bw, type MaterializedViewOutput as bx, type UnionArmJoin as by, type UnionSource as bz, DictionaryHandle as c, type LiveUserEnvelope as c$, ComputedFieldError as c0, type ComputedFields as c1, type ComputedFn as c2, type Conflict as c3, type ConflictPolicy as c4, type ConflictStrategy as c5, type CrossTierAccessEvent as c6, CrossVaultAggregation as c7, CrossVaultGroupedAggregation as c8, type GroupedRow as c9, type FactorRequirement as cA, type FanoutQueryOptions as cB, type FanoutResult as cC, type FenceDoc as cD, type FenceState as cE, type FieldChange as cF, type FieldDescriptor as cG, type FieldSource as cH, type GhostRecord as cI, type GrantOptions as cJ, type GuardViolation as cK, type HistoryConfig as cL, type HistoryEntry as cM, INDEXED_STORE_POLICY as cN, type ImportCapability as cO, type InferOutput as cP, type InternalCollectionStats as cQ, type IssueDelegationOptions as cR, type IssueMagicLinkGrantOptions as cS, type KeyringAuthenticator as cT, type KeyringAuthenticatorWrappingDEKs as cU, type KeyringAuthenticatorWrappingKEK as cV, type KeyringFile as cW, type ListAccessibleVaultsOptions as cX, type ListPageResult as cY, type ListUsersOptions as cZ, type LiveQueryOptions as c_, type CrossVaultLiveAggregation as ca, type CrossVaultLiveQuery as cb, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as cc, DELEGATIONS_COLLECTION as cd, type DeepPartial as ce, type DeepPartialOrNull as cf, type DeferredNumberingConfig as cg, type DelegationToken as ch, type DeleteManyResult as ci, type DeploymentEvent as cj, type DerivationDescriptor as ck, type DirtyEntry as cl, type DryRunResult as cm, type DumpSchemaOptions as cn, ELEVATION_AUDIT_COLLECTION as co, ElevatedHandle as cp, type EnrollAuthenticatorOptions as cq, type EnrollAuthenticatorWrappingDEKsOptions as cr, type EnrollAuthenticatorWrappingKEKOptions as cs, type EnrollRecoveryResult as ct, type ExportCapability as cu, type ExportChunk as cv, type ExportFormat as cw, type ExportStreamOptions as cx, type FactorKind as cy, type FactorProofBundle as cz, type DictionaryOptions as d, SEALED_PASSPHRASE_RECORD_ID as d$, type LocaleReadOptions as d0, Lru as d1, type LruOptions as d2, type LruStats as d3, MAGIC_LINK_CONTENT_INFO_PREFIX as d4, MAGIC_LINK_GRANTS_COLLECTION as d5, MAGIC_LINK_KEK_INFO_PREFIX as d6, type MagicLinkGrantPayload as d7, type MagicLinkGrantRecord as d8, type MaterializedViewDescriptor as d9, type PublicEnvelopeSchema as dA, type PublicEnvelopeText as dB, type PullMode as dC, type PullOptions as dD, type PullPolicy as dE, type PullResult as dF, type PushMode as dG, type PushOptions as dH, type PushPolicy as dI, type PushResult as dJ, type PutManyItemOptions as dK, type PutManyOptions as dL, type PutManyResult as dM, type QueryAcrossOptions as dN, type QueryAcrossResult as dO, type QuickUnlockState as dP, QuickUnlockStore as dQ, type ReAuthOperation as dR, type RecoverPassphraseInput as dS, type RecoverPassphraseResult as dT, type RecoverUserOptions as dU, type RecoveryProof as dV, type ResolvedPublicEnvelopeSchema as dW, type RevokeOptions as dX, type RotatePassphraseInput as dY, type RotateRecoveryOptions as dZ, type RotateRecoveryResult as d_, MemoryRecipientSealer as da, MemorySealingKeyProvider as db, NOYDB_BACKUP_VERSION as dc, NOYDB_FORMAT_VERSION as dd, NOYDB_KEYRING_VERSION as de, NOYDB_SYNC_VERSION as df, type NextOptions as dg, Noydb as dh, type NoydbEventMap as di, type NoydbOptions as dj, type Assignment as dk, type OverlayViewDescriptor as dl, PUBLIC_ENVELOPE_FIELDS as dm, type PaperRecoveryDoc as dn, type PaperRecoveryEntry as dp, type PassphrasePolicy as dq, type PassphraseValidationResult as dr, type Permission as ds, type Permissions as dt, type PersistedSchemaKind as du, type PlaintextTranslatorContext as dv, type PlaintextTranslatorFn as dw, PresenceHandle as dx, type PresencePeer as dy, type PublicEnvelopeField as dz, type I18nMap as e, type VaultRegistryRow as e$, type SchemaDelta as e0, type SchemaIntrospection as e1, type SchemaManifestRow as e2, type SealedEnvelope as e3, type SealedPassphrase as e4, type SequenceHandle as e5, type SequenceOptions as e6, SequenceStore as e7, type SessionPolicy as e8, type SetPublicEnvelopeInput as e9, type SyncTransactionResult as eA, type TabChannel as eB, type TabCoordinationOptions as eC, type TabLockManager as eD, type TabPresence as eE, type TabRole as eF, type TierMode as eG, type TransactionInvariant as eH, type TranslatorAuditEntry as eI, TxCollection as eJ, type TxOp as eK, TxVault as eL, USER_ENVELOPE_COLLECTION as eM, USER_ENVELOPE_MAX_BYTES as eN, type Unsubscribe as eO, type UpdateAuthenticatorOptions as eP, type UpdateContext as eQ, type UpdateUserOptions as eR, UserApi as eS, type UserEnvelopeCheckGate as eT, UserEnvelopeOversizedError as eU, type UserEnvelopePresented as eV, type UserInfo as eW, type VaultBackup as eX, VaultGroup as eY, type VaultGroupOptions as eZ, type VaultPolicyOnDisk as e_, type ShamirRecoveryDoc as ea, type ShamirRecoveryEntry as eb, ShardedCollection as ec, ShardedGroupedQuery as ed, ShardedQuery as ee, type ShardingConfig as ef, type SkippedVault as eg, type SlotRewrapCeremony as eh, type SlotRewrapContext as ei, type StandardSchemaV1 as ej, type StandardSchemaV1Issue as ek, type StandardSchemaV1SyncResult as el, StateManagementVault as em, type StoreAuth as en, type StoreAuthKind as eo, type StoreCapabilities as ep, type StoreTime as eq, SyncEngine as er, type SyncMetadata as es, type SyncPolicy as et, SyncScheduler as eu, type SyncSchedulerStatus as ev, type SyncStatus as ew, type SyncTarget as ex, type SyncTargetRole as ey, SyncTransaction as ez, type I18nTextDescriptor as f, validatePublicEnvelopeInput as f$, type VaultSchemaSnapshot as f0, type VaultSnapshot as f1, type VaultTemplate as f2, type WarningRules as f3, WeakPassphraseError as f4, type WeakPassphraseReason as f5, type WithArchiveOptions as f6, type WrappedDeksBlob as f7, type WriteConflict as f8, type WriteEvent as f9, loadActiveDelegations as fA, loadPaperRecoveryEntries as fB, loadSealedPassphrase as fC, loadShamirRecoveryEntries as fD, magicLinkGrantRecordId as fE, mintPaperRecoveryEntry as fF, mintShamirRecoveryEntry as fG, mintWrappedDeksBlob as fH, parseRsaOaepTlv as fI, parseSealedEnvelope as fJ, readMagicLinkGrantRecord as fK, recoverUser as fL, removeAuthenticator as fM, resolveSchema as fN, resolveSequenceKey as fO, revokeDelegation as fP, revokeMagicLinkGrant as fQ, runTransaction as fR, savePaperRecoveryEntries as fS, saveSealedPassphrase as fT, saveShamirRecoveryEntries as fU, sealRsaOaepTlv as fV, unwrapDeksFromBlob as fW, unwrapDeksFromPaperEntry as fX, unwrapDeksFromShamirEntry as fY, unwrapMagicLinkGrant as fZ, validatePassphrase as f_, type WriteHook as fa, type WriteQueue as fb, aesGcmOpen as fc, assertStrongPassphrase as fd, buildRecipientKeyringFile as fe, burnPaperRecoveryEntry as ff, createNoydb as fg, createStore as fh, deriveMagicLinkContentKey as fi, enrollAuthenticator as fj, estimateEntropy as fk, evalComputedFields as fl, evaluateExportCapability as fm, evaluateImportCapability as fn, findAuthenticator as fo, hasExportCapability as fp, hasImportCapability as fq, hasRecoveryEnrolled as fr, isMagicLinkGrantExpired as fs, isPublicEnvelope as ft, issueDelegation as fu, recoverPassphrase as fv, rotatePassphrase as fw, listMagicLinkGrants as fx, listUsers as fy, listUsersWithEnvelopes as fz, type I18nTextOptions as g, validateSchemaInput as g0, validateSchemaOutput as g1, withArchive as g2, withDeferredNumbering as g3, writeMagicLinkGrant as g4, changeSecret as g5, createOwnerKeyring as g6, ensureCollectionDEK as g7, grant as g8, loadKeyring as g9, persistKeyring as ga, revoke as gb, updateAuthenticator as gc, updateKeyringIdentity as gd, type TxStrategy as ge, type AmendmentTxOptions as gf, type OnMissingPolicy as h, type StaticDictDescriptor as i, applyI18nLocale as j, dictCollectionName as k, dictKey as l, enforceScript as m, getAtPath as n, i18nText as o, inferScripts as p, isDictCollectionName as q, isDictKeyDescriptor as r, isI18nTextDescriptor as s, isStaticDictDescriptor as t, resolveI18nText as u, resolvePolicy as v, setAtPathInPlace as w, staticDict as x, validateI18nTextValue as y, type SessionStrategy as z };
14470
+ export { type ConsentAuditFilter as $, type BlobPutOptions as A, type BlobStrategy as B, type BlobResponseOptions as C, DICT_COLLECTION_PREFIX as D, BlobSet as E, type BlobStrategyOpenArgs as F, type CompactRunOptions as G, type CompactionContext as H, type I18nStrategy as I, type CompactionResult as J, DEFAULT_CHUNK_SIZE as K, EXPORT_AUDIT_COLLECTION as L, ExportBlobsAbortedError as M, type ExportBlobsAuditEntry as N, type ExportBlobsHandle as O, PolicyEnforcer as P, type ExportBlobsOptions as Q, type ExportedBlob as R, type ScriptWarning as S, type SlotInfo as T, type SlotRecord as U, type VersionRecord as V, createExportBlobsHandle as W, runCompaction as X, type ConsentStrategy as Y, CONSENT_AUDIT_COLLECTION as Z, type ConsentAuditEntry as _, type DictEntry as a, VaultInstant as a$, type ConsentContext as a0, type ConsentOp as a1, loadConsentEntries as a2, writeConsentEntry as a3, type PeriodsStrategy as a4, type CarryForwardContext as a5, type ClosePeriodOptions as a6, type OpenPeriodOptions as a7, PERIODS_COLLECTION as a8, type PeriodRecord as a9, type DerivedFromMeta as aA, type OutputSpec as aB, type RecordOutputSpec as aC, type MaterializedViewStrategy as aD, type MaterializedViewStrategyHandle as aE, type OverlayedViewStrategy as aF, Collection as aG, type OverlayFieldMergeMode as aH, type OverlayFieldMergeRule as aI, OverlayedViewRegistry as aJ, type OverlayedViewStrategyHandle as aK, type SyncStrategy as aL, type Role as aM, type UnlockedKeyring as aN, type HistoryStrategy as aO, type NoydbStore as aP, type HistoryOptions as aQ, type EncryptedEnvelope as aR, type PruneOptions as aS, type AppendInput as aT, type ChangeType as aU, CollectionInstant as aV, type DiffEntry as aW, type JsonPatch as aX, type JsonPatchOp as aY, LedgerStore as aZ, type VaultEngine as a_, type ReadOnlyCollection as aa, appendPeriodLedgerEntry as ab, assertTsWritable as ac, chainAnchor as ad, loadPeriods as ae, validatePeriodName as af, type GuardStrategy as ag, type GuardChange as ah, type GuardContext as ai, GuardRegistry as aj, type GuardStrategyHandle as ak, ReadOnlyVaultFacade as al, type ShadowStrategy as am, CollectionFrame as an, VaultFrame as ao, type NoydbBundleStore as ap, type RetentionPolicy as aq, type SnapshotPolicy as ar, type SnapshotStrategy as as, type SnapshotMeta as at, type SnapshotMode as au, type DerivationStrategy as av, type DerivationContext as aw, type ArrayOutputSpec as ax, DerivationRegistry as ay, type DerivationStrategyHandle as az, type DictKeyDescriptor as b, DEFAULT_PUBLIC_ENVELOPE_SCHEMA as b$, type VerifyResult as b0, applyPatch as b1, computePatch as b2, diff as b3, formatDiff as b4, type PublicEnvelope as b5, type SealingKeyProvider as b6, type BundleRecipient as b7, type RecipientSealer as b8, type RecipientHint as b9, type ArchiveResult as bA, type ArchiveRunOptions as bB, type ArchiveStrategy as bC, BUNDLE_STORE_POLICY as bD, type BuiltInGateName as bE, type CacheOptions as bF, type CacheStats as bG, type CapturedBlueprint as bH, type ChangeEvent as bI, type CollectionChangeEvent as bJ, type CollectionConflictResolver as bK, type CollectionDescriptor as bL, type CollectionStats as bM, ComputedFieldError as bN, type ComputedFields as bO, type ComputedFn as bP, type Conflict as bQ, type ConflictPolicy as bR, type ConflictStrategy as bS, type CrossTierAccessEvent as bT, CrossVaultAggregation as bU, type CrossVaultDerivationContext as bV, type CrossVaultDerivationSpec as bW, CrossVaultGroupedAggregation as bX, type GroupedRow as bY, type CrossVaultLiveAggregation as bZ, type CrossVaultLiveQuery as b_, Vault as ba, type RecoveryEnrollmentInput as bb, type ShamirRecoveryProvider as bc, TxContext as bd, type MVQueryContext as be, type RegisteredMV as bf, MaterializedViewRegistry as bg, type MaterializedFromMeta as bh, type MaterializedViewOutput as bi, type UnionArmJoin as bj, type UnionSource as bk, type UserEnvelope as bl, type GateName as bm, type GatePolicy as bn, type VaultPolicy as bo, type ActiveTier as bp, type FactorProof as bq, type SchemaUpdateStrategy as br, type TransformFn as bs, type PersistedSchemaEnvelope as bt, type UpdateDecision as bu, type DirectoryConfig as bv, type UserVisibility as bw, type AccessibleVault as bx, type AffectedDocument as by, type ArchivePolicy as bz, DictionaryHandle as c, MAGIC_LINK_CONTENT_INFO_PREFIX as c$, DELEGATIONS_COLLECTION as c0, type DeepPartial as c1, type DeepPartialOrNull as c2, type DeferredNumberingConfig as c3, type DelegationToken as c4, type DeleteManyResult as c5, type DeploymentEvent as c6, type DerivationDescriptor as c7, type DirtyEntry as c8, type DryRunResult as c9, type HistoryConfig as cA, type HistoryEntry as cB, INDEXED_STORE_POLICY as cC, type ImportCapability as cD, type InferOutput as cE, type InternalCollectionStats as cF, type IssueDelegationOptions as cG, type IssueMagicLinkGrantOptions as cH, type KeyringAuthenticator as cI, type KeyringAuthenticatorWrappingDEKs as cJ, type KeyringAuthenticatorWrappingKEK as cK, type KeyringFile as cL, LinkEndpointError as cM, LinkIntegrityError as cN, type LinkOnDelete as cO, type LinkRow as cP, type LinkSetHandle as cQ, type LinkSpec as cR, type ListAccessibleVaultsOptions as cS, type ListPageResult as cT, type ListUsersOptions as cU, type LiveQueryOptions as cV, type LiveUserEnvelope as cW, type LocaleReadOptions as cX, Lru as cY, type LruOptions as cZ, type LruStats as c_, type DumpSchemaOptions as ca, ELEVATION_AUDIT_COLLECTION as cb, ElevatedHandle as cc, type EnrollAuthenticatorOptions as cd, type EnrollAuthenticatorWrappingDEKsOptions as ce, type EnrollAuthenticatorWrappingKEKOptions as cf, type EnrollRecoveryResult as cg, type ExportCapability as ch, type ExportChunk as ci, type ExportFormat as cj, type ExportStreamOptions as ck, type FactorKind as cl, type FactorProofBundle as cm, type FactorRequirement as cn, type FanoutQueryOptions as co, type FanoutResult as cp, type FenceDoc as cq, type FenceState as cr, type FieldChange as cs, type FieldDescriptor as ct, type FieldSource as cu, type FleetMigrationResult as cv, type FormattedSequenceHandle as cw, type GhostRecord as cx, type GrantOptions as cy, type GuardViolation as cz, type DictionaryOptions as d, type SchemaManifestRow as d$, MAGIC_LINK_GRANTS_COLLECTION as d0, MAGIC_LINK_KEK_INFO_PREFIX as d1, type MagicLinkGrantPayload as d2, type MagicLinkGrantRecord as d3, type MaterializedViewDescriptor as d4, MemoryRecipientSealer as d5, MemorySealingKeyProvider as d6, type MigrationStatusRow as d7, NOYDB_BACKUP_VERSION as d8, NOYDB_FORMAT_VERSION as d9, type PullPolicy as dA, type PullResult as dB, type PushMode as dC, type PushOptions as dD, type PushPolicy as dE, type PushResult as dF, type PutManyItemOptions as dG, type PutManyOptions as dH, type PutManyResult as dI, type QueryAcrossOptions as dJ, type QueryAcrossResult as dK, type QuickUnlockState as dL, QuickUnlockStore as dM, type ReAuthOperation as dN, type RecoverPassphraseInput as dO, type RecoverPassphraseResult as dP, type RecoverUserOptions as dQ, type RecoveryProof as dR, type RefreshInsightsResult as dS, type ResolvedPublicEnvelopeSchema as dT, type RevokeOptions as dU, type RotatePassphraseInput as dV, type RotateRecoveryOptions as dW, type RotateRecoveryResult as dX, SEALED_PASSPHRASE_RECORD_ID as dY, type SchemaDelta as dZ, type SchemaIntrospection as d_, NOYDB_KEYRING_VERSION as da, NOYDB_SYNC_VERSION as db, type NextOptions as dc, Noydb as dd, type NoydbEventMap as de, type NoydbOptions as df, type Assignment as dg, type OverlayViewDescriptor as dh, PUBLIC_ENVELOPE_FIELDS as di, type PaperRecoveryDoc as dj, type PaperRecoveryEntry as dk, type PassphrasePolicy as dl, type PassphraseValidationResult as dm, type Permission as dn, type Permissions as dp, type PersistedSchemaKind as dq, type PlaintextTranslatorContext as dr, type PlaintextTranslatorFn as ds, PresenceHandle as dt, type PresencePeer as du, type PublicEnvelopeField as dv, type PublicEnvelopeSchema as dw, type PublicEnvelopeText as dx, type PullMode as dy, type PullOptions as dz, type StaticDictDescriptor as e, type VaultRegistryRow as e$, type SealedEnvelope as e0, type SealedPassphrase as e1, type SearchEntry as e2, type SearchOptions as e3, type SearchResult as e4, type SequenceHandle as e5, type SequenceOptions as e6, SequenceStore as e7, type SessionPolicy as e8, type SetPublicEnvelopeInput as e9, type SyncTransactionResult as eA, type TabChannel as eB, type TabCoordinationOptions as eC, type TabLockManager as eD, type TabPresence as eE, type TabRole as eF, type TierMode as eG, type TransactionInvariant as eH, type TranslatorAuditEntry as eI, TxCollection as eJ, type TxOp as eK, TxVault as eL, USER_ENVELOPE_COLLECTION as eM, USER_ENVELOPE_MAX_BYTES as eN, type Unsubscribe as eO, type UpdateAuthenticatorOptions as eP, type UpdateContext as eQ, type UpdateUserOptions as eR, UserApi as eS, type UserEnvelopeCheckGate as eT, UserEnvelopeOversizedError as eU, type UserEnvelopePresented as eV, type UserInfo as eW, type VaultBackup as eX, VaultGroup as eY, type VaultGroupOptions as eZ, type VaultPolicyOnDisk as e_, type ShamirRecoveryDoc as ea, type ShamirRecoveryEntry as eb, ShardedCollection as ec, ShardedGroupedQuery as ed, ShardedQuery as ee, type ShardingConfig as ef, type SkippedVault as eg, type SlotRewrapCeremony as eh, type SlotRewrapContext as ei, type StandardSchemaV1 as ej, type StandardSchemaV1Issue as ek, type StandardSchemaV1SyncResult as el, StateManagementVault as em, type StoreAuth as en, type StoreAuthKind as eo, type StoreCapabilities as ep, type StoreTime as eq, SyncEngine as er, type SyncMetadata as es, type SyncPolicy as et, SyncScheduler as eu, type SyncSchedulerStatus as ev, type SyncStatus as ew, type SyncTarget as ex, type SyncTargetRole as ey, SyncTransaction as ez, dictCollectionName as f, unwrapMagicLinkGrant as f$, type VaultSchemaSnapshot as f0, type VaultSnapshot as f1, type VaultTemplate as f2, type WarningRules as f3, WeakPassphraseError as f4, type WeakPassphraseReason as f5, type WithArchiveOptions as f6, type WrappedDeksBlob as f7, type WriteConflict as f8, type WriteEvent as f9, listUsers as fA, listUsersWithEnvelopes as fB, loadActiveDelegations as fC, loadPaperRecoveryEntries as fD, loadSealedPassphrase as fE, loadShamirRecoveryEntries as fF, magicLinkGrantRecordId as fG, mintPaperRecoveryEntry as fH, mintShamirRecoveryEntry as fI, mintWrappedDeksBlob as fJ, parseRsaOaepTlv as fK, parseSealedEnvelope as fL, readMagicLinkGrantRecord as fM, recoverUser as fN, removeAuthenticator as fO, resolveSchema as fP, resolveSequenceKey as fQ, revokeDelegation as fR, revokeMagicLinkGrant as fS, runTransaction as fT, savePaperRecoveryEntries as fU, saveSealedPassphrase as fV, saveShamirRecoveryEntries as fW, sealRsaOaepTlv as fX, unwrapDeksFromBlob as fY, unwrapDeksFromPaperEntry as fZ, unwrapDeksFromShamirEntry as f_, type WriteHook as fa, type WriteQueue as fb, aesGcmOpen as fc, assertStrongPassphrase as fd, buildRecipientKeyringFile as fe, burnPaperRecoveryEntry as ff, compileSequenceFormat as fg, createNoydb as fh, createStore as fi, deriveMagicLinkContentKey as fj, enrollAuthenticator as fk, estimateEntropy as fl, evalComputedFields as fm, evaluateExportCapability as fn, evaluateImportCapability as fo, findAuthenticator as fp, hasExportCapability as fq, hasImportCapability as fr, hasRecoveryEnrolled as fs, isLinkCollectionName as ft, isMagicLinkGrantExpired as fu, isPublicEnvelope as fv, issueDelegation as fw, recoverPassphrase as fx, rotatePassphrase as fy, listMagicLinkGrants as fz, dictKey as g, validatePassphrase as g0, validatePublicEnvelopeInput as g1, validateSchemaInput as g2, validateSchemaOutput as g3, withArchive as g4, withDeferredNumbering as g5, writeMagicLinkGrant as g6, changeSecret as g7, createOwnerKeyring as g8, ensureCollectionDEK as g9, grant as ga, loadKeyring as gb, persistKeyring as gc, revoke as gd, updateAuthenticator as ge, updateKeyringIdentity as gf, type TxStrategy as gg, type AmendmentTxOptions as gh, enforceScript as h, inferScripts as i, isDictCollectionName as j, isDictKeyDescriptor as k, isStaticDictDescriptor as l, type SessionStrategy as m, createEnforcer as n, BLOB_CHUNKS_COLLECTION as o, BLOB_COLLECTION as p, BLOB_EVICTION_AUDIT_COLLECTION as q, BLOB_INDEX_COLLECTION as r, staticDict as s, BLOB_SLOTS_PREFIX as t, BLOB_VERSIONS_PREFIX as u, validateSessionPolicy as v, type BlobEvictionEntry as w, type BlobFieldPolicy as x, type BlobFieldsConfig as y, type BlobObject as z };