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

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 (367) hide show
  1. package/dist/aggregate/index.js +4 -4
  2. package/dist/api-UPAT2O3M.js +20 -0
  3. package/dist/as/index.js +12 -12
  4. package/dist/attestation/index.js +18 -18
  5. package/dist/{backup-YPUEKIJC.js → backup-JL2GOTYQ.js} +11 -11
  6. package/dist/blobs/index.js +27 -15
  7. package/dist/blobs/index.js.map +1 -1
  8. package/dist/broker/index.js +12 -12
  9. package/dist/by/index.js +2 -2
  10. package/dist/cargo/index.js +51 -22
  11. package/dist/{chunk-QDPZWTN2.js → chunk-25G7U6RD.js} +2 -2
  12. package/dist/{chunk-WKGF2TJR.js → chunk-25ZDB25Z.js} +2 -2
  13. package/dist/{chunk-5WZXVULX.js → chunk-2ITLQZV5.js} +2 -2
  14. package/dist/{chunk-WNGGJWF7.js → chunk-2JZ763FV.js} +2 -2
  15. package/dist/{chunk-U6JMEH2P.js → chunk-2KL6NDD4.js} +90 -3
  16. package/dist/chunk-2KL6NDD4.js.map +1 -0
  17. package/dist/{chunk-RJ6K6K5M.js → chunk-2RMDVWGB.js} +2 -2
  18. package/dist/{chunk-VAIS3SOM.js → chunk-2U7Y7BNJ.js} +2 -2
  19. package/dist/{chunk-WZSHL6DQ.js → chunk-2VUISNGP.js} +5 -5
  20. package/dist/chunk-2YELV6TV.js +1 -0
  21. package/dist/{chunk-ANATMTOA.js → chunk-3O62PVDW.js} +3 -3
  22. package/dist/{chunk-VKCADNMR.js → chunk-4JYYIFHW.js} +12 -12
  23. package/dist/{chunk-6HY2X62D.js → chunk-5BB3N4KU.js} +2 -2
  24. package/dist/{chunk-VCTXU4AT.js → chunk-5BHNQNBI.js} +1 -1
  25. package/dist/chunk-5BHNQNBI.js.map +1 -0
  26. package/dist/{chunk-6NQMXTYC.js → chunk-5OZCCLNC.js} +2 -2
  27. package/dist/{chunk-HOONYZY2.js → chunk-5P5AAXYA.js} +2 -2
  28. package/dist/{chunk-KS6SAVCZ.js → chunk-5SZ24DL5.js} +6 -6
  29. package/dist/{chunk-NCCBLYEB.js → chunk-7B4GPCX7.js} +5 -5
  30. package/dist/{chunk-SV6EAJEP.js → chunk-A64XXIIB.js} +4 -4
  31. package/dist/{chunk-WOM2HTML.js → chunk-AFBJHD55.js} +5 -5
  32. package/dist/{chunk-RFI7GGFO.js → chunk-BCOKZC4B.js} +2 -2
  33. package/dist/{chunk-XUW3PXHU.js → chunk-BVZGNMVM.js} +4 -16
  34. package/dist/{chunk-XUW3PXHU.js.map → chunk-BVZGNMVM.js.map} +1 -1
  35. package/dist/{chunk-MT62YSPZ.js → chunk-BZEPJJOK.js} +4 -4
  36. package/dist/{chunk-OCVM6KDH.js → chunk-BZK6JEX4.js} +5 -5
  37. package/dist/{chunk-H2KSZMIX.js → chunk-CCT4WZI6.js} +5 -5
  38. package/dist/{chunk-VEALDPHW.js → chunk-CGPO3ZYB.js} +2 -2
  39. package/dist/{chunk-S3BFKGET.js → chunk-DEQ2JTBR.js} +3 -3
  40. package/dist/{chunk-3ELCWU56.js → chunk-E2R5NRZD.js} +2 -2
  41. package/dist/{chunk-BOKIKJJB.js → chunk-EDC6MLXV.js} +2 -2
  42. package/dist/chunk-F4COUZLL.js +24 -0
  43. package/dist/chunk-F4COUZLL.js.map +1 -0
  44. package/dist/{chunk-JRBNCUNT.js → chunk-FLHOTGOO.js} +3 -3
  45. package/dist/{chunk-6XE5TMPR.js → chunk-GBEXTC6Z.js} +3 -3
  46. package/dist/{chunk-YZQOGE2L.js → chunk-GS3Q2KOZ.js} +2 -2
  47. package/dist/{chunk-M75ZZHSR.js → chunk-GYB2QK5H.js} +2 -2
  48. package/dist/{chunk-EO43ANYJ.js → chunk-GZ2GKOF6.js} +3 -3
  49. package/dist/{chunk-VCBHAE4R.js → chunk-H4SMS4O2.js} +2 -2
  50. package/dist/{chunk-LVGTA624.js → chunk-HGVFJL63.js} +4 -4
  51. package/dist/{chunk-554KLAAN.js → chunk-HVZT5T22.js} +5 -5
  52. package/dist/{chunk-CJ5KKU6X.js → chunk-IGAIOGCN.js} +4 -4
  53. package/dist/{chunk-W2OG6JOL.js → chunk-IGM563N5.js} +18 -1
  54. package/dist/chunk-IGM563N5.js.map +1 -0
  55. package/dist/{chunk-GWKAVKHI.js → chunk-ITI3SJRB.js} +2 -2
  56. package/dist/{chunk-CZTLE22N.js → chunk-IU22SQGU.js} +7 -7
  57. package/dist/{chunk-RTEK4C4I.js → chunk-IUIVDVXM.js} +2 -2
  58. package/dist/{chunk-Z4PD65VQ.js → chunk-IZX3WZBF.js} +4 -4
  59. package/dist/{chunk-RDXW3OBQ.js → chunk-J3VW4J4E.js} +2 -2
  60. package/dist/{chunk-IK43HLDQ.js → chunk-J6U4BOKP.js} +11 -11
  61. package/dist/{chunk-XJMBYYQK.js → chunk-JA5B3SLH.js} +2 -2
  62. package/dist/{chunk-IAO54J4R.js → chunk-JA5O7UEZ.js} +6 -6
  63. package/dist/{chunk-6HPG2YNX.js → chunk-JKWNG3TM.js} +2 -2
  64. package/dist/{chunk-WQIYTNJV.js → chunk-JLHKBAFY.js} +3 -3
  65. package/dist/{chunk-ISMV2QVG.js → chunk-KMONEHDJ.js} +2 -2
  66. package/dist/{chunk-XTHCN77N.js → chunk-KR5EGWI4.js} +7 -19
  67. package/dist/chunk-KR5EGWI4.js.map +1 -0
  68. package/dist/{chunk-JBBSYJHP.js → chunk-KVHWEPT2.js} +2 -2
  69. package/dist/{chunk-2PCAVW2I.js → chunk-L4OA7G5T.js} +2 -2
  70. package/dist/{chunk-IY23KFNZ.js → chunk-LLVW4V7R.js} +3 -3
  71. package/dist/{chunk-N6WF5PKC.js → chunk-M25ZIEB2.js} +2 -2
  72. package/dist/{chunk-FXZDAV62.js → chunk-MEKAMERX.js} +5 -7
  73. package/dist/{chunk-FXZDAV62.js.map → chunk-MEKAMERX.js.map} +1 -1
  74. package/dist/{chunk-UC2ETWF3.js → chunk-MSO2C3KG.js} +2 -2
  75. package/dist/{chunk-ONTBCHCP.js → chunk-N4FZ6ITM.js} +2 -2
  76. package/dist/{chunk-DRWBEDYO.js → chunk-NM4LVUXH.js} +2 -2
  77. package/dist/{chunk-DSBQODMZ.js → chunk-NOT7XA7Q.js} +5 -5
  78. package/dist/{chunk-RA5VTXXG.js → chunk-OGFPMCSP.js} +2 -2
  79. package/dist/{chunk-WHXXI3W5.js → chunk-OGY4ELVE.js} +3 -3
  80. package/dist/{chunk-T36RFODW.js → chunk-OOTTXUNV.js} +2 -2
  81. package/dist/{chunk-A5BDDEXK.js → chunk-OTU5ZI3U.js} +4 -4
  82. package/dist/{chunk-THVIPWRF.js → chunk-OVFCAS7U.js} +9 -9
  83. package/dist/{chunk-IFJTPAQQ.js → chunk-OWE4BNTM.js} +4 -4
  84. package/dist/{chunk-W4TCUGQR.js → chunk-PEY6ZTCF.js} +12 -8
  85. package/dist/{chunk-W4TCUGQR.js.map → chunk-PEY6ZTCF.js.map} +1 -1
  86. package/dist/{chunk-UDSR4X4L.js → chunk-PWZKD4HW.js} +74 -10
  87. package/dist/chunk-PWZKD4HW.js.map +1 -0
  88. package/dist/{chunk-HQBM64EE.js → chunk-QAFWRGVD.js} +127 -8
  89. package/dist/chunk-QAFWRGVD.js.map +1 -0
  90. package/dist/{chunk-ZXEZCY6F.js → chunk-QCUH2G77.js} +6 -6
  91. package/dist/{chunk-XDIAFPUM.js → chunk-QDNVHA2F.js} +2 -2
  92. package/dist/{chunk-FH52K7EG.js → chunk-QRHEAZ2Q.js} +2 -6
  93. package/dist/{chunk-FH52K7EG.js.map → chunk-QRHEAZ2Q.js.map} +1 -1
  94. package/dist/{chunk-A4FXFAKF.js → chunk-QXPOEAKR.js} +2 -2
  95. package/dist/{chunk-EWPOHMN2.js → chunk-RGL53NXZ.js} +3 -3
  96. package/dist/{chunk-TAGR72IR.js → chunk-RI3OKC3Y.js} +4 -4
  97. package/dist/{chunk-5PFOMHTB.js → chunk-S3OYXPSE.js} +9 -9
  98. package/dist/{chunk-JVBO4SZL.js → chunk-STR7WBOB.js} +2 -2
  99. package/dist/{chunk-DDHM2TLX.js → chunk-T7S4V52L.js} +4 -4
  100. package/dist/{chunk-WG4QBZDN.js → chunk-TYBXP6WE.js} +7 -7
  101. package/dist/{chunk-T3GY65MA.js → chunk-UEO5CHOP.js} +3 -3
  102. package/dist/{chunk-RNG4VRP4.js → chunk-V3YB7RGR.js} +3 -3
  103. package/dist/{chunk-R3BLCFD2.js → chunk-V7RGFJ3Z.js} +6 -6
  104. package/dist/{chunk-SMIRGMS7.js → chunk-VEX6G3YL.js} +2 -2
  105. package/dist/{chunk-PK6JIDQ4.js → chunk-VZELV7ZJ.js} +116 -119
  106. package/dist/chunk-VZELV7ZJ.js.map +1 -0
  107. package/dist/{chunk-GULTLPFB.js → chunk-XGVDLQJE.js} +3 -3
  108. package/dist/{chunk-JFCV5QIK.js → chunk-XULHFSHO.js} +5 -5
  109. package/dist/{chunk-S6Q37VGE.js → chunk-XW7NWO4A.js} +2 -2
  110. package/dist/{chunk-YCH5GBN6.js → chunk-Y5E6CH6S.js} +6 -6
  111. package/dist/{chunk-GDG5VVYG.js → chunk-YG2EG6CB.js} +4 -4
  112. package/dist/{chunk-UHNGNKLV.js → chunk-YGBIBOCR.js} +307 -17
  113. package/dist/chunk-YGBIBOCR.js.map +1 -0
  114. package/dist/{chunk-YTGDPCPW.js → chunk-YHPUDB7Q.js} +2 -2
  115. package/dist/{chunk-VRBTNCM4.js → chunk-ZJGZDOQO.js} +6 -6
  116. package/dist/classified/index.js +5 -5
  117. package/dist/{classified-marker-QWMASIT7.js → classified-marker-7S5IEP6Q.js} +3 -3
  118. package/dist/collection-facade-ENLTJZBT.js +44 -0
  119. package/dist/{computed-DSMPXG2Y.js → computed-WZNKRLCY.js} +3 -3
  120. package/dist/consent/index.js +9 -9
  121. package/dist/cover-B5MY43CK.js +36 -0
  122. package/dist/{dead-filter-66VGI6JV.js → dead-filter-KRRD57MR.js} +2 -2
  123. package/dist/delegation-UT76AQIG.js +25 -0
  124. package/dist/derivations/index.js +12 -12
  125. package/dist/derive-SGRCCKVP.js +21 -0
  126. package/dist/{enclave-TKPN2G2U.js → enclave-YFKA3GJT.js} +11 -9
  127. package/dist/executor-TEZYRDN3.js +9 -0
  128. package/dist/executor-UF7LTX6O.js +26 -0
  129. package/dist/executor-WQQRU6DO.js +9 -0
  130. package/dist/export-accessible-HXMKW5LJ.js +23 -0
  131. package/dist/extract-partition-QGQ2R42J.js +38 -0
  132. package/dist/{fanout-sidecar-B5LVUMQX.js → fanout-sidecar-HJV3A7PM.js} +9 -9
  133. package/dist/find-VV6PBIHK.js +11 -0
  134. package/dist/forget/index.js +9 -9
  135. package/dist/guards/index.js +3 -3
  136. package/dist/history/index.js +12 -12
  137. package/dist/i18n/index.js +14 -14
  138. package/dist/index.d.ts +1 -4
  139. package/dist/index.js +151 -168
  140. package/dist/index.js.map +1 -1
  141. package/dist/indexing/index.js +2 -2
  142. package/dist/issue-7JJ4Z7E2.js +19 -0
  143. package/dist/kernel/enclave/index.d.ts +1 -1
  144. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +8 -0
  145. package/dist/kernel/errors.d.ts +19 -0
  146. package/dist/kernel/noydb.d.ts +0 -6
  147. package/dist/kernel/types.d.ts +61 -17
  148. package/dist/kernel/vault.d.ts +0 -4
  149. package/dist/{ledger-PTK7XZYT.js → ledger-SW6QQOAV.js} +11 -11
  150. package/dist/liberate-W5MDWYOV.js +24 -0
  151. package/dist/{link-set-SLJHDNRB.js → link-set-GNGGCFI4.js} +11 -11
  152. package/dist/materialized-views/index.js +19 -19
  153. package/dist/noydb-U63S3Z7F.js +70 -0
  154. package/dist/on/index.js +9 -9
  155. package/dist/overlay-views/index.js +4 -4
  156. package/dist/periods/index.js +19 -17
  157. package/dist/pod/index.js +27 -12
  158. package/dist/{policy-YDLCOX4P.js → policy-EAXSJNOT.js} +5 -5
  159. package/dist/portability/index.js +8 -8
  160. package/dist/{post-register-2YHSADFI.js → post-register-A7HCFBP5.js} +6 -6
  161. package/dist/query/index.js +6 -6
  162. package/dist/register-YBMRLZLO.js +23 -0
  163. package/dist/registry-3LXKNXWI.js +9 -0
  164. package/dist/registry-4V4YQCXJ.js +19 -0
  165. package/dist/registry-ZULMLCJK.js +18 -0
  166. package/dist/request-withdrawal-SEVUEUDG.js +31 -0
  167. package/dist/{reveal-HWO4YMTJ.js → reveal-PB3YG544.js} +6 -6
  168. package/dist/revoke-5QULL5GT.js +24 -0
  169. package/dist/satellites/index.js +1 -1
  170. package/dist/sealed-record/index.js +12 -12
  171. package/dist/{seed-3ZMF5EQA.js → seed-6GTDHL4E.js} +11 -11
  172. package/dist/session/index.js +9 -9
  173. package/dist/shadow/index.js +2 -2
  174. package/dist/share-link/index.d.ts +19 -0
  175. package/dist/share-link/index.js +201 -0
  176. package/dist/share-link/index.js.map +1 -0
  177. package/dist/share-link/share-link.d.ts +123 -0
  178. package/dist/signer-ZMH35FT4.js +25 -0
  179. package/dist/snapshots/index.js +10 -10
  180. package/dist/{stale-VZL4OGUB.js → stale-NB5BGRVU.js} +10 -10
  181. package/dist/storage-QOZKQMID.js +23 -0
  182. package/dist/{store-coordination-provider-FKX3F6TQ.js → store-coordination-provider-3AELCZ4Y.js} +3 -3
  183. package/dist/sync/index.js +10 -9
  184. package/dist/sync/index.js.map +1 -1
  185. package/dist/team/index.js +29 -28
  186. package/dist/tiers/index.js +10 -10
  187. package/dist/to/index.js +1 -1
  188. package/dist/tx/index.js +3 -3
  189. package/dist/util/index.js +1 -1
  190. package/dist/{verify-26Y5GNMK.js → verify-MXN66IIH.js} +5 -5
  191. package/dist/via/blob/active.d.ts +27 -1
  192. package/dist/via/blob/index.d.ts +4 -0
  193. package/dist/{walk-IPLXE36W.js → walk-H4YE52S2.js} +11 -11
  194. package/dist/with/index.js +11 -11
  195. package/dist/with-audit/periods/periods.d.ts +1 -16
  196. package/dist/with-audit/periods/vault-facade.d.ts +6 -0
  197. package/dist/with-audit/periods/window.d.ts +16 -0
  198. package/dist/{legacy/kernel.d.ts → with-cargo/floor.d.ts} +1 -1
  199. package/dist/with-cargo/index.d.ts +12 -1
  200. package/dist/with-party/directory/cover/index.d.ts +0 -5
  201. package/dist/with-party/directory/cover/schema.d.ts +0 -6
  202. package/dist/with-party/directory/cover/storage.d.ts +0 -8
  203. package/dist/with-party/directory/cover/types.d.ts +0 -21
  204. package/dist/with-party/team/sync-period-scope.d.ts +78 -0
  205. package/dist/with-party/team/sync.d.ts +13 -0
  206. package/dist/with-pod/bundle.d.ts +0 -2
  207. package/dist/with-pod/index.d.ts +2 -1
  208. package/dist/with-shape/blobs/blob-compaction.d.ts +43 -3
  209. package/dist/with-shape/blobs/blob-pinning.d.ts +112 -0
  210. package/dist/with-shape/blobs/blob-set.d.ts +85 -1
  211. package/dist/withdraw-accessible-HPOVNG2G.js +28 -0
  212. package/package.json +7 -7
  213. package/dist/api-3A3S4SHH.js +0 -20
  214. package/dist/bundle/index.js +0 -153
  215. package/dist/bundle/index.js.map +0 -1
  216. package/dist/chunk-CHFZDSE4.js +0 -1
  217. package/dist/chunk-HQBM64EE.js.map +0 -1
  218. package/dist/chunk-PK6JIDQ4.js.map +0 -1
  219. package/dist/chunk-TIGPQDYP.js +0 -14
  220. package/dist/chunk-TIGPQDYP.js.map +0 -1
  221. package/dist/chunk-U6JMEH2P.js.map +0 -1
  222. package/dist/chunk-UDSR4X4L.js.map +0 -1
  223. package/dist/chunk-UHNGNKLV.js.map +0 -1
  224. package/dist/chunk-VCTXU4AT.js.map +0 -1
  225. package/dist/chunk-W2OG6JOL.js.map +0 -1
  226. package/dist/chunk-XTHCN77N.js.map +0 -1
  227. package/dist/collection-facade-KMBWNCYP.js +0 -44
  228. package/dist/cover-QJRXINN5.js +0 -52
  229. package/dist/delegation-SU6CV3W7.js +0 -25
  230. package/dist/derive-6RWU4EOA.js +0 -21
  231. package/dist/executor-KGNLJD6M.js +0 -9
  232. package/dist/executor-UX4FASYZ.js +0 -26
  233. package/dist/executor-XGIS6CR7.js +0 -9
  234. package/dist/export-accessible-LKW3QV22.js +0 -23
  235. package/dist/extract-partition-UP2ARO75.js +0 -38
  236. package/dist/find-YS6XWB46.js +0 -11
  237. package/dist/issue-3ACYX7LO.js +0 -19
  238. package/dist/legacy/bundle.d.ts +0 -30
  239. package/dist/liberate-MQQXBUCY.js +0 -24
  240. package/dist/noydb-ANIW5FLE.js +0 -69
  241. package/dist/register-PAM3ASRZ.js +0 -23
  242. package/dist/registry-4S2U2TR4.js +0 -19
  243. package/dist/registry-NPOWJHC4.js +0 -9
  244. package/dist/registry-VZ3CCI2R.js +0 -18
  245. package/dist/request-withdrawal-DI3H5WUI.js +0 -31
  246. package/dist/revoke-R5CZSVUT.js +0 -24
  247. package/dist/signer-MBVHW4WE.js +0 -25
  248. package/dist/storage-3MEJUENZ.js +0 -23
  249. package/dist/withdraw-accessible-TZDATQVR.js +0 -28
  250. /package/dist/{api-3A3S4SHH.js.map → api-UPAT2O3M.js.map} +0 -0
  251. /package/dist/{backup-YPUEKIJC.js.map → backup-JL2GOTYQ.js.map} +0 -0
  252. /package/dist/{chunk-QDPZWTN2.js.map → chunk-25G7U6RD.js.map} +0 -0
  253. /package/dist/{chunk-WKGF2TJR.js.map → chunk-25ZDB25Z.js.map} +0 -0
  254. /package/dist/{chunk-5WZXVULX.js.map → chunk-2ITLQZV5.js.map} +0 -0
  255. /package/dist/{chunk-WNGGJWF7.js.map → chunk-2JZ763FV.js.map} +0 -0
  256. /package/dist/{chunk-RJ6K6K5M.js.map → chunk-2RMDVWGB.js.map} +0 -0
  257. /package/dist/{chunk-VAIS3SOM.js.map → chunk-2U7Y7BNJ.js.map} +0 -0
  258. /package/dist/{chunk-WZSHL6DQ.js.map → chunk-2VUISNGP.js.map} +0 -0
  259. /package/dist/{chunk-CHFZDSE4.js.map → chunk-2YELV6TV.js.map} +0 -0
  260. /package/dist/{chunk-ANATMTOA.js.map → chunk-3O62PVDW.js.map} +0 -0
  261. /package/dist/{chunk-VKCADNMR.js.map → chunk-4JYYIFHW.js.map} +0 -0
  262. /package/dist/{chunk-6HY2X62D.js.map → chunk-5BB3N4KU.js.map} +0 -0
  263. /package/dist/{chunk-6NQMXTYC.js.map → chunk-5OZCCLNC.js.map} +0 -0
  264. /package/dist/{chunk-HOONYZY2.js.map → chunk-5P5AAXYA.js.map} +0 -0
  265. /package/dist/{chunk-KS6SAVCZ.js.map → chunk-5SZ24DL5.js.map} +0 -0
  266. /package/dist/{chunk-NCCBLYEB.js.map → chunk-7B4GPCX7.js.map} +0 -0
  267. /package/dist/{chunk-SV6EAJEP.js.map → chunk-A64XXIIB.js.map} +0 -0
  268. /package/dist/{chunk-WOM2HTML.js.map → chunk-AFBJHD55.js.map} +0 -0
  269. /package/dist/{chunk-RFI7GGFO.js.map → chunk-BCOKZC4B.js.map} +0 -0
  270. /package/dist/{chunk-MT62YSPZ.js.map → chunk-BZEPJJOK.js.map} +0 -0
  271. /package/dist/{chunk-OCVM6KDH.js.map → chunk-BZK6JEX4.js.map} +0 -0
  272. /package/dist/{chunk-H2KSZMIX.js.map → chunk-CCT4WZI6.js.map} +0 -0
  273. /package/dist/{chunk-VEALDPHW.js.map → chunk-CGPO3ZYB.js.map} +0 -0
  274. /package/dist/{chunk-S3BFKGET.js.map → chunk-DEQ2JTBR.js.map} +0 -0
  275. /package/dist/{chunk-3ELCWU56.js.map → chunk-E2R5NRZD.js.map} +0 -0
  276. /package/dist/{chunk-BOKIKJJB.js.map → chunk-EDC6MLXV.js.map} +0 -0
  277. /package/dist/{chunk-JRBNCUNT.js.map → chunk-FLHOTGOO.js.map} +0 -0
  278. /package/dist/{chunk-6XE5TMPR.js.map → chunk-GBEXTC6Z.js.map} +0 -0
  279. /package/dist/{chunk-YZQOGE2L.js.map → chunk-GS3Q2KOZ.js.map} +0 -0
  280. /package/dist/{chunk-M75ZZHSR.js.map → chunk-GYB2QK5H.js.map} +0 -0
  281. /package/dist/{chunk-EO43ANYJ.js.map → chunk-GZ2GKOF6.js.map} +0 -0
  282. /package/dist/{chunk-VCBHAE4R.js.map → chunk-H4SMS4O2.js.map} +0 -0
  283. /package/dist/{chunk-LVGTA624.js.map → chunk-HGVFJL63.js.map} +0 -0
  284. /package/dist/{chunk-554KLAAN.js.map → chunk-HVZT5T22.js.map} +0 -0
  285. /package/dist/{chunk-CJ5KKU6X.js.map → chunk-IGAIOGCN.js.map} +0 -0
  286. /package/dist/{chunk-GWKAVKHI.js.map → chunk-ITI3SJRB.js.map} +0 -0
  287. /package/dist/{chunk-CZTLE22N.js.map → chunk-IU22SQGU.js.map} +0 -0
  288. /package/dist/{chunk-RTEK4C4I.js.map → chunk-IUIVDVXM.js.map} +0 -0
  289. /package/dist/{chunk-Z4PD65VQ.js.map → chunk-IZX3WZBF.js.map} +0 -0
  290. /package/dist/{chunk-RDXW3OBQ.js.map → chunk-J3VW4J4E.js.map} +0 -0
  291. /package/dist/{chunk-IK43HLDQ.js.map → chunk-J6U4BOKP.js.map} +0 -0
  292. /package/dist/{chunk-XJMBYYQK.js.map → chunk-JA5B3SLH.js.map} +0 -0
  293. /package/dist/{chunk-IAO54J4R.js.map → chunk-JA5O7UEZ.js.map} +0 -0
  294. /package/dist/{chunk-6HPG2YNX.js.map → chunk-JKWNG3TM.js.map} +0 -0
  295. /package/dist/{chunk-WQIYTNJV.js.map → chunk-JLHKBAFY.js.map} +0 -0
  296. /package/dist/{chunk-ISMV2QVG.js.map → chunk-KMONEHDJ.js.map} +0 -0
  297. /package/dist/{chunk-JBBSYJHP.js.map → chunk-KVHWEPT2.js.map} +0 -0
  298. /package/dist/{chunk-2PCAVW2I.js.map → chunk-L4OA7G5T.js.map} +0 -0
  299. /package/dist/{chunk-IY23KFNZ.js.map → chunk-LLVW4V7R.js.map} +0 -0
  300. /package/dist/{chunk-N6WF5PKC.js.map → chunk-M25ZIEB2.js.map} +0 -0
  301. /package/dist/{chunk-UC2ETWF3.js.map → chunk-MSO2C3KG.js.map} +0 -0
  302. /package/dist/{chunk-ONTBCHCP.js.map → chunk-N4FZ6ITM.js.map} +0 -0
  303. /package/dist/{chunk-DRWBEDYO.js.map → chunk-NM4LVUXH.js.map} +0 -0
  304. /package/dist/{chunk-DSBQODMZ.js.map → chunk-NOT7XA7Q.js.map} +0 -0
  305. /package/dist/{chunk-RA5VTXXG.js.map → chunk-OGFPMCSP.js.map} +0 -0
  306. /package/dist/{chunk-WHXXI3W5.js.map → chunk-OGY4ELVE.js.map} +0 -0
  307. /package/dist/{chunk-T36RFODW.js.map → chunk-OOTTXUNV.js.map} +0 -0
  308. /package/dist/{chunk-A5BDDEXK.js.map → chunk-OTU5ZI3U.js.map} +0 -0
  309. /package/dist/{chunk-THVIPWRF.js.map → chunk-OVFCAS7U.js.map} +0 -0
  310. /package/dist/{chunk-IFJTPAQQ.js.map → chunk-OWE4BNTM.js.map} +0 -0
  311. /package/dist/{chunk-ZXEZCY6F.js.map → chunk-QCUH2G77.js.map} +0 -0
  312. /package/dist/{chunk-XDIAFPUM.js.map → chunk-QDNVHA2F.js.map} +0 -0
  313. /package/dist/{chunk-A4FXFAKF.js.map → chunk-QXPOEAKR.js.map} +0 -0
  314. /package/dist/{chunk-EWPOHMN2.js.map → chunk-RGL53NXZ.js.map} +0 -0
  315. /package/dist/{chunk-TAGR72IR.js.map → chunk-RI3OKC3Y.js.map} +0 -0
  316. /package/dist/{chunk-5PFOMHTB.js.map → chunk-S3OYXPSE.js.map} +0 -0
  317. /package/dist/{chunk-JVBO4SZL.js.map → chunk-STR7WBOB.js.map} +0 -0
  318. /package/dist/{chunk-DDHM2TLX.js.map → chunk-T7S4V52L.js.map} +0 -0
  319. /package/dist/{chunk-WG4QBZDN.js.map → chunk-TYBXP6WE.js.map} +0 -0
  320. /package/dist/{chunk-T3GY65MA.js.map → chunk-UEO5CHOP.js.map} +0 -0
  321. /package/dist/{chunk-RNG4VRP4.js.map → chunk-V3YB7RGR.js.map} +0 -0
  322. /package/dist/{chunk-R3BLCFD2.js.map → chunk-V7RGFJ3Z.js.map} +0 -0
  323. /package/dist/{chunk-SMIRGMS7.js.map → chunk-VEX6G3YL.js.map} +0 -0
  324. /package/dist/{chunk-GULTLPFB.js.map → chunk-XGVDLQJE.js.map} +0 -0
  325. /package/dist/{chunk-JFCV5QIK.js.map → chunk-XULHFSHO.js.map} +0 -0
  326. /package/dist/{chunk-S6Q37VGE.js.map → chunk-XW7NWO4A.js.map} +0 -0
  327. /package/dist/{chunk-YCH5GBN6.js.map → chunk-Y5E6CH6S.js.map} +0 -0
  328. /package/dist/{chunk-GDG5VVYG.js.map → chunk-YG2EG6CB.js.map} +0 -0
  329. /package/dist/{chunk-YTGDPCPW.js.map → chunk-YHPUDB7Q.js.map} +0 -0
  330. /package/dist/{chunk-VRBTNCM4.js.map → chunk-ZJGZDOQO.js.map} +0 -0
  331. /package/dist/{classified-marker-QWMASIT7.js.map → classified-marker-7S5IEP6Q.js.map} +0 -0
  332. /package/dist/{collection-facade-KMBWNCYP.js.map → collection-facade-ENLTJZBT.js.map} +0 -0
  333. /package/dist/{computed-DSMPXG2Y.js.map → computed-WZNKRLCY.js.map} +0 -0
  334. /package/dist/{cover-QJRXINN5.js.map → cover-B5MY43CK.js.map} +0 -0
  335. /package/dist/{dead-filter-66VGI6JV.js.map → dead-filter-KRRD57MR.js.map} +0 -0
  336. /package/dist/{delegation-SU6CV3W7.js.map → delegation-UT76AQIG.js.map} +0 -0
  337. /package/dist/{derive-6RWU4EOA.js.map → derive-SGRCCKVP.js.map} +0 -0
  338. /package/dist/{enclave-TKPN2G2U.js.map → enclave-YFKA3GJT.js.map} +0 -0
  339. /package/dist/{executor-KGNLJD6M.js.map → executor-TEZYRDN3.js.map} +0 -0
  340. /package/dist/{executor-UX4FASYZ.js.map → executor-UF7LTX6O.js.map} +0 -0
  341. /package/dist/{executor-XGIS6CR7.js.map → executor-WQQRU6DO.js.map} +0 -0
  342. /package/dist/{export-accessible-LKW3QV22.js.map → export-accessible-HXMKW5LJ.js.map} +0 -0
  343. /package/dist/{extract-partition-UP2ARO75.js.map → extract-partition-QGQ2R42J.js.map} +0 -0
  344. /package/dist/{fanout-sidecar-B5LVUMQX.js.map → fanout-sidecar-HJV3A7PM.js.map} +0 -0
  345. /package/dist/{find-YS6XWB46.js.map → find-VV6PBIHK.js.map} +0 -0
  346. /package/dist/{issue-3ACYX7LO.js.map → issue-7JJ4Z7E2.js.map} +0 -0
  347. /package/dist/{ledger-PTK7XZYT.js.map → ledger-SW6QQOAV.js.map} +0 -0
  348. /package/dist/{liberate-MQQXBUCY.js.map → liberate-W5MDWYOV.js.map} +0 -0
  349. /package/dist/{link-set-SLJHDNRB.js.map → link-set-GNGGCFI4.js.map} +0 -0
  350. /package/dist/{noydb-ANIW5FLE.js.map → noydb-U63S3Z7F.js.map} +0 -0
  351. /package/dist/{policy-YDLCOX4P.js.map → policy-EAXSJNOT.js.map} +0 -0
  352. /package/dist/{post-register-2YHSADFI.js.map → post-register-A7HCFBP5.js.map} +0 -0
  353. /package/dist/{register-PAM3ASRZ.js.map → register-YBMRLZLO.js.map} +0 -0
  354. /package/dist/{registry-4S2U2TR4.js.map → registry-3LXKNXWI.js.map} +0 -0
  355. /package/dist/{registry-NPOWJHC4.js.map → registry-4V4YQCXJ.js.map} +0 -0
  356. /package/dist/{registry-VZ3CCI2R.js.map → registry-ZULMLCJK.js.map} +0 -0
  357. /package/dist/{request-withdrawal-DI3H5WUI.js.map → request-withdrawal-SEVUEUDG.js.map} +0 -0
  358. /package/dist/{reveal-HWO4YMTJ.js.map → reveal-PB3YG544.js.map} +0 -0
  359. /package/dist/{revoke-R5CZSVUT.js.map → revoke-5QULL5GT.js.map} +0 -0
  360. /package/dist/{seed-3ZMF5EQA.js.map → seed-6GTDHL4E.js.map} +0 -0
  361. /package/dist/{signer-MBVHW4WE.js.map → signer-ZMH35FT4.js.map} +0 -0
  362. /package/dist/{stale-VZL4OGUB.js.map → stale-NB5BGRVU.js.map} +0 -0
  363. /package/dist/{storage-3MEJUENZ.js.map → storage-QOZKQMID.js.map} +0 -0
  364. /package/dist/{store-coordination-provider-FKX3F6TQ.js.map → store-coordination-provider-3AELCZ4Y.js.map} +0 -0
  365. /package/dist/{verify-26Y5GNMK.js.map → verify-MXN66IIH.js.map} +0 -0
  366. /package/dist/{walk-IPLXE36W.js.map → walk-H4YE52S2.js.map} +0 -0
  367. /package/dist/{withdraw-accessible-TZDATQVR.js.map → withdraw-accessible-HPOVNG2G.js.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  installViaBinder
3
- } from "./chunk-JVBO4SZL.js";
3
+ } from "./chunk-STR7WBOB.js";
4
4
  import {
5
5
  LocaleNotSpecifiedError,
6
6
  MissingTranslationError,
7
7
  ScriptViolationError,
8
8
  TranslatorNotConfiguredError
9
- } from "./chunk-W2OG6JOL.js";
9
+ } from "./chunk-IGM563N5.js";
10
10
 
