@noy-db/hub 0.3.0 → 0.4.0-pre.1

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 (375) hide show
  1. package/dist/aggregate/index.js +4 -4
  2. package/dist/api-IQFZJSQO.js +20 -0
  3. package/dist/as/index.js +11 -11
  4. package/dist/attestation/index.js +18 -18
  5. package/dist/{backup-BJ57IKAO.js → backup-LU2DTZTI.js} +11 -11
  6. package/dist/blobs/index.js +12 -12
  7. package/dist/broker/index.js +12 -12
  8. package/dist/bundle/index.js +26 -74
  9. package/dist/bundle/index.js.map +1 -1
  10. package/dist/by/index.js +2 -2
  11. package/dist/cargo/index.js +41 -22
  12. package/dist/chunk-2IALOXZS.js +24 -0
  13. package/dist/chunk-2IALOXZS.js.map +1 -0
  14. package/dist/{chunk-EVVGJDRQ.js → chunk-2MUZ3LY6.js} +3 -3
  15. package/dist/{chunk-NWSGI5C7.js → chunk-2P7EGNKF.js} +3 -3
  16. package/dist/{chunk-ZAJAVEXY.js → chunk-2PCAVW2I.js} +2 -2
  17. package/dist/{chunk-HTJQYHZP.js → chunk-3ELCWU56.js} +2 -2
  18. package/dist/{chunk-X7QBD67R.js → chunk-3PF6CRDT.js} +136 -114
  19. package/dist/chunk-3PF6CRDT.js.map +1 -0
  20. package/dist/{chunk-J2ZX2XUV.js → chunk-3SV2EPMN.js} +5 -5
  21. package/dist/{chunk-FUG4SFN3.js → chunk-3U3FBR7O.js} +2 -2
  22. package/dist/{chunk-VFUPHI2Z.js → chunk-4BRCIYFG.js} +6 -6
  23. package/dist/{chunk-SNZ6URZZ.js → chunk-5OI6BR4H.js} +7 -7
  24. package/dist/{chunk-B3HJYUOF.js → chunk-5WZXVULX.js} +2 -2
  25. package/dist/{chunk-LASZKVMO.js → chunk-6B4DYGWO.js} +3 -3
  26. package/dist/{chunk-ZJ2AK4V7.js → chunk-6HPG2YNX.js} +2 -2
  27. package/dist/{chunk-5M5DVGV7.js → chunk-6HY2X62D.js} +2 -2
  28. package/dist/{chunk-QRB7NAOJ.js → chunk-6NQMXTYC.js} +2 -2
  29. package/dist/{chunk-RIX4V2TB.js → chunk-6XE5TMPR.js} +3 -3
  30. package/dist/{chunk-BDVFPG6Y.js → chunk-7CI6CP7Z.js} +5 -5
  31. package/dist/{chunk-VLFCJYTL.js → chunk-7O3AYBC7.js} +63 -10
  32. package/dist/chunk-7O3AYBC7.js.map +1 -0
  33. package/dist/{chunk-454JXE57.js → chunk-A5BDDEXK.js} +10 -170
  34. package/dist/chunk-A5BDDEXK.js.map +1 -0
  35. package/dist/{chunk-FHS2HQSH.js → chunk-A7JJLVGH.js} +11 -8
  36. package/dist/chunk-A7JJLVGH.js.map +1 -0
  37. package/dist/{chunk-FM3G3NOY.js → chunk-BGK233EA.js} +83 -6
  38. package/dist/chunk-BGK233EA.js.map +1 -0
  39. package/dist/{chunk-OSDB5WW3.js → chunk-BMQWTQZ4.js} +11 -11
  40. package/dist/{chunk-W22IKJE2.js → chunk-BOKIKJJB.js} +2 -2
  41. package/dist/{chunk-CRI4OUV4.js → chunk-CBSY2N76.js} +2 -2
  42. package/dist/{chunk-2NVOWNI3.js → chunk-CCOP5XDW.js} +4 -4
  43. package/dist/{chunk-CDUQTA3Z.js → chunk-DDATL6PU.js} +7 -7
  44. package/dist/{chunk-RCVJZMFE.js → chunk-DDHM2TLX.js} +4 -4
  45. package/dist/{chunk-PN2XMATY.js → chunk-DRWBEDYO.js} +2 -2
  46. package/dist/{chunk-XDYREZWE.js → chunk-DVUZMT2W.js} +12 -8
  47. package/dist/{chunk-XDYREZWE.js.map → chunk-DVUZMT2W.js.map} +1 -1
  48. package/dist/{chunk-T2FFWNPK.js → chunk-EGCRBCNA.js} +3 -3
  49. package/dist/{chunk-VZRODIM3.js → chunk-F6T6L2UK.js} +4 -4
  50. package/dist/chunk-FH52K7EG.js +50 -0
  51. package/dist/chunk-FH52K7EG.js.map +1 -0
  52. package/dist/{chunk-EXK7QRWF.js → chunk-G6EQYAL6.js} +5 -5
  53. package/dist/{chunk-F64IRYG3.js → chunk-GQNGCEP5.js} +2 -2
  54. package/dist/{chunk-6JTIAGHD.js → chunk-GULTLPFB.js} +3 -3
  55. package/dist/chunk-GULTLPFB.js.map +1 -0
  56. package/dist/{chunk-ZUODRVHY.js → chunk-GVZQ4NAM.js} +2 -2
  57. package/dist/{chunk-3B5VVCNY.js → chunk-GWKAVKHI.js} +2 -2
  58. package/dist/{chunk-SLFHQTTW.js → chunk-GYYCX5K6.js} +5 -5
  59. package/dist/{chunk-CIE2BASH.js → chunk-HOONYZY2.js} +2 -2
  60. package/dist/{chunk-EYZ6IQ6X.js → chunk-HPUWOVR7.js} +5 -5
  61. package/dist/{chunk-IL6POWCW.js → chunk-IM3QVF53.js} +6 -6
  62. package/dist/{chunk-NJ4EOKMB.js → chunk-IRQY7IR5.js} +4 -4
  63. package/dist/{chunk-3QCRBHCY.js → chunk-ISMV2QVG.js} +2 -2
  64. package/dist/{chunk-HB3RFQSC.js → chunk-IY23KFNZ.js} +3 -3
  65. package/dist/chunk-J6Q7UVQE.js +248 -0
  66. package/dist/chunk-J6Q7UVQE.js.map +1 -0
  67. package/dist/{chunk-6CRIV7DE.js → chunk-JBBSYJHP.js} +2 -2
  68. package/dist/{chunk-MEFJPTZ4.js → chunk-JRBNCUNT.js} +3 -3
  69. package/dist/{chunk-4VNQOLML.js → chunk-JVBO4SZL.js} +2 -2
  70. package/dist/{chunk-I6GALP6E.js → chunk-JZWWLLVY.js} +6 -6
  71. package/dist/{chunk-RYCTDFUX.js → chunk-KUIB4B5Q.js} +2 -2
  72. package/dist/{chunk-HDQIIUPH.js → chunk-KUPKLSX5.js} +3 -3
  73. package/dist/{chunk-5O3XF4DV.js → chunk-KWVJAOIN.js} +4 -4
  74. package/dist/{chunk-3LQ2YKO4.js → chunk-LB6OH6K2.js} +2 -2
  75. package/dist/{chunk-AUSTCW2X.js → chunk-LOF2W3JU.js} +8 -8
  76. package/dist/{chunk-JNAI2HN2.js → chunk-LSASLXGC.js} +1 -1
  77. package/dist/chunk-LSASLXGC.js.map +1 -0
  78. package/dist/{chunk-K5IMOGHB.js → chunk-M75ZZHSR.js} +2 -2
  79. package/dist/{chunk-GTGPO5KW.js → chunk-MQ6WOPSY.js} +5 -5
  80. package/dist/{chunk-4CTHCN4J.js → chunk-MTQPRQHB.js} +4 -4
  81. package/dist/{chunk-UNFPPVNI.js → chunk-N55W7KUL.js} +2 -2
  82. package/dist/{chunk-JKJOGPZN.js → chunk-N6WF5PKC.js} +2 -2
  83. package/dist/{chunk-6T2SCQRU.js → chunk-O7WJ47EF.js} +4 -4
  84. package/dist/{chunk-JIF24JPM.js → chunk-OF75ACKS.js} +9 -9
  85. package/dist/{chunk-GKEWXIV5.js → chunk-ONTBCHCP.js} +2 -2
  86. package/dist/{chunk-4JBYV75E.js → chunk-PK6QCH2C.js} +5 -5
  87. package/dist/{chunk-6QTNZJBS.js → chunk-PT37L5DV.js} +3 -3
  88. package/dist/{chunk-EVX47VBM.js → chunk-QDPZWTN2.js} +2 -2
  89. package/dist/chunk-RA5VTXXG.js +173 -0
  90. package/dist/chunk-RA5VTXXG.js.map +1 -0
  91. package/dist/{chunk-QLWMEXCT.js → chunk-RDXW3OBQ.js} +2 -2
  92. package/dist/{chunk-Q5VNKNE5.js → chunk-RM2XV574.js} +3 -3
  93. package/dist/{chunk-ERJ7FU55.js → chunk-RND5ZPNP.js} +3 -3
  94. package/dist/{chunk-JZUV47FZ.js → chunk-RTEK4C4I.js} +2 -2
  95. package/dist/{chunk-KSKBRKGJ.js → chunk-S3BFKGET.js} +84 -6
  96. package/dist/chunk-S3BFKGET.js.map +1 -0
  97. package/dist/{chunk-5YOLBEQ6.js → chunk-S6Q37VGE.js} +2 -2
  98. package/dist/{chunk-HDMEGAQE.js → chunk-SMGEYW6G.js} +127 -8
  99. package/dist/chunk-SMGEYW6G.js.map +1 -0
  100. package/dist/{chunk-E5ZQT5KX.js → chunk-SMIRGMS7.js} +2 -2
  101. package/dist/chunk-T36RFODW.js +180 -0
  102. package/dist/chunk-T36RFODW.js.map +1 -0
  103. package/dist/{chunk-EQO2UVP4.js → chunk-T6GU5PPZ.js} +6 -6
  104. package/dist/{chunk-LXEXBTKL.js → chunk-TAGR72IR.js} +4 -4
  105. package/dist/{chunk-YFXZEAYK.js → chunk-TOPYT5U5.js} +6 -6
  106. package/dist/{chunk-MV43JSJF.js → chunk-UBNCR3YK.js} +4 -4
  107. package/dist/{chunk-ZICD77GM.js → chunk-UC2ETWF3.js} +2 -2
  108. package/dist/{chunk-XWZVFISC.js → chunk-UFEVO57O.js} +6 -6
  109. package/dist/{chunk-NR5LT5RY.js → chunk-UNCOC7QH.js} +7 -7
  110. package/dist/{chunk-R4ROFEYC.js → chunk-VAIS3SOM.js} +2 -2
  111. package/dist/{chunk-VN3DBQAU.js → chunk-VCBHAE4R.js} +2 -2
  112. package/dist/{chunk-M4CV6BRT.js → chunk-VEALDPHW.js} +2 -2
  113. package/dist/{chunk-BIOUI4HL.js → chunk-W2OG6JOL.js} +1 -1
  114. package/dist/{chunk-BIOUI4HL.js.map → chunk-W2OG6JOL.js.map} +1 -1
  115. package/dist/{chunk-7DSTRQIJ.js → chunk-WEYZTLXN.js} +2 -2
  116. package/dist/{chunk-CAF6WOK7.js → chunk-WNGGJWF7.js} +2 -2
  117. package/dist/{chunk-IU6SNYX6.js → chunk-YJV2UZ7H.js} +5 -5
  118. package/dist/{chunk-RZ5SVOYR.js → chunk-YTGDPCPW.js} +2 -2
  119. package/dist/{chunk-DLG74CNB.js → chunk-ZEQWCBCM.js} +7 -19
  120. package/dist/chunk-ZEQWCBCM.js.map +1 -0
  121. package/dist/classified/index.js +5 -5
  122. package/dist/{classified-marker-CZKA6ITE.js → classified-marker-WQVIJAW2.js} +3 -3
  123. package/dist/collection-facade-MJXSC3Q6.js +44 -0
  124. package/dist/{computed-ZIQTYTDI.js → computed-DSMPXG2Y.js} +3 -3
  125. package/dist/consent/index.js +9 -9
  126. package/dist/{public-envelope-B4KNWVUA.js → cover-B5SJDHR3.js} +25 -5
  127. package/dist/{dead-filter-ESOBZZP5.js → dead-filter-2A7IAJ3D.js} +2 -2
  128. package/dist/delegation-A5A75KQO.js +25 -0
  129. package/dist/derivations/index.js +12 -12
  130. package/dist/derive-HJSMH7RA.js +21 -0
  131. package/dist/{enclave-AP3I5W7O.js → enclave-7MW6ZGXW.js} +11 -9
  132. package/dist/executor-AXE4XMLT.js +26 -0
  133. package/dist/executor-KGNLJD6M.js +9 -0
  134. package/dist/executor-XGIS6CR7.js +9 -0
  135. package/dist/export-accessible-VVBJM3MM.js +23 -0
  136. package/dist/extract-partition-LGGBTQET.js +38 -0
  137. package/dist/{fanout-sidecar-A765THMX.js → fanout-sidecar-WDYQ77VB.js} +9 -9
  138. package/dist/find-YS6XWB46.js +11 -0
  139. package/dist/forget/index.js +9 -9
  140. package/dist/guards/index.js +6 -6
  141. package/dist/history/index.js +12 -12
  142. package/dist/i18n/index.js +14 -14
  143. package/dist/index.d.ts +6 -3
  144. package/dist/index.js +140 -117
  145. package/dist/index.js.map +1 -1
  146. package/dist/indexing/index.js +2 -2
  147. package/dist/issue-LSR5PS6H.js +19 -0
  148. package/dist/kernel/enclave/index.d.ts +1 -1
  149. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +8 -0
  150. package/dist/kernel/errors.d.ts +10 -5
  151. package/dist/kernel/noydb.d.ts +21 -11
  152. package/dist/kernel/types.d.ts +53 -6
  153. package/dist/kernel/vault.d.ts +10 -6
  154. package/dist/{ledger-GFBKVPV4.js → ledger-33BC4TR7.js} +11 -11
  155. package/dist/liberate-GBSAYLPJ.js +24 -0
  156. package/dist/{link-set-Z7Q2ASFX.js → link-set-QK22TDEX.js} +11 -11
  157. package/dist/materialized-views/index.js +19 -18
  158. package/dist/noydb-MTUBMWFE.js +70 -0
  159. package/dist/on/index.js +9 -9
  160. package/dist/overlay-views/index.js +4 -4
  161. package/dist/periods/index.js +19 -17
  162. package/dist/pod/index.js +13 -11
  163. package/dist/{policy-Z3RUAIY2.js → policy-NAHB2TUT.js} +5 -5
  164. package/dist/portability/index.js +8 -8
  165. package/dist/{post-register-JTH76BLY.js → post-register-JVTMJ6OW.js} +6 -6
  166. package/dist/query/index.js +10 -8
  167. package/dist/register-X462DNDM.js +23 -0
  168. package/dist/registry-3XMCT7MQ.js +18 -0
  169. package/dist/registry-KHD2I3M2.js +19 -0
  170. package/dist/registry-NPOWJHC4.js +9 -0
  171. package/dist/request-withdrawal-U7K3JTMY.js +31 -0
  172. package/dist/{reveal-DIBHLUZX.js → reveal-LGBOM2BO.js} +6 -6
  173. package/dist/revoke-OCWDSWRQ.js +24 -0
  174. package/dist/satellites/index.js +1 -1
  175. package/dist/sealed-record/index.js +12 -12
  176. package/dist/{seed-Q6M2IZFL.js → seed-PWK45HDF.js} +11 -11
  177. package/dist/session/index.js +9 -9
  178. package/dist/shadow/index.js +2 -2
  179. package/dist/share-link/index.d.ts +19 -0
  180. package/dist/share-link/index.js +201 -0
  181. package/dist/share-link/index.js.map +1 -0
  182. package/dist/share-link/share-link.d.ts +123 -0
  183. package/dist/signer-3YFBLZRN.js +25 -0
  184. package/dist/snapshots/index.js +10 -10
  185. package/dist/{stale-OSQ7J3AA.js → stale-FJED42DM.js} +10 -10
  186. package/dist/storage-W3GURVFU.js +23 -0
  187. package/dist/{store-coordination-provider-64OEZFGS.js → store-coordination-provider-APODTV4W.js} +3 -3
  188. package/dist/sync/index.js +10 -9
  189. package/dist/sync/index.js.map +1 -1
  190. package/dist/team/index.js +16 -15
  191. package/dist/tiers/index.js +10 -10
  192. package/dist/to/index.js +1 -1
  193. package/dist/tx/index.js +3 -3
  194. package/dist/util/index.js +1 -1
  195. package/dist/{verify-ZASTRNPR.js → verify-26Y5GNMK.js} +5 -5
  196. package/dist/via/i18n/policy.d.ts +1 -1
  197. package/dist/{walk-SVNDIZ62.js → walk-XS3PKM6I.js} +11 -11
  198. package/dist/with/index.js +11 -11
  199. package/dist/with-audit/periods/periods.d.ts +1 -16
  200. package/dist/with-audit/periods/window.d.ts +16 -0
  201. package/dist/with-cargo/index.d.ts +6 -0
  202. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +15 -0
  203. package/dist/with-formula/materialized-views/index.d.ts +1 -1
  204. package/dist/with-formula/materialized-views/registry.d.ts +29 -0
  205. package/dist/with-formula/materialized-views/types.d.ts +81 -0
  206. package/dist/with-formula/materialized-views/with-materialized-view.d.ts +9 -5
  207. package/dist/with-party/directory/cover/custom.d.ts +34 -0
  208. package/dist/with-party/directory/cover/index.d.ts +19 -0
  209. package/dist/with-party/directory/cover/schema.d.ts +39 -0
  210. package/dist/with-party/directory/cover/storage.d.ts +71 -0
  211. package/dist/with-party/directory/cover/types.d.ts +149 -0
  212. package/dist/with-party/team/noydb-facade.d.ts +1 -1
  213. package/dist/with-party/team/sync-period-scope.d.ts +78 -0
  214. package/dist/with-party/team/sync.d.ts +13 -0
  215. package/dist/with-pod/bundle.d.ts +9 -7
  216. package/dist/with-pod/format.d.ts +8 -4
  217. package/dist/with-pod/index.d.ts +2 -1
  218. package/dist/withdraw-accessible-Y3B2535F.js +28 -0
  219. package/package.json +7 -3
  220. package/dist/api-ZGS6LCOF.js +0 -20
  221. package/dist/chunk-454JXE57.js.map +0 -1
  222. package/dist/chunk-4NXKCLLQ.js +0 -97
  223. package/dist/chunk-4NXKCLLQ.js.map +0 -1
  224. package/dist/chunk-6JTIAGHD.js.map +0 -1
  225. package/dist/chunk-DLG74CNB.js.map +0 -1
  226. package/dist/chunk-FHS2HQSH.js.map +0 -1
  227. package/dist/chunk-FM3G3NOY.js.map +0 -1
  228. package/dist/chunk-HDMEGAQE.js.map +0 -1
  229. package/dist/chunk-JNAI2HN2.js.map +0 -1
  230. package/dist/chunk-KSKBRKGJ.js.map +0 -1
  231. package/dist/chunk-VLFCJYTL.js.map +0 -1
  232. package/dist/chunk-WXSYDNBT.js +0 -39
  233. package/dist/chunk-WXSYDNBT.js.map +0 -1
  234. package/dist/chunk-X3YYQWOQ.js +0 -155
  235. package/dist/chunk-X3YYQWOQ.js.map +0 -1
  236. package/dist/chunk-X7QBD67R.js.map +0 -1
  237. package/dist/collection-facade-TLWIPI76.js +0 -44
  238. package/dist/delegation-W7ZV2322.js +0 -25
  239. package/dist/derive-H2BJTLUI.js +0 -21
  240. package/dist/executor-KGWTNEQD.js +0 -9
  241. package/dist/executor-OVEXR6RT.js +0 -9
  242. package/dist/executor-UNEH5ZYH.js +0 -25
  243. package/dist/export-accessible-PCMXSUZS.js +0 -23
  244. package/dist/extract-partition-SWHFSYJO.js +0 -38
  245. package/dist/find-N6345CNT.js +0 -11
  246. package/dist/issue-5OKB6I2R.js +0 -19
  247. package/dist/liberate-3VDOT4KO.js +0 -24
  248. package/dist/noydb-ZCJOYBDI.js +0 -68
  249. package/dist/register-VAHONCID.js +0 -23
  250. package/dist/registry-7MLVD3VO.js +0 -19
  251. package/dist/registry-EPKPD5SM.js +0 -18
  252. package/dist/registry-P5T7PS2U.js +0 -9
  253. package/dist/request-withdrawal-TI3A5WPS.js +0 -31
  254. package/dist/revoke-FDRD6GRW.js +0 -24
  255. package/dist/signer-MUWEIUI6.js +0 -25
  256. package/dist/storage-MVFCGEQE.js +0 -23
  257. package/dist/with-party/directory/public-envelope/index.d.ts +0 -12
  258. package/dist/with-party/directory/public-envelope/schema.d.ts +0 -24
  259. package/dist/with-party/directory/public-envelope/storage.d.ts +0 -59
  260. package/dist/with-party/directory/public-envelope/types.d.ts +0 -80
  261. package/dist/withdraw-accessible-WZIEVWSR.js +0 -28
  262. /package/dist/{api-ZGS6LCOF.js.map → api-IQFZJSQO.js.map} +0 -0
  263. /package/dist/{backup-BJ57IKAO.js.map → backup-LU2DTZTI.js.map} +0 -0
  264. /package/dist/{chunk-EVVGJDRQ.js.map → chunk-2MUZ3LY6.js.map} +0 -0
  265. /package/dist/{chunk-NWSGI5C7.js.map → chunk-2P7EGNKF.js.map} +0 -0
  266. /package/dist/{chunk-ZAJAVEXY.js.map → chunk-2PCAVW2I.js.map} +0 -0
  267. /package/dist/{chunk-HTJQYHZP.js.map → chunk-3ELCWU56.js.map} +0 -0
  268. /package/dist/{chunk-J2ZX2XUV.js.map → chunk-3SV2EPMN.js.map} +0 -0
  269. /package/dist/{chunk-FUG4SFN3.js.map → chunk-3U3FBR7O.js.map} +0 -0
  270. /package/dist/{chunk-VFUPHI2Z.js.map → chunk-4BRCIYFG.js.map} +0 -0
  271. /package/dist/{chunk-SNZ6URZZ.js.map → chunk-5OI6BR4H.js.map} +0 -0
  272. /package/dist/{chunk-B3HJYUOF.js.map → chunk-5WZXVULX.js.map} +0 -0
  273. /package/dist/{chunk-LASZKVMO.js.map → chunk-6B4DYGWO.js.map} +0 -0
  274. /package/dist/{chunk-ZJ2AK4V7.js.map → chunk-6HPG2YNX.js.map} +0 -0
  275. /package/dist/{chunk-5M5DVGV7.js.map → chunk-6HY2X62D.js.map} +0 -0
  276. /package/dist/{chunk-QRB7NAOJ.js.map → chunk-6NQMXTYC.js.map} +0 -0
  277. /package/dist/{chunk-RIX4V2TB.js.map → chunk-6XE5TMPR.js.map} +0 -0
  278. /package/dist/{chunk-BDVFPG6Y.js.map → chunk-7CI6CP7Z.js.map} +0 -0
  279. /package/dist/{chunk-OSDB5WW3.js.map → chunk-BMQWTQZ4.js.map} +0 -0
  280. /package/dist/{chunk-W22IKJE2.js.map → chunk-BOKIKJJB.js.map} +0 -0
  281. /package/dist/{chunk-CRI4OUV4.js.map → chunk-CBSY2N76.js.map} +0 -0
  282. /package/dist/{chunk-2NVOWNI3.js.map → chunk-CCOP5XDW.js.map} +0 -0
  283. /package/dist/{chunk-CDUQTA3Z.js.map → chunk-DDATL6PU.js.map} +0 -0
  284. /package/dist/{chunk-RCVJZMFE.js.map → chunk-DDHM2TLX.js.map} +0 -0
  285. /package/dist/{chunk-PN2XMATY.js.map → chunk-DRWBEDYO.js.map} +0 -0
  286. /package/dist/{chunk-T2FFWNPK.js.map → chunk-EGCRBCNA.js.map} +0 -0
  287. /package/dist/{chunk-VZRODIM3.js.map → chunk-F6T6L2UK.js.map} +0 -0
  288. /package/dist/{chunk-EXK7QRWF.js.map → chunk-G6EQYAL6.js.map} +0 -0
  289. /package/dist/{chunk-F64IRYG3.js.map → chunk-GQNGCEP5.js.map} +0 -0
  290. /package/dist/{chunk-ZUODRVHY.js.map → chunk-GVZQ4NAM.js.map} +0 -0
  291. /package/dist/{chunk-3B5VVCNY.js.map → chunk-GWKAVKHI.js.map} +0 -0
  292. /package/dist/{chunk-SLFHQTTW.js.map → chunk-GYYCX5K6.js.map} +0 -0
  293. /package/dist/{chunk-CIE2BASH.js.map → chunk-HOONYZY2.js.map} +0 -0
  294. /package/dist/{chunk-EYZ6IQ6X.js.map → chunk-HPUWOVR7.js.map} +0 -0
  295. /package/dist/{chunk-IL6POWCW.js.map → chunk-IM3QVF53.js.map} +0 -0
  296. /package/dist/{chunk-NJ4EOKMB.js.map → chunk-IRQY7IR5.js.map} +0 -0
  297. /package/dist/{chunk-3QCRBHCY.js.map → chunk-ISMV2QVG.js.map} +0 -0
  298. /package/dist/{chunk-HB3RFQSC.js.map → chunk-IY23KFNZ.js.map} +0 -0
  299. /package/dist/{chunk-6CRIV7DE.js.map → chunk-JBBSYJHP.js.map} +0 -0
  300. /package/dist/{chunk-MEFJPTZ4.js.map → chunk-JRBNCUNT.js.map} +0 -0
  301. /package/dist/{chunk-4VNQOLML.js.map → chunk-JVBO4SZL.js.map} +0 -0
  302. /package/dist/{chunk-I6GALP6E.js.map → chunk-JZWWLLVY.js.map} +0 -0
  303. /package/dist/{chunk-RYCTDFUX.js.map → chunk-KUIB4B5Q.js.map} +0 -0
  304. /package/dist/{chunk-HDQIIUPH.js.map → chunk-KUPKLSX5.js.map} +0 -0
  305. /package/dist/{chunk-5O3XF4DV.js.map → chunk-KWVJAOIN.js.map} +0 -0
  306. /package/dist/{chunk-3LQ2YKO4.js.map → chunk-LB6OH6K2.js.map} +0 -0
  307. /package/dist/{chunk-AUSTCW2X.js.map → chunk-LOF2W3JU.js.map} +0 -0
  308. /package/dist/{chunk-K5IMOGHB.js.map → chunk-M75ZZHSR.js.map} +0 -0
  309. /package/dist/{chunk-GTGPO5KW.js.map → chunk-MQ6WOPSY.js.map} +0 -0
  310. /package/dist/{chunk-4CTHCN4J.js.map → chunk-MTQPRQHB.js.map} +0 -0
  311. /package/dist/{chunk-UNFPPVNI.js.map → chunk-N55W7KUL.js.map} +0 -0
  312. /package/dist/{chunk-JKJOGPZN.js.map → chunk-N6WF5PKC.js.map} +0 -0
  313. /package/dist/{chunk-6T2SCQRU.js.map → chunk-O7WJ47EF.js.map} +0 -0
  314. /package/dist/{chunk-JIF24JPM.js.map → chunk-OF75ACKS.js.map} +0 -0
  315. /package/dist/{chunk-GKEWXIV5.js.map → chunk-ONTBCHCP.js.map} +0 -0
  316. /package/dist/{chunk-4JBYV75E.js.map → chunk-PK6QCH2C.js.map} +0 -0
  317. /package/dist/{chunk-6QTNZJBS.js.map → chunk-PT37L5DV.js.map} +0 -0
  318. /package/dist/{chunk-EVX47VBM.js.map → chunk-QDPZWTN2.js.map} +0 -0
  319. /package/dist/{chunk-QLWMEXCT.js.map → chunk-RDXW3OBQ.js.map} +0 -0
  320. /package/dist/{chunk-Q5VNKNE5.js.map → chunk-RM2XV574.js.map} +0 -0
  321. /package/dist/{chunk-ERJ7FU55.js.map → chunk-RND5ZPNP.js.map} +0 -0
  322. /package/dist/{chunk-JZUV47FZ.js.map → chunk-RTEK4C4I.js.map} +0 -0
  323. /package/dist/{chunk-5YOLBEQ6.js.map → chunk-S6Q37VGE.js.map} +0 -0
  324. /package/dist/{chunk-E5ZQT5KX.js.map → chunk-SMIRGMS7.js.map} +0 -0
  325. /package/dist/{chunk-EQO2UVP4.js.map → chunk-T6GU5PPZ.js.map} +0 -0
  326. /package/dist/{chunk-LXEXBTKL.js.map → chunk-TAGR72IR.js.map} +0 -0
  327. /package/dist/{chunk-YFXZEAYK.js.map → chunk-TOPYT5U5.js.map} +0 -0
  328. /package/dist/{chunk-MV43JSJF.js.map → chunk-UBNCR3YK.js.map} +0 -0
  329. /package/dist/{chunk-ZICD77GM.js.map → chunk-UC2ETWF3.js.map} +0 -0
  330. /package/dist/{chunk-XWZVFISC.js.map → chunk-UFEVO57O.js.map} +0 -0
  331. /package/dist/{chunk-NR5LT5RY.js.map → chunk-UNCOC7QH.js.map} +0 -0
  332. /package/dist/{chunk-R4ROFEYC.js.map → chunk-VAIS3SOM.js.map} +0 -0
  333. /package/dist/{chunk-VN3DBQAU.js.map → chunk-VCBHAE4R.js.map} +0 -0
  334. /package/dist/{chunk-M4CV6BRT.js.map → chunk-VEALDPHW.js.map} +0 -0
  335. /package/dist/{chunk-7DSTRQIJ.js.map → chunk-WEYZTLXN.js.map} +0 -0
  336. /package/dist/{chunk-CAF6WOK7.js.map → chunk-WNGGJWF7.js.map} +0 -0
  337. /package/dist/{chunk-IU6SNYX6.js.map → chunk-YJV2UZ7H.js.map} +0 -0
  338. /package/dist/{chunk-RZ5SVOYR.js.map → chunk-YTGDPCPW.js.map} +0 -0
  339. /package/dist/{classified-marker-CZKA6ITE.js.map → classified-marker-WQVIJAW2.js.map} +0 -0
  340. /package/dist/{collection-facade-TLWIPI76.js.map → collection-facade-MJXSC3Q6.js.map} +0 -0
  341. /package/dist/{computed-ZIQTYTDI.js.map → computed-DSMPXG2Y.js.map} +0 -0
  342. /package/dist/{delegation-W7ZV2322.js.map → cover-B5SJDHR3.js.map} +0 -0
  343. /package/dist/{dead-filter-ESOBZZP5.js.map → dead-filter-2A7IAJ3D.js.map} +0 -0
  344. /package/dist/{derive-H2BJTLUI.js.map → delegation-A5A75KQO.js.map} +0 -0
  345. /package/dist/{enclave-AP3I5W7O.js.map → derive-HJSMH7RA.js.map} +0 -0
  346. /package/dist/{executor-KGWTNEQD.js.map → enclave-7MW6ZGXW.js.map} +0 -0
  347. /package/dist/{executor-OVEXR6RT.js.map → executor-AXE4XMLT.js.map} +0 -0
  348. /package/dist/{executor-UNEH5ZYH.js.map → executor-KGNLJD6M.js.map} +0 -0
  349. /package/dist/{export-accessible-PCMXSUZS.js.map → executor-XGIS6CR7.js.map} +0 -0
  350. /package/dist/{extract-partition-SWHFSYJO.js.map → export-accessible-VVBJM3MM.js.map} +0 -0
  351. /package/dist/{find-N6345CNT.js.map → extract-partition-LGGBTQET.js.map} +0 -0
  352. /package/dist/{fanout-sidecar-A765THMX.js.map → fanout-sidecar-WDYQ77VB.js.map} +0 -0
  353. /package/dist/{issue-5OKB6I2R.js.map → find-YS6XWB46.js.map} +0 -0
  354. /package/dist/{ledger-GFBKVPV4.js.map → issue-LSR5PS6H.js.map} +0 -0
  355. /package/dist/{liberate-3VDOT4KO.js.map → ledger-33BC4TR7.js.map} +0 -0
  356. /package/dist/{link-set-Z7Q2ASFX.js.map → liberate-GBSAYLPJ.js.map} +0 -0
  357. /package/dist/{noydb-ZCJOYBDI.js.map → link-set-QK22TDEX.js.map} +0 -0
  358. /package/dist/{policy-Z3RUAIY2.js.map → noydb-MTUBMWFE.js.map} +0 -0
  359. /package/dist/{public-envelope-B4KNWVUA.js.map → policy-NAHB2TUT.js.map} +0 -0
  360. /package/dist/{post-register-JTH76BLY.js.map → post-register-JVTMJ6OW.js.map} +0 -0
  361. /package/dist/{register-VAHONCID.js.map → register-X462DNDM.js.map} +0 -0
  362. /package/dist/{registry-7MLVD3VO.js.map → registry-3XMCT7MQ.js.map} +0 -0
  363. /package/dist/{registry-EPKPD5SM.js.map → registry-KHD2I3M2.js.map} +0 -0
  364. /package/dist/{registry-P5T7PS2U.js.map → registry-NPOWJHC4.js.map} +0 -0
  365. /package/dist/{request-withdrawal-TI3A5WPS.js.map → request-withdrawal-U7K3JTMY.js.map} +0 -0
  366. /package/dist/{reveal-DIBHLUZX.js.map → reveal-LGBOM2BO.js.map} +0 -0
  367. /package/dist/{revoke-FDRD6GRW.js.map → revoke-OCWDSWRQ.js.map} +0 -0
  368. /package/dist/{seed-Q6M2IZFL.js.map → seed-PWK45HDF.js.map} +0 -0
  369. /package/dist/{signer-MUWEIUI6.js.map → signer-3YFBLZRN.js.map} +0 -0
  370. /package/dist/{stale-OSQ7J3AA.js.map → stale-FJED42DM.js.map} +0 -0
  371. /package/dist/{storage-MVFCGEQE.js.map → storage-W3GURVFU.js.map} +0 -0
  372. /package/dist/{store-coordination-provider-64OEZFGS.js.map → store-coordination-provider-APODTV4W.js.map} +0 -0
  373. /package/dist/{verify-ZASTRNPR.js.map → verify-26Y5GNMK.js.map} +0 -0
  374. /package/dist/{walk-SVNDIZ62.js.map → walk-XS3PKM6I.js.map} +0 -0
  375. /package/dist/{withdraw-accessible-WZIEVWSR.js.map → withdraw-accessible-Y3B2535F.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  readDirectoryConfig,
6
6
  readUserVisibility,
7
7
  saveUserEnvelope
8
- } from "./chunk-4JBYV75E.js";
8
+ } from "./chunk-PK6QCH2C.js";
9
9
  import {
10
10
  base64ToBuffer,
11
11
  bufferToBase64,
@@ -16,11 +16,11 @@ import {
16
16
  generateSalt,
17
17
  unwrapKey,
18
18
  wrapKey
19
- } from "./chunk-CIE2BASH.js";
19
+ } from "./chunk-HOONYZY2.js";
20
20
  import {
21
21
  NOYDB_FORMAT_VERSION,
22
22
  NOYDB_KEYRING_VERSION
23
- } from "./chunk-JNAI2HN2.js";
23
+ } from "./chunk-LSASLXGC.js";
24
24
  import {
25
25
  DirectoryDisabledError,
26
26
  InvalidKeyError,
@@ -32,7 +32,7 @@ import {
32
32
  PrivilegeEscalationError,
33
33
  USER_ENVELOPE_COLLECTION,
34
34
  ValidationError
35
- } from "./chunk-BIOUI4HL.js";
35
+ } from "./chunk-W2OG6JOL.js";
36
36
 
