@struktoai/mirage-node 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/dist/aliyun-PGI57A43.js +10 -0
  2. package/dist/backblaze-TSPL6Y56.js +10 -0
  3. package/dist/box-7XTZYDSO.js +8 -0
  4. package/dist/cas.lua +15 -0
  5. package/dist/ceph-C265UI5T.js +10 -0
  6. package/dist/{chunk-I5THIMPP.js → chunk-25W4XQJZ.js} +5 -5
  7. package/dist/{chunk-QGRDPSAH.js → chunk-2ERLWAGG.js} +4 -2
  8. package/dist/chunk-2ERLWAGG.js.map +1 -0
  9. package/dist/{chunk-NJMGCT63.js → chunk-2QNPKPZZ.js} +7 -2
  10. package/dist/chunk-2QNPKPZZ.js.map +1 -0
  11. package/dist/{chunk-ZNWVJ6UW.js → chunk-3ASOQTZB.js} +7 -2
  12. package/dist/chunk-3ASOQTZB.js.map +1 -0
  13. package/dist/{chunk-WAR4Q2NM.js → chunk-3JZN3GYO.js} +13 -12
  14. package/dist/chunk-3JZN3GYO.js.map +1 -0
  15. package/dist/{chunk-S5OVP467.js → chunk-4GYB7DGC.js} +294 -705
  16. package/dist/chunk-4GYB7DGC.js.map +1 -0
  17. package/dist/{chunk-HJJMP6IX.js → chunk-4M73WHIE.js} +3 -3
  18. package/dist/{chunk-7CW3BMPH.js → chunk-4X6CLF4F.js} +3 -3
  19. package/dist/{chunk-QQBJC2FQ.js → chunk-5I7Q7RHW.js} +3 -3
  20. package/dist/{chunk-LV2G7VHL.js → chunk-5YRWF5RP.js} +17 -15
  21. package/dist/chunk-5YRWF5RP.js.map +1 -0
  22. package/dist/chunk-5ZHNPNDD.js +944 -0
  23. package/dist/chunk-5ZHNPNDD.js.map +1 -0
  24. package/dist/{chunk-VGLHY6BK.js → chunk-AULFV3KY.js} +1 -2
  25. package/dist/chunk-AULFV3KY.js.map +1 -0
  26. package/dist/{chunk-VWKUT4CW.js → chunk-BWLUBJQG.js} +19 -15
  27. package/dist/chunk-BWLUBJQG.js.map +1 -0
  28. package/dist/{chunk-X5HF2OFP.js → chunk-BWWU5T2D.js} +3 -3
  29. package/dist/chunk-C7TNKIK5.js +39 -0
  30. package/dist/chunk-C7TNKIK5.js.map +1 -0
  31. package/dist/{chunk-MPCCRRE6.js → chunk-CB76WPUS.js} +12 -13
  32. package/dist/chunk-CB76WPUS.js.map +1 -0
  33. package/dist/chunk-CGGO5NKD.js +1194 -0
  34. package/dist/chunk-CGGO5NKD.js.map +1 -0
  35. package/dist/{chunk-B2ZOKNN4.js → chunk-CQCTCW4S.js} +1 -2
  36. package/dist/chunk-CQCTCW4S.js.map +1 -0
  37. package/dist/{chunk-KPULTUOK.js → chunk-CXQGMFI7.js} +3 -3
  38. package/dist/{chunk-LW25LMIH.js → chunk-D3U7VQCG.js} +1 -2
  39. package/dist/{chunk-LW25LMIH.js.map → chunk-D3U7VQCG.js.map} +1 -1
  40. package/dist/{chunk-N5FSLVKO.js → chunk-DXU7NZPH.js} +3 -3
  41. package/dist/{chunk-XGJ2QERC.js → chunk-E3KXVEYI.js} +8 -4
  42. package/dist/chunk-E3KXVEYI.js.map +1 -0
  43. package/dist/{chunk-YAHRT6MB.js → chunk-EGZNOUMH.js} +3 -3
  44. package/dist/{chunk-DNBAMB5J.js → chunk-EVK6HH6Z.js} +1 -2
  45. package/dist/{chunk-DNBAMB5J.js.map → chunk-EVK6HH6Z.js.map} +1 -1
  46. package/dist/{chunk-HGCRXJGP.js → chunk-F5NWRF32.js} +3 -3
  47. package/dist/{chunk-GCFYZSVR.js → chunk-FRGTDZQT.js} +15 -10
  48. package/dist/chunk-FRGTDZQT.js.map +1 -0
  49. package/dist/{chunk-DYXEITK3.js → chunk-GF75O2EN.js} +4 -2
  50. package/dist/chunk-GF75O2EN.js.map +1 -0
  51. package/dist/{chunk-W7FLHT65.js → chunk-GTAS3QVC.js} +1 -2
  52. package/dist/{chunk-W7FLHT65.js.map → chunk-GTAS3QVC.js.map} +1 -1
  53. package/dist/{chunk-RQK5UPMP.js → chunk-H62XQZUM.js} +4 -3
  54. package/dist/chunk-H62XQZUM.js.map +1 -0
  55. package/dist/{chunk-UT2OPSN4.js → chunk-HCU3B6FW.js} +1 -2
  56. package/dist/chunk-HCU3B6FW.js.map +1 -0
  57. package/dist/chunk-HEDE2377.js +754 -0
  58. package/dist/chunk-HEDE2377.js.map +1 -0
  59. package/dist/{chunk-RNQN2FOU.js → chunk-HGIPWY5Y.js} +21 -10
  60. package/dist/chunk-HGIPWY5Y.js.map +1 -0
  61. package/dist/{chunk-Q2IAILVC.js → chunk-HSD24IP2.js} +8 -4
  62. package/dist/chunk-HSD24IP2.js.map +1 -0
  63. package/dist/{chunk-SWCDFEUK.js → chunk-HWQPEBID.js} +18 -14
  64. package/dist/chunk-HWQPEBID.js.map +1 -0
  65. package/dist/{chunk-SFUCUARB.js → chunk-IEHPTILN.js} +4 -4
  66. package/dist/chunk-IEHPTILN.js.map +1 -0
  67. package/dist/{chunk-M5FVUIYP.js → chunk-IEVLWEBO.js} +14 -13
  68. package/dist/chunk-IEVLWEBO.js.map +1 -0
  69. package/dist/{chunk-YUK3X3B4.js → chunk-IKJQOYI4.js} +1 -2
  70. package/dist/{chunk-YUK3X3B4.js.map → chunk-IKJQOYI4.js.map} +1 -1
  71. package/dist/{chunk-TA3WMOMU.js → chunk-IUXXZHY3.js} +16 -22
  72. package/dist/chunk-IUXXZHY3.js.map +1 -0
  73. package/dist/{chunk-EZQ5HBAC.js → chunk-JBDFYIN2.js} +12 -13
  74. package/dist/chunk-JBDFYIN2.js.map +1 -0
  75. package/dist/{chunk-JCC4CU2I.js → chunk-JEBH5APX.js} +14 -14
  76. package/dist/chunk-JEBH5APX.js.map +1 -0
  77. package/dist/{chunk-H3BST2LI.js → chunk-JHI2PHHD.js} +1 -2
  78. package/dist/{chunk-H3BST2LI.js.map → chunk-JHI2PHHD.js.map} +1 -1
  79. package/dist/{chunk-EGB7V74Z.js → chunk-KAWDDS27.js} +1 -3
  80. package/dist/chunk-KAWDDS27.js.map +1 -0
  81. package/dist/{chunk-DP2PP5V2.js → chunk-KGC2OGXI.js} +5 -4
  82. package/dist/chunk-KGC2OGXI.js.map +1 -0
  83. package/dist/{chunk-3WIO7NBR.js → chunk-L4GMDSMB.js} +3 -3
  84. package/dist/{chunk-47AVIIOT.js → chunk-L7FEZ7LU.js} +3 -3
  85. package/dist/{chunk-54NTYJEO.js → chunk-LPDLPRPS.js} +1 -3
  86. package/dist/{chunk-54NTYJEO.js.map → chunk-LPDLPRPS.js.map} +1 -1
  87. package/dist/{chunk-UGK4TAVK.js → chunk-LPLZLSMK.js} +1 -2
  88. package/dist/chunk-LPLZLSMK.js.map +1 -0
  89. package/dist/{chunk-EM4J5EQS.js → chunk-M6E7VK4D.js} +13 -13
  90. package/dist/chunk-M6E7VK4D.js.map +1 -0
  91. package/dist/{chunk-2CC5VW7K.js → chunk-MIQ3ECZM.js} +4 -2
  92. package/dist/chunk-MIQ3ECZM.js.map +1 -0
  93. package/dist/chunk-MRXTUFBZ.js +30 -0
  94. package/dist/chunk-MRXTUFBZ.js.map +1 -0
  95. package/dist/{chunk-RO5IQEDQ.js → chunk-NJ42VNXG.js} +1 -2
  96. package/dist/chunk-NJ42VNXG.js.map +1 -0
  97. package/dist/{chunk-AUHSTJJ3.js → chunk-NLXJMXVE.js} +3 -3
  98. package/dist/{chunk-E2ISWXLB.js → chunk-OQKNDS66.js} +1 -1
  99. package/dist/{chunk-E2ISWXLB.js.map → chunk-OQKNDS66.js.map} +1 -1
  100. package/dist/{chunk-IDYHQQOH.js → chunk-OSVZKYXS.js} +229 -378
  101. package/dist/chunk-OSVZKYXS.js.map +1 -0
  102. package/dist/{chunk-JAGJTM3Q.js → chunk-RHUEV4I7.js} +11 -12
  103. package/dist/chunk-RHUEV4I7.js.map +1 -0
  104. package/dist/{chunk-JALIYI6M.js → chunk-S4KVLPBR.js} +7 -2
  105. package/dist/chunk-S4KVLPBR.js.map +1 -0
  106. package/dist/{chunk-ZEGAMJO2.js → chunk-SAOQW6ZJ.js} +14 -14
  107. package/dist/chunk-SAOQW6ZJ.js.map +1 -0
  108. package/dist/{chunk-NOHWIBRX.js → chunk-SI4GMRXD.js} +13 -14
  109. package/dist/chunk-SI4GMRXD.js.map +1 -0
  110. package/dist/{chunk-X3G37FXT.js → chunk-SYMNWNC3.js} +3 -3
  111. package/dist/{chunk-DM4GSE26.js → chunk-TUNR4VUM.js} +3 -3
  112. package/dist/{chunk-XHCBHYN4.js → chunk-UAJYJP5C.js} +7 -2
  113. package/dist/chunk-UAJYJP5C.js.map +1 -0
  114. package/dist/{chunk-OPYQ5KIO.js → chunk-UYA3XL3J.js} +4 -2
  115. package/dist/chunk-UYA3XL3J.js.map +1 -0
  116. package/dist/{chunk-UINQOUZR.js → chunk-V7JVMG63.js} +3 -3
  117. package/dist/{chunk-LAJJPLEV.js → chunk-VBYIDRNU.js} +7 -3
  118. package/dist/chunk-VBYIDRNU.js.map +1 -0
  119. package/dist/{chunk-GS5AUKUO.js → chunk-VHED2STW.js} +10 -7
  120. package/dist/chunk-VHED2STW.js.map +1 -0
  121. package/dist/{chunk-JZT4QGIP.js → chunk-VIICUPWQ.js} +1 -2
  122. package/dist/{chunk-JZT4QGIP.js.map → chunk-VIICUPWQ.js.map} +1 -1
  123. package/dist/{chunk-QCZ2XUKH.js → chunk-VLRSOWHP.js} +16 -14
  124. package/dist/chunk-VLRSOWHP.js.map +1 -0
  125. package/dist/{chunk-XWVDS66D.js → chunk-W5ZLIQFR.js} +182 -381
  126. package/dist/chunk-W5ZLIQFR.js.map +1 -0
  127. package/dist/{chunk-YGZMVNN5.js → chunk-WTSSEUOZ.js} +7 -2
  128. package/dist/chunk-WTSSEUOZ.js.map +1 -0
  129. package/dist/{chunk-OHROA3FQ.js → chunk-WWP2STF5.js} +7 -2
  130. package/dist/chunk-WWP2STF5.js.map +1 -0
  131. package/dist/{chunk-IK2L4EN3.js → chunk-XADEMW6B.js} +3 -3
  132. package/dist/{chunk-FQ33BYFR.js → chunk-XEMLYWHK.js} +3 -3
  133. package/dist/{chunk-OZAEWZZ3.js → chunk-XFSEADPC.js} +6 -2
  134. package/dist/chunk-XFSEADPC.js.map +1 -0
  135. package/dist/{chunk-TWGVQLG2.js → chunk-XUUSWR4U.js} +1 -2
  136. package/dist/{chunk-TWGVQLG2.js.map → chunk-XUUSWR4U.js.map} +1 -1
  137. package/dist/{chunk-XLQI4IT2.js → chunk-YBVMZ7SR.js} +7 -2
  138. package/dist/chunk-YBVMZ7SR.js.map +1 -0
  139. package/dist/{chunk-A7IVFIOP.js → chunk-YRJICL2Q.js} +14 -14
  140. package/dist/chunk-YRJICL2Q.js.map +1 -0
  141. package/dist/{chunk-ZGSER5TG.js → chunk-ZM44MGC5.js} +3 -3
  142. package/dist/{chunk-G2WCEUQL.js → chunk-ZMREYTHA.js} +15 -14
  143. package/dist/chunk-ZMREYTHA.js.map +1 -0
  144. package/dist/{chunk-H3I2KZIY.js → chunk-ZPB3SLPK.js} +1 -2
  145. package/dist/{chunk-H3I2KZIY.js.map → chunk-ZPB3SLPK.js.map} +1 -1
  146. package/dist/chunk-ZPZQXHW2.js +1230 -0
  147. package/dist/chunk-ZPZQXHW2.js.map +1 -0
  148. package/dist/{config-34LHOGLM.js → config-2LASFFRD.js} +2 -4
  149. package/dist/config-3WDIJPTG.js +9 -0
  150. package/dist/config-4QV4QYI5.js +9 -0
  151. package/dist/{config-ZFJYQZCH.js → config-54USUVSE.js} +2 -4
  152. package/dist/config-5ZXN2T2H.js +9 -0
  153. package/dist/config-A2GQYJDB.js +9 -0
  154. package/dist/config-BBOLI7VE.js +9 -0
  155. package/dist/{config-VM526IKB.js → config-BIBFLUIR.js} +2 -4
  156. package/dist/{config-EO23EY62.js → config-CPYFOUQO.js} +2 -4
  157. package/dist/{config-3IVQJBNW.js → config-DWSJL3NH.js} +2 -4
  158. package/dist/config-E22XAGYN.js +9 -0
  159. package/dist/config-EHE52ZTK.js +9 -0
  160. package/dist/{config-GE4W4ZJC.js → config-EX3ZJTZI.js} +2 -4
  161. package/dist/{config-QNMKWJ4M.js → config-FRK7ZL37.js} +2 -4
  162. package/dist/{config-LHFFXVYI.js → config-HQXNFQZS.js} +2 -4
  163. package/dist/config-HTXOOAOD.js +9 -0
  164. package/dist/{config-HKRMKD76.js → config-IPNWAJHH.js} +2 -4
  165. package/dist/config-J2C53GOT.js +9 -0
  166. package/dist/config-K63RX6EU.js +9 -0
  167. package/dist/config-L7SBSH5L.js +9 -0
  168. package/dist/config-LEALEMKA.js +9 -0
  169. package/dist/{config-IVY5EQQ2.js → config-M3Z47VYU.js} +2 -4
  170. package/dist/{config-EIHSP5DZ.js → config-MZM3IPFM.js} +2 -4
  171. package/dist/{config-GHRUKEQ6.js → config-OJ2BPESH.js} +2 -4
  172. package/dist/{config-WDAZFXYD.js → config-QO2XUME4.js} +2 -4
  173. package/dist/config-QWQGOXQ5.js +9 -0
  174. package/dist/config-RI7IEZUF.js +9 -0
  175. package/dist/{config-CVZ2AGCO.js → config-SPW6NESU.js} +2 -6
  176. package/dist/{config-QAA646XB.js → config-T2IUIU5C.js} +2 -4
  177. package/dist/{config-NV5WXP64.js → config-UU27ALAA.js} +2 -4
  178. package/dist/config-VKKZGC7V.js +9 -0
  179. package/dist/config-W7EVPJNK.js +11 -0
  180. package/dist/config-WKQ3FGTZ.js +9 -0
  181. package/dist/config-WVILHDFV.js +11 -0
  182. package/dist/{config-Q45Y46YT.js → config-XU6D5C7E.js} +2 -4
  183. package/dist/databricks_volume-ETRDJVVQ.js +7 -0
  184. package/dist/digitalocean-QP72DR4J.js +10 -0
  185. package/dist/discord-BSN5RB3E.js +8 -0
  186. package/dist/disk-24NWTN2I.js +7 -0
  187. package/dist/dropbox-OSTZXSIE.js +8 -0
  188. package/dist/email-4ZFPSWIN.js +8 -0
  189. package/dist/gcs-PFWR6MIW.js +10 -0
  190. package/dist/gdocs-GPAZRQG5.js +8 -0
  191. package/dist/gdrive-XSX6A7B3.js +8 -0
  192. package/dist/github-EQ4NXUTA.js +8 -0
  193. package/dist/github_ci-QL5B2Q2N.js +8 -0
  194. package/dist/gmail-2TBT4CVH.js +8 -0
  195. package/dist/gridfs-KZRZ6SIB.js +9 -0
  196. package/dist/gsheets-N53WEXN2.js +8 -0
  197. package/dist/gslides-TATSARTH.js +8 -0
  198. package/dist/hf_buckets-BK7NGJWS.js +10 -0
  199. package/dist/hf_datasets-UQ5QGM4L.js +10 -0
  200. package/dist/hf_models-75LFCQCS.js +10 -0
  201. package/dist/hf_spaces-6T2KB3UC.js +10 -0
  202. package/dist/index.d.ts +494 -40
  203. package/dist/index.js +1193 -388
  204. package/dist/index.js.map +1 -1
  205. package/dist/langfuse-AMQCQWNE.js +8 -0
  206. package/dist/linear-V3TXO6CV.js +8 -0
  207. package/dist/minio-IZRZY4C5.js +10 -0
  208. package/dist/mongodb-VMKPQCPX.js +7 -0
  209. package/dist/nextcloud-5RHQCGDO.js +9 -0
  210. package/dist/notion-6PPNTQFM.js +8 -0
  211. package/dist/oci-CKYBSFZJ.js +10 -0
  212. package/dist/postgres-WIQBVL5M.js +7 -0
  213. package/dist/qingstor-AP4IIPLY.js +10 -0
  214. package/dist/r2-C4XGEWQY.js +10 -0
  215. package/dist/redis-6D55Q2WB.js +8 -0
  216. package/dist/s3-XQBI2CXN.js +8 -0
  217. package/dist/scaleway-SEZJVURB.js +10 -0
  218. package/dist/seaweedfs-3XYIAFU2.js +10 -0
  219. package/dist/slack-ZHXDJQY4.js +8 -0
  220. package/dist/ssh-X2MO7JOV.js +8 -0
  221. package/dist/supabase-BBM44UTM.js +10 -0
  222. package/dist/supabase-BBM44UTM.js.map +1 -0
  223. package/dist/tencent-X72USLJ7.js +10 -0
  224. package/dist/tencent-X72USLJ7.js.map +1 -0
  225. package/dist/trello-EER5NG7L.js +8 -0
  226. package/dist/trello-EER5NG7L.js.map +1 -0
  227. package/dist/wasabi-O4MVIUFG.js +10 -0
  228. package/dist/wasabi-O4MVIUFG.js.map +1 -0
  229. package/package.json +4 -2
  230. package/dist/aliyun-JMJ3PFYY.js +0 -10
  231. package/dist/backblaze-TDFD23QO.js +0 -10
  232. package/dist/box-GQ2U2R6R.js +0 -8
  233. package/dist/ceph-S2VOYO6G.js +0 -10
  234. package/dist/chunk-2CC5VW7K.js.map +0 -1
  235. package/dist/chunk-A7IVFIOP.js.map +0 -1
  236. package/dist/chunk-B2ZOKNN4.js.map +0 -1
  237. package/dist/chunk-DP2PP5V2.js.map +0 -1
  238. package/dist/chunk-DYXEITK3.js.map +0 -1
  239. package/dist/chunk-EGB7V74Z.js.map +0 -1
  240. package/dist/chunk-EM4J5EQS.js.map +0 -1
  241. package/dist/chunk-EZQ5HBAC.js.map +0 -1
  242. package/dist/chunk-G2WCEUQL.js.map +0 -1
  243. package/dist/chunk-GCFYZSVR.js.map +0 -1
  244. package/dist/chunk-GS5AUKUO.js.map +0 -1
  245. package/dist/chunk-IDYHQQOH.js.map +0 -1
  246. package/dist/chunk-JAGJTM3Q.js.map +0 -1
  247. package/dist/chunk-JALIYI6M.js.map +0 -1
  248. package/dist/chunk-JCC4CU2I.js.map +0 -1
  249. package/dist/chunk-LAJJPLEV.js.map +0 -1
  250. package/dist/chunk-LV2G7VHL.js.map +0 -1
  251. package/dist/chunk-M5FVUIYP.js.map +0 -1
  252. package/dist/chunk-MPCCRRE6.js.map +0 -1
  253. package/dist/chunk-NJMGCT63.js.map +0 -1
  254. package/dist/chunk-NOHWIBRX.js.map +0 -1
  255. package/dist/chunk-OHROA3FQ.js.map +0 -1
  256. package/dist/chunk-OPYQ5KIO.js.map +0 -1
  257. package/dist/chunk-OZAEWZZ3.js.map +0 -1
  258. package/dist/chunk-Q2IAILVC.js.map +0 -1
  259. package/dist/chunk-QCZ2XUKH.js.map +0 -1
  260. package/dist/chunk-QGRDPSAH.js.map +0 -1
  261. package/dist/chunk-RNQN2FOU.js.map +0 -1
  262. package/dist/chunk-RO5IQEDQ.js.map +0 -1
  263. package/dist/chunk-RQK5UPMP.js.map +0 -1
  264. package/dist/chunk-S5OVP467.js.map +0 -1
  265. package/dist/chunk-SFUCUARB.js.map +0 -1
  266. package/dist/chunk-SWCDFEUK.js.map +0 -1
  267. package/dist/chunk-TA3WMOMU.js.map +0 -1
  268. package/dist/chunk-TURD42QO.js +0 -1782
  269. package/dist/chunk-TURD42QO.js.map +0 -1
  270. package/dist/chunk-U6QSXTUS.js +0 -7
  271. package/dist/chunk-U6QSXTUS.js.map +0 -1
  272. package/dist/chunk-UGK4TAVK.js.map +0 -1
  273. package/dist/chunk-UT2OPSN4.js.map +0 -1
  274. package/dist/chunk-VGLHY6BK.js.map +0 -1
  275. package/dist/chunk-VWKUT4CW.js.map +0 -1
  276. package/dist/chunk-WAR4Q2NM.js.map +0 -1
  277. package/dist/chunk-WHFUWWI6.js +0 -2097
  278. package/dist/chunk-WHFUWWI6.js.map +0 -1
  279. package/dist/chunk-XGJ2QERC.js.map +0 -1
  280. package/dist/chunk-XHCBHYN4.js.map +0 -1
  281. package/dist/chunk-XLQI4IT2.js.map +0 -1
  282. package/dist/chunk-XWVDS66D.js.map +0 -1
  283. package/dist/chunk-YGZMVNN5.js.map +0 -1
  284. package/dist/chunk-ZEGAMJO2.js.map +0 -1
  285. package/dist/chunk-ZNWVJ6UW.js.map +0 -1
  286. package/dist/config-3BBWD5AB.js +0 -11
  287. package/dist/config-4UDVSUQJ.js +0 -11
  288. package/dist/config-CMDBAPDH.js +0 -11
  289. package/dist/config-D3RLSPNF.js +0 -11
  290. package/dist/config-DG65OEG3.js +0 -11
  291. package/dist/config-GCQK6NJY.js +0 -11
  292. package/dist/config-GVH27UPE.js +0 -11
  293. package/dist/config-HXVYIXP5.js +0 -11
  294. package/dist/config-IDZMEW73.js +0 -11
  295. package/dist/config-IJJXGLBQ.js +0 -11
  296. package/dist/config-KJOLGVB2.js +0 -11
  297. package/dist/config-KMVCVBYN.js +0 -15
  298. package/dist/config-KYTRXAB2.js +0 -15
  299. package/dist/config-OT2TQQCN.js +0 -11
  300. package/dist/config-QWCY3LBQ.js +0 -11
  301. package/dist/config-ZV6G2ZEC.js +0 -11
  302. package/dist/databricks_volume-7XOUYSTY.js +0 -7
  303. package/dist/digitalocean-3CQ4CPPZ.js +0 -10
  304. package/dist/discord-BG7OSRJG.js +0 -8
  305. package/dist/disk-XVLBCVKE.js +0 -8
  306. package/dist/dropbox-74GYLV3R.js +0 -8
  307. package/dist/email-5IZ7OBQ4.js +0 -8
  308. package/dist/gcs-EMEYU2XT.js +0 -10
  309. package/dist/gdocs-R67TDPON.js +0 -8
  310. package/dist/gdrive-PRN2ALRK.js +0 -8
  311. package/dist/github-DV7E6OFV.js +0 -8
  312. package/dist/github_ci-Q554V5PA.js +0 -8
  313. package/dist/gmail-OLN2LT4O.js +0 -8
  314. package/dist/gsheets-H4RYMQJ5.js +0 -8
  315. package/dist/gslides-YLCHKJOM.js +0 -8
  316. package/dist/hf_buckets-DTKXKKFF.js +0 -10
  317. package/dist/hf_datasets-55C4APKR.js +0 -10
  318. package/dist/hf_models-RO5JR36V.js +0 -10
  319. package/dist/hf_spaces-ZVZ3EDRX.js +0 -10
  320. package/dist/langfuse-ACASJZ7O.js +0 -8
  321. package/dist/linear-IC37LZV7.js +0 -8
  322. package/dist/minio-HZ576XFQ.js +0 -10
  323. package/dist/mongodb-JVR62OIO.js +0 -7
  324. package/dist/notion-HKRPQMJS.js +0 -8
  325. package/dist/oci-ZLVECXTW.js +0 -10
  326. package/dist/postgres-P36Z2YN4.js +0 -7
  327. package/dist/qingstor-YLP6K3L4.js +0 -10
  328. package/dist/r2-RPK25ANI.js +0 -10
  329. package/dist/redis-V5ULXULL.js +0 -8
  330. package/dist/s3-4OIOCAAT.js +0 -8
  331. package/dist/scaleway-CCWCLUHB.js +0 -10
  332. package/dist/seaweedfs-QSWKF2FN.js +0 -10
  333. package/dist/slack-YPS7PII3.js +0 -8
  334. package/dist/ssh-YFP3SMTJ.js +0 -9
  335. package/dist/supabase-6CFTOKGZ.js +0 -10
  336. package/dist/tencent-IWZZOSQ4.js +0 -10
  337. package/dist/trello-XYKWZD6P.js +0 -8
  338. package/dist/wasabi-6Z4DC5S5.js +0 -10
  339. /package/dist/{aliyun-JMJ3PFYY.js.map → aliyun-PGI57A43.js.map} +0 -0
  340. /package/dist/{backblaze-TDFD23QO.js.map → backblaze-TSPL6Y56.js.map} +0 -0
  341. /package/dist/{box-GQ2U2R6R.js.map → box-7XTZYDSO.js.map} +0 -0
  342. /package/dist/{ceph-S2VOYO6G.js.map → ceph-C265UI5T.js.map} +0 -0
  343. /package/dist/{chunk-I5THIMPP.js.map → chunk-25W4XQJZ.js.map} +0 -0
  344. /package/dist/{chunk-HJJMP6IX.js.map → chunk-4M73WHIE.js.map} +0 -0
  345. /package/dist/{chunk-7CW3BMPH.js.map → chunk-4X6CLF4F.js.map} +0 -0
  346. /package/dist/{chunk-QQBJC2FQ.js.map → chunk-5I7Q7RHW.js.map} +0 -0
  347. /package/dist/{chunk-X5HF2OFP.js.map → chunk-BWWU5T2D.js.map} +0 -0
  348. /package/dist/{chunk-KPULTUOK.js.map → chunk-CXQGMFI7.js.map} +0 -0
  349. /package/dist/{chunk-N5FSLVKO.js.map → chunk-DXU7NZPH.js.map} +0 -0
  350. /package/dist/{chunk-YAHRT6MB.js.map → chunk-EGZNOUMH.js.map} +0 -0
  351. /package/dist/{chunk-HGCRXJGP.js.map → chunk-F5NWRF32.js.map} +0 -0
  352. /package/dist/{chunk-3WIO7NBR.js.map → chunk-L4GMDSMB.js.map} +0 -0
  353. /package/dist/{chunk-47AVIIOT.js.map → chunk-L7FEZ7LU.js.map} +0 -0
  354. /package/dist/{chunk-AUHSTJJ3.js.map → chunk-NLXJMXVE.js.map} +0 -0
  355. /package/dist/{chunk-X3G37FXT.js.map → chunk-SYMNWNC3.js.map} +0 -0
  356. /package/dist/{chunk-DM4GSE26.js.map → chunk-TUNR4VUM.js.map} +0 -0
  357. /package/dist/{chunk-UINQOUZR.js.map → chunk-V7JVMG63.js.map} +0 -0
  358. /package/dist/{chunk-IK2L4EN3.js.map → chunk-XADEMW6B.js.map} +0 -0
  359. /package/dist/{chunk-FQ33BYFR.js.map → chunk-XEMLYWHK.js.map} +0 -0
  360. /package/dist/{chunk-ZGSER5TG.js.map → chunk-ZM44MGC5.js.map} +0 -0
  361. /package/dist/{config-34LHOGLM.js.map → config-2LASFFRD.js.map} +0 -0
  362. /package/dist/{config-3BBWD5AB.js.map → config-3WDIJPTG.js.map} +0 -0
  363. /package/dist/{config-3IVQJBNW.js.map → config-4QV4QYI5.js.map} +0 -0
  364. /package/dist/{config-4UDVSUQJ.js.map → config-54USUVSE.js.map} +0 -0
  365. /package/dist/{config-CMDBAPDH.js.map → config-5ZXN2T2H.js.map} +0 -0
  366. /package/dist/{config-CVZ2AGCO.js.map → config-A2GQYJDB.js.map} +0 -0
  367. /package/dist/{config-D3RLSPNF.js.map → config-BBOLI7VE.js.map} +0 -0
  368. /package/dist/{config-DG65OEG3.js.map → config-BIBFLUIR.js.map} +0 -0
  369. /package/dist/{config-EIHSP5DZ.js.map → config-CPYFOUQO.js.map} +0 -0
  370. /package/dist/{config-EO23EY62.js.map → config-DWSJL3NH.js.map} +0 -0
  371. /package/dist/{config-GCQK6NJY.js.map → config-E22XAGYN.js.map} +0 -0
  372. /package/dist/{config-GE4W4ZJC.js.map → config-EHE52ZTK.js.map} +0 -0
  373. /package/dist/{config-GHRUKEQ6.js.map → config-EX3ZJTZI.js.map} +0 -0
  374. /package/dist/{config-GVH27UPE.js.map → config-FRK7ZL37.js.map} +0 -0
  375. /package/dist/{config-HKRMKD76.js.map → config-HQXNFQZS.js.map} +0 -0
  376. /package/dist/{config-HXVYIXP5.js.map → config-HTXOOAOD.js.map} +0 -0
  377. /package/dist/{config-IDZMEW73.js.map → config-IPNWAJHH.js.map} +0 -0
  378. /package/dist/{config-IJJXGLBQ.js.map → config-J2C53GOT.js.map} +0 -0
  379. /package/dist/{config-IVY5EQQ2.js.map → config-K63RX6EU.js.map} +0 -0
  380. /package/dist/{config-KJOLGVB2.js.map → config-L7SBSH5L.js.map} +0 -0
  381. /package/dist/{config-KMVCVBYN.js.map → config-LEALEMKA.js.map} +0 -0
  382. /package/dist/{config-KYTRXAB2.js.map → config-M3Z47VYU.js.map} +0 -0
  383. /package/dist/{config-LHFFXVYI.js.map → config-MZM3IPFM.js.map} +0 -0
  384. /package/dist/{config-NV5WXP64.js.map → config-OJ2BPESH.js.map} +0 -0
  385. /package/dist/{config-OT2TQQCN.js.map → config-QO2XUME4.js.map} +0 -0
  386. /package/dist/{config-Q45Y46YT.js.map → config-QWQGOXQ5.js.map} +0 -0
  387. /package/dist/{config-QAA646XB.js.map → config-RI7IEZUF.js.map} +0 -0
  388. /package/dist/{config-QNMKWJ4M.js.map → config-SPW6NESU.js.map} +0 -0
  389. /package/dist/{config-QWCY3LBQ.js.map → config-T2IUIU5C.js.map} +0 -0
  390. /package/dist/{config-VM526IKB.js.map → config-UU27ALAA.js.map} +0 -0
  391. /package/dist/{config-WDAZFXYD.js.map → config-VKKZGC7V.js.map} +0 -0
  392. /package/dist/{config-ZFJYQZCH.js.map → config-W7EVPJNK.js.map} +0 -0
  393. /package/dist/{config-ZV6G2ZEC.js.map → config-WKQ3FGTZ.js.map} +0 -0
  394. /package/dist/{databricks_volume-7XOUYSTY.js.map → config-WVILHDFV.js.map} +0 -0
  395. /package/dist/{digitalocean-3CQ4CPPZ.js.map → config-XU6D5C7E.js.map} +0 -0
  396. /package/dist/{discord-BG7OSRJG.js.map → databricks_volume-ETRDJVVQ.js.map} +0 -0
  397. /package/dist/{disk-XVLBCVKE.js.map → digitalocean-QP72DR4J.js.map} +0 -0
  398. /package/dist/{dropbox-74GYLV3R.js.map → discord-BSN5RB3E.js.map} +0 -0
  399. /package/dist/{email-5IZ7OBQ4.js.map → disk-24NWTN2I.js.map} +0 -0
  400. /package/dist/{gcs-EMEYU2XT.js.map → dropbox-OSTZXSIE.js.map} +0 -0
  401. /package/dist/{gdocs-R67TDPON.js.map → email-4ZFPSWIN.js.map} +0 -0
  402. /package/dist/{gdrive-PRN2ALRK.js.map → gcs-PFWR6MIW.js.map} +0 -0
  403. /package/dist/{github-DV7E6OFV.js.map → gdocs-GPAZRQG5.js.map} +0 -0
  404. /package/dist/{github_ci-Q554V5PA.js.map → gdrive-XSX6A7B3.js.map} +0 -0
  405. /package/dist/{gmail-OLN2LT4O.js.map → github-EQ4NXUTA.js.map} +0 -0
  406. /package/dist/{gsheets-H4RYMQJ5.js.map → github_ci-QL5B2Q2N.js.map} +0 -0
  407. /package/dist/{gslides-YLCHKJOM.js.map → gmail-2TBT4CVH.js.map} +0 -0
  408. /package/dist/{hf_buckets-DTKXKKFF.js.map → gridfs-KZRZ6SIB.js.map} +0 -0
  409. /package/dist/{hf_datasets-55C4APKR.js.map → gsheets-N53WEXN2.js.map} +0 -0
  410. /package/dist/{hf_models-RO5JR36V.js.map → gslides-TATSARTH.js.map} +0 -0
  411. /package/dist/{hf_spaces-ZVZ3EDRX.js.map → hf_buckets-BK7NGJWS.js.map} +0 -0
  412. /package/dist/{langfuse-ACASJZ7O.js.map → hf_datasets-UQ5QGM4L.js.map} +0 -0
  413. /package/dist/{linear-IC37LZV7.js.map → hf_models-75LFCQCS.js.map} +0 -0
  414. /package/dist/{minio-HZ576XFQ.js.map → hf_spaces-6T2KB3UC.js.map} +0 -0
  415. /package/dist/{mongodb-JVR62OIO.js.map → langfuse-AMQCQWNE.js.map} +0 -0
  416. /package/dist/{notion-HKRPQMJS.js.map → linear-V3TXO6CV.js.map} +0 -0
  417. /package/dist/{oci-ZLVECXTW.js.map → minio-IZRZY4C5.js.map} +0 -0
  418. /package/dist/{postgres-P36Z2YN4.js.map → mongodb-VMKPQCPX.js.map} +0 -0
  419. /package/dist/{qingstor-YLP6K3L4.js.map → nextcloud-5RHQCGDO.js.map} +0 -0
  420. /package/dist/{r2-RPK25ANI.js.map → notion-6PPNTQFM.js.map} +0 -0
  421. /package/dist/{redis-V5ULXULL.js.map → oci-CKYBSFZJ.js.map} +0 -0
  422. /package/dist/{s3-4OIOCAAT.js.map → postgres-WIQBVL5M.js.map} +0 -0
  423. /package/dist/{scaleway-CCWCLUHB.js.map → qingstor-AP4IIPLY.js.map} +0 -0
  424. /package/dist/{seaweedfs-QSWKF2FN.js.map → r2-C4XGEWQY.js.map} +0 -0
  425. /package/dist/{slack-YPS7PII3.js.map → redis-6D55Q2WB.js.map} +0 -0
  426. /package/dist/{ssh-YFP3SMTJ.js.map → s3-XQBI2CXN.js.map} +0 -0
  427. /package/dist/{supabase-6CFTOKGZ.js.map → scaleway-SEZJVURB.js.map} +0 -0
  428. /package/dist/{tencent-IWZZOSQ4.js.map → seaweedfs-3XYIAFU2.js.map} +0 -0
  429. /package/dist/{trello-XYKWZD6P.js.map → slack-ZHXDJQY4.js.map} +0 -0
  430. /package/dist/{wasabi-6Z4DC5S5.js.map → ssh-X2MO7JOV.js.map} +0 -0
