@struktoai/mirage-node 0.0.3-alpha.0 → 0.0.4

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 (433) hide show
  1. package/README.md +1 -1
  2. package/dist/aliyun-PGI57A43.js +10 -0
  3. package/dist/backblaze-TSPL6Y56.js +10 -0
  4. package/dist/box-7XTZYDSO.js +8 -0
  5. package/dist/cas.lua +15 -0
  6. package/dist/ceph-C265UI5T.js +10 -0
  7. package/dist/{chunk-IQVNVTOP.js → chunk-25W4XQJZ.js} +5 -5
  8. package/dist/{chunk-QGRDPSAH.js → chunk-2ERLWAGG.js} +4 -2
  9. package/dist/chunk-2ERLWAGG.js.map +1 -0
  10. package/dist/{chunk-NJMGCT63.js → chunk-2QNPKPZZ.js} +7 -2
  11. package/dist/chunk-2QNPKPZZ.js.map +1 -0
  12. package/dist/{chunk-ZNWVJ6UW.js → chunk-3ASOQTZB.js} +7 -2
  13. package/dist/chunk-3ASOQTZB.js.map +1 -0
  14. package/dist/{chunk-ERELJ7BS.js → chunk-3JZN3GYO.js} +14 -13
  15. package/dist/chunk-3JZN3GYO.js.map +1 -0
  16. package/dist/{chunk-DTAY7LPC.js → chunk-4GYB7DGC.js} +295 -706
  17. package/dist/chunk-4GYB7DGC.js.map +1 -0
  18. package/dist/{chunk-G5BZE7UA.js → chunk-4M73WHIE.js} +3 -3
  19. package/dist/{chunk-Q6CDMOM6.js → chunk-4X6CLF4F.js} +3 -3
  20. package/dist/{chunk-3IJSIVKT.js → chunk-5I7Q7RHW.js} +3 -3
  21. package/dist/{chunk-YPT4JBUY.js → chunk-5YRWF5RP.js} +18 -16
  22. package/dist/chunk-5YRWF5RP.js.map +1 -0
  23. package/dist/chunk-5ZHNPNDD.js +944 -0
  24. package/dist/chunk-5ZHNPNDD.js.map +1 -0
  25. package/dist/{chunk-VGLHY6BK.js → chunk-AULFV3KY.js} +1 -2
  26. package/dist/chunk-AULFV3KY.js.map +1 -0
  27. package/dist/{chunk-A4Z6DZ22.js → chunk-BWLUBJQG.js} +20 -16
  28. package/dist/chunk-BWLUBJQG.js.map +1 -0
  29. package/dist/{chunk-OYV2DN66.js → chunk-BWWU5T2D.js} +3 -3
  30. package/dist/chunk-C7TNKIK5.js +39 -0
  31. package/dist/chunk-C7TNKIK5.js.map +1 -0
  32. package/dist/{chunk-HEHERHQ5.js → chunk-CB76WPUS.js} +13 -14
  33. package/dist/chunk-CB76WPUS.js.map +1 -0
  34. package/dist/chunk-CGGO5NKD.js +1194 -0
  35. package/dist/chunk-CGGO5NKD.js.map +1 -0
  36. package/dist/{chunk-B2ZOKNN4.js → chunk-CQCTCW4S.js} +1 -2
  37. package/dist/chunk-CQCTCW4S.js.map +1 -0
  38. package/dist/{chunk-AJICZLHT.js → chunk-CXQGMFI7.js} +3 -3
  39. package/dist/{chunk-LW25LMIH.js → chunk-D3U7VQCG.js} +1 -2
  40. package/dist/{chunk-LW25LMIH.js.map → chunk-D3U7VQCG.js.map} +1 -1
  41. package/dist/{chunk-RQYEEA2O.js → chunk-DXU7NZPH.js} +3 -3
  42. package/dist/{chunk-XGJ2QERC.js → chunk-E3KXVEYI.js} +8 -4
  43. package/dist/chunk-E3KXVEYI.js.map +1 -0
  44. package/dist/{chunk-L6JPBJAS.js → chunk-EGZNOUMH.js} +3 -3
  45. package/dist/{chunk-DNBAMB5J.js → chunk-EVK6HH6Z.js} +1 -2
  46. package/dist/{chunk-DNBAMB5J.js.map → chunk-EVK6HH6Z.js.map} +1 -1
  47. package/dist/{chunk-BYTU2YC3.js → chunk-F5NWRF32.js} +3 -3
  48. package/dist/{chunk-RLGWMJD3.js → chunk-FRGTDZQT.js} +146 -11
  49. package/dist/chunk-FRGTDZQT.js.map +1 -0
  50. package/dist/{chunk-DYXEITK3.js → chunk-GF75O2EN.js} +4 -2
  51. package/dist/chunk-GF75O2EN.js.map +1 -0
  52. package/dist/{chunk-W7FLHT65.js → chunk-GTAS3QVC.js} +1 -2
  53. package/dist/{chunk-W7FLHT65.js.map → chunk-GTAS3QVC.js.map} +1 -1
  54. package/dist/{chunk-RQK5UPMP.js → chunk-H62XQZUM.js} +4 -3
  55. package/dist/chunk-H62XQZUM.js.map +1 -0
  56. package/dist/{chunk-UT2OPSN4.js → chunk-HCU3B6FW.js} +1 -2
  57. package/dist/chunk-HCU3B6FW.js.map +1 -0
  58. package/dist/chunk-HEDE2377.js +754 -0
  59. package/dist/chunk-HEDE2377.js.map +1 -0
  60. package/dist/{chunk-JZQHKDSY.js → chunk-HGIPWY5Y.js} +22 -11
  61. package/dist/chunk-HGIPWY5Y.js.map +1 -0
  62. package/dist/{chunk-Q2IAILVC.js → chunk-HSD24IP2.js} +8 -4
  63. package/dist/chunk-HSD24IP2.js.map +1 -0
  64. package/dist/{chunk-5YOCVEUB.js → chunk-HWQPEBID.js} +19 -15
  65. package/dist/chunk-HWQPEBID.js.map +1 -0
  66. package/dist/{chunk-SFUCUARB.js → chunk-IEHPTILN.js} +4 -4
  67. package/dist/chunk-IEHPTILN.js.map +1 -0
  68. package/dist/{chunk-C6NHEDHY.js → chunk-IEVLWEBO.js} +15 -14
  69. package/dist/chunk-IEVLWEBO.js.map +1 -0
  70. package/dist/{chunk-YUK3X3B4.js → chunk-IKJQOYI4.js} +1 -2
  71. package/dist/{chunk-YUK3X3B4.js.map → chunk-IKJQOYI4.js.map} +1 -1
  72. package/dist/{chunk-MHCMHKM6.js → chunk-IUXXZHY3.js} +17 -23
  73. package/dist/chunk-IUXXZHY3.js.map +1 -0
  74. package/dist/{chunk-ABTEGAFB.js → chunk-JBDFYIN2.js} +13 -14
  75. package/dist/chunk-JBDFYIN2.js.map +1 -0
  76. package/dist/{chunk-A7X4L4JM.js → chunk-JEBH5APX.js} +15 -15
  77. package/dist/chunk-JEBH5APX.js.map +1 -0
  78. package/dist/{chunk-H3BST2LI.js → chunk-JHI2PHHD.js} +1 -2
  79. package/dist/{chunk-H3BST2LI.js.map → chunk-JHI2PHHD.js.map} +1 -1
  80. package/dist/{chunk-EGB7V74Z.js → chunk-KAWDDS27.js} +1 -3
  81. package/dist/chunk-KAWDDS27.js.map +1 -0
  82. package/dist/{chunk-DP2PP5V2.js → chunk-KGC2OGXI.js} +5 -4
  83. package/dist/chunk-KGC2OGXI.js.map +1 -0
  84. package/dist/{chunk-FXFDBF3P.js → chunk-L4GMDSMB.js} +3 -3
  85. package/dist/{chunk-O7ODGJYL.js → chunk-L7FEZ7LU.js} +3 -3
  86. package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
  87. package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
  88. package/dist/{chunk-UGK4TAVK.js → chunk-LPLZLSMK.js} +1 -2
  89. package/dist/chunk-LPLZLSMK.js.map +1 -0
  90. package/dist/{chunk-5DLOHQJ2.js → chunk-M6E7VK4D.js} +14 -14
  91. package/dist/chunk-M6E7VK4D.js.map +1 -0
  92. package/dist/{chunk-2CC5VW7K.js → chunk-MIQ3ECZM.js} +4 -2
  93. package/dist/chunk-MIQ3ECZM.js.map +1 -0
  94. package/dist/chunk-MRXTUFBZ.js +30 -0
  95. package/dist/chunk-MRXTUFBZ.js.map +1 -0
  96. package/dist/{chunk-RO5IQEDQ.js → chunk-NJ42VNXG.js} +1 -2
  97. package/dist/chunk-NJ42VNXG.js.map +1 -0
  98. package/dist/{chunk-3T3RMDNX.js → chunk-NLXJMXVE.js} +3 -3
  99. package/dist/{chunk-E2ISWXLB.js → chunk-OQKNDS66.js} +1 -1
  100. package/dist/{chunk-E2ISWXLB.js.map → chunk-OQKNDS66.js.map} +1 -1
  101. package/dist/chunk-OSVZKYXS.js +946 -0
  102. package/dist/chunk-OSVZKYXS.js.map +1 -0
  103. package/dist/{chunk-LYDMMNL2.js → chunk-RHUEV4I7.js} +12 -13
  104. package/dist/chunk-RHUEV4I7.js.map +1 -0
  105. package/dist/{chunk-JALIYI6M.js → chunk-S4KVLPBR.js} +7 -2
  106. package/dist/chunk-S4KVLPBR.js.map +1 -0
  107. package/dist/{chunk-XRU5WXZX.js → chunk-SAOQW6ZJ.js} +15 -15
  108. package/dist/chunk-SAOQW6ZJ.js.map +1 -0
  109. package/dist/{chunk-CASCUFK2.js → chunk-SI4GMRXD.js} +14 -15
  110. package/dist/chunk-SI4GMRXD.js.map +1 -0
  111. package/dist/{chunk-HQ4KWN76.js → chunk-SYMNWNC3.js} +3 -3
  112. package/dist/{chunk-PJBQKMCD.js → chunk-TUNR4VUM.js} +3 -3
  113. package/dist/{chunk-XHCBHYN4.js → chunk-UAJYJP5C.js} +7 -2
  114. package/dist/chunk-UAJYJP5C.js.map +1 -0
  115. package/dist/{chunk-OPYQ5KIO.js → chunk-UYA3XL3J.js} +4 -2
  116. package/dist/chunk-UYA3XL3J.js.map +1 -0
  117. package/dist/{chunk-WL7HS7EM.js → chunk-V7JVMG63.js} +3 -3
  118. package/dist/{chunk-LAJJPLEV.js → chunk-VBYIDRNU.js} +7 -3
  119. package/dist/chunk-VBYIDRNU.js.map +1 -0
  120. package/dist/{chunk-NHS7WLEQ.js → chunk-VHED2STW.js} +11 -8
  121. package/dist/chunk-VHED2STW.js.map +1 -0
  122. package/dist/{chunk-JZT4QGIP.js → chunk-VIICUPWQ.js} +1 -2
  123. package/dist/{chunk-JZT4QGIP.js.map → chunk-VIICUPWQ.js.map} +1 -1
  124. package/dist/{chunk-TRTUHCS4.js → chunk-VLRSOWHP.js} +17 -15
  125. package/dist/chunk-VLRSOWHP.js.map +1 -0
  126. package/dist/chunk-W5ZLIQFR.js +764 -0
  127. package/dist/chunk-W5ZLIQFR.js.map +1 -0
  128. package/dist/{chunk-YGZMVNN5.js → chunk-WTSSEUOZ.js} +7 -2
  129. package/dist/chunk-WTSSEUOZ.js.map +1 -0
  130. package/dist/{chunk-OHROA3FQ.js → chunk-WWP2STF5.js} +7 -2
  131. package/dist/chunk-WWP2STF5.js.map +1 -0
  132. package/dist/{chunk-C6NHFMIP.js → chunk-XADEMW6B.js} +3 -3
  133. package/dist/{chunk-KTNDT45N.js → chunk-XEMLYWHK.js} +3 -3
  134. package/dist/{chunk-OZAEWZZ3.js → chunk-XFSEADPC.js} +6 -2
  135. package/dist/chunk-XFSEADPC.js.map +1 -0
  136. package/dist/{chunk-TWGVQLG2.js → chunk-XUUSWR4U.js} +1 -2
  137. package/dist/{chunk-TWGVQLG2.js.map → chunk-XUUSWR4U.js.map} +1 -1
  138. package/dist/{chunk-XLQI4IT2.js → chunk-YBVMZ7SR.js} +7 -2
  139. package/dist/chunk-YBVMZ7SR.js.map +1 -0
  140. package/dist/{chunk-E7RW3SBV.js → chunk-YRJICL2Q.js} +15 -15
  141. package/dist/chunk-YRJICL2Q.js.map +1 -0
  142. package/dist/{chunk-B6SXRCBO.js → chunk-ZM44MGC5.js} +3 -3
  143. package/dist/{chunk-YAVGCQUP.js → chunk-ZMREYTHA.js} +16 -15
  144. package/dist/chunk-ZMREYTHA.js.map +1 -0
  145. package/dist/{chunk-H3I2KZIY.js → chunk-ZPB3SLPK.js} +1 -2
  146. package/dist/{chunk-H3I2KZIY.js.map → chunk-ZPB3SLPK.js.map} +1 -1
  147. package/dist/chunk-ZPZQXHW2.js +1230 -0
  148. package/dist/chunk-ZPZQXHW2.js.map +1 -0
  149. package/dist/{config-34LHOGLM.js → config-2LASFFRD.js} +2 -4
  150. package/dist/config-3WDIJPTG.js +9 -0
  151. package/dist/config-4QV4QYI5.js +9 -0
  152. package/dist/{config-ZFJYQZCH.js → config-54USUVSE.js} +2 -4
  153. package/dist/config-5ZXN2T2H.js +9 -0
  154. package/dist/config-A2GQYJDB.js +9 -0
  155. package/dist/config-BBOLI7VE.js +9 -0
  156. package/dist/{config-VM526IKB.js → config-BIBFLUIR.js} +2 -4
  157. package/dist/{config-EO23EY62.js → config-CPYFOUQO.js} +2 -4
  158. package/dist/{config-3IVQJBNW.js → config-DWSJL3NH.js} +2 -4
  159. package/dist/config-E22XAGYN.js +9 -0
  160. package/dist/config-EHE52ZTK.js +9 -0
  161. package/dist/{config-GE4W4ZJC.js → config-EX3ZJTZI.js} +2 -4
  162. package/dist/{config-QNMKWJ4M.js → config-FRK7ZL37.js} +2 -4
  163. package/dist/{config-LHFFXVYI.js → config-HQXNFQZS.js} +2 -4
  164. package/dist/config-HTXOOAOD.js +9 -0
  165. package/dist/{config-HKRMKD76.js → config-IPNWAJHH.js} +2 -4
  166. package/dist/config-J2C53GOT.js +9 -0
  167. package/dist/config-K63RX6EU.js +9 -0
  168. package/dist/config-L7SBSH5L.js +9 -0
  169. package/dist/config-LEALEMKA.js +9 -0
  170. package/dist/{config-IVY5EQQ2.js → config-M3Z47VYU.js} +2 -4
  171. package/dist/{config-EIHSP5DZ.js → config-MZM3IPFM.js} +2 -4
  172. package/dist/{config-GHRUKEQ6.js → config-OJ2BPESH.js} +2 -4
  173. package/dist/{config-WDAZFXYD.js → config-QO2XUME4.js} +2 -4
  174. package/dist/config-QWQGOXQ5.js +9 -0
  175. package/dist/config-RI7IEZUF.js +9 -0
  176. package/dist/{config-CVZ2AGCO.js → config-SPW6NESU.js} +2 -6
  177. package/dist/{config-QAA646XB.js → config-T2IUIU5C.js} +2 -4
  178. package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
  179. package/dist/config-VKKZGC7V.js +9 -0
  180. package/dist/config-W7EVPJNK.js +11 -0
  181. package/dist/config-WKQ3FGTZ.js +9 -0
  182. package/dist/config-WVILHDFV.js +11 -0
  183. package/dist/{config-Q45Y46YT.js → config-XU6D5C7E.js} +2 -4
  184. package/dist/databricks_volume-ETRDJVVQ.js +7 -0
  185. package/dist/digitalocean-QP72DR4J.js +10 -0
  186. package/dist/discord-BSN5RB3E.js +8 -0
  187. package/dist/disk-24NWTN2I.js +7 -0
  188. package/dist/dropbox-OSTZXSIE.js +8 -0
  189. package/dist/email-4ZFPSWIN.js +8 -0
  190. package/dist/gcs-PFWR6MIW.js +10 -0
  191. package/dist/gdocs-GPAZRQG5.js +8 -0
  192. package/dist/gdrive-XSX6A7B3.js +8 -0
  193. package/dist/github-EQ4NXUTA.js +8 -0
  194. package/dist/github_ci-QL5B2Q2N.js +8 -0
  195. package/dist/gmail-2TBT4CVH.js +8 -0
  196. package/dist/gridfs-KZRZ6SIB.js +9 -0
  197. package/dist/gsheets-N53WEXN2.js +8 -0
  198. package/dist/gslides-TATSARTH.js +8 -0
  199. package/dist/hf_buckets-BK7NGJWS.js +10 -0
  200. package/dist/hf_datasets-UQ5QGM4L.js +10 -0
  201. package/dist/hf_models-75LFCQCS.js +10 -0
  202. package/dist/hf_spaces-6T2KB3UC.js +10 -0
  203. package/dist/index.d.ts +599 -79
  204. package/dist/index.js +1515 -422
  205. package/dist/index.js.map +1 -1
  206. package/dist/langfuse-AMQCQWNE.js +8 -0
  207. package/dist/linear-V3TXO6CV.js +8 -0
  208. package/dist/minio-IZRZY4C5.js +10 -0
  209. package/dist/mongodb-VMKPQCPX.js +7 -0
  210. package/dist/nextcloud-5RHQCGDO.js +9 -0
  211. package/dist/notion-6PPNTQFM.js +8 -0
  212. package/dist/oci-CKYBSFZJ.js +10 -0
  213. package/dist/postgres-WIQBVL5M.js +7 -0
  214. package/dist/qingstor-AP4IIPLY.js +10 -0
  215. package/dist/r2-C4XGEWQY.js +10 -0
  216. package/dist/redis-6D55Q2WB.js +8 -0
  217. package/dist/s3-XQBI2CXN.js +8 -0
  218. package/dist/scaleway-SEZJVURB.js +10 -0
  219. package/dist/seaweedfs-3XYIAFU2.js +10 -0
  220. package/dist/slack-ZHXDJQY4.js +8 -0
  221. package/dist/ssh-X2MO7JOV.js +8 -0
  222. package/dist/supabase-BBM44UTM.js +10 -0
  223. package/dist/supabase-BBM44UTM.js.map +1 -0
  224. package/dist/tencent-X72USLJ7.js +10 -0
  225. package/dist/tencent-X72USLJ7.js.map +1 -0
  226. package/dist/trello-EER5NG7L.js +8 -0
  227. package/dist/trello-EER5NG7L.js.map +1 -0
  228. package/dist/wasabi-O4MVIUFG.js +10 -0
  229. package/dist/wasabi-O4MVIUFG.js.map +1 -0
  230. package/package.json +9 -5
  231. package/dist/aliyun-TMZRUYCG.js +0 -10
  232. package/dist/backblaze-OHW57DLK.js +0 -10
  233. package/dist/box-UXTCAFOZ.js +0 -8
  234. package/dist/ceph-TNN4I2FT.js +0 -10
  235. package/dist/chunk-2CC5VW7K.js.map +0 -1
  236. package/dist/chunk-5DLOHQJ2.js.map +0 -1
  237. package/dist/chunk-5HCVKTP3.js +0 -2086
  238. package/dist/chunk-5HCVKTP3.js.map +0 -1
  239. package/dist/chunk-5YOCVEUB.js.map +0 -1
  240. package/dist/chunk-A4Z6DZ22.js.map +0 -1
  241. package/dist/chunk-A7X4L4JM.js.map +0 -1
  242. package/dist/chunk-ABTEGAFB.js.map +0 -1
  243. package/dist/chunk-B2ZOKNN4.js.map +0 -1
  244. package/dist/chunk-C6NHEDHY.js.map +0 -1
  245. package/dist/chunk-CASCUFK2.js.map +0 -1
  246. package/dist/chunk-DP2PP5V2.js.map +0 -1
  247. package/dist/chunk-DTAY7LPC.js.map +0 -1
  248. package/dist/chunk-DYXEITK3.js.map +0 -1
  249. package/dist/chunk-E7RW3SBV.js.map +0 -1
  250. package/dist/chunk-EGB7V74Z.js.map +0 -1
  251. package/dist/chunk-ERELJ7BS.js.map +0 -1
  252. package/dist/chunk-HEHERHQ5.js.map +0 -1
  253. package/dist/chunk-JALIYI6M.js.map +0 -1
  254. package/dist/chunk-JZQHKDSY.js.map +0 -1
  255. package/dist/chunk-LAJJPLEV.js.map +0 -1
  256. package/dist/chunk-LYDMMNL2.js.map +0 -1
  257. package/dist/chunk-MHCMHKM6.js.map +0 -1
  258. package/dist/chunk-N72CAZEH.js +0 -1990
  259. package/dist/chunk-N72CAZEH.js.map +0 -1
  260. package/dist/chunk-NHS7WLEQ.js.map +0 -1
  261. package/dist/chunk-NJMGCT63.js.map +0 -1
  262. package/dist/chunk-OHROA3FQ.js.map +0 -1
  263. package/dist/chunk-OPYQ5KIO.js.map +0 -1
  264. package/dist/chunk-OZAEWZZ3.js.map +0 -1
  265. package/dist/chunk-PBBG7VFT.js +0 -1896
  266. package/dist/chunk-PBBG7VFT.js.map +0 -1
  267. package/dist/chunk-Q2IAILVC.js.map +0 -1
  268. package/dist/chunk-QGRDPSAH.js.map +0 -1
  269. package/dist/chunk-RLGWMJD3.js.map +0 -1
  270. package/dist/chunk-RO5IQEDQ.js.map +0 -1
  271. package/dist/chunk-RQK5UPMP.js.map +0 -1
  272. package/dist/chunk-SFUCUARB.js.map +0 -1
  273. package/dist/chunk-TRTUHCS4.js.map +0 -1
  274. package/dist/chunk-U6QSXTUS.js +0 -7
  275. package/dist/chunk-U6QSXTUS.js.map +0 -1
  276. package/dist/chunk-UGK4TAVK.js.map +0 -1
  277. package/dist/chunk-UT2OPSN4.js.map +0 -1
  278. package/dist/chunk-VGLHY6BK.js.map +0 -1
  279. package/dist/chunk-WSGEIVY3.js +0 -1766
  280. package/dist/chunk-WSGEIVY3.js.map +0 -1
  281. package/dist/chunk-XGJ2QERC.js.map +0 -1
  282. package/dist/chunk-XHCBHYN4.js.map +0 -1
  283. package/dist/chunk-XLQI4IT2.js.map +0 -1
  284. package/dist/chunk-XRU5WXZX.js.map +0 -1
  285. package/dist/chunk-YAVGCQUP.js.map +0 -1
  286. package/dist/chunk-YGZMVNN5.js.map +0 -1
  287. package/dist/chunk-YPT4JBUY.js.map +0 -1
  288. package/dist/chunk-ZNWVJ6UW.js.map +0 -1
  289. package/dist/config-3BBWD5AB.js +0 -11
  290. package/dist/config-4UDVSUQJ.js +0 -11
  291. package/dist/config-CMDBAPDH.js +0 -11
  292. package/dist/config-D3RLSPNF.js +0 -11
  293. package/dist/config-DG65OEG3.js +0 -11
  294. package/dist/config-GCQK6NJY.js +0 -11
  295. package/dist/config-GVH27UPE.js +0 -11
  296. package/dist/config-HXVYIXP5.js +0 -11
  297. package/dist/config-IDZMEW73.js +0 -11
  298. package/dist/config-IJJXGLBQ.js +0 -11
  299. package/dist/config-KJOLGVB2.js +0 -11
  300. package/dist/config-KMVCVBYN.js +0 -15
  301. package/dist/config-KYTRXAB2.js +0 -15
  302. package/dist/config-OT2TQQCN.js +0 -11
  303. package/dist/config-QWCY3LBQ.js +0 -11
  304. package/dist/config-ZV6G2ZEC.js +0 -11
  305. package/dist/databricks_volume-HNQ4DJVJ.js +0 -7
  306. package/dist/digitalocean-6SPR4S7V.js +0 -10
  307. package/dist/discord-SAV2RBJV.js +0 -8
  308. package/dist/disk-POACMF4G.js +0 -8
  309. package/dist/dropbox-CQ7MTYX2.js +0 -8
  310. package/dist/email-KBQ7CXS7.js +0 -8
  311. package/dist/gcs-SMIE4VMT.js +0 -10
  312. package/dist/gdocs-X5Y2SIQX.js +0 -8
  313. package/dist/gdrive-SIQPRIGI.js +0 -8
  314. package/dist/github-KBHWANKQ.js +0 -8
  315. package/dist/github_ci-HPITNK37.js +0 -8
  316. package/dist/gmail-DKHAGJNX.js +0 -8
  317. package/dist/gsheets-ZSUDIWGK.js +0 -8
  318. package/dist/gslides-GYXM7IMJ.js +0 -8
  319. package/dist/hf_buckets-RIOMV7WG.js +0 -10
  320. package/dist/hf_datasets-QF4BQ3OK.js +0 -10
  321. package/dist/hf_models-62GC2HPZ.js +0 -10
  322. package/dist/hf_spaces-NVSMUNRM.js +0 -10
  323. package/dist/langfuse-HUAYVPHF.js +0 -8
  324. package/dist/linear-2MM55KBC.js +0 -8
  325. package/dist/minio-L3XE6PQS.js +0 -10
  326. package/dist/mongodb-ZOX4FRHJ.js +0 -7
  327. package/dist/notion-UK4GTMT4.js +0 -8
  328. package/dist/oci-NURLWPL2.js +0 -10
  329. package/dist/postgres-JNFMPAO2.js +0 -7
  330. package/dist/qingstor-W55D5YFO.js +0 -10
  331. package/dist/r2-FSZK7IFI.js +0 -10
  332. package/dist/redis-S6GIPA4Z.js +0 -8
  333. package/dist/s3-GMPUJ65D.js +0 -8
  334. package/dist/scaleway-5VM55Y6D.js +0 -10
  335. package/dist/seaweedfs-J3EPUEPE.js +0 -10
  336. package/dist/slack-FVBXY7KD.js +0 -8
  337. package/dist/ssh-GCXETJ3Z.js +0 -9
  338. package/dist/supabase-HLWNHBBE.js +0 -10
  339. package/dist/tencent-YDO73XBD.js +0 -10
  340. package/dist/trello-CQ53BQUL.js +0 -8
  341. package/dist/wasabi-SOZKPMRQ.js +0 -10
  342. /package/dist/{aliyun-TMZRUYCG.js.map → aliyun-PGI57A43.js.map} +0 -0
  343. /package/dist/{backblaze-OHW57DLK.js.map → backblaze-TSPL6Y56.js.map} +0 -0
  344. /package/dist/{box-UXTCAFOZ.js.map → box-7XTZYDSO.js.map} +0 -0
  345. /package/dist/{ceph-TNN4I2FT.js.map → ceph-C265UI5T.js.map} +0 -0
  346. /package/dist/{chunk-IQVNVTOP.js.map → chunk-25W4XQJZ.js.map} +0 -0
  347. /package/dist/{chunk-G5BZE7UA.js.map → chunk-4M73WHIE.js.map} +0 -0
  348. /package/dist/{chunk-Q6CDMOM6.js.map → chunk-4X6CLF4F.js.map} +0 -0
  349. /package/dist/{chunk-3IJSIVKT.js.map → chunk-5I7Q7RHW.js.map} +0 -0
  350. /package/dist/{chunk-OYV2DN66.js.map → chunk-BWWU5T2D.js.map} +0 -0
  351. /package/dist/{chunk-AJICZLHT.js.map → chunk-CXQGMFI7.js.map} +0 -0
  352. /package/dist/{chunk-RQYEEA2O.js.map → chunk-DXU7NZPH.js.map} +0 -0
  353. /package/dist/{chunk-L6JPBJAS.js.map → chunk-EGZNOUMH.js.map} +0 -0
  354. /package/dist/{chunk-BYTU2YC3.js.map → chunk-F5NWRF32.js.map} +0 -0
  355. /package/dist/{chunk-FXFDBF3P.js.map → chunk-L4GMDSMB.js.map} +0 -0
  356. /package/dist/{chunk-O7ODGJYL.js.map → chunk-L7FEZ7LU.js.map} +0 -0
  357. /package/dist/{chunk-3T3RMDNX.js.map → chunk-NLXJMXVE.js.map} +0 -0
  358. /package/dist/{chunk-HQ4KWN76.js.map → chunk-SYMNWNC3.js.map} +0 -0
  359. /package/dist/{chunk-PJBQKMCD.js.map → chunk-TUNR4VUM.js.map} +0 -0
  360. /package/dist/{chunk-WL7HS7EM.js.map → chunk-V7JVMG63.js.map} +0 -0
  361. /package/dist/{chunk-C6NHFMIP.js.map → chunk-XADEMW6B.js.map} +0 -0
  362. /package/dist/{chunk-KTNDT45N.js.map → chunk-XEMLYWHK.js.map} +0 -0
  363. /package/dist/{chunk-B6SXRCBO.js.map → chunk-ZM44MGC5.js.map} +0 -0
  364. /package/dist/{config-34LHOGLM.js.map → config-2LASFFRD.js.map} +0 -0
  365. /package/dist/{config-3BBWD5AB.js.map → config-3WDIJPTG.js.map} +0 -0
  366. /package/dist/{config-3IVQJBNW.js.map → config-4QV4QYI5.js.map} +0 -0
  367. /package/dist/{config-4UDVSUQJ.js.map → config-54USUVSE.js.map} +0 -0
  368. /package/dist/{config-CMDBAPDH.js.map → config-5ZXN2T2H.js.map} +0 -0
  369. /package/dist/{config-CVZ2AGCO.js.map → config-A2GQYJDB.js.map} +0 -0
  370. /package/dist/{config-D3RLSPNF.js.map → config-BBOLI7VE.js.map} +0 -0
  371. /package/dist/{config-DG65OEG3.js.map → config-BIBFLUIR.js.map} +0 -0
  372. /package/dist/{config-EIHSP5DZ.js.map → config-CPYFOUQO.js.map} +0 -0
  373. /package/dist/{config-EO23EY62.js.map → config-DWSJL3NH.js.map} +0 -0
  374. /package/dist/{config-GCQK6NJY.js.map → config-E22XAGYN.js.map} +0 -0
  375. /package/dist/{config-GE4W4ZJC.js.map → config-EHE52ZTK.js.map} +0 -0
  376. /package/dist/{config-GHRUKEQ6.js.map → config-EX3ZJTZI.js.map} +0 -0
  377. /package/dist/{config-GVH27UPE.js.map → config-FRK7ZL37.js.map} +0 -0
  378. /package/dist/{config-HKRMKD76.js.map → config-HQXNFQZS.js.map} +0 -0
  379. /package/dist/{config-HXVYIXP5.js.map → config-HTXOOAOD.js.map} +0 -0
  380. /package/dist/{config-IDZMEW73.js.map → config-IPNWAJHH.js.map} +0 -0
  381. /package/dist/{config-IJJXGLBQ.js.map → config-J2C53GOT.js.map} +0 -0
  382. /package/dist/{config-IVY5EQQ2.js.map → config-K63RX6EU.js.map} +0 -0
  383. /package/dist/{config-KJOLGVB2.js.map → config-L7SBSH5L.js.map} +0 -0
  384. /package/dist/{config-KMVCVBYN.js.map → config-LEALEMKA.js.map} +0 -0
  385. /package/dist/{config-KYTRXAB2.js.map → config-M3Z47VYU.js.map} +0 -0
  386. /package/dist/{config-LHFFXVYI.js.map → config-MZM3IPFM.js.map} +0 -0
  387. /package/dist/{config-NV5WXP64.js.map → config-OJ2BPESH.js.map} +0 -0
  388. /package/dist/{config-OT2TQQCN.js.map → config-QO2XUME4.js.map} +0 -0
  389. /package/dist/{config-Q45Y46YT.js.map → config-QWQGOXQ5.js.map} +0 -0
  390. /package/dist/{config-QAA646XB.js.map → config-RI7IEZUF.js.map} +0 -0
  391. /package/dist/{config-QNMKWJ4M.js.map → config-SPW6NESU.js.map} +0 -0
  392. /package/dist/{config-QWCY3LBQ.js.map → config-T2IUIU5C.js.map} +0 -0
  393. /package/dist/{config-VM526IKB.js.map → config-UU27ALAA.js.map} +0 -0
  394. /package/dist/{config-WDAZFXYD.js.map → config-VKKZGC7V.js.map} +0 -0
  395. /package/dist/{config-ZFJYQZCH.js.map → config-W7EVPJNK.js.map} +0 -0
  396. /package/dist/{config-ZV6G2ZEC.js.map → config-WKQ3FGTZ.js.map} +0 -0
  397. /package/dist/{databricks_volume-HNQ4DJVJ.js.map → config-WVILHDFV.js.map} +0 -0
  398. /package/dist/{digitalocean-6SPR4S7V.js.map → config-XU6D5C7E.js.map} +0 -0
  399. /package/dist/{discord-SAV2RBJV.js.map → databricks_volume-ETRDJVVQ.js.map} +0 -0
  400. /package/dist/{disk-POACMF4G.js.map → digitalocean-QP72DR4J.js.map} +0 -0
  401. /package/dist/{dropbox-CQ7MTYX2.js.map → discord-BSN5RB3E.js.map} +0 -0
  402. /package/dist/{email-KBQ7CXS7.js.map → disk-24NWTN2I.js.map} +0 -0
  403. /package/dist/{gcs-SMIE4VMT.js.map → dropbox-OSTZXSIE.js.map} +0 -0
  404. /package/dist/{gdocs-X5Y2SIQX.js.map → email-4ZFPSWIN.js.map} +0 -0
  405. /package/dist/{gdrive-SIQPRIGI.js.map → gcs-PFWR6MIW.js.map} +0 -0
  406. /package/dist/{github-KBHWANKQ.js.map → gdocs-GPAZRQG5.js.map} +0 -0
  407. /package/dist/{github_ci-HPITNK37.js.map → gdrive-XSX6A7B3.js.map} +0 -0
  408. /package/dist/{gmail-DKHAGJNX.js.map → github-EQ4NXUTA.js.map} +0 -0
  409. /package/dist/{gsheets-ZSUDIWGK.js.map → github_ci-QL5B2Q2N.js.map} +0 -0
  410. /package/dist/{gslides-GYXM7IMJ.js.map → gmail-2TBT4CVH.js.map} +0 -0
  411. /package/dist/{hf_buckets-RIOMV7WG.js.map → gridfs-KZRZ6SIB.js.map} +0 -0
  412. /package/dist/{hf_datasets-QF4BQ3OK.js.map → gsheets-N53WEXN2.js.map} +0 -0
  413. /package/dist/{hf_models-62GC2HPZ.js.map → gslides-TATSARTH.js.map} +0 -0
  414. /package/dist/{hf_spaces-NVSMUNRM.js.map → hf_buckets-BK7NGJWS.js.map} +0 -0
  415. /package/dist/{langfuse-HUAYVPHF.js.map → hf_datasets-UQ5QGM4L.js.map} +0 -0
  416. /package/dist/{linear-2MM55KBC.js.map → hf_models-75LFCQCS.js.map} +0 -0
  417. /package/dist/{minio-L3XE6PQS.js.map → hf_spaces-6T2KB3UC.js.map} +0 -0
  418. /package/dist/{mongodb-ZOX4FRHJ.js.map → langfuse-AMQCQWNE.js.map} +0 -0
  419. /package/dist/{notion-UK4GTMT4.js.map → linear-V3TXO6CV.js.map} +0 -0
  420. /package/dist/{oci-NURLWPL2.js.map → minio-IZRZY4C5.js.map} +0 -0
  421. /package/dist/{postgres-JNFMPAO2.js.map → mongodb-VMKPQCPX.js.map} +0 -0
  422. /package/dist/{qingstor-W55D5YFO.js.map → nextcloud-5RHQCGDO.js.map} +0 -0
  423. /package/dist/{r2-FSZK7IFI.js.map → notion-6PPNTQFM.js.map} +0 -0
  424. /package/dist/{redis-S6GIPA4Z.js.map → oci-CKYBSFZJ.js.map} +0 -0
  425. /package/dist/{s3-GMPUJ65D.js.map → postgres-WIQBVL5M.js.map} +0 -0
  426. /package/dist/{scaleway-5VM55Y6D.js.map → qingstor-AP4IIPLY.js.map} +0 -0
  427. /package/dist/{seaweedfs-J3EPUEPE.js.map → r2-C4XGEWQY.js.map} +0 -0
  428. /package/dist/{slack-FVBXY7KD.js.map → redis-6D55Q2WB.js.map} +0 -0
  429. /package/dist/{ssh-GCXETJ3Z.js.map → s3-XQBI2CXN.js.map} +0 -0
  430. /package/dist/{supabase-HLWNHBBE.js.map → scaleway-SEZJVURB.js.map} +0 -0
  431. /package/dist/{tencent-YDO73XBD.js.map → seaweedfs-3XYIAFU2.js.map} +0 -0
  432. /package/dist/{trello-CQ53BQUL.js.map → slack-ZHXDJQY4.js.map} +0 -0
  433. /package/dist/{wasabi-SOZKPMRQ.js.map → ssh-X2MO7JOV.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,6 +1,20 @@
1
+ import {
2
+ DropboxResource
3
+ } from "./chunk-HWQPEBID.js";
4
+ import {
5
+ BoxResource
6
+ } from "./chunk-BWLUBJQG.js";
7
+ import {
8
+ normalizeBoxConfig,
9
+ redactBoxConfig
10
+ } from "./chunk-XFSEADPC.js";
1
11
  import {
2
12
  GmailResource
3
- } from "./chunk-HEHERHQ5.js";
13
+ } from "./chunk-CB76WPUS.js";
14
+ import {
15
+ normalizeGoogleConfig,
16
+ redactGoogleConfig
17
+ } from "./chunk-LPDLPRPS.js";
4
18
  import {
5
19
  EMAIL_COMMANDS,
6
20
  EMAIL_OPS,
@@ -8,273 +22,277 @@ import {
8
22
  EMAIL_WRITE_PROMPT,
9
23
  EmailAccessor,
10
24
  EmailResource
11
- } from "./chunk-DTAY7LPC.js";
25
+ } from "./chunk-4GYB7DGC.js";
12
26
  import {
13
27
  buildEmailConfig,
14
28
  normalizeEmailConfig,
15
29
  redactEmailConfig
16
- } from "./chunk-B2ZOKNN4.js";
30
+ } from "./chunk-CQCTCW4S.js";
31
+ import {
32
+ GDocsResource
33
+ } from "./chunk-JEBH5APX.js";
34
+ import {
35
+ GSheetsResource
36
+ } from "./chunk-SAOQW6ZJ.js";
37
+ import {
38
+ normalizeGSheetsConfig,
39
+ redactGSheetsConfig
40
+ } from "./chunk-D3U7VQCG.js";
17
41
  import {
18
42
  GSlidesResource
19
- } from "./chunk-E7RW3SBV.js";
43
+ } from "./chunk-YRJICL2Q.js";
44
+ import {
45
+ normalizeGSlidesConfig,
46
+ redactGSlidesConfig
47
+ } from "./chunk-GTAS3QVC.js";
20
48
  import {
21
49
  GDriveResource
22
- } from "./chunk-TRTUHCS4.js";
50
+ } from "./chunk-VLRSOWHP.js";
23
51
  import {
24
52
  normalizeGDriveConfig,
25
53
  redactGDriveConfig
26
- } from "./chunk-DP2PP5V2.js";
27
- import {
28
- DropboxResource
29
- } from "./chunk-5YOCVEUB.js";
54
+ } from "./chunk-KGC2OGXI.js";
30
55
  import {
31
56
  normalizeDropboxConfig,
32
57
  redactDropboxConfig
33
- } from "./chunk-Q2IAILVC.js";
58
+ } from "./chunk-HSD24IP2.js";
34
59
  import {
35
- BoxResource
36
- } from "./chunk-A4Z6DZ22.js";
60
+ NotionResource
61
+ } from "./chunk-SI4GMRXD.js";
37
62
  import {
38
- normalizeBoxConfig,
39
- redactBoxConfig
40
- } from "./chunk-OZAEWZZ3.js";
63
+ LangfuseResource
64
+ } from "./chunk-M6E7VK4D.js";
41
65
  import {
42
- normalizeGoogleConfig,
43
- redactGoogleConfig
44
- } from "./chunk-54NTYJEO.js";
66
+ normalizeLangfuseConfig,
67
+ redactLangfuseConfig
68
+ } from "./chunk-AULFV3KY.js";
45
69
  import {
46
70
  GitHubResource
47
- } from "./chunk-YPT4JBUY.js";
71
+ } from "./chunk-5YRWF5RP.js";
72
+ import {
73
+ normalizeGitHubConfig,
74
+ redactGitHubConfig
75
+ } from "./chunk-XUUSWR4U.js";
48
76
  import {
49
77
  GitHubCIResource
50
- } from "./chunk-ABTEGAFB.js";
78
+ } from "./chunk-JBDFYIN2.js";
51
79
  import {
52
80
  normalizeGitHubCIConfig,
53
81
  redactGitHubCIConfig
54
- } from "./chunk-H3I2KZIY.js";
55
- import {
56
- GDocsResource
57
- } from "./chunk-A7X4L4JM.js";
82
+ } from "./chunk-ZPB3SLPK.js";
58
83
  import {
59
84
  normalizeGDocsConfig,
60
85
  redactGDocsConfig
61
- } from "./chunk-H3BST2LI.js";
86
+ } from "./chunk-JHI2PHHD.js";
62
87
  import {
63
- GSheetsResource
64
- } from "./chunk-XRU5WXZX.js";
88
+ NEXTCLOUD_COMMANDS,
89
+ NEXTCLOUD_OPS,
90
+ NEXTCLOUD_PROMPT,
91
+ NextcloudAccessor,
92
+ NextcloudResource
93
+ } from "./chunk-ZPZQXHW2.js";
65
94
  import {
66
- normalizeGSheetsConfig,
67
- redactGSheetsConfig
68
- } from "./chunk-LW25LMIH.js";
95
+ DiscordResource
96
+ } from "./chunk-RHUEV4I7.js";
69
97
  import {
70
- normalizeGSlidesConfig,
71
- redactGSlidesConfig
72
- } from "./chunk-W7FLHT65.js";
98
+ normalizeDiscordConfig,
99
+ redactDiscordConfig
100
+ } from "./chunk-EVK6HH6Z.js";
73
101
  import {
74
102
  TrelloResource
75
- } from "./chunk-ERELJ7BS.js";
103
+ } from "./chunk-3JZN3GYO.js";
104
+ import {
105
+ normalizeTrelloConfig,
106
+ redactTrelloConfig
107
+ } from "./chunk-NJ42VNXG.js";
76
108
  import {
77
109
  LinearResource
78
- } from "./chunk-YAVGCQUP.js";
110
+ } from "./chunk-ZMREYTHA.js";
79
111
  import {
80
112
  normalizeLinearConfig,
81
113
  redactLinearConfig
82
- } from "./chunk-YUK3X3B4.js";
83
- import {
84
- NotionResource
85
- } from "./chunk-CASCUFK2.js";
114
+ } from "./chunk-IKJQOYI4.js";
86
115
  import {
87
116
  normalizeNotionConfig,
88
117
  redactNotionConfig
89
- } from "./chunk-JZT4QGIP.js";
118
+ } from "./chunk-VIICUPWQ.js";
90
119
  import {
91
- LangfuseResource
92
- } from "./chunk-5DLOHQJ2.js";
93
- import {
94
- normalizeLangfuseConfig,
95
- redactLangfuseConfig
96
- } from "./chunk-VGLHY6BK.js";
120
+ QINGSTOR_PROMPT,
121
+ QingStorResource
122
+ } from "./chunk-5I7Q7RHW.js";
97
123
  import {
98
- normalizeGitHubConfig,
99
- redactGitHubConfig
100
- } from "./chunk-TWGVQLG2.js";
124
+ PostgresResource,
125
+ PostgresStore
126
+ } from "./chunk-VHED2STW.js";
101
127
  import {
102
128
  MongoDBResource,
103
129
  MongoDBStore
104
- } from "./chunk-RLGWMJD3.js";
130
+ } from "./chunk-FRGTDZQT.js";
105
131
  import {
106
132
  SlackResource
107
- } from "./chunk-C6NHEDHY.js";
133
+ } from "./chunk-IEVLWEBO.js";
108
134
  import {
109
135
  normalizeSlackConfig,
110
136
  redactSlackConfig
111
- } from "./chunk-SFUCUARB.js";
137
+ } from "./chunk-IEHPTILN.js";
112
138
  import {
113
139
  SSHAccessor,
114
140
  SSHResource,
115
141
  SSH_COMMANDS,
116
142
  SSH_OPS,
117
143
  SSH_PROMPT
118
- } from "./chunk-5HCVKTP3.js";
144
+ } from "./chunk-5ZHNPNDD.js";
119
145
  import {
120
146
  normalizeSshConfig,
121
147
  redactSshConfig
122
- } from "./chunk-UGK4TAVK.js";
148
+ } from "./chunk-LPLZLSMK.js";
123
149
  import {
124
- DiscordResource
125
- } from "./chunk-LYDMMNL2.js";
150
+ normalizeNextcloudConfig,
151
+ redactNextcloudConfig
152
+ } from "./chunk-MRXTUFBZ.js";
126
153
  import {
127
- normalizeDiscordConfig,
128
- redactDiscordConfig
129
- } from "./chunk-DNBAMB5J.js";
130
- import {
131
- normalizeTrelloConfig,
132
- redactTrelloConfig
133
- } from "./chunk-RO5IQEDQ.js";
154
+ DIGITALOCEAN_PROMPT,
155
+ DigitalOceanResource
156
+ } from "./chunk-CXQGMFI7.js";
134
157
  import {
135
158
  TENCENT_PROMPT,
136
159
  TencentResource
137
- } from "./chunk-L6JPBJAS.js";
160
+ } from "./chunk-EGZNOUMH.js";
161
+ import {
162
+ redactTencentConfig,
163
+ resolvedTencentEndpoint
164
+ } from "./chunk-WTSSEUOZ.js";
138
165
  import {
139
166
  ALIYUN_PROMPT,
140
167
  AliyunResource
141
- } from "./chunk-KTNDT45N.js";
168
+ } from "./chunk-XEMLYWHK.js";
142
169
  import {
143
170
  redactAliyunConfig,
144
171
  resolvedAliyunEndpoint
145
- } from "./chunk-NJMGCT63.js";
172
+ } from "./chunk-2QNPKPZZ.js";
146
173
  import {
147
174
  SCALEWAY_PROMPT,
148
175
  ScalewayResource
149
- } from "./chunk-FXFDBF3P.js";
176
+ } from "./chunk-L4GMDSMB.js";
150
177
  import {
151
178
  redactScalewayConfig,
152
179
  resolvedScalewayEndpoint
153
- } from "./chunk-XLQI4IT2.js";
154
- import {
155
- QINGSTOR_PROMPT,
156
- QingStorResource
157
- } from "./chunk-3IJSIVKT.js";
180
+ } from "./chunk-YBVMZ7SR.js";
158
181
  import {
159
182
  redactQingStorConfig,
160
183
  resolvedQingStorEndpoint
161
- } from "./chunk-OHROA3FQ.js";
184
+ } from "./chunk-WWP2STF5.js";
162
185
  import {
163
- PostgresResource,
164
- PostgresStore
165
- } from "./chunk-NHS7WLEQ.js";
186
+ SEAWEEDFS_PROMPT,
187
+ SeaweedFSResource
188
+ } from "./chunk-NLXJMXVE.js";
166
189
  import {
167
190
  CEPH_PROMPT,
168
191
  CephResource
169
- } from "./chunk-C6NHFMIP.js";
192
+ } from "./chunk-XADEMW6B.js";
193
+ import {
194
+ redactCephConfig
195
+ } from "./chunk-UYA3XL3J.js";
170
196
  import {
171
197
  WASABI_PROMPT,
172
198
  WasabiResource
173
- } from "./chunk-O7ODGJYL.js";
199
+ } from "./chunk-L7FEZ7LU.js";
174
200
  import {
175
201
  redactWasabiConfig,
176
202
  resolvedWasabiEndpoint
177
- } from "./chunk-JALIYI6M.js";
203
+ } from "./chunk-S4KVLPBR.js";
178
204
  import {
179
205
  BACKBLAZE_PROMPT,
180
206
  BackblazeResource
181
- } from "./chunk-HQ4KWN76.js";
207
+ } from "./chunk-SYMNWNC3.js";
182
208
  import {
183
209
  redactBackblazeConfig,
184
210
  resolvedBackblazeEndpoint
185
- } from "./chunk-XHCBHYN4.js";
186
- import {
187
- DIGITALOCEAN_PROMPT,
188
- DigitalOceanResource
189
- } from "./chunk-AJICZLHT.js";
211
+ } from "./chunk-UAJYJP5C.js";
190
212
  import {
191
213
  redactDigitalOceanConfig,
192
214
  resolvedDigitalOceanEndpoint
193
- } from "./chunk-ZNWVJ6UW.js";
215
+ } from "./chunk-3ASOQTZB.js";
194
216
  import {
195
- redactTencentConfig,
196
- resolvedTencentEndpoint
197
- } from "./chunk-YGZMVNN5.js";
217
+ HF_BUCKETS_PROMPT,
218
+ HfBucketsResource
219
+ } from "./chunk-4M73WHIE.js";
198
220
  import {
199
221
  HF_DATASETS_PROMPT,
200
222
  HfDatasetsResource
201
- } from "./chunk-RQYEEA2O.js";
223
+ } from "./chunk-DXU7NZPH.js";
202
224
  import {
203
225
  HF_MODELS_PROMPT,
204
226
  HfModelsResource
205
- } from "./chunk-WL7HS7EM.js";
227
+ } from "./chunk-V7JVMG63.js";
206
228
  import {
207
229
  HF_SPACES_PROMPT,
208
230
  HfSpacesResource
209
- } from "./chunk-OYV2DN66.js";
231
+ } from "./chunk-BWWU5T2D.js";
232
+ import {
233
+ HF_COMMANDS,
234
+ HF_OPS,
235
+ HF_RESOURCES,
236
+ HfAccessor,
237
+ HfBucketsAccessor,
238
+ HfDatasetsAccessor,
239
+ HfModelsAccessor,
240
+ HfSpacesAccessor
241
+ } from "./chunk-HEDE2377.js";
242
+ import {
243
+ HF_ENDPOINT,
244
+ assertHfRepoId,
245
+ normalizeHfBucketsConfig,
246
+ normalizeHfRepoConfig,
247
+ redactHfBucketsConfig,
248
+ redactHfRepoConfig
249
+ } from "./chunk-KAWDDS27.js";
210
250
  import {
211
251
  MINIO_PROMPT,
212
252
  MinIOResource
213
- } from "./chunk-Q6CDMOM6.js";
253
+ } from "./chunk-4X6CLF4F.js";
214
254
  import {
215
255
  redactMinIOConfig
216
- } from "./chunk-DYXEITK3.js";
217
- import {
218
- SEAWEEDFS_PROMPT,
219
- SeaweedFSResource
220
- } from "./chunk-3T3RMDNX.js";
256
+ } from "./chunk-GF75O2EN.js";
221
257
  import {
222
258
  redactSeaweedFSConfig
223
- } from "./chunk-2CC5VW7K.js";
259
+ } from "./chunk-MIQ3ECZM.js";
224
260
  import {
225
- redactCephConfig
226
- } from "./chunk-OPYQ5KIO.js";
261
+ GCSResource,
262
+ GCS_PROMPT
263
+ } from "./chunk-25W4XQJZ.js";
264
+ import {
265
+ GCS_ENDPOINT,
266
+ redactGcsConfig
267
+ } from "./chunk-E3KXVEYI.js";
227
268
  import {
228
269
  OCIResource,
229
270
  OCI_PROMPT
230
- } from "./chunk-PJBQKMCD.js";
271
+ } from "./chunk-TUNR4VUM.js";
231
272
  import {
232
273
  redactOciConfig
233
- } from "./chunk-RQK5UPMP.js";
274
+ } from "./chunk-H62XQZUM.js";
234
275
  import {
235
276
  R2Resource,
236
277
  R2_PROMPT
237
- } from "./chunk-B6SXRCBO.js";
278
+ } from "./chunk-ZM44MGC5.js";
238
279
  import {
239
280
  redactR2Config
240
- } from "./chunk-LAJJPLEV.js";
281
+ } from "./chunk-VBYIDRNU.js";
241
282
  import {
242
283
  SUPABASE_PROMPT,
243
284
  SupabaseResource
244
- } from "./chunk-BYTU2YC3.js";
285
+ } from "./chunk-F5NWRF32.js";
245
286
  import {
246
287
  redactSupabaseConfig,
247
288
  resolvedSupabaseEndpoint
248
- } from "./chunk-QGRDPSAH.js";
249
- import {
250
- HF_BUCKETS_PROMPT,
251
- HfBucketsResource
252
- } from "./chunk-G5BZE7UA.js";
253
- import {
254
- HF_COMMANDS,
255
- HF_OPS,
256
- HF_RESOURCES,
257
- HfAccessor,
258
- HfBucketsAccessor,
259
- HfDatasetsAccessor,
260
- HfModelsAccessor,
261
- HfSpacesAccessor
262
- } from "./chunk-WSGEIVY3.js";
263
- import {
264
- HF_ENDPOINT,
265
- assertHfRepoId,
266
- normalizeHfBucketsConfig,
267
- normalizeHfRepoConfig,
268
- redactHfBucketsConfig,
269
- redactHfRepoConfig
270
- } from "./chunk-EGB7V74Z.js";
289
+ } from "./chunk-2ERLWAGG.js";
271
290
  import {
272
291
  DISK_COMMANDS,
273
292
  DISK_OPS,
274
293
  DISK_PROMPT,
275
294
  DiskResource
276
- } from "./chunk-PBBG7VFT.js";
277
- import "./chunk-U6QSXTUS.js";
295
+ } from "./chunk-W5ZLIQFR.js";
278
296
  import {
279
297
  REDIS_COMMANDS,
280
298
  REDIS_OPS,
@@ -283,43 +301,42 @@ import {
283
301
  RedisResource,
284
302
  RedisStore,
285
303
  stat
286
- } from "./chunk-N72CAZEH.js";
304
+ } from "./chunk-OSVZKYXS.js";
287
305
  import {
288
- loadOptionalPeer
289
- } from "./chunk-E2ISWXLB.js";
306
+ S3Resource
307
+ } from "./chunk-IUXXZHY3.js";
290
308
  import {
291
- DatabricksVolumeResource,
292
- loadDatabricksProfile,
293
- parseDatabricksCfg
294
- } from "./chunk-JZQHKDSY.js";
309
+ redactConfig
310
+ } from "./chunk-HCU3B6FW.js";
295
311
  import {
296
- GCSResource,
297
- GCS_PROMPT
298
- } from "./chunk-IQVNVTOP.js";
312
+ GridFSAccessor,
313
+ GridFSResource
314
+ } from "./chunk-CGGO5NKD.js";
299
315
  import {
300
- S3Resource
301
- } from "./chunk-MHCMHKM6.js";
316
+ loadOptionalPeer
317
+ } from "./chunk-OQKNDS66.js";
302
318
  import {
303
- redactConfig
304
- } from "./chunk-UT2OPSN4.js";
319
+ normalizeGridFSConfig
320
+ } from "./chunk-C7TNKIK5.js";
305
321
  import {
306
- GCS_ENDPOINT,
307
- redactGcsConfig
308
- } from "./chunk-XGJ2QERC.js";
322
+ DatabricksVolumeResource,
323
+ loadDatabricksProfile,
324
+ parseDatabricksCfg
325
+ } from "./chunk-HGIPWY5Y.js";
309
326
 
