@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
@@ -0,0 +1,750 @@
1
+ import {
2
+ loadOptionalPeer
3
+ } from "./chunk-OQKNDS66.js";
4
+
5
+ // src/accessor/hf.ts
6
+ import { Accessor, ResourceName } from "@struktoai/mirage-core";
7
+ var HF_RESOURCES = [
8
+ ResourceName.HF_BUCKETS,
9
+ ResourceName.HF_DATASETS,
10
+ ResourceName.HF_MODELS,
11
+ ResourceName.HF_SPACES
12
+ ];
13
+ var HfAccessor = class extends Accessor {
14
+ constructor(config) {
15
+ super();
16
+ this.config = config;
17
+ }
18
+ config;
19
+ operatorPromise = null;
20
+ get repoId() {
21
+ const config = this.config;
22
+ return config.repoId ?? config.bucket ?? "";
23
+ }
24
+ operatorOptions() {
25
+ const options = {
26
+ repo_type: this.repoType,
27
+ repo_id: this.repoId
28
+ };
29
+ if (this.config.token !== void 0 && this.config.token !== "") {
30
+ options.token = this.config.token;
31
+ }
32
+ if (this.config.endpoint !== void 0 && this.config.endpoint !== "") {
33
+ options.endpoint = this.config.endpoint;
34
+ }
35
+ const keyPrefix = this.config.keyPrefix;
36
+ if (keyPrefix !== void 0 && keyPrefix !== "") {
37
+ options.root = `/${stripSlashes(keyPrefix)}/`;
38
+ }
39
+ const revision = this.config.revision;
40
+ if (revision !== void 0 && revision !== "") {
41
+ options.revision = revision;
42
+ }
43
+ return options;
44
+ }
45
+ operator() {
46
+ this.operatorPromise ??= this.createOperator();
47
+ return this.operatorPromise;
48
+ }
49
+ async createOperator() {
50
+ const mod = await loadOptionalPeer(
51
+ () => import("opendal"),
52
+ { feature: "HuggingFace resources", packageName: "opendal" }
53
+ );
54
+ return new mod.Operator("hf", this.operatorOptions());
55
+ }
56
+ };
57
+ function stripSlashes(value) {
58
+ let start = 0;
59
+ let end = value.length;
60
+ while (start < end && value[start] === "/") start += 1;
61
+ while (end > start && value[end - 1] === "/") end -= 1;
62
+ return value.slice(start, end);
63
+ }
64
+ var HfBucketsAccessor = class extends HfAccessor {
65
+ repoType = "bucket";
66
+ resourceName = ResourceName.HF_BUCKETS;
67
+ get bucketUri() {
68
+ return `hf://buckets/${this.repoId}`;
69
+ }
70
+ };
71
+ var HfDatasetsAccessor = class extends HfAccessor {
72
+ repoType = "dataset";
73
+ resourceName = ResourceName.HF_DATASETS;
74
+ get bucketUri() {
75
+ return `hf://datasets/${this.repoId}`;
76
+ }
77
+ };
78
+ var HfModelsAccessor = class extends HfAccessor {
79
+ repoType = "model";
80
+ resourceName = ResourceName.HF_MODELS;
81
+ get bucketUri() {
82
+ return `hf://models/${this.repoId}`;
83
+ }
84
+ };
85
+ var HfSpacesAccessor = class extends HfAccessor {
86
+ repoType = "space";
87
+ resourceName = ResourceName.HF_SPACES;
88
+ get bucketUri() {
89
+ return `hf://spaces/${this.repoId}`;
90
+ }
91
+ };
92
+
93
+ // src/commands/builtin/hf/index.ts
94
+ import { makeGenericCommands } from "@struktoai/mirage-core";
95
+
96
+ // src/commands/builtin/hf/find.ts
97
+ import { command, findGeneric, metadataProvision, specOf } from "@struktoai/mirage-core";
98
+
99
+ // src/core/hf/find.ts
100
+ import {
101
+ buildTree,
102
+ emitStartPath,
103
+ keep,
104
+ rstripSlash,
105
+ startBasename,
106
+ stripSlash,
107
+ compareCodePoints
108
+ } from "@struktoai/mirage-core";
109
+
110
+ // src/core/hf/util.ts
111
+ import { mountPrefixOf } from "@struktoai/mirage-core";
112
+ function rawPathOf(path) {
113
+ const prefix = mountPrefixOf(path.virtual, path.resourcePath);
114
+ return prefix !== "" && path.virtual.startsWith(prefix) ? path.virtual.slice(prefix.length) || "/" : path.virtual;
115
+ }
116
+ function hfKey(rawPath) {
117
+ let start = 0;
118
+ while (start < rawPath.length && rawPath[start] === "/") start += 1;
119
+ return rawPath.slice(start);
120
+ }
121
+ function isNotFound(err) {
122
+ return err instanceof Error && err.message.startsWith("NotFound");
123
+ }
124
+
125
+ // src/core/hf/find.ts
126
+ function matchesFilters(entryPath, kind, size2, isEmpty, baseDepth, options, tree) {
127
+ const entryName = entryPath.split("/").pop() ?? "";
128
+ const depth = (entryPath.match(/\//g) ?? []).length - baseDepth;
129
+ if (options.maxDepth !== null && options.maxDepth !== void 0 && depth > options.maxDepth) {
130
+ return false;
131
+ }
132
+ if (!keep({ key: entryPath, name: entryName, kind, depth, isEmpty }, tree, options.minDepth)) {
133
+ return false;
134
+ }
135
+ if (options.minSize != null || options.maxSize != null) {
136
+ const effective = kind === "f" ? size2 : 0;
137
+ if (options.minSize != null && effective < options.minSize) {
138
+ return false;
139
+ }
140
+ if (options.maxSize != null && effective > options.maxSize) {
141
+ return false;
142
+ }
143
+ }
144
+ return true;
145
+ }
146
+ async function find(accessor, path, options = {}) {
147
+ const target = rawPathOf(path);
148
+ const pfx = stripSlash(target);
149
+ const scanPath = pfx !== "" ? `${pfx}/` : "/";
150
+ const base = pfx !== "" ? `/${pfx}` : "/";
151
+ const baseDepth = base === "/" ? 0 : (base.match(/\//g) ?? []).length;
152
+ const startName = startBasename(path.virtual);
153
+ const empty = options.empty === true;
154
+ const op = await accessor.operator();
155
+ const results = [];
156
+ const seenDirs = /* @__PURE__ */ new Set();
157
+ let sawDescendant = false;
158
+ let dirExists = false;
159
+ const tree = options.tree ?? buildTree({
160
+ name: options.name,
161
+ iname: options.iname,
162
+ pathPattern: options.pathPattern,
163
+ type: options.type,
164
+ nameExclude: options.nameExclude,
165
+ orNames: options.orNames
166
+ });
167
+ let entries2;
168
+ try {
169
+ entries2 = await op.list(scanPath, { recursive: true });
170
+ } catch (err) {
171
+ if (isNotFound(err)) return [];
172
+ throw err;
173
+ }
174
+ for (const entry of entries2) {
175
+ const rel = entry.path();
176
+ if (rel === "") continue;
177
+ const meta = entry.metadata();
178
+ const isDir = rel.endsWith("/") || meta.isDirectory();
179
+ const entryPath = `/${stripSlash(rel)}`;
180
+ if (entryPath === base) {
181
+ dirExists = true;
182
+ continue;
183
+ }
184
+ sawDescendant = true;
185
+ const kind = isDir ? "d" : "f";
186
+ const length = meta.contentLength;
187
+ const size2 = length !== null ? Number(length) : 0;
188
+ const fileEntries = [[entryPath, kind]];
189
+ if (!isDir) {
190
+ let parent = rstripSlash(entryPath.slice(0, entryPath.lastIndexOf("/"))) || "/";
191
+ while (parent !== "" && parent !== base && parent !== "/") {
192
+ if (!seenDirs.has(parent)) {
193
+ seenDirs.add(parent);
194
+ fileEntries.push([parent, "d"]);
195
+ }
196
+ parent = parent.slice(0, parent.lastIndexOf("/")) || "/";
197
+ }
198
+ }
199
+ for (const [ep, k] of fileEntries) {
200
+ const isEmpty = !empty ? null : k === "d" ? false : size2 === 0;
201
+ if (matchesFilters(ep, k, size2, isEmpty, baseDepth, options, tree)) {
202
+ results.push(ep);
203
+ }
204
+ }
205
+ }
206
+ if (sawDescendant || dirExists) {
207
+ emitStartPath(results, base, startName, {
208
+ kind: "d",
209
+ isEmpty: !sawDescendant,
210
+ exists: true,
211
+ tree,
212
+ maxDepth: options.maxDepth,
213
+ minDepth: options.minDepth,
214
+ minSize: options.minSize,
215
+ maxSize: options.maxSize
216
+ });
217
+ }
218
+ return [...new Set(results)].sort(compareCodePoints);
219
+ }
220
+
221
+ // src/core/hf/readdir.ts
222
+ import {
223
+ IndexEntry,
224
+ ResourceType,
225
+ mountPrefixOf as mountPrefixOf2,
226
+ rstripSlash as rstripSlash2,
227
+ stripSlash as stripSlash2,
228
+ compareCodePoints as compareCodePoints2
229
+ } from "@struktoai/mirage-core";
230
+
231
+ // src/core/hf/constants.ts
232
+ var SCOPE_ERROR = 1e4;
233
+ var DEFAULT_CHUNK_SIZE = 8192;
234
+
235
+ // src/core/hf/readdir.ts
236
+ import { enoent } from "@struktoai/mirage-core";
237
+ async function readdir(accessor, path, index) {
238
+ const prefix = mountPrefixOf2(path.virtual, path.resourcePath);
239
+ let target = path.pattern !== null ? path.directory : path.virtual;
240
+ if (prefix !== "" && target.startsWith(prefix)) {
241
+ const rest = target.slice(prefix.length);
242
+ if (prefix.endsWith("/") || rest === "" || rest.startsWith("/")) {
243
+ target = rest || "/";
244
+ }
245
+ }
246
+ const virtualKey = rstripSlash2(prefix !== "" ? `${prefix}${target}` : target) || "/";
247
+ if (index !== void 0) {
248
+ const listing = await index.listDir(virtualKey);
249
+ if (listing.entries !== void 0 && listing.entries !== null) {
250
+ return listing.entries;
251
+ }
252
+ }
253
+ const strippedTarget = stripSlash2(target);
254
+ const listPath = strippedTarget !== "" ? `${strippedTarget}/` : "/";
255
+ const op = await accessor.operator();
256
+ const names = [];
257
+ const dirKeys = /* @__PURE__ */ new Set();
258
+ const sizes = /* @__PURE__ */ new Map();
259
+ let entries2;
260
+ try {
261
+ entries2 = await op.list(listPath);
262
+ } catch (err) {
263
+ if (isNotFound(err)) throw enoent(path);
264
+ throw err;
265
+ }
266
+ for (const entry of entries2) {
267
+ const relative = entry.path();
268
+ if (relative === "" || relative === listPath) continue;
269
+ const isDir = relative.endsWith("/");
270
+ const base = `/${rstripSlash2(relative)}`;
271
+ names.push(base);
272
+ if (isDir) {
273
+ dirKeys.add(base);
274
+ } else {
275
+ const meta = entry.metadata();
276
+ const length = meta.contentLength;
277
+ sizes.set(base, length !== null ? Number(length) : null);
278
+ }
279
+ }
280
+ for (const [base, size2] of sizes) {
281
+ if (size2 !== null) continue;
282
+ const md = await op.stat(stripSlash2(base));
283
+ sizes.set(base, md.contentLength !== null ? Number(md.contentLength) : null);
284
+ }
285
+ names.sort(compareCodePoints2);
286
+ if (names.length > SCOPE_ERROR) {
287
+ console.warn(
288
+ `hf readdir: ${virtualKey} returned ${String(names.length)} entries (limit ${String(SCOPE_ERROR)})`
289
+ );
290
+ }
291
+ const virtualEntries = names.map((e) => prefix !== "" ? `${prefix}${e}` : e).sort(compareCodePoints2);
292
+ if (index !== void 0) {
293
+ const indexEntries = names.map((e) => {
294
+ const name = e.split("/").pop() ?? e;
295
+ if (dirKeys.has(e)) {
296
+ return [name, new IndexEntry({ id: e, name, resourceType: ResourceType.FOLDER })];
297
+ }
298
+ return [
299
+ name,
300
+ new IndexEntry({
301
+ id: e,
302
+ name,
303
+ resourceType: ResourceType.FILE,
304
+ size: sizes.get(e) ?? null
305
+ })
306
+ ];
307
+ });
308
+ await index.setDir(virtualKey, indexEntries);
309
+ }
310
+ return virtualEntries;
311
+ }
312
+
313
+ // src/commands/builtin/hf/find.ts
314
+ var HF_FIND = command({
315
+ name: "find",
316
+ resource: [...HF_RESOURCES],
317
+ spec: specOf("find"),
318
+ provision: metadataProvision,
319
+ // The emptiness probe is wired like the generic builder does it, because
320
+ // a bucket start point that holds nothing is exactly what an object store
321
+ // cannot tell from a missing one, and `-empty` has to match it.
322
+ fn: (accessor, paths, texts, opts) => findGeneric(
323
+ paths,
324
+ texts,
325
+ opts,
326
+ (root, options) => find(accessor, root, options),
327
+ void 0,
328
+ async (spec) => (await readdir(accessor, spec, opts.index ?? void 0)).length === 0
329
+ )
330
+ });
331
+
332
+ // src/commands/builtin/hf/io.ts
333
+ import { rangeOf } from "@struktoai/mirage-core";
334
+
335
+ // src/core/hf/write.ts
336
+ import { invalidateAfterWrite } from "@struktoai/mirage-core";
337
+ import { invalidateAncestors } from "@struktoai/mirage-core";
338
+ import { record } from "@struktoai/mirage-core";
339
+ import { enoent as enoent2 } from "@struktoai/mirage-core";
340
+ async function write(accessor, path, data, _index) {
341
+ const rawPath = rawPathOf(path);
342
+ const key = hfKey(rawPath);
343
+ const op = await accessor.operator();
344
+ const startMs = performance.now();
345
+ try {
346
+ await op.write(key, Buffer.from(data));
347
+ } catch (err) {
348
+ if (isNotFound(err)) throw enoent2(path);
349
+ throw err;
350
+ }
351
+ record("write", path.virtual, accessor.resourceName, data.byteLength, startMs);
352
+ await invalidateAfterWrite(path);
353
+ await invalidateAncestors(path);
354
+ }
355
+
356
+ // src/core/hf/create.ts
357
+ async function create(accessor, path, index) {
358
+ await write(accessor, path, new Uint8Array(), index);
359
+ }
360
+
361
+ // src/core/hf/du/entries.ts
362
+ import { compareCodePoints as compareCodePoints3, FileType as FileType2, stripSlash as stripSlash4 } from "@struktoai/mirage-core";
363
+
364
+ // src/core/hf/du/walk.ts
365
+ import "@struktoai/mirage-core";
366
+
367
+ // src/core/hf/stat.ts
368
+ import {
369
+ FileStat,
370
+ FileType,
371
+ guessType,
372
+ mountPrefixOf as mountPrefixOf3,
373
+ stripSlash as stripSlash3
374
+ } from "@struktoai/mirage-core";
375
+ import { enoent as enoent3 } from "@struktoai/mirage-core";
376
+ async function stat(accessor, path, index) {
377
+ const prefix = mountPrefixOf3(path.virtual, path.resourcePath);
378
+ const rawPath = rawPathOf(path);
379
+ const stripped = stripSlash3(rawPath);
380
+ if (stripped === "") {
381
+ return new FileStat({ name: "/", type: FileType.DIRECTORY });
382
+ }
383
+ if (index !== void 0) {
384
+ const virtualKey = prefix !== "" ? `${prefix}/${stripped}` : `/${stripped}`;
385
+ const lookup = await index.get(virtualKey);
386
+ if (lookup.entry !== void 0 && lookup.entry !== null) {
387
+ const entry = lookup.entry;
388
+ if (entry.resourceType === "folder") {
389
+ return new FileStat({ name: entry.name, type: FileType.DIRECTORY });
390
+ }
391
+ return new FileStat({
392
+ name: entry.name,
393
+ size: entry.size ?? null,
394
+ type: guessType(entry.name)
395
+ });
396
+ }
397
+ const parent = virtualKey.slice(0, virtualKey.lastIndexOf("/")) || "/";
398
+ const parentListing = await index.listDir(parent);
399
+ if (parentListing.entries !== void 0 && parentListing.entries !== null) {
400
+ throw enoent3(path);
401
+ }
402
+ }
403
+ const op = await accessor.operator();
404
+ let md = null;
405
+ try {
406
+ md = await op.stat(stripped);
407
+ } catch (err) {
408
+ if (!isNotFound(err)) throw err;
409
+ }
410
+ if (md !== null && !md.isDirectory()) {
411
+ const etag = md.etag;
412
+ return new FileStat({
413
+ name: stripped.split("/").pop() ?? stripped,
414
+ size: md.contentLength !== null ? Number(md.contentLength) : null,
415
+ modified: md.lastModified,
416
+ type: guessType(rawPath),
417
+ fingerprint: etag,
418
+ extra: etag !== null && etag !== "" ? { etag } : {}
419
+ });
420
+ }
421
+ try {
422
+ const children = await op.list(`${stripped}/`);
423
+ if (children.length > 0) {
424
+ return new FileStat({
425
+ name: stripped.split("/").pop() ?? "/",
426
+ type: FileType.DIRECTORY
427
+ });
428
+ }
429
+ } catch (err) {
430
+ if (!isNotFound(err)) throw err;
431
+ }
432
+ throw enoent3(path);
433
+ }
434
+
435
+ // src/core/hf/du/walk.ts
436
+ async function statOrNull(accessor, path) {
437
+ try {
438
+ return await stat(accessor, path);
439
+ } catch (err) {
440
+ if (err?.code === "ENOENT") return null;
441
+ throw err;
442
+ }
443
+ }
444
+ function lstrip(value) {
445
+ let start = 0;
446
+ while (start < value.length && value[start] === "/") start += 1;
447
+ return value.slice(start);
448
+ }
449
+
450
+ // src/core/hf/du/entries.ts
451
+ async function entries(accessor, path) {
452
+ const info = await statOrNull(accessor, path);
453
+ if (info !== null && info.type !== FileType2.DIRECTORY) return [[], info.size ?? 0];
454
+ const target = rawPathOf(path);
455
+ const pfx = stripSlash4(target);
456
+ const scanPath = pfx !== "" ? `${pfx}/` : "/";
457
+ const op = await accessor.operator();
458
+ const results = [];
459
+ let total = 0;
460
+ try {
461
+ for (const entry of await op.list(scanPath, { recursive: true })) {
462
+ const rel = entry.path();
463
+ if (rel === "" || rel.endsWith("/")) continue;
464
+ const length = entry.metadata().contentLength;
465
+ const size2 = length !== null ? Number(length) : 0;
466
+ results.push([`/${lstrip(rel)}`, size2]);
467
+ total += size2;
468
+ }
469
+ } catch (err) {
470
+ if (!isNotFound(err)) throw err;
471
+ }
472
+ results.sort((a, b) => compareCodePoints3(a[0], b[0]));
473
+ return [results, total];
474
+ }
475
+
476
+ // src/core/hf/du/size.ts
477
+ import { FileType as FileType3, stripSlash as stripSlash5 } from "@struktoai/mirage-core";
478
+ async function size(accessor, path) {
479
+ const info = await statOrNull(accessor, path);
480
+ if (info !== null && info.type !== FileType3.DIRECTORY) return info.size ?? 0;
481
+ const target = rawPathOf(path);
482
+ const pfx = stripSlash5(target);
483
+ const scanPath = pfx !== "" ? `${pfx}/` : "/";
484
+ const op = await accessor.operator();
485
+ let total = 0;
486
+ try {
487
+ for (const entry of await op.list(scanPath, { recursive: true })) {
488
+ if (entry.path().endsWith("/")) continue;
489
+ const length = entry.metadata().contentLength;
490
+ total += length !== null ? Number(length) : 0;
491
+ }
492
+ } catch (err) {
493
+ if (isNotFound(err)) return 0;
494
+ throw err;
495
+ }
496
+ return total;
497
+ }
498
+
499
+ // src/core/hf/mkdir.ts
500
+ async function mkdir(_accessor, _path, _index) {
501
+ }
502
+
503
+ // src/core/hf/unlink.ts
504
+ import { invalidateAfterUnlink } from "@struktoai/mirage-core";
505
+ import { FileType as FileType4, record as record2 } from "@struktoai/mirage-core";
506
+ import { invalidateAncestors as invalidateAncestors2 } from "@struktoai/mirage-core";
507
+ import { enoent as enoent4 } from "@struktoai/mirage-core";
508
+ async function unlink(accessor, path, index) {
509
+ const fileStat = await stat(accessor, path, index);
510
+ const rawPath = rawPathOf(path);
511
+ if (fileStat.type === FileType4.DIRECTORY) {
512
+ const e = new Error(`EISDIR: ${rawPath}`);
513
+ e.code = "EISDIR";
514
+ throw e;
515
+ }
516
+ const key = hfKey(rawPath);
517
+ const op = await accessor.operator();
518
+ const startMs = performance.now();
519
+ try {
520
+ await op.delete(key);
521
+ } catch (err) {
522
+ if (isNotFound(err)) throw enoent4(path);
523
+ throw err;
524
+ }
525
+ record2("unlink", path.virtual, accessor.resourceName, 0, startMs);
526
+ await invalidateAfterUnlink(path);
527
+ await invalidateAncestors2(path);
528
+ }
529
+
530
+ // src/core/hf/read.ts
531
+ import { record as record3 } from "@struktoai/mirage-core";
532
+ import { enoent as enoent5 } from "@struktoai/mirage-core";
533
+ async function read(accessor, path, _index, options = {}) {
534
+ const virtual = path.virtual;
535
+ const rawPath = rawPathOf(path);
536
+ const key = hfKey(rawPath);
537
+ const op = await accessor.operator();
538
+ const readOptions = {};
539
+ if (options.offset !== void 0 && options.offset > 0) {
540
+ readOptions.offset = BigInt(options.offset);
541
+ }
542
+ if (options.size !== void 0) {
543
+ readOptions.offset ??= 0n;
544
+ readOptions.size = BigInt(options.size);
545
+ }
546
+ const startMs = performance.now();
547
+ let data;
548
+ try {
549
+ data = readOptions.offset !== void 0 || readOptions.size !== void 0 ? await op.read(key, readOptions) : await op.read(key);
550
+ } catch (err) {
551
+ if (isNotFound(err)) throw enoent5(path);
552
+ throw err;
553
+ }
554
+ const bytes = new Uint8Array(data);
555
+ record3("read", virtual, accessor.resourceName, bytes.byteLength, startMs);
556
+ return bytes;
557
+ }
558
+
559
+ // src/core/hf/rm.ts
560
+ import { invalidateAfterUnlink as invalidateAfterUnlink2, record as record4, stripSlash as stripSlash6 } from "@struktoai/mirage-core";
561
+ import { invalidateAncestors as invalidateAncestors3 } from "@struktoai/mirage-core";
562
+ async function rmR(accessor, path) {
563
+ const stripped = stripSlash6(rawPathOf(path));
564
+ const scanPath = stripped !== "" ? `${stripped}/` : "/";
565
+ const op = await accessor.operator();
566
+ const startMs = performance.now();
567
+ const entries2 = await op.list(scanPath, { recursive: true });
568
+ for (const entry of entries2) {
569
+ const key = entry.path();
570
+ if (key.endsWith("/")) continue;
571
+ await op.delete(key);
572
+ }
573
+ record4("rm_r", path.virtual, accessor.resourceName, 0, startMs);
574
+ await invalidateAfterUnlink2(path);
575
+ await invalidateAncestors3(path);
576
+ }
577
+
578
+ // src/core/hf/stream.ts
579
+ import { recordStream } from "@struktoai/mirage-core";
580
+ import { enoent as enoent6 } from "@struktoai/mirage-core";
581
+ async function rangeRead(accessor, path, start, end) {
582
+ return read(accessor, path, void 0, { offset: start, size: end - start });
583
+ }
584
+ async function* stream(accessor, path, _index, chunkSize = DEFAULT_CHUNK_SIZE) {
585
+ const virtual = path.virtual;
586
+ const rawPath = rawPathOf(path);
587
+ const key = hfKey(rawPath);
588
+ const op = await accessor.operator();
589
+ const rec = recordStream("read", virtual, accessor.resourceName);
590
+ let reader;
591
+ try {
592
+ reader = await op.reader(key);
593
+ } catch (err) {
594
+ if (isNotFound(err)) throw enoent6(path);
595
+ throw err;
596
+ }
597
+ const buf = Buffer.alloc(chunkSize);
598
+ for (; ; ) {
599
+ const n = Number(await reader.read(buf));
600
+ if (n <= 0) break;
601
+ const chunk = new Uint8Array(buf.subarray(0, n));
602
+ if (rec !== null) rec.bytes += chunk.byteLength;
603
+ yield chunk;
604
+ }
605
+ }
606
+
607
+ // src/core/hf/exists.ts
608
+ async function exists(accessor, path) {
609
+ try {
610
+ await stat(accessor, path);
611
+ return true;
612
+ } catch (err) {
613
+ if (err?.code === "ENOENT") return false;
614
+ throw err;
615
+ }
616
+ }
617
+
618
+ // src/commands/builtin/hf/io.ts
619
+ var HF_IO = {
620
+ readdir,
621
+ readBytes: read,
622
+ readRange: rangeOf(read),
623
+ readStream: stream,
624
+ stat,
625
+ du: { size, entries },
626
+ isMounted: () => true,
627
+ local: false,
628
+ maxGlobMatches: SCOPE_ERROR,
629
+ write,
630
+ exists,
631
+ mkdir: (accessor, path) => mkdir(accessor, path),
632
+ unlink,
633
+ rmR,
634
+ create
635
+ };
636
+
637
+ // src/commands/builtin/hf/index.ts
638
+ var HF_OVERRIDES = /* @__PURE__ */ new Set(["cp", "mv", "find"]);
639
+ var HF_COMMANDS = [
640
+ ...HF_RESOURCES.flatMap(
641
+ (resource) => makeGenericCommands(resource, HF_IO, {
642
+ overrides: HF_OVERRIDES
643
+ })
644
+ ),
645
+ ...HF_FIND
646
+ ];
647
+
648
+ // src/ops/hf/index.ts
649
+ import { makeGenericOps } from "@struktoai/mirage-core";
650
+ var HF_OPS = makeGenericOps(HF_RESOURCES, HF_IO, {});
651
+
652
+ // src/resource/hf_buckets/base.ts
653
+ import {
654
+ BaseResource,
655
+ PathSpec,
656
+ makeResolveGlob,
657
+ mountKey,
658
+ mountPrefixOf as mountPrefixOf4
659
+ } from "@struktoai/mirage-core";
660
+ var globCore = makeResolveGlob(readdir, SCOPE_ERROR);
661
+ var HfResource = class extends BaseResource {
662
+ cachesReads = true;
663
+ // The Hub tree API reports each file's exact byte size (the LFS
664
+ // object size for LFS files); readdir backfills any lister-omitted
665
+ // size with one stat.
666
+ sizesAlwaysKnown = true;
667
+ supportsSnapshot = true;
668
+ opsMap = {
669
+ read_bytes: read,
670
+ readdir,
671
+ stat,
672
+ read_stream: stream,
673
+ range_read: rangeRead,
674
+ du_size: size,
675
+ du_entries: entries,
676
+ exists,
677
+ find_flat: find,
678
+ write,
679
+ create,
680
+ unlink,
681
+ mkdir
682
+ };
683
+ open() {
684
+ return Promise.resolve();
685
+ }
686
+ commands() {
687
+ return HF_COMMANDS;
688
+ }
689
+ ops() {
690
+ return HF_OPS;
691
+ }
692
+ streamPath(p) {
693
+ return stream(this.accessor, p);
694
+ }
695
+ readFile(p) {
696
+ return read(this.accessor, p, this.index);
697
+ }
698
+ writeFile(p, data) {
699
+ return write(this.accessor, p, data, this.index);
700
+ }
701
+ readdir(p) {
702
+ return readdir(this.accessor, p, this.index);
703
+ }
704
+ stat(p) {
705
+ return stat(this.accessor, p, this.index);
706
+ }
707
+ exists(p) {
708
+ return exists(this.accessor, p);
709
+ }
710
+ mkdir(p) {
711
+ return mkdir(this.accessor, p);
712
+ }
713
+ unlink(p) {
714
+ return unlink(this.accessor, p, this.index);
715
+ }
716
+ du(p) {
717
+ return size(this.accessor, p);
718
+ }
719
+ find(p, options = {}) {
720
+ return find(this.accessor, p, options);
721
+ }
722
+ glob(paths, prefix = "") {
723
+ const effective = prefix ? paths.map(
724
+ (p) => mountPrefixOf4(p.virtual, p.resourcePath) ? p : new PathSpec({
725
+ virtual: p.virtual,
726
+ directory: p.directory,
727
+ ...p.pattern !== null ? { pattern: p.pattern } : {},
728
+ resolved: p.resolved,
729
+ resourcePath: mountKey(p.virtual, prefix)
730
+ })
731
+ ) : paths;
732
+ return globCore(this.accessor, effective, this.index);
733
+ }
734
+ loadState(_state) {
735
+ return Promise.resolve();
736
+ }
737
+ };
738
+
739
+ export {
740
+ HF_RESOURCES,
741
+ HfAccessor,
742
+ HfBucketsAccessor,
743
+ HfDatasetsAccessor,
744
+ HfModelsAccessor,
745
+ HfSpacesAccessor,
746
+ HF_COMMANDS,
747
+ HF_OPS,
748
+ HfResource
749
+ };
750
+ //# sourceMappingURL=chunk-DDAFNROK.js.map