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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (465) hide show
  1. package/README.md +2 -1
  2. package/dist/aliyun-S62BR3TB.js +11 -0
  3. package/dist/append.lua +17 -0
  4. package/dist/backblaze-4EKSW63F.js +11 -0
  5. package/dist/box-ZPLZAGMK.js +8 -0
  6. package/dist/cas.lua +15 -0
  7. package/dist/ceph-ALKLD3MO.js +11 -0
  8. package/dist/{chunk-QCZ2XUKH.js → chunk-2A4YGVBM.js} +16 -23
  9. package/dist/chunk-2A4YGVBM.js.map +1 -0
  10. package/dist/chunk-2HCYLVGY.js +28 -0
  11. package/dist/chunk-2HCYLVGY.js.map +1 -0
  12. package/dist/chunk-2VPZAH5Q.js +20 -0
  13. package/dist/chunk-2VPZAH5Q.js.map +1 -0
  14. package/dist/{chunk-UT2OPSN4.js → chunk-3JZQ6VSZ.js} +5 -5
  15. package/dist/chunk-3JZQ6VSZ.js.map +1 -0
  16. package/dist/chunk-4IF4TGAI.js +11 -0
  17. package/dist/chunk-4IF4TGAI.js.map +1 -0
  18. package/dist/{chunk-47AVIIOT.js → chunk-5H6KNEPP.js} +4 -5
  19. package/dist/{chunk-47AVIIOT.js.map → chunk-5H6KNEPP.js.map} +1 -1
  20. package/dist/{chunk-I5THIMPP.js → chunk-5K2MWDCE.js} +6 -7
  21. package/dist/{chunk-I5THIMPP.js.map → chunk-5K2MWDCE.js.map} +1 -1
  22. package/dist/{chunk-3WIO7NBR.js → chunk-6SVXWRKX.js} +4 -5
  23. package/dist/{chunk-3WIO7NBR.js.map → chunk-6SVXWRKX.js.map} +1 -1
  24. package/dist/{chunk-RQK5UPMP.js → chunk-6VOIUGAD.js} +25 -12
  25. package/dist/chunk-6VOIUGAD.js.map +1 -0
  26. package/dist/{chunk-NOHWIBRX.js → chunk-7JYHFXXC.js} +15 -20
  27. package/dist/chunk-7JYHFXXC.js.map +1 -0
  28. package/dist/chunk-7VQQFWV6.js +20 -0
  29. package/dist/chunk-7VQQFWV6.js.map +1 -0
  30. package/dist/chunk-7ZP6TPHX.js +87 -0
  31. package/dist/chunk-7ZP6TPHX.js.map +1 -0
  32. package/dist/{chunk-SWCDFEUK.js → chunk-ADEXNSYU.js} +20 -22
  33. package/dist/chunk-ADEXNSYU.js.map +1 -0
  34. package/dist/chunk-AQSYAXL4.js +16 -0
  35. package/dist/chunk-AQSYAXL4.js.map +1 -0
  36. package/dist/{chunk-RO5IQEDQ.js → chunk-ATLXMNKD.js} +8 -4
  37. package/dist/chunk-ATLXMNKD.js.map +1 -0
  38. package/dist/{chunk-MPCCRRE6.js → chunk-BYCUGFRF.js} +16 -16
  39. package/dist/chunk-BYCUGFRF.js.map +1 -0
  40. package/dist/{chunk-HJJMP6IX.js → chunk-BZTVYOES.js} +3 -3
  41. package/dist/{chunk-B2ZOKNN4.js → chunk-CRC4YWXB.js} +27 -9
  42. package/dist/chunk-CRC4YWXB.js.map +1 -0
  43. package/dist/chunk-CTGXJHO5.js +39 -0
  44. package/dist/chunk-CTGXJHO5.js.map +1 -0
  45. package/dist/{chunk-Q2IAILVC.js → chunk-DCDBIXVZ.js} +14 -5
  46. package/dist/chunk-DCDBIXVZ.js.map +1 -0
  47. package/dist/chunk-DDAFNROK.js +750 -0
  48. package/dist/chunk-DDAFNROK.js.map +1 -0
  49. package/dist/chunk-DQIEWEAW.js +85 -0
  50. package/dist/chunk-DQIEWEAW.js.map +1 -0
  51. package/dist/{chunk-QGRDPSAH.js → chunk-EBI4IHDC.js} +23 -12
  52. package/dist/chunk-EBI4IHDC.js.map +1 -0
  53. package/dist/{chunk-JAGJTM3Q.js → chunk-EIUTZ6N7.js} +19 -34
  54. package/dist/chunk-EIUTZ6N7.js.map +1 -0
  55. package/dist/{chunk-TA3WMOMU.js → chunk-EJZG5VUF.js} +38 -32
  56. package/dist/chunk-EJZG5VUF.js.map +1 -0
  57. package/dist/{chunk-X5HF2OFP.js → chunk-ENW5BVYN.js} +3 -3
  58. package/dist/{chunk-HGCRXJGP.js → chunk-ETIAW4YD.js} +3 -3
  59. package/dist/chunk-EUPXAYPB.js +20 -0
  60. package/dist/chunk-EUPXAYPB.js.map +1 -0
  61. package/dist/{chunk-YAHRT6MB.js → chunk-FA6YNU75.js} +4 -5
  62. package/dist/{chunk-YAHRT6MB.js.map → chunk-FA6YNU75.js.map} +1 -1
  63. package/dist/{chunk-TWGVQLG2.js → chunk-FFH6R5VQ.js} +7 -3
  64. package/dist/chunk-FFH6R5VQ.js.map +1 -0
  65. package/dist/{chunk-JCC4CU2I.js → chunk-GE6H2COM.js} +15 -23
  66. package/dist/chunk-GE6H2COM.js.map +1 -0
  67. package/dist/{chunk-DM4GSE26.js → chunk-GMMQ3ZK4.js} +3 -3
  68. package/dist/{chunk-ZEGAMJO2.js → chunk-GSGE3M5P.js} +15 -23
  69. package/dist/chunk-GSGE3M5P.js.map +1 -0
  70. package/dist/{chunk-GCFYZSVR.js → chunk-H64SB6VO.js} +32 -13
  71. package/dist/chunk-H64SB6VO.js.map +1 -0
  72. package/dist/{chunk-N5FSLVKO.js → chunk-HCRYAFBI.js} +3 -3
  73. package/dist/{chunk-IDYHQQOH.js → chunk-HOPUP6LA.js} +358 -471
  74. package/dist/chunk-HOPUP6LA.js.map +1 -0
  75. package/dist/chunk-HS24BL6W.js +160 -0
  76. package/dist/chunk-HS24BL6W.js.map +1 -0
  77. package/dist/chunk-HVYVG5KQ.js +16 -0
  78. package/dist/chunk-HVYVG5KQ.js.map +1 -0
  79. package/dist/{chunk-FQ33BYFR.js → chunk-I7CPLZNW.js} +4 -5
  80. package/dist/{chunk-FQ33BYFR.js.map → chunk-I7CPLZNW.js.map} +1 -1
  81. package/dist/{chunk-VGLHY6BK.js → chunk-IFUCGI4I.js} +7 -3
  82. package/dist/chunk-IFUCGI4I.js.map +1 -0
  83. package/dist/{chunk-RNQN2FOU.js → chunk-IFYXSSKR.js} +24 -13
  84. package/dist/chunk-IFYXSSKR.js.map +1 -0
  85. package/dist/chunk-IXA4DQE4.js +20 -0
  86. package/dist/chunk-IXA4DQE4.js.map +1 -0
  87. package/dist/chunk-IZMKMD3O.js +11 -0
  88. package/dist/chunk-IZMKMD3O.js.map +1 -0
  89. package/dist/{chunk-7CW3BMPH.js → chunk-JJERW2BI.js} +4 -5
  90. package/dist/{chunk-7CW3BMPH.js.map → chunk-JJERW2BI.js.map} +1 -1
  91. package/dist/{chunk-EM4J5EQS.js → chunk-JQR4HVUX.js} +13 -16
  92. package/dist/chunk-JQR4HVUX.js.map +1 -0
  93. package/dist/{chunk-VWKUT4CW.js → chunk-JXOMDLFS.js} +21 -26
  94. package/dist/chunk-JXOMDLFS.js.map +1 -0
  95. package/dist/chunk-KIX6N7NT.js +1001 -0
  96. package/dist/chunk-KIX6N7NT.js.map +1 -0
  97. package/dist/{chunk-OZAEWZZ3.js → chunk-L42UTDFK.js} +12 -3
  98. package/dist/chunk-L42UTDFK.js.map +1 -0
  99. package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
  100. package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
  101. package/dist/chunk-M2UF2JHJ.js +11 -0
  102. package/dist/chunk-M2UF2JHJ.js.map +1 -0
  103. package/dist/{chunk-UGK4TAVK.js → chunk-MONC734W.js} +7 -3
  104. package/dist/chunk-MONC734W.js.map +1 -0
  105. package/dist/{chunk-IK2L4EN3.js → chunk-N72RLCMU.js} +4 -5
  106. package/dist/{chunk-IK2L4EN3.js.map → chunk-N72RLCMU.js.map} +1 -1
  107. package/dist/{chunk-H3I2KZIY.js → chunk-ND4IWJ4V.js} +7 -3
  108. package/dist/chunk-ND4IWJ4V.js.map +1 -0
  109. package/dist/chunk-NZ3EKGW4.js +1312 -0
  110. package/dist/chunk-NZ3EKGW4.js.map +1 -0
  111. package/dist/{chunk-XGJ2QERC.js → chunk-OAE57MNL.js} +27 -11
  112. package/dist/chunk-OAE57MNL.js.map +1 -0
  113. package/dist/{chunk-EZQ5HBAC.js → chunk-OHKGIQB4.js} +12 -16
  114. package/dist/chunk-OHKGIQB4.js.map +1 -0
  115. package/dist/{chunk-E2ISWXLB.js → chunk-OQKNDS66.js} +1 -1
  116. package/dist/{chunk-E2ISWXLB.js.map → chunk-OQKNDS66.js.map} +1 -1
  117. package/dist/{chunk-UINQOUZR.js → chunk-OXEQSPND.js} +3 -3
  118. package/dist/{chunk-A7IVFIOP.js → chunk-PKNE5J2B.js} +15 -23
  119. package/dist/chunk-PKNE5J2B.js.map +1 -0
  120. package/dist/chunk-PSXXEGYQ.js +16 -0
  121. package/dist/chunk-PSXXEGYQ.js.map +1 -0
  122. package/dist/{chunk-EGB7V74Z.js → chunk-QAOVABCR.js} +7 -4
  123. package/dist/chunk-QAOVABCR.js.map +1 -0
  124. package/dist/{chunk-X3G37FXT.js → chunk-QQ7FP4GD.js} +4 -5
  125. package/dist/{chunk-X3G37FXT.js.map → chunk-QQ7FP4GD.js.map} +1 -1
  126. package/dist/{chunk-WAR4Q2NM.js → chunk-QYLVMC6B.js} +13 -15
  127. package/dist/chunk-QYLVMC6B.js.map +1 -0
  128. package/dist/{chunk-KPULTUOK.js → chunk-RX3XR65X.js} +4 -5
  129. package/dist/{chunk-KPULTUOK.js.map → chunk-RX3XR65X.js.map} +1 -1
  130. package/dist/chunk-RYQJJB4C.js +30 -0
  131. package/dist/chunk-RYQJJB4C.js.map +1 -0
  132. package/dist/{chunk-QQBJC2FQ.js → chunk-TUF7TCN7.js} +4 -5
  133. package/dist/{chunk-QQBJC2FQ.js.map → chunk-TUF7TCN7.js.map} +1 -1
  134. package/dist/{chunk-AUHSTJJ3.js → chunk-TUX36JY5.js} +4 -5
  135. package/dist/{chunk-AUHSTJJ3.js.map → chunk-TUX36JY5.js.map} +1 -1
  136. package/dist/chunk-TWRQCQWU.js +1153 -0
  137. package/dist/chunk-TWRQCQWU.js.map +1 -0
  138. package/dist/chunk-U6DFQRG3.js +20 -0
  139. package/dist/chunk-U6DFQRG3.js.map +1 -0
  140. package/dist/chunk-VI5YTKNY.js +20 -0
  141. package/dist/chunk-VI5YTKNY.js.map +1 -0
  142. package/dist/chunk-WG5YS6TC.js +872 -0
  143. package/dist/chunk-WG5YS6TC.js.map +1 -0
  144. package/dist/{chunk-ZGSER5TG.js → chunk-WMJJ4WGF.js} +4 -5
  145. package/dist/{chunk-ZGSER5TG.js.map → chunk-WMJJ4WGF.js.map} +1 -1
  146. package/dist/{chunk-LV2G7VHL.js → chunk-WY4FNH42.js} +21 -18
  147. package/dist/chunk-WY4FNH42.js.map +1 -0
  148. package/dist/{chunk-LAJJPLEV.js → chunk-XIG5BWWH.js} +25 -12
  149. package/dist/chunk-XIG5BWWH.js.map +1 -0
  150. package/dist/chunk-XJBC3OYX.js +11 -0
  151. package/dist/chunk-XJBC3OYX.js.map +1 -0
  152. package/dist/{chunk-G2WCEUQL.js → chunk-XPRDXWK7.js} +21 -20
  153. package/dist/chunk-XPRDXWK7.js.map +1 -0
  154. package/dist/chunk-YKRQSZS7.js +96 -0
  155. package/dist/chunk-YKRQSZS7.js.map +1 -0
  156. package/dist/{chunk-M5FVUIYP.js → chunk-YMBL3VJB.js} +21 -19
  157. package/dist/chunk-YMBL3VJB.js.map +1 -0
  158. package/dist/chunk-YUJBXFYK.js +1205 -0
  159. package/dist/chunk-YUJBXFYK.js.map +1 -0
  160. package/dist/{chunk-JALIYI6M.js → chunk-YZ4ZJNOL.js} +28 -11
  161. package/dist/chunk-YZ4ZJNOL.js.map +1 -0
  162. package/dist/chunk-ZTHVEXIV.js +11 -0
  163. package/dist/chunk-ZTHVEXIV.js.map +1 -0
  164. package/dist/{chunk-GS5AUKUO.js → chunk-ZVSYUCYS.js} +11 -7
  165. package/dist/chunk-ZVSYUCYS.js.map +1 -0
  166. package/dist/{config-QAA646XB.js → config-2YBCHU2W.js} +2 -4
  167. package/dist/{config-IVY5EQQ2.js → config-3YRGRW72.js} +3 -4
  168. package/dist/config-4GSOMUMF.js +9 -0
  169. package/dist/config-5YBUWFUP.js +9 -0
  170. package/dist/{config-34LHOGLM.js → config-5ZRKJTKG.js} +3 -4
  171. package/dist/config-A25LTL5W.js +11 -0
  172. package/dist/config-CLU7JABG.js +9 -0
  173. package/dist/config-D2RF7L3N.js +9 -0
  174. package/dist/{config-LHFFXVYI.js → config-E55TKM6K.js} +2 -4
  175. package/dist/config-ELDOFRJW.js +9 -0
  176. package/dist/{config-GE4W4ZJC.js → config-FPC3RBFD.js} +2 -4
  177. package/dist/config-FPM3LAW7.js +9 -0
  178. package/dist/{config-HKRMKD76.js → config-G3F54CS4.js} +3 -4
  179. package/dist/config-G43HRUI3.js +9 -0
  180. package/dist/{config-WDAZFXYD.js → config-GG3WO5PB.js} +3 -4
  181. package/dist/config-JUYBWAZE.js +9 -0
  182. package/dist/{config-CVZ2AGCO.js → config-LJ5T6TVA.js} +2 -6
  183. package/dist/config-MDSAE4O3.js +11 -0
  184. package/dist/{config-EIHSP5DZ.js → config-NRIOKK5T.js} +2 -4
  185. package/dist/config-OYK2BSJK.js +9 -0
  186. package/dist/config-PB3KA2CE.js +9 -0
  187. package/dist/{config-ZFJYQZCH.js → config-QY4IL3PH.js} +3 -4
  188. package/dist/config-R4LAOEDS.js +9 -0
  189. package/dist/{config-QNMKWJ4M.js → config-RIAAD6RW.js} +3 -4
  190. package/dist/config-SYNEQAUB.js +9 -0
  191. package/dist/{config-Q45Y46YT.js → config-TJKGYA2B.js} +3 -4
  192. package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
  193. package/dist/{config-3IVQJBNW.js → config-UURRGA7U.js} +2 -2
  194. package/dist/{config-VM526IKB.js → config-VPLHQXVE.js} +2 -4
  195. package/dist/config-WRACCRPN.js +9 -0
  196. package/dist/{config-GHRUKEQ6.js → config-WVHKXEVE.js} +3 -4
  197. package/dist/{config-EO23EY62.js → config-XU7R36IE.js} +3 -4
  198. package/dist/config-Y2KOUYSS.js +9 -0
  199. package/dist/databricks_volume-CNCPTZHS.js +7 -0
  200. package/dist/digitalocean-DJZOUB6Q.js +11 -0
  201. package/dist/discord-ETB2CADR.js +7 -0
  202. package/dist/disk-WEHSTK3F.js +7 -0
  203. package/dist/dropbox-XN6PGLNE.js +8 -0
  204. package/dist/email-OV7XCP3T.js +8 -0
  205. package/dist/gcal-P56MRCGU.js +8 -0
  206. package/dist/gcs-HFBIAE2C.js +10 -0
  207. package/dist/gdocs-LQ3UXP3J.js +8 -0
  208. package/dist/gdrive-N6UBYLON.js +8 -0
  209. package/dist/github-BPZREGPI.js +8 -0
  210. package/dist/github_ci-7A4LUIZ7.js +8 -0
  211. package/dist/gmail-YED2MF6H.js +8 -0
  212. package/dist/gridfs-CPLQ4G62.js +9 -0
  213. package/dist/gsheets-4BNIJPQ6.js +8 -0
  214. package/dist/gslides-GDBYLO5A.js +8 -0
  215. package/dist/hf_buckets-FTJITQ3P.js +10 -0
  216. package/dist/hf_datasets-6GXVKQD7.js +10 -0
  217. package/dist/hf_models-PJPGZAC5.js +10 -0
  218. package/dist/hf_spaces-LFNFOLBF.js +10 -0
  219. package/dist/index.d.ts +1311 -569
  220. package/dist/index.js +3359 -964
  221. package/dist/index.js.map +1 -1
  222. package/dist/jaeger-GCA6MJ6E.js +8 -0
  223. package/dist/lancedb-TJ5YSJY5.js +7 -0
  224. package/dist/langfuse-RUMTUMXS.js +8 -0
  225. package/dist/linear-BCE4KEAC.js +7 -0
  226. package/dist/minio-5SO6KBTK.js +11 -0
  227. package/dist/mongodb-L5CMN2EE.js +7 -0
  228. package/dist/nextcloud-4O2LZVW2.js +9 -0
  229. package/dist/notion-RVKEAQ2M.js +7 -0
  230. package/dist/oci-OQXOIC62.js +10 -0
  231. package/dist/postgres-AV45GNRS.js +7 -0
  232. package/dist/qingstor-W277YA4K.js +11 -0
  233. package/dist/r2-FUA4IORE.js +10 -0
  234. package/dist/redis-LPS357NF.js +8 -0
  235. package/dist/s3-FPNWWIVM.js +8 -0
  236. package/dist/scaleway-BP3732U7.js +11 -0
  237. package/dist/seaweedfs-MC6HIEP4.js +11 -0
  238. package/dist/slack-JFGW7VLN.js +7 -0
  239. package/dist/ssh-UYPG42LM.js +8 -0
  240. package/dist/ssh-UYPG42LM.js.map +1 -0
  241. package/dist/supabase-A3KUFMDC.js +10 -0
  242. package/dist/supabase-A3KUFMDC.js.map +1 -0
  243. package/dist/tencent-5464UQ2X.js +11 -0
  244. package/dist/tencent-5464UQ2X.js.map +1 -0
  245. package/dist/trello-O2KB3FUO.js +8 -0
  246. package/dist/trello-O2KB3FUO.js.map +1 -0
  247. package/dist/wasabi-2IKBIWNO.js +10 -0
  248. package/dist/wasabi-2IKBIWNO.js.map +1 -0
  249. package/package.json +17 -3
  250. package/dist/aliyun-JMJ3PFYY.js +0 -10
  251. package/dist/backblaze-TDFD23QO.js +0 -10
  252. package/dist/box-GQ2U2R6R.js +0 -8
  253. package/dist/ceph-S2VOYO6G.js +0 -10
  254. package/dist/chunk-2CC5VW7K.js +0 -52
  255. package/dist/chunk-2CC5VW7K.js.map +0 -1
  256. package/dist/chunk-A7IVFIOP.js.map +0 -1
  257. package/dist/chunk-B2ZOKNN4.js.map +0 -1
  258. package/dist/chunk-DNBAMB5J.js +0 -18
  259. package/dist/chunk-DNBAMB5J.js.map +0 -1
  260. package/dist/chunk-DP2PP5V2.js +0 -26
  261. package/dist/chunk-DP2PP5V2.js.map +0 -1
  262. package/dist/chunk-DYXEITK3.js +0 -52
  263. package/dist/chunk-DYXEITK3.js.map +0 -1
  264. package/dist/chunk-EGB7V74Z.js.map +0 -1
  265. package/dist/chunk-EM4J5EQS.js.map +0 -1
  266. package/dist/chunk-EZQ5HBAC.js.map +0 -1
  267. package/dist/chunk-G2WCEUQL.js.map +0 -1
  268. package/dist/chunk-GCFYZSVR.js.map +0 -1
  269. package/dist/chunk-GS5AUKUO.js.map +0 -1
  270. package/dist/chunk-H3BST2LI.js +0 -26
  271. package/dist/chunk-H3BST2LI.js.map +0 -1
  272. package/dist/chunk-H3I2KZIY.js.map +0 -1
  273. package/dist/chunk-IDYHQQOH.js.map +0 -1
  274. package/dist/chunk-JAGJTM3Q.js.map +0 -1
  275. package/dist/chunk-JALIYI6M.js.map +0 -1
  276. package/dist/chunk-JCC4CU2I.js.map +0 -1
  277. package/dist/chunk-JZT4QGIP.js +0 -24
  278. package/dist/chunk-JZT4QGIP.js.map +0 -1
  279. package/dist/chunk-LAJJPLEV.js.map +0 -1
  280. package/dist/chunk-LV2G7VHL.js.map +0 -1
  281. package/dist/chunk-LW25LMIH.js +0 -26
  282. package/dist/chunk-LW25LMIH.js.map +0 -1
  283. package/dist/chunk-M5FVUIYP.js.map +0 -1
  284. package/dist/chunk-MPCCRRE6.js.map +0 -1
  285. package/dist/chunk-NJMGCT63.js +0 -54
  286. package/dist/chunk-NJMGCT63.js.map +0 -1
  287. package/dist/chunk-NOHWIBRX.js.map +0 -1
  288. package/dist/chunk-OHROA3FQ.js +0 -54
  289. package/dist/chunk-OHROA3FQ.js.map +0 -1
  290. package/dist/chunk-OPYQ5KIO.js +0 -52
  291. package/dist/chunk-OPYQ5KIO.js.map +0 -1
  292. package/dist/chunk-OZAEWZZ3.js.map +0 -1
  293. package/dist/chunk-Q2IAILVC.js.map +0 -1
  294. package/dist/chunk-QCZ2XUKH.js.map +0 -1
  295. package/dist/chunk-QGRDPSAH.js.map +0 -1
  296. package/dist/chunk-RNQN2FOU.js.map +0 -1
  297. package/dist/chunk-RO5IQEDQ.js.map +0 -1
  298. package/dist/chunk-RQK5UPMP.js.map +0 -1
  299. package/dist/chunk-S5OVP467.js +0 -1795
  300. package/dist/chunk-S5OVP467.js.map +0 -1
  301. package/dist/chunk-SFUCUARB.js +0 -21
  302. package/dist/chunk-SFUCUARB.js.map +0 -1
  303. package/dist/chunk-SWCDFEUK.js.map +0 -1
  304. package/dist/chunk-TA3WMOMU.js.map +0 -1
  305. package/dist/chunk-TURD42QO.js +0 -1782
  306. package/dist/chunk-TURD42QO.js.map +0 -1
  307. package/dist/chunk-TWGVQLG2.js.map +0 -1
  308. package/dist/chunk-U6QSXTUS.js +0 -7
  309. package/dist/chunk-U6QSXTUS.js.map +0 -1
  310. package/dist/chunk-UGK4TAVK.js.map +0 -1
  311. package/dist/chunk-UT2OPSN4.js.map +0 -1
  312. package/dist/chunk-VGLHY6BK.js.map +0 -1
  313. package/dist/chunk-VWKUT4CW.js.map +0 -1
  314. package/dist/chunk-W7FLHT65.js +0 -26
  315. package/dist/chunk-W7FLHT65.js.map +0 -1
  316. package/dist/chunk-WAR4Q2NM.js.map +0 -1
  317. package/dist/chunk-WHFUWWI6.js +0 -2097
  318. package/dist/chunk-WHFUWWI6.js.map +0 -1
  319. package/dist/chunk-XGJ2QERC.js.map +0 -1
  320. package/dist/chunk-XHCBHYN4.js +0 -54
  321. package/dist/chunk-XHCBHYN4.js.map +0 -1
  322. package/dist/chunk-XLQI4IT2.js +0 -54
  323. package/dist/chunk-XLQI4IT2.js.map +0 -1
  324. package/dist/chunk-XWVDS66D.js +0 -963
  325. package/dist/chunk-XWVDS66D.js.map +0 -1
  326. package/dist/chunk-YGZMVNN5.js +0 -54
  327. package/dist/chunk-YGZMVNN5.js.map +0 -1
  328. package/dist/chunk-YUK3X3B4.js +0 -27
  329. package/dist/chunk-YUK3X3B4.js.map +0 -1
  330. package/dist/chunk-ZEGAMJO2.js.map +0 -1
  331. package/dist/chunk-ZNWVJ6UW.js +0 -54
  332. package/dist/chunk-ZNWVJ6UW.js.map +0 -1
  333. package/dist/config-3BBWD5AB.js +0 -11
  334. package/dist/config-4UDVSUQJ.js +0 -11
  335. package/dist/config-CMDBAPDH.js +0 -11
  336. package/dist/config-D3RLSPNF.js +0 -11
  337. package/dist/config-DG65OEG3.js +0 -11
  338. package/dist/config-GCQK6NJY.js +0 -11
  339. package/dist/config-GVH27UPE.js +0 -11
  340. package/dist/config-HXVYIXP5.js +0 -11
  341. package/dist/config-IDZMEW73.js +0 -11
  342. package/dist/config-IJJXGLBQ.js +0 -11
  343. package/dist/config-KJOLGVB2.js +0 -11
  344. package/dist/config-KMVCVBYN.js +0 -15
  345. package/dist/config-KYTRXAB2.js +0 -15
  346. package/dist/config-OT2TQQCN.js +0 -11
  347. package/dist/config-QWCY3LBQ.js +0 -11
  348. package/dist/config-ZV6G2ZEC.js +0 -11
  349. package/dist/databricks_volume-7XOUYSTY.js +0 -7
  350. package/dist/digitalocean-3CQ4CPPZ.js +0 -10
  351. package/dist/discord-BG7OSRJG.js +0 -8
  352. package/dist/disk-XVLBCVKE.js +0 -8
  353. package/dist/dropbox-74GYLV3R.js +0 -8
  354. package/dist/email-5IZ7OBQ4.js +0 -8
  355. package/dist/gcs-EMEYU2XT.js +0 -10
  356. package/dist/gdocs-R67TDPON.js +0 -8
  357. package/dist/gdrive-PRN2ALRK.js +0 -8
  358. package/dist/github-DV7E6OFV.js +0 -8
  359. package/dist/github_ci-Q554V5PA.js +0 -8
  360. package/dist/gmail-OLN2LT4O.js +0 -8
  361. package/dist/gsheets-H4RYMQJ5.js +0 -8
  362. package/dist/gslides-YLCHKJOM.js +0 -8
  363. package/dist/hf_buckets-DTKXKKFF.js +0 -10
  364. package/dist/hf_datasets-55C4APKR.js +0 -10
  365. package/dist/hf_models-RO5JR36V.js +0 -10
  366. package/dist/hf_spaces-ZVZ3EDRX.js +0 -10
  367. package/dist/langfuse-ACASJZ7O.js +0 -8
  368. package/dist/linear-IC37LZV7.js +0 -8
  369. package/dist/minio-HZ576XFQ.js +0 -10
  370. package/dist/mongodb-JVR62OIO.js +0 -7
  371. package/dist/notion-HKRPQMJS.js +0 -8
  372. package/dist/oci-ZLVECXTW.js +0 -10
  373. package/dist/postgres-P36Z2YN4.js +0 -7
  374. package/dist/qingstor-YLP6K3L4.js +0 -10
  375. package/dist/r2-RPK25ANI.js +0 -10
  376. package/dist/redis-V5ULXULL.js +0 -8
  377. package/dist/s3-4OIOCAAT.js +0 -8
  378. package/dist/scaleway-CCWCLUHB.js +0 -10
  379. package/dist/seaweedfs-QSWKF2FN.js +0 -10
  380. package/dist/slack-YPS7PII3.js +0 -8
  381. package/dist/ssh-YFP3SMTJ.js +0 -9
  382. package/dist/supabase-6CFTOKGZ.js +0 -10
  383. package/dist/tencent-IWZZOSQ4.js +0 -10
  384. package/dist/trello-XYKWZD6P.js +0 -8
  385. package/dist/wasabi-6Z4DC5S5.js +0 -10
  386. /package/dist/{aliyun-JMJ3PFYY.js.map → aliyun-S62BR3TB.js.map} +0 -0
  387. /package/dist/{backblaze-TDFD23QO.js.map → backblaze-4EKSW63F.js.map} +0 -0
  388. /package/dist/{box-GQ2U2R6R.js.map → box-ZPLZAGMK.js.map} +0 -0
  389. /package/dist/{ceph-S2VOYO6G.js.map → ceph-ALKLD3MO.js.map} +0 -0
  390. /package/dist/{chunk-HJJMP6IX.js.map → chunk-BZTVYOES.js.map} +0 -0
  391. /package/dist/{chunk-X5HF2OFP.js.map → chunk-ENW5BVYN.js.map} +0 -0
  392. /package/dist/{chunk-HGCRXJGP.js.map → chunk-ETIAW4YD.js.map} +0 -0
  393. /package/dist/{chunk-DM4GSE26.js.map → chunk-GMMQ3ZK4.js.map} +0 -0
  394. /package/dist/{chunk-N5FSLVKO.js.map → chunk-HCRYAFBI.js.map} +0 -0
  395. /package/dist/{chunk-UINQOUZR.js.map → chunk-OXEQSPND.js.map} +0 -0
  396. /package/dist/{config-34LHOGLM.js.map → config-2YBCHU2W.js.map} +0 -0
  397. /package/dist/{config-3BBWD5AB.js.map → config-3YRGRW72.js.map} +0 -0
  398. /package/dist/{config-3IVQJBNW.js.map → config-4GSOMUMF.js.map} +0 -0
  399. /package/dist/{config-4UDVSUQJ.js.map → config-5YBUWFUP.js.map} +0 -0
  400. /package/dist/{config-CMDBAPDH.js.map → config-5ZRKJTKG.js.map} +0 -0
  401. /package/dist/{config-CVZ2AGCO.js.map → config-A25LTL5W.js.map} +0 -0
  402. /package/dist/{config-D3RLSPNF.js.map → config-CLU7JABG.js.map} +0 -0
  403. /package/dist/{config-DG65OEG3.js.map → config-D2RF7L3N.js.map} +0 -0
  404. /package/dist/{config-EIHSP5DZ.js.map → config-E55TKM6K.js.map} +0 -0
  405. /package/dist/{config-EO23EY62.js.map → config-ELDOFRJW.js.map} +0 -0
  406. /package/dist/{config-GCQK6NJY.js.map → config-FPC3RBFD.js.map} +0 -0
  407. /package/dist/{config-GE4W4ZJC.js.map → config-FPM3LAW7.js.map} +0 -0
  408. /package/dist/{config-GHRUKEQ6.js.map → config-G3F54CS4.js.map} +0 -0
  409. /package/dist/{config-GVH27UPE.js.map → config-G43HRUI3.js.map} +0 -0
  410. /package/dist/{config-HKRMKD76.js.map → config-GG3WO5PB.js.map} +0 -0
  411. /package/dist/{config-HXVYIXP5.js.map → config-JUYBWAZE.js.map} +0 -0
  412. /package/dist/{config-IDZMEW73.js.map → config-LJ5T6TVA.js.map} +0 -0
  413. /package/dist/{config-IJJXGLBQ.js.map → config-MDSAE4O3.js.map} +0 -0
  414. /package/dist/{config-IVY5EQQ2.js.map → config-NRIOKK5T.js.map} +0 -0
  415. /package/dist/{config-KJOLGVB2.js.map → config-OYK2BSJK.js.map} +0 -0
  416. /package/dist/{config-KMVCVBYN.js.map → config-PB3KA2CE.js.map} +0 -0
  417. /package/dist/{config-KYTRXAB2.js.map → config-QY4IL3PH.js.map} +0 -0
  418. /package/dist/{config-LHFFXVYI.js.map → config-R4LAOEDS.js.map} +0 -0
  419. /package/dist/{config-NV5WXP64.js.map → config-RIAAD6RW.js.map} +0 -0
  420. /package/dist/{config-OT2TQQCN.js.map → config-SYNEQAUB.js.map} +0 -0
  421. /package/dist/{config-Q45Y46YT.js.map → config-TJKGYA2B.js.map} +0 -0
  422. /package/dist/{config-QAA646XB.js.map → config-UU27ALAA.js.map} +0 -0
  423. /package/dist/{config-QNMKWJ4M.js.map → config-UURRGA7U.js.map} +0 -0
  424. /package/dist/{config-QWCY3LBQ.js.map → config-VPLHQXVE.js.map} +0 -0
  425. /package/dist/{config-VM526IKB.js.map → config-WRACCRPN.js.map} +0 -0
  426. /package/dist/{config-WDAZFXYD.js.map → config-WVHKXEVE.js.map} +0 -0
  427. /package/dist/{config-ZFJYQZCH.js.map → config-XU7R36IE.js.map} +0 -0
  428. /package/dist/{config-ZV6G2ZEC.js.map → config-Y2KOUYSS.js.map} +0 -0
  429. /package/dist/{databricks_volume-7XOUYSTY.js.map → databricks_volume-CNCPTZHS.js.map} +0 -0
  430. /package/dist/{digitalocean-3CQ4CPPZ.js.map → digitalocean-DJZOUB6Q.js.map} +0 -0
  431. /package/dist/{discord-BG7OSRJG.js.map → discord-ETB2CADR.js.map} +0 -0
  432. /package/dist/{disk-XVLBCVKE.js.map → disk-WEHSTK3F.js.map} +0 -0
  433. /package/dist/{dropbox-74GYLV3R.js.map → dropbox-XN6PGLNE.js.map} +0 -0
  434. /package/dist/{email-5IZ7OBQ4.js.map → email-OV7XCP3T.js.map} +0 -0
  435. /package/dist/{gcs-EMEYU2XT.js.map → gcal-P56MRCGU.js.map} +0 -0
  436. /package/dist/{gdocs-R67TDPON.js.map → gcs-HFBIAE2C.js.map} +0 -0
  437. /package/dist/{gdrive-PRN2ALRK.js.map → gdocs-LQ3UXP3J.js.map} +0 -0
  438. /package/dist/{github-DV7E6OFV.js.map → gdrive-N6UBYLON.js.map} +0 -0
  439. /package/dist/{github_ci-Q554V5PA.js.map → github-BPZREGPI.js.map} +0 -0
  440. /package/dist/{gmail-OLN2LT4O.js.map → github_ci-7A4LUIZ7.js.map} +0 -0
  441. /package/dist/{gsheets-H4RYMQJ5.js.map → gmail-YED2MF6H.js.map} +0 -0
  442. /package/dist/{gslides-YLCHKJOM.js.map → gridfs-CPLQ4G62.js.map} +0 -0
  443. /package/dist/{hf_buckets-DTKXKKFF.js.map → gsheets-4BNIJPQ6.js.map} +0 -0
  444. /package/dist/{hf_datasets-55C4APKR.js.map → gslides-GDBYLO5A.js.map} +0 -0
  445. /package/dist/{hf_models-RO5JR36V.js.map → hf_buckets-FTJITQ3P.js.map} +0 -0
  446. /package/dist/{hf_spaces-ZVZ3EDRX.js.map → hf_datasets-6GXVKQD7.js.map} +0 -0
  447. /package/dist/{langfuse-ACASJZ7O.js.map → hf_models-PJPGZAC5.js.map} +0 -0
  448. /package/dist/{linear-IC37LZV7.js.map → hf_spaces-LFNFOLBF.js.map} +0 -0
  449. /package/dist/{minio-HZ576XFQ.js.map → jaeger-GCA6MJ6E.js.map} +0 -0
  450. /package/dist/{mongodb-JVR62OIO.js.map → lancedb-TJ5YSJY5.js.map} +0 -0
  451. /package/dist/{notion-HKRPQMJS.js.map → langfuse-RUMTUMXS.js.map} +0 -0
  452. /package/dist/{oci-ZLVECXTW.js.map → linear-BCE4KEAC.js.map} +0 -0
  453. /package/dist/{postgres-P36Z2YN4.js.map → minio-5SO6KBTK.js.map} +0 -0
  454. /package/dist/{qingstor-YLP6K3L4.js.map → mongodb-L5CMN2EE.js.map} +0 -0
  455. /package/dist/{r2-RPK25ANI.js.map → nextcloud-4O2LZVW2.js.map} +0 -0
  456. /package/dist/{redis-V5ULXULL.js.map → notion-RVKEAQ2M.js.map} +0 -0
  457. /package/dist/{s3-4OIOCAAT.js.map → oci-OQXOIC62.js.map} +0 -0
  458. /package/dist/{scaleway-CCWCLUHB.js.map → postgres-AV45GNRS.js.map} +0 -0
  459. /package/dist/{seaweedfs-QSWKF2FN.js.map → qingstor-W277YA4K.js.map} +0 -0
  460. /package/dist/{slack-YPS7PII3.js.map → r2-FUA4IORE.js.map} +0 -0
  461. /package/dist/{ssh-YFP3SMTJ.js.map → redis-LPS357NF.js.map} +0 -0
  462. /package/dist/{supabase-6CFTOKGZ.js.map → s3-FPNWWIVM.js.map} +0 -0
  463. /package/dist/{tencent-IWZZOSQ4.js.map → scaleway-BP3732U7.js.map} +0 -0
  464. /package/dist/{trello-XYKWZD6P.js.map → seaweedfs-MC6HIEP4.js.map} +0 -0
  465. /package/dist/{wasabi-6Z4DC5S5.js.map → slack-JFGW7VLN.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/ssh/ssh.ts","../src/accessor/ssh.ts","../src/commands/builtin/ssh/index.ts","../src/core/ssh/append.ts","../src/core/ssh/utils.ts","../src/core/ssh/constants.ts","../src/core/ssh/read.ts","../src/core/ssh/stream.ts","../src/core/ssh/write.ts","../src/core/ssh/copy.ts","../src/core/ssh/create.ts","../src/core/ssh/du/entries.ts","../src/core/ssh/du/walk.ts","../src/core/ssh/du/size.ts","../src/core/ssh/exists.ts","../src/core/ssh/find.ts","../src/core/ssh/mkdir.ts","../src/core/ssh/readdir.ts","../src/core/ssh/rename.ts","../src/core/ssh/rm.ts","../src/core/ssh/rmdir.ts","../src/core/ssh/set_attrs.ts","../src/core/ssh/entry.ts","../src/core/ssh/stat.ts","../src/core/ssh/truncate.ts","../src/core/ssh/unlink.ts","../src/commands/builtin/ssh/io.ts","../src/ops/ssh/index.ts","../src/resource/ssh/prompt.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 PathSpec,\n ResourceName,\n makeResolveGlob,\n mountKey,\n mountPrefixOf,\n type FileStat,\n type FindOptions,\n type RegisteredCommand,\n type RegisteredOp,\n type Resource,\n} from '@struktoai/mirage-core'\nimport { SSHAccessor } from '../../accessor/ssh.ts'\nimport { SSH_COMMANDS } from '../../commands/builtin/ssh/index.ts'\nimport { appendBytes as appendCore } from '../../core/ssh/append.ts'\nimport { copy as copyCore } from '../../core/ssh/copy.ts'\nimport { create as createCore } from '../../core/ssh/create.ts'\nimport { size as duSizeCore, entries as duEntriesCore } from '../../core/ssh/du/index.ts'\nimport { exists as existsCore } from '../../core/ssh/exists.ts'\nimport { find as findCore, type FindOptions as SshFindOptions } from '../../core/ssh/find.ts'\nimport { mkdir as mkdirCore } from '../../core/ssh/mkdir.ts'\nimport { read as readCoreFn } from '../../core/ssh/read.ts'\nimport { SCOPE_ERROR } from '../../core/ssh/constants.ts'\nimport { readdir as readdirCore } from '../../core/ssh/readdir.ts'\nimport { rename as renameCore } from '../../core/ssh/rename.ts'\nimport { rmR as rmRCore } from '../../core/ssh/rm.ts'\nimport { rmdir as rmdirCore } from '../../core/ssh/rmdir.ts'\nimport { stat as statCore } from '../../core/ssh/stat.ts'\nimport { rangeRead as rangeReadCore, stream as streamCore } from '../../core/ssh/stream.ts'\nimport { truncate as truncateCore } from '../../core/ssh/truncate.ts'\nimport { unlink as unlinkCore } from '../../core/ssh/unlink.ts'\nimport { writeBytes as writeCore } from '../../core/ssh/write.ts'\nimport { SSH_OPS } from '../../ops/ssh/index.ts'\nimport { type SSHConfig, type SSHConfigRedacted, redactSshConfig } from './config.ts'\nimport { SSH_PROMPT } from './prompt.ts'\n\nconst globCore = makeResolveGlob(readdirCore, SCOPE_ERROR)\n\nexport interface SSHResourceState {\n type: string\n config: SSHConfigRedacted\n}\n\nexport class SSHResource extends BaseResource implements Resource {\n readonly kind = ResourceName.SSH\n readonly cachesReads: boolean = true\n // SFTP stat/readdir report the remote inode's exact byte size for every\n // file; reads are the same raw bytes.\n readonly sizesAlwaysKnown: boolean = true\n override readonly indexTtl: number = 60\n readonly prompt = SSH_PROMPT\n readonly config: SSHConfig\n readonly accessor: SSHAccessor\n readonly opsMap: Record<string, unknown> = {\n read_bytes: readCoreFn,\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 range_read: rangeReadCore,\n rm_recursive: rmRCore,\n du_size: duSizeCore,\n du_entries: duEntriesCore,\n create: createCore,\n truncate: truncateCore,\n exists: existsCore,\n find_flat: findCore,\n append: appendCore,\n }\n\n constructor(config: SSHConfig) {\n super()\n this.config = config\n this.accessor = new SSHAccessor(config)\n }\n\n open(): Promise<void> {\n return Promise.resolve()\n }\n\n override async close(): Promise<void> {\n await this.accessor.close()\n await super.close()\n }\n\n ops(): readonly RegisteredOp[] {\n return SSH_OPS\n }\n\n commands(): readonly RegisteredCommand[] {\n return SSH_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 readCoreFn(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 appendCore(this.accessor, p, data)\n }\n\n readdir(p: PathSpec): Promise<string[]> {\n return readdirCore(this.accessor, p)\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 duSizeCore(this.accessor, p)\n }\n\n find(p: PathSpec, options: FindOptions = {}): Promise<string[]> {\n return findCore(this.accessor, p, options as SshFindOptions)\n }\n\n glob(paths: readonly PathSpec[], prefix = ''): Promise<PathSpec[]> {\n const effective = prefix\n ? paths.map((p) =>\n mountPrefixOf(p.virtual, p.resourcePath)\n ? p\n : new PathSpec({\n virtual: p.virtual,\n directory: p.directory,\n ...(p.pattern !== null ? { pattern: p.pattern } : {}),\n resolved: p.resolved,\n resourcePath: mountKey(p.virtual, prefix),\n }),\n )\n : paths\n return globCore(this.accessor, effective)\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n async getState(): Promise<SSHResourceState> {\n return {\n type: this.kind,\n config: redactSshConfig(this.config),\n }\n }\n\n loadState(_state: SSHResourceState): Promise<void> {\n return Promise.resolve()\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 * as Ssh2Mod from 'ssh2'\nimport type { Client, SFTPWrapper } from 'ssh2'\nimport { Accessor } from '@struktoai/mirage-core'\nimport { homedir } from 'node:os'\nimport { readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { SSHConfig } from '../resource/ssh/config.ts'\n\nfunction expandHome(p: string): string {\n if (p === '~') return homedir()\n if (p.startsWith('~/')) return resolve(homedir(), p.slice(2))\n return p\n}\n\nexport class SSHAccessor extends Accessor {\n private client: Client | null = null\n private sftpClient: SFTPWrapper | null = null\n private connectPromise: Promise<SFTPWrapper> | null = null\n\n constructor(public readonly config: SSHConfig) {\n super()\n }\n\n async sftp(): Promise<SFTPWrapper> {\n if (this.sftpClient !== null) return this.sftpClient\n if (this.connectPromise !== null) return this.connectPromise\n this.connectPromise = this.connect()\n try {\n return await this.connectPromise\n } finally {\n this.connectPromise = null\n }\n }\n\n private async connect(): Promise<SFTPWrapper> {\n let ssh2Mod: typeof Ssh2Mod\n try {\n ssh2Mod = await import('ssh2')\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err)\n throw new Error(`ssh2 is required for the SSH resource — install it as a peer dep: ${msg}`)\n }\n const { Client: ClientCtor } = ssh2Mod\n const c = new ClientCtor()\n const opts: Record<string, unknown> = {\n host: this.config.hostname ?? this.config.host,\n port: this.config.port ?? 22,\n readyTimeout: (this.config.timeout ?? 30) * 1000,\n }\n if (this.config.username !== undefined) opts.username = this.config.username\n if (this.config.password !== undefined) opts.password = this.config.password\n if (this.config.identityFile !== undefined) {\n opts.privateKey = readFileSync(expandHome(this.config.identityFile))\n if (this.config.passphrase !== undefined) opts.passphrase = this.config.passphrase\n }\n return new Promise<SFTPWrapper>((resolveFn, rejectFn) => {\n c.on('ready', () => {\n c.sftp((err: Error | undefined, sftp: SFTPWrapper) => {\n if (err !== undefined) {\n rejectFn(err)\n return\n }\n this.client = c\n this.sftpClient = sftp\n resolveFn(sftp)\n })\n })\n c.on('error', rejectFn)\n c.connect(opts as Parameters<Client['connect']>[0])\n })\n }\n\n close(): Promise<void> {\n if (this.client !== null) {\n this.client.end()\n this.client = null\n this.sftpClient = null\n }\n return Promise.resolve()\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 RegisteredCommand, ResourceName, makeGenericCommands } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../../accessor/ssh.ts'\nimport { SSH_IO } from './io.ts'\n\nexport const SSH_COMMANDS: readonly RegisteredCommand[] = [\n ...makeGenericCommands<SSHAccessor>(ResourceName.SSH, SSH_IO),\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 } from '@struktoai/mirage-core'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { joinRoot, stripPrefix } from './utils.ts'\n\nexport async function appendBytes(\n accessor: SSHAccessor,\n p: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n await new Promise<void>((resolveFn, rejectFn) => {\n sftp.appendFile(remote, Buffer.from(data), (err) => {\n if (err) rejectFn(err)\n else resolveFn()\n })\n })\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 } from '@struktoai/mirage-core'\nimport { lstripSlash, mountPrefixOf, rstripSlash } from '@struktoai/mirage-core'\n\nconst S_IFMT = 0o170000\nconst S_IFDIR = 0o040000\nconst S_IFREG = 0o100000\n\nexport function stripPrefix(p: PathSpec): string {\n if (\n mountPrefixOf(p.virtual, p.resourcePath) &&\n p.virtual.startsWith(mountPrefixOf(p.virtual, p.resourcePath))\n ) {\n return p.virtual.slice(mountPrefixOf(p.virtual, p.resourcePath).length) || '/'\n }\n return p.virtual\n}\n\nexport function joinRoot(root: string, rel: string): string {\n const r = rstripSlash(root)\n const stripped = lstripSlash(rel)\n if (stripped === '') return r === '' ? '/' : r\n if (r === '') return `/${stripped}`\n return `${r}/${stripped}`\n}\n\nexport function isNoSuchFile(err: unknown): boolean {\n if (err === null || err === undefined) return false\n if (typeof err !== 'object') return false\n const code = (err as { code?: unknown }).code\n return code === 2\n}\n\nexport function isDirectoryAttrs(attrs: { mode?: number }): boolean {\n if (attrs.mode === undefined) return false\n return (attrs.mode & S_IFMT) === S_IFDIR\n}\n\nexport function isFileAttrs(attrs: { mode?: number }): boolean {\n if (attrs.mode === undefined) return false\n return (attrs.mode & S_IFMT) === S_IFREG\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 = 500\nexport const SCOPE_ERROR = 5000\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 { enoent } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { readChunks } from './stream.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\n\nexport async function read(accessor: SSHAccessor, p: PathSpec): Promise<Uint8Array> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n // ssh2's readFile stats the file and issues a single READ for the whole\n // size; servers that honor large reads (asyncssh) reply with a packet over\n // ssh2's 256 KiB cap, a fatal protocol error that strands the pending\n // callback. Stream in bounded chunks instead.\n const rs = sftp.createReadStream(remote)\n const chunks: Uint8Array[] = []\n let total = 0\n try {\n for await (const u8 of readChunks(rs)) {\n chunks.push(u8)\n total += u8.byteLength\n }\n } catch (err) {\n if (isNoSuchFile(err)) throw enoent(p)\n throw err\n }\n const out = new Uint8Array(total)\n let offset = 0\n for (const c of chunks) {\n out.set(c, offset)\n offset += c.byteLength\n }\n return out\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 { once } from 'node:events'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { ReadStream } from 'ssh2'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\n\nasync function waitForClose(rs: ReadStream): Promise<Error | null> {\n try {\n await once(rs, 'close')\n return null\n } catch (error) {\n return error instanceof Error ? error : new Error(String(error))\n }\n}\n\nexport async function* readChunks(rs: ReadStream): AsyncIterable<Uint8Array> {\n const closed = waitForClose(rs)\n let closeError: Error | null = null\n try {\n for await (const chunk of rs) {\n const buf = chunk as Buffer\n yield new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength)\n }\n } finally {\n if (!rs.destroyed) rs.destroy()\n closeError = await closed\n }\n if (closeError !== null) throw closeError\n}\n\nexport async function* stream(accessor: SSHAccessor, p: PathSpec): AsyncIterable<Uint8Array> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n const rs = sftp.createReadStream(remote)\n try {\n yield* readChunks(rs)\n } catch (err) {\n if (isNoSuchFile(err)) throw enoent(p)\n throw err\n }\n}\n\nexport async function rangeRead(\n accessor: SSHAccessor,\n p: PathSpec,\n start: number,\n end: number,\n): Promise<Uint8Array> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n const rs = sftp.createReadStream(remote, { start, end: end - 1 })\n const chunks: Uint8Array[] = []\n let total = 0\n try {\n for await (const u8 of readChunks(rs)) {\n chunks.push(u8)\n total += u8.byteLength\n }\n } catch (err) {\n if (isNoSuchFile(err)) throw enoent(p)\n throw err\n }\n const out = new Uint8Array(total)\n let offset = 0\n for (const c of chunks) {\n out.set(c, offset)\n offset += c.byteLength\n }\n return out\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 } from '@struktoai/mirage-core'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { joinRoot, stripPrefix } from './utils.ts'\n\nexport async function writeBytes(\n accessor: SSHAccessor,\n p: PathSpec,\n data: Uint8Array,\n): Promise<void> {\n const start = performance.now()\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n await new Promise<void>((resolveFn, rejectFn) => {\n sftp.writeFile(remote, Buffer.from(data), (err) => {\n if (err) rejectFn(err)\n else resolveFn()\n })\n })\n record('write', virtual, ResourceName.SSH, 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 { PathSpec } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { read } from './read.ts'\nimport { writeBytes } from './write.ts'\n\nexport async function copy(accessor: SSHAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const data = await read(accessor, src)\n await writeBytes(accessor, dst, 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 } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { writeBytes } from './write.ts'\n\nexport function create(accessor: SSHAccessor, path: PathSpec): Promise<void> {\n return writeBytes(accessor, path, new Uint8Array())\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 { SSHAccessor } from '../../../accessor/ssh.ts'\nimport { stripPrefix } from '../utils.ts'\nimport { compareCodePoints, norm } from '@struktoai/mirage-core'\nimport { walkAll } from './walk.ts'\n\nexport async function entries(\n accessor: SSHAccessor,\n p: PathSpec,\n): Promise<[entries: [string, number][], total: number]> {\n const virtual = norm(stripPrefix(p))\n const entries: [string, number][] = []\n const total = await walkAll(accessor, virtual, entries)\n entries.sort((a, b) => compareCodePoints(a[0], b[0]))\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 { FileEntryWithStats } from 'ssh2'\nimport type { SSHAccessor } from '../../../accessor/ssh.ts'\nimport { isDirectoryAttrs, isFileAttrs, joinRoot } from '../utils.ts'\n\nasync function readRemoteDir(\n accessor: SSHAccessor,\n remote: string,\n): Promise<FileEntryWithStats[] | null> {\n const sftp = await accessor.sftp()\n return new Promise<FileEntryWithStats[] | null>((resolveFn, rejectFn) => {\n sftp.readdir(remote, (err, entries) => {\n if (err !== undefined) {\n const code = (err as { code?: unknown }).code\n if (code === 2) {\n resolveFn(null)\n return\n }\n rejectFn(err)\n return\n }\n resolveFn(entries)\n })\n })\n}\n\nasync function statRemote(\n accessor: SSHAccessor,\n remote: string,\n): Promise<{ mode: number; size: number } | null> {\n const sftp = await accessor.sftp()\n return new Promise<{ mode: number; size: number } | null>((resolveFn, rejectFn) => {\n sftp.lstat(remote, (err, stats) => {\n if (err !== undefined) {\n const code = (err as { code?: unknown }).code\n if (code === 2) {\n resolveFn(null)\n return\n }\n rejectFn(err)\n return\n }\n resolveFn({ mode: stats.mode, size: stats.size })\n })\n })\n}\n\nexport async function walkSizes(accessor: SSHAccessor, virtual: string): Promise<number> {\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n const st = await statRemote(accessor, remote)\n if (st === null) return 0\n if (isFileAttrs(st)) return st.size\n if (!isDirectoryAttrs(st)) return 0\n const entries = await readRemoteDir(accessor, remote)\n if (entries === null) return 0\n let total = 0\n for (const entry of entries) {\n if (entry.filename === '.' || entry.filename === '..') continue\n const child = virtual === '/' ? `/${entry.filename}` : `${virtual}/${entry.filename}`\n if (isDirectoryAttrs(entry.attrs)) {\n total += await walkSizes(accessor, child)\n } else {\n total += entry.attrs.size\n }\n }\n return total\n}\n\nexport async function walkAll(\n accessor: SSHAccessor,\n virtual: string,\n entries: [string, number][],\n): Promise<number> {\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n const st = await statRemote(accessor, remote)\n if (st === null) return 0\n if (isFileAttrs(st)) {\n entries.push([virtual, st.size])\n return st.size\n }\n if (!isDirectoryAttrs(st)) return 0\n const list = await readRemoteDir(accessor, remote)\n if (list === null) return 0\n let total = 0\n for (const entry of list) {\n if (entry.filename === '.' || entry.filename === '..') continue\n const child = virtual === '/' ? `/${entry.filename}` : `${virtual}/${entry.filename}`\n if (isDirectoryAttrs(entry.attrs)) {\n total += await walkAll(accessor, child, entries)\n } else {\n const size = entry.attrs.size\n entries.push([child, size])\n total += size\n }\n }\n return 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 { SSHAccessor } from '../../../accessor/ssh.ts'\nimport { stripPrefix } from '../utils.ts'\nimport { walkSizes } from './walk.ts'\n\nexport async function size(accessor: SSHAccessor, p: PathSpec): Promise<number> {\n const virtual = stripPrefix(p)\n return walkSizes(accessor, virtual)\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 { SSHAccessor } from '../../accessor/ssh.ts'\nimport { joinRoot, stripPrefix } from './utils.ts'\n\nexport async function exists(accessor: SSHAccessor, p: PathSpec): Promise<boolean> {\n const sftp = await accessor.sftp()\n const remote = joinRoot(accessor.config.root ?? '/', stripPrefix(p))\n return new Promise<boolean>((resolveFn) => {\n sftp.exists(remote, (yes) => {\n resolveFn(yes)\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 { FileEntryWithStats } from 'ssh2'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isDirectoryAttrs, joinRoot, stripPrefix } from './utils.ts'\nimport { compareCodePoints, norm } from '@struktoai/mirage-core'\nimport {\n buildTree,\n emitStartPath,\n keep,\n type PredNode,\n startBasename,\n} from '@struktoai/mirage-core'\n\nexport interface FindOptions {\n name?: string | null\n type?: string | 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 mtimeMin?: number | null\n mtimeMax?: number | null\n}\n\ninterface WalkCtx {\n accessor: SSHAccessor\n options: FindOptions\n results: string[]\n baseDepth: number\n tree: PredNode\n}\n\nfunction isFileType(t: FindOptions['type']): boolean {\n return t === 'f' || t === 'file'\n}\n\nfunction isDirType(t: FindOptions['type']): boolean {\n return t === 'd' || t === 'directory'\n}\n\nfunction matches(\n entry: FileEntryWithStats,\n entryPath: string,\n isDir: boolean,\n depth: number,\n opts: FindOptions,\n tree: PredNode,\n): boolean {\n if (opts.maxDepth !== null && opts.maxDepth !== undefined && depth > opts.maxDepth) return false\n const basename = entryPath.slice(entryPath.lastIndexOf('/') + 1)\n const isEmpty = isDir ? false : entry.attrs.size === 0\n if (\n !keep(\n { key: entryPath, name: basename, kind: isDir ? 'd' : 'f', depth, isEmpty },\n tree,\n opts.minDepth,\n )\n ) {\n return false\n }\n if (opts.minSize != null || opts.maxSize != null) {\n // Directories count as size 0 for -size (deliberate GNU divergence).\n const size = isDir ? 0 : entry.attrs.size\n if (opts.minSize != null && size < opts.minSize) return false\n if (opts.maxSize != null && size > opts.maxSize) return false\n }\n if (\n (opts.mtimeMin !== null && opts.mtimeMin !== undefined) ||\n (opts.mtimeMax !== null && opts.mtimeMax !== undefined)\n ) {\n const mtime = entry.attrs.mtime\n if (opts.mtimeMin !== null && opts.mtimeMin !== undefined && mtime < opts.mtimeMin) return false\n if (opts.mtimeMax !== null && opts.mtimeMax !== undefined && mtime > opts.mtimeMax) return false\n }\n return true\n}\n\nasync function readRemoteDir(\n accessor: SSHAccessor,\n remote: string,\n): Promise<FileEntryWithStats[] | null> {\n const sftp = await accessor.sftp()\n return new Promise<FileEntryWithStats[] | null>((resolveFn, rejectFn) => {\n sftp.readdir(remote, (err, entries) => {\n if (err !== undefined) {\n const code = (err as { code?: unknown }).code\n if (code === 2) {\n resolveFn(null)\n return\n }\n rejectFn(err)\n return\n }\n resolveFn(entries)\n })\n })\n}\n\nasync function statRemote(\n accessor: SSHAccessor,\n remote: string,\n): Promise<{ isDir: boolean; size: number } | null> {\n const sftp = await accessor.sftp()\n return new Promise<{ isDir: boolean; size: number } | null>((resolveFn, rejectFn) => {\n sftp.stat(remote, (err, stats) => {\n if (err !== undefined) {\n const code = (err as { code?: unknown }).code\n if (code === 2) {\n resolveFn(null)\n return\n }\n rejectFn(err)\n return\n }\n resolveFn({ isDir: stats.isDirectory(), size: stats.size })\n })\n })\n}\n\nasync function walk(ctx: WalkCtx, virtual: string, depth: number): Promise<void> {\n const opts = ctx.options\n if (opts.maxDepth !== null && opts.maxDepth !== undefined && depth > opts.maxDepth) return\n const remote = joinRoot(ctx.accessor.config.root ?? '/', virtual)\n const entries = await readRemoteDir(ctx.accessor, remote)\n if (entries === null) return\n for (const entry of entries) {\n if (entry.filename === '.' || entry.filename === '..') continue\n const childPath = virtual === '/' ? `/${entry.filename}` : `${virtual}/${entry.filename}`\n const isDir = isDirectoryAttrs(entry.attrs)\n if (matches(entry, childPath, isDir, depth + 1, opts, ctx.tree)) {\n ctx.results.push(childPath)\n }\n if (isDir) {\n await walk(ctx, childPath, depth + 1)\n }\n }\n}\n\nexport async function find(\n accessor: SSHAccessor,\n p: PathSpec,\n options: FindOptions = {},\n): Promise<string[]> {\n const virtual = norm(stripPrefix(p))\n const startName = startBasename(p.virtual)\n const results: string[] = []\n const baseDepth = (virtual.match(/\\//g) ?? []).length\n const typeKind: 'f' | 'd' | null = isFileType(options.type)\n ? 'f'\n : isDirType(options.type)\n ? 'd'\n : null\n const tree =\n options.tree ??\n buildTree({\n name: options.name,\n iname: options.iname,\n pathPattern: options.pathPattern,\n type: typeKind,\n nameExclude: options.nameExclude,\n orNames: options.orNames,\n })\n if (options.maxDepth == null || options.maxDepth >= 0) {\n const st = await statRemote(accessor, joinRoot(accessor.config.root ?? '/', virtual))\n emitStartPath(results, virtual, startName, {\n kind: st?.isDir ? 'd' : 'f',\n isEmpty: st === null ? null : st.isDir ? false : st.size === 0,\n exists: st !== null,\n tree,\n maxDepth: options.maxDepth,\n minDepth: options.minDepth,\n size: st === null || st.isDir ? null : st.size,\n minSize: options.minSize,\n maxSize: options.maxSize,\n })\n }\n await walk({ accessor, options, results, baseDepth, tree }, virtual, 0)\n results.sort(compareCodePoints)\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 { invalidateAfterWrite, invalidateAncestors } from '@struktoai/mirage-core'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { SFTPWrapper, Stats } from 'ssh2'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\nimport { enoent, stripSlash } from '@struktoai/mirage-core'\n\nasync function statRemote(sftp: SFTPWrapper, remote: string): Promise<Stats | null> {\n return new Promise<Stats | null>((resolveFn) => {\n sftp.lstat(remote, (err, stats) => {\n if (err) resolveFn(null)\n else resolveFn(stats)\n })\n })\n}\n\nasync function mkdirOne(sftp: SFTPWrapper, remote: string, ignoreExisting: boolean): Promise<void> {\n return new Promise<void>((resolveFn, rejectFn) => {\n sftp.mkdir(remote, (err) => {\n if (!err) {\n resolveFn()\n return\n }\n if (ignoreExisting) {\n // ignore: dir already exists\n resolveFn()\n return\n }\n rejectFn(err)\n })\n })\n}\n\nexport async function mkdir(accessor: SSHAccessor, p: PathSpec, recursive: boolean): Promise<void> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const root = accessor.config.root ?? '/'\n const remote = joinRoot(root, virtual)\n if (!recursive) {\n try {\n await mkdirOne(sftp, remote, false)\n } catch (err) {\n if (isNoSuchFile(err)) throw enoent(p)\n throw err\n }\n return\n }\n const cleaned = stripSlash(virtual)\n if (cleaned.length === 0) return\n const parts = cleaned.split('/')\n let cur = ''\n for (const part of parts) {\n cur = cur === '' ? `/${part}` : `${cur}/${part}`\n const stepRemote = joinRoot(root, cur)\n const existing = await statRemote(sftp, stepRemote)\n if (existing?.isDirectory()) continue\n await mkdirOne(sftp, stepRemote, true)\n }\n await invalidateAfterWrite(p)\n await invalidateAncestors(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 { FileEntryWithStats } from 'ssh2'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\nimport { compareCodePoints, enoent, mountPrefixOf, stripSlash } from '@struktoai/mirage-core'\n\nexport async function readdir(accessor: SSHAccessor, p: PathSpec): Promise<string[]> {\n const sftp = await accessor.sftp()\n const virtual =\n p.pattern !== null\n ? p.directory.slice(mountPrefixOf(p.virtual, p.resourcePath).length) || '/'\n : stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n const list = await new Promise<FileEntryWithStats[]>((resolveFn, rejectFn) => {\n sftp.readdir(remote, (err, entries) => {\n if (err !== undefined) {\n if (isNoSuchFile(err)) rejectFn(enoent(p))\n else rejectFn(err)\n return\n }\n resolveFn(entries)\n })\n })\n const base = `/${stripSlash(virtual)}`\n const dirPrefix = base === '/' ? '/' : `${base}/`\n const mountPrefix = mountPrefixOf(p.virtual, p.resourcePath)\n const names: string[] = []\n for (const entry of list) {\n if (entry.filename === '.' || entry.filename === '..') continue\n names.push(`${mountPrefix}${dirPrefix}${entry.filename}`)\n }\n names.sort(compareCodePoints)\n return names\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 { invalidateAfterUnlink, invalidateAfterWrite } from '@struktoai/mirage-core'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\n\nexport async function rename(accessor: SSHAccessor, src: PathSpec, dst: PathSpec): Promise<void> {\n const sftp = await accessor.sftp()\n const root = accessor.config.root ?? '/'\n const srcVirtual = stripPrefix(src)\n const dstVirtual = stripPrefix(dst)\n const remoteSrc = joinRoot(root, srcVirtual)\n const remoteDst = joinRoot(root, dstVirtual)\n // POSIX rename semantics (replace an existing destination); plain SFTP\n // rename refuses to overwrite, so prefer posix-rename@openssh.com. ssh2\n // throws synchronously when the server lacks the extension — only then\n // fall back to the plain rename.\n await new Promise<void>((resolveFn, rejectFn) => {\n const done = (err: unknown): void => {\n if (!err) resolveFn()\n else if (isNoSuchFile(err)) rejectFn(enoent(src))\n else rejectFn(err as Error)\n }\n try {\n sftp.ext_openssh_rename(remoteSrc, remoteDst, done)\n } catch {\n sftp.rename(remoteSrc, remoteDst, done)\n }\n })\n await invalidateAfterWrite(dst)\n await invalidateAfterUnlink(src)\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 { FileEntryWithStats, SFTPWrapper, Stats } from 'ssh2'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport { enoent, invalidateAfterUnlink } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isDirectoryAttrs, isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\n\nasync function statRemote(sftp: SFTPWrapper, remote: string): Promise<Stats> {\n return new Promise<Stats>((resolveFn, rejectFn) => {\n sftp.lstat(remote, (err, stats) => {\n if (err !== undefined) rejectFn(err)\n else resolveFn(stats)\n })\n })\n}\n\nasync function readdirRemote(sftp: SFTPWrapper, remote: string): Promise<FileEntryWithStats[]> {\n return new Promise<FileEntryWithStats[]>((resolveFn, rejectFn) => {\n sftp.readdir(remote, (err, list) => {\n if (err !== undefined) rejectFn(err)\n else resolveFn(list)\n })\n })\n}\n\nasync function unlinkRemote(sftp: SFTPWrapper, remote: string): Promise<void> {\n return new Promise<void>((resolveFn, rejectFn) => {\n sftp.unlink(remote, (err) => {\n if (err) rejectFn(err)\n else resolveFn()\n })\n })\n}\n\nasync function rmdirRemote(sftp: SFTPWrapper, remote: string): Promise<void> {\n return new Promise<void>((resolveFn, rejectFn) => {\n sftp.rmdir(remote, (err) => {\n if (err) rejectFn(err)\n else resolveFn()\n })\n })\n}\n\nasync function rmRecurse(sftp: SFTPWrapper, remote: string): Promise<void> {\n const stats = await statRemote(sftp, remote)\n if (isDirectoryAttrs(stats)) {\n const entries = await readdirRemote(sftp, remote)\n for (const entry of entries) {\n if (entry.filename === '.' || entry.filename === '..') continue\n const child = remote === '/' ? `/${entry.filename}` : `${remote}/${entry.filename}`\n await rmRecurse(sftp, child)\n }\n await rmdirRemote(sftp, remote)\n return\n }\n await unlinkRemote(sftp, remote)\n}\n\nexport async function rmR(accessor: SSHAccessor, p: PathSpec): Promise<void> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n try {\n await rmRecurse(sftp, remote)\n } catch (err) {\n if (isNoSuchFile(err)) throw enoent(p)\n throw err\n }\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 type { PathSpec } from '@struktoai/mirage-core'\nimport { enoent, invalidateAfterUnlink } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\n\nexport async function rmdir(accessor: SSHAccessor, p: PathSpec): Promise<void> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n await new Promise<void>((resolveFn, rejectFn) => {\n sftp.rmdir(remote, (err) => {\n if (!err) {\n resolveFn()\n return\n }\n if (isNoSuchFile(err)) rejectFn(enoent(p))\n else rejectFn(err)\n })\n })\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 type { PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { SFTPWrapper, Stats } from 'ssh2'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\n\nexport interface SetAttrsFields {\n mode?: number\n uid?: number | string\n gid?: number | string\n atime?: string\n mtime?: string\n}\n\nfunction sftpStat(sftp: SFTPWrapper, remote: string, p: PathSpec): Promise<Stats> {\n return new Promise((resolveFn, rejectFn) => {\n sftp.stat(remote, (err, stats) => {\n if (err !== undefined) {\n if (isNoSuchFile(err)) rejectFn(enoent(p))\n else rejectFn(err)\n return\n }\n resolveFn(stats)\n })\n })\n}\n\nfunction sftpChmod(sftp: SFTPWrapper, remote: string, mode: number): Promise<void> {\n return new Promise((resolveFn, rejectFn) => {\n sftp.chmod(remote, mode, (err) => {\n if (err !== undefined && err !== null) rejectFn(err)\n else resolveFn()\n })\n })\n}\n\nfunction sftpUtimes(\n sftp: SFTPWrapper,\n remote: string,\n atime: number,\n mtime: number,\n): Promise<void> {\n return new Promise((resolveFn, rejectFn) => {\n sftp.utimes(remote, atime, mtime, (err) => {\n if (err !== undefined && err !== null) rejectFn(err)\n else resolveFn()\n })\n })\n}\n\n// Write metadata fields (the write side of stat), mirroring disk. Applies\n// natively what the remote inode can take and returns the residual: fields\n// the caller must overlay elsewhere. Times always apply via SFTP utimes, so\n// touch results live on the real file and out-of-band readers see them.\n// `mode` is applied with owner access kept (`chmod 000` must not lock\n// mirage's own SFTP session out of reads; mount mode does real access\n// control), so clamped bits come back as residual. Ownership never applies\n// (chown over SFTP needs privileges the login user does not have) and is\n// always residual.\nexport async function setAttrs(\n accessor: SSHAccessor,\n path: PathSpec,\n fields: SetAttrsFields,\n): Promise<Record<string, number | string>> {\n const sftp = await accessor.sftp()\n const remote = joinRoot(accessor.config.root ?? '/', stripPrefix(path))\n const st = await sftpStat(sftp, remote, path)\n const residual: Record<string, number | string> = {}\n if (fields.mode !== undefined) {\n const keep = st.isDirectory() ? 0o700 : 0o600\n await sftpChmod(sftp, remote, fields.mode | keep)\n if ((fields.mode | keep) !== fields.mode) residual.mode = fields.mode\n }\n if (fields.uid !== undefined) residual.uid = fields.uid\n if (fields.gid !== undefined) residual.gid = fields.gid\n if (fields.atime !== undefined || fields.mtime !== undefined) {\n const newAtime =\n fields.atime !== undefined ? Math.floor(Date.parse(fields.atime) / 1000) : st.atime\n const newMtime =\n fields.mtime !== undefined ? Math.floor(Date.parse(fields.mtime) / 1000) : st.mtime\n await sftpUtimes(sftp, remote, newAtime, newMtime)\n }\n return residual\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 { FileStat, FileType, guessType } from '@struktoai/mirage-core'\nimport { isDirectoryAttrs } from './utils.ts'\n\nexport interface SshAttrs {\n size?: number\n mode?: number\n mtime?: number\n atime?: number\n uid?: number\n gid?: number\n}\n\nexport function attrsToFileStat(name: string, attrs: SshAttrs): FileStat {\n const modified = attrs.mtime !== undefined ? new Date(attrs.mtime * 1000).toISOString() : null\n const extra: Record<string, unknown> = {}\n if (attrs.mode !== undefined) extra.mode = attrs.mode\n if (attrs.uid !== undefined) extra.uid = attrs.uid\n if (attrs.gid !== undefined) extra.gid = attrs.gid\n // Fields setattr applies natively (mode, times) surface from the\n // remote inode, so external chmod/utime stays visible, mirroring\n // disk. Ownership can never be applied natively (chown over SFTP\n // needs privileges), so it lives wholly in the namespace overlay;\n // server-side uid/gid stay in extra only.\n const mode = attrs.mode !== undefined ? attrs.mode & 0o7777 : null\n const atime = attrs.atime !== undefined ? new Date(attrs.atime * 1000).toISOString() : null\n // The remote mtime is the only cheap change token SFTP offers, so it is\n // also the fingerprint: without one, the ALWAYS consistency policy has\n // nothing to compare and keeps serving a cached copy that the server has\n // already replaced. Mirrors the python stat.\n if (isDirectoryAttrs(attrs)) {\n return new FileStat({\n name,\n size: null,\n modified,\n fingerprint: modified,\n type: FileType.DIRECTORY,\n mode,\n atime,\n extra,\n })\n }\n return new FileStat({\n name,\n size: attrs.size ?? null,\n modified,\n fingerprint: modified,\n type: guessType(name),\n mode,\n atime,\n extra,\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 { FileStat, PathSpec } from '@struktoai/mirage-core'\nimport type { Stats } from 'ssh2'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { attrsToFileStat } from './entry.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\nimport { enoent, rstripSlash } from '@struktoai/mirage-core'\n\nexport async function stat(accessor: SSHAccessor, p: PathSpec): Promise<FileStat> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n const attrs = await new Promise<Stats>((resolveFn, rejectFn) => {\n // Follow symlinks (stat, not lstat), like the Python core: reads\n // follow the link, so the reported size must be the target's.\n sftp.stat(remote, (err, stats) => {\n if (err !== undefined) {\n if (isNoSuchFile(err)) rejectFn(enoent(p))\n else rejectFn(err)\n return\n }\n resolveFn(stats)\n })\n })\n const cleaned = rstripSlash(virtual)\n const name = cleaned.length === 0 ? '/' : (cleaned.split('/').pop() ?? '/')\n return attrsToFileStat(name, attrs)\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 { SSHAccessor } from '../../accessor/ssh.ts'\nimport { read } from './read.ts'\nimport { writeBytes } from './write.ts'\n\nexport async function truncate(accessor: SSHAccessor, p: PathSpec, length: number): Promise<void> {\n let data: Uint8Array\n try {\n data = await read(accessor, p)\n } catch (err) {\n if ((err as { code?: string }).code === 'ENOENT') {\n data = new Uint8Array(0)\n } else {\n throw err\n }\n }\n const out = new Uint8Array(length)\n out.set(data.subarray(0, Math.min(data.byteLength, length)))\n await writeBytes(accessor, p, out)\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 { invalidateAfterUnlink } from '@struktoai/mirage-core'\nimport type { PathSpec } from '@struktoai/mirage-core'\nimport { enoent } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../accessor/ssh.ts'\nimport { isNoSuchFile, joinRoot, stripPrefix } from './utils.ts'\n\nexport async function unlink(accessor: SSHAccessor, p: PathSpec): Promise<void> {\n const sftp = await accessor.sftp()\n const virtual = stripPrefix(p)\n const remote = joinRoot(accessor.config.root ?? '/', virtual)\n await new Promise<void>((resolveFn, rejectFn) => {\n sftp.unlink(remote, (err) => {\n if (!err) {\n resolveFn()\n return\n }\n if (isNoSuchFile(err)) rejectFn(enoent(p))\n else rejectFn(err)\n })\n })\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 type { CommandIO } from '@struktoai/mirage-core'\nimport type { SSHAccessor } from '../../../accessor/ssh.ts'\nimport { appendBytes as sshAppend } from '../../../core/ssh/append.ts'\nimport { SCOPE_ERROR } from '../../../core/ssh/constants.ts'\nimport { copy as sshCopy } from '../../../core/ssh/copy.ts'\nimport { create as sshCreate } from '../../../core/ssh/create.ts'\nimport { size as sshDu, entries as sshDuAll } from '../../../core/ssh/du/index.ts'\nimport { exists as sshExists } from '../../../core/ssh/exists.ts'\nimport { find as sshFind } from '../../../core/ssh/find.ts'\nimport { mkdir as sshMkdir } from '../../../core/ssh/mkdir.ts'\nimport { read as sshRead } from '../../../core/ssh/read.ts'\nimport { readdir as sshReaddir } from '../../../core/ssh/readdir.ts'\nimport { rename as sshRename } from '../../../core/ssh/rename.ts'\nimport { rmR as sshRmR } from '../../../core/ssh/rm.ts'\nimport { rmdir as sshRmdir } from '../../../core/ssh/rmdir.ts'\nimport { setAttrs as sshSetAttrs } from '../../../core/ssh/set_attrs.ts'\nimport { stat as sshStat } from '../../../core/ssh/stat.ts'\nimport { stream as sshStream } from '../../../core/ssh/stream.ts'\nimport { truncate as sshTruncate } from '../../../core/ssh/truncate.ts'\nimport { unlink as sshUnlink } from '../../../core/ssh/unlink.ts'\nimport { writeBytes as sshWrite } from '../../../core/ssh/write.ts'\n\nexport const SSH_IO: CommandIO<SSHAccessor> = {\n maxGlobMatches: SCOPE_ERROR,\n readdir: sshReaddir,\n readBytes: sshRead,\n readStream: sshStream,\n stat: sshStat,\n isMounted: () => true,\n local: false,\n write: sshWrite,\n exists: sshExists,\n mkdir: (accessor, path, parents) => sshMkdir(accessor, path, parents === true),\n unlink: sshUnlink,\n rmdir: sshRmdir,\n rmR: sshRmR,\n rename: sshRename,\n copy: sshCopy,\n create: sshCreate,\n truncate: sshTruncate,\n append: sshAppend,\n find: sshFind,\n du: { size: sshDu, entries: sshDuAll },\n setAttrs: sshSetAttrs,\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 { ResourceName, makeGenericOps } from '@struktoai/mirage-core'\nimport { SSH_IO } from '../../commands/builtin/ssh/io.ts'\n\nexport const SSH_OPS: readonly RegisteredOp[] = makeGenericOps(ResourceName.SSH, SSH_IO, {\n mkdirParents: true,\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 SSH_PROMPT = `{prefix}\n Remote filesystem via SSH/SFTP.\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, stat, mkdir, touch, cp, mv, rm, tee.`\n"],"mappings":";;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA,gBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAAC;AAAA,OAMK;;;ACVP,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AAGxB,SAAS,WAAW,GAAmB;AACrC,MAAI,MAAM,IAAK,QAAO,QAAQ;AAC9B,MAAI,EAAE,WAAW,IAAI,EAAG,QAAO,QAAQ,QAAQ,GAAG,EAAE,MAAM,CAAC,CAAC;AAC5D,SAAO;AACT;AAEO,IAAM,cAAN,cAA0B,SAAS;A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,QACX,WAAW,EAAE;AAAA,QACb,GAAI,EAAE,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI,CAAC;AAAA,QACnD,UAAU,EAAE;AAAA,QACZ,cAAc,SAAS,EAAE,SAAS,MAAM;AAAA,MAC1C,CAAC;AAAA,IACP,IACA;AACJ,WAAO,SAAS,KAAK,UAAU,SAAS;AAAA,EAC1C;AAAA;AAAA,EAGA,MAAM,WAAsC;AAC1C,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,QAAQ,gBAAgB,KAAK,MAAM;AAAA,IACrC;AAAA,EACF;AAAA,EAEA,UAAU,QAAyC;AACjD,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":["ResourceName","mountPrefixOf","ResourceName","enoent","enoent","invalidateAfterWrite","invalidateAfterWrite","entries","size","entries","compareCodePoints","norm","size","readRemoteDir","entries","statRemote","invalidateAfterWrite","enoent","statRemote","invalidateAfterWrite","compareCodePoints","enoent","mountPrefixOf","stripSlash","entries","invalidateAfterWrite","enoent","enoent","invalidateAfterWrite","enoent","invalidateAfterUnlink","statRemote","entries","enoent","invalidateAfterUnlink","enoent","invalidateAfterUnlink","enoent","invalidateAfterUnlink","enoent","enoent","keep","enoent","rstripSlash","invalidateAfterUnlink","enoent","enoent","invalidateAfterUnlink","ResourceName","ResourceName","ResourceName","ResourceName","mountPrefixOf"]}
@@ -1,6 +1,14 @@
1
1
  // src/resource/box/config.ts
2
- import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
2
+ import {
3
+ normalizeFields,
4
+ redactConfigWithSchema,
5
+ secretStr,
6
+ z
7
+ } from "@struktoai/mirage-core";
3
8
  var BoxConfigSchema = z.object({
9
+ endpoint: z.string().optional(),
10
+ rootFolderId: z.string().optional(),
11
+ contentSearch: z.boolean().optional(),
4
12
  clientId: z.string().optional(),
5
13
  clientSecret: secretStr().optional(),
6
14
  refreshToken: secretStr().optional(),
@@ -13,6 +21,8 @@ function redactBoxConfig(config) {
13
21
  function normalizeBoxConfig(input) {
14
22
  return normalizeFields(input, {
15
23
  rename: {
24
+ root_folder_id: "rootFolderId",
25
+ content_search: "contentSearch",
16
26
  client_id: "clientId",
17
27
  client_secret: "clientSecret",
18
28
  refresh_token: "refreshToken",
@@ -24,8 +34,7 @@ function normalizeBoxConfig(input) {
24
34
  }
25
35
 
26
36
  export {
27
- BoxConfigSchema,
28
37
  redactBoxConfig,
29
38
  normalizeBoxConfig
30
39
  };
31
- //# sourceMappingURL=chunk-OZAEWZZ3.js.map
40
+ //# sourceMappingURL=chunk-L42UTDFK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/box/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 {\n normalizeFields,\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretStr,\n z,\n} from '@struktoai/mirage-core'\n\nexport interface BoxConfig {\n // API origin override (e.g. an integ fake). Defaults to api.box.com.\n endpoint?: string\n // Box folder id to mount as the workspace root instead of the account\n // root (\"0\"). Folder ids are stable across renames/moves and visible in\n // the Box web URL (box.com/folder/<id>), so a subfolder mount survives\n // reorganization that a path prefix would not.\n rootFolderId?: string\n // Opt in to grep/rg content-search push-down: route recursive literal\n // scans through Box search to narrow the file set before scanning locally.\n // Off by default because Box's search index lags recent writes.\n contentSearch?: boolean\n clientId?: string\n clientSecret?: string\n refreshToken?: string\n // Box enterprise ID for the client-credentials grant. With clientId +\n // clientSecret + enterpriseId set, the resource authenticates as the app's\n // service account; no refresh token needed.\n enterpriseId?: string\n // Box developer token from https://app.box.com/developers/console (60-min\n // lifetime). When set, the resource skips the OAuth refresh flow and uses\n // this token directly. Useful for first-run / quick exploration.\n accessToken?: string\n refreshFn?: (\n refreshToken: string,\n ) => Promise<{ accessToken: string; refreshToken: string; expiresIn: number }>\n onRefreshTokenRotated?: (newRefreshToken: string) => void | Promise<void>\n}\n\nconst BoxConfigSchema = z.object({\n endpoint: z.string().optional(),\n rootFolderId: z.string().optional(),\n contentSearch: z.boolean().optional(),\n clientId: z.string().optional(),\n clientSecret: secretStr().optional(),\n refreshToken: secretStr().optional(),\n enterpriseId: z.string().optional(),\n accessToken: secretStr().optional(),\n})\n\n// Only the redacted twin derives: the schema deliberately omits the\n// callbacks, which no snapshot can carry.\nexport type BoxConfigRedacted = RedactedConfig<\n ConfigOf<typeof BoxConfigSchema>,\n 'clientSecret' | 'refreshToken' | 'accessToken'\n>\n\nexport function redactBoxConfig(config: BoxConfig): BoxConfigRedacted {\n return redactConfigWithSchema(BoxConfigSchema, config) as unknown as BoxConfigRedacted\n}\n\nexport function normalizeBoxConfig(input: Record<string, unknown>): BoxConfig {\n return normalizeFields(input, {\n rename: {\n root_folder_id: 'rootFolderId',\n content_search: 'contentSearch',\n client_id: 'clientId',\n client_secret: 'clientSecret',\n refresh_token: 'refreshToken',\n enterprise_id: 'enterpriseId',\n access_token: 'accessToken',\n developer_token: 'accessToken',\n },\n }) as unknown as BoxConfig\n}\n"],"mappings":";AAcA;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AA+BP,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,eAAe,EAAE,QAAQ,EAAE,SAAS;AAAA,EACpC,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,cAAc,UAAU,EAAE,SAAS;AAAA,EACnC,cAAc,UAAU,EAAE,SAAS;AAAA,EACnC,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,aAAa,UAAU,EAAE,SAAS;AACpC,CAAC;AASM,SAAS,gBAAgB,QAAsC;AACpE,SAAO,uBAAuB,iBAAiB,MAAM;AACvD;AAEO,SAAS,mBAAmB,OAA2C;AAC5E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB,WAAW;AAAA,MACX,eAAe;AAAA,MACf,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,MACd,iBAAiB;AAAA,IACnB;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -1,13 +1,11 @@
1
1
  // src/resource/gmail/config.ts
2
2
  import {
3
- GoogleConfigSchema,
4
3
  normalizeGoogleConfig,
5
4
  redactGoogleConfig
6
5
  } from "@struktoai/mirage-core";
7
6
 
8
7
  export {
9
- GoogleConfigSchema,
10
8
  normalizeGoogleConfig,
11
9
  redactGoogleConfig
12
10
  };
13
- //# sourceMappingURL=chunk-54NTYJEO.js.map
11
+ //# sourceMappingURL=chunk-LPDLPRPS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resource/gmail/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\nexport {\n GoogleConfigSchema as GmailConfigSchema,\n normalizeGoogleConfig as normalizeGmailConfig,\n redactGoogleConfig as redactGmailConfig,\n type GoogleConfig as GmailConfig,\n type GoogleConfigRedacted as GmailConfigRedacted,\n} from '@struktoai/mirage-core'\n"],"mappings":";AAcA;AAAA,EACwB;AAAA,EACG;AAAA,EACH;AAAA,OAGjB;","names":[]}
1
+ {"version":3,"sources":["../src/resource/gmail/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\nexport {\n normalizeGoogleConfig as normalizeGmailConfig,\n redactGoogleConfig as redactGmailConfig,\n type GoogleConfig as GmailConfig,\n type GoogleConfigRedacted as GmailConfigRedacted,\n} from '@struktoai/mirage-core'\n"],"mappings":";AAcA;AAAA,EAC2B;AAAA,EACH;AAAA,OAGjB;","names":[]}
@@ -0,0 +1,11 @@
1
+ // src/resource/gsheets/config.ts
2
+ import {
3
+ normalizeGoogleConfig,
4
+ redactGoogleConfig
5
+ } from "@struktoai/mirage-core";
6
+
7
+ export {
8
+ normalizeGoogleConfig,
9
+ redactGoogleConfig
10
+ };
11
+ //# sourceMappingURL=chunk-M2UF2JHJ.js.map
@@ -0,0 +1 @@
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\nexport {\n normalizeGoogleConfig as normalizeGSheetsConfig,\n redactGoogleConfig as redactGSheetsConfig,\n type GoogleConfig as GSheetsConfig,\n type GoogleConfigRedacted as GSheetsConfigRedacted,\n} from '@struktoai/mirage-core'\n"],"mappings":";AAcA;AAAA,EAC2B;AAAA,EACH;AAAA,OAGjB;","names":[]}
@@ -1,5 +1,10 @@
1
1
  // src/resource/ssh/config.ts
2
- import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
2
+ import {
3
+ normalizeFields,
4
+ redactConfigWithSchema,
5
+ secretStr,
6
+ z
7
+ } from "@struktoai/mirage-core";
3
8
  var SSHConfigSchema = z.object({
4
9
  host: z.string(),
5
10
  hostname: z.string().optional(),
@@ -25,8 +30,7 @@ function normalizeSshConfig(input) {
25
30
  }
26
31
 
27
32
  export {
28
- SSHConfigSchema,
29
33
  redactSshConfig,
30
34
  normalizeSshConfig
31
35
  };
32
- //# sourceMappingURL=chunk-UGK4TAVK.js.map
36
+ //# sourceMappingURL=chunk-MONC734W.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resource/ssh/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 {\n normalizeFields,\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretStr,\n z,\n} from '@struktoai/mirage-core'\n\nconst SSHConfigSchema = z.object({\n host: z.string(),\n hostname: z.string().optional(),\n port: z.number().optional(),\n username: z.string().optional(),\n password: secretStr().optional(),\n identityFile: z.string().optional(),\n passphrase: secretStr().optional(),\n root: z.string().optional(),\n timeout: z.number().optional(),\n knownHosts: z.string().optional(),\n})\n\nexport type SSHConfig = ConfigOf<typeof SSHConfigSchema>\n\nexport type SSHConfigRedacted = RedactedConfig<SSHConfig, 'password' | 'passphrase'>\n\nexport function redactSshConfig(config: SSHConfig): SSHConfigRedacted {\n return redactConfigWithSchema(SSHConfigSchema, config) as unknown as SSHConfigRedacted\n}\n\nexport function normalizeSshConfig(input: Record<string, unknown>): SSHConfig {\n return normalizeFields(input, {\n rename: {\n identity_file: 'identityFile',\n known_hosts: 'knownHosts',\n },\n }) as unknown as SSHConfig\n}\n"],"mappings":";AAcA;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,MAAM,EAAE,OAAO;AAAA,EACf,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,UAAU,UAAU,EAAE,SAAS;AAAA,EAC/B,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,YAAY,UAAU,EAAE,SAAS;AAAA,EACjC,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,YAAY,EAAE,OAAO,EAAE,SAAS;AAClC,CAAC;AAMM,SAAS,gBAAgB,QAAsC;AACpE,SAAO,uBAAuB,iBAAiB,MAAM;AACvD;AAEO,SAAS,mBAAmB,OAA2C;AAC5E,SAAO,gBAAgB,OAAO;AAAA,IAC5B,QAAQ;AAAA,MACN,eAAe;AAAA,MACf,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  cephToS3Config,
3
3
  redactCephConfig
4
- } from "./chunk-OPYQ5KIO.js";
4
+ } from "./chunk-PSXXEGYQ.js";
5
5
  import {
6
6
  S3Resource
7
- } from "./chunk-TA3WMOMU.js";
7
+ } from "./chunk-EJZG5VUF.js";
8
8
 
9
9
  // src/resource/ceph/ceph.ts
10
10
  import {
@@ -17,8 +17,7 @@ import {
17
17
  var CEPH_PROMPT = `{prefix}
18
18
  Remote Ceph Rados Gateway bucket (S3-compatible).
19
19
  IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.
20
- Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.
21
- cat on .parquet/.orc/.feather returns a formatted table.`;
20
+ Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.`;
22
21
 
23
22
  // src/resource/ceph/ceph.ts
24
23
  var CephResource = class extends S3Resource {
@@ -54,4 +53,4 @@ export {
54
53
  CEPH_PROMPT,
55
54
  CephResource
56
55
  };
57
- //# sourceMappingURL=chunk-IK2L4EN3.js.map
56
+ //# sourceMappingURL=chunk-N72RLCMU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/resource/ceph/ceph.ts","../src/resource/ceph/prompt.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 remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n cephToS3Config,\n redactCephConfig,\n type CephConfig,\n type CephConfigRedacted,\n} from './config.ts'\nimport { CEPH_PROMPT } from './prompt.ts'\n\nexport interface CephResourceState {\n type: string\n config: CephConfigRedacted\n}\n\nexport class CephResource extends S3Resource {\n override readonly kind: string = ResourceName.CEPH\n override readonly prompt: string = CEPH_PROMPT\n readonly cephConfig: CephConfig\n private readonly cephOps: readonly RegisteredOp[]\n private readonly cephCommands: readonly RegisteredCommand[]\n\n constructor(config: CephConfig) {\n super(cephToS3Config(config))\n this.cephConfig = config\n this.cephOps = remapOpsResource(super.ops(), ResourceName.CEPH)\n this.cephCommands = remapCommandsResource(super.commands(), ResourceName.CEPH)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.cephOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.cephCommands\n }\n\n override getState(): Promise<CephResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactCephConfig(this.cephConfig),\n })\n }\n\n override loadState(_state: CephResourceState): Promise<void> {\n return Promise.resolve()\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\nexport const CEPH_PROMPT = `\\\n{prefix}\n Remote Ceph Rados Gateway bucket (S3-compatible).\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.\n cat on .parquet/.orc/.feather returns a formatted table.`\n"],"mappings":";;;;;;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNA,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;;;ADqBpB,IAAM,eAAN,cAA2B,WAAW;AAAA,EACzB,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAoB;AAC9B,UAAM,eAAe,MAAM,CAAC;AAC5B,SAAK,aAAa;AAClB,SAAK,UAAU,iBAAiB,MAAM,IAAI,GAAG,aAAa,IAAI;AAC9D,SAAK,eAAe,sBAAsB,MAAM,SAAS,GAAG,aAAa,IAAI;AAAA,EAC/E;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAuC;AAC9C,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,iBAAiB,KAAK,UAAU;AAAA,IAC1C,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA0C;AAC3D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/resource/ceph/ceph.ts","../src/resource/ceph/prompt.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 remapCommandsResource,\n remapOpsResource,\n ResourceName,\n type RegisteredCommand,\n type RegisteredOp,\n} from '@struktoai/mirage-core'\nimport { S3Resource } from '../s3/s3.ts'\nimport {\n cephToS3Config,\n redactCephConfig,\n type CephConfig,\n type CephConfigRedacted,\n} from './config.ts'\nimport { CEPH_PROMPT } from './prompt.ts'\n\nexport interface CephResourceState {\n type: string\n config: CephConfigRedacted\n}\n\nexport class CephResource extends S3Resource {\n override readonly kind: string = ResourceName.CEPH\n override readonly prompt: string = CEPH_PROMPT\n readonly cephConfig: CephConfig\n private readonly cephOps: readonly RegisteredOp[]\n private readonly cephCommands: readonly RegisteredCommand[]\n\n constructor(config: CephConfig) {\n super(cephToS3Config(config))\n this.cephConfig = config\n this.cephOps = remapOpsResource(super.ops(), ResourceName.CEPH)\n this.cephCommands = remapCommandsResource(super.commands(), ResourceName.CEPH)\n }\n\n override ops(): readonly RegisteredOp[] {\n return this.cephOps\n }\n\n override commands(): readonly RegisteredCommand[] {\n return this.cephCommands\n }\n\n override getState(): Promise<CephResourceState> {\n return Promise.resolve({\n type: this.kind,\n config: redactCephConfig(this.cephConfig),\n })\n }\n\n override loadState(_state: CephResourceState): Promise<void> {\n return Promise.resolve()\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\nexport const CEPH_PROMPT = `\\\n{prefix}\n Remote Ceph Rados Gateway bucket (S3-compatible).\n IMPORTANT: This is a remote mount. Prefer targeted reads over full scans.\n Supports: ls, cat, head, tail, grep, rg, wc, find, tree, jq, stat.`\n"],"mappings":";;;;;;;;;AAcA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;ACNA,IAAM,cAAc;AAAA;AAAA;AAAA;;;ADqBpB,IAAM,eAAN,cAA2B,WAAW;AAAA,EACzB,OAAe,aAAa;AAAA,EAC5B,SAAiB;AAAA,EAC1B;AAAA,EACQ;AAAA,EACA;AAAA,EAEjB,YAAY,QAAoB;AAC9B,UAAM,eAAe,MAAM,CAAC;AAC5B,SAAK,aAAa;AAClB,SAAK,UAAU,iBAAiB,MAAM,IAAI,GAAG,aAAa,IAAI;AAC9D,SAAK,eAAe,sBAAsB,MAAM,SAAS,GAAG,aAAa,IAAI;AAAA,EAC/E;AAAA,EAES,MAA+B;AACtC,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAyC;AAChD,WAAO,KAAK;AAAA,EACd;AAAA,EAES,WAAuC;AAC9C,WAAO,QAAQ,QAAQ;AAAA,MACrB,MAAM,KAAK;AAAA,MACX,QAAQ,iBAAiB,KAAK,UAAU;AAAA,IAC1C,CAAC;AAAA,EACH;AAAA,EAES,UAAU,QAA0C;AAC3D,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACF;","names":[]}
@@ -1,5 +1,10 @@
1
1
  // src/resource/github_ci/config.ts
2
- import { normalizeFields, redactConfigWithSchema, secretStr, z } from "@struktoai/mirage-core";
2
+ import {
3
+ normalizeFields,
4
+ redactConfigWithSchema,
5
+ secretStr,
6
+ z
7
+ } from "@struktoai/mirage-core";
3
8
  var GitHubCIConfigSchema = z.object({
4
9
  token: secretStr(),
5
10
  owner: z.string(),
@@ -18,8 +23,7 @@ function normalizeGitHubCIConfig(input) {
18
23
  }
19
24
 
20
25
  export {
21
- GitHubCIConfigSchema,
22
26
  redactGitHubCIConfig,
23
27
  normalizeGitHubCIConfig
24
28
  };
25
- //# sourceMappingURL=chunk-H3I2KZIY.js.map
29
+ //# sourceMappingURL=chunk-ND4IWJ4V.js.map
@@ -0,0 +1 @@
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 {\n normalizeFields,\n redactConfigWithSchema,\n type ConfigOf,\n type RedactedConfig,\n secretStr,\n z,\n} from '@struktoai/mirage-core'\n\nconst 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 type GitHubCIConfig = ConfigOf<typeof GitHubCIConfigSchema>\n\nexport type GitHubCIConfigRedacted = RedactedConfig<GitHubCIConfig, 'token'>\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;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AAEP,IAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,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;AAMM,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":[]}