@@ -1,12 +1,15 @@
1
1
  import {
2
2
  redactEmailConfig
3
- } from "./chunk-B2ZOKNN4.js";
3
+ } from "./chunk-CQCTCW4S.js";
4
4
 
5
5
  // src/resource/email/email.ts
6
6
  import {
7
7
  BaseResource,
8
- PathSpec as PathSpec4,
9
- ResourceName as ResourceName25
8
+ PathSpec as PathSpec3,
9
+ ResourceName as ResourceName11,
10
+ makeResolveGlob,
11
+ mountKey as mountKey4,
12
+ mountPrefixOf as mountPrefixOf7
10
13
  } from "@struktoai/mirage-core";
11
14
 
12
15
  // src/accessor/email.ts
@@ -52,28 +55,32 @@ var EmailAccessor = class extends Accessor {
52
55
  }
53
56
  };
54
57
 
55
- // src/commands/builtin/email/basename.ts
56
- import { ResourceName, command, specOf, basenameFn } from "@struktoai/mirage-core";
57
- var EMAIL_BASENAME = command({
58
- name: "basename",
59
- resource: ResourceName.EMAIL,
60
- spec: specOf("basename"),
61
- fn: basenameFn
62
- });
58
+ // src/commands/builtin/email/index.ts
59
+ import { ResourceName as ResourceName9, makeGenericCommands } from "@struktoai/mirage-core";
63
60
 