37
37
  // src/kernel/validation.ts
38
38
  var WeakPassphraseError = class extends NoydbError {
@@ -775,4 +775,4 @@ export {
775
775
  hasImportCapability,
776
776
  evaluateImportCapability
777
777
  };
778
- //# sourceMappingURL=chunk-J2ZX2XUV.js.map
778
+ //# sourceMappingURL=chunk-3SV2EPMN.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LookupHandle
3
- } from "./chunk-NJ4EOKMB.js";
3
+ } from "./chunk-IRQY7IR5.js";
4
4
 
5
5
  // src/via/lookup/active.ts
6
6
  function withLookup() {
@@ -33,4 +33,4 @@ function withLookup() {
33
33
  export {
34
34
  withLookup
35
35
  };
36
- //# sourceMappingURL=chunk-FUG4SFN3.js.map
36
+ //# sourceMappingURL=chunk-3U3FBR7O.js.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  liveRecordIsElevated
3
- } from "./chunk-PN2XMATY.js";
3
+ } from "./chunk-DRWBEDYO.js";
4
4
  import {
5
5
  isRewrappedUnder,
6
6
  openEnvelopeJson,
7
7
  rewrapEnvelope
8
- } from "./chunk-XDYREZWE.js";
8
+ } from "./chunk-DVUZMT2W.js";
9
9
  import {
10
10
  isTombstone,
11
11
  isTombstoneShape
12
- } from "./chunk-7DSTRQIJ.js";
12
+ } from "./chunk-WEYZTLXN.js";
13
13
  import {
14
14
  NOYDB_FORMAT_VERSION
15
- } from "./chunk-JNAI2HN2.js";
15
+ } from "./chunk-LSASLXGC.js";
16
16
  import {
17
17
  ReadOnlyAtInstantError
18
- } from "./chunk-BIOUI4HL.js";
18
+ } from "./chunk-W2OG6JOL.js";
19
19
 