11
11
  // src/port/with/i18n-strategy.ts
12
12
  function notEnabled(op) {
@@ -618,4 +618,4 @@ export {
618
618
  presentI18nForJoin,
619
619
  stripI18nFilled
620
620
  };
621
- //# sourceMappingURL=chunk-GULTLPFB.js.map
621
+ //# sourceMappingURL=chunk-XGVDLQJE.js.map
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  buildAccessibleBundle,
3
3
  resolveAccessibleCollections
4
- } from "./chunk-WKGF2TJR.js";
4
+ } from "./chunk-25ZDB25Z.js";
5
5
  import {
6
6
  sha256Hex
7
- } from "./chunk-HOONYZY2.js";
7
+ } from "./chunk-5P5AAXYA.js";
8
8
  import {
9
9
  NOYDB_FORMAT_VERSION
10
- } from "./chunk-VCTXU4AT.js";
10
+ } from "./chunk-5BHNQNBI.js";
11
11
  import {
12
12
  ReadOnlyError
13
- } from "./chunk-W2OG6JOL.js";
13
+ } from "./chunk-IGM563N5.js";
14
14
 
15
15
  // src/with-audit/portability/withdraw-accessible.ts
16
16
  var FROZEN_SNAPSHOTS_COLLECTION = "_frozen_snapshots";
