@noy-db/hub 0.3.0-pre.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (955) hide show
  1. package/dist/aggregate/index.js +9 -8
  2. package/dist/aggregate/index.js.map +1 -1
  3. package/dist/api-ZGS6LCOF.js +20 -0
  4. package/dist/as/index.js +11 -11
  5. package/dist/attestation/index.js +18 -18
  6. package/dist/backup-BJ57IKAO.js +242 -0
  7. package/dist/backup-BJ57IKAO.js.map +1 -0
  8. package/dist/blobs/index.js +13 -11
  9. package/dist/blobs/index.js.map +1 -1
  10. package/dist/broker/index.js +92 -0
  11. package/dist/broker/index.js.map +1 -0
  12. package/dist/bundle/index.js +25 -22
  13. package/dist/bundle/index.js.map +1 -1
  14. package/dist/by/index.js +2 -2
  15. package/dist/cargo/index.js +31 -31
  16. package/dist/chunk-2NVOWNI3.js +167 -0
  17. package/dist/chunk-2NVOWNI3.js.map +1 -0
  18. package/dist/chunk-3B5VVCNY.js +71 -0
  19. package/dist/chunk-3LQ2YKO4.js +230 -0
  20. package/dist/chunk-3QCRBHCY.js +54 -0
  21. package/dist/chunk-454JXE57.js +1697 -0
  22. package/dist/chunk-454JXE57.js.map +1 -0
  23. package/dist/chunk-4CTHCN4J.js +480 -0
  24. package/dist/chunk-4CTHCN4J.js.map +1 -0
  25. package/dist/chunk-4GPE63GU.js +111 -0
  26. package/dist/chunk-4GPE63GU.js.map +1 -0
  27. package/dist/chunk-4JBYV75E.js +150 -0
  28. package/dist/chunk-4NXKCLLQ.js +97 -0
  29. package/dist/chunk-4VNQOLML.js +29 -0
  30. package/dist/chunk-4VNQOLML.js.map +1 -0
  31. package/dist/chunk-5M5DVGV7.js +69 -0
  32. package/dist/chunk-5O3XF4DV.js +150 -0
  33. package/dist/chunk-5O3XF4DV.js.map +1 -0
  34. package/dist/chunk-5YOLBEQ6.js +30 -0
  35. package/dist/chunk-6CRIV7DE.js +129 -0
  36. package/dist/chunk-6JTIAGHD.js +621 -0
  37. package/dist/chunk-6JTIAGHD.js.map +1 -0
  38. package/dist/chunk-6QTNZJBS.js +255 -0
  39. package/dist/chunk-6T2SCQRU.js +86 -0
  40. package/dist/chunk-7DSTRQIJ.js +45 -0
  41. package/dist/chunk-AUSTCW2X.js +589 -0
  42. package/dist/chunk-B3HJYUOF.js +209 -0
  43. package/dist/chunk-BDVFPG6Y.js +164 -0
  44. package/dist/chunk-BIOUI4HL.js +1554 -0
  45. package/dist/chunk-BIOUI4HL.js.map +1 -0
  46. package/dist/chunk-CAF6WOK7.js +36 -0
  47. package/dist/chunk-CDUQTA3Z.js +381 -0
  48. package/dist/chunk-CDUQTA3Z.js.map +1 -0
  49. package/dist/chunk-CIE2BASH.js +404 -0
  50. package/dist/chunk-CRI4OUV4.js +42 -0
  51. package/dist/chunk-DLG74CNB.js +91 -0
  52. package/dist/chunk-E5ZQT5KX.js +30 -0
  53. package/dist/chunk-E5ZQT5KX.js.map +1 -0
  54. package/dist/chunk-EQO2UVP4.js +247 -0
  55. package/dist/chunk-EQO2UVP4.js.map +1 -0
  56. package/dist/chunk-ERJ7FU55.js +367 -0
  57. package/dist/chunk-EVVGJDRQ.js +205 -0
  58. package/dist/chunk-EVX47VBM.js +74 -0
  59. package/dist/chunk-EVX47VBM.js.map +1 -0
  60. package/dist/chunk-EXK7QRWF.js +59 -0
  61. package/dist/chunk-EYZ6IQ6X.js +202 -0
  62. package/dist/chunk-F64IRYG3.js +45 -0
  63. package/dist/chunk-FHS2HQSH.js +823 -0
  64. package/dist/chunk-FM3G3NOY.js +206 -0
  65. package/dist/chunk-FM3G3NOY.js.map +1 -0
  66. package/dist/chunk-FUG4SFN3.js +36 -0
  67. package/dist/chunk-FUG4SFN3.js.map +1 -0
  68. package/dist/chunk-GKEWXIV5.js +80 -0
  69. package/dist/chunk-GTGPO5KW.js +59 -0
  70. package/dist/chunk-HB3RFQSC.js +95 -0
  71. package/dist/chunk-HDMEGAQE.js +957 -0
  72. package/dist/chunk-HDMEGAQE.js.map +1 -0
  73. package/dist/chunk-HDQIIUPH.js +135 -0
  74. package/dist/chunk-HDQIIUPH.js.map +1 -0
  75. package/dist/chunk-HTJQYHZP.js +344 -0
  76. package/dist/chunk-HTJQYHZP.js.map +1 -0
  77. package/dist/chunk-I6GALP6E.js +99 -0
  78. package/dist/chunk-IGJCYUT5.js +99 -0
  79. package/dist/chunk-IGJCYUT5.js.map +1 -0
  80. package/dist/chunk-IL6POWCW.js +130 -0
  81. package/dist/chunk-IU6SNYX6.js +117 -0
  82. package/dist/chunk-J2ZX2XUV.js +778 -0
  83. package/dist/chunk-JIF24JPM.js +495 -0
  84. package/dist/chunk-JIF24JPM.js.map +1 -0
  85. package/dist/chunk-JK733I5V.js +23 -0
  86. package/dist/chunk-JK733I5V.js.map +1 -0
  87. package/dist/chunk-JKJOGPZN.js +29 -0
  88. package/dist/chunk-JNAI2HN2.js +32 -0
  89. package/dist/chunk-JNAI2HN2.js.map +1 -0
  90. package/dist/chunk-JZUV47FZ.js +41 -0
  91. package/dist/chunk-K5IMOGHB.js +30 -0
  92. package/dist/chunk-KPZS5QAQ.js +151 -0
  93. package/dist/chunk-KPZS5QAQ.js.map +1 -0
  94. package/dist/chunk-KSKBRKGJ.js +291 -0
  95. package/dist/chunk-KSKBRKGJ.js.map +1 -0
  96. package/dist/chunk-LASZKVMO.js +382 -0
  97. package/dist/chunk-LXEXBTKL.js +515 -0
  98. package/dist/chunk-LXEXBTKL.js.map +1 -0
  99. package/dist/chunk-M4CV6BRT.js +524 -0
  100. package/dist/chunk-M4CV6BRT.js.map +1 -0
  101. package/dist/chunk-MEFJPTZ4.js +371 -0
  102. package/dist/chunk-MEFJPTZ4.js.map +1 -0
  103. package/dist/chunk-MV43JSJF.js +265 -0
  104. package/dist/chunk-MV43JSJF.js.map +1 -0
  105. package/dist/chunk-NJ4EOKMB.js +392 -0
  106. package/dist/chunk-NJ4EOKMB.js.map +1 -0
  107. package/dist/chunk-NR5LT5RY.js +135 -0
  108. package/dist/chunk-NWSGI5C7.js +261 -0
  109. package/dist/chunk-NWSGI5C7.js.map +1 -0
  110. package/dist/chunk-OSDB5WW3.js +739 -0
  111. package/dist/chunk-OSDB5WW3.js.map +1 -0
  112. package/dist/chunk-PN2XMATY.js +37 -0
  113. package/dist/chunk-PN2XMATY.js.map +1 -0
  114. package/dist/chunk-Q5VNKNE5.js +70 -0
  115. package/dist/chunk-QLWMEXCT.js +21 -0
  116. package/dist/chunk-QRB7NAOJ.js +123 -0
  117. package/dist/chunk-R4ROFEYC.js +74 -0
  118. package/dist/chunk-RCVJZMFE.js +164 -0
  119. package/dist/chunk-RCVJZMFE.js.map +1 -0
  120. package/dist/chunk-RIX4V2TB.js +367 -0
  121. package/dist/chunk-RYCTDFUX.js +40 -0
  122. package/dist/chunk-RZ5SVOYR.js +155 -0
  123. package/dist/chunk-SLFHQTTW.js +99 -0
  124. package/dist/chunk-SNZ6URZZ.js +2782 -0
  125. package/dist/chunk-SNZ6URZZ.js.map +1 -0
  126. package/dist/chunk-T2FFWNPK.js +75 -0
  127. package/dist/chunk-T2FFWNPK.js.map +1 -0
  128. package/dist/chunk-UNFPPVNI.js +23 -0
  129. package/dist/chunk-VFUPHI2Z.js +333 -0
  130. package/dist/chunk-VFUPHI2Z.js.map +1 -0
  131. package/dist/chunk-VLFCJYTL.js +235 -0
  132. package/dist/chunk-VN3DBQAU.js +124 -0
  133. package/dist/chunk-VYYM3MEN.js +98 -0
  134. package/dist/chunk-VYYM3MEN.js.map +1 -0
  135. package/dist/chunk-VZRODIM3.js +49 -0
  136. package/dist/chunk-W22IKJE2.js +94 -0
  137. package/dist/chunk-X3YYQWOQ.js +155 -0
  138. package/dist/chunk-X7QBD67R.js +14405 -0
  139. package/dist/chunk-X7QBD67R.js.map +1 -0
  140. package/dist/chunk-XDYREZWE.js +1128 -0
  141. package/dist/chunk-XDYREZWE.js.map +1 -0
  142. package/dist/chunk-XWZVFISC.js +720 -0
  143. package/dist/chunk-XWZVFISC.js.map +1 -0
  144. package/dist/chunk-YFXZEAYK.js +85 -0
  145. package/dist/chunk-ZAJAVEXY.js +50 -0
  146. package/dist/chunk-ZICD77GM.js +34 -0
  147. package/dist/chunk-ZJ2AK4V7.js +38 -0
  148. package/dist/chunk-ZJ2AK4V7.js.map +1 -0
  149. package/dist/chunk-ZUODRVHY.js +14 -0
  150. package/dist/classified/index.js +5 -3
  151. package/dist/classified-marker-CZKA6ITE.js +28 -0
  152. package/dist/classified-marker-CZKA6ITE.js.map +1 -0
  153. package/dist/collection-facade-TLWIPI76.js +44 -0
  154. package/dist/computed-ZIQTYTDI.js +11 -0
  155. package/dist/consent/index.js +9 -9
  156. package/dist/crdt/index.js +1 -1
  157. package/dist/dead-filter-ESOBZZP5.js +28 -0
  158. package/dist/delegation-W7ZV2322.js +25 -0
  159. package/dist/derivations/index.js +12 -11
  160. package/dist/derive-H2BJTLUI.js +21 -0
  161. package/dist/enclave-AP3I5W7O.js +141 -0
  162. package/dist/executor-KGWTNEQD.js +9 -0
  163. package/dist/executor-OVEXR6RT.js +9 -0
  164. package/dist/executor-UNEH5ZYH.js +25 -0
  165. package/dist/export-accessible-PCMXSUZS.js +23 -0
  166. package/dist/extract-partition-SWHFSYJO.js +38 -0
  167. package/dist/fanout-sidecar-A765THMX.js +74 -0
  168. package/dist/find-N6345CNT.js +11 -0
  169. package/dist/forget/index.js +10 -10
  170. package/dist/forget/index.js.map +1 -1
  171. package/dist/guards/index.js +6 -6
  172. package/dist/history/index.js +14 -11
  173. package/dist/history/index.js.map +1 -1
  174. package/dist/i18n/index.js +50 -37
  175. package/dist/i18n/index.js.map +1 -1
  176. package/dist/index.d.ts +307 -1459
  177. package/dist/index.js +595 -198
  178. package/dist/index.js.map +1 -1
  179. package/dist/indexing/index.js +7 -7
  180. package/dist/indexing/index.js.map +1 -1
  181. package/dist/issue-5OKB6I2R.js +19 -0
  182. package/dist/kernel/best-effort-revert.d.ts +52 -0
  183. package/dist/kernel/cache/index.d.ts +10 -0
  184. package/dist/kernel/cache/lru.d.ts +97 -0
  185. package/dist/kernel/cache/policy.d.ts +32 -0
  186. package/dist/kernel/collection-config.d.ts +809 -0
  187. package/dist/kernel/collection.d.ts +1522 -0
  188. package/dist/kernel/constants.d.ts +18 -0
  189. package/dist/kernel/debug.d.ts +25 -0
  190. package/dist/kernel/enclave/broker/proof.d.ts +154 -0
  191. package/dist/kernel/enclave/classify/bidx.d.ts +77 -0
  192. package/dist/kernel/enclave/classify/compare.d.ts +10 -0
  193. package/dist/kernel/enclave/classify/digest.d.ts +8 -0
  194. package/dist/kernel/enclave/classify/find.d.ts +36 -0
  195. package/dist/kernel/enclave/classify/kofn.d.ts +7 -0
  196. package/dist/kernel/enclave/classify/normalize.d.ts +7 -0
  197. package/dist/kernel/enclave/classify/reveal.d.ts +10 -0
  198. package/dist/kernel/enclave/classify/vdig.d.ts +39 -0
  199. package/dist/kernel/enclave/classify/verify.d.ts +36 -0
  200. package/dist/kernel/enclave/classify/write.d.ts +8 -0
  201. package/dist/kernel/enclave/crypto.d.ts +263 -0
  202. package/dist/kernel/enclave/index.d.ts +79 -0
  203. package/dist/kernel/enclave/record-keys/deterministic.d.ts +55 -0
  204. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +79 -0
  205. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +107 -0
  206. package/dist/kernel/enclave/record-keys/record-codec.d.ts +328 -0
  207. package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +14 -0
  208. package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +123 -0
  209. package/dist/kernel/enclave/record-keys/sealing.d.ts +70 -0
  210. package/dist/kernel/enclave/record-keys/tombstone.d.ts +57 -0
  211. package/dist/kernel/env-check.d.ts +1 -0
  212. package/dist/kernel/errors.d.ts +1922 -0
  213. package/dist/kernel/events.d.ts +11 -0
  214. package/dist/kernel/lazy-count.d.ts +13 -0
  215. package/dist/kernel/memory-store.d.ts +17 -0
  216. package/dist/kernel/mutation.d.ts +14 -0
  217. package/dist/kernel/noydb.d.ts +826 -0
  218. package/dist/kernel/paths.d.ts +25 -0
  219. package/dist/kernel/query/builder.d.ts +520 -0
  220. package/dist/kernel/query/index.d.ts +31 -0
  221. package/dist/kernel/query/join.d.ts +205 -0
  222. package/dist/kernel/query/live.d.ts +111 -0
  223. package/dist/kernel/query/predicate.d.ts +139 -0
  224. package/dist/kernel/query/scan-builder.d.ts +334 -0
  225. package/dist/kernel/refs.d.ts +205 -0
  226. package/dist/kernel/schema.d.ts +134 -0
  227. package/dist/kernel/sync-policy.d.ts +188 -0
  228. package/dist/kernel/tier-visibility.d.ts +54 -0
  229. package/dist/kernel/types.d.ts +3239 -0
  230. package/dist/kernel/util/discriminant.d.ts +58 -0
  231. package/dist/kernel/util/index.d.ts +14 -0
  232. package/dist/kernel/util/sanitize-filename.d.ts +75 -0
  233. package/dist/kernel/validation.d.ts +130 -0
  234. package/dist/kernel/vault.d.ts +1740 -0
  235. package/dist/kernel/via/compose.d.ts +144 -0
  236. package/dist/kernel/via/dispatch.d.ts +195 -0
  237. package/dist/kernel/via/graph-wiring.d.ts +145 -0
  238. package/dist/kernel/via/graph.d.ts +166 -0
  239. package/dist/kernel/via/index.d.ts +200 -0
  240. package/dist/kernel/via/pipeline.d.ts +266 -0
  241. package/dist/kernel/via/reconcile.d.ts +153 -0
  242. package/dist/kernel/via/taint-binding.d.ts +66 -0
  243. package/dist/kernel/write-queue.d.ts +46 -0
  244. package/dist/ledger-GFBKVPV4.js +42 -0
  245. package/dist/legacy/bundle.d.ts +30 -0
  246. package/dist/legacy/kernel.d.ts +33 -0
  247. package/dist/liberate-3VDOT4KO.js +24 -0
  248. package/dist/link-set-Z7Q2ASFX.js +31 -0
  249. package/dist/materialized-views/index.js +19 -15
  250. package/dist/noydb-ZCJOYBDI.js +68 -0
  251. package/dist/on/index.js +9 -9
  252. package/dist/overlay-views/index.js +4 -4
  253. package/dist/periods/index.js +12 -12
  254. package/dist/pod/index.js +11 -11
  255. package/dist/policy-Z3RUAIY2.js +41 -0
  256. package/dist/port/as/index.d.ts +26 -0
  257. package/dist/port/at/index.d.ts +18 -0
  258. package/dist/port/by/default-provider.d.ts +9 -0
  259. package/dist/port/by/index.d.ts +17 -0
  260. package/dist/port/by/types.d.ts +86 -0
  261. package/dist/port/in/index.d.ts +21 -0
  262. package/dist/port/on/index.d.ts +27 -0
  263. package/dist/port/to/index.d.ts +19 -0
  264. package/dist/port/ui/index.d.ts +21 -0
  265. package/dist/port/with/blob-strategy.d.ts +98 -0
  266. package/dist/port/with/broker-strategy.d.ts +84 -0
  267. package/dist/port/with/capabilities.d.ts +31 -0
  268. package/dist/port/with/classified-marker.d.ts +9 -0
  269. package/dist/port/with/classified-strategy.d.ts +62 -0
  270. package/dist/port/with/computed-strategy.d.ts +19 -0
  271. package/dist/port/with/i18n-strategy.d.ts +175 -0
  272. package/dist/port/with/index.d.ts +18 -0
  273. package/dist/port/with/lazy-strategy.d.ts +48 -0
  274. package/dist/port/with/lookup-strategy.d.ts +129 -0
  275. package/dist/port/with/service-bus.d.ts +156 -0
  276. package/dist/port/with/team-strategy.d.ts +36 -0
  277. package/dist/port/with/write-hooks.d.ts +34 -0
  278. package/dist/portability/index.js +8 -8
  279. package/dist/post-register-JTH76BLY.js +60 -0
  280. package/dist/post-register-JTH76BLY.js.map +1 -0
  281. package/dist/public-envelope-B4KNWVUA.js +32 -0
  282. package/dist/purge-scope-FGNNLWHD.js +24 -0
  283. package/dist/purge-scope-FGNNLWHD.js.map +1 -0
  284. package/dist/query/index.js +9 -6
  285. package/dist/read-only-facade-CHCKSEPD.js +8 -0
  286. package/dist/register-VAHONCID.js +23 -0
  287. package/dist/registry-7MLVD3VO.js +19 -0
  288. package/dist/registry-EPKPD5SM.js +18 -0
  289. package/dist/registry-P5T7PS2U.js +9 -0
  290. package/dist/request-withdrawal-TI3A5WPS.js +31 -0
  291. package/dist/reveal-DIBHLUZX.js +38 -0
  292. package/dist/reveal-DIBHLUZX.js.map +1 -0
  293. package/dist/revoke-FDRD6GRW.js +24 -0
  294. package/dist/satellites/index.js +1 -1
  295. package/dist/sealed-record/index.js +12 -12
  296. package/dist/seed-Q6M2IZFL.js +231 -0
  297. package/dist/seed-Q6M2IZFL.js.map +1 -0
  298. package/dist/session/index.js +9 -9
  299. package/dist/shadow/index.js +2 -2
  300. package/dist/signer-MUWEIUI6.js +25 -0
  301. package/dist/snapshots/index.js +10 -10
  302. package/dist/stale-OSQ7J3AA.js +29 -0
  303. package/dist/storage-MVFCGEQE.js +23 -0
  304. package/dist/store-coordination-provider-64OEZFGS.js +142 -0
  305. package/dist/sync/index.js +9 -9
  306. package/dist/team/index.js +15 -15
  307. package/dist/tiers/index.js +14 -10
  308. package/dist/to/index.js +1 -2
  309. package/dist/tx/index.js +3 -3
  310. package/dist/util/index.js +1 -1
  311. package/dist/verify-ZASTRNPR.js +140 -0
  312. package/dist/verify-ZASTRNPR.js.map +1 -0
  313. package/dist/via/blob/active.d.ts +34 -0
  314. package/dist/via/blob/binding.d.ts +86 -0
  315. package/dist/via/blob/index.d.ts +34 -0
  316. package/dist/via/classified/active.d.ts +3 -0
  317. package/dist/via/classified/binding.d.ts +83 -0
  318. package/dist/via/classified/config-drift.d.ts +34 -0
  319. package/dist/via/classified/descriptor.d.ts +66 -0
  320. package/dist/via/classified/errors.d.ts +19 -0
  321. package/dist/via/classified/guards.d.ts +23 -0
  322. package/dist/via/classified/index.d.ts +11 -0
  323. package/dist/via/classified/presets.d.ts +65 -0
  324. package/dist/via/classified/resolve.d.ts +9 -0
  325. package/dist/via/classified/strategy.d.ts +11 -0
  326. package/dist/via/classified/validators.d.ts +3 -0
  327. package/dist/via/classified/write.d.ts +4 -0
  328. package/dist/via/computed/binding.d.ts +34 -0
  329. package/dist/via/computed/descriptor.d.ts +35 -0
  330. package/dist/via/i18n/active.d.ts +28 -0
  331. package/dist/via/i18n/binding.d.ts +36 -0
  332. package/dist/via/i18n/core.d.ts +267 -0
  333. package/dist/via/i18n/densify.d.ts +24 -0
  334. package/dist/via/i18n/dictionary.d.ts +200 -0
  335. package/dist/via/i18n/index.d.ts +21 -0
  336. package/dist/via/i18n/policy.d.ts +44 -0
  337. package/dist/via/i18n/script.d.ts +26 -0
  338. package/dist/via/i18n/strategy.d.ts +13 -0
  339. package/dist/via/lookup/active.d.ts +19 -0
  340. package/dist/via/lookup/binding.d.ts +99 -0
  341. package/dist/via/lookup/descriptor.d.ts +123 -0
  342. package/dist/via/lookup/handle.d.ts +220 -0
  343. package/dist/via/lookup/index.d.ts +17 -0
  344. package/dist/via/lookup/registry.d.ts +228 -0
  345. package/dist/via/lookup/snapshot.d.ts +67 -0
  346. package/dist/via/money/arith.d.ts +68 -0
  347. package/dist/via/money/binding.d.ts +21 -0
  348. package/dist/via/money/branded.d.ts +61 -0
  349. package/dist/via/money/descriptor.d.ts +73 -0
  350. package/dist/via/money/fixed-point.d.ts +51 -0
  351. package/dist/via/money/index.d.ts +15 -0
  352. package/dist/via/money/iso4217.d.ts +6 -0
  353. package/dist/via/money/money-reducer.d.ts +33 -0
  354. package/dist/via/money/normalize.d.ts +105 -0
  355. package/dist/via/money/paths.d.ts +61 -0
  356. package/dist/via/money/where.d.ts +127 -0
  357. package/dist/walk-SVNDIZ62.js +241 -0
  358. package/dist/with/index.js +11 -11
  359. package/dist/with-audit/attestation/active.d.ts +10 -0
  360. package/dist/with-audit/attestation/index.d.ts +16 -0
  361. package/dist/with-audit/attestation/issue.d.ts +29 -0
  362. package/dist/with-audit/attestation/revoke.d.ts +15 -0
  363. package/dist/with-audit/attestation/signer.d.ts +33 -0
  364. package/dist/with-audit/attestation/strategy.d.ts +44 -0
  365. package/dist/with-audit/attestation/vault-facade.d.ts +62 -0
  366. package/dist/with-audit/consent/active.d.ts +14 -0
  367. package/dist/with-audit/consent/consent.d.ts +114 -0
  368. package/dist/with-audit/consent/index.d.ts +14 -0
  369. package/dist/with-audit/consent/strategy.d.ts +36 -0
  370. package/dist/with-audit/forget/active.d.ts +31 -0
  371. package/dist/with-audit/forget/index.d.ts +28 -0
  372. package/dist/with-audit/forget/purge-scope.d.ts +54 -0
  373. package/dist/with-audit/forget/strategy.d.ts +199 -0
  374. package/dist/with-audit/forget/subject-index.d.ts +83 -0
  375. package/dist/with-audit/guards/executor.d.ts +26 -0
  376. package/dist/with-audit/guards/immutable-guard.d.ts +63 -0
  377. package/dist/with-audit/guards/index.d.ts +10 -0
  378. package/dist/with-audit/guards/read-only-facade.d.ts +31 -0
  379. package/dist/with-audit/guards/registry.d.ts +83 -0
  380. package/dist/with-audit/guards/transition-guard.d.ts +82 -0
  381. package/dist/with-audit/guards/types.d.ts +134 -0
  382. package/dist/with-audit/guards/with-guard.d.ts +15 -0
  383. package/dist/with-audit/periods/active.d.ts +11 -0
  384. package/dist/with-audit/periods/index.d.ts +18 -0
  385. package/dist/with-audit/periods/periods.d.ts +417 -0
  386. package/dist/with-audit/periods/strategy.d.ts +32 -0
  387. package/dist/with-audit/periods/vault-facade.d.ts +95 -0
  388. package/dist/with-audit/portability/active.d.ts +11 -0
  389. package/dist/with-audit/portability/export-accessible.d.ts +46 -0
  390. package/dist/with-audit/portability/index.d.ts +18 -0
  391. package/dist/with-audit/portability/request-withdrawal.d.ts +85 -0
  392. package/dist/with-audit/portability/strategy.d.ts +31 -0
  393. package/dist/with-audit/portability/withdraw-accessible.d.ts +82 -0
  394. package/dist/with-audit/sealed-record/active.d.ts +9 -0
  395. package/dist/with-audit/sealed-record/index.d.ts +55 -0
  396. package/dist/with-audit/sealed-record/strategy.d.ts +34 -0
  397. package/dist/with-audit/sealed-record/types.d.ts +27 -0
  398. package/dist/with-audit/tiers/active.d.ts +9 -0
  399. package/dist/with-audit/tiers/index.d.ts +394 -0
  400. package/dist/with-audit/tiers/strategy.d.ts +36 -0
  401. package/dist/with-cargo/active.d.ts +11 -0
  402. package/dist/with-cargo/adopt-partition.d.ts +81 -0
  403. package/dist/with-cargo/decrypt-partition.d.ts +19 -0
  404. package/dist/with-cargo/describe-extraction.d.ts +41 -0
  405. package/dist/with-cargo/extract-partition.d.ts +155 -0
  406. package/dist/with-cargo/index.d.ts +33 -0
  407. package/dist/with-cargo/strategy.d.ts +30 -0
  408. package/dist/with-cargo/vault-diff.d.ts +144 -0
  409. package/dist/with-cargo/walk-closure.d.ts +67 -0
  410. package/dist/with-commit/crdt/active.d.ts +25 -0
  411. package/dist/with-commit/crdt/crdt.d.ts +42 -0
  412. package/dist/with-commit/crdt/index.d.ts +16 -0
  413. package/dist/with-commit/crdt/strategy.d.ts +25 -0
  414. package/dist/with-commit/history/active.d.ts +40 -0
  415. package/dist/with-commit/history/diff.d.ts +23 -0
  416. package/dist/with-commit/history/history.d.ts +73 -0
  417. package/dist/with-commit/history/index.d.ts +30 -0
  418. package/dist/with-commit/history/ledger/constants.d.ts +37 -0
  419. package/dist/with-commit/history/ledger/entry.d.ts +195 -0
  420. package/dist/with-commit/history/ledger/hash.d.ts +30 -0
  421. package/dist/with-commit/history/ledger/index.d.ts +19 -0
  422. package/dist/with-commit/history/ledger/patch.d.ts +99 -0
  423. package/dist/with-commit/history/ledger/store.d.ts +356 -0
  424. package/dist/with-commit/history/strategy.d.ts +136 -0
  425. package/dist/with-commit/history/time-machine.d.ts +202 -0
  426. package/dist/with-commit/numbering/descriptor.d.ts +27 -0
  427. package/dist/with-commit/numbering/index.d.ts +69 -0
  428. package/dist/with-commit/sequence/active.d.ts +10 -0
  429. package/dist/with-commit/sequence/index.d.ts +150 -0
  430. package/dist/with-commit/sequence/strategy.d.ts +26 -0
  431. package/dist/with-commit/tx/active.d.ts +27 -0
  432. package/dist/with-commit/tx/dry-run.d.ts +29 -0
  433. package/dist/with-commit/tx/elevated-handle.d.ts +59 -0
  434. package/dist/with-commit/tx/index.d.ts +13 -0
  435. package/dist/with-commit/tx/invariants.d.ts +68 -0
  436. package/dist/with-commit/tx/strategy.d.ts +23 -0
  437. package/dist/with-commit/tx/transaction.d.ts +212 -0
  438. package/dist/with-fork/archive/engine.d.ts +71 -0
  439. package/dist/with-fork/archive/index.d.ts +23 -0
  440. package/dist/with-fork/shadow/active.d.ts +6 -0
  441. package/dist/with-fork/shadow/index.d.ts +14 -0
  442. package/dist/with-fork/shadow/strategy.d.ts +28 -0
  443. package/dist/with-fork/shadow/vault-frame.d.ts +93 -0
  444. package/dist/with-fork/snapshots/active.d.ts +20 -0
  445. package/dist/with-fork/snapshots/engine.d.ts +36 -0
  446. package/dist/with-fork/snapshots/index.d.ts +5 -0
  447. package/dist/with-fork/snapshots/noydb-facade.d.ts +64 -0
  448. package/dist/with-fork/snapshots/policy.d.ts +23 -0
  449. package/dist/with-fork/snapshots/scheduler.d.ts +34 -0
  450. package/dist/with-fork/snapshots/strategy.d.ts +48 -0
  451. package/dist/with-formula/computed/index.d.ts +48 -0
  452. package/dist/with-formula/computed/lazy.d.ts +13 -0
  453. package/dist/with-formula/derivations/executor.d.ts +61 -0
  454. package/dist/with-formula/derivations/fanout-sidecar.d.ts +75 -0
  455. package/dist/with-formula/derivations/index.d.ts +6 -0
  456. package/dist/with-formula/derivations/registry.d.ts +67 -0
  457. package/dist/with-formula/derivations/stale.d.ts +39 -0
  458. package/dist/with-formula/derivations/strategy-hash.d.ts +1 -0
  459. package/dist/with-formula/derivations/types.d.ts +248 -0
  460. package/dist/with-formula/derivations/with-derivation.d.ts +10 -0
  461. package/dist/with-formula/derivations/with-rollup.d.ts +34 -0
  462. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +58 -0
  463. package/dist/with-formula/materialized-views/executor.d.ts +80 -0
  464. package/dist/with-formula/materialized-views/index.d.ts +11 -0
  465. package/dist/with-formula/materialized-views/query-hash.d.ts +23 -0
  466. package/dist/with-formula/materialized-views/registry.d.ts +99 -0
  467. package/dist/with-formula/materialized-views/stale.d.ts +113 -0
  468. package/dist/with-formula/materialized-views/types.d.ts +318 -0
  469. package/dist/with-formula/materialized-views/with-materialized-view.d.ts +24 -0
  470. package/dist/with-formula/overlay-views/index.d.ts +5 -0
  471. package/dist/with-formula/overlay-views/registry.d.ts +42 -0
  472. package/dist/with-formula/overlay-views/types.d.ts +97 -0
  473. package/dist/with-formula/overlay-views/virtual-collection.d.ts +90 -0
  474. package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +9 -0
  475. package/dist/with-lookup/aggregate/active.d.ts +33 -0
  476. package/dist/with-lookup/aggregate/aggregation.d.ts +166 -0
  477. package/dist/with-lookup/aggregate/canonical-key.d.ts +16 -0
  478. package/dist/with-lookup/aggregate/groupby.d.ts +280 -0
  479. package/dist/with-lookup/aggregate/index.d.ts +23 -0
  480. package/dist/with-lookup/aggregate/reducers.d.ts +257 -0
  481. package/dist/with-lookup/aggregate/strategy.d.ts +59 -0
  482. package/dist/with-lookup/embeddings/cosine.d.ts +2 -0
  483. package/dist/with-lookup/embeddings/descriptor.d.ts +8 -0
  484. package/dist/with-lookup/embeddings/index.d.ts +4 -0
  485. package/dist/with-lookup/embeddings/vec-id.d.ts +47 -0
  486. package/dist/with-lookup/embeddings/vector-set.d.ts +19 -0
  487. package/dist/with-lookup/indexing/active.d.ts +30 -0
  488. package/dist/with-lookup/indexing/collection-facade.d.ts +157 -0
  489. package/dist/with-lookup/indexing/eager-indexes.d.ts +122 -0
  490. package/dist/with-lookup/indexing/index.d.ts +27 -0
  491. package/dist/with-lookup/indexing/lazy-builder.d.ts +102 -0
  492. package/dist/with-lookup/indexing/persisted-indexes.d.ts +229 -0
  493. package/dist/with-lookup/indexing/strategy.d.ts +56 -0
  494. package/dist/with-lookup/indexing/unique-constraints.d.ts +74 -0
  495. package/dist/with-lookup/search/active.d.ts +10 -0
  496. package/dist/with-lookup/search/build-docs.d.ts +15 -0
  497. package/dist/with-lookup/search/collection-facade.d.ts +163 -0
  498. package/dist/with-lookup/search/fuse.d.ts +22 -0
  499. package/dist/with-lookup/search/index-store.d.ts +19 -0
  500. package/dist/with-lookup/search/index.d.ts +19 -0
  501. package/dist/with-lookup/search/inverted-index.d.ts +47 -0
  502. package/dist/with-lookup/search/persisted-index-store.d.ts +121 -0
  503. package/dist/with-lookup/search/retrieve-types.d.ts +29 -0
  504. package/dist/with-lookup/search/scan.d.ts +28 -0
  505. package/dist/with-lookup/search/segment.d.ts +15 -0
  506. package/dist/with-lookup/search/serialize.d.ts +4 -0
  507. package/dist/with-lookup/search/snippet.d.ts +5 -0
  508. package/dist/with-lookup/search/strategy.d.ts +41 -0
  509. package/dist/with-lookup/search/tokenize.d.ts +12 -0
  510. package/dist/with-party/auth-introspection/index.d.ts +44 -0
  511. package/dist/with-party/broker/active.d.ts +23 -0
  512. package/dist/with-party/broker/index.d.ts +28 -0
  513. package/dist/with-party/broker/seed.d.ts +77 -0
  514. package/dist/with-party/custody/active.d.ts +10 -0
  515. package/dist/with-party/custody/index.d.ts +69 -0
  516. package/dist/with-party/custody/liberate.d.ts +64 -0
  517. package/dist/with-party/custody/strategy.d.ts +48 -0
  518. package/dist/with-party/directory/index.d.ts +11 -0
  519. package/dist/with-party/directory/public-envelope/index.d.ts +12 -0
  520. package/dist/with-party/directory/public-envelope/schema.d.ts +24 -0
  521. package/dist/with-party/directory/public-envelope/storage.d.ts +59 -0
  522. package/dist/with-party/directory/public-envelope/types.d.ts +80 -0
  523. package/dist/with-party/directory/storage.d.ts +33 -0
  524. package/dist/with-party/directory/types.d.ts +43 -0
  525. package/dist/with-party/directory/user-envelope/api.d.ts +201 -0
  526. package/dist/with-party/directory/user-envelope/index.d.ts +12 -0
  527. package/dist/with-party/directory/user-envelope/storage.d.ts +54 -0
  528. package/dist/with-party/directory/visibility.d.ts +47 -0
  529. package/dist/with-party/policy/engine.d.ts +60 -0
  530. package/dist/with-party/policy/index.d.ts +15 -0
  531. package/dist/with-party/policy/noydb-facade.d.ts +39 -0
  532. package/dist/with-party/policy/presets.d.ts +38 -0
  533. package/dist/with-party/policy/storage.d.ts +31 -0
  534. package/dist/with-party/session/active.d.ts +34 -0
  535. package/dist/with-party/session/dev-unlock.d.ts +128 -0
  536. package/dist/with-party/session/index.d.ts +23 -0
  537. package/dist/with-party/session/session-policy.d.ts +92 -0
  538. package/dist/with-party/session/session.d.ts +131 -0
  539. package/dist/with-party/session/strategy.d.ts +42 -0
  540. package/dist/with-party/session/unlock-state.d.ts +47 -0
  541. package/dist/with-party/sync/index.d.ts +31 -0
  542. package/dist/with-party/tab-coordination.d.ts +73 -0
  543. package/dist/with-party/tab-write-relay.d.ts +39 -0
  544. package/dist/with-party/team/active.d.ts +13 -0
  545. package/dist/with-party/team/authenticators.d.ts +95 -0
  546. package/dist/with-party/team/deed.d.ts +97 -0
  547. package/dist/with-party/team/delegation.d.ts +88 -0
  548. package/dist/with-party/team/index.d.ts +38 -0
  549. package/dist/with-party/team/keyring.d.ts +318 -0
  550. package/dist/with-party/team/magic-link-grant.d.ts +152 -0
  551. package/dist/with-party/team/managed-passphrase.d.ts +280 -0
  552. package/dist/with-party/team/noydb-facade.d.ts +484 -0
  553. package/dist/with-party/team/peer-recover.d.ts +81 -0
  554. package/dist/with-party/team/presence.d.ts +81 -0
  555. package/dist/with-party/team/recovery.d.ts +191 -0
  556. package/dist/with-party/team/reserved-secret-collections.d.ts +41 -0
  557. package/dist/with-party/team/rotate-recover.d.ts +275 -0
  558. package/dist/with-party/team/shamir-recovery-provider.d.ts +15 -0
  559. package/dist/with-party/team/strategy.d.ts +9 -0
  560. package/dist/with-party/team/sync-active.d.ts +33 -0
  561. package/dist/with-party/team/sync-credentials.d.ts +113 -0
  562. package/dist/with-party/team/sync-strategy.d.ts +67 -0
  563. package/dist/with-party/team/sync-transaction.d.ts +39 -0
  564. package/dist/with-party/team/sync.d.ts +174 -0
  565. package/dist/with-party/team/tiers.d.ts +39 -0
  566. package/dist/with-party/team/wrapped-deks.d.ts +86 -0
  567. package/dist/with-pod/backup.d.ts +74 -0
  568. package/dist/with-pod/bundle.d.ts +414 -0
  569. package/dist/with-pod/format.d.ts +203 -0
  570. package/dist/with-pod/index.d.ts +20 -0
  571. package/dist/with-pod/pod-store.d.ts +54 -0
  572. package/dist/with-pod/ulid.d.ts +64 -0
  573. package/dist/with-shape/blobs/blob-compaction.d.ts +170 -0
  574. package/dist/with-shape/blobs/blob-intent.d.ts +153 -0
  575. package/dist/with-shape/blobs/blob-set.d.ts +1286 -0
  576. package/dist/with-shape/blobs/export-blobs.d.ts +110 -0
  577. package/dist/with-shape/blobs/import-external.d.ts +50 -0
  578. package/dist/with-shape/blobs/mime-magic.d.ts +48 -0
  579. package/dist/with-shape/blobs/object-projection.d.ts +70 -0
  580. package/dist/with-shape/introspection/describe.d.ts +237 -0
  581. package/dist/with-shape/introspection/field-meta.d.ts +61 -0
  582. package/dist/with-shape/introspection/fields.d.ts +14 -0
  583. package/dist/with-shape/introspection/index.d.ts +12 -0
  584. package/dist/with-shape/introspection/json-schema.d.ts +13 -0
  585. package/dist/with-shape/introspection/meta.d.ts +22 -0
  586. package/dist/with-shape/introspection/projection.d.ts +13 -0
  587. package/dist/with-shape/introspection/types.d.ts +154 -0
  588. package/dist/with-shape/introspection/walk.d.ts +50 -0
  589. package/dist/with-shape/links/lazy-handle.d.ts +36 -0
  590. package/dist/with-shape/links/link-set.d.ts +67 -0
  591. package/dist/with-shape/links/names.d.ts +65 -0
  592. package/dist/with-shape/links/vault-facade.d.ts +211 -0
  593. package/dist/with-shape/persisted-schemas/canonicalize.d.ts +11 -0
  594. package/dist/with-shape/persisted-schemas/derive.d.ts +29 -0
  595. package/dist/with-shape/persisted-schemas/index.d.ts +21 -0
  596. package/dist/with-shape/persisted-schemas/register.d.ts +66 -0
  597. package/dist/with-shape/persisted-schemas/storage.d.ts +61 -0
  598. package/dist/with-shape/persisted-schemas/types.d.ts +54 -0
  599. package/dist/with-shape/satellites/dead-filter.d.ts +21 -0
  600. package/dist/with-shape/satellites/declare.d.ts +60 -0
  601. package/dist/with-shape/satellites/existence.d.ts +5 -0
  602. package/dist/with-shape/satellites/fanout.d.ts +38 -0
  603. package/dist/with-shape/satellites/forget.d.ts +47 -0
  604. package/dist/with-shape/satellites/index.d.ts +3 -0
  605. package/dist/with-shape/satellites/joined.d.ts +19 -0
  606. package/dist/with-shape/satellites/marker.d.ts +10 -0
  607. package/dist/with-shape/satellites/migrate-cek.d.ts +26 -0
  608. package/dist/with-shape/satellites/post-register.d.ts +6 -0
  609. package/dist/with-shape/satellites/proxy.d.ts +37 -0
  610. package/dist/with-shape/satellites/raw-target.d.ts +14 -0
  611. package/dist/with-shape/satellites/registry.d.ts +19 -0
  612. package/dist/with-shape/satellites/types.d.ts +37 -0
  613. package/dist/with-shape/satellites/validate.d.ts +17 -0
  614. package/dist/with-shape/schema-update/client-registry.d.ts +35 -0
  615. package/dist/with-shape/schema-update/cutover.d.ts +5 -0
  616. package/dist/with-shape/schema-update/delta.d.ts +2 -0
  617. package/dist/with-shape/schema-update/dispatch.d.ts +3 -0
  618. package/dist/with-shape/schema-update/fence-controller.d.ts +62 -0
  619. package/dist/with-shape/schema-update/fence-watcher.d.ts +37 -0
  620. package/dist/with-shape/schema-update/fence.d.ts +15 -0
  621. package/dist/with-shape/schema-update/gate.d.ts +16 -0
  622. package/dist/with-shape/schema-update/index.d.ts +6 -0
  623. package/dist/with-shape/schema-update/store-coordination-provider.d.ts +29 -0
  624. package/dist/with-shape/schema-update/strategies.d.ts +12 -0
  625. package/dist/with-shape/schema-update/types.d.ts +53 -0
  626. package/dist/with-store/index.d.ts +15 -0
  627. package/dist/with-store/lazy/active.d.ts +12 -0
  628. package/dist/with-store/lazy/index.d.ts +14 -0
  629. package/dist/with-store/lazy/strategy.d.ts +9 -0
  630. package/dist/with-store/route-store.d.ts +259 -0
  631. package/dist/with-store/store-middleware.d.ts +189 -0
  632. package/dist/withdraw-accessible-WZIEVWSR.js +28 -0
  633. package/package.json +47 -55
  634. package/dist/adapter/index.d.ts +0 -5
  635. package/dist/adapter/index.js +0 -15
  636. package/dist/aggregate/index.d.ts +0 -42
  637. package/dist/api-JDWL67WL.js +0 -20
  638. package/dist/as/index.d.ts +0 -7
  639. package/dist/at/index.d.ts +0 -5
  640. package/dist/attestation/index.d.ts +0 -20
  641. package/dist/backup-WRGNTGJF.js +0 -225
  642. package/dist/backup-WRGNTGJF.js.map +0 -1
  643. package/dist/blobs/index.d.ts +0 -44
  644. package/dist/bundle/index.d.ts +0 -122
  645. package/dist/bundle-DzWtVw7w.d.ts +0 -548
  646. package/dist/by/index.d.ts +0 -1
  647. package/dist/cargo/index.d.ts +0 -9
  648. package/dist/chunk-25G7PUTA.js +0 -235
  649. package/dist/chunk-26FSVNBL.js +0 -34
  650. package/dist/chunk-2PJB6H3H.js +0 -167
  651. package/dist/chunk-2PJB6H3H.js.map +0 -1
  652. package/dist/chunk-37JZR7CY.js +0 -91
  653. package/dist/chunk-3KBK5LU4.js +0 -117
  654. package/dist/chunk-3YKBGS3I.js +0 -686
  655. package/dist/chunk-3YKBGS3I.js.map +0 -1
  656. package/dist/chunk-44DV37ZV.js +0 -75
  657. package/dist/chunk-44DV37ZV.js.map +0 -1
  658. package/dist/chunk-47C4CI7R.js +0 -108
  659. package/dist/chunk-47C4CI7R.js.map +0 -1
  660. package/dist/chunk-4VDFUBTS.js +0 -275
  661. package/dist/chunk-4VDFUBTS.js.map +0 -1
  662. package/dist/chunk-55LSDABW.js +0 -94
  663. package/dist/chunk-56JB2BGI.js +0 -13003
  664. package/dist/chunk-56JB2BGI.js.map +0 -1
  665. package/dist/chunk-5GQE5IDB.js +0 -513
  666. package/dist/chunk-5GQE5IDB.js.map +0 -1
  667. package/dist/chunk-5HRJQSKN.js +0 -202
  668. package/dist/chunk-5HZULLHE.js +0 -404
  669. package/dist/chunk-5JQMX2EH.js +0 -50
  670. package/dist/chunk-5UOPIPZC.js +0 -95
  671. package/dist/chunk-5YBUFCFF.js +0 -135
  672. package/dist/chunk-62APEMF3.js +0 -280
  673. package/dist/chunk-62APEMF3.js.map +0 -1
  674. package/dist/chunk-6P5AJ2ZS.js +0 -120
  675. package/dist/chunk-6P5AJ2ZS.js.map +0 -1
  676. package/dist/chunk-6PALJTC2.js +0 -430
  677. package/dist/chunk-6PALJTC2.js.map +0 -1
  678. package/dist/chunk-6S7T6WC4.js +0 -111
  679. package/dist/chunk-6S7T6WC4.js.map +0 -1
  680. package/dist/chunk-6Z435B6N.js +0 -1656
  681. package/dist/chunk-6Z435B6N.js.map +0 -1
  682. package/dist/chunk-723XB5NX.js +0 -86
  683. package/dist/chunk-7CZ6YXMO.js +0 -124
  684. package/dist/chunk-7KTL4RHZ.js +0 -120
  685. package/dist/chunk-7KTL4RHZ.js.map +0 -1
  686. package/dist/chunk-7TAV3BFQ.js +0 -766
  687. package/dist/chunk-7TAV3BFQ.js.map +0 -1
  688. package/dist/chunk-BASCPHNM.js +0 -380
  689. package/dist/chunk-BASCPHNM.js.map +0 -1
  690. package/dist/chunk-BGIZAFY7.js +0 -1
  691. package/dist/chunk-BJ2XF2RC.js +0 -823
  692. package/dist/chunk-BM6E4MUT.js +0 -881
  693. package/dist/chunk-BM6E4MUT.js.map +0 -1
  694. package/dist/chunk-BTFTHF6Q.js +0 -42
  695. package/dist/chunk-C4NOLA5X.js +0 -132
  696. package/dist/chunk-C4NOLA5X.js.map +0 -1
  697. package/dist/chunk-CHK5VVMI.js +0 -155
  698. package/dist/chunk-DCVVCJVB.js +0 -45
  699. package/dist/chunk-EU7HDMT3.js +0 -54
  700. package/dist/chunk-F3EKFGUS.js +0 -99
  701. package/dist/chunk-FCOZ7DEC.js +0 -355
  702. package/dist/chunk-FCOZ7DEC.js.map +0 -1
  703. package/dist/chunk-FWART3VA.js +0 -205
  704. package/dist/chunk-FZK3JJJK.js +0 -150
  705. package/dist/chunk-GDOOG5YQ.js +0 -382
  706. package/dist/chunk-GLVXQU3E.js +0 -155
  707. package/dist/chunk-HU55NPHZ.js +0 -80
  708. package/dist/chunk-I6JJ6VJS.js +0 -97
  709. package/dist/chunk-I6URUNTD.js +0 -59
  710. package/dist/chunk-IARAK3PK.js +0 -14
  711. package/dist/chunk-II6DLDZM.js +0 -30
  712. package/dist/chunk-J5YUA6JB.js +0 -23
  713. package/dist/chunk-J7OH6R4K.js +0 -49
  714. package/dist/chunk-K2WCO3NX.js +0 -1
  715. package/dist/chunk-L6Q5NA22.js +0 -40
  716. package/dist/chunk-LFGJG4XZ.js +0 -30
  717. package/dist/chunk-M3OYTM5Z.js +0 -85
  718. package/dist/chunk-MOQ5M46U.js +0 -209
  719. package/dist/chunk-NTPWQH4S.js +0 -589
  720. package/dist/chunk-OJ64XMPJ.js +0 -1434
  721. package/dist/chunk-OJ64XMPJ.js.map +0 -1
  722. package/dist/chunk-OWGAXPRE.js +0 -129
  723. package/dist/chunk-P2PEPSPK.js +0 -230
  724. package/dist/chunk-P6TZ3IVN.js +0 -453
  725. package/dist/chunk-P6TZ3IVN.js.map +0 -1
  726. package/dist/chunk-PAJCRV7O.js +0 -123
  727. package/dist/chunk-PMMV5SQC.js +0 -416
  728. package/dist/chunk-PMMV5SQC.js.map +0 -1
  729. package/dist/chunk-PPPZIBKY.js +0 -261
  730. package/dist/chunk-PPPZIBKY.js.map +0 -1
  731. package/dist/chunk-PVC2FBCQ.js +0 -45
  732. package/dist/chunk-PYIUDUGS.js +0 -36
  733. package/dist/chunk-QABECTNN.js +0 -255
  734. package/dist/chunk-QYMMMKOO.js +0 -164
  735. package/dist/chunk-R4IVPJHN.js +0 -130
  736. package/dist/chunk-REWTMYSF.js +0 -32
  737. package/dist/chunk-REWTMYSF.js.map +0 -1
  738. package/dist/chunk-RNYDHIQL.js +0 -367
  739. package/dist/chunk-RUIMKQTA.js +0 -23
  740. package/dist/chunk-RUIMKQTA.js.map +0 -1
  741. package/dist/chunk-TCGVRKOS.js +0 -367
  742. package/dist/chunk-TIAYXOEI.js +0 -99
  743. package/dist/chunk-TQ3REHVF.js +0 -95
  744. package/dist/chunk-TQ3REHVF.js.map +0 -1
  745. package/dist/chunk-TUL5YQWF.js +0 -777
  746. package/dist/chunk-U7LV2DUN.js +0 -74
  747. package/dist/chunk-UB3XHGFG.js +0 -181
  748. package/dist/chunk-UB3XHGFG.js.map +0 -1
  749. package/dist/chunk-UMH35AQV.js +0 -70
  750. package/dist/chunk-UWZ7O4NR.js +0 -29
  751. package/dist/chunk-V76PHWLE.js +0 -41
  752. package/dist/chunk-VFQOE76I.js +0 -69
  753. package/dist/chunk-VIWOGJ2O.js +0 -71
  754. package/dist/chunk-VK6OC22R.js +0 -37
  755. package/dist/chunk-VK6OC22R.js.map +0 -1
  756. package/dist/chunk-VVLOWY74.js +0 -150
  757. package/dist/chunk-VVLOWY74.js.map +0 -1
  758. package/dist/chunk-W3JABOVB.js +0 -53
  759. package/dist/chunk-W3JABOVB.js.map +0 -1
  760. package/dist/chunk-WPNP3NF5.js +0 -1221
  761. package/dist/chunk-WPNP3NF5.js.map +0 -1
  762. package/dist/chunk-X5QZAJDB.js +0 -59
  763. package/dist/chunk-X6VNIRHS.js +0 -239
  764. package/dist/chunk-X6VNIRHS.js.map +0 -1
  765. package/dist/chunk-XBPUVQDO.js +0 -664
  766. package/dist/chunk-XBPUVQDO.js.map +0 -1
  767. package/dist/chunk-XW5LZYV4.js +0 -21
  768. package/dist/chunk-YTCCC6NG.js +0 -320
  769. package/dist/chunk-YTCCC6NG.js.map +0 -1
  770. package/dist/classified/index.d.ts +0 -17
  771. package/dist/collection-facade-EJVIN2BY.js +0 -39
  772. package/dist/computed-6FOFXQPE.js +0 -11
  773. package/dist/config-drift-RFEVGBKR.js +0 -24
  774. package/dist/config-drift-RFEVGBKR.js.map +0 -1
  775. package/dist/consent/index.d.ts +0 -23
  776. package/dist/crdt/index.d.ts +0 -34
  777. package/dist/dead-filter-RHMNYOXP.js +0 -28
  778. package/dist/decrypt-partition-IHtxEnTi.d.ts +0 -21
  779. package/dist/delegation-IHXOASHV.js +0 -25
  780. package/dist/derivations/index.d.ts +0 -70
  781. package/dist/derive-CD3ZVIXK.js +0 -21
  782. package/dist/describe/index.d.ts +0 -1
  783. package/dist/describe/index.js +0 -1
  784. package/dist/describe-C6iHNlqJ.d.ts +0 -162
  785. package/dist/dev-unlock-wgQ7Ci5I.d.ts +0 -263
  786. package/dist/discriminant-BN9REW3o.d.ts +0 -60
  787. package/dist/enclave-KGEUW2GL.js +0 -123
  788. package/dist/executor-EUPYHCLU.js +0 -9
  789. package/dist/executor-KZ4B3PRT.js +0 -9
  790. package/dist/executor-MHUM2VZK.js +0 -21
  791. package/dist/export-accessible-Z3NSZZHN.js +0 -23
  792. package/dist/extract-partition-VSKT35JG.js +0 -36
  793. package/dist/fanout-sidecar-NBDKKCHT.js +0 -74
  794. package/dist/find-OH4BEULF.js +0 -11
  795. package/dist/forget/index.d.ts +0 -36
  796. package/dist/guards/index.d.ts +0 -35
  797. package/dist/hash-CwHnoKyW.d.ts +0 -72
  798. package/dist/history/index.d.ts +0 -61
  799. package/dist/i18n/index.d.ts +0 -37
  800. package/dist/in/index.d.ts +0 -5
  801. package/dist/index-B9QdHytu.d.ts +0 -123
  802. package/dist/index-CTvUp94-.d.ts +0 -123
  803. package/dist/index-Dn5GzPg_.d.ts +0 -22138
  804. package/dist/indexing/index.d.ts +0 -39
  805. package/dist/issue-AEOL6RXA.js +0 -19
  806. package/dist/kernel/index.d.ts +0 -32
  807. package/dist/kernel/index.js +0 -59
  808. package/dist/lazy/index.d.ts +0 -21
  809. package/dist/ledger-3LR3YO2W.js +0 -42
  810. package/dist/liberate-XSEPRWEA.js +0 -24
  811. package/dist/link-set-NSUIX6BR.js +0 -31
  812. package/dist/materialized-views/index.d.ts +0 -173
  813. package/dist/mime-magic-CYbFNQ4h.d.ts +0 -103
  814. package/dist/noydb-POVTIVQ6.js +0 -62
  815. package/dist/on/index.d.ts +0 -5
  816. package/dist/overlay-views/index.d.ts +0 -98
  817. package/dist/periods/index.d.ts +0 -20
  818. package/dist/pod/index.d.ts +0 -63
  819. package/dist/policy-Y7HL2KGA.js +0 -41
  820. package/dist/portability/index.d.ts +0 -20
  821. package/dist/post-register-KOFRTCDD.js +0 -55
  822. package/dist/post-register-KOFRTCDD.js.map +0 -1
  823. package/dist/public-envelope-NC7SPNMV.js +0 -32
  824. package/dist/query/index.d.ts +0 -5
  825. package/dist/read-only-facade-5ADRJVTM.js +0 -8
  826. package/dist/register-3D6R2MKN.js +0 -23
  827. package/dist/registry-AI4E46PD.js +0 -19
  828. package/dist/registry-HSNQ4NBP.js +0 -9
  829. package/dist/registry-WIX6QCV5.js +0 -17
  830. package/dist/request-withdrawal-GU4XS2R5.js +0 -31
  831. package/dist/reveal-5Y777N5Q.js +0 -38
  832. package/dist/reveal-5Y777N5Q.js.map +0 -1
  833. package/dist/revoke-ZFETCLYV.js +0 -24
  834. package/dist/revoke-ZFETCLYV.js.map +0 -1
  835. package/dist/satellites/index.d.ts +0 -5
  836. package/dist/sealed-record/index.d.ts +0 -69
  837. package/dist/session/index.d.ts +0 -44
  838. package/dist/shadow/index.d.ts +0 -15
  839. package/dist/signer-GAIMQQ2J.js +0 -25
  840. package/dist/signer-GAIMQQ2J.js.map +0 -1
  841. package/dist/snapshots/index.d.ts +0 -26
  842. package/dist/stale-77LP2EEF.js +0 -14
  843. package/dist/stale-77LP2EEF.js.map +0 -1
  844. package/dist/storage-KEXIXLGM.js +0 -23
  845. package/dist/storage-KEXIXLGM.js.map +0 -1
  846. package/dist/store-coordination-provider-NJDDZ264.js +0 -142
  847. package/dist/subject-index-O75wKshW.d.ts +0 -362
  848. package/dist/sync/index.d.ts +0 -41
  849. package/dist/team/index.d.ts +0 -155
  850. package/dist/tiers/index.d.ts +0 -5
  851. package/dist/to/index.d.ts +0 -5
  852. package/dist/transition-guard-D5RLJv8S.d.ts +0 -165
  853. package/dist/tx/index.d.ts +0 -35
  854. package/dist/ui/index.d.ts +0 -1
  855. package/dist/ulid-DRH25k3y.d.ts +0 -66
  856. package/dist/util/index.d.ts +0 -79
  857. package/dist/validators-C3lrVF-c.d.ts +0 -101
  858. package/dist/vault-diff-_LSIcOMv.d.ts +0 -147
  859. package/dist/verify-CAYGXYNO.js +0 -139
  860. package/dist/verify-CAYGXYNO.js.map +0 -1
  861. package/dist/walk-SMAE4IEI.js +0 -241
  862. package/dist/with/index.d.ts +0 -38
  863. package/dist/with-materialized-view-Xv1-9Bh0.d.ts +0 -27
  864. package/dist/with-overlayed-view-CuWhq_-C.d.ts +0 -12
  865. package/dist/with-rollup-K_iwal4b.d.ts +0 -47
  866. package/dist/withdraw-accessible-Q7BULAN5.js +0 -28
  867. package/dist/withdraw-accessible-Q7BULAN5.js.map +0 -1
  868. /package/dist/{adapter/index.js.map → api-ZGS6LCOF.js.map} +0 -0
  869. /package/dist/{chunk-VIWOGJ2O.js.map → chunk-3B5VVCNY.js.map} +0 -0
  870. /package/dist/{chunk-P2PEPSPK.js.map → chunk-3LQ2YKO4.js.map} +0 -0
  871. /package/dist/{chunk-EU7HDMT3.js.map → chunk-3QCRBHCY.js.map} +0 -0
  872. /package/dist/{chunk-FZK3JJJK.js.map → chunk-4JBYV75E.js.map} +0 -0
  873. /package/dist/{chunk-I6JJ6VJS.js.map → chunk-4NXKCLLQ.js.map} +0 -0
  874. /package/dist/{chunk-VFQOE76I.js.map → chunk-5M5DVGV7.js.map} +0 -0
  875. /package/dist/{chunk-LFGJG4XZ.js.map → chunk-5YOLBEQ6.js.map} +0 -0
  876. /package/dist/{chunk-OWGAXPRE.js.map → chunk-6CRIV7DE.js.map} +0 -0
  877. /package/dist/{chunk-QABECTNN.js.map → chunk-6QTNZJBS.js.map} +0 -0
  878. /package/dist/{chunk-723XB5NX.js.map → chunk-6T2SCQRU.js.map} +0 -0
  879. /package/dist/{chunk-PVC2FBCQ.js.map → chunk-7DSTRQIJ.js.map} +0 -0
  880. /package/dist/{chunk-NTPWQH4S.js.map → chunk-AUSTCW2X.js.map} +0 -0
  881. /package/dist/{chunk-MOQ5M46U.js.map → chunk-B3HJYUOF.js.map} +0 -0
  882. /package/dist/{chunk-QYMMMKOO.js.map → chunk-BDVFPG6Y.js.map} +0 -0
  883. /package/dist/{chunk-PYIUDUGS.js.map → chunk-CAF6WOK7.js.map} +0 -0
  884. /package/dist/{chunk-5HZULLHE.js.map → chunk-CIE2BASH.js.map} +0 -0
  885. /package/dist/{chunk-BTFTHF6Q.js.map → chunk-CRI4OUV4.js.map} +0 -0
  886. /package/dist/{chunk-37JZR7CY.js.map → chunk-DLG74CNB.js.map} +0 -0
  887. /package/dist/{chunk-TCGVRKOS.js.map → chunk-ERJ7FU55.js.map} +0 -0
  888. /package/dist/{chunk-FWART3VA.js.map → chunk-EVVGJDRQ.js.map} +0 -0
  889. /package/dist/{chunk-X5QZAJDB.js.map → chunk-EXK7QRWF.js.map} +0 -0
  890. /package/dist/{chunk-5HRJQSKN.js.map → chunk-EYZ6IQ6X.js.map} +0 -0
  891. /package/dist/{chunk-DCVVCJVB.js.map → chunk-F64IRYG3.js.map} +0 -0
  892. /package/dist/{chunk-BJ2XF2RC.js.map → chunk-FHS2HQSH.js.map} +0 -0
  893. /package/dist/{chunk-HU55NPHZ.js.map → chunk-GKEWXIV5.js.map} +0 -0
  894. /package/dist/{chunk-I6URUNTD.js.map → chunk-GTGPO5KW.js.map} +0 -0
  895. /package/dist/{chunk-5UOPIPZC.js.map → chunk-HB3RFQSC.js.map} +0 -0
  896. /package/dist/{chunk-F3EKFGUS.js.map → chunk-I6GALP6E.js.map} +0 -0
  897. /package/dist/{chunk-R4IVPJHN.js.map → chunk-IL6POWCW.js.map} +0 -0
  898. /package/dist/{chunk-3KBK5LU4.js.map → chunk-IU6SNYX6.js.map} +0 -0
  899. /package/dist/{chunk-TUL5YQWF.js.map → chunk-J2ZX2XUV.js.map} +0 -0
  900. /package/dist/{chunk-UWZ7O4NR.js.map → chunk-JKJOGPZN.js.map} +0 -0
  901. /package/dist/{chunk-V76PHWLE.js.map → chunk-JZUV47FZ.js.map} +0 -0
  902. /package/dist/{chunk-II6DLDZM.js.map → chunk-K5IMOGHB.js.map} +0 -0
  903. /package/dist/{chunk-GDOOG5YQ.js.map → chunk-LASZKVMO.js.map} +0 -0
  904. /package/dist/{chunk-5YBUFCFF.js.map → chunk-NR5LT5RY.js.map} +0 -0
  905. /package/dist/{chunk-UMH35AQV.js.map → chunk-Q5VNKNE5.js.map} +0 -0
  906. /package/dist/{chunk-XW5LZYV4.js.map → chunk-QLWMEXCT.js.map} +0 -0
  907. /package/dist/{chunk-PAJCRV7O.js.map → chunk-QRB7NAOJ.js.map} +0 -0
  908. /package/dist/{chunk-U7LV2DUN.js.map → chunk-R4ROFEYC.js.map} +0 -0
  909. /package/dist/{chunk-RNYDHIQL.js.map → chunk-RIX4V2TB.js.map} +0 -0
  910. /package/dist/{chunk-L6Q5NA22.js.map → chunk-RYCTDFUX.js.map} +0 -0
  911. /package/dist/{chunk-CHK5VVMI.js.map → chunk-RZ5SVOYR.js.map} +0 -0
  912. /package/dist/{chunk-TIAYXOEI.js.map → chunk-SLFHQTTW.js.map} +0 -0
  913. /package/dist/{chunk-J5YUA6JB.js.map → chunk-UNFPPVNI.js.map} +0 -0
  914. /package/dist/{chunk-25G7PUTA.js.map → chunk-VLFCJYTL.js.map} +0 -0
  915. /package/dist/{chunk-7CZ6YXMO.js.map → chunk-VN3DBQAU.js.map} +0 -0
  916. /package/dist/{chunk-J7OH6R4K.js.map → chunk-VZRODIM3.js.map} +0 -0
  917. /package/dist/{chunk-55LSDABW.js.map → chunk-W22IKJE2.js.map} +0 -0
  918. /package/dist/{chunk-GLVXQU3E.js.map → chunk-X3YYQWOQ.js.map} +0 -0
  919. /package/dist/{chunk-M3OYTM5Z.js.map → chunk-YFXZEAYK.js.map} +0 -0
  920. /package/dist/{chunk-5JQMX2EH.js.map → chunk-ZAJAVEXY.js.map} +0 -0
  921. /package/dist/{chunk-26FSVNBL.js.map → chunk-ZICD77GM.js.map} +0 -0
  922. /package/dist/{chunk-IARAK3PK.js.map → chunk-ZUODRVHY.js.map} +0 -0
  923. /package/dist/{api-JDWL67WL.js.map → collection-facade-TLWIPI76.js.map} +0 -0
  924. /package/dist/{chunk-BGIZAFY7.js.map → computed-ZIQTYTDI.js.map} +0 -0
  925. /package/dist/{dead-filter-RHMNYOXP.js.map → dead-filter-ESOBZZP5.js.map} +0 -0
  926. /package/dist/{chunk-K2WCO3NX.js.map → delegation-W7ZV2322.js.map} +0 -0
  927. /package/dist/{collection-facade-EJVIN2BY.js.map → derive-H2BJTLUI.js.map} +0 -0
  928. /package/dist/{computed-6FOFXQPE.js.map → enclave-AP3I5W7O.js.map} +0 -0
  929. /package/dist/{delegation-IHXOASHV.js.map → executor-KGWTNEQD.js.map} +0 -0
  930. /package/dist/{derive-CD3ZVIXK.js.map → executor-OVEXR6RT.js.map} +0 -0
  931. /package/dist/{describe/index.js.map → executor-UNEH5ZYH.js.map} +0 -0
  932. /package/dist/{enclave-KGEUW2GL.js.map → export-accessible-PCMXSUZS.js.map} +0 -0
  933. /package/dist/{executor-EUPYHCLU.js.map → extract-partition-SWHFSYJO.js.map} +0 -0
  934. /package/dist/{fanout-sidecar-NBDKKCHT.js.map → fanout-sidecar-A765THMX.js.map} +0 -0
  935. /package/dist/{executor-KZ4B3PRT.js.map → find-N6345CNT.js.map} +0 -0
  936. /package/dist/{executor-MHUM2VZK.js.map → issue-5OKB6I2R.js.map} +0 -0
  937. /package/dist/{export-accessible-Z3NSZZHN.js.map → ledger-GFBKVPV4.js.map} +0 -0
  938. /package/dist/{extract-partition-VSKT35JG.js.map → liberate-3VDOT4KO.js.map} +0 -0
  939. /package/dist/{find-OH4BEULF.js.map → link-set-Z7Q2ASFX.js.map} +0 -0
  940. /package/dist/{issue-AEOL6RXA.js.map → noydb-ZCJOYBDI.js.map} +0 -0
  941. /package/dist/{kernel/index.js.map → policy-Z3RUAIY2.js.map} +0 -0
  942. /package/dist/{ledger-3LR3YO2W.js.map → public-envelope-B4KNWVUA.js.map} +0 -0
  943. /package/dist/{liberate-XSEPRWEA.js.map → read-only-facade-CHCKSEPD.js.map} +0 -0
  944. /package/dist/{link-set-NSUIX6BR.js.map → register-VAHONCID.js.map} +0 -0
  945. /package/dist/{noydb-POVTIVQ6.js.map → registry-7MLVD3VO.js.map} +0 -0
  946. /package/dist/{policy-Y7HL2KGA.js.map → registry-EPKPD5SM.js.map} +0 -0
  947. /package/dist/{public-envelope-NC7SPNMV.js.map → registry-P5T7PS2U.js.map} +0 -0
  948. /package/dist/{read-only-facade-5ADRJVTM.js.map → request-withdrawal-TI3A5WPS.js.map} +0 -0
  949. /package/dist/{register-3D6R2MKN.js.map → revoke-FDRD6GRW.js.map} +0 -0
  950. /package/dist/{registry-AI4E46PD.js.map → signer-MUWEIUI6.js.map} +0 -0
  951. /package/dist/{registry-HSNQ4NBP.js.map → stale-OSQ7J3AA.js.map} +0 -0
  952. /package/dist/{registry-WIX6QCV5.js.map → storage-MVFCGEQE.js.map} +0 -0
  953. /package/dist/{store-coordination-provider-NJDDZ264.js.map → store-coordination-provider-64OEZFGS.js.map} +0 -0
  954. /package/dist/{walk-SMAE4IEI.js.map → walk-SVNDIZ62.js.map} +0 -0
  955. /package/dist/{request-withdrawal-GU4XS2R5.js.map → withdraw-accessible-WZIEVWSR.js.map} +0 -0
