@struktoai/mirage-node 0.0.3 → 0.0.5-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (465) hide show
  1. package/README.md +2 -1
  2. package/dist/aliyun-S62BR3TB.js +11 -0
  3. package/dist/append.lua +17 -0
  4. package/dist/backblaze-4EKSW63F.js +11 -0
  5. package/dist/box-ZPLZAGMK.js +8 -0
  6. package/dist/cas.lua +15 -0
  7. package/dist/ceph-ALKLD3MO.js +11 -0
  8. package/dist/{chunk-QCZ2XUKH.js → chunk-2A4YGVBM.js} +16 -23
  9. package/dist/chunk-2A4YGVBM.js.map +1 -0
  10. package/dist/chunk-2HCYLVGY.js +28 -0
  11. package/dist/chunk-2HCYLVGY.js.map +1 -0
  12. package/dist/chunk-2VPZAH5Q.js +20 -0
  13. package/dist/chunk-2VPZAH5Q.js.map +1 -0
  14. package/dist/{chunk-UT2OPSN4.js → chunk-3JZQ6VSZ.js} +5 -5
  15. package/dist/chunk-3JZQ6VSZ.js.map +1 -0
  16. package/dist/chunk-4IF4TGAI.js +11 -0
  17. package/dist/chunk-4IF4TGAI.js.map +1 -0
  18. package/dist/{chunk-47AVIIOT.js → chunk-5H6KNEPP.js} +4 -5
  19. package/dist/{chunk-47AVIIOT.js.map → chunk-5H6KNEPP.js.map} +1 -1
  20. package/dist/{chunk-I5THIMPP.js → chunk-5K2MWDCE.js} +6 -7
  21. package/dist/{chunk-I5THIMPP.js.map → chunk-5K2MWDCE.js.map} +1 -1
  22. package/dist/{chunk-3WIO7NBR.js → chunk-6SVXWRKX.js} +4 -5
  23. package/dist/{chunk-3WIO7NBR.js.map → chunk-6SVXWRKX.js.map} +1 -1
  24. package/dist/{chunk-RQK5UPMP.js → chunk-6VOIUGAD.js} +25 -12
  25. package/dist/chunk-6VOIUGAD.js.map +1 -0
  26. package/dist/{chunk-NOHWIBRX.js → chunk-7JYHFXXC.js} +15 -20
  27. package/dist/chunk-7JYHFXXC.js.map +1 -0
  28. package/dist/chunk-7VQQFWV6.js +20 -0
  29. package/dist/chunk-7VQQFWV6.js.map +1 -0
  30. package/dist/chunk-7ZP6TPHX.js +87 -0
  31. package/dist/chunk-7ZP6TPHX.js.map +1 -0
  32. package/dist/{chunk-SWCDFEUK.js → chunk-ADEXNSYU.js} +20 -22
  33. package/dist/chunk-ADEXNSYU.js.map +1 -0
  34. package/dist/chunk-AQSYAXL4.js +16 -0
  35. package/dist/chunk-AQSYAXL4.js.map +1 -0
  36. package/dist/{chunk-RO5IQEDQ.js → chunk-ATLXMNKD.js} +8 -4
  37. package/dist/chunk-ATLXMNKD.js.map +1 -0
  38. package/dist/{chunk-MPCCRRE6.js → chunk-BYCUGFRF.js} +16 -16
  39. package/dist/chunk-BYCUGFRF.js.map +1 -0
  40. package/dist/{chunk-HJJMP6IX.js → chunk-BZTVYOES.js} +3 -3
  41. package/dist/{chunk-B2ZOKNN4.js → chunk-CRC4YWXB.js} +27 -9
  42. package/dist/chunk-CRC4YWXB.js.map +1 -0
  43. package/dist/chunk-CTGXJHO5.js +39 -0
  44. package/dist/chunk-CTGXJHO5.js.map +1 -0
  45. package/dist/{chunk-Q2IAILVC.js → chunk-DCDBIXVZ.js} +14 -5
  46. package/dist/chunk-DCDBIXVZ.js.map +1 -0
  47. package/dist/chunk-DDAFNROK.js +750 -0
  48. package/dist/chunk-DDAFNROK.js.map +1 -0
  49. package/dist/chunk-DQIEWEAW.js +85 -0
  50. package/dist/chunk-DQIEWEAW.js.map +1 -0
  51. package/dist/{chunk-QGRDPSAH.js → chunk-EBI4IHDC.js} +23 -12
  52. package/dist/chunk-EBI4IHDC.js.map +1 -0
  53. package/dist/{chunk-JAGJTM3Q.js → chunk-EIUTZ6N7.js} +19 -34
  54. package/dist/chunk-EIUTZ6N7.js.map +1 -0
  55. package/dist/{chunk-TA3WMOMU.js → chunk-EJZG5VUF.js} +38 -32
  56. package/dist/chunk-EJZG5VUF.js.map +1 -0
  57. package/dist/{chunk-X5HF2OFP.js → chunk-ENW5BVYN.js} +3 -3
  58. package/dist/{chunk-HGCRXJGP.js → chunk-ETIAW4YD.js} +3 -3
  59. package/dist/chunk-EUPXAYPB.js +20 -0
  60. package/dist/chunk-EUPXAYPB.js.map +1 -0
  61. package/dist/{chunk-YAHRT6MB.js → chunk-FA6YNU75.js} +4 -5
  62. package/dist/{chunk-YAHRT6MB.js.map → chunk-FA6YNU75.js.map} +1 -1
  63. package/dist/{chunk-TWGVQLG2.js → chunk-FFH6R5VQ.js} +7 -3
  64. package/dist/chunk-FFH6R5VQ.js.map +1 -0
  65. package/dist/{chunk-JCC4CU2I.js → chunk-GE6H2COM.js} +15 -23
  66. package/dist/chunk-GE6H2COM.js.map +1 -0
  67. package/dist/{chunk-DM4GSE26.js → chunk-GMMQ3ZK4.js} +3 -3
  68. package/dist/{chunk-ZEGAMJO2.js → chunk-GSGE3M5P.js} +15 -23
  69. package/dist/chunk-GSGE3M5P.js.map +1 -0
  70. package/dist/{chunk-GCFYZSVR.js → chunk-H64SB6VO.js} +32 -13
  71. package/dist/chunk-H64SB6VO.js.map +1 -0
  72. package/dist/{chunk-N5FSLVKO.js → chunk-HCRYAFBI.js} +3 -3
  73. package/dist/{chunk-IDYHQQOH.js → chunk-HOPUP6LA.js} +358 -471
  74. package/dist/chunk-HOPUP6LA.js.map +1 -0
  75. package/dist/chunk-HS24BL6W.js +160 -0
  76. package/dist/chunk-HS24BL6W.js.map +1 -0
  77. package/dist/chunk-HVYVG5KQ.js +16 -0
  78. package/dist/chunk-HVYVG5KQ.js.map +1 -0
  79. package/dist/{chunk-FQ33BYFR.js → chunk-I7CPLZNW.js} +4 -5
  80. package/dist/{chunk-FQ33BYFR.js.map → chunk-I7CPLZNW.js.map} +1 -1
  81. package/dist/{chunk-VGLHY6BK.js → chunk-IFUCGI4I.js} +7 -3
  82. package/dist/chunk-IFUCGI4I.js.map +1 -0
  83. package/dist/{chunk-RNQN2FOU.js → chunk-IFYXSSKR.js} +24 -13
  84. package/dist/chunk-IFYXSSKR.js.map +1 -0
  85. package/dist/chunk-IXA4DQE4.js +20 -0
  86. package/dist/chunk-IXA4DQE4.js.map +1 -0
  87. package/dist/chunk-IZMKMD3O.js +11 -0
  88. package/dist/chunk-IZMKMD3O.js.map +1 -0
  89. package/dist/{chunk-7CW3BMPH.js → chunk-JJERW2BI.js} +4 -5
  90. package/dist/{chunk-7CW3BMPH.js.map → chunk-JJERW2BI.js.map} +1 -1
  91. package/dist/{chunk-EM4J5EQS.js → chunk-JQR4HVUX.js} +13 -16
  92. package/dist/chunk-JQR4HVUX.js.map +1 -0
  93. package/dist/{chunk-VWKUT4CW.js → chunk-JXOMDLFS.js} +21 -26
  94. package/dist/chunk-JXOMDLFS.js.map +1 -0
  95. package/dist/chunk-KIX6N7NT.js +1001 -0
  96. package/dist/chunk-KIX6N7NT.js.map +1 -0
  97. package/dist/{chunk-OZAEWZZ3.js → chunk-L42UTDFK.js} +12 -3
  98. package/dist/chunk-L42UTDFK.js.map +1 -0
  99. package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
  100. package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
  101. package/dist/chunk-M2UF2JHJ.js +11 -0
  102. package/dist/chunk-M2UF2JHJ.js.map +1 -0
  103. package/dist/{chunk-UGK4TAVK.js → chunk-MONC734W.js} +7 -3
  104. package/dist/chunk-MONC734W.js.map +1 -0
  105. package/dist/{chunk-IK2L4EN3.js → chunk-N72RLCMU.js} +4 -5
  106. package/dist/{chunk-IK2L4EN3.js.map → chunk-N72RLCMU.js.map} +1 -1
  107. package/dist/{chunk-H3I2KZIY.js → chunk-ND4IWJ4V.js} +7 -3
  108. package/dist/chunk-ND4IWJ4V.js.map +1 -0
  109. package/dist/chunk-NZ3EKGW4.js +1312 -0
  110. package/dist/chunk-NZ3EKGW4.js.map +1 -0
  111. package/dist/{chunk-XGJ2QERC.js → chunk-OAE57MNL.js} +27 -11
  112. package/dist/chunk-OAE57MNL.js.map +1 -0
  113. package/dist/{chunk-EZQ5HBAC.js → chunk-OHKGIQB4.js} +12 -16
  114. package/dist/chunk-OHKGIQB4.js.map +1 -0
  115. package/dist/{chunk-E2ISWXLB.js → chunk-OQKNDS66.js} +1 -1
  116. package/dist/{chunk-E2ISWXLB.js.map → chunk-OQKNDS66.js.map} +1 -1
  117. package/dist/{chunk-UINQOUZR.js → chunk-OXEQSPND.js} +3 -3
  118. package/dist/{chunk-A7IVFIOP.js → chunk-PKNE5J2B.js} +15 -23
  119. package/dist/chunk-PKNE5J2B.js.map +1 -0
  120. package/dist/chunk-PSXXEGYQ.js +16 -0
  121. package/dist/chunk-PSXXEGYQ.js.map +1 -0
  122. package/dist/{chunk-EGB7V74Z.js → chunk-QAOVABCR.js} +7 -4
  123. package/dist/chunk-QAOVABCR.js.map +1 -0
  124. package/dist/{chunk-X3G37FXT.js → chunk-QQ7FP4GD.js} +4 -5
  125. package/dist/{chunk-X3G37FXT.js.map → chunk-QQ7FP4GD.js.map} +1 -1
  126. package/dist/{chunk-WAR4Q2NM.js → chunk-QYLVMC6B.js} +13 -15
  127. package/dist/chunk-QYLVMC6B.js.map +1 -0
  128. package/dist/{chunk-KPULTUOK.js → chunk-RX3XR65X.js} +4 -5
  129. package/dist/{chunk-KPULTUOK.js.map → chunk-RX3XR65X.js.map} +1 -1
  130. package/dist/chunk-RYQJJB4C.js +30 -0
  131. package/dist/chunk-RYQJJB4C.js.map +1 -0
  132. package/dist/{chunk-QQBJC2FQ.js → chunk-TUF7TCN7.js} +4 -5
  133. package/dist/{chunk-QQBJC2FQ.js.map → chunk-TUF7TCN7.js.map} +1 -1
  134. package/dist/{chunk-AUHSTJJ3.js → chunk-TUX36JY5.js} +4 -5
  135. package/dist/{chunk-AUHSTJJ3.js.map → chunk-TUX36JY5.js.map} +1 -1
  136. package/dist/chunk-TWRQCQWU.js +1153 -0
  137. package/dist/chunk-TWRQCQWU.js.map +1 -0
  138. package/dist/chunk-U6DFQRG3.js +20 -0
  139. package/dist/chunk-U6DFQRG3.js.map +1 -0
  140. package/dist/chunk-VI5YTKNY.js +20 -0
  141. package/dist/chunk-VI5YTKNY.js.map +1 -0
  142. package/dist/chunk-WG5YS6TC.js +872 -0
  143. package/dist/chunk-WG5YS6TC.js.map +1 -0
  144. package/dist/{chunk-ZGSER5TG.js → chunk-WMJJ4WGF.js} +4 -5
  145. package/dist/{chunk-ZGSER5TG.js.map → chunk-WMJJ4WGF.js.map} +1 -1
  146. package/dist/{chunk-LV2G7VHL.js → chunk-WY4FNH42.js} +21 -18
  147. package/dist/chunk-WY4FNH42.js.map +1 -0
  148. package/dist/{chunk-LAJJPLEV.js → chunk-XIG5BWWH.js} +25 -12
  149. package/dist/chunk-XIG5BWWH.js.map +1 -0
  150. package/dist/chunk-XJBC3OYX.js +11 -0
  151. package/dist/chunk-XJBC3OYX.js.map +1 -0
  152. package/dist/{chunk-G2WCEUQL.js → chunk-XPRDXWK7.js} +21 -20
  153. package/dist/chunk-XPRDXWK7.js.map +1 -0
  154. package/dist/chunk-YKRQSZS7.js +96 -0
  155. package/dist/chunk-YKRQSZS7.js.map +1 -0
  156. package/dist/{chunk-M5FVUIYP.js → chunk-YMBL3VJB.js} +21 -19
  157. package/dist/chunk-YMBL3VJB.js.map +1 -0
  158. package/dist/chunk-YUJBXFYK.js +1205 -0
  159. package/dist/chunk-YUJBXFYK.js.map +1 -0
  160. package/dist/{chunk-JALIYI6M.js → chunk-YZ4ZJNOL.js} +28 -11
  161. package/dist/chunk-YZ4ZJNOL.js.map +1 -0
  162. package/dist/chunk-ZTHVEXIV.js +11 -0
  163. package/dist/chunk-ZTHVEXIV.js.map +1 -0
  164. package/dist/{chunk-GS5AUKUO.js → chunk-ZVSYUCYS.js} +11 -7
  165. package/dist/chunk-ZVSYUCYS.js.map +1 -0
  166. package/dist/{config-QAA646XB.js → config-2YBCHU2W.js} +2 -4
  167. package/dist/{config-IVY5EQQ2.js → config-3YRGRW72.js} +3 -4
  168. package/dist/config-4GSOMUMF.js +9 -0
  169. package/dist/config-5YBUWFUP.js +9 -0
  170. package/dist/{config-34LHOGLM.js → config-5ZRKJTKG.js} +3 -4
  171. package/dist/config-A25LTL5W.js +11 -0
  172. package/dist/config-CLU7JABG.js +9 -0
  173. package/dist/config-D2RF7L3N.js +9 -0
  174. package/dist/{config-LHFFXVYI.js → config-E55TKM6K.js} +2 -4
  175. package/dist/config-ELDOFRJW.js +9 -0
  176. package/dist/{config-GE4W4ZJC.js → config-FPC3RBFD.js} +2 -4
  177. package/dist/config-FPM3LAW7.js +9 -0
  178. package/dist/{config-HKRMKD76.js → config-G3F54CS4.js} +3 -4
  179. package/dist/config-G43HRUI3.js +9 -0
  180. package/dist/{config-WDAZFXYD.js → config-GG3WO5PB.js} +3 -4
  181. package/dist/config-JUYBWAZE.js +9 -0
  182. package/dist/{config-CVZ2AGCO.js → config-LJ5T6TVA.js} +2 -6
  183. package/dist/config-MDSAE4O3.js +11 -0
  184. package/dist/{config-EIHSP5DZ.js → config-NRIOKK5T.js} +2 -4
  185. package/dist/config-OYK2BSJK.js +9 -0
  186. package/dist/config-PB3KA2CE.js +9 -0
  187. package/dist/{config-ZFJYQZCH.js → config-QY4IL3PH.js} +3 -4
  188. package/dist/config-R4LAOEDS.js +9 -0
  189. package/dist/{config-QNMKWJ4M.js → config-RIAAD6RW.js} +3 -4
  190. package/dist/config-SYNEQAUB.js +9 -0
  191. package/dist/{config-Q45Y46YT.js → config-TJKGYA2B.js} +3 -4
  192. package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
  193. package/dist/{config-3IVQJBNW.js → config-UURRGA7U.js} +2 -2
  194. package/dist/{config-VM526IKB.js → config-VPLHQXVE.js} +2 -4
  195. package/dist/config-WRACCRPN.js +9 -0
  196. package/dist/{config-GHRUKEQ6.js → config-WVHKXEVE.js} +3 -4
  197. package/dist/{config-EO23EY62.js → config-XU7R36IE.js} +3 -4
  198. package/dist/config-Y2KOUYSS.js +9 -0
  199. package/dist/databricks_volume-CNCPTZHS.js +7 -0
  200. package/dist/digitalocean-DJZOUB6Q.js +11 -0
  201. package/dist/discord-ETB2CADR.js +7 -0
  202. package/dist/disk-WEHSTK3F.js +7 -0
  203. package/dist/dropbox-XN6PGLNE.js +8 -0
  204. package/dist/email-OV7XCP3T.js +8 -0
  205. package/dist/gcal-P56MRCGU.js +8 -0
  206. package/dist/gcs-HFBIAE2C.js +10 -0
  207. package/dist/gdocs-LQ3UXP3J.js +8 -0
  208. package/dist/gdrive-N6UBYLON.js +8 -0
  209. package/dist/github-BPZREGPI.js +8 -0
  210. package/dist/github_ci-7A4LUIZ7.js +8 -0
  211. package/dist/gmail-YED2MF6H.js +8 -0
  212. package/dist/gridfs-CPLQ4G62.js +9 -0
  213. package/dist/gsheets-4BNIJPQ6.js +8 -0
  214. package/dist/gslides-GDBYLO5A.js +8 -0
  215. package/dist/hf_buckets-FTJITQ3P.js +10 -0
  216. package/dist/hf_datasets-6GXVKQD7.js +10 -0
  217. package/dist/hf_models-PJPGZAC5.js +10 -0
  218. package/dist/hf_spaces-LFNFOLBF.js +10 -0
  219. package/dist/index.d.ts +1311 -569
  220. package/dist/index.js +3359 -964
  221. package/dist/index.js.map +1 -1
  222. package/dist/jaeger-GCA6MJ6E.js +8 -0
  223. package/dist/lancedb-TJ5YSJY5.js +7 -0
  224. package/dist/langfuse-RUMTUMXS.js +8 -0
  225. package/dist/linear-BCE4KEAC.js +7 -0
  226. package/dist/minio-5SO6KBTK.js +11 -0
  227. package/dist/mongodb-L5CMN2EE.js +7 -0
  228. package/dist/nextcloud-4O2LZVW2.js +9 -0
  229. package/dist/notion-RVKEAQ2M.js +7 -0
  230. package/dist/oci-OQXOIC62.js +10 -0
  231. package/dist/postgres-AV45GNRS.js +7 -0
  232. package/dist/qingstor-W277YA4K.js +11 -0
  233. package/dist/r2-FUA4IORE.js +10 -0
  234. package/dist/redis-LPS357NF.js +8 -0
  235. package/dist/s3-FPNWWIVM.js +8 -0
  236. package/dist/scaleway-BP3732U7.js +11 -0
  237. package/dist/seaweedfs-MC6HIEP4.js +11 -0
  238. package/dist/slack-JFGW7VLN.js +7 -0
  239. package/dist/ssh-UYPG42LM.js +8 -0
  240. package/dist/ssh-UYPG42LM.js.map +1 -0
  241. package/dist/supabase-A3KUFMDC.js +10 -0
  242. package/dist/supabase-A3KUFMDC.js.map +1 -0
  243. package/dist/tencent-5464UQ2X.js +11 -0
  244. package/dist/tencent-5464UQ2X.js.map +1 -0
  245. package/dist/trello-O2KB3FUO.js +8 -0
  246. package/dist/trello-O2KB3FUO.js.map +1 -0
  247. package/dist/wasabi-2IKBIWNO.js +10 -0
  248. package/dist/wasabi-2IKBIWNO.js.map +1 -0
  249. package/package.json +17 -3
  250. package/dist/aliyun-JMJ3PFYY.js +0 -10
  251. package/dist/backblaze-TDFD23QO.js +0 -10
  252. package/dist/box-GQ2U2R6R.js +0 -8
  253. package/dist/ceph-S2VOYO6G.js +0 -10
  254. package/dist/chunk-2CC5VW7K.js +0 -52
  255. package/dist/chunk-2CC5VW7K.js.map +0 -1
  256. package/dist/chunk-A7IVFIOP.js.map +0 -1
  257. package/dist/chunk-B2ZOKNN4.js.map +0 -1
  258. package/dist/chunk-DNBAMB5J.js +0 -18
  259. package/dist/chunk-DNBAMB5J.js.map +0 -1
  260. package/dist/chunk-DP2PP5V2.js +0 -26
  261. package/dist/chunk-DP2PP5V2.js.map +0 -1
  262. package/dist/chunk-DYXEITK3.js +0 -52
  263. package/dist/chunk-DYXEITK3.js.map +0 -1
  264. package/dist/chunk-EGB7V74Z.js.map +0 -1
  265. package/dist/chunk-EM4J5EQS.js.map +0 -1
  266. package/dist/chunk-EZQ5HBAC.js.map +0 -1
  267. package/dist/chunk-G2WCEUQL.js.map +0 -1
  268. package/dist/chunk-GCFYZSVR.js.map +0 -1
  269. package/dist/chunk-GS5AUKUO.js.map +0 -1
  270. package/dist/chunk-H3BST2LI.js +0 -26
  271. package/dist/chunk-H3BST2LI.js.map +0 -1
  272. package/dist/chunk-H3I2KZIY.js.map +0 -1
  273. package/dist/chunk-IDYHQQOH.js.map +0 -1
  274. package/dist/chunk-JAGJTM3Q.js.map +0 -1
  275. package/dist/chunk-JALIYI6M.js.map +0 -1
  276. package/dist/chunk-JCC4CU2I.js.map +0 -1
  277. package/dist/chunk-JZT4QGIP.js +0 -24
  278. package/dist/chunk-JZT4QGIP.js.map +0 -1
  279. package/dist/chunk-LAJJPLEV.js.map +0 -1
  280. package/dist/chunk-LV2G7VHL.js.map +0 -1
  281. package/dist/chunk-LW25LMIH.js +0 -26
  282. package/dist/chunk-LW25LMIH.js.map +0 -1
  283. package/dist/chunk-M5FVUIYP.js.map +0 -1
  284. package/dist/chunk-MPCCRRE6.js.map +0 -1
  285. package/dist/chunk-NJMGCT63.js +0 -54
  286. package/dist/chunk-NJMGCT63.js.map +0 -1
  287. package/dist/chunk-NOHWIBRX.js.map +0 -1
  288. package/dist/chunk-OHROA3FQ.js +0 -54
  289. package/dist/chunk-OHROA3FQ.js.map +0 -1
  290. package/dist/chunk-OPYQ5KIO.js +0 -52
  291. package/dist/chunk-OPYQ5KIO.js.map +0 -1
  292. package/dist/chunk-OZAEWZZ3.js.map +0 -1
  293. package/dist/chunk-Q2IAILVC.js.map +0 -1
  294. package/dist/chunk-QCZ2XUKH.js.map +0 -1
  295. package/dist/chunk-QGRDPSAH.js.map +0 -1
  296. package/dist/chunk-RNQN2FOU.js.map +0 -1
  297. package/dist/chunk-RO5IQEDQ.js.map +0 -1
  298. package/dist/chunk-RQK5UPMP.js.map +0 -1
  299. package/dist/chunk-S5OVP467.js +0 -1795
  300. package/dist/chunk-S5OVP467.js.map +0 -1
  301. package/dist/chunk-SFUCUARB.js +0 -21
  302. package/dist/chunk-SFUCUARB.js.map +0 -1
  303. package/dist/chunk-SWCDFEUK.js.map +0 -1
  304. package/dist/chunk-TA3WMOMU.js.map +0 -1
  305. package/dist/chunk-TURD42QO.js +0 -1782
  306. package/dist/chunk-TURD42QO.js.map +0 -1
  307. package/dist/chunk-TWGVQLG2.js.map +0 -1
  308. package/dist/chunk-U6QSXTUS.js +0 -7
  309. package/dist/chunk-U6QSXTUS.js.map +0 -1
  310. package/dist/chunk-UGK4TAVK.js.map +0 -1
  311. package/dist/chunk-UT2OPSN4.js.map +0 -1
  312. package/dist/chunk-VGLHY6BK.js.map +0 -1
  313. package/dist/chunk-VWKUT4CW.js.map +0 -1
  314. package/dist/chunk-W7FLHT65.js +0 -26
  315. package/dist/chunk-W7FLHT65.js.map +0 -1
  316. package/dist/chunk-WAR4Q2NM.js.map +0 -1
  317. package/dist/chunk-WHFUWWI6.js +0 -2097
  318. package/dist/chunk-WHFUWWI6.js.map +0 -1
  319. package/dist/chunk-XGJ2QERC.js.map +0 -1
  320. package/dist/chunk-XHCBHYN4.js +0 -54
  321. package/dist/chunk-XHCBHYN4.js.map +0 -1
  322. package/dist/chunk-XLQI4IT2.js +0 -54
  323. package/dist/chunk-XLQI4IT2.js.map +0 -1
  324. package/dist/chunk-XWVDS66D.js +0 -963
  325. package/dist/chunk-XWVDS66D.js.map +0 -1
  326. package/dist/chunk-YGZMVNN5.js +0 -54
  327. package/dist/chunk-YGZMVNN5.js.map +0 -1
  328. package/dist/chunk-YUK3X3B4.js +0 -27
  329. package/dist/chunk-YUK3X3B4.js.map +0 -1
  330. package/dist/chunk-ZEGAMJO2.js.map +0 -1
  331. package/dist/chunk-ZNWVJ6UW.js +0 -54
  332. package/dist/chunk-ZNWVJ6UW.js.map +0 -1
  333. package/dist/config-3BBWD5AB.js +0 -11
  334. package/dist/config-4UDVSUQJ.js +0 -11
  335. package/dist/config-CMDBAPDH.js +0 -11
  336. package/dist/config-D3RLSPNF.js +0 -11
  337. package/dist/config-DG65OEG3.js +0 -11
  338. package/dist/config-GCQK6NJY.js +0 -11
  339. package/dist/config-GVH27UPE.js +0 -11
  340. package/dist/config-HXVYIXP5.js +0 -11
  341. package/dist/config-IDZMEW73.js +0 -11
  342. package/dist/config-IJJXGLBQ.js +0 -11
  343. package/dist/config-KJOLGVB2.js +0 -11
  344. package/dist/config-KMVCVBYN.js +0 -15
  345. package/dist/config-KYTRXAB2.js +0 -15
  346. package/dist/config-OT2TQQCN.js +0 -11
  347. package/dist/config-QWCY3LBQ.js +0 -11
  348. package/dist/config-ZV6G2ZEC.js +0 -11
  349. package/dist/databricks_volume-7XOUYSTY.js +0 -7
  350. package/dist/digitalocean-3CQ4CPPZ.js +0 -10
  351. package/dist/discord-BG7OSRJG.js +0 -8
  352. package/dist/disk-XVLBCVKE.js +0 -8
  353. package/dist/dropbox-74GYLV3R.js +0 -8
  354. package/dist/email-5IZ7OBQ4.js +0 -8
  355. package/dist/gcs-EMEYU2XT.js +0 -10
  356. package/dist/gdocs-R67TDPON.js +0 -8
  357. package/dist/gdrive-PRN2ALRK.js +0 -8
  358. package/dist/github-DV7E6OFV.js +0 -8
  359. package/dist/github_ci-Q554V5PA.js +0 -8
  360. package/dist/gmail-OLN2LT4O.js +0 -8
  361. package/dist/gsheets-H4RYMQJ5.js +0 -8
  362. package/dist/gslides-YLCHKJOM.js +0 -8
  363. package/dist/hf_buckets-DTKXKKFF.js +0 -10
  364. package/dist/hf_datasets-55C4APKR.js +0 -10
  365. package/dist/hf_models-RO5JR36V.js +0 -10
  366. package/dist/hf_spaces-ZVZ3EDRX.js +0 -10
  367. package/dist/langfuse-ACASJZ7O.js +0 -8
  368. package/dist/linear-IC37LZV7.js +0 -8
  369. package/dist/minio-HZ576XFQ.js +0 -10
  370. package/dist/mongodb-JVR62OIO.js +0 -7
  371. package/dist/notion-HKRPQMJS.js +0 -8
  372. package/dist/oci-ZLVECXTW.js +0 -10
  373. package/dist/postgres-P36Z2YN4.js +0 -7
  374. package/dist/qingstor-YLP6K3L4.js +0 -10
  375. package/dist/r2-RPK25ANI.js +0 -10
  376. package/dist/redis-V5ULXULL.js +0 -8
  377. package/dist/s3-4OIOCAAT.js +0 -8
  378. package/dist/scaleway-CCWCLUHB.js +0 -10
  379. package/dist/seaweedfs-QSWKF2FN.js +0 -10
  380. package/dist/slack-YPS7PII3.js +0 -8
  381. package/dist/ssh-YFP3SMTJ.js +0 -9
  382. package/dist/supabase-6CFTOKGZ.js +0 -10
  383. package/dist/tencent-IWZZOSQ4.js +0 -10
  384. package/dist/trello-XYKWZD6P.js +0 -8
  385. package/dist/wasabi-6Z4DC5S5.js +0 -10
  386. /package/dist/{aliyun-JMJ3PFYY.js.map → aliyun-S62BR3TB.js.map} +0 -0
  387. /package/dist/{backblaze-TDFD23QO.js.map → backblaze-4EKSW63F.js.map} +0 -0
  388. /package/dist/{box-GQ2U2R6R.js.map → box-ZPLZAGMK.js.map} +0 -0
  389. /package/dist/{ceph-S2VOYO6G.js.map → ceph-ALKLD3MO.js.map} +0 -0
  390. /package/dist/{chunk-HJJMP6IX.js.map → chunk-BZTVYOES.js.map} +0 -0
  391. /package/dist/{chunk-X5HF2OFP.js.map → chunk-ENW5BVYN.js.map} +0 -0
  392. /package/dist/{chunk-HGCRXJGP.js.map → chunk-ETIAW4YD.js.map} +0 -0
  393. /package/dist/{chunk-DM4GSE26.js.map → chunk-GMMQ3ZK4.js.map} +0 -0
  394. /package/dist/{chunk-N5FSLVKO.js.map → chunk-HCRYAFBI.js.map} +0 -0
  395. /package/dist/{chunk-UINQOUZR.js.map → chunk-OXEQSPND.js.map} +0 -0
  396. /package/dist/{config-34LHOGLM.js.map → config-2YBCHU2W.js.map} +0 -0
  397. /package/dist/{config-3BBWD5AB.js.map → config-3YRGRW72.js.map} +0 -0
  398. /package/dist/{config-3IVQJBNW.js.map → config-4GSOMUMF.js.map} +0 -0
  399. /package/dist/{config-4UDVSUQJ.js.map → config-5YBUWFUP.js.map} +0 -0
  400. /package/dist/{config-CMDBAPDH.js.map → config-5ZRKJTKG.js.map} +0 -0
  401. /package/dist/{config-CVZ2AGCO.js.map → config-A25LTL5W.js.map} +0 -0
  402. /package/dist/{config-D3RLSPNF.js.map → config-CLU7JABG.js.map} +0 -0
  403. /package/dist/{config-DG65OEG3.js.map → config-D2RF7L3N.js.map} +0 -0
  404. /package/dist/{config-EIHSP5DZ.js.map → config-E55TKM6K.js.map} +0 -0
  405. /package/dist/{config-EO23EY62.js.map → config-ELDOFRJW.js.map} +0 -0
  406. /package/dist/{config-GCQK6NJY.js.map → config-FPC3RBFD.js.map} +0 -0
  407. /package/dist/{config-GE4W4ZJC.js.map → config-FPM3LAW7.js.map} +0 -0
  408. /package/dist/{config-GHRUKEQ6.js.map → config-G3F54CS4.js.map} +0 -0
  409. /package/dist/{config-GVH27UPE.js.map → config-G43HRUI3.js.map} +0 -0
  410. /package/dist/{config-HKRMKD76.js.map → config-GG3WO5PB.js.map} +0 -0
  411. /package/dist/{config-HXVYIXP5.js.map → config-JUYBWAZE.js.map} +0 -0
  412. /package/dist/{config-IDZMEW73.js.map → config-LJ5T6TVA.js.map} +0 -0
  413. /package/dist/{config-IJJXGLBQ.js.map → config-MDSAE4O3.js.map} +0 -0
  414. /package/dist/{config-IVY5EQQ2.js.map → config-NRIOKK5T.js.map} +0 -0
  415. /package/dist/{config-KJOLGVB2.js.map → config-OYK2BSJK.js.map} +0 -0
  416. /package/dist/{config-KMVCVBYN.js.map → config-PB3KA2CE.js.map} +0 -0
  417. /package/dist/{config-KYTRXAB2.js.map → config-QY4IL3PH.js.map} +0 -0
  418. /package/dist/{config-LHFFXVYI.js.map → config-R4LAOEDS.js.map} +0 -0
  419. /package/dist/{config-NV5WXP64.js.map → config-RIAAD6RW.js.map} +0 -0
  420. /package/dist/{config-OT2TQQCN.js.map → config-SYNEQAUB.js.map} +0 -0
  421. /package/dist/{config-Q45Y46YT.js.map → config-TJKGYA2B.js.map} +0 -0
  422. /package/dist/{config-QAA646XB.js.map → config-UU27ALAA.js.map} +0 -0
  423. /package/dist/{config-QNMKWJ4M.js.map → config-UURRGA7U.js.map} +0 -0
  424. /package/dist/{config-QWCY3LBQ.js.map → config-VPLHQXVE.js.map} +0 -0
  425. /package/dist/{config-VM526IKB.js.map → config-WRACCRPN.js.map} +0 -0
  426. /package/dist/{config-WDAZFXYD.js.map → config-WVHKXEVE.js.map} +0 -0
  427. /package/dist/{config-ZFJYQZCH.js.map → config-XU7R36IE.js.map} +0 -0
  428. /package/dist/{config-ZV6G2ZEC.js.map → config-Y2KOUYSS.js.map} +0 -0
  429. /package/dist/{databricks_volume-7XOUYSTY.js.map → databricks_volume-CNCPTZHS.js.map} +0 -0
  430. /package/dist/{digitalocean-3CQ4CPPZ.js.map → digitalocean-DJZOUB6Q.js.map} +0 -0
  431. /package/dist/{discord-BG7OSRJG.js.map → discord-ETB2CADR.js.map} +0 -0
  432. /package/dist/{disk-XVLBCVKE.js.map → disk-WEHSTK3F.js.map} +0 -0
  433. /package/dist/{dropbox-74GYLV3R.js.map → dropbox-XN6PGLNE.js.map} +0 -0
  434. /package/dist/{email-5IZ7OBQ4.js.map → email-OV7XCP3T.js.map} +0 -0
  435. /package/dist/{gcs-EMEYU2XT.js.map → gcal-P56MRCGU.js.map} +0 -0
  436. /package/dist/{gdocs-R67TDPON.js.map → gcs-HFBIAE2C.js.map} +0 -0
  437. /package/dist/{gdrive-PRN2ALRK.js.map → gdocs-LQ3UXP3J.js.map} +0 -0
  438. /package/dist/{github-DV7E6OFV.js.map → gdrive-N6UBYLON.js.map} +0 -0
  439. /package/dist/{github_ci-Q554V5PA.js.map → github-BPZREGPI.js.map} +0 -0
  440. /package/dist/{gmail-OLN2LT4O.js.map → github_ci-7A4LUIZ7.js.map} +0 -0
  441. /package/dist/{gsheets-H4RYMQJ5.js.map → gmail-YED2MF6H.js.map} +0 -0
  442. /package/dist/{gslides-YLCHKJOM.js.map → gridfs-CPLQ4G62.js.map} +0 -0
  443. /package/dist/{hf_buckets-DTKXKKFF.js.map → gsheets-4BNIJPQ6.js.map} +0 -0
  444. /package/dist/{hf_datasets-55C4APKR.js.map → gslides-GDBYLO5A.js.map} +0 -0
  445. /package/dist/{hf_models-RO5JR36V.js.map → hf_buckets-FTJITQ3P.js.map} +0 -0
  446. /package/dist/{hf_spaces-ZVZ3EDRX.js.map → hf_datasets-6GXVKQD7.js.map} +0 -0
  447. /package/dist/{langfuse-ACASJZ7O.js.map → hf_models-PJPGZAC5.js.map} +0 -0
  448. /package/dist/{linear-IC37LZV7.js.map → hf_spaces-LFNFOLBF.js.map} +0 -0
  449. /package/dist/{minio-HZ576XFQ.js.map → jaeger-GCA6MJ6E.js.map} +0 -0
  450. /package/dist/{mongodb-JVR62OIO.js.map → lancedb-TJ5YSJY5.js.map} +0 -0
  451. /package/dist/{notion-HKRPQMJS.js.map → langfuse-RUMTUMXS.js.map} +0 -0
  452. /package/dist/{oci-ZLVECXTW.js.map → linear-BCE4KEAC.js.map} +0 -0
  453. /package/dist/{postgres-P36Z2YN4.js.map → minio-5SO6KBTK.js.map} +0 -0
  454. /package/dist/{qingstor-YLP6K3L4.js.map → mongodb-L5CMN2EE.js.map} +0 -0
  455. /package/dist/{r2-RPK25ANI.js.map → nextcloud-4O2LZVW2.js.map} +0 -0
  456. /package/dist/{redis-V5ULXULL.js.map → notion-RVKEAQ2M.js.map} +0 -0
  457. /package/dist/{s3-4OIOCAAT.js.map → oci-OQXOIC62.js.map} +0 -0
  458. /package/dist/{scaleway-CCWCLUHB.js.map → postgres-AV45GNRS.js.map} +0 -0
  459. /package/dist/{seaweedfs-QSWKF2FN.js.map → qingstor-W277YA4K.js.map} +0 -0
  460. /package/dist/{slack-YPS7PII3.js.map → r2-FUA4IORE.js.map} +0 -0
  461. /package/dist/{ssh-YFP3SMTJ.js.map → redis-LPS357NF.js.map} +0 -0
  462. /package/dist/{supabase-6CFTOKGZ.js.map → s3-FPNWWIVM.js.map} +0 -0
  463. /package/dist/{tencent-IWZZOSQ4.js.map → scaleway-BP3732U7.js.map} +0 -0
  464. /package/dist/{trello-XYKWZD6P.js.map → seaweedfs-MC6HIEP4.js.map} +0 -0
  465. /package/dist/{wasabi-6Z4DC5S5.js.map → slack-JFGW7VLN.js.map} +0 -0
