@noy-db/hub 0.3.0-pre.10 → 0.3.0-pre.12

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 (898) hide show
  1. package/dist/aggregate/index.js +4 -4
  2. package/dist/api-3TH2GOFQ.js +20 -0
  3. package/dist/as/index.js +11 -11
  4. package/dist/attestation/index.js +18 -18
  5. package/dist/backup-2WVBIVXW.js +225 -0
  6. package/dist/blobs/index.js +10 -10
  7. package/dist/broker/index.js +92 -0
  8. package/dist/broker/index.js.map +1 -0
  9. package/dist/bundle/index.js +20 -20
  10. package/dist/by/index.js +2 -2
  11. package/dist/cargo/index.js +30 -30
  12. package/dist/chunk-2MTRJCBI.js +75 -0
  13. package/dist/chunk-37WOJQWY.js +404 -0
  14. package/dist/chunk-3QSOFZQB.js +589 -0
  15. package/dist/chunk-44IL5G3W.js +99 -0
  16. package/dist/chunk-45QPICLE.js +69 -0
  17. package/dist/chunk-4BQXMCE5.js +164 -0
  18. package/dist/chunk-4GPE63GU.js +111 -0
  19. package/dist/chunk-4GPE63GU.js.map +1 -0
  20. package/dist/chunk-5HNX4OD4.js +30 -0
  21. package/dist/chunk-65VLRG3I.js +54 -0
  22. package/dist/chunk-6MA575R5.js +59 -0
  23. package/dist/chunk-6S7ENMRE.js +524 -0
  24. package/dist/chunk-6S7ENMRE.js.map +1 -0
  25. package/dist/chunk-7GAXFU2O.js +123 -0
  26. package/dist/chunk-7QLY64AD.js +202 -0
  27. package/dist/chunk-7ZOSHEVS.js +235 -0
  28. package/dist/chunk-AAIIDAUC.js +371 -0
  29. package/dist/chunk-AAIIDAUC.js.map +1 -0
  30. package/dist/chunk-AKEOHKMT.js +282 -0
  31. package/dist/chunk-AKEOHKMT.js.map +1 -0
  32. package/dist/chunk-APHLCXVC.js +124 -0
  33. package/dist/chunk-BDEMZD4F.js +129 -0
  34. package/dist/chunk-BDPAVYGJ.js +662 -0
  35. package/dist/chunk-BLUT46UP.js +42 -0
  36. package/dist/chunk-CCIR2OJH.js +778 -0
  37. package/dist/chunk-CXC3JLAQ.js +155 -0
  38. package/dist/chunk-CZMCOFEA.js +1221 -0
  39. package/dist/chunk-DIB2BOIH.js +164 -0
  40. package/dist/chunk-DJ7MRXNA.js +344 -0
  41. package/dist/chunk-DJ7MRXNA.js.map +1 -0
  42. package/dist/chunk-EHW5KTTA.js +150 -0
  43. package/dist/chunk-EHW5KTTA.js.map +1 -0
  44. package/dist/chunk-EIZ4YOG2.js +70 -0
  45. package/dist/chunk-EVHBK7BN.js +515 -0
  46. package/dist/chunk-EXGDL2UQ.js +74 -0
  47. package/dist/chunk-F3LGBRSV.js +453 -0
  48. package/dist/chunk-F44XWXOA.js +392 -0
  49. package/dist/chunk-FF7S3XDW.js +230 -0
  50. package/dist/chunk-FJTWLQV3.js +155 -0
  51. package/dist/chunk-FYNE4WLC.js +36 -0
  52. package/dist/chunk-FZCGIJEJ.js +1505 -0
  53. package/dist/chunk-FZCGIJEJ.js.map +1 -0
  54. package/dist/chunk-GL3JV5EV.js +130 -0
  55. package/dist/chunk-GXLZXD2W.js +29 -0
  56. package/dist/chunk-HA6ZQWA2.js +1056 -0
  57. package/dist/chunk-HA6ZQWA2.js.map +1 -0
  58. package/dist/chunk-HBBZWEC5.js +686 -0
  59. package/dist/chunk-HG76BZ6G.js +188 -0
  60. package/dist/chunk-HGAB325C.js +38 -0
  61. package/dist/chunk-HIOLCOK3.js +30 -0
  62. package/dist/chunk-HIOLCOK3.js.map +1 -0
  63. package/dist/chunk-HK4XTXO4.js +49 -0
  64. package/dist/chunk-HYG32HCM.js +14 -0
  65. package/dist/chunk-ILF5GARW.js +135 -0
  66. package/dist/chunk-INBQ43DI.js +382 -0
  67. package/dist/chunk-IQIVD7TP.js +247 -0
  68. package/dist/chunk-J3JIYFYL.js +45 -0
  69. package/dist/chunk-JC75UBMT.js +32 -0
  70. package/dist/chunk-JC75UBMT.js.map +1 -0
  71. package/dist/chunk-JGUZMC3I.js +150 -0
  72. package/dist/chunk-JRKE5MAZ.js +80 -0
  73. package/dist/chunk-K2DLLK34.js +255 -0
  74. package/dist/chunk-KKYEZCQG.js +34 -0
  75. package/dist/chunk-NAR6IDKH.js +54 -0
  76. package/dist/chunk-NEYKOESM.js +117 -0
  77. package/dist/chunk-NM3IFKBL.js +29 -0
  78. package/dist/chunk-NRYNRSGV.js +99 -0
  79. package/dist/chunk-NT2ZO4KI.js +59 -0
  80. package/dist/chunk-P2LJI6JE.js +94 -0
  81. package/dist/chunk-PH7G7ZI7.js +823 -0
  82. package/dist/chunk-PN5332SU.js +209 -0
  83. package/dist/chunk-QF5LGMSV.js +45 -0
  84. package/dist/chunk-QG5RQQBO.js +367 -0
  85. package/dist/chunk-QYPDYN23.js +23 -0
  86. package/dist/chunk-R3NHNVS5.js +478 -0
  87. package/dist/chunk-R3NHNVS5.js.map +1 -0
  88. package/dist/chunk-RNXJ2VO6.js +280 -0
  89. package/dist/chunk-RXTMLYJS.js +97 -0
  90. package/dist/chunk-S2OWPVSO.js +30 -0
  91. package/dist/chunk-S7TAPIRS.js +205 -0
  92. package/dist/chunk-SAL5X5OK.js +40 -0
  93. package/dist/chunk-SGJGWBSC.js +85 -0
  94. package/dist/chunk-SIAIYP6G.js +50 -0
  95. package/dist/chunk-SXPCZ6LL.js +1697 -0
  96. package/dist/chunk-SXPCZ6LL.js.map +1 -0
  97. package/dist/chunk-TBNF5DV5.js +261 -0
  98. package/dist/chunk-TVOHSPVK.js +21 -0
  99. package/dist/chunk-TVS6BUUR.js +41 -0
  100. package/dist/chunk-UMC5QZTX.js +86 -0
  101. package/dist/chunk-US34HTOI.js +367 -0
  102. package/dist/chunk-VCUQR6ZL.js +621 -0
  103. package/dist/chunk-VXZNSPJM.js +957 -0
  104. package/dist/chunk-VXZNSPJM.js.map +1 -0
  105. package/dist/chunk-WEHIQYQH.js +71 -0
  106. package/dist/chunk-WHQHTNT7.js +265 -0
  107. package/dist/chunk-X6Y5MXTH.js +74 -0
  108. package/dist/chunk-XJ47GS53.js +291 -0
  109. package/dist/chunk-XS6DLN67.js +95 -0
  110. package/dist/chunk-Y5TWPBNW.js +91 -0
  111. package/dist/chunk-YCXKFB7J.js +14181 -0
  112. package/dist/chunk-YCXKFB7J.js.map +1 -0
  113. package/dist/chunk-ZHOJOT6S.js +36 -0
  114. package/dist/chunk-ZL6PRULX.js +167 -0
  115. package/dist/chunk-ZL6PRULX.js.map +1 -0
  116. package/dist/classified/index.js +5 -5
  117. package/dist/classified-marker-M7K3OJPM.js +28 -0
  118. package/dist/classified-marker-M7K3OJPM.js.map +1 -0
  119. package/dist/collection-facade-DWA735G2.js +39 -0
  120. package/dist/computed-ORCGM5JE.js +11 -0
  121. package/dist/consent/index.js +9 -9
  122. package/dist/crdt/index.js +1 -1
  123. package/dist/dead-filter-OV5FGKOG.js +28 -0
  124. package/dist/delegation-YVSHMIZZ.js +25 -0
  125. package/dist/derivations/index.js +12 -12
  126. package/dist/derive-BUO555L5.js +21 -0
  127. package/dist/enclave-XXFUKJC6.js +135 -0
  128. package/dist/executor-6OCCE5VM.js +25 -0
  129. package/dist/executor-JFVAJY42.js +9 -0
  130. package/dist/executor-UPSH5O3F.js +9 -0
  131. package/dist/export-accessible-L4A2QZA5.js +23 -0
  132. package/dist/extract-partition-ZHQ4RGGM.js +36 -0
  133. package/dist/fanout-sidecar-IO2KDUWV.js +74 -0
  134. package/dist/find-ZFZDZQ2U.js +11 -0
  135. package/dist/forget/index.js +10 -10
  136. package/dist/forget/index.js.map +1 -1
  137. package/dist/guards/index.js +3 -3
  138. package/dist/history/index.js +11 -11
  139. package/dist/i18n/index.js +15 -15
  140. package/dist/index.d.ts +303 -1492
  141. package/dist/index.js +172 -171
  142. package/dist/index.js.map +1 -1
  143. package/dist/indexing/index.js +5 -5
  144. package/dist/indexing/index.js.map +1 -1
  145. package/dist/issue-OG4V23SQ.js +19 -0
  146. package/dist/kernel/best-effort-revert.d.ts +52 -0
  147. package/dist/kernel/cache/index.d.ts +10 -0
  148. package/dist/kernel/cache/lru.d.ts +97 -0
  149. package/dist/kernel/cache/policy.d.ts +32 -0
  150. package/dist/kernel/collection-config.d.ts +789 -0
  151. package/dist/kernel/collection.d.ts +1519 -0
  152. package/dist/kernel/constants.d.ts +18 -0
  153. package/dist/kernel/debug.d.ts +25 -0
  154. package/dist/kernel/enclave/broker/proof.d.ts +154 -0
  155. package/dist/kernel/enclave/classify/bidx.d.ts +77 -0
  156. package/dist/kernel/enclave/classify/compare.d.ts +10 -0
  157. package/dist/kernel/enclave/classify/digest.d.ts +8 -0
  158. package/dist/kernel/enclave/classify/find.d.ts +36 -0
  159. package/dist/kernel/enclave/classify/kofn.d.ts +7 -0
  160. package/dist/kernel/enclave/classify/normalize.d.ts +7 -0
  161. package/dist/kernel/enclave/classify/reveal.d.ts +10 -0
  162. package/dist/kernel/enclave/classify/vdig.d.ts +39 -0
  163. package/dist/kernel/enclave/classify/verify.d.ts +33 -0
  164. package/dist/kernel/enclave/classify/write.d.ts +8 -0
  165. package/dist/kernel/enclave/crypto.d.ts +263 -0
  166. package/dist/kernel/enclave/index.d.ts +78 -0
  167. package/dist/kernel/enclave/record-keys/deterministic.d.ts +54 -0
  168. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +79 -0
  169. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +57 -0
  170. package/dist/kernel/enclave/record-keys/record-codec.d.ts +301 -0
  171. package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +14 -0
  172. package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +123 -0
  173. package/dist/kernel/enclave/record-keys/sealing.d.ts +70 -0
  174. package/dist/kernel/enclave/record-keys/tombstone.d.ts +57 -0
  175. package/dist/kernel/env-check.d.ts +1 -0
  176. package/dist/kernel/errors.d.ts +1848 -0
  177. package/dist/kernel/events.d.ts +11 -0
  178. package/dist/kernel/memory-store.d.ts +17 -0
  179. package/dist/kernel/mutation.d.ts +14 -0
  180. package/dist/kernel/noydb.d.ts +826 -0
  181. package/dist/kernel/paths.d.ts +25 -0
  182. package/dist/kernel/query/builder.d.ts +520 -0
  183. package/dist/kernel/query/index.d.ts +31 -0
  184. package/dist/kernel/query/join.d.ts +205 -0
  185. package/dist/kernel/query/live.d.ts +111 -0
  186. package/dist/kernel/query/predicate.d.ts +139 -0
  187. package/dist/kernel/query/scan-builder.d.ts +334 -0
  188. package/dist/kernel/refs.d.ts +205 -0
  189. package/dist/kernel/schema.d.ts +134 -0
  190. package/dist/kernel/sync-policy.d.ts +188 -0
  191. package/dist/kernel/types.d.ts +3166 -0
  192. package/dist/kernel/util/discriminant.d.ts +58 -0
  193. package/dist/kernel/util/index.d.ts +14 -0
  194. package/dist/kernel/util/sanitize-filename.d.ts +75 -0
  195. package/dist/kernel/validation.d.ts +130 -0
  196. package/dist/kernel/vault.d.ts +1737 -0
  197. package/dist/kernel/via/compose.d.ts +144 -0
  198. package/dist/kernel/via/dispatch.d.ts +185 -0
  199. package/dist/kernel/via/graph-wiring.d.ts +145 -0
  200. package/dist/kernel/via/graph.d.ts +166 -0
  201. package/dist/kernel/via/index.d.ts +200 -0
  202. package/dist/kernel/via/pipeline.d.ts +266 -0
  203. package/dist/kernel/via/reconcile.d.ts +153 -0
  204. package/dist/kernel/via/taint-binding.d.ts +66 -0
  205. package/dist/kernel/write-queue.d.ts +46 -0
  206. package/dist/ledger-UAQKPWNM.js +42 -0
  207. package/dist/legacy/bundle.d.ts +30 -0
  208. package/dist/legacy/kernel.d.ts +33 -0
  209. package/dist/liberate-GFUQJRK5.js +24 -0
  210. package/dist/link-set-DGYUOFVD.js +31 -0
  211. package/dist/materialized-views/index.js +19 -19
  212. package/dist/noydb-AKH4AMCR.js +67 -0
  213. package/dist/on/index.js +9 -9
  214. package/dist/overlay-views/index.js +4 -4
  215. package/dist/periods/index.js +12 -12
  216. package/dist/pod/index.js +11 -11
  217. package/dist/policy-5POYLI26.js +41 -0
  218. package/dist/port/as/index.d.ts +26 -0
  219. package/dist/port/at/index.d.ts +18 -0
  220. package/dist/port/by/default-provider.d.ts +9 -0
  221. package/dist/port/by/index.d.ts +17 -0
  222. package/dist/port/by/types.d.ts +86 -0
  223. package/dist/port/in/index.d.ts +21 -0
  224. package/dist/port/on/index.d.ts +27 -0
  225. package/dist/port/to/index.d.ts +19 -0
  226. package/dist/port/ui/index.d.ts +21 -0
  227. package/dist/port/with/blob-strategy.d.ts +81 -0
  228. package/dist/port/with/broker-strategy.d.ts +84 -0
  229. package/dist/port/with/capabilities.d.ts +31 -0
  230. package/dist/port/with/classified-marker.d.ts +9 -0
  231. package/dist/port/with/classified-strategy.d.ts +62 -0
  232. package/dist/port/with/computed-strategy.d.ts +19 -0
  233. package/dist/port/with/i18n-strategy.d.ts +175 -0
  234. package/dist/port/with/index.d.ts +18 -0
  235. package/dist/port/with/lazy-strategy.d.ts +48 -0
  236. package/dist/port/with/lookup-strategy.d.ts +129 -0
  237. package/dist/port/with/service-bus.d.ts +156 -0
  238. package/dist/port/with/team-strategy.d.ts +36 -0
  239. package/dist/port/with/write-hooks.d.ts +34 -0
  240. package/dist/portability/index.js +8 -8
  241. package/dist/post-register-LB3P4XQU.js +60 -0
  242. package/dist/post-register-LB3P4XQU.js.map +1 -0
  243. package/dist/public-envelope-GOG4LUM7.js +32 -0
  244. package/dist/purge-scope-FGNNLWHD.js +24 -0
  245. package/dist/purge-scope-FGNNLWHD.js.map +1 -0
  246. package/dist/query/index.js +5 -5
  247. package/dist/register-ZI7YI7US.js +23 -0
  248. package/dist/registry-DZ2T4LL7.js +9 -0
  249. package/dist/registry-NVWEQ2GU.js +18 -0
  250. package/dist/registry-SEKL74ET.js +19 -0
  251. package/dist/request-withdrawal-ZP3JIRVS.js +31 -0
  252. package/dist/reveal-NPVROV4D.js +38 -0
  253. package/dist/revoke-VF6TAJK2.js +24 -0
  254. package/dist/satellites/index.js +1 -1
  255. package/dist/sealed-record/index.js +12 -12
  256. package/dist/seed-VI4FU7UH.js +231 -0
  257. package/dist/seed-VI4FU7UH.js.map +1 -0
  258. package/dist/session/index.js +9 -9
  259. package/dist/shadow/index.js +2 -2
  260. package/dist/signer-DRDDCCHW.js +25 -0
  261. package/dist/snapshots/index.js +10 -10
  262. package/dist/stale-TJXFQKOJ.js +14 -0
  263. package/dist/storage-GR7KZRH4.js +23 -0
  264. package/dist/store-coordination-provider-5KDS2RRP.js +142 -0
  265. package/dist/sync/index.js +9 -9
  266. package/dist/team/index.js +15 -15
  267. package/dist/tiers/index.js +10 -10
  268. package/dist/to/index.js +1 -1
  269. package/dist/tx/index.js +3 -3
  270. package/dist/util/index.js +1 -1
  271. package/dist/verify-QK76NJ4G.js +139 -0
  272. package/dist/via/blob/active.d.ts +34 -0
  273. package/dist/via/blob/binding.d.ts +86 -0
  274. package/dist/via/blob/index.d.ts +34 -0
  275. package/dist/via/classified/active.d.ts +3 -0
  276. package/dist/via/classified/binding.d.ts +83 -0
  277. package/dist/via/classified/config-drift.d.ts +34 -0
  278. package/dist/via/classified/descriptor.d.ts +66 -0
  279. package/dist/via/classified/errors.d.ts +19 -0
  280. package/dist/via/classified/guards.d.ts +23 -0
  281. package/dist/via/classified/index.d.ts +11 -0
  282. package/dist/via/classified/presets.d.ts +65 -0
  283. package/dist/via/classified/resolve.d.ts +9 -0
  284. package/dist/via/classified/strategy.d.ts +11 -0
  285. package/dist/via/classified/validators.d.ts +3 -0
  286. package/dist/via/classified/write.d.ts +4 -0
  287. package/dist/via/computed/binding.d.ts +34 -0
  288. package/dist/via/computed/descriptor.d.ts +35 -0
  289. package/dist/via/i18n/active.d.ts +28 -0
  290. package/dist/via/i18n/binding.d.ts +36 -0
  291. package/dist/via/i18n/core.d.ts +267 -0
  292. package/dist/via/i18n/densify.d.ts +24 -0
  293. package/dist/via/i18n/dictionary.d.ts +200 -0
  294. package/dist/via/i18n/index.d.ts +21 -0
  295. package/dist/via/i18n/policy.d.ts +44 -0
  296. package/dist/via/i18n/script.d.ts +26 -0
  297. package/dist/via/i18n/strategy.d.ts +13 -0
  298. package/dist/via/lookup/active.d.ts +19 -0
  299. package/dist/via/lookup/binding.d.ts +99 -0
  300. package/dist/via/lookup/descriptor.d.ts +123 -0
  301. package/dist/via/lookup/handle.d.ts +220 -0
  302. package/dist/via/lookup/index.d.ts +17 -0
  303. package/dist/via/lookup/registry.d.ts +228 -0
  304. package/dist/via/lookup/snapshot.d.ts +67 -0
  305. package/dist/via/money/arith.d.ts +68 -0
  306. package/dist/via/money/binding.d.ts +21 -0
  307. package/dist/via/money/branded.d.ts +61 -0
  308. package/dist/via/money/descriptor.d.ts +73 -0
  309. package/dist/via/money/fixed-point.d.ts +51 -0
  310. package/dist/via/money/index.d.ts +15 -0
  311. package/dist/via/money/iso4217.d.ts +6 -0
  312. package/dist/via/money/money-reducer.d.ts +33 -0
  313. package/dist/via/money/normalize.d.ts +105 -0
  314. package/dist/via/money/paths.d.ts +61 -0
  315. package/dist/via/money/where.d.ts +127 -0
  316. package/dist/walk-XQCBKSBW.js +241 -0
  317. package/dist/with/index.js +11 -11
  318. package/dist/with-audit/attestation/active.d.ts +10 -0
  319. package/dist/with-audit/attestation/index.d.ts +16 -0
  320. package/dist/with-audit/attestation/issue.d.ts +29 -0
  321. package/dist/with-audit/attestation/revoke.d.ts +15 -0
  322. package/dist/with-audit/attestation/signer.d.ts +33 -0
  323. package/dist/with-audit/attestation/strategy.d.ts +44 -0
  324. package/dist/with-audit/attestation/vault-facade.d.ts +62 -0
  325. package/dist/with-audit/consent/active.d.ts +14 -0
  326. package/dist/with-audit/consent/consent.d.ts +114 -0
  327. package/dist/with-audit/consent/index.d.ts +14 -0
  328. package/dist/with-audit/consent/strategy.d.ts +36 -0
  329. package/dist/with-audit/forget/active.d.ts +31 -0
  330. package/dist/with-audit/forget/index.d.ts +28 -0
  331. package/dist/with-audit/forget/purge-scope.d.ts +54 -0
  332. package/dist/with-audit/forget/strategy.d.ts +177 -0
  333. package/dist/with-audit/forget/subject-index.d.ts +83 -0
  334. package/dist/with-audit/guards/executor.d.ts +26 -0
  335. package/dist/with-audit/guards/immutable-guard.d.ts +63 -0
  336. package/dist/with-audit/guards/index.d.ts +10 -0
  337. package/dist/with-audit/guards/read-only-facade.d.ts +31 -0
  338. package/dist/with-audit/guards/registry.d.ts +83 -0
  339. package/dist/with-audit/guards/transition-guard.d.ts +82 -0
  340. package/dist/with-audit/guards/types.d.ts +134 -0
  341. package/dist/with-audit/guards/with-guard.d.ts +15 -0
  342. package/dist/with-audit/periods/active.d.ts +11 -0
  343. package/dist/with-audit/periods/index.d.ts +18 -0
  344. package/dist/with-audit/periods/periods.d.ts +417 -0
  345. package/dist/with-audit/periods/strategy.d.ts +32 -0
  346. package/dist/with-audit/periods/vault-facade.d.ts +95 -0
  347. package/dist/with-audit/portability/active.d.ts +11 -0
  348. package/dist/with-audit/portability/export-accessible.d.ts +46 -0
  349. package/dist/with-audit/portability/index.d.ts +18 -0
  350. package/dist/with-audit/portability/request-withdrawal.d.ts +85 -0
  351. package/dist/with-audit/portability/strategy.d.ts +31 -0
  352. package/dist/with-audit/portability/withdraw-accessible.d.ts +82 -0
  353. package/dist/with-audit/sealed-record/active.d.ts +9 -0
  354. package/dist/with-audit/sealed-record/index.d.ts +55 -0
  355. package/dist/with-audit/sealed-record/strategy.d.ts +34 -0
  356. package/dist/with-audit/sealed-record/types.d.ts +27 -0
  357. package/dist/with-audit/tiers/active.d.ts +9 -0
  358. package/dist/with-audit/tiers/index.d.ts +122 -0
  359. package/dist/with-audit/tiers/strategy.d.ts +35 -0
  360. package/dist/with-cargo/active.d.ts +11 -0
  361. package/dist/with-cargo/adopt-partition.d.ts +81 -0
  362. package/dist/with-cargo/decrypt-partition.d.ts +19 -0
  363. package/dist/with-cargo/describe-extraction.d.ts +33 -0
  364. package/dist/with-cargo/extract-partition.d.ts +147 -0
  365. package/dist/with-cargo/index.d.ts +33 -0
  366. package/dist/with-cargo/strategy.d.ts +30 -0
  367. package/dist/with-cargo/vault-diff.d.ts +144 -0
  368. package/dist/with-cargo/walk-closure.d.ts +38 -0
  369. package/dist/with-commit/crdt/active.d.ts +25 -0
  370. package/dist/with-commit/crdt/crdt.d.ts +42 -0
  371. package/dist/with-commit/crdt/index.d.ts +16 -0
  372. package/dist/with-commit/crdt/strategy.d.ts +25 -0
  373. package/dist/with-commit/history/active.d.ts +40 -0
  374. package/dist/with-commit/history/diff.d.ts +23 -0
  375. package/dist/with-commit/history/history.d.ts +27 -0
  376. package/dist/with-commit/history/index.d.ts +30 -0
  377. package/dist/with-commit/history/ledger/constants.d.ts +37 -0
  378. package/dist/with-commit/history/ledger/entry.d.ts +195 -0
  379. package/dist/with-commit/history/ledger/hash.d.ts +30 -0
  380. package/dist/with-commit/history/ledger/index.d.ts +19 -0
  381. package/dist/with-commit/history/ledger/patch.d.ts +99 -0
  382. package/dist/with-commit/history/ledger/store.d.ts +335 -0
  383. package/dist/with-commit/history/strategy.d.ts +126 -0
  384. package/dist/with-commit/history/time-machine.d.ts +179 -0
  385. package/dist/with-commit/numbering/descriptor.d.ts +27 -0
  386. package/dist/with-commit/numbering/index.d.ts +69 -0
  387. package/dist/with-commit/sequence/active.d.ts +10 -0
  388. package/dist/with-commit/sequence/index.d.ts +150 -0
  389. package/dist/with-commit/sequence/strategy.d.ts +26 -0
  390. package/dist/with-commit/tx/active.d.ts +27 -0
  391. package/dist/with-commit/tx/dry-run.d.ts +29 -0
  392. package/dist/with-commit/tx/elevated-handle.d.ts +58 -0
  393. package/dist/with-commit/tx/index.d.ts +13 -0
  394. package/dist/with-commit/tx/invariants.d.ts +68 -0
  395. package/dist/with-commit/tx/strategy.d.ts +23 -0
  396. package/dist/with-commit/tx/transaction.d.ts +212 -0
  397. package/dist/with-fork/archive/engine.d.ts +71 -0
  398. package/dist/with-fork/archive/index.d.ts +23 -0
  399. package/dist/with-fork/shadow/active.d.ts +6 -0
  400. package/dist/with-fork/shadow/index.d.ts +14 -0
  401. package/dist/with-fork/shadow/strategy.d.ts +28 -0
  402. package/dist/with-fork/shadow/vault-frame.d.ts +93 -0
  403. package/dist/with-fork/snapshots/active.d.ts +20 -0
  404. package/dist/with-fork/snapshots/engine.d.ts +36 -0
  405. package/dist/with-fork/snapshots/index.d.ts +5 -0
  406. package/dist/with-fork/snapshots/noydb-facade.d.ts +64 -0
  407. package/dist/with-fork/snapshots/policy.d.ts +23 -0
  408. package/dist/with-fork/snapshots/scheduler.d.ts +34 -0
  409. package/dist/with-fork/snapshots/strategy.d.ts +48 -0
  410. package/dist/with-formula/computed/index.d.ts +48 -0
  411. package/dist/with-formula/computed/lazy.d.ts +13 -0
  412. package/dist/with-formula/derivations/executor.d.ts +61 -0
  413. package/dist/with-formula/derivations/fanout-sidecar.d.ts +75 -0
  414. package/dist/with-formula/derivations/index.d.ts +6 -0
  415. package/dist/with-formula/derivations/registry.d.ts +67 -0
  416. package/dist/with-formula/derivations/stale.d.ts +39 -0
  417. package/dist/with-formula/derivations/strategy-hash.d.ts +1 -0
  418. package/dist/with-formula/derivations/types.d.ts +248 -0
  419. package/dist/with-formula/derivations/with-derivation.d.ts +10 -0
  420. package/dist/with-formula/derivations/with-rollup.d.ts +34 -0
  421. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +58 -0
  422. package/dist/with-formula/materialized-views/executor.d.ts +71 -0
  423. package/dist/with-formula/materialized-views/index.d.ts +11 -0
  424. package/dist/with-formula/materialized-views/query-hash.d.ts +23 -0
  425. package/dist/with-formula/materialized-views/registry.d.ts +99 -0
  426. package/dist/with-formula/materialized-views/stale.d.ts +62 -0
  427. package/dist/with-formula/materialized-views/types.d.ts +318 -0
  428. package/dist/with-formula/materialized-views/with-materialized-view.d.ts +24 -0
  429. package/dist/with-formula/overlay-views/index.d.ts +5 -0
  430. package/dist/with-formula/overlay-views/registry.d.ts +42 -0
  431. package/dist/with-formula/overlay-views/types.d.ts +97 -0
  432. package/dist/with-formula/overlay-views/virtual-collection.d.ts +90 -0
  433. package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +9 -0
  434. package/dist/with-lookup/aggregate/active.d.ts +33 -0
  435. package/dist/with-lookup/aggregate/aggregation.d.ts +166 -0
  436. package/dist/with-lookup/aggregate/canonical-key.d.ts +16 -0
  437. package/dist/with-lookup/aggregate/groupby.d.ts +280 -0
  438. package/dist/with-lookup/aggregate/index.d.ts +23 -0
  439. package/dist/with-lookup/aggregate/reducers.d.ts +257 -0
  440. package/dist/with-lookup/aggregate/strategy.d.ts +59 -0
  441. package/dist/with-lookup/embeddings/cosine.d.ts +2 -0
  442. package/dist/with-lookup/embeddings/descriptor.d.ts +8 -0
  443. package/dist/with-lookup/embeddings/index.d.ts +3 -0
  444. package/dist/with-lookup/embeddings/vector-set.d.ts +19 -0
  445. package/dist/with-lookup/indexing/active.d.ts +30 -0
  446. package/dist/with-lookup/indexing/collection-facade.d.ts +120 -0
  447. package/dist/with-lookup/indexing/eager-indexes.d.ts +122 -0
  448. package/dist/with-lookup/indexing/index.d.ts +27 -0
  449. package/dist/with-lookup/indexing/lazy-builder.d.ts +102 -0
  450. package/dist/with-lookup/indexing/persisted-indexes.d.ts +229 -0
  451. package/dist/with-lookup/indexing/strategy.d.ts +56 -0
  452. package/dist/with-lookup/indexing/unique-constraints.d.ts +74 -0
  453. package/dist/with-lookup/search/active.d.ts +10 -0
  454. package/dist/with-lookup/search/build-docs.d.ts +15 -0
  455. package/dist/with-lookup/search/collection-facade.d.ts +123 -0
  456. package/dist/with-lookup/search/fuse.d.ts +22 -0
  457. package/dist/with-lookup/search/index-store.d.ts +19 -0
  458. package/dist/with-lookup/search/index.d.ts +19 -0
  459. package/dist/with-lookup/search/inverted-index.d.ts +47 -0
  460. package/dist/with-lookup/search/persisted-index-store.d.ts +41 -0
  461. package/dist/with-lookup/search/retrieve-types.d.ts +29 -0
  462. package/dist/with-lookup/search/scan.d.ts +28 -0
  463. package/dist/with-lookup/search/segment.d.ts +15 -0
  464. package/dist/with-lookup/search/serialize.d.ts +4 -0
  465. package/dist/with-lookup/search/snippet.d.ts +5 -0
  466. package/dist/with-lookup/search/strategy.d.ts +37 -0
  467. package/dist/with-lookup/search/tokenize.d.ts +12 -0
  468. package/dist/with-party/auth-introspection/index.d.ts +44 -0
  469. package/dist/with-party/broker/active.d.ts +23 -0
  470. package/dist/with-party/broker/index.d.ts +28 -0
  471. package/dist/with-party/broker/seed.d.ts +77 -0
  472. package/dist/with-party/custody/active.d.ts +10 -0
  473. package/dist/with-party/custody/index.d.ts +69 -0
  474. package/dist/with-party/custody/liberate.d.ts +64 -0
  475. package/dist/with-party/custody/strategy.d.ts +48 -0
  476. package/dist/with-party/directory/index.d.ts +11 -0
  477. package/dist/with-party/directory/public-envelope/index.d.ts +12 -0
  478. package/dist/with-party/directory/public-envelope/schema.d.ts +24 -0
  479. package/dist/with-party/directory/public-envelope/storage.d.ts +59 -0
  480. package/dist/with-party/directory/public-envelope/types.d.ts +80 -0
  481. package/dist/with-party/directory/storage.d.ts +33 -0
  482. package/dist/with-party/directory/types.d.ts +43 -0
  483. package/dist/with-party/directory/user-envelope/api.d.ts +201 -0
  484. package/dist/with-party/directory/user-envelope/index.d.ts +12 -0
  485. package/dist/with-party/directory/user-envelope/storage.d.ts +54 -0
  486. package/dist/with-party/directory/visibility.d.ts +47 -0
  487. package/dist/with-party/policy/engine.d.ts +60 -0
  488. package/dist/with-party/policy/index.d.ts +15 -0
  489. package/dist/with-party/policy/noydb-facade.d.ts +39 -0
  490. package/dist/with-party/policy/presets.d.ts +38 -0
  491. package/dist/with-party/policy/storage.d.ts +31 -0
  492. package/dist/with-party/session/active.d.ts +34 -0
  493. package/dist/with-party/session/dev-unlock.d.ts +128 -0
  494. package/dist/with-party/session/index.d.ts +23 -0
  495. package/dist/with-party/session/session-policy.d.ts +92 -0
  496. package/dist/with-party/session/session.d.ts +131 -0
  497. package/dist/with-party/session/strategy.d.ts +42 -0
  498. package/dist/with-party/session/unlock-state.d.ts +47 -0
  499. package/dist/with-party/sync/index.d.ts +31 -0
  500. package/dist/with-party/tab-coordination.d.ts +73 -0
  501. package/dist/with-party/tab-write-relay.d.ts +39 -0
  502. package/dist/with-party/team/active.d.ts +13 -0
  503. package/dist/with-party/team/authenticators.d.ts +95 -0
  504. package/dist/with-party/team/deed.d.ts +97 -0
  505. package/dist/with-party/team/delegation.d.ts +88 -0
  506. package/dist/with-party/team/index.d.ts +38 -0
  507. package/dist/with-party/team/keyring.d.ts +318 -0
  508. package/dist/with-party/team/magic-link-grant.d.ts +152 -0
  509. package/dist/with-party/team/managed-passphrase.d.ts +280 -0
  510. package/dist/with-party/team/noydb-facade.d.ts +484 -0
  511. package/dist/with-party/team/peer-recover.d.ts +81 -0
  512. package/dist/with-party/team/presence.d.ts +81 -0
  513. package/dist/with-party/team/recovery.d.ts +191 -0
  514. package/dist/with-party/team/reserved-secret-collections.d.ts +41 -0
  515. package/dist/with-party/team/rotate-recover.d.ts +275 -0
  516. package/dist/with-party/team/shamir-recovery-provider.d.ts +15 -0
  517. package/dist/with-party/team/strategy.d.ts +9 -0
  518. package/dist/with-party/team/sync-active.d.ts +33 -0
  519. package/dist/with-party/team/sync-credentials.d.ts +113 -0
  520. package/dist/with-party/team/sync-strategy.d.ts +67 -0
  521. package/dist/with-party/team/sync-transaction.d.ts +39 -0
  522. package/dist/with-party/team/sync.d.ts +174 -0
  523. package/dist/with-party/team/tiers.d.ts +39 -0
  524. package/dist/with-party/team/wrapped-deks.d.ts +86 -0
  525. package/dist/with-pod/backup.d.ts +74 -0
  526. package/dist/with-pod/bundle.d.ts +414 -0
  527. package/dist/with-pod/format.d.ts +203 -0
  528. package/dist/with-pod/index.d.ts +20 -0
  529. package/dist/with-pod/pod-store.d.ts +54 -0
  530. package/dist/with-pod/ulid.d.ts +64 -0
  531. package/dist/with-shape/blobs/blob-compaction.d.ts +170 -0
  532. package/dist/with-shape/blobs/blob-set.d.ts +342 -0
  533. package/dist/with-shape/blobs/export-blobs.d.ts +110 -0
  534. package/dist/with-shape/blobs/import-external.d.ts +50 -0
  535. package/dist/with-shape/blobs/mime-magic.d.ts +48 -0
  536. package/dist/with-shape/blobs/object-projection.d.ts +70 -0
  537. package/dist/with-shape/introspection/describe.d.ts +237 -0
  538. package/dist/with-shape/introspection/field-meta.d.ts +61 -0
  539. package/dist/with-shape/introspection/fields.d.ts +14 -0
  540. package/dist/with-shape/introspection/index.d.ts +12 -0
  541. package/dist/with-shape/introspection/json-schema.d.ts +13 -0
  542. package/dist/with-shape/introspection/meta.d.ts +22 -0
  543. package/dist/with-shape/introspection/projection.d.ts +13 -0
  544. package/dist/with-shape/introspection/types.d.ts +154 -0
  545. package/dist/with-shape/introspection/walk.d.ts +50 -0
  546. package/dist/with-shape/links/lazy-handle.d.ts +36 -0
  547. package/dist/with-shape/links/link-set.d.ts +67 -0
  548. package/dist/with-shape/links/names.d.ts +65 -0
  549. package/dist/with-shape/links/vault-facade.d.ts +211 -0
  550. package/dist/with-shape/persisted-schemas/canonicalize.d.ts +11 -0
  551. package/dist/with-shape/persisted-schemas/derive.d.ts +29 -0
  552. package/dist/with-shape/persisted-schemas/index.d.ts +21 -0
  553. package/dist/with-shape/persisted-schemas/register.d.ts +66 -0
  554. package/dist/with-shape/persisted-schemas/storage.d.ts +61 -0
  555. package/dist/with-shape/persisted-schemas/types.d.ts +54 -0
  556. package/dist/with-shape/satellites/dead-filter.d.ts +21 -0
  557. package/dist/with-shape/satellites/declare.d.ts +60 -0
  558. package/dist/with-shape/satellites/existence.d.ts +5 -0
  559. package/dist/with-shape/satellites/fanout.d.ts +38 -0
  560. package/dist/with-shape/satellites/forget.d.ts +47 -0
  561. package/dist/with-shape/satellites/index.d.ts +3 -0
  562. package/dist/with-shape/satellites/joined.d.ts +19 -0
  563. package/dist/with-shape/satellites/marker.d.ts +10 -0
  564. package/dist/with-shape/satellites/migrate-cek.d.ts +26 -0
  565. package/dist/with-shape/satellites/post-register.d.ts +6 -0
  566. package/dist/with-shape/satellites/proxy.d.ts +37 -0
  567. package/dist/with-shape/satellites/raw-target.d.ts +14 -0
  568. package/dist/with-shape/satellites/registry.d.ts +19 -0
  569. package/dist/with-shape/satellites/types.d.ts +37 -0
  570. package/dist/with-shape/satellites/validate.d.ts +17 -0
  571. package/dist/with-shape/schema-update/client-registry.d.ts +35 -0
  572. package/dist/with-shape/schema-update/cutover.d.ts +5 -0
  573. package/dist/with-shape/schema-update/delta.d.ts +2 -0
  574. package/dist/with-shape/schema-update/dispatch.d.ts +3 -0
  575. package/dist/with-shape/schema-update/fence-controller.d.ts +62 -0
  576. package/dist/with-shape/schema-update/fence-watcher.d.ts +37 -0
  577. package/dist/with-shape/schema-update/fence.d.ts +15 -0
  578. package/dist/with-shape/schema-update/gate.d.ts +16 -0
  579. package/dist/with-shape/schema-update/index.d.ts +6 -0
  580. package/dist/with-shape/schema-update/store-coordination-provider.d.ts +29 -0
  581. package/dist/with-shape/schema-update/strategies.d.ts +12 -0
  582. package/dist/with-shape/schema-update/types.d.ts +53 -0
  583. package/dist/with-store/index.d.ts +15 -0
  584. package/dist/with-store/lazy/active.d.ts +12 -0
  585. package/dist/with-store/lazy/index.d.ts +14 -0
  586. package/dist/with-store/lazy/strategy.d.ts +9 -0
  587. package/dist/with-store/route-store.d.ts +259 -0
  588. package/dist/with-store/store-middleware.d.ts +189 -0
  589. package/dist/withdraw-accessible-FMN4LPJZ.js +28 -0
  590. package/package.json +47 -43
  591. package/dist/aggregate/index.d.ts +0 -41
  592. package/dist/api-TX2EX2FX.js +0 -20
  593. package/dist/as/index.d.ts +0 -6
  594. package/dist/at/index.d.ts +0 -4
  595. package/dist/attestation/index.d.ts +0 -19
  596. package/dist/backup-R7NTDFKY.js +0 -225
  597. package/dist/blobs/index.d.ts +0 -43
  598. package/dist/bundle/index.d.ts +0 -121
  599. package/dist/bundle-D6GxiUfq.d.ts +0 -548
  600. package/dist/by/index.d.ts +0 -1
  601. package/dist/cargo/index.d.ts +0 -7
  602. package/dist/chunk-2OV5NVE7.js +0 -95
  603. package/dist/chunk-2OZXVKVP.js +0 -367
  604. package/dist/chunk-2REPHKET.js +0 -54
  605. package/dist/chunk-3JXPAHOZ.js +0 -686
  606. package/dist/chunk-3MATJ6O4.js +0 -367
  607. package/dist/chunk-3OPY6MK2.js +0 -404
  608. package/dist/chunk-3QSIU3UT.js +0 -291
  609. package/dist/chunk-4OMCIY6F.js +0 -99
  610. package/dist/chunk-5I35DOHK.js +0 -94
  611. package/dist/chunk-5VG4IJR7.js +0 -235
  612. package/dist/chunk-5YESYH2C.js +0 -155
  613. package/dist/chunk-6G5ORS5D.js +0 -202
  614. package/dist/chunk-6P5XCKSD.js +0 -71
  615. package/dist/chunk-6S7T6WC4.js +0 -111
  616. package/dist/chunk-6S7T6WC4.js.map +0 -1
  617. package/dist/chunk-7BWJHO2A.js +0 -34
  618. package/dist/chunk-7P2SDJG3.js +0 -279
  619. package/dist/chunk-7P2SDJG3.js.map +0 -1
  620. package/dist/chunk-ANB77BVV.js +0 -150
  621. package/dist/chunk-ANB77BVV.js.map +0 -1
  622. package/dist/chunk-BKARNZJN.js +0 -382
  623. package/dist/chunk-BQISD5ZV.js +0 -261
  624. package/dist/chunk-BUAQ7YI3.js +0 -1697
  625. package/dist/chunk-BUAQ7YI3.js.map +0 -1
  626. package/dist/chunk-CB7CWSKW.js +0 -430
  627. package/dist/chunk-CB7CWSKW.js.map +0 -1
  628. package/dist/chunk-DFVUTGT2.js +0 -515
  629. package/dist/chunk-DJ7KIPLV.js +0 -23
  630. package/dist/chunk-DSKDQP3G.js +0 -14066
  631. package/dist/chunk-DSKDQP3G.js.map +0 -1
  632. package/dist/chunk-DV4HUP5G.js +0 -99
  633. package/dist/chunk-EOXAAJTY.js +0 -621
  634. package/dist/chunk-ET67AY6B.js +0 -74
  635. package/dist/chunk-F4CEK5YM.js +0 -123
  636. package/dist/chunk-FORYWFN6.js +0 -130
  637. package/dist/chunk-FRP6D2DM.js +0 -91
  638. package/dist/chunk-FUOE7UUV.js +0 -341
  639. package/dist/chunk-FUOE7UUV.js.map +0 -1
  640. package/dist/chunk-G4JYND6L.js +0 -42
  641. package/dist/chunk-G6XV4H65.js +0 -59
  642. package/dist/chunk-GNMXXTMN.js +0 -85
  643. package/dist/chunk-HPWKV3YB.js +0 -21
  644. package/dist/chunk-HY3AUMFI.js +0 -41
  645. package/dist/chunk-HYR4WZZ3.js +0 -69
  646. package/dist/chunk-ICXIFFYZ.js +0 -355
  647. package/dist/chunk-ICXIFFYZ.js.map +0 -1
  648. package/dist/chunk-IVLTXX4W.js +0 -280
  649. package/dist/chunk-J4LPNIGK.js +0 -777
  650. package/dist/chunk-JJZ2LW6T.js +0 -36
  651. package/dist/chunk-KJ2BCBTL.js +0 -589
  652. package/dist/chunk-KNZB6JMR.js +0 -129
  653. package/dist/chunk-LEJIKBBB.js +0 -124
  654. package/dist/chunk-LL2NIVUR.js +0 -188
  655. package/dist/chunk-MCHVVJIA.js +0 -968
  656. package/dist/chunk-MCHVVJIA.js.map +0 -1
  657. package/dist/chunk-NUEQU36L.js +0 -392
  658. package/dist/chunk-O45M6LDB.js +0 -38
  659. package/dist/chunk-OBKWYKYC.js +0 -117
  660. package/dist/chunk-OHHKHSJP.js +0 -209
  661. package/dist/chunk-OT76OZL6.js +0 -45
  662. package/dist/chunk-OVYRLHPE.js +0 -150
  663. package/dist/chunk-OXCSVM3B.js +0 -155
  664. package/dist/chunk-P33LUIML.js +0 -205
  665. package/dist/chunk-PLS64NCS.js +0 -59
  666. package/dist/chunk-PS2NEWEX.js +0 -36
  667. package/dist/chunk-QA2KUPCP.js +0 -45
  668. package/dist/chunk-QOC3VYL2.js +0 -30
  669. package/dist/chunk-QSFOZUYL.js +0 -823
  670. package/dist/chunk-RHK32N73.js +0 -30
  671. package/dist/chunk-RW3Y22MW.js +0 -97
  672. package/dist/chunk-S7VFUQM2.js +0 -1484
  673. package/dist/chunk-S7VFUQM2.js.map +0 -1
  674. package/dist/chunk-T7WSLRAU.js +0 -49
  675. package/dist/chunk-TAKWLZZX.js +0 -944
  676. package/dist/chunk-TAKWLZZX.js.map +0 -1
  677. package/dist/chunk-TMBXVJKT.js +0 -75
  678. package/dist/chunk-TWKKOM55.js +0 -54
  679. package/dist/chunk-U3WZCU7E.js +0 -14
  680. package/dist/chunk-UF362QVH.js +0 -70
  681. package/dist/chunk-UN4FVIBH.js +0 -135
  682. package/dist/chunk-VEAVKDDB.js +0 -29
  683. package/dist/chunk-VEPTFUJY.js +0 -29
  684. package/dist/chunk-VJV7GKQK.js +0 -662
  685. package/dist/chunk-VQRAIPYF.js +0 -50
  686. package/dist/chunk-VRIYFLBA.js +0 -74
  687. package/dist/chunk-VWM3DAVB.js +0 -265
  688. package/dist/chunk-VWRRVE6D.js +0 -80
  689. package/dist/chunk-WBJIQSLL.js +0 -167
  690. package/dist/chunk-WBJIQSLL.js.map +0 -1
  691. package/dist/chunk-WIGQB62E.js +0 -164
  692. package/dist/chunk-WZSCE6RM.js +0 -466
  693. package/dist/chunk-WZSCE6RM.js.map +0 -1
  694. package/dist/chunk-XGDAPN6M.js +0 -255
  695. package/dist/chunk-XH7XP3OL.js +0 -1221
  696. package/dist/chunk-XREOISSI.js +0 -40
  697. package/dist/chunk-XUBPSPKD.js +0 -164
  698. package/dist/chunk-Y3A5CB5G.js +0 -247
  699. package/dist/chunk-YCXCR7VG.js +0 -230
  700. package/dist/chunk-YMVQD5Q5.js +0 -453
  701. package/dist/chunk-YN5IAHN6.js +0 -32
  702. package/dist/chunk-YN5IAHN6.js.map +0 -1
  703. package/dist/chunk-ZYJ55N7N.js +0 -86
  704. package/dist/classified/index.d.ts +0 -16
  705. package/dist/classified-marker-H6YSHYNK.js +0 -24
  706. package/dist/classified-marker-H6YSHYNK.js.map +0 -1
  707. package/dist/collection-facade-LVD22JLM.js +0 -39
  708. package/dist/computed-EXDMQODG.js +0 -11
  709. package/dist/consent/index.d.ts +0 -22
  710. package/dist/crdt/index.d.ts +0 -33
  711. package/dist/dead-filter-HQIE2YG7.js +0 -28
  712. package/dist/decrypt-partition-IHtxEnTi.d.ts +0 -21
  713. package/dist/delegation-BJP73GAP.js +0 -25
  714. package/dist/derivations/index.d.ts +0 -69
  715. package/dist/derive-BME7HDWO.js +0 -21
  716. package/dist/dev-unlock-Bmm2pgJ0.d.ts +0 -263
  717. package/dist/discriminant-BN9REW3o.d.ts +0 -60
  718. package/dist/enclave-NHORSWSF.js +0 -125
  719. package/dist/executor-FE6X4LFX.js +0 -9
  720. package/dist/executor-KSHKRJXP.js +0 -25
  721. package/dist/executor-ZHTJJICG.js +0 -9
  722. package/dist/export-accessible-DACHM5VT.js +0 -23
  723. package/dist/extract-partition-RNENZZ4T.js +0 -36
  724. package/dist/fanout-sidecar-OFWN3NM7.js +0 -74
  725. package/dist/find-BNGBJNKP.js +0 -11
  726. package/dist/forget/index.d.ts +0 -36
  727. package/dist/guards/index.d.ts +0 -34
  728. package/dist/hash-DAJjMsCE.d.ts +0 -72
  729. package/dist/history/index.d.ts +0 -60
  730. package/dist/i18n/index.d.ts +0 -56
  731. package/dist/in/index.d.ts +0 -4
  732. package/dist/index-B9QdHytu.d.ts +0 -123
  733. package/dist/index-DjWbxsjb.d.ts +0 -23579
  734. package/dist/index-qwuNvO2B.d.ts +0 -144
  735. package/dist/indexing/index.d.ts +0 -38
  736. package/dist/issue-NDI4CVZU.js +0 -19
  737. package/dist/lazy/index.d.ts +0 -20
  738. package/dist/ledger-6NDS2EO4.js +0 -42
  739. package/dist/liberate-HN3RIGIP.js +0 -24
  740. package/dist/link-set-SJB2MVJV.js +0 -31
  741. package/dist/materialized-views/index.d.ts +0 -189
  742. package/dist/mime-magic-bBj5OgUC.d.ts +0 -103
  743. package/dist/noydb-BWF6EPIR.js +0 -66
  744. package/dist/on/index.d.ts +0 -4
  745. package/dist/overlay-views/index.d.ts +0 -97
  746. package/dist/periods/index.d.ts +0 -19
  747. package/dist/pod/index.d.ts +0 -62
  748. package/dist/policy-WGNAG5H6.js +0 -41
  749. package/dist/portability/index.d.ts +0 -19
  750. package/dist/post-register-CWKBQRC7.js +0 -55
  751. package/dist/post-register-CWKBQRC7.js.map +0 -1
  752. package/dist/public-envelope-EJLVIFX7.js +0 -32
  753. package/dist/query/index.d.ts +0 -4
  754. package/dist/register-SBIX7TVV.js +0 -23
  755. package/dist/registry-3EQG6OOE.js +0 -18
  756. package/dist/registry-CA327ACV.js +0 -9
  757. package/dist/registry-E7OXOTSV.js +0 -19
  758. package/dist/request-withdrawal-KAH2AAXC.js +0 -31
  759. package/dist/reveal-R3JLHMUF.js +0 -38
  760. package/dist/revoke-IXLOJ3IH.js +0 -24
  761. package/dist/satellites/index.d.ts +0 -4
  762. package/dist/sealed-record/index.d.ts +0 -68
  763. package/dist/session/index.d.ts +0 -43
  764. package/dist/shadow/index.d.ts +0 -14
  765. package/dist/signer-Y46N2GJ3.js +0 -25
  766. package/dist/snapshots/index.d.ts +0 -25
  767. package/dist/stale-Z7IW6RIL.js +0 -14
  768. package/dist/storage-ADNP2UWI.js +0 -23
  769. package/dist/store-coordination-provider-DTDMI6VL.js +0 -142
  770. package/dist/subject-index-CyOgGMJL.d.ts +0 -380
  771. package/dist/sync/index.d.ts +0 -40
  772. package/dist/team/index.d.ts +0 -154
  773. package/dist/tiers/index.d.ts +0 -4
  774. package/dist/to/index.d.ts +0 -4
  775. package/dist/transition-guard-DI-krBsZ.d.ts +0 -165
  776. package/dist/tx/index.d.ts +0 -34
  777. package/dist/ui/index.d.ts +0 -4
  778. package/dist/ulid-DRH25k3y.d.ts +0 -66
  779. package/dist/util/index.d.ts +0 -79
  780. package/dist/validators-BUcli5Nh.d.ts +0 -101
  781. package/dist/vault-diff-Z2DUayMe.d.ts +0 -147
  782. package/dist/verify-JPF2YR5E.js +0 -139
  783. package/dist/walk-XYA2O3LW.js +0 -241
  784. package/dist/with/index.d.ts +0 -37
  785. package/dist/with-materialized-view-BUmzlXue.d.ts +0 -27
  786. package/dist/with-overlayed-view-m4FaXXTO.d.ts +0 -12
  787. package/dist/with-rollup-DEKGI9vb.d.ts +0 -47
  788. package/dist/withdraw-accessible-WLV4MTEN.js +0 -28
  789. /package/dist/{api-TX2EX2FX.js.map → api-3TH2GOFQ.js.map} +0 -0
  790. /package/dist/{backup-R7NTDFKY.js.map → backup-2WVBIVXW.js.map} +0 -0
  791. /package/dist/{chunk-TMBXVJKT.js.map → chunk-2MTRJCBI.js.map} +0 -0
  792. /package/dist/{chunk-3OPY6MK2.js.map → chunk-37WOJQWY.js.map} +0 -0
  793. /package/dist/{chunk-KJ2BCBTL.js.map → chunk-3QSOFZQB.js.map} +0 -0
  794. /package/dist/{chunk-DV4HUP5G.js.map → chunk-44IL5G3W.js.map} +0 -0
  795. /package/dist/{chunk-HYR4WZZ3.js.map → chunk-45QPICLE.js.map} +0 -0
  796. /package/dist/{chunk-XUBPSPKD.js.map → chunk-4BQXMCE5.js.map} +0 -0
  797. /package/dist/{chunk-RHK32N73.js.map → chunk-5HNX4OD4.js.map} +0 -0
  798. /package/dist/{chunk-2REPHKET.js.map → chunk-65VLRG3I.js.map} +0 -0
  799. /package/dist/{chunk-G6XV4H65.js.map → chunk-6MA575R5.js.map} +0 -0
  800. /package/dist/{chunk-F4CEK5YM.js.map → chunk-7GAXFU2O.js.map} +0 -0
  801. /package/dist/{chunk-6G5ORS5D.js.map → chunk-7QLY64AD.js.map} +0 -0
  802. /package/dist/{chunk-5VG4IJR7.js.map → chunk-7ZOSHEVS.js.map} +0 -0
  803. /package/dist/{chunk-LEJIKBBB.js.map → chunk-APHLCXVC.js.map} +0 -0
  804. /package/dist/{chunk-KNZB6JMR.js.map → chunk-BDEMZD4F.js.map} +0 -0
  805. /package/dist/{chunk-VJV7GKQK.js.map → chunk-BDPAVYGJ.js.map} +0 -0
  806. /package/dist/{chunk-G4JYND6L.js.map → chunk-BLUT46UP.js.map} +0 -0
  807. /package/dist/{chunk-J4LPNIGK.js.map → chunk-CCIR2OJH.js.map} +0 -0
  808. /package/dist/{chunk-5YESYH2C.js.map → chunk-CXC3JLAQ.js.map} +0 -0
  809. /package/dist/{chunk-XH7XP3OL.js.map → chunk-CZMCOFEA.js.map} +0 -0
  810. /package/dist/{chunk-WIGQB62E.js.map → chunk-DIB2BOIH.js.map} +0 -0
  811. /package/dist/{chunk-UF362QVH.js.map → chunk-EIZ4YOG2.js.map} +0 -0
  812. /package/dist/{chunk-DFVUTGT2.js.map → chunk-EVHBK7BN.js.map} +0 -0
  813. /package/dist/{chunk-ET67AY6B.js.map → chunk-EXGDL2UQ.js.map} +0 -0
  814. /package/dist/{chunk-YMVQD5Q5.js.map → chunk-F3LGBRSV.js.map} +0 -0
  815. /package/dist/{chunk-NUEQU36L.js.map → chunk-F44XWXOA.js.map} +0 -0
  816. /package/dist/{chunk-YCXCR7VG.js.map → chunk-FF7S3XDW.js.map} +0 -0
  817. /package/dist/{chunk-OXCSVM3B.js.map → chunk-FJTWLQV3.js.map} +0 -0
  818. /package/dist/{chunk-PS2NEWEX.js.map → chunk-FYNE4WLC.js.map} +0 -0
  819. /package/dist/{chunk-FORYWFN6.js.map → chunk-GL3JV5EV.js.map} +0 -0
  820. /package/dist/{chunk-VEAVKDDB.js.map → chunk-GXLZXD2W.js.map} +0 -0
  821. /package/dist/{chunk-3JXPAHOZ.js.map → chunk-HBBZWEC5.js.map} +0 -0
  822. /package/dist/{chunk-LL2NIVUR.js.map → chunk-HG76BZ6G.js.map} +0 -0
  823. /package/dist/{chunk-O45M6LDB.js.map → chunk-HGAB325C.js.map} +0 -0
  824. /package/dist/{chunk-T7WSLRAU.js.map → chunk-HK4XTXO4.js.map} +0 -0
  825. /package/dist/{chunk-U3WZCU7E.js.map → chunk-HYG32HCM.js.map} +0 -0
  826. /package/dist/{chunk-UN4FVIBH.js.map → chunk-ILF5GARW.js.map} +0 -0
  827. /package/dist/{chunk-BKARNZJN.js.map → chunk-INBQ43DI.js.map} +0 -0
  828. /package/dist/{chunk-Y3A5CB5G.js.map → chunk-IQIVD7TP.js.map} +0 -0
  829. /package/dist/{chunk-QA2KUPCP.js.map → chunk-J3JIYFYL.js.map} +0 -0
  830. /package/dist/{chunk-OVYRLHPE.js.map → chunk-JGUZMC3I.js.map} +0 -0
  831. /package/dist/{chunk-VWRRVE6D.js.map → chunk-JRKE5MAZ.js.map} +0 -0
  832. /package/dist/{chunk-XGDAPN6M.js.map → chunk-K2DLLK34.js.map} +0 -0
  833. /package/dist/{chunk-7BWJHO2A.js.map → chunk-KKYEZCQG.js.map} +0 -0
  834. /package/dist/{chunk-TWKKOM55.js.map → chunk-NAR6IDKH.js.map} +0 -0
  835. /package/dist/{chunk-OBKWYKYC.js.map → chunk-NEYKOESM.js.map} +0 -0
  836. /package/dist/{chunk-VEPTFUJY.js.map → chunk-NM3IFKBL.js.map} +0 -0
  837. /package/dist/{chunk-4OMCIY6F.js.map → chunk-NRYNRSGV.js.map} +0 -0
  838. /package/dist/{chunk-PLS64NCS.js.map → chunk-NT2ZO4KI.js.map} +0 -0
  839. /package/dist/{chunk-5I35DOHK.js.map → chunk-P2LJI6JE.js.map} +0 -0
  840. /package/dist/{chunk-QSFOZUYL.js.map → chunk-PH7G7ZI7.js.map} +0 -0
  841. /package/dist/{chunk-OHHKHSJP.js.map → chunk-PN5332SU.js.map} +0 -0
  842. /package/dist/{chunk-OT76OZL6.js.map → chunk-QF5LGMSV.js.map} +0 -0
  843. /package/dist/{chunk-3MATJ6O4.js.map → chunk-QG5RQQBO.js.map} +0 -0
  844. /package/dist/{chunk-DJ7KIPLV.js.map → chunk-QYPDYN23.js.map} +0 -0
  845. /package/dist/{chunk-IVLTXX4W.js.map → chunk-RNXJ2VO6.js.map} +0 -0
  846. /package/dist/{chunk-RW3Y22MW.js.map → chunk-RXTMLYJS.js.map} +0 -0
  847. /package/dist/{chunk-QOC3VYL2.js.map → chunk-S2OWPVSO.js.map} +0 -0
  848. /package/dist/{chunk-P33LUIML.js.map → chunk-S7TAPIRS.js.map} +0 -0
  849. /package/dist/{chunk-XREOISSI.js.map → chunk-SAL5X5OK.js.map} +0 -0
  850. /package/dist/{chunk-GNMXXTMN.js.map → chunk-SGJGWBSC.js.map} +0 -0
  851. /package/dist/{chunk-VQRAIPYF.js.map → chunk-SIAIYP6G.js.map} +0 -0
  852. /package/dist/{chunk-BQISD5ZV.js.map → chunk-TBNF5DV5.js.map} +0 -0
  853. /package/dist/{chunk-HPWKV3YB.js.map → chunk-TVOHSPVK.js.map} +0 -0
  854. /package/dist/{chunk-HY3AUMFI.js.map → chunk-TVS6BUUR.js.map} +0 -0
  855. /package/dist/{chunk-ZYJ55N7N.js.map → chunk-UMC5QZTX.js.map} +0 -0
  856. /package/dist/{chunk-2OZXVKVP.js.map → chunk-US34HTOI.js.map} +0 -0
  857. /package/dist/{chunk-EOXAAJTY.js.map → chunk-VCUQR6ZL.js.map} +0 -0
  858. /package/dist/{chunk-6P5XCKSD.js.map → chunk-WEHIQYQH.js.map} +0 -0
  859. /package/dist/{chunk-VWM3DAVB.js.map → chunk-WHQHTNT7.js.map} +0 -0
  860. /package/dist/{chunk-VRIYFLBA.js.map → chunk-X6Y5MXTH.js.map} +0 -0
  861. /package/dist/{chunk-3QSIU3UT.js.map → chunk-XJ47GS53.js.map} +0 -0
  862. /package/dist/{chunk-2OV5NVE7.js.map → chunk-XS6DLN67.js.map} +0 -0
  863. /package/dist/{chunk-FRP6D2DM.js.map → chunk-Y5TWPBNW.js.map} +0 -0
  864. /package/dist/{chunk-JJZ2LW6T.js.map → chunk-ZHOJOT6S.js.map} +0 -0
  865. /package/dist/{collection-facade-LVD22JLM.js.map → collection-facade-DWA735G2.js.map} +0 -0
  866. /package/dist/{computed-EXDMQODG.js.map → computed-ORCGM5JE.js.map} +0 -0
  867. /package/dist/{dead-filter-HQIE2YG7.js.map → dead-filter-OV5FGKOG.js.map} +0 -0
  868. /package/dist/{delegation-BJP73GAP.js.map → delegation-YVSHMIZZ.js.map} +0 -0
  869. /package/dist/{derive-BME7HDWO.js.map → derive-BUO555L5.js.map} +0 -0
  870. /package/dist/{enclave-NHORSWSF.js.map → enclave-XXFUKJC6.js.map} +0 -0
  871. /package/dist/{executor-FE6X4LFX.js.map → executor-6OCCE5VM.js.map} +0 -0
  872. /package/dist/{executor-KSHKRJXP.js.map → executor-JFVAJY42.js.map} +0 -0
  873. /package/dist/{executor-ZHTJJICG.js.map → executor-UPSH5O3F.js.map} +0 -0
  874. /package/dist/{export-accessible-DACHM5VT.js.map → export-accessible-L4A2QZA5.js.map} +0 -0
  875. /package/dist/{extract-partition-RNENZZ4T.js.map → extract-partition-ZHQ4RGGM.js.map} +0 -0
  876. /package/dist/{fanout-sidecar-OFWN3NM7.js.map → fanout-sidecar-IO2KDUWV.js.map} +0 -0
  877. /package/dist/{find-BNGBJNKP.js.map → find-ZFZDZQ2U.js.map} +0 -0
  878. /package/dist/{issue-NDI4CVZU.js.map → issue-OG4V23SQ.js.map} +0 -0
  879. /package/dist/{ledger-6NDS2EO4.js.map → ledger-UAQKPWNM.js.map} +0 -0
  880. /package/dist/{liberate-HN3RIGIP.js.map → liberate-GFUQJRK5.js.map} +0 -0
  881. /package/dist/{link-set-SJB2MVJV.js.map → link-set-DGYUOFVD.js.map} +0 -0
  882. /package/dist/{noydb-BWF6EPIR.js.map → noydb-AKH4AMCR.js.map} +0 -0
  883. /package/dist/{policy-WGNAG5H6.js.map → policy-5POYLI26.js.map} +0 -0
  884. /package/dist/{public-envelope-EJLVIFX7.js.map → public-envelope-GOG4LUM7.js.map} +0 -0
  885. /package/dist/{register-SBIX7TVV.js.map → register-ZI7YI7US.js.map} +0 -0
  886. /package/dist/{registry-3EQG6OOE.js.map → registry-DZ2T4LL7.js.map} +0 -0
  887. /package/dist/{registry-CA327ACV.js.map → registry-NVWEQ2GU.js.map} +0 -0
  888. /package/dist/{registry-E7OXOTSV.js.map → registry-SEKL74ET.js.map} +0 -0
  889. /package/dist/{request-withdrawal-KAH2AAXC.js.map → request-withdrawal-ZP3JIRVS.js.map} +0 -0
  890. /package/dist/{reveal-R3JLHMUF.js.map → reveal-NPVROV4D.js.map} +0 -0
  891. /package/dist/{revoke-IXLOJ3IH.js.map → revoke-VF6TAJK2.js.map} +0 -0
  892. /package/dist/{signer-Y46N2GJ3.js.map → signer-DRDDCCHW.js.map} +0 -0
  893. /package/dist/{stale-Z7IW6RIL.js.map → stale-TJXFQKOJ.js.map} +0 -0
  894. /package/dist/{storage-ADNP2UWI.js.map → storage-GR7KZRH4.js.map} +0 -0
  895. /package/dist/{store-coordination-provider-DTDMI6VL.js.map → store-coordination-provider-5KDS2RRP.js.map} +0 -0
  896. /package/dist/{verify-JPF2YR5E.js.map → verify-QK76NJ4G.js.map} +0 -0
  897. /package/dist/{walk-XYA2O3LW.js.map → walk-XQCBKSBW.js.map} +0 -0
  898. /package/dist/{withdraw-accessible-WLV4MTEN.js.map → withdraw-accessible-FMN4LPJZ.js.map} +0 -0