@@ -0,0 +1,1522 @@
1
+ import type { EncryptedEnvelope, HistoryOptions, HistoryEntry, PruneOptions, LocaleReadOptions, PutManyItemOptions, PutManyOptions, PutManyResult, DeleteManyResult, SealedView, ClassifiedVerdict } from './types.js';
2
+ import type { FieldMeta } from '../with-shape/introspection/field-meta.js';
3
+ import type { CollectionMeta } from '../with-shape/introspection/meta.js';
4
+ import { type ClassifiedEntry } from '../port/with/classified-strategy.js';
5
+ import type { CrdtState } from '../with-commit/crdt/crdt.js';
6
+ import type { I18nTextDescriptor, DictKeyDescriptor, StaticDictDescriptor, DictionaryHandle } from '../port/with/i18n-strategy.js';
7
+ import type { LookupDescriptor } from '../port/with/lookup-strategy.js';
8
+ import { ViaPipeline } from './via/pipeline.js';
9
+ import { type ViaDescriptor, type ViaEraseReport } from './via/index.js';
10
+ import type { MutationOrigin } from './mutation.js';
11
+ import { type WaveContext, type RollupOutcome, type RollupDeleteIntent } from './via/dispatch.js';
12
+ import type { ComputedFields } from '../with-formula/computed/index.js';
13
+ import { type SealedShredSlot } from './enclave/index.js';
14
+ import { type TierMoveResult } from '../with-audit/tiers/index.js';
15
+ import type { GhostRecord } from './types.js';
16
+ import type { StandardSchemaV1 } from './schema.js';
17
+ import type { DiffEntry } from '../with-commit/history/diff.js';
18
+ import { Query, ScanBuilder } from './query/index.js';
19
+ import type { JoinableSource } from './query/index.js';
20
+ import type { CollectionIndexes } from '../with-lookup/indexing/eager-indexes.js';
21
+ import { LazyQuery } from '../with-lookup/indexing/lazy-builder.js';
22
+ import type { SearchOptions, SearchResult } from '../with-lookup/search/index.js';
23
+ import type { RetrieveOptions, RetrieveHit } from '../with-lookup/search/retrieve-types.js';
24
+ import { type CollectionDescription, type DescribeOptions } from '../with-shape/introspection/describe.js';
25
+ import type { CollectionConfig } from '../with-shape/introspection/types.js';
26
+ import { type LruStats } from './cache/index.js';
27
+ import type { PresenceHandle } from '../with-party/team/presence.js';
28
+ import type { BlobSet } from '../with-shape/blobs/blob-set.js';
29
+ import type { TxContext } from '../with-commit/tx/transaction.js';
30
+ import { type CollectionOpts } from './collection-config.js';
31
+ /**
32
+ * Callback for dirty tracking (sync engine integration). `action: 'revert'`
33
+ * (spec #591) means "un-dirty" — the fan-out wiring in `noydb.ts` routes it
34
+ * to `SyncEngine.removeDirty` instead of `trackChange`; `version` is unused
35
+ * for that action.
36
+ */
37
+ export type OnDirtyCallback = (collection: string, id: string, action: 'put' | 'delete' | 'revert', version: number) => Promise<void>;
38
+ /**
39
+ * Event delivered to a `collection.subscribe()` callback. Distinct
40
+ * from the hub-level `ChangeEvent` — this one is bound to a single
41
+ * collection's type `T` and hydrates the record from cache on put.
42
+ *
43
+ * - `type: 'put'` — `record` is the current decrypted value, or
44
+ * `null` in the rare case where another op deleted the record
45
+ * between the emit and the handler firing.
46
+ * - `type: 'delete'` — `record` is always `null`; the deletion is
47
+ * the only information.
48
+ */
49
+ export interface CollectionChangeEvent<T> {
50
+ readonly type: 'put' | 'delete';
51
+ readonly id: string;
52
+ readonly record: T | null;
53
+ }
54
+ /**
55
+ * Per-collection cache configuration. Only meaningful when paired with
56
+ * `prefetch: false` (lazy mode); eager mode keeps the entire decrypted
57
+ * cache in memory and ignores these bounds.
58
+ */
59
+ export interface CacheOptions {
60
+ /** Maximum number of records to keep in memory before LRU eviction. */
61
+ maxRecords?: number;
62
+ /**
63
+ * Maximum total decrypted byte size before LRU eviction. Accepts a raw
64
+ * number or a human-friendly string: `'50KB'`, `'50MB'`, `'1GB'`.
65
+ * Eviction picks the least-recently-used entry until both budgets
66
+ * (maxRecords AND maxBytes, if both are set) are satisfied.
67
+ */
68
+ maxBytes?: number | string;
69
+ }
70
+ /** Statistics exposed via `Collection.cacheStats()`. */
71
+ export interface CacheStats extends LruStats {
72
+ /** True if this collection is in lazy mode. */
73
+ lazy: boolean;
74
+ }
75
+ /** A typed collection of records within a vault. */
76
+ export declare class Collection<T, S extends keyof T = never, Q extends keyof T & string = never, M extends keyof T & string = never> {
77
+ #private;
78
+ private readonly adapter;
79
+ private readonly vault;
80
+ private readonly name;
81
+ private readonly keyring;
82
+ private readonly storeCiphertext;
83
+ private readonly ramCiphertext;
84
+ private readonly emitter;
85
+ private readonly writeQueue;
86
+ private readonly schemaUpdateGate;
87
+ private readonly schemaFence;
88
+ private readonly writeHooks;
89
+ private readonly subsystemBus;
90
+ private readonly activeTxId;
91
+ private readonly getDEK;
92
+ private readonly onDirty;
93
+ /** #693: live check — true when multi-tab write-propagation is active; gates the #606 marker-id-set fallback read. */
94
+ private readonly tabCoordinated;
95
+ private readonly historyConfig;
96
+ /** True when the caller explicitly provided a `historyConfig` option (vs. inheriting the vault default). */
97
+ private readonly historyConfigExplicit;
98
+ /**
99
+ * tree-shake seam — the strategy that backs `collection.blob(id)`.
100
+ * Defaults to `NO_BLOBS`, a ~10-line stub that throws with an actionable
101
+ * message. Consumers opt into real blob storage by importing
102
+ * `{ blobs }` from `@noy-db/hub/blobs` and passing the returned
103
+ * strategy to `createNoydb({ blobStrategy: blobs() })`. With the
104
+ * default stub, none of the BlobSet / chunk / MIME-magic machinery
105
+ * reaches the bundle.
106
+ */
107
+ private readonly blobStrategy;
108
+ private readonly objectStore;
109
+ private readonly blobFields;
110
+ private readonly blobTierPolicy;
111
+ private readonly aggregateStrategy;
112
+ private readonly crdtStrategy;
113
+ private readonly tiersStrategy;
114
+ private readonly searchStrategy;
115
+ private readonly historyStrategy;
116
+ private readonly syncStrategy;
117
+ private readonly cache;
118
+ private hydrated;
119
+ /**
120
+ * #606: ids known to carry a delete marker in the store — lets the #589
121
+ * re-create version-continuity gate in `_putInternal` read the store ONLY
122
+ * for a known marker prior, instead of unconditionally on every insert.
123
+ * Populated on hydration (`ensureHydrated`/`hydrateFromSnapshot`), local
124
+ * delete (`_doDelete`), and the sync/tab/cutover choke point
125
+ * (`_invalidateCacheEntry`). Accepted drift: `vault._purgeDeleteMarkers`/
126
+ * `_purgeMarkersOn` remove markers directly on the raw store, bypassing
127
+ * Collection, so this set can hold stale ids after a purge on an
128
+ * already-loaded collection — perf-only and self-healing (a stale id just
129
+ * costs one `adapter.get` that returns non-marker/null, and version
130
+ * resolution falls back to 1 correctly). Do not try to wire purge into it.
131
+ */
132
+ private readonly markerIds;
133
+ /**
134
+ * Lazy mode flag. `true` when constructed with `prefetch: false`.
135
+ * In lazy mode the cache is bounded by an LRU and `list()`/`query()`
136
+ * throw — callers must use `scan()` or per-id `get()` instead.
137
+ */
138
+ private readonly lazy;
139
+ /**
140
+ * LRU cache for lazy mode. Only allocated when `prefetch: false` is set.
141
+ * Stores `{ record, version }` entries the same shape as `this.cache`.
142
+ * Tree-shaking note: importing Collection without setting `prefetch:false`
143
+ * still pulls in the Lru class today; future bundle-size work could
144
+ * lazy-import the cache module.
145
+ */
146
+ private readonly lru;
147
+ /**
148
+ * tree-shake seam — per-Collection indexing state. Owned by the
149
+ * `IndexStrategy` passed through from `createNoydb({ indexStrategy })`.
150
+ * Defaults to a disabled state (both accessors return null) so the
151
+ * `CollectionIndexes` / `PersistedCollectionIndex` / `LazyQuery`
152
+ * classes never reach the bundle when indexing is unused.
153
+ *
154
+ * Accessor helpers below (`get indexes()`, `get persistedIndexes()`)
155
+ * preserve the field-access ergonomics without changing every
156
+ * caller site.
157
+ */
158
+ private readonly indexState;
159
+ /**
160
+ * In-memory unique-constraint enforcement for eager mode.
161
+ * `null` when no `unique:true` indexes are declared on this collection, or when the collection is in lazy mode (which throws at registration).
162
+ */
163
+ private readonly uniqueConstraints;
164
+ /**
165
+ * True once `_idx/*` side-cars have been bulk-loaded into
166
+ * `persistedIndexes`. Flipped by `ensurePersistedIndexesLoaded()` on
167
+ * first lazy-mode query so subsequent queries skip the adapter round
168
+ * trip. Invalidation (remote sync, rotation) resets it alongside
169
+ * `persistedIndexes.clear()`.
170
+ */
171
+ private persistedIndexesLoaded;
172
+ /**
173
+ * Accessor for the in-memory eager-mode index mirror. Returns `null`
174
+ * when indexing is disabled on this Noydb instance (the
175
+ * `NO_INDEXING` default) or when the collection is in lazy mode
176
+ * (which uses the persisted mirror instead).
177
+ */
178
+ private get indexes();
179
+ /**
180
+ * Accessor for the persisted-mirror (lazy-mode) index. Returns `null` when indexing is disabled or the collection is in eager mode.
181
+ */
182
+ private get persistedIndexes();
183
+ /**
184
+ * per-collection reconcile-on-open policy. Read once
185
+ * from `CollectionOptions.reconcileOnOpen` and applied by
186
+ * `ensurePersistedIndexesLoaded()` on the first lazy-mode query.
187
+ */
188
+ private readonly reconcileOnOpen;
189
+ /**
190
+ * Re-entrancy guard for the auto-reconcile path. `reconcileIndex`
191
+ * reloads the mirror after applying fixes, which re-enters
192
+ * `ensurePersistedIndexesLoaded`; without this flag we'd trigger a
193
+ * second auto-reconcile pass and potentially infinite recursion.
194
+ */
195
+ private autoReconciling;
196
+ /**
197
+ * Optional Standard Schema v1 validator. When set, every `put()` runs
198
+ * the input through `validateSchemaInput` before encryption, and every
199
+ * record coming OUT of `decryptRecord` runs through
200
+ * `validateSchemaOutput`. A rejected input throws
201
+ * `SchemaValidationError` with `direction: 'input'`; drifted stored
202
+ * data throws with `direction: 'output'`. Both carry the rich issue
203
+ * list from the validator so UI code can render field-level messages.
204
+ *
205
+ * The schema is stored as `StandardSchemaV1<unknown, T>` because the
206
+ * collection type parameter `T` is the OUTPUT type — whatever the
207
+ * validator produces after transforms and coercion. Users who pass a
208
+ * schema to `defineNoydbStore` (or `Collection.constructor`) get their
209
+ * `T` inferred automatically via `InferOutput<Schema>`.
210
+ */
211
+ private readonly schema;
212
+ /**
213
+ * Vault-default locale. Used as the fallback when no per-call
214
+ * locale option is passed to `get()`/`list()`. Provided by Vault
215
+ * at collection construction time via the `collection({ locale })` or
216
+ * `openVault(name, { locale })` path.
217
+ *
218
+ * `undefined` means "no default locale set" — i18nText fields will
219
+ * throw `LocaleNotSpecifiedError` unless a per-call locale is passed.
220
+ */
221
+ private readonly defaultLocale;
222
+ /** Field name → `I18nTextDescriptor` for `i18nText()` fields (`i18nFields` option); write/read runs through the compiled `via` i18n binding — this remains for `describe()` and the search-index build path. Mutable — see {@link _reconcileReadState} (#671 item 2). */
223
+ private i18nFields;
224
+ /** The configured string fields exposed to `retrieve()`; `undefined` for ordinary collections (zero-cost). */
225
+ private readonly textIndexes;
226
+ /** Session-scoped lexical index store; `undefined` (zero-cost) unless `textIndexes` is non-empty. */
227
+ private readonly searchIndexStore;
228
+ /** Embedding config for write-time vector derivation; `undefined` (zero-cost) for ordinary
229
+ * collections. When set, `put()` encodes the source field(s) and stores an encrypted `_vec` sidecar. */
230
+ private readonly embeddings;
231
+ /** In-memory vector set, populated lazily from `_vec` sidecars; `undefined` when no embedding config is declared. */
232
+ private vectorSet;
233
+ /** Field name → `DictKeyDescriptor` for `dictKey()` fields; used by `get()`/`list()` to add `<field>Label` virtual fields when a locale is requested. Mutable — see {@link _reconcileReadState} (#671 item 2). */
234
+ private dictKeyFields;
235
+ /** Field name → `LookupDescriptor` for native `lookup()`/`enumOf()`/`dict()` fields (#650 Task 2) — describe()-only in this task. Mutable — see {@link _reconcileReadState} (#671 item 2). */
236
+ private lookupFields;
237
+ /** Sync join-dressing hook (#650 Task 6, #626 retirement) — `querySourceForJoin()`'s `presentForJoin`. Mutable — see {@link _reconcileReadState} (#671 item 3). */
238
+ private presentForJoin;
239
+ /** Consumer-neutral per-field descriptors declared via `fieldMeta`; read by `getFieldMeta()`, merged by `describe()`. */
240
+ private fieldMeta;
241
+ /** Collection-level descriptive metadata declared via `meta`; read by `getMeta()`, surfaced in `describe()`. */
242
+ private meta;
243
+ /** Outbound ref declarations (snapshot from vault refRegistry at construction time); used by `describe()`. */
244
+ private readonly _refs;
245
+ /** Money field descriptors keyed by field path, typed as the opaque {@link ViaDescriptor} marker
246
+ * (the kernel never inspects the concrete shape); `put()` quantizes to a scaled-int string,
247
+ * `get()`/`list()` decode back. Mutable so {@link _applyMoneyFields} can attach. */
248
+ private moneyFields;
249
+ private via;
250
+ /**
251
+ * Computed scalar fields, evaluated first on every `put()`. Mutable for
252
+ * the same MV-pre-creation reconcile as {@link moneyFields}.
253
+ */
254
+ private computed;
255
+ /**
256
+ * Resolved classified() sensitive-field descriptors, declared via the
257
+ * `classifiedFields` collection option. Mutable so {@link _applyClassifiedFields}
258
+ * can attach a declaration to a collection MV-analysis pre-created.
259
+ */
260
+ private classified;
261
+ /**
262
+ * Frozen construction-time facts the refusal matrix (R1-R5) checks against.
263
+ * Stored so {@link _applyClassifiedFields} — door 2, the reconcile seam —
264
+ * can re-run the SAME guard the config resolver ran at door 1 (C5's lesson:
265
+ * crdt/conflictPolicy/perRecordKeys are construction-only but
266
+ * classifiedFields can attach later).
267
+ */
268
+ private readonly classifiedGuardCtx;
269
+ /**
270
+ * Digest-only classified fields (`storage: 'digest-only'`), keyed by field
271
+ * name — the enclave-consumable policy map the codec's write path carries
272
+ * `_vdig` forward under (C6). `null` when the collection declares none.
273
+ */
274
+ private readonly vdigFields;
275
+ /** C-A/R10 memoization: marker declared-set lookup (undefined=unresolved) + classified-handle persist-once flag. */
276
+ private _markerDigestOnlyCache;
277
+ private _markerPersisted;
278
+ /**
279
+ * Tree-shake seam for `reveal()` — defaults to `NO_CLASSIFIED`, which
280
+ * throws `ClassifiedNotEnabledError`. Set via the `classifiedStrategy`
281
+ * `createNoydb()` option (opt in with `withClassified()`).
282
+ */
283
+ private readonly classifiedStrategy;
284
+ /** Async callback provided by the Vault to open a dynamic dictionary handle (for label-map pre-computation in the search index). Only used in `resolveDictLabelMaps()`; static dicts bypass this entirely. Mutable, assign-once — see {@link _reconcileReadState} (#671 item 1). */
285
+ private getDictionary;
286
+ /**
287
+ * declared deterministic fields. `null` when the feature
288
+ * is inactive for this collection; a frozen `Set` otherwise.
289
+ */
290
+ private readonly deterministicFields;
291
+ /**
292
+ * Declared structural-group-encryption fields (`sensitive`). Each is
293
+ * sealed into its own `_sealed[field]` slot under a per-field key and kept
294
+ * out of the open `_data` blob. Empty set ⇒ feature off (byte-identical
295
+ * output). See {@link encryptRecord} / {@link decryptRecord}.
296
+ */
297
+ private readonly sensitiveFields;
298
+ /**
299
+ * Per-record CEK opt-in (`perRecordKeys: true`). When set, writes mint /
300
+ * reuse a per-record content-encryption key and stamp `_cek` on the
301
+ * envelope (see {@link EncryptedEnvelope._cek}). OFF by default — a
302
+ * non-adopting collection takes the byte-identical legacy path. The READ
303
+ * path does not consult this flag: `_cek` presence on the envelope is the
304
+ * format discriminant, so a mixed vault (and a recipient that never set the
305
+ * flag) still decrypts CEK records.
306
+ */
307
+ private readonly perRecordCek;
308
+ /**
309
+ * Per-record provenance opt-in (`provenance: true`). When set, `put()` calls
310
+ * that supply a `source` option stamp `_source`/`_sourceTs` onto the
311
+ * unencrypted envelope metadata. Off by default — zero cost for collections
312
+ * that don't need lineage tracking.
313
+ */
314
+ private readonly provenance;
315
+ /**
316
+ * Session-scoped `(id) → CEK` cache for this collection. Lets updates
317
+ * reuse a record's stable CEK and lets repeated reads skip the AES-KW
318
+ * unwrap. Bounded by LRU; never persisted. Dropped when the owning
319
+ * collection instance is discarded — `vault.load()` clears the
320
+ * collectionCache, so a keyring refresh drops every CEK alongside the
321
+ * DEK cache. `null` unless `perRecordCek` is set.
322
+ */
323
+ private readonly cekCache;
324
+ /**
325
+ * The per-record envelope build + encrypt/decrypt + per-record-CEK +
326
+ * sealed-field crypto, extracted off this god-object. Holds no mutable
327
+ * state of its own — it shares this collection's `cekCache` reference (so
328
+ * tier methods and `vault.invalidateRecordCaches` evictions stay visible to
329
+ * it) and reads the rest of its dependencies as a frozen context snapshot.
330
+ */
331
+ private readonly codec;
332
+ /**
333
+ * declared tiers for this collection. `null` when
334
+ * tier-aware methods are disabled. Tier 0 is implicit and never
335
+ * stored here.
336
+ */
337
+ private readonly tiers;
338
+ private readonly tierMode;
339
+ private readonly onCrossTierAccess;
340
+ private readonly addSubjectRef;
341
+ /**
342
+ * Optional reference to the vault-level hash-chained audit log. When present, every successful `put()` and `delete()` appends an entry to the ledger AFTER the adapter write succeeds (so a failed adapter write never produces an orphan ledger entry).
343
+ *
344
+ * The ledger is always a vault-wide singleton — all
345
+ * collections in the same vault share the same LedgerStore.
346
+ * Vault.ledger() does the lazy init; this field just holds
347
+ * the reference so Collection doesn't need to reach back up to the
348
+ * vault on every mutation.
349
+ *
350
+ * `undefined` means "no ledger attached" — supported for tests that
351
+ * construct a Collection directly without a vault, and for
352
+ * future backwards-compat scenarios. Production usage always has a
353
+ * ledger because Vault.collection() passes one through.
354
+ */
355
+ private readonly ledger;
356
+ /** — per-collection CRDT mode, or undefined for normal LWW-at-record-level. */
357
+ private readonly crdtMode;
358
+ /** — optional remote/sync adapter for presence broadcasting. */
359
+ private readonly syncAdapter;
360
+ /** — consent-audit hook, no-op when no scope is active. */
361
+ private readonly onAccess;
362
+ /**
363
+ * Vault-internal hook for derivation dispatch. When set,
364
+ * `Collection.put` consults the registry after the source-write
365
+ * commits and writes derived outputs through `getCollection(name).put`.
366
+ */
367
+ private readonly derivationSource;
368
+ /**
369
+ * Vault-internal hook for materialized-view dispatch.
370
+ * Parallel to `derivationSource` — when set, `Collection.put` fires
371
+ * `MaterializedViewRegistry.onSourceWrite` after the source-write
372
+ * commits + after `dispatchDerivations` has run.
373
+ */
374
+ private readonly materializedViewSource;
375
+ /** #638 Task 4 — `Vault._collectGraphTouch`; a no-op absent an open batch. `collectDelete` (#640) is the sync-apply delete socket. */
376
+ private readonly graphDispatch;
377
+ /**
378
+ * Optional back-reference to the owning compartment's ref
379
+ * enforcer. When present, `Collection.put` calls
380
+ * `refEnforcer.enforceRefsOnPut(name, record)` before the adapter
381
+ * write, and `Collection.delete` calls
382
+ * `refEnforcer.enforceRefsOnDelete(name, id)` before its own
383
+ * adapter delete. The Vault handles the actual registry
384
+ * lookup and cross-collection enforcement — Collection just
385
+ * notifies it at the right points in the lifecycle.
386
+ *
387
+ * Typed as a structural interface rather than `Vault`
388
+ * directly to avoid a circular import. Vault implements
389
+ * these two methods; any other object with the same shape would
390
+ * work too (used only in unit tests).
391
+ */
392
+ private readonly refEnforcer;
393
+ /**
394
+ * Optional back-reference to the owning compartment's join resolver
395
+ *`). When present,
396
+ * `Collection.query()` builds a `JoinContext` that lets the Query
397
+ * resolve `.join(field)` calls into target collections via this
398
+ * resolver.
399
+ *
400
+ * Two methods:
401
+ * - `resolveSource(name)` — fetch a `JoinableSource` for the
402
+ * right-side collection by name. Returning `null` means "no
403
+ * such collection in this compartment" — the executor then
404
+ * throws an actionable error naming the missing target.
405
+ * - `resolveRef(leftCollection, field)` — look up the ref
406
+ * descriptor the left collection declared for this field.
407
+ * `null` when the field has no ref, which makes `.join()`
408
+ * throw at plan time before any records are touched.
409
+ *
410
+ * Typed structurally rather than as `Vault` to avoid a
411
+ * circular import. Vault implements these two methods; any
412
+ * other object with the same shape works too (used only in unit
413
+ * tests against a plain object).
414
+ */
415
+ private readonly joinResolver;
416
+ constructor(opts: CollectionOpts<T>);
417
+ /**
418
+ * Return the Standard Schema validator attached to this collection,
419
+ * or `undefined` if none was provided at construction time.
420
+ *
421
+ * Exposed (read-only) for the Vault-level export primitive,
422
+ * which surfaces each collection's schema in the per-chunk metadata
423
+ * so downstream serializers (`@noy-db/as-*` packages, custom
424
+ * exporters) can produce schema-aware output without poking at
425
+ * collection internals. The validator object is returned by
426
+ * reference — callers must treat it as immutable.
427
+ */
428
+ getSchema(): StandardSchemaV1<unknown, T> | undefined;
429
+ /** The declared consumer-neutral field metadata channel (canonical). */
430
+ getFieldMeta(): Record<string, FieldMeta> | undefined;
431
+ /** The collection's declared descriptive metadata. */
432
+ getMeta(): CollectionMeta | undefined;
433
+ /**
434
+ * Aggregate all collection-level configuration options that are actively set
435
+ * into a {@link CollectionConfig} snapshot. Returns `undefined` when no options
436
+ * are configured (omitting the `config` block from `dumpSchema()` output).
437
+ * Consumed by `walk.ts` to populate `CollectionDescriptor.config`.
438
+ */
439
+ getConfig(): CollectionConfig | undefined;
440
+ /**
441
+ * Describe the collection's field schema from in-memory config — zero store I/O.
442
+ * Sync overload (no args): merges moneyFields/dictKeyFields/refs/computed/fieldMeta/
443
+ * taint into a {@link CollectionDescription} (types inferred from config; the async
444
+ * overload also derives validator-exact types and resolves dynamic dict labels).
445
+ */
446
+ describe(): CollectionDescription;
447
+ describe(opts: DescribeOptions): Promise<CollectionDescription>;
448
+ /**
449
+ * Async describe implementation. Derives validator-exact types via deriveZodFields
450
+ * (lazy, no static zod import), optionally resolves dynamic-dict labels from vault.dictionary(name).list(),
451
+ * then delegates to buildDescription (which also runs fieldMeta key-validation).
452
+ */
453
+ private describeAsync;
454
+ /** JSON Schema for this collection with describe() metadata as x- extensions. */
455
+ toJSONSchema(): Promise<object>;
456
+ /** Single-point audited reveal of one classified field. Requires withClassified(). */
457
+ reveal(id: string, field: string): Promise<unknown>;
458
+ /** Verify-without-reveal: verdict-only oracle for one classified field. Requires withClassified(). */
459
+ verify(id: string, field: string, candidate: string): Promise<ClassifiedVerdict>;
460
+ /** k-of-n challenge over the collection's secretAnswer members. Requires withClassified(). */
461
+ verifyGroup(id: string, answers: Record<string, string>, opts: {
462
+ readonly min: number;
463
+ }): Promise<{
464
+ readonly passed: boolean;
465
+ }>;
466
+ private _classifiedVerifyCtx;
467
+ /**
468
+ * Equatable blind-index lookup: the ids whose classified digest-only
469
+ * `equatable` field carries a `_bidx` tag matching `candidate` AND whose
470
+ * `_vdig` payload confirms it. Requires the field to be declared
471
+ * `classified.password({ equatable: true })` (or `secretAnswer`) and the
472
+ * collection to have opened its `acknowledgeEquatableRisk` door.
473
+ *
474
+ * The algorithm order is load-bearing (spec §3):
475
+ * 1. Caller-bug refusals thrown at ~0 elapsed, BEFORE any PBKDF2 (R9 /
476
+ * Oracle #6): the three field mis-declarations share ONE constant,
477
+ * field-name-free message so the refusal text cannot enumerate which
478
+ * fields are classified / digest-only / equatable.
479
+ * 2. Derive the ONE blind-index target UNCONDITIONALLY (I-1 / F1): an empty
480
+ * collection still pays exactly one 600K PBKDF2, so wall-time can never
481
+ * distinguish "no records" from "no match". No early return may precede
482
+ * this line.
483
+ * 3. Scan `list + one get` per id, string-comparing the stored `_bidx` tag —
484
+ * decrypting NOTHING — and retain each hit's already-fetched envelope.
485
+ * 4. Emit the single sweep consent op (`onAccess('find', '*')`) now — after
486
+ * the scan, before confirm (Oracle #5) — fixing its store-write timestamp
487
+ * independent of hit count.
488
+ * 5. Confirm-by-verify against the ALREADY-FETCHED envelope (C-B): run the
489
+ * enclave `verifyDigestField` on an in-memory `getEnvelope` closure so the
490
+ * confirm reads ZERO additional envelopes. A tag-hit whose `_vdig` fails
491
+ * to confirm is dropped silently (a splice is indistinguishable from a
492
+ * stale tag). Store-shape law: the only store calls are `list + N get`.
493
+ */
494
+ findByDigest(field: string, candidate: string): Promise<readonly string[]>;
495
+ /**
496
+ * Retire a field's equatable blind-index (`_bidx`) coverage across every
497
+ * live record — the SOLE lazy-write-independent drop-path for a still-live
498
+ * record's tag (besides clear / `forget()` / DEK-rotation). For each envelope
499
+ * carrying `_bidx[field]`, rewrite it WITHOUT that slot (dropping the whole
500
+ * `_bidx` map when it becomes empty), leaving `_vdig[field]` and everything
501
+ * else INTACT — the field stays `digest-only`, only the index coverage is
502
+ * retired. NO crypto, NO re-mint, NO re-encrypt: a targeted envelope rewrite.
503
+ * Returns the count of records scrubbed.
504
+ *
505
+ * This is a maintenance write, not a read-egress: it emits NO `'find'` op and
506
+ * no consent. The field is validated to a declared equatable digest-only
507
+ * classified field (only such a field ever carries `_bidx`).
508
+ *
509
+ * **Ledger consistency**: dropping `_bidx[field]` changes the envelope's
510
+ * payload hash (`_bidx` is bound into `envelopeBodyForHash`), so a raw
511
+ * `adapter.put` of the scrubbed envelope WITHOUT a matching ledger entry would
512
+ * desync the chain and make a future integrity cross-check flag false
513
+ * tampering. After each rewrite we therefore append an `op:'migration'` entry
514
+ * recording the NEW payloadHash at the SAME version — this is index retirement,
515
+ * not a new record version, so `_v` is NOT bumped; the migration op is
516
+ * reverse-delta-inert (`ledger.reconstruct` skips non-put/delete ops) yet
517
+ * keeps the hash chain and the record's latest recorded payloadHash correct.
518
+ */
519
+ scrubEquatableTags(field: string): Promise<number>;
520
+ /**
521
+ * @internal — attach money descriptors post-construction. MV dependency
522
+ * analysis auto-creates a source collection (without options) during
523
+ * `openVault`, before the user's `collection(name, { moneyFields })`
524
+ * declaration; this reconciles that ordering. First-wins. Not public.
525
+ *
526
+ * PREPENDS money rather than appending: {@link compileViaBindings} always
527
+ * compiles money before i18n (money-first pipeline order — see its
528
+ * docstring), and by the time this reconcile runs an i18n binding may
529
+ * already be sitting in `this.via.bindings` (declared at construction).
530
+ * Appending here would yield `[i18n, money]` on this path vs `[money,
531
+ * i18n]` from compile — prepending keeps both paths money-first.
532
+ */
533
+ _applyMoneyFields(moneyFields: Record<string, ViaDescriptor>): void;
534
+ /** @internal — attach computed fields post-construction. See {@link _applyMoneyFields}. */
535
+ _applyComputed(computed: ComputedFields): void;
536
+ /** @internal — attach fieldMeta post-construction. See {@link _applyMoneyFields}. First-wins. */
537
+ _applyFieldMeta(fieldMeta: Record<string, FieldMeta>): void;
538
+ /** @internal — attach collection-level meta post-construction. See {@link _applyMoneyFields}. First-wins. */
539
+ _applyMeta(meta: CollectionMeta): void;
540
+ /**
541
+ * @internal — attach classified fields post-construction. See {@link _applyMoneyFields}.
542
+ * First-wins. Note: unlike money/computed/meta, this cannot retro-seal a
543
+ * collection that was already auto-created — `sensitiveFields` is frozen at
544
+ * construction time. A reconciled declaration is only accepted when none of
545
+ * its members are `storage: 'recoverable'` (those require sealing at first
546
+ * open); otherwise this throws rather than silently persisting the value as
547
+ * inline plaintext while `describe()` advertises protection.
548
+ */
549
+ _applyClassifiedFields(classifiedFields: Record<string, ClassifiedEntry>): void;
550
+ get _ramCiphertext(): boolean;
551
+ /**
552
+ * Get a single record by ID.
553
+ *
554
+ * @param id Record identifier.
555
+ * @param locale Optional locale options. When provided,
556
+ * `i18nText` fields are resolved to the requested locale
557
+ * string, and `dictKey` fields get a `<field>Label`
558
+ * virtual field added. Pass `{ locale: 'raw' }` to
559
+ * return the full `{ [locale]: string }` map instead.
560
+ *
561
+ * @returns The decrypted (and optionally locale-resolved) record, or
562
+ * `null` if not found.
563
+ */
564
+ get(id: string, locale?: LocaleReadOptions): Promise<SealedView<T, S> | null>;
565
+ /**
566
+ * Return the raw CRDT state for a record.
567
+ * Only available on collections configured with `crdt: 'lww-map' | 'rga' | 'yjs'`.
568
+ * Use this for merge operations or to pass to `@noy-db/yjs`.
569
+ * Throws if the collection is not in CRDT mode.
570
+ */
571
+ getRaw(id: string): Promise<CrdtState | null>;
572
+ /**
573
+ * Read a record's unencrypted envelope metadata (version, timestamps,
574
+ * provenance) without decrypting the body.
575
+ *
576
+ * Returns `null` when no envelope exists for `id` (record absent or never
577
+ * written). Only `_source`/`_sourceTs` fields are populated when the
578
+ * collection was opened with `provenance: true` AND the record was written
579
+ * with a `source` option — but this method works on any collection because
580
+ * it reads the raw envelope directly.
581
+ *
582
+ * @returns `{ version, timestamp, by?, source?, sourceTs? }` or `null`.
583
+ *
584
+ * @example
585
+ * const meta = await clients.getMetadata('c1')
586
+ * if (meta) console.log(meta.source, meta.timestamp)
587
+ */
588
+ getMetadata(id: string): Promise<{
589
+ readonly version: number;
590
+ readonly timestamp: string;
591
+ readonly by?: string;
592
+ readonly source?: string;
593
+ readonly sourceTs?: string;
594
+ } | null>;
595
+ /**
596
+ * Return a presence handle for this collection.
597
+ *
598
+ * The handle manages an encrypted ephemeral presence channel keyed by an
599
+ * HKDF derivation of this collection's DEK. Presence payloads are invisible
600
+ * to the adapter.
601
+ *
602
+ * @param opts.staleMs Milliseconds before a peer is considered inactive.
603
+ * Default: 30 000.
604
+ * @param opts.pollIntervalMs Milliseconds between storage polls (fallback mode).
605
+ * Default: 5 000.
606
+ */
607
+ presence<P = unknown>(opts?: {
608
+ staleMs?: number;
609
+ pollIntervalMs?: number;
610
+ }): PresenceHandle<P>;
611
+ /**
612
+ * Create or update a record. Runs inside the hub's write-queue tracker
613
+ * so `hub.writeQueue.pending` reflects this write.
614
+ *
615
+ * @param id Record identifier.
616
+ * @param record The record body (validated by the collection's schema
617
+ * if one was attached at `vault.collection(...)` time).
618
+ * @param options Optional metadata for audit + import workflows.
619
+ * `reason` is stamped onto the resulting ledger entry
620
+ * so audit consumers can filter via
621
+ * `entries.filter(e => e.reason?.startsWith('import:'))`.
622
+ * `source` is an opaque source id (e.g. `'crm-sync'`, `'firm-A'`)
623
+ * stamped onto the envelope as `_source`/`_sourceTs` when
624
+ * the collection has `provenance: true`. Ignored otherwise
625
+ * (zero cost).
626
+ * `sourceTs` is an optional ISO-8601 origin timestamp override;
627
+ * when supplied together with `source` on a provenance collection,
628
+ * replaces the machine-stamped `now()` so re-merges preserve the
629
+ * ORIGIN refresh time across vaults. (FR-4)
630
+ */
631
+ put(id: string, record: T, options?: {
632
+ readonly reason?: string;
633
+ readonly source?: string;
634
+ readonly sourceTs?: string;
635
+ }): Promise<void>;
636
+ /**
637
+ * Resolve the prior stored record (with its `_i18nFilled` marker) for
638
+ * densify. Eager: in-memory cache; lazy: LRU then adapter. undefined if absent.
639
+ */
640
+ private resolveDensifyPrior;
641
+ /**
642
+ * Densify provenance for a record: which i18n slots were auto-filled,
643
+ * e.g. `{ name: ['en'] }`. undefined when nothing was filled. The marker is
644
+ * stripped from ordinary reads; this is the sanctioned audit accessor.
645
+ */
646
+ i18nProvenance(id: string): Promise<Record<string, readonly string[]> | undefined>;
647
+ /**
648
+ * Validate a record against this collection's schema WITHOUT writing it.
649
+ * Returns the (possibly coerced) record on success; throws
650
+ * {@link SchemaValidationError} (direction: `'input'`) on violation.
651
+ * A no-op pass-through when no schema is declared.
652
+ *
653
+ * Used by FR-8 migrate-then-merge to pre-validate all staged records
654
+ * before `mergeDecryptedRecords` writes anything — so a failed upgrade
655
+ * never half-writes the receiver.
656
+ */
657
+ validateInput(record: T): Promise<T>;
658
+ /**
659
+ * Resolve the prior record as REAL VALUES for the eager write/delete paths
660
+ * (history snapshot, ledger patch, index upkeep). The eager cache holds
661
+ * {@link Sealed} handles for sensitive fields (non-residency), so when the
662
+ * collection seals anything we re-decrypt the stored envelope to materialise
663
+ * real values — re-encrypting a handle would otherwise persist the marker
664
+ * `'[sealed]'` in place of the value. `via?.hasAtRestHooks` (#642) catches
665
+ * hook-only sealing (taint/classified, no local `sensitiveFields`).
666
+ */
667
+ private resolvePriorValues;
668
+ /** Resolves the prior envelope/record for a gate event; elides the read (#267) when no handler at `point` needs it (`elided: true`, `env`/`record` null). */
669
+ private resolveGatePrior;
670
+ /**
671
+ * Wraps {@link RecordCodec.toCacheRecord} with an additional strip for
672
+ * digest-only classified fields: the codec already omits them from `_data`
673
+ * on write, but the write path caches the pre-encrypt `record` object
674
+ * directly (to skip a redundant decrypt) — without this, a vdig field's
675
+ * plaintext would sit in the working-set cache and `get()` would leak it
676
+ * right back out, defeating C6.
677
+ */
678
+ private _toCacheableRecord;
679
+ /** @internal Untracked put body — call {@link put}, not this. */
680
+ private _putInternal;
681
+ /**
682
+ * Fire registered MV strategies whose dependency set includes this
683
+ * collection. Eager-mode MVs re-materialize inline via
684
+ * `MaterializedViewExecutor.refresh`; lazy / manual modes are
685
+ * no-ops in the foundation; wired in the lazy-mode implementation.
686
+ *
687
+ * Skips entirely when the record being written is itself an
688
+ * MV-emitted row (carries `_materializedFrom`) — defensive guard
689
+ * against missed cycle detection.
690
+ *
691
+ * @internal `wave` (#638 Task 4): when present (the sync/cutover/restore dispatch wave),
692
+ * an eager MV already refreshed this wave is skipped (per-target dedup, keyed on spec name).
693
+ */
694
+ dispatchMaterializedViews(id: string, record: T, wave?: WaveContext): Promise<void>;
695
+ /**
696
+ * Fire registered derivation strategies for this source collection.
697
+ * Eager mode runs `derive` inline and writes each output via the
698
+ * sibling `Collection.put`; lazy mode marks dependent outputs stale
699
+ * (D11 stub today). Errors in non-strict mode are logged and
700
+ * skipped; strict mode propagates the first failing output's error.
701
+ *
702
+ * Skips entirely when the record being written is itself a derived
703
+ * output (carries `_derivedFrom`) — defensive guard against missed
704
+ * cycle detection.
705
+ */
706
+ /**
707
+ * @internal The RAW stored record (canonical-money form, i18n maps
708
+ * intact), WITHOUT the locale resolution `get()` applies. Used as the
709
+ * patch base for self-write reverse-denorm so writing back never clobbers
710
+ * an i18n map or re-quantizes money incorrectly. Returns null for
711
+ * missing / tombstoned records.
712
+ */
713
+ _getStoredRecord(id: string): Promise<T | null>;
714
+ /** @internal #638 Task 4 — decrypted STORED-form record + envelope version for the sync/cutover/
715
+ * restore dispatch wave (id threaded into decrypt, matching `_invalidateCacheEntry`'s contract). */
716
+ _getStoredRecordForDispatch(id: string): Promise<{
717
+ record: T;
718
+ version: number;
719
+ } | null>;
720
+ /**
721
+ * @internal Ids of records whose top-level `field` equals `value`.
722
+ * Uses the FK index when the field is indexed (O(matches)); otherwise a
723
+ * linear scan (O(N) — fine for small child sets; index the FK to scale).
724
+ */
725
+ _findMatchingIds(field: string, value: unknown): Promise<string[]>;
726
+ /** @internal Recompute a rollup aggregate onto the parent from `parentId`'s current children (value-equality guarded; no-op absent parent).
727
+ * `wave` (#638 T4, #640): per-target dedup. Returns the `putDerivedOutput` outcome, or `'noop'` (no parent/no-op/deduped) — `dispatchRollupsOnDelete`'s forget-fanout caller + #640's `_recomputeDeletedRollups` need this to fill their reports. */
728
+ private recomputeRollup;
729
+ /** @internal #640 — this deleted child's rollup PARENT intents (see via/dispatch.ts#resolveRollupDeleteIntents). */
730
+ _rollupDeleteIntents(deleted: T): RollupDeleteIntent[];
731
+ /**
732
+ * @internal Fire any rollups for which THIS collection is the child `from`, recomputing the
733
+ * affected parent after a child delete/forget. Called from the delete path (return discarded)
734
+ * and from `forgetDerivedFanout` (#638 Task 6), which needs the per-target outcome to fill
735
+ * `ForgetResult.derivedAggregatesRecomputed`/`derivedResidueFrozen`). `wave` (#640): per-target dedup for the sync-apply path; `undefined` on local-delete (byte-identical).
736
+ */
737
+ dispatchRollupsOnDelete(id: string, deleted: T, wave?: WaveContext): Promise<ReadonlyArray<{
738
+ readonly into: string;
739
+ readonly parentId: string;
740
+ readonly outcome: RollupOutcome;
741
+ }>>;
742
+ /** @internal #640 — the wave's per-id driver: recompute each sync-apply delete's rollup parent. */
743
+ _recomputeDeletedRollups(intents: readonly RollupDeleteIntent[], wave: WaveContext): Promise<void>;
744
+ /** @internal `wave` (#638 Task 4) — threaded to `recomputeRollup` for the sync/cutover/restore
745
+ * dispatch wave's per-target dedup; `undefined` on the local-write path (byte-identical). */
746
+ dispatchDerivations(id: string, record: T, version: number, wave?: WaveContext): Promise<void>;
747
+ /**
748
+ * Delete a record by ID. Runs inside the hub's write-queue tracker
749
+ * so `hub.writeQueue.pending` reflects this write.
750
+ */
751
+ delete(id: string): Promise<void>;
752
+ /**
753
+ * @internal — bulk-rewrite every record through a cutover transform. Raw adapter path (bypasses the write gate + guards — the transform is trusted and runs only during the `migrating` phase). Bumps each record's `_v` and appends a ledger `op:'migration'` entry. #708: refuses BEFORE any rewrite if a live record is elevated (assertCutoverTierSafe) — demote it first.
754
+ */
755
+ _applyCutoverTransform(transform: (doc: Record<string, unknown>) => Record<string, unknown>): Promise<number>;
756
+ /** @internal Untracked delete body — call {@link delete}, not this. */
757
+ private _deleteInternal;
758
+ /**
759
+ * @internal — system-internal delete that bypasses user-facing
760
+ * delete hooks (`onDelete`, FK ref enforcer). Used by derivation tombstones and MV refresh
761
+ * (Dim 14 v2) — system housekeeping shouldn't trip user invariants
762
+ * registered against the output collection. The ledger entry and
763
+ * history snapshot still fire so backup integrity and time-travel
764
+ * reconstruction stay consistent.
765
+ *
766
+ * Returns `true` when it erased a live record, `false` for delete-of-absent (idempotent
767
+ * contract — both txCtx-aware and txCtx===null callers honour this, short-circuiting before any side-effect).
768
+ *
769
+ * When a `txCtx` is supplied, the prior envelope is captured and
770
+ * pushed onto `txCtx._executed` BEFORE the delete fires — mirrors
771
+ * the rollback hardening for puts. Callers outside a
772
+ * multi-record transaction pass `null` and skip the tracking.
773
+ *
774
+ * Amendment composition: if `_internalDelete` runs while a vault's
775
+ * `GuardRegistry` has an amendment window open, the `{before, after:
776
+ * null}` change pair is pushed onto the amendment change-set the
777
+ * same way a user-initiated delete would. The `onDelete` user-hook
778
+ * is still skipped (housekeeping must not trip user invariants in
779
+ * normal mode), but the amendment's invariant DOES see the change
780
+ * — so a `RCT-CANCEL-001`-style invariant pairing can reject a
781
+ * derivation-driven tombstone fired during an admin amendment.
782
+ *
783
+ * Constraint to surface to consumers: output collections of
784
+ * derivations with `optional: true` outputs should not be the
785
+ * targets of `strict` or `cascade` inbound foreign-key refs —
786
+ * `_internalDelete` bypasses the ref enforcer by design (the
787
+ * `onDelete` bypass primitive). Treat the housekeeping path as
788
+ * "system can tombstone its own emissions regardless of FK shape."
789
+ *
790
+ * Permission handling is unchanged: the caller must still hold
791
+ * write permission on the collection (derivations run under the
792
+ * user's keyring).
793
+ */
794
+ _internalDelete(id: string, txCtx?: TxContext | null): Promise<boolean>;
795
+ private _doDelete;
796
+ /**
797
+ * @internal — GDPR crypto-shred a LIVE record to a tombstone.
798
+ *
799
+ * Rewrites the on-disk envelope to `{ _noydb, _v, _ts, _by, _iv:'', _data:'' }`,
800
+ * dropping `_iv`/`_data`/`_cek`/`_det`. The wrapped per-record CEK is gone, so
801
+ * the body — and (via {@link tombstoneHistory}) every history version under
802
+ * the same CEK — is permanently undecryptable; the collection DEK and every
803
+ * other record are untouched. `_det` is stripped too, so `findByDet` no
804
+ * longer matches the shredded record (avoiding a post-shred TamperedError).
805
+ *
806
+ * Unlike `delete()`/`_internalDelete`, this:
807
+ * - does NOT fire onDelete guards / MV / derivation dispatch (a shred is an
808
+ * erasure, not a domain delete — re-running those would be wrong),
809
+ * - does NOT append a per-record ledger entry (`vault.forget()` appends a
810
+ * single `op:'forget'` summary for the whole subject),
811
+ * - keeps the record KEY present (it's an overwrite, not an adapter delete)
812
+ * so the version counter + "record existed" survive for audit.
813
+ *
814
+ * Idempotent: returns `null` when the record is absent or already a tombstone.
815
+ * Otherwise returns `{ previousVersion }`. Invalidates the eager cache, the
816
+ * lazy LRU, and the per-record CEK cache for this id.
817
+ */
818
+ /**
819
+ * @internal — decrypt an envelope to a plain record for subject-index
820
+ * rebuild. Returns `null` for a tombstone or unreadable envelope.
821
+ * Skips schema validation — the rebuild only reads the subject field.
822
+ */
823
+ _decodeEnvelope(envelope: EncryptedEnvelope, id: string): Promise<Record<string, unknown> | null>;
824
+ _writeTombstone(id: string, actor: string): Promise<{
825
+ previousVersion: number;
826
+ } | null>;
827
+ /**
828
+ * Cascade deletes of array-shape derived rows when a source row is deleted. Reads each
829
+ * registered strategy's fanout sidecar for this source id, deletes every listed derived
830
+ * row, then deletes the sidecar itself. Returns the REAL erased count (#622 review Finding 1).
831
+ *
832
+ * Record-shape derivations are skipped on the ordinary delete path (see _doDelete's comment).
833
+ * `eraseRecordShapeToo` (#638 T6, default `false`) opts a same-id record-shape copy into
834
+ * erasure too — forget()'s fanout, GDPR residue. A delete-of-absent contributes 0 either way.
835
+ * @internal
836
+ */
837
+ dispatchArrayDerivationsOnDelete(id: string, eraseRecordShapeToo?: boolean): Promise<number>;
838
+ /**
839
+ * Mirror of {@link dispatchMaterializedViews} for the delete/forget path — no `_materializedFrom`
840
+ * skip (record's gone); the `internal` gate at `_doDelete` is the recursion guard. Returns the
841
+ * row count TOMBSTONED across EVERY MV sourced here (#638 T6 — `forgetDerivedFanout`'s
842
+ * `derivedRecordsErased`) — eager AND lazy/manual `invalidateMVAtRest` purges both contribute now
843
+ * (#761 item 1, previously eager-only); lazy persists a stale mark for cold-session recompute;
844
+ * manual serves empty until `refreshView()`. `residueUndecodable`/`residueDeclined` (#776/#785) carry `outputCollection:id` entries whose ownership stamp `invalidateMVAtRest` could not decode, resp. decoded+stamp-matched but declined erasure — surfaced, not erased.
845
+ * @internal
846
+ */
847
+ dispatchMaterializedViewsOnDelete(id: string): Promise<{
848
+ deleted: number;
849
+ residueUndecodable: string[];
850
+ residueDeclined: string[];
851
+ }>;
852
+ /**
853
+ * List all records in the collection.
854
+ *
855
+ * Throws in lazy mode — bulk listing defeats the purpose of lazy
856
+ * hydration. Use `scan()` to iterate over the full collection
857
+ * page-by-page without holding more than `pageSize` records in memory.
858
+ *
859
+ * @param locale Optional locale options. When provided,
860
+ * each record is locale-resolved before being returned.
861
+ */
862
+ list(locale?: LocaleReadOptions): Promise<T[]>;
863
+ /**
864
+ * Scan-mode full-text search over a plain-text `field`. Decrypts the
865
+ * collection in memory and ranks records by BM25 against the tokenized query.
866
+ * **Zero added store leakage** — pure client-side scan; nothing searchable is
867
+ * written to the store. (A store-usable blind index for at-scale search is a
868
+ * separate, gated opt-in.) Eager mode only.
869
+ *
870
+ * `opts.match` (`'any'` default | `'all'`), `opts.prefix` (last query term as
871
+ * a prefix → typeahead), `opts.limit` (top-N). Returns `{ id, score, record }`
872
+ * ranked by descending score. The default tokenizer is word-boundary based —
873
+ * see `src/search/tokenize.ts` for the Thai/CJK caveat.
874
+ */
875
+ search(field: string, query: string, opts?: SearchOptions): Promise<SearchResult<T>[]>;
876
+ /** Force-persist the lexical index now — gated behind `searchStrategy: withSearch()`. */
877
+ flushIndex(): Promise<void>;
878
+ /** Pre-build the lexical index — gated behind `searchStrategy: withSearch()`. */
879
+ warmIndex(): Promise<void>;
880
+ /** Retrieval (lexical | semantic | hybrid) — gated behind `searchStrategy: withSearch()`. */
881
+ retrieve(query: string, opts?: RetrieveOptions<T>): Promise<RetrieveHit<T>[]>;
882
+ /** Raw-vector kNN — gated behind `searchStrategy: withSearch()`. */
883
+ similarTo(vector: Float32Array, opts?: {
884
+ k?: number;
885
+ minScore?: number;
886
+ includeRecord?: boolean;
887
+ }): Promise<RetrieveHit<T>[]>;
888
+ /** Opt-in bulk `_vec` re-derive (#788) — a plain collection has nothing to rebuild; gated behind `searchStrategy: withSearch()` otherwise. */
889
+ rebuildEmbeddings(): Promise<{
890
+ rebuilt: number;
891
+ skipped: number;
892
+ }>;
893
+ /**
894
+ * Bind the {@link SearchContext} the search/retrieval surface needs. The
895
+ * `cache` is the SAME `Map` reference the eager read/write path owns (passed
896
+ * by reference, never copied) so the index always builds over the live set.
897
+ */
898
+ private searchContext;
899
+ /**
900
+ * Put many records in one call. Each item is processed sequentially
901
+ * through the normal `put()` path — meaning per-item validation,
902
+ * history snapshots, ledger appends, and change events all still
903
+ * fire. The round-trip saving comes from the adapter staying hot
904
+ * across the batch (no connection re-open, no keyring re-unlock).
905
+ *
906
+ * ## Semantics
907
+ *
908
+ * **Best-effort with per-item results.** If item 5 of 10 fails, items
909
+ * 1–4 are already persisted and items 6–10 are still attempted.
910
+ * The returned {@link PutManyResult} lists every success and failure
911
+ * individually so the caller can decide whether to roll forward
912
+ * (retry the failures) or roll back (manually delete the successes).
913
+ *
914
+ * **True tx-atomic putMany** — pass `{ atomic: true }` to switch
915
+ * to the transaction executor: pre-flight CAS against every
916
+ * item's `expectedVersion`, then commit all ops with best-effort
917
+ * revert on mid-batch failure. Atomic mode throws on failure rather
918
+ * than returning a mixed-results object.
919
+ *
920
+ * ## Change events
921
+ *
922
+ * One `change` event per successfully-written record, same as N
923
+ * single-record puts. Subscribers don't need to special-case bulk.
924
+ */
925
+ putMany(entries: ReadonlyArray<readonly [id: string, record: T, opts?: PutManyItemOptions]>, options?: PutManyOptions): Promise<PutManyResult>;
926
+ /**
927
+ * Atomic-mode implementation of {@link putMany}. Pre-flights every
928
+ * `expectedVersion`, executes all puts in declaration order, and
929
+ * reverts executed ops via the raw adapter on mid-batch failure.
930
+ * See `runTransaction` for the shared semantics + crash-window caveat.
931
+ *
932
+ * @internal
933
+ */
934
+ private putManyAtomic;
935
+ /**
936
+ * Get many records in one call. Returns a `Map<id, T | null>` —
937
+ * missing records surface as `null` entries so the caller can
938
+ * distinguish "not found" from "lookup failed". Order-stable
939
+ * iteration (Map preserves insertion order = input `ids` order).
940
+ *
941
+ * Reads go through the per-id `get()` path, which means the cache
942
+ * / hydration logic stays consistent with single-record reads.
943
+ */
944
+ getMany(ids: readonly string[]): Promise<Map<string, T | null>>;
945
+ /**
946
+ * Delete many records in one call. Same best-effort contract as
947
+ * {@link putMany}: if item 5 fails, items 1–4 are already deleted
948
+ * and items 6–10 are still attempted.
949
+ *
950
+ * Deleting a non-existent id is not a failure — matches the
951
+ * idempotent semantics of single-record `delete()`.
952
+ */
953
+ deleteMany(ids: readonly string[]): Promise<DeleteManyResult>;
954
+ /**
955
+ * Build a chainable query against the collection. Returns a `Query<T>`
956
+ * builder when called with no arguments.
957
+ *
958
+ * Backward-compatible overload: passing a predicate function returns
959
+ * the filtered records directly (the API). Prefer the chainable
960
+ * form for new code.
961
+ *
962
+ * **Lazy-MV gap:** `query()` is synchronous and does NOT
963
+ * trigger lazy materialized-view resolve-on-read. If this
964
+ * collection is a lazy MV's output and the MV is currently stale,
965
+ * `query().toArray()` returns the pre-stale snapshot. To force a
966
+ * fresh read on a lazy MV, either call `list()` (which DOES
967
+ * trigger resolve) or `vault.refreshView(mvName)` before querying.
968
+ * The proper fix — extending `QuerySource` with an async prepare
969
+ * hook — is a separate PR.
970
+ *
971
+ * @example
972
+ * ```ts
973
+ * // New chainable API:
974
+ * const overdue = invoices.query()
975
+ * .where('status', '==', 'open')
976
+ * .where('dueDate', '<', new Date())
977
+ * .orderBy('dueDate')
978
+ * .toArray();
979
+ *
980
+ * // Legacy predicate form (still supported):
981
+ * const drafts = invoices.query(i => i.status === 'draft');
982
+ * ```
983
+ */
984
+ query(): Query<T, S, Q, M>;
985
+ query(predicate: (record: T) => boolean): T[];
986
+ /**
987
+ * Subscribe to every put/delete on this collection. Returns an
988
+ * unsubscribe function.
989
+ *
990
+ * Fires **after** the store write has committed — subscribers see
991
+ * only materialised state, never in-flight or rolled-back writes.
992
+ *
993
+ * This is an event stream, not a reactive value. For reactive
994
+ * "current array state" semantics use `query().live()`. Typical
995
+ * use cases for `subscribe()`:
996
+ * - audit-trail / activity-feed UI that lists events as they happen
997
+ * - Pinia-per-collection wiring where each store subscribes once
998
+ * - outbox-style workers that process every new record
999
+ *
1000
+ * The callback receives a `CollectionChangeEvent<T>`:
1001
+ * - `{ type: 'put', id, record }` — record is the current
1002
+ * decrypted value. May be `null` if another op deleted the
1003
+ * record between the emit and the handler firing (rare race).
1004
+ * - `{ type: 'delete', id, record: null }` — deletion event;
1005
+ * the record content is gone by the time the handler runs.
1006
+ *
1007
+ * The callback is invoked synchronously *with respect to the emit
1008
+ * moment*, but the record lookup is async (cache hit for eager
1009
+ * collections; one `get()` for lazy collections). If your handler
1010
+ * does not need the record, cast it away and ignore — the lookup
1011
+ * is still performed, but it's cheap on the hydrated path.
1012
+ *
1013
+ * ergonomic wrapper over `db.on('change', …)` that
1014
+ * filters to this collection and hydrates the record.
1015
+ */
1016
+ subscribe(cb: (event: CollectionChangeEvent<T>) => void): () => void;
1017
+ /**
1018
+ * Return a minimal JoinableSource view of this collection's
1019
+ * in-memory cache. Used by the Vault's `resolveSource`
1020
+ * method when another collection's `.join()` needs to probe this
1021
+ * one as the right side.
1022
+ *
1023
+ * The returned object captures the cache reference through a
1024
+ * closure, so subsequent mutations to the cache are visible to
1025
+ * the joined query. That's intentional: a join that fires after
1026
+ * the right-side collection has been updated should see the
1027
+ * fresh data.
1028
+ *
1029
+ * Throws in lazy mode because the cache is bounded and could
1030
+ * silently miss records — consistent with the `query()` /
1031
+ * `list()` lazy-mode policy. If this becomes a blocker for a
1032
+ * real consumer, the fix is to add an async `scan()`-backed
1033
+ * variant of this method, which is exactly what streaming joins will need anyway.
1034
+ */
1035
+ querySourceForJoin(): JoinableSource;
1036
+ /**
1037
+ * Cache statistics — useful for devtools, monitoring, and verifying
1038
+ * that LRU eviction is happening as expected in lazy mode.
1039
+ *
1040
+ * In eager mode, returns size only (no hits/misses are tracked because
1041
+ * every read is a cache hit by construction). In lazy mode, returns
1042
+ * the full LRU stats: `{ hits, misses, evictions, size, bytes }`.
1043
+ */
1044
+ cacheStats(): CacheStats;
1045
+ /** Get version history for a record, newest first. */
1046
+ history(id: string, options?: HistoryOptions): Promise<HistoryEntry<T>[]>;
1047
+ /**
1048
+ * Get a specific past version of a record.
1049
+ *
1050
+ * History reads intentionally **skip schema validation** — historical
1051
+ * records predate the current schema by definition, so validating them
1052
+ * against today's shape would be a false positive on any schema
1053
+ * evolution. If a caller needs validated history, they should filter
1054
+ * and re-put the records through the normal `put()` path.
1055
+ */
1056
+ getVersion(id: string, version: number): Promise<T | null>;
1057
+ /** Revert a record to a past version. Creates a new version with the old content. */
1058
+ revert(id: string, version: number): Promise<void>;
1059
+ /**
1060
+ * Compare two versions of a record and return the differences.
1061
+ * Use version 0 to represent "before creation" (empty).
1062
+ * Omit versionB to compare against the current version.
1063
+ */
1064
+ diff(id: string, versionA: number, versionB?: number): Promise<DiffEntry[]>;
1065
+ /** Resolve a version: try history first, then check if it's the current version. */
1066
+ private resolveVersion;
1067
+ private resolveCurrentOrVersion;
1068
+ /** Prune history entries for a record (or all records if id is undefined). */
1069
+ pruneRecordHistory(id: string | undefined, options: PruneOptions): Promise<number>;
1070
+ /** Clear all history for this collection (or a specific record). */
1071
+ clearHistory(id?: string): Promise<number>;
1072
+ /**
1073
+ * Count records in the collection.
1074
+ *
1075
+ * In eager mode this returns the in-memory cache size (instant). In lazy
1076
+ * mode it counts only LIVE tier-0 envelopes via envelope inspection — no
1077
+ * record bodies loaded — matching eager's tombstone/tier exclusion (#706).
1078
+ */
1079
+ count(): Promise<number>;
1080
+ /**
1081
+ * Fetch a single page of records via the adapter's optional `listPage`
1082
+ * extension. Returns the decrypted records for this page plus an opaque
1083
+ * cursor for the next page.
1084
+ *
1085
+ * Pass `cursor: undefined` (or omit it) to start from the beginning.
1086
+ * The final page returns `nextCursor: null`.
1087
+ *
1088
+ * If the adapter does NOT implement `listPage`, this falls back to a
1089
+ * synthetic implementation: it loads all ids via `list()`, sorts them,
1090
+ * and slices a window. The first call emits a one-time console.warn so
1091
+ * developers can spot adapters that should opt into the fast path.
1092
+ */
1093
+ listPage(opts?: {
1094
+ cursor?: string;
1095
+ limit?: number;
1096
+ }): Promise<{
1097
+ items: T[];
1098
+ nextCursor: string | null;
1099
+ }>;
1100
+ /**
1101
+ * Stream every record in the collection page-by-page as an async
1102
+ * iterable, with chainable `.where()` / `.filter()` clauses and a
1103
+ * memory-bounded `.aggregate(spec)` terminal.
1104
+ *
1105
+ * The whole point: process collections larger than RAM without
1106
+ * ever holding more than `pageSize` records decrypted at once.
1107
+ *
1108
+ * @example
1109
+ * ```ts
1110
+ * // Backward-compatible iteration — unchanged from the previous
1111
+ * // async-generator shape. `ScanBuilder` implements AsyncIterable.
1112
+ * for await (const record of invoices.scan({ pageSize: 500 })) {
1113
+ * await processOne(record)
1114
+ * }
1115
+ *
1116
+ * // — streaming aggregation with O(reducers) memory.
1117
+ * const { total, n } = await invoices.scan()
1118
+ * .where('year', '==', 2025)
1119
+ * .aggregate({ total: sum('amount'), n: count() })
1120
+ * ```
1121
+ *
1122
+ * **Lazy-MV gap:** `scan()` is synchronous-build and does
1123
+ * NOT trigger lazy materialized-view resolve-on-read. For lazy
1124
+ * MVs, call `list()` (which DOES resolve) or `vault.refreshView(name)`
1125
+ * before scanning. Same shape as the `query()` limitation.
1126
+ *
1127
+ * Returns a `ScanBuilder<T>` instead of the raw async iterator
1128
+ * that previous versions used. The builder implements
1129
+ * `AsyncIterable<T>`, so every existing `for await … of` call
1130
+ * continues to work unchanged. Direct `.next()` calls on the
1131
+ * iterator — not idiomatic, not used in the codebase — are no
1132
+ * longer supported; upgrade to `for await` or call the new
1133
+ * `.aggregate()` terminal.
1134
+ *
1135
+ * Uses `adapter.listPage` when available; otherwise falls back
1136
+ * to the synthetic pagination path with the same one-time
1137
+ * warning (`listPage()` routes through that fallback internally).
1138
+ */
1139
+ scan(opts?: {
1140
+ pageSize?: number;
1141
+ }): ScanBuilder<T, S, M>;
1142
+ /** Decrypt a page of envelopes returned by `adapter.listPage`. */
1143
+ private decryptPage;
1144
+ /** Load all records from adapter into memory cache. */
1145
+ /**
1146
+ * @internal — refresh the in-memory cache entry for a single id by
1147
+ * re-reading from the adapter. Used by the transaction executor's
1148
+ * Phase-3 revert path: that path writes the prior envelope directly
1149
+ * via the raw store (to avoid re-firing Collection-level side
1150
+ * effects), which would otherwise leave this Collection's eager
1151
+ * cache holding the rolled-back value. After revert, the executor
1152
+ * calls this hook so subsequent `get` / `query` reads see the
1153
+ * actual on-disk state.
1154
+ *
1155
+ * Lazy mode: drops the LRU entry; the next `get` repopulates from
1156
+ * the adapter. Eager mode: re-reads the envelope and either sets
1157
+ * the cache entry (record still present) or deletes it (record was
1158
+ * gone before the tx and the revert deleted it again).
1159
+ */
1160
+ /**
1161
+ * @internal — evict ONLY the per-record CEK cache entry for `id`. Used by
1162
+ * `vault.rotateRecordCek()`: after a hard CEK rotation the cached unwrapped
1163
+ * CEK is stale (it would decrypt the pre-rotation body and fail GCM auth on
1164
+ * the post-rotation body). Eviction must be synchronous with the live-envelope
1165
+ * rewrite so no concurrent read observes the old CEK. Paired with
1166
+ * {@link _invalidateCacheEntry} (which refreshes the decrypted-record cache).
1167
+ * No-op when the collection is not `perRecordKeys`.
1168
+ */
1169
+ _invalidateCekCacheEntry(id: string): void;
1170
+ /** @internal Satellite fan-out revert cleanup (spec #591): drop the sync dirty entry ('revert' is
1171
+ * onDirty-channel-only) and re-announce the RESTORED state as a plain put/delete — `subscribe()`
1172
+ * only understands those two actions, and the restored record may exist again. */
1173
+ _compensateRevertedWrite(id: string): Promise<void>;
1174
+ _invalidateCacheEntry(id: string): Promise<void>;
1175
+ /**
1176
+ * Apply a peer tab's committed write to THIS tab's in-memory view:
1177
+ * re-read the (already-persisted) envelope from the shared store + refresh
1178
+ * cache/indexes, then emit a `change` event so reactive consumers re-render.
1179
+ * Never writes to the store and never fires write hooks, so it cannot loop.
1180
+ */
1181
+ _applyRemoteChange(id: string, action: 'put' | 'delete'): Promise<void>;
1182
+ /**
1183
+ * Origin-tagged mutation choke point (#623 task 10) — the single dispatch
1184
+ * point every put/delete path funnels through, AFTER its own store write,
1185
+ * to fire the side-effects that path performs today. Each case below
1186
+ * performs EXACTLY the side-effect set the seam-map Part-3 table
1187
+ * (`.superpowers/sdd/seam-map-i18n-pipeline.md`) records for `origin` —
1188
+ * this is a pure parity extraction of existing tails, not a behavior
1189
+ * change. Phase C (#621, #622) plugs the dependency-graph dispatch into
1190
+ * this socket, keyed off `origin`, without every call site having to
1191
+ * learn the graph.
1192
+ *
1193
+ * `restore` is never reached: `Vault.load` / `backup.ts#loadVault` drops
1194
+ * the whole `collectionCache` instead of dispatching per record — the
1195
+ * origin is reserved for phase C.
1196
+ *
1197
+ * @internal
1198
+ */
1199
+ _onRecordMutated(id: string, action: 'put' | 'delete', origin: MutationOrigin, ctx?: {
1200
+ readonly record?: T;
1201
+ readonly version?: number;
1202
+ }): Promise<void>;
1203
+ /** @internal — the current in-memory record without a store read (for conflict capture); also the #640 FK-recovery read on a sync-applied delete — misses on a cold or evicted child (lazy LRU eviction OR an un-hydrated eager collection whose first sync op is a delete), not "lazy-mode" only. */
1204
+ _peekCached(id: string): T | null;
1205
+ private ensureHydrated;
1206
+ /** Hydrate from a pre-loaded snapshot (used by Vault). */
1207
+ hydrateFromSnapshot(records: Record<string, EncryptedEnvelope>): Promise<void>;
1208
+ /**
1209
+ * Rebuild secondary indexes from the current in-memory cache.
1210
+ *
1211
+ * Called after any bulk hydration. Incremental put/delete updates
1212
+ * are handled by `indexes.upsert()` / `indexes.remove()` directly,
1213
+ * so this only fires for full reloads.
1214
+ *
1215
+ * Synchronous and O(N × indexes.size); for the target scale of
1216
+ * 1K–50K records this completes in single-digit milliseconds.
1217
+ */
1218
+ private rebuildEagerIndexesFromCache;
1219
+ /**
1220
+ * Rebuild unique-constraint maps from the current in-memory cache.
1221
+ * Called after any bulk hydration alongside `rebuildEagerIndexesFromCache`.
1222
+ */
1223
+ private rebuildUniqueConstraintsFromCache;
1224
+ /**
1225
+ * Rebuild every declared index from scratch.
1226
+ *
1227
+ * Eager mode: refreshes the in-memory `CollectionIndexes` from the
1228
+ * current cache — O(records × declaredFields).
1229
+ *
1230
+ * Lazy mode: tears down every `_idx/<field>/<recordId>`
1231
+ * side-car, walks the canonical record namespace, and materialises
1232
+ * fresh side-cars for every declared field. The in-memory mirror is
1233
+ * cleared and re-ingested. Intended for two scenarios:
1234
+ * 1. Adding a new indexed field to a collection that already holds
1235
+ * records — after the schema change, call `rebuildIndexes()` to
1236
+ * backfill the side-cars.
1237
+ * 2. Recovery from a catastrophic drift (audit noticed many
1238
+ * `index:write-partial` events, operator wants a clean slate).
1239
+ *
1240
+ * The rebuild is NOT incremental — it's a full bulk-replace. For
1241
+ * per-field drift repair, use `reconcileIndex(field)` instead.
1242
+ */
1243
+ rebuildIndexes(): Promise<void>;
1244
+ /**
1245
+ * Compare the persisted `_idx/<field>/*` side-cars against the
1246
+ * canonical records for a single field, reporting the drift (and
1247
+ * optionally repairing it).
1248
+ *
1249
+ * Lazy mode only. Eager mode throws — the in-memory index cannot
1250
+ * drift.
1251
+ *
1252
+ * `missing` — record ids whose value is indexable but no side-car
1253
+ * exists. Happens when a `put()` succeeded but the side-car put
1254
+ * failed (surfaced as `index:write-partial`).
1255
+ * `stale` — side-car ids pointing to a record that no longer exists
1256
+ * or whose current value no longer matches the side-car body.
1257
+ * `applied` — number of writes that were actually applied (always 0
1258
+ * when `dryRun: true`).
1259
+ *
1260
+ * Design reference: acceptance criteria.
1261
+ */
1262
+ reconcileIndex(field: string, opts?: {
1263
+ dryRun?: boolean;
1264
+ }): Promise<{
1265
+ field: string;
1266
+ missing: string[];
1267
+ stale: string[];
1268
+ applied: number;
1269
+ }>;
1270
+ /**
1271
+ * Get the in-memory index store. Used by `Query` to short-circuit
1272
+ * `==` and `in` lookups when an index covers the where clause.
1273
+ *
1274
+ * Returns `null` if no indexes are declared on this collection.
1275
+ */
1276
+ getIndexes(): CollectionIndexes | null;
1277
+ /**
1278
+ * Return a `BlobSet` for the given record id.
1279
+ *
1280
+ * No I/O is performed until you call a method on the handle.
1281
+ *
1282
+ * ```ts
1283
+ * const blobs = invoices.blob('inv-001')
1284
+ *
1285
+ * // Upload a PDF (deduplicates automatically, MIME auto-detected)
1286
+ * await blobs.put('receipt.pdf', pdfBytes)
1287
+ *
1288
+ * // List slots
1289
+ * const files = await blobs.list() // SlotInfo[]
1290
+ *
1291
+ * // Serve as HTTP response (Content-Type, ETag, streaming body)
1292
+ * const res = await blobs.response('receipt.pdf', { inline: true })
1293
+ *
1294
+ * // Publish a named version (amendment versioning)
1295
+ * await blobs.publish('receipt.pdf', 'issued-2025-01')
1296
+ *
1297
+ * // Raw bytes
1298
+ * const bytes = await blobs.get('receipt.pdf')
1299
+ * ```
1300
+ *
1301
+ * Blobs are stored in internal collections (`_blob_slots_*`, `_blob_index`,
1302
+ * `_blob_chunks`, `_blob_versions_*`) that are excluded from queries and
1303
+ * `list()`. Slot metadata uses this collection's DEK; chunk data uses a
1304
+ * vault-shared `_blob` DEK (enabling cross-collection deduplication).
1305
+ */
1306
+ blob(id: string): BlobSet;
1307
+ /** Get all records as encrypted envelopes (for dump). */
1308
+ dumpEnvelopes(): Promise<Record<string, EncryptedEnvelope>>;
1309
+ /**
1310
+ * Apply locale resolution to a record.
1311
+ *
1312
+ * Called from `get()` and `list()` when locale options are present.
1313
+ * Uses the effective locale: per-call `locale` takes precedence over
1314
+ * `this.defaultLocale`.
1315
+ *
1316
+ * - i18nText fields: replaced with the resolved string (or the full
1317
+ * map when `locale === 'raw'`).
1318
+ * - dictKey fields: `<field>Label` virtual fields added.
1319
+ *
1320
+ * Returns the record unchanged when no Via pipeline is compiled (#638 Task 7:
1321
+ * was money/i18n/dictKey-flag-gated — missed any OTHER binding's `present`
1322
+ * hook, e.g. the `computed` via-binding's virtual-mode read-time compute;
1323
+ * `this.via` truthiness is the general condition every binding's presence
1324
+ * already implies).
1325
+ */
1326
+ private applyLocaleToRecord;
1327
+ /**
1328
+ * Low-level: encrypt a pre-serialised JSON string into an EncryptedEnvelope.
1329
+ * Used by both the normal record path and the CRDT path (which serialises
1330
+ * a CrdtState rather than a T).
1331
+ */
1332
+ /**
1333
+ * Write / update / delete the `_idx/<field>/<recordId>` side-cars for
1334
+ * every declared persistence-index field on this collection after a
1335
+ * successful main-record `put()`.
1336
+ *
1337
+ * Timing: called AFTER `adapter.put()` of the main record succeeds, so
1338
+ * a failed main write never leaves a stale index entry. Side-car write
1339
+ * failures do NOT fail the overall `put()` — the main record is already
1340
+ * durably committed. Per-field failures surface as
1341
+ * `IndexWriteFailureError` on the emitter's `index:write-partial`
1342
+ * channel and the operator runs a reconcile pass later.
1343
+ *
1344
+ * Null/undefined field values are not indexed — matches the
1345
+ * `PersistedCollectionIndex.stringifyKey` contract. If the prior value
1346
+ * was non-null and the new value is null, the side-car is deleted.
1347
+ */
1348
+ private maintainPersistedIndexesOnPut;
1349
+ /**
1350
+ * Tear down `_idx/<field>/<recordId>` side-cars for a deleted record.
1351
+ * Mirror state updates regardless of adapter outcome; adapter failures
1352
+ * surface on `index:write-partial` the same way put does.
1353
+ */
1354
+ private maintainPersistedIndexesOnDelete;
1355
+ /**
1356
+ * @internal — hard-delete this record's persisted `_idx/<field>/<recordId>`
1357
+ * side-cars for the erasure path. `forget()` crypto-shreds the body but
1358
+ * keeps the collection DEK, under which these side-cars are encrypted — so
1359
+ * without this they leave the indexed field VALUES readable after a "forget".
1360
+ *
1361
+ * Content-free: the side-car id is `encodeIdxId(def.key, id)`, so it needs no
1362
+ * body decode (the body is being shredded). Eager mode has no durable side-car
1363
+ * → no-op. The in-memory mirror is left as-is: it is ephemeral (rebuilt from
1364
+ * the now-deleted side-cars on reopen) and live reads skip the tombstone, so a
1365
+ * stale mirror hit cannot surface the erased record. Returns the count deleted
1366
+ * + the `def.key`s whose delete FAILED (residue that still leaks the value).
1367
+ */
1368
+ _purgePersistedIndexes(id: string): Promise<{
1369
+ purged: number;
1370
+ residue: string[];
1371
+ }>;
1372
+ /** Drop a record's encrypted _vec sidecar on erasure (a vector is text-invertible).
1373
+ * Called by vault.ts forget() inside a resilient try/catch; residue is reported in ForgetResult. */
1374
+ _purgeVector(id: string): Promise<void>;
1375
+ /** Drop the persisted lexical-index blob (forget/erasure): an opaque
1376
+ * all-records index must not survive crypto-shred. Idempotent; no-op without persist. */
1377
+ _purgeSearchIndex(): Promise<void>;
1378
+ /**
1379
+ * Bulk-load the persisted-index mirror from `_idx/<field>/*` side-cars
1380
+ * on first lazy-mode query. Idempotent — subsequent calls short-circuit
1381
+ * on the `persistedIndexesLoaded` flag.
1382
+ *
1383
+ * Listing the whole id namespace is acceptable here because the caller
1384
+ * has already decided to pay a first-query cost (this is the indexed
1385
+ * equivalent of lazy-mode hydration, not a per-query scan).
1386
+ */
1387
+ private ensurePersistedIndexesLoaded;
1388
+ /**
1389
+ * Walk every declared persisted-index field, run `reconcileIndex`
1390
+ * per the configured policy, and emit `index:reconciled` for each.
1391
+ * Called internally by `ensurePersistedIndexesLoaded()` — exposed as
1392
+ * a private helper for readability, not as a public API (the public
1393
+ * entry points are `reconcileIndex` and `rebuildIndexes`).
1394
+ */
1395
+ private autoReconcile;
1396
+ /**
1397
+ * Construct a `LazyQuery<T>` bound to this collection. Used by the
1398
+ * lazy-mode branch of `query()` and kept private because callers should
1399
+ * always go through `query()` to pick up the eager/lazy dispatch.
1400
+ */
1401
+ /**
1402
+ * Build a chainable indexed-read query against a lazy-mode collection.
1403
+ *
1404
+ * Companion to `query()`, which is eager-mode only and materialises a
1405
+ * snapshot. `lazyQuery()` dispatches every read through the persisted
1406
+ * index side-cars — no bulk decrypt, no snapshot. Every field touched by
1407
+ * `.where(...)` or `.orderBy(...)` MUST be declared in `indexes`;
1408
+ * otherwise `.toArray()` throws `IndexRequiredError`.
1409
+ *
1410
+ * The returned builder is always Promise-returning on its terminals
1411
+ * (`toArray`, `first`, `count`) because candidate records are decrypted
1412
+ * from the adapter on demand.
1413
+ *
1414
+ * @example
1415
+ * ```ts
1416
+ * const disbursements = vault.collection<Disbursement>('disbursements', {
1417
+ * prefetch: false,
1418
+ * cache: { maxRecords: 1000 },
1419
+ * indexes: ['clientId', 'period'],
1420
+ * })
1421
+ * const rows = await disbursements.lazyQuery()
1422
+ * .where('clientId', '==', 'c-42')
1423
+ * .orderBy('period', 'desc')
1424
+ * .limit(50)
1425
+ * .toArray()
1426
+ * ```
1427
+ *
1428
+ * Throws at call time when the collection is in eager mode — use
1429
+ * `query()` there. Throws if no index is declared, because a lazy
1430
+ * query with no index would need to enumerate the whole collection.
1431
+ */
1432
+ lazyQuery(): LazyQuery<T, S, Q>;
1433
+ /**
1434
+ * Resolve the stable CEK for a record on the WRITE path — see
1435
+ * {@link resolveStableCek}. Thin delegate that supplies the collection's
1436
+ * CEK cache, live-envelope reader, and DEK resolver.
1437
+ */
1438
+ private resolveRecordCek;
1439
+ /** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
1440
+ private _ensureClassifiedMarker;
1441
+ /** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
1442
+ private _classifiedMarkerDigestOnly;
1443
+ /**
1444
+ * find the first record whose deterministic field matches
1445
+ * the given plaintext. Returns `null` when no match exists.
1446
+ *
1447
+ * Reads every envelope via the adapter and compares the stored
1448
+ * `_det[field]` to a freshly computed deterministic ciphertext — no
1449
+ * record bodies are decrypted during the search, which is the whole
1450
+ * point of a deterministic index.
1451
+ *
1452
+ * Throws when the field is not declared in `deterministicFields`, so a
1453
+ * typo fails loudly at the call site rather than silently returning
1454
+ * null forever.
1455
+ */
1456
+ findByDet(field: string, value: unknown): Promise<T | null>;
1457
+ /**
1458
+ * return every record whose deterministic field matches.
1459
+ * Same semantics as {@link findByDet} but without the short-circuit.
1460
+ */
1461
+ queryByDet(field: string, value: unknown): Promise<T[]>;
1462
+ /** Bind the {@link DeterministicContext} this collection's det lookups need. */
1463
+ private detContext;
1464
+ /** tier-aware put — gated behind `tiersStrategy: withTiers()`. `searchResidue: true` = stuck search compensation (#774, mirroring #764's elevate/demote posture); the write itself always completes. */
1465
+ putAtTier(id: string, record: T, tier: number, opts?: {
1466
+ elevation?: {
1467
+ reason: string;
1468
+ fromTier: number;
1469
+ };
1470
+ source?: string;
1471
+ sourceTs?: string;
1472
+ }): Promise<TierMoveResult>;
1473
+ /** tier-aware get — gated behind `tiersStrategy: withTiers()`. */
1474
+ getAtTier(id: string): Promise<T | GhostRecord | null>;
1475
+ /** list ids grouped by the caller's readability — gated behind `withTiers()`. */
1476
+ listAtTier(): Promise<Array<{
1477
+ id: string;
1478
+ tier: number;
1479
+ readable: boolean;
1480
+ }>>;
1481
+ /** elevate a record to a higher tier — gated behind `withTiers()`. `searchResidue: true` = stuck search compensation (#764); the move itself always completes. */
1482
+ elevate(id: string, toTier: number): Promise<TierMoveResult>;
1483
+ /** demote a record to a lower tier — gated behind `withTiers()`. Same `searchResidue` posture as {@link elevate} (#764). */
1484
+ demote(id: string, toTier: number): Promise<TierMoveResult>;
1485
+ /**
1486
+ * Emit a cross-tier access event. The subscriber sink stays collection-resident (it captures `onCrossTierAccess`); the tiers module reaches it via the {@link TiersContext.emitCrossTierEvent} callback.
1487
+ */
1488
+ private emitCrossTierEvent;
1489
+ /**
1490
+ * Classify a live envelope's `_sealed` slots for crypto-shred completeness
1491
+ * (#M-1, 2026-06-30 security review). Kept as a `_`-prefixed method on
1492
+ * Collection because `vault.ts` forget() reaches in via this name.
1493
+ */
1494
+ _classifySealedShred(live: EncryptedEnvelope): Promise<{
1495
+ readonly slots: readonly SealedShredSlot[];
1496
+ }>;
1497
+ _onViaErase(id: string, live: EncryptedEnvelope): Promise<ViaEraseReport | undefined>;
1498
+ get _via(): ViaPipeline | undefined;
1499
+ _setVia(pipeline: ViaPipeline | undefined): void;
1500
+ get _viaFieldsSnapshot(): {
1501
+ i18nFields: Record<string, I18nTextDescriptor> | undefined;
1502
+ lookupFields: Record<string, LookupDescriptor> | undefined;
1503
+ };
1504
+ _reconcileReadState(patch: {
1505
+ dictKeyFields?: Record<string, DictKeyDescriptor | StaticDictDescriptor>;
1506
+ i18nFields?: Record<string, I18nTextDescriptor>;
1507
+ lookupFields?: Record<string, LookupDescriptor>;
1508
+ getDictionary?: (name: string) => Promise<DictionaryHandle>;
1509
+ presentForJoin?: (record: unknown, locale: string) => unknown;
1510
+ }): void;
1511
+ /**
1512
+ * Bind the {@link TiersContext} the tier ops need — `cekCache` by reference (same `Lru` the read/write path owns) for a synchronous re-wrap; `syncDerived` closes over `this` for {@link syncDerivedOutputs} (#722).
1513
+ */
1514
+ private tiersContext;
1515
+ /**
1516
+ * Bind the {@link IndexingContext} the index-maintenance surface needs. The
1517
+ * eager `cache` Map and the index / unique-constraint / persisted mirrors are
1518
+ * passed by reference (the SAME instances the query path reads, never
1519
+ * copied); the `persistedIndexesLoaded` flag and `ensure*` hydration stay collection-resident, reached via callbacks.
1520
+ */
1521
+ private indexingContext;
1522
+ }