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

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 (288) hide show
  1. package/dist/aggregate/index.cjs +91 -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 +16923 -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-PTVMYYON.js → chunk-243PNUA6.js} +3 -3
  25. package/dist/{chunk-MR4424N3.js → chunk-2PAQNPE3.js} +2 -2
  26. package/dist/chunk-3QAKZ37R.js +83 -0
  27. package/dist/chunk-3QAKZ37R.js.map +1 -0
  28. package/dist/chunk-3S4BJX25.js +36 -0
  29. package/dist/chunk-3S4BJX25.js.map +1 -0
  30. package/dist/chunk-3XHOCQK4.js +118 -0
  31. package/dist/chunk-3XHOCQK4.js.map +1 -0
  32. package/dist/{chunk-AVVPZ4BC.js → chunk-3Y53S2SA.js} +4 -4
  33. package/dist/chunk-3Z2TPHC4.js +291 -0
  34. package/dist/chunk-3Z2TPHC4.js.map +1 -0
  35. package/dist/chunk-4HIL6AHQ.js +57 -0
  36. package/dist/chunk-4HIL6AHQ.js.map +1 -0
  37. package/dist/chunk-5ZGZ6HIZ.js +100 -0
  38. package/dist/chunk-5ZGZ6HIZ.js.map +1 -0
  39. package/dist/{chunk-ZFKD4QMV.js → chunk-7BRE6EUA.js} +3 -3
  40. package/dist/chunk-7BUTTVMR.js +34 -0
  41. package/dist/chunk-7BUTTVMR.js.map +1 -0
  42. package/dist/{chunk-VQBTTTUN.js → chunk-7Q5PLD5C.js} +4 -4
  43. package/dist/{chunk-VQBTTTUN.js.map → chunk-7Q5PLD5C.js.map} +1 -1
  44. package/dist/{chunk-QAVUREFT.js → chunk-7Z23ZFLV.js} +12 -6
  45. package/dist/chunk-7Z23ZFLV.js.map +1 -0
  46. package/dist/chunk-AHPFONIL.js +59 -0
  47. package/dist/chunk-AHPFONIL.js.map +1 -0
  48. package/dist/chunk-CXSCDO5T.js +51 -0
  49. package/dist/chunk-CXSCDO5T.js.map +1 -0
  50. package/dist/chunk-E535SAN4.js +8834 -0
  51. package/dist/chunk-E535SAN4.js.map +1 -0
  52. package/dist/chunk-EUYOGYGV.js +830 -0
  53. package/dist/chunk-EUYOGYGV.js.map +1 -0
  54. package/dist/chunk-FAQVNJD4.js +61 -0
  55. package/dist/chunk-FAQVNJD4.js.map +1 -0
  56. package/dist/{chunk-SCZXXXU4.js → chunk-G6FRSBKK.js} +7 -32
  57. package/dist/chunk-G6FRSBKK.js.map +1 -0
  58. package/dist/chunk-GIV6DWBG.js +79 -0
  59. package/dist/chunk-GIV6DWBG.js.map +1 -0
  60. package/dist/chunk-HXJXPZRE.js +73 -0
  61. package/dist/chunk-HXJXPZRE.js.map +1 -0
  62. package/dist/{chunk-GOUT6DND.js → chunk-J4KLMEUL.js} +173 -91
  63. package/dist/chunk-J4KLMEUL.js.map +1 -0
  64. package/dist/{chunk-2CSJGFCB.js → chunk-JYQTXEIO.js} +6 -229
  65. package/dist/chunk-JYQTXEIO.js.map +1 -0
  66. package/dist/{chunk-MDDTIZUO.js → chunk-LRAZDV5X.js} +7 -119
  67. package/dist/chunk-LRAZDV5X.js.map +1 -0
  68. package/dist/{chunk-M5INGEFC.js → chunk-MRIBLZL3.js} +3 -1
  69. package/dist/chunk-MRIBLZL3.js.map +1 -0
  70. package/dist/{chunk-USKYUS74.js → chunk-MUWOSVEP.js} +2 -2
  71. package/dist/{chunk-4PWAI7Q4.js → chunk-NWZ3I6R6.js} +5 -5
  72. package/dist/chunk-OVZDFEOR.js +124 -0
  73. package/dist/chunk-OVZDFEOR.js.map +1 -0
  74. package/dist/chunk-PEULZC6M.js +118 -0
  75. package/dist/chunk-PEULZC6M.js.map +1 -0
  76. package/dist/chunk-PFSNOPBQ.js +233 -0
  77. package/dist/chunk-PFSNOPBQ.js.map +1 -0
  78. package/dist/chunk-PLI5TV7N.js +53 -0
  79. package/dist/chunk-PLI5TV7N.js.map +1 -0
  80. package/dist/{chunk-WDM5XGGS.js → chunk-Q6W2CMEJ.js} +181 -11
  81. package/dist/chunk-Q6W2CMEJ.js.map +1 -0
  82. package/dist/{chunk-QGZRWRSL.js → chunk-QPEXPHJR.js} +4 -4
  83. package/dist/{chunk-R36SIKES.js → chunk-QXQRKXCU.js} +2 -2
  84. package/dist/chunk-RTZVQAJ7.js +82 -0
  85. package/dist/chunk-RTZVQAJ7.js.map +1 -0
  86. package/dist/chunk-TBKOGSYR.js +296 -0
  87. package/dist/chunk-TBKOGSYR.js.map +1 -0
  88. package/dist/chunk-UMLVJTYV.js +20 -0
  89. package/dist/chunk-UMLVJTYV.js.map +1 -0
  90. package/dist/chunk-UND4XIB6.js +251 -0
  91. package/dist/chunk-UND4XIB6.js.map +1 -0
  92. package/dist/chunk-VCGTOS2A.js +795 -0
  93. package/dist/chunk-VCGTOS2A.js.map +1 -0
  94. package/dist/chunk-VE6YVP32.js +19 -0
  95. package/dist/chunk-VE6YVP32.js.map +1 -0
  96. package/dist/{chunk-M62XNWRA.js → chunk-VK5EER6C.js} +2 -2
  97. package/dist/{chunk-NXFEYLVG.js → chunk-VPSUZLOJ.js} +4 -3
  98. package/dist/{chunk-NXFEYLVG.js.map → chunk-VPSUZLOJ.js.map} +1 -1
  99. package/dist/{chunk-TDR6T5CJ.js → chunk-VRBCTEKQ.js} +91 -132
  100. package/dist/chunk-VRBCTEKQ.js.map +1 -0
  101. package/dist/{chunk-ACLDOTNQ.js → chunk-W3XXT26A.js} +303 -3
  102. package/dist/chunk-W3XXT26A.js.map +1 -0
  103. package/dist/{chunk-CIMZBAZB.js → chunk-XG3PTSCD.js} +1 -1
  104. package/dist/chunk-XG3PTSCD.js.map +1 -0
  105. package/dist/chunk-Y2RKOPNC.js +145 -0
  106. package/dist/chunk-Y2RKOPNC.js.map +1 -0
  107. package/dist/{chunk-NPC4LFV5.js → chunk-YMYK7US4.js} +2 -2
  108. package/dist/{chunk-RKJ6OL7K.js → chunk-YS3POABP.js} +1 -1
  109. package/dist/chunk-YS3POABP.js.map +1 -0
  110. package/dist/chunk-YTXSFG3C.js +179 -0
  111. package/dist/chunk-YTXSFG3C.js.map +1 -0
  112. package/dist/consent/index.cjs.map +1 -1
  113. package/dist/consent/index.d.cts +7 -6
  114. package/dist/consent/index.d.ts +7 -6
  115. package/dist/consent/index.js +3 -3
  116. package/dist/{crypto-IVKU7YTT.js → crypto-5ZDIY3NG.js} +3 -3
  117. package/dist/{delegation-2DBS2EOH.js → delegation-QYXZW25W.js} +5 -4
  118. package/dist/derivations/index.cjs +351 -0
  119. package/dist/derivations/index.cjs.map +1 -0
  120. package/dist/derivations/index.d.cts +72 -0
  121. package/dist/derivations/index.d.ts +72 -0
  122. package/dist/derivations/index.js +27 -0
  123. package/dist/{dev-unlock-Da1B0TIK.d.cts → dev-unlock-DQCNDfFp.d.cts} +1 -1
  124. package/dist/{dev-unlock-BdPp68qn.d.ts → dev-unlock-utkybTKb.d.ts} +1 -1
  125. package/dist/executor-AS2IDHKZ.js +11 -0
  126. package/dist/executor-HLXFXNFM.js +8 -0
  127. package/dist/executor-HLXFXNFM.js.map +1 -0
  128. package/dist/executor-HN6YBHZ5.js +8 -0
  129. package/dist/executor-HN6YBHZ5.js.map +1 -0
  130. package/dist/fanout-sidecar-VJ52RIEY.js +51 -0
  131. package/dist/fanout-sidecar-VJ52RIEY.js.map +1 -0
  132. package/dist/guards/index.cjs +315 -0
  133. package/dist/guards/index.cjs.map +1 -0
  134. package/dist/guards/index.d.cts +31 -0
  135. package/dist/guards/index.d.ts +31 -0
  136. package/dist/guards/index.js +29 -0
  137. package/dist/guards/index.js.map +1 -0
  138. package/dist/{hash-lsoL3eEW.d.ts → hash-DcoYWfJ_.d.ts} +1 -1
  139. package/dist/{hash-BEfzPKwo.d.cts → hash-jDowCrK2.d.cts} +1 -1
  140. package/dist/history/index.cjs +8 -1
  141. package/dist/history/index.cjs.map +1 -1
  142. package/dist/history/index.d.cts +8 -7
  143. package/dist/history/index.d.ts +8 -7
  144. package/dist/history/index.js +6 -6
  145. package/dist/i18n/index.cjs +81 -0
  146. package/dist/i18n/index.cjs.map +1 -1
  147. package/dist/i18n/index.d.cts +7 -6
  148. package/dist/i18n/index.d.ts +7 -6
  149. package/dist/i18n/index.js +27 -12
  150. package/dist/i18n/index.js.map +1 -1
  151. package/dist/{index-6xNpPsxR.d.cts → index-BCKdioeh.d.ts} +331 -5
  152. package/dist/{index-DJTf9yxn.d.ts → index-BMjrzNZr.d.cts} +331 -5
  153. package/dist/index.cjs +6065 -959
  154. package/dist/index.cjs.map +1 -1
  155. package/dist/index.d.cts +208 -16
  156. package/dist/index.d.ts +208 -16
  157. package/dist/index.js +242 -7392
  158. package/dist/index.js.map +1 -1
  159. package/dist/indexing/index.cjs +2 -0
  160. package/dist/indexing/index.cjs.map +1 -1
  161. package/dist/indexing/index.d.cts +3 -3
  162. package/dist/indexing/index.d.ts +3 -3
  163. package/dist/indexing/index.js +4 -4
  164. package/dist/issue-ORP37MVW.js +12 -0
  165. package/dist/issue-ORP37MVW.js.map +1 -0
  166. package/dist/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-C-rPfWG0.d.cts} +1 -1
  167. package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Rpd-V3jP.d.ts} +1 -1
  168. package/dist/{ledger-QZTTHQAQ.js → ledger-3IU5GMXA.js} +6 -6
  169. package/dist/ledger-3IU5GMXA.js.map +1 -0
  170. package/dist/materialized-views/index.cjs +837 -0
  171. package/dist/materialized-views/index.cjs.map +1 -0
  172. package/dist/materialized-views/index.d.cts +184 -0
  173. package/dist/materialized-views/index.d.ts +184 -0
  174. package/dist/materialized-views/index.js +45 -0
  175. package/dist/materialized-views/index.js.map +1 -0
  176. package/dist/noydb-5H3C24GG.js +34 -0
  177. package/dist/noydb-5H3C24GG.js.map +1 -0
  178. package/dist/overlay-views/index.cjs +359 -0
  179. package/dist/overlay-views/index.cjs.map +1 -0
  180. package/dist/overlay-views/index.d.cts +82 -0
  181. package/dist/overlay-views/index.d.ts +82 -0
  182. package/dist/overlay-views/index.js +25 -0
  183. package/dist/overlay-views/index.js.map +1 -0
  184. package/dist/periods/index.cjs +7 -1
  185. package/dist/periods/index.cjs.map +1 -1
  186. package/dist/periods/index.d.cts +7 -6
  187. package/dist/periods/index.d.ts +7 -6
  188. package/dist/periods/index.js +6 -6
  189. package/dist/{predicate-SBHmi6D0.d.cts → predicate-Dnu81tsS.d.cts} +25 -1
  190. package/dist/{predicate-SBHmi6D0.d.ts → predicate-Dnu81tsS.d.ts} +25 -1
  191. package/dist/{public-envelope-6JTACYJV.js → public-envelope-U3CMEOMV.js} +4 -4
  192. package/dist/public-envelope-U3CMEOMV.js.map +1 -0
  193. package/dist/query/index.cjs +302 -124
  194. package/dist/query/index.cjs.map +1 -1
  195. package/dist/query/index.d.cts +3 -3
  196. package/dist/query/index.d.ts +3 -3
  197. package/dist/query/index.js +26 -11
  198. package/dist/read-only-facade-ITU6L7BL.js +7 -0
  199. package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
  200. package/dist/registry-3ALP62P6.js +10 -0
  201. package/dist/registry-3ALP62P6.js.map +1 -0
  202. package/dist/registry-7HE6VJGC.js +8 -0
  203. package/dist/registry-7HE6VJGC.js.map +1 -0
  204. package/dist/registry-PSIPG2QR.js +8 -0
  205. package/dist/registry-PSIPG2QR.js.map +1 -0
  206. package/dist/registry-RFGGMVNJ.js +7 -0
  207. package/dist/registry-RFGGMVNJ.js.map +1 -0
  208. package/dist/revoke-KY2GB4KP.js +17 -0
  209. package/dist/revoke-KY2GB4KP.js.map +1 -0
  210. package/dist/session/index.cjs +7 -1
  211. package/dist/session/index.cjs.map +1 -1
  212. package/dist/session/index.d.cts +8 -7
  213. package/dist/session/index.d.ts +8 -7
  214. package/dist/session/index.js +10 -3
  215. package/dist/session/index.js.map +1 -1
  216. package/dist/shadow/index.cjs.map +1 -1
  217. package/dist/shadow/index.d.cts +7 -6
  218. package/dist/shadow/index.d.ts +7 -6
  219. package/dist/shadow/index.js +2 -2
  220. package/dist/signer-GRI5TZKH.js +18 -0
  221. package/dist/signer-GRI5TZKH.js.map +1 -0
  222. package/dist/stale-OTOF3FH7.js +13 -0
  223. package/dist/stale-OTOF3FH7.js.map +1 -0
  224. package/dist/store/index.cjs +14 -0
  225. package/dist/store/index.cjs.map +1 -1
  226. package/dist/store/index.d.cts +7 -6
  227. package/dist/store/index.d.ts +7 -6
  228. package/dist/store/index.js +5 -2
  229. package/dist/{strategy-D-SrOLCl.d.cts → strategy-DSTrsZ8t.d.cts} +72 -19
  230. package/dist/{strategy-D-SrOLCl.d.ts → strategy-DSTrsZ8t.d.ts} +72 -19
  231. package/dist/sync/index.cjs.map +1 -1
  232. package/dist/sync/index.d.cts +6 -5
  233. package/dist/sync/index.d.ts +6 -5
  234. package/dist/sync/index.js +4 -4
  235. package/dist/team/index.cjs +1554 -2
  236. package/dist/team/index.cjs.map +1 -1
  237. package/dist/team/index.d.cts +7 -6
  238. package/dist/team/index.d.ts +7 -6
  239. package/dist/team/index.js +77 -8
  240. package/dist/tx/index.cjs +296 -44
  241. package/dist/tx/index.cjs.map +1 -1
  242. package/dist/tx/index.d.cts +7 -6
  243. package/dist/tx/index.d.ts +7 -6
  244. package/dist/tx/index.js +2 -2
  245. package/dist/{types-Bo7NSXJr.d.ts → types-BoFFiskX.d.ts} +2714 -321
  246. package/dist/{types-Bnb82f5R.d.cts → types-DJG8HG6F.d.cts} +2714 -321
  247. package/dist/{index-CywCC1qZ.d.cts → ulid-BmBgooGm.d.ts} +215 -26
  248. package/dist/{index-8QDuznDr.d.ts → ulid-C7ms9oli.d.cts} +215 -26
  249. package/dist/util/index.cjs.map +1 -1
  250. package/dist/util/index.js +1 -1
  251. package/dist/with-derivation-BKXXa8Vt.d.ts +13 -0
  252. package/dist/with-derivation-BjQ7q4NE.d.cts +13 -0
  253. package/dist/with-guard-C25yNjzd.d.ts +18 -0
  254. package/dist/with-guard-DQme5DKE.d.cts +18 -0
  255. package/dist/with-materialized-view-BbEPFIIJ.d.cts +27 -0
  256. package/dist/with-materialized-view-CqnRwI2S.d.ts +27 -0
  257. package/dist/with-overlayed-view-Ct1fSJt-.d.ts +13 -0
  258. package/dist/with-overlayed-view-bwlmmFjx.d.cts +13 -0
  259. package/package.json +65 -2
  260. package/dist/chunk-2CSJGFCB.js.map +0 -1
  261. package/dist/chunk-ACLDOTNQ.js.map +0 -1
  262. package/dist/chunk-BTDCBVJW.js +0 -160
  263. package/dist/chunk-BTDCBVJW.js.map +0 -1
  264. package/dist/chunk-CIMZBAZB.js.map +0 -1
  265. package/dist/chunk-EXHNQEV4.js +0 -392
  266. package/dist/chunk-EXHNQEV4.js.map +0 -1
  267. package/dist/chunk-GOUT6DND.js.map +0 -1
  268. package/dist/chunk-M5INGEFC.js.map +0 -1
  269. package/dist/chunk-MDDTIZUO.js.map +0 -1
  270. package/dist/chunk-QAVUREFT.js.map +0 -1
  271. package/dist/chunk-RKJ6OL7K.js.map +0 -1
  272. package/dist/chunk-SCZXXXU4.js.map +0 -1
  273. package/dist/chunk-TDR6T5CJ.js.map +0 -1
  274. package/dist/chunk-WDM5XGGS.js.map +0 -1
  275. /package/dist/{chunk-PTVMYYON.js.map → chunk-243PNUA6.js.map} +0 -0
  276. /package/dist/{chunk-MR4424N3.js.map → chunk-2PAQNPE3.js.map} +0 -0
  277. /package/dist/{chunk-AVVPZ4BC.js.map → chunk-3Y53S2SA.js.map} +0 -0
  278. /package/dist/{chunk-ZFKD4QMV.js.map → chunk-7BRE6EUA.js.map} +0 -0
  279. /package/dist/{chunk-USKYUS74.js.map → chunk-MUWOSVEP.js.map} +0 -0
  280. /package/dist/{chunk-4PWAI7Q4.js.map → chunk-NWZ3I6R6.js.map} +0 -0
  281. /package/dist/{chunk-QGZRWRSL.js.map → chunk-QPEXPHJR.js.map} +0 -0
  282. /package/dist/{chunk-R36SIKES.js.map → chunk-QXQRKXCU.js.map} +0 -0
  283. /package/dist/{chunk-M62XNWRA.js.map → chunk-VK5EER6C.js.map} +0 -0
  284. /package/dist/{chunk-NPC4LFV5.js.map → chunk-YMYK7US4.js.map} +0 -0
  285. /package/dist/{crypto-IVKU7YTT.js.map → crypto-5ZDIY3NG.js.map} +0 -0
  286. /package/dist/{delegation-2DBS2EOH.js.map → delegation-QYXZW25W.js.map} +0 -0
  287. /package/dist/{ledger-QZTTHQAQ.js.map → derivations/index.js.map} +0 -0
  288. /package/dist/{public-envelope-6JTACYJV.js.map → executor-AS2IDHKZ.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-Dnu81tsS.cjs';
2
+ import { A as AggregateStrategy, b as AggregateSpec, c as Aggregation, a as AggregateResult, g as GroupedQuery, h as GroupedQueryN } from './strategy-DSTrsZ8t.cjs';
3
3
 
4
4
  /**
5
5
  * All NOYDB error classes — a single import surface for `catch` blocks and
@@ -116,6 +116,26 @@ declare class TamperedError extends NoydbError {
116
116
  declare class InvalidKeyError extends NoydbError {
117
117
  constructor(message?: string);
118
118
  }
119
+ /**
120
+ * Thrown when a keyring's wrapped-DEK set unwraps partially — at least
121
+ * one DEK succeeds (proving the KEK is correct) but at least one fails.
122
+ * The passphrase is right; the failed entries are corrupted.
123
+ *
124
+ * This is distinct from {@link InvalidKeyError} so that
125
+ * `NoydbOptions.onInvalidKey: 'reset'` does NOT fire — resetting on
126
+ * partial corruption would destroy the still-valid DEKs and the data
127
+ * they protect, which is silent data loss in response to a feature
128
+ * designed for stale-credential recovery.
129
+ */
130
+ declare class KeyringCorruptError extends NoydbError {
131
+ readonly failedCollections: readonly string[];
132
+ readonly intactCount: number;
133
+ constructor(opts: {
134
+ failedCollections: readonly string[];
135
+ intactCount: number;
136
+ message?: string;
137
+ });
138
+ }
119
139
  /**
120
140
  * Thrown when the authenticated user does not have a DEK for the requested
121
141
  * collection — i.e. the collection is not in their keyring at all.
@@ -229,7 +249,7 @@ declare class KeyringExpiredError extends NoydbError {
229
249
  }
230
250
  /**
231
251
  * Thrown when an `@noy-db/as-*` import is attempted but the invoking
232
- * keyring lacks the required import-capability bit (issue ).
252
+ * keyring lacks the required import-capability bit.
233
253
  *
234
254
  * - `tier: 'plaintext'` — a plaintext-tier import (`as-csv`, `as-json`,
235
255
  * `as-ndjson`, `as-zip`, …) was attempted but the keyring's
@@ -327,6 +347,64 @@ declare class PeriodClosedError extends NoydbError {
327
347
  readonly recordTs: string;
328
348
  constructor(periodName: string, endDate: string, recordTs: string);
329
349
  }
350
+ /**
351
+ * Thrown when a `put()` or `delete()` is rejected by a guard's `check`
352
+ * function. The `reason` is the message the guard supplied — typically a
353
+ * short business description (e.g. "invoice is issued"). The full
354
+ * collection + id are surfaced so audit UIs can link back to the record.
355
+ */
356
+ declare class RecordLockedError extends NoydbError {
357
+ readonly collection: string;
358
+ readonly id: string;
359
+ readonly reason: string;
360
+ constructor(collection: string, id: string, reason: string);
361
+ }
362
+ /**
363
+ * Thrown when a `put()` changes one or more fields that are frozen by a
364
+ * `frozenFields` guard. The `fields` list contains the specific paths
365
+ * that were detected as changed.
366
+ */
367
+ declare class FieldFrozenError extends NoydbError {
368
+ readonly collection: string;
369
+ readonly id: string;
370
+ readonly fields: readonly string[];
371
+ constructor(collection: string, id: string, fields: readonly string[]);
372
+ }
373
+ /**
374
+ * Thrown by an amendment invariant when the proposed change-set violates
375
+ * the declared business rule (e.g. disbursement total not preserved).
376
+ * Triggers a full transaction rollback via the existing revert pass.
377
+ */
378
+ declare class InvariantError extends NoydbError {
379
+ constructor(message: string);
380
+ }
381
+ /**
382
+ * Thrown at `withTransactions({ amendment: true })` open if the caller's
383
+ * role is not in the guard's allowed amendment roles. Fail-fast: thrown
384
+ * before any writes are attempted.
385
+ */
386
+ declare class AmendmentForbiddenError extends NoydbError {
387
+ readonly userId: string;
388
+ readonly role: string;
389
+ constructor(userId: string, role: string);
390
+ }
391
+ /**
392
+ * Thrown by `listUsersWithEnvelopes` when the vault's user directory
393
+ * has been disabled (via `db.setDirectoryEnabled(vault, false)`) and
394
+ * the caller's role is neither `owner` nor `admin`. Owner/admin can
395
+ * still enumerate users — the toggle is a UX privacy switch, not a
396
+ * security boundary.
397
+ *
398
+ * Honest caveat: this is a UX flag, not a privacy guarantee. The
399
+ * envelope ciphertext is still in the store, the keyring file is
400
+ * still listed at `_keyring/*`, and anyone with direct store read
401
+ * access can count keyrings without going through the hub. See
402
+ * `docs/subsystems/user-envelope.md` → "Directory visibility".
403
+ */
404
+ declare class DirectoryDisabledError extends NoydbError {
405
+ readonly vault: string;
406
+ constructor(vault: string);
407
+ }
330
408
  /**
331
409
  * Thrown when a user tries to act at a tier they are not cleared for.
332
410
  *
@@ -584,6 +662,33 @@ declare class IndexWriteFailureError extends NoydbError {
584
662
  declare class BundleIntegrityError extends NoydbError {
585
663
  constructor(message: string);
586
664
  }
665
+ /**
666
+ * Thrown by `readNoydbBundle` (#197) when the bundle carries
667
+ * sealed per-user passphrases but no supplied `SealingKeyProvider`
668
+ * has a `.id` (= `pid`) matching the sealed entry's `pid`.
669
+ *
670
+ * Carries the failing pid + the user id so the recipient can
671
+ * surface an actionable prompt:
672
+ *
673
+ * ```
674
+ * BundleSealMismatchError: bundle carries sealed passphrase for user "alice"
675
+ * under provider "macos-keychain:com.acme.app/alice@acme.example",
676
+ * but no registered provider matches that pid.
677
+ * ```
678
+ *
679
+ * Three resolution paths the message names (per foundation §11.9.4):
680
+ *
681
+ * 1. Configure a provider matching the pid and retry import.
682
+ * 2. Pass `attemptUnsealAcrossProviders: true` to try each
683
+ * registered provider regardless of pid.
684
+ * 3. Inspect without unsealing — pass no `sealingProviders` to
685
+ * receive the sealed entries unmodified for offline analysis.
686
+ */
687
+ declare class BundleSealMismatchError extends NoydbError {
688
+ readonly userId: string;
689
+ readonly pid: string;
690
+ constructor(userId: string, pid: string);
691
+ }
587
692
  /**
588
693
  * Thrown when `vault.collection()` is called with a name that is
589
694
  * reserved for NOYDB internal use (any name starting with `_dict_`).
@@ -707,6 +812,34 @@ declare class BackupCorruptedError extends NoydbError {
707
812
  readonly id: string;
708
813
  constructor(collection: string, id: string, message: string);
709
814
  }
815
+ /**
816
+ * Thrown by partition-extraction primitives (#198 epic) when the
817
+ * transitive-closure walk fails — e.g. the FK graph is deeper than
818
+ * `maxDepth`, signalling a runaway or unexpectedly cyclic graph.
819
+ */
820
+ declare class PartitionExtractionError extends NoydbError {
821
+ constructor(message: string);
822
+ }
823
+ /**
824
+ * Thrown by `adoptPartition` (#207) when the transfer seal can't be
825
+ * opened — a wrong/short transfer key (AES-GCM auth-tag failure) or a
826
+ * malformed sealed payload.
827
+ */
828
+ declare class TransferSealError extends NoydbError {
829
+ constructor(message: string);
830
+ }
831
+ /**
832
+ * Thrown when an adoption-lifecycle precondition fails — re-adopting a
833
+ * partition already consumed in this store (#207), or owner-creation on a
834
+ * vault that isn't in the adopted-unowned state (#208).
835
+ */
836
+ declare class AdoptionStateError extends NoydbError {
837
+ constructor(message: string);
838
+ }
839
+ /** Document-attestation failures: undeclared field-schema, non-owner issue, missing field, signer failure. */
840
+ declare class AttestationError extends NoydbError {
841
+ constructor(message: string);
842
+ }
710
843
  /**
711
844
  * Thrown by `resolveSession()` when the session token's `expiresAt`
712
845
  * timestamp is in the past. The session key is also removed from the
@@ -830,6 +963,156 @@ declare class PathEscapeError extends NoydbError {
830
963
  targetDir: string;
831
964
  });
832
965
  }
966
+ /**
967
+ * Thrown at vault open if the derivation graph contains a cycle.
968
+ * `path` is the offending chain (e.g. `['a', 'b', 'c', 'a']`).
969
+ */
970
+ declare class DerivationCycleError extends NoydbError {
971
+ readonly path: readonly string[];
972
+ constructor(path: readonly string[]);
973
+ }
974
+ /**
975
+ * Thrown when a cascade of source → output → source → … exceeds the
976
+ * configured `maxDepth` (default 5).
977
+ */
978
+ declare class DerivationDepthError extends NoydbError {
979
+ readonly limit: number;
980
+ readonly attempted: number;
981
+ constructor(limit: number, attempted: number);
982
+ }
983
+ /**
984
+ * Thrown at registration if a `withDerivation` strategy references an
985
+ * output `collection` that isn't otherwise declared (no schema, no use
986
+ * elsewhere). Surfacing this early catches typos in collection names.
987
+ */
988
+ declare class DerivationOutputUnknownError extends NoydbError {
989
+ readonly collection: string;
990
+ constructor(collection: string);
991
+ }
992
+ /**
993
+ * Thrown when the user's `derive` function returns a value that doesn't
994
+ * match the declared output spec (e.g. wrong shape, wrong key set).
995
+ */
996
+ declare class DerivationOutputShapeError extends NoydbError {
997
+ readonly outputKey: string;
998
+ constructor(outputKey: string, detail: string);
999
+ }
1000
+ /**
1001
+ * Thrown by array-shape derivations (#200) when the `derive` function
1002
+ * returns more rows than the output's `maxFanout` cap. The cap exists
1003
+ * to keep dispatch cost bounded — without it a single source-row
1004
+ * update could fan out to thousands of derived rows, dominating the
1005
+ * write path.
1006
+ *
1007
+ * Defaults to `maxFanout: 64`. Raise on the output spec for
1008
+ * carry-forward expansion cases (e.g. monthly rows across multi-year
1009
+ * contracts).
1010
+ */
1011
+ declare class DerivationCapExceededError extends NoydbError {
1012
+ readonly outputKey: string;
1013
+ readonly returned: number;
1014
+ readonly maxFanout: number;
1015
+ constructor(outputKey: string, returned: number, maxFanout: number);
1016
+ }
1017
+ /**
1018
+ * Thrown at vault open if the materialized-view graph contains a
1019
+ * cycle. `path` is the offending chain (e.g. `['a-mv', 'b-mv', 'a-mv']`).
1020
+ * Detected by the same shared DFS that catches `DerivationCycleError`;
1021
+ * surfaces with a distinct error type so consumers can disambiguate.
1022
+ */
1023
+ declare class MaterializedViewCycleError extends NoydbError {
1024
+ readonly path: readonly string[];
1025
+ constructor(path: readonly string[]);
1026
+ }
1027
+ /**
1028
+ * Thrown at MV registration if the query references a source
1029
+ * collection that isn't declared on the vault. Surfacing this early
1030
+ * catches typos in collection names.
1031
+ */
1032
+ declare class MaterializedViewSourceUnknownError extends NoydbError {
1033
+ readonly mvName: string;
1034
+ readonly collection: string;
1035
+ constructor(mvName: string, collection: string);
1036
+ }
1037
+ /**
1038
+ * Thrown by the MV executor when a refresh produces more rows than
1039
+ * the configured ceiling. Default ceiling is 100k rows; override
1040
+ * per-MV via `maxRows`. Mirrors `JoinTooLargeError` /
1041
+ * `GroupCardinalityError` from the query DSL — the explosion is
1042
+ * detected BEFORE writes hit the store, so the source-write
1043
+ * transaction can roll back cleanly via strict-mode.
1044
+ */
1045
+ declare class MaterializedViewTooLargeError extends NoydbError {
1046
+ readonly mvName: string;
1047
+ readonly expected: number;
1048
+ readonly limit: number;
1049
+ constructor(mvName: string, expected: number, limit: number);
1050
+ }
1051
+ /**
1052
+ * Thrown by `withMaterializedView()` at registration time when the
1053
+ * strategy is structurally malformed. Distinct from
1054
+ * `MaterializedViewSourceUnknownError` (the source list is well-formed
1055
+ * but names a collection the vault doesn't know) and
1056
+ * `MaterializedViewCycleError` (the source graph has a cycle): this
1057
+ * error fires before either check, at the moment the spec is being
1058
+ * normalized.
1059
+ *
1060
+ * Today the trigger cases are all about the `query` / `unionSources`
1061
+ * dichotomy introduced by #165:
1062
+ * - both `query` and `unionSources` were set (mutually exclusive),
1063
+ * - neither `query` nor `unionSources` was set,
1064
+ * - `unionSources` has fewer than 2 arms,
1065
+ * - two arms in `unionSources` reference the same `collection`.
1066
+ *
1067
+ * The error message is prefixed with `[noy-db] withMaterializedView:`
1068
+ * so it's grep-friendly in logs and looks consistent with the existing
1069
+ * `ValidationError` messages from the same factory.
1070
+ */
1071
+ declare class MaterializedViewConfigError extends NoydbError {
1072
+ constructor(message: string);
1073
+ }
1074
+ /**
1075
+ * Thrown at vault open when a `withOverlayedView` declaration uses
1076
+ * another virtual-overlay name as its `base`. Multi-overlay stacking
1077
+ * is a v2 non-goal — the shallow expansion in
1078
+ * `QueryDependencyAnalyzer` would truncate at the inner overlay
1079
+ * name, leaving downstream MVs silently stale.
1080
+ */
1081
+ declare class OverlayBaseIsVirtualError extends NoydbError {
1082
+ readonly overlayName: string;
1083
+ readonly base: string;
1084
+ constructor(overlayName: string, base: string);
1085
+ }
1086
+ /**
1087
+ * Thrown at vault open when a `withOverlayedView`'s `overlay`
1088
+ * references an unknown collection or an MV-owned collection. The
1089
+ * overlay collection is user-writable; MV-owned collections aren't.
1090
+ */
1091
+ declare class OverlayCollectionUnavailableError extends NoydbError {
1092
+ readonly overlayName: string;
1093
+ readonly overlay: string;
1094
+ constructor(overlayName: string, overlay: string);
1095
+ }
1096
+ /**
1097
+ * Thrown at vault open when a `withOverlayedView`'s virtual `name`
1098
+ * collides with an MV output or a concrete source collection.
1099
+ */
1100
+ declare class OverlayNameCollisionError extends NoydbError {
1101
+ readonly overlayName: string;
1102
+ constructor(overlayName: string);
1103
+ }
1104
+ /**
1105
+ * Thrown by the virtual overlay's `put(id, record)` when the
1106
+ * consumer-supplied `id` doesn't match `rowKey(record)`. Catches
1107
+ * fat-finger separator typos that would otherwise silently produce
1108
+ * orphaned overlay rows. Direct writes to the underlying overlay
1109
+ * collection (bypass the virtual layer) skip this validation.
1110
+ */
1111
+ declare class OverlayIdMismatchError extends NoydbError {
1112
+ readonly actual: string;
1113
+ readonly expected: string;
1114
+ constructor(actual: string, expected: string);
1115
+ }
833
1116
 
834
1117
  /**
835
1118
  * Foreign-key references — the soft-FK mechanism.
@@ -1361,12 +1644,54 @@ interface QuerySource<T> {
1361
1644
  * joinContext, and calling `.join()` on it throws with an actionable
1362
1645
  * error. See `query/join.ts` for the full design.
1363
1646
  */
1647
+ /**
1648
+ * Declared deterministic predicate (#153). Carries the consumer's
1649
+ * stable `hash` (for function-body identity), the function itself,
1650
+ * and is keyed by name when registered on a `Query<T>` via
1651
+ * `_withPredicates()`.
1652
+ */
1653
+ interface DeclaredPredicate {
1654
+ hash: string;
1655
+ fn: (record: unknown, ctx?: unknown) => boolean;
1656
+ }
1364
1657
  declare class Query<T> {
1365
1658
  private readonly source;
1366
1659
  private readonly plan;
1367
1660
  private readonly joinContext;
1368
1661
  private readonly aggregateStrategy;
1369
- constructor(source: QuerySource<T>, plan?: QueryPlan, joinContext?: JoinContext, aggregateStrategy?: AggregateStrategy);
1662
+ private readonly predicates;
1663
+ constructor(source: QuerySource<T>, plan?: QueryPlan, joinContext?: JoinContext, aggregateStrategy?: AggregateStrategy, predicates?: ReadonlyMap<string, DeclaredPredicate>);
1664
+ /**
1665
+ * @internal — accessor for the materialized-view dependency
1666
+ * analyzer. Not part of the public API; consumers should use the
1667
+ * builder methods, not inspect the plan directly.
1668
+ */
1669
+ _plan(): QueryPlan;
1670
+ /**
1671
+ * @internal — accessor for the materialized-view dependency
1672
+ * analyzer. Returns the join resolution context (or `undefined` for
1673
+ * queries constructed without a Collection backing).
1674
+ */
1675
+ _joinContext(): JoinContext | undefined;
1676
+ /**
1677
+ * @internal — clone this Query with a declared-predicate map
1678
+ * attached. Used by the materialized-view registry to enable
1679
+ * `.wherePredicate(name, ctx?)` for the MV's query callback (#153).
1680
+ * Consumers don't call this directly.
1681
+ */
1682
+ _withPredicates(predicates: ReadonlyMap<string, DeclaredPredicate>): Query<T>;
1683
+ /**
1684
+ * Filter by a registered deterministic predicate (#153). Requires
1685
+ * the Query to have been augmented with a predicates map (typically
1686
+ * via the materialized-view registry — bare Queries constructed
1687
+ * outside an MV throw on `.wherePredicate()`).
1688
+ *
1689
+ * `ctx` is an optional opaque value passed verbatim to the predicate
1690
+ * function. Both `predicateHash` (from the registration) and a
1691
+ * canonical-JSON hash of `ctx` fold into the MV's `queryHash`, so
1692
+ * either changing forces refresh on next visit.
1693
+ */
1694
+ wherePredicate(name: string, ctx?: unknown): Query<T>;
1370
1695
  /** Add a field comparison. Multiple where() calls are AND-combined. */
1371
1696
  where(field: string, op: Operator, value: unknown): Query<T>;
1372
1697
  /**
@@ -1558,6 +1883,7 @@ declare class Query<T> {
1558
1883
  * per record and can't be index-accelerated.
1559
1884
  */
1560
1885
  groupBy<F extends string>(field: F): GroupedQuery<T, F>;
1886
+ groupBy<F extends readonly [string, string, ...string[]]>(...fields: F): GroupedQueryN<T, F>;
1561
1887
  /**
1562
1888
  * Re-run the query whenever the source notifies of changes.
1563
1889
  * Returns an unsubscribe function. The callback receives the latest result.
@@ -1937,4 +2263,4 @@ declare class ScanBuilder<T> implements AsyncIterable<T> {
1937
2263
  private recordMatches;
1938
2264
  }
1939
2265
 
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 };
2266
+ export { type JoinLeg as $, AmendmentForbiddenError as A, BackupCorruptedError as B, ConflictError as C, DictKeyInUseError as D, DecryptionError as E, FieldFrozenError as F, DelegationTargetMissingError as G, DirectoryDisabledError as H, InvariantError as I, ElevationExpiredError as J, ExportCapabilityError as K, LocaleNotSpecifiedError as L, MissingTranslationError as M, NoydbError as N, OverlayBaseIsVirtualError as O, PartitionExtractionError as P, Query as Q, ReservedCollectionNameError as R, SessionExpiredError as S, TranslatorNotConfiguredError as T, FilenameSanitizationError as U, GroupCardinalityError as V, ImportCapabilityError as W, IndexRequiredError as X, IndexWriteFailureError as Y, InvalidKeyError as Z, type JoinContext as _, DictKeyMissingError as a, type JoinStrategy as a0, JoinTooLargeError as a1, type JoinableSource as a2, KeyringCorruptError as a3, KeyringExpiredError as a4, LedgerContentionError as a5, type LiveQuery as a6, type LiveUpstream as a7, NetworkError as a8, NoAccessError as a9, buildLiveQuery as aA, executePlan as aB, ref as aC, resetJoinWarnings as aD, NotFoundError as aa, type OrderBy as ab, PathEscapeError as ac, PeriodClosedError as ad, PermissionDeniedError as ae, PrivilegeEscalationError as af, type QueryPlan as ag, type QuerySource as ah, ReadOnlyAtInstantError as ai, ReadOnlyError as aj, ReadOnlyFrameError as ak, type RefDescriptor as al, RefIntegrityError as am, type RefMode as an, RefRegistry as ao, RefScopeError as ap, type RefViolation as aq, ScanBuilder as ar, type ScanPageProvider as as, SchemaValidationError as at, StoreCapabilityError as au, TamperedError as av, TierDemoteDeniedError as aw, TierNotGrantedError as ax, ValidationError as ay, applyJoins as az, SessionNotFoundError as b, SessionPolicyError as c, RecordLockedError as d, DerivationCapExceededError as e, DerivationCycleError as f, DerivationDepthError as g, DerivationOutputShapeError as h, DerivationOutputUnknownError as i, OverlayCollectionUnavailableError as j, OverlayIdMismatchError as k, OverlayNameCollisionError as l, AttestationError as m, AdoptionStateError as n, BackupLedgerError as o, BundleIntegrityError as p, BundleSealMismatchError as q, BundleVersionConflictError as r, TransferSealError as s, MaterializedViewConfigError as t, MaterializedViewCycleError as u, MaterializedViewSourceUnknownError as v, MaterializedViewTooLargeError as w, AlreadyElevatedError as x, DEFAULT_JOIN_MAX_ROWS as y, DanglingReferenceError as z };