@@ -1,124 +1,145 @@
1
1
  import {
2
2
  loadOptionalPeer
3
- } from "./chunk-E2ISWXLB.js";
3
+ } from "./chunk-OQKNDS66.js";
4
4
 
5
5
  // src/resource/redis/redis.ts
6
6
  import {
7
7
  BaseResource,
8
- PathSpec as PathSpec2,
8
+ PathSpec,
9
9
  REDACTED_SECRET,
10
- ResourceName as ResourceName21
10
+ ResourceName as ResourceName9,
11
+ makeResolveGlob,
12
+ mountKey,
13
+ mountPrefixOf as mountPrefixOf2,
14
+ stripSlash as stripSlash2,
15
+ compareCodePoints as compareCodePoints5
11
16
  } from "@struktoai/mirage-core";
12
17
 
13
18
  // src/commands/builtin/redis/index.ts
19
+ import { ResourceName as ResourceName7, makeGenericCommands } from "@struktoai/mirage-core";
20
+
21
+ // src/core/redis/append.ts
22
+ import { ResourceName, invalidateAfterWrite, record } from "@struktoai/mirage-core";
23
+
24
+ // src/core/redis/dest.ts
14
25
  import {
15
- ResourceName as ResourceName5,
16
- makeFiletypeCommands,
17
- makeGenericCommands
26
+ ancestors,
27
+ eexist,
28
+ enoent,
29
+ enotdir,
30
+ mountedPath
18
31
  } from "@struktoai/mirage-core";