20
20
  // src/with-commit/history/history.ts
21
21
  var HISTORY_COLLECTION = "_history";
@@ -330,4 +330,4 @@ export {
330
330
  VaultInstant,
331
331
  CollectionInstant
332
332
  };
333
- //# sourceMappingURL=chunk-VFUPHI2Z.js.map
333
+ //# sourceMappingURL=chunk-4BRCIYFG.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  assertTierAccess,
3
3
  dekKey
4
- } from "./chunk-ZICD77GM.js";
4
+ } from "./chunk-UC2ETWF3.js";
5
5
  import {
6
6
  liveRecordIsElevated,
7
7
  liveRecordTier
8
- } from "./chunk-PN2XMATY.js";
8
+ } from "./chunk-DRWBEDYO.js";
9
9
  import {
10
10
  openEnvelopeJson,
11
11
  writeEnvelopeBody
12
- } from "./chunk-XDYREZWE.js";
12
+ } from "./chunk-DVUZMT2W.js";
13
13
  import {
14
14
  base64ToBuffer,
15
15
  bufferToBase64,
@@ -21,10 +21,10 @@ import {
21
21
  sha256Hex,
22
22
  unwrapCek,
23
23
  wrapCek
24
- } from "./chunk-CIE2BASH.js";
24
+ } from "./chunk-HOONYZY2.js";
25
25
  import {
26
26
  NOYDB_FORMAT_VERSION
27
- } from "./chunk-JNAI2HN2.js";
27
+ } from "./chunk-LSASLXGC.js";
28
28
  import {
29
29
  BlobIntentPendingError,
30
30
  ConflictError,
@@ -33,7 +33,7 @@ import {
33
33
  TierNotGrantedError,
34
34
  UnsupportedTierCompositionError,
35
35
  ValidationError
36
- } from "./chunk-BIOUI4HL.js";
36
+ } from "./chunk-W2OG6JOL.js";
37
37
 
