@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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/redis/redis.ts","../src/commands/builtin/redis/index.ts","../src/core/redis/read.ts","../src/core/redis/utils.ts","../src/core/redis/stat.ts","../src/core/redis/append.ts","../src/core/redis/constants.ts","../src/core/redis/copy.ts","../src/core/redis/create.ts","../src/core/redis/du.ts","../src/core/redis/exists.ts","../src/core/redis/find.ts","../src/core/redis/mkdir.ts","../src/core/redis/readdir.ts","../src/core/redis/entry.ts","../src/core/redis/rename.ts","../src/core/redis/rm.ts","../src/core/redis/rmdir.ts","../src/core/redis/set_attrs.ts","../src/core/redis/stream.ts","../src/core/redis/truncate.ts","../src/core/redis/unlink.ts","../src/core/redis/write.ts","../src/commands/builtin/redis/io.ts","../src/accessor/redis.ts","../src/ops/redis/index.ts","../src/resource/redis/prompt.ts","../src/resource/redis/store.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n PathSpec,\n REDACTED_SECRET,\n ResourceName,\n makeResolveGlob,\n mountKey,\n mountPrefixOf,\n type FileStat,\n type FindOptions,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n} from '@struktoai/mirage-core'\nimport { REDIS_COMMANDS } from '../../commands/builtin/redis/index.ts'\nimport type { RedisClientType } from 'redis'\nimport { RedisAccessor } from '../../accessor/redis.ts'\nimport { appendBytes } from '../../core/redis/append.ts'\nimport { SCOPE_ERROR } from '../../core/redis/constants.ts'\nimport { copy as copyCore } from '../../core/redis/copy.ts'\nimport { create as createCore } from '../../core/redis/create.ts'\nimport { du as duCore, duAll as duAllCore } from '../../core/redis/du.ts'\nimport { exists as existsCore } from '../../core/redis/exists.ts'\nimport { find as findCore, type FindOptions as RedisFindOptions } from '../../core/redis/find.ts'\nimport { mkdir as mkdirCore } from '../../core/redis/mkdir.ts'\nimport { read as readCore } from '../../core/redis/read.ts'\nimport { readdir as readdirCore } from '../../core/redis/readdir.ts'\nimport { rename as renameCore } from '../../core/redis/rename.ts'\nimport { rmR as rmRCore } from '../../core/redis/rm.ts'\nimport { rmdir as rmdirCore } from '../../core/redis/rmdir.ts'\nimport { stat as statCore } from '../../core/redis/stat.ts'\nimport { stream as streamCore } from '../../core/redis/stream.ts'\nimport { truncate as truncateCore } from '../../core/redis/truncate.ts'\nimport { unlink as unlinkCore } from '../../core/redis/unlink.ts'\nimport { writeBytes as writeCore } from '../../core/redis/write.ts'\nimport { REDIS_OPS } from '../../ops/redis/index.ts'\nimport { REDIS_PROMPT } from './prompt.ts'\nimport { RedisStore } from './store.ts'\n\nconst globCore = makeResolveGlob(readdirCore, SCOPE_ERROR)\n\nexport interface RedisResourceOptions {\n url?: string\n keyPrefix?: string\n}\n\nexport interface RedisModule {\n createClient: (options: { url: string }) => RedisClientType\n RESP_TYPES: { readonly BLOB_STRING: number }\n}\n\nexport interface RedisResourceState {\n type: string\n config: {\n url: typeof REDACTED_SECRET\n keyPrefix: string\n }\n keyPrefix: string\n files: Record<string, Uint8Array>\n dirs: string[]\n attrs?: Record<string, Record<string, string>>\n modified?: Record<string, string>\n}\n\nexport class RedisResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.REDIS\n readonly cachesReads: boolean = false\n override readonly indexTtl: number = 0\n readonly prompt: string = REDIS_PROMPT\n readonly url: string\n readonly keyPrefix: string\n readonly store: RedisStore\n readonly accessor: RedisAccessor\n\n readonly opsMap: Record<string, unknown> = {\n read_bytes: readCore,\n write: writeCore,\n readdir: readdirCore,\n stat: statCore,\n unlink: unlinkCore,\n rmdir: rmdirCore,\n copy: copyCore,\n rename: renameCore,\n mkdir: mkdirCore,\n read_stream: streamCore,\n rm_recursive: rmRCore,\n du_total: duCore,\n du_all: duAllCore,\n create: createCore,\n truncate: truncateCore,\n exists: existsCore,\n find_flat: findCore,\n append: appendBytes,\n }\n\n constructor(options: RedisResourceOptions = {}) {\n super()\n this.url = options.url ?? 'redis://localhost:6379/0'\n this.keyPrefix = options.keyPrefix ?? 'mirage:fs:'\n this.store = new RedisStore({ url: this.url, keyPrefix: this.keyPrefix })\n this.accessor = new RedisAccessor(this.store)\n }\n\n async open(): Promise<void> {\n await this.store.client()\n }\n\n close(): Promise<void> {\n return this.store.close()\n }\n\n client(): Promise<RedisClientType> {\n return this.store.client()\n }\n\n protected module(): Promise<RedisModule> {\n return import('redis') as unknown as Promise<RedisModule>\n }\n\n ops(): readonly RegisteredOp[] {\n return REDIS_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return REDIS_COMMANDS\n }\n\n streamPath(p: PathSpec): AsyncIterable<Uint8Array> {\n return streamCore(this.accessor, p)\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return readCore(this.accessor, p)\n }\n\n writeFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return writeCore(this.accessor, p, data)\n }\n\n appendFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return appendBytes(this.accessor, p, data)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return readdirCore(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return statCore(this.accessor, p)\n }\n\n exists(p: PathSpec): Promise<boolean> {\n return existsCore(this.accessor, p)\n }\n\n mkdir(p: PathSpec, options?: { recursive?: boolean }): Promise<void> {\n return mkdirCore(this.accessor, p, options?.recursive === true)\n }\n\n rmdir(p: PathSpec): Promise<void> {\n return rmdirCore(this.accessor, p)\n }\n\n unlink(p: PathSpec): Promise<void> {\n return unlinkCore(this.accessor, p)\n }\n\n rename(src: PathSpec, dst: PathSpec): Promise<void> {\n return renameCore(this.accessor, src, dst)\n }\n\n truncate(p: PathSpec, length: number): Promise<void> {\n return truncateCore(this.accessor, p, length)\n }\n\n copy(src: PathSpec, dst: PathSpec): Promise<void> {\n return copyCore(this.accessor, src, dst)\n }\n\n rmR(p: PathSpec): Promise<void> {\n return rmRCore(this.accessor, p)\n }\n\n du(p: PathSpec): Promise<number> {\n return duCore(this.accessor, p)\n }\n\n find(p: PathSpec, options: FindOptions = {}): Promise<string[]> {\n return findCore(this.accessor, p, options as RedisFindOptions)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective = prefix\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath)\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return globCore(this.accessor, effective, this.index)\n }\n\n async getState(): Promise<RedisResourceState> {\n const files: Record<string, Uint8Array> = {}\n for (const key of await this.store.listFiles()) {\n const data = await this.store.getFile(key)\n if (data !== null) files[key] = data\n }\n const dirs = [...(await this.store.listDirs())].sort()\n const c = await this.store.client()\n const attrs: Record<string, Record<string, string>> = {}\n const attrsStrip = `${this.keyPrefix}attrs:`.length\n for await (const key of c.scanIterator({ MATCH: `${this.keyPrefix}attrs:*` })) {\n for (const k of Array.isArray(key) ? key : [key]) {\n attrs[k.slice(attrsStrip)] = { ...(await c.hGetAll(k)) }\n }\n }\n const modified: Record<string, string> = {}\n const modStrip = `${this.keyPrefix}modified:`.length\n for await (const key of c.scanIterator({ MATCH: `${this.keyPrefix}modified:*` })) {\n for (const k of Array.isArray(key) ? key : [key]) {\n const val = await c.get(k)\n if (val !== null) modified[k.slice(modStrip)] = val\n }\n }\n return {\n type: this.kind,\n config: {\n url: REDACTED_SECRET,\n keyPrefix: this.keyPrefix,\n },\n keyPrefix: this.keyPrefix,\n files,\n dirs,\n attrs,\n modified,\n }\n }\n\n async loadState(state: RedisResourceState): Promise<void> {\n const c = await this.store.client()\n const pipe = c.multi()\n const dirKey = `${this.keyPrefix}dir`\n for (const [path, data] of Object.entries(state.files)) {\n pipe.set(\n `${this.keyPrefix}file:${path}`,\n Buffer.from(data.buffer, data.byteOffset, data.byteLength),\n )\n }\n for (const dir of state.dirs) {\n pipe.sAdd(dirKey, dir)\n }\n for (const [path, fields] of Object.entries(state.attrs ?? {})) {\n if (Object.keys(fields).length > 0) {\n pipe.hSet(`${this.keyPrefix}attrs:${path}`, fields)\n }\n }\n for (const [path, ts] of Object.entries(state.modified ?? {})) {\n pipe.set(`${this.keyPrefix}modified:${path}`, ts)\n }\n await pipe.exec()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n type RegisteredCommand,\n ResourceName,\n makeFiletypeCommands,\n makeGenericCommands,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { read as redisRead } from '../../../core/redis/read.ts'\nimport { stat as redisStat } from '../../../core/redis/stat.ts'\nimport { REDIS_IO } from './io.ts'\n\nexport const REDIS_COMMANDS: readonly RegisteredCommand[] = [\n ...makeFiletypeCommands<RedisAccessor>({\n resource: ResourceName.REDIS,\n readBytes: redisRead,\n statEntry: redisStat,\n }),\n ...makeGenericCommands<RedisAccessor>(ResourceName.REDIS, REDIS_IO),\n]\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type IndexCacheStore, record, ResourceName, type PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function read(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): Promise<Uint8Array> {\n const start = performance.now()\n const p = norm(path.mountPath)\n const data = await accessor.store.getFile(p)\n if (data === null) {\n throw enoent(path)\n }\n record('read', p, ResourceName.REDIS, data.byteLength, start)\n return data\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport { norm, parent, gnuBasename as basename } from '@struktoai/mirage-core'\n\nexport function nowIso(): string {\n return new Date().toISOString()\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n FileStat,\n FileType,\n guessType,\n type IndexCacheStore,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { basename, norm } from './utils.ts'\n\nfunction decodeAttrs(raw: Record<string, string>): {\n mode?: number\n uid?: number | string\n gid?: number | string\n atime?: string\n} {\n const out: { mode?: number; uid?: number | string; gid?: number | string; atime?: string } = {}\n if (raw.mode !== undefined) out.mode = parseInt(raw.mode, 10)\n for (const key of ['uid', 'gid'] as const) {\n const val = raw[key]\n if (val !== undefined) out[key] = /^\\d+$/.test(val) ? parseInt(val, 10) : val\n }\n if (raw.atime !== undefined) out.atime = raw.atime\n return out\n}\n\nexport async function stat(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): Promise<FileStat> {\n const p = norm(path.mountPath)\n const store = accessor.store\n if (await store.hasDir(p)) {\n const attrs = decodeAttrs(await store.getAttrs(p))\n return new FileStat({\n name: basename(p),\n modified: await store.getModified(p),\n type: FileType.DIRECTORY,\n mode: attrs.mode ?? null,\n uid: attrs.uid ?? null,\n gid: attrs.gid ?? null,\n atime: attrs.atime ?? null,\n })\n }\n if (await store.hasFile(p)) {\n const size = await store.fileLen(p)\n const attrs = decodeAttrs(await store.getAttrs(p))\n return new FileStat({\n name: basename(p),\n size,\n modified: await store.getModified(p),\n type: guessType(p),\n mode: attrs.mode ?? null,\n uid: attrs.uid ?? null,\n gid: attrs.gid ?? null,\n atime: attrs.atime ?? null,\n })\n }\n throw enoent(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { ResourceName, invalidateAfterWrite, record, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function appendBytes(\n accessor: RedisAccessor,\n path: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const start = performance.now()\n const p = norm(path.mountPath)\n const store = accessor.store\n const existing = await store.getFile(p)\n if (existing !== null) {\n const merged = new Uint8Array(existing.byteLength + data.byteLength)\n merged.set(existing, 0)\n merged.set(data, existing.byteLength)\n await store.setFile(p, merged)\n } else {\n await store.setFile(p, data)\n }\n await store.setModified(p, nowIso())\n record('append', p, ResourceName.REDIS, data.byteLength, start)\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const SCOPE_WARN = 5000\nexport const SCOPE_ERROR = 50000\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { invalidateAfterWrite, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function copy(accessor: RedisAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const s = norm(src.mountPath)\n const d = norm(dst.mountPath)\n const store = accessor.store\n const data = await store.getFile(s)\n if (data === null) {\n throw new Error(`file not found: ${s}`)\n }\n await store.setFile(d, data)\n await store.setModified(d, nowIso())\n await invalidateAfterWrite(dst)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { invalidateAfterWrite, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function create(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.mountPath)\n const store = accessor.store\n await store.setFile(p, new Uint8Array(0))\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { rstripSlash } from '@struktoai/mirage-core'\n\nexport async function du(accessor: RedisAccessor, path: PathSpec): Promise<number> {\n const p = norm(path.mountPath)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n let total = 0\n for (const key of await store.listFiles()) {\n if (key === p || key.startsWith(prefix)) {\n total += await store.fileLen(key)\n }\n }\n return total\n}\n\nexport async function duAll(\n accessor: RedisAccessor,\n path: PathSpec,\n): Promise<{ entries: [string, number][]; total: number }> {\n const p = norm(path.mountPath)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const entries: [string, number][] = []\n let total = 0\n for (const key of await store.listFiles()) {\n if (key === p || key.startsWith(prefix)) {\n const size = await store.fileLen(key)\n entries.push([key, size])\n total += size\n }\n }\n return { entries, total }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function exists(accessor: RedisAccessor, path: PathSpec): Promise<boolean> {\n const p = norm(path.mountPath)\n const store = accessor.store\n return (await store.hasFile(p)) || (await store.hasDir(p))\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport {\n buildTree,\n computeNonemptyDirs,\n emitStartPath,\n keep,\n type PredNode,\n rstripSlash,\n startBasename,\n} from '@struktoai/mirage-core'\n\nexport interface FindOptions {\n name?: string | null\n type?: 'f' | 'd' | null\n minSize?: number | null\n maxSize?: number | null\n maxDepth?: number | null\n minDepth?: number | null\n nameExclude?: string | null\n orNames?: string[] | null\n iname?: string | null\n pathPattern?: string | null\n empty?: boolean | null\n tree?: PredNode | null\n}\n\nexport async function find(\n accessor: RedisAccessor,\n path: PathSpec,\n options: FindOptions = {},\n): Promise<string[]> {\n const p = norm(path.mountPath)\n const startName = startBasename(path.virtual)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const baseDepth = p === '/' ? 0 : (p.match(/\\//g) ?? []).length\n const results: string[] = []\n const tree =\n options.tree ??\n buildTree({\n name: options.name,\n iname: options.iname,\n pathPattern: options.pathPattern,\n type: options.type,\n nameExclude: options.nameExclude,\n orNames: options.orNames,\n empty: options.empty,\n })\n const empty = options.empty === true\n const allFiles = await store.listFiles()\n const allDirs = await store.listDirs()\n const nonempty = empty\n ? computeNonemptyDirs([...allFiles, ...[...allDirs].filter((k) => k !== '/')])\n : new Set<string>()\n const candidates: [string, 'f' | 'd'][] = []\n if (options.type !== 'd') {\n for (const key of allFiles) candidates.push([key, 'f'])\n }\n if (options.type !== 'f') {\n for (const key of allDirs) {\n candidates.push([key, 'd'])\n }\n }\n let rootKind: 'f' | 'd' | null = null\n let rootIsEmpty: boolean | null = null\n let rootSize: number | null = null\n for (const [key, kind] of candidates) {\n if (key !== p && !key.startsWith(prefix)) continue\n if (key === p) {\n rootKind = kind\n if (empty) {\n rootIsEmpty = kind === 'f' ? (await store.fileLen(key)) === 0 : !nonempty.has(key)\n }\n if (kind === 'f') rootSize = await store.fileLen(key)\n continue\n }\n const depth = (key.match(/\\//g) ?? []).length - baseDepth\n if (options.maxDepth !== null && options.maxDepth !== undefined && depth > options.maxDepth)\n continue\n const basename = key.slice(key.lastIndexOf('/') + 1)\n let isEmpty: boolean | null = null\n if (empty) {\n isEmpty = kind === 'f' ? (await store.fileLen(key)) === 0 : !nonempty.has(key)\n }\n if (!keep({ key, name: basename, kind, depth, isEmpty }, tree, options.minDepth)) continue\n if (options.minSize != null || options.maxSize != null) {\n // Directories count as size 0 for -size (deliberate GNU divergence).\n const size = kind === 'f' ? await store.fileLen(key) : 0\n if (options.minSize != null && size < options.minSize) continue\n if (options.maxSize != null && size > options.maxSize) continue\n }\n results.push(key)\n }\n if (rootKind !== null) {\n emitStartPath(results, p, startName, {\n kind: rootKind,\n isEmpty: rootIsEmpty,\n exists: true,\n tree,\n maxDepth: options.maxDepth,\n minDepth: options.minDepth,\n size: rootSize,\n minSize: options.minSize,\n maxSize: options.maxSize,\n })\n }\n results.sort()\n return results\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterWrite, invalidateAncestors } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso, parent } from './utils.ts'\nimport { stripSlash } from '@struktoai/mirage-core'\n\nexport async function mkdir(\n accessor: RedisAccessor,\n path: PathSpec,\n parents = false,\n): Promise<void> {\n const p = norm(path.mountPath)\n const store = accessor.store\n if (parents) {\n const parts = stripSlash(p).split('/')\n let current = ''\n const now = nowIso()\n for (const part of parts) {\n current += `/${part}`\n await store.addDir(current)\n const mod = await store.getModified(current)\n if (mod === null) {\n await store.setModified(current, now)\n }\n }\n await invalidateAfterWrite(p)\n await invalidateAncestors(path)\n return\n }\n const par = parent(p)\n if (par !== '/' && !(await store.hasDir(par))) {\n throw new Error(`parent directory does not exist: ${par}`)\n }\n await store.addDir(p)\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n mountPrefixOf,\n type IndexCacheStore,\n type PathSpec,\n rstripSlash,\n} from '@struktoai/mirage-core'\nimport { enotdir } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { RedisIndexEntry } from './entry.ts'\nimport { norm } from './utils.ts'\n\nexport async function readdir(\n accessor: RedisAccessor,\n path: PathSpec,\n index?: IndexCacheStore,\n): Promise<string[]> {\n const virtual = path.pattern !== null ? path.directory : path.mountPath\n const mountPrefix = mountPrefixOf(path.virtual, path.resourcePath)\n // Canonical key: no trailing slash (except root), or the same dir\n // indexes under two keys and cache hits return doubled-slash entries.\n const virtualKey = rstripSlash(mountPrefix + virtual) || '/'\n if (index !== undefined) {\n const cached = await index.listDir(virtualKey)\n if (cached.entries !== undefined && cached.entries !== null) {\n return cached.entries\n }\n }\n const store = accessor.store\n const p = norm(virtual)\n if (!(await store.hasDir(p))) {\n throw enotdir(path)\n }\n const dirPrefix = p === '/' ? '/' : `${p}/`\n const seen = new Set<string>()\n const files = await store.listFiles()\n const dirs = await store.listDirs()\n for (const key of [...files, ...dirs]) {\n if (key === p) continue\n if (!key.startsWith(dirPrefix)) continue\n const remainder = key.slice(dirPrefix.length)\n const first = remainder.split('/')[0]\n if (first !== undefined && first.length > 0) seen.add(dirPrefix + first)\n }\n const sorted = [...seen].sort()\n const virtualEntries = sorted.map((entry) => `${mountPrefix}${entry}`)\n if (index !== undefined) {\n const fileSet = new Set(files)\n const entries: [string, RedisIndexEntry][] = sorted.map((e) => {\n const name = e.slice(e.lastIndexOf('/') + 1)\n return [name, fileSet.has(e) ? RedisIndexEntry.file(e) : RedisIndexEntry.folder(e)]\n })\n await index.setDir(virtualKey, entries)\n }\n return virtualEntries\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { IndexEntry } from '@struktoai/mirage-core'\n\nconst RedisResourceType = Object.freeze({\n FILE: 'file',\n FOLDER: 'folder',\n} as const)\n\ntype RedisResourceType = (typeof RedisResourceType)[keyof typeof RedisResourceType]\n\nexport class RedisIndexEntry extends IndexEntry {\n // size defaults to null, not 0: a readdir knows a key exists but not\n // its length, and a lying 0 would be trusted by index-first size\n // lookups (provision estimates) over a real stat.\n static file(path: string, size: number | null = null): RedisIndexEntry {\n const name = path.slice(path.lastIndexOf('/') + 1)\n return new RedisIndexEntry({\n id: path,\n name,\n resourceType: RedisResourceType.FILE,\n vfsName: name,\n size,\n })\n }\n\n static folder(path: string): RedisIndexEntry {\n const name = path.slice(path.lastIndexOf('/') + 1)\n return new RedisIndexEntry({\n id: path,\n name,\n resourceType: RedisResourceType.FOLDER,\n vfsName: name,\n })\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterUnlink, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\nimport { rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rename(accessor: RedisAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const s = norm(src.mountPath)\n const d = norm(dst.mountPath)\n const now = nowIso()\n const store = accessor.store\n if (await store.hasFile(s)) {\n const data = await store.getFile(s)\n const mod = await store.getModified(s)\n const attrs = await store.getAttrs(s)\n if (data === null) throw new Error(`file not found: ${s}`)\n await store.delFile(s)\n await store.delModified(s)\n await store.delAttrs(s)\n await store.setFile(d, data)\n await store.setModified(d, mod ?? now)\n if (Object.keys(attrs).length > 0) await store.setAttrs(d, attrs)\n await invalidateAfterUnlink(s)\n await invalidateAfterWrite(d)\n return\n }\n if (await store.hasDir(s)) {\n const mod = await store.getModified(s)\n const attrs = await store.getAttrs(s)\n await store.removeDir(s)\n await store.delModified(s)\n await store.delAttrs(s)\n await store.addDir(d)\n await store.setModified(d, mod ?? now)\n if (Object.keys(attrs).length > 0) await store.setAttrs(d, attrs)\n const prefix = rstripSlash(s) + '/'\n const dPrefix = rstripSlash(d) + '/'\n const files = await store.listFiles()\n for (const key of files) {\n if (key.startsWith(prefix)) {\n const newKey = dPrefix + key.slice(prefix.length)\n const data = await store.getFile(key)\n if (data === null) continue\n const subAttrs = await store.getAttrs(key)\n await store.delFile(key)\n await store.delAttrs(key)\n await store.setFile(newKey, data)\n if (Object.keys(subAttrs).length > 0) await store.setAttrs(newKey, subAttrs)\n }\n }\n await invalidateAfterUnlink(s)\n await invalidateAfterWrite(d)\n return\n }\n throw new Error(`file not found: ${s}`)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { invalidateAfterUnlink, rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rmR(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.mountPath)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const files = await store.listFiles()\n for (const key of files) {\n if (key === p || key.startsWith(prefix)) {\n await store.delFile(key)\n await store.delModified(key)\n await store.delAttrs(key)\n }\n }\n const dirs = await store.listDirs()\n for (const key of dirs) {\n if (key === p || key.startsWith(prefix)) {\n await store.removeDir(key)\n await store.delModified(key)\n await store.delAttrs(key)\n }\n }\n await invalidateAfterUnlink(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { invalidateAfterUnlink, rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rmdir(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.mountPath)\n const store = accessor.store\n if (!(await store.hasDir(p))) {\n throw new Error(`not a directory: ${p}`)\n }\n const prefix = rstripSlash(p) + '/'\n const files = await store.listFiles()\n const dirs = await store.listDirs()\n const candidates = [...files, ...dirs]\n for (const k of candidates) {\n if (k !== p && k.startsWith(prefix)) {\n throw new Error(`directory not empty: ${p}`)\n }\n }\n await store.removeDir(p)\n await invalidateAfterUnlink(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { enoent, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport interface SetAttrsFields {\n mode?: number\n uid?: number | string\n gid?: number | string\n atime?: string\n mtime?: string\n}\n\n// Write metadata fields on an existing entry (the write side of stat).\n// Fields live in a per-path attrs hash; values are stored as strings\n// (redis hashes are string-valued) and decoded by stat. Stored, not\n// enforced: mount mode does real access control. Returns the residual\n// (always empty; every field applies natively).\nexport async function setAttrs(\n accessor: RedisAccessor,\n path: PathSpec,\n fields: SetAttrsFields,\n): Promise<Record<string, number | string>> {\n const store = accessor.store\n const p = norm(path.mountPath)\n if (!(await store.hasFile(p)) && !(await store.hasDir(p))) {\n throw enoent(path)\n }\n const encoded: Record<string, string> = {}\n if (fields.mode !== undefined) encoded.mode = String(fields.mode)\n if (fields.uid !== undefined) encoded.uid = String(fields.uid)\n if (fields.gid !== undefined) encoded.gid = String(fields.gid)\n if (fields.atime !== undefined) encoded.atime = fields.atime\n if (Object.keys(encoded).length > 0) {\n await store.setAttrs(p, encoded)\n }\n if (fields.mtime !== undefined) {\n await store.setModified(p, fields.mtime)\n }\n return {}\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n type IndexCacheStore,\n recordStream,\n ResourceName,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function* stream(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): AsyncIterable<Uint8Array> {\n const p = norm(path.mountPath)\n const data = await accessor.store.getFile(p)\n if (data === null) throw enoent(path)\n const rec = recordStream('read', p, ResourceName.REDIS)\n if (rec !== null) rec.bytes = data.byteLength\n yield data\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function truncate(\n accessor: RedisAccessor,\n path: PathSpec,\n length: number,\n): Promise<void> {\n const p = norm(path.mountPath)\n const store = accessor.store\n const existing = await store.getFile(p)\n const data = existing ?? new Uint8Array(0)\n const out = new Uint8Array(length)\n const copyLen = Math.min(data.byteLength, length)\n out.set(data.subarray(0, copyLen), 0)\n await store.setFile(p, out)\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterUnlink } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function unlink(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.mountPath)\n const store = accessor.store\n if (!(await store.hasFile(p))) {\n throw new Error(`file not found: ${p}`)\n }\n await store.delFile(p)\n await store.delModified(p)\n await store.delAttrs(p)\n await invalidateAfterUnlink(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { ResourceName, invalidateAfterWrite, record, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso, parent } from './utils.ts'\n\nexport async function writeBytes(\n accessor: RedisAccessor,\n path: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const start = performance.now()\n const p = norm(path.mountPath)\n const par = parent(p)\n const store = accessor.store\n if (par !== '/' && !(await store.hasDir(par))) {\n throw new Error(`parent directory does not exist: ${par}`)\n }\n await store.setFile(p, data)\n await store.setModified(p, nowIso())\n record('write', p, ResourceName.REDIS, data.byteLength, start)\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { CommandIO } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { appendBytes as redisAppend } from '../../../core/redis/append.ts'\nimport { SCOPE_ERROR } from '../../../core/redis/constants.ts'\nimport { copy as redisCopy } from '../../../core/redis/copy.ts'\nimport { create as redisCreate } from '../../../core/redis/create.ts'\nimport { du as redisDu, duAll as redisDuAll } from '../../../core/redis/du.ts'\nimport { exists as redisExists } from '../../../core/redis/exists.ts'\nimport { find as redisFind } from '../../../core/redis/find.ts'\nimport { mkdir as redisMkdir } from '../../../core/redis/mkdir.ts'\nimport { read as redisRead } from '../../../core/redis/read.ts'\nimport { readdir as redisReaddir } from '../../../core/redis/readdir.ts'\nimport { rename as redisRename } from '../../../core/redis/rename.ts'\nimport { rmR as redisRmR } from '../../../core/redis/rm.ts'\nimport { rmdir as redisRmdir } from '../../../core/redis/rmdir.ts'\nimport { setAttrs as redisSetAttrs } from '../../../core/redis/set_attrs.ts'\nimport { stat as redisStat } from '../../../core/redis/stat.ts'\nimport { stream as redisStream } from '../../../core/redis/stream.ts'\nimport { truncate as redisTruncate } from '../../../core/redis/truncate.ts'\nimport { unlink as redisUnlink } from '../../../core/redis/unlink.ts'\nimport { writeBytes as redisWrite } from '../../../core/redis/write.ts'\n\nexport const REDIS_IO: CommandIO<RedisAccessor> = {\n readdir: redisReaddir,\n readBytes: redisRead,\n readStream: redisStream,\n stat: redisStat,\n isMounted: () => true,\n local: true,\n maxGlobMatches: SCOPE_ERROR,\n write: redisWrite,\n exists: redisExists,\n mkdir: redisMkdir,\n unlink: redisUnlink,\n rmdir: redisRmdir,\n rmR: redisRmR,\n rename: redisRename,\n copy: redisCopy,\n create: redisCreate,\n truncate: redisTruncate,\n append: redisAppend,\n setAttrs: redisSetAttrs,\n find: redisFind,\n duTotal: redisDu,\n duAll: async (accessor, path) => {\n const { entries, total } = await redisDuAll(accessor, path)\n return [entries, total]\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { Accessor } from '@struktoai/mirage-core'\nimport type { RedisStore } from '../resource/redis/store.ts'\n\nexport class RedisAccessor extends Accessor {\n readonly store: RedisStore\n\n constructor(store: RedisStore) {\n super()\n this.store = store\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName, makeGenericOps } from '@struktoai/mirage-core'\nimport { REDIS_IO } from '../../commands/builtin/redis/io.ts'\n\nexport const REDIS_OPS: readonly RegisteredOp[] = makeGenericOps(ResourceName.REDIS, REDIS_IO, {\n filetypeRead: ['.feather', '.hdf5', '.parquet'],\n forwardIndex: false,\n})\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const REDIS_PROMPT = `Redis-backed persistent filesystem. Behaves like a standard filesystem.\nStandard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.`\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { RedisClientType } from 'redis'\nimport { loadOptionalPeer } from '../../optional_peer.ts'\n\nexport interface RedisStoreOptions {\n url?: string\n client?: RedisClientType\n keyPrefix?: string\n}\n\nexport class RedisStore {\n readonly url: string\n readonly keyPrefix: string\n private readonly providedClient: RedisClientType | null\n private clientPromise: Promise<RedisClientType> | null = null\n\n constructor(options: RedisStoreOptions = {}) {\n this.url = options.url ?? 'redis://localhost:6379/0'\n this.keyPrefix = options.keyPrefix ?? 'mirage:fs:'\n this.providedClient = options.client ?? null\n }\n\n fk(path: string): string {\n return `${this.keyPrefix}file:${path}`\n }\n\n dk(): string {\n return `${this.keyPrefix}dir`\n }\n\n mk(path: string): string {\n return `${this.keyPrefix}modified:${path}`\n }\n\n ak(path: string): string {\n return `${this.keyPrefix}attrs:${path}`\n }\n\n async client(): Promise<RedisClientType> {\n if (this.providedClient !== null) return this.providedClient\n this.clientPromise ??= (async () => {\n const mod = await loadOptionalPeer(\n () =>\n import('redis') as unknown as Promise<{\n createClient: (o: { url: string }) => RedisClientType\n }>,\n { feature: 'RedisResource / RedisFileCacheStore', packageName: 'redis' },\n )\n const c = mod.createClient({\n url: this.url,\n socket: { reconnectStrategy: false },\n } as Parameters<typeof mod.createClient>[0])\n await c.connect()\n await c.sAdd(this.dk(), '/')\n return c\n })()\n return this.clientPromise\n }\n\n async getFile(path: string): Promise<Uint8Array | null> {\n const c = await this.client()\n const typed = c as unknown as {\n withTypeMapping: (m: Record<number, unknown>) => {\n get: (k: string) => Promise<Buffer | null>\n }\n }\n const mod = (await import('redis')) as unknown as {\n RESP_TYPES: { readonly BLOB_STRING: number }\n }\n const blob = mod.RESP_TYPES.BLOB_STRING\n const mapping: Record<number, unknown> = { [blob]: Buffer }\n const raw = await typed.withTypeMapping(mapping).get(this.fk(path))\n if (raw === null) return null\n return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength)\n }\n\n async setFile(path: string, data: Uint8Array): Promise<void> {\n const c = await this.client()\n await c.set(this.fk(path), Buffer.from(data.buffer, data.byteOffset, data.byteLength))\n }\n\n async delFile(path: string): Promise<void> {\n const c = await this.client()\n await c.del(this.fk(path))\n }\n\n async hasFile(path: string): Promise<boolean> {\n const c = await this.client()\n return (await c.exists(this.fk(path))) > 0\n }\n\n async listFiles(prefix = ''): Promise<string[]> {\n const c = await this.client()\n const pattern = `${this.keyPrefix}file:${prefix}*`\n const strip = `${this.keyPrefix}file:`.length\n const result: string[] = []\n for await (const k of c.scanIterator({ MATCH: pattern })) {\n const keys = Array.isArray(k) ? k : [k]\n for (const key of keys) result.push(key.slice(strip))\n }\n return result.sort()\n }\n\n async fileLen(path: string): Promise<number> {\n const c = await this.client()\n return c.strLen(this.fk(path))\n }\n\n async hasDir(path: string): Promise<boolean> {\n const c = await this.client()\n return (await c.sIsMember(this.dk(), path)) === 1\n }\n\n async addDir(path: string): Promise<void> {\n const c = await this.client()\n await c.sAdd(this.dk(), path)\n }\n\n async removeDir(path: string): Promise<void> {\n const c = await this.client()\n await c.sRem(this.dk(), path)\n }\n\n async listDirs(): Promise<Set<string>> {\n const c = await this.client()\n const members = await c.sMembers(this.dk())\n return new Set(members)\n }\n\n async getModified(path: string): Promise<string | null> {\n const c = await this.client()\n return c.get(this.mk(path))\n }\n\n async setModified(path: string, ts: string): Promise<void> {\n const c = await this.client()\n await c.set(this.mk(path), ts)\n }\n\n async delModified(path: string): Promise<void> {\n const c = await this.client()\n await c.del(this.mk(path))\n }\n\n async getAttrs(path: string): Promise<Record<string, string>> {\n const c = await this.client()\n const raw = await c.hGetAll(this.ak(path))\n return { ...raw }\n }\n\n async setAttrs(path: string, fields: Record<string, string>): Promise<void> {\n const c = await this.client()\n await c.hSet(this.ak(path), fields)\n }\n\n async delAttrs(path: string): Promise<void> {\n const c = await this.client()\n await c.del(this.ak(path))\n }\n\n async clear(): Promise<void> {\n const c = await this.client()\n for (const pattern of [\n `${this.keyPrefix}file:*`,\n `${this.keyPrefix}modified:*`,\n `${this.keyPrefix}attrs:*`,\n ]) {\n const keys: string[] = []\n for await (const k of c.scanIterator({ MATCH: pattern })) {\n if (Array.isArray(k)) keys.push(...k)\n else keys.push(k)\n }\n if (keys.length > 0) await c.del(keys)\n }\n await c.del(this.dk())\n }\n\n async close(): Promise<void> {\n if (this.providedClient !== null) return\n if (this.clientPromise === null) return\n const c = await this.clientPromise\n const typed = c as unknown as { destroy?: () => void }\n if (typeof typed.destroy === 'function') typed.destroy()\n else if (c.isOpen) await c.quit()\n this.clientPromise = null\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAAC;AAAA,OAMK;;;ACbP;AAAA,EAEE,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACLP,SAA+B,QAAQ,oBAAmC;AAC1E,SAAS,cAAc;;;ACDvB,SAAS,MAAM,QAAuB,mBAAgB;AAE/C,SAAS,SAAiB;AAC/B,UAAO,oBAAI,KAAK,GAAE,YAAY;AAChC;;;ADCA,eAAsB,KACpB,UACA,MACA,QACqB;AACrB,QAAM,QAAQ,YAAY,IAAI;AAC9B,QAAM,IAAI,KAAK,KAAK,SAAS;AAC7B,QAAM,OAAO,MAAM,SAAS,MAAM,QAAQ,CAAC;AAC3C,MAAI,SAAS,MAAM;AACjB,UAAM,OAAO,IAAI;AAAA,EACnB;AACA,SAAO,QAAQ,GAAG,aAAa,OAAO,KAAK,YAAY,KAAK;AAC5D,SAAO;AACT;;;AElBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,UAAAC,eAAc;AAIvB,SAAS,YAAY,KAKnB;AACA,QAAM,MAAuF,CAAC;AAC9F,MAAI,IAAI,SAAS,OAAW,KAAI,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S,YAAY,IAAI,IAAI,EAAE;AAAA,IAClD;AACA,UAAM,KAAK,KAAK;AAAA,EAClB;AACF;","names":["ResourceName","mountPrefixOf","ResourceName","enoent","enoent","ResourceName","record","record","ResourceName","invalidateAfterWrite","invalidateAfterWrite","invalidateAfterWrite","invalidateAfterWrite","rstripSlash","invalidateAfterWrite","invalidateAfterWrite","rstripSlash","rstripSlash","invalidateAfterWrite","rstripSlash","invalidateAfterWrite","invalidateAfterUnlink","rstripSlash","invalidateAfterUnlink","rstripSlash","enoent","enoent","ResourceName","enoent","enoent","ResourceName","invalidateAfterWrite","invalidateAfterWrite","invalidateAfterUnlink","invalidateAfterUnlink","ResourceName","invalidateAfterWrite","record","record","ResourceName","invalidateAfterWrite","ResourceName","ResourceName","ResourceName","ResourceName","mountPrefixOf"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactDiscordConfig
3
- } from "./chunk-DNBAMB5J.js";
3
+ } from "./chunk-EVK6HH6Z.js";
4
4
 
5
5
  // src/resource/discord/discord.ts
6
6
  import {
@@ -8,7 +8,7 @@ import {
8
8
  DISCORD_API,
9
9
  DISCORD_COMMANDS,
10
10
  DISCORD_PROMPT,
11
- DISCORD_VFS_OPS,
11
+ DISCORD_OPS,
12
12
  DISCORD_WRITE_PROMPT,
13
13
  DiscordAccessor,
14
14
  HttpDiscordTransport,
@@ -17,8 +17,11 @@ import {
17
17
  discordRead,
18
18
  discordReaddir,
19
19
  discordStat,
20
- resolveDiscordGlob
20
+ mountKey,
21
+ mountPrefixOf,
22
+ makeResolveGlob
21
23
  } from "@struktoai/mirage-core";
24
+ var resolveDiscordGlob = makeResolveGlob(discordReaddir);
22
25
  var NodeDiscordTransport = class extends HttpDiscordTransport {
23
26
  constructor(token) {
24
27
  super();
@@ -34,7 +37,7 @@ var NodeDiscordTransport = class extends HttpDiscordTransport {
34
37
  };
35
38
  var DiscordResource = class extends BaseResource {
36
39
  kind = ResourceName.DISCORD;
37
- isRemote = true;
40
+ cachesReads = true;
38
41
  indexTtl = 600;
39
42
  prompt = DISCORD_PROMPT;
40
43
  writePrompt = DISCORD_WRITE_PROMPT;
@@ -55,7 +58,7 @@ var DiscordResource = class extends BaseResource {
55
58
  return DISCORD_COMMANDS;
56
59
  }
57
60
  ops() {
58
- return DISCORD_VFS_OPS;
61
+ return DISCORD_OPS;
59
62
  }
60
63
  readFile(p) {
61
64
  return discordRead(this.accessor, p, this.index);
@@ -66,18 +69,14 @@ var DiscordResource = class extends BaseResource {
66
69
  stat(p) {
67
70
  return discordStat(this.accessor, p, this.index);
68
71
  }
69
- async fingerprint(p) {
70
- const lookup = await this.index.get(p.original);
71
- return lookup.entry?.remoteTime ?? null;
72
- }
73
72
  glob(paths, prefix = "") {
74
73
  const effective = prefix !== "" ? paths.map(
75
- (p) => p.prefix !== "" ? p : new PathSpec({
76
- original: p.original,
74
+ (p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
75
+ virtual: p.virtual,
77
76
  directory: p.directory,
78
77
  ...p.pattern !== null ? { pattern: p.pattern } : {},
79
78
  resolved: p.resolved,
80
- prefix
79
+ resourcePath: mountKey(p.virtual, prefix)
81
80
  })
82
81
  ) : paths;
83
82
  return resolveDiscordGlob(this.accessor, effective, this.index);
@@ -96,4 +95,4 @@ var DiscordResource = class extends BaseResource {
96
95
  export {
97
96
  DiscordResource
98
97
  };
99
- //# sourceMappingURL=chunk-LYDMMNL2.js.map
98
+ //# sourceMappingURL=chunk-RHUEV4I7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/discord/discord.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n DISCORD_API,\n DISCORD_COMMANDS,\n DISCORD_PROMPT,\n DISCORD_OPS,\n DISCORD_WRITE_PROMPT,\n DiscordAccessor,\n HttpDiscordTransport,\n PathSpec,\n ResourceName,\n discordRead,\n discordReaddir,\n discordStat,\n mountKey,\n mountPrefixOf,\n makeResolveGlob,\n type FileStat,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n} from '@struktoai/mirage-core'\nimport { redactDiscordConfig, type DiscordConfig, type DiscordConfigRedacted } from './config.ts'\n\nconst resolveDiscordGlob = makeResolveGlob(discordReaddir)\n\nclass NodeDiscordTransport extends HttpDiscordTransport {\n constructor(private readonly token: string) {\n super()\n }\n protected baseUrl(): string {\n return DISCORD_API\n }\n protected authHeaders(): Record<string, string> {\n return { Authorization: `Bot ${this.token}` }\n }\n}\n\nexport interface DiscordResourceState {\n type: string\n config: DiscordConfigRedacted\n}\n\nexport class DiscordResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.DISCORD\n readonly cachesReads: boolean = true\n override readonly indexTtl: number = 600\n readonly prompt: string = DISCORD_PROMPT\n readonly writePrompt: string = DISCORD_WRITE_PROMPT\n readonly config: DiscordConfig\n readonly accessor: DiscordAccessor\n\n constructor(config: DiscordConfig) {\n super()\n this.config = config\n this.accessor = new DiscordAccessor(new NodeDiscordTransport(config.token))\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return DISCORD_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return DISCORD_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return discordRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return discordReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return discordStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return resolveDiscordGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<DiscordResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactDiscordConfig(this.config),\n })\n }\n\n loadState(_state: DiscordResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAGP,IAAM,qBAAqB,gBAAgB,cAAc;AAEzD,IAAM,uBAAN,cAAmC,qBAAqB;AAAA,EACtD,YAA6B,OAAe;AAC1C,UAAM;AADqB;AAAA,EAE7B;AAAA,EAF6B;AAAA,EAGnB,UAAkB;AAC1B,WAAO;AAAA,EACT;AAAA,EACU,cAAsC;AAC9C,WAAO,EAAE,eAAe,OAAO,KAAK,KAAK,GAAG;AAAA,EAC9C;AACF;AAOO,IAAM,kBAAN,cAA8B,aAAiC;AAAA,EAC3D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACd,WAAmB;AAAA,EAC5B,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAuB;AACjC,UAAM;AACN,SAAK,SAAS;AACd,SAAK,WAAW,IAAI,gBAAgB,IAAI,qBAAqB,OAAO,KAAK,CAAC;AAAA,EAC5E;AAAA,EAEA,OAAsB;AACpB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,QAAuB;AACrB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,WAAyC;AACvC,WAAO;AAAA,EACT;AAAA,EAEA,MAA+B;AAC7B,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,YAAY,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACjD;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,eAAe,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACpD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,YAAY,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EACjD;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,cAAc,EAAE,SAAS,EAAE,YAAY,MAAM,KACzC,IACA,IAAI,SAAS;AAAA,QACX,SAAS,EAAE;AAAA,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACN,WAAO,mBAAmB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAChE;AAAA,EAEA,WAA0C;AACxC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,oBAAoB,KAAK,MAAM;AAAA,IACzC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA6C;AACrD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -6,6 +6,8 @@ var WasabiConfigSchema = z.object({
6
6
  secretAccessKey: secretStr(),
7
7
  region: z.string(),
8
8
  endpoint: z.string(),
9
+ forcePathStyle: z.boolean().optional(),
10
+ keyPrefix: z.string().optional(),
9
11
  timeoutMs: z.number().optional()
10
12
  });
11
13
  function resolvedWasabiEndpoint(config) {
@@ -20,6 +22,8 @@ function wasabiToS3Config(config) {
20
22
  endpoint: resolvedWasabiEndpoint(config),
21
23
  accessKeyId: config.accessKeyId,
22
24
  secretAccessKey: config.secretAccessKey,
25
+ ...config.forcePathStyle !== void 0 ? { forcePathStyle: config.forcePathStyle } : {},
26
+ ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {},
23
27
  ...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
24
28
  };
25
29
  }
@@ -36,6 +40,8 @@ function normalizeWasabiConfig(input) {
36
40
  access_key_id: "accessKeyId",
37
41
  secret_access_key: "secretAccessKey",
38
42
  endpoint_url: "endpoint",
43
+ path_style: "forcePathStyle",
44
+ key_prefix: "keyPrefix",
39
45
  timeout: "timeoutMs"
40
46
  },
41
47
  transform: {
@@ -46,10 +52,9 @@ function normalizeWasabiConfig(input) {
46
52
  }
47
53
 
48
54
  export {
49
- WasabiConfigSchema,
50
55
  resolvedWasabiEndpoint,
51
56
  wasabiToS3Config,
52
57
  redactWasabiConfig,
53
58
  normalizeWasabiConfig
54
59
  };
55
- //# sourceMappingURL=chunk-JALIYI6M.js.map
60
+ //# sourceMappingURL=chunk-S4KVLPBR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/wasabi/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\nimport type { S3Config } from '../s3/config.ts'\n\nexport interface WasabiConfig {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n region?: string\n endpoint?: string\n forcePathStyle?: boolean\n keyPrefix?: string\n timeoutMs?: number\n}\n\nexport interface WasabiConfigRedacted {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n region: string\n endpoint: string\n forcePathStyle?: boolean\n keyPrefix?: string\n timeoutMs?: number\n}\n\nconst WasabiConfigSchema = z.object({\n bucket: z.string(),\n accessKeyId: secretStr(),\n secretAccessKey: secretStr(),\n region: z.string(),\n endpoint: z.string(),\n forcePathStyle: z.boolean().optional(),\n keyPrefix: z.string().optional(),\n timeoutMs: z.number().optional(),\n})\n\nexport function resolvedWasabiEndpoint(config: WasabiConfig): string {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n const region = config.region ?? 'us-east-1'\n return region === 'us-east-1' ? 'https://s3.wasabisys.com' : `https://s3.${region}.wasabisys.com`\n}\n\nexport function wasabiToS3Config(config: WasabiConfig): S3Config {\n return {\n bucket: config.bucket,\n region: config.region ?? 'us-east-1',\n endpoint: resolvedWasabiEndpoint(config),\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n ...(config.forcePathStyle !== undefined ? { forcePathStyle: config.forcePathStyle } : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function redactWasabiConfig(config: WasabiConfig): WasabiConfigRedacted {\n return redactConfigWithSchema(WasabiConfigSchema, {\n ...config,\n region: config.region ?? 'us-east-1',\n endpoint: resolvedWasabiEndpoint(config),\n }) as unknown as WasabiConfigRedacted\n}\n\nexport function normalizeWasabiConfig(input: Record<string, unknown>): WasabiConfig {\n return normalizeFields(input, {\n rename: {\n access_key_id: 'accessKeyId',\n secret_access_key: 'secretAccessKey',\n endpoint_url: 'endpoint',\n path_style: 'forcePathStyle',\n key_prefix: 'keyPrefix',\n timeout: 'timeoutMs',\n },\n transform: {\n timeout: (v: unknown) => (typeof v === 'number' ? v * 1000 : v),\n },\n drop: ['proxy'],\n }) as unknown as WasabiConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAyBtE,IAAM,qBAAqB,EAAE,OAAO;AAAA,EAClC,QAAQ,EAAE,OAAO;AAAA,EACjB,aAAa,UAAU;AAAA,EACvB,iBAAiB,UAAU;AAAA,EAC3B,QAAQ,EAAE,OAAO;AAAA,EACjB,UAAU,EAAE,OAAO;AAAA,EACnB,gBAAgB,EAAE,QAAQ,EAAE,SAAS;AAAA,EACrC,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,uBAAuB,QAA8B;AACnE,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,QAAM,SAAS,OAAO,UAAU;AAChC,SAAO,WAAW,cAAc,6BAA6B,cAAc,MAAM;AACnF;AAEO,SAAS,iBAAiB,QAAgC;AAC/D,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO,UAAU;AAAA,IACzB,UAAU,uBAAuB,MAAM;AAAA,IACvC,aAAa,OAAO;AAAA,IACpB,iBAAiB,OAAO;AAAA,IACxB,GAAI,OAAO,mBAAmB,SAAY,EAAE,gBAAgB,OAAO,eAAe,IAAI,CAAC;AAAA,IACvF,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,IACxE,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB;AAAA,IAChD,GAAG;AAAA,IACH,QAAQ,OAAO,UAAU;AAAA,IACzB,UAAU,uBAAuB,MAAM;AAAA,EACzC,CAAC;AACH;AAEO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,SAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,SAAS,CAAC,MAAgB,OAAO,MAAM,WAAW,IAAI,MAAO;AAAA,IAC/D;AAAA,IACA,MAAM,CAAC,OAAO;AAAA,EAChB,CAAC;AACH;","names":[]}
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  redactGSheetsConfig
3
- } from "./chunk-LW25LMIH.js";
3
+ } from "./chunk-D3U7VQCG.js";
4
4
 
5
5
  // src/resource/gsheets/gsheets.ts
6
6
  import {
7
7
  BaseResource,
8
8
  GSHEETS_COMMANDS,
9
9
  GSHEETS_PROMPT,
10
- GSHEETS_VFS_OPS,
10
+ GSHEETS_OPS,
11
11
  GSHEETS_WRITE_PROMPT,
12
12
  GSheetsAccessor,
13
13
  PathSpec,
@@ -15,12 +15,15 @@ import {
15
15
  TokenManager,
16
16
  gsheetsRead,
17
17
  gsheetsReaddir,
18
- gsheetsResolveGlob,
19
- gsheetsStat
18
+ makeResolveGlob,
19
+ gsheetsStat,
20
+ mountKey,
21
+ mountPrefixOf
20
22
  } from "@struktoai/mirage-core";
23
+ var gsheetsResolveGlob = makeResolveGlob(gsheetsReaddir);
21
24
  var GSheetsResource = class extends BaseResource {
22
25
  kind = ResourceName.GSHEETS;
23
- isRemote = true;
26
+ cachesReads = true;
24
27
  indexTtl = 86400;
25
28
  prompt = GSHEETS_PROMPT;
26
29
  writePrompt = GSHEETS_WRITE_PROMPT;
@@ -32,7 +35,8 @@ var GSheetsResource = class extends BaseResource {
32
35
  const tm = new TokenManager({
33
36
  clientId: config.clientId,
34
37
  clientSecret: config.clientSecret,
35
- refreshToken: config.refreshToken
38
+ refreshToken: config.refreshToken,
39
+ ...config.refreshFn !== void 0 ? { refreshFn: config.refreshFn } : {}
36
40
  });
37
41
  this.accessor = new GSheetsAccessor({ tokenManager: tm });
38
42
  }
@@ -46,7 +50,7 @@ var GSheetsResource = class extends BaseResource {
46
50
  return GSHEETS_COMMANDS;
47
51
  }
48
52
  ops() {
49
- return GSHEETS_VFS_OPS;
53
+ return GSHEETS_OPS;
50
54
  }
51
55
  readFile(p) {
52
56
  return gsheetsRead(this.accessor, p, this.index);
@@ -57,18 +61,14 @@ var GSheetsResource = class extends BaseResource {
57
61
  stat(p) {
58
62
  return gsheetsStat(this.accessor, p, this.index);
59
63
  }
60
- async fingerprint(p) {
61
- const lookup = await this.index.get(p.original);
62
- return lookup.entry?.remoteTime ?? null;
63
- }
64
64
  glob(paths, prefix = "") {
65
65
  const effective = prefix !== "" ? paths.map(
66
- (p) => p.prefix !== "" ? p : new PathSpec({
67
- original: p.original,
66
+ (p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
67
+ virtual: p.virtual,
68
68
  directory: p.directory,
69
69
  ...p.pattern !== null ? { pattern: p.pattern } : {},
70
70
  resolved: p.resolved,
71
- prefix
71
+ resourcePath: mountKey(p.virtual, prefix)
72
72
  })
73
73
  ) : paths;
74
74
  return gsheetsResolveGlob(this.accessor, effective, this.index);
@@ -87,4 +87,4 @@ var GSheetsResource = class extends BaseResource {
87
87
  export {
88
88
  GSheetsResource
89
89
  };
90
- //# sourceMappingURL=chunk-XRU5WXZX.js.map
90
+ //# sourceMappingURL=chunk-SAOQW6ZJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/gsheets/gsheets.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n GSHEETS_COMMANDS,\n GSHEETS_PROMPT,\n GSHEETS_OPS,\n GSHEETS_WRITE_PROMPT,\n GSheetsAccessor,\n PathSpec,\n ResourceName,\n TokenManager,\n gsheetsRead,\n gsheetsReaddir,\n makeResolveGlob,\n gsheetsStat,\n mountKey,\n mountPrefixOf,\n type FileStat,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n} from '@struktoai/mirage-core'\nimport { redactGSheetsConfig, type GSheetsConfig, type GSheetsConfigRedacted } from './config.ts'\n\nconst gsheetsResolveGlob = makeResolveGlob(gsheetsReaddir)\n\nexport interface GSheetsResourceState {\n type: string\n config: GSheetsConfigRedacted\n}\n\nexport class GSheetsResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GSHEETS\n readonly cachesReads: boolean = true\n override readonly indexTtl: number = 86_400\n readonly prompt: string = GSHEETS_PROMPT\n readonly writePrompt: string = GSHEETS_WRITE_PROMPT\n readonly config: GSheetsConfig\n readonly accessor: GSheetsAccessor\n\n constructor(config: GSheetsConfig) {\n super()\n this.config = config\n const tm = new TokenManager({\n clientId: config.clientId,\n clientSecret: config.clientSecret,\n refreshToken: config.refreshToken,\n ...(config.refreshFn !== undefined ? { refreshFn: config.refreshFn } : {}),\n })\n this.accessor = new GSheetsAccessor({ tokenManager: tm })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GSHEETS_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GSHEETS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gsheetsRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gsheetsReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gsheetsStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return gsheetsResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GSheetsResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGSheetsConfig(this.config),\n })\n }\n\n loadState(_state: GSheetsResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAGP,IAAM,qBAAqB,gBAAgB,cAAc;AAOlD,IAAM,kBAAN,cAA8B,aAAiC;AAAA,EAC3D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACd,WAAmB;AAAA,EAC5B,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAuB;AACjC,UAAM;AACN,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa;AAAA,MAC1B,UAAU,OAAO;AAAA,MACjB,cAAc,OAAO;AAAA,MACrB,cAAc,OAAO;AAAA,MACrB,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,IAC1E,CAAC;AACD,SAAK,WAAW,IAAI,gBAAgB,E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VIICUPWQ.js";
4
4
 
5
5
  // src/resource/notion/notion.ts
6
6
  import {
@@ -8,19 +8,22 @@ import {
8
8
  HttpNotionTransport,
9
9
  NOTION_COMMANDS,
10
10
  NOTION_PROMPT,
11
- NOTION_VFS_OPS,
11
+ NOTION_OPS,
12
12
  NOTION_WRITE_PROMPT,
13
13
  NotionAccessor,
14
+ PathSpec,
15
+ ResourceName,
16
+ mountKey,
17
+ mountPrefixOf,
14
18
  notionRead,
15
19
  notionReaddir,
16
20
  notionStat,
17
- PathSpec,
18
- ResourceName,
19
- resolveNotionGlob
21
+ makeResolveGlob
20
22
  } from "@struktoai/mirage-core";
23
+ var resolveNotionGlob = makeResolveGlob(notionReaddir);
21
24
  var NotionResource = class extends BaseResource {
22
25
  kind = ResourceName.NOTION;
23
- isRemote = true;
26
+ cachesReads = true;
24
27
  indexTtl = 600;
25
28
  prompt = NOTION_PROMPT;
26
29
  writePrompt = NOTION_WRITE_PROMPT;
@@ -43,7 +46,7 @@ var NotionResource = class extends BaseResource {
43
46
  return NOTION_COMMANDS;
44
47
  }
45
48
  ops() {
46
- return NOTION_VFS_OPS;
49
+ return NOTION_OPS;
47
50
  }
48
51
  readFile(p) {
49
52
  return notionRead(this.accessor, p, this.index);
@@ -54,18 +57,14 @@ var NotionResource = class extends BaseResource {
54
57
  stat(p) {
55
58
  return notionStat(this.accessor, p, this.index);
56
59
  }
57
- async fingerprint(p) {
58
- const lookup = await this.index.get(p.original);
59
- return lookup.entry?.remoteTime ?? null;
60
- }
61
60
  glob(paths, prefix = "") {
62
61
  const effective = prefix !== "" ? paths.map(
63
- (p) => p.prefix !== "" ? p : new PathSpec({
64
- original: p.original,
62
+ (p) => mountPrefixOf(p.virtual, p.resourcePath) !== "" ? p : new PathSpec({
63
+ virtual: p.virtual,
65
64
  directory: p.directory,
66
65
  ...p.pattern !== null ? { pattern: p.pattern } : {},
67
66
  resolved: p.resolved,
68
- prefix
67
+ resourcePath: mountKey(p.virtual, prefix)
69
68
  })
70
69
  ) : paths;
71
70
  return resolveNotionGlob(this.accessor, effective, this.index);
@@ -84,4 +83,4 @@ var NotionResource = class extends BaseResource {
84
83
  export {
85
84
  NotionResource
86
85
  };
87
- //# sourceMappingURL=chunk-CASCUFK2.js.map
86
+ //# sourceMappingURL=chunk-SI4GMRXD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/notion/notion.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n HttpNotionTransport,\n NOTION_COMMANDS,\n NOTION_PROMPT,\n NOTION_OPS,\n NOTION_WRITE_PROMPT,\n NotionAccessor,\n PathSpec,\n ResourceName,\n mountKey,\n mountPrefixOf,\n notionRead,\n notionReaddir,\n notionStat,\n makeResolveGlob,\n type FileStat,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n} from '@struktoai/mirage-core'\nimport { redactNotionConfig, type NotionConfig, type NotionConfigRedacted } from './config.ts'\n\nconst resolveNotionGlob = makeResolveGlob<NotionAccessor>(notionReaddir)\n\nexport interface NotionResourceState {\n type: string\n config: NotionConfigRedacted\n}\n\nexport class NotionResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.NOTION\n readonly cachesReads: boolean = true\n override readonly indexTtl: number = 600\n readonly prompt: string = NOTION_PROMPT\n readonly writePrompt: string = NOTION_WRITE_PROMPT\n readonly config: NotionConfig\n readonly accessor: NotionAccessor\n\n constructor(config: NotionConfig) {\n super()\n this.config = config\n const transportOpts: { apiKey: string; baseUrl?: string } = { apiKey: config.apiKey }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n this.accessor = new NotionAccessor(new HttpNotionTransport(transportOpts))\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return NOTION_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return NOTION_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return notionRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return notionReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return notionStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath) !== ''\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return resolveNotionGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<NotionResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactNotionConfig(this.config),\n })\n }\n\n loadState(_state: NotionResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAGP,IAAM,oBAAoB,gBAAgC,aAAa;AAOhE,IAAM,iBAAN,cAA6B,aAAiC;AAAA,EAC1D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACd,WAAmB;AAAA,EAC5B,SAAiB;AAAA,EAC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mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  backblazeToS3Config,
3
3
  redactBackblazeConfig
4
- } from "./chunk-XHCBHYN4.js";
4
+ } from "./chunk-UAJYJP5C.js";
5
5
  import {
6
6
  S3Resource
7
- } from "./chunk-MHCMHKM6.js";
7
+ } from "./chunk-IUXXZHY3.js";
8
8
 
9
9
  // src/resource/backblaze/backblaze.ts
10
10
  import {
@@ -54,4 +54,4 @@ export {
54
54
  BACKBLAZE_PROMPT,
55
55
  BackblazeResource
56
56
  };
57
- //# sourceMappingURL=chunk-HQ4KWN76.js.map
57
+ //# sourceMappingURL=chunk-SYMNWNC3.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ociToS3Config,
3
3
  redactOciConfig
4
- } from "./chunk-RQK5UPMP.js";
4
+ } from "./chunk-H62XQZUM.js";
5
5
  import {
6
6
  S3Resource
7
- } from "./chunk-MHCMHKM6.js";
7
+ } from "./chunk-IUXXZHY3.js";
8
8
 
9
9
  // src/resource/oci/oci.ts
10
10
  import {
@@ -53,4 +53,4 @@ export {
53
53
  OCI_PROMPT,
54
54
  OCIResource
55
55
  };
56
- //# sourceMappingURL=chunk-PJBQKMCD.js.map
56
+ //# sourceMappingURL=chunk-TUNR4VUM.js.map
@@ -6,6 +6,8 @@ var BackblazeConfigSchema = z.object({
6
6
  secretAccessKey: secretStr(),
7
7
  region: z.string(),
8
8
  endpoint: z.string(),
9
+ forcePathStyle: z.boolean().optional(),
10
+ keyPrefix: z.string().optional(),
9
11
  timeoutMs: z.number().optional()
10
12
  });
11
13
  function resolvedBackblazeEndpoint(config) {
@@ -20,6 +22,8 @@ function backblazeToS3Config(config) {
20
22
  endpoint: resolvedBackblazeEndpoint(config),
21
23
  accessKeyId: config.accessKeyId,
22
24
  secretAccessKey: config.secretAccessKey,
25
+ ...config.forcePathStyle !== void 0 ? { forcePathStyle: config.forcePathStyle } : {},
26
+ ...config.keyPrefix !== void 0 ? { keyPrefix: config.keyPrefix } : {},
23
27
  ...config.timeoutMs !== void 0 ? { timeoutMs: config.timeoutMs } : {}
24
28
  };
25
29
  }
@@ -35,6 +39,8 @@ function normalizeBackblazeConfig(input) {
35
39
  access_key_id: "accessKeyId",
36
40
  secret_access_key: "secretAccessKey",
37
41
  endpoint_url: "endpoint",
42
+ path_style: "forcePathStyle",
43
+ key_prefix: "keyPrefix",
38
44
  timeout: "timeoutMs"
39
45
  },
40
46
  transform: {
@@ -45,10 +51,9 @@ function normalizeBackblazeConfig(input) {
45
51
  }
46
52
 
47
53
  export {
48
- BackblazeConfigSchema,
49
54
  resolvedBackblazeEndpoint,
50
55
  backblazeToS3Config,
51
56
  redactBackblazeConfig,
52
57
  normalizeBackblazeConfig
53
58
  };
54
- //# sourceMappingURL=chunk-XHCBHYN4.js.map
59
+ //# sourceMappingURL=chunk-UAJYJP5C.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/backblaze/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\nimport type { S3Config } from '../s3/config.ts'\n\nexport interface BackblazeConfig {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n region: string\n endpoint?: string\n forcePathStyle?: boolean\n keyPrefix?: string\n timeoutMs?: number\n}\n\nexport interface BackblazeConfigRedacted {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n region: string\n endpoint: string\n forcePathStyle?: boolean\n keyPrefix?: string\n timeoutMs?: number\n}\n\nconst BackblazeConfigSchema = z.object({\n bucket: z.string(),\n accessKeyId: secretStr(),\n secretAccessKey: secretStr(),\n region: z.string(),\n endpoint: z.string(),\n forcePathStyle: z.boolean().optional(),\n keyPrefix: z.string().optional(),\n timeoutMs: z.number().optional(),\n})\n\nexport function resolvedBackblazeEndpoint(config: BackblazeConfig): string {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n const region = config.region\n return `https://s3.${region}.backblazeb2.com`\n}\n\nexport function backblazeToS3Config(config: BackblazeConfig): S3Config {\n return {\n bucket: config.bucket,\n region: config.region,\n endpoint: resolvedBackblazeEndpoint(config),\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n ...(config.forcePathStyle !== undefined ? { forcePathStyle: config.forcePathStyle } : {}),\n ...(config.keyPrefix !== undefined ? { keyPrefix: config.keyPrefix } : {}),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function redactBackblazeConfig(config: BackblazeConfig): BackblazeConfigRedacted {\n return redactConfigWithSchema(BackblazeConfigSchema, {\n ...config,\n endpoint: resolvedBackblazeEndpoint(config),\n }) as unknown as BackblazeConfigRedacted\n}\n\nexport function normalizeBackblazeConfig(input: Record<string, unknown>): BackblazeConfig {\n return normalizeFields(input, {\n rename: {\n access_key_id: 'accessKeyId',\n secret_access_key: 'secretAccessKey',\n endpoint_url: 'endpoint',\n path_style: 'forcePathStyle',\n key_prefix: 'keyPrefix',\n timeout: 'timeoutMs',\n },\n transform: {\n timeout: (v: unknown) => (typeof v === 'number' ? v * 1000 : v),\n },\n drop: ['proxy'],\n }) as unknown as BackblazeConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAyBtE,IAAM,wBAAw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