@noy-db/hub 0.4.0-pre.0 → 0.4.0-pre.10

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 (611) hide show
  1. package/README.md +3 -4
  2. package/dist/api-ZDKTWNBB.js +20 -0
  3. package/dist/attestation/index.js +18 -18
  4. package/dist/{backup-YPUEKIJC.js → backup-2UX7PRM5.js} +13 -13
  5. package/dist/blobs/index.js +30 -15
  6. package/dist/blobs/index.js.map +1 -1
  7. package/dist/broker/index.js +12 -12
  8. package/dist/broker/index.js.map +1 -1
  9. package/dist/cargo/index.js +58 -29
  10. package/dist/{chunk-IY23KFNZ.js → chunk-35NMVJ7I.js} +3 -3
  11. package/dist/{chunk-S3BFKGET.js → chunk-3HUYRN24.js} +4 -4
  12. package/dist/chunk-3HUYRN24.js.map +1 -0
  13. package/dist/{walk-IPLXE36W.js → chunk-3V3XR4S4.js} +4 -13
  14. package/dist/{walk-IPLXE36W.js.map → chunk-3V3XR4S4.js.map} +1 -1
  15. package/dist/{chunk-RTEK4C4I.js → chunk-4JQK3L4V.js} +2 -2
  16. package/dist/{chunk-3ELCWU56.js → chunk-4ZKNC6A6.js} +2 -2
  17. package/dist/{chunk-VQNJ7UZL.js → chunk-55LKVALY.js} +106 -10
  18. package/dist/chunk-55LKVALY.js.map +1 -0
  19. package/dist/{chunk-VAIS3SOM.js → chunk-55LX6FSX.js} +2 -2
  20. package/dist/chunk-5D2ALSM5.js +19 -0
  21. package/dist/chunk-5D2ALSM5.js.map +1 -0
  22. package/dist/{chunk-6HPG2YNX.js → chunk-5DRROK5W.js} +2 -2
  23. package/dist/{chunk-S6Q37VGE.js → chunk-5GQEU4DN.js} +2 -2
  24. package/dist/chunk-5JOFWL4G.js +25 -0
  25. package/dist/chunk-5JOFWL4G.js.map +1 -0
  26. package/dist/{chunk-ZXEZCY6F.js → chunk-63FE525P.js} +6 -6
  27. package/dist/chunk-6LJY7X5A.js +18 -0
  28. package/dist/chunk-6LJY7X5A.js.map +1 -0
  29. package/dist/{chunk-JVBO4SZL.js → chunk-6UBZ6I5Z.js} +2 -2
  30. package/dist/{chunk-BOKIKJJB.js → chunk-6ZNSB3H6.js} +5 -17
  31. package/dist/chunk-6ZNSB3H6.js.map +1 -0
  32. package/dist/{chunk-IK43HLDQ.js → chunk-7YVBQJ7K.js} +13 -355
  33. package/dist/chunk-7YVBQJ7K.js.map +1 -0
  34. package/dist/{chunk-VRBTNCM4.js → chunk-ABS7FMMD.js} +6 -6
  35. package/dist/chunk-AFHQATY4.js +47 -0
  36. package/dist/chunk-AFHQATY4.js.map +1 -0
  37. package/dist/{chunk-HOONYZY2.js → chunk-AKKRXT23.js} +7 -7
  38. package/dist/chunk-AKKRXT23.js.map +1 -0
  39. package/dist/{chunk-DDHM2TLX.js → chunk-AT2JJEKJ.js} +4 -4
  40. package/dist/chunk-AT2JJEKJ.js.map +1 -0
  41. package/dist/{chunk-M75ZZHSR.js → chunk-BLBAQRBM.js} +2 -2
  42. package/dist/{chunk-554KLAAN.js → chunk-BLCWSJLN.js} +88 -81
  43. package/dist/chunk-BLCWSJLN.js.map +1 -0
  44. package/dist/chunk-CADUYBQD.js +151 -0
  45. package/dist/chunk-CADUYBQD.js.map +1 -0
  46. package/dist/{chunk-WOM2HTML.js → chunk-CI32CAFS.js} +5 -5
  47. package/dist/{chunk-FH52K7EG.js → chunk-CUZLNGD5.js} +2 -6
  48. package/dist/{chunk-FH52K7EG.js.map → chunk-CUZLNGD5.js.map} +1 -1
  49. package/dist/{chunk-U6JMEH2P.js → chunk-CXQW2NWO.js} +145 -3
  50. package/dist/chunk-CXQW2NWO.js.map +1 -0
  51. package/dist/{chunk-EO43ANYJ.js → chunk-DABACXEF.js} +3 -3
  52. package/dist/{chunk-CJ5KKU6X.js → chunk-DMH3VZU5.js} +4 -4
  53. package/dist/chunk-DSDXAKIP.js +50 -0
  54. package/dist/chunk-DSDXAKIP.js.map +1 -0
  55. package/dist/{chunk-WZSHL6DQ.js → chunk-DZ2JXHWK.js} +5 -5
  56. package/dist/chunk-DZFQVICS.js +23 -0
  57. package/dist/chunk-DZFQVICS.js.map +1 -0
  58. package/dist/chunk-E23UGFVC.js +63 -0
  59. package/dist/chunk-E23UGFVC.js.map +1 -0
  60. package/dist/{chunk-Z4PD65VQ.js → chunk-EE7UHLKH.js} +4 -4
  61. package/dist/chunk-EIPVYUEP.js +654 -0
  62. package/dist/chunk-EIPVYUEP.js.map +1 -0
  63. package/dist/{chunk-RNG4VRP4.js → chunk-EKRSCRNM.js} +3 -3
  64. package/dist/{chunk-YMUGBZN2.js → chunk-FQ5CHJR7.js} +1 -1
  65. package/dist/chunk-FQ5CHJR7.js.map +1 -0
  66. package/dist/{chunk-RFI7GGFO.js → chunk-FQZ6XTQ7.js} +17 -20
  67. package/dist/chunk-FQZ6XTQ7.js.map +1 -0
  68. package/dist/{chunk-MT62YSPZ.js → chunk-FRMPM7WG.js} +4 -4
  69. package/dist/{chunk-W4TCUGQR.js → chunk-G2JUIDFA.js} +13 -9
  70. package/dist/{chunk-W4TCUGQR.js.map → chunk-G2JUIDFA.js.map} +1 -1
  71. package/dist/{chunk-T3GY65MA.js → chunk-G6WWZNJP.js} +13 -13
  72. package/dist/chunk-G6WWZNJP.js.map +1 -0
  73. package/dist/chunk-GJW4HX2O.js +1 -0
  74. package/dist/{chunk-KS6SAVCZ.js → chunk-GU3IP74F.js} +6 -6
  75. package/dist/{chunk-UHNGNKLV.js → chunk-GWWOGNBK.js} +308 -18
  76. package/dist/chunk-GWWOGNBK.js.map +1 -0
  77. package/dist/{chunk-5PFOMHTB.js → chunk-H2GPHUZD.js} +12 -13
  78. package/dist/chunk-H2GPHUZD.js.map +1 -0
  79. package/dist/{chunk-H2KSZMIX.js → chunk-HMU5P6RL.js} +5 -5
  80. package/dist/chunk-HMU5P6RL.js.map +1 -0
  81. package/dist/{chunk-JFCV5QIK.js → chunk-I5GEJX3R.js} +5 -5
  82. package/dist/chunk-I5GEJX3R.js.map +1 -0
  83. package/dist/{chunk-GWKAVKHI.js → chunk-IG6KUWBX.js} +2 -2
  84. package/dist/chunk-IG6KUWBX.js.map +1 -0
  85. package/dist/{chunk-LVGTA624.js → chunk-IPUG56GJ.js} +15 -5
  86. package/dist/{chunk-LVGTA624.js.map → chunk-IPUG56GJ.js.map} +1 -1
  87. package/dist/{chunk-SMIRGMS7.js → chunk-IXNCZTWA.js} +2 -2
  88. package/dist/{chunk-WQIYTNJV.js → chunk-IXTSNGYY.js} +3 -3
  89. package/dist/{chunk-WHXXI3W5.js → chunk-IYZISPGD.js} +7 -5
  90. package/dist/chunk-IYZISPGD.js.map +1 -0
  91. package/dist/{chunk-HQBM64EE.js → chunk-JDOMW53O.js} +145 -16
  92. package/dist/chunk-JDOMW53O.js.map +1 -0
  93. package/dist/{chunk-NCCBLYEB.js → chunk-JJZGIE4U.js} +6 -5
  94. package/dist/{chunk-DRWBEDYO.js → chunk-JYJFGD2H.js} +2 -2
  95. package/dist/{chunk-TAGR72IR.js → chunk-KRCBZYTZ.js} +26 -177
  96. package/dist/chunk-KRCBZYTZ.js.map +1 -0
  97. package/dist/{chunk-DSBQODMZ.js → chunk-L2DGWBCT.js} +14 -14
  98. package/dist/chunk-L2DGWBCT.js.map +1 -0
  99. package/dist/{chunk-VEALDPHW.js → chunk-L3YYLT4E.js} +15 -2
  100. package/dist/chunk-L3YYLT4E.js.map +1 -0
  101. package/dist/{chunk-FXZDAV62.js → chunk-LNPUSMZL.js} +29 -31
  102. package/dist/chunk-LNPUSMZL.js.map +1 -0
  103. package/dist/{chunk-XJMBYYQK.js → chunk-LNZKOUJR.js} +2 -2
  104. package/dist/{chunk-R3BLCFD2.js → chunk-MBKVNOJS.js} +6 -6
  105. package/dist/chunk-MCHBCNCE.js +367 -0
  106. package/dist/chunk-MCHBCNCE.js.map +1 -0
  107. package/dist/{chunk-VCBHAE4R.js → chunk-MHMLXJ3I.js} +2 -2
  108. package/dist/chunk-MHMLXJ3I.js.map +1 -0
  109. package/dist/{chunk-WNGGJWF7.js → chunk-MSMJJB4J.js} +2 -2
  110. package/dist/chunk-MSMJJB4J.js.map +1 -0
  111. package/dist/{chunk-T36RFODW.js → chunk-MXUT7FTE.js} +2 -2
  112. package/dist/chunk-MXUT7FTE.js.map +1 -0
  113. package/dist/{chunk-WG4QBZDN.js → chunk-N4BBNYIB.js} +11 -9
  114. package/dist/chunk-N4BBNYIB.js.map +1 -0
  115. package/dist/{chunk-PK6JIDQ4.js → chunk-NFIBXF4V.js} +1084 -1583
  116. package/dist/chunk-NFIBXF4V.js.map +1 -0
  117. package/dist/{chunk-VKCADNMR.js → chunk-NFNJLRY7.js} +368 -52
  118. package/dist/chunk-NFNJLRY7.js.map +1 -0
  119. package/dist/{chunk-N6WF5PKC.js → chunk-NFZGZ4AK.js} +2 -2
  120. package/dist/{chunk-JRBNCUNT.js → chunk-NGSJZFGL.js} +21 -4
  121. package/dist/chunk-NGSJZFGL.js.map +1 -0
  122. package/dist/chunk-NJ4DYYO5.js +81 -0
  123. package/dist/chunk-NJ4DYYO5.js.map +1 -0
  124. package/dist/chunk-NM5UYF6Q.js +24 -0
  125. package/dist/chunk-NM5UYF6Q.js.map +1 -0
  126. package/dist/{chunk-JBBSYJHP.js → chunk-NYEFP7DY.js} +4 -4
  127. package/dist/chunk-NYEFP7DY.js.map +1 -0
  128. package/dist/{chunk-GDG5VVYG.js → chunk-NZ24MX4J.js} +8 -46
  129. package/dist/chunk-NZ24MX4J.js.map +1 -0
  130. package/dist/{chunk-IFJTPAQQ.js → chunk-OLEPKFTW.js} +4 -4
  131. package/dist/chunk-OLEPKFTW.js.map +1 -0
  132. package/dist/{chunk-THVIPWRF.js → chunk-PEATRIYJ.js} +9 -9
  133. package/dist/chunk-PEOZ34EM.js +13 -0
  134. package/dist/chunk-PEOZ34EM.js.map +1 -0
  135. package/dist/{chunk-UC2ETWF3.js → chunk-PTHKZWEH.js} +2 -14
  136. package/dist/{chunk-UC2ETWF3.js.map → chunk-PTHKZWEH.js.map} +1 -1
  137. package/dist/chunk-PVEWA2DU.js +23 -0
  138. package/dist/chunk-PVEWA2DU.js.map +1 -0
  139. package/dist/{chunk-VCTXU4AT.js → chunk-QBAC3GXA.js} +1 -1
  140. package/dist/chunk-QBAC3GXA.js.map +1 -0
  141. package/dist/{chunk-RDXW3OBQ.js → chunk-QD46HPZG.js} +2 -2
  142. package/dist/chunk-QD46HPZG.js.map +1 -0
  143. package/dist/{chunk-YZQOGE2L.js → chunk-QDIH2744.js} +2 -2
  144. package/dist/{chunk-6HY2X62D.js → chunk-QJNCB5SK.js} +2 -2
  145. package/dist/{chunk-IAO54J4R.js → chunk-QX76XVQH.js} +6 -6
  146. package/dist/chunk-QX76XVQH.js.map +1 -0
  147. package/dist/{chunk-W2OG6JOL.js → chunk-QZWTRENR.js} +24 -7
  148. package/dist/chunk-QZWTRENR.js.map +1 -0
  149. package/dist/{chunk-6NQMXTYC.js → chunk-RO5NM6UI.js} +2 -2
  150. package/dist/chunk-RO5NM6UI.js.map +1 -0
  151. package/dist/chunk-SGDPRCC4.js +1075 -0
  152. package/dist/chunk-SGDPRCC4.js.map +1 -0
  153. package/dist/{chunk-2PCAVW2I.js → chunk-SHEEBRZ4.js} +2 -2
  154. package/dist/chunk-SMY5X46Z.js +14 -0
  155. package/dist/chunk-SMY5X46Z.js.map +1 -0
  156. package/dist/{chunk-ISMV2QVG.js → chunk-TG634KCO.js} +11 -2
  157. package/dist/chunk-TG634KCO.js.map +1 -0
  158. package/dist/{chunk-XUW3PXHU.js → chunk-TUXQSFHZ.js} +4 -16
  159. package/dist/{chunk-XUW3PXHU.js.map → chunk-TUXQSFHZ.js.map} +1 -1
  160. package/dist/{chunk-GULTLPFB.js → chunk-UADPR6F4.js} +3 -3
  161. package/dist/{chunk-GULTLPFB.js.map → chunk-UADPR6F4.js.map} +1 -1
  162. package/dist/{chunk-XTHCN77N.js → chunk-UDHBXYGG.js} +29 -19
  163. package/dist/chunk-UDHBXYGG.js.map +1 -0
  164. package/dist/{chunk-RA5VTXXG.js → chunk-V6UQZA2H.js} +2 -2
  165. package/dist/chunk-VG2ZSFYD.js +32 -0
  166. package/dist/chunk-VG2ZSFYD.js.map +1 -0
  167. package/dist/chunk-VKQCVU2Z.js +21 -0
  168. package/dist/chunk-VKQCVU2Z.js.map +1 -0
  169. package/dist/{chunk-QDPZWTN2.js → chunk-W3G5REIU.js} +2 -2
  170. package/dist/{chunk-A4FXFAKF.js → chunk-W3L64Y3J.js} +2 -2
  171. package/dist/{chunk-ONTBCHCP.js → chunk-W66AM5IB.js} +2 -2
  172. package/dist/chunk-W66AM5IB.js.map +1 -0
  173. package/dist/{chunk-A5BDDEXK.js → chunk-WBKZUO5V.js} +26 -43
  174. package/dist/chunk-WBKZUO5V.js.map +1 -0
  175. package/dist/{chunk-XDIAFPUM.js → chunk-WLXMTYGO.js} +2 -2
  176. package/dist/{chunk-RJ6K6K5M.js → chunk-X3F5YJG2.js} +2 -2
  177. package/dist/{chunk-WKGF2TJR.js → chunk-X45JYIAY.js} +3 -3
  178. package/dist/chunk-X45JYIAY.js.map +1 -0
  179. package/dist/{chunk-6XE5TMPR.js → chunk-X4MVWPHV.js} +3 -3
  180. package/dist/chunk-X4MVWPHV.js.map +1 -0
  181. package/dist/chunk-XZHEOSQ2.js +16 -0
  182. package/dist/chunk-XZHEOSQ2.js.map +1 -0
  183. package/dist/chunk-Y2NBBT6K.js +18 -0
  184. package/dist/chunk-Y2NBBT6K.js.map +1 -0
  185. package/dist/{chunk-CZTLE22N.js → chunk-Y2NJBNX3.js} +8 -8
  186. package/dist/{chunk-CZTLE22N.js.map → chunk-Y2NJBNX3.js.map} +1 -1
  187. package/dist/{chunk-YTGDPCPW.js → chunk-Y6B6HVKC.js} +2 -2
  188. package/dist/chunk-YMUFFJCO.js +23 -0
  189. package/dist/chunk-YMUFFJCO.js.map +1 -0
  190. package/dist/{chunk-SV6EAJEP.js → chunk-YWWQM7KP.js} +5 -14
  191. package/dist/chunk-YWWQM7KP.js.map +1 -0
  192. package/dist/{chunk-UDSR4X4L.js → chunk-YZJSJOUI.js} +239 -16
  193. package/dist/chunk-YZJSJOUI.js.map +1 -0
  194. package/dist/{chunk-5WZXVULX.js → chunk-ZTLOXFPB.js} +2 -2
  195. package/dist/chunk-ZTLOXFPB.js.map +1 -0
  196. package/dist/classified/index.js +5 -5
  197. package/dist/{classified-marker-QWMASIT7.js → classified-marker-7PKJBFCG.js} +3 -3
  198. package/dist/collection-facade-6I5K5IOD.js +45 -0
  199. package/dist/{computed-DSMPXG2Y.js → computed-AB45PS4V.js} +3 -3
  200. package/dist/consent/index.js +13 -9
  201. package/dist/consent/index.js.map +1 -1
  202. package/dist/cover/index.js +37 -0
  203. package/dist/crdt/index.js +4 -0
  204. package/dist/crdt/index.js.map +1 -1
  205. package/dist/custody/index.js +26 -0
  206. package/dist/{dead-filter-66VGI6JV.js → dead-filter-FL3WIUZS.js} +2 -2
  207. package/dist/{chunk-OCVM6KDH.js → delegation-QXZ4MPPH.js} +12 -6
  208. package/dist/{chunk-OCVM6KDH.js.map → delegation-QXZ4MPPH.js.map} +1 -1
  209. package/dist/derivations/index.js +12 -12
  210. package/dist/derive-VGS7FKE3.js +22 -0
  211. package/dist/directory/index.js +46 -0
  212. package/dist/dispatch-EGGC7UD7.js +72 -0
  213. package/dist/dispatch-EGGC7UD7.js.map +1 -0
  214. package/dist/dispatch-GDSTUTVP.js +194 -0
  215. package/dist/dispatch-GDSTUTVP.js.map +1 -0
  216. package/dist/{enclave-TKPN2G2U.js → enclave-SPEEDYZ4.js} +13 -11
  217. package/dist/executor-IEBLTBCW.js +9 -0
  218. package/dist/executor-OTF556PL.js +28 -0
  219. package/dist/executor-RM7XWQDU.js +9 -0
  220. package/dist/export-accessible-P42BQ4PB.js +23 -0
  221. package/dist/extract-partition-TCYXRWBN.js +38 -0
  222. package/dist/{fanout-sidecar-B5LVUMQX.js → fanout-sidecar-SSMRSC2L.js} +9 -9
  223. package/dist/find-OZMTRIK3.js +11 -0
  224. package/dist/forget/index.js +11 -11
  225. package/dist/forget/index.js.map +1 -1
  226. package/dist/guards/index.js +4 -4
  227. package/dist/history/index.js +16 -12
  228. package/dist/history/index.js.map +1 -1
  229. package/dist/i18n/index.js +16 -14
  230. package/dist/i18n/index.js.map +1 -1
  231. package/dist/index.d.ts +42 -42
  232. package/dist/index.js +332 -2106
  233. package/dist/index.js.map +1 -1
  234. package/dist/indexing/index.js +4 -2
  235. package/dist/indexing/index.js.map +1 -1
  236. package/dist/introspection/index.js +28 -0
  237. package/dist/issue-FCKN5O6C.js +19 -0
  238. package/dist/kernel/best-effort-revert.d.ts +9 -1
  239. package/dist/kernel/collection-config.d.ts +12 -70
  240. package/dist/kernel/collection.d.ts +11 -23
  241. package/dist/kernel/enclave/crypto.d.ts +8 -8
  242. package/dist/kernel/enclave/index.d.ts +4 -4
  243. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +8 -0
  244. package/dist/kernel/errors.d.ts +41 -22
  245. package/dist/kernel/lazy.d.ts +30 -0
  246. package/dist/kernel/noydb.d.ts +81 -124
  247. package/dist/kernel/query/builder.d.ts +10 -10
  248. package/dist/kernel/query/index.d.ts +0 -6
  249. package/dist/kernel/query/scan-builder.d.ts +4 -4
  250. package/dist/kernel/sync-policy.d.ts +76 -4
  251. package/dist/kernel/types.d.ts +187 -86
  252. package/dist/kernel/validation.d.ts +33 -33
  253. package/dist/kernel/vault.d.ts +41 -229
  254. package/dist/kernel/via/dispatch.d.ts +7 -0
  255. package/dist/{ledger-PTK7XZYT.js → ledger-6XBEVWYP.js} +11 -11
  256. package/dist/liberate-CYUOS4NC.js +24 -0
  257. package/dist/{link-set-SLJHDNRB.js → link-set-NK6L2A5S.js} +11 -11
  258. package/dist/materialized-views/index.js +22 -19
  259. package/dist/money/index.js +31 -0
  260. package/dist/noydb-FZZIMLCI.js +81 -0
  261. package/dist/overlay-views/index.js +4 -4
  262. package/dist/periods/index.js +21 -17
  263. package/dist/pod/index.js +26 -12
  264. package/dist/{policy-YDLCOX4P.js → policy/index.js} +6 -6
  265. package/dist/port/with/archive-strategy.d.ts +31 -0
  266. package/dist/port/with/blob-strategy.d.ts +15 -5
  267. package/dist/port/with/collection-options.d.ts +171 -0
  268. package/dist/port/with/collection-registries.d.ts +62 -0
  269. package/dist/port/with/strategies.d.ts +134 -0
  270. package/dist/port/with/team-strategy.d.ts +3 -2
  271. package/dist/portability/index.js +8 -8
  272. package/dist/{post-register-2YHSADFI.js → post-register-VFIYISUK.js} +6 -6
  273. package/dist/query/index.js +6 -46
  274. package/dist/{aggregate → reduce}/index.js +24 -17
  275. package/dist/reduce/index.js.map +1 -0
  276. package/dist/register-UKU2J6MN.js +25 -0
  277. package/dist/registry-2VCWVHZS.js +19 -0
  278. package/dist/registry-7Y5WF7GS.js +9 -0
  279. package/dist/{registry-VW6P6A3J.js → registry-BWD2ED52.js} +2 -2
  280. package/dist/registry-DTWRJLSF.js +18 -0
  281. package/dist/request-withdrawal-JYDZ5XY2.js +31 -0
  282. package/dist/{reveal-HWO4YMTJ.js → reveal-CL2BCW6A.js} +6 -6
  283. package/dist/revoke-2TSAD2T4.js +24 -0
  284. package/dist/satellites/index.js +1 -1
  285. package/dist/schema-update/index.js +26 -0
  286. package/dist/sealed-record/index.js +12 -12
  287. package/dist/search/index.js +36 -0
  288. package/dist/{seed-3ZMF5EQA.js → seed-NUVJEL7T.js} +12 -12
  289. package/dist/seed-NUVJEL7T.js.map +1 -0
  290. package/dist/sequence/index.js +30 -0
  291. package/dist/session/index.js +13 -9
  292. package/dist/session/index.js.map +1 -1
  293. package/dist/shadow/index.js +6 -2
  294. package/dist/shadow/index.js.map +1 -1
  295. package/dist/share-link/index.d.ts +19 -0
  296. package/dist/share-link/index.js +201 -0
  297. package/dist/share-link/index.js.map +1 -0
  298. package/dist/share-link/share-link.d.ts +123 -0
  299. package/dist/signer-K7Z2EOMG.js +25 -0
  300. package/dist/snapshots/index.js +14 -10
  301. package/dist/snapshots/index.js.map +1 -1
  302. package/dist/{stale-VZL4OGUB.js → stale-A4J26OIC.js} +11 -10
  303. package/dist/storage-YVHZUISN.js +23 -0
  304. package/dist/store/index.js +22 -0
  305. package/dist/{store-coordination-provider-FKX3F6TQ.js → store-coordination-provider-EWRZL7XF.js} +3 -3
  306. package/dist/sync/index.js +15 -11
  307. package/dist/sync/index.js.map +1 -1
  308. package/dist/team/index.js +33 -47
  309. package/dist/tiers/index.js +10 -10
  310. package/dist/to/index.js +1 -1
  311. package/dist/{tx → transactions}/index.js +7 -3
  312. package/dist/transactions/index.js.map +1 -0
  313. package/dist/util/index.js +1 -1
  314. package/dist/{verify-26Y5GNMK.js → verify-7XWHJWUN.js} +5 -5
  315. package/dist/via/blob/active.d.ts +23 -7
  316. package/dist/via/blob/binding.d.ts +1 -1
  317. package/dist/via/blob/index.d.ts +7 -1
  318. package/dist/via/i18n/core.d.ts +1 -1
  319. package/dist/via/i18n/index.d.ts +2 -0
  320. package/dist/via/money/money-reducer.d.ts +2 -2
  321. package/dist/walk-P5D6CF4V.js +21 -0
  322. package/dist/with-audit/consent/index.d.ts +2 -0
  323. package/dist/with-audit/forget/active.d.ts +3 -3
  324. package/dist/with-audit/forget/index.d.ts +6 -5
  325. package/dist/with-audit/forget/strategy.d.ts +3 -3
  326. package/dist/with-audit/guards/executor.d.ts +4 -4
  327. package/dist/with-audit/guards/immutable-guard.d.ts +3 -3
  328. package/dist/with-audit/guards/index.d.ts +1 -1
  329. package/dist/with-audit/guards/registry.d.ts +3 -3
  330. package/dist/with-audit/guards/transition-guard.d.ts +3 -3
  331. package/dist/with-audit/guards/types.d.ts +10 -10
  332. package/dist/with-audit/guards/with-guard.d.ts +2 -2
  333. package/dist/with-audit/periods/index.d.ts +2 -0
  334. package/dist/with-audit/periods/periods.d.ts +1 -16
  335. package/dist/with-audit/periods/vault-facade.d.ts +6 -0
  336. package/dist/with-audit/periods/window.d.ts +16 -0
  337. package/dist/with-audit/portability/export-accessible.d.ts +4 -4
  338. package/dist/with-audit/portability/request-withdrawal.d.ts +3 -3
  339. package/dist/with-audit/portability/withdraw-accessible.d.ts +2 -2
  340. package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
  341. package/dist/with-audit/tiers/index.d.ts +1 -0
  342. package/dist/with-cargo/adopt-partition.d.ts +7 -7
  343. package/dist/{legacy/kernel.d.ts → with-cargo/floor.d.ts} +4 -4
  344. package/dist/with-cargo/index.d.ts +15 -2
  345. package/dist/with-commit/crdt/index.d.ts +2 -0
  346. package/dist/with-commit/history/index.d.ts +2 -0
  347. package/dist/with-commit/history/time-machine.d.ts +2 -2
  348. package/dist/with-commit/numbering/descriptor.d.ts +16 -6
  349. package/dist/with-commit/tx/active.d.ts +5 -5
  350. package/dist/with-commit/tx/index.d.ts +2 -2
  351. package/dist/with-commit/tx/invariants.d.ts +1 -1
  352. package/dist/with-commit/tx/strategy.d.ts +3 -3
  353. package/dist/with-fork/shadow/index.d.ts +2 -0
  354. package/dist/with-fork/snapshots/active.d.ts +2 -2
  355. package/dist/with-fork/snapshots/index.d.ts +3 -1
  356. package/dist/with-fork/snapshots/noydb-facade.d.ts +3 -3
  357. package/dist/with-fork/snapshots/strategy.d.ts +2 -2
  358. package/dist/with-formula/derivations/dispatch.d.ts +98 -0
  359. package/dist/with-formula/derivations/executor.d.ts +2 -2
  360. package/dist/with-formula/derivations/index.d.ts +4 -1
  361. package/dist/with-formula/derivations/registry.d.ts +3 -3
  362. package/dist/with-formula/derivations/stale.d.ts +2 -2
  363. package/dist/with-formula/derivations/types.d.ts +3 -3
  364. package/dist/with-formula/derivations/with-derivation.d.ts +2 -2
  365. package/dist/with-formula/derivations/with-rollup.d.ts +15 -8
  366. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +3 -3
  367. package/dist/with-formula/materialized-views/dispatch.d.ts +75 -0
  368. package/dist/with-formula/materialized-views/index.d.ts +2 -1
  369. package/dist/with-formula/materialized-views/registry.d.ts +4 -4
  370. package/dist/with-formula/materialized-views/types.d.ts +11 -11
  371. package/dist/with-formula/materialized-views/with-materialized-view.d.ts +2 -2
  372. package/dist/with-formula/overlay-views/index.d.ts +1 -1
  373. package/dist/with-formula/overlay-views/registry.d.ts +4 -4
  374. package/dist/with-formula/overlay-views/types.d.ts +3 -3
  375. package/dist/with-formula/overlay-views/virtual-collection.d.ts +2 -2
  376. package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +2 -2
  377. package/dist/with-lookup/indexing/active.d.ts +5 -5
  378. package/dist/with-lookup/indexing/index.d.ts +3 -1
  379. package/dist/with-lookup/indexing/strategy.d.ts +3 -3
  380. package/dist/with-lookup/{aggregate → reduce}/active.d.ts +8 -8
  381. package/dist/with-lookup/{aggregate → reduce}/groupby.d.ts +21 -21
  382. package/dist/with-lookup/reduce/index.d.ts +34 -0
  383. package/dist/with-lookup/{aggregate → reduce}/reducers.d.ts +11 -12
  384. package/dist/with-lookup/{aggregate/aggregation.d.ts → reduce/reduction.d.ts} +21 -21
  385. package/dist/with-lookup/{aggregate → reduce}/strategy.d.ts +15 -15
  386. package/dist/with-lookup/search/build-docs.d.ts +7 -2
  387. package/dist/with-lookup/search/index.d.ts +1 -1
  388. package/dist/with-party/broker/index.d.ts +1 -0
  389. package/dist/with-party/broker/seed.d.ts +1 -1
  390. package/dist/with-party/custody/liberate.d.ts +3 -3
  391. package/dist/with-party/directory/cover/index.d.ts +1 -5
  392. package/dist/with-party/directory/cover/schema.d.ts +0 -6
  393. package/dist/with-party/directory/cover/storage.d.ts +0 -8
  394. package/dist/with-party/directory/cover/types.d.ts +0 -21
  395. package/dist/with-party/directory/index.d.ts +2 -0
  396. package/dist/with-party/session/dev-unlock.d.ts +2 -2
  397. package/dist/with-party/session/index.d.ts +2 -0
  398. package/dist/with-party/session/session.d.ts +2 -2
  399. package/dist/with-party/team/deed.d.ts +8 -8
  400. package/dist/with-party/team/index.d.ts +4 -7
  401. package/dist/with-party/team/keyring.d.ts +83 -35
  402. package/dist/with-party/team/{managed-passphrase.d.ts → managed-secret.d.ts} +27 -27
  403. package/dist/with-party/team/noydb-facade.d.ts +43 -42
  404. package/dist/with-party/team/peer-recover.d.ts +13 -13
  405. package/dist/with-party/team/recovery.d.ts +5 -5
  406. package/dist/with-party/team/rotate-recover.d.ts +30 -30
  407. package/dist/with-pod/bundle.d.ts +30 -32
  408. package/dist/with-pod/format.d.ts +2 -2
  409. package/dist/with-pod/index.d.ts +2 -1
  410. package/dist/with-shape/blobs/blob-compaction.d.ts +43 -3
  411. package/dist/with-shape/blobs/blob-pinning.d.ts +112 -0
  412. package/dist/with-shape/blobs/blob-set.d.ts +86 -2
  413. package/dist/with-shape/introspection/index.d.ts +6 -0
  414. package/dist/with-shape/schema-update/index.d.ts +1 -0
  415. package/dist/with-store/index.d.ts +3 -2
  416. package/dist/with-store/route-store.d.ts +1 -1
  417. package/dist/{with-party/team/sync-active.d.ts → with-sync/active.d.ts} +1 -1
  418. package/dist/{with-party/team/sync-credentials.d.ts → with-sync/credentials.d.ts} +3 -3
  419. package/dist/{with-party/team/sync.d.ts → with-sync/engine.d.ts} +17 -4
  420. package/dist/{with-party/sync → with-sync}/index.d.ts +4 -2
  421. package/dist/with-sync/period-scope.d.ts +78 -0
  422. package/dist/{with-party/team → with-sync}/presence.d.ts +2 -2
  423. package/dist/{with-party/team/sync-strategy.d.ts → with-sync/strategy.d.ts} +6 -6
  424. package/dist/{with-party/team/sync-transaction.d.ts → with-sync/transaction.d.ts} +3 -3
  425. package/dist/withdraw-accessible-A2PWF5MZ.js +28 -0
  426. package/dist/withdraw-accessible-A2PWF5MZ.js.map +1 -0
  427. package/package.json +49 -36
  428. package/dist/aggregate/index.js.map +0 -1
  429. package/dist/api-3A3S4SHH.js +0 -20
  430. package/dist/as/index.js +0 -30
  431. package/dist/at/index.js +0 -1
  432. package/dist/bundle/index.js +0 -153
  433. package/dist/bundle/index.js.map +0 -1
  434. package/dist/by/index.js +0 -11
  435. package/dist/chunk-554KLAAN.js.map +0 -1
  436. package/dist/chunk-5PFOMHTB.js.map +0 -1
  437. package/dist/chunk-5WZXVULX.js.map +0 -1
  438. package/dist/chunk-6NQMXTYC.js.map +0 -1
  439. package/dist/chunk-6XE5TMPR.js.map +0 -1
  440. package/dist/chunk-A5BDDEXK.js.map +0 -1
  441. package/dist/chunk-ANATMTOA.js +0 -205
  442. package/dist/chunk-ANATMTOA.js.map +0 -1
  443. package/dist/chunk-BOKIKJJB.js.map +0 -1
  444. package/dist/chunk-CHFZDSE4.js +0 -1
  445. package/dist/chunk-DDHM2TLX.js.map +0 -1
  446. package/dist/chunk-DSBQODMZ.js.map +0 -1
  447. package/dist/chunk-EWPOHMN2.js +0 -255
  448. package/dist/chunk-EWPOHMN2.js.map +0 -1
  449. package/dist/chunk-FXZDAV62.js.map +0 -1
  450. package/dist/chunk-GDG5VVYG.js.map +0 -1
  451. package/dist/chunk-GWKAVKHI.js.map +0 -1
  452. package/dist/chunk-H2KSZMIX.js.map +0 -1
  453. package/dist/chunk-HOONYZY2.js.map +0 -1
  454. package/dist/chunk-HQBM64EE.js.map +0 -1
  455. package/dist/chunk-IAO54J4R.js.map +0 -1
  456. package/dist/chunk-IFJTPAQQ.js.map +0 -1
  457. package/dist/chunk-IK43HLDQ.js.map +0 -1
  458. package/dist/chunk-ISMV2QVG.js.map +0 -1
  459. package/dist/chunk-JBBSYJHP.js.map +0 -1
  460. package/dist/chunk-JFCV5QIK.js.map +0 -1
  461. package/dist/chunk-JRBNCUNT.js.map +0 -1
  462. package/dist/chunk-LB7FD65R.js +0 -163
  463. package/dist/chunk-LB7FD65R.js.map +0 -1
  464. package/dist/chunk-ONTBCHCP.js.map +0 -1
  465. package/dist/chunk-PK6JIDQ4.js.map +0 -1
  466. package/dist/chunk-RDXW3OBQ.js.map +0 -1
  467. package/dist/chunk-RFI7GGFO.js.map +0 -1
  468. package/dist/chunk-S3BFKGET.js.map +0 -1
  469. package/dist/chunk-SV6EAJEP.js.map +0 -1
  470. package/dist/chunk-T36RFODW.js.map +0 -1
  471. package/dist/chunk-T3GY65MA.js.map +0 -1
  472. package/dist/chunk-TAGR72IR.js.map +0 -1
  473. package/dist/chunk-TIGPQDYP.js +0 -14
  474. package/dist/chunk-TIGPQDYP.js.map +0 -1
  475. package/dist/chunk-U6JMEH2P.js.map +0 -1
  476. package/dist/chunk-UDSR4X4L.js.map +0 -1
  477. package/dist/chunk-UHNGNKLV.js.map +0 -1
  478. package/dist/chunk-VCBHAE4R.js.map +0 -1
  479. package/dist/chunk-VCTXU4AT.js.map +0 -1
  480. package/dist/chunk-VEALDPHW.js.map +0 -1
  481. package/dist/chunk-VKCADNMR.js.map +0 -1
  482. package/dist/chunk-VQNJ7UZL.js.map +0 -1
  483. package/dist/chunk-W2OG6JOL.js.map +0 -1
  484. package/dist/chunk-WG4QBZDN.js.map +0 -1
  485. package/dist/chunk-WHXXI3W5.js.map +0 -1
  486. package/dist/chunk-WKGF2TJR.js.map +0 -1
  487. package/dist/chunk-WNGGJWF7.js.map +0 -1
  488. package/dist/chunk-XTHCN77N.js.map +0 -1
  489. package/dist/chunk-YCH5GBN6.js +0 -99
  490. package/dist/chunk-YCH5GBN6.js.map +0 -1
  491. package/dist/chunk-YMUGBZN2.js.map +0 -1
  492. package/dist/collection-facade-KMBWNCYP.js +0 -44
  493. package/dist/cover-QJRXINN5.js +0 -52
  494. package/dist/delegation-SU6CV3W7.js +0 -25
  495. package/dist/derive-6RWU4EOA.js +0 -21
  496. package/dist/executor-KGNLJD6M.js +0 -9
  497. package/dist/executor-UX4FASYZ.js +0 -26
  498. package/dist/executor-XGIS6CR7.js +0 -9
  499. package/dist/export-accessible-LKW3QV22.js +0 -23
  500. package/dist/extract-partition-UP2ARO75.js +0 -38
  501. package/dist/find-YS6XWB46.js +0 -11
  502. package/dist/in/index.js +0 -1
  503. package/dist/issue-3ACYX7LO.js +0 -19
  504. package/dist/legacy/bundle.d.ts +0 -30
  505. package/dist/liberate-MQQXBUCY.js +0 -24
  506. package/dist/noydb-ANIW5FLE.js +0 -69
  507. package/dist/on/index.js +0 -17
  508. package/dist/port/as/index.d.ts +0 -26
  509. package/dist/port/at/index.d.ts +0 -18
  510. package/dist/port/in/index.d.ts +0 -21
  511. package/dist/port/on/index.d.ts +0 -27
  512. package/dist/port/ui/index.d.ts +0 -21
  513. package/dist/port/with/index.d.ts +0 -18
  514. package/dist/register-PAM3ASRZ.js +0 -23
  515. package/dist/registry-4S2U2TR4.js +0 -19
  516. package/dist/registry-NPOWJHC4.js +0 -9
  517. package/dist/registry-VZ3CCI2R.js +0 -18
  518. package/dist/request-withdrawal-DI3H5WUI.js +0 -31
  519. package/dist/revoke-R5CZSVUT.js +0 -24
  520. package/dist/seed-3ZMF5EQA.js.map +0 -1
  521. package/dist/signer-MBVHW4WE.js +0 -25
  522. package/dist/storage-3MEJUENZ.js +0 -23
  523. package/dist/tx/index.js.map +0 -1
  524. package/dist/ui/index.js +0 -1
  525. package/dist/with/index.js +0 -31
  526. package/dist/with-lookup/aggregate/index.d.ts +0 -23
  527. package/dist/withdraw-accessible-TZDATQVR.js +0 -28
  528. /package/dist/{api-3A3S4SHH.js.map → api-ZDKTWNBB.js.map} +0 -0
  529. /package/dist/{backup-YPUEKIJC.js.map → backup-2UX7PRM5.js.map} +0 -0
  530. /package/dist/{chunk-IY23KFNZ.js.map → chunk-35NMVJ7I.js.map} +0 -0
  531. /package/dist/{chunk-RTEK4C4I.js.map → chunk-4JQK3L4V.js.map} +0 -0
  532. /package/dist/{chunk-3ELCWU56.js.map → chunk-4ZKNC6A6.js.map} +0 -0
  533. /package/dist/{chunk-VAIS3SOM.js.map → chunk-55LX6FSX.js.map} +0 -0
  534. /package/dist/{chunk-6HPG2YNX.js.map → chunk-5DRROK5W.js.map} +0 -0
  535. /package/dist/{chunk-S6Q37VGE.js.map → chunk-5GQEU4DN.js.map} +0 -0
  536. /package/dist/{chunk-ZXEZCY6F.js.map → chunk-63FE525P.js.map} +0 -0
  537. /package/dist/{chunk-JVBO4SZL.js.map → chunk-6UBZ6I5Z.js.map} +0 -0
  538. /package/dist/{chunk-VRBTNCM4.js.map → chunk-ABS7FMMD.js.map} +0 -0
  539. /package/dist/{chunk-M75ZZHSR.js.map → chunk-BLBAQRBM.js.map} +0 -0
  540. /package/dist/{chunk-WOM2HTML.js.map → chunk-CI32CAFS.js.map} +0 -0
  541. /package/dist/{chunk-EO43ANYJ.js.map → chunk-DABACXEF.js.map} +0 -0
  542. /package/dist/{chunk-CJ5KKU6X.js.map → chunk-DMH3VZU5.js.map} +0 -0
  543. /package/dist/{chunk-WZSHL6DQ.js.map → chunk-DZ2JXHWK.js.map} +0 -0
  544. /package/dist/{chunk-Z4PD65VQ.js.map → chunk-EE7UHLKH.js.map} +0 -0
  545. /package/dist/{chunk-RNG4VRP4.js.map → chunk-EKRSCRNM.js.map} +0 -0
  546. /package/dist/{chunk-MT62YSPZ.js.map → chunk-FRMPM7WG.js.map} +0 -0
  547. /package/dist/{as/index.js.map → chunk-GJW4HX2O.js.map} +0 -0
  548. /package/dist/{chunk-KS6SAVCZ.js.map → chunk-GU3IP74F.js.map} +0 -0
  549. /package/dist/{chunk-SMIRGMS7.js.map → chunk-IXNCZTWA.js.map} +0 -0
  550. /package/dist/{chunk-WQIYTNJV.js.map → chunk-IXTSNGYY.js.map} +0 -0
  551. /package/dist/{chunk-NCCBLYEB.js.map → chunk-JJZGIE4U.js.map} +0 -0
  552. /package/dist/{chunk-DRWBEDYO.js.map → chunk-JYJFGD2H.js.map} +0 -0
  553. /package/dist/{chunk-XJMBYYQK.js.map → chunk-LNZKOUJR.js.map} +0 -0
  554. /package/dist/{chunk-R3BLCFD2.js.map → chunk-MBKVNOJS.js.map} +0 -0
  555. /package/dist/{chunk-N6WF5PKC.js.map → chunk-NFZGZ4AK.js.map} +0 -0
  556. /package/dist/{chunk-THVIPWRF.js.map → chunk-PEATRIYJ.js.map} +0 -0
  557. /package/dist/{chunk-YZQOGE2L.js.map → chunk-QDIH2744.js.map} +0 -0
  558. /package/dist/{chunk-6HY2X62D.js.map → chunk-QJNCB5SK.js.map} +0 -0
  559. /package/dist/{chunk-2PCAVW2I.js.map → chunk-SHEEBRZ4.js.map} +0 -0
  560. /package/dist/{chunk-RA5VTXXG.js.map → chunk-V6UQZA2H.js.map} +0 -0
  561. /package/dist/{chunk-QDPZWTN2.js.map → chunk-W3G5REIU.js.map} +0 -0
  562. /package/dist/{chunk-A4FXFAKF.js.map → chunk-W3L64Y3J.js.map} +0 -0
  563. /package/dist/{chunk-XDIAFPUM.js.map → chunk-WLXMTYGO.js.map} +0 -0
  564. /package/dist/{chunk-RJ6K6K5M.js.map → chunk-X3F5YJG2.js.map} +0 -0
  565. /package/dist/{chunk-YTGDPCPW.js.map → chunk-Y6B6HVKC.js.map} +0 -0
  566. /package/dist/{classified-marker-QWMASIT7.js.map → classified-marker-7PKJBFCG.js.map} +0 -0
  567. /package/dist/{at/index.js.map → collection-facade-6I5K5IOD.js.map} +0 -0
  568. /package/dist/{by/index.js.map → computed-AB45PS4V.js.map} +0 -0
  569. /package/dist/{in → cover}/index.js.map +0 -0
  570. /package/dist/{on → custody}/index.js.map +0 -0
  571. /package/dist/{dead-filter-66VGI6JV.js.map → dead-filter-FL3WIUZS.js.map} +0 -0
  572. /package/dist/{chunk-CHFZDSE4.js.map → derive-VGS7FKE3.js.map} +0 -0
  573. /package/dist/{ui → directory}/index.js.map +0 -0
  574. /package/dist/{collection-facade-KMBWNCYP.js.map → enclave-SPEEDYZ4.js.map} +0 -0
  575. /package/dist/{computed-DSMPXG2Y.js.map → executor-IEBLTBCW.js.map} +0 -0
  576. /package/dist/{cover-QJRXINN5.js.map → executor-OTF556PL.js.map} +0 -0
  577. /package/dist/{delegation-SU6CV3W7.js.map → executor-RM7XWQDU.js.map} +0 -0
  578. /package/dist/{derive-6RWU4EOA.js.map → export-accessible-P42BQ4PB.js.map} +0 -0
  579. /package/dist/{enclave-TKPN2G2U.js.map → extract-partition-TCYXRWBN.js.map} +0 -0
  580. /package/dist/{fanout-sidecar-B5LVUMQX.js.map → fanout-sidecar-SSMRSC2L.js.map} +0 -0
  581. /package/dist/{executor-KGNLJD6M.js.map → find-OZMTRIK3.js.map} +0 -0
  582. /package/dist/{with → introspection}/index.js.map +0 -0
  583. /package/dist/{executor-UX4FASYZ.js.map → issue-FCKN5O6C.js.map} +0 -0
  584. /package/dist/{executor-XGIS6CR7.js.map → ledger-6XBEVWYP.js.map} +0 -0
  585. /package/dist/{export-accessible-LKW3QV22.js.map → liberate-CYUOS4NC.js.map} +0 -0
  586. /package/dist/{extract-partition-UP2ARO75.js.map → link-set-NK6L2A5S.js.map} +0 -0
  587. /package/dist/{find-YS6XWB46.js.map → money/index.js.map} +0 -0
  588. /package/dist/{issue-3ACYX7LO.js.map → noydb-FZZIMLCI.js.map} +0 -0
  589. /package/dist/{ledger-PTK7XZYT.js.map → policy/index.js.map} +0 -0
  590. /package/dist/{post-register-2YHSADFI.js.map → post-register-VFIYISUK.js.map} +0 -0
  591. /package/dist/{liberate-MQQXBUCY.js.map → register-UKU2J6MN.js.map} +0 -0
  592. /package/dist/{link-set-SLJHDNRB.js.map → registry-2VCWVHZS.js.map} +0 -0
  593. /package/dist/{noydb-ANIW5FLE.js.map → registry-7Y5WF7GS.js.map} +0 -0
  594. /package/dist/{policy-YDLCOX4P.js.map → registry-BWD2ED52.js.map} +0 -0
  595. /package/dist/{register-PAM3ASRZ.js.map → registry-DTWRJLSF.js.map} +0 -0
  596. /package/dist/{registry-4S2U2TR4.js.map → request-withdrawal-JYDZ5XY2.js.map} +0 -0
  597. /package/dist/{reveal-HWO4YMTJ.js.map → reveal-CL2BCW6A.js.map} +0 -0
  598. /package/dist/{registry-NPOWJHC4.js.map → revoke-2TSAD2T4.js.map} +0 -0
  599. /package/dist/{registry-VW6P6A3J.js.map → schema-update/index.js.map} +0 -0
  600. /package/dist/{registry-VZ3CCI2R.js.map → search/index.js.map} +0 -0
  601. /package/dist/{request-withdrawal-DI3H5WUI.js.map → sequence/index.js.map} +0 -0
  602. /package/dist/{revoke-R5CZSVUT.js.map → signer-K7Z2EOMG.js.map} +0 -0
  603. /package/dist/{signer-MBVHW4WE.js.map → stale-A4J26OIC.js.map} +0 -0
  604. /package/dist/{stale-VZL4OGUB.js.map → storage-YVHZUISN.js.map} +0 -0
  605. /package/dist/{storage-3MEJUENZ.js.map → store/index.js.map} +0 -0
  606. /package/dist/{store-coordination-provider-FKX3F6TQ.js.map → store-coordination-provider-EWRZL7XF.js.map} +0 -0
  607. /package/dist/{verify-26Y5GNMK.js.map → verify-7XWHJWUN.js.map} +0 -0
  608. /package/dist/{withdraw-accessible-TZDATQVR.js.map → walk-P5D6CF4V.js.map} +0 -0
  609. /package/dist/with-lookup/{aggregate → reduce}/canonical-key.d.ts +0 -0
  610. /package/dist/{with-party → with-sync}/tab-coordination.d.ts +0 -0
  611. /package/dist/{with-party → with-sync}/tab-write-relay.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-lookup/reduce/strategy.ts"],"sourcesContent":["/**\n * Strategy seam between the core Query / ScanBuilder chain and the\n * optional aggregate / groupBy service. Core imports\n * `ReduceStrategy` as a TYPE-ONLY symbol and `NO_REDUCE` as a\n * tiny runtime stub.\n *\n * The heavy machinery — `Reduction`, `GroupedQuery`, the\n * reducer-step logic — is only reachable from `withReduce()` in\n * `./active.ts`, which is only exported through the\n * `@noy-db/hub/reduce` subpath. Consumers that don't import the\n * subpath ship none of the ~886 LOC.\n *\n * @internal\n */\n\nimport type {\n Reduction,\n ReduceSpec,\n ReduceResult,\n ReductionUpstream,\n} from './reduction.js'\nimport type { GroupedQuery, GroupedQueryN } from './groupby.js'\nimport type { ViaPipeline } from '../../kernel/via/pipeline.js'\n\n/**\n * Seam interface. `@internal` — will promote to public only when the\n * aggregate service is extracted into its own package.\n *\n * @internal\n */\nexport interface ReduceStrategy {\n /**\n * Build an `Reduction<R>` for `Query.aggregate(spec)`. `executeRecords`\n * is a closure that produces the matching record set when the\n * reduction runs. NO_REDUCE throws; the active strategy\n * constructs a real `Reduction`.\n */\n aggregate<Spec extends ReduceSpec>(\n executeRecords: () => readonly unknown[],\n spec: Spec,\n upstreams: readonly ReductionUpstream[],\n ): Reduction<ReduceResult<Spec>>\n\n /**\n * Build a `GroupedQuery<T, F, S>` for `Query.groupBy(field)`. Same\n * closure / upstream inputs as `aggregate` plus the group key field.\n */\n groupBy<T, F extends string, S extends keyof T = never, M extends keyof T & string = never>(\n executeRecords: () => readonly unknown[],\n field: F,\n upstreams: readonly ReductionUpstream[],\n dictLabelResolver?: (\n key: string,\n locale: string,\n fallback?: string | readonly string[],\n ) => Promise<string | undefined>,\n via?: ViaPipeline,\n ): GroupedQuery<T, F, S, M>\n\n /**\n * Variadic-keyed sibling — builds a `GroupedQueryN<T, F, S>` for\n * `Query.groupBy(...fields)`. No dictLabelResolver — `<field>Label`\n * projection only applies to single-field groupings, which dispatch\n * through `groupBy` above.\n */\n groupByN<T, F extends readonly string[], S extends keyof T = never, M extends keyof T & string = never>(\n executeRecords: () => readonly unknown[],\n fields: F,\n upstreams: readonly ReductionUpstream[],\n via?: ViaPipeline,\n ): GroupedQueryN<T, F, S, M>\n\n /**\n * Terminal streaming aggregator for `ScanBuilder.aggregate(spec)`.\n * Takes an async iterable of decrypted records + the spec and\n * returns the reduced result.\n */\n scanAggregate<Spec extends ReduceSpec>(\n iter: AsyncIterable<unknown>,\n spec: Spec,\n ): Promise<ReduceResult<Spec>>\n}\n\nconst NOT_ENABLED = new Error(\n 'Aggregate / groupBy is not enabled on this Noydb instance. ' +\n 'Import `{ withReduce }` from \"@noy-db/hub/reduce\" and pass it to ' +\n '`createNoydb({ reduceStrategy: withReduce() })`.',\n)\n\n/**\n * No-aggregate stub. Every `.aggregate()` / `.groupBy()` / streaming\n * `scan().aggregate()` call throws with a pointer at the subpath. The\n * real `Reduction` / `GroupedQuery` classes are never referenced at\n * runtime, so the bundler drops the ~886 LOC.\n *\n * @internal\n */\nexport const NO_REDUCE: ReduceStrategy = {\n aggregate() { throw NOT_ENABLED },\n groupBy() { throw NOT_ENABLED },\n groupByN() { throw NOT_ENABLED },\n scanAggregate() { throw NOT_ENABLED },\n}\n"],"mappings":";AAmFA,IAAM,cAAc,IAAI;AAAA,EACtB;AAGF;AAUO,IAAM,YAA4B;AAAA,EACvC,YAAY;AAAE,UAAM;AAAA,EAAY;AAAA,EAChC,UAAU;AAAE,UAAM;AAAA,EAAY;AAAA,EAC9B,WAAW;AAAE,UAAM;AAAA,EAAY;AAAA,EAC/B,gBAAgB;AAAE,UAAM;AAAA,EAAY;AACtC;","names":[]}