64
- // src/commands/builtin/email/cat.ts
61
+ // src/commands/builtin/email/find.ts
65
62
  import {
66
- ResourceName as ResourceName2,
67
- catGeneric,
68
- command as command2,
69
- specOf as specOf2
63
+ FileType as FileType2,
64
+ IOResult,
65
+ PathSpec as PathSpec2,
66
+ ResourceName,
67
+ command,
68
+ formatRecords,
69
+ mountKey as mountKey3,
70
+ mountPrefixOf as mountPrefixOf4,
71
+ resolveGlobOf,
72
+ rstripSlash,
73
+ specOf,
74
+ stripSlash as stripSlash2
70
75
  } from "@struktoai/mirage-core";
71
76
 
72
- // src/core/email/glob.ts
73
- import { PathSpec as PathSpecCtor2, rstripSlash } from "@struktoai/mirage-core";
74
-
75
77
  // src/core/email/readdir.ts
76
- import { IndexEntry, PathSpec as PathSpecCtor, stripSlash } from "@struktoai/mirage-core";
78
+ import {
79
+ IndexEntry,
80
+ PathSpec as PathSpecCtor,
81
+ mountKey,
82
+ mountPrefixOf
83
+ } from "@struktoai/mirage-core";
77
84
 
78
85
  // src/core/email/_parse.ts
