@noy-db/hub 0.1.0-pre.9 → 0.2.0-pre.10

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 (305) hide show
  1. package/dist/aggregate/index.cjs +100 -36
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +2 -2
  4. package/dist/aggregate/index.d.ts +2 -2
  5. package/dist/aggregate/index.js +16 -9
  6. package/dist/aggregate/index.js.map +1 -1
  7. package/dist/attestation/index.cjs +305 -0
  8. package/dist/attestation/index.cjs.map +1 -0
  9. package/dist/attestation/index.d.cts +52 -0
  10. package/dist/attestation/index.d.ts +52 -0
  11. package/dist/attestation/index.js +36 -0
  12. package/dist/attestation/index.js.map +1 -0
  13. package/dist/blobs/index.cjs.map +1 -1
  14. package/dist/blobs/index.d.cts +7 -6
  15. package/dist/blobs/index.d.ts +7 -6
  16. package/dist/blobs/index.js +10 -8
  17. package/dist/blobs/index.js.map +1 -1
  18. package/dist/bundle/index.cjs +19121 -60
  19. package/dist/bundle/index.cjs.map +1 -1
  20. package/dist/bundle/index.d.cts +175 -6
  21. package/dist/bundle/index.d.ts +175 -6
  22. package/dist/bundle/index.js +543 -4
  23. package/dist/bundle/index.js.map +1 -1
  24. package/dist/chunk-26NK23DZ.js +296 -0
  25. package/dist/chunk-26NK23DZ.js.map +1 -0
  26. package/dist/{chunk-TDR6T5CJ.js → chunk-2LPPNWF6.js} +91 -132
  27. package/dist/chunk-2LPPNWF6.js.map +1 -0
  28. package/dist/{chunk-PTVMYYON.js → chunk-2N62W5YP.js} +3 -3
  29. package/dist/{chunk-QGZRWRSL.js → chunk-3LPV6BXR.js} +4 -4
  30. package/dist/{chunk-QAVUREFT.js → chunk-4CLICFEY.js} +12 -6
  31. package/dist/chunk-4CLICFEY.js.map +1 -0
  32. package/dist/chunk-4USCAEDT.js +10529 -0
  33. package/dist/chunk-4USCAEDT.js.map +1 -0
  34. package/dist/chunk-5IXJGFF2.js +83 -0
  35. package/dist/chunk-5IXJGFF2.js.map +1 -0
  36. package/dist/chunk-5OEJ6GOT.js +124 -0
  37. package/dist/chunk-5OEJ6GOT.js.map +1 -0
  38. package/dist/{chunk-4PWAI7Q4.js → chunk-5OX6XVNS.js} +5 -5
  39. package/dist/{chunk-2CSJGFCB.js → chunk-6EOXTJS2.js} +6 -229
  40. package/dist/chunk-6EOXTJS2.js.map +1 -0
  41. package/dist/chunk-6T2UDBKG.js +53 -0
  42. package/dist/chunk-6T2UDBKG.js.map +1 -0
  43. package/dist/{chunk-GOUT6DND.js → chunk-6YLPHBKR.js} +382 -95
  44. package/dist/chunk-6YLPHBKR.js.map +1 -0
  45. package/dist/chunk-7CEGU63S.js +179 -0
  46. package/dist/chunk-7CEGU63S.js.map +1 -0
  47. package/dist/chunk-A3JMGXPG.js +125 -0
  48. package/dist/chunk-A3JMGXPG.js.map +1 -0
  49. package/dist/chunk-BB27JMWB.js +795 -0
  50. package/dist/chunk-BB27JMWB.js.map +1 -0
  51. package/dist/{chunk-SCZXXXU4.js → chunk-BDV7INMP.js} +7 -32
  52. package/dist/chunk-BDV7INMP.js.map +1 -0
  53. package/dist/chunk-C3WE6UJY.js +19 -0
  54. package/dist/chunk-C3WE6UJY.js.map +1 -0
  55. package/dist/chunk-CH22FZHT.js +96 -0
  56. package/dist/chunk-CH22FZHT.js.map +1 -0
  57. package/dist/chunk-CXFOITNS.js +34 -0
  58. package/dist/chunk-CXFOITNS.js.map +1 -0
  59. package/dist/chunk-CXJG63MA.js +109 -0
  60. package/dist/chunk-CXJG63MA.js.map +1 -0
  61. package/dist/chunk-DAP2XL7Q.js +51 -0
  62. package/dist/chunk-DAP2XL7Q.js.map +1 -0
  63. package/dist/{chunk-AVVPZ4BC.js → chunk-DJRWA3Q5.js} +4 -4
  64. package/dist/chunk-DRXIZOFV.js +233 -0
  65. package/dist/chunk-DRXIZOFV.js.map +1 -0
  66. package/dist/chunk-FO3UEG4S.js +313 -0
  67. package/dist/chunk-FO3UEG4S.js.map +1 -0
  68. package/dist/chunk-GAUEWM7D.js +147 -0
  69. package/dist/chunk-GAUEWM7D.js.map +1 -0
  70. package/dist/{chunk-MDDTIZUO.js → chunk-GNHAC43Q.js} +218 -119
  71. package/dist/chunk-GNHAC43Q.js.map +1 -0
  72. package/dist/chunk-HHOO7HGH.js +57 -0
  73. package/dist/chunk-HHOO7HGH.js.map +1 -0
  74. package/dist/{chunk-WDM5XGGS.js → chunk-HQSQC2XL.js} +182 -12
  75. package/dist/chunk-HQSQC2XL.js.map +1 -0
  76. package/dist/chunk-IMYKDWB4.js +139 -0
  77. package/dist/chunk-IMYKDWB4.js.map +1 -0
  78. package/dist/{chunk-M62XNWRA.js → chunk-LSTBFLL2.js} +2 -2
  79. package/dist/{chunk-ACLDOTNQ.js → chunk-O6EJ6WTI.js} +436 -3
  80. package/dist/chunk-O6EJ6WTI.js.map +1 -0
  81. package/dist/chunk-PC6ZEDRL.js +71 -0
  82. package/dist/chunk-PC6ZEDRL.js.map +1 -0
  83. package/dist/chunk-PM3QYWUU.js +251 -0
  84. package/dist/chunk-PM3QYWUU.js.map +1 -0
  85. package/dist/chunk-PVUUIWHY.js +73 -0
  86. package/dist/chunk-PVUUIWHY.js.map +1 -0
  87. package/dist/chunk-PXTQPZO4.js +830 -0
  88. package/dist/chunk-PXTQPZO4.js.map +1 -0
  89. package/dist/{chunk-ZFKD4QMV.js → chunk-QSOYKKMD.js} +4 -4
  90. package/dist/chunk-QSOYKKMD.js.map +1 -0
  91. package/dist/{chunk-MR4424N3.js → chunk-R233SLY3.js} +2 -2
  92. package/dist/chunk-RC6SU5NO.js +36 -0
  93. package/dist/chunk-RC6SU5NO.js.map +1 -0
  94. package/dist/{chunk-USKYUS74.js → chunk-RRNA5GKT.js} +2 -2
  95. package/dist/{chunk-R36SIKES.js → chunk-RYIL3PI2.js} +2 -2
  96. package/dist/chunk-STNPB3UM.js +9 -0
  97. package/dist/chunk-STNPB3UM.js.map +1 -0
  98. package/dist/{chunk-M5INGEFC.js → chunk-TV3YZ35S.js} +7 -1
  99. package/dist/chunk-TV3YZ35S.js.map +1 -0
  100. package/dist/chunk-TY32C732.js +59 -0
  101. package/dist/chunk-TY32C732.js.map +1 -0
  102. package/dist/chunk-UMLVJTYV.js +20 -0
  103. package/dist/chunk-UMLVJTYV.js.map +1 -0
  104. package/dist/{chunk-NPC4LFV5.js → chunk-WIBHRONM.js} +2 -2
  105. package/dist/chunk-WIBHRONM.js.map +1 -0
  106. package/dist/{chunk-RKJ6OL7K.js → chunk-WIRRPTFH.js} +1 -1
  107. package/dist/chunk-WIRRPTFH.js.map +1 -0
  108. package/dist/{chunk-VQBTTTUN.js → chunk-Y26YV5R3.js} +4 -4
  109. package/dist/{chunk-VQBTTTUN.js.map → chunk-Y26YV5R3.js.map} +1 -1
  110. package/dist/{chunk-NXFEYLVG.js → chunk-YM7LFCG7.js} +5 -4
  111. package/dist/{chunk-NXFEYLVG.js.map → chunk-YM7LFCG7.js.map} +1 -1
  112. package/dist/{chunk-CIMZBAZB.js → chunk-Z6FNBOTC.js} +1 -1
  113. package/dist/chunk-Z6FNBOTC.js.map +1 -0
  114. package/dist/chunk-ZROPXHJY.js +82 -0
  115. package/dist/chunk-ZROPXHJY.js.map +1 -0
  116. package/dist/consent/index.cjs.map +1 -1
  117. package/dist/consent/index.d.cts +7 -6
  118. package/dist/consent/index.d.ts +7 -6
  119. package/dist/consent/index.js +3 -3
  120. package/dist/{crypto-IVKU7YTT.js → crypto-2CRLG4F4.js} +3 -3
  121. package/dist/{delegation-2DBS2EOH.js → delegation-ZTRT2PRV.js} +5 -4
  122. package/dist/derivations/index.cjs +368 -0
  123. package/dist/derivations/index.cjs.map +1 -0
  124. package/dist/derivations/index.d.cts +72 -0
  125. package/dist/derivations/index.d.ts +72 -0
  126. package/dist/derivations/index.js +27 -0
  127. package/dist/{dev-unlock-Da1B0TIK.d.cts → dev-unlock-AglVnkPY.d.cts} +1 -1
  128. package/dist/{dev-unlock-BdPp68qn.d.ts → dev-unlock-BOEYl1xl.d.ts} +1 -1
  129. package/dist/discriminant-BN9REW3o.d.cts +60 -0
  130. package/dist/discriminant-BN9REW3o.d.ts +60 -0
  131. package/dist/executor-S76VN45G.js +8 -0
  132. package/dist/executor-UCXLIGLW.js +11 -0
  133. package/dist/executor-UCXLIGLW.js.map +1 -0
  134. package/dist/executor-ZCNZJMGR.js +8 -0
  135. package/dist/executor-ZCNZJMGR.js.map +1 -0
  136. package/dist/fanout-sidecar-OKPMMPLG.js +51 -0
  137. package/dist/fanout-sidecar-OKPMMPLG.js.map +1 -0
  138. package/dist/guards/index.cjs +322 -0
  139. package/dist/guards/index.cjs.map +1 -0
  140. package/dist/guards/index.d.cts +31 -0
  141. package/dist/guards/index.d.ts +31 -0
  142. package/dist/guards/index.js +29 -0
  143. package/dist/guards/index.js.map +1 -0
  144. package/dist/{hash-lsoL3eEW.d.ts → hash-B9m3_fhj.d.ts} +1 -1
  145. package/dist/{hash-BEfzPKwo.d.cts → hash-RVqz2zi8.d.cts} +1 -1
  146. package/dist/history/index.cjs +9 -2
  147. package/dist/history/index.cjs.map +1 -1
  148. package/dist/history/index.d.cts +8 -7
  149. package/dist/history/index.d.ts +8 -7
  150. package/dist/history/index.js +6 -6
  151. package/dist/i18n/index.cjs +368 -27
  152. package/dist/i18n/index.cjs.map +1 -1
  153. package/dist/i18n/index.d.cts +7 -6
  154. package/dist/i18n/index.d.ts +7 -6
  155. package/dist/i18n/index.js +34 -6
  156. package/dist/i18n/index.js.map +1 -1
  157. package/dist/{index-DJTf9yxn.d.ts → index-B8bjExET.d.cts} +508 -14
  158. package/dist/{index-6xNpPsxR.d.cts → index-DfUbNad8.d.ts} +508 -14
  159. package/dist/index.cjs +8779 -1260
  160. package/dist/index.cjs.map +1 -1
  161. package/dist/index.d.cts +231 -19
  162. package/dist/index.d.ts +231 -19
  163. package/dist/index.js +311 -7370
  164. package/dist/index.js.map +1 -1
  165. package/dist/indexing/index.cjs +7 -1
  166. package/dist/indexing/index.cjs.map +1 -1
  167. package/dist/indexing/index.d.cts +3 -3
  168. package/dist/indexing/index.d.ts +3 -3
  169. package/dist/indexing/index.js +4 -4
  170. package/dist/issue-3W6IVLKH.js +12 -0
  171. package/dist/issue-3W6IVLKH.js.map +1 -0
  172. package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Ci5_YG73.d.cts} +2 -2
  173. package/dist/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-D5GU14TS.d.ts} +2 -2
  174. package/dist/{ledger-QZTTHQAQ.js → ledger-O7FXOG3D.js} +6 -6
  175. package/dist/ledger-O7FXOG3D.js.map +1 -0
  176. package/dist/materialized-views/index.cjs +856 -0
  177. package/dist/materialized-views/index.cjs.map +1 -0
  178. package/dist/materialized-views/index.d.cts +186 -0
  179. package/dist/materialized-views/index.d.ts +186 -0
  180. package/dist/materialized-views/index.js +45 -0
  181. package/dist/materialized-views/index.js.map +1 -0
  182. package/dist/noydb-YAZNH5TI.js +34 -0
  183. package/dist/noydb-YAZNH5TI.js.map +1 -0
  184. package/dist/overlay-views/index.cjs +369 -0
  185. package/dist/overlay-views/index.cjs.map +1 -0
  186. package/dist/overlay-views/index.d.cts +82 -0
  187. package/dist/overlay-views/index.d.ts +82 -0
  188. package/dist/overlay-views/index.js +25 -0
  189. package/dist/overlay-views/index.js.map +1 -0
  190. package/dist/periods/index.cjs +7 -1
  191. package/dist/periods/index.cjs.map +1 -1
  192. package/dist/periods/index.d.cts +7 -6
  193. package/dist/periods/index.d.ts +7 -6
  194. package/dist/periods/index.js +6 -6
  195. package/dist/{predicate-SBHmi6D0.d.cts → predicate-Bt5ft-9c.d.cts} +51 -2
  196. package/dist/{predicate-SBHmi6D0.d.ts → predicate-Bt5ft-9c.d.ts} +51 -2
  197. package/dist/{public-envelope-6JTACYJV.js → public-envelope-HMYHZIRH.js} +4 -4
  198. package/dist/public-envelope-HMYHZIRH.js.map +1 -0
  199. package/dist/query/index.cjs +555 -128
  200. package/dist/query/index.cjs.map +1 -1
  201. package/dist/query/index.d.cts +3 -3
  202. package/dist/query/index.d.ts +3 -3
  203. package/dist/query/index.js +32 -11
  204. package/dist/read-only-facade-ITU6L7BL.js +7 -0
  205. package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
  206. package/dist/registry-DKEXOJVO.js +7 -0
  207. package/dist/registry-DKEXOJVO.js.map +1 -0
  208. package/dist/registry-ST2VNFZC.js +10 -0
  209. package/dist/registry-ST2VNFZC.js.map +1 -0
  210. package/dist/registry-UFIK7CSR.js +8 -0
  211. package/dist/registry-UFIK7CSR.js.map +1 -0
  212. package/dist/registry-ZGYYSM5I.js +8 -0
  213. package/dist/registry-ZGYYSM5I.js.map +1 -0
  214. package/dist/revoke-S6JMSLUN.js +17 -0
  215. package/dist/revoke-S6JMSLUN.js.map +1 -0
  216. package/dist/session/index.cjs +7 -1
  217. package/dist/session/index.cjs.map +1 -1
  218. package/dist/session/index.d.cts +8 -7
  219. package/dist/session/index.d.ts +8 -7
  220. package/dist/session/index.js +10 -3
  221. package/dist/session/index.js.map +1 -1
  222. package/dist/shadow/index.cjs.map +1 -1
  223. package/dist/shadow/index.d.cts +7 -6
  224. package/dist/shadow/index.d.ts +7 -6
  225. package/dist/shadow/index.js +2 -2
  226. package/dist/signer-7NPTB3SQ.js +18 -0
  227. package/dist/signer-7NPTB3SQ.js.map +1 -0
  228. package/dist/snapshots/index.cjs +937 -0
  229. package/dist/snapshots/index.cjs.map +1 -0
  230. package/dist/snapshots/index.d.cts +28 -0
  231. package/dist/snapshots/index.d.ts +28 -0
  232. package/dist/snapshots/index.js +152 -0
  233. package/dist/snapshots/index.js.map +1 -0
  234. package/dist/stale-VKXSXJF4.js +13 -0
  235. package/dist/stale-VKXSXJF4.js.map +1 -0
  236. package/dist/store/index.cjs +14 -0
  237. package/dist/store/index.cjs.map +1 -1
  238. package/dist/store/index.d.cts +7 -6
  239. package/dist/store/index.d.ts +7 -6
  240. package/dist/store/index.js +5 -2
  241. package/dist/{strategy-D-SrOLCl.d.ts → strategy-CT2LCKAX.d.cts} +84 -19
  242. package/dist/{strategy-D-SrOLCl.d.cts → strategy-CT2LCKAX.d.ts} +84 -19
  243. package/dist/sync/index.cjs.map +1 -1
  244. package/dist/sync/index.d.cts +6 -5
  245. package/dist/sync/index.d.ts +6 -5
  246. package/dist/sync/index.js +4 -4
  247. package/dist/team/index.cjs +1554 -2
  248. package/dist/team/index.cjs.map +1 -1
  249. package/dist/team/index.d.cts +7 -6
  250. package/dist/team/index.d.ts +7 -6
  251. package/dist/team/index.js +77 -8
  252. package/dist/tx/index.cjs +375 -43
  253. package/dist/tx/index.cjs.map +1 -1
  254. package/dist/tx/index.d.cts +8 -7
  255. package/dist/tx/index.d.ts +8 -7
  256. package/dist/tx/index.js +56 -3
  257. package/dist/tx/index.js.map +1 -1
  258. package/dist/{types-Bo7NSXJr.d.ts → types-CaNQm4i8.d.ts} +3902 -614
  259. package/dist/{types-Bnb82f5R.d.cts → types-n2_IfwlQ.d.cts} +3902 -614
  260. package/dist/{index-CywCC1qZ.d.cts → ulid-B9SMWj5i.d.ts} +216 -27
  261. package/dist/{index-8QDuznDr.d.ts → ulid-CLMjmyhG.d.cts} +216 -27
  262. package/dist/util/index.cjs +7 -0
  263. package/dist/util/index.cjs.map +1 -1
  264. package/dist/util/index.d.cts +2 -0
  265. package/dist/util/index.d.ts +2 -0
  266. package/dist/util/index.js +5 -1
  267. package/dist/util/index.js.map +1 -1
  268. package/dist/with-derivation-CVIOPTUf.d.ts +13 -0
  269. package/dist/with-derivation-aKrtS7Jj.d.cts +13 -0
  270. package/dist/with-guard-DZQbPzoP.d.cts +18 -0
  271. package/dist/with-guard-DseETUrF.d.ts +18 -0
  272. package/dist/with-materialized-view-C1eA1_T_.d.cts +27 -0
  273. package/dist/with-materialized-view-DaYaE8-Q.d.ts +27 -0
  274. package/dist/with-overlayed-view-DQsh2p8H.d.ts +13 -0
  275. package/dist/with-overlayed-view-DleJfKcV.d.cts +13 -0
  276. package/package.json +77 -3
  277. package/dist/chunk-2CSJGFCB.js.map +0 -1
  278. package/dist/chunk-ACLDOTNQ.js.map +0 -1
  279. package/dist/chunk-BTDCBVJW.js +0 -160
  280. package/dist/chunk-BTDCBVJW.js.map +0 -1
  281. package/dist/chunk-CIMZBAZB.js.map +0 -1
  282. package/dist/chunk-EXHNQEV4.js +0 -392
  283. package/dist/chunk-EXHNQEV4.js.map +0 -1
  284. package/dist/chunk-GOUT6DND.js.map +0 -1
  285. package/dist/chunk-M5INGEFC.js.map +0 -1
  286. package/dist/chunk-MDDTIZUO.js.map +0 -1
  287. package/dist/chunk-NPC4LFV5.js.map +0 -1
  288. package/dist/chunk-QAVUREFT.js.map +0 -1
  289. package/dist/chunk-RKJ6OL7K.js.map +0 -1
  290. package/dist/chunk-SCZXXXU4.js.map +0 -1
  291. package/dist/chunk-TDR6T5CJ.js.map +0 -1
  292. package/dist/chunk-WDM5XGGS.js.map +0 -1
  293. package/dist/chunk-ZFKD4QMV.js.map +0 -1
  294. /package/dist/{chunk-PTVMYYON.js.map → chunk-2N62W5YP.js.map} +0 -0
  295. /package/dist/{chunk-QGZRWRSL.js.map → chunk-3LPV6BXR.js.map} +0 -0
  296. /package/dist/{chunk-4PWAI7Q4.js.map → chunk-5OX6XVNS.js.map} +0 -0
  297. /package/dist/{chunk-AVVPZ4BC.js.map → chunk-DJRWA3Q5.js.map} +0 -0
  298. /package/dist/{chunk-M62XNWRA.js.map → chunk-LSTBFLL2.js.map} +0 -0
  299. /package/dist/{chunk-MR4424N3.js.map → chunk-R233SLY3.js.map} +0 -0
  300. /package/dist/{chunk-USKYUS74.js.map → chunk-RRNA5GKT.js.map} +0 -0
  301. /package/dist/{chunk-R36SIKES.js.map → chunk-RYIL3PI2.js.map} +0 -0
  302. /package/dist/{crypto-IVKU7YTT.js.map → crypto-2CRLG4F4.js.map} +0 -0
  303. /package/dist/{delegation-2DBS2EOH.js.map → delegation-ZTRT2PRV.js.map} +0 -0
  304. /package/dist/{ledger-QZTTHQAQ.js.map → derivations/index.js.map} +0 -0
  305. /package/dist/{public-envelope-6JTACYJV.js.map → executor-S76VN45G.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- import { C as CollectionIndexes, a as Clause, O as Operator } from './predicate-SBHmi6D0.js';
2
- import { A as AggregateStrategy, b as AggregateSpec, c as Aggregation, a as AggregateResult, g as GroupedQuery } from './strategy-D-SrOLCl.js';
1
+ import { C as CollectionIndexes, a as Clause, O as Operator } from './predicate-Bt5ft-9c.cjs';
2
+ import { A as AggregateStrategy, b as AggregateSpec, c as Aggregation, a as AggregateResult, g as GroupedQuery, h as GroupedQueryN } from './strategy-CT2LCKAX.cjs';
3
3
 
4
4
  /**
5
5
  * All NOYDB error classes — a single import surface for `catch` blocks and
@@ -29,11 +29,15 @@ import { A as AggregateStrategy, b as AggregateSpec, c as Aggregation, a as Aggr
29
29
  * │ ├─ ValidationError — application-level guard failed
30
30
  * │ └─ SchemaValidationError — Standard Schema v1 rejection
31
31
  * ├─ Query errors
32
- * │ ├─ JoinTooLargeError — join row ceiling exceeded
33
- * │ ├─ DanglingReferenceError strict ref() points at nothing
34
- * │ ├─ GroupCardinalityError groupBy bucket cap exceeded
35
- * │ ├─ IndexRequiredError lazy-mode query touches unindexed field
36
- * │ └─ IndexWriteFailureError index side-car put/delete failed post-main
32
+ * │ ├─ JoinTooLargeError — join row ceiling exceeded
33
+ * │ ├─ CrossJoinTooLargeError cross-join row ceiling exceeded
34
+ * │ ├─ CrossJoinSourceUnknownError target collection not in vault
35
+ * │ ├─ DanglingReferenceError strict ref() points at nothing
36
+ * │ ├─ GroupCardinalityError groupBy bucket cap exceeded
37
+ * │ ├─ IndexRequiredError — lazy-mode query touches unindexed field
38
+ * │ ├─ IndexWriteFailureError — index side-car put/delete failed post-main
39
+ * │ ├─ UniqueConstraintError — duplicate value on unique index
40
+ * │ └─ UnsupportedIndexOptionError — unique+lazy or unique+crdt at registration
37
41
  * ├─ i18n / Dictionary errors
38
42
  * │ ├─ ReservedCollectionNameError
39
43
  * │ ├─ DictKeyMissingError
@@ -46,10 +50,12 @@ import { A as AggregateStrategy, b as AggregateSpec, c as Aggregation, a as Aggr
46
50
  * │ └─ BackupCorruptedError — envelope hash mismatch in dump
47
51
  * ├─ Bundle errors
48
52
  * │ └─ BundleIntegrityError — .noydb body sha256 mismatch
49
- * └─ Session errors
50
- * ├─ SessionExpiredError
51
- * ├─ SessionNotFoundError
52
- * └─ SessionPolicyError
53
+ * ├─ Session errors
54
+ *├─ SessionExpiredError
55
+ *├─ SessionNotFoundError
56
+ *└─ SessionPolicyError
57
+ * └─ Snapshot errors
58
+ * └─ SnapshotNotFoundError — snapshot key absent from snapshot store
53
59
  * ```
54
60
  *
55
61
  * ## Catching all NOYDB errors
@@ -116,6 +122,26 @@ declare class TamperedError extends NoydbError {
116
122
  declare class InvalidKeyError extends NoydbError {
117
123
  constructor(message?: string);
118
124
  }
125
+ /**
126
+ * Thrown when a keyring's wrapped-DEK set unwraps partially — at least
127
+ * one DEK succeeds (proving the KEK is correct) but at least one fails.
128
+ * The passphrase is right; the failed entries are corrupted.
129
+ *
130
+ * This is distinct from {@link InvalidKeyError} so that
131
+ * `NoydbOptions.onInvalidKey: 'reset'` does NOT fire — resetting on
132
+ * partial corruption would destroy the still-valid DEKs and the data
133
+ * they protect, which is silent data loss in response to a feature
134
+ * designed for stale-credential recovery.
135
+ */
136
+ declare class KeyringCorruptError extends NoydbError {
137
+ readonly failedCollections: readonly string[];
138
+ readonly intactCount: number;
139
+ constructor(opts: {
140
+ failedCollections: readonly string[];
141
+ intactCount: number;
142
+ message?: string;
143
+ });
144
+ }
119
145
  /**
120
146
  * Thrown when the authenticated user does not have a DEK for the requested
121
147
  * collection — i.e. the collection is not in their keyring at all.
@@ -229,7 +255,7 @@ declare class KeyringExpiredError extends NoydbError {
229
255
  }
230
256
  /**
231
257
  * Thrown when an `@noy-db/as-*` import is attempted but the invoking
232
- * keyring lacks the required import-capability bit (issue ).
258
+ * keyring lacks the required import-capability bit.
233
259
  *
234
260
  * - `tier: 'plaintext'` — a plaintext-tier import (`as-csv`, `as-json`,
235
261
  * `as-ndjson`, `as-zip`, …) was attempted but the keyring's
@@ -327,6 +353,64 @@ declare class PeriodClosedError extends NoydbError {
327
353
  readonly recordTs: string;
328
354
  constructor(periodName: string, endDate: string, recordTs: string);
329
355
  }
356
+ /**
357
+ * Thrown when a `put()` or `delete()` is rejected by a guard's `check`
358
+ * function. The `reason` is the message the guard supplied — typically a
359
+ * short business description (e.g. "invoice is issued"). The full
360
+ * collection + id are surfaced so audit UIs can link back to the record.
361
+ */
362
+ declare class RecordLockedError extends NoydbError {
363
+ readonly collection: string;
364
+ readonly id: string;
365
+ readonly reason: string;
366
+ constructor(collection: string, id: string, reason: string);
367
+ }
368
+ /**
369
+ * Thrown when a `put()` changes one or more fields that are frozen by a
370
+ * `frozenFields` guard. The `fields` list contains the specific paths
371
+ * that were detected as changed.
372
+ */
373
+ declare class FieldFrozenError extends NoydbError {
374
+ readonly collection: string;
375
+ readonly id: string;
376
+ readonly fields: readonly string[];
377
+ constructor(collection: string, id: string, fields: readonly string[]);
378
+ }
379
+ /**
380
+ * Thrown by an amendment invariant when the proposed change-set violates
381
+ * the declared business rule (e.g. disbursement total not preserved).
382
+ * Triggers a full transaction rollback via the existing revert pass.
383
+ */
384
+ declare class InvariantError extends NoydbError {
385
+ constructor(message: string);
386
+ }
387
+ /**
388
+ * Thrown at `withTransactions({ amendment: true })` open if the caller's
389
+ * role is not in the guard's allowed amendment roles. Fail-fast: thrown
390
+ * before any writes are attempted.
391
+ */
392
+ declare class AmendmentForbiddenError extends NoydbError {
393
+ readonly userId: string;
394
+ readonly role: string;
395
+ constructor(userId: string, role: string);
396
+ }
397
+ /**
398
+ * Thrown by `listUsersWithEnvelopes` when the vault's user directory
399
+ * has been disabled (via `db.setDirectoryEnabled(vault, false)`) and
400
+ * the caller's role is neither `owner` nor `admin`. Owner/admin can
401
+ * still enumerate users — the toggle is a UX privacy switch, not a
402
+ * security boundary.
403
+ *
404
+ * Honest caveat: this is a UX flag, not a privacy guarantee. The
405
+ * envelope ciphertext is still in the store, the keyring file is
406
+ * still listed at `_keyring/*`, and anyone with direct store read
407
+ * access can count keyrings without going through the hub. See
408
+ * `docs/subsystems/user-envelope.md` → "Directory visibility".
409
+ */
410
+ declare class DirectoryDisabledError extends NoydbError {
411
+ readonly vault: string;
412
+ constructor(vault: string);
413
+ }
330
414
  /**
331
415
  * Thrown when a user tries to act at a tier they are not cleared for.
332
416
  *
@@ -480,6 +564,30 @@ declare class SchemaValidationError extends NoydbError {
480
564
  readonly direction: 'input' | 'output';
481
565
  constructor(message: string, issues: readonly unknown[], direction: 'input' | 'output');
482
566
  }
567
+ /** Base for schema-evolution strategy rejections. */
568
+ declare class SchemaUpdateError extends NoydbError {
569
+ constructor(code: string, message: string);
570
+ }
571
+ /** A non-additive schema change was rejected by the `additiveOnly()` strategy. */
572
+ declare class NonAdditiveSchemaChangeError extends SchemaUpdateError {
573
+ constructor(message: string);
574
+ }
575
+ /** A schema change was rejected by the `lockSchema()` strategy. */
576
+ declare class SchemaLockedError extends SchemaUpdateError {
577
+ constructor(message: string);
578
+ }
579
+ /** Write attempted while a schema cutover fence is up (draining/migrating, or this collection has a pending cutover). */
580
+ declare class SchemaFenceError extends SchemaUpdateError {
581
+ constructor(message: string);
582
+ }
583
+ /** Write attempted by a client whose generation snapshot is behind the live fence — reload required. */
584
+ declare class MigrationRequiredError extends SchemaUpdateError {
585
+ constructor(message: string);
586
+ }
587
+ /** A coordinated cutover timed out waiting for active clients to quiesce. */
588
+ declare class QuiesceTimeoutError extends SchemaUpdateError {
589
+ constructor(message: string);
590
+ }
483
591
  /**
484
592
  * Thrown when `.groupBy().aggregate()` produces more than the hard
485
593
  * cardinality cap (default 100_000 groups)..
@@ -534,6 +642,51 @@ declare class IndexRequiredError extends NoydbError {
534
642
  missingFields: readonly string[];
535
643
  });
536
644
  }
645
+ /**
646
+ * Thrown by `Collection.put()` when writing a record would violate a
647
+ * unique-index constraint — the same field value (or composite field
648
+ * tuple) is already held by a *different* record id in the collection.
649
+ *
650
+ * Properties:
651
+ * - `collection` — name of the collection the write was targeting
652
+ * - `recordId` — the id of the record being written (the would-be violator)
653
+ * - `fields` — the constrained field(s), e.g. `['taxId']` or `['workerId','employerEntityId']`
654
+ * - `conflictingId` — the id of the record already holding the value
655
+ *
656
+ * Null-distinct semantics: if any constrained field is `null`/`undefined`,
657
+ * the row is exempt (the constraint does not fire). This matches standard
658
+ * SQL NULL-distinct behavior.
659
+ */
660
+ declare class UniqueConstraintError extends NoydbError {
661
+ readonly collection: string;
662
+ readonly recordId: string;
663
+ readonly fields: readonly string[];
664
+ readonly conflictingId: string;
665
+ constructor(collection: string, recordId: string, fields: readonly string[], conflictingId: string);
666
+ }
667
+ /**
668
+ * Thrown at collection registration when an index option is declared that
669
+ * is incompatible with the collection's operating mode.
670
+ *
671
+ * Currently covers two cases:
672
+ * - `unique: true` on a lazy-mode (`prefetch: false`) collection — lazy mode
673
+ * does not pre-load all records, so an in-memory uniqueness map cannot be
674
+ * maintained reliably.
675
+ * - `unique: true` on a CRDT collection (`crdt: 'lww-map' | 'rga' | 'yjs'`) —
676
+ * CRDT put() short-circuits the unique-constraint check, so enforcement would
677
+ * silently not fire.
678
+ *
679
+ * Both cases are caught eagerly at `vault.collection()` time so the developer
680
+ * sees the incompatibility immediately rather than shipping silently-ignored
681
+ * constraints.
682
+ *
683
+ * The `option` field names the incompatible option (`'unique'`) so catch blocks
684
+ * can pattern-match without inspecting the error message.
685
+ */
686
+ declare class UnsupportedIndexOptionError extends NoydbError {
687
+ readonly option: string;
688
+ constructor(option: string, message: string);
689
+ }
537
690
  /**
538
691
  * Thrown (or surfaced via the `index:write-partial` event) when one or more
539
692
  * per-indexed-field side-car writes fail after the main record write has
@@ -584,6 +737,33 @@ declare class IndexWriteFailureError extends NoydbError {
584
737
  declare class BundleIntegrityError extends NoydbError {
585
738
  constructor(message: string);
586
739
  }
740
+ /**
741
+ * Thrown by `readNoydbBundle` when the bundle carries
742
+ * sealed per-user passphrases but no supplied `SealingKeyProvider`
743
+ * has a `.id` (= `pid`) matching the sealed entry's `pid`.
744
+ *
745
+ * Carries the failing pid + the user id so the recipient can
746
+ * surface an actionable prompt:
747
+ *
748
+ * ```
749
+ * BundleSealMismatchError: bundle carries sealed passphrase for user "alice"
750
+ * under provider "macos-keychain:com.acme.app/alice@acme.example",
751
+ * but no registered provider matches that pid.
752
+ * ```
753
+ *
754
+ * Three resolution paths the message names (per foundation §11.9.4):
755
+ *
756
+ * 1. Configure a provider matching the pid and retry import.
757
+ * 2. Pass `attemptUnsealAcrossProviders: true` to try each
758
+ * registered provider regardless of pid.
759
+ * 3. Inspect without unsealing — pass no `sealingProviders` to
760
+ * receive the sealed entries unmodified for offline analysis.
761
+ */
762
+ declare class BundleSealMismatchError extends NoydbError {
763
+ readonly userId: string;
764
+ readonly pid: string;
765
+ constructor(userId: string, pid: string);
766
+ }
587
767
  /**
588
768
  * Thrown when `vault.collection()` is called with a name that is
589
769
  * reserved for NOYDB internal use (any name starting with `_dict_`).
@@ -663,6 +843,26 @@ declare class LocaleNotSpecifiedError extends NoydbError {
663
843
  readonly field: string;
664
844
  constructor(field: string, message?: string);
665
845
  }
846
+ /**
847
+ * Thrown at write time when an `i18nText` slot's value contains
848
+ * characters outside the script set allowed for that locale, and the
849
+ * field's `onScriptViolation` policy is `'reject'` (the default).
850
+ *
851
+ * Distinct from {@link MissingTranslationError} (write-shape) and
852
+ * {@link LocaleNotSpecifiedError} (read-hole) so callers can tell a
853
+ * wrong-script value from a missing one.
854
+ */
855
+ declare class ScriptViolationError extends NoydbError {
856
+ /** The field whose value violated its script constraint. */
857
+ readonly field: string;
858
+ /** The locale slot (e.g. `'en'`) that was checked. */
859
+ readonly locale: string;
860
+ /** The Unicode scripts allowed for this slot. */
861
+ readonly expected: readonly string[];
862
+ /** A short sample of the offending characters, for diagnostics. */
863
+ readonly sample: string;
864
+ constructor(field: string, locale: string, expected: readonly string[], sample: string, message?: string);
865
+ }
666
866
  /**
667
867
  * Thrown when a collection has an `i18nText` field with
668
868
  * `autoTranslate: true` but no `plaintextTranslator` was configured
@@ -707,6 +907,34 @@ declare class BackupCorruptedError extends NoydbError {
707
907
  readonly id: string;
708
908
  constructor(collection: string, id: string, message: string);
709
909
  }
910
+ /**
911
+ * Thrown by partition-extraction primitives when the
912
+ * transitive-closure walk fails — e.g. the FK graph is deeper than
913
+ * `maxDepth`, signalling a runaway or unexpectedly cyclic graph.
914
+ */
915
+ declare class PartitionExtractionError extends NoydbError {
916
+ constructor(message: string);
917
+ }
918
+ /**
919
+ * Thrown by `adoptPartition` when the transfer seal can't be
920
+ * opened — a wrong/short transfer key (AES-GCM auth-tag failure) or a
921
+ * malformed sealed payload.
922
+ */
923
+ declare class TransferSealError extends NoydbError {
924
+ constructor(message: string);
925
+ }
926
+ /**
927
+ * Thrown when an adoption-lifecycle precondition fails — re-adopting a
928
+ * partition already consumed in this store, or owner-creation on a
929
+ * vault that isn't in the adopted-unowned state.
930
+ */
931
+ declare class AdoptionStateError extends NoydbError {
932
+ constructor(message: string);
933
+ }
934
+ /** Document-attestation failures: undeclared field-schema, non-owner issue, missing field, signer failure. */
935
+ declare class AttestationError extends NoydbError {
936
+ constructor(message: string);
937
+ }
710
938
  /**
711
939
  * Thrown by `resolveSession()` when the session token's `expiresAt`
712
940
  * timestamp is in the past. The session key is also removed from the
@@ -782,6 +1010,34 @@ declare class JoinTooLargeError extends NoydbError {
782
1010
  message: string;
783
1011
  });
784
1012
  }
1013
+ /**
1014
+ * Thrown by `.crossJoin()` when the cumulative cartesian product (or lateral
1015
+ * filtered count) exceeds the configured ceiling. Check before allocating.
1016
+ * Mirrors the pattern of `JoinTooLargeError` and the `.join()` row ceiling.
1017
+ *
1018
+ * @see CrossJoinClause.maxRows — per-clause override
1019
+ * @see DEFAULT_CROSS_JOIN_MAX_ROWS — package default (50_000)
1020
+ */
1021
+ declare class CrossJoinTooLargeError extends NoydbError {
1022
+ readonly target: string;
1023
+ readonly expected: number;
1024
+ readonly limit: number;
1025
+ constructor(opts: {
1026
+ target: string;
1027
+ expected: number;
1028
+ limit: number;
1029
+ });
1030
+ }
1031
+ /**
1032
+ * Thrown at cross-join execution time when the target collection is not
1033
+ * reachable from the current vault. The left collection is included in the
1034
+ * message for context.
1035
+ */
1036
+ declare class CrossJoinSourceUnknownError extends NoydbError {
1037
+ readonly target: string;
1038
+ readonly leftCollection: string;
1039
+ constructor(target: string, leftCollection: string);
1040
+ }
785
1041
  /**
786
1042
  * Thrown by `.join()` in strict `ref()` mode when a left-side record
787
1043
  * points at a right-side id that does not exist in the target
@@ -830,6 +1086,169 @@ declare class PathEscapeError extends NoydbError {
830
1086
  targetDir: string;
831
1087
  });
832
1088
  }
1089
+ /**
1090
+ * Thrown at vault open if the derivation graph contains a cycle.
1091
+ * `path` is the offending chain (e.g. `['a', 'b', 'c', 'a']`).
1092
+ */
1093
+ declare class DerivationCycleError extends NoydbError {
1094
+ readonly path: readonly string[];
1095
+ constructor(path: readonly string[]);
1096
+ }
1097
+ /**
1098
+ * Thrown when a cascade of source → output → source → … exceeds the
1099
+ * configured `maxDepth` (default 5).
1100
+ */
1101
+ declare class DerivationDepthError extends NoydbError {
1102
+ readonly limit: number;
1103
+ readonly attempted: number;
1104
+ constructor(limit: number, attempted: number);
1105
+ }
1106
+ /**
1107
+ * Thrown at registration if a `withDerivation` strategy references an
1108
+ * output `collection` that isn't otherwise declared (no schema, no use
1109
+ * elsewhere). Surfacing this early catches typos in collection names.
1110
+ */
1111
+ declare class DerivationOutputUnknownError extends NoydbError {
1112
+ readonly collection: string;
1113
+ constructor(collection: string);
1114
+ }
1115
+ /**
1116
+ * Thrown when the user's `derive` function returns a value that doesn't
1117
+ * match the declared output spec (e.g. wrong shape, wrong key set).
1118
+ */
1119
+ declare class DerivationOutputShapeError extends NoydbError {
1120
+ readonly outputKey: string;
1121
+ constructor(outputKey: string, detail: string);
1122
+ }
1123
+ /**
1124
+ * Thrown by array-shape derivations when the `derive` function
1125
+ * returns more rows than the output's `maxFanout` cap. The cap exists
1126
+ * to keep dispatch cost bounded — without it a single source-row
1127
+ * update could fan out to thousands of derived rows, dominating the
1128
+ * write path.
1129
+ *
1130
+ * Defaults to `maxFanout: 64`. Raise on the output spec for
1131
+ * carry-forward expansion cases (e.g. monthly rows across multi-year
1132
+ * contracts).
1133
+ */
1134
+ declare class DerivationCapExceededError extends NoydbError {
1135
+ readonly outputKey: string;
1136
+ readonly returned: number;
1137
+ readonly maxFanout: number;
1138
+ constructor(outputKey: string, returned: number, maxFanout: number);
1139
+ }
1140
+ /**
1141
+ * Thrown at vault open if the materialized-view graph contains a
1142
+ * cycle. `path` is the offending chain (e.g. `['a-mv', 'b-mv', 'a-mv']`).
1143
+ * Detected by the same shared DFS that catches `DerivationCycleError`;
1144
+ * surfaces with a distinct error type so consumers can disambiguate.
1145
+ */
1146
+ declare class MaterializedViewCycleError extends NoydbError {
1147
+ readonly path: readonly string[];
1148
+ constructor(path: readonly string[]);
1149
+ }
1150
+ /**
1151
+ * Thrown at MV registration if the query references a source
1152
+ * collection that isn't declared on the vault. Surfacing this early
1153
+ * catches typos in collection names.
1154
+ */
1155
+ declare class MaterializedViewSourceUnknownError extends NoydbError {
1156
+ readonly mvName: string;
1157
+ readonly collection: string;
1158
+ constructor(mvName: string, collection: string);
1159
+ }
1160
+ /**
1161
+ * Thrown by the MV executor when a refresh produces more rows than
1162
+ * the configured ceiling. Default ceiling is 100k rows; override
1163
+ * per-MV via `maxRows`. Mirrors `JoinTooLargeError` /
1164
+ * `GroupCardinalityError` from the query DSL — the explosion is
1165
+ * detected BEFORE writes hit the store, so the source-write
1166
+ * transaction can roll back cleanly via strict-mode.
1167
+ */
1168
+ declare class MaterializedViewTooLargeError extends NoydbError {
1169
+ readonly mvName: string;
1170
+ readonly expected: number;
1171
+ readonly limit: number;
1172
+ constructor(mvName: string, expected: number, limit: number);
1173
+ }
1174
+ /**
1175
+ * Thrown by `withMaterializedView()` at registration time when the
1176
+ * strategy is structurally malformed. Distinct from
1177
+ * `MaterializedViewSourceUnknownError` (the source list is well-formed
1178
+ * but names a collection the vault doesn't know) and
1179
+ * `MaterializedViewCycleError` (the source graph has a cycle): this
1180
+ * error fires before either check, at the moment the spec is being
1181
+ * normalized.
1182
+ *
1183
+ * Today the trigger cases are all about the `query` / `unionSources`
1184
+ * dichotomy:
1185
+ * - both `query` and `unionSources` were set (mutually exclusive),
1186
+ * - neither `query` nor `unionSources` was set,
1187
+ * - `unionSources` has fewer than 2 arms,
1188
+ * - two arms in `unionSources` reference the same `collection`.
1189
+ *
1190
+ * The error message is prefixed with `[noy-db] withMaterializedView:`
1191
+ * so it's grep-friendly in logs and looks consistent with the existing
1192
+ * `ValidationError` messages from the same factory.
1193
+ */
1194
+ declare class MaterializedViewConfigError extends NoydbError {
1195
+ constructor(message: string);
1196
+ }
1197
+ /**
1198
+ * Thrown at vault open when a `withOverlayedView` declaration uses
1199
+ * another virtual-overlay name as its `base`. Multi-overlay stacking
1200
+ * is a v2 non-goal — the shallow expansion in
1201
+ * `QueryDependencyAnalyzer` would truncate at the inner overlay
1202
+ * name, leaving downstream MVs silently stale.
1203
+ */
1204
+ declare class OverlayBaseIsVirtualError extends NoydbError {
1205
+ readonly overlayName: string;
1206
+ readonly base: string;
1207
+ constructor(overlayName: string, base: string);
1208
+ }
1209
+ /**
1210
+ * Thrown at vault open when a `withOverlayedView`'s `overlay`
1211
+ * references an unknown collection or an MV-owned collection. The
1212
+ * overlay collection is user-writable; MV-owned collections aren't.
1213
+ */
1214
+ declare class OverlayCollectionUnavailableError extends NoydbError {
1215
+ readonly overlayName: string;
1216
+ readonly overlay: string;
1217
+ constructor(overlayName: string, overlay: string);
1218
+ }
1219
+ /**
1220
+ * Thrown at vault open when a `withOverlayedView`'s virtual `name`
1221
+ * collides with an MV output or a concrete source collection.
1222
+ */
1223
+ declare class OverlayNameCollisionError extends NoydbError {
1224
+ readonly overlayName: string;
1225
+ constructor(overlayName: string);
1226
+ }
1227
+ /**
1228
+ * Thrown by the virtual overlay's `put(id, record)` when the
1229
+ * consumer-supplied `id` doesn't match `rowKey(record)`. Catches
1230
+ * fat-finger separator typos that would otherwise silently produce
1231
+ * orphaned overlay rows. Direct writes to the underlying overlay
1232
+ * collection (bypass the virtual layer) skip this validation.
1233
+ */
1234
+ declare class OverlayIdMismatchError extends NoydbError {
1235
+ readonly actual: string;
1236
+ readonly expected: string;
1237
+ constructor(actual: string, expected: string);
1238
+ }
1239
+ /**
1240
+ * Thrown when a requested snapshot version does not exist in the
1241
+ * snapshot store — either it was never created, was pruned by the
1242
+ * retention policy, or was deleted manually.
1243
+ *
1244
+ * The `version` field carries the key that was looked up so callers
1245
+ * can surface an actionable "snapshot X not found" message without
1246
+ * parsing the error string.
1247
+ */
1248
+ declare class SnapshotNotFoundError extends NoydbError {
1249
+ readonly version: string;
1250
+ constructor(version: string);
1251
+ }
833
1252
 
834
1253
  /**
835
1254
  * Foreign-key references — the soft-FK mechanism.
@@ -1325,6 +1744,8 @@ interface QueryPlan {
1325
1744
  */
1326
1745
  readonly joins: readonly JoinLeg[];
1327
1746
  }