@@ -1,18 +1,10 @@
1
1
  import {
2
2
  grant,
3
3
  revoke
4
- } from "./chunk-554KLAAN.js";
4
+ } from "./chunk-BLCWSJLN.js";
5
5
  import {
6
- CargoNotEnabledError,
7
6
  CustodyNotEnabledError
8
- } from "./chunk-W2OG6JOL.js";
9
-
10
- // src/with-cargo/strategy.ts
11
- var NO_CARGO = {
12
- async extractPartition() {
13
- throw new CargoNotEnabledError();
14
- }
15
- };
7
+ } from "./chunk-QZWTRENR.js";
16
8
 
17
9
  // src/with-party/custody/active.ts
18
10
  function withCustody() {
@@ -24,7 +16,7 @@ function withCustody() {
24
16
  return host._revokeCustodianImpl(revoke, vault, options, factors);
25
17
  },
26
18
  async liberate(vault, opts) {
27
- const { liberateVault } = await import("./liberate-MQQXBUCY.js");
19
+ const { liberateVault } = await import("./liberate-CYUOS4NC.js");
28
20
  return liberateVault(vault, opts);
29
21
  }
30
22
  };
@@ -78,9 +70,8 @@ var CustodyApi = class {
78
70
  };
79
71
 
80
72
  export {
81
- NO_CARGO,
82
- withCustody,
83
73
  NO_CUSTODY,
74
+ withCustody,
84
75
  CustodyApi
85
76
  };