19
-
20
- // src/core/redis/read.ts
21
- import { record, ResourceName } from "@struktoai/mirage-core";
22
- import { enoent } from "@struktoai/mirage-core";
32
+ async function checkDestParents(store, dst, d) {
33
+ for (const ancestor of ancestors(d)) {
34
+ if (await store.hasDir(ancestor)) continue;
35
+ if (await store.hasFile(ancestor)) throw enotdir(dst);
36
+ throw enoent(dst);
37
+ }
38
+ }
39
+ async function checkMkdirTarget(store, spec, key, parents) {
40
+ if (!parents) {
41
+ if (await store.hasDir(key) || await store.hasFile(key)) throw eexist(spec);
42
+ return;
43
+ }
44
+ for (const component of [...ancestors(key), key]) {
45
+ if (!await store.hasFile(component)) continue;
46
+ const named = mountedPath(spec, component);
47
+ throw component === key ? eexist(named) : enotdir(named);
48
+ }
49
+ }
23
50
 
24
51
  // src/core/redis/utils.ts
25
- import { norm, parent, gnuBasename } from "@struktoai/mirage-core";
52
+ import { norm, gnuBasename } from "@struktoai/mirage-core";
26
53
  function nowIso() {
27
54
  return (/* @__PURE__ */ new Date()).toISOString();
28
55
  }