310
327
  // src/index.ts
311
328
  export * from "@struktoai/mirage-core";
312
329
 
313
330
  // src/workspace.ts
314
331
  import { readFileSync } from "fs";
315
- import { createRequire } from "module";
332
+ import { createRequire as createRequire2 } from "module";
316
333
  import {
317
334
  createShellParser,
318
335
  Workspace as CoreWorkspace
319
336
  } from "@struktoai/mirage-core";
320
337
 
321
338
  // src/workspace/fuse.ts
322
- import { rmSync } from "fs";
339
+ import { rmdirSync } from "fs";
323
340
 
324
341
  // src/fuse/mount.ts
325
342
  import { execSync } from "child_process";
@@ -328,7 +345,14 @@ import { tmpdir } from "os";
328
345
  import { join } from "path";
329
346
 
330
347
  // src/fuse/fs.ts
331
- import { FileType, rstripSlash } from "@struktoai/mirage-core";
348
+ import { posix } from "path";
349
+ import {
350
+ FileType,
351
+ isMissingOp,
352
+ PathSpec,
353
+ runWithSession,
354
+ rstripSlash
355
+ } from "@struktoai/mirage-core";
332
356
 
333
357
  // src/fuse/platform/macos.ts
334
358
  var MACOS_METADATA = /* @__PURE__ */ new Set([
@@ -342,17 +366,15 @@ function isMacosMetadata(name) {
342
366
  }
343
367
 
344
368
  // src/fuse/fs.ts
345
- var ENV_AGENT_ID = "MIRAGE_AGENT_ID";
346
- var MIRAGE_DIR = "/.mirage";
347
- var MIRAGE_WHOAMI = "/.mirage/whoami";
348
369
  var ENOENT = -2;
349
370
  var EACCES = -13;
350
371
  var ENOTDIR = -20;
351
372
  var EEXIST = -17;
352
373
  var ENOTEMPTY = -66;
353
374
  var EIO = -5;
375
+ var EINVAL = -22;
376
+ var EROFS = -30;
354
377
  var PREFETCH_TTL_MS = 3e4;
355
- var UNKNOWN_SIZE_SENTINEL = 100 * 1024 * 1024;
356
378
  function classifyError(err) {
357
379
  const code = err.code;
358
380
  if (code === "ENOTEMPTY") return ENOTEMPTY;
@@ -363,6 +385,7 @@ function classifyError(err) {
363
385
  const msg = (err instanceof Error ? err.message : String(err)).toLowerCase();
364
386
  if (msg.includes("not empty") || msg.includes("enotempty")) return ENOTEMPTY;
365
387
  if (msg.includes("not a directory") || msg.includes("enotdir")) return ENOTDIR;
388
+ if (msg.includes("not allowed to access mount")) return EACCES;
366
389
  if (msg.includes("permission") || msg.includes("eacces") || msg.includes("read-only"))
367
390
  return EACCES;
368
391
  if (msg.includes("file exists") || msg.includes("eexist")) return EEXIST;
@@ -372,33 +395,32 @@ function classifyError(err) {
372
395
  }
373
396
  var MirageFS = class {
374
397
  ws;
375
- agentId;
376
398
  now;
377
399
  root;
378
400
  prefixes;
379
401
  handles = /* @__PURE__ */ new Map();
402
+ // In-memory extended attributes, keyed by FUSE path. Backends have no POSIX
403
+ // xattrs, so these are advisory and never persisted; see setxattr.
404
+ xattrs = /* @__PURE__ */ new Map();
380
405
  prefetchCache = /* @__PURE__ */ new Map();
381
406
  prefetchInflight = /* @__PURE__ */ new Map();
382
407
  nextFh = 1;
383
408
  uid;
384
409
  gid;
410
+ session;
385
411
  constructor(ws, options = {}) {
386
412
  this.ws = ws;
387
- this.agentId = options.agentId ?? process.env[ENV_AGENT_ID] ?? `agent-${Math.random().toString(36).slice(2, 10)}`;
388
413
  this.now = /* @__PURE__ */ new Date();
389
414
  this.root = options.rootPrefix !== void 0 ? rstripSlash(options.rootPrefix) : "";
390
415
  this.prefixes = this.root === "" ? ws.mounts().map((m) => m.prefix) : [];
391
416
  this.uid = typeof process.getuid === "function" ? process.getuid() : 0;
392
417
  this.gid = typeof process.getgid === "function" ? process.getgid() : 0;
418
+ this.session = options.session ?? null;
393
419
  }
394
420
  // ── helpers ──────────────────────────────────────────────────────
395
- resolve(path) {
396
- if (this.root === "") return path;
397
- return path === "/" ? this.root : this.root + path;
398
- }
399
- whoamiContent() {
400
- const lines = [`agent: ${this.agentId}`, "cwd: /", `mounts: ${this.prefixes.join(", ")}`];
401
- return new TextEncoder().encode(lines.join("\n") + "\n");
421
+ resolve(path4) {
422
+ if (this.root === "") return path4;
423
+ return path4 === "/" ? this.root : this.root + path4;
402
424
  }
403
425
  dirStat() {
404
426
  return {
@@ -424,8 +446,62 @@ var MirageFS = class {
424
446
  gid: this.gid
425
447
  };
426
448
  }
427
- isVirtualDir(path) {
428
- const bare = rstripSlash(path);
449
+ /**
450
+ * Fold merged stat attributes into a FUSE attr. The workspace stat
451
+ * already carries the namespace overlay (chmod bits, chown ids, touched
452
+ * mtime), so honoring these fields here is what makes metadata ops
453
+ * visible over FUSE. String uid/gid (names) are skipped: FUSE wants
454
+ * numeric ids and there is no user db to map against.
455
+ */
456
+ applyStatAttrs(entry, s) {
457
+ if (s.mode !== null) {
458
+ entry.mode = entry.mode & ~4095 | s.mode & 4095;
459
+ }
460
+ if (typeof s.uid === "number") entry.uid = s.uid;
461
+ if (typeof s.gid === "number") entry.gid = s.gid;
462
+ if (s.modified !== null) {
463
+ const ts = new Date(s.modified);
464
+ if (!Number.isNaN(ts.getTime())) {
465
+ entry.mtime = ts;
466
+ entry.ctime = ts;
467
+ }
468
+ }
469
+ return entry;
470
+ }
471
+ /**
472
+ * The target to present for a namespace link at a FUSE path, or null
473
+ * when not a link. Relative targets are stored verbatim and returned
474
+ * as-is. Absolute targets name virtual paths, so they are rewritten
475
+ * relative to the link's directory: returned raw, the kernel would
476
+ * resolve them against the host root and escape the mountpoint.
477
+ */
478
+ linkTarget(path4) {
479
+ const links = this.ws.fs.links;
480
+ if (links === null) return null;
481
+ const target = links.readlink(this.resolve(path4));
482
+ if (target === null) return null;
483
+ if (!target.startsWith("/")) return target;
484
+ let fuseTarget = target;
485
+ if (this.root !== "") {
486
+ if (target === this.root) {
487
+ fuseTarget = "/";
488
+ } else if (target.startsWith(this.root + "/")) {
489
+ fuseTarget = target.slice(this.root.length);
490
+ } else {
491
+ return target;
492
+ }
493
+ }
494
+ const slash = path4.lastIndexOf("/");
495
+ const parent = slash <= 0 ? "/" : path4.slice(0, slash);
496
+ return posix.relative(parent, fuseTarget);
497
+ }
498
+ linkStat(target) {
499
+ const entry = this.fileStat(new TextEncoder().encode(target).byteLength);
500
+ entry.mode = 41471;
501
+ return entry;
502
+ }
503
+ isVirtualDir(path4) {
504
+ const bare = rstripSlash(path4);
429
505
  const normalized = bare + "/";
430
506
  for (const p of this.prefixes) {
431
507
  const pBare = rstripSlash(p);
@@ -433,8 +509,8 @@ var MirageFS = class {
433
509
  }
434
510
  return false;
435
511
  }
436
- virtualChildren(path) {
437
- const normalized = path === "/" ? "/" : rstripSlash(path) + "/";
512
+ virtualChildren(path4) {
513
+ const normalized = path4 === "/" ? "/" : rstripSlash(path4) + "/";
438
514
  const children = /* @__PURE__ */ new Set();
439
515
  for (const p of this.prefixes) {
440
516
  if (p.startsWith(normalized) && p !== normalized) {
@@ -445,47 +521,47 @@ var MirageFS = class {
445
521
  }
446
522
  return [...children].sort();
447
523
  }
448
- cachedSize(path) {
524
+ cachedSize(path4) {
449
525
  for (const ctx of this.handles.values()) {
450
- if (ctx.path === path && ctx.data !== void 0) return ctx.data.byteLength;
526
+ if (ctx.path === path4 && ctx.data !== void 0) return ctx.data.byteLength;
451
527
  }
452
- const entry = this.prefetchCache.get(path);
528
+ const entry = this.prefetchCache.get(path4);
453
529
  if (entry !== void 0 && entry.expires > Date.now()) return entry.data.byteLength;
454
530
  return null;
455
531
  }
456
- cachedData(path) {
532
+ cachedData(path4) {
457
533
  for (const ctx of this.handles.values()) {
458
- if (ctx.path === path && ctx.data !== void 0) return ctx.data;
534
+ if (ctx.path === path4 && ctx.data !== void 0) return ctx.data;
459
535
  }
460
- const entry = this.prefetchCache.get(path);
536
+ const entry = this.prefetchCache.get(path4);
461
537
  if (entry !== void 0 && entry.expires > Date.now()) return entry.data;
462
- if (entry !== void 0) this.prefetchCache.delete(path);
538
+ if (entry !== void 0) this.prefetchCache.delete(path4);
463
539
  return null;
464
540
  }
465
541
  /**
466
- * Fetch bytes for a size-unknown file and cache them so the immediate
467
- * getattr → open → read burst (and subsequent stats within the TTL) reuse
468
- * the same fetch. Required because @zkochan/fuse-native doesn't expose
469
- * libfuse's `direct_io` flag — without a real size from getattr, the kernel
470
- * decides the file is empty and never issues read().
542
+ * Fetch bytes for a size-unknown file and cache them so the open → read →
543
+ * fstat burst (and subsequent stats within the TTL) reuse the same fetch.
544
+ * With getattr reporting 0 pre-open, this hydration is what lets fgetattr
545
+ * answer with the real byte length after open (mirrors Python's
546
+ * `_prefetch_read`).
471
547
  */
472
- async prefetch(path) {
473
- const cached = this.cachedData(path);
548
+ async prefetch(path4) {
549
+ const cached = this.cachedData(path4);
474
550
  if (cached !== null) return cached;
475
- const inflight = this.prefetchInflight.get(path);
551
+ const inflight = this.prefetchInflight.get(path4);
476
552
  if (inflight !== void 0) return inflight;
477
553
  const promise = (async () => {
478
554
  try {
479
- const data = await this.ws.fs.readFile(this.resolve(path));
480
- this.prefetchCache.set(path, { data, expires: Date.now() + PREFETCH_TTL_MS });
555
+ const data = await this.ws.fs.readFile(this.resolve(path4));
556
+ this.prefetchCache.set(path4, { data, expires: Date.now() + PREFETCH_TTL_MS });
481
557
  return data;
482
558
  } catch {
483
559
  return null;
484
560
  } finally {
485
- this.prefetchInflight.delete(path);
561
+ this.prefetchInflight.delete(path4);
486
562
  }
487
563
  })();
488
- this.prefetchInflight.set(path, promise);
564
+ this.prefetchInflight.set(path4, promise);
489
565
  return promise;
490
566
  }
491
567
  /** Drain and return accumulated op records (mirrors Python's drain_ops). */
@@ -494,12 +570,12 @@ var MirageFS = class {
494
570
  this.ws.records.length = 0;
495
571
  return records;
496
572
  }
497
- async writeFile(path, data) {
498
- await this.ws.dispatch("write", this.resolve(path), [data]);
573
+ async writeFile(path4, data) {
574
+ await this.ws.dispatch("write", this.resolve(path4), [data]);
499
575
  }
500
576
  // ── FUSE op surface (mirrors mfusepy Operations) ─────────────────
501
577
  ops() {
502
- return {
578
+ const table = {
503
579
  readdir: this.readdir.bind(this),
504
580
  getattr: this.getattr.bind(this),
505
581
  fgetattr: this.fgetattr.bind(this),
@@ -507,6 +583,8 @@ var MirageFS = class {
507
583
  read: this.read.bind(this),
508
584
  write: this.write.bind(this),
509
585
  create: this.create.bind(this),
586
+ readlink: this.readlink.bind(this),
587
+ symlink: this.symlink.bind(this),
510
588
  unlink: this.unlink.bind(this),
511
589
  mkdir: this.mkdir.bind(this),
512
590
  rmdir: this.rmdir.bind(this),
@@ -519,60 +597,78 @@ var MirageFS = class {
519
597
  chmod: this.chmod.bind(this),
520
598
  chown: this.chown.bind(this),
521
599
  access: this.access.bind(this),
600
+ setxattr: this.setxattr.bind(this),
601
+ getxattr: this.getxattr.bind(this),
602
+ listxattr: this.listxattr.bind(this),
603
+ removexattr: this.removexattr.bind(this),
522
604
  statfs: this.statfs.bind(this)
523
605
  };
606
+ const session = this.session;
607
+ if (session === null) return table;
608
+ const bound = {};
609
+ for (const [name, fn] of Object.entries(table)) {
610
+ bound[name] = (...args) => {
611
+ void runWithSession(session, () => {
612
+ fn(...args);
613
+ return Promise.resolve();
614
+ });
615
+ };
616
+ }
617
+ return bound;
524
618
  }
525
- getattr(path, cb) {
619
+ getattr(path4, cb) {
526
620
  void (async () => {
527
- if (path === "/" || path === MIRAGE_DIR) {
621
+ if (path4 === "/") {
528
622
  cb(0, this.dirStat());
529
623
  return;
530
624
  }
531
- if (path === MIRAGE_WHOAMI) {
532
- cb(0, this.fileStat(this.whoamiContent().byteLength));
533
- return;
534
- }
535
- const name = path.slice(path.lastIndexOf("/") + 1);
625
+ const name = path4.slice(path4.lastIndexOf("/") + 1);
536
626
  if (isMacosMetadata(name)) {
537
627
  cb(ENOENT);
538
628
  return;
539
629
  }
540
- if (this.isVirtualDir(path)) {
630
+ const target = this.linkTarget(path4);
631
+ if (target !== null) {
632
+ cb(0, this.linkStat(target));
633
+ return;
634
+ }
635
+ if (this.isVirtualDir(path4)) {
541
636
  cb(0, this.dirStat());
542
637
  return;
543
638
  }
544
639
  try {
545
- const s = await this.ws.fs.stat(this.resolve(path));
640
+ const s = await this.ws.fs.stat(this.resolve(path4));
546
641
  if (s.type === FileType.DIRECTORY) {
547
- cb(0, this.dirStat());
642
+ cb(0, this.applyStatAttrs(this.dirStat(), s));
548
643
  return;
549
644
  }
550
645
  let size = s.size;
551
- size ??= this.cachedSize(path) ?? UNKNOWN_SIZE_SENTINEL;
552
- cb(0, this.fileStat(size));
646
+ size ??= this.cachedSize(path4) ?? 0;
647
+ cb(0, this.applyStatAttrs(this.fileStat(size), s));
553
648
  } catch (err) {
554
649
  cb(classifyError(err));
555
650
  }
556
651
  })();
557
652
  }
558
- fgetattr(path, fd, cb) {
653
+ fgetattr(path4, fd, cb) {
559
654
  const ctx = this.handles.get(fd);
560
655
  if (ctx?.data !== void 0) {
561
656
  cb(0, this.fileStat(ctx.data.byteLength));
562
657
  return;
563
658
  }
564
- this.getattr(path, cb);
659
+ this.getattr(path4, cb);
565
660
  }
566
- readdir(path, cb) {
661
+ readdir(path4, cb) {
567
662
  void (async () => {
568
- if (path === MIRAGE_DIR) {
569
- cb(0, [".", "..", "whoami"]);
570
- return;
663
+ const names = new Set(this.virtualChildren(path4));
664
+ const links = this.ws.fs.links;
665
+ if (links !== null) {
666
+ for (const linkName of links.linksUnder(this.resolve(path4)).keys()) {
667
+ if (linkName !== "" && !isMacosMetadata(linkName)) names.add(linkName);
668
+ }
571
669
  }
572
- const names = new Set(this.virtualChildren(path));
573
- if (path === "/") names.add(".mirage");
574
670
  try {
575
- const entries = await this.ws.fs.readdir(this.resolve(path));
671
+ const entries = await this.ws.fs.readdir(this.resolve(path4));
576
672
  for (const e of entries) {
577
673
  const part = rstripSlash(e).split("/").pop() ?? "";
578
674
  if (part !== "" && !isMacosMetadata(part)) names.add(part);
@@ -586,22 +682,15 @@ var MirageFS = class {
586
682
  cb(0, [".", "..", ...[...names].sort()]);
587
683
  })();
588
684
  }
589
- read(path, fd, buf, len, pos, cb) {
685
+ read(path4, fd, buf, len, pos, cb) {
590
686
  void (async () => {
591
- if (path === MIRAGE_WHOAMI) {
592
- const data = this.whoamiContent();
593
- const slice = data.subarray(pos, pos + len);
594
- buf.set(slice, 0);
595
- cb(slice.byteLength);
596
- return;
597
- }
598
687
  const ctx = this.handles.get(fd);
599
688
  try {
600
689
  if (ctx !== void 0 && ctx.data === void 0) {
601
- const cached = this.cachedData(path);
602
- ctx.data = cached ?? await this.ws.fs.readFile(this.resolve(path));
690
+ const cached = this.cachedData(path4);
691
+ ctx.data = cached ?? await this.ws.fs.readFile(this.resolve(path4));
603
692
  }
604
- const data = ctx?.data ?? this.cachedData(path) ?? await this.ws.fs.readFile(this.resolve(path));
693
+ const data = ctx?.data ?? this.cachedData(path4) ?? await this.ws.fs.readFile(this.resolve(path4));
605
694
  const slice = data.subarray(pos, pos + len);
606
695
  buf.set(slice, 0);
607
696
  cb(slice.byteLength);
@@ -610,7 +699,7 @@ var MirageFS = class {
610
699
  }
611
700
  })();
612
701
  }
613
- write(path, fd, buf, len, pos, cb) {
702
+ write(path4, fd, buf, len, pos, cb) {
614
703
  const ctx = this.handles.get(fd);
615
704
  const data = new Uint8Array(buf.subarray(0, len));
616
705
  if (ctx !== void 0) {
@@ -623,7 +712,7 @@ var MirageFS = class {
623
712
  try {
624
713
  let existing = new Uint8Array(0);
625
714
  try {
626
- existing = await this.ws.fs.readFile(this.resolve(path), { raw: true });
715
+ existing = await this.ws.fs.readFile(this.resolve(path4), { raw: true });
627
716
  } catch {
628
717
  }
629
718
  let merged = existing;
@@ -642,45 +731,84 @@ var MirageFS = class {
642
731
  }
643
732
  merged = out;
644
733
  }
645
- await this.writeFile(path, merged);
734
+ await this.writeFile(path4, merged);
646
735
  cb(len);
647
736
  } catch {
648
737
  cb(0);
649
738
  }
650
739
  })();
651
740
  }
652
- create(path, _mode, cb) {
741
+ create(path4, _mode, cb) {
653
742
  void (async () => {
654
743
  try {
655
744
  try {
656
- await this.ws.dispatch("create", this.resolve(path));
745
+ await this.ws.dispatch("create", this.resolve(path4));
657
746
  } catch (dispatchErr) {
658
- const msg = (dispatchErr instanceof Error ? dispatchErr.message : String(dispatchErr)).toLowerCase();
659
- if (!msg.includes("no op")) throw dispatchErr;
660
- await this.writeFile(path, new Uint8Array(0));
747
+ if (!isMissingOp(dispatchErr, "create")) throw dispatchErr;
748
+ await this.writeFile(path4, new Uint8Array(0));
661
749
  }
662
750
  const fh = this.nextFh++;
663
- this.handles.set(fh, { path });
751
+ this.handles.set(fh, { path: path4 });
664
752
  cb(0, fh);
665
753
  } catch (err) {
666
754
  cb(classifyError(err));
667
755
  }
668
756
  })();
669
757
  }
670
- mkdir(path, _mode, cb) {
758
+ mkdir(path4, _mode, cb) {
671
759
  void (async () => {
672
760
  try {
673
- await this.ws.fs.mkdir(this.resolve(path));
761
+ await this.ws.dispatch("mkdir", this.resolve(path4));
674
762
  cb(0);
675
763
  } catch (err) {
676
764
  cb(classifyError(err));
677
765
  }
678
766
  })();
679
767
  }
680
- unlink(path, cb) {
768
+ readlink(path4, cb) {
769
+ const target = this.linkTarget(path4);
770
+ if (target === null) {
771
+ cb(EINVAL);
772
+ return;
773
+ }
774
+ cb(0, target);
775
+ }
776
+ /**
777
+ * Create namespace link `dest -> src` (ln -s src dest; libfuse passes
778
+ * the pointee first). Relative sources are stored verbatim (resolved
779
+ * at follow time, exactly like the shell `ln -s`); absolute sources
780
+ * are mapped into virtual space so a scoped mount stores the path it
781
+ * will later follow.
782
+ */
783
+ symlink(src, dest, cb) {
784
+ void (async () => {
785
+ const links = this.ws.fs.links;
786
+ if (links === null) {
787
+ cb(EROFS);
788
+ return;
789
+ }
790
+ const stored = src.startsWith("/") ? this.resolve(src) : src;
791
+ try {
792
+ await links.symlink(this.resolve(dest), stored, Date.now() / 1e3);
793
+ cb(0);
794
+ } catch (err) {
795
+ cb(classifyError(err));
796
+ }
797
+ })();
798
+ }
799
+ unlink(path4, cb) {
681
800
  void (async () => {
801
+ const links = this.ws.fs.links;
802
+ if (links?.isLink(this.resolve(path4)) === true) {
803
+ await links.unlink(this.resolve(path4));
804
+ this.xattrs.delete(path4);
805
+ this.prefetchCache.delete(path4);
806
+ cb(0);
807
+ return;
808
+ }
682
809
  try {
683
- await this.ws.fs.unlink(this.resolve(path));
810
+ await this.ws.dispatch("unlink", this.resolve(path4));
811
+ this.xattrs.delete(path4);
684
812
  cb(0);
685
813
  } catch (err) {
686
814
  cb(classifyError(err));
@@ -690,43 +818,50 @@ var MirageFS = class {
690
818
  rename(src, dst, cb) {
691
819
  void (async () => {
692
820
  try {
693
- await this.ws.fs.rename(this.resolve(src), this.resolve(dst));
821
+ await this.ws.dispatch("rename", this.resolve(src), [
822
+ PathSpec.fromStrPath(this.resolve(dst))
823
+ ]);
824
+ const moved = this.xattrs.get(src);
825
+ if (moved !== void 0) {
826
+ this.xattrs.delete(src);
827
+ this.xattrs.set(dst, moved);
828
+ }
694
829
  cb(0);
695
830
  } catch (err) {
696
831
  cb(classifyError(err));
697
832
  }
698
833
  })();
699
834
  }
700
- rmdir(path, cb) {
835
+ rmdir(path4, cb) {
701
836
  void (async () => {
702
837
  try {
703
838
  try {
704
- const entries = await this.ws.fs.readdir(this.resolve(path));
839
+ const entries = await this.ws.fs.readdir(this.resolve(path4));
705
840
  if (entries.length > 0) {
706
841
  cb(ENOTEMPTY);
707
842
  return;
708
843
  }
709
844
  } catch {
710
845
  }
711
- await this.ws.fs.rmdir(this.resolve(path));
846
+ await this.ws.dispatch("rmdir", this.resolve(path4));
847
+ this.xattrs.delete(path4);
712
848
  cb(0);
713
849
  } catch (err) {
714
850
  cb(classifyError(err));
715
851
  }
716
852
  })();
717
853
  }
718
- truncate(path, size, cb) {
854
+ truncate(path4, size, cb) {
719
855
  void (async () => {
720
856
  try {
721
857
  try {
722
- await this.ws.dispatch("truncate", this.resolve(path), [size]);
858
+ await this.ws.dispatch("truncate", this.resolve(path4), [size]);
723
859
  } catch (dispatchErr) {
724
- const msg = (dispatchErr instanceof Error ? dispatchErr.message : String(dispatchErr)).toLowerCase();
725
- if (!msg.includes("no op")) throw dispatchErr;
726
- const data = await this.ws.fs.readFile(this.resolve(path), { raw: true }).catch(() => new Uint8Array(0));
860
+ if (!isMissingOp(dispatchErr, "truncate")) throw dispatchErr;
861
+ const data = await this.ws.fs.readFile(this.resolve(path4), { raw: true }).catch(() => new Uint8Array(0));
727
862
  const out = new Uint8Array(size);
728
863
  out.set(data.subarray(0, Math.min(data.byteLength, size)), 0);
729
- await this.writeFile(path, out);
864
+ await this.writeFile(path4, out);
730
865
  }
731
866
  cb(0);
732
867
  } catch (err) {
@@ -750,36 +885,80 @@ var MirageFS = class {
750
885
  // chmod / chown / utimens / access are no-ops for the filesystem but must
751
886
  // validate path existence — callers like `touch`/`chmod` on a missing file
752
887
  // should fail with ENOENT, not silently succeed.
753
- chmod(path, _mode, cb) {
754
- this.getattrValidate(path, cb);
888
+ chmod(path4, _mode, cb) {
889
+ this.getattrValidate(path4, cb);
890
+ }
891
+ chown(path4, _uid, _gid, cb) {
892
+ this.getattrValidate(path4, cb);
893
+ }
894
+ utimens(path4, _atime, _mtime, cb) {
895
+ this.getattrValidate(path4, cb);
896
+ }
897
+ access(path4, _amode, cb) {
898
+ this.getattrValidate(path4, cb);
899
+ }
900
+ // Mirage backends (S3, etc.) have no POSIX extended attributes, so there is
901
+ // nothing to persist xattrs to. We keep them in memory per mount so tools that
902
+ // probe or set xattrs (sandbox runtimes, rsync -aX, tar --xattrs, cp -p, macOS
903
+ // Finder writing com.apple.*) succeed instead of failing with ENOTSUP. The
904
+ // values live only for the mount's lifetime and are never written to the
905
+ // backend.
906
+ setxattr(path4, name, value, _position, _flags, cb) {
907
+ this.getattr(path4, (code) => {
908
+ if (code !== 0) {
909
+ cb(code);
910
+ return;
911
+ }
912
+ let attrs = this.xattrs.get(path4);
913
+ if (attrs === void 0) {
914
+ attrs = /* @__PURE__ */ new Map();
915
+ this.xattrs.set(path4, attrs);
916
+ }
917
+ attrs.set(name, Buffer.from(value));
918
+ cb(0);
919
+ });
755
920
  }
756
- chown(path, _uid, _gid, cb) {
757
- this.getattrValidate(path, cb);
921
+ getxattr(path4, name, _position, cb) {
922
+ this.getattr(path4, (code) => {
923
+ if (code !== 0) {
924
+ cb(code);
925
+ return;
926
+ }
927
+ cb(0, this.xattrs.get(path4)?.get(name));
928
+ });
758
929
  }
759
- utimens(path, _atime, _mtime, cb) {
760
- this.getattrValidate(path, cb);
930
+ listxattr(path4, cb) {
931
+ this.getattr(path4, (code) => {
932
+ if (code !== 0) {
933
+ cb(code);
934
+ return;
935
+ }
936
+ const attrs = this.xattrs.get(path4);
937
+ cb(0, attrs ? [...attrs.keys()] : []);
938
+ });
761
939
  }
762
- access(path, _amode, cb) {
763
- this.getattrValidate(path, cb);
940
+ removexattr(path4, name, cb) {
941
+ this.getattr(path4, (code) => {
942
+ if (code !== 0) {
943
+ cb(code);
944
+ return;
945
+ }
946
+ this.xattrs.get(path4)?.delete(name);
947
+ cb(0);
948
+ });
764
949
  }
765
- getattrValidate(path, cb) {
766
- this.getattr(path, (code) => {
950
+ getattrValidate(path4, cb) {
951
+ this.getattr(path4, (code) => {
767
952
  cb(code);
768
953
  });
769
954
  }
770
- open(path, _flags, cb) {
955
+ open(path4, _flags, cb) {
771
956
  void (async () => {
772
- if (path === MIRAGE_WHOAMI) {
773
- const fh = this.nextFh++;
774
- this.handles.set(fh, { path });
775
- cb(0, fh);
776
- return;
777
- }
778
957
  try {
779
- const s = await this.ws.fs.stat(this.resolve(path));
780
- const ctx = { path };
958
+ const s = await this.ws.fs.stat(this.resolve(path4));
959
+ const ctx = { path: path4 };
781
960
  if (s.size === null && s.type !== FileType.DIRECTORY) {
782
- const data = await this.prefetch(path);
961
+ const data = await this.prefetch(path4);
783
962
  if (data !== null) ctx.data = data;
784
963
  }
785
964
  const fh = this.nextFh++;
@@ -794,7 +973,7 @@ var MirageFS = class {
794
973
  this.handles.delete(fd);
795
974
  cb(0);
796
975
  }
797
- flush(path, fd, cb) {
976
+ flush(path4, fd, cb) {
798
977
  const ctx = this.handles.get(fd);
799
978
  if (ctx?.writeBuf === void 0 || ctx.writeBuf.length === 0) {
800
979
  cb(0);
@@ -806,7 +985,7 @@ var MirageFS = class {
806
985
  try {
807
986
  let existing = new Uint8Array(0);
808
987
  try {
809
- existing = await this.ws.fs.readFile(this.resolve(path), { raw: true });
988
+ existing = await this.ws.fs.readFile(this.resolve(path4), { raw: true });
810
989
  } catch {
811
990
  }
812
991
  let total = existing.byteLength;
@@ -818,19 +997,32 @@ var MirageFS = class {
818
997
  for (const [off, chunk] of writes) {
819
998
  merged.set(chunk, off);
820
999
  }
821
- await this.writeFile(path, merged);
1000
+ await this.writeFile(path4, merged);
822
1001
  cb(0);
823
1002
  } catch (err) {
824
1003
  cb(classifyError(err));
825
1004
  }
826
1005
  })();
827
1006
  }
828
- fsync(path, _datasync, fd, cb) {
829
- this.flush(path, fd, cb);
1007
+ fsync(path4, _datasync, fd, cb) {
1008
+ this.flush(path4, fd, cb);
830
1009
  }
831
1010
  };
832
1011
 
833
1012
  // src/fuse/mount.ts
1013
+ function appendDirectIO(fuse) {
1014
+ const orig = fuse._fuseOptions?.bind(fuse);
1015
+ if (orig === void 0) {
1016
+ throw new Error(
1017
+ "@zkochan/fuse-native no longer exposes _fuseOptions(); the direct_io mount option cannot be applied. Update appendDirectIO in mount.ts for the new fuse-native version."
1018
+ );
1019
+ }
1020
+ fuse._fuseOptions = () => {
1021
+ const serialized = orig();
1022
+ if (serialized === "") return "-odirect_io";
1023
+ return serialized.includes("direct_io") ? serialized : `${serialized},direct_io`;
1024
+ };
1025
+ }
834
1026
  async function loadFuse() {
835
1027
  const mod = await loadOptionalPeer(
836
1028
  () => import("@zkochan/fuse-native"),
@@ -859,16 +1051,17 @@ function forceUnmount(mountpoint) {
859
1051
  async function mount(ws, options = {}) {
860
1052
  const Fuse = await loadFuse();
861
1053
  let mountpoint;
1054
+ let ownsMountpoint = false;
862
1055
  if (options.mountpoint !== void 0) {
863
1056
  mkdirSync(options.mountpoint, { recursive: true });
864
1057
  mountpoint = options.mountpoint;
865
1058
  } else {
866
1059
  mountpoint = mkdtempSync(join(tmpdir(), "mirage-fuse-"));
1060
+ ownsMountpoint = true;
867
1061
  }
868
- const agentId = options.agentId;
869
1062
  const mfs = new MirageFS(ws, {
870
- ...agentId !== void 0 ? { agentId } : {},
871
- ...options.rootPrefix !== void 0 ? { rootPrefix: options.rootPrefix } : {}
1063
+ ...options.rootPrefix !== void 0 ? { rootPrefix: options.rootPrefix } : {},
1064
+ ...options.session !== void 0 ? { session: options.session } : {}
872
1065
  });
873
1066
  const autoUnmount = options.autoUnmount ?? process.platform === "linux";
874
1067
  const fuseOpts = {
@@ -879,6 +1072,7 @@ async function mount(ws, options = {}) {
879
1072
  ...options.fuseOptions ?? {}
880
1073
  };
881
1074
  const fuse = new Fuse(mountpoint, mfs.ops(), fuseOpts);
1075
+ if (fuseOpts.directIO !== false) appendDirectIO(fuse);
882
1076
  await new Promise((resolve, reject) => {
883
1077
  fuse.mount((err) => {
884
1078
  if (err === null) resolve();
@@ -887,6 +1081,7 @@ async function mount(ws, options = {}) {
887
1081
  });
888
1082
  return {
889
1083
  mountpoint,
1084
+ ownsMountpoint,
890
1085
  unmount: () => new Promise((resolve, reject) => {
891
1086
  fuse.unmount((err) => {
892
1087
  if (err === null) resolve();
@@ -901,6 +1096,13 @@ function mountBackground(ws, options = {}) {
901
1096
 
902
1097
  // src/workspace/fuse.ts
903
1098
  var SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
1099
+ function removeMountpointIfOwned(entry) {
1100
+ if (!entry.ownsMountpoint) return;
1101
+ try {
1102
+ rmdirSync(entry.mountpoint);
1103
+ } catch {
1104
+ }
1105
+ }
904
1106
  var FuseCleanupRegistry = class {
905
1107
  mounts = /* @__PURE__ */ new Set();
906
1108
  installed = false;
@@ -935,10 +1137,7 @@ var FuseCleanupRegistry = class {
935
1137
  drainSync() {
936
1138
  for (const entry of this.mounts) {
937
1139
  forceUnmount(entry.mountpoint);
938
- try {
939
- rmSync(entry.mountpoint, { recursive: true, force: true });
940
- } catch {
941
- }
1140
+ removeMountpointIfOwned(entry);
942
1141
  }
943
1142
  this.mounts.clear();
944
1143
  }
@@ -946,61 +1145,81 @@ var FuseCleanupRegistry = class {
946
1145
  var CLEANUP = new FuseCleanupRegistry();
947
1146
  var FuseManager = class {
948
1147
  handle = null;
949
- externalMountpoint = null;
950
- auto = false;
951
1148
  cleanupEntry = null;
952
1149
  get mountpoint() {
953
- if (this.handle !== null) return this.handle.mountpoint;
954
- return this.externalMountpoint;
955
- }
956
- set mountpoint(path) {
957
- this.externalMountpoint = path;
1150
+ return this.handle?.mountpoint ?? null;
958
1151
  }
959
1152
  async setup(ws, options = {}) {
960
1153
  if (this.handle !== null) return this.handle.mountpoint;
961
- this.handle = await mount(ws, options);
962
- this.auto = true;
963
- this.externalMountpoint = null;
964
- this.cleanupEntry = { mountpoint: this.handle.mountpoint, handle: this.handle };
1154
+ const handle = await mount(ws, options);
1155
+ this.handle = handle;
1156
+ this.cleanupEntry = {
1157
+ mountpoint: handle.mountpoint,
1158
+ handle,
1159
+ // Preserve the ownership decision made by mount(); unmount cleanup must
1160
+ // not infer ownership from path shape or whether the directory exists.
1161
+ ownsMountpoint: handle.ownsMountpoint
1162
+ };
965
1163
  CLEANUP.register(this.cleanupEntry);
966
- ws.setFuseMountpoint(this.handle.mountpoint, { owned: true });
967
- return this.handle.mountpoint;
1164
+ return handle.mountpoint;
968
1165
  }
969
- async unmount(ws) {
1166
+ async unmount() {
970
1167
  if (this.handle === null) {
971
- if (ws !== void 0) ws.setFuseMountpoint(null);
972
- this.externalMountpoint = null;
973
1168
  return;
974
1169
  }
975
1170
  const mp = this.handle.mountpoint;
976
1171
  try {
977
1172
  await this.handle.unmount();
978
1173
  } finally {
979
- if (this.cleanupEntry !== null) {
980
- CLEANUP.unregister(this.cleanupEntry);
1174
+ const cleanupEntry = this.cleanupEntry;
1175
+ if (cleanupEntry !== null) {
1176
+ CLEANUP.unregister(cleanupEntry);
981
1177
  this.cleanupEntry = null;
982
1178
  }
983
1179
  this.handle = null;
984
- this.auto = false;
985
- ws?.setFuseMountpoint(null);
986
- try {
987
- rmSync(mp, { recursive: true, force: true });
988
- } catch {
989
- }
1180
+ removeMountpointIfOwned({
1181
+ mountpoint: mp,
1182
+ ownsMountpoint: cleanupEntry?.ownsMountpoint ?? false
1183
+ });
990
1184
  }
991
1185
  }
992
- async close(ws) {
993
- if (this.auto) await this.unmount(ws);
1186
+ async close() {
1187
+ await this.unmount();
994
1188
  }
995
1189
  };
996
1190
 
997
- // src/workspace.ts
1191
+ // src/workspace/mount_spec.ts
1192
+ var Mount = class {
1193
+ constructor(resource, options = {}) {
1194
+ this.resource = resource;
1195
+ this.options = options;
1196
+ }
1197
+ resource;
1198
+ options;
1199
+ };
1200
+
1201
+ // src/compression_codecs.ts
1202
+ import { createRequire } from "module";
1203
+ import { registerCompressionCodec } from "@struktoai/mirage-core";
998
1204
  var requireCjs = createRequire(import.meta.url);
1205
+ var { Bzip2 } = requireCjs("compressjs");
1206
+ var { xz } = requireCjs("@napi-rs/lzma");
1207
+ registerCompressionCodec("bzip2", {
1208
+ compress: (bytes) => Promise.resolve(Uint8Array.from(Bzip2.compressFile(bytes))),
1209
+ decompress: (bytes) => Promise.resolve(Uint8Array.from(Bzip2.decompressFile(bytes)))
1210
+ });
1211
+ registerCompressionCodec("xz", {
1212
+ compress: async (bytes) => new Uint8Array(await xz.compress(Buffer.from(bytes))),
1213
+ decompress: async (bytes) => new Uint8Array(await xz.decompress(Buffer.from(bytes)))
1214
+ });
1215
+
1216
+ // src/workspace.ts
1217
+ var requireCjs2 = createRequire2(import.meta.url);
999
1218
  var cachedParser = null;
1000
1219
  function loadShellParser() {
1001
1220
  if (cachedParser !== null) return cachedParser;
1002
- const enginePath = requireCjs.resolve("web-tree-sitter/web-tree-sitter.wasm");
1003
- const grammarPath = requireCjs.resolve("tree-sitter-bash/tree-sitter-bash.wasm");
1221
+ const enginePath = requireCjs2.resolve("web-tree-sitter/web-tree-sitter.wasm");
1222
+ const grammarPath = requireCjs2.resolve("tree-sitter-bash/tree-sitter-bash.wasm");
1004
1223
  cachedParser = createShellParser({
1005
1224
  engineWasm: readFileSync(enginePath),
1006
1225
  grammarWasm: readFileSync(grammarPath)
@@ -1008,29 +1227,35 @@ function loadShellParser() {
1008
1227
  return cachedParser;
1009
1228
  }
1010
1229
  var Workspace = class extends CoreWorkspace {
1011
- autoFuseManagers = /* @__PURE__ */ new Map();
1012
- fuseMountpointsMap = /* @__PURE__ */ new Map();
1013
1230
  fuseSetupPromise = null;
1231
+ fuseMountpointsMap = /* @__PURE__ */ new Map();
1232
+ fuseManagers = /* @__PURE__ */ new Map();
1014
1233
  constructor(resources, options = {}) {
1015
- super(resources, {
1234
+ const specs = {};
1235
+ const commandSafeguards = {
1236
+ ...options.commandSafeguards ?? {}
1237
+ };
1238
+ const fuseTargets = [];
1239
+ for (const [prefix, value] of Object.entries(resources)) {
1240
+ if (value instanceof Mount) {
1241
+ specs[prefix] = value.options.mode !== void 0 ? [value.resource, value.options.mode] : value.resource;
1242
+ if (value.options.commandSafeguards !== void 0)
1243
+ commandSafeguards[prefix] = value.options.commandSafeguards;
1244
+ if (value.options.fuse !== void 0 && value.options.fuse !== false)
1245
+ fuseTargets.push([prefix, value.options.fuse]);
1246
+ } else {
1247
+ specs[prefix] = value;
1248
+ }
1249
+ }
1250
+ super(specs, {
1016
1251
  ...options,
1252
+ ...Object.keys(commandSafeguards).length > 0 ? { commandSafeguards } : {},
1017
1253
  shellParserFactory: options.shellParserFactory ?? loadShellParser
1018
1254
  });
1019
- const fuseMounts = options.fuseMounts ?? {};
1020
- const setups = [];
1021
- for (const [prefix, target] of Object.entries(fuseMounts)) {
1022
- if (target === false) continue;
1023
- const fm = new FuseManager();
1024
- this.autoFuseManagers.set(prefix, fm);
1025
- const opts = {
1026
- rootPrefix: prefix,
1027
- ...typeof target === "string" ? { mountpoint: target } : {}
1028
- };
1029
- setups.push(
1030
- fm.setup(this, opts).then(
1031
- (mountpoint) => {
1032
- this.fuseMountpointsMap.set(prefix, mountpoint);
1033
- },
1255
+ if (fuseTargets.length > 0) {
1256
+ const setups = fuseTargets.map(
1257
+ ([prefix, target]) => this.addFuseMount(prefix, typeof target === "string" ? target : void 0).then(
1258
+ () => void 0,
1034
1259
  (err) => {
1035
1260
  process.stderr.write(
1036
1261
  `mirage: FUSE auto-mount failed for ${prefix}, continuing without it: ${err instanceof Error ? err.message : String(err)}
@@ -1039,45 +1264,865 @@ var Workspace = class extends CoreWorkspace {
1039
1264
  }
1040
1265
  )
1041
1266
  );
1042
- }
1043
- if (setups.length > 0) {
1044
1267
  this.fuseSetupPromise = Promise.all(setups).then(() => void 0);
1045
1268
  }
1046
1269
  }
1047
- /** Map each FUSE-exposed mount prefix to its live mountpoint. */
1270
+ registerFuseMount(prefix, mountpoint) {
1271
+ for (const [otherPrefix, otherMp] of this.fuseMountpointsMap) {
1272
+ if (otherMp === mountpoint && otherPrefix !== prefix) {
1273
+ throw new Error(
1274
+ `FUSE mountpoint ${mountpoint} already used by prefix ${otherPrefix}; mounts need distinct paths`
1275
+ );
1276
+ }
1277
+ }
1278
+ this.fuseMountpointsMap.set(prefix, mountpoint);
1279
+ }
1280
+ /**
1281
+ * Mount a workspace subtree under FUSE and own its lifecycle. Each mount gets
1282
+ * its own {@link FuseManager}, so a workspace can expose any number of FUSE
1283
+ * subtrees at once. A pinned mountpoint is collision-checked BEFORE mounting,
1284
+ * so a clash never leaves a partial kernel mount.
1285
+ *
1286
+ * A session-bound mount (`sessionId` given) runs every op under that
1287
+ * session's mount grants (the kernel-tier primitive: bind-mount the tree
1288
+ * into a container and the narrowing travels with it); it is keyed
1289
+ * separately so the same prefix can also be exposed unbound.
1290
+ */
1291
+ async addFuseMount(prefix, mountpoint, sessionId) {
1292
+ const session = sessionId !== void 0 ? this.getSession(sessionId) : void 0;
1293
+ const key = sessionId === void 0 ? prefix : `${prefix}@${sessionId}`;
1294
+ if (mountpoint !== void 0) this.registerFuseMount(key, mountpoint);
1295
+ const fm = new FuseManager();
1296
+ this.fuseManagers.set(key, fm);
1297
+ try {
1298
+ const mp = await fm.setup(this, {
1299
+ rootPrefix: prefix,
1300
+ ...mountpoint !== void 0 ? { mountpoint } : {},
1301
+ ...session !== void 0 ? { session } : {}
1302
+ });
1303
+ if (mountpoint === void 0) this.registerFuseMount(key, mp);
1304
+ return mp;
1305
+ } catch (err) {
1306
+ this.fuseManagers.delete(key);
1307
+ this.fuseMountpointsMap.delete(key);
1308
+ throw err;
1309
+ }
1310
+ }
1311
+ async removeFuseMount(prefix, sessionId) {
1312
+ const key = sessionId === void 0 ? prefix : `${prefix}@${sessionId}`;
1313
+ const fm = this.fuseManagers.get(key);
1314
+ this.fuseManagers.delete(key);
1315
+ if (fm !== void 0) await fm.unmount();
1316
+ this.fuseMountpointsMap.delete(key);
1317
+ }
1048
1318
  get fuseMountpoints() {
1049
1319
  return Object.fromEntries(this.fuseMountpointsMap);
1050
1320
  }
1051
- async ensureFuseReady() {
1321
+ get fuseMountpoint() {
1322
+ if (this.fuseMountpointsMap.size === 0) return null;
1323
+ if (this.fuseMountpointsMap.size > 1) {
1324
+ throw new Error("multiple FUSE mounts active; use fuseMountpoints to select one by prefix");
1325
+ }
1326
+ return this.fuseMountpointsMap.values().next().value ?? null;
1327
+ }
1328
+ /** Await the eager per-mount fuse mounts started in the constructor. */
1329
+ async fuseReady() {
1052
1330
  if (this.fuseSetupPromise !== null) {
1053
1331
  await this.fuseSetupPromise;
1054
1332
  this.fuseSetupPromise = null;
1055
1333
  }
1056
1334
  }
1057
1335
  async execute(command, options = {}) {
1058
- await this.ensureFuseReady();
1336
+ await this.fuseReady();
1059
1337
  return super.execute(command, options);
1060
1338
  }
1061
1339
  async close() {
1062
- await this.ensureFuseReady().catch(() => void 0);
1063
- for (const fm of this.autoFuseManagers.values()) {
1064
- await fm.close(this);
1065
- }
1340
+ await this.fuseReady().catch(() => void 0);
1341
+ for (const fm of this.fuseManagers.values()) await fm.unmount();
1342
+ this.fuseManagers.clear();
1343
+ this.fuseMountpointsMap.clear();
1066
1344
  await super.close();
1067
1345
  }
1068
1346
  };
1069
1347
 
1348
+ // src/observe/disk_store.ts
1349
+ import { appendFile, mkdir, readdir, readFile, rmdir, unlink, writeFile } from "fs/promises";
1350
+ import path from "path";
1351
+ var DiskObserverStore = class {
1352
+ root;
1353
+ constructor(root) {
1354
+ this.root = root;
1355
+ }
1356
+ abs(key) {
1357
+ return path.join(this.root, key.replace(/^\/+/, ""));
1358
+ }
1359
+ async append(key, data) {
1360
+ const absPath = this.abs(key);
1361
+ await mkdir(path.dirname(absPath), { recursive: true });
1362
+ await appendFile(absPath, data);
1363
+ }
1364
+ async write(key, data) {
1365
+ const absPath = this.abs(key);
1366
+ await mkdir(path.dirname(absPath), { recursive: true });
1367
+ await writeFile(absPath, data);
1368
+ }
1369
+ readAll() {
1370
+ return this.readMatching("");
1371
+ }
1372
+ async readMatching(suffix) {
1373
+ const out = /* @__PURE__ */ new Map();
1374
+ const { files } = await this.walk();
1375
+ for (const absPath of files) {
1376
+ const rel = "/" + path.relative(this.root, absPath);
1377
+ if (!rel.endsWith(suffix)) continue;
1378
+ out.set(rel, new Uint8Array(await readFile(absPath)));
1379
+ }
1380
+ return out;
1381
+ }
1382
+ async clear() {
1383
+ const { files, dirs } = await this.walk();
1384
+ for (const absPath of files) await unlink(absPath);
1385
+ for (const d of [...dirs].reverse()) await rmdir(d);
1386
+ }
1387
+ close() {
1388
+ return Promise.resolve();
1389
+ }
1390
+ async walk() {
1391
+ const files = [];
1392
+ const dirs = [];
1393
+ const stack = [this.root];
1394
+ while (stack.length > 0) {
1395
+ const d = stack.pop();
1396
+ if (d === void 0) break;
1397
+ let entries;
1398
+ try {
1399
+ entries = await readdir(d, { withFileTypes: true });
1400
+ } catch {
1401
+ continue;
1402
+ }
1403
+ dirs.push(d);
1404
+ for (const entry of entries) {
1405
+ const full = path.join(d, entry.name);
1406
+ if (entry.isDirectory()) stack.push(full);
1407
+ else files.push(full);
1408
+ }
1409
+ }
1410
+ return { files, dirs };
1411
+ }
1412
+ };
1413
+
1414
+ // src/observe/redis_store.ts
1415
+ var RedisObserverStore = class {
1416
+ url;
1417
+ prefix;
1418
+ indexKey;
1419
+ clientPromise = null;
1420
+ constructor(options = {}) {
1421
+ this.url = options.url ?? "redis://localhost:6379/0";
1422
+ this.prefix = options.keyPrefix ?? "mirage:observer:";
1423
+ this.indexKey = `${this.prefix}keys`;
1424
+ }
1425
+ async client() {
1426
+ this.clientPromise ??= (async () => {
1427
+ const mod = await loadOptionalPeer(
1428
+ () => import("redis"),
1429
+ { feature: "RedisObserverStore", packageName: "redis" }
1430
+ );
1431
+ const c = mod.createClient({
1432
+ url: this.url,
1433
+ socket: { reconnectStrategy: false }
1434
+ });
1435
+ await c.connect();
1436
+ return c;
1437
+ })();
1438
+ return this.clientPromise;
1439
+ }
1440
+ async append(key, data) {
1441
+ const c = await this.client();
1442
+ const buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
1443
+ await c.multi().append(`${this.prefix}${key}`, buf).sAdd(this.indexKey, key).exec();
1444
+ }
1445
+ async write(key, data) {
1446
+ const c = await this.client();
1447
+ const buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
1448
+ await c.multi().set(`${this.prefix}${key}`, buf).sAdd(this.indexKey, key).exec();
1449
+ }
1450
+ readAll() {
1451
+ return this.readMatching("");
1452
+ }
1453
+ async readMatching(suffix) {
1454
+ const paths = (await this.indexedPaths()).filter((p) => p.endsWith(suffix));
1455
+ return this.readPaths(paths);
1456
+ }
1457
+ async indexedPaths() {
1458
+ const c = await this.client();
1459
+ const members = await c.sMembers(this.indexKey);
1460
+ return [...members].sort();
1461
+ }
1462
+ async readPaths(paths) {
1463
+ const out = /* @__PURE__ */ new Map();
1464
+ if (paths.length === 0) return out;
1465
+ const c = await this.client();
1466
+ const mod = await import("redis");
1467
+ const mapping = { [mod.RESP_TYPES.BLOB_STRING]: Buffer };
1468
+ const typed = c;
1469
+ const values = await typed.withTypeMapping(mapping).mGet(paths.map((p) => `${this.prefix}${p}`));
1470
+ paths.forEach((p, i) => {
1471
+ const raw = values[i];
1472
+ out.set(p, raw === null || raw === void 0 ? new Uint8Array() : new Uint8Array(raw));
1473
+ });
1474
+ return out;
1475
+ }
1476
+ async clear() {
1477
+ const c = await this.client();
1478
+ const paths = await this.indexedPaths();
1479
+ const keys = [...paths.map((p) => `${this.prefix}${p}`), this.indexKey];
1480
+ if (keys.length > 0) await c.del(keys);
1481
+ }
1482
+ async close() {
1483
+ if (this.clientPromise === null) return;
1484
+ const pending = this.clientPromise;
1485
+ this.clientPromise = null;
1486
+ const c = await pending;
1487
+ await c.quit();
1488
+ }
1489
+ };
1490
+
1491
+ // src/workspace/namespace/disk.ts
1492
+ import { NamespaceStore } from "@struktoai/mirage-core";
1493
+
1494
+ // src/workspace/session/disk.ts
1495
+ import { mkdir as mkdir2, open, readFile as readFile2, readdir as readdir2, rename, stat as stat2, unlink as unlink2, writeFile as writeFile2 } from "fs/promises";
1496
+ import path2 from "path";
1497
+ import { generationOf, SessionStore } from "@struktoai/mirage-core";
1498
+ var LOCK_STALE_SECONDS = 10;
1499
+ var LOCK_RETRY_SLEEP_MS = 5;
1500
+ var LOCK_RETRY_LIMIT = 2e3;
1501
+ var tmpCounter = 0;
1502
+ function quoteName(name) {
1503
+ return encodeURIComponent(name).replace(
1504
+ /[!'()*]/g,
1505
+ (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
1506
+ );
1507
+ }
1508
+ function isMissing(e) {
1509
+ return e.code === "ENOENT";
1510
+ }
1511
+ var DiskRecordClient = class {
1512
+ dir;
1513
+ constructor(root, prefix) {
1514
+ this.dir = path2.join(root, prefix);
1515
+ }
1516
+ recordPath(name) {
1517
+ return path2.join(this.dir, `${quoteName(name)}.json`);
1518
+ }
1519
+ // The token slot mirrors the S3 client's ETag but stays empty: disk
1520
+ // CAS anchors on the lockfile, not on a version token.
1521
+ async get(name) {
1522
+ let body;
1523
+ try {
1524
+ body = await readFile2(this.recordPath(name));
1525
+ } catch (e) {
1526
+ if (isMissing(e)) return [null, ""];
1527
+ throw e;
1528
+ }
1529
+ return [JSON.parse(body.toString()), ""];
1530
+ }
1531
+ async put(name, fields) {
1532
+ await mkdir2(this.dir, { recursive: true });
1533
+ await this.writeRecord(this.recordPath(name), fields);
1534
+ }
1535
+ /**
1536
+ * Write one record iff its stored generation matches.
1537
+ *
1538
+ * Take the record's lockfile, re-read under the lock, check the
1539
+ * generation, then tmp-write + rename. Losing the lock race or the
1540
+ * generation check resolves false; the caller adopts and retries.
1541
+ */
1542
+ async casPut(name, fields, expectedGeneration) {
1543
+ await mkdir2(this.dir, { recursive: true });
1544
+ const target = this.recordPath(name);
1545
+ const lockPath = `${target}.lock`;
1546
+ let fh = await this.acquireLock(lockPath);
1547
+ if (fh === null) {
1548
+ if (!await this.reclaimStaleLock(lockPath)) return false;
1549
+ fh = await this.acquireLock(lockPath);
1550
+ if (fh === null) return false;
1551
+ }
1552
+ try {
1553
+ const [stored] = await this.get(name);
1554
+ if (generationOf(stored) !== expectedGeneration) return false;
1555
+ await this.writeRecord(target, fields);
1556
+ return true;
1557
+ } finally {
1558
+ await this.releaseLock(fh, lockPath);
1559
+ }
1560
+ }
1561
+ async listNames() {
1562
+ let entries;
1563
+ try {
1564
+ entries = await readdir2(this.dir);
1565
+ } catch (e) {
1566
+ if (isMissing(e)) return [];
1567
+ throw e;
1568
+ }
1569
+ return entries.filter((n) => n.endsWith(".json")).map((n) => decodeURIComponent(n.slice(0, -".json".length)));
1570
+ }
1571
+ async loadAll() {
1572
+ const names = await this.listNames();
1573
+ const records = await Promise.all(names.map((name) => this.get(name)));
1574
+ const out = /* @__PURE__ */ new Map();
1575
+ for (let i = 0; i < names.length; i++) {
1576
+ const name = names[i];
1577
+ const fields = records[i]?.[0];
1578
+ if (name !== void 0 && fields != null) out.set(name, fields);
1579
+ }
1580
+ return out;
1581
+ }
1582
+ async delete(names) {
1583
+ for (const name of names) {
1584
+ try {
1585
+ await unlink2(this.recordPath(name));
1586
+ } catch (e) {
1587
+ if (!isMissing(e)) throw e;
1588
+ }
1589
+ }
1590
+ }
1591
+ async clear() {
1592
+ await this.delete(await this.listNames());
1593
+ }
1594
+ async close() {
1595
+ }
1596
+ /**
1597
+ * Block until this record's lockfile is held; handle to release.
1598
+ *
1599
+ * For callers doing a read-modify-write that is not generation-CAS
1600
+ * (e.g. the single-file namespace plane); spins past contention and
1601
+ * reclaims stale locks, throwing only if a live writer holds the
1602
+ * lock for the whole retry budget (~10s).
1603
+ */
1604
+ async lock(name) {
1605
+ await mkdir2(this.dir, { recursive: true });
1606
+ const lockPath = `${this.recordPath(name)}.lock`;
1607
+ for (let i = 0; i < LOCK_RETRY_LIMIT; i++) {
1608
+ const fh = await this.acquireLock(lockPath);
1609
+ if (fh !== null) return fh;
1610
+ if (await this.reclaimStaleLock(lockPath)) continue;
1611
+ await new Promise((r) => setTimeout(r, LOCK_RETRY_SLEEP_MS));
1612
+ }
1613
+ throw new Error(`could not acquire lock ${lockPath}`);
1614
+ }
1615
+ async unlock(name, fh) {
1616
+ await this.releaseLock(fh, `${this.recordPath(name)}.lock`);
1617
+ }
1618
+ // O_CREAT|O_EXCL ('wx'): filesystem-atomic mutex, the git protocol.
1619
+ // Local filesystems only (O_EXCL is unreliable on ancient NFS, the
1620
+ // same caveat git ships with).
1621
+ async acquireLock(lockPath) {
1622
+ let fh;
1623
+ try {
1624
+ fh = await open(lockPath, "wx");
1625
+ } catch (e) {
1626
+ if (e.code === "EEXIST") return null;
1627
+ throw e;
1628
+ }
1629
+ await fh.write(String(process.pid));
1630
+ return fh;
1631
+ }
1632
+ // True when the lock is gone or was stale and removed; false when a
1633
+ // live writer still holds it.
1634
+ async reclaimStaleLock(lockPath) {
1635
+ let mtimeMs;
1636
+ try {
1637
+ mtimeMs = (await stat2(lockPath)).mtimeMs;
1638
+ } catch (e) {
1639
+ if (isMissing(e)) return true;
1640
+ throw e;
1641
+ }
1642
+ const age = (Date.now() - mtimeMs) / 1e3;
1643
+ if (age <= LOCK_STALE_SECONDS) return false;
1644
+ console.warn(`mirage: reclaiming stale lock ${lockPath} (age ${age.toFixed(1)}s)`);
1645
+ try {
1646
+ await unlink2(lockPath);
1647
+ } catch (e) {
1648
+ if (!isMissing(e)) throw e;
1649
+ }
1650
+ return true;
1651
+ }
1652
+ async releaseLock(fh, lockPath) {
1653
+ await fh.close();
1654
+ try {
1655
+ await unlink2(lockPath);
1656
+ } catch (e) {
1657
+ if (!isMissing(e)) throw e;
1658
+ console.warn(`mirage: lock ${lockPath} vanished before release (reclaimed?)`);
1659
+ }
1660
+ }
1661
+ async writeRecord(target, fields) {
1662
+ const tmp = `${target}.${String(process.pid)}.${String(tmpCounter++)}.tmp`;
1663
+ await writeFile2(tmp, JSON.stringify(fields));
1664
+ await rename(tmp, target);
1665
+ }
1666
+ };
1667
+ var DiskSessionStore = class extends SessionStore {
1668
+ records;
1669
+ constructor(root) {
1670
+ super();
1671
+ this.records = new DiskRecordClient(root, "sessions/");
1672
+ }
1673
+ async load() {
1674
+ return await this.records.loadAll();
1675
+ }
1676
+ async set(sessionId, fields) {
1677
+ await this.records.put(sessionId, fields);
1678
+ }
1679
+ async casSet(sessionId, fields, expectedGeneration) {
1680
+ return await this.records.casPut(sessionId, fields, expectedGeneration);
1681
+ }
1682
+ async delete(sessionIds) {
1683
+ await this.records.delete(sessionIds);
1684
+ }
1685
+ async replaceAll(entries) {
1686
+ const stale = (await this.records.listNames()).filter((n) => !entries.has(n));
1687
+ await this.records.delete(stale);
1688
+ await Promise.all([...entries].map(([sid, fields]) => this.records.put(sid, fields)));
1689
+ }
1690
+ async clear() {
1691
+ await this.records.clear();
1692
+ }
1693
+ async close() {
1694
+ await this.records.close();
1695
+ }
1696
+ };
1697
+
1698
+ // src/workspace/namespace/disk.ts
1699
+ var NAMESPACE_RECORD = "namespace";
1700
+ var DiskNamespaceStore = class extends NamespaceStore {
1701
+ records;
1702
+ constructor(root) {
1703
+ super();
1704
+ this.records = new DiskRecordClient(root, "");
1705
+ }
1706
+ async state() {
1707
+ const [fields] = await this.records.get(NAMESPACE_RECORD);
1708
+ if (fields === null) return { nodes: {}, user: null };
1709
+ return {
1710
+ nodes: fields.nodes ?? {},
1711
+ user: typeof fields.user === "string" ? fields.user : null
1712
+ };
1713
+ }
1714
+ async write(state) {
1715
+ await this.records.put(NAMESPACE_RECORD, { nodes: state.nodes, user: state.user });
1716
+ }
1717
+ async load() {
1718
+ return new Map(Object.entries((await this.state()).nodes));
1719
+ }
1720
+ async set(path4, fields) {
1721
+ const fh = await this.records.lock(NAMESPACE_RECORD);
1722
+ try {
1723
+ const state = await this.state();
1724
+ state.nodes[path4] = fields;
1725
+ await this.write(state);
1726
+ } finally {
1727
+ await this.records.unlock(NAMESPACE_RECORD, fh);
1728
+ }
1729
+ }
1730
+ async delete(paths) {
1731
+ const fh = await this.records.lock(NAMESPACE_RECORD);
1732
+ try {
1733
+ const state = await this.state();
1734
+ const drop = new Set(paths);
1735
+ state.nodes = Object.fromEntries(
1736
+ Object.entries(state.nodes).filter(([path4]) => !drop.has(path4))
1737
+ );
1738
+ await this.write(state);
1739
+ } finally {
1740
+ await this.records.unlock(NAMESPACE_RECORD, fh);
1741
+ }
1742
+ }
1743
+ async replaceAll(entries) {
1744
+ const fh = await this.records.lock(NAMESPACE_RECORD);
1745
+ try {
1746
+ const state = await this.state();
1747
+ state.nodes = Object.fromEntries(entries);
1748
+ await this.write(state);
1749
+ } finally {
1750
+ await this.records.unlock(NAMESPACE_RECORD, fh);
1751
+ }
1752
+ }
1753
+ async loadUser() {
1754
+ return (await this.state()).user;
1755
+ }
1756
+ async setUser(user) {
1757
+ const fh = await this.records.lock(NAMESPACE_RECORD);
1758
+ try {
1759
+ const state = await this.state();
1760
+ state.user = user;
1761
+ await this.write(state);
1762
+ } finally {
1763
+ await this.records.unlock(NAMESPACE_RECORD, fh);
1764
+ }
1765
+ }
1766
+ async clear() {
1767
+ const fh = await this.records.lock(NAMESPACE_RECORD);
1768
+ try {
1769
+ await this.write({ nodes: {}, user: null });
1770
+ } finally {
1771
+ await this.records.unlock(NAMESPACE_RECORD, fh);
1772
+ }
1773
+ }
1774
+ async close() {
1775
+ await this.records.close();
1776
+ }
1777
+ };
1778
+
1779
+ // src/workspace/namespace/redis.ts
1780
+ import { NamespaceStore as NamespaceStore2 } from "@struktoai/mirage-core";
1781
+ var RedisNamespaceStore = class extends NamespaceStore2 {
1782
+ url;
1783
+ key;
1784
+ userKey;
1785
+ clientPromise = null;
1786
+ constructor(options = {}) {
1787
+ super();
1788
+ this.url = options.url ?? "redis://localhost:6379/0";
1789
+ const prefix = options.keyPrefix ?? "mirage:namespace:";
1790
+ this.key = `${prefix}nodes`;
1791
+ this.userKey = `${prefix}user`;
1792
+ }
1793
+ async client() {
1794
+ this.clientPromise ??= (async () => {
1795
+ const mod = await loadOptionalPeer(
1796
+ () => import("redis"),
1797
+ { feature: "RedisNamespaceStore", packageName: "redis" }
1798
+ );
1799
+ const c = mod.createClient({
1800
+ url: this.url,
1801
+ socket: { reconnectStrategy: false }
1802
+ });
1803
+ await c.connect();
1804
+ return c;
1805
+ })();
1806
+ return this.clientPromise;
1807
+ }
1808
+ async load() {
1809
+ const c = await this.client();
1810
+ const raw = await c.hGetAll(this.key);
1811
+ const out = /* @__PURE__ */ new Map();
1812
+ for (const [path4, value] of Object.entries(raw)) {
1813
+ out.set(path4, JSON.parse(value));
1814
+ }
1815
+ return out;
1816
+ }
1817
+ async set(path4, fields) {
1818
+ const c = await this.client();
1819
+ await c.hSet(this.key, path4, JSON.stringify(fields));
1820
+ }
1821
+ async delete(paths) {
1822
+ if (paths.length === 0) return;
1823
+ const c = await this.client();
1824
+ await c.hDel(this.key, [...paths]);
1825
+ }
1826
+ async replaceAll(entries) {
1827
+ const c = await this.client();
1828
+ const multi = c.multi().del(this.key);
1829
+ for (const [path4, fields] of entries) {
1830
+ multi.hSet(this.key, path4, JSON.stringify(fields));
1831
+ }
1832
+ await multi.exec();
1833
+ }
1834
+ async loadUser() {
1835
+ const c = await this.client();
1836
+ return c.get(this.userKey);
1837
+ }
1838
+ async setUser(user) {
1839
+ const c = await this.client();
1840
+ await c.set(this.userKey, user);
1841
+ }
1842
+ async clear() {
1843
+ const c = await this.client();
1844
+ await c.del([this.key, this.userKey]);
1845
+ }
1846
+ async close() {
1847
+ if (this.clientPromise === null) return;
1848
+ const pending = this.clientPromise;
1849
+ this.clientPromise = null;
1850
+ const c = await pending;
1851
+ await c.quit();
1852
+ }
1853
+ };
1854
+
1855
+ // src/workspace/session/redis.ts
1856
+ import { readFileSync as readFileSync2 } from "fs";
1857
+ import { SessionStore as SessionStore2 } from "@struktoai/mirage-core";
1858
+ var CAS_SCRIPT = readFileSync2(new URL("./cas.lua", import.meta.url), "utf8");
1859
+ var RedisSessionStore = class extends SessionStore2 {
1860
+ url;
1861
+ key;
1862
+ clientPromise = null;
1863
+ constructor(options = {}) {
1864
+ super();
1865
+ this.url = options.url ?? "redis://localhost:6379/0";
1866
+ const prefix = options.keyPrefix ?? "mirage:session:";
1867
+ this.key = `${prefix}sessions`;
1868
+ }
1869
+ async client() {
1870
+ this.clientPromise ??= (async () => {
1871
+ const mod = await loadOptionalPeer(
1872
+ () => import("redis"),
1873
+ { feature: "RedisSessionStore", packageName: "redis" }
1874
+ );
1875
+ const c = mod.createClient({
1876
+ url: this.url,
1877
+ socket: { reconnectStrategy: false }
1878
+ });
1879
+ await c.connect();
1880
+ return c;
1881
+ })();
1882
+ return this.clientPromise;
1883
+ }
1884
+ // One atomic server-side compare-and-set: Lua reads the stored
1885
+ // record's generation and writes only on a match.
1886
+ async casSet(sessionId, fields, expectedGeneration) {
1887
+ const c = await this.client();
1888
+ const result = await c.eval(CAS_SCRIPT, {
1889
+ keys: [this.key],
1890
+ arguments: [sessionId, JSON.stringify(fields), String(expectedGeneration)]
1891
+ });
1892
+ return result === 1;
1893
+ }
1894
+ async load() {
1895
+ const c = await this.client();
1896
+ const raw = await c.hGetAll(this.key);
1897
+ const out = /* @__PURE__ */ new Map();
1898
+ for (const [sid, value] of Object.entries(raw)) {
1899
+ out.set(sid, JSON.parse(value));
1900
+ }
1901
+ return out;
1902
+ }
1903
+ async set(sessionId, fields) {
1904
+ const c = await this.client();
1905
+ await c.hSet(this.key, sessionId, JSON.stringify(fields));
1906
+ }
1907
+ async delete(sessionIds) {
1908
+ if (sessionIds.length === 0) return;
1909
+ const c = await this.client();
1910
+ await c.hDel(this.key, [...sessionIds]);
1911
+ }
1912
+ async replaceAll(entries) {
1913
+ const c = await this.client();
1914
+ const multi = c.multi().del(this.key);
1915
+ for (const [sid, fields] of entries) {
1916
+ multi.hSet(this.key, sid, JSON.stringify(fields));
1917
+ }
1918
+ await multi.exec();
1919
+ }
1920
+ async clear() {
1921
+ const c = await this.client();
1922
+ await c.del(this.key);
1923
+ }
1924
+ async close() {
1925
+ if (this.clientPromise === null) return;
1926
+ const pending = this.clientPromise;
1927
+ this.clientPromise = null;
1928
+ const c = await pending;
1929
+ await c.quit();
1930
+ }
1931
+ };
1932
+
1933
+ // src/workspace/store/disk.ts
1934
+ import { homedir } from "os";
1935
+ import path3 from "path";
1936
+ import {
1937
+ WorkspaceStateStore
1938
+ } from "@struktoai/mirage-core";
1939
+ var DEFAULT_STATE_ROOT = "~/.mirage/state";
1940
+ function expandHome(p) {
1941
+ if (p === "~") return homedir();
1942
+ if (p.startsWith("~/")) return path3.join(homedir(), p.slice(2));
1943
+ return p;
1944
+ }
1945
+ function quoteSegment(name) {
1946
+ return encodeURIComponent(name).replace(
1947
+ /[!'()*]/g,
1948
+ (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
1949
+ );
1950
+ }
1951
+ var DiskWorkspaceStateStore = class extends WorkspaceStateStore {
1952
+ root;
1953
+ meta = /* @__PURE__ */ new Map();
1954
+ namespaces = /* @__PURE__ */ new Map();
1955
+ observers = /* @__PURE__ */ new Map();
1956
+ sessionTables = /* @__PURE__ */ new Map();
1957
+ constructor(options = {}) {
1958
+ const { root, ...overrides } = options;
1959
+ super(overrides);
1960
+ this.root = expandHome(root ?? DEFAULT_STATE_ROOT);
1961
+ }
1962
+ wsRoot(workspaceId) {
1963
+ return path3.join(this.root, "workspaces", quoteSegment(workspaceId));
1964
+ }
1965
+ metaClient(workspaceId) {
1966
+ let client = this.meta.get(workspaceId);
1967
+ if (client === void 0) {
1968
+ client = new DiskRecordClient(this.wsRoot(workspaceId), "");
1969
+ this.meta.set(workspaceId, client);
1970
+ }
1971
+ return client;
1972
+ }
1973
+ makeNamespace(workspaceId) {
1974
+ let ns = this.namespaces.get(workspaceId);
1975
+ if (ns === void 0) {
1976
+ ns = new DiskNamespaceStore(this.wsRoot(workspaceId));
1977
+ this.namespaces.set(workspaceId, ns);
1978
+ }
1979
+ return ns;
1980
+ }
1981
+ makeObserver(workspaceId) {
1982
+ let ob = this.observers.get(workspaceId);
1983
+ if (ob === void 0) {
1984
+ ob = new DiskObserverStore(path3.join(this.wsRoot(workspaceId), "history"));
1985
+ this.observers.set(workspaceId, ob);
1986
+ }
1987
+ return ob;
1988
+ }
1989
+ makeSessions(workspaceId) {
1990
+ let table = this.sessionTables.get(workspaceId);
1991
+ if (table === void 0) {
1992
+ table = new DiskSessionStore(this.wsRoot(workspaceId));
1993
+ this.sessionTables.set(workspaceId, table);
1994
+ }
1995
+ return table;
1996
+ }
1997
+ async readMeta(workspaceId) {
1998
+ const [fields] = await this.metaClient(workspaceId).get("workspace");
1999
+ return fields;
2000
+ }
2001
+ async writeMeta(workspaceId, fields) {
2002
+ await this.metaClient(workspaceId).put("workspace", fields);
2003
+ }
2004
+ async casWriteMeta(workspaceId, fields, expectedGeneration) {
2005
+ return await this.metaClient(workspaceId).casPut("workspace", fields, expectedGeneration);
2006
+ }
2007
+ async closeSelf() {
2008
+ for (const ns of this.namespaces.values()) await ns.close();
2009
+ for (const ob of this.observers.values()) await ob.close();
2010
+ for (const table of this.sessionTables.values()) await table.close();
2011
+ for (const client of this.meta.values()) await client.close();
2012
+ }
2013
+ };
2014
+
2015
+ // src/workspace/store/redis.ts
2016
+ import {
2017
+ WorkspaceStateStore as WorkspaceStateStore2
2018
+ } from "@struktoai/mirage-core";
2019
+ var RedisWorkspaceStateStore = class extends WorkspaceStateStore2 {
2020
+ url;
2021
+ prefix;
2022
+ metaKey;
2023
+ clientPromise = null;
2024
+ namespaces = /* @__PURE__ */ new Map();
2025
+ observers = /* @__PURE__ */ new Map();
2026
+ sessionTables = /* @__PURE__ */ new Map();
2027
+ constructor(options = {}) {
2028
+ const { url, keyPrefix, ...overrides } = options;
2029
+ super(overrides);
2030
+ this.url = url ?? "redis://localhost:6379/0";
2031
+ this.prefix = keyPrefix ?? "mirage:";
2032
+ this.metaKey = `${this.prefix}workspaces`;
2033
+ }
2034
+ async client() {
2035
+ this.clientPromise ??= (async () => {
2036
+ const mod = await loadOptionalPeer(
2037
+ () => import("redis"),
2038
+ { feature: "RedisWorkspaceStateStore", packageName: "redis" }
2039
+ );
2040
+ const c = mod.createClient({
2041
+ url: this.url,
2042
+ socket: { reconnectStrategy: false }
2043
+ });
2044
+ await c.connect();
2045
+ return c;
2046
+ })();
2047
+ return this.clientPromise;
2048
+ }
2049
+ makeNamespace(workspaceId) {
2050
+ let ns = this.namespaces.get(workspaceId);
2051
+ if (ns === void 0) {
2052
+ ns = new RedisNamespaceStore({
2053
+ url: this.url,
2054
+ keyPrefix: `${this.prefix}${workspaceId}:namespace:`
2055
+ });
2056
+ this.namespaces.set(workspaceId, ns);
2057
+ }
2058
+ return ns;
2059
+ }
2060
+ makeObserver(workspaceId) {
2061
+ let ob = this.observers.get(workspaceId);
2062
+ if (ob === void 0) {
2063
+ ob = new RedisObserverStore({
2064
+ url: this.url,
2065
+ keyPrefix: `${this.prefix}${workspaceId}:observer:`
2066
+ });
2067
+ this.observers.set(workspaceId, ob);
2068
+ }
2069
+ return ob;
2070
+ }
2071
+ makeSessions(workspaceId) {
2072
+ let table = this.sessionTables.get(workspaceId);
2073
+ if (table === void 0) {
2074
+ table = new RedisSessionStore({
2075
+ url: this.url,
2076
+ keyPrefix: `${this.prefix}${workspaceId}:`
2077
+ });
2078
+ this.sessionTables.set(workspaceId, table);
2079
+ }
2080
+ return table;
2081
+ }
2082
+ async readMeta(workspaceId) {
2083
+ const c = await this.client();
2084
+ const raw = await c.hGet(this.metaKey, workspaceId);
2085
+ return raw != null ? JSON.parse(raw) : null;
2086
+ }
2087
+ async writeMeta(workspaceId, fields) {
2088
+ const c = await this.client();
2089
+ await c.hSet(this.metaKey, workspaceId, JSON.stringify(fields));
2090
+ }
2091
+ // Same generic hash-field CAS the session store uses: the meta hash
2092
+ // is keyed by workspace id instead of session id.
2093
+ async casWriteMeta(workspaceId, fields, expectedGeneration) {
2094
+ const c = await this.client();
2095
+ const result = await c.eval(CAS_SCRIPT, {
2096
+ keys: [this.metaKey],
2097
+ arguments: [workspaceId, JSON.stringify(fields), String(expectedGeneration)]
2098
+ });
2099
+ return result === 1;
2100
+ }
2101
+ async closeSelf() {
2102
+ for (const ns of this.namespaces.values()) await ns.close();
2103
+ for (const ob of this.observers.values()) await ob.close();
2104
+ for (const table of this.sessionTables.values()) await table.close();
2105
+ if (this.clientPromise !== null) {
2106
+ const c = await this.clientPromise;
2107
+ await c.quit();
2108
+ }
2109
+ }
2110
+ };
2111
+
1070
2112
  // src/fs_monkey.ts
1071
2113
  import { Buffer as Buffer2 } from "buffer";
1072
- import { createRequire as createRequire2 } from "module";
2114
+ import { createRequire as createRequire3 } from "module";
1073
2115
  import { FileType as FileType2 } from "@struktoai/mirage-core";
1074
- var requireCjs2 = createRequire2(import.meta.url);
1075
- var fs = requireCjs2("node:fs");
1076
- var fsMonkey = requireCjs2("fs-monkey");
2116
+ var requireCjs3 = createRequire3(import.meta.url);
2117
+ var fs = requireCjs3("node:fs");
2118
+ var fsMonkey = requireCjs3("fs-monkey");
1077
2119
  var { patchFs } = fsMonkey;
1078
2120
  function mountedPath(ws, p) {
1079
2121
  try {
1080
- return ws.registry.mountFor(p) !== null;
2122
+ const m = ws.registry.mountFor(p);
2123
+ if (m === null) return false;
2124
+ if (ws.syntheticRoot && m === ws.registry.rootMount) return false;
2125
+ return true;
1081
2126
  } catch {
1082
2127
  return false;
1083
2128
  }
@@ -1224,7 +2269,7 @@ async function resolveSizes(accessor, paths, index) {
1224
2269
  const resolved = [];
1225
2270
  let missing = 0;
1226
2271
  for (const p of paths) {
1227
- const pathStr = p.original;
2272
+ const pathStr = p.virtual;
1228
2273
  let size = null;
1229
2274
  if (index !== void 0) {
1230
2275
  const lookup = await index.get(pathStr);
@@ -1292,13 +2337,19 @@ function metadataProvision(_accessor, paths, _texts, _opts) {
1292
2337
  // src/cache/redis/file.ts
1293
2338
  import {
1294
2339
  defaultFingerprint,
1295
- parseLimit
2340
+ parseLimit,
2341
+ validateMaxDrainBytes
1296
2342
  } from "@struktoai/mirage-core";
1297
2343
  var RedisFileCacheStore = class extends RedisResource {
2344
+ // Advisory only: unlike the RAM store there is no client-side LRU, so
2345
+ // nothing evicts on overflow. Cap memory on the Redis server instead
2346
+ // (maxmemory + maxmemory-policy allkeys-lru) to approximate the RAM
2347
+ // store's eviction behavior.
1298
2348
  limit;
1299
2349
  dataPrefix;
1300
2350
  metaPrefix;
1301
- maxDrainBytes;
2351
+ maxDrainBytesValue = null;
2352
+ drainTasks = /* @__PURE__ */ new Map();
1302
2353
  constructor(options = {}) {
1303
2354
  super({
1304
2355
  url: options.url ?? "redis://localhost:6379/0",
@@ -1309,7 +2360,16 @@ var RedisFileCacheStore = class extends RedisResource {
1309
2360
  this.metaPrefix = `${this.keyPrefix}meta:`;
1310
2361
  this.maxDrainBytes = options.maxDrainBytes ?? null;
1311
2362
  }
1312
- cacheSize = 0;
2363
+ get maxDrainBytes() {
2364
+ return this.maxDrainBytesValue;
2365
+ }
2366
+ set maxDrainBytes(value) {
2367
+ validateMaxDrainBytes(this.limit, value);
2368
+ this.maxDrainBytesValue = value;
2369
+ }
2370
+ // Size lives in the redis server and is not tracked client-side.
2371
+ cacheSize = null;
2372
+ cacheEntries = null;
1313
2373
  get cacheLimit() {
1314
2374
  return this.limit;
1315
2375
  }
@@ -1348,6 +2408,7 @@ var RedisFileCacheStore = class extends RedisResource {
1348
2408
  return true;
1349
2409
  }
1350
2410
  async remove(key) {
2411
+ this.drainTasks.delete(key);
1351
2412
  const c = await this.cacheClient();
1352
2413
  const pipe = c.multi();
1353
2414
  pipe.del(`${this.dataPrefix}${key}`);
@@ -1355,7 +2416,7 @@ var RedisFileCacheStore = class extends RedisResource {
1355
2416
  await pipe.exec();
1356
2417
  }
1357
2418
  async exists(key) {
1358
- const k = typeof key === "string" ? key : key.stripPrefix;
2419
+ const k = typeof key === "string" ? key : key.mountPath;
1359
2420
  const c = await this.cacheClient();
1360
2421
  return await c.exists(`${this.dataPrefix}${k}`) > 0;
1361
2422
  }
@@ -1366,6 +2427,7 @@ var RedisFileCacheStore = class extends RedisResource {
1366
2427
  return fp === remoteFingerprint;
1367
2428
  }
1368
2429
  async clear() {
2430
+ this.drainTasks.clear();
1369
2431
  const c = await this.cacheClient();
1370
2432
  for (const pattern of [`${this.dataPrefix}*`, `${this.metaPrefix}*`]) {
1371
2433
  const batch = [];
@@ -1501,7 +2563,7 @@ var LanceDBStore = class {
1501
2563
  var REMOTE_SCHEMES = ["s3://", "gs://", "az://", "hf://", "db://"];
1502
2564
  var LanceDBResource = class extends BaseResource {
1503
2565
  kind = ResourceName.LANCEDB;
1504
- isRemote;
2566
+ cachesReads;
1505
2567
  indexTtl = 0;
1506
2568
  prompt = LANCEDB_PROMPT;
1507
2569
  config;
@@ -1511,7 +2573,7 @@ var LanceDBResource = class extends BaseResource {
1511
2573
  super();
1512
2574
  const config = "config" in options ? options.config : options;
1513
2575
  this.config = resolveLanceDBConfig(config);
1514
- this.isRemote = REMOTE_SCHEMES.some((scheme) => this.config.uri.startsWith(scheme));
2576
+ this.cachesReads = REMOTE_SCHEMES.some((scheme) => this.config.uri.startsWith(scheme));
1515
2577
  this.store = new LanceDBStore(this.config);
1516
2578
  this.accessor = new LanceDBAccessor(this.store, this.config);
1517
2579
  }
@@ -1546,208 +2608,218 @@ var REGISTRY = {
1546
2608
  return new RAMResource();
1547
2609
  },
1548
2610
  disk: async (config) => {
1549
- const { DiskResource: DiskResource2 } = await import("./disk-POACMF4G.js");
2611
+ const { DiskResource: DiskResource2 } = await import("./disk-24NWTN2I.js");
1550
2612
  const norm = normalizeFields(config);
1551
2613
  return new DiskResource2(norm);
1552
2614
  },
1553
2615
  redis: async (config) => {
1554
- const { RedisResource: RedisResource2 } = await import("./redis-S6GIPA4Z.js");
2616
+ const { RedisResource: RedisResource2 } = await import("./redis-6D55Q2WB.js");
1555
2617
  const norm = normalizeFields(config);
1556
2618
  return new RedisResource2(norm);
1557
2619
  },
1558
2620
  s3: async (config) => {
1559
- const { S3Resource: S3Resource2 } = await import("./s3-GMPUJ65D.js");
1560
- const { normalizeS3Config } = await import("./config-QWCY3LBQ.js");
2621
+ const { S3Resource: S3Resource2 } = await import("./s3-XQBI2CXN.js");
2622
+ const { normalizeS3Config } = await import("./config-BBOLI7VE.js");
1561
2623
  return new S3Resource2(normalizeS3Config(config));
1562
2624
  },
2625
+ gridfs: async (config) => {
2626
+ const { GridFSResource: GridFSResource2 } = await import("./gridfs-KZRZ6SIB.js");
2627
+ const { normalizeGridFSConfig: normalizeGridFSConfig2 } = await import("./config-J2C53GOT.js");
2628
+ return new GridFSResource2(normalizeGridFSConfig2(config));
2629
+ },
1563
2630
  gcs: async (config) => {
1564
- const { GCSResource: GCSResource2 } = await import("./gcs-SMIE4VMT.js");
1565
- const { normalizeGcsConfig } = await import("./config-VM526IKB.js");
2631
+ const { GCSResource: GCSResource2 } = await import("./gcs-PFWR6MIW.js");
2632
+ const { normalizeGcsConfig } = await import("./config-BIBFLUIR.js");
1566
2633
  return new GCSResource2(normalizeGcsConfig(config));
1567
2634
  },
1568
2635
  oci: async (config) => {
1569
- const { OCIResource: OCIResource2 } = await import("./oci-NURLWPL2.js");
1570
- const { normalizeOciConfig } = await import("./config-KYTRXAB2.js");
2636
+ const { OCIResource: OCIResource2 } = await import("./oci-CKYBSFZJ.js");
2637
+ const { normalizeOciConfig } = await import("./config-W7EVPJNK.js");
1571
2638
  return new OCIResource2(normalizeOciConfig(config));
1572
2639
  },
1573
2640
  r2: async (config) => {
1574
- const { R2Resource: R2Resource2 } = await import("./r2-FSZK7IFI.js");
1575
- const { normalizeR2Config } = await import("./config-KMVCVBYN.js");
2641
+ const { R2Resource: R2Resource2 } = await import("./r2-C4XGEWQY.js");
2642
+ const { normalizeR2Config } = await import("./config-WVILHDFV.js");
1576
2643
  return new R2Resource2(normalizeR2Config(config));
1577
2644
  },
1578
2645
  hf_buckets: async (config) => {
1579
- const { HfBucketsResource: HfBucketsResource2 } = await import("./hf_buckets-RIOMV7WG.js");
1580
- const { normalizeHfBucketsConfig: normalizeHfBucketsConfig2 } = await import("./config-CVZ2AGCO.js");
2646
+ const { HfBucketsResource: HfBucketsResource2 } = await import("./hf_buckets-BK7NGJWS.js");
2647
+ const { normalizeHfBucketsConfig: normalizeHfBucketsConfig2 } = await import("./config-SPW6NESU.js");
1581
2648
  return new HfBucketsResource2(normalizeHfBucketsConfig2(config));
1582
2649
  },
1583
2650
  hf_datasets: async (config) => {
1584
- const { HfDatasetsResource: HfDatasetsResource2 } = await import("./hf_datasets-QF4BQ3OK.js");
1585
- const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-CVZ2AGCO.js");
2651
+ const { HfDatasetsResource: HfDatasetsResource2 } = await import("./hf_datasets-UQ5QGM4L.js");
2652
+ const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-SPW6NESU.js");
1586
2653
  return new HfDatasetsResource2(normalizeHfRepoConfig2(config));
1587
2654
  },
1588
2655
  hf_models: async (config) => {
1589
- const { HfModelsResource: HfModelsResource2 } = await import("./hf_models-62GC2HPZ.js");
1590
- const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-CVZ2AGCO.js");
2656
+ const { HfModelsResource: HfModelsResource2 } = await import("./hf_models-75LFCQCS.js");
2657
+ const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-SPW6NESU.js");
1591
2658
  return new HfModelsResource2(normalizeHfRepoConfig2(config));
1592
2659
  },
1593
2660
  hf_spaces: async (config) => {
1594
- const { HfSpacesResource: HfSpacesResource2 } = await import("./hf_spaces-NVSMUNRM.js");
1595
- const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-CVZ2AGCO.js");
2661
+ const { HfSpacesResource: HfSpacesResource2 } = await import("./hf_spaces-6T2KB3UC.js");
2662
+ const { normalizeHfRepoConfig: normalizeHfRepoConfig2 } = await import("./config-SPW6NESU.js");
1596
2663
  return new HfSpacesResource2(normalizeHfRepoConfig2(config));
1597
2664
  },
1598
2665
  supabase: async (config) => {
1599
- const { SupabaseResource: SupabaseResource2 } = await import("./supabase-HLWNHBBE.js");
1600
- const { normalizeSupabaseConfig } = await import("./config-GE4W4ZJC.js");
2666
+ const { SupabaseResource: SupabaseResource2 } = await import("./supabase-BBM44UTM.js");
2667
+ const { normalizeSupabaseConfig } = await import("./config-EX3ZJTZI.js");
1601
2668
  return new SupabaseResource2(normalizeSupabaseConfig(config));
1602
2669
  },
1603
2670
  databricks_volume: async (config) => {
1604
- const { DatabricksVolumeResource: DatabricksVolumeResource2 } = await import("./databricks_volume-HNQ4DJVJ.js");
2671
+ const { DatabricksVolumeResource: DatabricksVolumeResource2 } = await import("./databricks_volume-ETRDJVVQ.js");
1605
2672
  const { normalizeDatabricksVolumeConfig } = await import("@struktoai/mirage-core");
1606
2673
  return DatabricksVolumeResource2.create(normalizeDatabricksVolumeConfig(config));
1607
2674
  },
1608
2675
  minio: async (config) => {
1609
- const { MinIOResource: MinIOResource2 } = await import("./minio-L3XE6PQS.js");
1610
- const { normalizeMinIOConfig } = await import("./config-34LHOGLM.js");
2676
+ const { MinIOResource: MinIOResource2 } = await import("./minio-IZRZY4C5.js");
2677
+ const { normalizeMinIOConfig } = await import("./config-2LASFFRD.js");
1611
2678
  return new MinIOResource2(normalizeMinIOConfig(config));
1612
2679
  },
1613
2680
  ceph: async (config) => {
1614
- const { CephResource: CephResource2 } = await import("./ceph-TNN4I2FT.js");
1615
- const { normalizeCephConfig } = await import("./config-ZFJYQZCH.js");
2681
+ const { CephResource: CephResource2 } = await import("./ceph-C265UI5T.js");
2682
+ const { normalizeCephConfig } = await import("./config-54USUVSE.js");
1616
2683
  return new CephResource2(normalizeCephConfig(config));
1617
2684
  },
1618
2685
  seaweedfs: async (config) => {
1619
- const { SeaweedFSResource: SeaweedFSResource2 } = await import("./seaweedfs-J3EPUEPE.js");
1620
- const { normalizeSeaweedFSConfig } = await import("./config-GHRUKEQ6.js");
2686
+ const { SeaweedFSResource: SeaweedFSResource2 } = await import("./seaweedfs-3XYIAFU2.js");
2687
+ const { normalizeSeaweedFSConfig } = await import("./config-OJ2BPESH.js");
1621
2688
  return new SeaweedFSResource2(normalizeSeaweedFSConfig(config));
1622
2689
  },
1623
2690
  wasabi: async (config) => {
1624
- const { WasabiResource: WasabiResource2 } = await import("./wasabi-SOZKPMRQ.js");
1625
- const { normalizeWasabiConfig } = await import("./config-QAA646XB.js");
2691
+ const { WasabiResource: WasabiResource2 } = await import("./wasabi-O4MVIUFG.js");
2692
+ const { normalizeWasabiConfig } = await import("./config-T2IUIU5C.js");
1626
2693
  return new WasabiResource2(normalizeWasabiConfig(config));
1627
2694
  },
1628
2695
  backblaze: async (config) => {
1629
- const { BackblazeResource: BackblazeResource2 } = await import("./backblaze-OHW57DLK.js");
1630
- const { normalizeBackblazeConfig } = await import("./config-WDAZFXYD.js");
2696
+ const { BackblazeResource: BackblazeResource2 } = await import("./backblaze-TSPL6Y56.js");
2697
+ const { normalizeBackblazeConfig } = await import("./config-QO2XUME4.js");
1631
2698
  return new BackblazeResource2(normalizeBackblazeConfig(config));
1632
2699
  },
1633
2700
  digitalocean: async (config) => {
1634
- const { DigitalOceanResource: DigitalOceanResource2 } = await import("./digitalocean-6SPR4S7V.js");
1635
- const { normalizeDigitalOceanConfig } = await import("./config-Q45Y46YT.js");
2701
+ const { DigitalOceanResource: DigitalOceanResource2 } = await import("./digitalocean-QP72DR4J.js");
2702
+ const { normalizeDigitalOceanConfig } = await import("./config-XU6D5C7E.js");
1636
2703
  return new DigitalOceanResource2(normalizeDigitalOceanConfig(config));
1637
2704
  },
1638
2705
  tencent: async (config) => {
1639
- const { TencentResource: TencentResource2 } = await import("./tencent-YDO73XBD.js");
1640
- const { normalizeTencentConfig } = await import("./config-QNMKWJ4M.js");
2706
+ const { TencentResource: TencentResource2 } = await import("./tencent-X72USLJ7.js");
2707
+ const { normalizeTencentConfig } = await import("./config-FRK7ZL37.js");
1641
2708
  return new TencentResource2(normalizeTencentConfig(config));
1642
2709
  },
1643
2710
  aliyun: async (config) => {
1644
- const { AliyunResource: AliyunResource2 } = await import("./aliyun-TMZRUYCG.js");
1645
- const { normalizeAliyunConfig } = await import("./config-HKRMKD76.js");
2711
+ const { AliyunResource: AliyunResource2 } = await import("./aliyun-PGI57A43.js");
2712
+ const { normalizeAliyunConfig } = await import("./config-IPNWAJHH.js");
1646
2713
  return new AliyunResource2(normalizeAliyunConfig(config));
1647
2714
  },
1648
2715
  scaleway: async (config) => {
1649
- const { ScalewayResource: ScalewayResource2 } = await import("./scaleway-5VM55Y6D.js");
1650
- const { normalizeScalewayConfig } = await import("./config-EO23EY62.js");
2716
+ const { ScalewayResource: ScalewayResource2 } = await import("./scaleway-SEZJVURB.js");
2717
+ const { normalizeScalewayConfig } = await import("./config-CPYFOUQO.js");
1651
2718
  return new ScalewayResource2(normalizeScalewayConfig(config));
1652
2719
  },
1653
2720
  qingstor: async (config) => {
1654
- const { QingStorResource: QingStorResource2 } = await import("./qingstor-W55D5YFO.js");
1655
- const { normalizeQingStorConfig } = await import("./config-IVY5EQQ2.js");
2721
+ const { QingStorResource: QingStorResource2 } = await import("./qingstor-AP4IIPLY.js");
2722
+ const { normalizeQingStorConfig } = await import("./config-M3Z47VYU.js");
1656
2723
  return new QingStorResource2(normalizeQingStorConfig(config));
1657
2724
  },
1658
2725
  postgres: async (config) => {
1659
- const { PostgresResource: PostgresResource2 } = await import("./postgres-JNFMPAO2.js");
2726
+ const { PostgresResource: PostgresResource2 } = await import("./postgres-WIQBVL5M.js");
1660
2727
  const { normalizePostgresConfig } = await import("@struktoai/mirage-core");
1661
2728
  return new PostgresResource2(normalizePostgresConfig(config));
1662
2729
  },
1663
2730
  mongodb: async (config) => {
1664
- const { MongoDBResource: MongoDBResource2 } = await import("./mongodb-ZOX4FRHJ.js");
2731
+ const { MongoDBResource: MongoDBResource2 } = await import("./mongodb-VMKPQCPX.js");
1665
2732
  const { normalizeMongoDBConfig } = await import("@struktoai/mirage-core");
1666
2733
  return new MongoDBResource2(normalizeMongoDBConfig(config));
1667
2734
  },
1668
2735
  slack: async (config) => {
1669
- const { SlackResource: SlackResource2 } = await import("./slack-FVBXY7KD.js");
1670
- const { normalizeSlackConfig: normalizeSlackConfig2 } = await import("./config-ZV6G2ZEC.js");
2736
+ const { SlackResource: SlackResource2 } = await import("./slack-ZHXDJQY4.js");
2737
+ const { normalizeSlackConfig: normalizeSlackConfig2 } = await import("./config-4QV4QYI5.js");
1671
2738
  return new SlackResource2(normalizeSlackConfig2(config));
1672
2739
  },
1673
2740
  ssh: async (config) => {
1674
- const { SSHResource: SSHResource2 } = await import("./ssh-GCXETJ3Z.js");
1675
- const { normalizeSshConfig: normalizeSshConfig2 } = await import("./config-KJOLGVB2.js");
2741
+ const { SSHResource: SSHResource2 } = await import("./ssh-X2MO7JOV.js");
2742
+ const { normalizeSshConfig: normalizeSshConfig2 } = await import("./config-VKKZGC7V.js");
1676
2743
  return new SSHResource2(normalizeSshConfig2(config));
1677
2744
  },
2745
+ nextcloud: async (config) => {
2746
+ const { NextcloudResource: NextcloudResource2 } = await import("./nextcloud-5RHQCGDO.js");
2747
+ const { normalizeNextcloudConfig: normalizeNextcloudConfig2 } = await import("./config-E22XAGYN.js");
2748
+ return new NextcloudResource2(normalizeNextcloudConfig2(config));
2749
+ },
1678
2750
  discord: async (config) => {
1679
- const { DiscordResource: DiscordResource2 } = await import("./discord-SAV2RBJV.js");
1680
- const { normalizeDiscordConfig: normalizeDiscordConfig2 } = await import("./config-DG65OEG3.js");
2751
+ const { DiscordResource: DiscordResource2 } = await import("./discord-BSN5RB3E.js");
2752
+ const { normalizeDiscordConfig: normalizeDiscordConfig2 } = await import("./config-EHE52ZTK.js");
1681
2753
  return new DiscordResource2(normalizeDiscordConfig2(config));
1682
2754
  },
1683
2755
  trello: async (config) => {
1684
- const { TrelloResource: TrelloResource2 } = await import("./trello-CQ53BQUL.js");
1685
- const { normalizeTrelloConfig: normalizeTrelloConfig2 } = await import("./config-GVH27UPE.js");
2756
+ const { TrelloResource: TrelloResource2 } = await import("./trello-EER5NG7L.js");
2757
+ const { normalizeTrelloConfig: normalizeTrelloConfig2 } = await import("./config-QWQGOXQ5.js");
1686
2758
  return new TrelloResource2(normalizeTrelloConfig2(config));
1687
2759
  },
1688
2760
  linear: async (config) => {
1689
- const { LinearResource: LinearResource2 } = await import("./linear-2MM55KBC.js");
1690
- const { normalizeLinearConfig: normalizeLinearConfig2 } = await import("./config-GCQK6NJY.js");
2761
+ const { LinearResource: LinearResource2 } = await import("./linear-V3TXO6CV.js");
2762
+ const { normalizeLinearConfig: normalizeLinearConfig2 } = await import("./config-LEALEMKA.js");
1691
2763
  return new LinearResource2(normalizeLinearConfig2(config));
1692
2764
  },
1693
2765
  notion: async (config) => {
1694
- const { NotionResource: NotionResource2 } = await import("./notion-UK4GTMT4.js");
1695
- const { normalizeNotionConfig: normalizeNotionConfig2 } = await import("./config-IJJXGLBQ.js");
2766
+ const { NotionResource: NotionResource2 } = await import("./notion-6PPNTQFM.js");
2767
+ const { normalizeNotionConfig: normalizeNotionConfig2 } = await import("./config-HTXOOAOD.js");
1696
2768
  return new NotionResource2(normalizeNotionConfig2(config));
1697
2769
  },
1698
2770
  langfuse: async (config) => {
1699
- const { LangfuseResource: LangfuseResource2 } = await import("./langfuse-HUAYVPHF.js");
1700
- const { normalizeLangfuseConfig: normalizeLangfuseConfig2 } = await import("./config-LHFFXVYI.js");
2771
+ const { LangfuseResource: LangfuseResource2 } = await import("./langfuse-AMQCQWNE.js");
2772
+ const { normalizeLangfuseConfig: normalizeLangfuseConfig2 } = await import("./config-HQXNFQZS.js");
1701
2773
  return new LangfuseResource2(normalizeLangfuseConfig2(config));
1702
2774
  },
1703
2775
  github: async (config) => {
1704
- const { GitHubResource: GitHubResource2 } = await import("./github-KBHWANKQ.js");
1705
- const { normalizeGitHubConfig: normalizeGitHubConfig2 } = await import("./config-3BBWD5AB.js");
2776
+ const { GitHubResource: GitHubResource2 } = await import("./github-EQ4NXUTA.js");
2777
+ const { normalizeGitHubConfig: normalizeGitHubConfig2 } = await import("./config-WKQ3FGTZ.js");
1706
2778
  return GitHubResource2.create(normalizeGitHubConfig2(config));
1707
2779
  },
1708
2780
  github_ci: async (config) => {
1709
- const { GitHubCIResource: GitHubCIResource2 } = await import("./github_ci-HPITNK37.js");
1710
- const { normalizeGitHubCIConfig: normalizeGitHubCIConfig2 } = await import("./config-EIHSP5DZ.js");
2781
+ const { GitHubCIResource: GitHubCIResource2 } = await import("./github_ci-QL5B2Q2N.js");
2782
+ const { normalizeGitHubCIConfig: normalizeGitHubCIConfig2 } = await import("./config-MZM3IPFM.js");
1711
2783
  return new GitHubCIResource2(normalizeGitHubCIConfig2(config));
1712
2784
  },
1713
2785
  gdocs: async (config) => {
1714
- const { GDocsResource: GDocsResource2 } = await import("./gdocs-X5Y2SIQX.js");
1715
- const { normalizeGDocsConfig: normalizeGDocsConfig2 } = await import("./config-D3RLSPNF.js");
2786
+ const { GDocsResource: GDocsResource2 } = await import("./gdocs-GPAZRQG5.js");
2787
+ const { normalizeGDocsConfig: normalizeGDocsConfig2 } = await import("./config-3WDIJPTG.js");
1716
2788
  return new GDocsResource2(normalizeGDocsConfig2(config));
1717
2789
  },
1718
2790
  gsheets: async (config) => {
1719
- const { GSheetsResource: GSheetsResource2 } = await import("./gsheets-ZSUDIWGK.js");
1720
- const { normalizeGSheetsConfig: normalizeGSheetsConfig2 } = await import("./config-OT2TQQCN.js");
2791
+ const { GSheetsResource: GSheetsResource2 } = await import("./gsheets-N53WEXN2.js");
2792
+ const { normalizeGSheetsConfig: normalizeGSheetsConfig2 } = await import("./config-5ZXN2T2H.js");
1721
2793
  return new GSheetsResource2(normalizeGSheetsConfig2(config));
1722
2794
  },
1723
2795
  gslides: async (config) => {
1724
- const { GSlidesResource: GSlidesResource2 } = await import("./gslides-GYXM7IMJ.js");
1725
- const { normalizeGSlidesConfig: normalizeGSlidesConfig2 } = await import("./config-IDZMEW73.js");
2796
+ const { GSlidesResource: GSlidesResource2 } = await import("./gslides-TATSARTH.js");
2797
+ const { normalizeGSlidesConfig: normalizeGSlidesConfig2 } = await import("./config-RI7IEZUF.js");
1726
2798
  return new GSlidesResource2(normalizeGSlidesConfig2(config));
1727
2799
  },
1728
2800
  gdrive: async (config) => {
1729
- const { GDriveResource: GDriveResource2 } = await import("./gdrive-SIQPRIGI.js");
1730
- const { normalizeGDriveConfig: normalizeGDriveConfig2 } = await import("./config-HXVYIXP5.js");
2801
+ const { GDriveResource: GDriveResource2 } = await import("./gdrive-XSX6A7B3.js");
2802
+ const { normalizeGDriveConfig: normalizeGDriveConfig2 } = await import("./config-K63RX6EU.js");
1731
2803
  return new GDriveResource2(normalizeGDriveConfig2(config));
1732
2804
  },
1733
2805
  dropbox: async (config) => {
1734
- const { DropboxResource: DropboxResource2 } = await import("./dropbox-CQ7MTYX2.js");
1735
- const { normalizeDropboxConfig: normalizeDropboxConfig2 } = await import("./config-4UDVSUQJ.js");
2806
+ const { DropboxResource: DropboxResource2 } = await import("./dropbox-OSTZXSIE.js");
2807
+ const { normalizeDropboxConfig: normalizeDropboxConfig2 } = await import("./config-L7SBSH5L.js");
1736
2808
  return new DropboxResource2(normalizeDropboxConfig2(config));
1737
2809
  },
1738
2810
  box: async (config) => {
1739
- const { BoxResource: BoxResource2 } = await import("./box-UXTCAFOZ.js");
1740
- const { normalizeBoxConfig: normalizeBoxConfig2 } = await import("./config-CMDBAPDH.js");
2811
+ const { BoxResource: BoxResource2 } = await import("./box-7XTZYDSO.js");
2812
+ const { normalizeBoxConfig: normalizeBoxConfig2 } = await import("./config-A2GQYJDB.js");
1741
2813
  return new BoxResource2(normalizeBoxConfig2(config));
1742
2814
  },
1743
2815
  gmail: async (config) => {
1744
- const { GmailResource: GmailResource2 } = await import("./gmail-DKHAGJNX.js");
1745
- const { normalizeGmailConfig } = await import("./config-NV5WXP64.js");
2816
+ const { GmailResource: GmailResource2 } = await import("./gmail-2TBT4CVH.js");
2817
+ const { normalizeGmailConfig } = await import("./config-UU27ALAA.js");
1746
2818
  return new GmailResource2(normalizeGmailConfig(config));
1747
2819
  },
1748
2820
  email: async (config) => {
1749
- const { EmailResource: EmailResource2 } = await import("./email-KBQ7CXS7.js");
1750
- const { normalizeEmailConfig: normalizeEmailConfig2 } = await import("./config-3IVQJBNW.js");
2821
+ const { EmailResource: EmailResource2 } = await import("./email-4ZFPSWIN.js");
2822
+ const { normalizeEmailConfig: normalizeEmailConfig2 } = await import("./config-DWSJL3NH.js");
1751
2823
  return new EmailResource2(normalizeEmailConfig2(config));
1752
2824
  }
1753
2825
  };
@@ -1774,6 +2846,7 @@ export {
1774
2846
  BoxResource,
1775
2847
  CEPH_PROMPT,
1776
2848
  CephResource,
2849
+ DEFAULT_STATE_ROOT,
1777
2850
  DIGITALOCEAN_PROMPT,
1778
2851
  DISK_COMMANDS,
1779
2852
  DISK_OPS,
@@ -1781,7 +2854,12 @@ export {
1781
2854
  DatabricksVolumeResource,
1782
2855
  DigitalOceanResource,
1783
2856
  DiscordResource,
2857
+ DiskNamespaceStore,
2858
+ DiskObserverStore,
2859
+ DiskRecordClient,
1784
2860
  DiskResource,
2861
+ DiskSessionStore,
2862
+ DiskWorkspaceStateStore,
1785
2863
  DropboxResource,
1786
2864
  EMAIL_COMMANDS,
1787
2865
  EMAIL_OPS,
@@ -1800,6 +2878,8 @@ export {
1800
2878
  GitHubCIResource,
1801
2879
  GitHubResource,
1802
2880
  GmailResource,
2881
+ GridFSAccessor,
2882
+ GridFSResource,
1803
2883
  HF_BUCKETS_PROMPT,
1804
2884
  HF_COMMANDS,
1805
2885
  HF_DATASETS_PROMPT,
@@ -1826,6 +2906,12 @@ export {
1826
2906
  MirageFS,
1827
2907
  MongoDBResource,
1828
2908
  MongoDBStore,
2909
+ Mount,
2910
+ NEXTCLOUD_COMMANDS,
2911
+ NEXTCLOUD_OPS,
2912
+ NEXTCLOUD_PROMPT,
2913
+ NextcloudAccessor,
2914
+ NextcloudResource,
1829
2915
  NotionResource,
1830
2916
  OCIResource,
1831
2917
  OCI_PROMPT,
@@ -1840,8 +2926,12 @@ export {
1840
2926
  REDIS_PROMPT,
1841
2927
  RedisAccessor,
1842
2928
  RedisFileCacheStore,
2929
+ RedisNamespaceStore,
2930
+ RedisObserverStore,
1843
2931
  RedisResource,
2932
+ RedisSessionStore,
1844
2933
  RedisStore,
2934
+ RedisWorkspaceStateStore,
1845
2935
  S3Resource,
1846
2936
  SCALEWAY_PROMPT,
1847
2937
  SEAWEEDFS_PROMPT,
@@ -1883,11 +2973,13 @@ export {
1883
2973
  normalizeGitHubCIConfig,
1884
2974
  normalizeGitHubConfig,
1885
2975
  normalizeGoogleConfig as normalizeGmailConfig,
2976
+ normalizeGridFSConfig,
1886
2977
  normalizeHfBucketsConfig,
1887
2978
  normalizeHfModelsConfig,
1888
2979
  normalizeHfRepoConfig,
1889
2980
  normalizeLangfuseConfig,
1890
2981
  normalizeLinearConfig,
2982
+ normalizeNextcloudConfig,
1891
2983
  normalizeNotionConfig,
1892
2984
  normalizeSlackConfig,
1893
2985
  normalizeSshConfig,
@@ -1916,6 +3008,7 @@ export {
1916
3008
  redactLangfuseConfig,
1917
3009
  redactLinearConfig,
1918
3010
  redactMinIOConfig,
3011
+ redactNextcloudConfig,
1919
3012
  redactNotionConfig,
1920
3013
  redactOciConfig,
1921
3014
  redactQingStorConfig,