86
- //# sourceMappingURL=chunk-SV6EAJEP.js.map
77
+ //# sourceMappingURL=chunk-YWWQM7KP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-party/custody/active.ts","../src/with-party/custody/strategy.ts","../src/with-party/custody/index.ts"],"sourcesContent":["/**\n * Enable the sovereign-custody (FR-6) capability.\n * Pass to `createNoydb({ custodyStrategy: withCustody() })` to make\n * `db.grantCustodian` / `db.revokeCustodian` (and the `vault.custody.*` facade\n * that delegates to them) plus `vault.custody.liberate()` live. The heavy\n * `liberateVault` ceremony is dynamically imported here, so it is reached only\n * via opt-in; grant/revoke run the host's own gate + keyring engine.\n */\nimport type { CustodyStrategy } from './strategy.js'\nimport { grant as grantEngine, revoke as revokeEngine } from '../team/keyring.js'\n\nexport function withCustody(): CustodyStrategy {\n return {\n async grantCustodian(host, vault, options, factors) {\n return host._grantCustodianImpl(grantEngine, vault, options, factors)\n },\n async revokeCustodian(host, vault, options, factors) {\n return host._revokeCustodianImpl(revokeEngine, vault, options, factors)\n },\n async liberate(vault, opts) {\n const { liberateVault } = await import('./liberate.js')\n return liberateVault(vault, opts)\n },\n }\n}\n","/**\n * Sovereign-custody (FR-6) capability strategy — the three on-demand\n * operations the custody surface routes through: minting a custodian\n * (`grantCustodian`), removing one (`revokeCustodian`), and the audited\n * ownership-claim ceremony (`liberate`). The active engine ({@link withCustody})\n * runs the grant/revoke impls the host exposes and dynamically imports the\n * heavy `liberateVault` ceremony (keeping it out of the floor bundle);\n * {@link NO_CUSTODY} throws.\n *\n * `Noydb.grantCustodian` / `Noydb.revokeCustodian` delegate here (passing\n * themselves as the {@link CustodyHost}), and `vault.custody.liberate` delegates\n * here with its {@link Vault}. An un-opted-in caller hits `NO_CUSTODY`'s throw.\n *\n * Note: the lower-level `liberateVault` FREE FUNCTION (exported from\n * `custody/liberate.ts`) stays ungated — it has no `createNoydb` instance to\n * gate against (the same carve-out as the `openSealedRecord` host opener). Only\n * the instance surfaces (`db.grantCustodian` / `db.revokeCustodian` /\n * `vault.custody.*`) are the capability.\n * @internal\n */\nimport type { GrantOptions, RevokeOptions, FactorProofBundle, NoydbStore } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { UnlockedKeyring } from '../team/keyring.js'\nimport type { GrantCustodianOptions } from './index.js'\nimport type { LiberateOptions, LiberateResult } from './liberate.js'\nimport { CustodyNotEnabledError } from '../../kernel/errors.js'\n\n/**\n * The grant/revoke engine the strategy runs when opted in — implemented by\n * `Noydb` (`_grantCustodianImpl` / `_revokeCustodianImpl` hold the gate +\n * keyring logic; the public `grantCustodian` / `revokeCustodian` route through\n * the strategy). Since the #267 team split the keyring grant/revoke engines\n * are passed IN by `withCustody()` (statically linked there, not in the\n * kernel) so the single-user floor never carries them.\n */\nexport interface CustodyHost {\n _grantCustodianImpl(\n engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, options: GrantOptions) => Promise<void>,\n vault: string,\n options: GrantCustodianOptions,\n factors?: FactorProofBundle,\n ): Promise<void>\n _revokeCustodianImpl(\n engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, options: RevokeOptions) => Promise<void>,\n vault: string,\n options: RevokeOptions,\n factors?: FactorProofBundle,\n ): Promise<void>\n}\n\nexport interface CustodyStrategy {\n grantCustodian(host: CustodyHost, vault: string, options: GrantCustodianOptions, factors?: FactorProofBundle): Promise<void>\n revokeCustodian(host: CustodyHost, vault: string, options: RevokeOptions, factors?: FactorProofBundle): Promise<void>\n liberate(vault: Vault, opts: LiberateOptions): Promise<LiberateResult>\n}\n\n/**\n * No-op stub — the floor default. Every custody operation throws\n * {@link CustodyNotEnabledError}; opt in with `custodyStrategy: withCustody()`\n * in createNoydb. @internal\n */\nexport const NO_CUSTODY: CustodyStrategy = {\n async grantCustodian() { throw new CustodyNotEnabledError() },\n async revokeCustodian() { throw new CustodyNotEnabledError() },\n async liberate() { throw new CustodyNotEnabledError() },\n}\n","/**\n * Public `vault.custody.*` API surface (FR-6).\n *\n * The custody namespace is the vault-instance face of the FR-6 sovereign-custody\n * model — it mirrors `vault.user.*` exactly: a thin delegation shell with NO\n * business logic. The Vault constructs one `CustodyApi` per session, injecting\n * closures that bind the vault name / keyring into the genuinely-core\n * implementations (`Noydb.grantCustodian` / `Noydb.revokeCustodian` and the\n * `liberateVault` ceremony). Each method just forwards to its injected callback.\n *\n * Three operations:\n * - `grantCustodian(opts)` — owner-only: mint a `custodian` who operates the\n * vault fully but can never grant / rotate / sever / extract.\n * - `revokeCustodian(opts)` — owner-only: remove a custodian.\n * - `liberate(opts)` — custodian-only: audited claim of ownership over a\n * sealed-owner (Deed) vault (mints a DISTINCT new owner; ledger-audited).\n *\n * Provisioning a Deed (`createDeedOwner`) is deliberately NOT on this class: it\n * is a store-level operation that mints the vault's first owner, so there is no\n * vault instance (and thus no custody namespace) yet — it stays the exported\n * `team/deed.ts` function.\n *\n * @see docs/superpowers/specs/2026-06-17-fr6-deed-custodian-liberate-design.md\n * @module\n */\nimport type { GrantOptions, RevokeOptions, FactorProofBundle } from '../../kernel/types.js'\nimport type { LiberateOptions, LiberateResult } from './liberate.js'\n\n/** Options for `vault.custody.grantCustodian` — a grant with the role fixed to `custodian`. */\nexport type GrantCustodianOptions = Omit<GrantOptions, 'role'>\n\n// Capability opt-in seam (S4): grant/revoke custodian + liberate throw\n// CustodyNotEnabledError unless `custodyStrategy: withCustody()` is opted in.\nexport { withCustody } from './active.js'\nexport { NO_CUSTODY, type CustodyStrategy, type CustodyHost } from './strategy.js'\nexport { CustodyNotEnabledError } from '../../kernel/errors.js'\n\n/**\n * Implementation behind `vault.custody`. Constructed once per Vault. Holds the\n * injected, vault-bound implementations in closure; every method delegates with\n * no added logic (the owner-only / custodian-only / gate checks all live in the\n * injected implementations — `Noydb.grantCustodian` etc. and `liberateVault`).\n */\nexport class CustodyApi {\n constructor(\n /** Bound `Noydb.grantCustodian(this.name, ...)` — owner-only, gated. */\n private readonly _grantCustodian: (options: GrantCustodianOptions, factors?: FactorProofBundle) => Promise<void>,\n /** Bound `Noydb.revokeCustodian(this.name, ...)` — owner-only, gated. */\n private readonly _revokeCustodian: (options: RevokeOptions, factors?: FactorProofBundle) => Promise<void>,\n /** Bound `liberateVault(this, ...)` — custodian-only audited ownership claim. */\n private readonly _liberate: (opts: LiberateOptions) => Promise<LiberateResult>,\n ) {}\n\n /**\n * Owner-only: grant the FR-6 `custodian` role. The custodian operates every\n * collection (rw + access) but is provably unable to grant / revoke / rotate /\n * extract-and-sever. Defended in depth (gate + owner-only role check) inside\n * the injected `Noydb.grantCustodian`.\n */\n async grantCustodian(options: GrantCustodianOptions, factors?: FactorProofBundle): Promise<void> {\n return this._grantCustodian(options, factors)\n }\n\n /** Owner-only: revoke a custodian. */\n async revokeCustodian(options: RevokeOptions, factors?: FactorProofBundle): Promise<void> {\n return this._revokeCustodian(options, factors)\n }\n\n /**\n * Custodian-only: the audited claim of ownership over a sealed-owner (Deed)\n * vault. Mints a DISTINCT new owner re-wrapping the incumbent DEKs under a\n * fresh KEK (the latent owner is never impersonated), ledger-audited. See\n * {@link liberateVault}.\n */\n async liberate(opts: LiberateOptions): Promise<LiberateResult> {\n return this._liberate(opts)\n }\n}\n"],"mappings":";;;;;;;;;AAWO,SAAS,cAA+B;AAC7C,SAAO;AAAA,IACL,MAAM,eAAe,MAAM,OAAO,SAAS,SAAS;AAClD,aAAO,KAAK,oBAAoB,OAAa,OAAO,SAAS,OAAO;AAAA,IACtE;AAAA,IACA,MAAM,gBAAgB,MAAM,OAAO,SAAS,SAAS;AACnD,aAAO,KAAK,qBAAqB,QAAc,OAAO,SAAS,OAAO;AAAA,IACxE;AAAA,IACA,MAAM,SAAS,OAAO,MAAM;AAC1B,YAAM,EAAE,cAAc,IAAI,MAAM,OAAO,wBAAe;AACtD,aAAO,cAAc,OAAO,IAAI;AAAA,IAClC;AAAA,EACF;AACF;;;ACqCO,IAAM,aAA8B;AAAA,EACzC,MAAM,iBAAiB;AAAE,UAAM,IAAI,uBAAuB;AAAA,EAAE;AAAA,EAC5D,MAAM,kBAAkB;AAAE,UAAM,IAAI,uBAAuB;AAAA,EAAE;AAAA,EAC7D,MAAM,WAAW;AAAE,UAAM,IAAI,uBAAuB;AAAA,EAAE;AACxD;;;ACtBO,IAAM,aAAN,MAAiB;AAAA,EACtB,YAEmB,iBAEA,kBAEA,WACjB;AALiB;AAEA;AAEA;AAAA,EAChB;AAAA,EALgB;AAAA,EAEA;AAAA,EAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASnB,MAAM,eAAe,SAAgC,SAA4C;AAC/F,WAAO,KAAK,gBAAgB,SAAS,OAAO;AAAA,EAC9C;AAAA;AAAA,EAGA,MAAM,gBAAgB,SAAwB,SAA4C;AACxF,WAAO,KAAK,iBAAiB,SAAS,OAAO;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,SAAS,MAAgD;AAC7D,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;","names":[]}
@@ -1,32 +1,252 @@
1
+ import {
2
+ walkClosure
3
+ } from "./chunk-PEATRIYJ.js";
1
4
  import {
2
5
  resolveManagedSecret
3
- } from "./chunk-RFI7GGFO.js";
6
+ } from "./chunk-FQZ6XTQ7.js";
4
7
  import {
5
8
  parseExtractedPartitionBody,
6
9
  readPod,
7
10
  readPodHeader
8
- } from "./chunk-FXZDAV62.js";
11
+ } from "./chunk-LNPUSMZL.js";
9
12
  import {
10
13
  createOwnerKeyring
11
- } from "./chunk-554KLAAN.js";
14
+ } from "./chunk-BLCWSJLN.js";
15
+ import {
16
+ diff
17
+ } from "./chunk-SVLR4POP.js";
12
18
  import {
13
19
  LedgerStore
14
- } from "./chunk-VRBTNCM4.js";
20
+ } from "./chunk-ABS7FMMD.js";
15
21
  import {
16
22
  LEDGER_COLLECTION
17
23
  } from "./chunk-I7FD46FF.js";