1747
+ /** Default row ceiling for cross-join expansion. Matches JoinTooLargeError's ceiling. */
1748
+ declare const DEFAULT_CROSS_JOIN_MAX_ROWS = 50000;
1328
1749
  /**
1329
1750
  * Source of records that a query executes against.
1330
1751
  *
@@ -1361,12 +1782,54 @@ interface QuerySource<T> {
1361
1782
  * joinContext, and calling `.join()` on it throws with an actionable
1362
1783
  * error. See `query/join.ts` for the full design.
1363
1784
  */
1785
+ /**
1786
+ * Declared deterministic predicate. Carries the consumer's
1787
+ * stable `hash` (for function-body identity), the function itself,
1788
+ * and is keyed by name when registered on a `Query<T>` via
1789
+ * `_withPredicates()`.
1790
+ */
1791
+ interface DeclaredPredicate {
1792
+ hash: string;
1793
+ fn: (record: unknown, ctx?: unknown) => boolean;
1794
+ }
1364
1795
  declare class Query<T> {
1365
1796
  private readonly source;
1366
1797
  private readonly plan;
1367
1798
  private readonly joinContext;
1368
1799
  private readonly aggregateStrategy;
1369
- constructor(source: QuerySource<T>, plan?: QueryPlan, joinContext?: JoinContext, aggregateStrategy?: AggregateStrategy);
1800
+ private readonly predicates;
1801
+ constructor(source: QuerySource<T>, plan?: QueryPlan, joinContext?: JoinContext, aggregateStrategy?: AggregateStrategy, predicates?: ReadonlyMap<string, DeclaredPredicate>);
1802
+ /**
1803
+ * @internal — accessor for the materialized-view dependency
1804
+ * analyzer. Not part of the public API; consumers should use the
1805
+ * builder methods, not inspect the plan directly.
1806
+ */
1807
+ _plan(): QueryPlan;
1808
+ /**
1809
+ * @internal — accessor for the materialized-view dependency
1810
+ * analyzer. Returns the join resolution context (or `undefined` for
1811
+ * queries constructed without a Collection backing).
1812
+ */
1813
+ _joinContext(): JoinContext | undefined;
1814
+ /**
1815
+ * @internal — clone this Query with a declared-predicate map
1816
+ * attached. Used by the materialized-view registry to enable
1817
+ * `.wherePredicate(name, ctx?)` for the MV's query callback.
1818
+ * Consumers don't call this directly.
1819
+ */
1820
+ _withPredicates(predicates: ReadonlyMap<string, DeclaredPredicate>): Query<T>;
1821
+ /**
1822
+ * Filter by a registered deterministic predicate. Requires
1823
+ * the Query to have been augmented with a predicates map (typically
1824
+ * via the materialized-view registry — bare Queries constructed
1825
+ * outside an MV throw on `.wherePredicate()`).
1826
+ *
1827
+ * `ctx` is an optional opaque value passed verbatim to the predicate
1828
+ * function. Both `predicateHash` (from the registration) and a
1829
+ * canonical-JSON hash of `ctx` fold into the MV's `queryHash`, so
1830
+ * either changing forces refresh on next visit.
1831
+ */
1832
+ wherePredicate(name: string, ctx?: unknown): Query<T>;
1370
1833
  /** Add a field comparison. Multiple where() calls are AND-combined. */
1371
1834
  where(field: string, op: Operator, value: unknown): Query<T>;
1372
1835
  /**
@@ -1451,6 +1914,36 @@ declare class Query<T> {
1451
1914
  strategy?: JoinStrategy;
1452
1915
  maxRows?: number;
1453
1916
  }): Query<T & Record<As, R | null>>;
1917
+ /**
1918
+ * Cartesian-product cross-join against `target` collection. Each result row
1919
+ * carries the original `T` fields plus `result[as]` populated from every
1920
+ * right-side row (or the filtered subset when `on:` is supplied).
1921
+ *
1922
+ * **Order matters:** `.where().crossJoin()` filters BEFORE expanding (cheaper);
1923
+ * `.crossJoin().where('alias.field', ...)` filters AFTER (required when the
1924
+ * where clause references the aliased fields).
1925
+ *
1926
+ * **Cost ceiling:** `CrossJoinTooLargeError` fires before allocation when
1927
+ * `leftRows × rightRows` (or the cumulative lateral count) exceeds the limit.
1928
+ * Default: 50,000 rows. Override per-clause with `{ maxRows: N }`.
1929
+ *
1930
+ * **`on:` shapes:**
1931
+ * - `on: (left) => TTarget[]` — subset form (most efficient)
1932
+ * - `on: (left) => (right) => boolean` — predicate form
1933
+ * - `on: { predicate: 'name' }` — MV-safe, hash-tracked form
1934
+ * (requires the Query to have been augmented via `_withPredicates`)
1935
+ *
1936
+ * Requires a JoinContext (constructed via `collection.query()`).
1937
+ */
1938
+ crossJoin<TTarget = unknown, As extends string = string>(target: string, opts: {
1939
+ as: As;
1940
+ on?: ((left: T) => unknown[] | ((right: TTarget) => boolean)) | {
1941
+ readonly predicate: string;
1942
+ };
1943
+ maxRows?: number;
1944
+ }): Query<T & {
1945
+ [K in As]: TTarget;
1946
+ }>;
1454
1947
  /**
1455
1948
  * Execute the plan and return the matching records. When the plan
1456
1949
  * carries any join legs, they are applied after `where` / `orderBy`
@@ -1558,6 +2051,7 @@ declare class Query<T> {
1558
2051
  * per record and can't be index-accelerated.
1559
2052
  */
1560
2053
  groupBy<F extends string>(field: F): GroupedQuery<T, F>;
2054
+ groupBy<F extends readonly [string, string, ...string[]]>(...fields: F): GroupedQueryN<T, F>;
1561
2055
  /**
1562
2056
  * Re-run the query whenever the source notifies of changes.
1563
2057
  * Returns an unsubscribe function. The callback receives the latest result.
@@ -1937,4 +2431,4 @@ declare class ScanBuilder<T> implements AsyncIterable<T> {
1937
2431
  private recordMatches;
1938
2432
  }
1939
2433
 
1940
- export { ScanBuilder as $, AlreadyElevatedError as A, BackupCorruptedError as B, ConflictError as C, DEFAULT_JOIN_MAX_ROWS as D, ElevationExpiredError as E, FilenameSanitizationError as F, GroupCardinalityError as G, type QuerySource as H, ImportCapabilityError as I, type JoinContext as J, KeyringExpiredError as K, LedgerContentionError as L, MissingTranslationError as M, NoydbError as N, type OrderBy as O, PathEscapeError as P, Query as Q, ReadOnlyAtInstantError as R, ReadOnlyError as S, ReadOnlyFrameError as T, type RefDescriptor as U, RefIntegrityError as V, type RefMode as W, RefRegistry as X, RefScopeError as Y, type RefViolation as Z, ReservedCollectionNameError as _, BackupLedgerError as a, type ScanPageProvider as a0, SchemaValidationError as a1, SessionExpiredError as a2, SessionNotFoundError as a3, SessionPolicyError as a4, StoreCapabilityError as a5, TamperedError as a6, TierDemoteDeniedError as a7, TierNotGrantedError as a8, TranslatorNotConfiguredError as a9, ValidationError as aa, applyJoins as ab, buildLiveQuery as ac, executePlan as ad, ref as ae, resetJoinWarnings as af, BundleIntegrityError as b, BundleVersionConflictError as c, DanglingReferenceError as d, DecryptionError as e, DelegationTargetMissingError as f, DictKeyInUseError as g, DictKeyMissingError as h, ExportCapabilityError as i, IndexRequiredError as j, IndexWriteFailureError as k, InvalidKeyError as l, type JoinLeg as m, type JoinStrategy as n, JoinTooLargeError as o, type JoinableSource as p, type LiveQuery as q, type LiveUpstream as r, LocaleNotSpecifiedError as s, NetworkError as t, NoAccessError as u, NotFoundError as v, PeriodClosedError as w, PermissionDeniedError as x, PrivilegeEscalationError as y, type QueryPlan as z };
2434
+ export { ImportCapabilityError as $, AmendmentForbiddenError as A, BackupCorruptedError as B, ConflictError as C, DictKeyInUseError as D, CrossJoinSourceUnknownError as E, FieldFrozenError as F, CrossJoinTooLargeError as G, DEFAULT_CROSS_JOIN_MAX_ROWS as H, InvariantError as I, DEFAULT_JOIN_MAX_ROWS as J, DanglingReferenceError as K, LocaleNotSpecifiedError as L, MissingTranslationError as M, NoydbError as N, OverlayBaseIsVirtualError as O, PartitionExtractionError as P, Query as Q, ReservedCollectionNameError as R, ScriptViolationError as S, TranslatorNotConfiguredError as T, DecryptionError as U, DelegationTargetMissingError as V, DirectoryDisabledError as W, ElevationExpiredError as X, ExportCapabilityError as Y, FilenameSanitizationError as Z, GroupCardinalityError as _, DictKeyMissingError as a, IndexRequiredError as a0, IndexWriteFailureError as a1, InvalidKeyError as a2, type JoinContext as a3, type JoinLeg as a4, type JoinStrategy as a5, JoinTooLargeError as a6, type JoinableSource as a7, KeyringCorruptError as a8, KeyringExpiredError as a9, type ScanPageProvider as aA, SchemaFenceError as aB, SchemaLockedError as aC, SchemaUpdateError as aD, SchemaValidationError as aE, StoreCapabilityError as aF, TamperedError as aG, TierDemoteDeniedError as aH, TierNotGrantedError as aI, UniqueConstraintError as aJ, UnsupportedIndexOptionError as aK, ValidationError as aL, applyJoins as aM, buildLiveQuery as aN, executePlan as aO, ref as aP, resetJoinWarnings as aQ, LedgerContentionError as aa, type LiveQuery as ab, type LiveUpstream as ac, MigrationRequiredError as ad, NetworkError as ae, NoAccessError as af, NonAdditiveSchemaChangeError as ag, NotFoundError as ah, type OrderBy as ai, PathEscapeError as aj, PeriodClosedError as ak, PermissionDeniedError as al, PrivilegeEscalationError as am, type QueryPlan as an, type QuerySource as ao, QuiesceTimeoutError as ap, ReadOnlyAtInstantError as aq, ReadOnlyError as ar, ReadOnlyFrameError as as, type RefDescriptor as at, RefIntegrityError as au, type RefMode as av, RefRegistry as aw, RefScopeError as ax, type RefViolation as ay, ScanBuilder as az, SessionExpiredError as b, SessionNotFoundError as c, SessionPolicyError as d, RecordLockedError as e, SnapshotNotFoundError as f, DerivationCapExceededError as g, DerivationCycleError as h, DerivationDepthError as i, DerivationOutputShapeError as j, DerivationOutputUnknownError as k, OverlayCollectionUnavailableError as l, OverlayIdMismatchError as m, OverlayNameCollisionError as n, AttestationError as o, AdoptionStateError as p, BackupLedgerError as q, BundleIntegrityError as r, BundleSealMismatchError as s, BundleVersionConflictError as t, TransferSealError as u, MaterializedViewConfigError as v, MaterializedViewCycleError as w, MaterializedViewSourceUnknownError as x, MaterializedViewTooLargeError as y, AlreadyElevatedError as z };