@@ -0,0 +1,1519 @@
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 { GhostRecord } from './types.js';
15
+ import type { StandardSchemaV1 } from './schema.js';
16
+ import type { DiffEntry } from '../with-commit/history/diff.js';
17
+ import { Query, ScanBuilder } from './query/index.js';
18
+ import type { JoinableSource } from './query/index.js';
19
+ import type { CollectionIndexes } from '../with-lookup/indexing/eager-indexes.js';
20
+ import { LazyQuery } from '../with-lookup/indexing/lazy-builder.js';
21
+ import type { SearchOptions, SearchResult } from '../with-lookup/search/index.js';
22
+ import type { RetrieveOptions, RetrieveHit } from '../with-lookup/search/retrieve-types.js';
23
+ import { type CollectionDescription, type DescribeOptions } from '../with-shape/introspection/describe.js';
24
+ import type { CollectionConfig } from '../with-shape/introspection/types.js';
25
+ import { type LruStats } from './cache/index.js';
26
+ import type { PresenceHandle } from '../with-party/team/presence.js';
27
+ import type { BlobSet } from '../with-shape/blobs/blob-set.js';
28
+ import type { TxContext } from '../with-commit/tx/transaction.js';
29
+ import { type CollectionOpts } from './collection-config.js';
30
+ /**
31
+ * Callback for dirty tracking (sync engine integration). `action: 'revert'`
32
+ * (spec #591) means "un-dirty" — the fan-out wiring in `noydb.ts` routes it
33
+ * to `SyncEngine.removeDirty` instead of `trackChange`; `version` is unused
34
+ * for that action.
35
+ */
36
+ export type OnDirtyCallback = (collection: string, id: string, action: 'put' | 'delete' | 'revert', version: number) => Promise<void>;
37
+ /**
38
+ * Event delivered to a `collection.subscribe()` callback. Distinct
39
+ * from the hub-level `ChangeEvent` — this one is bound to a single
40
+ * collection's type `T` and hydrates the record from cache on put.
41
+ *
42
+ * - `type: 'put'` — `record` is the current decrypted value, or
43
+ * `null` in the rare case where another op deleted the record
44
+ * between the emit and the handler firing.
45
+ * - `type: 'delete'` — `record` is always `null`; the deletion is
46
+ * the only information.
47
+ */
48
+ export interface CollectionChangeEvent<T> {
49
+ readonly type: 'put' | 'delete';
50
+ readonly id: string;
51
+ readonly record: T | null;
52
+ }
53
+ /**
54
+ * Per-collection cache configuration. Only meaningful when paired with
55
+ * `prefetch: false` (lazy mode); eager mode keeps the entire decrypted
56
+ * cache in memory and ignores these bounds.
57
+ */
58
+ export interface CacheOptions {
59
+ /** Maximum number of records to keep in memory before LRU eviction. */
60
+ maxRecords?: number;
61
+ /**
62
+ * Maximum total decrypted byte size before LRU eviction. Accepts a raw
63
+ * number or a human-friendly string: `'50KB'`, `'50MB'`, `'1GB'`.
64
+ * Eviction picks the least-recently-used entry until both budgets
65
+ * (maxRecords AND maxBytes, if both are set) are satisfied.
66
+ */
67
+ maxBytes?: number | string;
68
+ }
69
+ /** Statistics exposed via `Collection.cacheStats()`. */
70
+ export interface CacheStats extends LruStats {
71
+ /** True if this collection is in lazy mode. */
72
+ lazy: boolean;
73
+ }
74
+ /** A typed collection of records within a vault. */
75
+ export declare class Collection<T, S extends keyof T = never, Q extends keyof T & string = never, M extends keyof T & string = never> {
76
+ #private;
77
+ private readonly adapter;
78
+ private readonly vault;
79
+ private readonly name;
80
+ private readonly keyring;
81
+ private readonly storeCiphertext;
82
+ private readonly ramCiphertext;
83
+ private readonly emitter;
84
+ private readonly writeQueue;
85
+ private readonly schemaUpdateGate;
86
+ private readonly schemaFence;
87
+ private readonly writeHooks;
88
+ private readonly subsystemBus;
89
+ private readonly activeTxId;
90
+ private readonly getDEK;
91
+ private readonly onDirty;
92
+ /** #693: live check — true when multi-tab write-propagation is active; gates the #606 marker-id-set fallback read. */
93
+ private readonly tabCoordinated;
94
+ private readonly historyConfig;
95
+ /** True when the caller explicitly provided a `historyConfig` option (vs. inheriting the vault default). */
96
+ private readonly historyConfigExplicit;
97
+ /**
98
+ * tree-shake seam — the strategy that backs `collection.blob(id)`.
99
+ * Defaults to `NO_BLOBS`, a ~10-line stub that throws with an actionable
100
+ * message. Consumers opt into real blob storage by importing
101
+ * `{ blobs }` from `@noy-db/hub/blobs` and passing the returned
102
+ * strategy to `createNoydb({ blobStrategy: blobs() })`. With the
103
+ * default stub, none of the BlobSet / chunk / MIME-magic machinery
104
+ * reaches the bundle.
105
+ */
106
+ private readonly blobStrategy;
107
+ private readonly objectStore;
108
+ private readonly blobFields;
109
+ private readonly aggregateStrategy;
110
+ private readonly crdtStrategy;
111
+ private readonly tiersStrategy;
112
+ private readonly searchStrategy;
113
+ private readonly historyStrategy;
114
+ private readonly syncStrategy;
115
+ private readonly cache;
116
+ private hydrated;
117
+ /**
118
+ * #606: ids known to carry a delete marker in the store — lets the #589
119
+ * re-create version-continuity gate in `_putInternal` read the store ONLY
120
+ * for a known marker prior, instead of unconditionally on every insert.
121
+ * Populated on hydration (`ensureHydrated`/`hydrateFromSnapshot`), local
122
+ * delete (`_doDelete`), and the sync/tab/cutover choke point
123
+ * (`_invalidateCacheEntry`). Accepted drift: `vault._purgeDeleteMarkers`/
124
+ * `_purgeMarkersOn` remove markers directly on the raw store, bypassing
125
+ * Collection, so this set can hold stale ids after a purge on an
126
+ * already-loaded collection — perf-only and self-healing (a stale id just
127
+ * costs one `adapter.get` that returns non-marker/null, and version
128
+ * resolution falls back to 1 correctly). Do not try to wire purge into it.
129
+ */
130
+ private readonly markerIds;
131
+ /**
132
+ * Lazy mode flag. `true` when constructed with `prefetch: false`.
133
+ * In lazy mode the cache is bounded by an LRU and `list()`/`query()`
134
+ * throw — callers must use `scan()` or per-id `get()` instead.
135
+ */
136
+ private readonly lazy;
137
+ /**
138
+ * LRU cache for lazy mode. Only allocated when `prefetch: false` is set.
139
+ * Stores `{ record, version }` entries the same shape as `this.cache`.
140
+ * Tree-shaking note: importing Collection without setting `prefetch:false`
141
+ * still pulls in the Lru class today; future bundle-size work could
142
+ * lazy-import the cache module.
143
+ */
144
+ private readonly lru;
145
+ /**
146
+ * tree-shake seam — per-Collection indexing state. Owned by the
147
+ * `IndexStrategy` passed through from `createNoydb({ indexStrategy })`.
148
+ * Defaults to a disabled state (both accessors return null) so the
149
+ * `CollectionIndexes` / `PersistedCollectionIndex` / `LazyQuery`
150
+ * classes never reach the bundle when indexing is unused.
151
+ *
152
+ * Accessor helpers below (`get indexes()`, `get persistedIndexes()`)
153
+ * preserve the field-access ergonomics without changing every
154
+ * caller site.
155
+ */
156
+ private readonly indexState;
157
+ /**
158
+ * In-memory unique-constraint enforcement for eager mode.
159
+ * `null` when no `unique:true` indexes are declared on this collection, or when the collection is in lazy mode (which throws at registration).
160
+ */
161
+ private readonly uniqueConstraints;
162
+ /**
163
+ * True once `_idx/*` side-cars have been bulk-loaded into
164
+ * `persistedIndexes`. Flipped by `ensurePersistedIndexesLoaded()` on
165
+ * first lazy-mode query so subsequent queries skip the adapter round
166
+ * trip. Invalidation (remote sync, rotation) resets it alongside
167
+ * `persistedIndexes.clear()`.
168
+ */
169
+ private persistedIndexesLoaded;
170
+ /**
171
+ * Accessor for the in-memory eager-mode index mirror. Returns `null`
172
+ * when indexing is disabled on this Noydb instance (the
173
+ * `NO_INDEXING` default) or when the collection is in lazy mode
174
+ * (which uses the persisted mirror instead).
175
+ */
176
+ private get indexes();
177
+ /**
178
+ * Accessor for the persisted-mirror (lazy-mode) index. Returns `null` when indexing is disabled or the collection is in eager mode.
179
+ */
180
+ private get persistedIndexes();
181
+ /**
182
+ * per-collection reconcile-on-open policy. Read once
183
+ * from `CollectionOptions.reconcileOnOpen` and applied by
184
+ * `ensurePersistedIndexesLoaded()` on the first lazy-mode query.
185
+ */
186
+ private readonly reconcileOnOpen;
187
+ /**
188
+ * Re-entrancy guard for the auto-reconcile path. `reconcileIndex`
189
+ * reloads the mirror after applying fixes, which re-enters
190
+ * `ensurePersistedIndexesLoaded`; without this flag we'd trigger a
191
+ * second auto-reconcile pass and potentially infinite recursion.
192
+ */
193
+ private autoReconciling;
194
+ /**
195
+ * Optional Standard Schema v1 validator. When set, every `put()` runs
196
+ * the input through `validateSchemaInput` before encryption, and every
197
+ * record coming OUT of `decryptRecord` runs through
198
+ * `validateSchemaOutput`. A rejected input throws
199
+ * `SchemaValidationError` with `direction: 'input'`; drifted stored
200
+ * data throws with `direction: 'output'`. Both carry the rich issue
201
+ * list from the validator so UI code can render field-level messages.
202
+ *
203
+ * The schema is stored as `StandardSchemaV1<unknown, T>` because the
204
+ * collection type parameter `T` is the OUTPUT type — whatever the
205
+ * validator produces after transforms and coercion. Users who pass a
206
+ * schema to `defineNoydbStore` (or `Collection.constructor`) get their
207
+ * `T` inferred automatically via `InferOutput<Schema>`.
208
+ */
209
+ private readonly schema;
210
+ /**
211
+ * Vault-default locale. Used as the fallback when no per-call
212
+ * locale option is passed to `get()`/`list()`. Provided by Vault
213
+ * at collection construction time via the `collection({ locale })` or
214
+ * `openVault(name, { locale })` path.
215
+ *
216
+ * `undefined` means "no default locale set" — i18nText fields will
217
+ * throw `LocaleNotSpecifiedError` unless a per-call locale is passed.
218
+ */
219
+ private readonly defaultLocale;
220
+ /** 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). */
221
+ private i18nFields;
222
+ /** The configured string fields exposed to `retrieve()`; `undefined` for ordinary collections (zero-cost). */
223
+ private readonly textIndexes;
224
+ /** Session-scoped lexical index store; `undefined` (zero-cost) unless `textIndexes` is non-empty. */
225
+ private readonly searchIndexStore;
226
+ /** Embedding config for write-time vector derivation; `undefined` (zero-cost) for ordinary
227
+ * collections. When set, `put()` encodes the source field(s) and stores an encrypted `_vec` sidecar. */
228
+ private readonly embeddings;
229
+ /** In-memory vector set, populated lazily from `_vec` sidecars; `undefined` when no embedding config is declared. */
230
+ private vectorSet;
231
+ /** 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). */
232
+ private dictKeyFields;
233
+ /** Field name → `LookupDescriptor` for native `lookup()`/`enumOf()`/`dict()` fields (#650 Task 2) — describe()-only in this task. Mutable — see {@link _reconcileReadState} (#671 item 2). */
234
+ private lookupFields;
235
+ /** Sync join-dressing hook (#650 Task 6, #626 retirement) — `querySourceForJoin()`'s `presentForJoin`. Mutable — see {@link _reconcileReadState} (#671 item 3). */
236
+ private presentForJoin;
237
+ /** Consumer-neutral per-field descriptors declared via `fieldMeta`; read by `getFieldMeta()`, merged by `describe()`. */
238
+ private fieldMeta;
239
+ /** Collection-level descriptive metadata declared via `meta`; read by `getMeta()`, surfaced in `describe()`. */
240
+ private meta;
241
+ /** Outbound ref declarations (snapshot from vault refRegistry at construction time); used by `describe()`. */
242
+ private readonly _refs;
243
+ /** Money field descriptors keyed by field path, typed as the opaque {@link ViaDescriptor} marker
244
+ * (the kernel never inspects the concrete shape); `put()` quantizes to a scaled-int string,
245
+ * `get()`/`list()` decode back. Mutable so {@link _applyMoneyFields} can attach. */
246
+ private moneyFields;
247
+ private via;
248
+ /**
249
+ * Computed scalar fields, evaluated first on every `put()`. Mutable for
250
+ * the same MV-pre-creation reconcile as {@link moneyFields}.
251
+ */
252
+ private computed;
253
+ /**
254
+ * Resolved classified() sensitive-field descriptors, declared via the
255
+ * `classifiedFields` collection option. Mutable so {@link _applyClassifiedFields}
256
+ * can attach a declaration to a collection MV-analysis pre-created.
257
+ */
258
+ private classified;
259
+ /**
260
+ * Frozen construction-time facts the refusal matrix (R1-R5) checks against.
261
+ * Stored so {@link _applyClassifiedFields} — door 2, the reconcile seam —
262
+ * can re-run the SAME guard the config resolver ran at door 1 (C5's lesson:
263
+ * crdt/conflictPolicy/perRecordKeys are construction-only but
264
+ * classifiedFields can attach later).
265
+ */
266
+ private readonly classifiedGuardCtx;
267
+ /**
268
+ * Digest-only classified fields (`storage: 'digest-only'`), keyed by field
269
+ * name — the enclave-consumable policy map the codec's write path carries
270
+ * `_vdig` forward under (C6). `null` when the collection declares none.
271
+ */
272
+ private readonly vdigFields;
273
+ /** C-A/R10 memoization: marker declared-set lookup (undefined=unresolved) + classified-handle persist-once flag. */
274
+ private _markerDigestOnlyCache;
275
+ private _markerPersisted;
276
+ /**
277
+ * Tree-shake seam for `reveal()` — defaults to `NO_CLASSIFIED`, which
278
+ * throws `ClassifiedNotEnabledError`. Set via the `classifiedStrategy`
279
+ * `createNoydb()` option (opt in with `withClassified()`).
280
+ */
281
+ private readonly classifiedStrategy;
282
+ /** 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). */
283
+ private getDictionary;
284
+ /**
285
+ * declared deterministic fields. `null` when the feature
286
+ * is inactive for this collection; a frozen `Set` otherwise.
287
+ */
288
+ private readonly deterministicFields;
289
+ /**
290
+ * Declared structural-group-encryption fields (`sensitive`). Each is
291
+ * sealed into its own `_sealed[field]` slot under a per-field key and kept
292
+ * out of the open `_data` blob. Empty set ⇒ feature off (byte-identical
293
+ * output). See {@link encryptRecord} / {@link decryptRecord}.
294
+ */
295
+ private readonly sensitiveFields;
296
+ /**
297
+ * Per-record CEK opt-in (`perRecordKeys: true`). When set, writes mint /
298
+ * reuse a per-record content-encryption key and stamp `_cek` on the
299
+ * envelope (see {@link EncryptedEnvelope._cek}). OFF by default — a
300
+ * non-adopting collection takes the byte-identical legacy path. The READ
301
+ * path does not consult this flag: `_cek` presence on the envelope is the
302
+ * format discriminant, so a mixed vault (and a recipient that never set the
303
+ * flag) still decrypts CEK records.
304
+ */
305
+ private readonly perRecordCek;
306
+ /**
307
+ * Per-record provenance opt-in (`provenance: true`). When set, `put()` calls
308
+ * that supply a `source` option stamp `_source`/`_sourceTs` onto the
309
+ * unencrypted envelope metadata. Off by default — zero cost for collections
310
+ * that don't need lineage tracking.
311
+ */
312
+ private readonly provenance;
313
+ /**
314
+ * Session-scoped `(id) → CEK` cache for this collection. Lets updates
315
+ * reuse a record's stable CEK and lets repeated reads skip the AES-KW
316
+ * unwrap. Bounded by LRU; never persisted. Dropped when the owning
317
+ * collection instance is discarded — `vault.load()` clears the
318
+ * collectionCache, so a keyring refresh drops every CEK alongside the
319
+ * DEK cache. `null` unless `perRecordCek` is set.
320
+ */
321
+ private readonly cekCache;
322
+ /**
323
+ * The per-record envelope build + encrypt/decrypt + per-record-CEK +
324
+ * sealed-field crypto, extracted off this god-object. Holds no mutable
325
+ * state of its own — it shares this collection's `cekCache` reference (so
326
+ * tier methods and `vault.invalidateRecordCaches` evictions stay visible to
327
+ * it) and reads the rest of its dependencies as a frozen context snapshot.
328
+ */
329
+ private readonly codec;
330
+ /**
331
+ * declared tiers for this collection. `null` when
332
+ * tier-aware methods are disabled. Tier 0 is implicit and never
333
+ * stored here.
334
+ */
335
+ private readonly tiers;
336
+ private readonly tierMode;
337
+ private readonly onCrossTierAccess;
338
+ /**
339
+ * Optional reference to the vault-level hash-chained audit
340
+ * log. When present, every successful `put()` and `delete()` appends
341
+ * an entry to the ledger AFTER the adapter write succeeds (so a
342
+ * 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.
754
+ * Raw adapter path (bypasses the write gate + guards — the transform is
755
+ * trusted and runs only during the `migrating` phase). Bumps each
756
+ * record's `_v` and appends a ledger `op:'migration'` entry.
757
+ */
758
+ _applyCutoverTransform(transform: (doc: Record<string, unknown>) => Record<string, unknown>): Promise<number>;
759
+ /** @internal Untracked delete body — call {@link delete}, not this. */
760
+ private _deleteInternal;
761
+ /**
762
+ * @internal — system-internal delete that bypasses user-facing
763
+ * delete hooks (`onDelete`, FK ref enforcer). Used by derivation tombstones and MV refresh
764
+ * (Dim 14 v2) — system housekeeping shouldn't trip user invariants
765
+ * registered against the output collection. The ledger entry and
766
+ * history snapshot still fire so backup integrity and time-travel
767
+ * reconstruction stay consistent.
768
+ *
769
+ * Returns `true` when it erased a live record, `false` for delete-of-absent (idempotent
770
+ * contract — both txCtx-aware and txCtx===null callers honour this, short-circuiting before any side-effect).
771
+ *
772
+ * When a `txCtx` is supplied, the prior envelope is captured and
773
+ * pushed onto `txCtx._executed` BEFORE the delete fires — mirrors
774
+ * the rollback hardening for puts. Callers outside a
775
+ * multi-record transaction pass `null` and skip the tracking.
776
+ *
777
+ * Amendment composition: if `_internalDelete` runs while a vault's
778
+ * `GuardRegistry` has an amendment window open, the `{before, after:
779
+ * null}` change pair is pushed onto the amendment change-set the
780
+ * same way a user-initiated delete would. The `onDelete` user-hook
781
+ * is still skipped (housekeeping must not trip user invariants in
782
+ * normal mode), but the amendment's invariant DOES see the change
783
+ * — so a `RCT-CANCEL-001`-style invariant pairing can reject a
784
+ * derivation-driven tombstone fired during an admin amendment.
785
+ *
786
+ * Constraint to surface to consumers: output collections of
787
+ * derivations with `optional: true` outputs should not be the
788
+ * targets of `strict` or `cascade` inbound foreign-key refs —
789
+ * `_internalDelete` bypasses the ref enforcer by design (the
790
+ * `onDelete` bypass primitive). Treat the housekeeping path as
791
+ * "system can tombstone its own emissions regardless of FK shape."
792
+ *
793
+ * Permission handling is unchanged: the caller must still hold
794
+ * write permission on the collection (derivations run under the
795
+ * user's keyring).
796
+ */
797
+ _internalDelete(id: string, txCtx?: TxContext | null): Promise<boolean>;
798
+ private _doDelete;
799
+ /**
800
+ * @internal — GDPR crypto-shred a LIVE record to a tombstone.
801
+ *
802
+ * Rewrites the on-disk envelope to `{ _noydb, _v, _ts, _by, _iv:'', _data:'' }`,
803
+ * dropping `_iv`/`_data`/`_cek`/`_det`. The wrapped per-record CEK is gone, so
804
+ * the body — and (via {@link tombstoneHistory}) every history version under
805
+ * the same CEK — is permanently undecryptable; the collection DEK and every
806
+ * other record are untouched. `_det` is stripped too, so `findByDet` no
807
+ * longer matches the shredded record (avoiding a post-shred TamperedError).
808
+ *
809
+ * Unlike `delete()`/`_internalDelete`, this:
810
+ * - does NOT fire onDelete guards / MV / derivation dispatch (a shred is an
811
+ * erasure, not a domain delete — re-running those would be wrong),
812
+ * - does NOT append a per-record ledger entry (`vault.forget()` appends a
813
+ * single `op:'forget'` summary for the whole subject),
814
+ * - keeps the record KEY present (it's an overwrite, not an adapter delete)
815
+ * so the version counter + "record existed" survive for audit.
816
+ *
817
+ * Idempotent: returns `null` when the record is absent or already a tombstone.
818
+ * Otherwise returns `{ previousVersion }`. Invalidates the eager cache, the
819
+ * lazy LRU, and the per-record CEK cache for this id.
820
+ */
821
+ /**
822
+ * @internal — decrypt an envelope to a plain record for subject-index
823
+ * rebuild. Returns `null` for a tombstone or unreadable envelope.
824
+ * Skips schema validation — the rebuild only reads the subject field.
825
+ */
826
+ _decodeEnvelope(envelope: EncryptedEnvelope, id: string): Promise<Record<string, unknown> | null>;
827
+ _writeTombstone(id: string, actor: string): Promise<{
828
+ previousVersion: number;
829
+ } | null>;
830
+ /**
831
+ * Cascade deletes of array-shape derived rows when a source row is deleted. Reads each
832
+ * registered strategy's fanout sidecar for this source id, deletes every listed derived
833
+ * row, then deletes the sidecar itself. Returns the REAL erased count (#622 review Finding 1).
834
+ *
835
+ * Record-shape derivations are skipped on the ordinary delete path (see _doDelete's comment).
836
+ * `eraseRecordShapeToo` (#638 T6, default `false`) opts a same-id record-shape copy into
837
+ * erasure too — forget()'s fanout, GDPR residue. A delete-of-absent contributes 0 either way.
838
+ * @internal
839
+ */
840
+ dispatchArrayDerivationsOnDelete(id: string, eraseRecordShapeToo?: boolean): Promise<number>;
841
+ /**
842
+ * Mirror of {@link dispatchMaterializedViews} for the delete/forget path — no `_materializedFrom`
843
+ * skip (record's gone); the `internal` gate at `_doDelete` is the recursion guard. Returns the
844
+ * row count TOMBSTONED across every eager MV sourced here (#638 T6 — `forgetDerivedFanout`'s
845
+ * `derivedRecordsErased`); a lazy MV only flips its stale bit (0 contribution — resolved on read).
846
+ * @internal
847
+ */
848
+ dispatchMaterializedViewsOnDelete(id: string): Promise<number>;
849
+ /**
850
+ * List all records in the collection.
851
+ *
852
+ * Throws in lazy mode — bulk listing defeats the purpose of lazy
853
+ * hydration. Use `scan()` to iterate over the full collection
854
+ * page-by-page without holding more than `pageSize` records in memory.
855
+ *
856
+ * @param locale Optional locale options. When provided,
857
+ * each record is locale-resolved before being returned.
858
+ */
859
+ list(locale?: LocaleReadOptions): Promise<T[]>;
860
+ /**
861
+ * Scan-mode full-text search over a plain-text `field`. Decrypts the
862
+ * collection in memory and ranks records by BM25 against the tokenized query.
863
+ * **Zero added store leakage** — pure client-side scan; nothing searchable is
864
+ * written to the store. (A store-usable blind index for at-scale search is a
865
+ * separate, gated opt-in.) Eager mode only.
866
+ *
867
+ * `opts.match` (`'any'` default | `'all'`), `opts.prefix` (last query term as
868
+ * a prefix → typeahead), `opts.limit` (top-N). Returns `{ id, score, record }`
869
+ * ranked by descending score. The default tokenizer is word-boundary based —
870
+ * see `src/search/tokenize.ts` for the Thai/CJK caveat.
871
+ */
872
+ search(field: string, query: string, opts?: SearchOptions): Promise<SearchResult<T>[]>;
873
+ /** Force-persist the lexical index now — gated behind `searchStrategy: withSearch()`. */
874
+ flushIndex(): Promise<void>;
875
+ /** Pre-build the lexical index — gated behind `searchStrategy: withSearch()`. */
876
+ warmIndex(): Promise<void>;
877
+ /** Retrieval (lexical | semantic | hybrid) — gated behind `searchStrategy: withSearch()`. */
878
+ retrieve(query: string, opts?: RetrieveOptions<T>): Promise<RetrieveHit<T>[]>;
879
+ /** Raw-vector kNN — gated behind `searchStrategy: withSearch()`. */
880
+ similarTo(vector: Float32Array, opts?: {
881
+ k?: number;
882
+ minScore?: number;
883
+ includeRecord?: boolean;
884
+ }): Promise<RetrieveHit<T>[]>;
885
+ /**
886
+ * Bind the {@link SearchContext} the search/retrieval surface needs. The
887
+ * `cache` is the SAME `Map` reference the eager read/write path owns (passed
888
+ * by reference, never copied) so the index always builds over the live set.
889
+ */
890
+ private searchContext;
891
+ /**
892
+ * Put many records in one call. Each item is processed sequentially
893
+ * through the normal `put()` path — meaning per-item validation,
894
+ * history snapshots, ledger appends, and change events all still
895
+ * fire. The round-trip saving comes from the adapter staying hot
896
+ * across the batch (no connection re-open, no keyring re-unlock).
897
+ *
898
+ * ## Semantics
899
+ *
900
+ * **Best-effort with per-item results.** If item 5 of 10 fails, items
901
+ * 1–4 are already persisted and items 6–10 are still attempted.
902
+ * The returned {@link PutManyResult} lists every success and failure
903
+ * individually so the caller can decide whether to roll forward
904
+ * (retry the failures) or roll back (manually delete the successes).
905
+ *
906
+ * **True tx-atomic putMany** — pass `{ atomic: true }` to switch
907
+ * to the transaction executor: pre-flight CAS against every
908
+ * item's `expectedVersion`, then commit all ops with best-effort
909
+ * revert on mid-batch failure. Atomic mode throws on failure rather
910
+ * than returning a mixed-results object.
911
+ *
912
+ * ## Change events
913
+ *
914
+ * One `change` event per successfully-written record, same as N
915
+ * single-record puts. Subscribers don't need to special-case bulk.
916
+ */
917
+ putMany(entries: ReadonlyArray<readonly [id: string, record: T, opts?: PutManyItemOptions]>, options?: PutManyOptions): Promise<PutManyResult>;
918
+ /**
919
+ * Atomic-mode implementation of {@link putMany}. Pre-flights every
920
+ * `expectedVersion`, executes all puts in declaration order, and
921
+ * reverts executed ops via the raw adapter on mid-batch failure.
922
+ * See `runTransaction` for the shared semantics + crash-window caveat.
923
+ *
924
+ * @internal
925
+ */
926
+ private putManyAtomic;
927
+ /**
928
+ * Get many records in one call. Returns a `Map<id, T | null>` —
929
+ * missing records surface as `null` entries so the caller can
930
+ * distinguish "not found" from "lookup failed". Order-stable
931
+ * iteration (Map preserves insertion order = input `ids` order).
932
+ *
933
+ * Reads go through the per-id `get()` path, which means the cache
934
+ * / hydration logic stays consistent with single-record reads.
935
+ */
936
+ getMany(ids: readonly string[]): Promise<Map<string, T | null>>;
937
+ /**
938
+ * Delete many records in one call. Same best-effort contract as
939
+ * {@link putMany}: if item 5 fails, items 1–4 are already deleted
940
+ * and items 6–10 are still attempted.
941
+ *
942
+ * Deleting a non-existent id is not a failure — matches the
943
+ * idempotent semantics of single-record `delete()`.
944
+ */
945
+ deleteMany(ids: readonly string[]): Promise<DeleteManyResult>;
946
+ /**
947
+ * Build a chainable query against the collection. Returns a `Query<T>`
948
+ * builder when called with no arguments.
949
+ *
950
+ * Backward-compatible overload: passing a predicate function returns
951
+ * the filtered records directly (the API). Prefer the chainable
952
+ * form for new code.
953
+ *
954
+ * **Lazy-MV gap:** `query()` is synchronous and does NOT
955
+ * trigger lazy materialized-view resolve-on-read. If this
956
+ * collection is a lazy MV's output and the MV is currently stale,
957
+ * `query().toArray()` returns the pre-stale snapshot. To force a
958
+ * fresh read on a lazy MV, either call `list()` (which DOES
959
+ * trigger resolve) or `vault.refreshView(mvName)` before querying.
960
+ * The proper fix — extending `QuerySource` with an async prepare
961
+ * hook — is a separate PR.
962
+ *
963
+ * @example
964
+ * ```ts
965
+ * // New chainable API:
966
+ * const overdue = invoices.query()
967
+ * .where('status', '==', 'open')
968
+ * .where('dueDate', '<', new Date())
969
+ * .orderBy('dueDate')
970
+ * .toArray();
971
+ *
972
+ * // Legacy predicate form (still supported):
973
+ * const drafts = invoices.query(i => i.status === 'draft');
974
+ * ```
975
+ */
976
+ query(): Query<T, S, Q, M>;
977
+ query(predicate: (record: T) => boolean): T[];
978
+ /**
979
+ * Subscribe to every put/delete on this collection. Returns an
980
+ * unsubscribe function.
981
+ *
982
+ * Fires **after** the store write has committed — subscribers see
983
+ * only materialised state, never in-flight or rolled-back writes.
984
+ *
985
+ * This is an event stream, not a reactive value. For reactive
986
+ * "current array state" semantics use `query().live()`. Typical
987
+ * use cases for `subscribe()`:
988
+ * - audit-trail / activity-feed UI that lists events as they happen
989
+ * - Pinia-per-collection wiring where each store subscribes once
990
+ * - outbox-style workers that process every new record
991
+ *
992
+ * The callback receives a `CollectionChangeEvent<T>`:
993
+ * - `{ type: 'put', id, record }` — record is the current
994
+ * decrypted value. May be `null` if another op deleted the
995
+ * record between the emit and the handler firing (rare race).
996
+ * - `{ type: 'delete', id, record: null }` — deletion event;
997
+ * the record content is gone by the time the handler runs.
998
+ *
999
+ * The callback is invoked synchronously *with respect to the emit
1000
+ * moment*, but the record lookup is async (cache hit for eager
1001
+ * collections; one `get()` for lazy collections). If your handler
1002
+ * does not need the record, cast it away and ignore — the lookup
1003
+ * is still performed, but it's cheap on the hydrated path.
1004
+ *
1005
+ * ergonomic wrapper over `db.on('change', …)` that
1006
+ * filters to this collection and hydrates the record.
1007
+ */
1008
+ subscribe(cb: (event: CollectionChangeEvent<T>) => void): () => void;
1009
+ /**
1010
+ * Return a minimal JoinableSource view of this collection's
1011
+ * in-memory cache. Used by the Vault's `resolveSource`
1012
+ * method when another collection's `.join()` needs to probe this
1013
+ * one as the right side.
1014
+ *
1015
+ * The returned object captures the cache reference through a
1016
+ * closure, so subsequent mutations to the cache are visible to
1017
+ * the joined query. That's intentional: a join that fires after
1018
+ * the right-side collection has been updated should see the
1019
+ * fresh data.
1020
+ *
1021
+ * Throws in lazy mode because the cache is bounded and could
1022
+ * silently miss records — consistent with the `query()` /
1023
+ * `list()` lazy-mode policy. If this becomes a blocker for a
1024
+ * real consumer, the fix is to add an async `scan()`-backed
1025
+ * variant of this method, which is exactly what streaming joins will need anyway.
1026
+ */
1027
+ querySourceForJoin(): JoinableSource;
1028
+ /**
1029
+ * Cache statistics — useful for devtools, monitoring, and verifying
1030
+ * that LRU eviction is happening as expected in lazy mode.
1031
+ *
1032
+ * In eager mode, returns size only (no hits/misses are tracked because
1033
+ * every read is a cache hit by construction). In lazy mode, returns
1034
+ * the full LRU stats: `{ hits, misses, evictions, size, bytes }`.
1035
+ */
1036
+ cacheStats(): CacheStats;
1037
+ /** Get version history for a record, newest first. */
1038
+ history(id: string, options?: HistoryOptions): Promise<HistoryEntry<T>[]>;
1039
+ /**
1040
+ * Get a specific past version of a record.
1041
+ *
1042
+ * History reads intentionally **skip schema validation** — historical
1043
+ * records predate the current schema by definition, so validating them
1044
+ * against today's shape would be a false positive on any schema
1045
+ * evolution. If a caller needs validated history, they should filter
1046
+ * and re-put the records through the normal `put()` path.
1047
+ */
1048
+ getVersion(id: string, version: number): Promise<T | null>;
1049
+ /** Revert a record to a past version. Creates a new version with the old content. */
1050
+ revert(id: string, version: number): Promise<void>;
1051
+ /**
1052
+ * Compare two versions of a record and return the differences.
1053
+ * Use version 0 to represent "before creation" (empty).
1054
+ * Omit versionB to compare against the current version.
1055
+ */
1056
+ diff(id: string, versionA: number, versionB?: number): Promise<DiffEntry[]>;
1057
+ /** Resolve a version: try history first, then check if it's the current version. */
1058
+ private resolveVersion;
1059
+ private resolveCurrentOrVersion;
1060
+ /** Prune history entries for a record (or all records if id is undefined). */
1061
+ pruneRecordHistory(id: string | undefined, options: PruneOptions): Promise<number>;
1062
+ /** Clear all history for this collection (or a specific record). */
1063
+ clearHistory(id?: string): Promise<number>;
1064
+ /**
1065
+ * Count records in the collection.
1066
+ *
1067
+ * In eager mode this returns the in-memory cache size (instant). In
1068
+ * lazy mode it asks the adapter via `list()` to enumerate ids — slower
1069
+ * but still correct, and avoids loading any record bodies into memory.
1070
+ */
1071
+ count(): Promise<number>;
1072
+ /**
1073
+ * Fetch a single page of records via the adapter's optional `listPage`
1074
+ * extension. Returns the decrypted records for this page plus an opaque
1075
+ * cursor for the next page.
1076
+ *
1077
+ * Pass `cursor: undefined` (or omit it) to start from the beginning.
1078
+ * The final page returns `nextCursor: null`.
1079
+ *
1080
+ * If the adapter does NOT implement `listPage`, this falls back to a
1081
+ * synthetic implementation: it loads all ids via `list()`, sorts them,
1082
+ * and slices a window. The first call emits a one-time console.warn so
1083
+ * developers can spot adapters that should opt into the fast path.
1084
+ */
1085
+ listPage(opts?: {
1086
+ cursor?: string;
1087
+ limit?: number;
1088
+ }): Promise<{
1089
+ items: T[];
1090
+ nextCursor: string | null;
1091
+ }>;
1092
+ /**
1093
+ * Stream every record in the collection page-by-page as an async
1094
+ * iterable, with chainable `.where()` / `.filter()` clauses and a
1095
+ * memory-bounded `.aggregate(spec)` terminal.
1096
+ *
1097
+ * The whole point: process collections larger than RAM without
1098
+ * ever holding more than `pageSize` records decrypted at once.
1099
+ *
1100
+ * @example
1101
+ * ```ts
1102
+ * // Backward-compatible iteration — unchanged from the previous
1103
+ * // async-generator shape. `ScanBuilder` implements AsyncIterable.
1104
+ * for await (const record of invoices.scan({ pageSize: 500 })) {
1105
+ * await processOne(record)
1106
+ * }
1107
+ *
1108
+ * // — streaming aggregation with O(reducers) memory.
1109
+ * const { total, n } = await invoices.scan()
1110
+ * .where('year', '==', 2025)
1111
+ * .aggregate({ total: sum('amount'), n: count() })
1112
+ * ```
1113
+ *
1114
+ * **Lazy-MV gap:** `scan()` is synchronous-build and does
1115
+ * NOT trigger lazy materialized-view resolve-on-read. For lazy
1116
+ * MVs, call `list()` (which DOES resolve) or `vault.refreshView(name)`
1117
+ * before scanning. Same shape as the `query()` limitation.
1118
+ *
1119
+ * Returns a `ScanBuilder<T>` instead of the raw async iterator
1120
+ * that previous versions used. The builder implements
1121
+ * `AsyncIterable<T>`, so every existing `for await … of` call
1122
+ * continues to work unchanged. Direct `.next()` calls on the
1123
+ * iterator — not idiomatic, not used in the codebase — are no
1124
+ * longer supported; upgrade to `for await` or call the new
1125
+ * `.aggregate()` terminal.
1126
+ *
1127
+ * Uses `adapter.listPage` when available; otherwise falls back
1128
+ * to the synthetic pagination path with the same one-time
1129
+ * warning (`listPage()` routes through that fallback internally).
1130
+ */
1131
+ scan(opts?: {
1132
+ pageSize?: number;
1133
+ }): ScanBuilder<T, S, M>;
1134
+ /** Decrypt a page of envelopes returned by `adapter.listPage`. */
1135
+ private decryptPage;
1136
+ /** Load all records from adapter into memory cache. */
1137
+ /**
1138
+ * @internal — refresh the in-memory cache entry for a single id by
1139
+ * re-reading from the adapter. Used by the transaction executor's
1140
+ * Phase-3 revert path: that path writes the prior envelope directly
1141
+ * via the raw store (to avoid re-firing Collection-level side
1142
+ * effects), which would otherwise leave this Collection's eager
1143
+ * cache holding the rolled-back value. After revert, the executor
1144
+ * calls this hook so subsequent `get` / `query` reads see the
1145
+ * actual on-disk state.
1146
+ *
1147
+ * Lazy mode: drops the LRU entry; the next `get` repopulates from
1148
+ * the adapter. Eager mode: re-reads the envelope and either sets
1149
+ * the cache entry (record still present) or deletes it (record was
1150
+ * gone before the tx and the revert deleted it again).
1151
+ */
1152
+ /**
1153
+ * @internal — evict ONLY the per-record CEK cache entry for `id`. Used by
1154
+ * `vault.rotateRecordCek()`: after a hard CEK rotation the cached unwrapped
1155
+ * CEK is stale (it would decrypt the pre-rotation body and fail GCM auth on
1156
+ * the post-rotation body). Eviction must be synchronous with the live-envelope
1157
+ * rewrite so no concurrent read observes the old CEK. Paired with
1158
+ * {@link _invalidateCacheEntry} (which refreshes the decrypted-record cache).
1159
+ * No-op when the collection is not `perRecordKeys`.
1160
+ */
1161
+ _invalidateCekCacheEntry(id: string): void;
1162
+ /** @internal Satellite fan-out revert cleanup (spec #591): drop the sync dirty entry ('revert' is
1163
+ * onDirty-channel-only) and re-announce the RESTORED state as a plain put/delete — `subscribe()`
1164
+ * only understands those two actions, and the restored record may exist again. */
1165
+ _compensateRevertedWrite(id: string): Promise<void>;
1166
+ _invalidateCacheEntry(id: string): Promise<void>;
1167
+ /**
1168
+ * Apply a peer tab's committed write to THIS tab's in-memory view:
1169
+ * re-read the (already-persisted) envelope from the shared store + refresh
1170
+ * cache/indexes, then emit a `change` event so reactive consumers re-render.
1171
+ * Never writes to the store and never fires write hooks, so it cannot loop.
1172
+ */
1173
+ _applyRemoteChange(id: string, action: 'put' | 'delete'): Promise<void>;
1174
+ /**
1175
+ * Origin-tagged mutation choke point (#623 task 10) — the single dispatch
1176
+ * point every put/delete path funnels through, AFTER its own store write,
1177
+ * to fire the side-effects that path performs today. Each case below
1178
+ * performs EXACTLY the side-effect set the seam-map Part-3 table
1179
+ * (`.superpowers/sdd/seam-map-i18n-pipeline.md`) records for `origin` —
1180
+ * this is a pure parity extraction of existing tails, not a behavior
1181
+ * change. Phase C (#621, #622) plugs the dependency-graph dispatch into
1182
+ * this socket, keyed off `origin`, without every call site having to
1183
+ * learn the graph.
1184
+ *
1185
+ * `restore` is never reached: `Vault.load` / `backup.ts#loadVault` drops
1186
+ * the whole `collectionCache` instead of dispatching per record — the
1187
+ * origin is reserved for phase C.
1188
+ *
1189
+ * @internal
1190
+ */
1191
+ _onRecordMutated(id: string, action: 'put' | 'delete', origin: MutationOrigin, ctx?: {
1192
+ readonly record?: T;
1193
+ readonly version?: number;
1194
+ }): Promise<void>;
1195
+ /** @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. */
1196
+ _peekCached(id: string): T | null;
1197
+ private ensureHydrated;
1198
+ /** Hydrate from a pre-loaded snapshot (used by Vault). */
1199
+ hydrateFromSnapshot(records: Record<string, EncryptedEnvelope>): Promise<void>;
1200
+ /**
1201
+ * Rebuild secondary indexes from the current in-memory cache.
1202
+ *
1203
+ * Called after any bulk hydration. Incremental put/delete updates
1204
+ * are handled by `indexes.upsert()` / `indexes.remove()` directly,
1205
+ * so this only fires for full reloads.
1206
+ *
1207
+ * Synchronous and O(N × indexes.size); for the target scale of
1208
+ * 1K–50K records this completes in single-digit milliseconds.
1209
+ */
1210
+ private rebuildEagerIndexesFromCache;
1211
+ /**
1212
+ * Rebuild unique-constraint maps from the current in-memory cache.
1213
+ * Called after any bulk hydration alongside `rebuildEagerIndexesFromCache`.
1214
+ */
1215
+ private rebuildUniqueConstraintsFromCache;
1216
+ /**
1217
+ * Rebuild every declared index from scratch.
1218
+ *
1219
+ * Eager mode: refreshes the in-memory `CollectionIndexes` from the
1220
+ * current cache — O(records × declaredFields).
1221
+ *
1222
+ * Lazy mode: tears down every `_idx/<field>/<recordId>`
1223
+ * side-car, walks the canonical record namespace, and materialises
1224
+ * fresh side-cars for every declared field. The in-memory mirror is
1225
+ * cleared and re-ingested. Intended for two scenarios:
1226
+ * 1. Adding a new indexed field to a collection that already holds
1227
+ * records — after the schema change, call `rebuildIndexes()` to
1228
+ * backfill the side-cars.
1229
+ * 2. Recovery from a catastrophic drift (audit noticed many
1230
+ * `index:write-partial` events, operator wants a clean slate).
1231
+ *
1232
+ * The rebuild is NOT incremental — it's a full bulk-replace. For
1233
+ * per-field drift repair, use `reconcileIndex(field)` instead.
1234
+ */
1235
+ rebuildIndexes(): Promise<void>;
1236
+ /**
1237
+ * Compare the persisted `_idx/<field>/*` side-cars against the
1238
+ * canonical records for a single field, reporting the drift (and
1239
+ * optionally repairing it).
1240
+ *
1241
+ * Lazy mode only. Eager mode throws — the in-memory index cannot
1242
+ * drift.
1243
+ *
1244
+ * `missing` — record ids whose value is indexable but no side-car
1245
+ * exists. Happens when a `put()` succeeded but the side-car put
1246
+ * failed (surfaced as `index:write-partial`).
1247
+ * `stale` — side-car ids pointing to a record that no longer exists
1248
+ * or whose current value no longer matches the side-car body.
1249
+ * `applied` — number of writes that were actually applied (always 0
1250
+ * when `dryRun: true`).
1251
+ *
1252
+ * Design reference: acceptance criteria.
1253
+ */
1254
+ reconcileIndex(field: string, opts?: {
1255
+ dryRun?: boolean;
1256
+ }): Promise<{
1257
+ field: string;
1258
+ missing: string[];
1259
+ stale: string[];
1260
+ applied: number;
1261
+ }>;
1262
+ /**
1263
+ * Get the in-memory index store. Used by `Query` to short-circuit
1264
+ * `==` and `in` lookups when an index covers the where clause.
1265
+ *
1266
+ * Returns `null` if no indexes are declared on this collection.
1267
+ */
1268
+ getIndexes(): CollectionIndexes | null;
1269
+ /**
1270
+ * Return a `BlobSet` for the given record id.
1271
+ *
1272
+ * No I/O is performed until you call a method on the handle.
1273
+ *
1274
+ * ```ts
1275
+ * const blobs = invoices.blob('inv-001')
1276
+ *
1277
+ * // Upload a PDF (deduplicates automatically, MIME auto-detected)
1278
+ * await blobs.put('receipt.pdf', pdfBytes)
1279
+ *
1280
+ * // List slots
1281
+ * const files = await blobs.list() // SlotInfo[]
1282
+ *
1283
+ * // Serve as HTTP response (Content-Type, ETag, streaming body)
1284
+ * const res = await blobs.response('receipt.pdf', { inline: true })
1285
+ *
1286
+ * // Publish a named version (amendment versioning)
1287
+ * await blobs.publish('receipt.pdf', 'issued-2025-01')
1288
+ *
1289
+ * // Raw bytes
1290
+ * const bytes = await blobs.get('receipt.pdf')
1291
+ * ```
1292
+ *
1293
+ * Blobs are stored in internal collections (`_blob_slots_*`, `_blob_index`,
1294
+ * `_blob_chunks`, `_blob_versions_*`) that are excluded from queries and
1295
+ * `list()`. Slot metadata uses this collection's DEK; chunk data uses a
1296
+ * vault-shared `_blob` DEK (enabling cross-collection deduplication).
1297
+ */
1298
+ blob(id: string): BlobSet;
1299
+ /** Get all records as encrypted envelopes (for dump). */
1300
+ dumpEnvelopes(): Promise<Record<string, EncryptedEnvelope>>;
1301
+ /**
1302
+ * Apply locale resolution to a record.
1303
+ *
1304
+ * Called from `get()` and `list()` when locale options are present.
1305
+ * Uses the effective locale: per-call `locale` takes precedence over
1306
+ * `this.defaultLocale`.
1307
+ *
1308
+ * - i18nText fields: replaced with the resolved string (or the full
1309
+ * map when `locale === 'raw'`).
1310
+ * - dictKey fields: `<field>Label` virtual fields added.
1311
+ *
1312
+ * Returns the record unchanged when no Via pipeline is compiled (#638 Task 7:
1313
+ * was money/i18n/dictKey-flag-gated — missed any OTHER binding's `present`
1314
+ * hook, e.g. the `computed` via-binding's virtual-mode read-time compute;
1315
+ * `this.via` truthiness is the general condition every binding's presence
1316
+ * already implies).
1317
+ */
1318
+ private applyLocaleToRecord;
1319
+ /**
1320
+ * Low-level: encrypt a pre-serialised JSON string into an EncryptedEnvelope.
1321
+ * Used by both the normal record path and the CRDT path (which serialises
1322
+ * a CrdtState rather than a T).
1323
+ */
1324
+ /**
1325
+ * Write / update / delete the `_idx/<field>/<recordId>` side-cars for
1326
+ * every declared persistence-index field on this collection after a
1327
+ * successful main-record `put()`.
1328
+ *
1329
+ * Timing: called AFTER `adapter.put()` of the main record succeeds, so
1330
+ * a failed main write never leaves a stale index entry. Side-car write
1331
+ * failures do NOT fail the overall `put()` — the main record is already
1332
+ * durably committed. Per-field failures surface as
1333
+ * `IndexWriteFailureError` on the emitter's `index:write-partial`
1334
+ * channel and the operator runs a reconcile pass later.
1335
+ *
1336
+ * Null/undefined field values are not indexed — matches the
1337
+ * `PersistedCollectionIndex.stringifyKey` contract. If the prior value
1338
+ * was non-null and the new value is null, the side-car is deleted.
1339
+ */
1340
+ private maintainPersistedIndexesOnPut;
1341
+ /**
1342
+ * Tear down `_idx/<field>/<recordId>` side-cars for a deleted record.
1343
+ * Mirror state updates regardless of adapter outcome; adapter failures
1344
+ * surface on `index:write-partial` the same way put does.
1345
+ */
1346
+ private maintainPersistedIndexesOnDelete;
1347
+ /**
1348
+ * @internal — hard-delete this record's persisted `_idx/<field>/<recordId>`
1349
+ * side-cars for the erasure path. `forget()` crypto-shreds the body but
1350
+ * keeps the collection DEK, under which these side-cars are encrypted — so
1351
+ * without this they leave the indexed field VALUES readable after a "forget".
1352
+ *
1353
+ * Content-free: the side-car id is `encodeIdxId(def.key, id)`, so it needs no
1354
+ * body decode (the body is being shredded). Eager mode has no durable side-car
1355
+ * → no-op. The in-memory mirror is left as-is: it is ephemeral (rebuilt from
1356
+ * the now-deleted side-cars on reopen) and live reads skip the tombstone, so a
1357
+ * stale mirror hit cannot surface the erased record. Returns the count deleted
1358
+ * + the `def.key`s whose delete FAILED (residue that still leaks the value).
1359
+ */
1360
+ _purgePersistedIndexes(id: string): Promise<{
1361
+ purged: number;
1362
+ residue: string[];
1363
+ }>;
1364
+ /** Drop a record's encrypted _vec sidecar on erasure (a vector is text-invertible).
1365
+ * Called by vault.ts forget() inside a resilient try/catch; residue is reported in ForgetResult. */
1366
+ _purgeVector(id: string): Promise<void>;
1367
+ /** Drop the persisted lexical-index blob (forget/erasure): an opaque
1368
+ * all-records index must not survive crypto-shred. Idempotent; no-op without persist. */
1369
+ _purgeSearchIndex(): Promise<void>;
1370
+ /**
1371
+ * Bulk-load the persisted-index mirror from `_idx/<field>/*` side-cars
1372
+ * on first lazy-mode query. Idempotent — subsequent calls short-circuit
1373
+ * on the `persistedIndexesLoaded` flag.
1374
+ *
1375
+ * Listing the whole id namespace is acceptable here because the caller
1376
+ * has already decided to pay a first-query cost (this is the indexed
1377
+ * equivalent of lazy-mode hydration, not a per-query scan).
1378
+ */
1379
+ private ensurePersistedIndexesLoaded;
1380
+ /**
1381
+ * Walk every declared persisted-index field, run `reconcileIndex`
1382
+ * per the configured policy, and emit `index:reconciled` for each.
1383
+ * Called internally by `ensurePersistedIndexesLoaded()` — exposed as
1384
+ * a private helper for readability, not as a public API (the public
1385
+ * entry points are `reconcileIndex` and `rebuildIndexes`).
1386
+ */
1387
+ private autoReconcile;
1388
+ /**
1389
+ * Construct a `LazyQuery<T>` bound to this collection. Used by the
1390
+ * lazy-mode branch of `query()` and kept private because callers should
1391
+ * always go through `query()` to pick up the eager/lazy dispatch.
1392
+ */
1393
+ /**
1394
+ * Build a chainable indexed-read query against a lazy-mode collection.
1395
+ *
1396
+ * Companion to `query()`, which is eager-mode only and materialises a
1397
+ * snapshot. `lazyQuery()` dispatches every read through the persisted
1398
+ * index side-cars — no bulk decrypt, no snapshot. Every field touched by
1399
+ * `.where(...)` or `.orderBy(...)` MUST be declared in `indexes`;
1400
+ * otherwise `.toArray()` throws `IndexRequiredError`.
1401
+ *
1402
+ * The returned builder is always Promise-returning on its terminals
1403
+ * (`toArray`, `first`, `count`) because candidate records are decrypted
1404
+ * from the adapter on demand.
1405
+ *
1406
+ * @example
1407
+ * ```ts
1408
+ * const disbursements = vault.collection<Disbursement>('disbursements', {
1409
+ * prefetch: false,
1410
+ * cache: { maxRecords: 1000 },
1411
+ * indexes: ['clientId', 'period'],
1412
+ * })
1413
+ * const rows = await disbursements.lazyQuery()
1414
+ * .where('clientId', '==', 'c-42')
1415
+ * .orderBy('period', 'desc')
1416
+ * .limit(50)
1417
+ * .toArray()
1418
+ * ```
1419
+ *
1420
+ * Throws at call time when the collection is in eager mode — use
1421
+ * `query()` there. Throws if no index is declared, because a lazy
1422
+ * query with no index would need to enumerate the whole collection.
1423
+ */
1424
+ lazyQuery(): LazyQuery<T, S, Q>;
1425
+ /**
1426
+ * Resolve the stable CEK for a record on the WRITE path — see
1427
+ * {@link resolveStableCek}. Thin delegate that supplies the collection's
1428
+ * CEK cache, live-envelope reader, and DEK resolver.
1429
+ */
1430
+ private resolveRecordCek;
1431
+ /** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
1432
+ private _ensureClassifiedMarker;
1433
+ /** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
1434
+ private _classifiedMarkerDigestOnly;
1435
+ /**
1436
+ * find the first record whose deterministic field matches
1437
+ * the given plaintext. Returns `null` when no match exists.
1438
+ *
1439
+ * Reads every envelope via the adapter and compares the stored
1440
+ * `_det[field]` to a freshly computed deterministic ciphertext — no
1441
+ * record bodies are decrypted during the search, which is the whole
1442
+ * point of a deterministic index.
1443
+ *
1444
+ * Throws when the field is not declared in `deterministicFields`, so a
1445
+ * typo fails loudly at the call site rather than silently returning
1446
+ * null forever.
1447
+ */
1448
+ findByDet(field: string, value: unknown): Promise<T | null>;
1449
+ /**
1450
+ * return every record whose deterministic field matches.
1451
+ * Same semantics as {@link findByDet} but without the short-circuit.
1452
+ */
1453
+ queryByDet(field: string, value: unknown): Promise<T[]>;
1454
+ /** Bind the {@link DeterministicContext} this collection's det lookups need. */
1455
+ private detContext;
1456
+ /** tier-aware put — gated behind `tiersStrategy: withTiers()`. */
1457
+ putAtTier(id: string, record: T, tier: number, opts?: {
1458
+ elevation?: {
1459
+ reason: string;
1460
+ fromTier: number;
1461
+ };
1462
+ source?: string;
1463
+ sourceTs?: string;
1464
+ }): Promise<void>;
1465
+ /** tier-aware get — gated behind `tiersStrategy: withTiers()`. */
1466
+ getAtTier(id: string): Promise<T | GhostRecord | null>;
1467
+ /** list ids grouped by the caller's readability — gated behind `withTiers()`. */
1468
+ listAtTier(): Promise<Array<{
1469
+ id: string;
1470
+ tier: number;
1471
+ readable: boolean;
1472
+ }>>;
1473
+ /** elevate a record to a higher tier — gated behind `withTiers()`. */
1474
+ elevate(id: string, toTier: number): Promise<void>;
1475
+ /** demote a record to a lower tier — gated behind `withTiers()`. */
1476
+ demote(id: string, toTier: number): Promise<void>;
1477
+ /**
1478
+ * Emit a cross-tier access event. The subscriber sink stays collection-
1479
+ * resident (it captures `onCrossTierAccess`); the tiers module reaches it
1480
+ * via the {@link TiersContext.emitCrossTierEvent} callback.
1481
+ */
1482
+ private emitCrossTierEvent;
1483
+ /**
1484
+ * Classify a live envelope's `_sealed` slots for crypto-shred completeness
1485
+ * (#M-1, 2026-06-30 security review). Kept as a `_`-prefixed method on
1486
+ * Collection because `vault.ts` forget() reaches in via this name.
1487
+ */
1488
+ _classifySealedShred(live: EncryptedEnvelope): Promise<{
1489
+ readonly slots: readonly SealedShredSlot[];
1490
+ }>;
1491
+ _onViaErase(id: string, live: EncryptedEnvelope): Promise<ViaEraseReport | undefined>;
1492
+ get _via(): ViaPipeline | undefined;
1493
+ _setVia(pipeline: ViaPipeline | undefined): void;
1494
+ get _viaFieldsSnapshot(): {
1495
+ i18nFields: Record<string, I18nTextDescriptor> | undefined;
1496
+ lookupFields: Record<string, LookupDescriptor> | undefined;
1497
+ };
1498
+ _reconcileReadState(patch: {
1499
+ dictKeyFields?: Record<string, DictKeyDescriptor | StaticDictDescriptor>;
1500
+ i18nFields?: Record<string, I18nTextDescriptor>;
1501
+ lookupFields?: Record<string, LookupDescriptor>;
1502
+ getDictionary?: (name: string) => Promise<DictionaryHandle>;
1503
+ presentForJoin?: (record: unknown, locale: string) => unknown;
1504
+ }): void;
1505
+ /**
1506
+ * Bind the {@link TiersContext} the tier ops need. The `cekCache` is passed
1507
+ * by reference (the SAME `Lru` the kernel's read/write path owns) so an
1508
+ * elevate/demote CEK re-wrap stays synchronous with cache eviction.
1509
+ */
1510
+ private tiersContext;
1511
+ /**
1512
+ * Bind the {@link IndexingContext} the index-maintenance surface needs. The
1513
+ * eager `cache` Map and the index / unique-constraint / persisted mirrors are
1514
+ * passed by reference (the SAME instances the query path reads, never
1515
+ * copied); the `persistedIndexesLoaded` flag and `ensure*` hydration stay
1516
+ * collection-resident, reached via callbacks.
1517
+ */
1518
+ private indexingContext;
1519
+ }