18
24
  import {
19
25
  openEnvelopeJson
20
- } from "./chunk-W4TCUGQR.js";
26
+ } from "./chunk-G2JUIDFA.js";
21
27
  import {
22
28
  base64ToBuffer,
23
29
  wrapKey
24
- } from "./chunk-HOONYZY2.js";
30
+ } from "./chunk-AKKRXT23.js";
25
31
  import {
26
32
  AdoptionStateError,
27
33
  TransferSealError,
28
34
  ValidationError
29
- } from "./chunk-W2OG6JOL.js";
35
+ } from "./chunk-QZWTRENR.js";
36
+
37
+ // src/with-cargo/vault-diff.ts
38
+ async function diffVault(vault, candidate, options = {}) {
39
+ const idKey = options.idKey ?? "id";
40
+ const filter = options.collections ? new Set(options.collections) : null;
41
+ const compareFn = options.compareFn ?? ((a, b) => diff(a, b).length === 0);
42
+ const live = /* @__PURE__ */ new Map();
43
+ for await (const chunk of vault.exportStream({ granularity: "collection" })) {
44
+ if (filter && !filter.has(chunk.collection)) continue;
45
+ const collection = live.get(chunk.collection) ?? /* @__PURE__ */ new Map();
46
+ for (const record of chunk.records) {
47
+ const id = readIdField(record, idKey);
48
+ if (!id) continue;
49
+ collection.set(id, record);
50
+ }
51
+ live.set(chunk.collection, collection);
52
+ }
53
+ const cand = await normaliseCandidate(candidate, idKey, filter);
54
+ const added = [];
55
+ const modified = [];
56
+ const deleted = [];
57
+ const unchanged = options.includeUnchanged ? [] : void 0;
58
+ const collectionNames = /* @__PURE__ */ new Set([...live.keys(), ...cand.keys()]);
59
+ for (const collection of [...collectionNames].sort()) {
60
+ const liveColl = live.get(collection) ?? /* @__PURE__ */ new Map();
61
+ const candColl = cand.get(collection) ?? /* @__PURE__ */ new Map();
62
+ const allIds = /* @__PURE__ */ new Set([...liveColl.keys(), ...candColl.keys()]);
63
+ for (const id of [...allIds].sort()) {
64
+ const before = liveColl.get(id);
65
+ const after = candColl.get(id);
66
+ if (before === void 0 && after !== void 0) {
67
+ added.push({ collection, id, record: after });
68
+ } else if (before !== void 0 && after === void 0) {
69
+ const metadata = options.includeMetadata ? await vault.collection(collection).getMetadata(id) ?? void 0 : void 0;
70
+ deleted.push({ collection, id, record: before, ...metadata !== void 0 ? { metadata } : {} });
71
+ } else if (before !== void 0 && after !== void 0) {
72
+ if (compareFn(before, after)) {
73
+ unchanged?.push({ collection, id, record: after });
74
+ } else {
75
+ const metadata = options.includeMetadata ? await vault.collection(collection).getMetadata(id) ?? void 0 : void 0;
76
+ const fieldDiffs = diff(before, after);
77
+ const fieldsChanged = uniqueTopLevelKeys(fieldDiffs);
78
+ modified.push({
79
+ collection,
80
+ id,
81
+ record: after,
82
+ before,
83
+ fieldsChanged,
84
+ fieldDiffs,
85
+ ...metadata !== void 0 ? { metadata } : {}
86
+ });
87
+ }
88
+ }
89
+ }
90
+ }
91
+ const summary = {
92
+ add: added.length,
93
+ modify: modified.length,
94
+ delete: deleted.length,
95
+ total: added.length + modified.length + deleted.length
96
+ };
97
+ return {
98
+ added,
99
+ modified,
100
+ deleted,
101
+ unchanged,
102
+ summary,
103
+ format(opts) {
104
+ return formatDiff(opts?.detail ?? "full", { added, modified, deleted, summary });
105
+ }
106
+ };
107
+ }
108
+ async function normaliseCandidate(candidate, idKey, filter) {
109
+ const out = /* @__PURE__ */ new Map();
110
+ if (typeof candidate === "object" && candidate !== null && "exportStream" in candidate && typeof candidate.exportStream === "function") {
111
+ for await (const chunk of candidate.exportStream({ granularity: "collection" })) {
112
+ if (filter && !filter.has(chunk.collection)) continue;
113
+ const collection = out.get(chunk.collection) ?? /* @__PURE__ */ new Map();
114
+ for (const record of chunk.records) {
115
+ const id = readIdField(record, idKey);
116
+ if (!id) continue;
117
+ collection.set(id, record);
118
+ }
119
+ out.set(chunk.collection, collection);
120
+ }
121
+ return out;
122
+ }
123
+ if (typeof candidate === "string") {
124
+ let parsed;
125
+ try {
126
+ parsed = JSON.parse(candidate);
127
+ } catch (err) {
128
+ throw new Error(
129
+ `diffVault: candidate string is not valid JSON (${err.message})`
130
+ );
131
+ }
132
+ return collectionsFromObject(parsed, idKey, filter);
133
+ }
134
+ return collectionsFromObject(candidate, idKey, filter);
135
+ }
136
+ function collectionsFromObject(raw, idKey, filter) {
137
+ const out = /* @__PURE__ */ new Map();
138
+ if (raw === null || typeof raw !== "object") {
139
+ throw new Error("diffVault: candidate must be a Vault, an object, or a JSON string");
140
+ }
141
+ for (const [key, value] of Object.entries(raw)) {
142
+ if (key.startsWith("_")) continue;
143
+ if (filter && !filter.has(key)) continue;
144
+ if (!Array.isArray(value)) continue;
145
+ const collection = /* @__PURE__ */ new Map();
146
+ for (const record of value) {
147
+ if (record === null || typeof record !== "object") continue;
148
+ const id = readIdField(record, idKey);
149
+ if (!id) continue;
150
+ collection.set(id, record);
151
+ }
152
+ out.set(key, collection);
153
+ }
154
+ return out;
155
+ }
156
+ function uniqueTopLevelKeys(diffs) {
157
+ const keys = /* @__PURE__ */ new Set();
158
+ for (const d of diffs) {
159
+ const m = /^[^.[]+/.exec(d.path);
160
+ if (m) keys.add(m[0]);
161
+ }
162
+ return [...keys];
163
+ }
164
+ function readIdField(record, idKey) {
165
+ if (record === null || typeof record !== "object") return "";
166
+ const v = record[idKey];
167
+ if (typeof v === "string") return v;
168
+ if (typeof v === "number" && Number.isFinite(v)) return String(v);
169
+ return "";
170
+ }
171
+ function formatDiff(detail, b) {
172
+ const head = `${b.summary.add} added \xB7 ${b.summary.modify} modified \xB7 ${b.summary.delete} deleted`;
173
+ if (detail === "count") return head;
174
+ if (b.summary.total === 0) return head + "\n(no changes)";
175
+ if (detail === "one-line") return head;
176
+ const rows = [head, ""];
177
+ for (const e of b.added) rows.push(`${e.collection}/${e.id} added`);
178
+ for (const e of b.modified) {
179
+ const fields = e.fieldDiffs.map((f) => `${f.path}: ${shortJSON(f.from)} \u2192 ${shortJSON(f.to)}`).join(", ");
180
+ rows.push(`${e.collection}/${e.id} modified ${fields}`);
181
+ }
182
+ for (const e of b.deleted) rows.push(`${e.collection}/${e.id} deleted`);
183
+ return rows.join("\n");
184
+ }
185
+ function shortJSON(value) {
186
+ if (value === void 0) return "undefined";
187
+ const s = JSON.stringify(value);
188
+ if (typeof s !== "string") return "<unrepresentable>";
189
+ return s.length > 60 ? s.slice(0, 57) + "..." : s;
190
+ }
191
+
192
+ // src/with-cargo/active.ts
193
+ function withCargo() {
194
+ return {
195
+ async extractPartition(vault, opts) {
196
+ const { extractPartitionCore } = await import("./extract-partition-TCYXRWBN.js");
197
+ return extractPartitionCore(vault, opts);
198
+ }
199
+ };
200
+ }
201
+
202
+ // src/with-cargo/describe-extraction.ts
203
+ async function describeExtraction(vault, opts) {
204
+ const { closure, graph, danglingRefs } = await walkClosure(vault, opts);
205
+ const { name: vaultName, adapter } = vault._introspectState();
206
+ const encoder = new TextEncoder();
207
+ const byCollection = [];
208
+ const inaccessible = [];
209
+ let totalBytes = 0;
210
+ let totalRecords = 0;
211
+ for (const [collectionName, ids] of closure) {
212
+ let bytes = 0;
213
+ let oldestTs;
214
+ let newestTs;
215
+ let recordCount = 0;
216
+ for (const id of ids) {
217
+ const env = await adapter.get(vaultName, collectionName, id);
218
+ if (!env) {
219
+ inaccessible.push({ collection: collectionName, id });
220
+ continue;
221
+ }
222
+ recordCount++;
223
+ bytes += encoder.encode(JSON.stringify(env)).length;
224
+ const ts = env._ts;
225
+ if (oldestTs === void 0 || ts < oldestTs) oldestTs = ts;
226
+ if (newestTs === void 0 || ts > newestTs) newestTs = ts;
227
+ }
228
+ byCollection.push({
229
+ name: collectionName,
230
+ recordCount,
231
+ bytes,
232
+ // Spread conditionally — exactOptionalPropertyTypes forbids an
233
+ // explicit `undefined` on an optional property.
234
+ ...oldestTs !== void 0 ? { oldestTs } : {},
235
+ ...newestTs !== void 0 ? { newestTs } : {}
236
+ });
237
+ totalBytes += bytes;
238
+ totalRecords += recordCount;
239
+ }
240
+ byCollection.sort((a, b) => a.name.localeCompare(b.name));
241
+ return Object.freeze({
242
+ totalRecords,
243
+ totalBytes,
244
+ byCollection,
245
+ graph,
246
+ inaccessible,
247
+ danglingRefs
248
+ });
249
+ }
30
250
 
31
251
  // src/with-cargo/adopt-partition.ts
32
252
  async function unsealDeks(seal, transferKey) {
@@ -112,13 +332,13 @@ async function adoptPartition(bundleBytes, opts) {
112
332
  return { vaultName, needsOwner: true, sealId: seal.sealId };
113
333
  }
114
334
  function isManaged(o) {
115
- return "passphraseMode" in o && o.passphraseMode === "managed";
335
+ return "secretMode" in o && o.secretMode === "managed";
116
336
  }
117
337
  async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
118
338
  const { userId, transferKey } = opts;
119
339
  if (isManaged(opts) && !opts.recovery.some((r) => r.profile === "shamir")) {
120
340
  throw new AdoptionStateError(
121
- "managed-mode adoption requires at least one strong (shamir) recovery profile in `recovery` \u2014 paper alone is not strong when there is no user passphrase to fall back on."
341
+ "managed-mode adoption requires at least one strong (shamir) recovery profile in `recovery` \u2014 paper alone is not strong when there is no user secret to fall back on."
122
342
  );
123
343
  }
124
344
  const adoptionEnv = await store.get(vaultName, "_meta", "adoption");
@@ -145,8 +365,8 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
145
365
  const priorDeks = existingKeyring ? JSON.parse(existingKeyring._data).deks : {};
146
366
  const ownerMinted = existingKeyring !== null && partitionCollections.every((c) => c in priorDeks);
147
367
  if (!ownerMinted) {
148
- const passphrase = isManaged(opts) ? await resolveManagedSecret(store, vaultName, opts.sealingKey) : opts.passphrase;
149
- const unlocked = await createOwnerKeyring(store, vaultName, userId, passphrase);
368
+ const secret = isManaged(opts) ? await resolveManagedSecret(store, vaultName, opts.sealingKey) : opts.secret;
369
+ const unlocked = await createOwnerKeyring(store, vaultName, { userId, secret });
150
370
  const env = await store.get(vaultName, "_keyring", userId);
151
371
  if (!env) throw new AdoptionStateError(`keyring write for "${userId}" did not persist`);
152
372
  const keyringFile = JSON.parse(env._data);
@@ -179,15 +399,15 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
179
399
  }
180
400
  }
181
401
  if (isManaged(opts)) {
182
- const { createNoydb } = await import("./noydb-ANIW5FLE.js");
402
+ const { createNoydb } = await import("./noydb-FZZIMLCI.js");
183
403
  const db = await createNoydb({
184
404
  store,
185
405
  user: userId,
186
- passphraseMode: "managed",
406
+ secretMode: "managed",
187
407
  sealingKey: opts.sealingKey,
188
408
  shamirRecovery: opts.shamirRecovery
189
409
  });
190
- await db.openVaultAndEnrollRecovery(vaultName, { recovery: opts.recovery });
410
+ await db.team.openVaultAndEnrollRecovery(vaultName, { recovery: opts.recovery });
191
411
  }
192
412
  const consumed = { sealId: adoption.sealId, adoptedAt: adoption.adoptedAt, consumedAt: (/* @__PURE__ */ new Date()).toISOString() };
193
413
  await store.put(vaultName, "_meta", "adoption", { ...adoptionEnv, _data: JSON.stringify(consumed) });
@@ -230,6 +450,9 @@ export {
230
450
  unsealDeks,
231
451
  adoptPartition,
232
452
  createOwnerOnAdoptedPartition,
233
- decryptExtractedPartition
453
+ decryptExtractedPartition,
454
+ diffVault,
455
+ withCargo,
456
+ describeExtraction
234
457
  };
235
- //# sourceMappingURL=chunk-UDSR4X4L.js.map
458
+ //# sourceMappingURL=chunk-YZJSJOUI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-cargo/vault-diff.ts","../src/with-cargo/active.ts","../src/with-cargo/describe-extraction.ts","../src/with-cargo/adopt-partition.ts","../src/with-cargo/decrypt-partition.ts"],"sourcesContent":["/**\n * Vault-level diff orchestrator.\n *\n * Compares a live `Vault`'s plaintext state against a candidate state\n * (another vault, a plain `{ collection: records[] }` map, or a vault\n * dump JSON) and returns a structured `VaultDiff` plan listing the\n * records that would be added, modified, or deleted to bring the live\n * vault into the candidate's shape.\n *\n * Builds on two existing record-level helpers:\n *\n * 1. `diff(a, b)` from `./history/diff.ts` — emits dot-pathed\n * `DiffEntry[]` with `type: 'added' | 'removed' | 'changed'` for\n * each changed field of two records. Used here for the\n * `fieldDiffs` of every `modified` entry, and (with empty result)\n * as the default deep-equal check.\n *\n * 2. `Vault.exportStream()` from `./vault.ts` — the canonical\n * decrypt-and-stream-records iterator. Used to walk both sides\n * when the candidate is itself a `Vault`. ACL-scoped: collections\n * the caller can't read silently drop out, the same way every\n * other plaintext-emitting export pipeline filters them.\n *\n * The new orchestration is the **vault-level** enumeration: bucket\n * each record id into added (only in candidate), deleted (only in\n * vault), or modified (in both with field changes); leave the\n * field-level granularity to the existing `diff()`.\n *\n * Use cases:\n *\n * - Import preview (`@noy-db/as-*` `fromString` returns a plan\n * whose body is a `VaultDiff`).\n * - Backup verification (\"does this `.noydb` bundle from yesterday\n * match the current vault?\").\n * - Two-vault reconciliation (\"what's different between Office A\n * and Office B before we sync?\").\n * - Test assertions (golden-file testing with one-liner\n * `expect(plan.summary).toEqual(...)`).\n *\n * @module\n */\n\nimport type { Vault } from '../kernel/vault.js'\nimport { diff as fieldDiff, type DiffEntry as FieldDiffEntry } from '../with-commit/history/diff.js'\n\n// ─── Public types ──────────────────────────────────────────────────────\n\n/** Per-record entry shape — added and deleted records carry only the record value. */\nexport interface VaultDiffEntry<T = unknown> {\n readonly collection: string\n readonly id: string\n readonly record: T\n /**\n * Unencrypted envelope metadata for the RECEIVER-side record.\n * Populated only when `diffVault` is called with `{includeMetadata: true}`.\n * Default: `undefined` (zero extra reads, no behavior change).\n *\n * Populated for `modified` (the CURRENT receiver state, before the candidate\n * is applied) and `deleted` (the receiver envelope of the record being\n * removed). `added` entries have no receiver envelope at diff time, so their\n * `metadata` is always absent.\n */\n readonly metadata?: {\n readonly version: number\n readonly timestamp: string\n readonly by?: string\n readonly source?: string\n readonly sourceTs?: string\n }\n}\n\n/** Modified records carry both halves of the diff plus the field-level breakdown. */\nexport interface VaultDiffModifiedEntry<T = unknown> extends VaultDiffEntry<T> {\n /** The record as it stands in the live vault. */\n readonly before: T\n /** Top-level keys whose values differ between `before` and `record`. */\n readonly fieldsChanged: readonly string[]\n /**\n * Field-level diff entries from `diff(before, record)`. Reuses the\n * existing per-record diff helper so consumers can render git-style\n * `path: from → to` rows without re-walking the records.\n */\n readonly fieldDiffs: readonly FieldDiffEntry[]\n}\n\nexport interface VaultDiff<T = unknown> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n /** Only populated when `options.includeUnchanged: true`. */\n readonly unchanged: readonly VaultDiffEntry<T>[] | undefined\n readonly summary: {\n readonly add: number\n readonly modify: number\n readonly delete: number\n readonly total: number\n }\n /**\n * Format the diff as a human-readable string.\n *\n * - `'count'` — one line, just the numbers (`12 added · 3 modified · 0 deleted`)\n * - `'one-line'` — count plus a single overview line\n * - `'full'` — count + one row per added/modified/deleted record (default)\n */\n format(opts?: { detail?: 'count' | 'one-line' | 'full' }): string\n}\n\nexport interface DiffOptions {\n /** Restrict the diff to a subset of collections. */\n readonly collections?: readonly string[]\n /** Field on each record that carries its id. Defaults to `'id'`. */\n readonly idKey?: string\n /** Override the default deep-equal check for \"modified vs unchanged\". */\n readonly compareFn?: (a: unknown, b: unknown) => boolean\n /** If true, include unchanged records in the diff (off by default to save memory). */\n readonly includeUnchanged?: boolean\n /**\n * When `true`, each entry in `added`, `modified`, and `deleted` will carry a\n * `metadata` field with the RECEIVER-side envelope metadata\n * (`version`, `timestamp`, `by?`, `source?`, `sourceTs?`).\n *\n * Off by default — no extra adapter reads, no behavior change for existing callers.\n */\n readonly includeMetadata?: boolean\n}\n\n/**\n * Candidate state to diff the vault against:\n *\n * - A `Vault` instance — both sides are walked via `exportStream()`.\n * - A `Record<collection, records[]>` map — same shape `as-json.toObject()`\n * produces. Useful for diffing parsed file content against the live vault.\n * - A `VaultDump` (output of `vault.dump()`) — a JSON string carrying the\n * full vault state. Parsed and reduced to the map shape above.\n */\nexport type DiffCandidate<T = unknown> =\n | Vault\n | Record<string, readonly T[]>\n | string\n\n// ─── Implementation ────────────────────────────────────────────────────\n\n/**\n * Compute the diff between a live vault and a candidate state.\n *\n * Ungated shared import/merge infrastructure: the `as-*` exporters call this\n * internally from their `fromString`/import merge logic, so it is always\n * available (not behind `withCargo()`). Only `extractPartition` is a gated\n * cargo capability.\n *\n * Returns a fully buffered `VaultDiff` — no streaming. Memory cost is\n * O(n + m) in the row count of vault + candidate. For documented\n * 1K-50K-record vaults this is fine; a streaming variant lands as a\n * follow-up if a > 100K-record consumer arrives.\n */\nexport async function diffVault<T = unknown>(\n vault: Vault,\n candidate: DiffCandidate<T>,\n options: DiffOptions = {},\n): Promise<VaultDiff<T>> {\n const idKey = options.idKey ?? 'id'\n const filter = options.collections ? new Set(options.collections) : null\n const compareFn =\n options.compareFn ?? ((a: unknown, b: unknown) => fieldDiff(a, b).length === 0)\n\n // Side A — walk the live vault via exportStream(). Each chunk arrives\n // already decrypted and ACL-scoped, so collections the caller can't\n // read silently drop out. exportStream's records are typed `unknown[]`\n // — diffVault is the type-erasure boundary; the caller asserts the\n // record shape via the function's `<T>` generic.\n const live = new Map<string, Map<string, T>>()\n for await (const chunk of vault.exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = live.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n live.set(chunk.collection, collection)\n }\n\n // Side B — normalise the candidate into the same shape.\n const cand = await normaliseCandidate<T>(candidate, idKey, filter)\n\n // Walk every (collection, id) on either side and bucket.\n const added: VaultDiffEntry<T>[] = []\n const modified: VaultDiffModifiedEntry<T>[] = []\n const deleted: VaultDiffEntry<T>[] = []\n const unchanged: VaultDiffEntry<T>[] | undefined = options.includeUnchanged ? [] : undefined\n\n const collectionNames = new Set([...live.keys(), ...cand.keys()])\n for (const collection of [...collectionNames].sort()) {\n const liveColl = live.get(collection) ?? new Map<string, T>()\n const candColl = cand.get(collection) ?? new Map<string, T>()\n const allIds = new Set([...liveColl.keys(), ...candColl.keys()])\n\n for (const id of [...allIds].sort()) {\n const before = liveColl.get(id)\n const after = candColl.get(id)\n\n if (before === undefined && after !== undefined) {\n // added: record only in candidate — no receiver envelope\n added.push({ collection, id, record: after })\n } else if (before !== undefined && after === undefined) {\n // deleted: record only in receiver — attach metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\n deleted.push({ collection, id, record: before, ...(metadata !== undefined ? { metadata } : {}) })\n } else if (before !== undefined && after !== undefined) {\n if (compareFn(before, after)) {\n unchanged?.push({ collection, id, record: after })\n } else {\n // modified: record in both — attach receiver-side metadata if requested\n const metadata = options.includeMetadata\n ? (await vault.collection(collection).getMetadata(id)) ?? undefined\n : undefined\n const fieldDiffs = fieldDiff(before, after)\n const fieldsChanged = uniqueTopLevelKeys(fieldDiffs)\n modified.push({\n collection,\n id,\n record: after,\n before,\n fieldsChanged,\n fieldDiffs,\n ...(metadata !== undefined ? { metadata } : {}),\n })\n }\n }\n }\n }\n\n const summary = {\n add: added.length,\n modify: modified.length,\n delete: deleted.length,\n total: added.length + modified.length + deleted.length,\n }\n\n return {\n added,\n modified,\n deleted,\n unchanged,\n summary,\n format(opts) {\n return formatDiff(opts?.detail ?? 'full', { added, modified, deleted, summary })\n },\n }\n}\n\n// ─── Internals ─────────────────────────────────────────────────────────\n\nasync function normaliseCandidate<T>(\n candidate: DiffCandidate<T>,\n idKey: string,\n filter: Set<string> | null,\n): Promise<Map<string, Map<string, T>>> {\n const out = new Map<string, Map<string, T>>()\n\n // Vault instance — duck-type via the exportStream method (matches\n // vault.ts's structural shape without forcing a runtime instanceof check\n // that would import the class and risk circular deps).\n if (\n typeof candidate === 'object' &&\n candidate !== null &&\n 'exportStream' in candidate &&\n typeof (candidate as Vault).exportStream === 'function'\n ) {\n for await (const chunk of (candidate as Vault).exportStream({ granularity: 'collection' })) {\n if (filter && !filter.has(chunk.collection)) continue\n const collection = out.get(chunk.collection) ?? new Map<string, T>()\n for (const record of chunk.records) {\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record as T)\n }\n out.set(chunk.collection, collection)\n }\n return out\n }\n\n // String — assume a vault.dump() JSON string. Parse and reduce to the map shape.\n if (typeof candidate === 'string') {\n let parsed: unknown\n try {\n parsed = JSON.parse(candidate)\n } catch (err) {\n throw new Error(\n `diffVault: candidate string is not valid JSON (${(err as Error).message})`,\n )\n }\n return collectionsFromObject<T>(parsed, idKey, filter)\n }\n\n // Plain object — `Record<collection, records[]>` (same shape as-json.toObject() returns).\n return collectionsFromObject<T>(candidate, idKey, filter)\n}\n\nfunction collectionsFromObject<T>(\n raw: unknown,\n idKey: string,\n filter: Set<string> | null,\n): Map<string, Map<string, T>> {\n const out = new Map<string, Map<string, T>>()\n if (raw === null || typeof raw !== 'object') {\n throw new Error('diffVault: candidate must be a Vault, an object, or a JSON string')\n }\n // A vault dump JSON has a top-level shape like { _compartment, _keyring, <coll>: <records[]> }.\n // We accept both: keys starting with `_` are skipped (they're metadata), the rest are collections.\n for (const [key, value] of Object.entries(raw)) {\n if (key.startsWith('_')) continue\n if (filter && !filter.has(key)) continue\n if (!Array.isArray(value)) continue\n const collection = new Map<string, T>()\n for (const record of value as readonly T[]) {\n if (record === null || typeof record !== 'object') continue\n const id = readIdField(record, idKey)\n if (!id) continue\n collection.set(id, record)\n }\n out.set(key, collection)\n }\n return out\n}\n\nfunction uniqueTopLevelKeys(diffs: readonly FieldDiffEntry[]): readonly string[] {\n const keys = new Set<string>()\n for (const d of diffs) {\n // path is dot-separated; the top-level key is everything before the\n // first `.` or `[`. (`a.b.c` → `a`, `tags[0]` → `tags`, `(root)` → `(root)`).\n const m = /^[^.[]+/.exec(d.path)\n if (m) keys.add(m[0])\n }\n return [...keys]\n}\n\n/**\n * Pull the id field off a record without going through `String(obj)`,\n * which would emit `[object Object]` for nested objects and silently\n * collapse rows that share the same parent. Only string and number ids\n * are accepted; anything else returns the empty string and the record\n * is skipped at the call site.\n */\nfunction readIdField(record: unknown, idKey: string): string {\n if (record === null || typeof record !== 'object') return ''\n const v = (record as Record<string, unknown>)[idKey]\n if (typeof v === 'string') return v\n if (typeof v === 'number' && Number.isFinite(v)) return String(v)\n return ''\n}\n\ninterface FormatBuckets<T> {\n readonly added: readonly VaultDiffEntry<T>[]\n readonly modified: readonly VaultDiffModifiedEntry<T>[]\n readonly deleted: readonly VaultDiffEntry<T>[]\n readonly summary: VaultDiff<T>['summary']\n}\n\nfunction formatDiff<T>(\n detail: 'count' | 'one-line' | 'full',\n b: FormatBuckets<T>,\n): string {\n const head = `${b.summary.add} added · ${b.summary.modify} modified · ${b.summary.delete} deleted`\n if (detail === 'count') return head\n if (b.summary.total === 0) return head + '\\n(no changes)'\n if (detail === 'one-line') return head\n\n const rows: string[] = [head, '']\n for (const e of b.added) rows.push(`${e.collection}/${e.id}\\tadded`)\n for (const e of b.modified) {\n const fields = e.fieldDiffs\n .map((f) => `${f.path}: ${shortJSON(f.from)} → ${shortJSON(f.to)}`)\n .join(', ')\n rows.push(`${e.collection}/${e.id}\\tmodified\\t${fields}`)\n }\n for (const e of b.deleted) rows.push(`${e.collection}/${e.id}\\tdeleted`)\n return rows.join('\\n')\n}\n\nfunction shortJSON(value: unknown): string {\n if (value === undefined) return 'undefined'\n const s = JSON.stringify(value)\n // JSON.stringify returns string for any JSON value except `undefined`\n // (handled above), `function`, and `symbol`. Fall back to a static\n // tag for those — never let an arbitrary object hit the default\n // stringifier (which the lint rule explicitly bans).\n if (typeof s !== 'string') return '<unrepresentable>'\n return s.length > 60 ? s.slice(0, 57) + '...' : s\n}\n","/**\n * Enable the cargo (partition extraction) capability.\n * Pass to `createNoydb({ cargoStrategy: withCargo() })` to make the source-side\n * `extractPartition(vault, ...)` free function live. The extraction crypto\n * engine is dynamically imported here, so it stays out of the floor bundle\n * until opted in. The recipient-side `adoptPartition` /\n * `decryptExtractedPartition` free functions — and `diffVault` (shared\n * import/merge infra) — are ungated and unaffected.\n */\nimport type { CargoStrategy } from './strategy.js'\n\nexport function withCargo(): CargoStrategy {\n return {\n async extractPartition(vault, opts) {\n const { extractPartitionCore } = await import('./extract-partition.js')\n return extractPartitionCore(vault, opts)\n },\n }\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","/**\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-secret.js'\nimport type { SealingKeyProvider } from '../with-party/team/managed-secret.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 secret. */\nexport interface CreateOwnerStandardOptions {\n readonly userId: string\n readonly secret: string\n readonly transferKey: Uint8Array\n}\n\n/**\n * Managed-mode owner: the secret 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 secretMode: '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 'secretMode' in o && o.secretMode === '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 secret. Managed mode: the\n * secret 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 secret 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 secret. Managed mode mints a random secret, seals\n // it under the provider, and persists _meta/sealed-secret (so the\n // partition auto-unlocks on the recipient's device); standard mode uses the\n // caller's secret. Idempotent under retry — resolveManagedSecret's reopen\n // arm reuses an already-sealed secret.\n const secret = isManaged(opts)\n ? await resolveManagedSecret(store, vaultName, opts.sealingKey)\n : opts.secret\n\n // Mint the owner keyring (KEK + _users DEK + canary, written to disk).\n const unlocked = await createOwnerKeyring(store, vaultName, { userId: userId, secret: secret })\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 secret + 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/cargo 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 secretMode: 'managed',\n sealingKey: opts.sealingKey,\n shamirRecovery: opts.shamirRecovery,\n })\n await db.team.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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2JA,eAAsB,UACpB,OACA,WACA,UAAuB,CAAC,GACD;AACvB,QAAM,QAAQ,QAAQ,SAAS;AAC/B,QAAM,SAAS,QAAQ,cAAc,IAAI,IAAI,QAAQ,WAAW,IAAI;AACpE,QAAM,YACJ,QAAQ,cAAc,CAAC,GAAY,MAAe,KAAU,GAAG,CAAC,EAAE,WAAW;AAO/E,QAAM,OAAO,oBAAI,IAA4B;AAC7C,mBAAiB,SAAS,MAAM,aAAa,EAAE,aAAa,aAAa,CAAC,GAAG;AAC3E,QAAI,UAAU,CAAC,OAAO,IAAI,MAAM,UAAU,EAAG;AAC7C,UAAM,aAAa,KAAK,IAAI,MAAM,UAAU,KAAK,oBAAI,IAAe;AACpE,eAAW,UAAU,MAAM,SAAS;AAClC,YAAM,KAAK,YAAY,QAAQ,KAAK;AACpC,UAAI,CAAC,GAAI;AACT,iBAAW,IAAI,IAAI,MAAW;AAAA,IAChC;AACA,SAAK,IAAI,MAAM,YAAY,UAAU;AAAA,EACvC;AAGA,QAAM,OAAO,MAAM,mBAAsB,WAAW,OAAO,MAAM;AAGjE,QAAM,QAA6B,CAAC;AACpC,QAAM,WAAwC,CAAC;AAC/C,QAAM,UAA+B,CAAC;AACtC,QAAM,YAA6C,QAAQ,mBAAmB,CAAC,IAAI;AAEnF,QAAM,kBAAkB,oBAAI,IAAI,CAAC,GAAG,KAAK,KAAK,GAAG,GAAG,KAAK,KAAK,CAAC,CAAC;AAChE,aAAW,cAAc,CAAC,GAAG,eAAe,EAAE,KAAK,GAAG;AACpD,UAAM,WAAW,KAAK,IAAI,UAAU,K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"./chunk-W2OG6JOL.js";
3
+ } from "./chunk-QZWTRENR.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-5WZXVULX.js.map
209
+ //# sourceMappingURL=chunk-ZTLOXFPB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/with-formula/overlay-views/virtual-collection.ts"],"sourcesContent":["import { OverlayIdMismatchError } from '../../kernel/errors.js'\nimport type { Collection } from '../../kernel/collection.js'\nimport type { OverlayedViewSpec } from './types.js'\n\n/**\n * Virtual-collection proxy returned by `vault.collection(overlayName)`\n * when `overlayName` is a registered `withOverlayedView`.\n *\n * Implements the core `Collection<T>`-shaped read/write surface with\n * merge-on-read semantics:\n * - `get(id)`: overlay row wins iff `overlay[shadowField] === shadowValue`;\n * when `spec.mergeMode` is set, an intermediate status may instead pull\n * a declared subset of fields from the overlay over the base\n * - `list()` / `.query()`: union of ids, per-id merge applied\n * - `put(record)` / `put(id, record)`: routes to overlay; id derived\n * via the base MV's `rowKey` (validated on the two-arg form)\n * - `delete(id)`: removes the overlay row only; base stays\n *\n * Reactive APIs (`live`, `subscribe`, `query().live()`) are out of\n * scope for this release and surface as \"not yet implemented\" — wired in a\n * future sub-issue.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class OverlayedCollection<T extends Record<string, unknown> = any> {\n constructor(\n private readonly spec: OverlayedViewSpec,\n private readonly baseCollection: Collection<T>,\n private readonly overlayCollection: Collection<T>,\n private readonly baseRowKey: ((row: Record<string, unknown>) => string) | undefined,\n ) {}\n\n /**\n * Convenience accessors for advanced callers that need to bypass the\n * virtual layer (bulk imports, direct overlay queries). Mirrors the\n * spec's \"direct writes to the underlying overlay collection skip\n * the validation\" escape hatch.\n */\n readonly overlay = {\n rowKey: (row: Record<string, unknown>): string => {\n if (!this.baseRowKey) {\n throw new Error(\n `Overlay \"${this.spec.name}\": base \"${this.spec.base}\" is not an MV — ` +\n `cannot auto-derive id from the row. Use \\`put(id, record)\\` instead.`,\n )\n }\n return this.baseRowKey(row)\n },\n }\n\n /** Get the merged row by id. */\n async get(id: string): Promise<T | null> {\n const overlayRow = await this.overlayCollection.get(id)\n const baseRow = await this.baseCollection.get(id)\n return this.mergeRows(overlayRow, baseRow)\n }\n\n /** List union of base + overlay ids, applying the merge per row. */\n async list(): Promise<T[]> {\n const baseRows = await this.baseCollection.list()\n const overlayRows = await this.overlayCollection.list()\n const idOf = (row: T): string => {\n // Best-effort: use baseRowKey if available, else assume the row\n // has a `.id` field (common pattern). The spec requires every\n // base MV to declare `rowKey`, so the first branch is the\n // canonical path.\n if (this.baseRowKey) return this.baseRowKey(row as Record<string, unknown>)\n const idField = (row as Record<string, unknown>).id\n return typeof idField === 'string' ? idField : ''\n }\n // Key base + overlay rows by id, then union the id sets and run the\n // same per-id merge `get()` uses. Nulls (overlay-only rows that\n // don't qualify and have no base) are filtered out.\n const baseById = new Map<string, T>()\n const overlayById = new Map<string, T>()\n for (const row of baseRows) {\n const id = idOf(row)\n if (id) baseById.set(id, row)\n }\n for (const row of overlayRows) {\n const id = idOf(row)\n if (id) overlayById.set(id, row)\n }\n const out: T[] = []\n for (const id of new Set([...baseById.keys(), ...overlayById.keys()])) {\n const merged = this.mergeRows(overlayById.get(id) ?? null, baseById.get(id) ?? null)\n if (merged !== null) out.push(merged)\n }\n return out\n }\n\n /**\n * Write to the overlay. Two forms:\n * - `put(record)`: id is derived via the base MV's `rowKey(record)`.\n * Throws if the base isn't an MV.\n * - `put(id, record)`: validates `id === rowKey(record)`; throws\n * `OverlayIdMismatchError` on mismatch.\n */\n async put(idOrRecord: string | T, maybeRecord?: T): Promise<void> {\n let id: string\n let record: T\n if (maybeRecord === undefined) {\n // Single-arg form: put(record). Derive id via base rowKey.\n record = idOrRecord as T\n if (!this.baseRowKey) {\n throw new Error(\n `Overlay \"${this.spec.name}\".put(record): base \"${this.spec.base}\" is not an MV. ` +\n `Use put(id, record) explicitly.`,\n )\n }\n id = this.baseRowKey(record as Record<string, unknown>)\n } else {\n // Two-arg form: put(id, record). Validate against rowKey.\n id = idOrRecord as string\n record = maybeRecord\n if (this.baseRowKey) {\n const expected = this.baseRowKey(record as Record<string, unknown>)\n if (id !== expected) {\n throw new OverlayIdMismatchError(id, expected)\n }\n }\n }\n await this.overlayCollection.put(id, record)\n }\n\n /**\n * Remove the overlay row only. Idempotent (no-op on absent).\n * The base row is untouched — if a base row exists for `id`,\n * subsequent reads return it.\n */\n async delete(id: string): Promise<void> {\n await this.overlayCollection.delete(id)\n }\n\n /**\n * Merge a single id's overlay + base rows into the visible row.\n *\n * Priority (first match wins):\n * 1. Binary shadow win — overlay present AND\n * `overlay[shadowField] === shadowValue` → return the overlay row\n * entirely. This stays FIRST so the original binary behaviour is\n * unchanged whether or not `mergeMode` is configured.\n * 2. Field-level merge — overlay present, `mergeMode` configured,\n * and a rule whose `whenStatus` equals `overlay[shadowField]`.\n * The matched rule pulls its `overlayFields` (those present on\n * the overlay row) on top of the base row. With no base row, the\n * overlay row is returned as-is.\n * 3. Fallback — return the base row (possibly `null`). An\n * overlay-only row that qualifies under neither (1) nor (2) and\n * has no base is therefore NOT surfaced.\n */\n private mergeRows(overlayRow: T | null, baseRow: T | null): T | null {\n const shadowField = this.spec.shadowField\n if (\n overlayRow !== null &&\n (overlayRow as Record<string, unknown>)[shadowField] === this.spec.shadowValue\n ) {\n return overlayRow\n }\n if (overlayRow !== null && this.spec.mergeMode) {\n const status = (overlayRow as Record<string, unknown>)[shadowField]\n const rule = this.spec.mergeMode.rules.find((r) => r.whenStatus === status)\n if (rule) {\n if (baseRow === null) return overlayRow\n const overlaySrc = overlayRow as Record<string, unknown>\n const picked: Record<string, unknown> = {}\n for (const field of rule.overlayFields) {\n if (field in overlaySrc) picked[field] = overlaySrc[field]\n }\n return { ...(baseRow as Record<string, unknown>), ...picked } as T\n }\n }\n return baseRow\n }\n\n // ─── Throw-stubs for the unimplemented Collection<T> surface ───────\n //\n // `Vault.collection(name)` widens the return type to `Collection<T>`\n // for the overlay intercept, but `OverlayedCollection` doesn't\n // implement the full surface. These stubs catch the common\n // reactive / chainable APIs with a clear \"not yet implemented\"\n // error pointing at the relevant issue — so consumers don't hit a\n // cryptic `undefined is not a function` runtime crash.\n //\n // Throw-stubs so consumers get actionable errors rather than cryptic crashes.\n\n /** @throws — chainable Query<T> over a virtual collection is deferred. */\n query(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".query() is not yet implemented for overlay views (#154). ` +\n `Use \\`list()\\` + filter for now, or read from the underlying \\`${this.spec.base}\\` / \\`${this.spec.overlay}\\` collections directly. ` +\n `Reactive APIs land in a future MV sub-issue.`,\n )\n }\n\n /** @throws — change-stream subscription over a virtual collection is deferred. */\n subscribe(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".subscribe() is not yet implemented for overlay views (#154). ` +\n `Subscribe to the underlying \\`${this.spec.base}\\` / \\`${this.spec.overlay}\\` collections individually for now. ` +\n `Merged change-stream lands in a future MV sub-issue.`,\n )\n }\n\n /** @throws — live query over a virtual collection is deferred. */\n live(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".live() is not yet implemented for overlay views (#154). ` +\n `Reactive APIs land in a future MV sub-issue.`,\n )\n }\n\n /** @throws — async iteration over a virtual collection is deferred. */\n scan(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".scan() is not yet implemented for overlay views (#154). ` +\n `Use \\`list()\\` for now (no row-count ceiling at niwat scale), or scan the underlying collections directly.`,\n )\n }\n\n /** @throws — lazy-mode query is not applicable to virtual collections. */\n lazyQuery(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".lazyQuery() is not supported. ` +\n `Virtual collections always materialize through base + overlay reads — lazy-mode indexed lookups don't apply.`,\n )\n }\n\n /** @throws — bulk-atomic put is deferred to a future MV sub-issue. */\n putManyAtomic(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".putManyAtomic() is not yet implemented for overlay views (#154). ` +\n `Use sequential \\`.put(record)\\` calls for now, or write to \\`${this.spec.overlay}\\` directly.`,\n )\n }\n\n /** @throws — bulk delete is deferred to a future MV sub-issue. */\n deleteMany(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".deleteMany() is not yet implemented for overlay views (#154). ` +\n `Use sequential \\`.delete(id)\\` calls for now, or operate on \\`${this.spec.overlay}\\` directly.`,\n )\n }\n\n /** @throws — `.first()` over a virtual collection is deferred. */\n first(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".first() is not yet implemented for overlay views (#154). ` +\n `Use \\`(await list())[0]\\` for now.`,\n )\n }\n\n /** @throws — `.count()` over a virtual collection is deferred. */\n count(): never {\n throw new Error(\n `OverlayedCollection \"${this.spec.name}\".count() is not yet implemented for overlay views (#154). ` +\n `Use \\`(await list()).length\\` for now.`,\n )\n }\n}\n"],"mappings":";;;;;AAuBO,IAAM,sBAAN,MAAmE;AAAA,EACxE,YACmB,MACA,gBACA,mBACA,YACjB;AAJiB;AACA;AACA;AACA;AAAA,EAChB;AAAA,EAJgB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASV,UAAU;AAAA,IACjB,QAAQ,CAAC,QAAyC;AAChD,UAAI,CAAC,KAAK,YAAY;AACpB,cAAM,IAAI;AAAA,UACR,YAAY,KAAK,KAAK,IAAI,YAAY,KAAK,KAAK,IAAI;AAAA,QAEtD;AAAA,MACF;AACA,aAAO,KAAK,WAAW,GAAG;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA,EAGA,MAAM,IAAI,IAA+B;AACvC,UAAM,aAAa,MAAM,KAAK,kBAAkB,IAAI,EAAE;AACtD,UAAM,UAAU,MAAM,KAAK,eAAe,IAAI,EAAE;AAChD,WAAO,KAAK,UAAU,YAAY,OAAO;AAAA,EAC3C;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wBAAwB,KAAK,KAAK,IAAI,gGACH,KAAK,KAAK,IAAI,UAAU,KAAK,KAAK,OAAO;AAAA,IAE9E;AAAA,EACF;AAAA;AAAA,EAGA,OAAc;AACZ,UAAM,IAAI;AAAA,MACR,wBAAwB,KAAK,KAAK,IAAI;AAAA,IAExC;AAAA,EACF;AAAA;AAAA,EAGA,OAAc;AACZ,UAAM,IAAI;AAAA,MACR,wBAAwB,KAAK,KAAK,IAAI;AAAA,IAExC;AAAA,EACF;AAAA;AAAA,EAGA,YAAmB;AACjB,UAAM,IAAI;AAAA,MACR,wBAAwB,KAAK,KAAK,IAAI;AAAA,IAExC;AAAA,EACF;AAAA;AAAA,EAGA,gBAAuB;AACrB,UAAM,IAAI;AAAA,MACR,wBAAwB,KAAK,KAAK,IAAI,mIAC4B,KAAK,KAAK,OAAO;AAAA,IACrF;AAAA,EACF;AAAA;AAAA,EAGA,aAAoB;AAClB,UAAM,IAAI;AAAA,MACR,wBAAwB,KAAK,KAAK,IAAI,iIAC6B,KAAK,KAAK,OAAO;AAAA,IACtF;AAAA,EACF;AAAA;AAAA,EAGA,QAAe;AACb,UAAM,IAAI;AAAA,MACR,wBAAwB,KAAK,KAAK,IAAI;AAAA,IAExC;AAAA,EACF;AAAA;AAAA,EAGA,QAAe;AACb,UAAM,IAAI;AAAA,MACR,wBAAwB,KAAK,KAAK,IAAI;AAAA,IAExC;AAAA,EACF;AACF;","names":[]}
@@ -2,7 +2,7 @@ import {
2
2
  classified,
3
3
  luhnCheck,
4
4
  withClassified
5
- } from "../chunk-KS6SAVCZ.js";
5
+ } from "../chunk-GU3IP74F.js";
6
6
  import {
7
7
  ClassifiedNeverStoredError,
8
8
  ClassifiedValidationError,
@@ -11,15 +11,15 @@ import {
11
11
  isClassifiedFieldSpec,
12
12
  isClassifiedGroup,
13
13
  resolveClassifiedFields
14
- } from "../chunk-Z4PD65VQ.js";
15
- import "../chunk-JVBO4SZL.js";
16
- import "../chunk-VCTXU4AT.js";
14
+ } from "../chunk-EE7UHLKH.js";
15
+ import "../chunk-6UBZ6I5Z.js";
16
+ import "../chunk-QBAC3GXA.js";
17
17
  import {
18
18
  ClassifiedConfigError,
19
19
  ClassifiedRevealError,
20
20
  ClassifiedRotationError,
21
21
  ClassifiedVerifyError
22
- } from "../chunk-W2OG6JOL.js";
22
+ } from "../chunk-QZWTRENR.js";
23
23
  import "../chunk-PZ5AY32C.js";
