@struktoai/mirage-node 0.0.4 → 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.
- package/README.md +2 -1
- package/dist/aliyun-S62BR3TB.js +11 -0
- package/dist/append.lua +17 -0
- package/dist/backblaze-4EKSW63F.js +11 -0
- package/dist/box-ZPLZAGMK.js +8 -0
- package/dist/ceph-ALKLD3MO.js +11 -0
- package/dist/{chunk-VLRSOWHP.js → chunk-2A4YGVBM.js} +5 -14
- package/dist/chunk-2A4YGVBM.js.map +1 -0
- package/dist/chunk-2HCYLVGY.js +28 -0
- package/dist/chunk-2HCYLVGY.js.map +1 -0
- package/dist/chunk-2VPZAH5Q.js +20 -0
- package/dist/chunk-2VPZAH5Q.js.map +1 -0
- package/dist/{chunk-HCU3B6FW.js → chunk-3JZQ6VSZ.js} +5 -4
- package/dist/chunk-3JZQ6VSZ.js.map +1 -0
- package/dist/chunk-4IF4TGAI.js +11 -0
- package/dist/chunk-4IF4TGAI.js.map +1 -0
- package/dist/{chunk-L7FEZ7LU.js → chunk-5H6KNEPP.js} +4 -5
- package/dist/{chunk-L7FEZ7LU.js.map → chunk-5H6KNEPP.js.map} +1 -1
- package/dist/{chunk-25W4XQJZ.js → chunk-5K2MWDCE.js} +4 -5
- package/dist/{chunk-25W4XQJZ.js.map → chunk-5K2MWDCE.js.map} +1 -1
- package/dist/{chunk-L4GMDSMB.js → chunk-6SVXWRKX.js} +4 -5
- package/dist/{chunk-L4GMDSMB.js.map → chunk-6SVXWRKX.js.map} +1 -1
- package/dist/{chunk-H62XQZUM.js → chunk-6VOIUGAD.js} +22 -10
- package/dist/chunk-6VOIUGAD.js.map +1 -0
- package/dist/{chunk-SI4GMRXD.js → chunk-7JYHFXXC.js} +4 -8
- package/dist/chunk-7JYHFXXC.js.map +1 -0
- package/dist/chunk-7VQQFWV6.js +20 -0
- package/dist/chunk-7VQQFWV6.js.map +1 -0
- package/dist/chunk-7ZP6TPHX.js +87 -0
- package/dist/chunk-7ZP6TPHX.js.map +1 -0
- package/dist/{chunk-HWQPEBID.js → chunk-ADEXNSYU.js} +6 -12
- package/dist/chunk-ADEXNSYU.js.map +1 -0
- package/dist/chunk-AQSYAXL4.js +16 -0
- package/dist/chunk-AQSYAXL4.js.map +1 -0
- package/dist/{chunk-NJ42VNXG.js → chunk-ATLXMNKD.js} +8 -3
- package/dist/chunk-ATLXMNKD.js.map +1 -0
- package/dist/{chunk-CB76WPUS.js → chunk-BYCUGFRF.js} +5 -4
- package/dist/chunk-BYCUGFRF.js.map +1 -0
- package/dist/{chunk-4M73WHIE.js → chunk-BZTVYOES.js} +3 -3
- package/dist/{chunk-CQCTCW4S.js → chunk-CRC4YWXB.js} +28 -9
- package/dist/chunk-CRC4YWXB.js.map +1 -0
- package/dist/{chunk-C7TNKIK5.js → chunk-CTGXJHO5.js} +1 -1
- package/dist/chunk-CTGXJHO5.js.map +1 -0
- package/dist/{chunk-HSD24IP2.js → chunk-DCDBIXVZ.js} +7 -2
- package/dist/chunk-DCDBIXVZ.js.map +1 -0
- package/dist/{chunk-HEDE2377.js → chunk-DDAFNROK.js} +318 -322
- package/dist/chunk-DDAFNROK.js.map +1 -0
- package/dist/chunk-DQIEWEAW.js +85 -0
- package/dist/chunk-DQIEWEAW.js.map +1 -0
- package/dist/{chunk-2ERLWAGG.js → chunk-EBI4IHDC.js} +20 -11
- package/dist/chunk-EBI4IHDC.js.map +1 -0
- package/dist/{chunk-RHUEV4I7.js → chunk-EIUTZ6N7.js} +10 -24
- package/dist/chunk-EIUTZ6N7.js.map +1 -0
- package/dist/{chunk-IUXXZHY3.js → chunk-EJZG5VUF.js} +24 -12
- package/dist/chunk-EJZG5VUF.js.map +1 -0
- package/dist/{chunk-BWWU5T2D.js → chunk-ENW5BVYN.js} +3 -3
- package/dist/{chunk-F5NWRF32.js → chunk-ETIAW4YD.js} +3 -3
- package/dist/chunk-EUPXAYPB.js +20 -0
- package/dist/chunk-EUPXAYPB.js.map +1 -0
- package/dist/{chunk-EGZNOUMH.js → chunk-FA6YNU75.js} +4 -5
- package/dist/{chunk-EGZNOUMH.js.map → chunk-FA6YNU75.js.map} +1 -1
- package/dist/{chunk-XUUSWR4U.js → chunk-FFH6R5VQ.js} +7 -2
- package/dist/{chunk-XUUSWR4U.js.map → chunk-FFH6R5VQ.js.map} +1 -1
- package/dist/{chunk-JEBH5APX.js → chunk-GE6H2COM.js} +5 -13
- package/dist/chunk-GE6H2COM.js.map +1 -0
- package/dist/{chunk-TUNR4VUM.js → chunk-GMMQ3ZK4.js} +3 -3
- package/dist/{chunk-SAOQW6ZJ.js → chunk-GSGE3M5P.js} +5 -13
- package/dist/chunk-GSGE3M5P.js.map +1 -0
- package/dist/{chunk-FRGTDZQT.js → chunk-H64SB6VO.js} +19 -5
- package/dist/chunk-H64SB6VO.js.map +1 -0
- package/dist/{chunk-DXU7NZPH.js → chunk-HCRYAFBI.js} +3 -3
- package/dist/{chunk-OSVZKYXS.js → chunk-HOPUP6LA.js} +192 -156
- package/dist/chunk-HOPUP6LA.js.map +1 -0
- package/dist/chunk-HS24BL6W.js +160 -0
- package/dist/chunk-HS24BL6W.js.map +1 -0
- package/dist/chunk-HVYVG5KQ.js +16 -0
- package/dist/chunk-HVYVG5KQ.js.map +1 -0
- package/dist/{chunk-XEMLYWHK.js → chunk-I7CPLZNW.js} +4 -5
- package/dist/{chunk-XEMLYWHK.js.map → chunk-I7CPLZNW.js.map} +1 -1
- package/dist/{chunk-AULFV3KY.js → chunk-IFUCGI4I.js} +7 -2
- package/dist/chunk-IFUCGI4I.js.map +1 -0
- package/dist/{chunk-HGIPWY5Y.js → chunk-IFYXSSKR.js} +6 -6
- package/dist/chunk-IFYXSSKR.js.map +1 -0
- package/dist/chunk-IXA4DQE4.js +20 -0
- package/dist/chunk-IXA4DQE4.js.map +1 -0
- package/dist/chunk-IZMKMD3O.js +11 -0
- package/dist/chunk-IZMKMD3O.js.map +1 -0
- package/dist/{chunk-4X6CLF4F.js → chunk-JJERW2BI.js} +4 -5
- package/dist/{chunk-4X6CLF4F.js.map → chunk-JJERW2BI.js.map} +1 -1
- package/dist/{chunk-M6E7VK4D.js → chunk-JQR4HVUX.js} +2 -5
- package/dist/chunk-JQR4HVUX.js.map +1 -0
- package/dist/{chunk-BWLUBJQG.js → chunk-JXOMDLFS.js} +6 -15
- package/dist/chunk-JXOMDLFS.js.map +1 -0
- package/dist/{chunk-5ZHNPNDD.js → chunk-KIX6N7NT.js} +198 -141
- package/dist/chunk-KIX6N7NT.js.map +1 -0
- package/dist/{chunk-XFSEADPC.js → chunk-L42UTDFK.js} +7 -2
- package/dist/chunk-L42UTDFK.js.map +1 -0
- package/dist/chunk-M2UF2JHJ.js +11 -0
- package/dist/chunk-M2UF2JHJ.js.map +1 -0
- package/dist/{chunk-LPLZLSMK.js → chunk-MONC734W.js} +7 -2
- package/dist/chunk-MONC734W.js.map +1 -0
- package/dist/{chunk-XADEMW6B.js → chunk-N72RLCMU.js} +4 -5
- package/dist/{chunk-XADEMW6B.js.map → chunk-N72RLCMU.js.map} +1 -1
- package/dist/{chunk-ZPB3SLPK.js → chunk-ND4IWJ4V.js} +7 -2
- package/dist/chunk-ND4IWJ4V.js.map +1 -0
- package/dist/{chunk-ZPZQXHW2.js → chunk-NZ3EKGW4.js} +260 -178
- package/dist/chunk-NZ3EKGW4.js.map +1 -0
- package/dist/{chunk-E3KXVEYI.js → chunk-OAE57MNL.js} +22 -10
- package/dist/chunk-OAE57MNL.js.map +1 -0
- package/dist/{chunk-JBDFYIN2.js → chunk-OHKGIQB4.js} +2 -5
- package/dist/chunk-OHKGIQB4.js.map +1 -0
- package/dist/{chunk-V7JVMG63.js → chunk-OXEQSPND.js} +3 -3
- package/dist/{chunk-YRJICL2Q.js → chunk-PKNE5J2B.js} +5 -13
- package/dist/chunk-PKNE5J2B.js.map +1 -0
- package/dist/chunk-PSXXEGYQ.js +16 -0
- package/dist/chunk-PSXXEGYQ.js.map +1 -0
- package/dist/{chunk-KAWDDS27.js → chunk-QAOVABCR.js} +7 -2
- package/dist/chunk-QAOVABCR.js.map +1 -0
- package/dist/{chunk-SYMNWNC3.js → chunk-QQ7FP4GD.js} +4 -5
- package/dist/{chunk-SYMNWNC3.js.map → chunk-QQ7FP4GD.js.map} +1 -1
- package/dist/{chunk-3JZN3GYO.js → chunk-QYLVMC6B.js} +2 -5
- package/dist/chunk-QYLVMC6B.js.map +1 -0
- package/dist/{chunk-CXQGMFI7.js → chunk-RX3XR65X.js} +4 -5
- package/dist/{chunk-CXQGMFI7.js.map → chunk-RX3XR65X.js.map} +1 -1
- package/dist/{chunk-MRXTUFBZ.js → chunk-RYQJJB4C.js} +1 -1
- package/dist/chunk-RYQJJB4C.js.map +1 -0
- package/dist/{chunk-5I7Q7RHW.js → chunk-TUF7TCN7.js} +4 -5
- package/dist/{chunk-5I7Q7RHW.js.map → chunk-TUF7TCN7.js.map} +1 -1
- package/dist/{chunk-NLXJMXVE.js → chunk-TUX36JY5.js} +4 -5
- package/dist/{chunk-NLXJMXVE.js.map → chunk-TUX36JY5.js.map} +1 -1
- package/dist/{chunk-4GYB7DGC.js → chunk-TWRQCQWU.js} +327 -558
- package/dist/chunk-TWRQCQWU.js.map +1 -0
- package/dist/chunk-U6DFQRG3.js +20 -0
- package/dist/chunk-U6DFQRG3.js.map +1 -0
- package/dist/chunk-VI5YTKNY.js +20 -0
- package/dist/chunk-VI5YTKNY.js.map +1 -0
- package/dist/{chunk-W5ZLIQFR.js → chunk-WG5YS6TC.js} +308 -200
- package/dist/chunk-WG5YS6TC.js.map +1 -0
- package/dist/{chunk-ZM44MGC5.js → chunk-WMJJ4WGF.js} +4 -5
- package/dist/{chunk-ZM44MGC5.js.map → chunk-WMJJ4WGF.js.map} +1 -1
- package/dist/{chunk-5YRWF5RP.js → chunk-WY4FNH42.js} +6 -5
- package/dist/chunk-WY4FNH42.js.map +1 -0
- package/dist/{chunk-VBYIDRNU.js → chunk-XIG5BWWH.js} +19 -10
- package/dist/chunk-XIG5BWWH.js.map +1 -0
- package/dist/chunk-XJBC3OYX.js +11 -0
- package/dist/chunk-XJBC3OYX.js.map +1 -0
- package/dist/{chunk-ZMREYTHA.js → chunk-XPRDXWK7.js} +8 -8
- package/dist/chunk-XPRDXWK7.js.map +1 -0
- package/dist/chunk-YKRQSZS7.js +96 -0
- package/dist/chunk-YKRQSZS7.js.map +1 -0
- package/dist/{chunk-IEVLWEBO.js → chunk-YMBL3VJB.js} +9 -8
- package/dist/chunk-YMBL3VJB.js.map +1 -0
- package/dist/{chunk-CGGO5NKD.js → chunk-YUJBXFYK.js} +357 -346
- package/dist/chunk-YUJBXFYK.js.map +1 -0
- package/dist/{chunk-S4KVLPBR.js → chunk-YZ4ZJNOL.js} +22 -10
- package/dist/chunk-YZ4ZJNOL.js.map +1 -0
- package/dist/chunk-ZTHVEXIV.js +11 -0
- package/dist/chunk-ZTHVEXIV.js.map +1 -0
- package/dist/{chunk-VHED2STW.js → chunk-ZVSYUCYS.js} +2 -1
- package/dist/chunk-ZVSYUCYS.js.map +1 -0
- package/dist/{config-T2IUIU5C.js → config-2YBCHU2W.js} +2 -2
- package/dist/{config-M3Z47VYU.js → config-3YRGRW72.js} +3 -2
- package/dist/config-4GSOMUMF.js +9 -0
- package/dist/config-5YBUWFUP.js +9 -0
- package/dist/{config-2LASFFRD.js → config-5ZRKJTKG.js} +3 -2
- package/dist/{config-W7EVPJNK.js → config-A25LTL5W.js} +2 -2
- package/dist/{config-WKQ3FGTZ.js → config-CLU7JABG.js} +2 -2
- package/dist/{config-E22XAGYN.js → config-D2RF7L3N.js} +2 -2
- package/dist/{config-HQXNFQZS.js → config-E55TKM6K.js} +2 -2
- package/dist/config-ELDOFRJW.js +9 -0
- package/dist/{config-EX3ZJTZI.js → config-FPC3RBFD.js} +2 -2
- package/dist/config-FPM3LAW7.js +9 -0
- package/dist/{config-IPNWAJHH.js → config-G3F54CS4.js} +3 -2
- package/dist/{config-BBOLI7VE.js → config-G43HRUI3.js} +2 -2
- package/dist/{config-QO2XUME4.js → config-GG3WO5PB.js} +3 -2
- package/dist/{config-QWQGOXQ5.js → config-JUYBWAZE.js} +2 -2
- package/dist/{config-SPW6NESU.js → config-LJ5T6TVA.js} +2 -2
- package/dist/{config-WVILHDFV.js → config-MDSAE4O3.js} +2 -2
- package/dist/{config-MZM3IPFM.js → config-NRIOKK5T.js} +2 -2
- package/dist/{config-L7SBSH5L.js → config-OYK2BSJK.js} +2 -2
- package/dist/config-PB3KA2CE.js +9 -0
- package/dist/{config-54USUVSE.js → config-QY4IL3PH.js} +3 -2
- package/dist/{config-VKKZGC7V.js → config-R4LAOEDS.js} +2 -2
- package/dist/{config-FRK7ZL37.js → config-RIAAD6RW.js} +3 -2
- package/dist/{config-J2C53GOT.js → config-SYNEQAUB.js} +2 -2
- package/dist/{config-XU6D5C7E.js → config-TJKGYA2B.js} +3 -2
- package/dist/{config-DWSJL3NH.js → config-UURRGA7U.js} +4 -2
- package/dist/{config-BIBFLUIR.js → config-VPLHQXVE.js} +2 -2
- package/dist/config-WRACCRPN.js +9 -0
- package/dist/{config-OJ2BPESH.js → config-WVHKXEVE.js} +3 -2
- package/dist/{config-CPYFOUQO.js → config-XU7R36IE.js} +3 -2
- package/dist/{config-A2GQYJDB.js → config-Y2KOUYSS.js} +2 -2
- package/dist/databricks_volume-CNCPTZHS.js +7 -0
- package/dist/digitalocean-DJZOUB6Q.js +11 -0
- package/dist/discord-ETB2CADR.js +7 -0
- package/dist/disk-WEHSTK3F.js +7 -0
- package/dist/dropbox-XN6PGLNE.js +8 -0
- package/dist/email-OV7XCP3T.js +8 -0
- package/dist/gcal-P56MRCGU.js +8 -0
- package/dist/gcs-HFBIAE2C.js +10 -0
- package/dist/gdocs-LQ3UXP3J.js +8 -0
- package/dist/gdrive-N6UBYLON.js +8 -0
- package/dist/github-BPZREGPI.js +8 -0
- package/dist/github_ci-7A4LUIZ7.js +8 -0
- package/dist/{gmail-2TBT4CVH.js → gmail-YED2MF6H.js} +2 -2
- package/dist/gridfs-CPLQ4G62.js +9 -0
- package/dist/gsheets-4BNIJPQ6.js +8 -0
- package/dist/gslides-GDBYLO5A.js +8 -0
- package/dist/hf_buckets-FTJITQ3P.js +10 -0
- package/dist/hf_datasets-6GXVKQD7.js +10 -0
- package/dist/hf_models-PJPGZAC5.js +10 -0
- package/dist/hf_spaces-LFNFOLBF.js +10 -0
- package/dist/index.d.ts +897 -609
- package/dist/index.js +2371 -781
- package/dist/index.js.map +1 -1
- package/dist/jaeger-GCA6MJ6E.js +8 -0
- package/dist/lancedb-TJ5YSJY5.js +7 -0
- package/dist/langfuse-RUMTUMXS.js +8 -0
- package/dist/linear-BCE4KEAC.js +7 -0
- package/dist/minio-5SO6KBTK.js +11 -0
- package/dist/mongodb-L5CMN2EE.js +7 -0
- package/dist/nextcloud-4O2LZVW2.js +9 -0
- package/dist/notion-RVKEAQ2M.js +7 -0
- package/dist/oci-OQXOIC62.js +10 -0
- package/dist/postgres-AV45GNRS.js +7 -0
- package/dist/qingstor-W277YA4K.js +11 -0
- package/dist/r2-FUA4IORE.js +10 -0
- package/dist/{redis-6D55Q2WB.js → redis-LPS357NF.js} +2 -2
- package/dist/s3-FPNWWIVM.js +8 -0
- package/dist/scaleway-BP3732U7.js +11 -0
- package/dist/seaweedfs-MC6HIEP4.js +11 -0
- package/dist/slack-JFGW7VLN.js +7 -0
- package/dist/ssh-UYPG42LM.js +8 -0
- package/dist/supabase-A3KUFMDC.js +10 -0
- package/dist/tencent-5464UQ2X.js +11 -0
- package/dist/trello-O2KB3FUO.js +8 -0
- package/dist/wasabi-2IKBIWNO.js +10 -0
- package/dist/wasabi-2IKBIWNO.js.map +1 -0
- package/package.json +15 -3
- package/dist/aliyun-PGI57A43.js +0 -10
- package/dist/backblaze-TSPL6Y56.js +0 -10
- package/dist/box-7XTZYDSO.js +0 -8
- package/dist/ceph-C265UI5T.js +0 -10
- package/dist/chunk-2ERLWAGG.js.map +0 -1
- package/dist/chunk-2QNPKPZZ.js +0 -59
- package/dist/chunk-2QNPKPZZ.js.map +0 -1
- package/dist/chunk-3ASOQTZB.js +0 -59
- package/dist/chunk-3ASOQTZB.js.map +0 -1
- package/dist/chunk-3JZN3GYO.js.map +0 -1
- package/dist/chunk-4GYB7DGC.js.map +0 -1
- package/dist/chunk-5YRWF5RP.js.map +0 -1
- package/dist/chunk-5ZHNPNDD.js.map +0 -1
- package/dist/chunk-AULFV3KY.js.map +0 -1
- package/dist/chunk-BWLUBJQG.js.map +0 -1
- package/dist/chunk-C7TNKIK5.js.map +0 -1
- package/dist/chunk-CB76WPUS.js.map +0 -1
- package/dist/chunk-CGGO5NKD.js.map +0 -1
- package/dist/chunk-CQCTCW4S.js.map +0 -1
- package/dist/chunk-D3U7VQCG.js +0 -25
- package/dist/chunk-D3U7VQCG.js.map +0 -1
- package/dist/chunk-E3KXVEYI.js.map +0 -1
- package/dist/chunk-EVK6HH6Z.js +0 -17
- package/dist/chunk-EVK6HH6Z.js.map +0 -1
- package/dist/chunk-FRGTDZQT.js.map +0 -1
- package/dist/chunk-GF75O2EN.js +0 -54
- package/dist/chunk-GF75O2EN.js.map +0 -1
- package/dist/chunk-GTAS3QVC.js +0 -25
- package/dist/chunk-GTAS3QVC.js.map +0 -1
- package/dist/chunk-H62XQZUM.js.map +0 -1
- package/dist/chunk-HCU3B6FW.js.map +0 -1
- package/dist/chunk-HEDE2377.js.map +0 -1
- package/dist/chunk-HGIPWY5Y.js.map +0 -1
- package/dist/chunk-HSD24IP2.js.map +0 -1
- package/dist/chunk-HWQPEBID.js.map +0 -1
- package/dist/chunk-IEHPTILN.js +0 -21
- package/dist/chunk-IEHPTILN.js.map +0 -1
- package/dist/chunk-IEVLWEBO.js.map +0 -1
- package/dist/chunk-IKJQOYI4.js +0 -26
- package/dist/chunk-IKJQOYI4.js.map +0 -1
- package/dist/chunk-IUXXZHY3.js.map +0 -1
- package/dist/chunk-JBDFYIN2.js.map +0 -1
- package/dist/chunk-JEBH5APX.js.map +0 -1
- package/dist/chunk-JHI2PHHD.js +0 -25
- package/dist/chunk-JHI2PHHD.js.map +0 -1
- package/dist/chunk-KAWDDS27.js.map +0 -1
- package/dist/chunk-KGC2OGXI.js +0 -27
- package/dist/chunk-KGC2OGXI.js.map +0 -1
- package/dist/chunk-LPLZLSMK.js.map +0 -1
- package/dist/chunk-M6E7VK4D.js.map +0 -1
- package/dist/chunk-MIQ3ECZM.js +0 -54
- package/dist/chunk-MIQ3ECZM.js.map +0 -1
- package/dist/chunk-MRXTUFBZ.js.map +0 -1
- package/dist/chunk-NJ42VNXG.js.map +0 -1
- package/dist/chunk-OSVZKYXS.js.map +0 -1
- package/dist/chunk-RHUEV4I7.js.map +0 -1
- package/dist/chunk-S4KVLPBR.js.map +0 -1
- package/dist/chunk-SAOQW6ZJ.js.map +0 -1
- package/dist/chunk-SI4GMRXD.js.map +0 -1
- package/dist/chunk-UAJYJP5C.js +0 -59
- package/dist/chunk-UAJYJP5C.js.map +0 -1
- package/dist/chunk-UYA3XL3J.js +0 -54
- package/dist/chunk-UYA3XL3J.js.map +0 -1
- package/dist/chunk-VBYIDRNU.js.map +0 -1
- package/dist/chunk-VHED2STW.js.map +0 -1
- package/dist/chunk-VIICUPWQ.js +0 -23
- package/dist/chunk-VIICUPWQ.js.map +0 -1
- package/dist/chunk-VLRSOWHP.js.map +0 -1
- package/dist/chunk-W5ZLIQFR.js.map +0 -1
- package/dist/chunk-WTSSEUOZ.js +0 -59
- package/dist/chunk-WTSSEUOZ.js.map +0 -1
- package/dist/chunk-WWP2STF5.js +0 -59
- package/dist/chunk-WWP2STF5.js.map +0 -1
- package/dist/chunk-XFSEADPC.js.map +0 -1
- package/dist/chunk-YBVMZ7SR.js +0 -59
- package/dist/chunk-YBVMZ7SR.js.map +0 -1
- package/dist/chunk-YRJICL2Q.js.map +0 -1
- package/dist/chunk-ZMREYTHA.js.map +0 -1
- package/dist/chunk-ZPB3SLPK.js.map +0 -1
- package/dist/chunk-ZPZQXHW2.js.map +0 -1
- package/dist/config-3WDIJPTG.js +0 -9
- package/dist/config-4QV4QYI5.js +0 -9
- package/dist/config-5ZXN2T2H.js +0 -9
- package/dist/config-EHE52ZTK.js +0 -9
- package/dist/config-HTXOOAOD.js +0 -9
- package/dist/config-K63RX6EU.js +0 -9
- package/dist/config-LEALEMKA.js +0 -9
- package/dist/config-RI7IEZUF.js +0 -9
- package/dist/databricks_volume-ETRDJVVQ.js +0 -7
- package/dist/digitalocean-QP72DR4J.js +0 -10
- package/dist/discord-BSN5RB3E.js +0 -8
- package/dist/disk-24NWTN2I.js +0 -7
- package/dist/dropbox-OSTZXSIE.js +0 -8
- package/dist/email-4ZFPSWIN.js +0 -8
- package/dist/gcs-PFWR6MIW.js +0 -10
- package/dist/gdocs-GPAZRQG5.js +0 -8
- package/dist/gdrive-XSX6A7B3.js +0 -8
- package/dist/github-EQ4NXUTA.js +0 -8
- package/dist/github_ci-QL5B2Q2N.js +0 -8
- package/dist/gridfs-KZRZ6SIB.js +0 -9
- package/dist/gsheets-N53WEXN2.js +0 -8
- package/dist/gslides-TATSARTH.js +0 -8
- package/dist/hf_buckets-BK7NGJWS.js +0 -10
- package/dist/hf_datasets-UQ5QGM4L.js +0 -10
- package/dist/hf_models-75LFCQCS.js +0 -10
- package/dist/hf_spaces-6T2KB3UC.js +0 -10
- package/dist/langfuse-AMQCQWNE.js +0 -8
- package/dist/linear-V3TXO6CV.js +0 -8
- package/dist/minio-IZRZY4C5.js +0 -10
- package/dist/mongodb-VMKPQCPX.js +0 -7
- package/dist/nextcloud-5RHQCGDO.js +0 -9
- package/dist/notion-6PPNTQFM.js +0 -8
- package/dist/oci-CKYBSFZJ.js +0 -10
- package/dist/postgres-WIQBVL5M.js +0 -7
- package/dist/qingstor-AP4IIPLY.js +0 -10
- package/dist/r2-C4XGEWQY.js +0 -10
- package/dist/s3-XQBI2CXN.js +0 -8
- package/dist/scaleway-SEZJVURB.js +0 -10
- package/dist/seaweedfs-3XYIAFU2.js +0 -10
- package/dist/slack-ZHXDJQY4.js +0 -8
- package/dist/ssh-X2MO7JOV.js +0 -8
- package/dist/supabase-BBM44UTM.js +0 -10
- package/dist/tencent-X72USLJ7.js +0 -10
- package/dist/trello-EER5NG7L.js +0 -8
- package/dist/wasabi-O4MVIUFG.js +0 -10
- /package/dist/{aliyun-PGI57A43.js.map → aliyun-S62BR3TB.js.map} +0 -0
- /package/dist/{backblaze-TSPL6Y56.js.map → backblaze-4EKSW63F.js.map} +0 -0
- /package/dist/{box-7XTZYDSO.js.map → box-ZPLZAGMK.js.map} +0 -0
- /package/dist/{ceph-C265UI5T.js.map → ceph-ALKLD3MO.js.map} +0 -0
- /package/dist/{chunk-4M73WHIE.js.map → chunk-BZTVYOES.js.map} +0 -0
- /package/dist/{chunk-BWWU5T2D.js.map → chunk-ENW5BVYN.js.map} +0 -0
- /package/dist/{chunk-F5NWRF32.js.map → chunk-ETIAW4YD.js.map} +0 -0
- /package/dist/{chunk-TUNR4VUM.js.map → chunk-GMMQ3ZK4.js.map} +0 -0
- /package/dist/{chunk-DXU7NZPH.js.map → chunk-HCRYAFBI.js.map} +0 -0
- /package/dist/{chunk-V7JVMG63.js.map → chunk-OXEQSPND.js.map} +0 -0
- /package/dist/{config-2LASFFRD.js.map → config-2YBCHU2W.js.map} +0 -0
- /package/dist/{config-3WDIJPTG.js.map → config-3YRGRW72.js.map} +0 -0
- /package/dist/{config-4QV4QYI5.js.map → config-4GSOMUMF.js.map} +0 -0
- /package/dist/{config-54USUVSE.js.map → config-5YBUWFUP.js.map} +0 -0
- /package/dist/{config-5ZXN2T2H.js.map → config-5ZRKJTKG.js.map} +0 -0
- /package/dist/{config-A2GQYJDB.js.map → config-A25LTL5W.js.map} +0 -0
- /package/dist/{config-BBOLI7VE.js.map → config-CLU7JABG.js.map} +0 -0
- /package/dist/{config-BIBFLUIR.js.map → config-D2RF7L3N.js.map} +0 -0
- /package/dist/{config-CPYFOUQO.js.map → config-E55TKM6K.js.map} +0 -0
- /package/dist/{config-DWSJL3NH.js.map → config-ELDOFRJW.js.map} +0 -0
- /package/dist/{config-E22XAGYN.js.map → config-FPC3RBFD.js.map} +0 -0
- /package/dist/{config-EHE52ZTK.js.map → config-FPM3LAW7.js.map} +0 -0
- /package/dist/{config-EX3ZJTZI.js.map → config-G3F54CS4.js.map} +0 -0
- /package/dist/{config-FRK7ZL37.js.map → config-G43HRUI3.js.map} +0 -0
- /package/dist/{config-HQXNFQZS.js.map → config-GG3WO5PB.js.map} +0 -0
- /package/dist/{config-HTXOOAOD.js.map → config-JUYBWAZE.js.map} +0 -0
- /package/dist/{config-IPNWAJHH.js.map → config-LJ5T6TVA.js.map} +0 -0
- /package/dist/{config-J2C53GOT.js.map → config-MDSAE4O3.js.map} +0 -0
- /package/dist/{config-K63RX6EU.js.map → config-NRIOKK5T.js.map} +0 -0
- /package/dist/{config-L7SBSH5L.js.map → config-OYK2BSJK.js.map} +0 -0
- /package/dist/{config-LEALEMKA.js.map → config-PB3KA2CE.js.map} +0 -0
- /package/dist/{config-M3Z47VYU.js.map → config-QY4IL3PH.js.map} +0 -0
- /package/dist/{config-MZM3IPFM.js.map → config-R4LAOEDS.js.map} +0 -0
- /package/dist/{config-OJ2BPESH.js.map → config-RIAAD6RW.js.map} +0 -0
- /package/dist/{config-QO2XUME4.js.map → config-SYNEQAUB.js.map} +0 -0
- /package/dist/{config-QWQGOXQ5.js.map → config-TJKGYA2B.js.map} +0 -0
- /package/dist/{config-RI7IEZUF.js.map → config-UURRGA7U.js.map} +0 -0
- /package/dist/{config-SPW6NESU.js.map → config-VPLHQXVE.js.map} +0 -0
- /package/dist/{config-T2IUIU5C.js.map → config-WRACCRPN.js.map} +0 -0
- /package/dist/{config-VKKZGC7V.js.map → config-WVHKXEVE.js.map} +0 -0
- /package/dist/{config-W7EVPJNK.js.map → config-XU7R36IE.js.map} +0 -0
- /package/dist/{config-WKQ3FGTZ.js.map → config-Y2KOUYSS.js.map} +0 -0
- /package/dist/{config-WVILHDFV.js.map → databricks_volume-CNCPTZHS.js.map} +0 -0
- /package/dist/{config-XU6D5C7E.js.map → digitalocean-DJZOUB6Q.js.map} +0 -0
- /package/dist/{databricks_volume-ETRDJVVQ.js.map → discord-ETB2CADR.js.map} +0 -0
- /package/dist/{digitalocean-QP72DR4J.js.map → disk-WEHSTK3F.js.map} +0 -0
- /package/dist/{discord-BSN5RB3E.js.map → dropbox-XN6PGLNE.js.map} +0 -0
- /package/dist/{disk-24NWTN2I.js.map → email-OV7XCP3T.js.map} +0 -0
- /package/dist/{dropbox-OSTZXSIE.js.map → gcal-P56MRCGU.js.map} +0 -0
- /package/dist/{email-4ZFPSWIN.js.map → gcs-HFBIAE2C.js.map} +0 -0
- /package/dist/{gcs-PFWR6MIW.js.map → gdocs-LQ3UXP3J.js.map} +0 -0
- /package/dist/{gdocs-GPAZRQG5.js.map → gdrive-N6UBYLON.js.map} +0 -0
- /package/dist/{gdrive-XSX6A7B3.js.map → github-BPZREGPI.js.map} +0 -0
- /package/dist/{github-EQ4NXUTA.js.map → github_ci-7A4LUIZ7.js.map} +0 -0
- /package/dist/{github_ci-QL5B2Q2N.js.map → gmail-YED2MF6H.js.map} +0 -0
- /package/dist/{gmail-2TBT4CVH.js.map → gridfs-CPLQ4G62.js.map} +0 -0
- /package/dist/{gridfs-KZRZ6SIB.js.map → gsheets-4BNIJPQ6.js.map} +0 -0
- /package/dist/{gsheets-N53WEXN2.js.map → gslides-GDBYLO5A.js.map} +0 -0
- /package/dist/{gslides-TATSARTH.js.map → hf_buckets-FTJITQ3P.js.map} +0 -0
- /package/dist/{hf_buckets-BK7NGJWS.js.map → hf_datasets-6GXVKQD7.js.map} +0 -0
- /package/dist/{hf_datasets-UQ5QGM4L.js.map → hf_models-PJPGZAC5.js.map} +0 -0
- /package/dist/{hf_models-75LFCQCS.js.map → hf_spaces-LFNFOLBF.js.map} +0 -0
- /package/dist/{hf_spaces-6T2KB3UC.js.map → jaeger-GCA6MJ6E.js.map} +0 -0
- /package/dist/{langfuse-AMQCQWNE.js.map → lancedb-TJ5YSJY5.js.map} +0 -0
- /package/dist/{linear-V3TXO6CV.js.map → langfuse-RUMTUMXS.js.map} +0 -0
- /package/dist/{minio-IZRZY4C5.js.map → linear-BCE4KEAC.js.map} +0 -0
- /package/dist/{mongodb-VMKPQCPX.js.map → minio-5SO6KBTK.js.map} +0 -0
- /package/dist/{nextcloud-5RHQCGDO.js.map → mongodb-L5CMN2EE.js.map} +0 -0
- /package/dist/{notion-6PPNTQFM.js.map → nextcloud-4O2LZVW2.js.map} +0 -0
- /package/dist/{oci-CKYBSFZJ.js.map → notion-RVKEAQ2M.js.map} +0 -0
- /package/dist/{postgres-WIQBVL5M.js.map → oci-OQXOIC62.js.map} +0 -0
- /package/dist/{qingstor-AP4IIPLY.js.map → postgres-AV45GNRS.js.map} +0 -0
- /package/dist/{r2-C4XGEWQY.js.map → qingstor-W277YA4K.js.map} +0 -0
- /package/dist/{redis-6D55Q2WB.js.map → r2-FUA4IORE.js.map} +0 -0
- /package/dist/{s3-XQBI2CXN.js.map → redis-LPS357NF.js.map} +0 -0
- /package/dist/{scaleway-SEZJVURB.js.map → s3-FPNWWIVM.js.map} +0 -0
- /package/dist/{seaweedfs-3XYIAFU2.js.map → scaleway-BP3732U7.js.map} +0 -0
- /package/dist/{slack-ZHXDJQY4.js.map → seaweedfs-MC6HIEP4.js.map} +0 -0
- /package/dist/{ssh-X2MO7JOV.js.map → slack-JFGW7VLN.js.map} +0 -0
- /package/dist/{supabase-BBM44UTM.js.map → ssh-UYPG42LM.js.map} +0 -0
- /package/dist/{tencent-X72USLJ7.js.map → supabase-A3KUFMDC.js.map} +0 -0
- /package/dist/{trello-EER5NG7L.js.map → tencent-5464UQ2X.js.map} +0 -0
- /package/dist/{wasabi-O4MVIUFG.js.map → trello-O2KB3FUO.js.map} +0 -0
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
// src/resource/disk/disk.ts
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
chmod as chmod2,
|
|
4
|
+
mkdir as mkdir2,
|
|
5
|
+
readdir as readdir4,
|
|
6
|
+
readFile as readFile3,
|
|
7
|
+
stat as fsStat4,
|
|
8
|
+
statfs as fsStatfs,
|
|
9
|
+
writeFile as writeFile3
|
|
10
|
+
} from "fs/promises";
|
|
11
|
+
import path5 from "path";
|
|
4
12
|
import {
|
|
5
13
|
BaseResource,
|
|
14
|
+
CapacityState,
|
|
6
15
|
PathSpec,
|
|
7
|
-
ResourceName as
|
|
16
|
+
ResourceName as ResourceName8,
|
|
8
17
|
makeResolveGlob,
|
|
9
18
|
mountKey,
|
|
10
19
|
mountPrefixOf as mountPrefixOf2
|
|
11
20
|
} from "@struktoai/mirage-core";
|
|
12
21
|
|
|
13
22
|
// src/commands/builtin/disk/index.ts
|
|
14
|
-
import {
|
|
15
|
-
ResourceName as ResourceName5,
|
|
16
|
-
makeFiletypeCommands,
|
|
17
|
-
makeGenericCommands
|
|
18
|
-
} from "@struktoai/mirage-core";
|
|
23
|
+
import { ResourceName as ResourceName6, makeGenericCommands } from "@struktoai/mirage-core";
|
|
19
24
|
|
|
20
|
-
// src/core/disk/
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
25
|
+
// src/core/disk/append.ts
|
|
26
|
+
import { appendFile } from "fs/promises";
|
|
27
|
+
import { ResourceName, invalidateAfterWrite, record } from "@struktoai/mirage-core";
|
|
28
|
+
|
|
29
|
+
// src/core/disk/errors.ts
|
|
30
|
+
function diskError(err, spec) {
|
|
31
|
+
const code = err.code;
|
|
32
|
+
if (typeof code !== "string") return err;
|
|
33
|
+
const out = new Error(spec.virtual);
|
|
34
|
+
out.code = code;
|
|
35
|
+
out.virtualPath = spec.virtual;
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
23
38
|
|
|
24
39
|
// src/core/disk/utils.ts
|
|
25
40
|
import path from "path";
|
|
@@ -35,74 +50,17 @@ function resolveSafe(root, virtual) {
|
|
|
35
50
|
return resolved;
|
|
36
51
|
}
|
|
37
52
|
|
|
38
|
-
// src/core/disk/
|
|
39
|
-
async function
|
|
53
|
+
// src/core/disk/append.ts
|
|
54
|
+
async function appendBytes(accessor, p, data) {
|
|
40
55
|
const start = performance.now();
|
|
41
|
-
const virtual = path9.mountPath;
|
|
42
|
-
const full = resolveSafe(accessor.root, virtual);
|
|
43
|
-
let data;
|
|
44
|
-
try {
|
|
45
|
-
data = await readFile(full);
|
|
46
|
-
} catch (err) {
|
|
47
|
-
if (err.code === "ENOENT") {
|
|
48
|
-
throw enoent(path9);
|
|
49
|
-
}
|
|
50
|
-
throw err;
|
|
51
|
-
}
|
|
52
|
-
record("read", virtual, ResourceName.DISK, data.byteLength, start);
|
|
53
|
-
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// src/core/disk/stat.ts
|
|
57
|
-
import { stat as fsStat } from "fs/promises";
|
|
58
|
-
import path2 from "path";
|
|
59
|
-
import { enoent as enoent2, FileStat, FileType, guessType } from "@struktoai/mirage-core";
|
|
60
|
-
async function stat(accessor, p) {
|
|
61
56
|
const virtual = p.mountPath;
|
|
62
57
|
const full = resolveSafe(accessor.root, virtual);
|
|
63
|
-
let st;
|
|
64
58
|
try {
|
|
65
|
-
|
|
59
|
+
await appendFile(full, data);
|
|
66
60
|
} catch (err) {
|
|
67
|
-
|
|
68
|
-
throw enoent2(p);
|
|
69
|
-
}
|
|
70
|
-
throw err;
|
|
61
|
+
throw diskError(err, p);
|
|
71
62
|
}
|
|
72
|
-
|
|
73
|
-
const name = path2.basename(full);
|
|
74
|
-
if (st.isDirectory()) {
|
|
75
|
-
return new FileStat({
|
|
76
|
-
name,
|
|
77
|
-
size: null,
|
|
78
|
-
modified,
|
|
79
|
-
type: FileType.DIRECTORY,
|
|
80
|
-
mode: st.mode & 4095,
|
|
81
|
-
atime: st.atime.toISOString()
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return new FileStat({
|
|
85
|
-
name,
|
|
86
|
-
size: st.size,
|
|
87
|
-
modified,
|
|
88
|
-
fingerprint: modified,
|
|
89
|
-
type: guessType(name),
|
|
90
|
-
mode: st.mode & 4095,
|
|
91
|
-
atime: st.atime.toISOString()
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// src/core/disk/append.ts
|
|
96
|
-
import { appendFile, mkdir } from "fs/promises";
|
|
97
|
-
import path3 from "path";
|
|
98
|
-
import { ResourceName as ResourceName2, invalidateAfterWrite, record as record2 } from "@struktoai/mirage-core";
|
|
99
|
-
async function appendBytes(accessor, p, data) {
|
|
100
|
-
const start = performance.now();
|
|
101
|
-
const virtual = p.mountPath;
|
|
102
|
-
const full = resolveSafe(accessor.root, virtual);
|
|
103
|
-
await mkdir(path3.dirname(full), { recursive: true });
|
|
104
|
-
await appendFile(full, data);
|
|
105
|
-
record2("append", virtual, ResourceName2.DISK, data.byteLength, start);
|
|
63
|
+
record("append", virtual, ResourceName.DISK, data.byteLength, start);
|
|
106
64
|
await invalidateAfterWrite(p);
|
|
107
65
|
}
|
|
108
66
|
|
|
@@ -110,46 +68,51 @@ async function appendBytes(accessor, p, data) {
|
|
|
110
68
|
var SCOPE_ERROR = 5e4;
|
|
111
69
|
|
|
112
70
|
// src/core/disk/copy.ts
|
|
113
|
-
import { copyFile,
|
|
114
|
-
import
|
|
115
|
-
import { enoent as enoent3, invalidateAfterWrite as invalidateAfterWrite2 } from "@struktoai/mirage-core";
|
|
71
|
+
import { copyFile, stat } from "fs/promises";
|
|
72
|
+
import { invalidateAfterWrite as invalidateAfterWrite2 } from "@struktoai/mirage-core";
|
|
116
73
|
async function copy(accessor, src, dst) {
|
|
117
74
|
const s = resolveSafe(accessor.root, src.mountPath);
|
|
118
75
|
const d = resolveSafe(accessor.root, dst.mountPath);
|
|
119
|
-
await mkdir2(path4.dirname(d), { recursive: true });
|
|
120
76
|
try {
|
|
121
77
|
await copyFile(s, d);
|
|
122
78
|
} catch (err) {
|
|
79
|
+
let blame = dst;
|
|
123
80
|
if (err.code === "ENOENT") {
|
|
124
|
-
|
|
81
|
+
const srcMissing = await stat(s).then(
|
|
82
|
+
() => false,
|
|
83
|
+
() => true
|
|
84
|
+
);
|
|
85
|
+
if (srcMissing) blame = src;
|
|
125
86
|
}
|
|
126
|
-
throw err;
|
|
87
|
+
throw diskError(err, blame);
|
|
127
88
|
}
|
|
128
89
|
await invalidateAfterWrite2(dst);
|
|
129
90
|
}
|
|
130
91
|
|
|
131
92
|
// src/core/disk/write.ts
|
|
132
|
-
import {
|
|
133
|
-
import
|
|
134
|
-
import { ResourceName as ResourceName3, invalidateAfterWrite as invalidateAfterWrite3, record as record3 } from "@struktoai/mirage-core";
|
|
93
|
+
import { writeFile } from "fs/promises";
|
|
94
|
+
import { ResourceName as ResourceName2, invalidateAfterWrite as invalidateAfterWrite3, record as record2 } from "@struktoai/mirage-core";
|
|
135
95
|
async function writeBytes(accessor, p, data) {
|
|
136
96
|
const start = performance.now();
|
|
137
97
|
const virtual = p.mountPath;
|
|
138
98
|
const full = resolveSafe(accessor.root, virtual);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
99
|
+
try {
|
|
100
|
+
await writeFile(full, data);
|
|
101
|
+
} catch (err) {
|
|
102
|
+
throw diskError(err, p);
|
|
103
|
+
}
|
|
104
|
+
record2("write", virtual, ResourceName2.DISK, data.byteLength, start);
|
|
142
105
|
await invalidateAfterWrite3(p);
|
|
143
106
|
}
|
|
144
107
|
|
|
145
108
|
// src/core/disk/create.ts
|
|
146
|
-
function create(accessor,
|
|
147
|
-
return writeBytes(accessor,
|
|
109
|
+
function create(accessor, path6) {
|
|
110
|
+
return writeBytes(accessor, path6, new Uint8Array());
|
|
148
111
|
}
|
|
149
112
|
|
|
150
|
-
// src/core/disk/du.ts
|
|
113
|
+
// src/core/disk/du/walk.ts
|
|
151
114
|
import { readdir, stat as stat2 } from "fs/promises";
|
|
152
|
-
import
|
|
115
|
+
import path2 from "path";
|
|
153
116
|
async function walkSizes(full) {
|
|
154
117
|
let total = 0;
|
|
155
118
|
let st;
|
|
@@ -160,9 +123,9 @@ async function walkSizes(full) {
|
|
|
160
123
|
}
|
|
161
124
|
if (st.isFile()) return st.size;
|
|
162
125
|
if (!st.isDirectory()) return 0;
|
|
163
|
-
const
|
|
164
|
-
for (const e of
|
|
165
|
-
const child =
|
|
126
|
+
const entries2 = await readdir(full, { withFileTypes: true });
|
|
127
|
+
for (const e of entries2) {
|
|
128
|
+
const child = path2.join(full, e.name);
|
|
166
129
|
if (e.isDirectory()) total += await walkSizes(child);
|
|
167
130
|
else if (e.isFile()) {
|
|
168
131
|
try {
|
|
@@ -174,7 +137,7 @@ async function walkSizes(full) {
|
|
|
174
137
|
}
|
|
175
138
|
return total;
|
|
176
139
|
}
|
|
177
|
-
async function walkAll(accessor, full,
|
|
140
|
+
async function walkAll(accessor, full, entries2) {
|
|
178
141
|
let total = 0;
|
|
179
142
|
let st;
|
|
180
143
|
try {
|
|
@@ -183,21 +146,21 @@ async function walkAll(accessor, full, entries) {
|
|
|
183
146
|
return 0;
|
|
184
147
|
}
|
|
185
148
|
if (st.isFile()) {
|
|
186
|
-
const rel = "/" +
|
|
187
|
-
|
|
149
|
+
const rel = "/" + path2.relative(accessor.root, full).split(path2.sep).join("/");
|
|
150
|
+
entries2.push([rel, st.size]);
|
|
188
151
|
return st.size;
|
|
189
152
|
}
|
|
190
153
|
if (!st.isDirectory()) return 0;
|
|
191
154
|
const children = await readdir(full, { withFileTypes: true });
|
|
192
155
|
for (const e of children) {
|
|
193
|
-
const child =
|
|
156
|
+
const child = path2.join(full, e.name);
|
|
194
157
|
if (e.isDirectory()) {
|
|
195
|
-
total += await walkAll(accessor, child,
|
|
158
|
+
total += await walkAll(accessor, child, entries2);
|
|
196
159
|
} else if (e.isFile()) {
|
|
197
160
|
try {
|
|
198
161
|
const cst = await stat2(child);
|
|
199
|
-
const rel = "/" +
|
|
200
|
-
|
|
162
|
+
const rel = "/" + path2.relative(accessor.root, child).split(path2.sep).join("/");
|
|
163
|
+
entries2.push([rel, cst.size]);
|
|
201
164
|
total += cst.size;
|
|
202
165
|
} catch {
|
|
203
166
|
}
|
|
@@ -205,24 +168,29 @@ async function walkAll(accessor, full, entries) {
|
|
|
205
168
|
}
|
|
206
169
|
return total;
|
|
207
170
|
}
|
|
208
|
-
|
|
209
|
-
|
|
171
|
+
|
|
172
|
+
// src/core/disk/du/entries.ts
|
|
173
|
+
import { compareCodePoints } from "@struktoai/mirage-core";
|
|
174
|
+
async function entries(accessor, p) {
|
|
175
|
+
const virtual = norm(p.mountPath);
|
|
210
176
|
const full = resolveSafe(accessor.root, virtual);
|
|
211
|
-
|
|
177
|
+
const entries2 = [];
|
|
178
|
+
const total = await walkAll(accessor, full, entries2);
|
|
179
|
+
entries2.sort((a, b) => compareCodePoints(a[0], b[0]));
|
|
180
|
+
return [entries2, total];
|
|
212
181
|
}
|
|
213
|
-
|
|
214
|
-
|
|
182
|
+
|
|
183
|
+
// src/core/disk/du/size.ts
|
|
184
|
+
async function size(accessor, p) {
|
|
185
|
+
const virtual = p.mountPath;
|
|
215
186
|
const full = resolveSafe(accessor.root, virtual);
|
|
216
|
-
|
|
217
|
-
const total = await walkAll(accessor, full, entries);
|
|
218
|
-
entries.sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0);
|
|
219
|
-
return [entries, total];
|
|
187
|
+
return walkSizes(full);
|
|
220
188
|
}
|
|
221
189
|
|
|
222
190
|
// src/core/disk/exists.ts
|
|
223
191
|
import { access } from "fs/promises";
|
|
224
|
-
async function exists(accessor,
|
|
225
|
-
const full = resolveSafe(accessor.root,
|
|
192
|
+
async function exists(accessor, path6) {
|
|
193
|
+
const full = resolveSafe(accessor.root, path6.mountPath);
|
|
226
194
|
try {
|
|
227
195
|
await access(full);
|
|
228
196
|
return true;
|
|
@@ -233,23 +201,24 @@ async function exists(accessor, path9) {
|
|
|
233
201
|
|
|
234
202
|
// src/core/disk/find.ts
|
|
235
203
|
import { readdir as readdir2, stat as stat3 } from "fs/promises";
|
|
236
|
-
import
|
|
204
|
+
import path3 from "path";
|
|
237
205
|
import {
|
|
238
206
|
buildTree,
|
|
239
207
|
emitStartPath,
|
|
240
208
|
keep,
|
|
241
|
-
startBasename
|
|
209
|
+
startBasename,
|
|
210
|
+
compareCodePoints as compareCodePoints2
|
|
242
211
|
} from "@struktoai/mirage-core";
|
|
243
212
|
async function walk(ctx, full, current, depth) {
|
|
244
213
|
const opts = ctx.options;
|
|
245
214
|
if (opts.maxDepth !== null && opts.maxDepth !== void 0 && depth > opts.maxDepth) return;
|
|
246
|
-
let
|
|
215
|
+
let entries2;
|
|
247
216
|
try {
|
|
248
|
-
|
|
217
|
+
entries2 = await readdir2(full, { withFileTypes: true });
|
|
249
218
|
} catch {
|
|
250
219
|
return;
|
|
251
220
|
}
|
|
252
|
-
for (const e of
|
|
221
|
+
for (const e of entries2) {
|
|
253
222
|
const kind = e.isDirectory() ? "d" : "f";
|
|
254
223
|
const entryPath = current === "/" ? `/${e.name}` : `${current}/${e.name}`;
|
|
255
224
|
const entryName = e.name;
|
|
@@ -262,7 +231,7 @@ async function walk(ctx, full, current, depth) {
|
|
|
262
231
|
let isEmpty = null;
|
|
263
232
|
if (accept && opts.empty === true) {
|
|
264
233
|
try {
|
|
265
|
-
isEmpty = kind === "f" ? (await stat3(
|
|
234
|
+
isEmpty = kind === "f" ? (await stat3(path3.join(full, e.name))).size === 0 : (await readdir2(path3.join(full, e.name))).length === 0;
|
|
266
235
|
} catch {
|
|
267
236
|
isEmpty = null;
|
|
268
237
|
}
|
|
@@ -280,7 +249,7 @@ async function walk(ctx, full, current, depth) {
|
|
|
280
249
|
}
|
|
281
250
|
if (accept && kind === "f" && (opts.minSize !== null || opts.maxSize !== null || opts.mtimeMin !== null || opts.mtimeMax !== null)) {
|
|
282
251
|
try {
|
|
283
|
-
const st = await stat3(
|
|
252
|
+
const st = await stat3(path3.join(full, e.name));
|
|
284
253
|
if (opts.minSize !== null && opts.minSize !== void 0 && st.size < opts.minSize)
|
|
285
254
|
accept = false;
|
|
286
255
|
if (opts.maxSize !== null && opts.maxSize !== void 0 && st.size > opts.maxSize)
|
|
@@ -298,7 +267,7 @@ async function walk(ctx, full, current, depth) {
|
|
|
298
267
|
}
|
|
299
268
|
if (accept) ctx.results.push(entryPath);
|
|
300
269
|
if (kind === "d") {
|
|
301
|
-
await walk(ctx,
|
|
270
|
+
await walk(ctx, path3.join(full, e.name), entryPath, depth + 1);
|
|
302
271
|
}
|
|
303
272
|
}
|
|
304
273
|
}
|
|
@@ -344,31 +313,118 @@ async function find(accessor, p, options = {}) {
|
|
|
344
313
|
});
|
|
345
314
|
}
|
|
346
315
|
await walk({ accessor, base: virtual, baseDepth, options, tree, results }, full, virtual, 0);
|
|
347
|
-
results.sort();
|
|
316
|
+
results.sort(compareCodePoints2);
|
|
348
317
|
return results;
|
|
349
318
|
}
|
|
350
319
|
|
|
351
320
|
// src/core/disk/mkdir.ts
|
|
352
321
|
import { mkdir as fsMkdir } from "fs/promises";
|
|
353
|
-
import {
|
|
354
|
-
|
|
355
|
-
|
|
322
|
+
import {
|
|
323
|
+
invalidateAfterWrite as invalidateAfterWrite4,
|
|
324
|
+
invalidateAncestors,
|
|
325
|
+
norm as norm2
|
|
326
|
+
} from "@struktoai/mirage-core";
|
|
327
|
+
|
|
328
|
+
// src/core/disk/dest.ts
|
|
329
|
+
import { stat as fsStat } from "fs/promises";
|
|
330
|
+
import {
|
|
331
|
+
ancestors,
|
|
332
|
+
enotdir,
|
|
333
|
+
mountedPath
|
|
334
|
+
} from "@struktoai/mirage-core";
|
|
335
|
+
async function mkdirComponentError(root, spec, key) {
|
|
336
|
+
for (const component of ancestors(key)) {
|
|
337
|
+
try {
|
|
338
|
+
const st = await fsStat(resolveSafe(root, component));
|
|
339
|
+
if (!st.isDirectory()) return enotdir(mountedPath(spec, component));
|
|
340
|
+
} catch {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// src/core/disk/mkdir.ts
|
|
348
|
+
async function mkdir(accessor, path6, parents = false) {
|
|
349
|
+
const root = accessor.root;
|
|
350
|
+
const full = resolveSafe(root, path6.mountPath);
|
|
356
351
|
if (parents) {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
352
|
+
try {
|
|
353
|
+
await fsMkdir(full, { recursive: true });
|
|
354
|
+
} catch (err) {
|
|
355
|
+
const named = err.code === "ENOTDIR" ? await mkdirComponentError(root, path6, norm2(path6.mountPath)) : null;
|
|
356
|
+
throw named ?? diskError(err, path6);
|
|
357
|
+
}
|
|
358
|
+
await invalidateAfterWrite4(path6);
|
|
359
|
+
await invalidateAncestors(path6);
|
|
360
360
|
return;
|
|
361
361
|
}
|
|
362
362
|
try {
|
|
363
363
|
await fsMkdir(full);
|
|
364
364
|
} catch (err) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
throw diskError(err, path6);
|
|
366
|
+
}
|
|
367
|
+
await invalidateAfterWrite4(path6);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// src/core/disk/read.ts
|
|
371
|
+
import { open, readFile } from "fs/promises";
|
|
372
|
+
import { enoent, record as record3, ResourceName as ResourceName3 } from "@struktoai/mirage-core";
|
|
373
|
+
var CHUNK = 1 << 20;
|
|
374
|
+
async function read(accessor, path6) {
|
|
375
|
+
const start = performance.now();
|
|
376
|
+
const virtual = path6.mountPath;
|
|
377
|
+
const full = resolveSafe(accessor.root, virtual);
|
|
378
|
+
let data;
|
|
379
|
+
try {
|
|
380
|
+
data = await readFile(full);
|
|
381
|
+
} catch (err) {
|
|
382
|
+
if (err.code === "ENOENT") {
|
|
383
|
+
throw enoent(path6);
|
|
368
384
|
}
|
|
369
|
-
|
|
385
|
+
throw err;
|
|
386
|
+
}
|
|
387
|
+
record3("read", virtual, ResourceName3.DISK, data.byteLength, start);
|
|
388
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
389
|
+
}
|
|
390
|
+
async function readRange(accessor, path6, _index, offset, size2) {
|
|
391
|
+
const start = performance.now();
|
|
392
|
+
const virtual = path6.mountPath;
|
|
393
|
+
const full = resolveSafe(accessor.root, virtual);
|
|
394
|
+
let handle;
|
|
395
|
+
try {
|
|
396
|
+
handle = await open(full, "r");
|
|
397
|
+
} catch (err) {
|
|
398
|
+
if (err.code === "ENOENT") {
|
|
399
|
+
throw enoent(path6);
|
|
400
|
+
}
|
|
401
|
+
throw err;
|
|
402
|
+
}
|
|
403
|
+
try {
|
|
404
|
+
if (size2 !== null) {
|
|
405
|
+
const buf = Buffer.allocUnsafe(size2);
|
|
406
|
+
const { bytesRead } = await handle.read(buf, 0, size2, offset);
|
|
407
|
+
const out = new Uint8Array(buf.buffer, buf.byteOffset, bytesRead);
|
|
408
|
+
record3("read", virtual, ResourceName3.DISK, bytesRead, start);
|
|
409
|
+
return out;
|
|
410
|
+
}
|
|
411
|
+
const parts = [];
|
|
412
|
+
let total = 0;
|
|
413
|
+
let at = offset;
|
|
414
|
+
for (; ; ) {
|
|
415
|
+
const buf = Buffer.allocUnsafe(CHUNK);
|
|
416
|
+
const { bytesRead } = await handle.read(buf, 0, CHUNK, at);
|
|
417
|
+
if (bytesRead === 0) break;
|
|
418
|
+
parts.push(buf.subarray(0, bytesRead));
|
|
419
|
+
total += bytesRead;
|
|
420
|
+
at += bytesRead;
|
|
421
|
+
}
|
|
422
|
+
const joined = Buffer.concat(parts, total);
|
|
423
|
+
record3("read", virtual, ResourceName3.DISK, total, start);
|
|
424
|
+
return new Uint8Array(joined.buffer, joined.byteOffset, joined.byteLength);
|
|
425
|
+
} finally {
|
|
426
|
+
await handle.close();
|
|
370
427
|
}
|
|
371
|
-
await invalidateAfterWrite4(path9);
|
|
372
428
|
}
|
|
373
429
|
|
|
374
430
|
// src/core/disk/readdir.ts
|
|
@@ -376,13 +432,15 @@ import { readdir as fsReaddir } from "fs/promises";
|
|
|
376
432
|
import {
|
|
377
433
|
IndexEntry,
|
|
378
434
|
ResourceType,
|
|
379
|
-
|
|
435
|
+
enoent as enoent2,
|
|
436
|
+
enotdir as enotdir2,
|
|
380
437
|
mountPrefixOf,
|
|
381
|
-
rstripSlash
|
|
438
|
+
rstripSlash,
|
|
439
|
+
compareCodePoints as compareCodePoints3
|
|
382
440
|
} from "@struktoai/mirage-core";
|
|
383
|
-
async function readdir3(accessor,
|
|
384
|
-
const virtual =
|
|
385
|
-
const mountPrefix = mountPrefixOf(
|
|
441
|
+
async function readdir3(accessor, path6, index) {
|
|
442
|
+
const virtual = path6.pattern !== null ? path6.directory : path6.mountPath;
|
|
443
|
+
const mountPrefix = mountPrefixOf(path6.virtual, path6.resourcePath);
|
|
386
444
|
const virtualKey = rstripSlash(mountPrefix + virtual) || "/";
|
|
387
445
|
if (index !== void 0) {
|
|
388
446
|
const cached = await index.listDir(virtualKey);
|
|
@@ -391,18 +449,18 @@ async function readdir3(accessor, path9, index) {
|
|
|
391
449
|
}
|
|
392
450
|
}
|
|
393
451
|
const full = resolveSafe(accessor.root, virtual);
|
|
394
|
-
let
|
|
452
|
+
let entries2;
|
|
395
453
|
try {
|
|
396
|
-
|
|
454
|
+
entries2 = await fsReaddir(full);
|
|
397
455
|
} catch (err) {
|
|
398
456
|
const code = err.code;
|
|
399
|
-
if (code === "ENOTDIR") throw
|
|
400
|
-
if (code === "ENOENT") throw
|
|
457
|
+
if (code === "ENOTDIR") throw enotdir2(path6);
|
|
458
|
+
if (code === "ENOENT") throw enoent2(path6);
|
|
401
459
|
throw err;
|
|
402
460
|
}
|
|
403
461
|
const base = norm(virtual);
|
|
404
462
|
const dirPrefix = base === "/" ? "/" : `${base}/`;
|
|
405
|
-
const sorted = [...
|
|
463
|
+
const sorted = [...entries2].sort(compareCodePoints3);
|
|
406
464
|
const virtualEntries = sorted.map((e) => `${mountPrefix}${dirPrefix}${e}`);
|
|
407
465
|
if (index !== void 0) {
|
|
408
466
|
const indexEntries = sorted.map((name) => [
|
|
@@ -421,7 +479,7 @@ async function readdir3(accessor, path9, index) {
|
|
|
421
479
|
// src/core/disk/rename.ts
|
|
422
480
|
import { rename as fsRename } from "fs/promises";
|
|
423
481
|
import {
|
|
424
|
-
enoent as
|
|
482
|
+
enoent as enoent3,
|
|
425
483
|
invalidateAfterUnlink,
|
|
426
484
|
invalidateAfterWrite as invalidateAfterWrite5
|
|
427
485
|
} from "@struktoai/mirage-core";
|
|
@@ -432,7 +490,7 @@ async function rename(accessor, src, dst) {
|
|
|
432
490
|
await fsRename(s, d);
|
|
433
491
|
} catch (err) {
|
|
434
492
|
if (err.code === "ENOENT") {
|
|
435
|
-
throw
|
|
493
|
+
throw enoent3(src);
|
|
436
494
|
}
|
|
437
495
|
throw err;
|
|
438
496
|
}
|
|
@@ -443,36 +501,36 @@ async function rename(accessor, src, dst) {
|
|
|
443
501
|
// src/core/disk/rm.ts
|
|
444
502
|
import { rm } from "fs/promises";
|
|
445
503
|
import { invalidateAfterUnlink as invalidateAfterUnlink2 } from "@struktoai/mirage-core";
|
|
446
|
-
async function rmR(accessor,
|
|
447
|
-
const full = resolveSafe(accessor.root,
|
|
504
|
+
async function rmR(accessor, path6) {
|
|
505
|
+
const full = resolveSafe(accessor.root, path6.mountPath);
|
|
448
506
|
await rm(full, { recursive: true, force: true });
|
|
449
|
-
await invalidateAfterUnlink2(
|
|
507
|
+
await invalidateAfterUnlink2(path6);
|
|
450
508
|
}
|
|
451
509
|
|
|
452
510
|
// src/core/disk/rmdir.ts
|
|
453
511
|
import { rmdir as fsRmdir } from "fs/promises";
|
|
454
512
|
import { invalidateAfterUnlink as invalidateAfterUnlink3 } from "@struktoai/mirage-core";
|
|
455
|
-
async function rmdir(accessor,
|
|
456
|
-
const full = resolveSafe(accessor.root,
|
|
513
|
+
async function rmdir(accessor, path6) {
|
|
514
|
+
const full = resolveSafe(accessor.root, path6.mountPath);
|
|
457
515
|
try {
|
|
458
516
|
await fsRmdir(full);
|
|
459
517
|
} catch (err) {
|
|
460
518
|
if (err.code === "ENOENT") return;
|
|
461
519
|
throw err;
|
|
462
520
|
}
|
|
463
|
-
await invalidateAfterUnlink3(
|
|
521
|
+
await invalidateAfterUnlink3(path6);
|
|
464
522
|
}
|
|
465
523
|
|
|
466
524
|
// src/core/disk/set_attrs.ts
|
|
467
525
|
import { chmod, stat as fsStat2, utimes } from "fs/promises";
|
|
468
|
-
import { enoent as
|
|
469
|
-
async function setAttrs(accessor,
|
|
470
|
-
const full = resolveSafe(accessor.root,
|
|
526
|
+
import { enoent as enoent4 } from "@struktoai/mirage-core";
|
|
527
|
+
async function setAttrs(accessor, path6, fields) {
|
|
528
|
+
const full = resolveSafe(accessor.root, path6.mountPath);
|
|
471
529
|
let st;
|
|
472
530
|
try {
|
|
473
531
|
st = await fsStat2(full);
|
|
474
532
|
} catch (err) {
|
|
475
|
-
if (err.code === "ENOENT") throw
|
|
533
|
+
if (err.code === "ENOENT") throw enoent4(path6);
|
|
476
534
|
throw err;
|
|
477
535
|
}
|
|
478
536
|
const residual = {};
|
|
@@ -491,11 +549,47 @@ async function setAttrs(accessor, path9, fields) {
|
|
|
491
549
|
return residual;
|
|
492
550
|
}
|
|
493
551
|
|
|
552
|
+
// src/core/disk/stat.ts
|
|
553
|
+
import { stat as fsStat3 } from "fs/promises";
|
|
554
|
+
import path4 from "path";
|
|
555
|
+
import { FileStat, FileType, guessType } from "@struktoai/mirage-core";
|
|
556
|
+
async function stat4(accessor, p) {
|
|
557
|
+
const virtual = p.mountPath;
|
|
558
|
+
const full = resolveSafe(accessor.root, virtual);
|
|
559
|
+
let st;
|
|
560
|
+
try {
|
|
561
|
+
st = await fsStat3(full);
|
|
562
|
+
} catch (err) {
|
|
563
|
+
throw diskError(err, p);
|
|
564
|
+
}
|
|
565
|
+
const modified = st.mtime.toISOString();
|
|
566
|
+
const name = path4.basename(full);
|
|
567
|
+
if (st.isDirectory()) {
|
|
568
|
+
return new FileStat({
|
|
569
|
+
name,
|
|
570
|
+
size: null,
|
|
571
|
+
modified,
|
|
572
|
+
type: FileType.DIRECTORY,
|
|
573
|
+
mode: st.mode & 4095,
|
|
574
|
+
atime: st.atime.toISOString()
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
return new FileStat({
|
|
578
|
+
name,
|
|
579
|
+
size: st.size,
|
|
580
|
+
modified,
|
|
581
|
+
fingerprint: modified,
|
|
582
|
+
type: guessType(name),
|
|
583
|
+
mode: st.mode & 4095,
|
|
584
|
+
atime: st.atime.toISOString()
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
|
|
494
588
|
// src/core/disk/stream.ts
|
|
495
589
|
import { createReadStream } from "fs";
|
|
496
|
-
import { enoent as
|
|
497
|
-
async function* stream(accessor,
|
|
498
|
-
const virtual =
|
|
590
|
+
import { enoent as enoent5, recordStream, ResourceName as ResourceName4 } from "@struktoai/mirage-core";
|
|
591
|
+
async function* stream(accessor, path6) {
|
|
592
|
+
const virtual = path6.mountPath;
|
|
499
593
|
const full = resolveSafe(accessor.root, virtual);
|
|
500
594
|
const rec = recordStream("read", virtual, ResourceName4.DISK);
|
|
501
595
|
const rs = createReadStream(full, { highWaterMark: 65536 });
|
|
@@ -508,7 +602,7 @@ async function* stream(accessor, path9) {
|
|
|
508
602
|
}
|
|
509
603
|
} catch (err) {
|
|
510
604
|
if (err.code === "ENOENT") {
|
|
511
|
-
throw
|
|
605
|
+
throw enoent5(path6);
|
|
512
606
|
}
|
|
513
607
|
throw err;
|
|
514
608
|
}
|
|
@@ -516,9 +610,10 @@ async function* stream(accessor, path9) {
|
|
|
516
610
|
|
|
517
611
|
// src/core/disk/truncate.ts
|
|
518
612
|
import { readFile as readFile2, writeFile as writeFile2 } from "fs/promises";
|
|
519
|
-
import { invalidateAfterWrite as invalidateAfterWrite6 } from "@struktoai/mirage-core";
|
|
520
|
-
async function truncate(accessor,
|
|
521
|
-
const
|
|
613
|
+
import { ResourceName as ResourceName5, invalidateAfterWrite as invalidateAfterWrite6, record as record4 } from "@struktoai/mirage-core";
|
|
614
|
+
async function truncate(accessor, path6, length) {
|
|
615
|
+
const start = performance.now();
|
|
616
|
+
const full = resolveSafe(accessor.root, path6.mountPath);
|
|
522
617
|
let data;
|
|
523
618
|
try {
|
|
524
619
|
data = await readFile2(full);
|
|
@@ -532,35 +627,37 @@ async function truncate(accessor, path9, length) {
|
|
|
532
627
|
const out = new Uint8Array(length);
|
|
533
628
|
out.set(data.subarray(0, Math.min(data.byteLength, length)));
|
|
534
629
|
await writeFile2(full, out);
|
|
535
|
-
|
|
630
|
+
record4("truncate", path6.mountPath, ResourceName5.DISK, 0, start);
|
|
631
|
+
await invalidateAfterWrite6(path6);
|
|
536
632
|
}
|
|
537
633
|
|
|
538
634
|
// src/core/disk/unlink.ts
|
|
539
635
|
import { unlink as fsUnlink } from "fs/promises";
|
|
540
636
|
import { invalidateAfterUnlink as invalidateAfterUnlink4 } from "@struktoai/mirage-core";
|
|
541
|
-
async function unlink(accessor,
|
|
542
|
-
const full = resolveSafe(accessor.root,
|
|
637
|
+
async function unlink(accessor, path6) {
|
|
638
|
+
const full = resolveSafe(accessor.root, path6.mountPath);
|
|
543
639
|
try {
|
|
544
640
|
await fsUnlink(full);
|
|
545
641
|
} catch (err) {
|
|
546
642
|
if (err.code === "ENOENT") return;
|
|
547
643
|
throw err;
|
|
548
644
|
}
|
|
549
|
-
await invalidateAfterUnlink4(
|
|
645
|
+
await invalidateAfterUnlink4(path6);
|
|
550
646
|
}
|
|
551
647
|
|
|
552
648
|
// src/commands/builtin/disk/io.ts
|
|
553
649
|
var DISK_IO = {
|
|
554
650
|
readdir: readdir3,
|
|
555
651
|
readBytes: read,
|
|
652
|
+
readRange,
|
|
556
653
|
readStream: stream,
|
|
557
|
-
stat,
|
|
654
|
+
stat: stat4,
|
|
558
655
|
isMounted: (a) => a.root !== "",
|
|
559
656
|
local: true,
|
|
560
657
|
maxGlobMatches: SCOPE_ERROR,
|
|
561
658
|
write: writeBytes,
|
|
562
659
|
exists,
|
|
563
|
-
mkdir
|
|
660
|
+
mkdir,
|
|
564
661
|
unlink,
|
|
565
662
|
rmdir,
|
|
566
663
|
rmR,
|
|
@@ -571,18 +668,12 @@ var DISK_IO = {
|
|
|
571
668
|
append: appendBytes,
|
|
572
669
|
setAttrs,
|
|
573
670
|
find,
|
|
574
|
-
|
|
575
|
-
duAll
|
|
671
|
+
du: { size, entries }
|
|
576
672
|
};
|
|
577
673
|
|
|
578
674
|
// src/commands/builtin/disk/index.ts
|
|
579
675
|
var DISK_COMMANDS = [
|
|
580
|
-
...
|
|
581
|
-
resource: ResourceName5.DISK,
|
|
582
|
-
readBytes: read,
|
|
583
|
-
statEntry: stat
|
|
584
|
-
}),
|
|
585
|
-
...makeGenericCommands(ResourceName5.DISK, DISK_IO)
|
|
676
|
+
...makeGenericCommands(ResourceName6.DISK, DISK_IO)
|
|
586
677
|
];
|
|
587
678
|
|
|
588
679
|
// src/accessor/disk.ts
|
|
@@ -596,11 +687,9 @@ var DiskAccessor = class extends Accessor {
|
|
|
596
687
|
};
|
|
597
688
|
|
|
598
689
|
// src/ops/disk/index.ts
|
|
599
|
-
import { ResourceName as
|
|
600
|
-
var DISK_OPS = makeGenericOps(
|
|
601
|
-
|
|
602
|
-
mkdirParents: true,
|
|
603
|
-
forwardIndex: false
|
|
690
|
+
import { ResourceName as ResourceName7, makeGenericOps } from "@struktoai/mirage-core";
|
|
691
|
+
var DISK_OPS = makeGenericOps(ResourceName7.DISK, DISK_IO, {
|
|
692
|
+
mkdirParents: true
|
|
604
693
|
});
|
|
605
694
|
|
|
606
695
|
// src/resource/disk/prompt.ts
|
|
@@ -611,9 +700,9 @@ var DISK_PROMPT = `{prefix}
|
|
|
611
700
|
// src/resource/disk/disk.ts
|
|
612
701
|
var globCore = makeResolveGlob(readdir3, SCOPE_ERROR);
|
|
613
702
|
async function walkFiles(root, current, out) {
|
|
614
|
-
const
|
|
615
|
-
for (const e of
|
|
616
|
-
const child =
|
|
703
|
+
const entries2 = await readdir4(current, { withFileTypes: true });
|
|
704
|
+
for (const e of entries2) {
|
|
705
|
+
const child = path5.join(current, e.name);
|
|
617
706
|
if (e.isDirectory()) {
|
|
618
707
|
await walkFiles(root, child, out);
|
|
619
708
|
} else if (e.isFile()) {
|
|
@@ -622,8 +711,10 @@ async function walkFiles(root, current, out) {
|
|
|
622
711
|
}
|
|
623
712
|
}
|
|
624
713
|
var DiskResource = class extends BaseResource {
|
|
625
|
-
kind =
|
|
714
|
+
kind = ResourceName8.DISK;
|
|
626
715
|
cachesReads = false;
|
|
716
|
+
// byte store: stat() sizes every file from metadata
|
|
717
|
+
sizesAlwaysKnown = true;
|
|
627
718
|
indexTtl = 60;
|
|
628
719
|
prompt = DISK_PROMPT;
|
|
629
720
|
root;
|
|
@@ -632,16 +723,16 @@ var DiskResource = class extends BaseResource {
|
|
|
632
723
|
read_bytes: read,
|
|
633
724
|
write: writeBytes,
|
|
634
725
|
readdir: readdir3,
|
|
635
|
-
stat,
|
|
726
|
+
stat: stat4,
|
|
636
727
|
unlink,
|
|
637
728
|
rmdir,
|
|
638
729
|
copy,
|
|
639
730
|
rename,
|
|
640
|
-
mkdir
|
|
731
|
+
mkdir,
|
|
641
732
|
read_stream: stream,
|
|
642
733
|
rm_recursive: rmR,
|
|
643
|
-
|
|
644
|
-
|
|
734
|
+
du_size: size,
|
|
735
|
+
du_entries: entries,
|
|
645
736
|
create,
|
|
646
737
|
truncate,
|
|
647
738
|
exists,
|
|
@@ -650,14 +741,31 @@ var DiskResource = class extends BaseResource {
|
|
|
650
741
|
};
|
|
651
742
|
constructor(options) {
|
|
652
743
|
super();
|
|
653
|
-
this.root =
|
|
744
|
+
this.root = path5.resolve(options.root);
|
|
654
745
|
this.accessor = new DiskAccessor(this.root);
|
|
655
746
|
}
|
|
747
|
+
// The resolved root is the storage: two DiskResources built on the same
|
|
748
|
+
// directory are one store, however they were spelled.
|
|
749
|
+
storageId() {
|
|
750
|
+
return `${this.kind}:${this.root}`;
|
|
751
|
+
}
|
|
656
752
|
async open() {
|
|
657
|
-
await
|
|
753
|
+
await mkdir2(this.root, { recursive: true });
|
|
658
754
|
}
|
|
659
|
-
|
|
660
|
-
|
|
755
|
+
// A real filesystem reports real numbers (QUOTA). GNU df: used counts
|
|
756
|
+
// reserved blocks (blocks - bfree), available excludes them (bavail).
|
|
757
|
+
async statfs() {
|
|
758
|
+
const st = await fsStatfs(this.root);
|
|
759
|
+
const bsize = st.bsize;
|
|
760
|
+
return {
|
|
761
|
+
state: CapacityState.QUOTA,
|
|
762
|
+
total: st.blocks * bsize,
|
|
763
|
+
used: (st.blocks - st.bfree) * bsize,
|
|
764
|
+
available: st.bavail * bsize,
|
|
765
|
+
inodes: st.files,
|
|
766
|
+
inodesUsed: st.files - st.ffree,
|
|
767
|
+
inodesFree: st.ffree
|
|
768
|
+
};
|
|
661
769
|
}
|
|
662
770
|
ops() {
|
|
663
771
|
return DISK_OPS;
|
|
@@ -681,13 +789,13 @@ var DiskResource = class extends BaseResource {
|
|
|
681
789
|
return readdir3(this.accessor, p, this.index);
|
|
682
790
|
}
|
|
683
791
|
stat(p) {
|
|
684
|
-
return
|
|
792
|
+
return stat4(this.accessor, p);
|
|
685
793
|
}
|
|
686
794
|
exists(p) {
|
|
687
795
|
return exists(this.accessor, p);
|
|
688
796
|
}
|
|
689
797
|
mkdir(p, options) {
|
|
690
|
-
return
|
|
798
|
+
return mkdir(this.accessor, p, options?.recursive === true);
|
|
691
799
|
}
|
|
692
800
|
rmdir(p) {
|
|
693
801
|
return rmdir(this.accessor, p);
|
|
@@ -708,7 +816,7 @@ var DiskResource = class extends BaseResource {
|
|
|
708
816
|
return rmR(this.accessor, p);
|
|
709
817
|
}
|
|
710
818
|
du(p) {
|
|
711
|
-
return
|
|
819
|
+
return size(this.accessor, p);
|
|
712
820
|
}
|
|
713
821
|
find(p, options = {}) {
|
|
714
822
|
return find(this.accessor, p, options);
|
|
@@ -726,16 +834,16 @@ var DiskResource = class extends BaseResource {
|
|
|
726
834
|
return globCore(this.accessor, effective, this.index);
|
|
727
835
|
}
|
|
728
836
|
async getState() {
|
|
729
|
-
await
|
|
837
|
+
await mkdir2(this.root, { recursive: true });
|
|
730
838
|
const files = {};
|
|
731
839
|
const modes = {};
|
|
732
840
|
const fileList = [];
|
|
733
841
|
await walkFiles(this.root, this.root, fileList);
|
|
734
842
|
for (const full of fileList) {
|
|
735
|
-
const rel =
|
|
843
|
+
const rel = path5.relative(this.root, full).split(path5.sep).join("/");
|
|
736
844
|
const data = await readFile3(full);
|
|
737
845
|
files[rel] = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
738
|
-
modes[rel] = (await
|
|
846
|
+
modes[rel] = (await fsStat4(full)).mode & 4095;
|
|
739
847
|
}
|
|
740
848
|
return {
|
|
741
849
|
type: this.kind,
|
|
@@ -744,10 +852,10 @@ var DiskResource = class extends BaseResource {
|
|
|
744
852
|
};
|
|
745
853
|
}
|
|
746
854
|
async loadState(state) {
|
|
747
|
-
await
|
|
855
|
+
await mkdir2(this.root, { recursive: true });
|
|
748
856
|
for (const [rel, data] of Object.entries(state.files)) {
|
|
749
|
-
const full =
|
|
750
|
-
await
|
|
857
|
+
const full = path5.join(this.root, rel);
|
|
858
|
+
await mkdir2(path5.dirname(full), { recursive: true });
|
|
751
859
|
await writeFile3(full, data);
|
|
752
860
|
const mode = state.modes?.[rel];
|
|
753
861
|
if (mode !== void 0) await chmod2(full, mode);
|
|
@@ -761,4 +869,4 @@ export {
|
|
|
761
869
|
DISK_PROMPT,
|
|
762
870
|
DiskResource
|
|
763
871
|
};
|
|
764
|
-
//# sourceMappingURL=chunk-
|
|
872
|
+
//# sourceMappingURL=chunk-WG5YS6TC.js.map
|