@@ -114,4 +114,4 @@ export {
114
114
  freezeAndDeleteClosure,
115
115
  withdrawAccessibleData
116
116
  };
117
- //# sourceMappingURL=chunk-JFCV5QIK.js.map
117
+ //# sourceMappingURL=chunk-XULHFSHO.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AttestationNotEnabledError
3
- } from "./chunk-W2OG6JOL.js";
3
+ } from "./chunk-IGM563N5.js";
4
4
 
5
5
  // src/with-audit/attestation/strategy.ts
6
6
  var NO_ATTESTATION = {
@@ -27,4 +27,4 @@ var NO_ATTESTATION = {
27
27
  export {
28
28
  NO_ATTESTATION
29
29
  };
30
- //# sourceMappingURL=chunk-S6Q37VGE.js.map
30
+ //# sourceMappingURL=chunk-XW7NWO4A.js.map
@@ -4,19 +4,19 @@ import {
4
4
  grant,
5
5
  revoke,
6
6
  rotateKeys
7
- } from "./chunk-554KLAAN.js";
7
+ } from "./chunk-HVZT5T22.js";
8
8
  import {
9
9
  openEnvelopeJson
10
- } from "./chunk-W4TCUGQR.js";
10
+ } from "./chunk-PEY6ZTCF.js";
11
11
  import {
12
12
  encrypt
13
- } from "./chunk-HOONYZY2.js";
13
+ } from "./chunk-5P5AAXYA.js";
14
14
  import {
15
15
  NOYDB_FORMAT_VERSION
16
- } from "./chunk-VCTXU4AT.js";
16
+ } from "./chunk-5BHNQNBI.js";
17
17
  import {
18
18
  PermissionDeniedError
19
- } from "./chunk-W2OG6JOL.js";
19
+ } from "./chunk-IGM563N5.js";
20
20
 