24
24
  export {
25
25
  ClassifiedConfigError,
@@ -13,11 +13,11 @@ function markerForFields(vdigFields) {
13
13
  async function persistClassifiedMarkerForFields(store, vault, collectionName, vdigFields, dek) {
14
14
  const marker = markerForFields(vdigFields);
15
15
  if (marker === null) return;
16
- const { persistClassifiedMarker } = await import("./register-PAM3ASRZ.js");
16
+ const { persistClassifiedMarker } = await import("./register-UKU2J6MN.js");
17
17
  await persistClassifiedMarker({ store, vault, collectionName, dek, marker });
18
18
  }
19
19
  async function readClassifiedMarkerDigestOnly(store, vault, collectionName, dek) {
20
- const { loadPersistedSchema } = await import("./storage-3MEJUENZ.js");
20
+ const { loadPersistedSchema } = await import("./storage-YVHZUISN.js");
21
21
  const persisted = await loadPersistedSchema(store, vault, collectionName, dek);
22
22
  return persisted?.classified?.digestOnly ?? [];
23
23
  }
@@ -25,4 +25,4 @@ export {
25
25
  persistClassifiedMarkerForFields,
26
26
  readClassifiedMarkerDigestOnly
27
27
  };
28
- //# sourceMappingURL=classified-marker-QWMASIT7.js.map
28
+ //# sourceMappingURL=classified-marker-7PKJBFCG.js.map