38
38
  // src/with-shape/blobs/mime-magic.ts
39
39
  function hex(s) {
@@ -2779,4 +2779,4 @@ export {
2779
2779
  DEFAULT_CHUNK_SIZE,
2780
2780
  BlobSet
2781
2781
  };
2782
- //# sourceMappingURL=chunk-SNZ6URZZ.js.map
2782
+ //# sourceMappingURL=chunk-5OI6BR4H.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OverlayIdMismatchError
3
- } from "./chunk-BIOUI4HL.js";
3
+ } from "./chunk-W2OG6JOL.js";
4
4
 
5
5
  // src/with-formula/overlay-views/virtual-collection.ts
6
6
  var OverlayedCollection = class {
@@ -206,4 +206,4 @@ var OverlayedCollection = class {
206
206
  export {
207
207
  OverlayedCollection
208
208
  };
209
- //# sourceMappingURL=chunk-B3HJYUOF.js.map
209
+ //# sourceMappingURL=chunk-5WZXVULX.js.map
@@ -4,10 +4,10 @@ import {
4
4
  persistUserVisibility,
5
5
  readUserVisibility,
6
6
  saveUserEnvelope
7
- } from "./chunk-4JBYV75E.js";
7
+ } from "./chunk-PK6QCH2C.js";
8
8
  import {
9
9
  PolicyDeniedError
10
- } from "./chunk-BIOUI4HL.js";
10
+ } from "./chunk-W2OG6JOL.js";
11
11
 
12
12
  // src/with-party/directory/user-envelope/api.ts
13
13
  var UserApi = class {
@@ -379,4 +379,4 @@ export {
379
379
  UserApi,
380
380
  createUserApi
381
381
  };
382
- //# sourceMappingURL=chunk-LASZKVMO.js.map
382
+ //# sourceMappingURL=chunk-6B4DYGWO.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NoydbError
3
- } from "./chunk-BIOUI4HL.js";
3
+ } from "./chunk-W2OG6JOL.js";
4
4
 
5
5
  // src/with-formula/computed/index.ts
6
6
  var ComputedFieldError = class extends NoydbError {
@@ -35,4 +35,4 @@ export {
35
35
  ComputedFieldError,
36
36
  evalComputedFields
37
37
  };
38
- //# sourceMappingURL=chunk-ZJ2AK4V7.js.map
38
+ //# sourceMappingURL=chunk-6HPG2YNX.js.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-LP7BEXCT.js";
6
6
  import {
7
7
  bufferToBase64
8
- } from "./chunk-CIE2BASH.js";
8
+ } from "./chunk-HOONYZY2.js";
9
9
 
10
10
  // src/kernel/enclave/classify/bidx.ts
11
11
  var subtle = globalThis.crypto.subtle;
@@ -66,4 +66,4 @@ export {
66
66
  mintBidxTag,
67
67
  computeBidxTarget
68
68
  };
69
- //# sourceMappingURL=chunk-5M5DVGV7.js.map
69
+ //# sourceMappingURL=chunk-6HY2X62D.js.map
@@ -2,7 +2,7 @@ import {
2
2
  IllegalTransitionError,
3
3
  RecordLockedError,
4
4
  ValidationError
5
- } from "./chunk-BIOUI4HL.js";
5
+ } from "./chunk-W2OG6JOL.js";
6
6
 
7
7
  // src/with-audit/guards/with-guard.ts