21
21
  // src/with-party/team/active.ts
22
22
  function withTeam() {
@@ -96,4 +96,4 @@ export {
96
96
  listCredentials,
97
97
  credentialStatus
98
98
  };
99
- //# sourceMappingURL=chunk-YCH5GBN6.js.map
99
+ //# sourceMappingURL=chunk-Y5E6CH6S.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  canonicalize,
3
3
  derivePersistedSchema
4
- } from "./chunk-BOKIKJJB.js";
4
+ } from "./chunk-EDC6MLXV.js";
5
5
  import {
6
6
  loadPersistedSchemaEntry,
7
7
  savePersistedSchema
8
- } from "./chunk-CJ5KKU6X.js";
8
+ } from "./chunk-IGAIOGCN.js";
9
9
  import {
10
10
  ConflictError
11
- } from "./chunk-W2OG6JOL.js";
11
+ } from "./chunk-IGM563N5.js";
12
12
 
13
13
  // src/with-shape/schema-update/delta.ts
14
14
  function computeSchemaDelta(stored, fresh, collection) {
@@ -164,4 +164,4 @@ export {
164
164
  persistClassifiedMarker,
165
165
  persistSatelliteMarker
166
166
  };
167
- //# sourceMappingURL=chunk-GDG5VVYG.js.map
167
+ //# sourceMappingURL=chunk-YG2EG6CB.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  assertTierAccess,
3
3
  dekKey
4
- } from "./chunk-UC2ETWF3.js";
4
+ } from "./chunk-MSO2C3KG.js";
5
5
  import {
6
6
  liveRecordIsElevated,
7
7
  liveRecordTier
8
- } from "./chunk-DRWBEDYO.js";
8
+ } from "./chunk-NM4LVUXH.js";
9
9
  import {
10
10
  openEnvelopeJson,
11
11
  writeEnvelopeBody
12
- } from "./chunk-W4TCUGQR.js";
12
+ } from "./chunk-PEY6ZTCF.js";
13
13
  import {
14
14
  base64ToBuffer,
15
15
  bufferToBase64,
@@ -21,19 +21,53 @@ import {
21
21
  sha256Hex,
22
22
  unwrapCek,
23
23
  wrapCek
24
- } from "./chunk-HOONYZY2.js";
24
+ } from "./chunk-5P5AAXYA.js";
25
25
  import {
26
26
  NOYDB_FORMAT_VERSION
27
- } from "./chunk-VCTXU4AT.js";
27
+ } from "./chunk-5BHNQNBI.js";
28
28
  import {
29
29
  BlobIntentPendingError,
30
+ BlobOfflineError,
30
31
  ConflictError,
31
32
  NotFoundError,
32
33
  TamperedError,
33
34
  TierNotGrantedError,
34
35
  UnsupportedTierCompositionError,
35
36
  ValidationError
36
- } from "./chunk-W2OG6JOL.js";
37
+ } from "./chunk-IGM563N5.js";
38
+
39
+ // src/with-shape/blobs/blob-pinning.ts
40
+ function memoryBlobPinStore() {
41
+ const rows = /* @__PURE__ */ new Map();
42
+ return {
43
+ async get(key) {
44
+ return rows.get(key) ?? null;
45
+ },
46
+ async set(key, entry) {
47
+ rows.set(key, entry);
48
+ },
49
+ async delete(key) {
50
+ rows.delete(key);
51
+ },
52
+ async entries(prefix) {
53
+ const out = [];
54
+ for (const [key, entry] of rows) {
55
+ if (key.startsWith(prefix)) out.push({ key, entry });
56
+ }
57
+ return out;
58
+ }
59
+ };
60
+ }
61
+ function createBlobPinCache(store) {
62
+ return {
63
+ store: store ?? memoryBlobPinStore(),
64
+ stats: { hits: 0, misses: 0, bytesDownloaded: 0 }
65
+ };
66
+ }
67
+ function blobPinKey(vault, collection, recordId, slotName) {
68
+ const prefix = `${vault}::${collection}::${recordId}::`;
69
+ return slotName === void 0 ? prefix : prefix + slotName;
70
+ }
37
71
 
