@struktoai/mirage-node 0.0.3 → 0.0.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/cas.lua +15 -0
- package/dist/ceph-ALKLD3MO.js +11 -0
- package/dist/{chunk-QCZ2XUKH.js → chunk-2A4YGVBM.js} +16 -23
- 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-UT2OPSN4.js → chunk-3JZQ6VSZ.js} +5 -5
- 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-47AVIIOT.js → chunk-5H6KNEPP.js} +4 -5
- package/dist/{chunk-47AVIIOT.js.map → chunk-5H6KNEPP.js.map} +1 -1
- package/dist/{chunk-I5THIMPP.js → chunk-5K2MWDCE.js} +6 -7
- package/dist/{chunk-I5THIMPP.js.map → chunk-5K2MWDCE.js.map} +1 -1
- package/dist/{chunk-3WIO7NBR.js → chunk-6SVXWRKX.js} +4 -5
- package/dist/{chunk-3WIO7NBR.js.map → chunk-6SVXWRKX.js.map} +1 -1
- package/dist/{chunk-RQK5UPMP.js → chunk-6VOIUGAD.js} +25 -12
- package/dist/chunk-6VOIUGAD.js.map +1 -0
- package/dist/{chunk-NOHWIBRX.js → chunk-7JYHFXXC.js} +15 -20
- 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-SWCDFEUK.js → chunk-ADEXNSYU.js} +20 -22
- 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-RO5IQEDQ.js → chunk-ATLXMNKD.js} +8 -4
- package/dist/chunk-ATLXMNKD.js.map +1 -0
- package/dist/{chunk-MPCCRRE6.js → chunk-BYCUGFRF.js} +16 -16
- package/dist/chunk-BYCUGFRF.js.map +1 -0
- package/dist/{chunk-HJJMP6IX.js → chunk-BZTVYOES.js} +3 -3
- package/dist/{chunk-B2ZOKNN4.js → chunk-CRC4YWXB.js} +27 -9
- package/dist/chunk-CRC4YWXB.js.map +1 -0
- package/dist/chunk-CTGXJHO5.js +39 -0
- package/dist/chunk-CTGXJHO5.js.map +1 -0
- package/dist/{chunk-Q2IAILVC.js → chunk-DCDBIXVZ.js} +14 -5
- package/dist/chunk-DCDBIXVZ.js.map +1 -0
- package/dist/chunk-DDAFNROK.js +750 -0
- 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-QGRDPSAH.js → chunk-EBI4IHDC.js} +23 -12
- package/dist/chunk-EBI4IHDC.js.map +1 -0
- package/dist/{chunk-JAGJTM3Q.js → chunk-EIUTZ6N7.js} +19 -34
- package/dist/chunk-EIUTZ6N7.js.map +1 -0
- package/dist/{chunk-TA3WMOMU.js → chunk-EJZG5VUF.js} +38 -32
- package/dist/chunk-EJZG5VUF.js.map +1 -0
- package/dist/{chunk-X5HF2OFP.js → chunk-ENW5BVYN.js} +3 -3
- package/dist/{chunk-HGCRXJGP.js → chunk-ETIAW4YD.js} +3 -3
- package/dist/chunk-EUPXAYPB.js +20 -0
- package/dist/chunk-EUPXAYPB.js.map +1 -0
- package/dist/{chunk-YAHRT6MB.js → chunk-FA6YNU75.js} +4 -5
- package/dist/{chunk-YAHRT6MB.js.map → chunk-FA6YNU75.js.map} +1 -1
- package/dist/{chunk-TWGVQLG2.js → chunk-FFH6R5VQ.js} +7 -3
- package/dist/chunk-FFH6R5VQ.js.map +1 -0
- package/dist/{chunk-JCC4CU2I.js → chunk-GE6H2COM.js} +15 -23
- package/dist/chunk-GE6H2COM.js.map +1 -0
- package/dist/{chunk-DM4GSE26.js → chunk-GMMQ3ZK4.js} +3 -3
- package/dist/{chunk-ZEGAMJO2.js → chunk-GSGE3M5P.js} +15 -23
- package/dist/chunk-GSGE3M5P.js.map +1 -0
- package/dist/{chunk-GCFYZSVR.js → chunk-H64SB6VO.js} +32 -13
- package/dist/chunk-H64SB6VO.js.map +1 -0
- package/dist/{chunk-N5FSLVKO.js → chunk-HCRYAFBI.js} +3 -3
- package/dist/{chunk-IDYHQQOH.js → chunk-HOPUP6LA.js} +358 -471
- 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-FQ33BYFR.js → chunk-I7CPLZNW.js} +4 -5
- package/dist/{chunk-FQ33BYFR.js.map → chunk-I7CPLZNW.js.map} +1 -1
- package/dist/{chunk-VGLHY6BK.js → chunk-IFUCGI4I.js} +7 -3
- package/dist/chunk-IFUCGI4I.js.map +1 -0
- package/dist/{chunk-RNQN2FOU.js → chunk-IFYXSSKR.js} +24 -13
- 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-7CW3BMPH.js → chunk-JJERW2BI.js} +4 -5
- package/dist/{chunk-7CW3BMPH.js.map → chunk-JJERW2BI.js.map} +1 -1
- package/dist/{chunk-EM4J5EQS.js → chunk-JQR4HVUX.js} +13 -16
- package/dist/chunk-JQR4HVUX.js.map +1 -0
- package/dist/{chunk-VWKUT4CW.js → chunk-JXOMDLFS.js} +21 -26
- package/dist/chunk-JXOMDLFS.js.map +1 -0
- package/dist/chunk-KIX6N7NT.js +1001 -0
- package/dist/chunk-KIX6N7NT.js.map +1 -0
- package/dist/{chunk-OZAEWZZ3.js → chunk-L42UTDFK.js} +12 -3
- package/dist/chunk-L42UTDFK.js.map +1 -0
- package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
- package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
- package/dist/chunk-M2UF2JHJ.js +11 -0
- package/dist/chunk-M2UF2JHJ.js.map +1 -0
- package/dist/{chunk-UGK4TAVK.js → chunk-MONC734W.js} +7 -3
- package/dist/chunk-MONC734W.js.map +1 -0
- package/dist/{chunk-IK2L4EN3.js → chunk-N72RLCMU.js} +4 -5
- package/dist/{chunk-IK2L4EN3.js.map → chunk-N72RLCMU.js.map} +1 -1
- package/dist/{chunk-H3I2KZIY.js → chunk-ND4IWJ4V.js} +7 -3
- package/dist/chunk-ND4IWJ4V.js.map +1 -0
- package/dist/chunk-NZ3EKGW4.js +1312 -0
- package/dist/chunk-NZ3EKGW4.js.map +1 -0
- package/dist/{chunk-XGJ2QERC.js → chunk-OAE57MNL.js} +27 -11
- package/dist/chunk-OAE57MNL.js.map +1 -0
- package/dist/{chunk-EZQ5HBAC.js → chunk-OHKGIQB4.js} +12 -16
- package/dist/chunk-OHKGIQB4.js.map +1 -0
- package/dist/{chunk-E2ISWXLB.js → chunk-OQKNDS66.js} +1 -1
- package/dist/{chunk-E2ISWXLB.js.map → chunk-OQKNDS66.js.map} +1 -1
- package/dist/{chunk-UINQOUZR.js → chunk-OXEQSPND.js} +3 -3
- package/dist/{chunk-A7IVFIOP.js → chunk-PKNE5J2B.js} +15 -23
- 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-EGB7V74Z.js → chunk-QAOVABCR.js} +7 -4
- package/dist/chunk-QAOVABCR.js.map +1 -0
- package/dist/{chunk-X3G37FXT.js → chunk-QQ7FP4GD.js} +4 -5
- package/dist/{chunk-X3G37FXT.js.map → chunk-QQ7FP4GD.js.map} +1 -1
- package/dist/{chunk-WAR4Q2NM.js → chunk-QYLVMC6B.js} +13 -15
- package/dist/chunk-QYLVMC6B.js.map +1 -0
- package/dist/{chunk-KPULTUOK.js → chunk-RX3XR65X.js} +4 -5
- package/dist/{chunk-KPULTUOK.js.map → chunk-RX3XR65X.js.map} +1 -1
- package/dist/chunk-RYQJJB4C.js +30 -0
- package/dist/chunk-RYQJJB4C.js.map +1 -0
- package/dist/{chunk-QQBJC2FQ.js → chunk-TUF7TCN7.js} +4 -5
- package/dist/{chunk-QQBJC2FQ.js.map → chunk-TUF7TCN7.js.map} +1 -1
- package/dist/{chunk-AUHSTJJ3.js → chunk-TUX36JY5.js} +4 -5
- package/dist/{chunk-AUHSTJJ3.js.map → chunk-TUX36JY5.js.map} +1 -1
- package/dist/chunk-TWRQCQWU.js +1153 -0
- 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-WG5YS6TC.js +872 -0
- package/dist/chunk-WG5YS6TC.js.map +1 -0
- package/dist/{chunk-ZGSER5TG.js → chunk-WMJJ4WGF.js} +4 -5
- package/dist/{chunk-ZGSER5TG.js.map → chunk-WMJJ4WGF.js.map} +1 -1
- package/dist/{chunk-LV2G7VHL.js → chunk-WY4FNH42.js} +21 -18
- package/dist/chunk-WY4FNH42.js.map +1 -0
- package/dist/{chunk-LAJJPLEV.js → chunk-XIG5BWWH.js} +25 -12
- 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-G2WCEUQL.js → chunk-XPRDXWK7.js} +21 -20
- 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-M5FVUIYP.js → chunk-YMBL3VJB.js} +21 -19
- package/dist/chunk-YMBL3VJB.js.map +1 -0
- package/dist/chunk-YUJBXFYK.js +1205 -0
- package/dist/chunk-YUJBXFYK.js.map +1 -0
- package/dist/{chunk-JALIYI6M.js → chunk-YZ4ZJNOL.js} +28 -11
- 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-GS5AUKUO.js → chunk-ZVSYUCYS.js} +11 -7
- package/dist/chunk-ZVSYUCYS.js.map +1 -0
- package/dist/{config-QAA646XB.js → config-2YBCHU2W.js} +2 -4
- package/dist/{config-IVY5EQQ2.js → config-3YRGRW72.js} +3 -4
- package/dist/config-4GSOMUMF.js +9 -0
- package/dist/config-5YBUWFUP.js +9 -0
- package/dist/{config-34LHOGLM.js → config-5ZRKJTKG.js} +3 -4
- package/dist/config-A25LTL5W.js +11 -0
- package/dist/config-CLU7JABG.js +9 -0
- package/dist/config-D2RF7L3N.js +9 -0
- package/dist/{config-LHFFXVYI.js → config-E55TKM6K.js} +2 -4
- package/dist/config-ELDOFRJW.js +9 -0
- package/dist/{config-GE4W4ZJC.js → config-FPC3RBFD.js} +2 -4
- package/dist/config-FPM3LAW7.js +9 -0
- package/dist/{config-HKRMKD76.js → config-G3F54CS4.js} +3 -4
- package/dist/config-G43HRUI3.js +9 -0
- package/dist/{config-WDAZFXYD.js → config-GG3WO5PB.js} +3 -4
- package/dist/config-JUYBWAZE.js +9 -0
- package/dist/{config-CVZ2AGCO.js → config-LJ5T6TVA.js} +2 -6
- package/dist/config-MDSAE4O3.js +11 -0
- package/dist/{config-EIHSP5DZ.js → config-NRIOKK5T.js} +2 -4
- package/dist/config-OYK2BSJK.js +9 -0
- package/dist/config-PB3KA2CE.js +9 -0
- package/dist/{config-ZFJYQZCH.js → config-QY4IL3PH.js} +3 -4
- package/dist/config-R4LAOEDS.js +9 -0
- package/dist/{config-QNMKWJ4M.js → config-RIAAD6RW.js} +3 -4
- package/dist/config-SYNEQAUB.js +9 -0
- package/dist/{config-Q45Y46YT.js → config-TJKGYA2B.js} +3 -4
- package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
- package/dist/{config-3IVQJBNW.js → config-UURRGA7U.js} +2 -2
- package/dist/{config-VM526IKB.js → config-VPLHQXVE.js} +2 -4
- package/dist/config-WRACCRPN.js +9 -0
- package/dist/{config-GHRUKEQ6.js → config-WVHKXEVE.js} +3 -4
- package/dist/{config-EO23EY62.js → config-XU7R36IE.js} +3 -4
- package/dist/config-Y2KOUYSS.js +9 -0
- 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-YED2MF6H.js +8 -0
- 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 +1311 -569
- package/dist/index.js +3359 -964
- 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-LPS357NF.js +8 -0
- 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/ssh-UYPG42LM.js.map +1 -0
- package/dist/supabase-A3KUFMDC.js +10 -0
- package/dist/supabase-A3KUFMDC.js.map +1 -0
- package/dist/tencent-5464UQ2X.js +11 -0
- package/dist/tencent-5464UQ2X.js.map +1 -0
- package/dist/trello-O2KB3FUO.js +8 -0
- package/dist/trello-O2KB3FUO.js.map +1 -0
- package/dist/wasabi-2IKBIWNO.js +10 -0
- package/dist/wasabi-2IKBIWNO.js.map +1 -0
- package/package.json +17 -3
- package/dist/aliyun-JMJ3PFYY.js +0 -10
- package/dist/backblaze-TDFD23QO.js +0 -10
- package/dist/box-GQ2U2R6R.js +0 -8
- package/dist/ceph-S2VOYO6G.js +0 -10
- package/dist/chunk-2CC5VW7K.js +0 -52
- package/dist/chunk-2CC5VW7K.js.map +0 -1
- package/dist/chunk-A7IVFIOP.js.map +0 -1
- package/dist/chunk-B2ZOKNN4.js.map +0 -1
- package/dist/chunk-DNBAMB5J.js +0 -18
- package/dist/chunk-DNBAMB5J.js.map +0 -1
- package/dist/chunk-DP2PP5V2.js +0 -26
- package/dist/chunk-DP2PP5V2.js.map +0 -1
- package/dist/chunk-DYXEITK3.js +0 -52
- package/dist/chunk-DYXEITK3.js.map +0 -1
- package/dist/chunk-EGB7V74Z.js.map +0 -1
- package/dist/chunk-EM4J5EQS.js.map +0 -1
- package/dist/chunk-EZQ5HBAC.js.map +0 -1
- package/dist/chunk-G2WCEUQL.js.map +0 -1
- package/dist/chunk-GCFYZSVR.js.map +0 -1
- package/dist/chunk-GS5AUKUO.js.map +0 -1
- package/dist/chunk-H3BST2LI.js +0 -26
- package/dist/chunk-H3BST2LI.js.map +0 -1
- package/dist/chunk-H3I2KZIY.js.map +0 -1
- package/dist/chunk-IDYHQQOH.js.map +0 -1
- package/dist/chunk-JAGJTM3Q.js.map +0 -1
- package/dist/chunk-JALIYI6M.js.map +0 -1
- package/dist/chunk-JCC4CU2I.js.map +0 -1
- package/dist/chunk-JZT4QGIP.js +0 -24
- package/dist/chunk-JZT4QGIP.js.map +0 -1
- package/dist/chunk-LAJJPLEV.js.map +0 -1
- package/dist/chunk-LV2G7VHL.js.map +0 -1
- package/dist/chunk-LW25LMIH.js +0 -26
- package/dist/chunk-LW25LMIH.js.map +0 -1
- package/dist/chunk-M5FVUIYP.js.map +0 -1
- package/dist/chunk-MPCCRRE6.js.map +0 -1
- package/dist/chunk-NJMGCT63.js +0 -54
- package/dist/chunk-NJMGCT63.js.map +0 -1
- package/dist/chunk-NOHWIBRX.js.map +0 -1
- package/dist/chunk-OHROA3FQ.js +0 -54
- package/dist/chunk-OHROA3FQ.js.map +0 -1
- package/dist/chunk-OPYQ5KIO.js +0 -52
- package/dist/chunk-OPYQ5KIO.js.map +0 -1
- package/dist/chunk-OZAEWZZ3.js.map +0 -1
- package/dist/chunk-Q2IAILVC.js.map +0 -1
- package/dist/chunk-QCZ2XUKH.js.map +0 -1
- package/dist/chunk-QGRDPSAH.js.map +0 -1
- package/dist/chunk-RNQN2FOU.js.map +0 -1
- package/dist/chunk-RO5IQEDQ.js.map +0 -1
- package/dist/chunk-RQK5UPMP.js.map +0 -1
- package/dist/chunk-S5OVP467.js +0 -1795
- package/dist/chunk-S5OVP467.js.map +0 -1
- package/dist/chunk-SFUCUARB.js +0 -21
- package/dist/chunk-SFUCUARB.js.map +0 -1
- package/dist/chunk-SWCDFEUK.js.map +0 -1
- package/dist/chunk-TA3WMOMU.js.map +0 -1
- package/dist/chunk-TURD42QO.js +0 -1782
- package/dist/chunk-TURD42QO.js.map +0 -1
- package/dist/chunk-TWGVQLG2.js.map +0 -1
- package/dist/chunk-U6QSXTUS.js +0 -7
- package/dist/chunk-U6QSXTUS.js.map +0 -1
- package/dist/chunk-UGK4TAVK.js.map +0 -1
- package/dist/chunk-UT2OPSN4.js.map +0 -1
- package/dist/chunk-VGLHY6BK.js.map +0 -1
- package/dist/chunk-VWKUT4CW.js.map +0 -1
- package/dist/chunk-W7FLHT65.js +0 -26
- package/dist/chunk-W7FLHT65.js.map +0 -1
- package/dist/chunk-WAR4Q2NM.js.map +0 -1
- package/dist/chunk-WHFUWWI6.js +0 -2097
- package/dist/chunk-WHFUWWI6.js.map +0 -1
- package/dist/chunk-XGJ2QERC.js.map +0 -1
- package/dist/chunk-XHCBHYN4.js +0 -54
- package/dist/chunk-XHCBHYN4.js.map +0 -1
- package/dist/chunk-XLQI4IT2.js +0 -54
- package/dist/chunk-XLQI4IT2.js.map +0 -1
- package/dist/chunk-XWVDS66D.js +0 -963
- package/dist/chunk-XWVDS66D.js.map +0 -1
- package/dist/chunk-YGZMVNN5.js +0 -54
- package/dist/chunk-YGZMVNN5.js.map +0 -1
- package/dist/chunk-YUK3X3B4.js +0 -27
- package/dist/chunk-YUK3X3B4.js.map +0 -1
- package/dist/chunk-ZEGAMJO2.js.map +0 -1
- package/dist/chunk-ZNWVJ6UW.js +0 -54
- package/dist/chunk-ZNWVJ6UW.js.map +0 -1
- package/dist/config-3BBWD5AB.js +0 -11
- package/dist/config-4UDVSUQJ.js +0 -11
- package/dist/config-CMDBAPDH.js +0 -11
- package/dist/config-D3RLSPNF.js +0 -11
- package/dist/config-DG65OEG3.js +0 -11
- package/dist/config-GCQK6NJY.js +0 -11
- package/dist/config-GVH27UPE.js +0 -11
- package/dist/config-HXVYIXP5.js +0 -11
- package/dist/config-IDZMEW73.js +0 -11
- package/dist/config-IJJXGLBQ.js +0 -11
- package/dist/config-KJOLGVB2.js +0 -11
- package/dist/config-KMVCVBYN.js +0 -15
- package/dist/config-KYTRXAB2.js +0 -15
- package/dist/config-OT2TQQCN.js +0 -11
- package/dist/config-QWCY3LBQ.js +0 -11
- package/dist/config-ZV6G2ZEC.js +0 -11
- package/dist/databricks_volume-7XOUYSTY.js +0 -7
- package/dist/digitalocean-3CQ4CPPZ.js +0 -10
- package/dist/discord-BG7OSRJG.js +0 -8
- package/dist/disk-XVLBCVKE.js +0 -8
- package/dist/dropbox-74GYLV3R.js +0 -8
- package/dist/email-5IZ7OBQ4.js +0 -8
- package/dist/gcs-EMEYU2XT.js +0 -10
- package/dist/gdocs-R67TDPON.js +0 -8
- package/dist/gdrive-PRN2ALRK.js +0 -8
- package/dist/github-DV7E6OFV.js +0 -8
- package/dist/github_ci-Q554V5PA.js +0 -8
- package/dist/gmail-OLN2LT4O.js +0 -8
- package/dist/gsheets-H4RYMQJ5.js +0 -8
- package/dist/gslides-YLCHKJOM.js +0 -8
- package/dist/hf_buckets-DTKXKKFF.js +0 -10
- package/dist/hf_datasets-55C4APKR.js +0 -10
- package/dist/hf_models-RO5JR36V.js +0 -10
- package/dist/hf_spaces-ZVZ3EDRX.js +0 -10
- package/dist/langfuse-ACASJZ7O.js +0 -8
- package/dist/linear-IC37LZV7.js +0 -8
- package/dist/minio-HZ576XFQ.js +0 -10
- package/dist/mongodb-JVR62OIO.js +0 -7
- package/dist/notion-HKRPQMJS.js +0 -8
- package/dist/oci-ZLVECXTW.js +0 -10
- package/dist/postgres-P36Z2YN4.js +0 -7
- package/dist/qingstor-YLP6K3L4.js +0 -10
- package/dist/r2-RPK25ANI.js +0 -10
- package/dist/redis-V5ULXULL.js +0 -8
- package/dist/s3-4OIOCAAT.js +0 -8
- package/dist/scaleway-CCWCLUHB.js +0 -10
- package/dist/seaweedfs-QSWKF2FN.js +0 -10
- package/dist/slack-YPS7PII3.js +0 -8
- package/dist/ssh-YFP3SMTJ.js +0 -9
- package/dist/supabase-6CFTOKGZ.js +0 -10
- package/dist/tencent-IWZZOSQ4.js +0 -10
- package/dist/trello-XYKWZD6P.js +0 -8
- package/dist/wasabi-6Z4DC5S5.js +0 -10
- /package/dist/{aliyun-JMJ3PFYY.js.map → aliyun-S62BR3TB.js.map} +0 -0
- /package/dist/{backblaze-TDFD23QO.js.map → backblaze-4EKSW63F.js.map} +0 -0
- /package/dist/{box-GQ2U2R6R.js.map → box-ZPLZAGMK.js.map} +0 -0
- /package/dist/{ceph-S2VOYO6G.js.map → ceph-ALKLD3MO.js.map} +0 -0
- /package/dist/{chunk-HJJMP6IX.js.map → chunk-BZTVYOES.js.map} +0 -0
- /package/dist/{chunk-X5HF2OFP.js.map → chunk-ENW5BVYN.js.map} +0 -0
- /package/dist/{chunk-HGCRXJGP.js.map → chunk-ETIAW4YD.js.map} +0 -0
- /package/dist/{chunk-DM4GSE26.js.map → chunk-GMMQ3ZK4.js.map} +0 -0
- /package/dist/{chunk-N5FSLVKO.js.map → chunk-HCRYAFBI.js.map} +0 -0
- /package/dist/{chunk-UINQOUZR.js.map → chunk-OXEQSPND.js.map} +0 -0
- /package/dist/{config-34LHOGLM.js.map → config-2YBCHU2W.js.map} +0 -0
- /package/dist/{config-3BBWD5AB.js.map → config-3YRGRW72.js.map} +0 -0
- /package/dist/{config-3IVQJBNW.js.map → config-4GSOMUMF.js.map} +0 -0
- /package/dist/{config-4UDVSUQJ.js.map → config-5YBUWFUP.js.map} +0 -0
- /package/dist/{config-CMDBAPDH.js.map → config-5ZRKJTKG.js.map} +0 -0
- /package/dist/{config-CVZ2AGCO.js.map → config-A25LTL5W.js.map} +0 -0
- /package/dist/{config-D3RLSPNF.js.map → config-CLU7JABG.js.map} +0 -0
- /package/dist/{config-DG65OEG3.js.map → config-D2RF7L3N.js.map} +0 -0
- /package/dist/{config-EIHSP5DZ.js.map → config-E55TKM6K.js.map} +0 -0
- /package/dist/{config-EO23EY62.js.map → config-ELDOFRJW.js.map} +0 -0
- /package/dist/{config-GCQK6NJY.js.map → config-FPC3RBFD.js.map} +0 -0
- /package/dist/{config-GE4W4ZJC.js.map → config-FPM3LAW7.js.map} +0 -0
- /package/dist/{config-GHRUKEQ6.js.map → config-G3F54CS4.js.map} +0 -0
- /package/dist/{config-GVH27UPE.js.map → config-G43HRUI3.js.map} +0 -0
- /package/dist/{config-HKRMKD76.js.map → config-GG3WO5PB.js.map} +0 -0
- /package/dist/{config-HXVYIXP5.js.map → config-JUYBWAZE.js.map} +0 -0
- /package/dist/{config-IDZMEW73.js.map → config-LJ5T6TVA.js.map} +0 -0
- /package/dist/{config-IJJXGLBQ.js.map → config-MDSAE4O3.js.map} +0 -0
- /package/dist/{config-IVY5EQQ2.js.map → config-NRIOKK5T.js.map} +0 -0
- /package/dist/{config-KJOLGVB2.js.map → config-OYK2BSJK.js.map} +0 -0
- /package/dist/{config-KMVCVBYN.js.map → config-PB3KA2CE.js.map} +0 -0
- /package/dist/{config-KYTRXAB2.js.map → config-QY4IL3PH.js.map} +0 -0
- /package/dist/{config-LHFFXVYI.js.map → config-R4LAOEDS.js.map} +0 -0
- /package/dist/{config-NV5WXP64.js.map → config-RIAAD6RW.js.map} +0 -0
- /package/dist/{config-OT2TQQCN.js.map → config-SYNEQAUB.js.map} +0 -0
- /package/dist/{config-Q45Y46YT.js.map → config-TJKGYA2B.js.map} +0 -0
- /package/dist/{config-QAA646XB.js.map → config-UU27ALAA.js.map} +0 -0
- /package/dist/{config-QNMKWJ4M.js.map → config-UURRGA7U.js.map} +0 -0
- /package/dist/{config-QWCY3LBQ.js.map → config-VPLHQXVE.js.map} +0 -0
- /package/dist/{config-VM526IKB.js.map → config-WRACCRPN.js.map} +0 -0
- /package/dist/{config-WDAZFXYD.js.map → config-WVHKXEVE.js.map} +0 -0
- /package/dist/{config-ZFJYQZCH.js.map → config-XU7R36IE.js.map} +0 -0
- /package/dist/{config-ZV6G2ZEC.js.map → config-Y2KOUYSS.js.map} +0 -0
- /package/dist/{databricks_volume-7XOUYSTY.js.map → databricks_volume-CNCPTZHS.js.map} +0 -0
- /package/dist/{digitalocean-3CQ4CPPZ.js.map → digitalocean-DJZOUB6Q.js.map} +0 -0
- /package/dist/{discord-BG7OSRJG.js.map → discord-ETB2CADR.js.map} +0 -0
- /package/dist/{disk-XVLBCVKE.js.map → disk-WEHSTK3F.js.map} +0 -0
- /package/dist/{dropbox-74GYLV3R.js.map → dropbox-XN6PGLNE.js.map} +0 -0
- /package/dist/{email-5IZ7OBQ4.js.map → email-OV7XCP3T.js.map} +0 -0
- /package/dist/{gcs-EMEYU2XT.js.map → gcal-P56MRCGU.js.map} +0 -0
- /package/dist/{gdocs-R67TDPON.js.map → gcs-HFBIAE2C.js.map} +0 -0
- /package/dist/{gdrive-PRN2ALRK.js.map → gdocs-LQ3UXP3J.js.map} +0 -0
- /package/dist/{github-DV7E6OFV.js.map → gdrive-N6UBYLON.js.map} +0 -0
- /package/dist/{github_ci-Q554V5PA.js.map → github-BPZREGPI.js.map} +0 -0
- /package/dist/{gmail-OLN2LT4O.js.map → github_ci-7A4LUIZ7.js.map} +0 -0
- /package/dist/{gsheets-H4RYMQJ5.js.map → gmail-YED2MF6H.js.map} +0 -0
- /package/dist/{gslides-YLCHKJOM.js.map → gridfs-CPLQ4G62.js.map} +0 -0
- /package/dist/{hf_buckets-DTKXKKFF.js.map → gsheets-4BNIJPQ6.js.map} +0 -0
- /package/dist/{hf_datasets-55C4APKR.js.map → gslides-GDBYLO5A.js.map} +0 -0
- /package/dist/{hf_models-RO5JR36V.js.map → hf_buckets-FTJITQ3P.js.map} +0 -0
- /package/dist/{hf_spaces-ZVZ3EDRX.js.map → hf_datasets-6GXVKQD7.js.map} +0 -0
- /package/dist/{langfuse-ACASJZ7O.js.map → hf_models-PJPGZAC5.js.map} +0 -0
- /package/dist/{linear-IC37LZV7.js.map → hf_spaces-LFNFOLBF.js.map} +0 -0
- /package/dist/{minio-HZ576XFQ.js.map → jaeger-GCA6MJ6E.js.map} +0 -0
- /package/dist/{mongodb-JVR62OIO.js.map → lancedb-TJ5YSJY5.js.map} +0 -0
- /package/dist/{notion-HKRPQMJS.js.map → langfuse-RUMTUMXS.js.map} +0 -0
- /package/dist/{oci-ZLVECXTW.js.map → linear-BCE4KEAC.js.map} +0 -0
- /package/dist/{postgres-P36Z2YN4.js.map → minio-5SO6KBTK.js.map} +0 -0
- /package/dist/{qingstor-YLP6K3L4.js.map → mongodb-L5CMN2EE.js.map} +0 -0
- /package/dist/{r2-RPK25ANI.js.map → nextcloud-4O2LZVW2.js.map} +0 -0
- /package/dist/{redis-V5ULXULL.js.map → notion-RVKEAQ2M.js.map} +0 -0
- /package/dist/{s3-4OIOCAAT.js.map → oci-OQXOIC62.js.map} +0 -0
- /package/dist/{scaleway-CCWCLUHB.js.map → postgres-AV45GNRS.js.map} +0 -0
- /package/dist/{seaweedfs-QSWKF2FN.js.map → qingstor-W277YA4K.js.map} +0 -0
- /package/dist/{slack-YPS7PII3.js.map → r2-FUA4IORE.js.map} +0 -0
- /package/dist/{ssh-YFP3SMTJ.js.map → redis-LPS357NF.js.map} +0 -0
- /package/dist/{supabase-6CFTOKGZ.js.map → s3-FPNWWIVM.js.map} +0 -0
- /package/dist/{tencent-IWZZOSQ4.js.map → scaleway-BP3732U7.js.map} +0 -0
- /package/dist/{trello-XYKWZD6P.js.map → seaweedfs-MC6HIEP4.js.map} +0 -0
- /package/dist/{wasabi-6Z4DC5S5.js.map → slack-JFGW7VLN.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/linear/linear.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n type FileStat,\n HttpLinearTransport,\n LINEAR_COMMANDS,\n LINEAR_PROMPT,\n LINEAR_VFS_OPS,\n LINEAR_WRITE_PROMPT,\n LinearAccessor,\n type LinearReaddirFilter,\n linearRead,\n linearReaddir,\n linearStat,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolveLinearGlob,\n} from '@struktoai/mirage-core'\nimport { redactLinearConfig, type LinearConfig, type LinearConfigRedacted } from './config.ts'\n\nexport interface LinearResourceState {\n type: string\n config: LinearConfigRedacted\n}\n\nexport class LinearResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.LINEAR\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = LINEAR_PROMPT\n readonly writePrompt: string = LINEAR_WRITE_PROMPT\n readonly config: LinearConfig\n readonly accessor: LinearAccessor\n\n constructor(config: LinearConfig) {\n super()\n this.config = config\n const transportOpts: { apiKey: string; baseUrl?: string } = { apiKey: config.apiKey }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n this.accessor = new LinearAccessor(new HttpLinearTransport(transportOpts))\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return LINEAR_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return LINEAR_VFS_OPS\n }\n\n private filter(): LinearReaddirFilter {\n const out: LinearReaddirFilter = {}\n if (this.config.teamIds !== undefined) out.teamIds = this.config.teamIds\n return out\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return linearRead(this.accessor, p, this.index, this.filter())\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return linearReaddir(this.accessor, p, this.index, this.filter())\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return linearStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveLinearGlob(this.accessor, effective, this.index, this.filter())\n }\n\n getState(): Promise<LinearResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactLinearConfig(this.config),\n })\n }\n\n loadState(_state: LinearResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,iBAAN,cAA6B,aAAiC;AAAA,EAC1D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAsB;AAChC,UAAM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AAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,OAAO,KAAK,OAAO,CAAC;AAAA,EAC9E;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,IACxC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/mongodb/mongodb.ts","../src/resource/mongodb/store.ts","../package.json","../src/version.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n detectMongoScope,\n type FileStat,\n MONGODB_COMMANDS,\n MONGODB_OPS,\n MONGODB_PROMPT,\n MongoDBAccessor,\n type MongoDBConfig,\n type MongoDBConfigResolved,\n mongoRead,\n mongoReaddir,\n mongoStat,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n resolveMongoGlob,\n ResourceName,\n resolveMongoDBConfig,\n} from '@struktoai/mirage-core'\nimport { MongoDBStore } from './store.ts'\n\nvoid detectMongoScope\n\nexport interface MongoDBResourceOptions {\n config: MongoDBConfig\n prefix?: string\n}\n\nexport class MongoDBResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.MONGODB\n readonly cachesReads: boolean = false\n readonly indexTtl: number = 0\n readonly prompt: string\n readonly config: MongoDBConfigResolved\n readonly store: MongoDBStore\n readonly accessor: MongoDBAccessor\n\n constructor(options: MongoDBResourceOptions | MongoDBConfig) {\n super()\n const { config, prefix } =\n 'config' in options ? options : { config: options, prefix: undefined }\n this.config = resolveMongoDBConfig(config)\n this.store = new MongoDBStore(this.config.uri)\n this.accessor = new MongoDBAccessor(this.store, this.config)\n this.prompt = MONGODB_PROMPT.replace('{prefix}', prefix ?? '')\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n async close(): Promise<void> {\n await this.store.close()\n }\n\n ops(): readonly RegisteredOp[] {\n return MONGODB_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return MONGODB_COMMANDS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return mongoRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return mongoReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return mongoStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveMongoGlob(this.accessor, effective, this.index)\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n loadOptionalPeer,\n type EntityKind,\n type MongoCollectionSpec,\n type MongoDriver,\n type MongoFindOptions,\n type MongoIndexAccess,\n type MongoIterOptions,\n} from '@struktoai/mirage-core'\nimport { VERSION } from '../../version.ts'\n\nconst DRIVER_INFO = { name: 'Mirage', version: VERSION }\n\ninterface MongoCollectionLike {\n find: (\n filter: Record<string, unknown>,\n options?: { projection?: Record<string, unknown> },\n ) => {\n sort: (sort: Record<string, 1 | -1>) => MongoCursorLike\n skip: (n: number) => MongoCursorLike\n limit: (n: number) => MongoCursorLike\n batchSize: (n: number) => MongoCursorLike\n toArray: () => Promise<Record<string, unknown>[]>\n [Symbol.asyncIterator]?: () => AsyncIterableIterator<Record<string, unknown>>\n }\n countDocuments: (filter?: Record<string, unknown>) => Promise<number>\n listIndexes: () => { toArray: () => Promise<Record<string, unknown>[]> }\n aggregate: (pipeline: unknown[]) => { toArray: () => Promise<Record<string, unknown>[]> }\n watch: (\n pipeline?: unknown[],\n ) => AsyncIterableIterator<Record<string, unknown>> & { close: () => Promise<void> }\n}\n\ninterface MongoCursorLike {\n sort: (sort: Record<string, 1 | -1>) => MongoCursorLike\n skip: (n: number) => MongoCursorLike\n limit: (n: number) => MongoCursorLike\n batchSize: (n: number) => MongoCursorLike\n toArray: () => Promise<Record<string, unknown>[]>\n [Symbol.asyncIterator]?: () => AsyncIterableIterator<Record<string, unknown>>\n}\n\ninterface MongoDbLike {\n listCollections: (filter?: Record<string, unknown>) => {\n toArray: () => Promise<Record<string, unknown>[]>\n }\n collection: (name: string) => MongoCollectionLike\n admin: () => { listDatabases: () => Promise<{ databases: { name: string }[] }> }\n}\n\ninterface MongoClientLike {\n connect: () => Promise<MongoClientLike>\n db: (name?: string) => MongoDbLike\n close: () => Promise<void>\n}\n\ninterface MongoModule {\n MongoClient: new (\n uri: string,\n options?: { driverInfo?: { name: string; version?: string } },\n ) => MongoClientLike\n}\n\nexport class MongoDBStore implements MongoDriver {\n readonly uri: string\n private clientPromise: Promise<MongoClientLike> | null = null\n\n constructor(uri: string) {\n this.uri = uri\n }\n\n async listDatabases(): Promise<string[]> {\n const c = await this._client()\n const r = await c.db().admin().listDatabases()\n return r.databases.map((d) => d.name)\n }\n\n async listCollections(database: string, kind: EntityKind | null = null): Promise<string[]> {\n const c = await this._client()\n const filter = kind === null ? undefined : { type: kind }\n const cols = await c.db(database).listCollections(filter).toArray()\n return cols.map((col) => col.name as string).sort()\n }\n\n async listCollectionsDetailed(\n database: string,\n filter: { name?: string } = {},\n ): Promise<MongoCollectionSpec[]> {\n const c = await this._client()\n const cols = await c.db(database).listCollections(filter).toArray()\n return cols.map((col) => {\n const spec: MongoCollectionSpec = { name: col.name as string }\n if (col.type !== undefined) spec.type = col.type as string\n if (col.options !== undefined)\n spec.options = col.options as NonNullable<MongoCollectionSpec['options']>\n return spec\n })\n }\n\n async findDocuments<T = Record<string, unknown>>(\n database: string,\n collection: string,\n filter: Record<string, unknown> = {},\n options: MongoFindOptions = {},\n ): Promise<T[]> {\n const c = await this._client()\n let cursor = c\n .db(database)\n .collection(collection)\n .find(filter, {\n ...(options.projection !== undefined ? { projection: options.projection } : {}),\n }) as MongoCursorLike\n if (options.sort !== undefined) cursor = cursor.sort(options.sort)\n if (options.skip !== undefined) cursor = cursor.skip(options.skip)\n if (options.limit !== undefined) cursor = cursor.limit(options.limit)\n return (await cursor.toArray()) as T[]\n }\n\n async *iterDocuments<T = Record<string, unknown>>(\n database: string,\n collection: string,\n options: MongoIterOptions = {},\n ): AsyncIterableIterator<T> {\n const c = await this._client()\n const filter = options.filter ?? {}\n let cursor = c\n .db(database)\n .collection(collection)\n .find(filter, {\n ...(options.projection !== undefined ? { projection: options.projection } : {}),\n }) as MongoCursorLike\n if (options.sort !== undefined) cursor = cursor.sort(options.sort)\n if (options.batchSize !== undefined) cursor = cursor.batchSize(options.batchSize)\n if (cursor[Symbol.asyncIterator] === undefined) {\n const all = (await cursor.toArray()) as T[]\n for (const doc of all) yield doc\n return\n }\n for await (const doc of cursor as unknown as AsyncIterableIterator<T>) {\n yield doc\n }\n }\n\n async *iterInserts<T = Record<string, unknown>>(\n database: string,\n collection: string,\n ): AsyncIterableIterator<T> {\n const c = await this._client()\n const stream = c\n .db(database)\n .collection(collection)\n .watch([{ $match: { operationType: 'insert' } }])\n try {\n for await (const change of stream as AsyncIterableIterator<Record<string, unknown>>) {\n const doc = change.fullDocument\n if (doc !== undefined && doc !== null) yield doc as T\n }\n } finally {\n await stream.close()\n }\n }\n\n async countDocuments(\n database: string,\n collection: string,\n filter: Record<string, unknown> = {},\n ): Promise<number> {\n const c = await this._client()\n return c.db(database).collection(collection).countDocuments(filter)\n }\n\n async listIndexes(database: string, collection: string): Promise<Record<string, unknown>[]> {\n const c = await this._client()\n return c.db(database).collection(collection).listIndexes().toArray()\n }\n\n async getIndexStats(\n database: string,\n collection: string,\n ): Promise<Record<string, MongoIndexAccess>> {\n const c = await this._client()\n const docs = await c\n .db(database)\n .collection(collection)\n .aggregate([{ $indexStats: {} }])\n .toArray()\n const out: Record<string, MongoIndexAccess> = {}\n for (const d of docs) {\n const name = d.name as string | undefined\n if (name !== undefined) {\n out[name] = (d.accesses as MongoIndexAccess | undefined) ?? {}\n }\n }\n return out\n }\n\n async close(): Promise<void> {\n if (this.clientPromise === null) return\n const c = await this.clientPromise\n this.clientPromise = null\n await c.close()\n }\n\n private async _client(): Promise<MongoClientLike> {\n this.clientPromise ??= this._connect()\n return this.clientPromise\n }\n\n protected async _connect(): Promise<MongoClientLike> {\n const mod = await loadOptionalPeer(() => import('mongodb') as unknown as Promise<MongoModule>, {\n feature: 'MongoDBResource',\n packageName: 'mongodb',\n })\n const c = new mod.MongoClient(this.uri, { driverInfo: DRIVER_INFO })\n await c.connect()\n return c\n }\n}\n","{\n \"name\": \"@struktoai/mirage-node\",\n \"version\": \"0.0.3\",\n \"description\": \"A Unified Virtual Filesystem For AI Agents\",\n \"keywords\": [\n \"bash\",\n \"fuse\",\n \"typescript\",\n \"vfs\",\n \"ai-agents\",\n \"agent-sandbox\",\n \"langchain\",\n \"virtual-filesystem\",\n \"llm-agents\",\n \"agent-tools\",\n \"claude-code\",\n \"openai-agents\"\n ],\n \"homepage\": \"https://github.com/strukto-ai/mirage#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/strukto-ai/mirage/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/strukto-ai/mirage.git\",\n \"directory\": \"typescript/packages/node\"\n },\n \"license\": \"Apache-2.0\",\n \"author\": \"Zecheng Zhang <zecheng@strukto.ai>\",\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n }\n },\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@napi-rs/lzma\": \"^1.4.5\",\n \"@struktoai/mirage-core\": \"workspace:*\",\n \"compressjs\": \"^1.0.3\",\n \"fs-monkey\": \"^1.1.0\",\n \"tree-sitter-bash\": \"^0.25.1\",\n \"web-tree-sitter\": \"^0.26.8\"\n },\n \"peerDependencies\": {\n \"@lancedb/lancedb\": \"^0.30.0\",\n \"@zkochan/fuse-native\": \"^0.1.0\",\n \"imapflow\": \"^1.0.0\",\n \"mailparser\": \"^3.6.0\",\n \"mongodb\": \"^6.10.0\",\n \"nodemailer\": \"^9.0.1\",\n \"opendal\": \"^0.49.4\",\n \"pg\": \"^8.13.0\",\n \"redis\": \"^5.0.0\",\n \"ssh2\": \"^1.16.0\"\n },\n \"peerDependenciesMeta\": {\n \"@lancedb/lancedb\": {\n \"optional\": true\n },\n \"@zkochan/fuse-native\": {\n \"optional\": true\n },\n \"imapflow\": {\n \"optional\": true\n },\n \"mailparser\": {\n \"optional\": true\n },\n \"mongodb\": {\n \"optional\": true\n },\n \"nodemailer\": {\n \"optional\": true\n },\n \"opendal\": {\n \"optional\": true\n },\n \"pg\": {\n \"optional\": true\n },\n \"redis\": {\n \"optional\": true\n },\n \"ssh2\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@aws-sdk/client-s3\": \"^3.0.0\",\n \"@lancedb/lancedb\": \"^0.30.0\",\n \"@types/mailparser\": \"^3.4.6\",\n \"@types/nodemailer\": \"^8.0.0\",\n \"@types/pg\": \"^8.11.0\",\n \"@types/ssh2\": \"^1.15.0\",\n \"@zkochan/fuse-native\": \"^0.1.0\",\n \"imapflow\": \"^1.3.2\",\n \"mailparser\": \"^3.9.8\",\n \"mongodb\": \"^6.10.0\",\n \"nodemailer\": \"^9.0.1\",\n \"opendal\": \"^0.49.4\",\n \"pg\": \"^8.13.0\",\n \"redis\": \"^5.0.0\",\n \"ssh2\": \"^1.16.0\",\n \"tsup\": \"^8.5.0\",\n \"typescript\": \"^6.0.0\",\n \"vitest\": \"^3.2.6\"\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport pkg from '../package.json'\n\nexport const VERSION: string = pkg.version\n"],"mappings":";AAcA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACpBP;AAAA,EACE;AAAA,OAOK;;;ACtBP;AAAA,EACE,MAAQ;AAAA,EACR,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AAQ;AAAA,EACzB;AAAA,EAEA,MAAM,QAAuB;AAC3B,UAAM,KAAK,MAAM,MAAM;AAAA,EACzB;AAAA,EAEA,MAA+B;AAC7B,WAAO;AAAA,EACT;AAAA,EAEA,WAAyC;AACvC,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,UAAU,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAC/C;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,aAAa,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAClD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,UAAU,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAC/C;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,iBAAiB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC9D;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/postgres/postgres.ts","../src/resource/postgres/store.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n type FileStat,\n PathSpec,\n POSTGRES_COMMANDS,\n POSTGRES_OPS,\n POSTGRES_PROMPT,\n PostgresAccessor,\n type PostgresConfig,\n type PostgresConfigResolved,\n postgresRead,\n postgresReaddir,\n postgresStat,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolvePostgresConfig,\n resolvePostgresGlob,\n} from '@struktoai/mirage-core'\nimport { PostgresStore } from './store.ts'\n\nexport interface PostgresResourceOptions {\n config: PostgresConfig\n prefix?: string\n}\n\nexport class PostgresResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.POSTGRES\n readonly cachesReads: boolean = false\n readonly indexTtl: number = 0\n readonly prompt: string\n readonly config: PostgresConfigResolved\n readonly store: PostgresStore\n readonly accessor: PostgresAccessor\n\n constructor(options: PostgresResourceOptions | PostgresConfig) {\n super()\n const { config, prefix } =\n 'config' in options ? options : { config: options, prefix: undefined }\n this.config = resolvePostgresConfig(config)\n this.store = new PostgresStore(this.config)\n this.accessor = new PostgresAccessor(this.store, this.config)\n this.prompt = POSTGRES_PROMPT.replace('{prefix}', prefix ?? '')\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n async close(): Promise<void> {\n await this.store.close()\n }\n\n ops(): readonly RegisteredOp[] {\n return POSTGRES_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return POSTGRES_COMMANDS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return postgresRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return postgresReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return postgresStat(this.accessor, p, this.index)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolvePostgresGlob(this.accessor, effective, this.index)\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { loadOptionalPeer, type PgDriver, type PgQueryResult } from '@struktoai/mirage-core'\nimport type { PostgresConfigResolved } from '@struktoai/mirage-core'\n\ninterface PgPoolLike {\n query: (\n sql: string,\n params?: readonly unknown[],\n ) => Promise<{ rows: unknown[]; rowCount: number | null }>\n end: () => Promise<void>\n}\n\ninterface PgModule {\n Pool: new (options: Record<string, unknown>) => PgPoolLike\n}\n\nexport class PostgresStore implements PgDriver {\n readonly config: PostgresConfigResolved\n private poolPromise: Promise<PgPoolLike> | null = null\n\n constructor(config: PostgresConfigResolved) {\n this.config = config\n }\n\n async query<R = Record<string, unknown>>(\n sql: string,\n params?: readonly unknown[],\n ): Promise<PgQueryResult<R>> {\n const pool = await this._pool()\n const result = await pool.query(sql, params)\n return { rows: result.rows as R[], rowCount: result.rowCount ?? 0 }\n }\n\n async databaseName(): Promise<string> {\n const result = await this.query<{ db: string }>('SELECT current_database() AS db')\n return result.rows[0]?.db ?? ''\n }\n\n async close(): Promise<void> {\n if (this.poolPromise === null) return\n const pool = await this.poolPromise\n this.poolPromise = null\n await pool.end()\n }\n\n private async _pool(): Promise<PgPoolLike> {\n this.poolPromise ??= this._connect()\n return this.poolPromise\n }\n\n protected async _connect(): Promise<PgPoolLike> {\n const mod = await loadOptionalPeer(\n () => import('pg') as unknown as Promise<{ default?: PgModule } & Partial<PgModule>>,\n { feature: 'PostgresResource', packageName: 'pg' },\n )\n const Pool = mod.default?.Pool ?? mod.Pool\n if (Pool === undefined) {\n throw new Error('postgres: pg package missing Pool export')\n }\n return new Pool({\n connectionString: this.config.dsn,\n options: '-c default_transaction_read_only=on',\n })\n }\n}\n"],"mappings":";AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACnBP,SAAS,wBAA2D;AAe7D,IAAM,gBAAN,MAAwC;AAAA,EACpC;AAAA,EACD,cAA0C;AAAA,EAElD,YAAY,QAAgC;AAC1C,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,MAAM,MACJ,KACA,QAC2B;AAC3B,UAAM,OAAO,MAAM,KAAK,MAAM;AAC9B,UAAM,SAAS,MAAM,KAAK,MAAM,KAAK,MAAM;AAC3C,WAAO,EAAE,MAAM,OAAO,MAAa,UAAU,OAAO,YAAY,EAAE;AAAA,EACpE;AAAA,EAEA,MAAM,eAAgC;AACpC,UAAM,SAAS,MAAM,KAAK,MAAsB,iCAAiC;AACjF,WAAO,OAAO,KAAK,CAAC,GAAG,MAAM;AAAA,EAC/B;AAAA,EAEA,MAAM,QAAuB;AAC3B,QAAI,KAAK,gBAAgB,KAAM;AAC/B,UAAM,OAAO,MAAM,KAAK;AACxB,SAAK,cAAc;AACnB,UAAM,KAAK,IAAI;AAAA,EACjB;AAAA,EAEA,MAAc,QAA6B;AACzC,SAAK,gBAAgB,KAAK,SAAS;AACnC,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAgB,WAAgC;AAC9C,UAAM,MAAM,MAAM;AAAA,MAChB,MAAM,OAAO,IAAI;AAAA,MACjB,EAAE,SAAS,oBAAoB,aAAa,KAAK;AAAA,IACnD;AACA,UAAM,OAAO,IAAI,SAAS,QAAQ,IAA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,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,oBAAoB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EACjE;AACF;","names":[]}
|
package/dist/chunk-H3BST2LI.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/resource/gdocs/config.ts
|
|
2
|
-
import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
|
|
3
|
-
var GDocsConfigSchema = z.object({
|
|
4
|
-
clientId: z.string(),
|
|
5
|
-
clientSecret: secretStr(),
|
|
6
|
-
refreshToken: secretStr()
|
|
7
|
-
});
|
|
8
|
-
function redactGDocsConfig(config) {
|
|
9
|
-
return redactConfigWithSchema(GDocsConfigSchema, config);
|
|
10
|
-
}
|
|
11
|
-
function normalizeGDocsConfig(input) {
|
|
12
|
-
return normalizeFields(input, {
|
|
13
|
-
rename: {
|
|
14
|
-
client_id: "clientId",
|
|
15
|
-
client_secret: "clientSecret",
|
|
16
|
-
refresh_token: "refreshToken"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
GDocsConfigSchema,
|
|
23
|
-
redactGDocsConfig,
|
|
24
|
-
normalizeGDocsConfig
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=chunk-H3BST2LI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gdocs/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface GDocsConfig {\n clientId: string\n clientSecret: string\n refreshToken: string\n refreshFn?: (refreshToken: string) => Promise<{ accessToken: string; expiresIn: number }>\n}\n\nexport interface GDocsConfigRedacted {\n clientId: string\n clientSecret: '<REDACTED>'\n refreshToken: '<REDACTED>'\n}\n\nexport const GDocsConfigSchema = z.object({\n clientId: z.string(),\n clientSecret: secretStr(),\n refreshToken: secretStr(),\n})\n\nexport function redactGDocsConfig(config: GDocsConfig): GDocsConfigRedacted {\n return redactConfigWithSchema(GDocsConfigSchema, config) as unknown as GDocsConfigRedacted\n}\n\nexport function normalizeGDocsConfig(input: Record<string, unknown>): GDocsConfig {\n return normalizeFields(input, {\n rename: {\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n },\n }) as unknown as GDocsConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAe/D,IAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,UAAU,EAAE,OAAO;AAAA,EACnB,cAAc,UAAU;AAAA,EACxB,cAAc,UAAU;AAC1B,CAAC;AAEM,SAAS,kBAAkB,QAA0C;AAC1E,SAAO,uBAAuB,mBAAmB,MAAM;AACzD;AAEO,SAAS,qBAAqB,OAA6C;AAChF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/github_ci/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface GitHubCIConfig {\n token: string\n owner: string\n repo: string\n days?: number\n maxRuns?: number\n baseUrl?: string\n}\n\nexport interface GitHubCIConfigRedacted {\n token: '<REDACTED>'\n owner: string\n repo: string\n days?: number\n maxRuns?: number\n baseUrl?: string\n}\n\nexport const GitHubCIConfigSchema = z.object({\n token: secretStr(),\n owner: z.string(),\n repo: z.string(),\n days: z.number().optional(),\n maxRuns: z.number().optional(),\n baseUrl: z.string().optional(),\n})\n\nexport function redactGitHubCIConfig(config: GitHubCIConfig): GitHubCIConfigRedacted {\n return redactConfigWithSchema(GitHubCIConfigSchema, config) as unknown as GitHubCIConfigRedacted\n}\n\nexport function normalizeGitHubCIConfig(input: Record<string, unknown>): GitHubCIConfig {\n return normalizeFields(input, {\n rename: { base_url: 'baseUrl' },\n }) as unknown as GitHubCIConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAoB/D,IAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,OAAO,UAAU;AAAA,EACjB,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAEM,SAAS,qBAAqB,QAAgD;AACnF,SAAO,uBAAuB,sBAAsB,MAAM;AAC5D;AAEO,SAAS,wBAAwB,OAAgD;AACtF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ,EAAE,UAAU,UAAU;AAAA,EAChC,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/redis/redis.ts","../src/commands/builtin/redis/index.ts","../src/core/redis/read.ts","../src/core/redis/utils.ts","../src/core/redis/stat.ts","../src/core/redis/constants.ts","../src/core/redis/copy.ts","../src/core/redis/du.ts","../src/core/redis/exists.ts","../src/core/redis/find.ts","../src/core/redis/mkdir.ts","../src/core/redis/readdir.ts","../src/core/redis/entry.ts","../src/core/redis/rename.ts","../src/core/redis/rm.ts","../src/core/redis/rmdir.ts","../src/core/redis/stream.ts","../src/core/redis/unlink.ts","../src/core/redis/write.ts","../src/commands/builtin/redis/ops.ts","../src/commands/builtin/redis/sed.ts","../src/accessor/redis.ts","../src/core/redis/append.ts","../src/core/redis/create.ts","../src/core/redis/glob.ts","../src/core/redis/truncate.ts","../src/ops/redis/append.ts","../src/ops/redis/create.ts","../src/ops/redis/mkdir.ts","../src/ops/redis/read.ts","../src/ops/redis/read_feather.ts","../src/ops/redis/read_hdf5.ts","../src/ops/redis/read_parquet.ts","../src/ops/redis/readdir.ts","../src/ops/redis/rename.ts","../src/ops/redis/rmdir.ts","../src/ops/redis/stat.ts","../src/ops/redis/truncate.ts","../src/ops/redis/unlink.ts","../src/ops/redis/write.ts","../src/ops/redis/index.ts","../src/resource/redis/prompt.ts","../src/resource/redis/store.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n type FileStat,\n type FindOptions,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n REDACTED_SECRET,\n type Resource,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport { REDIS_COMMANDS } from '../../commands/builtin/redis/index.ts'\nimport type { RedisClientType } from 'redis'\nimport { RedisAccessor } from '../../accessor/redis.ts'\nimport { appendBytes } from '../../core/redis/append.ts'\nimport { copy as copyCore } from '../../core/redis/copy.ts'\nimport { create as createCore } from '../../core/redis/create.ts'\nimport { du as duCore, duAll as duAllCore } from '../../core/redis/du.ts'\nimport { exists as existsCore } from '../../core/redis/exists.ts'\nimport { find as findCore, type FindOptions as RedisFindOptions } from '../../core/redis/find.ts'\nimport { resolveGlob as globCore } from '../../core/redis/glob.ts'\nimport { mkdir as mkdirCore } from '../../core/redis/mkdir.ts'\nimport { read as readCore } from '../../core/redis/read.ts'\nimport { readdir as readdirCore } from '../../core/redis/readdir.ts'\nimport { rename as renameCore } from '../../core/redis/rename.ts'\nimport { rmR as rmRCore } from '../../core/redis/rm.ts'\nimport { rmdir as rmdirCore } from '../../core/redis/rmdir.ts'\nimport { stat as statCore } from '../../core/redis/stat.ts'\nimport { stream as streamCore } from '../../core/redis/stream.ts'\nimport { truncate as truncateCore } from '../../core/redis/truncate.ts'\nimport { unlink as unlinkCore } from '../../core/redis/unlink.ts'\nimport { writeBytes as writeCore } from '../../core/redis/write.ts'\nimport { REDIS_OPS } from '../../ops/redis/index.ts'\nimport { REDIS_PROMPT } from './prompt.ts'\nimport { RedisStore } from './store.ts'\n\nexport interface RedisResourceOptions {\n url?: string\n keyPrefix?: string\n}\n\nexport interface RedisModule {\n createClient: (options: { url: string }) => RedisClientType\n RESP_TYPES: { readonly BLOB_STRING: number }\n}\n\nexport interface RedisResourceState {\n type: string\n config: {\n url: typeof REDACTED_SECRET\n keyPrefix: string\n }\n keyPrefix: string\n files: Record<string, Uint8Array>\n dirs: string[]\n}\n\nexport class RedisResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.REDIS\n readonly cachesReads: boolean = false\n readonly indexTtl: number = 0\n readonly prompt: string = REDIS_PROMPT\n readonly url: string\n readonly keyPrefix: string\n readonly store: RedisStore\n readonly accessor: RedisAccessor\n\n readonly opsMap: Record<string, unknown> = {\n read_bytes: readCore,\n write: writeCore,\n readdir: readdirCore,\n stat: statCore,\n unlink: unlinkCore,\n rmdir: rmdirCore,\n copy: copyCore,\n rename: renameCore,\n mkdir: mkdirCore,\n read_stream: streamCore,\n rm_recursive: rmRCore,\n du_total: duCore,\n du_all: duAllCore,\n create: createCore,\n truncate: truncateCore,\n exists: existsCore,\n find_flat: findCore,\n append: appendBytes,\n }\n\n constructor(options: RedisResourceOptions = {}) {\n super()\n this.url = options.url ?? 'redis://localhost:6379/0'\n this.keyPrefix = options.keyPrefix ?? 'mirage:fs:'\n this.store = new RedisStore({ url: this.url, keyPrefix: this.keyPrefix })\n this.accessor = new RedisAccessor(this.store)\n }\n\n async open(): Promise<void> {\n await this.store.client()\n }\n\n close(): Promise<void> {\n return this.store.close()\n }\n\n client(): Promise<RedisClientType> {\n return this.store.client()\n }\n\n protected module(): Promise<RedisModule> {\n return import('redis') as unknown as Promise<RedisModule>\n }\n\n ops(): readonly RegisteredOp[] {\n return REDIS_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return REDIS_COMMANDS\n }\n\n streamPath(p: PathSpec): AsyncIterable<Uint8Array> {\n return streamCore(this.accessor, p)\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return readCore(this.accessor, p)\n }\n\n writeFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return writeCore(this.accessor, p, data)\n }\n\n appendFile(p: PathSpec, data: Uint8Array): Promise<void> {\n return appendBytes(this.accessor, p, data)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return readdirCore(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return statCore(this.accessor, p)\n }\n\n exists(p: PathSpec): Promise<boolean> {\n return existsCore(this.accessor, p)\n }\n\n mkdir(p: PathSpec, options?: { recursive?: boolean }): Promise<void> {\n return mkdirCore(this.accessor, p, options?.recursive === true)\n }\n\n rmdir(p: PathSpec): Promise<void> {\n return rmdirCore(this.accessor, p)\n }\n\n unlink(p: PathSpec): Promise<void> {\n return unlinkCore(this.accessor, p)\n }\n\n rename(src: PathSpec, dst: PathSpec): Promise<void> {\n return renameCore(this.accessor, src, dst)\n }\n\n truncate(p: PathSpec, length: number): Promise<void> {\n return truncateCore(this.accessor, p, length)\n }\n\n copy(src: PathSpec, dst: PathSpec): Promise<void> {\n return copyCore(this.accessor, src, dst)\n }\n\n rmR(p: PathSpec): Promise<void> {\n return rmRCore(this.accessor, p)\n }\n\n du(p: PathSpec): Promise<number> {\n return duCore(this.accessor, p)\n }\n\n find(p: PathSpec, options: FindOptions = {}): Promise<string[]> {\n return findCore(this.accessor, p, options as RedisFindOptions)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective = prefix\n ? paths.map((p) =>\n p.prefix\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return globCore(this.accessor, effective, this.index)\n }\n\n async getState(): Promise<RedisResourceState> {\n const files: Record<string, Uint8Array> = {}\n for (const key of await this.store.listFiles()) {\n const data = await this.store.getFile(key)\n if (data !== null) files[key] = data\n }\n const dirs = [...(await this.store.listDirs())].sort()\n return {\n type: this.kind,\n config: {\n url: REDACTED_SECRET,\n keyPrefix: this.keyPrefix,\n },\n keyPrefix: this.keyPrefix,\n files,\n dirs,\n }\n }\n\n async loadState(state: RedisResourceState): Promise<void> {\n const c = await this.store.client()\n const pipe = c.multi()\n const dirKey = `${this.keyPrefix}dir`\n for (const [path, data] of Object.entries(state.files)) {\n pipe.set(\n `${this.keyPrefix}file:${path}`,\n Buffer.from(data.buffer, data.byteOffset, data.byteLength),\n )\n }\n for (const dir of state.dirs) {\n pipe.sAdd(dirKey, dir)\n }\n await pipe.exec()\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n type RegisteredCommand,\n ResourceName,\n makeFiletypeCommands,\n makeGenericCommands,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { read as redisRead } from '../../../core/redis/read.ts'\nimport { stat as redisStat } from '../../../core/redis/stat.ts'\nimport { REDIS_CMD_OPS } from './ops.ts'\nimport { REDIS_SED } from './sed.ts'\n\nexport const REDIS_COMMANDS: readonly RegisteredCommand[] = [\n ...makeFiletypeCommands<RedisAccessor>({\n resource: ResourceName.REDIS,\n readBytes: redisRead,\n statEntry: redisStat,\n }),\n ...makeGenericCommands<RedisAccessor>(ResourceName.REDIS, REDIS_CMD_OPS),\n ...REDIS_SED,\n]\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type IndexCacheStore, record, ResourceName, type PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function read(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): Promise<Uint8Array> {\n const start = performance.now()\n const p = norm(path.stripPrefix)\n const data = await accessor.store.getFile(p)\n if (data === null) {\n throw enoent(path)\n }\n record('read', p, ResourceName.REDIS, data.byteLength, start)\n return data\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport { norm, parent, gnuBasename as basename } from '@struktoai/mirage-core'\n\nexport function nowIso(): string {\n return new Date().toISOString()\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n FileStat,\n FileType,\n guessType,\n type IndexCacheStore,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { basename, norm } from './utils.ts'\n\nexport async function stat(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): Promise<FileStat> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (await store.hasDir(p)) {\n return new FileStat({\n name: basename(p),\n modified: await store.getModified(p),\n type: FileType.DIRECTORY,\n })\n }\n if (await store.hasFile(p)) {\n const size = await store.fileLen(p)\n return new FileStat({\n name: basename(p),\n size,\n modified: await store.getModified(p),\n type: guessType(p),\n })\n }\n throw enoent(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const SCOPE_WARN = 5000\nexport const SCOPE_ERROR = 50000\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { invalidateAfterWrite, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function copy(accessor: RedisAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const s = norm(src.stripPrefix)\n const d = norm(dst.stripPrefix)\n const store = accessor.store\n const data = await store.getFile(s)\n if (data === null) {\n throw new Error(`file not found: ${s}`)\n }\n await store.setFile(d, data)\n await store.setModified(d, nowIso())\n await invalidateAfterWrite(dst)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { rstripSlash } from '@struktoai/mirage-core'\n\nexport async function du(accessor: RedisAccessor, path: PathSpec): Promise<number> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n let total = 0\n for (const key of await store.listFiles()) {\n if (key === p || key.startsWith(prefix)) {\n total += await store.fileLen(key)\n }\n }\n return total\n}\n\nexport async function duAll(\n accessor: RedisAccessor,\n path: PathSpec,\n): Promise<{ entries: [string, number][]; total: number }> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const entries: [string, number][] = []\n let total = 0\n for (const key of await store.listFiles()) {\n if (key === p || key.startsWith(prefix)) {\n const size = await store.fileLen(key)\n entries.push([key, size])\n total += size\n }\n }\n return { entries, total }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function exists(accessor: RedisAccessor, path: PathSpec): Promise<boolean> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n return (await store.hasFile(p)) || (await store.hasDir(p))\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport {\n buildTree,\n computeNonemptyDirs,\n emitStartPath,\n keep,\n type PredNode,\n rstripSlash,\n startBasename,\n} from '@struktoai/mirage-core'\n\nexport interface FindOptions {\n name?: string | null\n type?: 'f' | 'd' | null\n minSize?: number | null\n maxSize?: number | null\n maxDepth?: number | null\n minDepth?: number | null\n nameExclude?: string | null\n orNames?: string[] | null\n iname?: string | null\n pathPattern?: string | null\n empty?: boolean | null\n tree?: PredNode | null\n}\n\nexport async function find(\n accessor: RedisAccessor,\n path: PathSpec,\n options: FindOptions = {},\n): Promise<string[]> {\n const p = norm(path.stripPrefix)\n const startName = startBasename(path.original)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const baseDepth = p === '/' ? 0 : (p.match(/\\//g) ?? []).length\n const results: string[] = []\n const tree =\n options.tree ??\n buildTree({\n name: options.name,\n iname: options.iname,\n pathPattern: options.pathPattern,\n type: options.type,\n nameExclude: options.nameExclude,\n orNames: options.orNames,\n empty: options.empty,\n })\n const empty = options.empty === true\n const allFiles = await store.listFiles()\n const allDirs = await store.listDirs()\n const nonempty = empty\n ? computeNonemptyDirs([...allFiles, ...[...allDirs].filter((k) => k !== '/')])\n : new Set<string>()\n const candidates: [string, 'f' | 'd'][] = []\n if (options.type !== 'd') {\n for (const key of allFiles) candidates.push([key, 'f'])\n }\n if (options.type !== 'f') {\n for (const key of allDirs) {\n candidates.push([key, 'd'])\n }\n }\n let rootKind: 'f' | 'd' | null = null\n let rootIsEmpty: boolean | null = null\n let rootSize: number | null = null\n for (const [key, kind] of candidates) {\n if (key !== p && !key.startsWith(prefix)) continue\n if (key === p) {\n rootKind = kind\n if (empty) {\n rootIsEmpty = kind === 'f' ? (await store.fileLen(key)) === 0 : !nonempty.has(key)\n }\n if (kind === 'f') rootSize = await store.fileLen(key)\n continue\n }\n const depth = (key.match(/\\//g) ?? []).length - baseDepth\n if (options.maxDepth !== null && options.maxDepth !== undefined && depth > options.maxDepth)\n continue\n const basename = key.slice(key.lastIndexOf('/') + 1)\n let isEmpty: boolean | null = null\n if (empty) {\n isEmpty = kind === 'f' ? (await store.fileLen(key)) === 0 : !nonempty.has(key)\n }\n if (!keep({ key, name: basename, kind, depth, isEmpty }, tree, options.minDepth)) continue\n if (\n kind === 'f' &&\n ((options.minSize !== null && options.minSize !== undefined) ||\n (options.maxSize !== null && options.maxSize !== undefined))\n ) {\n const size = await store.fileLen(key)\n if (options.minSize !== null && options.minSize !== undefined && size < options.minSize)\n continue\n if (options.maxSize !== null && options.maxSize !== undefined && size > options.maxSize)\n continue\n }\n results.push(key)\n }\n if (rootKind !== null) {\n emitStartPath(results, p, startName, {\n kind: rootKind,\n isEmpty: rootIsEmpty,\n exists: true,\n tree,\n maxDepth: options.maxDepth,\n minDepth: options.minDepth,\n size: rootSize,\n minSize: options.minSize,\n maxSize: options.maxSize,\n })\n }\n results.sort()\n return results\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso, parent } from './utils.ts'\nimport { stripSlash } from '@struktoai/mirage-core'\n\nexport async function mkdir(\n accessor: RedisAccessor,\n path: PathSpec,\n parents = false,\n): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (parents) {\n const parts = stripSlash(p).split('/')\n let current = ''\n const now = nowIso()\n for (const part of parts) {\n current += `/${part}`\n await store.addDir(current)\n const mod = await store.getModified(current)\n if (mod === null) {\n await store.setModified(current, now)\n }\n }\n return\n }\n const par = parent(p)\n if (par !== '/' && !(await store.hasDir(par))) {\n throw new Error(`parent directory does not exist: ${par}`)\n }\n await store.addDir(p)\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type IndexCacheStore, type PathSpec } from '@struktoai/mirage-core'\nimport { enotdir } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { RedisIndexEntry } from './entry.ts'\nimport { norm } from './utils.ts'\n\nexport async function readdir(\n accessor: RedisAccessor,\n path: PathSpec,\n index?: IndexCacheStore,\n): Promise<string[]> {\n const virtual = path.pattern !== null ? path.directory : path.stripPrefix\n const mountPrefix = path.prefix\n const virtualKey = mountPrefix + virtual\n if (index !== undefined) {\n const cached = await index.listDir(virtualKey)\n if (cached.entries !== undefined && cached.entries !== null) {\n return cached.entries\n }\n }\n const store = accessor.store\n const p = norm(virtual)\n if (!(await store.hasDir(p))) {\n throw enotdir(path)\n }\n const dirPrefix = p === '/' ? '/' : `${p}/`\n const seen = new Set<string>()\n const files = await store.listFiles()\n const dirs = await store.listDirs()\n for (const key of [...files, ...dirs]) {\n if (key === p) continue\n if (!key.startsWith(dirPrefix)) continue\n const remainder = key.slice(dirPrefix.length)\n const first = remainder.split('/')[0]\n if (first !== undefined && first.length > 0) seen.add(dirPrefix + first)\n }\n const sorted = [...seen].sort()\n const virtualEntries = sorted.map((entry) => `${mountPrefix}${entry}`)\n if (index !== undefined) {\n const fileSet = new Set(files)\n const entries: [string, RedisIndexEntry][] = sorted.map((e) => {\n const name = e.slice(e.lastIndexOf('/') + 1)\n return [name, fileSet.has(e) ? RedisIndexEntry.file(e) : RedisIndexEntry.folder(e)]\n })\n await index.setDir(virtualKey, entries)\n }\n return virtualEntries\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { IndexEntry } from '@struktoai/mirage-core'\n\nexport const RedisResourceType = Object.freeze({\n FILE: 'file',\n FOLDER: 'folder',\n} as const)\n\nexport type RedisResourceType = (typeof RedisResourceType)[keyof typeof RedisResourceType]\n\nexport class RedisIndexEntry extends IndexEntry {\n static file(path: string, size = 0): RedisIndexEntry {\n const name = path.slice(path.lastIndexOf('/') + 1)\n return new RedisIndexEntry({\n id: path,\n name,\n resourceType: RedisResourceType.FILE,\n vfsName: name,\n size,\n })\n }\n\n static folder(path: string): RedisIndexEntry {\n const name = path.slice(path.lastIndexOf('/') + 1)\n return new RedisIndexEntry({\n id: path,\n name,\n resourceType: RedisResourceType.FOLDER,\n vfsName: name,\n })\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterUnlink, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\nimport { rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rename(accessor: RedisAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const s = norm(src.stripPrefix)\n const d = norm(dst.stripPrefix)\n const now = nowIso()\n const store = accessor.store\n if (await store.hasFile(s)) {\n const data = await store.getFile(s)\n const mod = await store.getModified(s)\n if (data === null) throw new Error(`file not found: ${s}`)\n await store.delFile(s)\n await store.delModified(s)\n await store.setFile(d, data)\n await store.setModified(d, mod ?? now)\n await invalidateAfterUnlink(s)\n await invalidateAfterWrite(d)\n return\n }\n if (await store.hasDir(s)) {\n const mod = await store.getModified(s)\n await store.removeDir(s)\n await store.delModified(s)\n await store.addDir(d)\n await store.setModified(d, mod ?? now)\n const prefix = rstripSlash(s) + '/'\n const dPrefix = rstripSlash(d) + '/'\n const files = await store.listFiles()\n for (const key of files) {\n if (key.startsWith(prefix)) {\n const newKey = dPrefix + key.slice(prefix.length)\n const data = await store.getFile(key)\n if (data === null) continue\n await store.delFile(key)\n await store.setFile(newKey, data)\n }\n }\n await invalidateAfterUnlink(s)\n await invalidateAfterWrite(d)\n return\n }\n throw new Error(`file not found: ${s}`)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { invalidateAfterUnlink, rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rmR(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const prefix = rstripSlash(p) + '/'\n const files = await store.listFiles()\n for (const key of files) {\n if (key === p || key.startsWith(prefix)) {\n await store.delFile(key)\n await store.delModified(key)\n }\n }\n const dirs = await store.listDirs()\n for (const key of dirs) {\n if (key === p || key.startsWith(prefix)) {\n await store.removeDir(key)\n await store.delModified(key)\n }\n }\n await invalidateAfterUnlink(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\nimport { invalidateAfterUnlink, rstripSlash } from '@struktoai/mirage-core'\n\nexport async function rmdir(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (!(await store.hasDir(p))) {\n throw new Error(`not a directory: ${p}`)\n }\n const prefix = rstripSlash(p) + '/'\n const files = await store.listFiles()\n const dirs = await store.listDirs()\n const candidates = [...files, ...dirs]\n for (const k of candidates) {\n if (k !== p && k.startsWith(prefix)) {\n throw new Error(`directory not empty: ${p}`)\n }\n }\n await store.removeDir(p)\n await invalidateAfterUnlink(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n type IndexCacheStore,\n recordStream,\n ResourceName,\n type PathSpec,\n} from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function* stream(\n accessor: RedisAccessor,\n path: PathSpec,\n _index?: IndexCacheStore,\n): AsyncIterable<Uint8Array> {\n const p = norm(path.stripPrefix)\n const data = await accessor.store.getFile(p)\n if (data === null) throw enoent(path)\n const rec = recordStream('read', p, ResourceName.REDIS)\n if (rec !== null) rec.bytes = data.byteLength\n yield data\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterUnlink } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm } from './utils.ts'\n\nexport async function unlink(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n if (!(await store.hasFile(p))) {\n throw new Error(`file not found: ${p}`)\n }\n await store.delFile(p)\n await store.delModified(p)\n await invalidateAfterUnlink(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { ResourceName, invalidateAfterWrite, record, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso, parent } from './utils.ts'\n\nexport async function writeBytes(\n accessor: RedisAccessor,\n path: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const start = performance.now()\n const p = norm(path.stripPrefix)\n const par = parent(p)\n const store = accessor.store\n if (par !== '/' && !(await store.hasDir(par))) {\n throw new Error(`parent directory does not exist: ${par}`)\n }\n await store.setFile(p, data)\n await store.setModified(p, nowIso())\n record('write', p, ResourceName.REDIS, data.byteLength, start)\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { CommandIO } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { SCOPE_ERROR } from '../../../core/redis/constants.ts'\nimport { copy as redisCopy } from '../../../core/redis/copy.ts'\nimport { du as redisDu, duAll as redisDuAll } from '../../../core/redis/du.ts'\nimport { exists as redisExists } from '../../../core/redis/exists.ts'\nimport { find as redisFind } from '../../../core/redis/find.ts'\nimport { mkdir as redisMkdir } from '../../../core/redis/mkdir.ts'\nimport { read as redisRead } from '../../../core/redis/read.ts'\nimport { readdir as redisReaddir } from '../../../core/redis/readdir.ts'\nimport { rename as redisRename } from '../../../core/redis/rename.ts'\nimport { rmR as redisRmR } from '../../../core/redis/rm.ts'\nimport { rmdir as redisRmdir } from '../../../core/redis/rmdir.ts'\nimport { stat as redisStat } from '../../../core/redis/stat.ts'\nimport { stream as redisStream } from '../../../core/redis/stream.ts'\nimport { unlink as redisUnlink } from '../../../core/redis/unlink.ts'\nimport { writeBytes as redisWrite } from '../../../core/redis/write.ts'\n\nexport const REDIS_CMD_OPS: CommandIO<RedisAccessor> = {\n readdir: redisReaddir,\n readBytes: redisRead,\n readStream: redisStream,\n stat: redisStat,\n isMounted: () => true,\n local: true,\n maxGlobMatches: SCOPE_ERROR,\n write: redisWrite,\n exists: redisExists,\n mkdir: redisMkdir,\n unlink: redisUnlink,\n rmdir: redisRmdir,\n rmR: redisRmR,\n rename: redisRename,\n copy: redisCopy,\n find: redisFind,\n duTotal: redisDu,\n duAll: async (accessor, path) => {\n const { entries, total } = await redisDuAll(accessor, path)\n return [entries, total]\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { ResourceName, makeSed } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../../accessor/redis.ts'\nimport { stream as redisStream } from '../../../core/redis/stream.ts'\nimport { writeBytes as redisWrite } from '../../../core/redis/write.ts'\n\nexport const REDIS_SED = makeSed<RedisAccessor>({\n resource: ResourceName.REDIS,\n stream: (a, p) => redisStream(a, p),\n write: (a, p, d) => redisWrite(a, p, d),\n})\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { Accessor } from '@struktoai/mirage-core'\nimport type { RedisStore } from '../resource/redis/store.ts'\n\nexport class RedisAccessor extends Accessor {\n readonly store: RedisStore\n\n constructor(store: RedisStore) {\n super()\n this.store = store\n }\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { ResourceName, invalidateAfterWrite, record, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function appendBytes(\n accessor: RedisAccessor,\n path: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const start = performance.now()\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const existing = await store.getFile(p)\n if (existing !== null) {\n const merged = new Uint8Array(existing.byteLength + data.byteLength)\n merged.set(existing, 0)\n merged.set(data, existing.byteLength)\n await store.setFile(p, merged)\n } else {\n await store.setFile(p, data)\n }\n await store.setModified(p, nowIso())\n record('append', p, ResourceName.REDIS, data.byteLength, start)\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { invalidateAfterWrite, type PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function create(accessor: RedisAccessor, path: PathSpec): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n await store.setFile(p, new Uint8Array(0))\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(path)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type IndexCacheStore, PathSpec } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { SCOPE_ERROR } from './constants.ts'\nimport { readdir } from './readdir.ts'\nimport { fnmatch } from '@struktoai/mirage-core'\nimport { gnuBasename } from '@struktoai/mirage-core'\n\nexport async function resolveGlob(\n accessor: RedisAccessor,\n paths: readonly PathSpec[],\n index?: IndexCacheStore,\n): Promise<PathSpec[]> {\n const result: PathSpec[] = []\n for (const p of paths) {\n if (p.resolved) {\n result.push(p)\n } else if (p.pattern !== null) {\n const dirSpec = new PathSpec({\n original: p.directory,\n directory: p.directory,\n resolved: true,\n prefix: p.prefix,\n })\n const entries = await readdir(accessor, dirSpec, index)\n const matched: PathSpec[] = []\n for (const e of entries) {\n if (fnmatch(gnuBasename(e), p.pattern)) {\n matched.push(\n new PathSpec({\n original: e,\n directory: p.directory,\n resolved: true,\n prefix: p.prefix,\n }),\n )\n }\n }\n if (matched.length > SCOPE_ERROR) matched.length = SCOPE_ERROR\n result.push(...matched)\n } else {\n result.push(p)\n }\n }\n return result\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { type PathSpec, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { norm, nowIso } from './utils.ts'\n\nexport async function truncate(\n accessor: RedisAccessor,\n path: PathSpec,\n length: number,\n): Promise<void> {\n const p = norm(path.stripPrefix)\n const store = accessor.store\n const existing = await store.getFile(p)\n const data = existing ?? new Uint8Array(0)\n const out = new Uint8Array(length)\n const copyLen = Math.min(data.byteLength, length)\n out.set(data.subarray(0, copyLen), 0)\n await store.setFile(p, out)\n await store.setModified(p, nowIso())\n await invalidateAfterWrite(p)\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { appendBytes } from '../../core/redis/append.ts'\n\nexport const appendOp: RegisteredOp = {\n name: 'append',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const data = args[0]\n if (!(data instanceof Uint8Array)) {\n throw new TypeError('append op requires a Uint8Array as the first arg')\n }\n return appendBytes(accessor, path, data)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { create } from '../../core/redis/create.ts'\n\nexport const createOp: RegisteredOp = {\n name: 'create',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return create(accessor, path)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { mkdir } from '../../core/redis/mkdir.ts'\n\nexport const mkdirOp: RegisteredOp = {\n name: 'mkdir',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const parents = args[0]\n return mkdir(accessor, path, parents === true)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readOp: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: null,\n write: false,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return coreRead(accessor, path)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n featherCat,\n type OpKwargs,\n type PathSpec,\n type RegisteredOp,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readFeatherOp: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: '.feather',\n write: false,\n fn: async (\n accessor: RedisAccessor,\n path: PathSpec,\n _args: readonly unknown[],\n kwargs: OpKwargs,\n ) => {\n const raw = await coreRead(accessor, path, kwargs.index)\n return featherCat(raw)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n hdf5Cat,\n type OpKwargs,\n type PathSpec,\n type RegisteredOp,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readHdf5Op: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: '.hdf5',\n write: false,\n fn: async (\n accessor: RedisAccessor,\n path: PathSpec,\n _args: readonly unknown[],\n kwargs: OpKwargs,\n ) => {\n const raw = await coreRead(accessor, path, kwargs.index)\n return hdf5Cat(raw)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n type OpKwargs,\n parquetCat,\n type PathSpec,\n type RegisteredOp,\n ResourceName,\n} from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { read as coreRead } from '../../core/redis/read.ts'\n\nexport const readParquetOp: RegisteredOp = {\n name: 'read',\n resource: ResourceName.REDIS,\n filetype: '.parquet',\n write: false,\n fn: async (\n accessor: RedisAccessor,\n path: PathSpec,\n _args: readonly unknown[],\n kwargs: OpKwargs,\n ) => {\n const raw = await coreRead(accessor, path, kwargs.index)\n return parquetCat(raw)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { readdir } from '../../core/redis/readdir.ts'\n\nexport const readdirOp: RegisteredOp = {\n name: 'readdir',\n resource: ResourceName.REDIS,\n filetype: null,\n write: false,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return readdir(accessor, path)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { rename } from '../../core/redis/rename.ts'\n\nexport const renameOp: RegisteredOp = {\n name: 'rename',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const dst = args[0]\n if (dst === undefined || dst === null || typeof dst !== 'object' || !('original' in dst)) {\n throw new TypeError('rename op requires a PathSpec destination as the first arg')\n }\n return rename(accessor, path, dst as PathSpec)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { rmdir } from '../../core/redis/rmdir.ts'\n\nexport const rmdirOp: RegisteredOp = {\n name: 'rmdir',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return rmdir(accessor, path)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { stat as coreStat } from '../../core/redis/stat.ts'\n\nexport const statOp: RegisteredOp = {\n name: 'stat',\n resource: ResourceName.REDIS,\n filetype: null,\n write: false,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return coreStat(accessor, path)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { truncate } from '../../core/redis/truncate.ts'\n\nexport const truncateOp: RegisteredOp = {\n name: 'truncate',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const length = args[0]\n if (typeof length !== 'number') {\n throw new TypeError('truncate op requires a number length as the first arg')\n }\n return truncate(accessor, path, length)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { PathSpec, RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { unlink } from '../../core/redis/unlink.ts'\n\nexport const unlinkOp: RegisteredOp = {\n name: 'unlink',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec) => {\n return unlink(accessor, path)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { extractWriteData, type PathSpec, type RegisteredOp } from '@struktoai/mirage-core'\nimport { ResourceName } from '@struktoai/mirage-core'\nimport type { RedisAccessor } from '../../accessor/redis.ts'\nimport { writeBytes } from '../../core/redis/write.ts'\n\nexport const writeOp: RegisteredOp = {\n name: 'write',\n resource: ResourceName.REDIS,\n filetype: null,\n write: true,\n fn: (accessor: RedisAccessor, path: PathSpec, args: readonly unknown[]) => {\n const data = extractWriteData(args)\n return writeBytes(accessor, path, data)\n },\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { RegisteredOp } from '@struktoai/mirage-core'\nimport { appendOp } from './append.ts'\nimport { createOp } from './create.ts'\nimport { mkdirOp } from './mkdir.ts'\nimport { readOp } from './read.ts'\nimport { readFeatherOp } from './read_feather.ts'\nimport { readHdf5Op } from './read_hdf5.ts'\nimport { readParquetOp } from './read_parquet.ts'\nimport { readdirOp } from './readdir.ts'\nimport { renameOp } from './rename.ts'\nimport { rmdirOp } from './rmdir.ts'\nimport { statOp } from './stat.ts'\nimport { truncateOp } from './truncate.ts'\nimport { unlinkOp } from './unlink.ts'\nimport { writeOp } from './write.ts'\n\nexport const REDIS_OPS: readonly RegisteredOp[] = [\n appendOp,\n createOp,\n mkdirOp,\n readOp,\n readFeatherOp,\n readHdf5Op,\n readParquetOp,\n readdirOp,\n renameOp,\n rmdirOp,\n statOp,\n truncateOp,\n unlinkOp,\n writeOp,\n]\n\nexport {\n appendOp,\n createOp,\n mkdirOp,\n readOp,\n readFeatherOp,\n readHdf5Op,\n readParquetOp,\n readdirOp,\n renameOp,\n rmdirOp,\n statOp,\n truncateOp,\n unlinkOp,\n writeOp,\n}\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nexport const REDIS_PROMPT = `Redis-backed persistent filesystem. Behaves like a standard filesystem.\nStandard commands: ls, cat, head, tail, grep, wc, find, tree, mkdir, touch, cp, mv, rm, tee.`\n","// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { RedisClientType } from 'redis'\nimport { loadOptionalPeer } from '../../optional_peer.ts'\n\nexport interface RedisStoreOptions {\n url?: string\n client?: RedisClientType\n keyPrefix?: string\n}\n\nexport class RedisStore {\n readonly url: string\n readonly keyPrefix: string\n private readonly providedClient: RedisClientType | null\n private clientPromise: Promise<RedisClientType> | null = null\n\n constructor(options: RedisStoreOptions = {}) {\n this.url = options.url ?? 'redis://localhost:6379/0'\n this.keyPrefix = options.keyPrefix ?? 'mirage:fs:'\n this.providedClient = options.client ?? null\n }\n\n fk(path: string): string {\n return `${this.keyPrefix}file:${path}`\n }\n\n dk(): string {\n return `${this.keyPrefix}dir`\n }\n\n mk(path: string): string {\n return `${this.keyPrefix}modified:${path}`\n }\n\n async client(): Promise<RedisClientType> {\n if (this.providedClient !== null) return this.providedClient\n this.clientPromise ??= (async () => {\n const mod = await loadOptionalPeer(\n () =>\n import('redis') as unknown as Promise<{\n createClient: (o: { url: string }) => RedisClientType\n }>,\n { feature: 'RedisResource / RedisFileCacheStore', packageName: 'redis' },\n )\n const c = mod.createClient({\n url: this.url,\n socket: { reconnectStrategy: false },\n } as Parameters<typeof mod.createClient>[0])\n await c.connect()\n await c.sAdd(this.dk(), '/')\n return c\n })()\n return this.clientPromise\n }\n\n async getFile(path: string): Promise<Uint8Array | null> {\n const c = await this.client()\n const typed = c as unknown as {\n withTypeMapping: (m: Record<number, unknown>) => {\n get: (k: string) => Promise<Buffer | null>\n }\n }\n const mod = (await import('redis')) as unknown as {\n RESP_TYPES: { readonly BLOB_STRING: number }\n }\n const blob = mod.RESP_TYPES.BLOB_STRING\n const mapping: Record<number, unknown> = { [blob]: Buffer }\n const raw = await typed.withTypeMapping(mapping).get(this.fk(path))\n if (raw === null) return null\n return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength)\n }\n\n async setFile(path: string, data: Uint8Array): Promise<void> {\n const c = await this.client()\n await c.set(this.fk(path), Buffer.from(data.buffer, data.byteOffset, data.byteLength))\n }\n\n async delFile(path: string): Promise<void> {\n const c = await this.client()\n await c.del(this.fk(path))\n }\n\n async hasFile(path: string): Promise<boolean> {\n const c = await this.client()\n return (await c.exists(this.fk(path))) > 0\n }\n\n async listFiles(prefix = ''): Promise<string[]> {\n const c = await this.client()\n const pattern = `${this.keyPrefix}file:${prefix}*`\n const strip = `${this.keyPrefix}file:`.length\n const result: string[] = []\n for await (const k of c.scanIterator({ MATCH: pattern })) {\n const keys = Array.isArray(k) ? k : [k]\n for (const key of keys) result.push(key.slice(strip))\n }\n return result.sort()\n }\n\n async fileLen(path: string): Promise<number> {\n const c = await this.client()\n return c.strLen(this.fk(path))\n }\n\n async getRange(path: string, start: number, end: number): Promise<Uint8Array> {\n const c = await this.client()\n const typed = c as unknown as {\n withTypeMapping: (m: Record<number, unknown>) => {\n getRange: (k: string, s: number, e: number) => Promise<Buffer>\n }\n }\n const mod = (await import('redis')) as unknown as {\n RESP_TYPES: { readonly BLOB_STRING: number }\n }\n const blob = mod.RESP_TYPES.BLOB_STRING\n const mapping: Record<number, unknown> = { [blob]: Buffer }\n const raw = await typed.withTypeMapping(mapping).getRange(this.fk(path), start, end)\n return new Uint8Array(raw.buffer, raw.byteOffset, raw.byteLength)\n }\n\n async hasDir(path: string): Promise<boolean> {\n const c = await this.client()\n return (await c.sIsMember(this.dk(), path)) === 1\n }\n\n async addDir(path: string): Promise<void> {\n const c = await this.client()\n await c.sAdd(this.dk(), path)\n }\n\n async removeDir(path: string): Promise<void> {\n const c = await this.client()\n await c.sRem(this.dk(), path)\n }\n\n async listDirs(): Promise<Set<string>> {\n const c = await this.client()\n const members = await c.sMembers(this.dk())\n return new Set(members)\n }\n\n async getModified(path: string): Promise<string | null> {\n const c = await this.client()\n return c.get(this.mk(path))\n }\n\n async setModified(path: string, ts: string): Promise<void> {\n const c = await this.client()\n await c.set(this.mk(path), ts)\n }\n\n async delModified(path: string): Promise<void> {\n const c = await this.client()\n await c.del(this.mk(path))\n }\n\n async clear(): Promise<void> {\n const c = await this.client()\n for (const pattern of [`${this.keyPrefix}file:*`, `${this.keyPrefix}modified:*`]) {\n const keys: string[] = []\n for await (const k of c.scanIterator({ MATCH: pattern })) {\n if (Array.isArray(k)) keys.push(...k)\n else keys.push(k)\n }\n if (keys.length > 0) await c.del(keys)\n }\n await c.del(this.dk())\n }\n\n async close(): Promise<void> {\n if (this.providedClient !== null) return\n if (this.clientPromise === null) return\n const c = await this.clientPromise\n const typed = c as unknown as { destroy?: () => void }\n if (typeof typed.destroy === 'function') typed.destroy()\n else if (c.isOpen) await c.quit()\n this.clientPromise = null\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAGA,YAAAA;AAAA,EAGA;AAAA,EAEA,gBAAAC;AAAA,OACK;;;ACVP;AAAA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AM,UAAU,GAAG;AAC9C,YAAM,OAAO,MAAM,KAAK,MAAM,QAAQ,GAAG;AACzC,UAAI,SAAS,KAAM,OAAM,GAAG,IAAI;AAAA,IAClC;AACA,UAAM,OAAO,CAAC,GAAI,MAAM,KAAK,MAAM,SAAS,CAAE,EAAE,KAAK;AACrD,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,QAAQ;AAAA,QACN,KAAK;AAAA,QACL,WAAW,KAAK;AAAA,MAClB;AAAA,MACA,WAAW,KAAK;AAAA,MAChB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,UAAU,OAA0C;AACxD,UAAM,IAAI,MAAM,KAAK,MAAM,OAAO;AAClC,UAAM,OAAO,EAAE,MAAM;AACrB,UAAM,SAAS,GAAG,KAAK,SAAS;AAChC,eAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,MAAM,KAAK,GAAG;AACtD,WAAK;AAAA,QACH,GAAG,KAAK,SAAS,QAAQ,IAAI;AAAA,QAC7B,OAAO,KAAK,KAAK,QAAQ,KAAK,YAAY,KAAK,UAAU;AAAA,MAC3D;AAAA,IACF;AACA,eAAW,OAAO,MAAM,MAAM;AAC5B,WAAK,KAAK,QAAQ,GAAG;AAAA,IACvB;AACA,UAAM,KAAK,KAAK;AAAA,EAClB;AACF;","names":["PathSpec","ResourceName","ResourceName","enoent","enoent","rstripSlash","invalidateAfterWrite","invalidateAfterWrite","invalidateAfterWrite","rstripSlash","invalidateAfterWrite","invalidateAfterUnlink","rstripSlash","invalidateAfterUnlink","rstripSlash","ResourceName","enoent","enoent","ResourceName","invalidateAfterUnlink","invalidateAfterUnlink","ResourceName","invalidateAfterWrite","record","record","ResourceName","invalidateAfterWrite","ResourceName","ResourceName","ResourceName","ResourceName","invalidateAfterWrite","record","record","ResourceName","invalidateAfterWrite","invalidateAfterWrite","invalidateAfterWrite","gnuBasename","invalidateAfterWrite","invalidateAfterWrite","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","ResourceName","PathSpec"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/discord/discord.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n DISCORD_API,\n DISCORD_COMMANDS,\n DISCORD_PROMPT,\n DISCORD_VFS_OPS,\n DISCORD_WRITE_PROMPT,\n DiscordAccessor,\n type FileStat,\n HttpDiscordTransport,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n discordRead,\n discordReaddir,\n discordStat,\n resolveDiscordGlob,\n} from '@struktoai/mirage-core'\nimport { redactDiscordConfig, type DiscordConfig, type DiscordConfigRedacted } from './config.ts'\n\nclass NodeDiscordTransport extends HttpDiscordTransport {\n constructor(private readonly token: string) {\n super()\n }\n protected baseUrl(): string {\n return DISCORD_API\n }\n protected authHeaders(): Record<string, string> {\n return { Authorization: `Bot ${this.token}` }\n }\n}\n\nexport interface DiscordResourceState {\n type: string\n config: DiscordConfigRedacted\n}\n\nexport class DiscordResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.DISCORD\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = DISCORD_PROMPT\n readonly writePrompt: string = DISCORD_WRITE_PROMPT\n readonly config: DiscordConfig\n readonly accessor: DiscordAccessor\n\n constructor(config: DiscordConfig) {\n super()\n this.config = config\n this.accessor = new DiscordAccessor(new NodeDiscordTransport(config.token))\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return DISCORD_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return DISCORD_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return discordRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return discordReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return discordStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveDiscordGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<DiscordResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactDiscordConfig(this.config),\n })\n }\n\n loadState(_state: DiscordResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,uBAAN,cAAmC,qBAAqB;AAAA,EACtD,YAA6B,OAAe;AAC1C,UAAM;AADqB;AAAA,E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,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,mBAAmB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAChE;AAAA,EAEA,WAA0C;AACxC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,oBAAoB,KAAK,MAAM;AAAA,IACzC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA6C;AACrD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/wasabi/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\nimport type { S3Config } from '../s3/config.ts'\n\nexport interface WasabiConfig {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n region?: string\n endpoint?: string\n timeoutMs?: number\n}\n\nexport interface WasabiConfigRedacted {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n region: string\n endpoint: string\n timeoutMs?: number\n}\n\nexport const WasabiConfigSchema = z.object({\n bucket: z.string(),\n accessKeyId: secretStr(),\n secretAccessKey: secretStr(),\n region: z.string(),\n endpoint: z.string(),\n timeoutMs: z.number().optional(),\n})\n\nexport function resolvedWasabiEndpoint(config: WasabiConfig): string {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n const region = config.region ?? 'us-east-1'\n return region === 'us-east-1' ? 'https://s3.wasabisys.com' : `https://s3.${region}.wasabisys.com`\n}\n\nexport function wasabiToS3Config(config: WasabiConfig): S3Config {\n return {\n bucket: config.bucket,\n region: config.region ?? 'us-east-1',\n endpoint: resolvedWasabiEndpoint(config),\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function redactWasabiConfig(config: WasabiConfig): WasabiConfigRedacted {\n return redactConfigWithSchema(WasabiConfigSchema, {\n ...config,\n region: config.region ?? 'us-east-1',\n endpoint: resolvedWasabiEndpoint(config),\n }) as unknown as WasabiConfigRedacted\n}\n\nexport function normalizeWasabiConfig(input: Record<string, unknown>): WasabiConfig {\n return normalizeFields(input, {\n rename: {\n access_key_id: 'accessKeyId',\n secret_access_key: 'secretAccessKey',\n endpoint_url: 'endpoint',\n timeout: 'timeoutMs',\n },\n transform: {\n timeout: (v: unknown) => (typeof v === 'number' ? v * 1000 : v),\n },\n drop: ['proxy'],\n }) as unknown as WasabiConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAqB/D,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,QAAQ,EAAE,OAAO;AAAA,EACjB,aAAa,UAAU;AAAA,EACvB,iBAAiB,UAAU;AAAA,EAC3B,QAAQ,EAAE,OAAO;AAAA,EACjB,UAAU,EAAE,OAAO;AAAA,EACnB,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,uBAAuB,QAA8B;AACnE,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,QAAM,SAAS,OAAO,UAAU;AAChC,SAAO,WAAW,cAAc,6BAA6B,cAAc,MAAM;AACnF;AAEO,SAAS,iBAAiB,QAAgC;AAC/D,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO,UAAU;AAAA,IACzB,UAAU,uBAAuB,MAAM;AAAA,IACvC,aAAa,OAAO;AAAA,IACpB,iBAAiB,OAAO;AAAA,IACxB,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB;AAAA,IAChD,GAAG;AAAA,IACH,QAAQ,OAAO,UAAU;AAAA,IACzB,UAAU,uBAAuB,MAAM;AAAA,EACzC,CAAC;AACH;AAEO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,SAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,SAAS,CAAC,MAAgB,OAAO,MAAM,WAAW,IAAI,MAAO;AAAA,IAC/D;AAAA,IACA,MAAM,CAAC,OAAO;AAAA,EAChB,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gdocs/gdocs.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n type FileStat,\n GDOCS_COMMANDS,\n GDOCS_PROMPT,\n GDOCS_VFS_OPS,\n GDOCS_WRITE_PROMPT,\n GDocsAccessor,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gdocsRead,\n gdocsReaddir,\n gdocsResolveGlob,\n gdocsStat,\n} from '@struktoai/mirage-core'\nimport { redactGDocsConfig, type GDocsConfig, type GDocsConfigRedacted } from './config.ts'\n\nexport interface GDocsResourceState {\n type: string\n config: GDocsConfigRedacted\n}\n\nexport class GDocsResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GDOCS\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GDOCS_PROMPT\n readonly writePrompt: string = GDOCS_WRITE_PROMPT\n readonly config: GDocsConfig\n readonly accessor: GDocsAccessor\n\n constructor(config: GDocsConfig) {\n super()\n this.config = config\n const tm = new TokenManager({\n clientId: config.clientId,\n clientSecret: config.clientSecret,\n refreshToken: config.refreshToken,\n })\n this.accessor = new GDocsAccessor({ tokenManager: tm })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GDOCS_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GDOCS_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gdocsRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gdocsReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gdocsStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return gdocsResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GDocsResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGDocsConfig(this.config),\n })\n }\n\n loadState(_state: GDocsResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,gBAAN,cAA4B,aAAiC;AAAA,EACzD,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAqB;AAC/B,UAAM;AACN,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa;AAAA,MAC1B,UAAU,OAAO;AAAA,MACjB,cAAc,OAAO;AAAA,MACrB,cAAc,OAAO;AAAA,IACvB,CAAC;AACD,SAAK,WAAW,IAAI,cAAc,EAAE,cAAc,GAAG,CAAC;AAAA,EACxD;AAAA,EAEA,OAAsB;AACpB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,QAAuB;AACrB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,WAAyC;AACvC,WAAO;AAAA,EACT;AAAA,EAEA,MAA+B;AAC7B,WAAO;AAAA,EACT;AAAA,EAEA,SAAS,GAAkC;AACzC,WAAO,UAAU,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAC/C;AAAA,EAEA,QAAQ,GAAgC;AACtC,WAAO,aAAa,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAClD;AAAA,EAEA,KAAK,GAAgC;AACnC,WAAO,UAAU,KAAK,UAAU,GAAG,KAAK,KAAK;AAAA,EAC/C;AAAA,EAEA,MAAM,YAAY,GAAqC;AACrD,UAAM,SAAS,MAAM,KAAK,MAAM,IAAI,EAAE,QAAQ;AAC9C,WAAO,OAAO,OAAO,cAAc;AAAA,EACrC;AAAA,EAEA,KAAK,OAA4B,SAAS,IAAyB;AACjE,UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,iBAAiB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC9D;AAAA,EAEA,WAAwC;AACtC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,kBAAkB,KAAK,MAAM;AAAA,IACvC,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA2C;AACnD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
package/dist/chunk-JZT4QGIP.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// src/resource/notion/config.ts
|
|
2
|
-
import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
|
|
3
|
-
var NotionConfigSchema = z.object({
|
|
4
|
-
apiKey: secretStr(),
|
|
5
|
-
baseUrl: z.string().optional()
|
|
6
|
-
});
|
|
7
|
-
function redactNotionConfig(config) {
|
|
8
|
-
return redactConfigWithSchema(NotionConfigSchema, config);
|
|
9
|
-
}
|
|
10
|
-
function normalizeNotionConfig(input) {
|
|
11
|
-
return normalizeFields(input, {
|
|
12
|
-
rename: {
|
|
13
|
-
api_key: "apiKey",
|
|
14
|
-
base_url: "baseUrl"
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
NotionConfigSchema,
|
|
21
|
-
redactNotionConfig,
|
|
22
|
-
normalizeNotionConfig
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=chunk-JZT4QGIP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/notion/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface NotionConfig {\n apiKey: string\n baseUrl?: string\n}\n\nexport interface NotionConfigRedacted {\n apiKey: '<REDACTED>'\n baseUrl?: string\n}\n\nexport const NotionConfigSchema = z.object({\n apiKey: secretStr(),\n baseUrl: z.string().optional(),\n})\n\nexport function redactNotionConfig(config: NotionConfig): NotionConfigRedacted {\n return redactConfigWithSchema(NotionConfigSchema, config) as unknown as NotionConfigRedacted\n}\n\nexport function normalizeNotionConfig(input: Record<string, unknown>): NotionConfig {\n return normalizeFields(input, {\n rename: {\n api_key: 'apiKey',\n base_url: 'baseUrl',\n },\n }) as unknown as NotionConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAY/D,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,QAAQ,UAAU;AAAA,EAClB,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAEM,SAAS,mBAAmB,QAA4C;AAC7E,SAAO,uBAAuB,oBAAoB,MAAM;AAC1D;AAEO,SAAS,sBAAsB,OAA8C;AAClF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IACZ;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/r2/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\nimport type { S3Config } from '../s3/config.ts'\n\nexport interface R2Config {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n accountId?: string\n endpoint?: string\n region?: string\n profile?: string\n timeoutMs?: number\n}\n\nexport interface R2ConfigRedacted {\n bucket: string\n accessKeyId: string\n secretAccessKey: string\n accountId?: string\n endpoint: string\n region: string\n profile?: string\n timeoutMs?: number\n}\n\nexport const R2ConfigSchema = z.object({\n bucket: z.string(),\n accessKeyId: secretStr(),\n secretAccessKey: secretStr(),\n accountId: z.string().optional(),\n endpoint: z.string(),\n region: z.string(),\n profile: z.string().optional(),\n timeoutMs: z.number().optional(),\n})\n\nexport function resolvedR2Endpoint(config: R2Config): string {\n if (config.endpoint !== undefined && config.endpoint !== '') return config.endpoint\n if (config.accountId !== undefined && config.accountId !== '') {\n return `https://${config.accountId}.r2.cloudflarestorage.com`\n }\n throw new Error('R2Config requires accountId or endpoint')\n}\n\nexport function r2ToS3Config(config: R2Config): S3Config {\n return {\n bucket: config.bucket,\n region: config.region ?? 'auto',\n endpoint: resolvedR2Endpoint(config),\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey,\n ...(config.profile !== undefined ? { profile: config.profile } : {}),\n ...(config.timeoutMs !== undefined ? { timeoutMs: config.timeoutMs } : {}),\n }\n}\n\nexport function redactR2Config(config: R2Config): R2ConfigRedacted {\n return redactConfigWithSchema(R2ConfigSchema, {\n ...config,\n endpoint: resolvedR2Endpoint(config),\n region: config.region ?? 'auto',\n }) as unknown as R2ConfigRedacted\n}\n\nexport function normalizeR2Config(input: Record<string, unknown>): R2Config {\n return normalizeFields(input, {\n rename: {\n account_id: 'accountId',\n access_key_id: 'accessKeyId',\n secret_access_key: 'secretAccessKey',\n aws_profile: 'profile',\n endpoint_url: 'endpoint',\n timeout: 'timeoutMs',\n },\n transform: {\n timeout: (v: unknown) => (typeof v === 'number' ? v * 1000 : v),\n },\n drop: ['proxy'],\n }) as unknown as R2Config\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAyB/D,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,EAAE,OAAO;AAAA,EACjB,aAAa,UAAU;AAAA,EACvB,iBAAiB,UAAU;AAAA,EAC3B,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,UAAU,EAAE,OAAO;AAAA,EACnB,QAAQ,EAAE,OAAO;AAAA,EACjB,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAEM,SAAS,mBAAmB,QAA0B;AAC3D,MAAI,OAAO,aAAa,UAAa,OAAO,aAAa,GAAI,QAAO,OAAO;AAC3E,MAAI,OAAO,cAAc,UAAa,OAAO,cAAc,IAAI;AAC7D,WAAO,WAAW,OAAO,SAAS;AAAA,EACpC;AACA,QAAM,IAAI,MAAM,yCAAyC;AAC3D;AAEO,SAAS,aAAa,QAA4B;AACvD,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO,UAAU;AAAA,IACzB,UAAU,mBAAmB,MAAM;AAAA,IACnC,aAAa,OAAO;AAAA,IACpB,iBAAiB,OAAO;AAAA,IACxB,GAAI,OAAO,YAAY,SAAY,EAAE,SAAS,OAAO,QAAQ,IAAI,CAAC;AAAA,IAClE,GAAI,OAAO,cAAc,SAAY,EAAE,WAAW,OAAO,UAAU,IAAI,CAAC;AAAA,EAC1E;AACF;AAEO,SAAS,eAAe,QAAoC;AACjE,SAAO,uBAAuB,gBAAgB;AAAA,IAC5C,GAAG;AAAA,IACH,UAAU,mBAAmB,MAAM;AAAA,IACnC,QAAQ,OAAO,UAAU;AAAA,EAC3B,CAAC;AACH;AAEO,SAAS,kBAAkB,OAA0C;AAC1E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,mBAAmB;AAAA,MACnB,aAAa;AAAA,MACb,cAAc;AAAA,MACd,SAAS;AAAA,IACX;AAAA,IACA,WAAW;AAAA,MACT,SAAS,CAAC,MAAgB,OAAO,MAAM,WAAW,IAAI,MAAO;AAAA,IAC/D;AAAA,IACA,MAAM,CAAC,OAAO;AAAA,EAChB,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/github/github.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n fetchGitHubRepoInfo,\n fetchGitHubTree,\n type FileStat,\n GITHUB_COMMANDS,\n GITHUB_VFS_OPS,\n GitHubAccessor,\n HttpGitHubTransport,\n type IndexCacheStore,\n PathSpec,\n RAMIndexCacheStore,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n githubBuildTreeMap,\n githubPopulateIndex,\n githubRead,\n githubReaddir,\n githubResolveGlob,\n githubStat,\n} from '@struktoai/mirage-core'\nimport { redactGitHubConfig, type GitHubConfig, type GitHubConfigRedacted } from './config.ts'\n\nexport interface GitHubResourceState {\n type: string\n config: GitHubConfigRedacted\n defaultBranch: string\n truncated: boolean\n}\n\nexport class GitHubResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GITHUB\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly config: GitHubConfig\n readonly accessor: GitHubAccessor\n\n private constructor(config: GitHubConfig, accessor: GitHubAccessor, index: IndexCacheStore) {\n super()\n this.config = config\n this.accessor = accessor\n this._index = index\n }\n\n static async create(config: GitHubConfig): Promise<GitHubResource> {\n const transportOpts: { token: string; baseUrl?: string } = { token: config.token }\n if (config.baseUrl !== undefined) transportOpts.baseUrl = config.baseUrl\n const transport = new HttpGitHubTransport(transportOpts)\n const repoInfo = await fetchGitHubRepoInfo(transport, config.owner, config.repo)\n const ref = config.ref ?? repoInfo.default_branch\n const { tree, truncated } = await fetchGitHubTree(transport, config.owner, config.repo, ref)\n const treeMap = githubBuildTreeMap(tree)\n const accessor = new GitHubAccessor({\n transport,\n owner: config.owner,\n repo: config.repo,\n ref,\n defaultBranch: repoInfo.default_branch,\n truncated,\n tree: treeMap,\n })\n const index = new RAMIndexCacheStore({ ttl: 86_400 })\n await githubPopulateIndex(index, tree)\n return new GitHubResource(config, accessor, index)\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GITHUB_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GITHUB_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return githubRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return githubReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return githubStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.id ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return githubResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GitHubResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGitHubConfig(this.config),\n defaultBranch: this.accessor.defaultBranch,\n truncated: this.accessor.truncated,\n })\n }\n\n loadState(_state: GitHubResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUA,IAAM,iBAAN,MAAM,wBAAuB,aAAiC;AAAA,EAC1D,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EAED,YAAY,QAAsB,UAA0B,OAAwB;AAC1F,UAAM;AACN,SAAK,SAAS;AACd,SAAK,WAAW;AAChB,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,aAAa,OAAO,QAA+C;AACjE,UAAM,gBAAqD,EAAE,OAAO,OAAO,MAAM;AACjF,QAAI,OAAO,YAA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UAAM,YACJ,WAAW,KACP,MAAM;AAAA,MAAI,CAAC,MACT,EAAE,WAAW,KACT,IACA,IAAI,SAAS;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ;AAAA,MACF,CAAC;AAAA,IACP,IACA;AACN,WAAO,kBAAkB,KAAK,UAAU,WAAW,KAAK,KAAK;AAAA,EAC/D;AAAA,EAEA,WAAyC;AACvC,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,mBAAmB,KAAK,MAAM;AAAA,MACtC,eAAe,KAAK,SAAS;AAAA,MAC7B,WAAW,KAAK,SAAS;AAAA,IAC3B,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,QAA4C;AACpD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
package/dist/chunk-LW25LMIH.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/resource/gsheets/config.ts
|
|
2
|
-
import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
|
|
3
|
-
var GSheetsConfigSchema = z.object({
|
|
4
|
-
clientId: z.string(),
|
|
5
|
-
clientSecret: secretStr(),
|
|
6
|
-
refreshToken: secretStr()
|
|
7
|
-
});
|
|
8
|
-
function redactGSheetsConfig(config) {
|
|
9
|
-
return redactConfigWithSchema(GSheetsConfigSchema, config);
|
|
10
|
-
}
|
|
11
|
-
function normalizeGSheetsConfig(input) {
|
|
12
|
-
return normalizeFields(input, {
|
|
13
|
-
rename: {
|
|
14
|
-
client_id: "clientId",
|
|
15
|
-
client_secret: "clientSecret",
|
|
16
|
-
refresh_token: "refreshToken"
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
GSheetsConfigSchema,
|
|
23
|
-
redactGSheetsConfig,
|
|
24
|
-
normalizeGSheetsConfig
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=chunk-LW25LMIH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gsheets/config.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport { normalizeFields, redactConfigWithSchema, secretStr, z } from '@struktoai/mirage-core'\n\nexport interface GSheetsConfig {\n clientId: string\n clientSecret: string\n refreshToken: string\n refreshFn?: (refreshToken: string) => Promise<{ accessToken: string; expiresIn: number }>\n}\n\nexport interface GSheetsConfigRedacted {\n clientId: string\n clientSecret: '<REDACTED>'\n refreshToken: '<REDACTED>'\n}\n\nexport const GSheetsConfigSchema = z.object({\n clientId: z.string(),\n clientSecret: secretStr(),\n refreshToken: secretStr(),\n})\n\nexport function redactGSheetsConfig(config: GSheetsConfig): GSheetsConfigRedacted {\n return redactConfigWithSchema(GSheetsConfigSchema, config) as unknown as GSheetsConfigRedacted\n}\n\nexport function normalizeGSheetsConfig(input: Record<string, unknown>): GSheetsConfig {\n return normalizeFields(input, {\n rename: {\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n },\n }) as unknown as GSheetsConfig\n}\n"],"mappings":";AAcA,SAAS,iBAAiB,wBAAwB,WAAW,SAAS;AAe/D,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,UAAU,EAAE,OAAO;AAAA,EACnB,cAAc,UAAU;AAAA,EACxB,cAAc,UAAU;AAC1B,CAAC;AAEM,SAAS,oBAAoB,QAA8C;AAChF,SAAO,uBAAuB,qBAAqB,MAAM;AAC3D;AAEO,SAAS,uBAAuB,OAA+C;AACpF,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,IACjB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/slack/slack.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n type FileStat,\n NodeSlackTransport,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n resolveSlackGlob,\n SLACK_COMMANDS,\n SLACK_PROMPT,\n SLACK_VFS_OPS,\n SLACK_WRITE_PROMPT,\n SlackAccessor,\n slackRead,\n slackReaddir,\n slackStat,\n} from '@struktoai/mirage-core'\nimport { redactSlackConfig, type SlackConfig, type SlackConfigRedacted } from './config.ts'\n\nexport interface SlackResourceState {\n type: string\n config: SlackConfigRedacted\n}\n\nexport class SlackResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.SLACK\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 600\n readonly prompt: string = SLACK_PROMPT\n readonly writePrompt: string = SLACK_WRITE_PROMPT\n readonly config: SlackConfig\n readonly accessor: SlackAccessor\n\n constructor(config: SlackConfig) {\n super()\n this.config = config\n this.accessor = new SlackAccessor(new NodeSlackTransport(config.token, config.searchToken))\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return SLACK_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return SLACK_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return slackRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return slackReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return slackStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return resolveSlackGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<SlackResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactSlackConfig(this.config),\n })\n }\n\n loadState(_state: SlackResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,gBAAN,cAA4B,aAAiC;AAAA,EACzD,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAqB;AA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A,UAAU,QAA2C;AACnD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/gmail/gmail.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport {\n BaseResource,\n type FileStat,\n GMAIL_COMMANDS,\n GMAIL_PROMPT,\n GMAIL_WRITE_PROMPT,\n GMAIL_VFS_OPS,\n GmailAccessor,\n PathSpec,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n ResourceName,\n TokenManager,\n gmailRead,\n gmailReaddir,\n gmailResolveGlob,\n gmailStat,\n} from '@struktoai/mirage-core'\nimport { redactGmailConfig, type GmailConfig, type GmailConfigRedacted } from './config.ts'\n\nexport interface GmailResourceState {\n type: string\n config: GmailConfigRedacted\n}\n\nexport class GmailResource extends BaseResource implements Resource {\n readonly kind: string = ResourceName.GMAIL\n readonly cachesReads: boolean = true\n readonly indexTtl: number = 86_400\n readonly prompt: string = GMAIL_PROMPT\n readonly writePrompt: string = GMAIL_WRITE_PROMPT\n readonly config: GmailConfig\n readonly accessor: GmailAccessor\n\n constructor(config: GmailConfig) {\n super()\n this.config = config\n const tm = new TokenManager(config)\n this.accessor = new GmailAccessor({ tokenManager: tm })\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n close(): Promise<void> {\n return Promise.resolve()\n }\n\n commands(): readonly RegisteredCommand[] {\n return GMAIL_COMMANDS\n }\n\n ops(): readonly RegisteredOp[] {\n return GMAIL_VFS_OPS\n }\n\n readFile(p: PathSpec): Promise<Uint8Array> {\n return gmailRead(this.accessor, p, this.index)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return gmailReaddir(this.accessor, p, this.index)\n }\n\n stat(p: PathSpec): Promise<FileStat> {\n return gmailStat(this.accessor, p, this.index)\n }\n\n async fingerprint(p: PathSpec): Promise<string | null> {\n const lookup = await this.index.get(p.original)\n return lookup.entry?.remoteTime ?? null\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective =\n prefix !== ''\n ? paths.map((p) =>\n p.prefix !== ''\n ? p\n : new PathSpec({\n original: p.original,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n prefix,\n }),\n )\n : paths\n return gmailResolveGlob(this.accessor, effective, this.index)\n }\n\n getState(): Promise<GmailResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactGmailConfig(this.config),\n })\n }\n\n loadState(_state: GmailResourceState): Promise<void> {\n return Promise.resolve()\n }\n}\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,gBAAN,cAA4B,aAAiC;AAAA,EACzD,OAAe,aAAa;AAAA,EAC5B,cAAuB;AAAA,EACvB,WAAmB;AAAA,EACnB,SAAiB;AAAA,EACjB,cAAsB;AAAA,EACtB;AAAA,EACA;AAAA,EAET,YAAY,QAAqB;AAC/B,UAAM;AACN,SAAK,SAAS;AACd,UAAM,KAAK,IAAI,aAAa,MAAM;AAClC,SAAK,WAAW,IAAI,cAAc,EAAE,cAAc,GAAG,CAAC;AAAA,EACxD;AAAA,EAEA,OAAsB;AACpB,WAAO,QAAQ,QAAQ;AAAA,EACzB;AAAA,EAEA,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