@noy-db/hub 0.3.0-pre.11 → 0.3.0-pre.13

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 (395) hide show
  1. package/dist/aggregate/index.js +4 -4
  2. package/dist/api-ZGS6LCOF.js +20 -0
  3. package/dist/as/index.js +11 -11
  4. package/dist/attestation/index.js +18 -18
  5. package/dist/{backup-XA5STIYQ.js → backup-BJ57IKAO.js} +28 -11
  6. package/dist/backup-BJ57IKAO.js.map +1 -0
  7. package/dist/blobs/index.js +12 -10
  8. package/dist/blobs/index.js.map +1 -1
  9. package/dist/broker/index.js +12 -12
  10. package/dist/bundle/index.js +25 -22
  11. package/dist/bundle/index.js.map +1 -1
  12. package/dist/by/index.js +2 -2
  13. package/dist/cargo/index.js +22 -22
  14. package/dist/{chunk-WGV4CUZT.js → chunk-2NVOWNI3.js} +4 -4
  15. package/dist/{chunk-WGV4CUZT.js.map → chunk-2NVOWNI3.js.map} +1 -1
  16. package/dist/{chunk-OFJ5GPNA.js → chunk-3B5VVCNY.js} +2 -2
  17. package/dist/{chunk-KPGX66PM.js → chunk-3LQ2YKO4.js} +2 -2
  18. package/dist/{chunk-D26JB3LZ.js → chunk-3QCRBHCY.js} +2 -2
  19. package/dist/{chunk-H6CZSDWK.js → chunk-454JXE57.js} +3 -3
  20. package/dist/{chunk-H6CZSDWK.js.map → chunk-454JXE57.js.map} +1 -1
  21. package/dist/{chunk-DGH65E7Q.js → chunk-4CTHCN4J.js} +24 -10
  22. package/dist/chunk-4CTHCN4J.js.map +1 -0
  23. package/dist/{chunk-4N5QFSNQ.js → chunk-4JBYV75E.js} +5 -5
  24. package/dist/{chunk-UTLEAJXC.js → chunk-4NXKCLLQ.js} +2 -2
  25. package/dist/{chunk-ARSAMO24.js → chunk-4VNQOLML.js} +2 -2
  26. package/dist/{chunk-X6CMGUAG.js → chunk-5M5DVGV7.js} +2 -2
  27. package/dist/{chunk-DJ3VKYFA.js → chunk-5O3XF4DV.js} +4 -4
  28. package/dist/chunk-5O3XF4DV.js.map +1 -0
  29. package/dist/{chunk-XHV25KBM.js → chunk-5YOLBEQ6.js} +2 -2
  30. package/dist/{chunk-CB25ONKC.js → chunk-6CRIV7DE.js} +2 -2
  31. package/dist/{chunk-BE7N3AXA.js → chunk-6JTIAGHD.js} +3 -3
  32. package/dist/{chunk-JOQ53DMI.js → chunk-6QTNZJBS.js} +3 -3
  33. package/dist/{chunk-BZO4WCJI.js → chunk-6T2SCQRU.js} +4 -4
  34. package/dist/{chunk-FQQF23MC.js → chunk-7DSTRQIJ.js} +2 -2
  35. package/dist/{chunk-IP2QBAGS.js → chunk-AUSTCW2X.js} +10 -10
  36. package/dist/{chunk-A2Y6YFVN.js → chunk-B3HJYUOF.js} +2 -2
  37. package/dist/{chunk-SRVQHVNX.js → chunk-BDVFPG6Y.js} +5 -5
  38. package/dist/{chunk-FH542DDY.js → chunk-BIOUI4HL.js} +50 -1
  39. package/dist/chunk-BIOUI4HL.js.map +1 -0
  40. package/dist/{chunk-YXOUQ2H7.js → chunk-CAF6WOK7.js} +2 -2
  41. package/dist/{chunk-H6HM6CVR.js → chunk-CDUQTA3Z.js} +114 -12
  42. package/dist/chunk-CDUQTA3Z.js.map +1 -0
  43. package/dist/{chunk-HUS3J5WM.js → chunk-CIE2BASH.js} +2 -2
  44. package/dist/{chunk-DIRRS7WP.js → chunk-CRI4OUV4.js} +2 -2
  45. package/dist/{chunk-FXK4X4BL.js → chunk-DLG74CNB.js} +4 -4
  46. package/dist/{chunk-WTUNZACT.js → chunk-E5ZQT5KX.js} +2 -2
  47. package/dist/{chunk-DMFNPHCX.js → chunk-EQO2UVP4.js} +6 -6
  48. package/dist/{chunk-MCEKIAO4.js → chunk-ERJ7FU55.js} +3 -3
  49. package/dist/{chunk-6QILBDZU.js → chunk-EVVGJDRQ.js} +3 -3
  50. package/dist/{chunk-7VSGW5KJ.js → chunk-EVX47VBM.js} +2 -2
  51. package/dist/{chunk-D3EFFFOL.js → chunk-EXK7QRWF.js} +5 -5
  52. package/dist/{chunk-5JB73NMC.js → chunk-EYZ6IQ6X.js} +5 -5
  53. package/dist/{chunk-BCYQA5BK.js → chunk-F64IRYG3.js} +2 -2
  54. package/dist/{chunk-K62IUKOD.js → chunk-FHS2HQSH.js} +5 -5
  55. package/dist/{chunk-2JMMY7HZ.js → chunk-FM3G3NOY.js} +27 -9
  56. package/dist/chunk-FM3G3NOY.js.map +1 -0
  57. package/dist/{chunk-67TNU77I.js → chunk-FUG4SFN3.js} +2 -2
  58. package/dist/{chunk-ZP5PL65C.js → chunk-GKEWXIV5.js} +2 -2
  59. package/dist/{chunk-RKRGDAS7.js → chunk-GTGPO5KW.js} +5 -5
  60. package/dist/{chunk-MSPNM2OM.js → chunk-HB3RFQSC.js} +3 -3
  61. package/dist/{chunk-W5D62AQD.js → chunk-HDMEGAQE.js} +20 -7
  62. package/dist/chunk-HDMEGAQE.js.map +1 -0
  63. package/dist/chunk-HDQIIUPH.js +135 -0
  64. package/dist/chunk-HDQIIUPH.js.map +1 -0
  65. package/dist/{chunk-7QIXUSDQ.js → chunk-HTJQYHZP.js} +15 -12
  66. package/dist/chunk-HTJQYHZP.js.map +1 -0
  67. package/dist/{chunk-OOLO4LQG.js → chunk-I6GALP6E.js} +6 -6
  68. package/dist/{chunk-57V5S7PW.js → chunk-IL6POWCW.js} +6 -6
  69. package/dist/{chunk-7NS43EXZ.js → chunk-IU6SNYX6.js} +5 -5
  70. package/dist/{chunk-5ZOSG3RJ.js → chunk-J2ZX2XUV.js} +5 -5
  71. package/dist/{chunk-L2SNBIV7.js → chunk-JIF24JPM.js} +57 -15
  72. package/dist/chunk-JIF24JPM.js.map +1 -0
  73. package/dist/{chunk-SYMS4546.js → chunk-JKJOGPZN.js} +2 -2
  74. package/dist/{chunk-CKZW6P5V.js → chunk-JNAI2HN2.js} +1 -1
  75. package/dist/chunk-JNAI2HN2.js.map +1 -0
  76. package/dist/{chunk-AWB5JZW6.js → chunk-JZUV47FZ.js} +2 -2
  77. package/dist/{chunk-ODJWBC5I.js → chunk-K5IMOGHB.js} +2 -2
  78. package/dist/{chunk-3G4KMVUN.js → chunk-KSKBRKGJ.js} +3 -3
  79. package/dist/{chunk-HFJIGWJC.js → chunk-LASZKVMO.js} +3 -3
  80. package/dist/{chunk-IGJHJYM6.js → chunk-LXEXBTKL.js} +4 -4
  81. package/dist/{chunk-3CNQ7FQ3.js → chunk-M4CV6BRT.js} +119 -25
  82. package/dist/chunk-M4CV6BRT.js.map +1 -0
  83. package/dist/{chunk-H44ZE4IE.js → chunk-MEFJPTZ4.js} +33 -17
  84. package/dist/chunk-MEFJPTZ4.js.map +1 -0
  85. package/dist/{chunk-PR5LC5YX.js → chunk-MV43JSJF.js} +4 -4
  86. package/dist/{chunk-ELNBMFOS.js → chunk-NJ4EOKMB.js} +4 -4
  87. package/dist/{chunk-PXWVF7MC.js → chunk-NR5LT5RY.js} +7 -7
  88. package/dist/{chunk-QYPKGVT4.js → chunk-NWSGI5C7.js} +3 -3
  89. package/dist/{chunk-P5RY4ZWD.js → chunk-OSDB5WW3.js} +92 -15
  90. package/dist/chunk-OSDB5WW3.js.map +1 -0
  91. package/dist/chunk-PN2XMATY.js +37 -0
  92. package/dist/chunk-PN2XMATY.js.map +1 -0
  93. package/dist/{chunk-25NDNMQ7.js → chunk-Q5VNKNE5.js} +3 -3
  94. package/dist/{chunk-CIKY6I4W.js → chunk-QLWMEXCT.js} +2 -2
  95. package/dist/{chunk-VA4ZWLFY.js → chunk-QRB7NAOJ.js} +2 -2
  96. package/dist/{chunk-3MSQLQNZ.js → chunk-R4ROFEYC.js} +2 -2
  97. package/dist/{chunk-BEIRE5K4.js → chunk-RCVJZMFE.js} +4 -4
  98. package/dist/{chunk-VR24ILCR.js → chunk-RIX4V2TB.js} +3 -3
  99. package/dist/{chunk-Q3XSMOZM.js → chunk-RYCTDFUX.js} +2 -2
  100. package/dist/{chunk-7E67FJ33.js → chunk-RZ5SVOYR.js} +2 -2
  101. package/dist/{chunk-IDIV5NVH.js → chunk-SLFHQTTW.js} +5 -5
  102. package/dist/chunk-SNZ6URZZ.js +2782 -0
  103. package/dist/chunk-SNZ6URZZ.js.map +1 -0
  104. package/dist/{chunk-C3YH34IL.js → chunk-T2FFWNPK.js} +3 -3
  105. package/dist/{chunk-O2DYPAZY.js → chunk-UNFPPVNI.js} +2 -2
  106. package/dist/{chunk-MELR46EF.js → chunk-VFUPHI2Z.js} +63 -10
  107. package/dist/chunk-VFUPHI2Z.js.map +1 -0
  108. package/dist/{chunk-GA2QHD6P.js → chunk-VLFCJYTL.js} +9 -9
  109. package/dist/{chunk-YSXEFGND.js → chunk-VN3DBQAU.js} +2 -2
  110. package/dist/{chunk-C7NTK5I3.js → chunk-VZRODIM3.js} +4 -4
  111. package/dist/{chunk-QLLKLFE2.js → chunk-W22IKJE2.js} +2 -2
  112. package/dist/{chunk-5XIPOCQC.js → chunk-X3YYQWOQ.js} +3 -3
  113. package/dist/{chunk-A2QF4JUE.js → chunk-X7QBD67R.js} +625 -293
  114. package/dist/chunk-X7QBD67R.js.map +1 -0
  115. package/dist/{chunk-QQJXBZCO.js → chunk-XDYREZWE.js} +82 -10
  116. package/dist/chunk-XDYREZWE.js.map +1 -0
  117. package/dist/{chunk-OEAATWH5.js → chunk-XWZVFISC.js} +40 -6
  118. package/dist/{chunk-OEAATWH5.js.map → chunk-XWZVFISC.js.map} +1 -1
  119. package/dist/{chunk-XFXUTFWQ.js → chunk-YFXZEAYK.js} +6 -6
  120. package/dist/{chunk-7ITPJFGC.js → chunk-ZAJAVEXY.js} +2 -2
  121. package/dist/{chunk-4R4Q64W5.js → chunk-ZICD77GM.js} +2 -2
  122. package/dist/{chunk-45ZZLTFH.js → chunk-ZJ2AK4V7.js} +2 -2
  123. package/dist/{chunk-UFILRICG.js → chunk-ZUODRVHY.js} +2 -2
  124. package/dist/classified/index.js +5 -5
  125. package/dist/{classified-marker-LQWWQNIJ.js → classified-marker-CZKA6ITE.js} +8 -4
  126. package/dist/classified-marker-CZKA6ITE.js.map +1 -0
  127. package/dist/collection-facade-TLWIPI76.js +44 -0
  128. package/dist/{computed-W6MVAMWZ.js → computed-ZIQTYTDI.js} +3 -3
  129. package/dist/consent/index.js +9 -9
  130. package/dist/{dead-filter-4KXZEB3X.js → dead-filter-ESOBZZP5.js} +2 -2
  131. package/dist/delegation-W7ZV2322.js +25 -0
  132. package/dist/derivations/index.js +12 -12
  133. package/dist/derive-H2BJTLUI.js +21 -0
  134. package/dist/{enclave-VXAQD4XJ.js → enclave-AP3I5W7O.js} +15 -9
  135. package/dist/executor-KGWTNEQD.js +9 -0
  136. package/dist/executor-OVEXR6RT.js +9 -0
  137. package/dist/executor-UNEH5ZYH.js +25 -0
  138. package/dist/export-accessible-PCMXSUZS.js +23 -0
  139. package/dist/extract-partition-SWHFSYJO.js +38 -0
  140. package/dist/{fanout-sidecar-CKYFH33E.js → fanout-sidecar-A765THMX.js} +9 -9
  141. package/dist/find-N6345CNT.js +11 -0
  142. package/dist/forget/index.js +9 -9
  143. package/dist/guards/index.js +3 -3
  144. package/dist/history/index.js +14 -11
  145. package/dist/history/index.js.map +1 -1
  146. package/dist/i18n/index.js +14 -14
  147. package/dist/index.d.ts +5 -1
  148. package/dist/index.js +108 -89
  149. package/dist/index.js.map +1 -1
  150. package/dist/indexing/index.js +5 -5
  151. package/dist/indexing/index.js.map +1 -1
  152. package/dist/issue-5OKB6I2R.js +19 -0
  153. package/dist/kernel/best-effort-revert.d.ts +52 -0
  154. package/dist/kernel/collection-config.d.ts +28 -0
  155. package/dist/kernel/collection.d.ts +49 -32
  156. package/dist/kernel/enclave/classify/verify.d.ts +3 -0
  157. package/dist/kernel/enclave/index.d.ts +2 -1
  158. package/dist/kernel/enclave/record-keys/deterministic.d.ts +1 -0
  159. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +50 -0
  160. package/dist/kernel/enclave/record-keys/record-codec.d.ts +27 -0
  161. package/dist/kernel/errors.d.ts +75 -1
  162. package/dist/kernel/lazy-count.d.ts +13 -0
  163. package/dist/kernel/noydb.d.ts +8 -0
  164. package/dist/kernel/tier-visibility.d.ts +54 -0
  165. package/dist/kernel/types.d.ts +92 -0
  166. package/dist/kernel/vault.d.ts +23 -6
  167. package/dist/kernel/via/dispatch.d.ts +10 -0
  168. package/dist/kernel/via/graph.d.ts +2 -1
  169. package/dist/{ledger-FU6GH5EH.js → ledger-GFBKVPV4.js} +11 -11
  170. package/dist/legacy/bundle.d.ts +1 -1
  171. package/dist/liberate-3VDOT4KO.js +24 -0
  172. package/dist/{link-set-MNADSH5M.js → link-set-Z7Q2ASFX.js} +11 -11
  173. package/dist/materialized-views/index.js +18 -18
  174. package/dist/noydb-ZCJOYBDI.js +68 -0
  175. package/dist/on/index.js +9 -9
  176. package/dist/overlay-views/index.js +4 -4
  177. package/dist/periods/index.js +12 -12
  178. package/dist/pod/index.js +11 -11
  179. package/dist/{policy-JTFOPPUU.js → policy-Z3RUAIY2.js} +5 -5
  180. package/dist/port/with/blob-strategy.d.ts +17 -0
  181. package/dist/port/with/lookup-strategy.d.ts +2 -1
  182. package/dist/portability/index.js +8 -8
  183. package/dist/{post-register-HAWO3O7O.js → post-register-JTH76BLY.js} +12 -7
  184. package/dist/post-register-JTH76BLY.js.map +1 -0
  185. package/dist/{public-envelope-NJVB7LPA.js → public-envelope-B4KNWVUA.js} +4 -4
  186. package/dist/query/index.js +5 -5
  187. package/dist/register-VAHONCID.js +23 -0
  188. package/dist/registry-7MLVD3VO.js +19 -0
  189. package/dist/registry-EPKPD5SM.js +18 -0
  190. package/dist/registry-P5T7PS2U.js +9 -0
  191. package/dist/request-withdrawal-TI3A5WPS.js +31 -0
  192. package/dist/{reveal-BOY7XYFH.js → reveal-DIBHLUZX.js} +7 -7
  193. package/dist/reveal-DIBHLUZX.js.map +1 -0
  194. package/dist/revoke-FDRD6GRW.js +24 -0
  195. package/dist/satellites/index.js +1 -1
  196. package/dist/sealed-record/index.js +12 -12
  197. package/dist/{seed-4RRXT42N.js → seed-Q6M2IZFL.js} +11 -11
  198. package/dist/session/index.js +9 -9
  199. package/dist/shadow/index.js +2 -2
  200. package/dist/signer-MUWEIUI6.js +25 -0
  201. package/dist/snapshots/index.js +10 -10
  202. package/dist/stale-OSQ7J3AA.js +29 -0
  203. package/dist/storage-MVFCGEQE.js +23 -0
  204. package/dist/{store-coordination-provider-HPYVFJCV.js → store-coordination-provider-64OEZFGS.js} +3 -3
  205. package/dist/sync/index.js +9 -9
  206. package/dist/team/index.js +15 -15
  207. package/dist/tiers/index.js +14 -10
  208. package/dist/to/index.js +1 -1
  209. package/dist/tx/index.js +3 -3
  210. package/dist/util/index.js +1 -1
  211. package/dist/{verify-66RHOW7N.js → verify-ZASTRNPR.js} +9 -8
  212. package/dist/verify-ZASTRNPR.js.map +1 -0
  213. package/dist/via/lookup/registry.d.ts +9 -0
  214. package/dist/via/money/where.d.ts +27 -6
  215. package/dist/{walk-2RWEOCAS.js → walk-SVNDIZ62.js} +11 -11
  216. package/dist/with/index.js +11 -11
  217. package/dist/with-audit/forget/strategy.d.ts +22 -0
  218. package/dist/with-audit/tiers/index.d.ts +275 -3
  219. package/dist/with-audit/tiers/strategy.d.ts +5 -4
  220. package/dist/with-cargo/describe-extraction.d.ts +9 -1
  221. package/dist/with-cargo/extract-partition.d.ts +9 -1
  222. package/dist/with-cargo/walk-closure.d.ts +32 -3
  223. package/dist/with-commit/history/history.d.ts +46 -0
  224. package/dist/with-commit/history/ledger/store.d.ts +21 -0
  225. package/dist/with-commit/history/strategy.d.ts +10 -0
  226. package/dist/with-commit/history/time-machine.d.ts +23 -0
  227. package/dist/with-commit/tx/elevated-handle.d.ts +2 -1
  228. package/dist/with-commit/tx/transaction.d.ts +5 -0
  229. package/dist/with-formula/materialized-views/executor.d.ts +9 -0
  230. package/dist/with-formula/materialized-views/stale.d.ts +52 -1
  231. package/dist/with-lookup/embeddings/index.d.ts +1 -0
  232. package/dist/with-lookup/embeddings/vec-id.d.ts +47 -0
  233. package/dist/with-lookup/indexing/collection-facade.d.ts +38 -1
  234. package/dist/with-lookup/indexing/lazy-builder.d.ts +35 -2
  235. package/dist/with-lookup/indexing/persisted-indexes.d.ts +44 -1
  236. package/dist/with-lookup/search/collection-facade.d.ts +40 -0
  237. package/dist/with-lookup/search/persisted-index-store.d.ts +82 -2
  238. package/dist/with-lookup/search/strategy.d.ts +4 -0
  239. package/dist/with-party/team/sync.d.ts +9 -0
  240. package/dist/with-shape/blobs/blob-intent.d.ts +153 -0
  241. package/dist/with-shape/blobs/blob-set.d.ts +949 -5
  242. package/dist/with-shape/satellites/fanout.d.ts +5 -4
  243. package/dist/with-shape/satellites/migrate-cek.d.ts +26 -0
  244. package/dist/with-shape/satellites/types.d.ts +11 -0
  245. package/dist/withdraw-accessible-WZIEVWSR.js +28 -0
  246. package/package.json +3 -3
  247. package/dist/api-YGMINAET.js +0 -20
  248. package/dist/backup-XA5STIYQ.js.map +0 -1
  249. package/dist/chunk-2JMMY7HZ.js.map +0 -1
  250. package/dist/chunk-3CNQ7FQ3.js.map +0 -1
  251. package/dist/chunk-7QIXUSDQ.js.map +0 -1
  252. package/dist/chunk-A2QF4JUE.js.map +0 -1
  253. package/dist/chunk-AOVDSIL3.js +0 -1221
  254. package/dist/chunk-AOVDSIL3.js.map +0 -1
  255. package/dist/chunk-CKZW6P5V.js.map +0 -1
  256. package/dist/chunk-DGH65E7Q.js.map +0 -1
  257. package/dist/chunk-DJ3VKYFA.js.map +0 -1
  258. package/dist/chunk-FH542DDY.js.map +0 -1
  259. package/dist/chunk-H44ZE4IE.js.map +0 -1
  260. package/dist/chunk-H6HM6CVR.js.map +0 -1
  261. package/dist/chunk-L2SNBIV7.js.map +0 -1
  262. package/dist/chunk-MELR46EF.js.map +0 -1
  263. package/dist/chunk-P5RY4ZWD.js.map +0 -1
  264. package/dist/chunk-QQJXBZCO.js.map +0 -1
  265. package/dist/chunk-TPH5EO6L.js +0 -54
  266. package/dist/chunk-TPH5EO6L.js.map +0 -1
  267. package/dist/chunk-W5D62AQD.js.map +0 -1
  268. package/dist/classified-marker-LQWWQNIJ.js.map +0 -1
  269. package/dist/collection-facade-YE2O4J4O.js +0 -39
  270. package/dist/delegation-OPUU3R2E.js +0 -25
  271. package/dist/derive-BGUHU663.js +0 -21
  272. package/dist/executor-GTVSUUBX.js +0 -25
  273. package/dist/executor-GZWMTOXB.js +0 -9
  274. package/dist/executor-XXGS4S3K.js +0 -9
  275. package/dist/export-accessible-BMULIOYB.js +0 -23
  276. package/dist/extract-partition-JUQTWDXR.js +0 -36
  277. package/dist/find-XRGCNGNN.js +0 -11
  278. package/dist/issue-UB6AA5M6.js +0 -19
  279. package/dist/liberate-YUN7W5QG.js +0 -24
  280. package/dist/noydb-6JLBZU4U.js +0 -67
  281. package/dist/post-register-HAWO3O7O.js.map +0 -1
  282. package/dist/register-VCKOBWKT.js +0 -23
  283. package/dist/registry-72UKJ2L4.js +0 -9
  284. package/dist/registry-BZFLJNEH.js +0 -18
  285. package/dist/registry-YJEYSYI5.js +0 -19
  286. package/dist/request-withdrawal-6MJRMFHF.js +0 -31
  287. package/dist/reveal-BOY7XYFH.js.map +0 -1
  288. package/dist/revoke-4KUNSVJC.js +0 -24
  289. package/dist/signer-DDDXP5JD.js +0 -25
  290. package/dist/stale-NXPT56JA.js +0 -14
  291. package/dist/storage-IR6EEAV2.js +0 -23
  292. package/dist/verify-66RHOW7N.js.map +0 -1
  293. package/dist/withdraw-accessible-CLMZEHQT.js +0 -28
  294. /package/dist/{api-YGMINAET.js.map → api-ZGS6LCOF.js.map} +0 -0
  295. /package/dist/{chunk-OFJ5GPNA.js.map → chunk-3B5VVCNY.js.map} +0 -0
  296. /package/dist/{chunk-KPGX66PM.js.map → chunk-3LQ2YKO4.js.map} +0 -0
  297. /package/dist/{chunk-D26JB3LZ.js.map → chunk-3QCRBHCY.js.map} +0 -0
  298. /package/dist/{chunk-4N5QFSNQ.js.map → chunk-4JBYV75E.js.map} +0 -0
  299. /package/dist/{chunk-UTLEAJXC.js.map → chunk-4NXKCLLQ.js.map} +0 -0
  300. /package/dist/{chunk-ARSAMO24.js.map → chunk-4VNQOLML.js.map} +0 -0
  301. /package/dist/{chunk-X6CMGUAG.js.map → chunk-5M5DVGV7.js.map} +0 -0
  302. /package/dist/{chunk-XHV25KBM.js.map → chunk-5YOLBEQ6.js.map} +0 -0
  303. /package/dist/{chunk-CB25ONKC.js.map → chunk-6CRIV7DE.js.map} +0 -0
  304. /package/dist/{chunk-BE7N3AXA.js.map → chunk-6JTIAGHD.js.map} +0 -0
  305. /package/dist/{chunk-JOQ53DMI.js.map → chunk-6QTNZJBS.js.map} +0 -0
  306. /package/dist/{chunk-BZO4WCJI.js.map → chunk-6T2SCQRU.js.map} +0 -0
  307. /package/dist/{chunk-FQQF23MC.js.map → chunk-7DSTRQIJ.js.map} +0 -0
  308. /package/dist/{chunk-IP2QBAGS.js.map → chunk-AUSTCW2X.js.map} +0 -0
  309. /package/dist/{chunk-A2Y6YFVN.js.map → chunk-B3HJYUOF.js.map} +0 -0
  310. /package/dist/{chunk-SRVQHVNX.js.map → chunk-BDVFPG6Y.js.map} +0 -0
  311. /package/dist/{chunk-YXOUQ2H7.js.map → chunk-CAF6WOK7.js.map} +0 -0
  312. /package/dist/{chunk-HUS3J5WM.js.map → chunk-CIE2BASH.js.map} +0 -0
  313. /package/dist/{chunk-DIRRS7WP.js.map → chunk-CRI4OUV4.js.map} +0 -0
  314. /package/dist/{chunk-FXK4X4BL.js.map → chunk-DLG74CNB.js.map} +0 -0
  315. /package/dist/{chunk-WTUNZACT.js.map → chunk-E5ZQT5KX.js.map} +0 -0
  316. /package/dist/{chunk-DMFNPHCX.js.map → chunk-EQO2UVP4.js.map} +0 -0
  317. /package/dist/{chunk-MCEKIAO4.js.map → chunk-ERJ7FU55.js.map} +0 -0
  318. /package/dist/{chunk-6QILBDZU.js.map → chunk-EVVGJDRQ.js.map} +0 -0
  319. /package/dist/{chunk-7VSGW5KJ.js.map → chunk-EVX47VBM.js.map} +0 -0
  320. /package/dist/{chunk-D3EFFFOL.js.map → chunk-EXK7QRWF.js.map} +0 -0
  321. /package/dist/{chunk-5JB73NMC.js.map → chunk-EYZ6IQ6X.js.map} +0 -0
  322. /package/dist/{chunk-BCYQA5BK.js.map → chunk-F64IRYG3.js.map} +0 -0
  323. /package/dist/{chunk-K62IUKOD.js.map → chunk-FHS2HQSH.js.map} +0 -0
  324. /package/dist/{chunk-67TNU77I.js.map → chunk-FUG4SFN3.js.map} +0 -0
  325. /package/dist/{chunk-ZP5PL65C.js.map → chunk-GKEWXIV5.js.map} +0 -0
  326. /package/dist/{chunk-RKRGDAS7.js.map → chunk-GTGPO5KW.js.map} +0 -0
  327. /package/dist/{chunk-MSPNM2OM.js.map → chunk-HB3RFQSC.js.map} +0 -0
  328. /package/dist/{chunk-OOLO4LQG.js.map → chunk-I6GALP6E.js.map} +0 -0
  329. /package/dist/{chunk-57V5S7PW.js.map → chunk-IL6POWCW.js.map} +0 -0
  330. /package/dist/{chunk-7NS43EXZ.js.map → chunk-IU6SNYX6.js.map} +0 -0
  331. /package/dist/{chunk-5ZOSG3RJ.js.map → chunk-J2ZX2XUV.js.map} +0 -0
  332. /package/dist/{chunk-SYMS4546.js.map → chunk-JKJOGPZN.js.map} +0 -0
  333. /package/dist/{chunk-AWB5JZW6.js.map → chunk-JZUV47FZ.js.map} +0 -0
  334. /package/dist/{chunk-ODJWBC5I.js.map → chunk-K5IMOGHB.js.map} +0 -0
  335. /package/dist/{chunk-3G4KMVUN.js.map → chunk-KSKBRKGJ.js.map} +0 -0
  336. /package/dist/{chunk-HFJIGWJC.js.map → chunk-LASZKVMO.js.map} +0 -0
  337. /package/dist/{chunk-IGJHJYM6.js.map → chunk-LXEXBTKL.js.map} +0 -0
  338. /package/dist/{chunk-PR5LC5YX.js.map → chunk-MV43JSJF.js.map} +0 -0
  339. /package/dist/{chunk-ELNBMFOS.js.map → chunk-NJ4EOKMB.js.map} +0 -0
  340. /package/dist/{chunk-PXWVF7MC.js.map → chunk-NR5LT5RY.js.map} +0 -0
  341. /package/dist/{chunk-QYPKGVT4.js.map → chunk-NWSGI5C7.js.map} +0 -0
  342. /package/dist/{chunk-25NDNMQ7.js.map → chunk-Q5VNKNE5.js.map} +0 -0
  343. /package/dist/{chunk-CIKY6I4W.js.map → chunk-QLWMEXCT.js.map} +0 -0
  344. /package/dist/{chunk-VA4ZWLFY.js.map → chunk-QRB7NAOJ.js.map} +0 -0
  345. /package/dist/{chunk-3MSQLQNZ.js.map → chunk-R4ROFEYC.js.map} +0 -0
  346. /package/dist/{chunk-BEIRE5K4.js.map → chunk-RCVJZMFE.js.map} +0 -0
  347. /package/dist/{chunk-VR24ILCR.js.map → chunk-RIX4V2TB.js.map} +0 -0
  348. /package/dist/{chunk-Q3XSMOZM.js.map → chunk-RYCTDFUX.js.map} +0 -0
  349. /package/dist/{chunk-7E67FJ33.js.map → chunk-RZ5SVOYR.js.map} +0 -0
  350. /package/dist/{chunk-IDIV5NVH.js.map → chunk-SLFHQTTW.js.map} +0 -0
  351. /package/dist/{chunk-C3YH34IL.js.map → chunk-T2FFWNPK.js.map} +0 -0
  352. /package/dist/{chunk-O2DYPAZY.js.map → chunk-UNFPPVNI.js.map} +0 -0
  353. /package/dist/{chunk-GA2QHD6P.js.map → chunk-VLFCJYTL.js.map} +0 -0
  354. /package/dist/{chunk-YSXEFGND.js.map → chunk-VN3DBQAU.js.map} +0 -0
  355. /package/dist/{chunk-C7NTK5I3.js.map → chunk-VZRODIM3.js.map} +0 -0
  356. /package/dist/{chunk-QLLKLFE2.js.map → chunk-W22IKJE2.js.map} +0 -0
  357. /package/dist/{chunk-5XIPOCQC.js.map → chunk-X3YYQWOQ.js.map} +0 -0
  358. /package/dist/{chunk-XFXUTFWQ.js.map → chunk-YFXZEAYK.js.map} +0 -0
  359. /package/dist/{chunk-7ITPJFGC.js.map → chunk-ZAJAVEXY.js.map} +0 -0
  360. /package/dist/{chunk-4R4Q64W5.js.map → chunk-ZICD77GM.js.map} +0 -0
  361. /package/dist/{chunk-45ZZLTFH.js.map → chunk-ZJ2AK4V7.js.map} +0 -0
  362. /package/dist/{chunk-UFILRICG.js.map → chunk-ZUODRVHY.js.map} +0 -0
  363. /package/dist/{collection-facade-YE2O4J4O.js.map → collection-facade-TLWIPI76.js.map} +0 -0
  364. /package/dist/{computed-W6MVAMWZ.js.map → computed-ZIQTYTDI.js.map} +0 -0
  365. /package/dist/{dead-filter-4KXZEB3X.js.map → dead-filter-ESOBZZP5.js.map} +0 -0
  366. /package/dist/{delegation-OPUU3R2E.js.map → delegation-W7ZV2322.js.map} +0 -0
  367. /package/dist/{derive-BGUHU663.js.map → derive-H2BJTLUI.js.map} +0 -0
  368. /package/dist/{enclave-VXAQD4XJ.js.map → enclave-AP3I5W7O.js.map} +0 -0
  369. /package/dist/{executor-GTVSUUBX.js.map → executor-KGWTNEQD.js.map} +0 -0
  370. /package/dist/{executor-GZWMTOXB.js.map → executor-OVEXR6RT.js.map} +0 -0
  371. /package/dist/{executor-XXGS4S3K.js.map → executor-UNEH5ZYH.js.map} +0 -0
  372. /package/dist/{export-accessible-BMULIOYB.js.map → export-accessible-PCMXSUZS.js.map} +0 -0
  373. /package/dist/{extract-partition-JUQTWDXR.js.map → extract-partition-SWHFSYJO.js.map} +0 -0
  374. /package/dist/{fanout-sidecar-CKYFH33E.js.map → fanout-sidecar-A765THMX.js.map} +0 -0
  375. /package/dist/{find-XRGCNGNN.js.map → find-N6345CNT.js.map} +0 -0
  376. /package/dist/{issue-UB6AA5M6.js.map → issue-5OKB6I2R.js.map} +0 -0
  377. /package/dist/{ledger-FU6GH5EH.js.map → ledger-GFBKVPV4.js.map} +0 -0
  378. /package/dist/{liberate-YUN7W5QG.js.map → liberate-3VDOT4KO.js.map} +0 -0
  379. /package/dist/{link-set-MNADSH5M.js.map → link-set-Z7Q2ASFX.js.map} +0 -0
  380. /package/dist/{noydb-6JLBZU4U.js.map → noydb-ZCJOYBDI.js.map} +0 -0
  381. /package/dist/{policy-JTFOPPUU.js.map → policy-Z3RUAIY2.js.map} +0 -0
  382. /package/dist/{public-envelope-NJVB7LPA.js.map → public-envelope-B4KNWVUA.js.map} +0 -0
  383. /package/dist/{register-VCKOBWKT.js.map → register-VAHONCID.js.map} +0 -0
  384. /package/dist/{registry-72UKJ2L4.js.map → registry-7MLVD3VO.js.map} +0 -0
  385. /package/dist/{registry-BZFLJNEH.js.map → registry-EPKPD5SM.js.map} +0 -0
  386. /package/dist/{registry-YJEYSYI5.js.map → registry-P5T7PS2U.js.map} +0 -0
  387. /package/dist/{request-withdrawal-6MJRMFHF.js.map → request-withdrawal-TI3A5WPS.js.map} +0 -0
  388. /package/dist/{revoke-4KUNSVJC.js.map → revoke-FDRD6GRW.js.map} +0 -0
  389. /package/dist/{seed-4RRXT42N.js.map → seed-Q6M2IZFL.js.map} +0 -0
  390. /package/dist/{signer-DDDXP5JD.js.map → signer-MUWEIUI6.js.map} +0 -0
  391. /package/dist/{stale-NXPT56JA.js.map → stale-OSQ7J3AA.js.map} +0 -0
  392. /package/dist/{storage-IR6EEAV2.js.map → storage-MVFCGEQE.js.map} +0 -0
  393. /package/dist/{store-coordination-provider-HPYVFJCV.js.map → store-coordination-provider-64OEZFGS.js.map} +0 -0
  394. /package/dist/{walk-2RWEOCAS.js.map → walk-SVNDIZ62.js.map} +0 -0
  395. /package/dist/{withdraw-accessible-CLMZEHQT.js.map → withdraw-accessible-WZIEVWSR.js.map} +0 -0