8
8
  function withGuard(strategy) {
@@ -120,4 +120,4 @@ export {
120
120
  immutableGuard,
121
121
  transitionGuard
122
122
  };
123
- //# sourceMappingURL=chunk-QRB7NAOJ.js.map
123
+ //# sourceMappingURL=chunk-6NQMXTYC.js.map
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  base64ToBuffer,
6
6
  bufferToBase64
7
- } from "./chunk-CIE2BASH.js";
7
+ } from "./chunk-HOONYZY2.js";
8
8
  import {
9
9
  SessionExpiredError,
10
10
  SessionNotFoundError,
11
11
  SessionPolicyError,
12
12
  ValidationError
13
- } from "./chunk-BIOUI4HL.js";
13
+ } from "./chunk-W2OG6JOL.js";
14
14
 
15
15
  // src/with-party/session/session.ts
16
16
  var subtle = globalThis.crypto.subtle;
@@ -364,4 +364,4 @@ export {
364
364
  clearDevUnlock,
365
365
  isDevUnlockActive
366
366
  };
367
- //# sourceMappingURL=chunk-RIX4V2TB.js.map
367
+ //# sourceMappingURL=chunk-6XE5TMPR.js.map
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  freezeAndDeleteClosure,
3
3
  randomId
4
- } from "./chunk-IU6SNYX6.js";
4
+ } from "./chunk-YJV2UZ7H.js";
5
5
  import {
6
6
  buildAccessibleBundle,
7
7
  resolveAccessibleCollections
8
- } from "./chunk-F64IRYG3.js";
8
+ } from "./chunk-GQNGCEP5.js";
9
9
  import {
10
10
  NOYDB_FORMAT_VERSION
11
- } from "./chunk-JNAI2HN2.js";
11
+ } from "./chunk-LSASLXGC.js";
12
12
  import {
13
13
  NoydbError
14
- } from "./chunk-BIOUI4HL.js";
14
+ } from "./chunk-W2OG6JOL.js";
15
15
 
16
16
  // src/with-audit/portability/request-withdrawal.ts
17
17
  var WITHDRAWAL_REQUESTS_COLLECTION = "_user_withdrawal_requests";
@@ -161,4 +161,4 @@ export {
161
161
  approveWithdrawal,
162
162
  rejectWithdrawal
163
163
  };
164
- //# sourceMappingURL=chunk-BDVFPG6Y.js.map
164
+ //# sourceMappingURL=chunk-7CI6CP7Z.js.map
@@ -1,32 +1,35 @@
1
+ import {
2
+ walkClosure
3
+ } from "./chunk-OF75ACKS.js";
1
4
  import {
2
5
  resolveManagedSecret
3
- } from "./chunk-3LQ2YKO4.js";
6
+ } from "./chunk-LB6OH6K2.js";
4
7
  import {
5
8
  parseExtractedPartitionBody,
6
9
  readPod,
7
10
  readPodHeader
8
- } from "./chunk-FHS2HQSH.js";
11
+ } from "./chunk-A7JJLVGH.js";
9
12
  import {
10
13
  createOwnerKeyring
11
- } from "./chunk-J2ZX2XUV.js";
14
+ } from "./chunk-3SV2EPMN.js";
12
15
  import {
13
16
  LedgerStore
14
- } from "./chunk-XWZVFISC.js";
17
+ } from "./chunk-UFEVO57O.js";
15
18
  import {
16
19
  LEDGER_COLLECTION
17
20
  } from "./chunk-I7FD46FF.js";
18
21
  import {
19
22
  openEnvelopeJson
20
- } from "./chunk-XDYREZWE.js";
23
+ } from "./chunk-DVUZMT2W.js";
21
24
  import {
22
25
  base64ToBuffer,
23
26
  wrapKey
24
- } from "./chunk-CIE2BASH.js";
27
+ } from "./chunk-HOONYZY2.js";
25
28
  import {
26
29
  AdoptionStateError,
27
30
  TransferSealError,
28
31
  ValidationError
29
- } from "./chunk-BIOUI4HL.js";
32
+ } from "./chunk-W2OG6JOL.js";
30
33
 
31
34
  // src/with-cargo/adopt-partition.ts
32
35
  async function unsealDeks(seal, transferKey) {
@@ -179,7 +182,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
179
182
  }
180
183
  }