38
72
  // src/with-shape/blobs/mime-magic.ts
39
73
  function hex(s) {
@@ -403,6 +437,12 @@ var BlobSet = class _BlobSet {
403
437
  objectStore;
404
438
  blobFields;
405
439
  keyring;
440
+ /**
441
+ * Device-local pin registry + external side-cache + KPI counters (#808).
442
+ * Injected by `withBlobs()` (one shared instance per strategy — per
443
+ * "device"); absent on a direct construction that never threads one.
444
+ */
445
+ pinCache;
406
446
  /**
407
447
  * Set only on the cleared clone `atTier()` returns (#749) — never by
408
448
  * `openSlot`/`Collection.blob()`. Its presence is what makes a `BlobSet`
@@ -425,6 +465,7 @@ var BlobSet = class _BlobSet {
425
465
  this.blobFields = opts.blobFields;
426
466
  this.keyring = opts.keyring;
427
467
  this.clearedTier = opts.clearedTier;
468
+ this.pinCache = opts.pinCache;
428
469
  }
429
470
  /**
430
471
  * #724 I1 completion: a legacy (non-`perRecordKeys`) blob has no per-blob
@@ -582,7 +623,8 @@ var BlobSet = class _BlobSet {
582
623
  ...this.userId !== void 0 ? { userId: this.userId } : {},
583
624
  ...this.maxBlobBytes !== void 0 ? { maxBlobBytes: this.maxBlobBytes } : {},
584
625
  ...this.objectStore !== void 0 ? { objectStore: this.objectStore } : {},
585
- ...this.blobFields !== void 0 ? { blobFields: this.blobFields } : {}
626
+ ...this.blobFields !== void 0 ? { blobFields: this.blobFields } : {},
627
+ ...this.pinCache !== void 0 ? { pinCache: this.pinCache } : {}
586
628
  });
587
629
  }
588
630
  /** The internal collection that holds slot metadata for this collection's blobs. */
@@ -1115,6 +1157,13 @@ var BlobSet = class _BlobSet {
1115
1157
  * which are fixed for the operation's lifetime in the marker (C1/C2).
1116
1158
  */
1117
1159
  async shredAllForRecord(ownerTier) {
1160
+ if (this.pinCache) {
1161
+ try {
1162
+ const rows = await this.pinCache.store.entries(blobPinKey(this.vault, this.collection, this.recordId));
1163
+ for (const { key } of rows) await this.pinCache.store.delete(key);
1164
+ } catch {
1165
+ }
1166
+ }
1118
1167
  const tierArg = ownerTier ?? 0;
1119
1168
  const intent = await this.resolveShredIntent(tierArg);
1120
1169
  if (!intent) return this.unmarkedShred(tierArg);
@@ -1988,8 +2037,11 @@ var BlobSet = class _BlobSet {
1988
2037
  for (let i = 0; i < blob.chunkCount; i++) {
1989
2038
  const chunk = await this.readChunk(blob.eTag, i, blob.chunkCount, chunkKey);
1990
2039
  if (!chunk) {
1991
- throw new NotFoundError(
1992
- `Blob chunk ${i}/${blob.chunkCount} missing for eTag "${blob.eTag}" on record "${this.recordId}"`
2040
+ throw new BlobOfflineError(
2041
+ this.collection,
2042
+ this.recordId,
2043
+ void 0,
2044
+ `chunk ${i}/${blob.chunkCount} for eTag "${blob.eTag}" is absent from the local store \u2014 content not yet synced to this device, or evicted (#808)`
1993
2045
  );
1994
2046
  }
1995
2047
  chunks.push(chunk);
@@ -2310,7 +2362,11 @@ var BlobSet = class _BlobSet {
2310
2362
  /**
2311
2363
  * Fetch all bytes for the named slot.
2312
2364
  * Returns `null` if the slot does not exist.
2313
- * Throws `NotFoundError` if the index entry exists but a chunk is missing.
2365
+ * Throws `BlobOfflineError` if the content is not available locally (#808):
2366
+ * an internal blob whose chunk envelopes are absent from the local store, or
2367
+ * an external slot with no local cached copy while the object store is
2368
+ * unreachable. External reads populate the device-local encrypted
2369
+ * side-cache, so a repeat read is served locally (see `pin()`).
2314
2370
  */
2315
2371
  async get(slotName) {
2316
2372
  if (await this.ownerRecordElevated()) return null;
@@ -2318,15 +2374,14 @@ var BlobSet = class _BlobSet {
2318
2374
  const slot = slots[slotName];
2319
2375
  if (!slot) return null;
2320
2376
  if (slot.external) {
2321
- if (!this.objectStore) {
2322
- throw new NotFoundError(`Blob slot "${slotName}" is external but no objectStore is configured`);
2323
- }
2324
- return this.objectStore.getObject(slot.external.key);
2377
+ return this.readExternal(slotName, slot);
2325
2378
  }
2326
2379
  const result = await this.loadBlobObject(slot.eTag);
2327
2380
  if (!result) return null;
2328
2381
  const blobDEK = this.encrypted ? await this.getDEK(dekKey(BLOB_COLLECTION, result.atTier)) : void 0;
2329
- return this.fetchAllChunks(result.blob, blobDEK, this.flatFallbackVerifyETag(slot.eTag, result.atTier));
2382
+ const bytes = await this.fetchAllChunks(result.blob, blobDEK, this.flatFallbackVerifyETag(slot.eTag, result.atTier));
2383
+ await this.recordLocalHit(slotName);
2384
+ return bytes;
2330
2385
  }
2331
2386
  /**
2332
2387
  * A URL to fetch an `external` slot's object directly — presigned
@@ -2437,15 +2492,35 @@ var BlobSet = class _BlobSet {
2437
2492
  /**
2438
2493
  * List all slot entries for this record.
2439
2494
  * Returns metadata only — no chunk data is loaded.
2495
+ *
2496
+ * #808: when a pin registry is present (`withBlobs()`), each entry is
2497
+ * annotated with this DEVICE's view — `pinned` / `lastAccessAt` /
2498
+ * `cachedBytes` (see their `SlotInfo` doc comments). The annotations come
2499
+ * from the device-local registry, never the vault store, and are what
2500
+ * `vault.compact()`'s pin exemption + cache-budget LRU pass key off.
2440
2501
  */
2441
2502
  async list() {
2442
2503
  if (await this.ownerRecordElevated()) return [];
2443
2504
  const { slots } = await this.loadSlots();
2444
- return Object.entries(slots).map(([name, slot]) => {
2505
+ const infos = Object.entries(slots).map(([name, slot]) => {
2445
2506
  const pub = { ...slot };
2446
2507
  delete pub.pendingRelease;
2447
2508
  return { name, ...pub };
2448
2509
  });
2510
+ if (!this.pinCache) return infos;
2511
+ const prefix = blobPinKey(this.vault, this.collection, this.recordId);
2512
+ const rows = await this.pinCache.store.entries(prefix);
2513
+ const byName = new Map(rows.map(({ key, entry }) => [key.slice(prefix.length), entry]));
2514
+ return infos.map((info) => {
2515
+ const entry = byName.get(info.name);
2516
+ if (!entry) return info;
2517
+ return {
2518
+ ...info,
2519
+ ...entry.pinned ? { pinned: true } : {},
2520
+ ...entry.lastAccessAt !== void 0 ? { lastAccessAt: entry.lastAccessAt } : {},
2521
+ ...entry.cachedBytes !== void 0 ? { cachedBytes: entry.cachedBytes } : {}
2522
+ };
2523
+ });
2449
2524
  }
2450
2525
  /**
2451
2526
  * Delete the named slot from this record.
@@ -2471,6 +2546,218 @@ var BlobSet = class _BlobSet {
2471
2546
  await this.releaseRef(eTagToRelease, 1, false).catch(() => {
2472
2547
  });
2473
2548
  }
2549
+ if (this.pinCache) {
2550
+ await this.pinCache.store.delete(this.pinKeyFor(slotName)).catch(() => {
2551
+ });
2552
+ }
2553
+ }
2554
+ // ─── Public API: Offline pinning + device-local cache (#808) ──────
2555
+ /**
2556
+ * Pin the named slot for offline availability ON THIS DEVICE.
2557
+ *
2558
+ * - Downloads eagerly (call while online): an internal blob's chunks are
2559
+ * fetched once to prove they are locally readable; an `external` slot's
2560
+ * bytes are fetched from the object store and kept in the device-local
2561
+ * side-cache, **encrypted** under the vault's `_blob` DEK via the same
2562
+ * enclave path as chunk encryption (the object-store copy sits outside
2563
+ * the ZK envelope by design; the local copy does not).
2564
+ * - A pinned slot is EXEMPT from `vault.compact()` eviction — both the
2565
+ * `blobFields` policy pass and the `cacheBudget` LRU pass.
2566
+ * - Pin state is device-local (never synced): it lives in the `withBlobs()`
2567
+ * pin registry, not in the vault store. Each device pins for itself.
2568
+ *
2569
+ * Throws `NotFoundError` for a missing slot and `BlobOfflineError` when the
2570
+ * eager download cannot complete (offline).
2571
+ */
2572
+ async pin(slotName) {
2573
+ this.assertKeyPartSafe(this.recordId, "record id");
2574
+ this.assertKeyPartSafe(slotName, "slot name");
2575
+ const pc = this.requirePinCache("pin");
2576
+ if (await this.ownerRecordElevated()) {
2577
+ throw new NotFoundError(`Slot "${slotName}" not found on record "${this.recordId}"`);
2578
+ }
2579
+ const { slots } = await this.loadSlots();
2580
+ const slot = slots[slotName];
2581
+ if (!slot) throw new NotFoundError(`Slot "${slotName}" not found on record "${this.recordId}"`);
2582
+ const now = (/* @__PURE__ */ new Date()).toISOString();
2583
+ if (slot.external) {
2584
+ const bytes = await this.readExternal(slotName, slot);
2585
+ if (bytes === null) {
2586
+ throw new NotFoundError(`External object for blob slot "${slotName}" is missing from the object store`);
2587
+ }
2588
+ const key2 = this.pinKeyFor(slotName);
2589
+ const entry = await pc.store.get(key2);
2590
+ if (entry?.cipher) {
2591
+ await pc.store.set(key2, { ...entry, pinned: true, pinnedAt: entry.pinnedAt ?? now });
2592
+ } else {
2593
+ await this.cacheExternalCopy(slotName, bytes, { pin: true });
2594
+ }
2595
+ return;
2596
+ }
2597
+ const result = await this.loadBlobObject(slot.eTag);
2598
+ if (!result) throw new NotFoundError(`BlobObject ${slot.eTag} not found`);
2599
+ const blobDEK = this.encrypted ? await this.getDEK(dekKey(BLOB_COLLECTION, result.atTier)) : void 0;
2600
+ await this.fetchAllChunks(result.blob, blobDEK, this.flatFallbackVerifyETag(slot.eTag, result.atTier));
2601
+ const key = this.pinKeyFor(slotName);
2602
+ const prev = await pc.store.get(key);
2603
+ await pc.store.set(key, { ...prev ?? {}, pinned: true, pinnedAt: now, lastAccessAt: now });
2604
+ }
2605
+ /**
2606
+ * Unpin the named slot on this device — it returns to the normal lifecycle:
2607
+ * `blobFields` policy eviction applies again, and any local cached copy
2608
+ * (external slots) stays but becomes budget-managed (`cacheBudget` LRU).
2609
+ * A no-op when the slot is not pinned here.
2610
+ */
2611
+ async unpin(slotName) {
2612
+ this.assertKeyPartSafe(slotName, "slot name");
2613
+ const pc = this.requirePinCache("unpin");
2614
+ const key = this.pinKeyFor(slotName);
2615
+ const entry = await pc.store.get(key);
2616
+ if (!entry?.pinned) return;
2617
+ const rest = { ...entry, pinned: false };
2618
+ delete rest.pinnedAt;
2619
+ await pc.store.set(key, rest);
2620
+ }
2621
+ /** Whether the named slot is pinned for offline ON THIS DEVICE (#808). */
2622
+ async isPinned(slotName) {
2623
+ const pc = this.requirePinCache("isPinned");
2624
+ const entry = await pc.store.get(this.pinKeyFor(slotName));
2625
+ return entry?.pinned === true;
2626
+ }
2627
+ /**
2628
+ * Drop this slot's device-local cached copy (the encrypted external
2629
+ * side-cache) WITHOUT touching the slot, the vault store, or the object
2630
+ * store. Returns the plaintext bytes freed (0 when nothing was cached, the
2631
+ * slot is pinned — pinned copies are exempt — or no registry is present).
2632
+ * The cache-budget pass inside `vault.compact()` is the expected caller;
2633
+ * the LRU access row itself is kept.
2634
+ */
2635
+ async dropLocalCache(slotName) {
2636
+ const pc = this.pinCache;
2637
+ if (!pc) return 0;
2638
+ const key = this.pinKeyFor(slotName);
2639
+ const entry = await pc.store.get(key);
2640
+ if (!entry || entry.pinned || !entry.cipher) return 0;
2641
+ const freed = entry.cachedBytes ?? 0;
2642
+ const rest = { ...entry };
2643
+ delete rest.cipher;
2644
+ delete rest.cachedBytes;
2645
+ await pc.store.set(key, rest);
2646
+ return freed;
2647
+ }
2648
+ // ─── Internal: device-local pin registry plumbing (#808) ──────────
2649
+ /** This slot's registry key — see {@link blobPinKey}. */
2650
+ pinKeyFor(slotName) {
2651
+ return blobPinKey(this.vault, this.collection, this.recordId, slotName);
2652
+ }
2653
+ /** AAD binding for a cached external copy: the row's own registry key. */
2654
+ pinCopyAAD(slotName) {
2655
+ return new TextEncoder().encode(`pin:${this.pinKeyFor(slotName)}`);
2656
+ }
2657
+ requirePinCache(op) {
2658
+ if (!this.pinCache) {
2659
+ throw new ValidationError(
2660
+ `BlobSet.${op}() requires the withBlobs() pin registry \u2014 this handle was constructed without one (#808)`
2661
+ );
2662
+ }
2663
+ return this.pinCache;
2664
+ }
2665
+ /** KPI hit + LRU access stamp for a successful LOCAL read. No-op without a registry. */
2666
+ async recordLocalHit(slotName, prev) {
2667
+ const pc = this.pinCache;
2668
+ if (!pc) return;
2669
+ pc.stats.hits += 1;
2670
+ const key = this.pinKeyFor(slotName);
2671
+ const entry = prev ?? await pc.store.get(key);
2672
+ await pc.store.set(key, { ...entry ?? { pinned: false }, lastAccessAt: (/* @__PURE__ */ new Date()).toISOString() });
2673
+ }
2674
+ /**
2675
+ * Read an `external` slot (#808 taxonomy): local encrypted side-cache first
2676
+ * (hit); else the object store (miss + `bytesDownloaded`), auto-caching the
2677
+ * fetched bytes so the NEXT read — and any later offline read — is local.
2678
+ * A network failure with no local copy is the typed `BlobOfflineError`;
2679
+ * a genuinely absent object (fetch succeeded, nothing there) stays `null`.
2680
+ */
2681
+ async readExternal(slotName, slot) {
2682
+ const pc = this.pinCache;
2683
+ if (pc) {
2684
+ const key = this.pinKeyFor(slotName);
2685
+ const entry = await pc.store.get(key);
2686
+ const cached = entry?.cipher ? await this.decryptCachedCopy(slotName, entry.cipher) : null;
2687
+ if (cached) {
2688
+ await this.recordLocalHit(slotName, entry);
2689
+ return cached;
2690
+ }
2691
+ }
2692
+ if (!this.objectStore) {
2693
+ throw new NotFoundError(`Blob slot "${slotName}" is external but no objectStore is configured`);
2694
+ }
2695
+ let bytes;
2696
+ try {
2697
+ bytes = await this.objectStore.getObject(slot.external.key);
2698
+ } catch (err) {
2699
+ throw new BlobOfflineError(
2700
+ this.collection,
2701
+ this.recordId,
2702
+ slotName,
2703
+ "no local cached copy and the object store is unreachable \u2014 pin() the slot while online to keep it readable offline (#808)",
2704
+ err
2705
+ );
2706
+ }
2707
+ if (bytes === null) return null;
2708
+ if (pc) {
2709
+ pc.stats.misses += 1;
2710
+ pc.stats.bytesDownloaded += bytes.byteLength;
2711
+ await this.cacheExternalCopy(slotName, bytes).catch(() => {
2712
+ });
2713
+ }
2714
+ return bytes;
2715
+ }
2716
+ /**
2717
+ * Decrypt a cached external copy. `null` (treated as a cache miss → network
2718
+ * refresh) when the vault keys can no longer open it — e.g. the copy was
2719
+ * cached before the owning record moved tiers, so it is sealed under a DEK
2720
+ * this handle no longer resolves. Genuine non-crypto failures propagate.
2721
+ */
2722
+ async decryptCachedCopy(slotName, cipher) {
2723
+ if (!this.encrypted) return base64ToBuffer(cipher.data);
2724
+ const dek = await this.getDEK(dekKey(BLOB_COLLECTION, await this.ownerTier()));
2725
+ try {
2726
+ return await decryptBytesWithAAD(cipher.iv, cipher.data, dek, this.pinCopyAAD(slotName));
2727
+ } catch (err) {
2728
+ if (err instanceof TamperedError) return null;
2729
+ throw err;
2730
+ }
2731
+ }
2732
+ /**
2733
+ * Write an external slot's bytes into the device-local side-cache —
2734
+ * ENCRYPTED under the vault's `_blob` DEK (owner tier) via the enclave's
2735
+ * AAD-bound path, mirroring chunk encryption; base64 plaintext with
2736
+ * `iv: ''` only on an unencrypted vault (the envelope convention). A
2737
+ * pre-existing pin flag survives the rewrite.
2738
+ */
2739
+ async cacheExternalCopy(slotName, bytes, opts) {
2740
+ const pc = this.pinCache;
2741
+ if (!pc) return;
2742
+ let cipher;
2743
+ if (this.encrypted) {
2744
+ const dek = await this.getDEK(dekKey(BLOB_COLLECTION, await this.ownerTier()));
2745
+ const enc = await encryptBytesWithAAD(bytes, dek, this.pinCopyAAD(slotName));
2746
+ cipher = { iv: enc.iv, data: enc.data };
2747
+ } else {
2748
+ cipher = { iv: "", data: bufferToBase64(bytes) };
2749
+ }
2750
+ const now = (/* @__PURE__ */ new Date()).toISOString();
2751
+ const key = this.pinKeyFor(slotName);
2752
+ const prev = await pc.store.get(key);
2753
+ const pinned = opts?.pin === true || prev?.pinned === true;
2754
+ await pc.store.set(key, {
2755
+ pinned,
2756
+ ...pinned ? { pinnedAt: (opts?.pin === true ? now : prev?.pinnedAt) ?? now } : {},
2757
+ lastAccessAt: now,
2758
+ cachedBytes: bytes.byteLength,
2759
+ cipher
2760
+ });
2474
2761
  }
2475
2762
  /**
2476
2763
  * Return a native `Response` whose body streams the decrypted,
@@ -2763,6 +3050,9 @@ async function plainSha256Hex(data) {
2763
3050
  }
2764
3051
 
2765
3052
  export {
3053
+ memoryBlobPinStore,
3054
+ createBlobPinCache,
3055
+ blobPinKey,
2766
3056
  detectMimeType,
2767
3057
  detectMagic,
2768
3058
  isPreCompressed,
@@ -2779,4 +3069,4 @@ export {
2779
3069
  DEFAULT_CHUNK_SIZE,
2780
3070
  BlobSet
2781
3071
  };
2782
- //# sourceMappingURL=chunk-UHNGNKLV.js.map
3072
+ //# sourceMappingURL=chunk-YGBIBOCR.js.map