@@ -7,12 +7,12 @@ import {
7
7
  decodeIdxId,
8
8
  encodeIdxId,
9
9
  isIdxId
10
- } from "../chunk-3CNQ7FQ3.js";
10
+ } from "../chunk-M4CV6BRT.js";
11
11
  import {
12
12
  CollectionIndexes
13
13
  } from "../chunk-KPZS5QAQ.js";
14
14
  import "../chunk-IGJCYUT5.js";
15
- import "../chunk-FH542DDY.js";
15
+ import "../chunk-BIOUI4HL.js";
16
16
  import "../chunk-PZ5AY32C.js";
17
17
 
18
18
  // src/with-lookup/indexing/active.ts
@@ -42,10 +42,10 @@ function declareAll(persisted, defs) {
42
42
  for (const def of defs) {
43
43
  if (typeof def === "string") {
44
44
  persisted.declare(def);
45
- } else if (Array.isArray(def)) {
46
- persisted.declareComposite(def);
47
45
  } else {
48
- persisted.declareComposite(def.fields);
46
+ const fields = Array.isArray(def) ? def : def.fields;
47
+ for (const f of fields) persisted.declare(f);
48
+ persisted.declareComposite(fields);
49
49
  }
50
50
  }
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/with-lookup/indexing/active.ts"],"sourcesContent":["/**\n * Active indexing strategy factory. Calling `withIndexing()` returns\n * an `IndexStrategy` whose `createState` constructs a real\n * `CollectionIndexes` (eager) or `PersistedCollectionIndex` (lazy)\n * per Collection, depending on the collection's `prefetch` mode and\n * its declared `IndexDef[]`.\n *\n * This module is only reachable through the `@noy-db/hub/indexing`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { CollectionIndexes } from './eager-indexes.js'\nimport type { IndexDef } from './eager-indexes.js'\nimport { PersistedCollectionIndex } from './persisted-indexes.js'\nimport type { IndexStrategy, IndexState } from './strategy.js'\n\n/**\n * Build the default indexing strategy. Pass into\n * `createNoydb({ indexStrategy: withIndexing() })` to light up the\n * eager-mode `==/in` fast-path on `.query()` and the full lazy-mode\n * `.lazyQuery()` + rebuild / reconcile / auto-reconcile surface.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withIndexing } from '@noy-db/hub/indexing'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * indexStrategy: withIndexing(),\n * })\n * ```\n */\nexport function withIndexing(): IndexStrategy {\n return {\n createState({ defs, lazy }) {\n if (lazy) {\n const persisted = new PersistedCollectionIndex()\n declareAll(persisted, defs)\n return makeLazyState(persisted)\n }\n const eager = new CollectionIndexes()\n for (const def of defs) {\n if (typeof def === 'string') {\n eager.declare(def)\n } else if (Array.isArray(def)) {\n for (const f of def as readonly string[]) eager.declare(f)\n } else {\n for (const f of (def as { fields: readonly string[] }).fields) eager.declare(f)\n }\n }\n return makeEagerState(eager)\n },\n }\n}\n\nfunction declareAll(persisted: PersistedCollectionIndex, defs: readonly IndexDef[]): void {\n for (const def of defs) {\n if (typeof def === 'string') {\n persisted.declare(def)\n } else if (Array.isArray(def)) {\n persisted.declareComposite(def as readonly string[])\n } else {\n persisted.declareComposite((def as { fields: readonly string[] }).fields)\n }\n }\n}\n\nfunction makeEagerState(eager: CollectionIndexes): IndexState {\n return {\n isEnabled: true,\n getEagerIndexes: () => eager,\n getPersistedIndexes: () => null,\n }\n}\n\nfunction makeLazyState(persisted: PersistedCollectionIndex): IndexState {\n return {\n isEnabled: true,\n getEagerIndexes: () => null,\n getPersistedIndexes: () => persisted,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCO,SAAS,eAA8B;AAC5C,SAAO;AAAA,IACL,YAAY,EAAE,MAAM,KAAK,GAAG;AAC1B,UAAI,MAAM;AACR,cAAM,YAAY,IAAI,yBAAyB;AAC/C,mBAAW,WAAW,IAAI;AAC1B,eAAO,cAAc,SAAS;AAAA,MAChC;AACA,YAAM,QAAQ,IAAI,kBAAkB;AACpC,iBAAW,OAAO,MAAM;AACtB,YAAI,OAAO,QAAQ,UAAU;AAC3B,gBAAM,QAAQ,GAAG;AAAA,QACnB,WAAW,MAAM,QAAQ,GAAG,GAAG;AAC7B,qBAAW,KAAK,IAA0B,OAAM,QAAQ,CAAC;AAAA,QAC3D,OAAO;AACL,qBAAW,KAAM,IAAsC,OAAQ,OAAM,QAAQ,CAAC;AAAA,QAChF;AAAA,MACF;AACA,aAAO,eAAe,KAAK;AAAA,IAC7B;AAAA,EACF;AACF;AAEA,SAAS,WAAW,WAAqC,MAAiC;AACxF,aAAW,OAAO,MAAM;AACtB,QAAI,OAAO,QAAQ,UAAU;AAC3B,gBAAU,QAAQ,GAAG;AAAA,IACvB,WAAW,MAAM,QAAQ,GAAG,GAAG;AAC7B,gBAAU,iBAAiB,GAAwB;AAAA,IACrD,OAAO;AACL,gBAAU,iBAAkB,IAAsC,MAAM;AAAA,IAC1E;AAAA,EACF;AACF;AAEA,SAAS,eAAe,OAAsC;AAC5D,SAAO;AAAA,IACL,WAAW;AAAA,IACX,iBAAiB,MAAM;AAAA,IACvB,qBAAqB,MAAM;AAAA,EAC7B;AACF;AAEA,SAAS,cAAc,WAAiD;AACtE,SAAO;AAAA,IACL,WAAW;AAAA,IACX,iBAAiB,MAAM;AAAA,IACvB,qBAAqB,MAAM;AAAA,EAC7B;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/with-lookup/indexing/active.ts"],"sourcesContent":["/**\n * Active indexing strategy factory. Calling `withIndexing()` returns\n * an `IndexStrategy` whose `createState` constructs a real\n * `CollectionIndexes` (eager) or `PersistedCollectionIndex` (lazy)\n * per Collection, depending on the collection's `prefetch` mode and\n * its declared `IndexDef[]`.\n *\n * This module is only reachable through the `@noy-db/hub/indexing`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { CollectionIndexes } from './eager-indexes.js'\nimport type { IndexDef } from './eager-indexes.js'\nimport { PersistedCollectionIndex } from './persisted-indexes.js'\nimport type { IndexStrategy, IndexState } from './strategy.js'\n\n/**\n * Build the default indexing strategy. Pass into\n * `createNoydb({ indexStrategy: withIndexing() })` to light up the\n * eager-mode `==/in` fast-path on `.query()` and the full lazy-mode\n * `.lazyQuery()` + rebuild / reconcile / auto-reconcile surface.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withIndexing } from '@noy-db/hub/indexing'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * indexStrategy: withIndexing(),\n * })\n * ```\n */\nexport function withIndexing(): IndexStrategy {\n return {\n createState({ defs, lazy }) {\n if (lazy) {\n const persisted = new PersistedCollectionIndex()\n declareAll(persisted, defs)\n return makeLazyState(persisted)\n }\n const eager = new CollectionIndexes()\n for (const def of defs) {\n if (typeof def === 'string') {\n eager.declare(def)\n } else if (Array.isArray(def)) {\n for (const f of def as readonly string[]) eager.declare(f)\n } else {\n for (const f of (def as { fields: readonly string[] }).fields) eager.declare(f)\n }\n }\n return makeEagerState(eager)\n },\n }\n}\n\nfunction declareAll(persisted: PersistedCollectionIndex, defs: readonly IndexDef[]): void {\n for (const def of defs) {\n if (typeof def === 'string') {\n persisted.declare(def)\n } else {\n const fields = Array.isArray(def) ? (def as readonly string[]) : (def as { fields: readonly string[] }).fields\n // #698: decompose a composite into its component single-field indexes\n // (like the eager branch above), so a composite-only declaration still\n // provides the single-field driver the #696 Via-covered fall-through\n // and single-field queries need. The composite mirror is kept for the\n // multi-field fast path.\n for (const f of fields) persisted.declare(f)\n persisted.declareComposite(fields)\n }\n }\n}\n\nfunction makeEagerState(eager: CollectionIndexes): IndexState {\n return {\n isEnabled: true,\n getEagerIndexes: () => eager,\n getPersistedIndexes: () => null,\n }\n}\n\nfunction makeLazyState(persisted: PersistedCollectionIndex): IndexState {\n return {\n isEnabled: true,\n getEagerIndexes: () => null,\n getPersistedIndexes: () => persisted,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCO,SAAS,eAA8B;AAC5C,SAAO;AAAA,IACL,YAAY,EAAE,MAAM,KAAK,GAAG;AAC1B,UAAI,MAAM;AACR,cAAM,YAAY,IAAI,yBAAyB;AAC/C,mBAAW,WAAW,IAAI;AAC1B,eAAO,cAAc,SAAS;AAAA,MAChC;AACA,YAAM,QAAQ,IAAI,kBAAkB;AACpC,iBAAW,OAAO,MAAM;AACtB,YAAI,OAAO,QAAQ,UAAU;AAC3B,gBAAM,QAAQ,GAAG;AAAA,QACnB,WAAW,MAAM,QAAQ,GAAG,GAAG;AAC7B,qBAAW,KAAK,IAA0B,OAAM,QAAQ,CAAC;AAAA,QAC3D,OAAO;AACL,qBAAW,KAAM,IAAsC,OAAQ,OAAM,QAAQ,CAAC;AAAA,QAChF;AAAA,MACF;AACA,aAAO,eAAe,KAAK;AAAA,IAC7B;AAAA,EACF;AACF;AAEA,SAAS,WAAW,WAAqC,MAAiC;AACxF,aAAW,OAAO,MAAM;AACtB,QAAI,OAAO,QAAQ,UAAU;AAC3B,gBAAU,QAAQ,GAAG;AAAA,IACvB,OAAO;AACL,YAAM,SAAS,MAAM,QAAQ,GAAG,IAAK,MAA6B,IAAsC;AAMxG,iBAAW,KAAK,OAAQ,WAAU,QAAQ,CAAC;AAC3C,gBAAU,iBAAiB,MAAM;AAAA,IACnC;AAAA,EACF;AACF;AAEA,SAAS,eAAe,OAAsC;AAC5D,SAAO;AAAA,IACL,WAAW;AAAA,IACX,iBAAiB,MAAM;AAAA,IACvB,qBAAqB,MAAM;AAAA,EAC7B;AACF;AAEA,SAAS,cAAc,WAAiD;AACtE,SAAO;AAAA,IACL,WAAW;AAAA,IACX,iBAAiB,MAAM;AAAA,IACvB,qBAAqB,MAAM;AAAA,EAC7B;AACF;","names":[]}
@@ -0,0 +1,19 @@
1
+ import {
2
+ issueAttestationCore
3
+ } from "./chunk-GTGPO5KW.js";
4
+ import "./chunk-EXK7QRWF.js";
5
+ import "./chunk-ZJADGNYF.js";
6
+ import "./chunk-XDYREZWE.js";
7
+ import "./chunk-7DSTRQIJ.js";
8
+ import "./chunk-HB3RFQSC.js";
9
+ import "./chunk-JKJOGPZN.js";
10
+ import "./chunk-5M5DVGV7.js";
11
+ import "./chunk-LP7BEXCT.js";
12
+ import "./chunk-CIE2BASH.js";
13
+ import "./chunk-JNAI2HN2.js";
14
+ import "./chunk-BIOUI4HL.js";
15
+ import "./chunk-PZ5AY32C.js";
16
+ export {
17
+ issueAttestationCore
18
+ };
19
+ //# sourceMappingURL=issue-5OKB6I2R.js.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Best-effort reverse-revert — the shape shared by two independent rollback
3
+ * paths that used to duplicate it: satellite fan-out
4
+ * (`with-shape/satellites/fanout.ts`'s `revertAndCompensate`) and
5
+ * multi-record transactions (`with-commit/tx/transaction.ts`'s
6
+ * `revertExecuted`). Both revert a list of already-executed writes on
7
+ * failure by walking them in REVERSE order and, per leg, restoring the
8
+ * captured prior envelope straight through the raw adapter — `put(prior)`
9
+ * when one existed, `delete` when the leg was a fresh insert — bypassing
10
+ * the Collection layer so the revert itself doesn't re-fire
11
+ * encryption/ledger/change-event machinery. Each leg's raw-adapter revert
12
+ * is best-effort: a throw is swallowed so a revert-path failure never masks
13
+ * the original error that triggered the rollback, and the loop moves on to
14
+ * the next leg.
15
+ *
16
+ * An optional per-leg `compensate` callback runs immediately after a
17
+ * successful raw-adapter revert (still inside the same try, so a throwing
18
+ * callback is swallowed the same way as a throwing raw revert). What the
19
+ * callback does is entirely caller-defined — satellites' fan-out fires
20
+ * `_compensateRevertedWrite` only for legs whose write actually landed
21
+ * (#596); with-commit's transaction executor invalidates the Collection
22
+ * cache. Neither concern belongs here: this helper only knows the generic
23
+ * reverse/best-effort/raw-revert shape.
24
+ *
25
+ * Lives in `kernel/` — not a `with-*` service — so both consumers (one a
26
+ * gated service, `with-commit`; one an always-on schema feature,
27
+ * `with-shape/satellites`) can import it without creating a
28
+ * `with-* → with-*` edge, which would force either family to always bundle
29
+ * the other and defeat the opt-in tree-shaking both are built around.
30
+ *
31
+ * @internal — implementation-sharing only, not part of the public surface.
32
+ */
33
+ import type { EncryptedEnvelope } from './types.js';
34
+ /** One already-executed write a revert pass needs to unwind. */
35
+ export interface BestEffortRevertLeg {
36
+ readonly vaultName: string;
37
+ readonly collectionName: string;
38
+ readonly id: string;
39
+ /** Envelope captured before the write, or `null` if the id didn't exist yet. */
40
+ readonly prior: EncryptedEnvelope | null;
41
+ }
42
+ /** The subset of `NoydbStore` a raw-adapter revert needs. */
43
+ export interface BestEffortRevertAdapter {
44
+ put(vaultName: string, collectionName: string, id: string, envelope: EncryptedEnvelope): Promise<void>;
45
+ delete(vaultName: string, collectionName: string, id: string): Promise<void>;
46
+ }
47
+ /**
48
+ * Revert `executed` in reverse order via the raw adapter, best-effort.
49
+ * `compensate`, when supplied, runs once per leg immediately after that
50
+ * leg's own raw revert succeeds.
51
+ */
52
+ export declare function bestEffortRevert<T extends BestEffortRevertLeg>(executed: readonly T[], adapter: BestEffortRevertAdapter, compensate?: (leg: T) => Promise<void> | void): Promise<void>;
@@ -106,6 +106,13 @@ export interface CollectionOpts<T> {
106
106
  */
107
107
  historyConfigExplicit?: boolean | undefined;
108
108
  onDirty?: OnDirtyCallback | undefined;
109
+ /**
110
+ * #693: live check for whether multi-tab coordination is active at all
111
+ * (`Noydb._tabCoordinationActive`). When true, the shared local store may be
112
+ * written out-of-band by another tab, so the #606 marker-id-set gate falls
113
+ * back to an unconditional store read on re-create.
114
+ */
115
+ tabCoordinated?: (() => boolean) | undefined;
109
116
  /**
110
117
  * tree-shake seam. When omitted, `collection.blob(id)` throws
111
118
  * with a pointer at the `@noy-db/hub/blobs` subpath. When set (via
@@ -115,6 +122,16 @@ export interface CollectionOpts<T> {
115
122
  blobStrategy?: BlobStrategy | undefined;
116
123
  objectStore?: ObjectProjection | undefined;
117
124
  blobFields?: BlobFieldsConfig | undefined;
125
+ /**
126
+ * #724 Arc 10 Task 3: how `elevate()`/`demote()`/`putAtTier()` rehome a
127
+ * SHARED blob (`refCount > 1`) it can't rewrap in place. `'isolate'`
128
+ * (default) forks a private tier-scoped copy for the moving record and
129
+ * releases its hold on the shared object — co-owners stay byte-for-byte
130
+ * untouched. `'dedup'` (#741, opt-in) leaves the shared object in place;
131
+ * the Task-1 runtime read gate still hides it, but the chunks stay
132
+ * decryptable at rest under the flat `_blob` DEK (documented residue).
133
+ */
134
+ blobTierPolicy?: 'isolate' | 'dedup' | undefined;
118
135
  aggregateStrategy?: AggregateStrategy | undefined;
119
136
  crdtStrategy?: CrdtStrategy | undefined;
120
137
  /**
@@ -249,6 +266,14 @@ export interface CollectionOpts<T> {
249
266
  * classified refusal matrix (R4: a digest-only field cannot be the subject key).
250
267
  */
251
268
  subjectKeyField?: string | undefined;
269
+ /**
270
+ * Register a record's forget-subject ref directly (bypassing the write-hook
271
+ * pipeline), wired by the Vault when this collection declares a forget-
272
+ * subject field. Consumed by `putAtTier` (#766, via `TiersContext.addSubjectRef`)
273
+ * so a record whose first write is a tier write still enters `_subject_index`.
274
+ * `undefined` when no forget strategy declares this collection (no-op).
275
+ */
276
+ addSubjectRef?: ((id: string, record: unknown) => Promise<void>) | undefined;
252
277
  /** — tree-shake seam for `collection.reveal()`. Defaults to `NO_CLASSIFIED`. */
253
278
  classifiedStrategy?: ClassifiedStrategy | undefined;
254
279
  /**
@@ -688,6 +713,7 @@ export declare function resolveCollectionConfig<T>(opts: CollectionOpts<T>): {
688
713
  reconcileOnOpen: "auto" | "off" | "dry-run";
689
714
  getDEK: (collectionName: string) => Promise<EnclaveKey>;
690
715
  onDirty: OnDirtyCallback | undefined;
716
+ tabCoordinated: (() => boolean) | undefined;
691
717
  historyConfig: HistoryConfig;
692
718
  historyConfigExplicit: boolean;
693
719
  schema: StandardSchemaV1<unknown, T> | undefined;
@@ -771,7 +797,9 @@ export declare function resolveCollectionConfig<T>(opts: CollectionOpts<T>): {
771
797
  tiersStrategy: TiersStrategy;
772
798
  searchStrategy: SearchStrategy;
773
799
  tierMode: TierMode;
800
+ blobTierPolicy: "isolate" | "dedup";
774
801
  onCrossTierAccess: ((event: CrossTierAccessEvent) => void) | undefined;
802
+ addSubjectRef: ((id: string, record: unknown) => Promise<void>) | undefined;
775
803
  deterministicFields: ReadonlySet<string> | null;
776
804
  sensitiveFields: ReadonlySet<string>;
777
805
  vdigFields: ReadonlyMap<string, VdigFieldPolicy> | null;
@@ -11,6 +11,7 @@ import type { MutationOrigin } from './mutation.js';
11
11
  import { type WaveContext, type RollupOutcome, type RollupDeleteIntent } from './via/dispatch.js';
12
12
  import type { ComputedFields } from '../with-formula/computed/index.js';
13
13
  import { type SealedShredSlot } from './enclave/index.js';
14
+ import { type TierMoveResult } from '../with-audit/tiers/index.js';
14
15
  import type { GhostRecord } from './types.js';
15
16
  import type { StandardSchemaV1 } from './schema.js';
16
17
  import type { DiffEntry } from '../with-commit/history/diff.js';
@@ -89,6 +90,8 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
89
90
  private readonly activeTxId;
90
91
  private readonly getDEK;
91
92
  private readonly onDirty;
93
+ /** #693: live check — true when multi-tab write-propagation is active; gates the #606 marker-id-set fallback read. */
94
+ private readonly tabCoordinated;
92
95
  private readonly historyConfig;
93
96
  /** True when the caller explicitly provided a `historyConfig` option (vs. inheriting the vault default). */
94
97
  private readonly historyConfigExplicit;
@@ -104,6 +107,7 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
104
107
  private readonly blobStrategy;
105
108
  private readonly objectStore;
106
109
  private readonly blobFields;
110
+ private readonly blobTierPolicy;
107
111
  private readonly aggregateStrategy;
108
112
  private readonly crdtStrategy;
109
113
  private readonly tiersStrategy;
@@ -112,6 +116,20 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
112
116
  private readonly syncStrategy;
113
117
  private readonly cache;
114
118
  private hydrated;
119
+ /**
120
+ * #606: ids known to carry a delete marker in the store — lets the #589
121
+ * re-create version-continuity gate in `_putInternal` read the store ONLY
122
+ * for a known marker prior, instead of unconditionally on every insert.
123
+ * Populated on hydration (`ensureHydrated`/`hydrateFromSnapshot`), local
124
+ * delete (`_doDelete`), and the sync/tab/cutover choke point
125
+ * (`_invalidateCacheEntry`). Accepted drift: `vault._purgeDeleteMarkers`/
126
+ * `_purgeMarkersOn` remove markers directly on the raw store, bypassing
127
+ * Collection, so this set can hold stale ids after a purge on an
128
+ * already-loaded collection — perf-only and self-healing (a stale id just
129
+ * costs one `adapter.get` that returns non-marker/null, and version
130
+ * resolution falls back to 1 correctly). Do not try to wire purge into it.
131
+ */
132
+ private readonly markerIds;
115
133
  /**
116
134
  * Lazy mode flag. `true` when constructed with `prefetch: false`.
117
135
  * In lazy mode the cache is bounded by an LRU and `list()`/`query()`
@@ -140,8 +158,7 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
140
158
  private readonly indexState;
141
159
  /**
142
160
  * In-memory unique-constraint enforcement for eager mode.
143
- * `null` when no `unique:true` indexes are declared on this collection,
144
- * or when the collection is in lazy mode (which throws at registration).
161
+ * `null` when no `unique:true` indexes are declared on this collection, or when the collection is in lazy mode (which throws at registration).
145
162
  */
146
163
  private readonly uniqueConstraints;
147
164
  /**
@@ -160,8 +177,7 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
160
177
  */
161
178
  private get indexes();
162
179
  /**
163
- * Accessor for the persisted-mirror (lazy-mode) index. Returns `null`
164
- * when indexing is disabled or the collection is in eager mode.
180
+ * Accessor for the persisted-mirror (lazy-mode) index. Returns `null` when indexing is disabled or the collection is in eager mode.
165
181
  */
166
182
  private get persistedIndexes();
167
183
  /**
@@ -321,11 +337,9 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
321
337
  private readonly tiers;
322
338
  private readonly tierMode;
323
339
  private readonly onCrossTierAccess;
340
+ private readonly addSubjectRef;
324
341
  /**
325
- * Optional reference to the vault-level hash-chained audit
326
- * log. When present, every successful `put()` and `delete()` appends
327
- * an entry to the ledger AFTER the adapter write succeeds (so a
328
- * failed adapter write never produces an orphan ledger entry).
342
+ * Optional reference to the vault-level hash-chained audit log. When present, every successful `put()` and `delete()` appends an entry to the ledger AFTER the adapter write succeeds (so a failed adapter write never produces an orphan ledger entry).
329
343
  *
330
344
  * The ledger is always a vault-wide singleton — all
331
345
  * collections in the same vault share the same LedgerStore.
@@ -736,10 +750,7 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
736
750
  */
737
751
  delete(id: string): Promise<void>;
738
752
  /**
739
- * @internal — bulk-rewrite every record through a cutover transform.
740
- * Raw adapter path (bypasses the write gate + guards — the transform is
741
- * trusted and runs only during the `migrating` phase). Bumps each
742
- * record's `_v` and appends a ledger `op:'migration'` entry.
753
+ * @internal — bulk-rewrite every record through a cutover transform. Raw adapter path (bypasses the write gate + guards — the transform is trusted and runs only during the `migrating` phase). Bumps each record's `_v` and appends a ledger `op:'migration'` entry. #708: refuses BEFORE any rewrite if a live record is elevated (assertCutoverTierSafe) — demote it first.
743
754
  */
744
755
  _applyCutoverTransform(transform: (doc: Record<string, unknown>) => Record<string, unknown>): Promise<number>;
745
756
  /** @internal Untracked delete body — call {@link delete}, not this. */
@@ -827,11 +838,17 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
827
838
  /**
828
839
  * Mirror of {@link dispatchMaterializedViews} for the delete/forget path — no `_materializedFrom`
829
840
  * skip (record's gone); the `internal` gate at `_doDelete` is the recursion guard. Returns the
830
- * row count TOMBSTONED across every eager MV sourced here (#638 T6 — `forgetDerivedFanout`'s
831
- * `derivedRecordsErased`); a lazy MV only flips its stale bit (0 contribution — resolved on read).
841
+ * row count TOMBSTONED across EVERY MV sourced here (#638 T6 — `forgetDerivedFanout`'s
842
+ * `derivedRecordsErased`) eager AND lazy/manual `invalidateMVAtRest` purges both contribute now
843
+ * (#761 item 1, previously eager-only); lazy persists a stale mark for cold-session recompute;
844
+ * manual serves empty until `refreshView()`. `residueUndecodable`/`residueDeclined` (#776/#785) carry `outputCollection:id` entries whose ownership stamp `invalidateMVAtRest` could not decode, resp. decoded+stamp-matched but declined erasure — surfaced, not erased.
832
845
  * @internal
833
846
  */
834
- dispatchMaterializedViewsOnDelete(id: string): Promise<number>;
847
+ dispatchMaterializedViewsOnDelete(id: string): Promise<{
848
+ deleted: number;
849
+ residueUndecodable: string[];
850
+ residueDeclined: string[];
851
+ }>;
835
852
  /**
836
853
  * List all records in the collection.
837
854
  *
@@ -868,6 +885,11 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
868
885
  minScore?: number;
869
886
  includeRecord?: boolean;
870
887
  }): Promise<RetrieveHit<T>[]>;
888
+ /** Opt-in bulk `_vec` re-derive (#788) — a plain collection has nothing to rebuild; gated behind `searchStrategy: withSearch()` otherwise. */
889
+ rebuildEmbeddings(): Promise<{
890
+ rebuilt: number;
891
+ skipped: number;
892
+ }>;
871
893
  /**
872
894
  * Bind the {@link SearchContext} the search/retrieval surface needs. The
873
895
  * `cache` is the SAME `Map` reference the eager read/write path owns (passed
@@ -1050,9 +1072,9 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
1050
1072
  /**
1051
1073
  * Count records in the collection.
1052
1074
  *
1053
- * In eager mode this returns the in-memory cache size (instant). In
1054
- * lazy mode it asks the adapter via `list()` to enumerate idsslower
1055
- * but still correct, and avoids loading any record bodies into memory.
1075
+ * In eager mode this returns the in-memory cache size (instant). In lazy
1076
+ * mode it counts only LIVE tier-0 envelopes via envelope inspectionno
1077
+ * record bodies loaded matching eager's tombstone/tier exclusion (#706).
1056
1078
  */
1057
1079
  count(): Promise<number>;
1058
1080
  /**
@@ -1439,7 +1461,7 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
1439
1461
  queryByDet(field: string, value: unknown): Promise<T[]>;
1440
1462
  /** Bind the {@link DeterministicContext} this collection's det lookups need. */
1441
1463
  private detContext;
1442
- /** tier-aware put — gated behind `tiersStrategy: withTiers()`. */
1464
+ /** tier-aware put — gated behind `tiersStrategy: withTiers()`. `searchResidue: true` = stuck search compensation (#774, mirroring #764's elevate/demote posture); the write itself always completes. */
1443
1465
  putAtTier(id: string, record: T, tier: number, opts?: {
1444
1466
  elevation?: {
1445
1467
  reason: string;
@@ -1447,7 +1469,7 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
1447
1469
  };
1448
1470
  source?: string;
1449
1471
  sourceTs?: string;
1450
- }): Promise<void>;
1472
+ }): Promise<TierMoveResult>;
1451
1473
  /** tier-aware get — gated behind `tiersStrategy: withTiers()`. */
1452
1474
  getAtTier(id: string): Promise<T | GhostRecord | null>;
1453
1475
  /** list ids grouped by the caller's readability — gated behind `withTiers()`. */
@@ -1456,14 +1478,12 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
1456
1478
  tier: number;
1457
1479
  readable: boolean;
1458
1480
  }>>;
1459
- /** elevate a record to a higher tier — gated behind `withTiers()`. */
1460
- elevate(id: string, toTier: number): Promise<void>;
1461
- /** demote a record to a lower tier — gated behind `withTiers()`. */
1462
- demote(id: string, toTier: number): Promise<void>;
1481
+ /** elevate a record to a higher tier — gated behind `withTiers()`. `searchResidue: true` = stuck search compensation (#764); the move itself always completes. */
1482
+ elevate(id: string, toTier: number): Promise<TierMoveResult>;
1483
+ /** demote a record to a lower tier — gated behind `withTiers()`. Same `searchResidue` posture as {@link elevate} (#764). */
1484
+ demote(id: string, toTier: number): Promise<TierMoveResult>;
1463
1485
  /**
1464
- * Emit a cross-tier access event. The subscriber sink stays collection-
1465
- * resident (it captures `onCrossTierAccess`); the tiers module reaches it
1466
- * via the {@link TiersContext.emitCrossTierEvent} callback.
1486
+ * Emit a cross-tier access event. The subscriber sink stays collection-resident (it captures `onCrossTierAccess`); the tiers module reaches it via the {@link TiersContext.emitCrossTierEvent} callback.
1467
1487
  */
1468
1488
  private emitCrossTierEvent;
1469
1489
  /**
@@ -1489,17 +1509,14 @@ export declare class Collection<T, S extends keyof T = never, Q extends keyof T
1489
1509
  presentForJoin?: (record: unknown, locale: string) => unknown;
1490
1510
  }): void;
1491
1511
  /**
1492
- * Bind the {@link TiersContext} the tier ops need. The `cekCache` is passed
1493
- * by reference (the SAME `Lru` the kernel's read/write path owns) so an
1494
- * elevate/demote CEK re-wrap stays synchronous with cache eviction.
1512
+ * Bind the {@link TiersContext} the tier ops need `cekCache` by reference (same `Lru` the read/write path owns) for a synchronous re-wrap; `syncDerived` closes over `this` for {@link syncDerivedOutputs} (#722).
1495
1513
  */
1496
1514
  private tiersContext;
1497
1515
  /**
1498
1516
  * Bind the {@link IndexingContext} the index-maintenance surface needs. The
1499
1517
  * eager `cache` Map and the index / unique-constraint / persisted mirrors are
1500
1518
  * passed by reference (the SAME instances the query path reads, never
1501
- * copied); the `persistedIndexesLoaded` flag and `ensure*` hydration stay
1502
- * collection-resident, reached via callbacks.
1519
+ * copied); the `persistedIndexesLoaded` flag and `ensure*` hydration stay collection-resident, reached via callbacks.
1503
1520
  */
1504
1521
  private indexingContext;
1505
1522
  }
@@ -7,6 +7,9 @@
7
7
  * text door (verifyTextField) has no real PBKDF2 of its own, so it pays the
8
8
  * pad UNCONDITIONALLY — every outcome, including a real compare, costs the
9
9
  * same one PBKDF2 unit (no inverted exists-vs-absent oracle).
10
+ * Elevated records (_tier > 0, with-audit tier moves) are non-comparable
11
+ * through every door and pad-false exactly like missing records (#691) —
12
+ * the tier-aware read surface is getAtTier, never verify.
10
13
  * Throws are reserved for caller/config bugs (ClassifiedVerifyError /
11
14
  * ClassifiedConfigError) and are exempt from the pad by design (R6 note).
12
15
  * @module
@@ -58,7 +58,8 @@ export type { EnclaveKey } from './crypto.js';
58
58
  export { encrypt, decrypt, encryptBytes, decryptBytes, encryptBytesWithAAD, decryptBytesWithAAD, encryptDeterministic, decryptDeterministic, sha256Hex, hmacSha256Hex, } from './crypto.js';
59
59
  export { deriveKey, derivePassphraseKey, generateDEK, generateSalt, generateIV, wrapKey, unwrapKey, bufferToBase64, base64ToBuffer, derivePresenceKey, deriveDeterministicKey, deriveSealedFieldKey, deriveSealedFieldKeyFromCek, wrapCek, unwrapCek, importCek, } from './crypto.js';
60
60
  export type { PassphraseKeyUsage } from './crypto.js';
61
- export { resolveStableCek, rewrapBodyToDek } from './record-keys/lifecycle.js';
61
+ export { resolveStableCek, rewrapBodyToDek, rewrapEnvelope, applyRewrappedBody, isRewrappedUnder } from './record-keys/lifecycle.js';
62
+ export type { RewrappedBody } from './record-keys/lifecycle.js';
62
63
  export { RecordCodec } from './record-keys/record-codec.js';
63
64
  export type { SealedShredSlot } from './record-keys/record-codec.js';
64
65
  export { SEALED_CEK_NS, sealRecordToHost, revokeSealedRecord, rotateRecordCek } from './record-keys/sealing.js';
@@ -12,6 +12,7 @@
12
12
  * Both functions take a small {@link DeterministicContext} (the exact `this.*`
13
13
  * the moving methods touched) instead of `this`, mirroring the `record-keys/`
14
14
  * siblings. Behaviour is byte-identical to the inline code they replaced.
15
+ * Elevated records (_tier > 0) are skipped: invisible to tier-0 scans (#691).
15
16
  *
16
17
  * Internal service — not exported as a `@noy-db/hub/*` subpath.
17
18
  */
@@ -55,3 +55,53 @@ export interface RewrappedBody {
55
55
  * directly — byte-for-byte the pre-CEK behaviour.
56
56
  */
57
57
  export declare function rewrapBodyToDek(envelope: Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek'>, fromDek: EnclaveKey, toDek: EnclaveKey): Promise<RewrappedBody>;
58
+ /**
59
+ * Merge an ALREADY-rewrapped {@link RewrappedBody} into `envelope`, keeping
60
+ * every field but the re-keyed body (`_iv`/`_data`/`_cek`) unchanged.
61
+ *
62
+ * Body-field access (`_iv`/`_data`/`_cek`) is sanctioned inside the enclave;
63
+ * this lets callers outside it get back a ready-to-store envelope without
64
+ * reading those fields themselves. Takes a body the caller has ALREADY
65
+ * computed (vs. {@link rewrapEnvelope}, which also runs `rewrapBodyToDek`)
66
+ * so a caller building a SECOND envelope from the same rewrap — a tier
67
+ * move's live write AND its pre-move `_history` snapshot, #728 — pays the
68
+ * unwrap/decrypt/encrypt/wrap crypto once, not twice.
69
+ */
70
+ export declare function applyRewrappedBody(envelope: EncryptedEnvelope, body: RewrappedBody): EncryptedEnvelope;
71
+ /**
72
+ * Move a FULL stored envelope from `fromDek` to `toDek`, preserving every
73
+ * field other than the re-keyed body (`_iv`/`_data`/`_cek`) unchanged.
74
+ * Mirrors the spread-merge idiom `with-audit/tiers/index.ts`'s
75
+ * `elevate()`/`demote()` use to apply `rewrapBodyToDek`'s result to the live
76
+ * envelope, generalized to any envelope shape (history callers don't bump
77
+ * `_v`/`_ts`/`_tier` the way a tier move does).
78
+ */
79
+ export declare function rewrapEnvelope(envelope: EncryptedEnvelope, fromDek: EnclaveKey, toDek: EnclaveKey): Promise<EncryptedEnvelope>;
80
+ /**
81
+ * Is `envelope` ALREADY wrapped under `dek` (a per-record CEK wrapped under
82
+ * `dek`, or — legacy, no `_cek` — the body itself decryptable under `dek`)?
83
+ *
84
+ * A toDek-first idempotency check for retry-safe rewrap loops (#712 crash
85
+ * atomicity, `with-commit/history/history.ts`'s `rewrapHistory`): a crash
86
+ * mid-rewrap can strand some entries already moved to `toDek` while others
87
+ * remain under `fromDek`. Calling this with `toDek` before attempting the
88
+ * `fromDek` rewrap lets the caller skip an already-migrated entry instead of
89
+ * re-wrapping it (a re-wrap would be a correctness no-op but doubles as an
90
+ * unnecessary write) — and, more importantly, tells a retry loop that this
91
+ * entry needs no `fromDek` unwrap attempt at all, so a crash that landed some
92
+ * entries under `toDek` doesn't wedge on those already-moved entries.
93
+ *
94
+ * AES-KW (CEK unwrap) and AES-GCM (direct decrypt) are both authenticated —
95
+ * unwrap/decrypt under the wrong key throws, never silently returns garbage
96
+ * — so a caught error here reliably means "not wrapped under `dek`", not a
97
+ * corrupt envelope (a genuinely corrupt envelope also throws under the
98
+ * correct key, but callers that reach this helper only do so as a
99
+ * best-effort probe before their own decisive fromDek attempt, which still
100
+ * surfaces real corruption).
101
+ *
102
+ * Body-field access (`_iv`/`_data`/`_cek`) is sanctioned inside the enclave —
103
+ * this is the sanctioned door so callers outside it (history.ts) never read
104
+ * those fields themselves, preserving the check-architecture body-access
105
+ * ratchet.
106
+ */
107
+ export declare function isRewrappedUnder(envelope: Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek'>, dek: EnclaveKey): Promise<boolean>;
@@ -278,6 +278,33 @@ export declare class RecordCodec<T> {
278
278
  id?: string;
279
279
  sealedAsHandles?: boolean;
280
280
  }): Promise<T>;
281
+ /**
282
+ * Decrypt an envelope under an EXPLICIT `dek` instead of this codec's own
283
+ * `ctx.getDEK()` / cekCache resolution — for a from-tier>0 pre-move decode
284
+ * (`with-audit/tiers/index.ts`'s `putAtTier`/`elevate`/`demote` sites,
285
+ * #722 whole-branch review). Mirrors the manual unwrap-then-decrypt
286
+ * `getAtTier`'s own tier>0 leg performs there (same primitives, same
287
+ * `applySealedSlots` extraction point #635 built for exactly this caller).
288
+ *
289
+ * `decryptRecord` is tier-UNAWARE: `resolveEnvelopeCek` reads the cekCache
290
+ * or falls back to `ctx.getDEK()` — this codec's DEFAULT (tier-0/
291
+ * collection) DEK — never the envelope's OWN tier. That only happens to
292
+ * decrypt a from-tier>0 envelope correctly when some other call in the
293
+ * SAME op already primed the cekCache with this record's CEK (true for an
294
+ * ordinary put()-then-elevate(0→1); NOT true for a `putAtTier`-origin
295
+ * envelope, whose body is encrypted directly under its tier DEK with no
296
+ * `_cek` ever minted, or a non-`perRecordKeys` collection, which has no
297
+ * `_cek` at all) — those throw `TamperedError`. Decrypting under the
298
+ * caller-resolved `dek` is correct regardless of cache state or
299
+ * `perRecordKeys`.
300
+ *
301
+ * No CRDT resolution, no schema validation — same scope as `getAtTier`'s
302
+ * tier>0 branch (the established precedent for a tier-aware read), which
303
+ * skips both for the same reason: a tier>0 read is an internal/derived-
304
+ * output-recompute path, not the public per-record read surface schema
305
+ * validation guards.
306
+ */
307
+ decryptRecordAtDek(envelope: EncryptedEnvelope, dek: EnclaveKey, id?: string): Promise<T | null>;
281
308
  /**
282
309
  * Decrypt an envelope into a record of type `T`.
283
310
  *
@@ -490,6 +490,62 @@ export declare class TierNotGrantedError extends NoydbError {
490
490
  readonly collection: string;
491
491
  constructor(collection: string, tier: number);
492
492
  }
493
+ /**
494
+ * Thrown when a tier-0 `put()` or `delete()` targets a record whose LIVE
495
+ * envelope is elevated (`_tier > 0`) — regardless of whether the caller
496
+ * holds the tier's DEK. `put()`/`delete()` are the tier-0 write APIs;
497
+ * the sanctioned way to write an elevated record is `putAtTier()`,
498
+ * `elevate()`, or `demote()`.
499
+ *
500
+ * Distinct from `TierNotGrantedError`, which means "no DEK for tier N"
501
+ * and refuses only non-holders. This error refuses HOLDERS too — the
502
+ * problem isn't clearance, it's that `put()`/`delete()` are the wrong
503
+ * API for an already-elevated record (a tier-0 `put()` over one would
504
+ * otherwise silently demote it; a tier-0 `delete()` would write a
505
+ * marker with no `_tier`, erasing the elevation signal). It is also
506
+ * distinct from the read-path invisibility gate (`liveRecordIsElevated`
507
+ * in `tier-visibility.ts`), which throws nothing — elevated records
508
+ * simply read as absent there. This is a write-path refusal, not a
509
+ * read-path ghost.
510
+ *
511
+ * #708: also raised by the coordinated-cutover pre-check
512
+ * (`assertCutoverTierSafe`) — a bulk-rewrite is a third tier-0 write path,
513
+ * so it gets the same refusal with a `detail` override naming the record.
514
+ */
515
+ export declare class TierWriteRefusedError extends NoydbError {
516
+ readonly tier: number;
517
+ readonly collection: string;
518
+ constructor(collection: string, tier: number, detail?: string);
519
+ }
520
+ /**
521
+ * Thrown at `vault.collection()` registration when `tiers` is declared
522
+ * together with a derived-artifact feature whose crypto has not yet been
523
+ * made tier-aware (elevate()/demote() do not re-key it), so an elevated
524
+ * record's data would stay readable at tier 0. Mirrors
525
+ * `UnsupportedIndexOptionError` — the refusal happens loudly at
526
+ * registration instead of leaking silently at rest.
527
+ *
528
+ * `feature` names the incompatible feature (e.g. `'blobs'`) so catch
529
+ * blocks can pattern-match without inspecting the error message.
530
+ */
531
+ export declare class UnsupportedTierCompositionError extends NoydbError {
532
+ readonly feature: string;
533
+ constructor(feature: string, message: string);
534
+ }
535
+ /**
536
+ * Thrown by `createIntent` (blob durability journal, #753 spec §7 C8) when a
537
+ * `_blob_intent` marker already exists for `{collection}::{recordId}` — the
538
+ * CAS create-if-absent (`expectedVersion: 0`) lost to a present row. A
539
+ * present marker means a shred or rehome is already in flight for this
540
+ * record and MUST be resumed before any new intent is minted (overwriting it
541
+ * would orphan the prior op's op-stamps — spec C8). Callers catch this and
542
+ * resume the pending marker first, then retry.
543
+ */
544
+ export declare class BlobIntentPendingError extends NoydbError {
545
+ readonly collection: string;
546
+ readonly recordId: string;
547
+ constructor(collection: string, recordId: string);
548
+ }
493
549
  /**
494
550
  * Thrown when an elevated-handle operation runs after the elevation's
495
551
  * TTL expired. Reads continue at the original tier; only writes
@@ -816,6 +872,24 @@ export declare class IndexWriteFailureError extends NoydbError {
816
872
  cause: unknown;
817
873
  });
818
874
  }
875
+ /**
876
+ * Thrown when `PersistedIndexStore`'s compensating `remove()` — the undo of a
877
+ * stale debounced `_ftindex` save that raced a purge (#725) — itself fails.
878
+ * That failure is sticky (`pendingCompensation`) and retried-first by every
879
+ * subsequent store entrypoint (`ensureBuilt`/`rebuildAndPersist`/
880
+ * `removePersisted`) rather than silently dropped, but was previously
881
+ * rethrown as the RAW adapter error indefinitely — indistinguishable from
882
+ * any other adapter failure, so a caller could not catch it deliberately the
883
+ * way `forget()` catches `_purgeSearchIndex` into `indexResidue` (#764).
884
+ *
885
+ * `cause` is the underlying adapter error. Callers that want stuck-
886
+ * compensation resilience instead of an abort (e.g. `elevate()`/`demote()`,
887
+ * #764) catch this type specifically and surface it as residue.
888
+ */
889
+ export declare class PersistedIndexCompensationError extends NoydbError {
890
+ readonly cause: unknown;
891
+ constructor(cause: unknown);
892
+ }
819
893
  /**
820
894
  * Thrown by `.where()` / `.orderBy()` / `.aggregate()` (via the Via
821
895
  * pipeline's `postureFor`/`wrapReducers`) when the field is covered by a Via
@@ -1838,7 +1912,7 @@ export declare class ClassifiedRotationError extends Error {
1838
1912
  }
1839
1913
  /**
1840
1914
  * A satellite-collection declaration or operation violated the refusal
1841
- * matrix (R-S1…R-S9) of the satellite-collections design. The message
1915
+ * matrix (R-S1…R-S10) of the satellite-collections design. The message
1842
1916
  * always names the R-S id.
1843
1917
  */
1844
1918
  export declare class SatelliteConfigError extends NoydbError {
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Lazy-mode `count()` support (#706): count ids whose envelope is LIVE at
3
+ * tier 0 — parity with eager count (the hydrated cache excludes tombstones,
4
+ * delete markers, and elevated records, #701). Envelope inspection only —
5
+ * no record body is ever decrypted here.
6
+ *
7
+ * #713: when the adapter implements the optional `listPage`, page through
8
+ * it and apply the same predicate to each page's envelopes — one
9
+ * round-trip per page instead of one `list()` + one `get()` per id. Stores
10
+ * without `listPage` keep the original N+1 loop.
11
+ */
12
+ import type { NoydbStore } from './types.js';
13
+ export declare function countLiveEnvelopes(adapter: NoydbStore, vault: string, name: string, storeCiphertext: boolean): Promise<number>;
@@ -577,6 +577,14 @@ export declare class Noydb {
577
577
  * `by-*` real-time transport is injected via `coordinationStrategy`.
578
578
  */
579
579
  get coordination(): CoordinationProvider;
580
+ /**
581
+ * #693: true when multi-tab coordination is active at all — presence/election
582
+ * alone (`propagateWrites: false`) or full write-propagation — a peer tab can
583
+ * write this instance's shared store out-of-band either way, so per-collection
584
+ * marker-id sets are not authoritative and the re-create gate must fall back to
585
+ * a store read. Live (tab coordination is enable/disable-able at runtime).
586
+ */
587
+ get _tabCoordinationActive(): boolean;
580
588
  /**
581
589
  * Soft-lock a single vault: clear its in-memory keyring, DEKs, vault
582
590
  * instance, sync engine, policy enforcer, and active-tier entry —