181
184
  if (isManaged(opts)) {
182
- const { createNoydb } = await import("./noydb-ZCJOYBDI.js");
185
+ const { createNoydb } = await import("./noydb-MTUBMWFE.js");
183
186
  const db = await createNoydb({
184
187
  store,
185
188
  user: userId,
@@ -226,10 +229,60 @@ async function decryptExtractedPartition(bundleBytes, transferKey) {
226
229
  return out;
227
230
  }
228
231
 
232
+ // src/with-cargo/describe-extraction.ts
233
+ async function describeExtraction(vault, opts) {
234
+ const { closure, graph, danglingRefs } = await walkClosure(vault, opts);
235
+ const { name: vaultName, adapter } = vault._introspectState();
236
+ const encoder = new TextEncoder();
237
+ const byCollection = [];
238
+ const inaccessible = [];
239
+ let totalBytes = 0;
240
+ let totalRecords = 0;
241
+ for (const [collectionName, ids] of closure) {
242
+ let bytes = 0;
243
+ let oldestTs;
244
+ let newestTs;
245
+ let recordCount = 0;
246
+ for (const id of ids) {
247
+ const env = await adapter.get(vaultName, collectionName, id);
248
+ if (!env) {
249
+ inaccessible.push({ collection: collectionName, id });
250
+ continue;
251
+ }
252
+ recordCount++;
253
+ bytes += encoder.encode(JSON.stringify(env)).length;
254
+ const ts = env._ts;
255
+ if (oldestTs === void 0 || ts < oldestTs) oldestTs = ts;
256
+ if (newestTs === void 0 || ts > newestTs) newestTs = ts;
257
+ }
258
+ byCollection.push({
259
+ name: collectionName,
260
+ recordCount,
261
+ bytes,
262
+ // Spread conditionally — exactOptionalPropertyTypes forbids an
263
+ // explicit `undefined` on an optional property.
264
+ ...oldestTs !== void 0 ? { oldestTs } : {},
265
+ ...newestTs !== void 0 ? { newestTs } : {}
266
+ });
267
+ totalBytes += bytes;
268
+ totalRecords += recordCount;
269
+ }
270
+ byCollection.sort((a, b) => a.name.localeCompare(b.name));
271
+ return Object.freeze({
272
+ totalRecords,
273
+ totalBytes,
274
+ byCollection,
275
+ graph,
276
+ inaccessible,
277
+ danglingRefs
278
+ });
279
+ }
280
+
229
281
  export {
230
282
  unsealDeks,
231
283
  adoptPartition,
232
284
  createOwnerOnAdoptedPartition,
233
- decryptExtractedPartition
285
+ decryptExtractedPartition,
286
+ describeExtraction
234
287
  };
235
- //# sourceMappingURL=chunk-VLFCJYTL.js.map
288
+ //# sourceMappingURL=chunk-7O3AYBC7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-cargo/adopt-partition.ts","../src/with-cargo/decrypt-partition.ts","../src/with-cargo/describe-extraction.ts"],"sourcesContent":["/**\n * Partition adoption. Recipient side: verify an extracted bundle,\n * validate the transfer key, import the re-keyed collections into a\n * destination store, and record an `_meta/adoption` marker. The bundle\n * stays UNOWNED after adoption — `createOwnerOnAdoptedPartition`\n * mints the owner; the transfer seal is then destroyed.\n *\n * @module\n */\nimport { base64ToBuffer, wrapKey, type EnclaveKey } from '../kernel/enclave/index.js'\nimport { TransferSealError, AdoptionStateError, ValidationError } from '../kernel/errors.js'\nimport type { NoydbStore, VaultSnapshot, KeyringFile } from '../kernel/types.js'\nimport { createOwnerKeyring } from '../with-party/team/keyring.js'\nimport { resolveManagedSecret } from '../with-party/team/managed-passphrase.js'\nimport type { SealingKeyProvider } from '../with-party/team/managed-passphrase.js'\nimport type { ShamirRecoveryProvider } from '../with-party/team/shamir-recovery-provider.js'\nimport type { RecoveryEnrollmentInput } from '../with-party/team/rotate-recover.js'\nimport { LedgerStore } from '../with-commit/history/ledger/store.js'\nimport { LEDGER_COLLECTION } from '../with-commit/history/ledger/constants.js'\nimport type { TransferSealPayload } from '../with-pod/bundle.js'\nimport { readPodHeader, readPod, parseExtractedPartitionBody } from '../with-pod/bundle.js'\n\n/**\n * Reverse of `sealDeks`. Imports the transfer key, decrypts the\n * sealed `{ collection: base64(rawDEK) }` map (layout iv(12)‖ct‖tag), and\n * re-imports each DEK as an AES-GCM key. Throws `TransferSealError` on a\n * wrong key (AES-GCM auth-tag failure) or malformed payload.\n */\nexport async function unsealDeks(\n seal: TransferSealPayload,\n transferKey: Uint8Array,\n): Promise<Map<string, EnclaveKey>> {\n if (transferKey.byteLength !== 32) {\n throw new TransferSealError(\n `transfer key must be 32 bytes, got ${transferKey.byteLength}.`,\n )\n }\n const key = await crypto.subtle.importKey('raw', transferKey as BufferSource, 'AES-GCM', false, ['decrypt'])\n const raw = base64ToBuffer(seal.payload)\n let plaintext: ArrayBuffer\n try {\n plaintext = await crypto.subtle.decrypt(\n { name: 'AES-GCM', iv: raw.slice(0, 12) as BufferSource },\n key,\n raw.slice(12) as BufferSource,\n )\n } catch {\n throw new TransferSealError(\n 'transfer seal could not be opened — wrong transfer key (AES-GCM authentication failed).',\n )\n }\n let dekMap: Record<string, string>\n try {\n dekMap = JSON.parse(new TextDecoder().decode(plaintext)) as Record<string, string>\n } catch {\n throw new TransferSealError('transfer seal payload is not valid JSON after decryption.')\n }\n const deks = new Map<string, EnclaveKey>()\n for (const [collection, b64] of Object.entries(dekMap)) {\n // Extractable: the recipient must be able to re-wrap these under their\n // own KEK (AES-KW) at owner-creation. Matches generateDEK.\n const dek = await crypto.subtle.importKey('raw', base64ToBuffer(b64) as BufferSource, 'AES-GCM', true, ['encrypt', 'decrypt'])\n deks.set(collection, dek)\n }\n return deks\n}\n\nexport interface AdoptPartitionOptions {\n readonly transferKey: Uint8Array\n readonly destinationStore: NoydbStore\n readonly vaultName: string\n}\n\nexport interface AdoptPartitionResult {\n readonly vaultName: string\n readonly needsOwner: true\n readonly sealId: string\n}\n\nexport async function adoptPartition(\n bundleBytes: Uint8Array,\n opts: AdoptPartitionOptions,\n): Promise<AdoptPartitionResult> {\n const { transferKey, destinationStore, vaultName } = opts\n\n const header = readPodHeader(bundleBytes)\n if (header.bundleKind !== 'extracted-partition' || header.transferSeal === undefined) {\n throw new ValidationError(\n 'adoptPartition requires an extracted-partition bundle with a transfer seal. '\n + 'For ordinary backups use readPod + vault.load.',\n )\n }\n\n const { dumpJson } = await readPod(bundleBytes)\n const { dump, seal } = parseExtractedPartitionBody(dumpJson)\n\n // Validate the transfer key by unsealing in memory; throws\n // TransferSealError on mismatch. DEKs are discarded here — they stay\n // sealed at rest (in _meta/adoption) until owner-creation wraps them under the\n // recipient's KEK.\n await unsealDeks(seal, transferKey)\n\n // Single-occupancy per vaultName: an `_meta/adoption` marker already present\n // means this slot holds a partition (adopted-and-unowned, or already owned).\n // saveAll below would overwrite its data and replace the marker, stranding the\n // prior adoption's transfer seal. Refuse regardless of sealId — re-adopting the\n // SAME bundle is a redundant call, and adopting a DIFFERENT bundle here would\n // clobber the existing partition. Either way, pick a fresh vaultName.\n const existing = await destinationStore.get(vaultName, '_meta', 'adoption')\n if (existing) {\n const prior = JSON.parse(existing._data) as { sealId?: string }\n if (prior.sealId === seal.sealId) {\n throw new AdoptionStateError(\n `partition (sealId ${seal.sealId}) is already adopted into vault \"${vaultName}\".`,\n )\n }\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already holds an adopted partition (sealId ${prior.sealId}); `\n + `adopting a different partition (sealId ${seal.sealId}) here would overwrite it. `\n + `Adopt into a fresh vaultName instead.`,\n )\n }\n\n // The marker-only check above misses a worse case: a vaultName already in use\n // by an ORDINARY vault (createNoydb + openVault) carries no `_meta/adoption`,\n // yet `saveAll` below is destructive on SQL adapters (`DELETE FROM ... WHERE\n // vault = ?` followed by upsert) and would wipe the legitimate keyring +\n // data. Refuse adoption into ANY occupied slot — a fresh vaultName is the\n // documented precondition.\n const existingKeyring = await destinationStore.list(vaultName, '_keyring')\n if (existingKeyring.length > 0) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already holds a keyring (an unrelated owner exists at this slot); `\n + `adoptPartition requires a fresh vaultName to avoid destructive saveAll on SQL adapters.`,\n )\n }\n\n const backup = JSON.parse(dump) as { collections: VaultSnapshot; _internal?: VaultSnapshot }\n await destinationStore.saveAll(vaultName, backup.collections)\n\n // Import carried internal collections (e.g. _schemas from carrySchemas).\n // saveAll only writes data collections; _internal is written per-record.\n if (backup._internal) {\n for (const [collection, records] of Object.entries(backup._internal)) {\n for (const [id, envelope] of Object.entries(records)) {\n await destinationStore.put(vaultName, collection, id, envelope)\n }\n }\n }\n\n const adoptedAt = new Date().toISOString()\n const adoption = { sealId: seal.sealId, adoptedAt, needsOwner: true as const, transferSeal: seal }\n await destinationStore.put(vaultName, '_meta', 'adoption', {\n _noydb: 1, _v: 1, _ts: adoptedAt, _iv: '', _data: JSON.stringify(adoption),\n })\n\n return { vaultName, needsOwner: true, sealId: seal.sealId }\n}\n\nexport interface CreateOwnerResult {\n readonly vaultName: string\n readonly userId: string\n}\n\n/** Standard-mode owner: recipient supplies the passphrase. */\nexport interface CreateOwnerStandardOptions {\n readonly userId: string\n readonly passphrase: string\n readonly transferKey: Uint8Array\n}\n\n/**\n * Managed-mode owner: the passphrase is minted + sealed under\n * a `SealingKeyProvider` (e.g. an `at-*` OS keychain) so the partition\n * auto-unlocks on the recipient's device. Managed mode mandates a strong\n * (Shamir) recovery profile at creation, which needs the\n * `shamirRecovery` provider injected.\n */\nexport interface CreateOwnerManagedOptions {\n readonly userId: string\n readonly passphraseMode: 'managed'\n readonly sealingKey: SealingKeyProvider\n readonly recovery: ReadonlyArray<RecoveryEnrollmentInput>\n readonly shamirRecovery: ShamirRecoveryProvider\n readonly transferKey: Uint8Array\n}\n\nexport type CreateOwnerOptions = CreateOwnerStandardOptions | CreateOwnerManagedOptions\n\nfunction isManaged(o: CreateOwnerOptions): o is CreateOwnerManagedOptions {\n return 'passphraseMode' in o && o.passphraseMode === 'managed'\n}\n\n/**\n * Mint the first owner keyring on an adopted-but-unowned partition,\n * then destroy the transfer seal.\n *\n * Standard mode: the recipient supplies a passphrase. Managed mode: the\n * passphrase is minted + sealed under a `SealingKeyProvider` and a strong\n * (Shamir) recovery profile is enrolled — orchestrated via the existing\n * `openVaultAndEnrollRecovery` ceremony.\n *\n * Either way, reuses `createOwnerKeyring` to derive the KEK + write the base\n * keyring, then wraps the partition's DEKs (recovered from the seal) under that\n * KEK and re-persists the merged keyring file.\n *\n * Idempotent under retry: the seal is destroyed LAST (Stage D), after the\n * keyring (Stage A), the ledger transition (Stage B), and — in managed mode —\n * strong-recovery enrollment (Stage C). A failure in the fallible enrollment\n * step leaves the seal intact, and re-running with the same `userId` +\n * `transferKey` resumes from the first incomplete stage. (Multi-profile recovery\n * arrays may re-enroll an already-enrolled profile on retry; managed mode's\n * mandated single Shamir profile does not.)\n */\nexport async function createOwnerOnAdoptedPartition(\n store: NoydbStore,\n vaultName: string,\n opts: CreateOwnerOptions,\n): Promise<CreateOwnerResult> {\n const { userId, transferKey } = opts\n\n // Managed mode requires a strong (Shamir) recovery profile, validated BEFORE\n // any disk write — same gate as createNoydb.\n if (isManaged(opts) && !opts.recovery.some((r) => r.profile === 'shamir')) {\n throw new AdoptionStateError(\n 'managed-mode adoption requires at least one strong (shamir) recovery profile in '\n + '`recovery` — paper alone is not strong when there is no user passphrase to fall back on.',\n )\n }\n\n // 1. Verify adopted-unowned state.\n const adoptionEnv = await store.get(vaultName, '_meta', 'adoption')\n if (!adoptionEnv) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" is not an adopted partition (no _meta/adoption). `\n + `createOwnerOnAdoptedPartition only applies to vaults created via adoptPartition.`,\n )\n }\n const adoption = JSON.parse(adoptionEnv._data) as {\n sealId: string; adoptedAt: string; needsOwner?: boolean\n consumedAt?: string; transferSeal?: TransferSealPayload\n }\n if (adoption.consumedAt !== undefined || adoption.transferSeal === undefined) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already has an owner (transfer seal consumed at ${adoption.consumedAt}).`,\n )\n }\n\n // 2. Recover the partition DEKs from the seal (throws on wrong key) BEFORE\n // writing any keyring, so a bad transfer key leaves no trace. Always\n // validated, including when resuming a partial prior call.\n const partitionDeks = await unsealDeks(adoption.transferSeal, transferKey)\n\n // The ceremony below is split into stages so a failure in the fallible\n // managed-enrollment step (network/provider outage) leaves the call RETRYABLE\n // — the seal is destroyed only once everything durable is in place. Each stage\n // detects its own prior completion rather than relying on a single resume bit.\n\n // A keyring present for a DIFFERENT user (with the seal still unconsumed) is a\n // genuine second-owner attempt — refuse it. A same-user keyring is a resumed\n // partial call and is handled by the stage checks below.\n const existingKeyring = await store.get(vaultName, '_keyring', userId)\n const otherOwners = (await store.list(vaultName, '_keyring')).filter((u) => u !== userId)\n if (otherOwners.length > 0) {\n throw new AdoptionStateError(\n `vault \"${vaultName}\" already has a keyring for a different owner; cannot create owner \"${userId}\".`,\n )\n }\n\n // Stage A — mint the owner keyring + merge the partition DEKs. Considered done\n // only when the keyring already holds every partition DEK. createOwnerKeyring\n // overwrites (fresh KEK + fresh _users DEK), so re-running is safe ONLY while\n // no recovery has been enrolled yet — guaranteed here because enrollment\n // (Stage C) runs strictly after Stage A completes.\n const partitionCollections = [...partitionDeks.keys()]\n const priorDeks = existingKeyring ? (JSON.parse(existingKeyring._data) as KeyringFile).deks : {}\n const ownerMinted = existingKeyring !== null && partitionCollections.every((c) => c in priorDeks)\n if (!ownerMinted) {\n // Resolve the owner passphrase. Managed mode mints a random passphrase, seals\n // it under the provider, and persists _meta/sealed-passphrase (so the\n // partition auto-unlocks on the recipient's device); standard mode uses the\n // caller's passphrase. Idempotent under retry — resolveManagedSecret's reopen\n // arm reuses an already-sealed passphrase.\n const passphrase = isManaged(opts)\n ? await resolveManagedSecret(store, vaultName, opts.sealingKey)\n : opts.passphrase\n\n // Mint the owner keyring (KEK + _users DEK + canary, written to disk).\n const unlocked = await createOwnerKeyring(store, vaultName, userId, passphrase)\n\n // Merge the partition DEKs (wrapped under the new KEK) into the keyring.\n const env = await store.get(vaultName, '_keyring', userId)\n if (!env) throw new AdoptionStateError(`keyring write for \"${userId}\" did not persist`)\n const keyringFile = JSON.parse(env._data) as KeyringFile\n const kek = unlocked.kek\n if (!kek) throw new AdoptionStateError(`owner keyring for \"${userId}\" has no KEK to wrap partition DEKs under`)\n const mergedDeks: Record<string, string> = { ...keyringFile.deks }\n for (const [collection, dek] of partitionDeks) {\n mergedDeks[collection] = await wrapKey(dek, kek)\n }\n const mergedFile: KeyringFile = { ...keyringFile, deks: mergedDeks }\n await store.put(vaultName, '_keyring', userId, { ...env, _data: JSON.stringify(mergedFile) })\n }\n\n // Stage B — record the ownership transition on the carried\n // audit chain (carryLedger sealed the _ledger DEK). No-op without that DEK.\n // Idempotent: appended only if the closing `transfer-seal-consumed` entry is\n // absent, so a retry does not duplicate the pair.\n const ledgerDek = partitionDeks.get(LEDGER_COLLECTION)\n if (ledgerDek) {\n const ledger = new LedgerStore({\n adapter: store,\n vault: vaultName,\n encrypted: true,\n getDEK: async () => ledgerDek,\n actor: userId,\n })\n const creationReason = `creation-of-new-owner:${userId}`\n const consumedReason = `transfer-seal-consumed:${adoption.sealId}`\n // Gate each append on its own presence — a crash or store error strictly\n // between the two adjacent puts would otherwise re-append the first one\n // on retry. The pair is the audit record, not a single transaction.\n const recordedReasons = new Set((await ledger.loadAllEntries()).map((e) => e.reason))\n if (!recordedReasons.has(creationReason)) {\n await ledger.append({ op: 'lifecycle', collection: '', id: '', version: 0, actor: '', payloadHash: '', reason: creationReason })\n }\n if (!recordedReasons.has(consumedReason)) {\n await ledger.append({ op: 'lifecycle', collection: '', id: '', version: 0, actor: '', payloadHash: '', reason: consumedReason })\n }\n }\n\n // Stage C — Managed mode: enroll the mandatory strong recovery\n // by orchestrating the existing public ceremony. The partition is\n // now a managed-mode vault on disk (sealed passphrase + keyring), so we\n // open it as a normal client and let openVaultAndEnrollRecovery do the\n // gate-bypass + enroll + re-assert. Dynamic import keeps the Noydb class\n // out of the @noy-db/hub/bundle static graph. Runs BEFORE seal destruction\n // so a failure here leaves the seal intact and the call retryable.\n if (isManaged(opts)) {\n const { createNoydb } = await import('../kernel/noydb.js')\n const db = await createNoydb({\n store,\n user: userId,\n passphraseMode: 'managed',\n sealingKey: opts.sealingKey,\n shamirRecovery: opts.shamirRecovery,\n })\n await db.openVaultAndEnrollRecovery(vaultName, { recovery: opts.recovery })\n }\n\n // Stage D — Destroy the transfer seal LAST — the commit point. Everything\n // above is either idempotent or resumable, so the seal is only consumed\n // once the owner keyring (and, in managed mode, strong recovery) is\n // durably in place. Retain sealId + consumedAt for audit.\n const consumed = { sealId: adoption.sealId, adoptedAt: adoption.adoptedAt, consumedAt: new Date().toISOString() }\n await store.put(vaultName, '_meta', 'adoption', { ...adoptionEnv, _data: JSON.stringify(consumed) })\n\n return { vaultName, userId }\n}\n","/**\n * Read-side counterpart to `extractPartition`: decrypt an\n * extracted-partition bundle's records to plaintext using its transfer\n * key, WITHOUT adopting it into a vault. Used by an outward\n * orchestration layer's reconcile/merge and field-authority flows to\n * compare incoming records against a receiver. The transfer key validates the bundle\n * (wrong key throws).\n * @module\n */\nimport type { EncryptedEnvelope } from '../kernel/types.js'\nimport { openEnvelopeJson } from '../kernel/enclave/index.js'\nimport { readPodHeader, readPod, parseExtractedPartitionBody } from '../with-pod/bundle.js'\nimport { unsealDeks } from './adopt-partition.js'\n\n/** One decrypted record from an extracted-partition compartment. */\nexport interface DecryptedRecord {\n readonly id: string\n readonly record: Record<string, unknown>\n /** Source envelope write timestamp (ISO) — for last-write-wins merges. */\n readonly ts: string\n /** Source envelope version. */\n readonly version: number\n /** Provenance source id (FR-5). Present only when the source collection had provenance:true and a source was supplied on put. */\n readonly source?: string\n /** ISO-8601 timestamp the provenance source was recorded (FR-5). */\n readonly sourceTs?: string\n}\n\n/**\n * Decrypt every record of an extracted-partition bundle to plaintext,\n * grouped by collection. Throws if the bundle isn't an\n * extracted-partition or the transfer key is wrong.\n */\nexport async function decryptExtractedPartition(\n bundleBytes: Uint8Array,\n transferKey: Uint8Array,\n): Promise<Record<string, DecryptedRecord[]>> {\n const header = readPodHeader(bundleBytes)\n if (header.bundleKind !== 'extracted-partition' || header.transferSeal === undefined) {\n throw new Error('decryptExtractedPartition: bundle is not an extracted-partition.')\n }\n const { dumpJson } = await readPod(bundleBytes)\n const { dump, seal } = parseExtractedPartitionBody(dumpJson)\n const deks = await unsealDeks(seal, transferKey) // throws TransferSealError on wrong key\n const backup = JSON.parse(dump) as { collections: Record<string, Record<string, EncryptedEnvelope>> }\n const out: Record<string, DecryptedRecord[]> = {}\n for (const [collection, byId] of Object.entries(backup.collections)) {\n const dek = deks.get(collection)\n if (dek === undefined) continue // no DEK sealed for this collection — skip\n const recs: DecryptedRecord[] = []\n for (const [id, env] of Object.entries(byId)) {\n const plaintext = await openEnvelopeJson(env, dek)\n const body = JSON.parse(plaintext) as Record<string, unknown>\n recs.push({\n id,\n record: { ...body, id },\n ts: env._ts,\n version: env._v,\n ...(env._source !== undefined ? { source: env._source } : {}),\n ...(env._sourceTs !== undefined ? { sourceTs: env._sourceTs } : {}),\n })\n }\n out[collection] = recs\n }\n return out\n}\n","/**\n * Partition-extraction dry-run. Read-only preview of what an\n * `extractPartition` would move: record counts, byte totals, and the\n * timestamp span per collection — computed from raw encrypted\n * envelopes WITHOUT decrypting them. Writes nothing, mutates nothing.\n *\n * @module\n */\nimport type { Vault } from '../kernel/vault.js'\nimport { walkClosure, type WalkClosureOptions, type DanglingRefNotice } from './walk-closure.js'\n\nexport interface ExtractionPreview {\n readonly totalRecords: number\n /** Sum of serialized encrypted-envelope sizes (bytes). */\n readonly totalBytes: number\n readonly byCollection: ReadonlyArray<{\n readonly name: string\n readonly recordCount: number\n readonly bytes: number\n /** Earliest envelope `_ts` in this collection (lexicographic). */\n readonly oldestTs?: string\n readonly newestTs?: string\n }>\n readonly graph: { readonly depth: number; readonly cyclesDetected: boolean }\n /** Records the walk reached but whose envelope couldn't be read. */\n readonly inaccessible: ReadonlyArray<{ readonly collection: string; readonly id: string }>\n /**\n * #772: outbound FK edges whose referenced parent was excluded from the\n * closure (missing, or tier-elevated and therefore invisible) — mirrors\n * `ExtractPartitionResult.danglingRefs` (#759) so a preview/extract pair\n * gives the SAME signal. A parent excluded this way never appears in\n * `byCollection` at all; this is the only preview-time indicator.\n */\n readonly danglingRefs: ReadonlyArray<DanglingRefNotice>\n}\n\nexport async function describeExtraction(\n vault: Vault,\n opts: WalkClosureOptions,\n): Promise<ExtractionPreview> {\n const { closure, graph, danglingRefs } = await walkClosure(vault, opts)\n\n const { name: vaultName, adapter } = vault._introspectState()\n const encoder = new TextEncoder()\n\n const byCollection: Array<{\n name: string; recordCount: number; bytes: number; oldestTs?: string; newestTs?: string\n }> = []\n const inaccessible: Array<{ collection: string; id: string }> = []\n let totalBytes = 0\n let totalRecords = 0\n\n for (const [collectionName, ids] of closure) {\n let bytes = 0\n let oldestTs: string | undefined\n let newestTs: string | undefined\n let recordCount = 0\n\n for (const id of ids) {\n const env = await adapter.get(vaultName, collectionName, id)\n if (!env) {\n // Walk reached it (via decrypted list) but the raw store read\n // returned nothing — surface rather than miscount.\n inaccessible.push({ collection: collectionName, id })\n continue\n }\n recordCount++\n bytes += encoder.encode(JSON.stringify(env)).length\n const ts = env._ts\n if (oldestTs === undefined || ts < oldestTs) oldestTs = ts\n if (newestTs === undefined || ts > newestTs) newestTs = ts\n }\n\n byCollection.push({\n name: collectionName,\n recordCount,\n bytes,\n // Spread conditionally — exactOptionalPropertyTypes forbids an\n // explicit `undefined` on an optional property.\n ...(oldestTs !== undefined ? { oldestTs } : {}),\n ...(newestTs !== undefined ? { newestTs } : {}),\n })\n totalBytes += bytes\n totalRecords += recordCount\n }\n\n byCollection.sort((a, b) => a.name.localeCompare(b.name))\n\n return Object.freeze({\n totalRecords,\n totalBytes,\n byCollection,\n graph,\n inaccessible,\n danglingRefs,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,eAAsB,WACpB,MACA,aACkC;AAClC,MAAI,YAAY,eAAe,IAAI;AACjC,UAAM,IAAI;AAAA,MACR,sCAAsC,YAAY,UAAU;AAAA,IAC9D;AAAA,EACF;AACA,QAAM,MAAM,MAAM,OAAO,OAAO,UAAU,OAAO,aAA6B,WAAW,OAAO,CAAC,SAAS,CAAC;AAC3G,QAAM,MAAM,eAAe,KAAK,OAAO;AACvC,MAAI;AACJ,MAAI;AACF,gBAAY,MAAM,OAAO,OAAO;AAAA,MAC9B,EAAE,MAAM,WAAW,IAAI,IAAI,MAAM,GAAG,EAAE,EAAkB;AAAA,MACxD;AAAA,MACA,IAAI,MAAM,EAAE;AAAA,IACd;AAAA,EACF,QAAQ;AACN,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,IAAI,YAAY,EAAE,OAAO,SAAS,CAAC;AAAA,EACzD,QAAQ;AACN,UAAM,IAAI,kBAAkB,2DAA2D;AAAA,EACzF;AACA,QAAM,OAAO,oBAAI,IAAwB;AACzC,aAAW,CAAC,YAAY,GAAG,KAAK,OAAO,QAAQ,MAAM,GAAG;AAGtD,UAAM,MAAM,MAAM,OAAO,OAAO,UAAU,OAAO,eAAe,GAAG,GAAmB,WAAW,MAAM,CAAC,WAAW,SAAS,CAAC;AAC7H,SAAK,IAAI,YAAY,GAAG;AAAA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AAI,CAAC,KAAK;AAGR,qBAAa,KAAK,EAAE,YAAY,gBAAgB,GAAG,CAAC;AACpD;AAAA,MACF;AACA;AACA,eAAS,QAAQ,OAAO,KAAK,UAAU,GAAG,CAAC,EAAE;AAC7C,YAAM,KAAK,IAAI;AACf,UAAI,aAAa,UAAa,KAAK,SAAU,YAAW;AACxD,UAAI,aAAa,UAAa,KAAK,SAAU,YAAW;AAAA,IAC1D;AAEA,iBAAa,KAAK;AAAA,MAChB,MAAM;AAAA,MACN;AAAA,MACA;AAAA;AAAA;AAAA,MAGA,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,MAC7C,GAAI,aAAa,SAAY,EAAE,SAAS,IAAI,CAAC;AAAA,IAC/C,CAAC;AACD,kBAAc;AACd,oBAAgB;AAAA,EAClB;AAEA,eAAa,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,IAAI,CAAC;AAExD,SAAO,OAAO,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -1,6 +1,9 @@
1
+ import {
2
+ applyJoins
3
+ } from "./chunk-RA5VTXXG.js";
1
4
  import {
2
5
  reducerBuilder
3
- } from "./chunk-LXEXBTKL.js";
6
+ } from "./chunk-TAGR72IR.js";
4
7
  import {
5
8
  evaluateClause,
6
9
  hasFnClause,
@@ -10,168 +13,8 @@ import {
10
13
  CrossJoinSourceUnknownError,
11
14
  CrossJoinTooLargeError,
12
15
  DanglingReferenceError,
13
- FieldNotQueryableError,
14
- JoinTooLargeError
15
- } from "./chunk-BIOUI4HL.js";
16
-
17
- // src/kernel/query/join.ts
18
- var DEFAULT_JOIN_MAX_ROWS = 5e4;
19
- var JOIN_WARN_FRACTION = 0.8;
20
- function coerceRefKey(value) {
21
- if (value === null || value === void 0) return null;
22
- if (typeof value === "string") return value;
23
- if (typeof value === "number" || typeof value === "bigint") return String(value);
24
- return null;
25
- }
26
- var warnedDanglingKeys = /* @__PURE__ */ new Set();
27
- function warnOnceDangling(field, target, refId) {
28
- const key = `${field}\u2192${target}:${refId}`;
29
- if (warnedDanglingKeys.has(key)) return;
30
- warnedDanglingKeys.add(key);
31
- console.warn(
32
- `[noy-db] .join() encountered dangling ref in 'warn' mode: field "${field}" \u2192 "${target}:${refId}" not found. Attaching null.`
33
- );
34
- }
35
- var warnedCeilingKeys = /* @__PURE__ */ new Set();
36
- function warnCeilingApproaching(target, side, rows, maxRows) {
37
- const key = `${target}:${side}`;
38
- if (warnedCeilingKeys.has(key)) return;
39
- warnedCeilingKeys.add(key);
40
- const pct = Math.round(rows / maxRows * 100);
41
- console.warn(
42
- `[noy-db] .join() ${side} side is at ${pct}% of the ${maxRows}-row ceiling for target "${target}" (${rows} rows). Streaming joins over scan() are not yet supported for collections that need to exceed this.`
43
- );
44
- }
45
- function applyJoins(rows, joins, context, locale) {
46
- if (joins.length === 0) return [...rows];
47
- let result = [...rows];
48
- for (const leg of joins) {
49
- result = applyOneJoin(result, leg, context, locale);
50
- }
51
- return result;
52
- }
53
- function applyOneJoin(leftRows, leg, context, locale) {
54
- if (leg.isDictJoin) {
55
- const dictSource = context.resolveDictSource?.(leg.field);
56
- if (!dictSource) {
57
- throw new Error(
58
- `.join() field "${leg.field}" on "${context.leftCollection}" is declared as a dictKey join but the dict source could not be resolved. Ensure the dictionary has at least one entry.`
59
- );
60
- }
61
- const out = [];
62
- const snapshot = dictSource.snapshot();
63
- const dictMap = /* @__PURE__ */ new Map();
64
- for (const entry of snapshot) {
65
- const k = readPath(entry, "key");
66
- if (typeof k === "string") dictMap.set(k, entry);
67
- }
68
- for (const left of leftRows) {
69
- const rawId = readPath(left, leg.field);
70
- const key = coerceRefKey(rawId);
71
- const dictEntry = key === null ? void 0 : dictMap.get(key);
72
- out.push({ ...left, [leg.as]: dictEntry ?? null });
73
- }
74
- return out;
75
- }
76
- const source = context.resolveSource(leg.target);
77
- if (!source) {
78
- throw new Error(
79
- `.join() cannot resolve target collection "${leg.target}" (referenced from field "${leg.field}" on "${context.leftCollection}"). Make sure the target collection has been opened via vault.collection() at least once before running the query.`
80
- );
81
- }
82
- const maxRows = leg.maxRows ?? DEFAULT_JOIN_MAX_ROWS;
83
- if (leftRows.length > maxRows) {
84
- throw new JoinTooLargeError({
85
- leftRows: leftRows.length,
86
- rightRows: -1,
87
- maxRows,
88
- side: "left",
89
- message: `.join() left side has ${leftRows.length} rows, exceeding the ${maxRows}-row ceiling for target "${leg.target}". Filter the left side further with where()/limit() before joining, or raise the ceiling via { maxRows }. Streaming joins over scan() are not yet supported.`
90
- });
91
- }
92
- if (leftRows.length > maxRows * JOIN_WARN_FRACTION) {
93
- warnCeilingApproaching(leg.target, "left", leftRows.length, maxRows);
94
- }
95
- const rightSnapshot = source.snapshot();
96
- if (rightSnapshot.length > maxRows) {
97
- throw new JoinTooLargeError({
98
- leftRows: leftRows.length,
99
- rightRows: rightSnapshot.length,
100
- maxRows,
101
- side: "right",
102
- message: `.join() right side "${leg.target}" has ${rightSnapshot.length} rows, exceeding the ${maxRows}-row ceiling. Raise the ceiling via { maxRows } if the data genuinely fits in memory, or track for streaming joins.`
103
- });
104
- }
105
- if (rightSnapshot.length > maxRows * JOIN_WARN_FRACTION) {
106
- warnCeilingApproaching(leg.target, "right", rightSnapshot.length, maxRows);
107
- }
108
- const effLocale = locale ?? context.defaultLocale;
109
- const presentResolve = effLocale !== void 0 && source.presentForJoin !== void 0 ? (right) => right !== null && typeof right === "object" ? source.presentForJoin(right, effLocale) : right : void 0;
110
- const strategy = leg.strategy ?? (source.lookupById ? "nested" : "hash");
111
- if (strategy === "nested" && source.lookupById) {
112
- const lookup = (id) => source.lookupById?.(id);
113
- return nestedLoopJoin(leftRows, leg, lookup, presentResolve);
114
- }
115
- return hashJoin(leftRows, leg, rightSnapshot, presentResolve);
116
- }
117
- function nestedLoopJoin(leftRows, leg, lookupById, presentResolve) {
118
- const out = [];
119
- for (const left of leftRows) {
120
- const rawId = readPath(left, leg.field);
121
- const key = coerceRefKey(rawId);
122
- let right = key === null ? void 0 : lookupById(key);
123
- if (presentResolve && right !== void 0) right = presentResolve(right);
124
- out.push(attachJoin(left, leg, right, rawId));
125
- }
126
- return out;
127
- }
128
- function hashJoin(leftRows, leg, rightSnapshot, presentResolve) {
129
- const rightMap = /* @__PURE__ */ new Map();
130
- for (const record of rightSnapshot) {
131
- const rawId = readPath(record, "id");
132
- const key = coerceRefKey(rawId);
133
- if (key !== null) {
134
- rightMap.set(key, record);
135
- }
136
- }
137
- const out = [];
138
- for (const left of leftRows) {
139
- const rawId = readPath(left, leg.field);
140
- const key = coerceRefKey(rawId);
141
- let right = key === null ? void 0 : rightMap.get(key);
142
- if (presentResolve && right !== void 0) right = presentResolve(right);
143
- out.push(attachJoin(left, leg, right, rawId));
144
- }
145
- return out;
146
- }
147
- function attachJoin(left, leg, right, rawId) {
148
- if (left === null || typeof left !== "object") {
149
- return left;
150
- }
151
- const merged = { ...left };
152
- const refKey = coerceRefKey(rawId);
153
- if (right === void 0) {
154
- if (refKey !== null && leg.mode === "strict") {
155
- throw new DanglingReferenceError({
156
- field: leg.field,
157
- target: leg.target,
158
- refId: refKey,
159
- message: `.join() strict dangling: record references "${leg.target}:${refKey}" via field "${leg.field}", but no such record exists. Use ref() mode 'warn' or 'cascade' if dangling refs are acceptable, or run vault.checkIntegrity() to find and fix the orphans.`
160
- });
161
- }
162
- if (refKey !== null && leg.mode === "warn") {
163
- warnOnceDangling(leg.field, leg.target, refKey);
164
- }
165
- merged[leg.as] = null;
166
- } else {
167
- merged[leg.as] = right;
168
- }
169
- return merged;
170
- }
171
- function resetJoinWarnings() {
172
- warnedDanglingKeys.clear();
173
- warnedCeilingKeys.clear();
174
- }
16
+ FieldNotQueryableError
17
+ } from "./chunk-W2OG6JOL.js";
175
18
 
176
19
  // src/kernel/query/live.ts
177
20
  function buildLiveQuery(recompute, upstreams) {
@@ -1572,7 +1415,7 @@ var ScanBuilder = class _ScanBuilder {
1572
1415
  const map = /* @__PURE__ */ new Map();
1573
1416
  for (const record of source.snapshot()) {
1574
1417
  const rawId = readPath(record, "id");
1575
- const key = coerceRefKey2(rawId);
1418
+ const key = coerceRefKey(rawId);
1576
1419
  if (key !== null) map.set(key, record);
1577
1420
  }
1578
1421
  hashByPrimaryKey = map;
@@ -1605,7 +1448,7 @@ var ScanBuilder = class _ScanBuilder {
1605
1448
  }
1606
1449
  const { leg } = resolver;
1607
1450
  const rawId = readPath(left, leg.field);
1608
- const refKey = coerceRefKey2(rawId);
1451
+ const refKey = coerceRefKey(rawId);
1609
1452
  let right = void 0;
1610
1453
  if (refKey !== null) {
1611
1454
  if (resolver.lookupById !== null) {
@@ -1676,7 +1519,7 @@ var ScanBuilder = class _ScanBuilder {
1676
1519
  return true;
1677
1520
  }
1678
1521
  };
1679
- function coerceRefKey2(value) {
1522
+ function coerceRefKey(value) {
1680
1523
  if (value === null || value === void 0) return null;
1681
1524
  if (typeof value === "string") return value;
1682
1525
  if (typeof value === "number" || typeof value === "bigint") return String(value);
@@ -1684,9 +1527,6 @@ function coerceRefKey2(value) {
1684
1527
  }
1685
1528
 
1686
1529
  export {
1687
- DEFAULT_JOIN_MAX_ROWS,
1688
- applyJoins,
1689
- resetJoinWarnings,
1690
1530
  buildLiveQuery,
1691
1531
  NO_AGGREGATE,
1692
1532
  DEFAULT_CROSS_JOIN_MAX_ROWS,
@@ -1694,4 +1534,4 @@ export {
1694
1534
  executePlan,
1695
1535
  ScanBuilder
1696
1536
  };
1697
- //# sourceMappingURL=chunk-454JXE57.js.map
1537
+ //# sourceMappingURL=chunk-A5BDDEXK.js.map