79
86
  import { loadOptionalPeer as loadOptionalPeer2 } from "@struktoai/mirage-core";
@@ -97,6 +104,12 @@ function toAddrList(list) {
97
104
  const objs = Array.isArray(list) ? list : [list];
98
105
  return objs.flatMap((obj) => obj.value.map((a) => toAddr(a)));
99
106
  }
107
+ function rawDateHeader(parsed) {
108
+ const found = parsed.headerLines.find((h) => h.key === "date");
109
+ if (found === void 0) return "";
110
+ const colon = found.line.indexOf(":");
111
+ return colon === -1 ? "" : found.line.slice(colon + 1).trim();
112
+ }
100
113
  function fromParsed(parsed, headersOnly) {
101
114
  const text = headersOnly ? "" : parsed.text ?? "";
102
115
  const html = headersOnly ? "" : typeof parsed.html === "string" ? parsed.html : "";
@@ -112,7 +125,7 @@ function fromParsed(parsed, headersOnly) {
112
125
  to: toAddrList(parsed.to),
113
126
  cc: toAddrList(parsed.cc),
114
127
  subject: parsed.subject ?? "",
115
- date: parsed.date instanceof Date ? parsed.date.toUTCString() : "",
128
+ date: rawDateHeader(parsed),
116
129
  body_text: text,
117
130
  body_html: html,
118
131
  snippet: text.slice(0, 100),
@@ -267,10 +280,10 @@ async function fetchHeaders(accessor, folder, uids) {
267
280
  try {
268
281
  const results = [];
269
282
  for (const uid of uids) {
270
- const msg = await imap.fetchOne(uid, { headers: true, flags: true, uid: true }, { uid: true });
283
+ const msg = await imap.fetchOne(uid, { source: true, flags: true, uid: true }, { uid: true });
271
284
  if (msg === false) continue;
272
- const headers = msg.headers instanceof Buffer ? new Uint8Array(msg.headers) : new Uint8Array(0);
273
- const parsed = await parseRfc822(headers, true);
285
+ const source = msg.source instanceof Buffer ? new Uint8Array(msg.source) : new Uint8Array(0);
286
+ const parsed = await parseRfc822(source);
274
287
  results.push({
275
288
  ...parsed,
276
289
  uid,
@@ -333,11 +346,8 @@ function enoent(p) {
333
346
  return e;
334
347
  }
335
348
  async function readdir(accessor, path, index) {
336
- const prefix = path.prefix;
337
- const raw = path.pattern !== null ? path.directory : path.original;
338
- let p = raw;
339
- if (prefix !== "" && p.startsWith(prefix)) p = p.slice(prefix.length) || "/";
340
- const key = stripSlash(p);
349
+ const prefix = mountPrefixOf(path.virtual, path.resourcePath);
350
+ const key = (path.pattern !== null ? path.dir : path).resourcePath;
341
351
  const virtualKey = key !== "" ? `${prefix}/${key}` : prefix !== "" ? prefix : "/";
342
352
  const parts = key === "" ? [] : key.split("/");
343
353
  const depth = parts.length;
@@ -366,7 +376,7 @@ async function readdir(accessor, path, index) {
366
376
  const cached = await index.listDir(virtualKey);
367
377
  if (cached.entries !== void 0 && cached.entries !== null) return cached.entries;
368
378
  }
369
- if (index === void 0) throw enoent(path.original);
379
+ if (index === void 0) throw enoent(path.virtual);
370
380
  const maxMessages = accessor.config.maxMessages;
371
381
  const uids = await listMessageUids(accessor, folderName, "ALL", maxMessages);
372
382
  const headersList = await fetchHeaders(accessor, folderName, uids);
@@ -434,96 +444,25 @@ async function readdir(accessor, path, index) {
434
444
  return dateEntries.map(([name]) => `${prefix}/${key}/${name}`);
435
445
  }
436
446
  if (depth === 2 || depth === 3) {
437
- if (index === void 0) throw enoent(path.original);
447
+ if (index === void 0) throw enoent(path.virtual);
438
448
  let cached = await index.listDir(virtualKey);
439
449
  if (cached.entries !== void 0 && cached.entries !== null) return cached.entries;
440
450
  const folderPath = prefix !== "" ? `${prefix}/${parts[0] ?? ""}` : `/${parts[0] ?? ""}`;
441
- const folderSpec = new PathSpecCtor({ original: folderPath, directory: folderPath, prefix });
451
+ const folderSpec = new PathSpecCtor({
452
+ virtual: folderPath,
453
+ directory: folderPath,
454
+ resourcePath: mountKey(folderPath, prefix)
455
+ });
442
456
  await readdir(accessor, folderSpec, index);
443
457
  cached = await index.listDir(virtualKey);
444
458
  if (cached.entries !== void 0 && cached.entries !== null) return cached.entries;
445
- throw enoent(path.original);
459
+ throw enoent(path.virtual);
446
460
  }
447
- throw enoent(path.original);
448
- }
449
-
450
- // src/core/email/glob.ts
451
- import { fnmatch } from "@struktoai/mirage-core";
452
- var SCOPE_ERROR = 1e3;
453
- async function resolveGlob(accessor, paths, index) {
454
- const result = [];
455
- for (const p of paths) {
456
- if (p.resolved) {
457
- result.push(p);
458
- continue;
459
- }
460
- if (p.pattern !== null && p.pattern !== "") {
461
- const entries = await readdir(accessor, p, index);
462
- const matched = [];
463
- for (const entry of entries) {
464
- const trimmed = rstripSlash(entry);
465
- const base = trimmed.split("/").pop() ?? trimmed;
466
- if (!fnmatch(base, p.pattern)) continue;
467
- matched.push(PathSpecCtor2.fromStrPath(trimmed, p.prefix));
468
- }
469
- const truncated = matched.length > SCOPE_ERROR ? matched.slice(0, SCOPE_ERROR) : matched;
470
- result.push(...truncated);
471
- } else {
472
- result.push(p);
473
- }
474
- }
475
- return result;
476
- }
477
-
478
- // src/core/email/read.ts
479
- import { gnuDirname, stripSlash as stripSlash2 } from "@struktoai/mirage-core";
480
- var ENC = new TextEncoder();
481
- function enoent2(p) {
482
- const e = new Error(`ENOENT: ${p}`);
483
- e.code = "ENOENT";
484
- return e;
485
- }
486
- function eisdir(p) {
487
- const e = new Error(`EISDIR: ${p}`);
488
- e.code = "EISDIR";
489
- return e;
490
- }
491
- async function read(accessor, path, index) {
492
- const prefix = path.prefix;
493
- let p = path.original;
494
- if (prefix !== "" && p.startsWith(prefix)) p = p.slice(prefix.length) || "/";
495
- const key = stripSlash2(p);
496
- if (index === void 0) throw enoent2(path.original);
497
- const virtualKey = prefix !== "" ? `${prefix}/${key}` : `/${key}`;
498
- const result = await index.get(virtualKey);
499
- if (result.entry === void 0 || result.entry === null) throw enoent2(path.original);
500
- const rt = result.entry.resourceType;
501
- if (rt === "email/folder" || rt === "email/date" || rt === "email/attachment_dir") {
502
- throw eisdir(path.original);
503
- }
504
- if (rt === "email/attachment") {
505
- const parentKey = gnuDirname(virtualKey);
506
- const parentResult = await index.get(parentKey);
507
- if (parentResult.entry === void 0 || parentResult.entry === null) {
508
- throw enoent2(path.original);
509
- }
510
- const uid2 = parentResult.entry.id;
511
- const parts2 = stripSlash2(virtualKey).split("/");
512
- const folder2 = prefix !== "" ? parts2[1] ?? "" : parts2[0] ?? "";
513
- const filename = result.entry.vfsName !== "" ? result.entry.vfsName : result.entry.name;
514
- const data = await fetchAttachment(accessor, folder2, uid2, filename);
515
- if (data === null) throw enoent2(path.original);
516
- return data;
517
- }
518
- const parts = stripSlash2(virtualKey).split("/");
519
- const folder = prefix !== "" ? parts[1] ?? "" : parts[0] ?? "";
520
- const uid = result.entry.id;
521
- const msg = await fetchMessage(accessor, folder, uid);
522
- return ENC.encode(JSON.stringify(msg));
461
+ throw enoent(path.virtual);
523
462
  }
524
463
 
525
464
  // src/core/email/stat.ts
526
- import { FileStat, FileType, stripSlash as stripSlash3 } from "@struktoai/mirage-core";
465
+ import { FileStat, FileType, PathSpec, mountKey as mountKey2, mountPrefixOf as mountPrefixOf2 } from "@struktoai/mirage-core";
527
466
  function guessType(name) {
528
467
  const lower = name.toLowerCase();
529
468
  if (lower.endsWith(".json") || lower.endsWith(".email.json")) return FileType.JSON;
@@ -539,27 +478,41 @@ function guessType(name) {
539
478
  }
540
479
  return FileType.BINARY;
541
480
  }
542
- function enoent3(p) {
481
+ function enoent2(p) {
543
482
  const e = new Error(`ENOENT: ${p}`);
544
483
  e.code = "ENOENT";
545
484
  return e;
546
485
  }
547
486
  async function stat(accessor, path, index) {
548
- const prefix = path.prefix;
549
- let p = path.original;
550
- if (prefix !== "" && p.startsWith(prefix)) p = p.slice(prefix.length) || "/";
551
- const key = stripSlash3(p);
487
+ const prefix = mountPrefixOf2(path.virtual, path.resourcePath);
488
+ const key = path.resourcePath;
552
489
  if (key === "") return new FileStat({ name: "/", type: FileType.DIRECTORY });
553
- if (index === void 0) throw enoent3(path.original);
490
+ if (index === void 0) throw enoent2(path.virtual);
554
491
  const virtualKey = prefix !== "" ? `${prefix}/${key}` : `/${key}`;
555
- const result = await index.get(virtualKey);
492
+ let result = await index.get(virtualKey);
556
493
  if (result.entry === void 0 || result.entry === null) {
557
494
  if (!key.includes("/")) {
558
495
  const folders = await listFolders2(accessor);
559
496
  if (folders.includes(key)) return new FileStat({ name: key, type: FileType.DIRECTORY });
560
- throw enoent3(path.original);
497
+ throw enoent2(path.virtual);
498
+ }
499
+ const parentVirtual = virtualKey.slice(0, virtualKey.lastIndexOf("/")) || "/";
500
+ try {
501
+ await readdir(
502
+ accessor,
503
+ new PathSpec({
504
+ virtual: parentVirtual,
505
+ directory: parentVirtual,
506
+ resolved: false,
507
+ resourcePath: mountKey2(parentVirtual, prefix)
508
+ }),
509
+ index
510
+ );
511
+ } catch {
512
+ throw enoent2(path.virtual);
561
513
  }
562
- throw enoent3(path.original);
514
+ result = await index.get(virtualKey);
515
+ if (result.entry === void 0 || result.entry === null) throw enoent2(path.virtual);
563
516
  }
564
517
  const rt = result.entry.resourceType;
565
518
  const vfsName = result.entry.vfsName !== "" ? result.entry.vfsName : result.entry.name;
@@ -591,6 +544,64 @@ async function stat(accessor, path, index) {
591
544
  return new FileStat({ name: vfsName, type: FileType.JSON, extra: { uid: result.entry.id } });
592
545
  }
593
546
 
547
+ // src/core/email/read.ts
548
+ import { gnuDirname, mountPrefixOf as mountPrefixOf3, stripSlash } from "@struktoai/mirage-core";
549
+ var ENC = new TextEncoder();
550
+ function enoent3(p) {
551
+ const e = new Error(`ENOENT: ${p}`);
552
+ e.code = "ENOENT";
553
+ return e;
554
+ }
555
+ function eisdir(p) {
556
+ const e = new Error(`EISDIR: ${p}`);
557
+ e.code = "EISDIR";
558
+ return e;
559
+ }
560
+ async function read(accessor, path, index) {
561
+ const prefix = mountPrefixOf3(path.virtual, path.resourcePath);
562
+ const key = path.resourcePath;
563
+ if (index === void 0) throw enoent3(path.virtual);
564
+ const virtualKey = prefix !== "" ? `${prefix}/${key}` : `/${key}`;
565
+ const result = await index.get(virtualKey);
566
+ if (result.entry === void 0 || result.entry === null) throw enoent3(path.virtual);
567
+ const rt = result.entry.resourceType;
568
+ if (rt === "email/folder" || rt === "email/date" || rt === "email/attachment_dir") {
569
+ throw eisdir(path.virtual);
570
+ }
571
+ if (rt === "email/attachment") {
572
+ const parentKey = gnuDirname(virtualKey);
573
+ const parentResult = await index.get(parentKey);
574
+ if (parentResult.entry === void 0 || parentResult.entry === null) {
575
+ throw enoent3(path.virtual);
576
+ }
577
+ const uid2 = parentResult.entry.id;
578
+ const parts2 = stripSlash(virtualKey).split("/");
579
+ const folder2 = prefix !== "" ? parts2[1] ?? "" : parts2[0] ?? "";
580
+ const filename = result.entry.vfsName !== "" ? result.entry.vfsName : result.entry.name;
581
+ const data = await fetchAttachment(accessor, folder2, uid2, filename);
582
+ if (data === null) throw enoent3(path.virtual);
583
+ return data;
584
+ }
585
+ const parts = stripSlash(virtualKey).split("/");
586
+ const folder = prefix !== "" ? parts[1] ?? "" : parts[0] ?? "";
587
+ const uid = result.entry.id;
588
+ const msg = await fetchMessage(accessor, folder, uid);
589
+ return ENC.encode(JSON.stringify(msg));
590
+ }
591
+
592
+ // src/commands/builtin/email/io.ts
593
+ async function* emailReadStream(accessor, path, index) {
594
+ yield await read(accessor, path, index);
595
+ }
596
+ var EMAIL_IO = {
597
+ readdir,
598
+ readBytes: read,
599
+ readStream: emailReadStream,
600
+ stat,
601
+ isMounted: () => true,
602
+ local: false
603
+ };
604
+
594
605
  // src/commands/builtin/email/provision.ts
595
606
  import {
596
607
  Precision,
@@ -602,7 +613,7 @@ async function fileReadProvision(_accessor, paths, _texts, opts) {
602
613
  let ops = 0;
603
614
  if (index !== void 0) {
604
615
  for (const p of paths) {
605
- const lookup = await index.get(p.original);
616
+ const lookup = await index.get(p.virtual);
606
617
  if (lookup.entry !== void 0 && lookup.entry !== null) ops += 1;
607
618
  }
608
619
  }
@@ -622,50 +633,10 @@ function metadataProvision(_accessor, _paths, _texts, _opts) {
622
633
  });
623
634
  }
624
635
 
625
- // src/commands/builtin/email/cat.ts
626
- async function* emailStream(accessor, p, index) {
627
- yield await read(accessor, p, index);
628
- }
629
- async function catCommand(accessor, paths, texts, opts) {
630
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
631
- return catGeneric(
632
- resolved,
633
- texts,
634
- opts,
635
- (p) => stat(accessor, p, opts.index ?? void 0),
636
- (p) => emailStream(accessor, p, opts.index ?? void 0)
637
- );
638
- }
639
- var EMAIL_CAT = command2({
640
- name: "cat",
641
- resource: ResourceName2.EMAIL,
642
- spec: specOf2("cat"),
643
- fn: catCommand,
644
- provision: fileReadProvision
645
- });
646
-
647
- // src/commands/builtin/email/dirname.ts
648
- import { ResourceName as ResourceName3, command as command3, specOf as specOf3, dirnameFn } from "@struktoai/mirage-core";
649
- var EMAIL_DIRNAME = command3({
650
- name: "dirname",
651
- resource: ResourceName3.EMAIL,
652
- spec: specOf3("dirname"),
653
- fn: dirnameFn
654
- });
655
-
656
636
  // src/commands/builtin/email/find.ts
657
- import {
658
- IOResult,
659
- PathSpec,
660
- ResourceName as ResourceName4,
661
- command as command4,
662
- specOf as specOf4,
663
- rstripSlash as rstripSlash2,
664
- stripSlash as stripSlash4,
665
- formatRecords
666
- } from "@struktoai/mirage-core";
667
- import { fnmatch as fnmatch2 } from "@struktoai/mirage-core";
637
+ import { fnmatch } from "@struktoai/mirage-core";
668
638
  import { findSizeMtimeError, invalidFindArg } from "@struktoai/mirage-core";
639
+ var resolveGlob = resolveGlobOf(EMAIL_IO);
669
640
  async function walk(accessor, path, index, maxDepth, depth) {
670
641
  if (maxDepth !== null && depth > maxDepth) return [];
671
642
  let children;
@@ -676,16 +647,21 @@ async function walk(accessor, path, index, maxDepth, depth) {
676
647
  }
677
648
  const results = [];
678
649
  for (const child of children) {
679
- const isFolder = child.endsWith("/");
680
- const trimmed = isFolder ? rstripSlash2(child) : child;
650
+ const trimmed = rstripSlash(child);
681
651
  results.push(trimmed);
682
- if (isFolder) {
683
- const childSpec = new PathSpec({
684
- original: trimmed,
685
- directory: trimmed,
686
- resolved: false,
687
- prefix: path.prefix
688
- });
652
+ const childSpec = new PathSpec2({
653
+ virtual: trimmed,
654
+ directory: trimmed,
655
+ resolved: false,
656
+ resourcePath: mountKey3(trimmed, mountPrefixOf4(path.virtual, path.resourcePath))
657
+ });
658
+ let st;
659
+ try {
660
+ st = await stat(accessor, childSpec, index ?? void 0);
661
+ } catch {
662
+ continue;
663
+ }
664
+ if (st.type === FileType2.DIRECTORY) {
689
665
  const sub = await walk(accessor, childSpec, index, maxDepth, depth + 1);
690
666
  results.push(...sub);
691
667
  }
@@ -694,11 +670,11 @@ async function walk(accessor, path, index, maxDepth, depth) {
694
670
  }
695
671
  async function findCommand(accessor, paths, _texts, opts) {
696
672
  const resolved = await resolveGlob(accessor, paths, opts.index ?? void 0);
697
- const p0 = resolved[0] ?? new PathSpec({
698
- original: "/",
673
+ const p0 = resolved[0] ?? new PathSpec2({
674
+ virtual: "/",
699
675
  directory: "/",
700
676
  resolved: false,
701
- prefix: opts.mountPrefix ?? ""
677
+ resourcePath: ""
702
678
  });
703
679
  const nameFlag = typeof opts.flags.name === "string" ? opts.flags.name : null;
704
680
  const inameFlag = typeof opts.flags.iname === "string" ? opts.flags.iname : null;
@@ -715,26 +691,26 @@ async function findCommand(accessor, paths, _texts, opts) {
715
691
  const sizeMtimeErr = findSizeMtimeError(sizeFlag, mtimeFlag);
716
692
  if (sizeMtimeErr !== null) return sizeMtimeErr;
717
693
  const allPaths = await walk(accessor, p0, opts.index, maxDepth, 0);
718
- const searchKey = stripSlash4(p0.stripPrefix);
694
+ const searchKey = stripSlash2(p0.mountPath);
719
695
  const baseDepth = searchKey === "" ? -1 : searchKey.split("/").length - 1;
720
696
  const results = [];
721
697
  for (const p of [...allPaths].sort()) {
722
- const stripped = p.startsWith(p0.prefix) ? p.slice(p0.prefix.length) : p;
723
- const trimmed = stripSlash4(stripped);
698
+ const stripped = p.startsWith(mountPrefixOf4(p0.virtual, p0.resourcePath)) ? p.slice(mountPrefixOf4(p0.virtual, p0.resourcePath).length) : p;
699
+ const trimmed = stripSlash2(stripped);
724
700
  const depth = trimmed === "" ? -1 : trimmed.split("/").length - (baseDepth + 2);
725
701
  if (minDepth !== null && depth < minDepth) continue;
726
702
  const entryName = p.split("/").pop() ?? p;
727
- if (nameFlag !== null && !fnmatch2(entryName, nameFlag)) continue;
728
- if (inameFlag !== null && !fnmatch2(entryName.toLowerCase(), inameFlag.toLowerCase())) continue;
703
+ if (nameFlag !== null && !fnmatch(entryName, nameFlag)) continue;
704
+ if (inameFlag !== null && !fnmatch(entryName.toLowerCase(), inameFlag.toLowerCase())) continue;
729
705
  results.push(p);
730
706
  }
731
707
  const out = formatRecords(results);
732
708
  return [out, new IOResult()];
733
709
  }
734
- var EMAIL_FIND = command4({
710
+ var EMAIL_FIND = command({
735
711
  name: "find",
736
- resource: ResourceName4.EMAIL,
737
- spec: specOf4("find"),
712
+ resource: ResourceName.EMAIL,
713
+ spec: specOf("find"),
738
714
  fn: findCommand,
739
715
  provision: metadataProvision
740
716
  });
@@ -745,8 +721,8 @@ import {
745
721
  IOResult as IOResult2,
746
722
  OperandKind,
747
723
  Option,
748
- ResourceName as ResourceName5,
749
- command as command5
724
+ ResourceName as ResourceName2,
725
+ command as command2
750
726
  } from "@struktoai/mirage-core";
751
727
 
752
728
  // src/core/email/send.ts
@@ -849,9 +825,9 @@ async function emailForwardCommand(accessor, _paths, _texts, opts) {
849
825
  const out = ENC2.encode(JSON.stringify(result));
850
826
  return [out, new IOResult2()];
851
827
  }
852
- var EMAIL_FORWARD = command5({
853
- name: "email-forward",
854
- resource: ResourceName5.EMAIL,
828
+ var EMAIL_FORWARD = command2({
829
+ name: "himalaya message forward",
830
+ resource: ResourceName2.EMAIL,
855
831
  spec: SPEC,
856
832
  fn: emailForwardCommand,
857
833
  write: true
@@ -860,26 +836,21 @@ var EMAIL_FORWARD = command5({
860
836
  // src/commands/builtin/email/grep.ts
861
837
  import {
862
838
  IOResult as IOResult3,
863
- PathSpec as PathSpec2,
864
- ResourceName as ResourceName6,
865
- command as command6,
839
+ ResourceName as ResourceName3,
840
+ command as command3,
866
841
  compilePattern,
867
- exitOnEmpty,
868
- grepFilesOnly,
842
+ grepGeneric,
869
843
  grepLines,
870
- grepStream,
844
+ mountPrefixOf as mountPrefixOf5,
871
845
  prefixAggregate,
872
- quietMatch,
873
- resolveSource,
874
- specOf as specOf5,
875
- yieldBytes,
876
- formatRecords as formatRecords2
846
+ resolveGlobOf as resolveGlobOf2,
847
+ specOf as specOf2
877
848
  } from "@struktoai/mirage-core";
878
849
 
879
850
  // src/core/email/scope.ts
880
- import { stripSlash as stripSlash5 } from "@struktoai/mirage-core";
851
+ import { stripSlash as stripSlash3 } from "@struktoai/mirage-core";
881
852
  function detectScope(path) {
882
- const key = stripSlash5(path.stripPrefix);
853
+ const key = stripSlash3(path.mountPath);
883
854
  if (key === "") {
884
855
  return { useNative: false, folder: null, resourcePath: "/" };
885
856
  }
@@ -964,8 +935,11 @@ async function searchAndFormat(accessor, scope, pattern, prefix, maxResults = nu
964
935
  }
965
936
 
966
937
  // src/commands/builtin/email/grep.ts
938
+ var resolveGlob2 = resolveGlobOf2(EMAIL_IO);
967
939
  var ENC3 = new TextEncoder();
968
- var DEC = new TextDecoder("utf-8", { fatal: false });
940
+ async function* emailStream(accessor, p, index) {
941
+ yield await read(accessor, p, index);
942
+ }
969
943
  function parseFlags(flags) {
970
944
  const toInt = (v) => typeof v === "string" ? Number.parseInt(v, 10) : null;
971
945
  const aCtx = toInt(flags.A);
@@ -991,10 +965,6 @@ function getPattern(texts, flags) {
991
965
  if (texts.length > 0 && texts[0] !== void 0) return texts[0];
992
966
  throw new Error("grep: usage: grep [flags] pattern [path]");
993
967
  }
994
- function splitLinesNoTrailing(text) {
995
- const stripped = text.endsWith("\n") ? text.slice(0, -1) : text;
996
- return stripped === "" ? [] : stripped.split("\n");
997
- }
998
968
  async function grepCommand(accessor, paths, texts, opts) {
999
969
  let pattern;
1000
970
  try {
@@ -1005,14 +975,13 @@ async function grepCommand(accessor, paths, texts, opts) {
1005
975
  `) })];
1006
976
  }
1007
977
  const f = parseFlags(opts.flags);
1008
- const recursive = opts.flags.r === true || opts.flags.R === true;
1009
978
  if (paths.length > 0) {
1010
979
  const first = paths[0];
1011
980
  if (first !== void 0) {
1012
981
  const scope = detectScope(first);
1013
- if (scope.useNative) {
1014
- const filePrefix2 = first.prefix !== "" ? first.prefix : "";
1015
- const pairs = await searchAndFormat(accessor, scope, pattern, filePrefix2, f.maxCount ?? 50);
982
+ if (scope.useNative && !pattern.includes("\n")) {
983
+ const filePrefix = mountPrefixOf5(first.virtual, first.resourcePath) !== "" ? mountPrefixOf5(first.virtual, first.resourcePath) : "";
984
+ const pairs = await searchAndFormat(accessor, scope, pattern, filePrefix, f.maxCount ?? 50);
1016
985
  const lines = [];
1017
986
  for (const [vfsPath, msgText] of pairs) {
1018
987
  const matched = grepLines(
@@ -1028,225 +997,26 @@ async function grepCommand(accessor, paths, texts, opts) {
1028
997
  return [out, new IOResult3()];
1029
998
  }
1030
999
  }
1031
- const resolved = await resolveGlob(accessor, paths, opts.index ?? void 0);
1032
- if (resolved.length === 0) return [new Uint8Array(0), new IOResult3({ exitCode: 1 })];
1033
- const filePrefix = resolved[0]?.prefix ?? "";
1034
- const readdirFn = async (path) => {
1035
- const spec = new PathSpec2({
1036
- original: path,
1037
- directory: path,
1038
- resolved: false,
1039
- prefix: filePrefix
1040
- });
1041
- return readdir(accessor, spec, opts.index ?? void 0);
1042
- };
1043
- const statFn = async (path) => {
1044
- const spec = new PathSpec2({
1045
- original: path,
1046
- directory: path,
1047
- resolved: false,
1048
- prefix: filePrefix
1049
- });
1050
- return stat(accessor, spec, opts.index ?? void 0);
1051
- };
1052
- const readBytesFn = async (path) => {
1053
- const spec = new PathSpec2({
1054
- original: path,
1055
- directory: path,
1056
- resolved: true,
1057
- prefix: filePrefix
1058
- });
1059
- return read(accessor, spec, opts.index ?? void 0);
1060
- };
1061
- if (f.filesOnly) {
1062
- const warnings = [];
1063
- const firstResolved2 = resolved[0];
1064
- if (firstResolved2 === void 0) return [new Uint8Array(0), new IOResult3({ exitCode: 1 })];
1065
- const results = await grepFilesOnly(
1066
- readdirFn,
1067
- statFn,
1068
- readBytesFn,
1069
- firstResolved2.original,
1070
- pattern,
1071
- {
1072
- recursive,
1073
- ignoreCase: f.ignoreCase,
1074
- invert: f.invert,
1075
- lineNumbers: f.lineNumbers,
1076
- countOnly: f.countOnly,
1077
- fixedString: f.fixedString,
1078
- onlyMatching: f.onlyMatching,
1079
- maxCount: f.maxCount,
1080
- wholeWord: f.wholeWord
1081
- },
1082
- warnings
1083
- );
1084
- const stderr = warnings.length > 0 ? formatRecords2(warnings) : null;
1085
- if (results.length === 0) return [new Uint8Array(0), new IOResult3({ exitCode: 1, stderr })];
1086
- const out = formatRecords2(results);
1087
- return [out, new IOResult3({ stderr })];
1088
- }
1089
- const pat2 = compilePattern(pattern, f.ignoreCase, f.fixedString, f.wholeWord);
1090
- if (resolved.length > 1) {
1091
- const allResults = [];
1092
- for (const p of resolved) {
1093
- const data2 = splitLinesNoTrailing(
1094
- DEC.decode(await read(accessor, p, opts.index ?? void 0))
1095
- );
1096
- const hits = grepLines(p.original, data2, pat2, f);
1097
- if (f.countOnly) {
1098
- if (hits.length > 0) allResults.push(`${p.original}:${hits[0] ?? ""}`);
1099
- } else {
1100
- for (const h of hits) allResults.push(`${p.original}:${h}`);
1101
- }
1102
- }
1103
- if (allResults.length === 0) return [new Uint8Array(0), new IOResult3({ exitCode: 1 })];
1104
- const out = formatRecords2(allResults);
1105
- return [out, new IOResult3()];
1106
- }
1107
- const firstResolved = resolved[0];
1108
- if (firstResolved === void 0) return [null, new IOResult3()];
1109
- const data = await read(accessor, firstResolved, opts.index ?? void 0);
1110
- const source2 = yieldBytes(data);
1111
- const stream2 = grepStream(source2, pat2, f);
1112
- if (f.quiet) {
1113
- const io3 = new IOResult3({ exitCode: 1 });
1114
- return [quietMatch(stream2, io3), io3];
1115
- }
1116
- const io2 = new IOResult3();
1117
- return [exitOnEmpty(stream2, io2), io2];
1118
1000
  }
1119
- let source;
1120
- try {
1121
- source = resolveSource(opts.stdin, "grep: usage: grep [flags] pattern [path]");
1122
- } catch (err) {
1123
- const msg = err instanceof Error ? err.message : String(err);
1124
- return [null, new IOResult3({ exitCode: 2, stderr: ENC3.encode(`${msg}
1125
- `) })];
1126
- }
1127
- const pat = compilePattern(pattern, f.ignoreCase, f.fixedString, f.wholeWord);
1128
- const stream = grepStream(source, pat, f);
1129
- if (f.quiet) {
1130
- const io2 = new IOResult3({ exitCode: 1 });
1131
- return [quietMatch(stream, io2), io2];
1132
- }
1133
- const io = new IOResult3();
1134
- return [exitOnEmpty(stream, io), io];
1135
- }
1136
- var EMAIL_GREP = command6({
1137
- name: "grep",
1138
- resource: ResourceName6.EMAIL,
1139
- spec: specOf5("grep"),
1140
- fn: grepCommand,
1141
- aggregate: prefixAggregate,
1142
- provision: fileReadProvision
1143
- });
1144
-
1145
- // src/commands/builtin/email/head.ts
1146
- import {
1147
- ResourceName as ResourceName7,
1148
- command as command7,
1149
- headGeneric,
1150
- specOf as specOf6
1151
- } from "@struktoai/mirage-core";
1152
- async function* emailStream2(accessor, p, index) {
1153
- yield await read(accessor, p, index);
1154
- }
1155
- async function headCommand(accessor, paths, texts, opts) {
1156
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1157
- return headGeneric(
1001
+ const resolved = paths.length > 0 ? await resolveGlob2(accessor, paths, opts.index ?? void 0) : [];
1002
+ const stat2 = (p) => stat(accessor, p, opts.index ?? void 0);
1003
+ const readdir2 = (p) => readdir(accessor, p, opts.index ?? void 0);
1004
+ return grepGeneric(
1005
+ "grep",
1158
1006
  resolved,
1159
1007
  texts,
1160
1008
  opts,
1161
- (p) => stat(accessor, p, opts.index ?? void 0),
1162
- (p) => emailStream2(accessor, p, opts.index ?? void 0)
1163
- );
1164
- }
1165
- var EMAIL_HEAD = command7({
1166
- name: "head",
1167
- resource: ResourceName7.EMAIL,
1168
- spec: specOf6("head"),
1169
- fn: headCommand,
1170
- provision: fileReadProvision
1171
- });
1172
-
1173
- // src/commands/builtin/email/jq.ts
1174
- import {
1175
- ResourceName as ResourceName8,
1176
- command as command8,
1177
- jqGeneric,
1178
- specOf as specOf7
1179
- } from "@struktoai/mirage-core";
1180
- async function* emailStream3(accessor, p, index) {
1181
- yield await read(accessor, p, index);
1182
- }
1183
- async function jqCommand(accessor, paths, texts, opts) {
1184
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1185
- const stream = (p) => emailStream3(accessor, p, opts.index ?? void 0);
1186
- return jqGeneric(resolved, texts, opts, stream);
1187
- }
1188
- var EMAIL_JQ = command8({
1189
- name: "jq",
1190
- resource: ResourceName8.EMAIL,
1191
- spec: specOf7("jq"),
1192
- fn: jqCommand
1193
- });
1194
-
1195
- // src/commands/builtin/email/ls.ts
1196
- import {
1197
- PathSpec as PathSpec3,
1198
- ResourceName as ResourceName9,
1199
- command as command9,
1200
- lsGeneric,
1201
- specOf as specOf8
1202
- } from "@struktoai/mirage-core";
1203
- async function lsCommand(accessor, paths, _texts, opts) {
1204
- let workingPaths = paths;
1205
- if (workingPaths.length === 0) {
1206
- workingPaths = [
1207
- new PathSpec3({
1208
- original: opts.cwd,
1209
- directory: opts.cwd,
1210
- resolved: false,
1211
- prefix: opts.mountPrefix ?? ""
1212
- })
1213
- ];
1214
- }
1215
- const resolved = await resolveGlob(accessor, workingPaths, opts.index ?? void 0);
1216
- return lsGeneric(
1217
- resolved,
1218
- opts,
1219
- (p) => readdir(accessor, p, opts.index ?? void 0),
1220
- (p) => stat(accessor, p, opts.index ?? void 0)
1009
+ stat2,
1010
+ readdir2,
1011
+ (p) => emailStream(accessor, p, opts.index ?? void 0)
1221
1012
  );
1222
1013
  }
1223
- var EMAIL_LS = command9({
1224
- name: "ls",
1225
- resource: ResourceName9.EMAIL,
1226
- spec: specOf8("ls"),
1227
- fn: lsCommand,
1228
- provision: metadataProvision
1229
- });
1230
-
1231
- // src/commands/builtin/email/nl.ts
1232
- import {
1233
- ResourceName as ResourceName10,
1234
- command as command10,
1235
- nlGeneric,
1236
- specOf as specOf9
1237
- } from "@struktoai/mirage-core";
1238
- async function* emailStream4(accessor, p, index) {
1239
- yield await read(accessor, p, index);
1240
- }
1241
- async function nlCommand(accessor, paths, _texts, opts) {
1242
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1243
- return nlGeneric(resolved, opts, (p) => emailStream4(accessor, p, opts.index ?? void 0));
1244
- }
1245
- var EMAIL_NL = command10({
1246
- name: "nl",
1247
- resource: ResourceName10.EMAIL,
1248
- spec: specOf9("nl"),
1249
- fn: nlCommand,
1014
+ var EMAIL_GREP = command3({
1015
+ name: "grep",
1016
+ resource: ResourceName3.EMAIL,
1017
+ spec: specOf2("grep"),
1018
+ fn: grepCommand,
1019
+ aggregate: prefixAggregate,
1250
1020
  provision: fileReadProvision
1251
1021
  });
1252
1022
 
@@ -1256,8 +1026,8 @@ import {
1256
1026
  IOResult as IOResult4,
1257
1027
  OperandKind as OperandKind2,
1258
1028
  Option as Option2,
1259
- ResourceName as ResourceName11,
1260
- command as command11
1029
+ ResourceName as ResourceName4,
1030
+ command as command4
1261
1031
  } from "@struktoai/mirage-core";
1262
1032
  var ENC4 = new TextEncoder();
1263
1033
  var SPEC2 = new CommandSpec2({
@@ -1279,37 +1049,29 @@ async function emailReadCommand(accessor, _paths, _texts, opts) {
1279
1049
  const out = ENC4.encode(JSON.stringify(processed));
1280
1050
  return [out, new IOResult4()];
1281
1051
  }
1282
- var EMAIL_READ = command11({
1283
- name: "email-read",
1284
- resource: ResourceName11.EMAIL,
1052
+ var EMAIL_READ = command4({
1053
+ name: "himalaya message read",
1054
+ resource: ResourceName4.EMAIL,
1285
1055
  spec: SPEC2,
1286
1056
  fn: emailReadCommand
1287
1057
  });
1288
1058
 
1289
- // src/commands/builtin/email/realpath.ts
1290
- import { ResourceName as ResourceName12, command as command12, realpathGeneric, specOf as specOf10 } from "@struktoai/mirage-core";
1291
- var EMAIL_REALPATH = command12({
1292
- name: "realpath",
1293
- resource: ResourceName12.EMAIL,
1294
- spec: specOf10("realpath"),
1295
- fn: (accessor, paths, texts, opts) => realpathGeneric(paths, texts, opts, (p) => stat(accessor, p, opts.index ?? void 0))
1296
- });
1297
-
1298
1059
  // src/commands/builtin/email/email_reply.ts
1299
1060
  import {
1300
1061
  CommandSpec as CommandSpec3,
1301
1062
  IOResult as IOResult5,
1302
1063
  OperandKind as OperandKind3,
1303
1064
  Option as Option3,
1304
- ResourceName as ResourceName13,
1305
- command as command13
1065
+ ResourceName as ResourceName5,
1066
+ command as command5
1306
1067
  } from "@struktoai/mirage-core";
1307
1068
  var ENC5 = new TextEncoder();
1308
1069
  var SPEC3 = new CommandSpec3({
1309
1070
  options: [
1310
1071
  new Option3({ long: "--uid", valueKind: OperandKind3.TEXT }),
1311
1072
  new Option3({ long: "--folder", valueKind: OperandKind3.TEXT }),
1312
- new Option3({ long: "--body", valueKind: OperandKind3.TEXT })
1073
+ new Option3({ long: "--body", valueKind: OperandKind3.TEXT }),
1074
+ new Option3({ long: "--all" })
1313
1075
  ]
1314
1076
  });
1315
1077
  async function emailReplyCommand(accessor, _paths, _texts, opts) {
@@ -1326,83 +1088,44 @@ async function emailReplyCommand(accessor, _paths, _texts, opts) {
1326
1088
  return [null, new IOResult5({ exitCode: 2, stderr: ENC5.encode("--body is required\n") })];
1327
1089
  }
1328
1090
  const original = await fetchMessage(accessor, folder, uid);
1329
- const result = await replyMessage(accessor.config, original, body);
1091
+ const result = opts.flags.all === true ? await replyAllMessage(accessor.config, original, body) : await replyMessage(accessor.config, original, body);
1330
1092
  const out = ENC5.encode(JSON.stringify(result));
1331
1093
  return [out, new IOResult5()];
1332
1094
  }
1333
- var EMAIL_REPLY = command13({
1334
- name: "email-reply",
1335
- resource: ResourceName13.EMAIL,
1095
+ var EMAIL_REPLY = command5({
1096
+ name: "himalaya message reply",
1097
+ resource: ResourceName5.EMAIL,
1336
1098
  spec: SPEC3,
1337
1099
  fn: emailReplyCommand,
1338
1100
  write: true
1339
1101
  });
1340
1102
 
1341
- // src/commands/builtin/email/email_reply_all.ts
1342
- import {
1343
- CommandSpec as CommandSpec4,
1344
- IOResult as IOResult6,
1345
- OperandKind as OperandKind4,
1346
- Option as Option4,
1347
- ResourceName as ResourceName14,
1348
- command as command14
1349
- } from "@struktoai/mirage-core";
1350
- var ENC6 = new TextEncoder();
1351
- var SPEC4 = new CommandSpec4({
1352
- options: [
1353
- new Option4({ long: "--uid", valueKind: OperandKind4.TEXT }),
1354
- new Option4({ long: "--folder", valueKind: OperandKind4.TEXT }),
1355
- new Option4({ long: "--body", valueKind: OperandKind4.TEXT })
1356
- ]
1357
- });
1358
- async function emailReplyAllCommand(accessor, _paths, _texts, opts) {
1359
- const uid = typeof opts.flags.uid === "string" ? opts.flags.uid : "";
1360
- const folder = typeof opts.flags.folder === "string" ? opts.flags.folder : "";
1361
- const body = typeof opts.flags.body === "string" ? opts.flags.body : "";
1362
- if (uid === "") {
1363
- return [null, new IOResult6({ exitCode: 2, stderr: ENC6.encode("--uid is required\n") })];
1364
- }
1365
- if (folder === "") {
1366
- return [null, new IOResult6({ exitCode: 2, stderr: ENC6.encode("--folder is required\n") })];
1367
- }
1368
- if (body === "") {
1369
- return [null, new IOResult6({ exitCode: 2, stderr: ENC6.encode("--body is required\n") })];
1370
- }
1371
- const original = await fetchMessage(accessor, folder, uid);
1372
- const result = await replyAllMessage(accessor.config, original, body);
1373
- const out = ENC6.encode(JSON.stringify(result));
1374
- return [out, new IOResult6()];
1375
- }
1376
- var EMAIL_REPLY_ALL = command14({
1377
- name: "email-reply-all",
1378
- resource: ResourceName14.EMAIL,
1379
- spec: SPEC4,
1380
- fn: emailReplyAllCommand,
1381
- write: true
1382
- });
1383
-
1384
1103
  // src/commands/builtin/email/rg.ts
1385
1104
  import {
1386
- IOResult as IOResult7,
1387
- ResourceName as ResourceName15,
1388
- command as command15,
1105
+ IOResult as IOResult6,
1106
+ ResourceName as ResourceName6,
1107
+ command as command6,
1389
1108
  compilePattern as compilePattern2,
1390
1109
  grepLines as grepLines2,
1110
+ mountPrefixOf as mountPrefixOf6,
1111
+ patternArg,
1112
+ resolveGlobOf as resolveGlobOf3,
1391
1113
  rgGeneric,
1392
- specOf as specOf11
1114
+ specOf as specOf3
1393
1115
  } from "@struktoai/mirage-core";
1394
- var ENC7 = new TextEncoder();
1395
- async function* emailStream5(accessor, p, index) {
1116
+ var resolveGlob3 = resolveGlobOf3(EMAIL_IO);
1117
+ var ENC6 = new TextEncoder();
1118
+ async function* emailStream2(accessor, p, index) {
1396
1119
  yield await read(accessor, p, index);
1397
1120
  }
1398
1121
  async function rgCommand(accessor, paths, texts, opts) {
1399
- if (texts.length === 0 || texts[0] === void 0) {
1122
+ const pattern = patternArg(texts, opts.flags);
1123
+ if (pattern === null) {
1400
1124
  return [
1401
1125
  null,
1402
- new IOResult7({ exitCode: 2, stderr: ENC7.encode("rg: usage: rg [flags] pattern [path]\n") })
1126
+ new IOResult6({ exitCode: 2, stderr: ENC6.encode("rg: usage: rg [flags] pattern [path]\n") })
1403
1127
  ];
1404
1128
  }
1405
- const pattern = texts[0];
1406
1129
  const ignoreCase = opts.flags.i === true;
1407
1130
  const invert = opts.flags.v === true;
1408
1131
  const lineNumbers = opts.flags.n === true;
@@ -1425,21 +1148,21 @@ async function rgCommand(accessor, paths, texts, opts) {
1425
1148
  const first = paths[0];
1426
1149
  if (first !== void 0) {
1427
1150
  const scope = detectScope(first);
1428
- if (scope.useNative) {
1429
- const filePrefix = first.prefix !== "" ? first.prefix : "";
1151
+ if (scope.useNative && !pattern.includes("\n")) {
1152
+ const filePrefix = mountPrefixOf6(first.virtual, first.resourcePath) !== "" ? mountPrefixOf6(first.virtual, first.resourcePath) : "";
1430
1153
  const pairs = await searchAndFormat(accessor, scope, pattern, filePrefix, maxCount ?? 50);
1431
1154
  const lines = [];
1432
1155
  for (const [vfsPath, msgText] of pairs) {
1433
1156
  const matched = grepLines2(vfsPath, [msgText], pat, lineOpts);
1434
1157
  for (const line of matched) lines.push(`${vfsPath}:${line}`);
1435
1158
  }
1436
- if (lines.length === 0) return [new Uint8Array(0), new IOResult7({ exitCode: 1 })];
1437
- const out = ENC7.encode(lines.join("\n") + "\n");
1438
- return [out, new IOResult7()];
1159
+ if (lines.length === 0) return [new Uint8Array(0), new IOResult6({ exitCode: 1 })];
1160
+ const out = ENC6.encode(lines.join("\n") + "\n");
1161
+ return [out, new IOResult6()];
1439
1162
  }
1440
1163
  }
1441
1164
  }
1442
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1165
+ const resolved = paths.length > 0 ? await resolveGlob3(accessor, paths, opts.index ?? void 0) : [];
1443
1166
  const stat2 = (p) => stat(accessor, p, opts.index ?? void 0);
1444
1167
  const readdir2 = (p) => readdir(accessor, p, opts.index ?? void 0);
1445
1168
  return rgGeneric(
@@ -1448,31 +1171,31 @@ async function rgCommand(accessor, paths, texts, opts) {
1448
1171
  opts,
1449
1172
  stat2,
1450
1173
  readdir2,
1451
- (p) => emailStream5(accessor, p, opts.index ?? void 0)
1174
+ (p) => emailStream2(accessor, p, opts.index ?? void 0)
1452
1175
  );
1453
1176
  }
1454
- var EMAIL_RG = command15({
1177
+ var EMAIL_RG = command6({
1455
1178
  name: "rg",
1456
- resource: ResourceName15.EMAIL,
1457
- spec: specOf11("rg"),
1179
+ resource: ResourceName6.EMAIL,
1180
+ spec: specOf3("rg"),
1458
1181
  fn: rgCommand
1459
1182
  });
1460
1183
 
1461
1184
  // src/commands/builtin/email/email_send.ts
1462
1185
  import {
1463
- CommandSpec as CommandSpec5,
1464
- IOResult as IOResult8,
1465
- OperandKind as OperandKind5,
1466
- Option as Option5,
1467
- ResourceName as ResourceName16,
1468
- command as command16
1186
+ CommandSpec as CommandSpec4,
1187
+ IOResult as IOResult7,
1188
+ OperandKind as OperandKind4,
1189
+ Option as Option4,
1190
+ ResourceName as ResourceName7,
1191
+ command as command7
1469
1192
  } from "@struktoai/mirage-core";
1470
- var ENC8 = new TextEncoder();
1471
- var SPEC5 = new CommandSpec5({
1193
+ var ENC7 = new TextEncoder();
1194
+ var SPEC4 = new CommandSpec4({
1472
1195
  options: [
1473
- new Option5({ long: "--to", valueKind: OperandKind5.TEXT }),
1474
- new Option5({ long: "--subject", valueKind: OperandKind5.TEXT }),
1475
- new Option5({ long: "--body", valueKind: OperandKind5.TEXT })
1196
+ new Option4({ long: "--to", valueKind: OperandKind4.TEXT }),
1197
+ new Option4({ long: "--subject", valueKind: OperandKind4.TEXT }),
1198
+ new Option4({ long: "--body", valueKind: OperandKind4.TEXT })
1476
1199
  ]
1477
1200
  });
1478
1201
  async function emailSendCommand(accessor, _paths, _texts, opts) {
@@ -1480,116 +1203,47 @@ async function emailSendCommand(accessor, _paths, _texts, opts) {
1480
1203
  const subject = typeof opts.flags.subject === "string" ? opts.flags.subject : "";
1481
1204
  const body = typeof opts.flags.body === "string" ? opts.flags.body : "";
1482
1205
  if (to === "") {
1483
- return [null, new IOResult8({ exitCode: 2, stderr: ENC8.encode("--to is required\n") })];
1206
+ return [null, new IOResult7({ exitCode: 2, stderr: ENC7.encode("--to is required\n") })];
1484
1207
  }
1485
1208
  if (subject === "") {
1486
- return [null, new IOResult8({ exitCode: 2, stderr: ENC8.encode("--subject is required\n") })];
1209
+ return [null, new IOResult7({ exitCode: 2, stderr: ENC7.encode("--subject is required\n") })];
1487
1210
  }
1488
1211
  if (body === "") {
1489
- return [null, new IOResult8({ exitCode: 2, stderr: ENC8.encode("--body is required\n") })];
1212
+ return [null, new IOResult7({ exitCode: 2, stderr: ENC7.encode("--body is required\n") })];
1490
1213
  }
1491
1214
  const result = await sendMessage(accessor.config, to, subject, body);
1492
- const out = ENC8.encode(JSON.stringify(result));
1493
- return [out, new IOResult8()];
1215
+ const out = ENC7.encode(JSON.stringify(result));
1216
+ return [out, new IOResult7()];
1494
1217
  }
1495
- var EMAIL_SEND = command16({
1496
- name: "email-send",
1497
- resource: ResourceName16.EMAIL,
1498
- spec: SPEC5,
1218
+ var EMAIL_SEND = command7({
1219
+ name: "himalaya message send",
1220
+ resource: ResourceName7.EMAIL,
1221
+ spec: SPEC4,
1499
1222
  fn: emailSendCommand,
1500
1223
  write: true
1501
1224
  });
1502
1225
 
1503
- // src/commands/builtin/email/stat.ts
1504
- import {
1505
- ResourceName as ResourceName17,
1506
- command as command17,
1507
- specOf as specOf12,
1508
- statGeneric
1509
- } from "@struktoai/mirage-core";
1510
- async function statCommand(accessor, paths, _texts, opts) {
1511
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1512
- return statGeneric(resolved, opts, (p) => stat(accessor, p, opts.index ?? void 0));
1513
- }
1514
- var EMAIL_STAT = command17({
1515
- name: "stat",
1516
- resource: ResourceName17.EMAIL,
1517
- spec: specOf12("stat"),
1518
- fn: statCommand,
1519
- provision: metadataProvision
1520
- });
1521
-
1522
- // src/commands/builtin/email/tail.ts
1523
- import {
1524
- ResourceName as ResourceName18,
1525
- command as command18,
1526
- specOf as specOf13,
1527
- tailGeneric
1528
- } from "@struktoai/mirage-core";
1529
- async function* emailStream6(accessor, p, index) {
1530
- yield await read(accessor, p, index);
1531
- }
1532
- async function tailCommand(accessor, paths, texts, opts) {
1533
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1534
- return tailGeneric(
1535
- resolved,
1536
- texts,
1537
- opts,
1538
- (p) => emailStream6(accessor, p, opts.index ?? void 0)
1539
- );
1540
- }
1541
- var EMAIL_TAIL = command18({
1542
- name: "tail",
1543
- resource: ResourceName18.EMAIL,
1544
- spec: specOf13("tail"),
1545
- fn: tailCommand,
1546
- provision: fileReadProvision
1547
- });
1548
-
1549
- // src/commands/builtin/email/tree.ts
1550
- import {
1551
- ResourceName as ResourceName19,
1552
- command as command19,
1553
- specOf as specOf14,
1554
- treeGeneric
1555
- } from "@struktoai/mirage-core";
1556
- async function treeCommand(accessor, paths, _texts, opts) {
1557
- const resolved = await resolveGlob(accessor, paths, opts.index ?? void 0);
1558
- return treeGeneric(
1559
- resolved,
1560
- opts,
1561
- (p) => readdir(accessor, p, opts.index ?? void 0),
1562
- (p) => stat(accessor, p, opts.index ?? void 0)
1563
- );
1564
- }
1565
- var EMAIL_TREE = command19({
1566
- name: "tree",
1567
- resource: ResourceName19.EMAIL,
1568
- spec: specOf14("tree"),
1569
- fn: treeCommand
1570
- });
1571
-
1572
1226
  // src/commands/builtin/email/email_triage.ts
1573
1227
  import {
1574
- CommandSpec as CommandSpec6,
1575
- IOResult as IOResult9,
1576
- OperandKind as OperandKind6,
1577
- Option as Option6,
1578
- ResourceName as ResourceName20,
1579
- command as command20
1228
+ CommandSpec as CommandSpec5,
1229
+ IOResult as IOResult8,
1230
+ OperandKind as OperandKind5,
1231
+ Option as Option5,
1232
+ ResourceName as ResourceName8,
1233
+ command as command8
1580
1234
  } from "@struktoai/mirage-core";
1581
- var ENC9 = new TextEncoder();
1582
- var SPEC6 = new CommandSpec6({
1235
+ var ENC8 = new TextEncoder();
1236
+ var SPEC5 = new CommandSpec5({
1583
1237
  options: [
1584
- new Option6({ long: "--folder", valueKind: OperandKind6.TEXT }),
1585
- new Option6({ long: "--max", valueKind: OperandKind6.TEXT }),
1586
- new Option6({ long: "--unseen" }),
1587
- new Option6({ long: "--subject", valueKind: OperandKind6.TEXT }),
1588
- new Option6({ long: "--from", valueKind: OperandKind6.TEXT }),
1589
- new Option6({ long: "--to", valueKind: OperandKind6.TEXT }),
1590
- new Option6({ long: "--body", valueKind: OperandKind6.TEXT }),
1591
- new Option6({ long: "--since", valueKind: OperandKind6.TEXT }),
1592
- new Option6({ long: "--before", valueKind: OperandKind6.TEXT })
1238
+ new Option5({ long: "--folder", valueKind: OperandKind5.TEXT }),
1239
+ new Option5({ long: "--max", valueKind: OperandKind5.TEXT }),
1240
+ new Option5({ long: "--unseen" }),
1241
+ new Option5({ long: "--subject", valueKind: OperandKind5.TEXT }),
1242
+ new Option5({ long: "--from", valueKind: OperandKind5.TEXT }),
1243
+ new Option5({ long: "--to", valueKind: OperandKind5.TEXT }),
1244
+ new Option5({ long: "--body", valueKind: OperandKind5.TEXT }),
1245
+ new Option5({ long: "--since", valueKind: OperandKind5.TEXT }),
1246
+ new Option5({ long: "--before", valueKind: OperandKind5.TEXT })
1593
1247
  ]
1594
1248
  });
1595
1249
  async function emailTriageCommand(accessor, _paths, _texts, opts) {
@@ -1610,105 +1264,39 @@ async function emailTriageCommand(accessor, _paths, _texts, opts) {
1610
1264
  maxResults
1611
1265
  );
1612
1266
  if (uids.length === 0) {
1613
- const out2 = ENC9.encode("[]");
1614
- return [out2, new IOResult9()];
1267
+ const out2 = ENC8.encode("[]");
1268
+ return [out2, new IOResult8()];
1615
1269
  }
1616
1270
  const headers = await fetchHeaders(accessor, folder, uids);
1617
- const out = ENC9.encode(JSON.stringify(headers));
1618
- return [out, new IOResult9()];
1271
+ const out = ENC8.encode(JSON.stringify(headers));
1272
+ return [out, new IOResult8()];
1619
1273
  }
1620
- var EMAIL_TRIAGE = command20({
1621
- name: "email-triage",
1622
- resource: ResourceName20.EMAIL,
1623
- spec: SPEC6,
1274
+ var EMAIL_TRIAGE = command8({
1275
+ name: "himalaya envelope list",
1276
+ resource: ResourceName8.EMAIL,
1277
+ spec: SPEC5,
1624
1278
  fn: emailTriageCommand
1625
1279
  });
1626
1280
 
1627
- // src/commands/builtin/email/wc.ts
1628
- import {
1629
- ResourceName as ResourceName21,
1630
- command as command21,
1631
- specOf as specOf15,
1632
- wcGeneric
1633
- } from "@struktoai/mirage-core";
1634
- async function* emailStream7(accessor, p, index) {
1635
- yield await read(accessor, p, index);
1636
- }
1637
- async function wcCommand(accessor, paths, texts, opts) {
1638
- const resolved = paths.length > 0 ? await resolveGlob(accessor, paths, opts.index ?? void 0) : [];
1639
- return wcGeneric(resolved, texts, opts, (p) => emailStream7(accessor, p, opts.index ?? void 0));
1640
- }
1641
- var EMAIL_WC = command21({
1642
- name: "wc",
1643
- resource: ResourceName21.EMAIL,
1644
- spec: specOf15("wc"),
1645
- fn: wcCommand,
1646
- provision: fileReadProvision
1647
- });
1648
-
1649
1281
  // src/commands/builtin/email/index.ts
1282
+ var EMAIL_OVERRIDES = /* @__PURE__ */ new Set(["find", "grep", "rg"]);
1650
1283
  var EMAIL_COMMANDS = [
1651
- ...EMAIL_BASENAME,
1652
- ...EMAIL_CAT,
1653
- ...EMAIL_DIRNAME,
1284
+ ...makeGenericCommands(ResourceName9.EMAIL, EMAIL_IO, {
1285
+ overrides: EMAIL_OVERRIDES
1286
+ }),
1654
1287
  ...EMAIL_FIND,
1655
1288
  ...EMAIL_GREP,
1656
- ...EMAIL_HEAD,
1657
- ...EMAIL_JQ,
1658
- ...EMAIL_LS,
1659
- ...EMAIL_NL,
1660
- ...EMAIL_REALPATH,
1661
1289
  ...EMAIL_RG,
1662
- ...EMAIL_STAT,
1663
- ...EMAIL_TAIL,
1664
- ...EMAIL_TREE,
1665
- ...EMAIL_WC,
1666
1290
  ...EMAIL_SEND,
1667
1291
  ...EMAIL_REPLY,
1668
- ...EMAIL_REPLY_ALL,
1669
1292
  ...EMAIL_FORWARD,
1670
1293
  ...EMAIL_TRIAGE,
1671
1294
  ...EMAIL_READ
1672
1295
  ];
1673
1296
 
1674
- // src/ops/email/read.ts
1675
- import { ResourceName as ResourceName22 } from "@struktoai/mirage-core";
1676
- var readOp = {
1677
- name: "read",
1678
- resource: ResourceName22.EMAIL,
1679
- filetype: null,
1680
- write: false,
1681
- fn: (accessor, path, _args, kwargs) => {
1682
- return read(accessor, path, kwargs.index);
1683
- }
1684
- };
1685
-
1686
- // src/ops/email/readdir.ts
1687
- import { ResourceName as ResourceName23 } from "@struktoai/mirage-core";
1688
- var readdirOp = {
1689
- name: "readdir",
1690
- resource: ResourceName23.EMAIL,
1691
- filetype: null,
1692
- write: false,
1693
- fn: (accessor, path, _args, kwargs) => {
1694
- return readdir(accessor, path, kwargs.index);
1695
- }
1696
- };
1697
-
1698
- // src/ops/email/stat.ts
1699
- import { ResourceName as ResourceName24 } from "@struktoai/mirage-core";
1700
- var statOp = {
1701
- name: "stat",
1702
- resource: ResourceName24.EMAIL,
1703
- filetype: null,
1704
- write: false,
1705
- fn: (accessor, path, _args, kwargs) => {
1706
- return stat(accessor, path, kwargs.index);
1707
- }
1708
- };
1709
-
1710
1297
  // src/ops/email/index.ts
1711
- var EMAIL_OPS = [readdirOp, readOp, statOp];
1298
+ import { ResourceName as ResourceName10, makeGenericOps } from "@struktoai/mirage-core";
1299
+ var EMAIL_OPS = makeGenericOps(ResourceName10.EMAIL, EMAIL_IO);
1712
1300
 
1713
1301
  // src/resource/email/prompt.ts
1714
1302
  var EMAIL_PROMPT = `{prefix}
@@ -1717,15 +1305,20 @@ var EMAIL_PROMPT = `{prefix}
1717
1305
  <subject>__<uid>.email.json
1718
1306
  <subject>__<uid>/ # if attachments exist
1719
1307
  <attachment-filename>
1720
- Folders include: INBOX, Sent, Drafts, etc. cat shows email as JSON.`;
1308
+ Folders include: INBOX, Sent, Drafts, etc. cat shows email as JSON.
1309
+
1310
+ Read commands:
1311
+ himalaya envelope list --folder INBOX --unseen # id/from/subject/date
1312
+ himalaya message read --folder INBOX --uid <uid> # one message as JSON`;
1721
1313
  var EMAIL_WRITE_PROMPT = ` Write commands:
1722
- email-send "to@email.com" "subject" "body"
1723
- email-reply <email-path> "reply body"
1724
- email-forward <email-path> "to@email.com"`;
1314
+ himalaya message send --to "to@email.com" --subject "Hi" --body "..."
1315
+ himalaya message reply --folder INBOX --uid <uid> --body "..." [--all]
1316
+ himalaya message forward --folder INBOX --uid <uid> --to "to@email.com"`;
1725
1317
 
1726
1318
  // src/resource/email/email.ts
1319
+ var resolveGlob4 = makeResolveGlob(readdir);
1727
1320
  var EmailResource = class extends BaseResource {
1728
- kind = ResourceName25.EMAIL;
1321
+ kind = ResourceName11.EMAIL;
1729
1322
  cachesReads = true;
1730
1323
  indexTtl = 86400;
1731
1324
  prompt = EMAIL_PROMPT;
@@ -1757,21 +1350,17 @@ var EmailResource = class extends BaseResource {
1757
1350
  stat(p) {
1758
1351
  return stat(this.accessor, p, this.index);
1759
1352
  }
1760
- async fingerprint(p) {
1761
- const lookup = await this.index.get(p.original);
1762
- return lookup.entry?.remoteTime ?? null;
1763
- }
1764
1353
  glob(paths, prefix = "") {
1765
1354
  const effective = prefix !== "" ? paths.map(
1766
- (p) => p.prefix !== "" ? p : new PathSpec4({
1767
- original: p.original,
1355
+ (p) => mountPrefixOf7(p.virtual, p.resourcePath) !== "" ? p : new PathSpec3({
1356
+ virtual: p.virtual,
1768
1357
  directory: p.directory,
1769
1358
  ...p.pattern !== null ? { pattern: p.pattern } : {},
1770
1359
  resolved: p.resolved,
1771
- prefix
1360
+ resourcePath: mountKey4(p.virtual, prefix)
1772
1361
  })
1773
1362
  ) : paths;
1774
- return resolveGlob(this.accessor, effective, this.index);
1363
+ return resolveGlob4(this.accessor, effective, this.index);
1775
1364
  }
1776
1365
  getState() {
1777
1366
  return Promise.resolve({
@@ -1792,4 +1381,4 @@ export {
1792
1381
  EMAIL_WRITE_PROMPT,
1793
1382
  EmailResource
1794
1383
  };
1795
- //# sourceMappingURL=chunk-S5OVP467.js.map
1384
+ //# sourceMappingURL=chunk-4GYB7DGC.js.map