29
56
 
30
- // src/core/redis/read.ts
31
- async function read(accessor, path, _index) {
57
+ // src/core/redis/append.ts
58
+ async function appendBytes(accessor, path, data) {
32
59
  const start = performance.now();
33
- const p = norm(path.stripPrefix);
34
- const data = await accessor.store.getFile(p);
35
- if (data === null) {
36
- throw enoent(path);
37
- }
38
- record("read", p, ResourceName.REDIS, data.byteLength, start);
39
- return data;
40
- }
41
-
42
- // src/core/redis/stat.ts
43
- import {
44
- FileStat,
45
- FileType,
46
- guessType
47
- } from "@struktoai/mirage-core";
48
- import { enoent as enoent2 } from "@struktoai/mirage-core";
49
- async function stat(accessor, path, _index) {
50
- const p = norm(path.stripPrefix);
60
+ const p = norm(path.mountPath);
51
61
  const store = accessor.store;
52
- if (await store.hasDir(p)) {
53
- return new FileStat({
54
- name: gnuBasename(p),
55
- modified: await store.getModified(p),
56
- type: FileType.DIRECTORY
57
- });
58
- }
59
- if (await store.hasFile(p)) {
60
- const size = await store.fileLen(p);
61
- return new FileStat({
62
- name: gnuBasename(p),
63
- size,
64
- modified: await store.getModified(p),
65
- type: guessType(p)
66
- });
62
+ await checkDestParents(store, path, p);
63
+ const existing = await store.getFile(p);
64
+ if (existing !== null) {
65
+ const merged = new Uint8Array(existing.byteLength + data.byteLength);
66
+ merged.set(existing, 0);
67
+ merged.set(data, existing.byteLength);
68
+ await store.setFile(p, merged);
69
+ } else {
70
+ await store.setFile(p, data);
67
71
  }
68
- throw enoent2(path);
72
+ await store.setModified(p, nowIso());
73
+ record("append", p, ResourceName.REDIS, data.byteLength, start);
74
+ await invalidateAfterWrite(p);
69
75
  }
70
76
 
71
77
  // src/core/redis/constants.ts
72
78
  var SCOPE_ERROR = 5e4;
73
79
 
74
80
  // src/core/redis/copy.ts
75
- import { invalidateAfterWrite } from "@struktoai/mirage-core";
81
+ import { enoent as enoent2, invalidateAfterWrite as invalidateAfterWrite2 } from "@struktoai/mirage-core";
76
82
  async function copy(accessor, src, dst) {
77
- const s = norm(src.stripPrefix);
78
- const d = norm(dst.stripPrefix);
83
+ const s = norm(src.mountPath);
84
+ const d = norm(dst.mountPath);
79
85
  const store = accessor.store;
86
+ await checkDestParents(store, dst, d);
80
87
  const data = await store.getFile(s);
81
- if (data === null) {
82
- throw new Error(`file not found: ${s}`);
83
- }
88
+ if (data === null) throw enoent2(src);
84
89
  await store.setFile(d, data);
85
90
  await store.setModified(d, nowIso());
86
- await invalidateAfterWrite(dst);
91
+ await invalidateAfterWrite2(dst);
87
92
  }
88
93
 
89
- // src/core/redis/du.ts
90
- import { rstripSlash } from "@struktoai/mirage-core";
91
- async function du(accessor, path) {
92
- const p = norm(path.stripPrefix);
94
+ // src/core/redis/create.ts
95
+ import { ResourceName as ResourceName2, invalidateAfterWrite as invalidateAfterWrite3, record as record2 } from "@struktoai/mirage-core";
96
+ async function create(accessor, path) {
97
+ const start = performance.now();
98
+ const p = norm(path.mountPath);
99
+ const store = accessor.store;
100
+ await checkDestParents(store, path, p);
101
+ await store.setFile(p, new Uint8Array(0));
102
+ await store.setModified(p, nowIso());
103
+ record2("create", p, ResourceName2.REDIS, 0, start);
104
+ await invalidateAfterWrite3(path);
105
+ }
106
+
107
+ // src/core/redis/du/entries.ts
108
+ import { compareCodePoints, rstripSlash } from "@struktoai/mirage-core";
109
+ async function entries(accessor, path) {
110
+ const p = norm(path.mountPath);
93
111
  const store = accessor.store;
94
112
  const prefix = rstripSlash(p) + "/";
113
+ const found = [];
95
114
  let total = 0;
96
- for (const key of await store.listFiles()) {
115
+ for (const key of [...await store.listFiles()].sort(compareCodePoints)) {
97
116
  if (key === p || key.startsWith(prefix)) {
98
- total += await store.fileLen(key);
117
+ const size2 = await store.fileLen(key);
118
+ found.push([key, size2]);
119
+ total += size2;
99
120
  }
100
121
  }
101
- return total;
122
+ return [found, total];
102
123
  }
103
- async function duAll(accessor, path) {
104
- const p = norm(path.stripPrefix);
124
+
125
+ // src/core/redis/du/size.ts
126
+ import { rstripSlash as rstripSlash2 } from "@struktoai/mirage-core";
127
+ async function size(accessor, path) {
128
+ const p = norm(path.mountPath);
105
129
  const store = accessor.store;
106
- const prefix = rstripSlash(p) + "/";
107
- const entries = [];
130
+ const prefix = rstripSlash2(p) + "/";
108
131
  let total = 0;
109
132
  for (const key of await store.listFiles()) {
110
133
  if (key === p || key.startsWith(prefix)) {
111
- const size = await store.fileLen(key);
112
- entries.push([key, size]);
113
- total += size;
134
+ total += await store.fileLen(key);
114
135
  }
115
136
  }
116
- return { entries, total };
137
+ return total;
117
138
  }
118
139
 
119
140
  // src/core/redis/exists.ts
120
141
  async function exists(accessor, path) {
121
- const p = norm(path.stripPrefix);
142
+ const p = norm(path.mountPath);
122
143
  const store = accessor.store;
123
144
  return await store.hasFile(p) || await store.hasDir(p);
124
145
  }
@@ -129,14 +150,15 @@ import {
129
150
  computeNonemptyDirs,
130
151
  emitStartPath,
131
152
  keep,
132
- rstripSlash as rstripSlash2,
133
- startBasename
153
+ rstripSlash as rstripSlash3,
154
+ startBasename,
155
+ compareCodePoints as compareCodePoints2
134
156
  } from "@struktoai/mirage-core";
135
157
  async function find(accessor, path, options = {}) {
136
- const p = norm(path.stripPrefix);
137
- const startName = startBasename(path.original);
158
+ const p = norm(path.mountPath);
159
+ const startName = startBasename(path.virtual);
138
160
  const store = accessor.store;
139
- const prefix = rstripSlash2(p) + "/";
161
+ const prefix = rstripSlash3(p) + "/";
140
162
  const baseDepth = p === "/" ? 0 : (p.match(/\//g) ?? []).length;
141
163
  const results = [];
142
164
  const tree = options.tree ?? buildTree({
@@ -183,12 +205,10 @@ async function find(accessor, path, options = {}) {
183
205
  isEmpty = kind === "f" ? await store.fileLen(key) === 0 : !nonempty.has(key);
184
206
  }
185
207
  if (!keep({ key, name: basename, kind, depth, isEmpty }, tree, options.minDepth)) continue;
186
- if (kind === "f" && (options.minSize !== null && options.minSize !== void 0 || options.maxSize !== null && options.maxSize !== void 0)) {
187
- const size = await store.fileLen(key);
188
- if (options.minSize !== null && options.minSize !== void 0 && size < options.minSize)
189
- continue;
190
- if (options.maxSize !== null && options.maxSize !== void 0 && size > options.maxSize)
191
- continue;
208
+ if (options.minSize != null || options.maxSize != null) {
209
+ const size2 = kind === "f" ? await store.fileLen(key) : 0;
210
+ if (options.minSize != null && size2 < options.minSize) continue;
211
+ if (options.maxSize != null && size2 > options.maxSize) continue;
192
212
  }
193
213
  results.push(key);
194
214
  }
@@ -205,16 +225,17 @@ async function find(accessor, path, options = {}) {
205
225
  maxSize: options.maxSize
206
226
  });
207
227
  }
208
- results.sort();
228
+ results.sort(compareCodePoints2);
209
229
  return results;
210
230
  }
211
231
 
212
232
  // src/core/redis/mkdir.ts
213
- import { invalidateAfterWrite as invalidateAfterWrite2 } from "@struktoai/mirage-core";
233
+ import { invalidateAfterWrite as invalidateAfterWrite4, invalidateAncestors } from "@struktoai/mirage-core";
214
234
  import { stripSlash } from "@struktoai/mirage-core";
215
235
  async function mkdir(accessor, path, parents = false) {
216
- const p = norm(path.stripPrefix);
236
+ const p = norm(path.mountPath);
217
237
  const store = accessor.store;
238
+ await checkMkdirTarget(store, path, p, parents);
218
239
  if (parents) {
219
240
  const parts = stripSlash(p).split("/");
220
241
  let current = "";
@@ -227,20 +248,37 @@ async function mkdir(accessor, path, parents = false) {
227
248
  await store.setModified(current, now);
228
249
  }
229
250
  }
251
+ await invalidateAfterWrite4(p);
252
+ await invalidateAncestors(path);
230
253
  return;
231
254
  }
232
- const par = parent(p);
233
- if (par !== "/" && !await store.hasDir(par)) {
234
- throw new Error(`parent directory does not exist: ${par}`);
235
- }
255
+ await checkDestParents(store, path, p);
236
256
  await store.addDir(p);
237
257
  await store.setModified(p, nowIso());
238
- await invalidateAfterWrite2(p);
258
+ await invalidateAfterWrite4(p);
259
+ }
260
+
261
+ // src/core/redis/read.ts
262
+ import { record as record3, ResourceName as ResourceName3 } from "@struktoai/mirage-core";
263
+ import { enoent as enoent3 } from "@struktoai/mirage-core";
264
+ async function read(accessor, path, _index) {
265
+ const start = performance.now();
266
+ const p = norm(path.mountPath);
267
+ const data = await accessor.store.getFile(p);
268
+ if (data === null) {
269
+ throw enoent3(path);
270
+ }
271
+ record3("read", p, ResourceName3.REDIS, data.byteLength, start);
272
+ return data;
239
273
  }
240
274
 
241
275
  // src/core/redis/readdir.ts
242
- import "@struktoai/mirage-core";
243
- import { enotdir } from "@struktoai/mirage-core";
276
+ import {
277
+ mountPrefixOf,
278
+ rstripSlash as rstripSlash4,
279
+ compareCodePoints as compareCodePoints3
280
+ } from "@struktoai/mirage-core";
281
+ import { readdirError } from "@struktoai/mirage-core";
244
282
 
245
283
  // src/core/redis/entry.ts
246
284
  import { IndexEntry } from "@struktoai/mirage-core";
@@ -249,14 +287,17 @@ var RedisResourceType = Object.freeze({
249
287
  FOLDER: "folder"
250
288
  });
251
289
  var RedisIndexEntry = class _RedisIndexEntry extends IndexEntry {
252
- static file(path, size = 0) {
290
+ // size defaults to null, not 0: a readdir knows a key exists but not
291
+ // its length, and a lying 0 would be trusted by index-first size
292
+ // lookups (provision estimates) over a real stat.
293
+ static file(path, size2 = null) {
253
294
  const name = path.slice(path.lastIndexOf("/") + 1);
254
295
  return new _RedisIndexEntry({
255
296
  id: path,
256
297
  name,
257
298
  resourceType: RedisResourceType.FILE,
258
299
  vfsName: name,
259
- size
300
+ size: size2
260
301
  });
261
302
  }
262
303
  static folder(path) {
@@ -272,9 +313,9 @@ var RedisIndexEntry = class _RedisIndexEntry extends IndexEntry {
272
313
 
273
314
  // src/core/redis/readdir.ts
274
315
  async function readdir(accessor, path, index) {
275
- const virtual = path.pattern !== null ? path.directory : path.stripPrefix;
276
- const mountPrefix = path.prefix;
277
- const virtualKey = mountPrefix + virtual;
316
+ const virtual = path.pattern !== null ? path.directory : path.mountPath;
317
+ const mountPrefix = mountPrefixOf(path.virtual, path.resourcePath);
318
+ const virtualKey = rstripSlash4(mountPrefix + virtual) || "/";
278
319
  if (index !== void 0) {
279
320
  const cached = await index.listDir(virtualKey);
280
321
  if (cached.entries !== void 0 && cached.entries !== null) {
@@ -284,7 +325,12 @@ async function readdir(accessor, path, index) {
284
325
  const store = accessor.store;
285
326
  const p = norm(virtual);
286
327
  if (!await store.hasDir(p)) {
287
- throw enotdir(path);
328
+ throw await readdirError(
329
+ path,
330
+ p,
331
+ (k) => store.hasFile(k),
332
+ (k) => store.hasDir(k)
333
+ );
288
334
  }
289
335
  const dirPrefix = p === "/" ? "/" : `${p}/`;
290
336
  const seen = /* @__PURE__ */ new Set();
@@ -297,75 +343,86 @@ async function readdir(accessor, path, index) {
297
343
  const first = remainder.split("/")[0];
298
344
  if (first !== void 0 && first.length > 0) seen.add(dirPrefix + first);
299
345
  }
300
- const sorted = [...seen].sort();
346
+ const sorted = [...seen].sort(compareCodePoints3);
301
347
  const virtualEntries = sorted.map((entry) => `${mountPrefix}${entry}`);
302
348
  if (index !== void 0) {
303
349
  const fileSet = new Set(files);
304
- const entries = sorted.map((e) => {
350
+ const entries2 = sorted.map((e) => {
305
351
  const name = e.slice(e.lastIndexOf("/") + 1);
306
352
  return [name, fileSet.has(e) ? RedisIndexEntry.file(e) : RedisIndexEntry.folder(e)];
307
353
  });
308
- await index.setDir(virtualKey, entries);
354
+ await index.setDir(virtualKey, entries2);
309
355
  }
310
356
  return virtualEntries;
311
357
  }
312
358
 
313
359
  // src/core/redis/rename.ts
314
- import { invalidateAfterUnlink, invalidateAfterWrite as invalidateAfterWrite3 } from "@struktoai/mirage-core";
315
- import { rstripSlash as rstripSlash3 } from "@struktoai/mirage-core";
360
+ import { invalidateAfterUnlink, invalidateAfterWrite as invalidateAfterWrite5 } from "@struktoai/mirage-core";
361
+ import { enoent as enoent4, rstripSlash as rstripSlash5 } from "@struktoai/mirage-core";
316
362
  async function rename(accessor, src, dst) {
317
- const s = norm(src.stripPrefix);
318
- const d = norm(dst.stripPrefix);
363
+ const s = norm(src.mountPath);
364
+ const d = norm(dst.mountPath);
319
365
  const now = nowIso();
320
366
  const store = accessor.store;
367
+ await checkDestParents(store, dst, d);
321
368
  if (await store.hasFile(s)) {
322
369
  const data = await store.getFile(s);
323
370
  const mod = await store.getModified(s);
324
- if (data === null) throw new Error(`file not found: ${s}`);
371
+ const attrs = await store.getAttrs(s);
372
+ if (data === null) throw enoent4(src);
325
373
  await store.delFile(s);
326
374
  await store.delModified(s);
375
+ await store.delAttrs(s);
327
376
  await store.setFile(d, data);
328
377
  await store.setModified(d, mod ?? now);
378
+ if (Object.keys(attrs).length > 0) await store.setAttrs(d, attrs);
329
379
  await invalidateAfterUnlink(s);
330
- await invalidateAfterWrite3(d);
380
+ await invalidateAfterWrite5(d);
331
381
  return;
332
382
  }
333
383
  if (await store.hasDir(s)) {
334
384
  const mod = await store.getModified(s);
385
+ const attrs = await store.getAttrs(s);
335
386
  await store.removeDir(s);
336
387
  await store.delModified(s);
388
+ await store.delAttrs(s);
337
389
  await store.addDir(d);
338
390
  await store.setModified(d, mod ?? now);
339
- const prefix = rstripSlash3(s) + "/";
340
- const dPrefix = rstripSlash3(d) + "/";
391
+ if (Object.keys(attrs).length > 0) await store.setAttrs(d, attrs);
392
+ const prefix = rstripSlash5(s) + "/";
393
+ const dPrefix = rstripSlash5(d) + "/";
341
394
  const files = await store.listFiles();
342
395
  for (const key of files) {
343
396
  if (key.startsWith(prefix)) {
344
397
  const newKey = dPrefix + key.slice(prefix.length);
345
398
  const data = await store.getFile(key);
346
399
  if (data === null) continue;
400
+ const subAttrs = await store.getAttrs(key);
347
401
  await store.delFile(key);
402
+ await store.delAttrs(key);
348
403
  await store.setFile(newKey, data);
404
+ if (Object.keys(subAttrs).length > 0) await store.setAttrs(newKey, subAttrs);
349
405
  }
350
406
  }
351
407
  await invalidateAfterUnlink(s);
352
- await invalidateAfterWrite3(d);
408
+ await invalidateAfterWrite5(d);
353
409
  return;
354
410
  }
355
- throw new Error(`file not found: ${s}`);
411
+ throw enoent4(src);
356
412
  }
357
413
 
358
414
  // src/core/redis/rm.ts
359
- import { invalidateAfterUnlink as invalidateAfterUnlink2, rstripSlash as rstripSlash4 } from "@struktoai/mirage-core";
415
+ import { invalidateAfterUnlink as invalidateAfterUnlink2, rstripSlash as rstripSlash6 } from "@struktoai/mirage-core";
360
416
  async function rmR(accessor, path) {
361
- const p = norm(path.stripPrefix);
417
+ const p = norm(path.mountPath);
362
418
  const store = accessor.store;
363
- const prefix = rstripSlash4(p) + "/";
419
+ const prefix = rstripSlash6(p) + "/";
364
420
  const files = await store.listFiles();
365
421
  for (const key of files) {
366
422
  if (key === p || key.startsWith(prefix)) {
367
423
  await store.delFile(key);
368
424
  await store.delModified(key);
425
+ await store.delAttrs(key);
369
426
  }
370
427
  }
371
428
  const dirs = await store.listDirs();
@@ -373,20 +430,21 @@ async function rmR(accessor, path) {
373
430
  if (key === p || key.startsWith(prefix)) {
374
431
  await store.removeDir(key);
375
432
  await store.delModified(key);
433
+ await store.delAttrs(key);
376
434
  }
377
435
  }
378
436
  await invalidateAfterUnlink2(path);
379
437
  }
380
438
 
381
439
  // src/core/redis/rmdir.ts
382
- import { invalidateAfterUnlink as invalidateAfterUnlink3, rstripSlash as rstripSlash5 } from "@struktoai/mirage-core";
440
+ import { invalidateAfterUnlink as invalidateAfterUnlink3, rstripSlash as rstripSlash7 } from "@struktoai/mirage-core";
383
441
  async function rmdir(accessor, path) {
384
- const p = norm(path.stripPrefix);
442
+ const p = norm(path.mountPath);
385
443
  const store = accessor.store;
386
444
  if (!await store.hasDir(p)) {
387
445
  throw new Error(`not a directory: ${p}`);
388
446
  }
389
- const prefix = rstripSlash5(p) + "/";
447
+ const prefix = rstripSlash7(p) + "/";
390
448
  const files = await store.listFiles();
391
449
  const dirs = await store.listDirs();
392
450
  const candidates = [...files, ...dirs];
@@ -399,52 +457,138 @@ async function rmdir(accessor, path) {
399
457
  await invalidateAfterUnlink3(path);
400
458
  }
401
459
 
460
+ // src/core/redis/set_attrs.ts
461
+ import { enoent as enoent5 } from "@struktoai/mirage-core";
462
+ async function setAttrs(accessor, path, fields) {
463
+ const store = accessor.store;
464
+ const p = norm(path.mountPath);
465
+ if (!await store.hasFile(p) && !await store.hasDir(p)) {
466
+ throw enoent5(path);
467
+ }
468
+ const encoded = {};
469
+ if (fields.mode !== void 0) encoded.mode = String(fields.mode);
470
+ if (fields.uid !== void 0) encoded.uid = String(fields.uid);
471
+ if (fields.gid !== void 0) encoded.gid = String(fields.gid);
472
+ if (fields.atime !== void 0) encoded.atime = fields.atime;
473
+ if (Object.keys(encoded).length > 0) {
474
+ await store.setAttrs(p, encoded);
475
+ }
476
+ if (fields.mtime !== void 0) {
477
+ await store.setModified(p, fields.mtime);
478
+ }
479
+ return {};
480
+ }
481
+
482
+ // src/core/redis/stat.ts
483
+ import {
484
+ FileStat,
485
+ FileType,
486
+ guessType
487
+ } from "@struktoai/mirage-core";
488
+ import { enoent as enoent6 } from "@struktoai/mirage-core";
489
+ function decodeAttrs(raw) {
490
+ const out = {};
491
+ if (raw.mode !== void 0) out.mode = parseInt(raw.mode, 10);
492
+ for (const key of ["uid", "gid"]) {
493
+ const val = raw[key];
494
+ if (val !== void 0) out[key] = /^\d+$/.test(val) ? parseInt(val, 10) : val;
495
+ }
496
+ if (raw.atime !== void 0) out.atime = raw.atime;
497
+ return out;
498
+ }
499
+ async function stat(accessor, path, _index) {
500
+ const p = norm(path.mountPath);
501
+ const store = accessor.store;
502
+ if (await store.hasDir(p)) {
503
+ const attrs = decodeAttrs(await store.getAttrs(p));
504
+ return new FileStat({
505
+ name: gnuBasename(p),
506
+ modified: await store.getModified(p),
507
+ type: FileType.DIRECTORY,
508
+ mode: attrs.mode ?? null,
509
+ uid: attrs.uid ?? null,
510
+ gid: attrs.gid ?? null,
511
+ atime: attrs.atime ?? null
512
+ });
513
+ }
514
+ if (await store.hasFile(p)) {
515
+ const size2 = await store.fileLen(p);
516
+ const attrs = decodeAttrs(await store.getAttrs(p));
517
+ return new FileStat({
518
+ name: gnuBasename(p),
519
+ size: size2,
520
+ modified: await store.getModified(p),
521
+ type: guessType(p),
522
+ mode: attrs.mode ?? null,
523
+ uid: attrs.uid ?? null,
524
+ gid: attrs.gid ?? null,
525
+ atime: attrs.atime ?? null
526
+ });
527
+ }
528
+ throw enoent6(path);
529
+ }
530
+
402
531
  // src/core/redis/stream.ts
403
532
  import {
404
533
  recordStream,
405
- ResourceName as ResourceName2
534
+ ResourceName as ResourceName4
406
535
  } from "@struktoai/mirage-core";
407
- import { enoent as enoent3 } from "@struktoai/mirage-core";
536
+ import { enoent as enoent7 } from "@struktoai/mirage-core";
408
537
  async function* stream(accessor, path, _index) {
409
- const p = norm(path.stripPrefix);
538
+ const p = norm(path.mountPath);
410
539
  const data = await accessor.store.getFile(p);
411
- if (data === null) throw enoent3(path);
412
- const rec = recordStream("read", p, ResourceName2.REDIS);
540
+ if (data === null) throw enoent7(path);
541
+ const rec = recordStream("read", p, ResourceName4.REDIS);
413
542
  if (rec !== null) rec.bytes = data.byteLength;
414
543
  yield data;
415
544
  }
416
545
 
546
+ // src/core/redis/truncate.ts
547
+ import { ResourceName as ResourceName5, invalidateAfterWrite as invalidateAfterWrite6, record as record4 } from "@struktoai/mirage-core";
548
+ async function truncate(accessor, path, length) {
549
+ const start = performance.now();
550
+ const p = norm(path.mountPath);
551
+ const store = accessor.store;
552
+ const existing = await store.getFile(p);
553
+ const data = existing ?? new Uint8Array(0);
554
+ const out = new Uint8Array(length);
555
+ const copyLen = Math.min(data.byteLength, length);
556
+ out.set(data.subarray(0, copyLen), 0);
557
+ await store.setFile(p, out);
558
+ await store.setModified(p, nowIso());
559
+ record4("truncate", p, ResourceName5.REDIS, 0, start);
560
+ await invalidateAfterWrite6(p);
561
+ }
562
+
417
563
  // src/core/redis/unlink.ts
418
564
  import { invalidateAfterUnlink as invalidateAfterUnlink4 } from "@struktoai/mirage-core";
419
565
  async function unlink(accessor, path) {
420
- const p = norm(path.stripPrefix);
566
+ const p = norm(path.mountPath);
421
567
  const store = accessor.store;
422
568
  if (!await store.hasFile(p)) {
423
569
  throw new Error(`file not found: ${p}`);
424
570
  }
425
571
  await store.delFile(p);
426
572
  await store.delModified(p);
573
+ await store.delAttrs(p);
427
574
  await invalidateAfterUnlink4(p);
428
575
  }
429
576
 
430
577
  // src/core/redis/write.ts
431
- import { ResourceName as ResourceName3, invalidateAfterWrite as invalidateAfterWrite4, record as record2 } from "@struktoai/mirage-core";
578
+ import { ResourceName as ResourceName6, invalidateAfterWrite as invalidateAfterWrite7, record as record5 } from "@struktoai/mirage-core";
432
579
  async function writeBytes(accessor, path, data) {
433
580
  const start = performance.now();
434
- const p = norm(path.stripPrefix);
435
- const par = parent(p);
581
+ const p = norm(path.mountPath);
436
582
  const store = accessor.store;
437
- if (par !== "/" && !await store.hasDir(par)) {
438
- throw new Error(`parent directory does not exist: ${par}`);
439
- }
583
+ await checkDestParents(store, path, p);
440
584
  await store.setFile(p, data);
441
585
  await store.setModified(p, nowIso());
442
- record2("write", p, ResourceName3.REDIS, data.byteLength, start);
443
- await invalidateAfterWrite4(p);
586
+ record5("write", p, ResourceName6.REDIS, data.byteLength, start);
587
+ await invalidateAfterWrite7(p);
444
588
  }
445
589
 
446
- // src/commands/builtin/redis/ops.ts
447
- var REDIS_CMD_OPS = {
590
+ // src/commands/builtin/redis/io.ts
591
+ var REDIS_IO = {
448
592
  readdir,
449
593
  readBytes: read,
450
594
  readStream: stream,
@@ -460,31 +604,17 @@ var REDIS_CMD_OPS = {
460
604
  rmR,
461
605
  rename,
462
606
  copy,
607
+ create,
608
+ truncate,
609
+ append: appendBytes,
610
+ setAttrs,
463
611
  find,
464
- duTotal: du,
465
- duAll: async (accessor, path) => {
466
- const { entries, total } = await duAll(accessor, path);
467
- return [entries, total];
468
- }
612
+ du: { size, entries }
469
613
  };
470
614
 
471
- // src/commands/builtin/redis/sed.ts
472
- import { ResourceName as ResourceName4, makeSed } from "@struktoai/mirage-core";
473
- var REDIS_SED = makeSed({
474
- resource: ResourceName4.REDIS,
475
- stream: (a, p) => stream(a, p),
476
- write: (a, p, d) => writeBytes(a, p, d)
477
- });
478
-
479
615
  // src/commands/builtin/redis/index.ts
480
616
  var REDIS_COMMANDS = [
481
- ...makeFiletypeCommands({
482
- resource: ResourceName5.REDIS,
483
- readBytes: read,
484
- statEntry: stat
485
- }),
486
- ...makeGenericCommands(ResourceName5.REDIS, REDIS_CMD_OPS),
487
- ...REDIS_SED
617
+ ...makeGenericCommands(ResourceName7.REDIS, REDIS_IO)
488
618
  ];
489
619
 
490
620
  // src/accessor/redis.ts
@@ -497,308 +627,16 @@ var RedisAccessor = class extends Accessor {
497
627
  }
498
628
  };
499
629
 
500
- // src/core/redis/append.ts
501
- import { ResourceName as ResourceName6, invalidateAfterWrite as invalidateAfterWrite5, record as record3 } from "@struktoai/mirage-core";
502
- async function appendBytes(accessor, path, data) {
503
- const start = performance.now();
504
- const p = norm(path.stripPrefix);
505
- const store = accessor.store;
506
- const existing = await store.getFile(p);
507
- if (existing !== null) {
508
- const merged = new Uint8Array(existing.byteLength + data.byteLength);
509
- merged.set(existing, 0);
510
- merged.set(data, existing.byteLength);
511
- await store.setFile(p, merged);
512
- } else {
513
- await store.setFile(p, data);
514
- }
515
- await store.setModified(p, nowIso());
516
- record3("append", p, ResourceName6.REDIS, data.byteLength, start);
517
- await invalidateAfterWrite5(p);
518
- }
519
-
520
- // src/core/redis/create.ts
521
- import { invalidateAfterWrite as invalidateAfterWrite6 } from "@struktoai/mirage-core";
522
- async function create(accessor, path) {
523
- const p = norm(path.stripPrefix);
524
- const store = accessor.store;
525
- await store.setFile(p, new Uint8Array(0));
526
- await store.setModified(p, nowIso());
527
- await invalidateAfterWrite6(path);
528
- }
529
-
530
- // src/core/redis/glob.ts
531
- import { PathSpec } from "@struktoai/mirage-core";
532
- import { fnmatch } from "@struktoai/mirage-core";
533
- import { gnuBasename as gnuBasename2 } from "@struktoai/mirage-core";
534
- async function resolveGlob(accessor, paths, index) {
535
- const result = [];
536
- for (const p of paths) {
537
- if (p.resolved) {
538
- result.push(p);
539
- } else if (p.pattern !== null) {
540
- const dirSpec = new PathSpec({
541
- original: p.directory,
542
- directory: p.directory,
543
- resolved: true,
544
- prefix: p.prefix
545
- });
546
- const entries = await readdir(accessor, dirSpec, index);
547
- const matched = [];
548
- for (const e of entries) {
549
- if (fnmatch(gnuBasename2(e), p.pattern)) {
550
- matched.push(
551
- new PathSpec({
552
- original: e,
553
- directory: p.directory,
554
- resolved: true,
555
- prefix: p.prefix
556
- })
557
- );
558
- }
559
- }
560
- if (matched.length > SCOPE_ERROR) matched.length = SCOPE_ERROR;
561
- result.push(...matched);
562
- } else {
563
- result.push(p);
564
- }
565
- }
566
- return result;
567
- }
568
-
569
- // src/core/redis/truncate.ts
570
- import { invalidateAfterWrite as invalidateAfterWrite7 } from "@struktoai/mirage-core";
571
- async function truncate(accessor, path, length) {
572
- const p = norm(path.stripPrefix);
573
- const store = accessor.store;
574
- const existing = await store.getFile(p);
575
- const data = existing ?? new Uint8Array(0);
576
- const out = new Uint8Array(length);
577
- const copyLen = Math.min(data.byteLength, length);
578
- out.set(data.subarray(0, copyLen), 0);
579
- await store.setFile(p, out);
580
- await store.setModified(p, nowIso());
581
- await invalidateAfterWrite7(p);
582
- }
583
-
584
- // src/ops/redis/append.ts
585
- import { ResourceName as ResourceName7 } from "@struktoai/mirage-core";
586
- var appendOp = {
587
- name: "append",
588
- resource: ResourceName7.REDIS,
589
- filetype: null,
590
- write: true,
591
- fn: (accessor, path, args) => {
592
- const data = args[0];
593
- if (!(data instanceof Uint8Array)) {
594
- throw new TypeError("append op requires a Uint8Array as the first arg");
595
- }
596
- return appendBytes(accessor, path, data);
597
- }
598
- };
599
-
600
- // src/ops/redis/create.ts
601
- import { ResourceName as ResourceName8 } from "@struktoai/mirage-core";
602
- var createOp = {
603
- name: "create",
604
- resource: ResourceName8.REDIS,
605
- filetype: null,
606
- write: true,
607
- fn: (accessor, path) => {
608
- return create(accessor, path);
609
- }
610
- };
611
-
612
- // src/ops/redis/mkdir.ts
613
- import { ResourceName as ResourceName9 } from "@struktoai/mirage-core";
614
- var mkdirOp = {
615
- name: "mkdir",
616
- resource: ResourceName9.REDIS,
617
- filetype: null,
618
- write: true,
619
- fn: (accessor, path, args) => {
620
- const parents = args[0];
621
- return mkdir(accessor, path, parents === true);
622
- }
623
- };
624
-
625
- // src/ops/redis/read.ts
626
- import { ResourceName as ResourceName10 } from "@struktoai/mirage-core";
627
- var readOp = {
628
- name: "read",
629
- resource: ResourceName10.REDIS,
630
- filetype: null,
631
- write: false,
632
- fn: (accessor, path) => {
633
- return read(accessor, path);
634
- }
635
- };
636
-
637
- // src/ops/redis/read_feather.ts
638
- import {
639
- featherCat,
640
- ResourceName as ResourceName11
641
- } from "@struktoai/mirage-core";
642
- var readFeatherOp = {
643
- name: "read",
644
- resource: ResourceName11.REDIS,
645
- filetype: ".feather",
646
- write: false,
647
- fn: async (accessor, path, _args, kwargs) => {
648
- const raw = await read(accessor, path, kwargs.index);
649
- return featherCat(raw);
650
- }
651
- };
652
-
653
- // src/ops/redis/read_hdf5.ts
654
- import {
655
- hdf5Cat,
656
- ResourceName as ResourceName12
657
- } from "@struktoai/mirage-core";
658
- var readHdf5Op = {
659
- name: "read",
660
- resource: ResourceName12.REDIS,
661
- filetype: ".hdf5",
662
- write: false,
663
- fn: async (accessor, path, _args, kwargs) => {
664
- const raw = await read(accessor, path, kwargs.index);
665
- return hdf5Cat(raw);
666
- }
667
- };
668
-
669
- // src/ops/redis/read_parquet.ts
670
- import {
671
- parquetCat,
672
- ResourceName as ResourceName13
673
- } from "@struktoai/mirage-core";
674
- var readParquetOp = {
675
- name: "read",
676
- resource: ResourceName13.REDIS,
677
- filetype: ".parquet",
678
- write: false,
679
- fn: async (accessor, path, _args, kwargs) => {
680
- const raw = await read(accessor, path, kwargs.index);
681
- return parquetCat(raw);
682
- }
683
- };
684
-
685
- // src/ops/redis/readdir.ts
686
- import { ResourceName as ResourceName14 } from "@struktoai/mirage-core";
687
- var readdirOp = {
688
- name: "readdir",
689
- resource: ResourceName14.REDIS,
690
- filetype: null,
691
- write: false,
692
- fn: (accessor, path) => {
693
- return readdir(accessor, path);
694
- }
695
- };
696
-
697
- // src/ops/redis/rename.ts
698
- import { ResourceName as ResourceName15 } from "@struktoai/mirage-core";
699
- var renameOp = {
700
- name: "rename",
701
- resource: ResourceName15.REDIS,
702
- filetype: null,
703
- write: true,
704
- fn: (accessor, path, args) => {
705
- const dst = args[0];
706
- if (dst === void 0 || dst === null || typeof dst !== "object" || !("original" in dst)) {
707
- throw new TypeError("rename op requires a PathSpec destination as the first arg");
708
- }
709
- return rename(accessor, path, dst);
710
- }
711
- };
712
-
713
- // src/ops/redis/rmdir.ts
714
- import { ResourceName as ResourceName16 } from "@struktoai/mirage-core";
715
- var rmdirOp = {
716
- name: "rmdir",
717
- resource: ResourceName16.REDIS,
718
- filetype: null,
719
- write: true,
720
- fn: (accessor, path) => {
721
- return rmdir(accessor, path);
722
- }
723
- };
724
-
725
- // src/ops/redis/stat.ts
726
- import { ResourceName as ResourceName17 } from "@struktoai/mirage-core";
727
- var statOp = {
728
- name: "stat",
729
- resource: ResourceName17.REDIS,
730
- filetype: null,
731
- write: false,
732
- fn: (accessor, path) => {
733
- return stat(accessor, path);
734
- }
735
- };
736
-
737
- // src/ops/redis/truncate.ts
738
- import { ResourceName as ResourceName18 } from "@struktoai/mirage-core";
739
- var truncateOp = {
740
- name: "truncate",
741
- resource: ResourceName18.REDIS,
742
- filetype: null,
743
- write: true,
744
- fn: (accessor, path, args) => {
745
- const length = args[0];
746
- if (typeof length !== "number") {
747
- throw new TypeError("truncate op requires a number length as the first arg");
748
- }
749
- return truncate(accessor, path, length);
750
- }
751
- };
752
-
753
- // src/ops/redis/unlink.ts
754
- import { ResourceName as ResourceName19 } from "@struktoai/mirage-core";
755
- var unlinkOp = {
756
- name: "unlink",
757
- resource: ResourceName19.REDIS,
758
- filetype: null,
759
- write: true,
760
- fn: (accessor, path) => {
761
- return unlink(accessor, path);
762
- }
763
- };
764
-
765
- // src/ops/redis/write.ts
766
- import { extractWriteData } from "@struktoai/mirage-core";
767
- import { ResourceName as ResourceName20 } from "@struktoai/mirage-core";
768
- var writeOp = {
769
- name: "write",
770
- resource: ResourceName20.REDIS,
771
- filetype: null,
772
- write: true,
773
- fn: (accessor, path, args) => {
774
- const data = extractWriteData(args);
775
- return writeBytes(accessor, path, data);
776
- }
777
- };
778
-
779
630
  // src/ops/redis/index.ts
780
- var REDIS_OPS = [
781
- appendOp,
782
- createOp,
783
- mkdirOp,
784
- readOp,
785
- readFeatherOp,
786
- readHdf5Op,
787
- readParquetOp,
788
- readdirOp,
789
- renameOp,
790
- rmdirOp,
791
- statOp,
792
- truncateOp,
793
- unlinkOp,
794
- writeOp
795
- ];
631
+ import { ResourceName as ResourceName8, makeGenericOps } from "@struktoai/mirage-core";
632
+ var REDIS_OPS = makeGenericOps(ResourceName8.REDIS, REDIS_IO);
796
633
 
797
634
  // src/resource/redis/prompt.ts
798
635
  var REDIS_PROMPT = `Redis-backed persistent filesystem. Behaves like a standard filesystem.
799
636
  Standard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.`;
800
637
 
801
638
  // src/resource/redis/store.ts
639
+ import { compareCodePoints as compareCodePoints4 } from "@struktoai/mirage-core";
802
640
  var RedisStore = class {
803
641
  url;
804
642
  keyPrefix;
@@ -818,6 +656,9 @@ var RedisStore = class {
818
656
  mk(path) {
819
657
  return `${this.keyPrefix}modified:${path}`;
820
658
  }
659
+ ak(path) {
660
+ return `${this.keyPrefix}attrs:${path}`;
661
+ }
821
662
  async client() {
822
663
  if (this.providedClient !== null) return this.providedClient;
823
664
  this.clientPromise ??= (async () => {
@@ -866,21 +707,12 @@ var RedisStore = class {
866
707
  const keys = Array.isArray(k) ? k : [k];
867
708
  for (const key of keys) result.push(key.slice(strip));
868
709
  }
869
- return result.sort();
710
+ return result.sort(compareCodePoints4);
870
711
  }
871
712
  async fileLen(path) {
872
713
  const c = await this.client();
873
714
  return c.strLen(this.fk(path));
874
715
  }
875
- async getRange(path, start, end) {
876
- const c = await this.client();
877
- const typed = c;
878
- const mod = await import("redis");
879
- const blob = mod.RESP_TYPES.BLOB_STRING;
880
- const mapping = { [blob]: Buffer };
881
- const raw = await typed.withTypeMapping(mapping).getRange(this.fk(path), start, end);
882
- return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength);
883
- }
884
716
  async hasDir(path) {
885
717
  const c = await this.client();
886
718
  return await c.sIsMember(this.dk(), path) === 1;
@@ -910,9 +742,26 @@ var RedisStore = class {
910
742
  const c = await this.client();
911
743
  await c.del(this.mk(path));
912
744
  }
745
+ async getAttrs(path) {
746
+ const c = await this.client();
747
+ const raw = await c.hGetAll(this.ak(path));
748
+ return { ...raw };
749
+ }
750
+ async setAttrs(path, fields) {
751
+ const c = await this.client();
752
+ await c.hSet(this.ak(path), fields);
753
+ }
754
+ async delAttrs(path) {
755
+ const c = await this.client();
756
+ await c.del(this.ak(path));
757
+ }
913
758
  async clear() {
914
759
  const c = await this.client();
915
- for (const pattern of [`${this.keyPrefix}file:*`, `${this.keyPrefix}modified:*`]) {
760
+ for (const pattern of [
761
+ `${this.keyPrefix}file:*`,
762
+ `${this.keyPrefix}modified:*`,
763
+ `${this.keyPrefix}attrs:*`
764
+ ]) {
916
765
  const keys = [];
917
766
  for await (const k of c.scanIterator({ MATCH: pattern })) {
918
767
  if (Array.isArray(k)) keys.push(...k);
@@ -934,9 +783,12 @@ var RedisStore = class {
934
783
  };
935
784
 
936
785
  // src/resource/redis/redis.ts
786
+ var globCore = makeResolveGlob(readdir, SCOPE_ERROR);
937
787
  var RedisResource = class extends BaseResource {
938
- kind = ResourceName21.REDIS;
788
+ kind = ResourceName9.REDIS;
939
789
  cachesReads = false;
790
+ // byte store: stat() sizes every file from metadata
791
+ sizesAlwaysKnown = true;
940
792
  indexTtl = 0;
941
793
  prompt = REDIS_PROMPT;
942
794
  url;
@@ -955,8 +807,8 @@ var RedisResource = class extends BaseResource {
955
807
  mkdir,
956
808
  read_stream: stream,
957
809
  rm_recursive: rmR,
958
- du_total: du,
959
- du_all: duAll,
810
+ du_size: size,
811
+ du_entries: entries,
960
812
  create,
961
813
  truncate,
962
814
  exists,
@@ -970,11 +822,20 @@ var RedisResource = class extends BaseResource {
970
822
  this.store = new RedisStore({ url: this.url, keyPrefix: this.keyPrefix });
971
823
  this.accessor = new RedisAccessor(this.store);
972
824
  }
825
+ // The server URL (host, port and db) plus the key prefix pin the keyspace
826
+ // two mounts would share. The prefix is joined path-like so nested
827
+ // prefixes collapse onto one key.
828
+ storageId() {
829
+ const prefix = stripSlash2(this.keyPrefix);
830
+ const base = `${this.kind}:${this.url}`;
831
+ return prefix === "" ? base : `${base}/${prefix}`;
832
+ }
973
833
  async open() {
974
834
  await this.store.client();
975
835
  }
976
- close() {
977
- return this.store.close();
836
+ async close() {
837
+ await this.store.close();
838
+ await super.close();
978
839
  }
979
840
  client() {
980
841
  return this.store.client();
@@ -1031,22 +892,22 @@ var RedisResource = class extends BaseResource {
1031
892
  return rmR(this.accessor, p);
1032
893
  }
1033
894
  du(p) {
1034
- return du(this.accessor, p);
895
+ return size(this.accessor, p);
1035
896
  }
1036
897
  find(p, options = {}) {
1037
898
  return find(this.accessor, p, options);
1038
899
  }
1039
900
  glob(paths, prefix = "") {
1040
901
  const effective = prefix ? paths.map(
1041
- (p) => p.prefix ? p : new PathSpec2({
1042
- original: p.original,
902
+ (p) => mountPrefixOf2(p.virtual, p.resourcePath) ? p : new PathSpec({
903
+ virtual: p.virtual,
1043
904
  directory: p.directory,
1044
905
  ...p.pattern !== null ? { pattern: p.pattern } : {},
1045
906
  resolved: p.resolved,
1046
- prefix
907
+ resourcePath: mountKey(p.virtual, prefix)
1047
908
  })
1048
909
  ) : paths;
1049
- return resolveGlob(this.accessor, effective, this.index);
910
+ return globCore(this.accessor, effective, this.index);
1050
911
  }
1051
912
  async getState() {
1052
913
  const files = {};
@@ -1054,7 +915,23 @@ var RedisResource = class extends BaseResource {
1054
915
  const data = await this.store.getFile(key);
1055
916
  if (data !== null) files[key] = data;
1056
917
  }
1057
- const dirs = [...await this.store.listDirs()].sort();
918
+ const dirs = [...await this.store.listDirs()].sort(compareCodePoints5);
919
+ const c = await this.store.client();
920
+ const attrs = {};
921
+ const attrsStrip = `${this.keyPrefix}attrs:`.length;
922
+ for await (const key of c.scanIterator({ MATCH: `${this.keyPrefix}attrs:*` })) {
923
+ for (const k of Array.isArray(key) ? key : [key]) {
924
+ attrs[k.slice(attrsStrip)] = { ...await c.hGetAll(k) };
925
+ }
926
+ }
927
+ const modified = {};
928
+ const modStrip = `${this.keyPrefix}modified:`.length;
929
+ for await (const key of c.scanIterator({ MATCH: `${this.keyPrefix}modified:*` })) {
930
+ for (const k of Array.isArray(key) ? key : [key]) {
931
+ const val = await c.get(k);
932
+ if (val !== null) modified[k.slice(modStrip)] = val;
933
+ }
934
+ }
1058
935
  return {
1059
936
  type: this.kind,
1060
937
  config: {
@@ -1063,7 +940,9 @@ var RedisResource = class extends BaseResource {
1063
940
  },
1064
941
  keyPrefix: this.keyPrefix,
1065
942
  files,
1066
- dirs
943
+ dirs,
944
+ attrs,
945
+ modified
1067
946
  };
1068
947
  }
1069
948
  async loadState(state) {
@@ -1079,6 +958,14 @@ var RedisResource = class extends BaseResource {
1079
958
  for (const dir of state.dirs) {
1080
959
  pipe.sAdd(dirKey, dir);
1081
960
  }
961
+ for (const [path, fields] of Object.entries(state.attrs ?? {})) {
962
+ if (Object.keys(fields).length > 0) {
963
+ pipe.hSet(`${this.keyPrefix}attrs:${path}`, fields);
964
+ }
965
+ }
966
+ for (const [path, ts] of Object.entries(state.modified ?? {})) {
967
+ pipe.set(`${this.keyPrefix}modified:${path}`, ts);
968
+ }
1082
969
  await pipe.exec();
1083
970
  }
1084
971
  };
@@ -1092,4 +979,4 @@ export {
1092
979
  RedisStore,
1093
980
  RedisResource
1094
981
  };
1095
- //# sourceMappingURL=chunk-IDYHQQOH.js.map
982
+ //# sourceMappingURL=chunk-HOPUP6LA.js.map