@struktoai/mirage-node 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/dist/aliyun-PGI57A43.js +10 -0
  2. package/dist/backblaze-TSPL6Y56.js +10 -0
  3. package/dist/box-7XTZYDSO.js +8 -0
  4. package/dist/cas.lua +15 -0
  5. package/dist/ceph-C265UI5T.js +10 -0
  6. package/dist/{chunk-I5THIMPP.js → chunk-25W4XQJZ.js} +5 -5
  7. package/dist/{chunk-QGRDPSAH.js → chunk-2ERLWAGG.js} +4 -2
  8. package/dist/chunk-2ERLWAGG.js.map +1 -0
  9. package/dist/{chunk-NJMGCT63.js → chunk-2QNPKPZZ.js} +7 -2
  10. package/dist/chunk-2QNPKPZZ.js.map +1 -0
  11. package/dist/{chunk-ZNWVJ6UW.js → chunk-3ASOQTZB.js} +7 -2
  12. package/dist/chunk-3ASOQTZB.js.map +1 -0
  13. package/dist/{chunk-WAR4Q2NM.js → chunk-3JZN3GYO.js} +13 -12
  14. package/dist/chunk-3JZN3GYO.js.map +1 -0
  15. package/dist/{chunk-S5OVP467.js → chunk-4GYB7DGC.js} +294 -705
  16. package/dist/chunk-4GYB7DGC.js.map +1 -0
  17. package/dist/{chunk-HJJMP6IX.js → chunk-4M73WHIE.js} +3 -3
  18. package/dist/{chunk-7CW3BMPH.js → chunk-4X6CLF4F.js} +3 -3
  19. package/dist/{chunk-QQBJC2FQ.js → chunk-5I7Q7RHW.js} +3 -3
  20. package/dist/{chunk-LV2G7VHL.js → chunk-5YRWF5RP.js} +17 -15
  21. package/dist/chunk-5YRWF5RP.js.map +1 -0
  22. package/dist/chunk-5ZHNPNDD.js +944 -0
  23. package/dist/chunk-5ZHNPNDD.js.map +1 -0
  24. package/dist/{chunk-VGLHY6BK.js → chunk-AULFV3KY.js} +1 -2
  25. package/dist/chunk-AULFV3KY.js.map +1 -0
  26. package/dist/{chunk-VWKUT4CW.js → chunk-BWLUBJQG.js} +19 -15
  27. package/dist/chunk-BWLUBJQG.js.map +1 -0
  28. package/dist/{chunk-X5HF2OFP.js → chunk-BWWU5T2D.js} +3 -3
  29. package/dist/chunk-C7TNKIK5.js +39 -0
  30. package/dist/chunk-C7TNKIK5.js.map +1 -0
  31. package/dist/{chunk-MPCCRRE6.js → chunk-CB76WPUS.js} +12 -13
  32. package/dist/chunk-CB76WPUS.js.map +1 -0
  33. package/dist/chunk-CGGO5NKD.js +1194 -0
  34. package/dist/chunk-CGGO5NKD.js.map +1 -0
  35. package/dist/{chunk-B2ZOKNN4.js → chunk-CQCTCW4S.js} +1 -2
  36. package/dist/chunk-CQCTCW4S.js.map +1 -0
  37. package/dist/{chunk-KPULTUOK.js → chunk-CXQGMFI7.js} +3 -3
  38. package/dist/{chunk-LW25LMIH.js → chunk-D3U7VQCG.js} +1 -2
  39. package/dist/{chunk-LW25LMIH.js.map → chunk-D3U7VQCG.js.map} +1 -1
  40. package/dist/{chunk-N5FSLVKO.js → chunk-DXU7NZPH.js} +3 -3
  41. package/dist/{chunk-XGJ2QERC.js → chunk-E3KXVEYI.js} +8 -4
  42. package/dist/chunk-E3KXVEYI.js.map +1 -0
  43. package/dist/{chunk-YAHRT6MB.js → chunk-EGZNOUMH.js} +3 -3
  44. package/dist/{chunk-DNBAMB5J.js → chunk-EVK6HH6Z.js} +1 -2
  45. package/dist/{chunk-DNBAMB5J.js.map → chunk-EVK6HH6Z.js.map} +1 -1
  46. package/dist/{chunk-HGCRXJGP.js → chunk-F5NWRF32.js} +3 -3
  47. package/dist/{chunk-GCFYZSVR.js → chunk-FRGTDZQT.js} +15 -10
  48. package/dist/chunk-FRGTDZQT.js.map +1 -0
  49. package/dist/{chunk-DYXEITK3.js → chunk-GF75O2EN.js} +4 -2
  50. package/dist/chunk-GF75O2EN.js.map +1 -0
  51. package/dist/{chunk-W7FLHT65.js → chunk-GTAS3QVC.js} +1 -2
  52. package/dist/{chunk-W7FLHT65.js.map → chunk-GTAS3QVC.js.map} +1 -1
  53. package/dist/{chunk-RQK5UPMP.js → chunk-H62XQZUM.js} +4 -3
  54. package/dist/chunk-H62XQZUM.js.map +1 -0
  55. package/dist/{chunk-UT2OPSN4.js → chunk-HCU3B6FW.js} +1 -2
  56. package/dist/chunk-HCU3B6FW.js.map +1 -0
  57. package/dist/chunk-HEDE2377.js +754 -0
  58. package/dist/chunk-HEDE2377.js.map +1 -0
  59. package/dist/{chunk-RNQN2FOU.js → chunk-HGIPWY5Y.js} +21 -10
  60. package/dist/chunk-HGIPWY5Y.js.map +1 -0
  61. package/dist/{chunk-Q2IAILVC.js → chunk-HSD24IP2.js} +8 -4
  62. package/dist/chunk-HSD24IP2.js.map +1 -0
  63. package/dist/{chunk-SWCDFEUK.js → chunk-HWQPEBID.js} +18 -14
  64. package/dist/chunk-HWQPEBID.js.map +1 -0
  65. package/dist/{chunk-SFUCUARB.js → chunk-IEHPTILN.js} +4 -4
  66. package/dist/chunk-IEHPTILN.js.map +1 -0
  67. package/dist/{chunk-M5FVUIYP.js → chunk-IEVLWEBO.js} +14 -13
  68. package/dist/chunk-IEVLWEBO.js.map +1 -0
  69. package/dist/{chunk-YUK3X3B4.js → chunk-IKJQOYI4.js} +1 -2
  70. package/dist/{chunk-YUK3X3B4.js.map → chunk-IKJQOYI4.js.map} +1 -1
  71. package/dist/{chunk-TA3WMOMU.js → chunk-IUXXZHY3.js} +16 -22
  72. package/dist/chunk-IUXXZHY3.js.map +1 -0
  73. package/dist/{chunk-EZQ5HBAC.js → chunk-JBDFYIN2.js} +12 -13
  74. package/dist/chunk-JBDFYIN2.js.map +1 -0
  75. package/dist/{chunk-JCC4CU2I.js → chunk-JEBH5APX.js} +14 -14
  76. package/dist/chunk-JEBH5APX.js.map +1 -0
  77. package/dist/{chunk-H3BST2LI.js → chunk-JHI2PHHD.js} +1 -2
  78. package/dist/{chunk-H3BST2LI.js.map → chunk-JHI2PHHD.js.map} +1 -1
  79. package/dist/{chunk-EGB7V74Z.js → chunk-KAWDDS27.js} +1 -3
  80. package/dist/chunk-KAWDDS27.js.map +1 -0
  81. package/dist/{chunk-DP2PP5V2.js → chunk-KGC2OGXI.js} +5 -4
  82. package/dist/chunk-KGC2OGXI.js.map +1 -0
  83. package/dist/{chunk-3WIO7NBR.js → chunk-L4GMDSMB.js} +3 -3
  84. package/dist/{chunk-47AVIIOT.js → chunk-L7FEZ7LU.js} +3 -3
  85. package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
  86. package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
  87. package/dist/{chunk-UGK4TAVK.js → chunk-LPLZLSMK.js} +1 -2
  88. package/dist/chunk-LPLZLSMK.js.map +1 -0
  89. package/dist/{chunk-EM4J5EQS.js → chunk-M6E7VK4D.js} +13 -13
  90. package/dist/chunk-M6E7VK4D.js.map +1 -0
  91. package/dist/{chunk-2CC5VW7K.js → chunk-MIQ3ECZM.js} +4 -2
  92. package/dist/chunk-MIQ3ECZM.js.map +1 -0
  93. package/dist/chunk-MRXTUFBZ.js +30 -0
  94. package/dist/chunk-MRXTUFBZ.js.map +1 -0
  95. package/dist/{chunk-RO5IQEDQ.js → chunk-NJ42VNXG.js} +1 -2
  96. package/dist/chunk-NJ42VNXG.js.map +1 -0
  97. package/dist/{chunk-AUHSTJJ3.js → chunk-NLXJMXVE.js} +3 -3
  98. package/dist/{chunk-E2ISWXLB.js → chunk-OQKNDS66.js} +1 -1
  99. package/dist/{chunk-E2ISWXLB.js.map → chunk-OQKNDS66.js.map} +1 -1
  100. package/dist/{chunk-IDYHQQOH.js → chunk-OSVZKYXS.js} +229 -378
  101. package/dist/chunk-OSVZKYXS.js.map +1 -0
  102. package/dist/{chunk-JAGJTM3Q.js → chunk-RHUEV4I7.js} +11 -12
  103. package/dist/chunk-RHUEV4I7.js.map +1 -0
  104. package/dist/{chunk-JALIYI6M.js → chunk-S4KVLPBR.js} +7 -2
  105. package/dist/chunk-S4KVLPBR.js.map +1 -0
  106. package/dist/{chunk-ZEGAMJO2.js → chunk-SAOQW6ZJ.js} +14 -14
  107. package/dist/chunk-SAOQW6ZJ.js.map +1 -0
  108. package/dist/{chunk-NOHWIBRX.js → chunk-SI4GMRXD.js} +13 -14
  109. package/dist/chunk-SI4GMRXD.js.map +1 -0
  110. package/dist/{chunk-X3G37FXT.js → chunk-SYMNWNC3.js} +3 -3
  111. package/dist/{chunk-DM4GSE26.js → chunk-TUNR4VUM.js} +3 -3
  112. package/dist/{chunk-XHCBHYN4.js → chunk-UAJYJP5C.js} +7 -2
  113. package/dist/chunk-UAJYJP5C.js.map +1 -0
  114. package/dist/{chunk-OPYQ5KIO.js → chunk-UYA3XL3J.js} +4 -2
  115. package/dist/chunk-UYA3XL3J.js.map +1 -0
  116. package/dist/{chunk-UINQOUZR.js → chunk-V7JVMG63.js} +3 -3
  117. package/dist/{chunk-LAJJPLEV.js → chunk-VBYIDRNU.js} +7 -3
  118. package/dist/chunk-VBYIDRNU.js.map +1 -0
  119. package/dist/{chunk-GS5AUKUO.js → chunk-VHED2STW.js} +10 -7
  120. package/dist/chunk-VHED2STW.js.map +1 -0
  121. package/dist/{chunk-JZT4QGIP.js → chunk-VIICUPWQ.js} +1 -2
  122. package/dist/{chunk-JZT4QGIP.js.map → chunk-VIICUPWQ.js.map} +1 -1
  123. package/dist/{chunk-QCZ2XUKH.js → chunk-VLRSOWHP.js} +16 -14
  124. package/dist/chunk-VLRSOWHP.js.map +1 -0
  125. package/dist/{chunk-XWVDS66D.js → chunk-W5ZLIQFR.js} +182 -381
  126. package/dist/chunk-W5ZLIQFR.js.map +1 -0
  127. package/dist/{chunk-YGZMVNN5.js → chunk-WTSSEUOZ.js} +7 -2
  128. package/dist/chunk-WTSSEUOZ.js.map +1 -0
  129. package/dist/{chunk-OHROA3FQ.js → chunk-WWP2STF5.js} +7 -2
  130. package/dist/chunk-WWP2STF5.js.map +1 -0
  131. package/dist/{chunk-IK2L4EN3.js → chunk-XADEMW6B.js} +3 -3
  132. package/dist/{chunk-FQ33BYFR.js → chunk-XEMLYWHK.js} +3 -3
  133. package/dist/{chunk-OZAEWZZ3.js → chunk-XFSEADPC.js} +6 -2
  134. package/dist/chunk-XFSEADPC.js.map +1 -0
  135. package/dist/{chunk-TWGVQLG2.js → chunk-XUUSWR4U.js} +1 -2
  136. package/dist/{chunk-TWGVQLG2.js.map → chunk-XUUSWR4U.js.map} +1 -1
  137. package/dist/{chunk-XLQI4IT2.js → chunk-YBVMZ7SR.js} +7 -2
  138. package/dist/chunk-YBVMZ7SR.js.map +1 -0
  139. package/dist/{chunk-A7IVFIOP.js → chunk-YRJICL2Q.js} +14 -14
  140. package/dist/chunk-YRJICL2Q.js.map +1 -0
  141. package/dist/{chunk-ZGSER5TG.js → chunk-ZM44MGC5.js} +3 -3
  142. package/dist/{chunk-G2WCEUQL.js → chunk-ZMREYTHA.js} +15 -14
  143. package/dist/chunk-ZMREYTHA.js.map +1 -0
  144. package/dist/{chunk-H3I2KZIY.js → chunk-ZPB3SLPK.js} +1 -2
  145. package/dist/{chunk-H3I2KZIY.js.map → chunk-ZPB3SLPK.js.map} +1 -1
  146. package/dist/chunk-ZPZQXHW2.js +1230 -0
  147. package/dist/chunk-ZPZQXHW2.js.map +1 -0
  148. package/dist/{config-34LHOGLM.js → config-2LASFFRD.js} +2 -4
  149. package/dist/config-3WDIJPTG.js +9 -0
  150. package/dist/config-4QV4QYI5.js +9 -0
  151. package/dist/{config-ZFJYQZCH.js → config-54USUVSE.js} +2 -4
  152. package/dist/config-5ZXN2T2H.js +9 -0
  153. package/dist/config-A2GQYJDB.js +9 -0
  154. package/dist/config-BBOLI7VE.js +9 -0
  155. package/dist/{config-VM526IKB.js → config-BIBFLUIR.js} +2 -4
  156. package/dist/{config-EO23EY62.js → config-CPYFOUQO.js} +2 -4
  157. package/dist/{config-3IVQJBNW.js → config-DWSJL3NH.js} +2 -4
  158. package/dist/config-E22XAGYN.js +9 -0
  159. package/dist/config-EHE52ZTK.js +9 -0
  160. package/dist/{config-GE4W4ZJC.js → config-EX3ZJTZI.js} +2 -4
  161. package/dist/{config-QNMKWJ4M.js → config-FRK7ZL37.js} +2 -4
  162. package/dist/{config-LHFFXVYI.js → config-HQXNFQZS.js} +2 -4
  163. package/dist/config-HTXOOAOD.js +9 -0
  164. package/dist/{config-HKRMKD76.js → config-IPNWAJHH.js} +2 -4
  165. package/dist/config-J2C53GOT.js +9 -0
  166. package/dist/config-K63RX6EU.js +9 -0
  167. package/dist/config-L7SBSH5L.js +9 -0
  168. package/dist/config-LEALEMKA.js +9 -0
  169. package/dist/{config-IVY5EQQ2.js → config-M3Z47VYU.js} +2 -4
  170. package/dist/{config-EIHSP5DZ.js → config-MZM3IPFM.js} +2 -4
  171. package/dist/{config-GHRUKEQ6.js → config-OJ2BPESH.js} +2 -4
  172. package/dist/{config-WDAZFXYD.js → config-QO2XUME4.js} +2 -4
  173. package/dist/config-QWQGOXQ5.js +9 -0
  174. package/dist/config-RI7IEZUF.js +9 -0
  175. package/dist/{config-CVZ2AGCO.js → config-SPW6NESU.js} +2 -6
  176. package/dist/{config-QAA646XB.js → config-T2IUIU5C.js} +2 -4
  177. package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
  178. package/dist/config-VKKZGC7V.js +9 -0
  179. package/dist/config-W7EVPJNK.js +11 -0
  180. package/dist/config-WKQ3FGTZ.js +9 -0
  181. package/dist/config-WVILHDFV.js +11 -0
  182. package/dist/{config-Q45Y46YT.js → config-XU6D5C7E.js} +2 -4
  183. package/dist/databricks_volume-ETRDJVVQ.js +7 -0
  184. package/dist/digitalocean-QP72DR4J.js +10 -0
  185. package/dist/discord-BSN5RB3E.js +8 -0
  186. package/dist/disk-24NWTN2I.js +7 -0
  187. package/dist/dropbox-OSTZXSIE.js +8 -0
  188. package/dist/email-4ZFPSWIN.js +8 -0
  189. package/dist/gcs-PFWR6MIW.js +10 -0
  190. package/dist/gdocs-GPAZRQG5.js +8 -0
  191. package/dist/gdrive-XSX6A7B3.js +8 -0
  192. package/dist/github-EQ4NXUTA.js +8 -0
  193. package/dist/github_ci-QL5B2Q2N.js +8 -0
  194. package/dist/gmail-2TBT4CVH.js +8 -0
  195. package/dist/gridfs-KZRZ6SIB.js +9 -0
  196. package/dist/gsheets-N53WEXN2.js +8 -0
  197. package/dist/gslides-TATSARTH.js +8 -0
  198. package/dist/hf_buckets-BK7NGJWS.js +10 -0
  199. package/dist/hf_datasets-UQ5QGM4L.js +10 -0
  200. package/dist/hf_models-75LFCQCS.js +10 -0
  201. package/dist/hf_spaces-6T2KB3UC.js +10 -0
  202. package/dist/index.d.ts +494 -40
  203. package/dist/index.js +1193 -388
  204. package/dist/index.js.map +1 -1
  205. package/dist/langfuse-AMQCQWNE.js +8 -0
  206. package/dist/linear-V3TXO6CV.js +8 -0
  207. package/dist/minio-IZRZY4C5.js +10 -0
  208. package/dist/mongodb-VMKPQCPX.js +7 -0
  209. package/dist/nextcloud-5RHQCGDO.js +9 -0
  210. package/dist/notion-6PPNTQFM.js +8 -0
  211. package/dist/oci-CKYBSFZJ.js +10 -0
  212. package/dist/postgres-WIQBVL5M.js +7 -0
  213. package/dist/qingstor-AP4IIPLY.js +10 -0
  214. package/dist/r2-C4XGEWQY.js +10 -0
  215. package/dist/redis-6D55Q2WB.js +8 -0
  216. package/dist/s3-XQBI2CXN.js +8 -0
  217. package/dist/scaleway-SEZJVURB.js +10 -0
  218. package/dist/seaweedfs-3XYIAFU2.js +10 -0
  219. package/dist/slack-ZHXDJQY4.js +8 -0
  220. package/dist/ssh-X2MO7JOV.js +8 -0
  221. package/dist/supabase-BBM44UTM.js +10 -0
  222. package/dist/supabase-BBM44UTM.js.map +1 -0
  223. package/dist/tencent-X72USLJ7.js +10 -0
  224. package/dist/tencent-X72USLJ7.js.map +1 -0
  225. package/dist/trello-EER5NG7L.js +8 -0
  226. package/dist/trello-EER5NG7L.js.map +1 -0
  227. package/dist/wasabi-O4MVIUFG.js +10 -0
  228. package/dist/wasabi-O4MVIUFG.js.map +1 -0
  229. package/package.json +4 -2
  230. package/dist/aliyun-JMJ3PFYY.js +0 -10
  231. package/dist/backblaze-TDFD23QO.js +0 -10
  232. package/dist/box-GQ2U2R6R.js +0 -8
  233. package/dist/ceph-S2VOYO6G.js +0 -10
  234. package/dist/chunk-2CC5VW7K.js.map +0 -1
  235. package/dist/chunk-A7IVFIOP.js.map +0 -1
  236. package/dist/chunk-B2ZOKNN4.js.map +0 -1
  237. package/dist/chunk-DP2PP5V2.js.map +0 -1
  238. package/dist/chunk-DYXEITK3.js.map +0 -1
  239. package/dist/chunk-EGB7V74Z.js.map +0 -1
  240. package/dist/chunk-EM4J5EQS.js.map +0 -1
  241. package/dist/chunk-EZQ5HBAC.js.map +0 -1
  242. package/dist/chunk-G2WCEUQL.js.map +0 -1
  243. package/dist/chunk-GCFYZSVR.js.map +0 -1
  244. package/dist/chunk-GS5AUKUO.js.map +0 -1
  245. package/dist/chunk-IDYHQQOH.js.map +0 -1
  246. package/dist/chunk-JAGJTM3Q.js.map +0 -1
  247. package/dist/chunk-JALIYI6M.js.map +0 -1
  248. package/dist/chunk-JCC4CU2I.js.map +0 -1
  249. package/dist/chunk-LAJJPLEV.js.map +0 -1
  250. package/dist/chunk-LV2G7VHL.js.map +0 -1
  251. package/dist/chunk-M5FVUIYP.js.map +0 -1
  252. package/dist/chunk-MPCCRRE6.js.map +0 -1
  253. package/dist/chunk-NJMGCT63.js.map +0 -1
  254. package/dist/chunk-NOHWIBRX.js.map +0 -1
  255. package/dist/chunk-OHROA3FQ.js.map +0 -1
  256. package/dist/chunk-OPYQ5KIO.js.map +0 -1
  257. package/dist/chunk-OZAEWZZ3.js.map +0 -1
  258. package/dist/chunk-Q2IAILVC.js.map +0 -1
  259. package/dist/chunk-QCZ2XUKH.js.map +0 -1
  260. package/dist/chunk-QGRDPSAH.js.map +0 -1
  261. package/dist/chunk-RNQN2FOU.js.map +0 -1
  262. package/dist/chunk-RO5IQEDQ.js.map +0 -1
  263. package/dist/chunk-RQK5UPMP.js.map +0 -1
  264. package/dist/chunk-S5OVP467.js.map +0 -1
  265. package/dist/chunk-SFUCUARB.js.map +0 -1
  266. package/dist/chunk-SWCDFEUK.js.map +0 -1
  267. package/dist/chunk-TA3WMOMU.js.map +0 -1
  268. package/dist/chunk-TURD42QO.js +0 -1782
  269. package/dist/chunk-TURD42QO.js.map +0 -1
  270. package/dist/chunk-U6QSXTUS.js +0 -7
  271. package/dist/chunk-U6QSXTUS.js.map +0 -1
  272. package/dist/chunk-UGK4TAVK.js.map +0 -1
  273. package/dist/chunk-UT2OPSN4.js.map +0 -1
  274. package/dist/chunk-VGLHY6BK.js.map +0 -1
  275. package/dist/chunk-VWKUT4CW.js.map +0 -1
  276. package/dist/chunk-WAR4Q2NM.js.map +0 -1
  277. package/dist/chunk-WHFUWWI6.js +0 -2097
  278. package/dist/chunk-WHFUWWI6.js.map +0 -1
  279. package/dist/chunk-XGJ2QERC.js.map +0 -1
  280. package/dist/chunk-XHCBHYN4.js.map +0 -1
  281. package/dist/chunk-XLQI4IT2.js.map +0 -1
  282. package/dist/chunk-XWVDS66D.js.map +0 -1
  283. package/dist/chunk-YGZMVNN5.js.map +0 -1
  284. package/dist/chunk-ZEGAMJO2.js.map +0 -1
  285. package/dist/chunk-ZNWVJ6UW.js.map +0 -1
  286. package/dist/config-3BBWD5AB.js +0 -11
  287. package/dist/config-4UDVSUQJ.js +0 -11
  288. package/dist/config-CMDBAPDH.js +0 -11
  289. package/dist/config-D3RLSPNF.js +0 -11
  290. package/dist/config-DG65OEG3.js +0 -11
  291. package/dist/config-GCQK6NJY.js +0 -11
  292. package/dist/config-GVH27UPE.js +0 -11
  293. package/dist/config-HXVYIXP5.js +0 -11
  294. package/dist/config-IDZMEW73.js +0 -11
  295. package/dist/config-IJJXGLBQ.js +0 -11
  296. package/dist/config-KJOLGVB2.js +0 -11
  297. package/dist/config-KMVCVBYN.js +0 -15
  298. package/dist/config-KYTRXAB2.js +0 -15
  299. package/dist/config-OT2TQQCN.js +0 -11
  300. package/dist/config-QWCY3LBQ.js +0 -11
  301. package/dist/config-ZV6G2ZEC.js +0 -11
  302. package/dist/databricks_volume-7XOUYSTY.js +0 -7
  303. package/dist/digitalocean-3CQ4CPPZ.js +0 -10
  304. package/dist/discord-BG7OSRJG.js +0 -8
  305. package/dist/disk-XVLBCVKE.js +0 -8
  306. package/dist/dropbox-74GYLV3R.js +0 -8
  307. package/dist/email-5IZ7OBQ4.js +0 -8
  308. package/dist/gcs-EMEYU2XT.js +0 -10
  309. package/dist/gdocs-R67TDPON.js +0 -8
  310. package/dist/gdrive-PRN2ALRK.js +0 -8
  311. package/dist/github-DV7E6OFV.js +0 -8
  312. package/dist/github_ci-Q554V5PA.js +0 -8
  313. package/dist/gmail-OLN2LT4O.js +0 -8
  314. package/dist/gsheets-H4RYMQJ5.js +0 -8
  315. package/dist/gslides-YLCHKJOM.js +0 -8
  316. package/dist/hf_buckets-DTKXKKFF.js +0 -10
  317. package/dist/hf_datasets-55C4APKR.js +0 -10
  318. package/dist/hf_models-RO5JR36V.js +0 -10
  319. package/dist/hf_spaces-ZVZ3EDRX.js +0 -10
  320. package/dist/langfuse-ACASJZ7O.js +0 -8
  321. package/dist/linear-IC37LZV7.js +0 -8
  322. package/dist/minio-HZ576XFQ.js +0 -10
  323. package/dist/mongodb-JVR62OIO.js +0 -7
  324. package/dist/notion-HKRPQMJS.js +0 -8
  325. package/dist/oci-ZLVECXTW.js +0 -10
  326. package/dist/postgres-P36Z2YN4.js +0 -7
  327. package/dist/qingstor-YLP6K3L4.js +0 -10
  328. package/dist/r2-RPK25ANI.js +0 -10
  329. package/dist/redis-V5ULXULL.js +0 -8
  330. package/dist/s3-4OIOCAAT.js +0 -8
  331. package/dist/scaleway-CCWCLUHB.js +0 -10
  332. package/dist/seaweedfs-QSWKF2FN.js +0 -10
  333. package/dist/slack-YPS7PII3.js +0 -8
  334. package/dist/ssh-YFP3SMTJ.js +0 -9
  335. package/dist/supabase-6CFTOKGZ.js +0 -10
  336. package/dist/tencent-IWZZOSQ4.js +0 -10
  337. package/dist/trello-XYKWZD6P.js +0 -8
  338. package/dist/wasabi-6Z4DC5S5.js +0 -10
  339. /package/dist/{aliyun-JMJ3PFYY.js.map → aliyun-PGI57A43.js.map} +0 -0
  340. /package/dist/{backblaze-TDFD23QO.js.map → backblaze-TSPL6Y56.js.map} +0 -0
  341. /package/dist/{box-GQ2U2R6R.js.map → box-7XTZYDSO.js.map} +0 -0
  342. /package/dist/{ceph-S2VOYO6G.js.map → ceph-C265UI5T.js.map} +0 -0
  343. /package/dist/{chunk-I5THIMPP.js.map → chunk-25W4XQJZ.js.map} +0 -0
  344. /package/dist/{chunk-HJJMP6IX.js.map → chunk-4M73WHIE.js.map} +0 -0
  345. /package/dist/{chunk-7CW3BMPH.js.map → chunk-4X6CLF4F.js.map} +0 -0
  346. /package/dist/{chunk-QQBJC2FQ.js.map → chunk-5I7Q7RHW.js.map} +0 -0
  347. /package/dist/{chunk-X5HF2OFP.js.map → chunk-BWWU5T2D.js.map} +0 -0
  348. /package/dist/{chunk-KPULTUOK.js.map → chunk-CXQGMFI7.js.map} +0 -0
  349. /package/dist/{chunk-N5FSLVKO.js.map → chunk-DXU7NZPH.js.map} +0 -0
  350. /package/dist/{chunk-YAHRT6MB.js.map → chunk-EGZNOUMH.js.map} +0 -0
  351. /package/dist/{chunk-HGCRXJGP.js.map → chunk-F5NWRF32.js.map} +0 -0
  352. /package/dist/{chunk-3WIO7NBR.js.map → chunk-L4GMDSMB.js.map} +0 -0
  353. /package/dist/{chunk-47AVIIOT.js.map → chunk-L7FEZ7LU.js.map} +0 -0
  354. /package/dist/{chunk-AUHSTJJ3.js.map → chunk-NLXJMXVE.js.map} +0 -0
  355. /package/dist/{chunk-X3G37FXT.js.map → chunk-SYMNWNC3.js.map} +0 -0
  356. /package/dist/{chunk-DM4GSE26.js.map → chunk-TUNR4VUM.js.map} +0 -0
  357. /package/dist/{chunk-UINQOUZR.js.map → chunk-V7JVMG63.js.map} +0 -0
  358. /package/dist/{chunk-IK2L4EN3.js.map → chunk-XADEMW6B.js.map} +0 -0
  359. /package/dist/{chunk-FQ33BYFR.js.map → chunk-XEMLYWHK.js.map} +0 -0
  360. /package/dist/{chunk-ZGSER5TG.js.map → chunk-ZM44MGC5.js.map} +0 -0
  361. /package/dist/{config-34LHOGLM.js.map → config-2LASFFRD.js.map} +0 -0
  362. /package/dist/{config-3BBWD5AB.js.map → config-3WDIJPTG.js.map} +0 -0
  363. /package/dist/{config-3IVQJBNW.js.map → config-4QV4QYI5.js.map} +0 -0
  364. /package/dist/{config-4UDVSUQJ.js.map → config-54USUVSE.js.map} +0 -0
  365. /package/dist/{config-CMDBAPDH.js.map → config-5ZXN2T2H.js.map} +0 -0
  366. /package/dist/{config-CVZ2AGCO.js.map → config-A2GQYJDB.js.map} +0 -0
  367. /package/dist/{config-D3RLSPNF.js.map → config-BBOLI7VE.js.map} +0 -0
  368. /package/dist/{config-DG65OEG3.js.map → config-BIBFLUIR.js.map} +0 -0
  369. /package/dist/{config-EIHSP5DZ.js.map → config-CPYFOUQO.js.map} +0 -0
  370. /package/dist/{config-EO23EY62.js.map → config-DWSJL3NH.js.map} +0 -0
  371. /package/dist/{config-GCQK6NJY.js.map → config-E22XAGYN.js.map} +0 -0
  372. /package/dist/{config-GE4W4ZJC.js.map → config-EHE52ZTK.js.map} +0 -0
  373. /package/dist/{config-GHRUKEQ6.js.map → config-EX3ZJTZI.js.map} +0 -0
  374. /package/dist/{config-GVH27UPE.js.map → config-FRK7ZL37.js.map} +0 -0
  375. /package/dist/{config-HKRMKD76.js.map → config-HQXNFQZS.js.map} +0 -0
  376. /package/dist/{config-HXVYIXP5.js.map → config-HTXOOAOD.js.map} +0 -0
  377. /package/dist/{config-IDZMEW73.js.map → config-IPNWAJHH.js.map} +0 -0
  378. /package/dist/{config-IJJXGLBQ.js.map → config-J2C53GOT.js.map} +0 -0
  379. /package/dist/{config-IVY5EQQ2.js.map → config-K63RX6EU.js.map} +0 -0
  380. /package/dist/{config-KJOLGVB2.js.map → config-L7SBSH5L.js.map} +0 -0
  381. /package/dist/{config-KMVCVBYN.js.map → config-LEALEMKA.js.map} +0 -0
  382. /package/dist/{config-KYTRXAB2.js.map → config-M3Z47VYU.js.map} +0 -0
  383. /package/dist/{config-LHFFXVYI.js.map → config-MZM3IPFM.js.map} +0 -0
  384. /package/dist/{config-NV5WXP64.js.map → config-OJ2BPESH.js.map} +0 -0
  385. /package/dist/{config-OT2TQQCN.js.map → config-QO2XUME4.js.map} +0 -0
  386. /package/dist/{config-Q45Y46YT.js.map → config-QWQGOXQ5.js.map} +0 -0
  387. /package/dist/{config-QAA646XB.js.map → config-RI7IEZUF.js.map} +0 -0
  388. /package/dist/{config-QNMKWJ4M.js.map → config-SPW6NESU.js.map} +0 -0
  389. /package/dist/{config-QWCY3LBQ.js.map → config-T2IUIU5C.js.map} +0 -0
  390. /package/dist/{config-VM526IKB.js.map → config-UU27ALAA.js.map} +0 -0
  391. /package/dist/{config-WDAZFXYD.js.map → config-VKKZGC7V.js.map} +0 -0
  392. /package/dist/{config-ZFJYQZCH.js.map → config-W7EVPJNK.js.map} +0 -0
  393. /package/dist/{config-ZV6G2ZEC.js.map → config-WKQ3FGTZ.js.map} +0 -0
  394. /package/dist/{databricks_volume-7XOUYSTY.js.map → config-WVILHDFV.js.map} +0 -0
  395. /package/dist/{digitalocean-3CQ4CPPZ.js.map → config-XU6D5C7E.js.map} +0 -0
  396. /package/dist/{discord-BG7OSRJG.js.map → databricks_volume-ETRDJVVQ.js.map} +0 -0
  397. /package/dist/{disk-XVLBCVKE.js.map → digitalocean-QP72DR4J.js.map} +0 -0
  398. /package/dist/{dropbox-74GYLV3R.js.map → discord-BSN5RB3E.js.map} +0 -0
  399. /package/dist/{email-5IZ7OBQ4.js.map → disk-24NWTN2I.js.map} +0 -0
  400. /package/dist/{gcs-EMEYU2XT.js.map → dropbox-OSTZXSIE.js.map} +0 -0
  401. /package/dist/{gdocs-R67TDPON.js.map → email-4ZFPSWIN.js.map} +0 -0
  402. /package/dist/{gdrive-PRN2ALRK.js.map → gcs-PFWR6MIW.js.map} +0 -0
  403. /package/dist/{github-DV7E6OFV.js.map → gdocs-GPAZRQG5.js.map} +0 -0
  404. /package/dist/{github_ci-Q554V5PA.js.map → gdrive-XSX6A7B3.js.map} +0 -0
  405. /package/dist/{gmail-OLN2LT4O.js.map → github-EQ4NXUTA.js.map} +0 -0
  406. /package/dist/{gsheets-H4RYMQJ5.js.map → github_ci-QL5B2Q2N.js.map} +0 -0
  407. /package/dist/{gslides-YLCHKJOM.js.map → gmail-2TBT4CVH.js.map} +0 -0
  408. /package/dist/{hf_buckets-DTKXKKFF.js.map → gridfs-KZRZ6SIB.js.map} +0 -0
  409. /package/dist/{hf_datasets-55C4APKR.js.map → gsheets-N53WEXN2.js.map} +0 -0
  410. /package/dist/{hf_models-RO5JR36V.js.map → gslides-TATSARTH.js.map} +0 -0
  411. /package/dist/{hf_spaces-ZVZ3EDRX.js.map → hf_buckets-BK7NGJWS.js.map} +0 -0
  412. /package/dist/{langfuse-ACASJZ7O.js.map → hf_datasets-UQ5QGM4L.js.map} +0 -0
  413. /package/dist/{linear-IC37LZV7.js.map → hf_models-75LFCQCS.js.map} +0 -0
  414. /package/dist/{minio-HZ576XFQ.js.map → hf_spaces-6T2KB3UC.js.map} +0 -0
  415. /package/dist/{mongodb-JVR62OIO.js.map → langfuse-AMQCQWNE.js.map} +0 -0
  416. /package/dist/{notion-HKRPQMJS.js.map → linear-V3TXO6CV.js.map} +0 -0
  417. /package/dist/{oci-ZLVECXTW.js.map → minio-IZRZY4C5.js.map} +0 -0
  418. /package/dist/{postgres-P36Z2YN4.js.map → mongodb-VMKPQCPX.js.map} +0 -0
  419. /package/dist/{qingstor-YLP6K3L4.js.map → nextcloud-5RHQCGDO.js.map} +0 -0
  420. /package/dist/{r2-RPK25ANI.js.map → notion-6PPNTQFM.js.map} +0 -0
  421. /package/dist/{redis-V5ULXULL.js.map → oci-CKYBSFZJ.js.map} +0 -0
  422. /package/dist/{s3-4OIOCAAT.js.map → postgres-WIQBVL5M.js.map} +0 -0
  423. /package/dist/{scaleway-CCWCLUHB.js.map → qingstor-AP4IIPLY.js.map} +0 -0
  424. /package/dist/{seaweedfs-QSWKF2FN.js.map → r2-C4XGEWQY.js.map} +0 -0
  425. /package/dist/{slack-YPS7PII3.js.map → redis-6D55Q2WB.js.map} +0 -0
  426. /package/dist/{ssh-YFP3SMTJ.js.map → s3-XQBI2CXN.js.map} +0 -0
  427. /package/dist/{supabase-6CFTOKGZ.js.map → scaleway-SEZJVURB.js.map} +0 -0
  428. /package/dist/{tencent-IWZZOSQ4.js.map → seaweedfs-3XYIAFU2.js.map} +0 -0
  429. /package/dist/{trello-XYKWZD6P.js.map → slack-ZHXDJQY4.js.map} +0 -0
  430. /package/dist/{wasabi-6Z4DC5S5.js.map → ssh-X2MO7JOV.js.map} +0 -0
@@ -1,1782 +0,0 @@
1
- import {
2
- loadOptionalPeer
3
- } from "./chunk-E2ISWXLB.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/awk.ts
94
- import { awkGeneric, command, specOf } from "@struktoai/mirage-core";
95
-
96
- // src/core/hf/stream.ts
97
- import { recordStream } from "@struktoai/mirage-core";
98
-
99
- // src/core/hf/constants.ts
100
- var SCOPE_ERROR = 1e4;
101
- var DEFAULT_CHUNK_SIZE = 8192;
102
-
103
- // src/core/hf/read.ts
104
- import { record } from "@struktoai/mirage-core";
105
-
106
- // src/core/hf/util.ts
107
- function rawPathOf(path) {
108
- const prefix = path.prefix;
109
- return prefix !== "" && path.original.startsWith(prefix) ? path.original.slice(prefix.length) || "/" : path.original;
110
- }
111
- function hfKey(rawPath) {
112
- let start = 0;
113
- while (start < rawPath.length && rawPath[start] === "/") start += 1;
114
- return rawPath.slice(start);
115
- }
116
- function isNotFound(err) {
117
- return err instanceof Error && err.message.startsWith("NotFound");
118
- }
119
-
120
- // src/core/hf/read.ts
121
- import { enoent } from "@struktoai/mirage-core";
122
- async function read(accessor, path, _index, options = {}) {
123
- const virtual = path.original;
124
- const rawPath = rawPathOf(path);
125
- const key = hfKey(rawPath);
126
- const op = await accessor.operator();
127
- const readOptions = {};
128
- if (options.offset !== void 0 && options.offset > 0) {
129
- readOptions.offset = BigInt(options.offset);
130
- }
131
- if (options.size !== void 0) {
132
- readOptions.offset ??= 0n;
133
- readOptions.size = BigInt(options.size);
134
- }
135
- const startMs = performance.now();
136
- let data;
137
- try {
138
- data = readOptions.offset !== void 0 || readOptions.size !== void 0 ? await op.read(key, readOptions) : await op.read(key);
139
- } catch (err) {
140
- if (isNotFound(err)) throw enoent(path);
141
- throw err;
142
- }
143
- const bytes = new Uint8Array(data);
144
- record("read", virtual, accessor.resourceName, bytes.byteLength, startMs);
145
- return bytes;
146
- }
147
-
148
- // src/core/hf/stream.ts
149
- import { enoent as enoent2 } from "@struktoai/mirage-core";
150
- async function rangeRead(accessor, path, start, end) {
151
- return read(accessor, path, void 0, { offset: start, size: end - start });
152
- }
153
- async function* stream(accessor, path, _index, chunkSize = DEFAULT_CHUNK_SIZE) {
154
- const virtual = path.original;
155
- const rawPath = rawPathOf(path);
156
- const key = hfKey(rawPath);
157
- const op = await accessor.operator();
158
- const rec = recordStream("read", virtual, accessor.resourceName);
159
- let reader;
160
- try {
161
- reader = await op.reader(key);
162
- } catch (err) {
163
- if (isNotFound(err)) throw enoent2(path);
164
- throw err;
165
- }
166
- const buf = Buffer.alloc(chunkSize);
167
- for (; ; ) {
168
- const n = Number(await reader.read(buf));
169
- if (n <= 0) break;
170
- const chunk = new Uint8Array(buf.subarray(0, n));
171
- if (rec !== null) rec.bytes += chunk.byteLength;
172
- yield chunk;
173
- }
174
- }
175
-
176
- // src/commands/builtin/hf/awk.ts
177
- var HF_AWK = command({
178
- name: "awk",
179
- resource: [...HF_RESOURCES],
180
- spec: specOf("awk"),
181
- fn: (accessor, paths, texts, opts) => awkGeneric(paths, texts, opts, (p) => stream(accessor, p))
182
- });
183
-
184
- // src/commands/builtin/hf/base64_cmd.ts
185
- import { command as command2, specOf as specOf2, base64Generic } from "@struktoai/mirage-core";
186
- var HF_BASE64 = command2({
187
- name: "base64",
188
- resource: [...HF_RESOURCES],
189
- spec: specOf2("base64"),
190
- fn: (accessor, paths, _texts, opts) => base64Generic(paths, opts, (p) => stream(accessor, p))
191
- });
192
-
193
- // src/commands/builtin/hf/basename.ts
194
- import { command as command3, specOf as specOf3, basenameFn } from "@struktoai/mirage-core";
195
- var HF_BASENAME = command3({
196
- name: "basename",
197
- resource: [...HF_RESOURCES],
198
- spec: specOf3("basename"),
199
- fn: basenameFn
200
- });
201
-
202
- // src/commands/builtin/hf/cat/cat.ts
203
- import {
204
- catGeneric,
205
- command as command4,
206
- concatAggregate,
207
- specOf as specOf4
208
- } from "@struktoai/mirage-core";
209
-
210
- // src/core/hf/glob.ts
211
- import { fnmatch, PathSpec } from "@struktoai/mirage-core";
212
-
213
- // src/core/hf/readdir.ts
214
- import {
215
- IndexEntry,
216
- ResourceType,
217
- rstripSlash,
218
- stripSlash
219
- } from "@struktoai/mirage-core";
220
- import { enoent as enoent3 } from "@struktoai/mirage-core";
221
- async function readdir(accessor, path, index) {
222
- const prefix = path.prefix;
223
- let target = path.pattern !== null ? path.directory : path.original;
224
- if (prefix !== "" && target.startsWith(prefix)) {
225
- const rest = target.slice(prefix.length);
226
- if (prefix.endsWith("/") || rest === "" || rest.startsWith("/")) {
227
- target = rest || "/";
228
- }
229
- }
230
- const virtualKey = rstripSlash(prefix !== "" ? `${prefix}${target}` : target) || "/";
231
- if (index !== void 0) {
232
- const listing = await index.listDir(virtualKey);
233
- if (listing.entries !== void 0 && listing.entries !== null) {
234
- return listing.entries;
235
- }
236
- }
237
- const strippedTarget = stripSlash(target);
238
- const listPath = strippedTarget !== "" ? `${strippedTarget}/` : "/";
239
- const op = await accessor.operator();
240
- const names = [];
241
- const dirKeys = /* @__PURE__ */ new Set();
242
- const sizes = /* @__PURE__ */ new Map();
243
- let entries;
244
- try {
245
- entries = await op.list(listPath);
246
- } catch (err) {
247
- if (isNotFound(err)) throw enoent3(path);
248
- throw err;
249
- }
250
- for (const entry of entries) {
251
- const relative = entry.path();
252
- if (relative === "" || relative === listPath) continue;
253
- const isDir = relative.endsWith("/");
254
- const base = `/${rstripSlash(relative)}`;
255
- names.push(base);
256
- if (isDir) {
257
- dirKeys.add(base);
258
- } else {
259
- const meta = entry.metadata();
260
- const length = meta.contentLength;
261
- sizes.set(base, length !== null ? Number(length) : null);
262
- }
263
- }
264
- names.sort();
265
- if (names.length > SCOPE_ERROR) {
266
- console.warn(
267
- `hf readdir: ${virtualKey} returned ${String(names.length)} entries (limit ${String(SCOPE_ERROR)})`
268
- );
269
- }
270
- const virtualEntries = names.map((e) => prefix !== "" ? `${prefix}${e}` : e).sort();
271
- if (index !== void 0) {
272
- const indexEntries = names.map((e) => {
273
- const name = e.split("/").pop() ?? e;
274
- if (dirKeys.has(e)) {
275
- return [name, new IndexEntry({ id: e, name, resourceType: ResourceType.FOLDER })];
276
- }
277
- return [
278
- name,
279
- new IndexEntry({
280
- id: e,
281
- name,
282
- resourceType: ResourceType.FILE,
283
- size: sizes.get(e) ?? null
284
- })
285
- ];
286
- });
287
- await index.setDir(virtualKey, indexEntries);
288
- }
289
- return virtualEntries;
290
- }
291
-
292
- // src/core/hf/glob.ts
293
- async function resolveGlob(accessor, paths, index) {
294
- const result = [];
295
- for (const p of paths) {
296
- if (p.resolved) {
297
- result.push(p);
298
- continue;
299
- }
300
- if (p.pattern !== null && p.pattern !== "") {
301
- const entries = await readdir(accessor, p.dir, index);
302
- const matched = [];
303
- for (const entry of entries) {
304
- const entryBase = entry.split("/").pop() ?? "";
305
- if (!fnmatch(entryBase, p.pattern)) continue;
306
- matched.push(PathSpec.fromStrPath(entry, p.prefix));
307
- }
308
- if (matched.length > SCOPE_ERROR) {
309
- console.warn(
310
- `${p.directory}: ${String(matched.length)} matches exceeds limit (${String(SCOPE_ERROR)}), truncating`
311
- );
312
- }
313
- const truncated = matched.length > SCOPE_ERROR ? matched.slice(0, SCOPE_ERROR) : matched;
314
- result.push(...truncated);
315
- } else {
316
- result.push(p);
317
- }
318
- }
319
- return result;
320
- }
321
-
322
- // src/core/hf/stat.ts
323
- import {
324
- FileStat,
325
- FileType,
326
- guessType,
327
- stripSlash as stripSlash2
328
- } from "@struktoai/mirage-core";
329
- import { enoent as enoent4 } from "@struktoai/mirage-core";
330
- async function stat(accessor, path, index) {
331
- const prefix = path.prefix;
332
- const rawPath = rawPathOf(path);
333
- const stripped = stripSlash2(rawPath);
334
- if (stripped === "") {
335
- return new FileStat({ name: "/", type: FileType.DIRECTORY });
336
- }
337
- if (index !== void 0) {
338
- const virtualKey = prefix !== "" ? `${prefix}/${stripped}` : `/${stripped}`;
339
- const lookup = await index.get(virtualKey);
340
- if (lookup.entry !== void 0 && lookup.entry !== null) {
341
- const entry = lookup.entry;
342
- if (entry.resourceType === "folder") {
343
- return new FileStat({ name: entry.name, type: FileType.DIRECTORY });
344
- }
345
- return new FileStat({
346
- name: entry.name,
347
- size: entry.size ?? null,
348
- type: guessType(entry.name)
349
- });
350
- }
351
- const parent = virtualKey.slice(0, virtualKey.lastIndexOf("/")) || "/";
352
- const parentListing = await index.listDir(parent);
353
- if (parentListing.entries !== void 0 && parentListing.entries !== null) {
354
- throw enoent4(path);
355
- }
356
- }
357
- const op = await accessor.operator();
358
- let md = null;
359
- try {
360
- md = await op.stat(stripped);
361
- } catch (err) {
362
- if (!isNotFound(err)) throw err;
363
- }
364
- if (md !== null && !md.isDirectory()) {
365
- const etag = md.etag;
366
- return new FileStat({
367
- name: stripped.split("/").pop() ?? stripped,
368
- size: md.contentLength !== null ? Number(md.contentLength) : null,
369
- modified: md.lastModified,
370
- type: guessType(rawPath),
371
- fingerprint: etag,
372
- extra: etag !== null && etag !== "" ? { etag } : {}
373
- });
374
- }
375
- try {
376
- const mdDir = await op.stat(`${stripped}/`);
377
- if (mdDir.isDirectory()) {
378
- return new FileStat({
379
- name: stripped.split("/").pop() ?? "/",
380
- type: FileType.DIRECTORY
381
- });
382
- }
383
- } catch (err) {
384
- if (!isNotFound(err)) throw err;
385
- }
386
- throw enoent4(path);
387
- }
388
-
389
- // src/commands/builtin/hf/provision.ts
390
- import {
391
- Precision,
392
- ProvisionResult
393
- } from "@struktoai/mirage-core";
394
- async function resolveSizes(accessor, paths, index) {
395
- const resolved = [];
396
- let missing = 0;
397
- for (const p of paths) {
398
- const pathStr = p.original;
399
- let size = null;
400
- if (index !== void 0) {
401
- const lookup = await index.get(pathStr);
402
- if (lookup.entry !== void 0 && lookup.entry !== null) {
403
- size = lookup.entry.size;
404
- }
405
- }
406
- if (size === null) {
407
- try {
408
- const fileStat = await stat(accessor, p, index);
409
- size = fileStat.size;
410
- } catch {
411
- }
412
- }
413
- if (size !== null) {
414
- resolved.push([pathStr, size]);
415
- } else {
416
- missing += 1;
417
- }
418
- }
419
- return { resolved, missing };
420
- }
421
- async function fileReadProvision(accessor, paths, _texts, opts) {
422
- if (paths.length === 0) {
423
- return new ProvisionResult({ precision: Precision.UNKNOWN });
424
- }
425
- const index = opts.index ?? void 0;
426
- const { resolved, missing } = await resolveSizes(accessor, paths, index);
427
- if (missing > 0 || resolved.length === 0) {
428
- return new ProvisionResult({ precision: Precision.UNKNOWN });
429
- }
430
- const total = resolved.reduce((sum, [, size]) => sum + size, 0);
431
- return new ProvisionResult({
432
- networkReadLow: total,
433
- networkReadHigh: total,
434
- readOps: resolved.length,
435
- precision: Precision.EXACT
436
- });
437
- }
438
- function parseNumFlag(value) {
439
- if (typeof value !== "string") return null;
440
- const n = Number.parseInt(value, 10);
441
- return Number.isFinite(n) ? n : null;
442
- }
443
- async function headTailProvision(accessor, paths, _texts, opts) {
444
- if (paths.length === 0) {
445
- return new ProvisionResult({ precision: Precision.UNKNOWN });
446
- }
447
- const index = opts.index ?? void 0;
448
- const { resolved, missing } = await resolveSizes(accessor, paths, index);
449
- if (missing > 0 || resolved.length === 0) {
450
- return new ProvisionResult({ precision: Precision.UNKNOWN });
451
- }
452
- const c = parseNumFlag(opts.flags.c);
453
- if (c !== null) {
454
- const total = resolved.reduce((sum, [, size]) => sum + Math.min(c, size), 0);
455
- return new ProvisionResult({
456
- networkReadLow: total,
457
- networkReadHigh: total,
458
- readOps: resolved.length,
459
- precision: Precision.EXACT
460
- });
461
- }
462
- const full = resolved.reduce((sum, [, size]) => sum + size, 0);
463
- return new ProvisionResult({
464
- networkReadLow: 0,
465
- networkReadHigh: full,
466
- readOps: resolved.length,
467
- precision: Precision.RANGE
468
- });
469
- }
470
- function metadataProvision(_accessor, paths, _texts, _opts) {
471
- const n = Math.max(1, paths.length > 0 ? paths.length : 1);
472
- return new ProvisionResult({
473
- networkReadLow: 0,
474
- networkReadHigh: 0,
475
- readOps: n,
476
- precision: Precision.EXACT
477
- });
478
- }
479
-
480
- // src/commands/builtin/hf/cat/cat.ts
481
- async function catCommand(accessor, paths, texts, opts) {
482
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
483
- return catGeneric(
484
- resolved,
485
- texts,
486
- opts,
487
- (p) => stat(accessor, p, opts.index ?? void 0),
488
- (p) => stream(accessor, p)
489
- );
490
- }
491
- var HF_CAT = command4({
492
- name: "cat",
493
- resource: [...HF_RESOURCES],
494
- spec: specOf4("cat"),
495
- fn: catCommand,
496
- provision: fileReadProvision,
497
- aggregate: concatAggregate
498
- });
499
-
500
- // src/commands/builtin/hf/cmp.ts
501
- import { command as command5, specOf as specOf5, cmpGeneric } from "@struktoai/mirage-core";
502
- var HF_CMP = command5({
503
- name: "cmp",
504
- resource: [...HF_RESOURCES],
505
- spec: specOf5("cmp"),
506
- fn: (accessor, paths, _texts, opts) => cmpGeneric(paths, opts, (p) => stream(accessor, p))
507
- });
508
-
509
- // src/commands/builtin/hf/column.ts
510
- import { command as command6, specOf as specOf6, columnGeneric } from "@struktoai/mirage-core";
511
- var HF_COLUMN = command6({
512
- name: "column",
513
- resource: [...HF_RESOURCES],
514
- spec: specOf6("column"),
515
- fn: (accessor, paths, _texts, opts) => columnGeneric(paths, opts, (p) => stream(accessor, p))
516
- });
517
-
518
- // src/commands/builtin/hf/comm.ts
519
- import { command as command7, specOf as specOf7, commGeneric } from "@struktoai/mirage-core";
520
- var HF_COMM = command7({
521
- name: "comm",
522
- resource: [...HF_RESOURCES],
523
- spec: specOf7("comm"),
524
- fn: (accessor, paths, _texts, opts) => commGeneric(paths, opts, (p) => stream(accessor, p))
525
- });
526
-
527
- // src/commands/builtin/hf/csplit.ts
528
- import { command as command8, specOf as specOf8, csplitGeneric } from "@struktoai/mirage-core";
529
-
530
- // src/core/hf/write.ts
531
- import { invalidateAfterWrite } from "@struktoai/mirage-core";
532
- import { record as record2 } from "@struktoai/mirage-core";
533
- import { enoent as enoent5 } from "@struktoai/mirage-core";
534
- async function write(accessor, path, data, _index) {
535
- const rawPath = rawPathOf(path);
536
- const key = hfKey(rawPath);
537
- const op = await accessor.operator();
538
- const startMs = performance.now();
539
- try {
540
- await op.write(key, Buffer.from(data));
541
- } catch (err) {
542
- if (isNotFound(err)) throw enoent5(path);
543
- throw err;
544
- }
545
- record2("write", path.original, accessor.resourceName, data.byteLength, startMs);
546
- await invalidateAfterWrite(path);
547
- }
548
-
549
- // src/commands/builtin/hf/csplit.ts
550
- var HF_CSPLIT = command8({
551
- name: "csplit",
552
- resource: [...HF_RESOURCES],
553
- spec: specOf8("csplit"),
554
- fn: (accessor, paths, texts, opts) => csplitGeneric(
555
- paths,
556
- texts,
557
- opts,
558
- (p) => stream(accessor, p),
559
- (p, d) => write(accessor, p, d)
560
- ),
561
- write: true
562
- });
563
-
564
- // src/commands/builtin/hf/cut.ts
565
- import { command as command9, cutGeneric, specOf as specOf9 } from "@struktoai/mirage-core";
566
- var HF_CUT = command9({
567
- name: "cut",
568
- resource: [...HF_RESOURCES],
569
- spec: specOf9("cut"),
570
- fn: (accessor, paths, _texts, opts) => cutGeneric(paths, opts, (p) => stream(accessor, p))
571
- });
572
-
573
- // src/commands/builtin/hf/diff.ts
574
- import { command as command10, diffGeneric, specOf as specOf10 } from "@struktoai/mirage-core";
575
- var HF_DIFF = command10({
576
- name: "diff",
577
- resource: [...HF_RESOURCES],
578
- spec: specOf10("diff"),
579
- fn: (accessor, paths, _texts, opts) => diffGeneric(
580
- paths,
581
- opts,
582
- (p) => stream(accessor, p),
583
- (p) => readdir(accessor, p, opts.index ?? void 0),
584
- (p) => stat(accessor, p, opts.index ?? void 0)
585
- )
586
- });
587
-
588
- // src/commands/builtin/hf/dirname.ts
589
- import { command as command11, specOf as specOf11, dirnameFn } from "@struktoai/mirage-core";
590
- var HF_DIRNAME = command11({
591
- name: "dirname",
592
- resource: [...HF_RESOURCES],
593
- spec: specOf11("dirname"),
594
- fn: dirnameFn
595
- });
596
-
597
- // src/commands/builtin/hf/du.ts
598
- import {
599
- command as command12,
600
- duGeneric,
601
- specOf as specOf12
602
- } from "@struktoai/mirage-core";
603
-
604
- // src/core/hf/du.ts
605
- import { stripSlash as stripSlash3 } from "@struktoai/mirage-core";
606
- async function du(accessor, path) {
607
- const target = rawPathOf(path);
608
- const pfx = stripSlash3(target);
609
- const scanPath = pfx !== "" ? `${pfx}/` : "/";
610
- const op = await accessor.operator();
611
- let total = 0;
612
- try {
613
- for (const entry of await op.list(scanPath, { recursive: true })) {
614
- if (entry.path().endsWith("/")) continue;
615
- const length = entry.metadata().contentLength;
616
- total += length !== null ? Number(length) : 0;
617
- }
618
- } catch (err) {
619
- if (isNotFound(err)) return 0;
620
- throw err;
621
- }
622
- return total;
623
- }
624
- async function duAll(accessor, path) {
625
- const target = rawPathOf(path);
626
- const pfx = stripSlash3(target);
627
- const scanPath = pfx !== "" ? `${pfx}/` : "/";
628
- const op = await accessor.operator();
629
- const results = [];
630
- let total = 0;
631
- try {
632
- for (const entry of await op.list(scanPath, { recursive: true })) {
633
- const rel = entry.path();
634
- if (rel === "" || rel.endsWith("/")) continue;
635
- const length = entry.metadata().contentLength;
636
- const size = length !== null ? Number(length) : 0;
637
- results.push([`/${lstrip(rel)}`, size]);
638
- total += size;
639
- }
640
- } catch (err) {
641
- if (!isNotFound(err)) throw err;
642
- }
643
- results.sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0);
644
- return [results, total];
645
- }
646
- function lstrip(value) {
647
- let start = 0;
648
- while (start < value.length && value[start] === "/") start += 1;
649
- return value.slice(start);
650
- }
651
-
652
- // src/commands/builtin/hf/du.ts
653
- async function duCommand(accessor, paths, _texts, opts) {
654
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
655
- return duGeneric(
656
- resolved,
657
- opts,
658
- (p) => du(accessor, p),
659
- (p) => duAll(accessor, p)
660
- );
661
- }
662
- var HF_DU = command12({
663
- name: "du",
664
- resource: [...HF_RESOURCES],
665
- spec: specOf12("du"),
666
- fn: duCommand
667
- });
668
-
669
- // src/commands/builtin/hf/expand.ts
670
- import { command as command13, specOf as specOf13, expandGeneric } from "@struktoai/mirage-core";
671
- var HF_EXPAND = command13({
672
- name: "expand",
673
- resource: [...HF_RESOURCES],
674
- spec: specOf13("expand"),
675
- fn: (accessor, paths, _texts, opts) => expandGeneric(paths, opts, (p) => stream(accessor, p))
676
- });
677
-
678
- // src/commands/builtin/hf/file/file.ts
679
- import {
680
- command as command14,
681
- fileGeneric,
682
- specOf as specOf14
683
- } from "@struktoai/mirage-core";
684
- async function fileCommand(accessor, paths, _texts, opts) {
685
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
686
- return fileGeneric(
687
- resolved,
688
- opts,
689
- (p) => stat(accessor, p, opts.index ?? void 0),
690
- (p) => read(accessor, p, opts.index ?? void 0)
691
- );
692
- }
693
- var HF_FILE = command14({
694
- name: "file",
695
- resource: [...HF_RESOURCES],
696
- spec: specOf14("file"),
697
- fn: fileCommand
698
- });
699
-
700
- // src/commands/builtin/hf/find.ts
701
- import { command as command15, findGeneric, specOf as specOf15 } from "@struktoai/mirage-core";
702
-
703
- // src/core/hf/find.ts
704
- import {
705
- buildTree,
706
- emitStartPath,
707
- keep,
708
- rstripSlash as rstripSlash2,
709
- startBasename,
710
- stripSlash as stripSlash4
711
- } from "@struktoai/mirage-core";
712
- function matchesFilters(entryPath, kind, meta, baseDepth, options, tree) {
713
- const entryName = entryPath.split("/").pop() ?? "";
714
- const depth = (entryPath.match(/\//g) ?? []).length - baseDepth;
715
- if (options.maxDepth !== null && options.maxDepth !== void 0 && depth > options.maxDepth) {
716
- return false;
717
- }
718
- if (!keep({ key: entryPath, name: entryName, kind, depth }, tree, options.minDepth)) {
719
- return false;
720
- }
721
- if (kind === "f" && (options.minSize !== null || options.maxSize !== null)) {
722
- if (options.minSize !== null && options.minSize !== void 0 && meta.size < options.minSize) {
723
- return false;
724
- }
725
- if (options.maxSize !== null && options.maxSize !== void 0 && meta.size > options.maxSize) {
726
- return false;
727
- }
728
- }
729
- if (options.mtimeMin !== null && options.mtimeMin !== void 0 || options.mtimeMax !== null && options.mtimeMax !== void 0) {
730
- if (meta.mtime === null) return false;
731
- if (options.mtimeMin !== null && options.mtimeMin !== void 0 && meta.mtime < options.mtimeMin) {
732
- return false;
733
- }
734
- if (options.mtimeMax !== null && options.mtimeMax !== void 0 && meta.mtime > options.mtimeMax) {
735
- return false;
736
- }
737
- }
738
- return true;
739
- }
740
- async function find(accessor, path, options = {}) {
741
- const target = rawPathOf(path);
742
- const pfx = stripSlash4(target);
743
- const scanPath = pfx !== "" ? `${pfx}/` : "/";
744
- const base = pfx !== "" ? `/${pfx}` : "/";
745
- const baseDepth = base === "/" ? 0 : (base.match(/\//g) ?? []).length;
746
- const startName = startBasename(path.original);
747
- const op = await accessor.operator();
748
- const results = [];
749
- const seenDirs = /* @__PURE__ */ new Set();
750
- let sawDescendant = false;
751
- let dirExists = false;
752
- const tree = options.tree ?? buildTree({
753
- name: options.name,
754
- iname: options.iname,
755
- pathPattern: options.pathPattern,
756
- type: options.type,
757
- nameExclude: options.nameExclude,
758
- orNames: options.orNames
759
- });
760
- let entries;
761
- try {
762
- entries = await op.list(scanPath, { recursive: true });
763
- } catch (err) {
764
- if (isNotFound(err)) return [];
765
- throw err;
766
- }
767
- for (const entry of entries) {
768
- const rel = entry.path();
769
- if (rel === "") continue;
770
- const meta = entry.metadata();
771
- const isDir = rel.endsWith("/") || meta.isDirectory();
772
- const entryPath = `/${stripSlash4(rel)}`;
773
- if (entryPath === base) {
774
- dirExists = true;
775
- continue;
776
- }
777
- sawDescendant = true;
778
- const kind = isDir ? "d" : "f";
779
- const length = meta.contentLength;
780
- const lm = meta.lastModified;
781
- const candidateMeta = {
782
- size: length !== null ? Number(length) : 0,
783
- mtime: lm !== null ? Date.parse(lm) / 1e3 : null
784
- };
785
- const fileEntries = [[entryPath, kind]];
786
- if (!isDir) {
787
- let parent = rstripSlash2(entryPath.slice(0, entryPath.lastIndexOf("/"))) || "/";
788
- while (parent !== "" && parent !== base && parent !== "/") {
789
- if (!seenDirs.has(parent)) {
790
- seenDirs.add(parent);
791
- fileEntries.push([parent, "d"]);
792
- }
793
- parent = parent.slice(0, parent.lastIndexOf("/")) || "/";
794
- }
795
- }
796
- for (const [ep, k] of fileEntries) {
797
- if (matchesFilters(ep, k, candidateMeta, baseDepth, options, tree)) {
798
- results.push(ep);
799
- }
800
- }
801
- }
802
- if (sawDescendant || dirExists) {
803
- emitStartPath(results, base, startName, {
804
- kind: "d",
805
- isEmpty: null,
806
- exists: true,
807
- tree,
808
- maxDepth: options.maxDepth,
809
- minDepth: options.minDepth
810
- });
811
- }
812
- return [...new Set(results)].sort();
813
- }
814
-
815
- // src/commands/builtin/hf/find.ts
816
- var HF_FIND = command15({
817
- name: "find",
818
- resource: [...HF_RESOURCES],
819
- spec: specOf15("find"),
820
- provision: metadataProvision,
821
- fn: (accessor, paths, texts, opts) => findGeneric(paths, texts, opts, (root, options) => find(accessor, root, options))
822
- });
823
-
824
- // src/commands/builtin/hf/fmt.ts
825
- import {
826
- command as command16,
827
- fmtGeneric,
828
- specOf as specOf16
829
- } from "@struktoai/mirage-core";
830
- async function fmtCommand(accessor, paths, _texts, opts) {
831
- return fmtGeneric(paths, opts, (p) => stream(accessor, p));
832
- }
833
- var HF_FMT = command16({
834
- name: "fmt",
835
- resource: [...HF_RESOURCES],
836
- spec: specOf16("fmt"),
837
- fn: fmtCommand
838
- });
839
-
840
- // src/commands/builtin/hf/fold.ts
841
- import { command as command17, specOf as specOf17, foldGeneric } from "@struktoai/mirage-core";
842
- var HF_FOLD = command17({
843
- name: "fold",
844
- resource: [...HF_RESOURCES],
845
- spec: specOf17("fold"),
846
- fn: (accessor, paths, _texts, opts) => foldGeneric(paths, opts, (p) => stream(accessor, p))
847
- });
848
-
849
- // src/commands/builtin/hf/grep/grep.ts
850
- import {
851
- command as command18,
852
- grepGeneric,
853
- prefixAggregate,
854
- specOf as specOf18
855
- } from "@struktoai/mirage-core";
856
- async function grepFn(accessor, paths, texts, opts) {
857
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths) : [];
858
- const stat2 = (p) => stat(accessor, p);
859
- const readdir2 = (p) => readdir(accessor, p);
860
- return grepGeneric("grep", resolved, texts, opts, stat2, readdir2, (p) => stream(accessor, p));
861
- }
862
- var HF_GREP = command18({
863
- name: "grep",
864
- resource: [...HF_RESOURCES],
865
- spec: specOf18("grep"),
866
- fn: grepFn,
867
- provision: fileReadProvision,
868
- aggregate: prefixAggregate
869
- });
870
-
871
- // src/commands/builtin/hf/gunzip.ts
872
- import { command as command19, specOf as specOf19, gunzipGeneric } from "@struktoai/mirage-core";
873
-
874
- // src/core/hf/unlink.ts
875
- import { invalidateAfterUnlink } from "@struktoai/mirage-core";
876
- import { FileType as FileType2, record as record3 } from "@struktoai/mirage-core";
877
- import { enoent as enoent6 } from "@struktoai/mirage-core";
878
- async function unlink(accessor, path, index) {
879
- const fileStat = await stat(accessor, path, index);
880
- const rawPath = rawPathOf(path);
881
- if (fileStat.type === FileType2.DIRECTORY) {
882
- const e = new Error(`EISDIR: ${rawPath}`);
883
- e.code = "EISDIR";
884
- throw e;
885
- }
886
- const key = hfKey(rawPath);
887
- const op = await accessor.operator();
888
- const startMs = performance.now();
889
- try {
890
- await op.delete(key);
891
- } catch (err) {
892
- if (isNotFound(err)) throw enoent6(path);
893
- throw err;
894
- }
895
- record3("unlink", path.original, accessor.resourceName, 0, startMs);
896
- await invalidateAfterUnlink(path);
897
- }
898
-
899
- // src/commands/builtin/hf/gunzip.ts
900
- var HF_GUNZIP = command19({
901
- name: "gunzip",
902
- resource: [...HF_RESOURCES],
903
- spec: specOf19("gunzip"),
904
- fn: (accessor, paths, _texts, opts) => gunzipGeneric(
905
- paths,
906
- opts,
907
- (p) => stream(accessor, p),
908
- (p, d) => write(accessor, p, d),
909
- (p) => unlink(accessor, p)
910
- ),
911
- write: true
912
- });
913
-
914
- // src/commands/builtin/hf/gzip.ts
915
- import { command as command20, specOf as specOf20, gzipGeneric } from "@struktoai/mirage-core";
916
- var HF_GZIP = command20({
917
- name: "gzip",
918
- resource: [...HF_RESOURCES],
919
- spec: specOf20("gzip"),
920
- fn: (accessor, paths, _texts, opts) => gzipGeneric(
921
- paths,
922
- opts,
923
- (p) => stream(accessor, p),
924
- (p, d) => write(accessor, p, d),
925
- (p) => unlink(accessor, p)
926
- ),
927
- write: true
928
- });
929
-
930
- // src/commands/builtin/hf/head/head.ts
931
- import { command as command21, headGeneric, headerAggregate, specOf as specOf21 } from "@struktoai/mirage-core";
932
- var HF_HEAD = command21({
933
- name: "head",
934
- resource: [...HF_RESOURCES],
935
- spec: specOf21("head"),
936
- provision: headTailProvision,
937
- fn: (accessor, paths, texts, opts) => headGeneric(
938
- paths,
939
- texts,
940
- opts,
941
- (p) => stat(accessor, p),
942
- (p) => stream(accessor, p)
943
- ),
944
- aggregate: headerAggregate
945
- });
946
-
947
- // src/commands/builtin/hf/iconv.ts
948
- import { command as command22, specOf as specOf22, iconvGeneric } from "@struktoai/mirage-core";
949
- var HF_ICONV = command22({
950
- name: "iconv",
951
- resource: [...HF_RESOURCES],
952
- spec: specOf22("iconv"),
953
- fn: (accessor, paths, _texts, opts) => iconvGeneric(
954
- paths,
955
- opts,
956
- (p) => stream(accessor, p),
957
- (p, d) => write(accessor, p, d)
958
- ),
959
- write: true
960
- });
961
-
962
- // src/commands/builtin/hf/join.ts
963
- import { command as command23, specOf as specOf23, joinGeneric } from "@struktoai/mirage-core";
964
- var HF_JOIN = command23({
965
- name: "join",
966
- resource: [...HF_RESOURCES],
967
- spec: specOf23("join"),
968
- fn: (accessor, paths, _texts, opts) => joinGeneric(paths, opts, (p) => stream(accessor, p))
969
- });
970
-
971
- // src/commands/builtin/hf/jq.ts
972
- import {
973
- command as command24,
974
- isJsonlPath,
975
- isStreamableJsonlExpr,
976
- jqGeneric,
977
- Precision as Precision2,
978
- ProvisionResult as ProvisionResult2,
979
- specOf as specOf24
980
- } from "@struktoai/mirage-core";
981
- async function jqProvision(accessor, paths, texts, _opts) {
982
- const [first] = paths;
983
- const [expr] = texts;
984
- if (first === void 0 || expr === void 0) return new ProvisionResult2({ command: "jq" });
985
- try {
986
- const s = await stat(accessor, first);
987
- const fileSize = s.size ?? 0;
988
- if (isJsonlPath(first.original) && isStreamableJsonlExpr(expr)) {
989
- return new ProvisionResult2({
990
- command: `jq '${expr}' ${first.original}`,
991
- networkReadLow: 0,
992
- networkReadHigh: fileSize,
993
- readOps: 1,
994
- precision: Precision2.RANGE
995
- });
996
- }
997
- return new ProvisionResult2({
998
- command: `jq '${expr}' ${first.original}`,
999
- networkReadLow: fileSize,
1000
- networkReadHigh: fileSize,
1001
- readOps: 1,
1002
- precision: Precision2.EXACT
1003
- });
1004
- } catch {
1005
- return new ProvisionResult2({ command: "jq" });
1006
- }
1007
- }
1008
- async function jqCommand(accessor, paths, texts, opts) {
1009
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1010
- return jqGeneric(resolved, texts, opts, (p) => stream(accessor, p));
1011
- }
1012
- var HF_JQ = command24({
1013
- name: "jq",
1014
- resource: [...HF_RESOURCES],
1015
- spec: specOf24("jq"),
1016
- provision: jqProvision,
1017
- fn: jqCommand
1018
- });
1019
-
1020
- // src/commands/builtin/hf/look.ts
1021
- import { command as command25, specOf as specOf25, lookGeneric } from "@struktoai/mirage-core";
1022
- var HF_LOOK = command25({
1023
- name: "look",
1024
- resource: [...HF_RESOURCES],
1025
- spec: specOf25("look"),
1026
- fn: (accessor, paths, texts, opts) => lookGeneric(paths, texts, opts, (p) => stream(accessor, p))
1027
- });
1028
-
1029
- // src/commands/builtin/hf/ls/ls.ts
1030
- import {
1031
- command as command26,
1032
- lsGeneric,
1033
- specOf as specOf26
1034
- } from "@struktoai/mirage-core";
1035
- async function lsCommand(accessor, paths, _texts, opts) {
1036
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1037
- return lsGeneric(
1038
- resolved,
1039
- opts,
1040
- (p) => readdir(accessor, p, opts.index ?? void 0),
1041
- (p) => stat(accessor, p, opts.index ?? void 0)
1042
- );
1043
- }
1044
- var HF_LS = command26({
1045
- name: "ls",
1046
- resource: [...HF_RESOURCES],
1047
- spec: specOf26("ls"),
1048
- fn: lsCommand,
1049
- provision: metadataProvision
1050
- });
1051
-
1052
- // src/commands/builtin/hf/md5.ts
1053
- import { command as command27, specOf as specOf27, md5Generic } from "@struktoai/mirage-core";
1054
- var HF_MD5 = command27({
1055
- name: "md5",
1056
- resource: [...HF_RESOURCES],
1057
- spec: specOf27("md5"),
1058
- fn: (accessor, paths, _texts, opts) => md5Generic(paths, opts, (p) => stream(accessor, p))
1059
- });
1060
-
1061
- // src/commands/builtin/hf/mktemp.ts
1062
- import { command as command28, mktempGeneric, specOf as specOf28 } from "@struktoai/mirage-core";
1063
-
1064
- // src/core/hf/mkdir.ts
1065
- async function mkdir(_accessor, _path, _index) {
1066
- }
1067
-
1068
- // src/commands/builtin/hf/mktemp.ts
1069
- var HF_MKTEMP = command28({
1070
- name: "mktemp",
1071
- resource: [...HF_RESOURCES],
1072
- spec: specOf28("mktemp"),
1073
- fn: (accessor, _paths, texts, opts) => mktempGeneric(
1074
- texts,
1075
- opts,
1076
- (p) => mkdir(accessor, p),
1077
- (p, d) => write(accessor, p, d)
1078
- ),
1079
- write: true
1080
- });
1081
-
1082
- // src/commands/builtin/hf/nl.ts
1083
- import { command as command29, specOf as specOf29, nlGeneric } from "@struktoai/mirage-core";
1084
- var HF_NL = command29({
1085
- name: "nl",
1086
- resource: [...HF_RESOURCES],
1087
- spec: specOf29("nl"),
1088
- fn: (accessor, paths, _texts, opts) => nlGeneric(paths, opts, (p) => stream(accessor, p))
1089
- });
1090
-
1091
- // src/commands/builtin/hf/paste.ts
1092
- import { command as command30, specOf as specOf30, pasteGeneric } from "@struktoai/mirage-core";
1093
- var HF_PASTE = command30({
1094
- name: "paste",
1095
- resource: [...HF_RESOURCES],
1096
- spec: specOf30("paste"),
1097
- fn: (accessor, paths, _texts, opts) => pasteGeneric(paths, opts, (p) => stream(accessor, p))
1098
- });
1099
-
1100
- // src/commands/builtin/hf/readlink.ts
1101
- import { command as command31, readlinkGeneric, specOf as specOf31 } from "@struktoai/mirage-core";
1102
- var HF_READLINK = command31({
1103
- name: "readlink",
1104
- resource: [...HF_RESOURCES],
1105
- spec: specOf31("readlink"),
1106
- fn: (_accessor, paths, texts, opts) => readlinkGeneric(paths, texts, opts)
1107
- });
1108
-
1109
- // src/commands/builtin/hf/realpath.ts
1110
- import { command as command32, realpathGeneric, specOf as specOf32 } from "@struktoai/mirage-core";
1111
- var HF_REALPATH = command32({
1112
- name: "realpath",
1113
- resource: [...HF_RESOURCES],
1114
- spec: specOf32("realpath"),
1115
- fn: (accessor, paths, texts, opts) => realpathGeneric(paths, texts, opts, (p) => stat(accessor, p, opts.index ?? void 0))
1116
- });
1117
-
1118
- // src/commands/builtin/hf/rev.ts
1119
- import { command as command33, specOf as specOf33, revGeneric } from "@struktoai/mirage-core";
1120
- var HF_REV = command33({
1121
- name: "rev",
1122
- resource: [...HF_RESOURCES],
1123
- spec: specOf33("rev"),
1124
- fn: (accessor, paths, _texts, opts) => revGeneric(paths, opts, (p) => stream(accessor, p))
1125
- });
1126
-
1127
- // src/commands/builtin/hf/rg.ts
1128
- import {
1129
- command as command34,
1130
- rgGeneric,
1131
- specOf as specOf34
1132
- } from "@struktoai/mirage-core";
1133
- async function rgCommand(accessor, paths, texts, opts) {
1134
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths) : [];
1135
- const stat2 = (p) => stat(accessor, p);
1136
- const readdir2 = (p) => readdir(accessor, p);
1137
- return rgGeneric(resolved, texts, opts, stat2, readdir2, (p) => stream(accessor, p));
1138
- }
1139
- var HF_RG = command34({
1140
- name: "rg",
1141
- resource: [...HF_RESOURCES],
1142
- spec: specOf34("rg"),
1143
- fn: rgCommand,
1144
- provision: fileReadProvision
1145
- });
1146
-
1147
- // src/commands/builtin/hf/rm.ts
1148
- import {
1149
- IOResult,
1150
- command as command35,
1151
- specOf as specOf35
1152
- } from "@struktoai/mirage-core";
1153
- var ENC = new TextEncoder();
1154
- async function* lines(parts) {
1155
- for (const part of parts) yield ENC.encode(`${part}
1156
- `);
1157
- }
1158
- async function rmCommand(accessor, paths, _texts, opts) {
1159
- if (paths.length === 0) {
1160
- return [null, new IOResult({ exitCode: 1, stderr: ENC.encode("rm: missing operand\n") })];
1161
- }
1162
- if (opts.flags.r === true || opts.flags.R === true || opts.flags.d === true) {
1163
- return [
1164
- null,
1165
- new IOResult({
1166
- exitCode: 1,
1167
- stderr: ENC.encode("rm: recursive and directory removal are not supported\n")
1168
- })
1169
- ];
1170
- }
1171
- const force = opts.flags.f === true;
1172
- const verbose = opts.flags.v === true;
1173
- const resolved = await resolveGlob(accessor, paths, opts.index ?? void 0);
1174
- const verboseParts = [];
1175
- const removed = {};
1176
- for (const path of resolved) {
1177
- try {
1178
- await unlink(accessor, path, opts.index ?? void 0);
1179
- } catch (err) {
1180
- const code = err?.code;
1181
- if (code === "EISDIR") {
1182
- throw new Error(`rm: cannot remove '${path.original}': Is a directory`);
1183
- }
1184
- if (code === "ENOENT" && force) continue;
1185
- throw err;
1186
- }
1187
- removed[path.stripPrefix] = new Uint8Array();
1188
- if (verbose) verboseParts.push(`removed '${path.original}'`);
1189
- }
1190
- const output = verbose ? lines(verboseParts) : null;
1191
- return [output, new IOResult({ writes: removed })];
1192
- }
1193
- var HF_RM = command35({
1194
- name: "rm",
1195
- resource: [...HF_RESOURCES],
1196
- spec: specOf35("rm"),
1197
- fn: rmCommand,
1198
- write: true
1199
- });
1200
-
1201
- // src/commands/builtin/hf/sed.ts
1202
- import { makeSed } from "@struktoai/mirage-core";
1203
- var HF_SED = makeSed({
1204
- resource: [...HF_RESOURCES],
1205
- stream: (a, p) => stream(a, p),
1206
- write: (a, p, d) => write(a, p, d)
1207
- });
1208
-
1209
- // src/commands/builtin/hf/sha256sum.ts
1210
- import { command as command36, sha256sumGeneric, specOf as specOf36 } from "@struktoai/mirage-core";
1211
- var HF_SHA256SUM = command36({
1212
- name: "sha256sum",
1213
- resource: [...HF_RESOURCES],
1214
- spec: specOf36("sha256sum"),
1215
- fn: (accessor, paths, _texts, opts) => sha256sumGeneric(paths, opts, (p) => stream(accessor, p))
1216
- });
1217
-
1218
- // src/commands/builtin/hf/shuf.ts
1219
- import { command as command37, specOf as specOf37, shufGeneric } from "@struktoai/mirage-core";
1220
- var HF_SHUF = command37({
1221
- name: "shuf",
1222
- resource: [...HF_RESOURCES],
1223
- spec: specOf37("shuf"),
1224
- fn: (accessor, paths, texts, opts) => shufGeneric(paths, texts, opts, (p) => stream(accessor, p))
1225
- });
1226
-
1227
- // src/commands/builtin/hf/sort.ts
1228
- import { command as command38, specOf as specOf38, sortGeneric } from "@struktoai/mirage-core";
1229
- var HF_SORT = command38({
1230
- name: "sort",
1231
- resource: [...HF_RESOURCES],
1232
- spec: specOf38("sort"),
1233
- fn: (accessor, paths, _texts, opts) => sortGeneric(paths, opts, (p) => stream(accessor, p))
1234
- });
1235
-
1236
- // src/commands/builtin/hf/split.ts
1237
- import { command as command39, specOf as specOf39, splitGeneric } from "@struktoai/mirage-core";
1238
- var HF_SPLIT = command39({
1239
- name: "split",
1240
- resource: [...HF_RESOURCES],
1241
- spec: specOf39("split"),
1242
- fn: (accessor, paths, _texts, opts) => splitGeneric(
1243
- paths,
1244
- opts,
1245
- (p) => stream(accessor, p),
1246
- (p, d) => write(accessor, p, d)
1247
- ),
1248
- write: true
1249
- });
1250
-
1251
- // src/commands/builtin/hf/stat/stat.ts
1252
- import {
1253
- command as command40,
1254
- specOf as specOf40,
1255
- statGeneric
1256
- } from "@struktoai/mirage-core";
1257
- async function statCommand(accessor, paths, _texts, opts) {
1258
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1259
- return statGeneric(resolved, opts, (p) => stat(accessor, p, opts.index ?? void 0));
1260
- }
1261
- var HF_STAT = command40({
1262
- name: "stat",
1263
- resource: [...HF_RESOURCES],
1264
- spec: specOf40("stat"),
1265
- fn: statCommand,
1266
- provision: metadataProvision
1267
- });
1268
-
1269
- // src/commands/builtin/hf/strings.ts
1270
- import { command as command41, specOf as specOf41, stringsGeneric } from "@struktoai/mirage-core";
1271
- var HF_STRINGS = command41({
1272
- name: "strings",
1273
- resource: [...HF_RESOURCES],
1274
- spec: specOf41("strings"),
1275
- fn: (accessor, paths, _texts, opts) => stringsGeneric(paths, opts, (p) => stream(accessor, p))
1276
- });
1277
-
1278
- // src/commands/builtin/hf/tac.ts
1279
- import { command as command42, specOf as specOf42, tacGeneric } from "@struktoai/mirage-core";
1280
- var HF_TAC = command42({
1281
- name: "tac",
1282
- resource: [...HF_RESOURCES],
1283
- spec: specOf42("tac"),
1284
- fn: (accessor, paths, _texts, opts) => tacGeneric(paths, opts, (p) => stream(accessor, p))
1285
- });
1286
-
1287
- // src/commands/builtin/hf/tail/tail.ts
1288
- import { command as command43, headerAggregate as headerAggregate2, specOf as specOf43, tailGeneric } from "@struktoai/mirage-core";
1289
- var HF_TAIL = command43({
1290
- name: "tail",
1291
- resource: [...HF_RESOURCES],
1292
- spec: specOf43("tail"),
1293
- provision: headTailProvision,
1294
- fn: (accessor, paths, texts, opts) => tailGeneric(paths, texts, opts, (p) => stream(accessor, p)),
1295
- aggregate: headerAggregate2
1296
- });
1297
-
1298
- // src/commands/builtin/hf/tar.ts
1299
- import { command as command44, specOf as specOf44, tarGeneric } from "@struktoai/mirage-core";
1300
- var HF_TAR = command44({
1301
- name: "tar",
1302
- resource: [...HF_RESOURCES],
1303
- spec: specOf44("tar"),
1304
- fn: (accessor, paths, _texts, opts) => tarGeneric(
1305
- paths,
1306
- opts,
1307
- (p) => stream(accessor, p),
1308
- (p, data) => write(accessor, p, data),
1309
- (p) => mkdir(accessor, p)
1310
- ),
1311
- write: true
1312
- });
1313
-
1314
- // src/commands/builtin/hf/touch.ts
1315
- import {
1316
- IOResult as IOResult2,
1317
- command as command45,
1318
- specOf as specOf45
1319
- } from "@struktoai/mirage-core";
1320
-
1321
- // src/core/hf/exists.ts
1322
- async function exists(accessor, path) {
1323
- try {
1324
- await stat(accessor, path);
1325
- return true;
1326
- } catch (err) {
1327
- if (err?.code === "ENOENT") return false;
1328
- throw err;
1329
- }
1330
- }
1331
-
1332
- // src/commands/builtin/hf/touch.ts
1333
- var ENC2 = new TextEncoder();
1334
- async function touchCommand(accessor, paths, texts, opts) {
1335
- if (paths.length === 0) {
1336
- return [null, new IOResult2({ exitCode: 1, stderr: ENC2.encode("touch: missing operand\n") })];
1337
- }
1338
- const createOnly = opts.flags.c === true;
1339
- for (const p of paths) {
1340
- if (createOnly) continue;
1341
- if (!await exists(accessor, p)) {
1342
- await write(accessor, p, new Uint8Array(0));
1343
- }
1344
- }
1345
- return [null, new IOResult2()];
1346
- }
1347
- var HF_TOUCH = command45({
1348
- name: "touch",
1349
- resource: [...HF_RESOURCES],
1350
- spec: specOf45("touch"),
1351
- fn: touchCommand,
1352
- write: true
1353
- });
1354
-
1355
- // src/commands/builtin/hf/tr.ts
1356
- import { command as command46, specOf as specOf46, trGeneric } from "@struktoai/mirage-core";
1357
- var HF_TR = command46({
1358
- name: "tr",
1359
- resource: [...HF_RESOURCES],
1360
- spec: specOf46("tr"),
1361
- fn: (accessor, paths, texts, opts) => trGeneric(paths, texts, opts, (p) => stream(accessor, p))
1362
- });
1363
-
1364
- // src/commands/builtin/hf/tree.ts
1365
- import {
1366
- command as command47,
1367
- specOf as specOf47,
1368
- treeGeneric
1369
- } from "@struktoai/mirage-core";
1370
- async function treeCommand(accessor, paths, _texts, opts) {
1371
- const resolved = await resolveGlob(accessor, paths, opts.index ?? void 0);
1372
- return treeGeneric(
1373
- resolved,
1374
- opts,
1375
- (p) => readdir(accessor, p, opts.index ?? void 0),
1376
- (p) => stat(accessor, p, opts.index ?? void 0)
1377
- );
1378
- }
1379
- var HF_TREE = command47({
1380
- name: "tree",
1381
- resource: [...HF_RESOURCES],
1382
- spec: specOf47("tree"),
1383
- fn: treeCommand
1384
- });
1385
-
1386
- // src/commands/builtin/hf/tsort.ts
1387
- import { command as command48, specOf as specOf48, tsortGeneric } from "@struktoai/mirage-core";
1388
- var HF_TSORT = command48({
1389
- name: "tsort",
1390
- resource: [...HF_RESOURCES],
1391
- spec: specOf48("tsort"),
1392
- fn: (accessor, paths, _texts, opts) => tsortGeneric(paths, opts, (p) => stream(accessor, p))
1393
- });
1394
-
1395
- // src/commands/builtin/hf/unexpand.ts
1396
- import { command as command49, specOf as specOf49, unexpandGeneric } from "@struktoai/mirage-core";
1397
- var HF_UNEXPAND = command49({
1398
- name: "unexpand",
1399
- resource: [...HF_RESOURCES],
1400
- spec: specOf49("unexpand"),
1401
- fn: (accessor, paths, _texts, opts) => unexpandGeneric(paths, opts, (p) => stream(accessor, p))
1402
- });
1403
-
1404
- // src/commands/builtin/hf/uniq.ts
1405
- import { command as command50, specOf as specOf50, uniqGeneric } from "@struktoai/mirage-core";
1406
- var HF_UNIQ = command50({
1407
- name: "uniq",
1408
- resource: [...HF_RESOURCES],
1409
- spec: specOf50("uniq"),
1410
- fn: (accessor, paths, _texts, opts) => uniqGeneric(paths, opts, (p) => stream(accessor, p))
1411
- });
1412
-
1413
- // src/commands/builtin/hf/unzip.ts
1414
- import { command as command51, specOf as specOf51, unzipGeneric } from "@struktoai/mirage-core";
1415
- var HF_UNZIP = command51({
1416
- name: "unzip",
1417
- resource: [...HF_RESOURCES],
1418
- spec: specOf51("unzip"),
1419
- fn: (accessor, paths, _texts, opts) => unzipGeneric(
1420
- paths,
1421
- opts,
1422
- (p) => stream(accessor, p),
1423
- (p, d) => write(accessor, p, d),
1424
- (p) => mkdir(accessor, p)
1425
- ),
1426
- write: true
1427
- });
1428
-
1429
- // src/commands/builtin/hf/wc/wc.ts
1430
- import { command as command52, specOf as specOf52, wcAggregate, wcGeneric } from "@struktoai/mirage-core";
1431
- var HF_WC = command52({
1432
- name: "wc",
1433
- resource: [...HF_RESOURCES],
1434
- spec: specOf52("wc"),
1435
- fn: (accessor, paths, texts, opts) => wcGeneric(paths, texts, opts, (p) => stream(accessor, p)),
1436
- provision: fileReadProvision,
1437
- aggregate: wcAggregate
1438
- });
1439
-
1440
- // src/commands/builtin/hf/xxd.ts
1441
- import { command as command53, specOf as specOf53, xxdGeneric } from "@struktoai/mirage-core";
1442
- var HF_XXD = command53({
1443
- name: "xxd",
1444
- resource: [...HF_RESOURCES],
1445
- spec: specOf53("xxd"),
1446
- fn: (accessor, paths, _texts, opts) => xxdGeneric(paths, opts, (p) => stream(accessor, p))
1447
- });
1448
-
1449
- // src/commands/builtin/hf/zcat.ts
1450
- import { command as command54, specOf as specOf54, zcatGeneric } from "@struktoai/mirage-core";
1451
- var HF_ZCAT = command54({
1452
- name: "zcat",
1453
- resource: [...HF_RESOURCES],
1454
- spec: specOf54("zcat"),
1455
- fn: (accessor, paths, _texts, opts) => zcatGeneric(paths, opts, (p) => stream(accessor, p))
1456
- });
1457
-
1458
- // src/commands/builtin/hf/zgrep.ts
1459
- import { command as command55, specOf as specOf55, zgrepGeneric } from "@struktoai/mirage-core";
1460
- var HF_ZGREP = command55({
1461
- name: "zgrep",
1462
- resource: [...HF_RESOURCES],
1463
- spec: specOf55("zgrep"),
1464
- fn: (accessor, paths, texts, opts) => zgrepGeneric(paths, texts, opts, (p) => stream(accessor, p))
1465
- });
1466
-
1467
- // src/commands/builtin/hf/zip_cmd.ts
1468
- import { command as command56, specOf as specOf56, zipGeneric } from "@struktoai/mirage-core";
1469
- var HF_ZIP = command56({
1470
- name: "zip",
1471
- resource: [...HF_RESOURCES],
1472
- spec: specOf56("zip"),
1473
- fn: (accessor, paths, _texts, opts) => zipGeneric(
1474
- paths,
1475
- opts,
1476
- (p) => stream(accessor, p),
1477
- (p, d) => write(accessor, p, d)
1478
- ),
1479
- write: true
1480
- });
1481
-
1482
- // src/commands/builtin/hf/index.ts
1483
- var HF_COMMANDS = [
1484
- ...HF_AWK,
1485
- ...HF_BASE64,
1486
- ...HF_BASENAME,
1487
- ...HF_CAT,
1488
- ...HF_CMP,
1489
- ...HF_COLUMN,
1490
- ...HF_COMM,
1491
- ...HF_CSPLIT,
1492
- ...HF_CUT,
1493
- ...HF_DIFF,
1494
- ...HF_DIRNAME,
1495
- ...HF_DU,
1496
- ...HF_EXPAND,
1497
- ...HF_FILE,
1498
- ...HF_FIND,
1499
- ...HF_FMT,
1500
- ...HF_FOLD,
1501
- ...HF_GREP,
1502
- ...HF_GUNZIP,
1503
- ...HF_GZIP,
1504
- ...HF_HEAD,
1505
- ...HF_ICONV,
1506
- ...HF_JOIN,
1507
- ...HF_JQ,
1508
- ...HF_LOOK,
1509
- ...HF_LS,
1510
- ...HF_MD5,
1511
- ...HF_MKTEMP,
1512
- ...HF_NL,
1513
- ...HF_PASTE,
1514
- ...HF_READLINK,
1515
- ...HF_REALPATH,
1516
- ...HF_REV,
1517
- ...HF_RG,
1518
- ...HF_RM,
1519
- ...HF_SED,
1520
- ...HF_SHA256SUM,
1521
- ...HF_SHUF,
1522
- ...HF_SORT,
1523
- ...HF_SPLIT,
1524
- ...HF_STAT,
1525
- ...HF_STRINGS,
1526
- ...HF_TAC,
1527
- ...HF_TAIL,
1528
- ...HF_TAR,
1529
- ...HF_TOUCH,
1530
- ...HF_TR,
1531
- ...HF_TREE,
1532
- ...HF_TSORT,
1533
- ...HF_UNEXPAND,
1534
- ...HF_UNIQ,
1535
- ...HF_UNZIP,
1536
- ...HF_WC,
1537
- ...HF_XXD,
1538
- ...HF_ZCAT,
1539
- ...HF_ZGREP,
1540
- ...HF_ZIP
1541
- ];
1542
-
1543
- // src/core/hf/create.ts
1544
- async function create(accessor, path, index) {
1545
- await write(accessor, path, new Uint8Array(), index);
1546
- }
1547
-
1548
- // src/ops/hf/create.ts
1549
- var createOps = HF_RESOURCES.map((resource) => ({
1550
- name: "create",
1551
- resource,
1552
- filetype: null,
1553
- write: true,
1554
- fn: (accessor, path) => {
1555
- return create(accessor, path);
1556
- }
1557
- }));
1558
-
1559
- // src/ops/hf/mkdir.ts
1560
- var mkdirOps = HF_RESOURCES.map((resource) => ({
1561
- name: "mkdir",
1562
- resource,
1563
- filetype: null,
1564
- write: true,
1565
- fn: (accessor, path) => {
1566
- return mkdir(accessor, path);
1567
- }
1568
- }));
1569
-
1570
- // src/ops/hf/read/read.ts
1571
- var readOps = HF_RESOURCES.map((resource) => ({
1572
- name: "read",
1573
- resource,
1574
- filetype: null,
1575
- write: false,
1576
- fn: (accessor, path, _args, kwargs) => {
1577
- return read(accessor, path, kwargs.index);
1578
- }
1579
- }));
1580
-
1581
- // src/ops/hf/read/read_feather.ts
1582
- import { featherCat } from "@struktoai/mirage-core";
1583
- var readFeatherOps = HF_RESOURCES.map((resource) => ({
1584
- name: "read",
1585
- resource,
1586
- filetype: ".feather",
1587
- write: false,
1588
- fn: async (accessor, path, _args, kwargs) => {
1589
- const raw = await read(accessor, path, kwargs.index);
1590
- return featherCat(raw);
1591
- }
1592
- }));
1593
-
1594
- // src/ops/hf/read/read_hdf5.ts
1595
- import { hdf5Cat } from "@struktoai/mirage-core";
1596
- var readHdf5Ops = HF_RESOURCES.map((resource) => ({
1597
- name: "read",
1598
- resource,
1599
- filetype: ".hdf5",
1600
- write: false,
1601
- fn: async (accessor, path, _args, kwargs) => {
1602
- const raw = await read(accessor, path, kwargs.index);
1603
- return hdf5Cat(raw);
1604
- }
1605
- }));
1606
-
1607
- // src/ops/hf/read/read_parquet.ts
1608
- import { parquetCat } from "@struktoai/mirage-core";
1609
- var readParquetOps = HF_RESOURCES.map((resource) => ({
1610
- name: "read",
1611
- resource,
1612
- filetype: ".parquet",
1613
- write: false,
1614
- fn: async (accessor, path, _args, kwargs) => {
1615
- const raw = await read(accessor, path, kwargs.index);
1616
- return parquetCat(raw);
1617
- }
1618
- }));
1619
-
1620
- // src/ops/hf/readdir.ts
1621
- var readdirOps = HF_RESOURCES.map((resource) => ({
1622
- name: "readdir",
1623
- resource,
1624
- filetype: null,
1625
- write: false,
1626
- fn: (accessor, path, _args, kwargs) => {
1627
- return readdir(accessor, path, kwargs.index);
1628
- }
1629
- }));
1630
-
1631
- // src/ops/hf/stat.ts
1632
- var statOps = HF_RESOURCES.map((resource) => ({
1633
- name: "stat",
1634
- resource,
1635
- filetype: null,
1636
- write: false,
1637
- fn: (accessor, path, _args, kwargs) => {
1638
- return stat(accessor, path, kwargs.index);
1639
- }
1640
- }));
1641
-
1642
- // src/ops/hf/unlink.ts
1643
- var unlinkOps = HF_RESOURCES.map((resource) => ({
1644
- name: "unlink",
1645
- resource,
1646
- filetype: null,
1647
- write: true,
1648
- fn: (accessor, path, _args, kwargs) => {
1649
- return unlink(accessor, path, kwargs.index);
1650
- }
1651
- }));
1652
-
1653
- // src/ops/hf/write.ts
1654
- import { extractWriteData } from "@struktoai/mirage-core";
1655
- var writeOps = HF_RESOURCES.map((resource) => ({
1656
- name: "write",
1657
- resource,
1658
- filetype: null,
1659
- write: true,
1660
- fn: (accessor, path, args) => {
1661
- const data = extractWriteData(args);
1662
- return write(accessor, path, data);
1663
- }
1664
- }));
1665
-
1666
- // src/ops/hf/index.ts
1667
- var HF_OPS = [
1668
- ...createOps,
1669
- ...mkdirOps,
1670
- ...readOps,
1671
- ...readFeatherOps,
1672
- ...readHdf5Ops,
1673
- ...readParquetOps,
1674
- ...readdirOps,
1675
- ...statOps,
1676
- ...unlinkOps,
1677
- ...writeOps
1678
- ];
1679
-
1680
- // src/resource/hf_buckets/base.ts
1681
- import {
1682
- BaseResource,
1683
- PathSpec as PathSpec2
1684
- } from "@struktoai/mirage-core";
1685
- var HfResource = class extends BaseResource {
1686
- cachesReads = true;
1687
- supportsSnapshot = true;
1688
- opsMap = {
1689
- read_bytes: read,
1690
- readdir,
1691
- stat,
1692
- read_stream: stream,
1693
- range_read: rangeRead,
1694
- du_total: du,
1695
- du_all: duAll,
1696
- exists,
1697
- find_flat: find,
1698
- write,
1699
- create,
1700
- unlink,
1701
- mkdir
1702
- };
1703
- open() {
1704
- return Promise.resolve();
1705
- }
1706
- close() {
1707
- return Promise.resolve();
1708
- }
1709
- commands() {
1710
- return HF_COMMANDS;
1711
- }
1712
- ops() {
1713
- return HF_OPS;
1714
- }
1715
- streamPath(p) {
1716
- return stream(this.accessor, p);
1717
- }
1718
- readFile(p) {
1719
- return read(this.accessor, p, this.index);
1720
- }
1721
- writeFile(p, data) {
1722
- return write(this.accessor, p, data, this.index);
1723
- }
1724
- readdir(p) {
1725
- return readdir(this.accessor, p, this.index);
1726
- }
1727
- stat(p) {
1728
- return stat(this.accessor, p, this.index);
1729
- }
1730
- exists(p) {
1731
- return exists(this.accessor, p);
1732
- }
1733
- mkdir(p) {
1734
- return mkdir(this.accessor, p);
1735
- }
1736
- unlink(p) {
1737
- return unlink(this.accessor, p, this.index);
1738
- }
1739
- du(p) {
1740
- return du(this.accessor, p);
1741
- }
1742
- find(p, options = {}) {
1743
- return find(this.accessor, p, options);
1744
- }
1745
- glob(paths, prefix = "") {
1746
- const effective = prefix ? paths.map(
1747
- (p) => p.prefix ? p : new PathSpec2({
1748
- original: p.original,
1749
- directory: p.directory,
1750
- ...p.pattern !== null ? { pattern: p.pattern } : {},
1751
- resolved: p.resolved,
1752
- prefix
1753
- })
1754
- ) : paths;
1755
- return resolveGlob(this.accessor, effective, this.index);
1756
- }
1757
- async fingerprint(p) {
1758
- try {
1759
- const s = await stat(this.accessor, p);
1760
- return s.fingerprint;
1761
- } catch (err) {
1762
- if (err?.code === "ENOENT") return null;
1763
- throw err;
1764
- }
1765
- }
1766
- loadState(_state) {
1767
- return Promise.resolve();
1768
- }
1769
- };
1770
-
1771
- export {
1772
- HF_RESOURCES,
1773
- HfAccessor,
1774
- HfBucketsAccessor,
1775
- HfDatasetsAccessor,
1776
- HfModelsAccessor,
1777
- HfSpacesAccessor,
1778
- HF_COMMANDS,
1779
- HF_OPS,
1780
- HfResource
1781
- };
1782
- //# sourceMappingURL=chunk-TURD42QO.js.map