just-bash-nx 2.14.6 → 3.0.0

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 (599) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/README.md +38 -2
  3. package/dist/Bash.d.ts +27 -0
  4. package/dist/bin/chunks/awk2-CKPJ75GN.js +2 -0
  5. package/dist/bin/chunks/base64-I3CXGD2Q.js +2 -0
  6. package/dist/bin/chunks/bash-UYSJL7VA.js +2 -0
  7. package/dist/bin/chunks/cat-3TMJDECR.js +2 -0
  8. package/dist/bin/chunks/chunk-24DJ4XAS.js +18 -0
  9. package/dist/bin/chunks/{chunk-DOXYBGNA.js → chunk-2ACK45YF.js} +4 -4
  10. package/dist/bin/chunks/chunk-2GZSSMV3.js +14 -0
  11. package/dist/bin/chunks/{chunk-WXMBDX4P.js → chunk-2TMMAY52.js} +7 -7
  12. package/dist/bin/chunks/chunk-575DV2PL.js +9 -0
  13. package/dist/bin/chunks/chunk-5DFR7VRU.js +13 -0
  14. package/dist/bin/chunks/chunk-5EPOBKNU.js +140 -0
  15. package/dist/bin/chunks/chunk-63XSH3IT.js +2 -0
  16. package/dist/bin/{shell/chunks/chunk-N43DJTSI.js → chunks/chunk-6CW6ATOU.js} +1 -1
  17. package/dist/bin/chunks/{chunk-ZUDPEMHG.js → chunk-6ZKYK7PO.js} +4 -4
  18. package/dist/bin/chunks/chunk-7FOU5QKD.js +11 -0
  19. package/dist/bin/chunks/chunk-7RSTZI3G.js +9 -0
  20. package/dist/bin/chunks/{chunk-SGA7Y45Z.js → chunk-A65XLABI.js} +5 -5
  21. package/dist/bin/chunks/{chunk-YLE2OYY6.js → chunk-A6CAHGYF.js} +1 -1
  22. package/dist/bin/chunks/{chunk-L6XUBS6H.js → chunk-AM6HJVBI.js} +16 -16
  23. package/dist/bin/chunks/chunk-AQBEVPZP.js +6 -0
  24. package/dist/bin/chunks/chunk-AX3QU3MP.js +6 -0
  25. package/dist/bin/chunks/chunk-B4CUXR3Q.js +33 -0
  26. package/dist/bin/{shell/chunks/chunk-BGGF3ELU.js → chunks/chunk-B5DAHNDY.js} +1 -1
  27. package/dist/bin/chunks/chunk-BEWZWAXH.js +8 -0
  28. package/dist/bin/{shell/chunks/chunk-JDNI5HBX.js → chunks/chunk-C6FRS5UB.js} +3 -3
  29. package/dist/bin/chunks/chunk-CUYKY2BK.js +5 -0
  30. package/dist/bin/chunks/chunk-D3JRD3JF.js +36 -0
  31. package/dist/bin/chunks/chunk-D6DORGK7.js +16 -0
  32. package/dist/bin/{shell/chunks/chunk-EONWONZV.js → chunks/chunk-DH7TPGPX.js} +1 -1
  33. package/dist/bin/chunks/{chunk-IO2FYBEM.js → chunk-F75VXASN.js} +1 -1
  34. package/dist/bin/chunks/chunk-FU7JHPYW.js +9 -0
  35. package/dist/bin/chunks/chunk-G36D7WFF.js +6 -0
  36. package/dist/bin/chunks/chunk-GQQLQPZG.js +7 -0
  37. package/dist/bin/chunks/chunk-HIVPP3AM.js +17 -0
  38. package/dist/bin/{shell/chunks/chunk-NAX7MTAR.js → chunks/chunk-I3X57RP5.js} +6 -6
  39. package/dist/bin/chunks/chunk-IZ3AT2KX.js +19 -0
  40. package/dist/bin/chunks/chunk-KHOBXZFG.js +12 -0
  41. package/dist/bin/chunks/chunk-KMFPV7SR.js +6 -0
  42. package/dist/bin/chunks/chunk-KX2PR2HV.js +16 -0
  43. package/dist/bin/chunks/{chunk-54G6AE72.js → chunk-LCJRVV55.js} +1 -1
  44. package/dist/bin/chunks/chunk-M33SULGQ.js +9 -0
  45. package/dist/bin/chunks/{chunk-3Y32LPNT.js → chunk-M3T6XOXC.js} +1 -1
  46. package/dist/bin/chunks/chunk-MWKPB24E.js +11 -0
  47. package/dist/bin/chunks/chunk-NN2DBOAZ.js +5 -0
  48. package/dist/bin/chunks/{chunk-PNI5NMXP.js → chunk-NOGXKS2G.js} +23 -23
  49. package/dist/bin/{shell/chunks/chunk-7BORMNPQ.js → chunks/chunk-NWG67HAQ.js} +1 -1
  50. package/dist/bin/{shell/chunks/chunk-OXHVTSNH.js → chunks/chunk-P43NQKUN.js} +1 -1
  51. package/dist/bin/chunks/chunk-RR4FBZRQ.js +16 -0
  52. package/dist/bin/chunks/{chunk-FIHFXGT6.js → chunk-RUJLEXBJ.js} +72 -72
  53. package/dist/bin/chunks/chunk-RX22J4AC.js +14 -0
  54. package/dist/bin/chunks/chunk-S7KZBLGH.js +3 -0
  55. package/dist/bin/chunks/chunk-UO7ZJYDM.js +11 -0
  56. package/dist/bin/{shell/chunks/chunk-S3QAKT3R.js → chunks/chunk-VECTAALH.js} +1 -1
  57. package/dist/bin/chunks/chunk-VRU3NTQB.js +3 -0
  58. package/dist/bin/chunks/chunk-WJ3HZK2S.js +5 -0
  59. package/dist/bin/chunks/{chunk-SXRVLCZ4.js → chunk-WRYJHXRE.js} +1 -1
  60. package/dist/bin/chunks/chunk-XZEAAOBW.js +8 -0
  61. package/dist/bin/{shell/chunks/chunk-EWDHVLQL.js → chunks/chunk-YMQY74O7.js} +13 -13
  62. package/dist/bin/chunks/chunk-ZNMFCOTS.js +10 -0
  63. package/dist/bin/chunks/{chunk-GOJZHH3L.js → chunk-ZO3PBKJB.js} +3 -3
  64. package/dist/bin/chunks/column-MTXKQLJH.js +2 -0
  65. package/dist/bin/chunks/comm-YZHVF2XN.js +2 -0
  66. package/dist/bin/chunks/cut-MWPHE25M.js +2 -0
  67. package/dist/bin/chunks/diff-EINZHDTZ.js +2 -0
  68. package/dist/bin/chunks/env-NK55NKL6.js +2 -0
  69. package/dist/bin/chunks/expand-47QQBMM5.js +2 -0
  70. package/dist/bin/{shell/chunks/expansion-QUT3FT7V.js → chunks/expansion-H3VFC532.js} +1 -1
  71. package/dist/bin/chunks/{expr-G4EF4POQ.js → expr-VPJ77DR7.js} +1 -1
  72. package/dist/bin/chunks/find-O2KKT6KZ.js +2 -0
  73. package/dist/bin/chunks/flag-coverage-K5GLIZKA.js +2 -0
  74. package/dist/bin/chunks/fold-QC27S46O.js +2 -0
  75. package/dist/bin/chunks/grep-3X5B47DW.js +2 -0
  76. package/dist/bin/chunks/gzip-VYBZGPTA.js +2 -0
  77. package/dist/bin/chunks/head-BM7J6BEI.js +2 -0
  78. package/dist/bin/chunks/html-to-markdown-G2FXKDLR.js +2 -0
  79. package/dist/bin/chunks/join-5J5VA3I7.js +2 -0
  80. package/dist/bin/chunks/jq-TUCIEKOF.js +2 -0
  81. package/dist/bin/chunks/{js-exec-RWEELTC2.js → js-exec-LZPKIZ5V.js} +11 -11
  82. package/dist/bin/chunks/js-exec-worker.js +70 -7
  83. package/dist/bin/chunks/md5sum-GVZ66MRR.js +2 -0
  84. package/dist/bin/chunks/nl-XLPXDHHK.js +2 -0
  85. package/dist/bin/chunks/od-CRBL7ZML.js +2 -0
  86. package/dist/bin/chunks/paste-7MEIW3PG.js +2 -0
  87. package/dist/bin/chunks/python3-BBQ4SVHU.js +12 -0
  88. package/dist/bin/chunks/rev-6LTZEDBA.js +2 -0
  89. package/dist/bin/chunks/rg-UPQTBQZR.js +2 -0
  90. package/dist/bin/chunks/sed-OKEUW2KT.js +2 -0
  91. package/dist/bin/chunks/sha1sum-HFI2SRA4.js +2 -0
  92. package/dist/bin/chunks/sha256sum-N44D3OCP.js +2 -0
  93. package/dist/bin/chunks/sort-ES3NRFJA.js +2 -0
  94. package/dist/bin/chunks/split-QFBCCUR5.js +2 -0
  95. package/dist/bin/chunks/sqlite3-V4SEWTIR.js +2 -0
  96. package/dist/bin/chunks/sqlite3-worker.js +1728 -0
  97. package/dist/bin/chunks/strings-YGI6HF5M.js +2 -0
  98. package/dist/bin/chunks/tac-HWXFWOGO.js +2 -0
  99. package/dist/bin/chunks/tail-YX6MELZ5.js +2 -0
  100. package/dist/bin/chunks/tar-UO62YC6N.js +2 -0
  101. package/dist/bin/chunks/tee-XKJM7HV7.js +2 -0
  102. package/dist/bin/chunks/time-RPVNTV72.js +2 -0
  103. package/dist/bin/chunks/timeout-4QMASFQG.js +2 -0
  104. package/dist/bin/chunks/tr-A6IXSBQX.js +2 -0
  105. package/dist/bin/chunks/unexpand-UCJETXUX.js +2 -0
  106. package/dist/bin/chunks/uniq-2KXDTNDX.js +2 -0
  107. package/dist/bin/chunks/wc-KTXPMRYY.js +2 -0
  108. package/dist/bin/chunks/worker.js +21 -7
  109. package/dist/bin/chunks/xan-BCGRY7KM.js +2 -0
  110. package/dist/bin/chunks/xan-view-JFFJAU35.js +2 -0
  111. package/dist/bin/chunks/xargs-EWL5DXR3.js +2 -0
  112. package/dist/bin/chunks/yq-TKCR3BPF.js +2 -0
  113. package/dist/bin/just-bash.js +296 -296
  114. package/dist/bin/shell/chunks/awk2-CKPJ75GN.js +2 -0
  115. package/dist/bin/shell/chunks/base64-I3CXGD2Q.js +2 -0
  116. package/dist/bin/shell/chunks/bash-UYSJL7VA.js +2 -0
  117. package/dist/bin/shell/chunks/cat-3TMJDECR.js +2 -0
  118. package/dist/bin/shell/chunks/chunk-24DJ4XAS.js +18 -0
  119. package/dist/bin/shell/chunks/{chunk-DOXYBGNA.js → chunk-2ACK45YF.js} +4 -4
  120. package/dist/bin/shell/chunks/chunk-2GZSSMV3.js +14 -0
  121. package/dist/bin/shell/chunks/{chunk-WXMBDX4P.js → chunk-2TMMAY52.js} +7 -7
  122. package/dist/bin/shell/chunks/chunk-575DV2PL.js +9 -0
  123. package/dist/bin/shell/chunks/chunk-5DFR7VRU.js +13 -0
  124. package/dist/bin/shell/chunks/chunk-5EPOBKNU.js +140 -0
  125. package/dist/bin/shell/chunks/chunk-63XSH3IT.js +2 -0
  126. package/dist/bin/{chunks/chunk-N43DJTSI.js → shell/chunks/chunk-6CW6ATOU.js} +1 -1
  127. package/dist/bin/shell/chunks/{chunk-ZUDPEMHG.js → chunk-6ZKYK7PO.js} +4 -4
  128. package/dist/bin/shell/chunks/chunk-7FOU5QKD.js +11 -0
  129. package/dist/bin/shell/chunks/chunk-7RSTZI3G.js +9 -0
  130. package/dist/bin/shell/chunks/{chunk-SGA7Y45Z.js → chunk-A65XLABI.js} +5 -5
  131. package/dist/bin/shell/chunks/{chunk-YLE2OYY6.js → chunk-A6CAHGYF.js} +1 -1
  132. package/dist/bin/shell/chunks/{chunk-L6XUBS6H.js → chunk-AM6HJVBI.js} +16 -16
  133. package/dist/bin/shell/chunks/chunk-AQBEVPZP.js +6 -0
  134. package/dist/bin/shell/chunks/chunk-AX3QU3MP.js +6 -0
  135. package/dist/bin/shell/chunks/chunk-B4CUXR3Q.js +33 -0
  136. package/dist/bin/{chunks/chunk-BGGF3ELU.js → shell/chunks/chunk-B5DAHNDY.js} +1 -1
  137. package/dist/bin/shell/chunks/chunk-BEWZWAXH.js +8 -0
  138. package/dist/bin/{chunks/chunk-JDNI5HBX.js → shell/chunks/chunk-C6FRS5UB.js} +3 -3
  139. package/dist/bin/shell/chunks/chunk-CUYKY2BK.js +5 -0
  140. package/dist/bin/shell/chunks/chunk-D3JRD3JF.js +36 -0
  141. package/dist/bin/shell/chunks/chunk-D6DORGK7.js +16 -0
  142. package/dist/bin/{chunks/chunk-EONWONZV.js → shell/chunks/chunk-DH7TPGPX.js} +1 -1
  143. package/dist/bin/shell/chunks/{chunk-IO2FYBEM.js → chunk-F75VXASN.js} +1 -1
  144. package/dist/bin/shell/chunks/chunk-FU7JHPYW.js +9 -0
  145. package/dist/bin/shell/chunks/chunk-G36D7WFF.js +6 -0
  146. package/dist/bin/shell/chunks/chunk-GQQLQPZG.js +7 -0
  147. package/dist/bin/shell/chunks/chunk-HIVPP3AM.js +17 -0
  148. package/dist/bin/{chunks/chunk-NAX7MTAR.js → shell/chunks/chunk-I3X57RP5.js} +6 -6
  149. package/dist/bin/shell/chunks/chunk-IZ3AT2KX.js +19 -0
  150. package/dist/bin/shell/chunks/chunk-KHOBXZFG.js +12 -0
  151. package/dist/bin/shell/chunks/chunk-KMFPV7SR.js +6 -0
  152. package/dist/bin/shell/chunks/chunk-KX2PR2HV.js +16 -0
  153. package/dist/bin/shell/chunks/{chunk-54G6AE72.js → chunk-LCJRVV55.js} +1 -1
  154. package/dist/bin/shell/chunks/chunk-M33SULGQ.js +9 -0
  155. package/dist/bin/shell/chunks/{chunk-3Y32LPNT.js → chunk-M3T6XOXC.js} +1 -1
  156. package/dist/bin/shell/chunks/chunk-MWKPB24E.js +11 -0
  157. package/dist/bin/shell/chunks/chunk-NN2DBOAZ.js +5 -0
  158. package/dist/bin/shell/chunks/{chunk-PNI5NMXP.js → chunk-NOGXKS2G.js} +23 -23
  159. package/dist/bin/{chunks/chunk-7BORMNPQ.js → shell/chunks/chunk-NWG67HAQ.js} +1 -1
  160. package/dist/bin/{chunks/chunk-OXHVTSNH.js → shell/chunks/chunk-P43NQKUN.js} +1 -1
  161. package/dist/bin/shell/chunks/chunk-RR4FBZRQ.js +16 -0
  162. package/dist/bin/shell/chunks/{chunk-FIHFXGT6.js → chunk-RUJLEXBJ.js} +72 -72
  163. package/dist/bin/shell/chunks/chunk-RX22J4AC.js +14 -0
  164. package/dist/bin/shell/chunks/chunk-S7KZBLGH.js +3 -0
  165. package/dist/bin/shell/chunks/chunk-UO7ZJYDM.js +11 -0
  166. package/dist/bin/{chunks/chunk-S3QAKT3R.js → shell/chunks/chunk-VECTAALH.js} +1 -1
  167. package/dist/bin/shell/chunks/chunk-VRU3NTQB.js +3 -0
  168. package/dist/bin/shell/chunks/chunk-WJ3HZK2S.js +5 -0
  169. package/dist/bin/shell/chunks/{chunk-SXRVLCZ4.js → chunk-WRYJHXRE.js} +1 -1
  170. package/dist/bin/shell/chunks/chunk-XZEAAOBW.js +8 -0
  171. package/dist/bin/{chunks/chunk-EWDHVLQL.js → shell/chunks/chunk-YMQY74O7.js} +13 -13
  172. package/dist/bin/shell/chunks/chunk-ZNMFCOTS.js +10 -0
  173. package/dist/bin/shell/chunks/{chunk-GOJZHH3L.js → chunk-ZO3PBKJB.js} +3 -3
  174. package/dist/bin/shell/chunks/column-MTXKQLJH.js +2 -0
  175. package/dist/bin/shell/chunks/comm-YZHVF2XN.js +2 -0
  176. package/dist/bin/shell/chunks/cut-MWPHE25M.js +2 -0
  177. package/dist/bin/shell/chunks/diff-EINZHDTZ.js +2 -0
  178. package/dist/bin/shell/chunks/env-NK55NKL6.js +2 -0
  179. package/dist/bin/shell/chunks/expand-47QQBMM5.js +2 -0
  180. package/dist/bin/{chunks/expansion-QUT3FT7V.js → shell/chunks/expansion-H3VFC532.js} +1 -1
  181. package/dist/bin/shell/chunks/{expr-G4EF4POQ.js → expr-VPJ77DR7.js} +1 -1
  182. package/dist/bin/shell/chunks/find-O2KKT6KZ.js +2 -0
  183. package/dist/bin/shell/chunks/flag-coverage-K5GLIZKA.js +2 -0
  184. package/dist/bin/shell/chunks/fold-QC27S46O.js +2 -0
  185. package/dist/bin/shell/chunks/grep-3X5B47DW.js +2 -0
  186. package/dist/bin/shell/chunks/gzip-VYBZGPTA.js +2 -0
  187. package/dist/bin/shell/chunks/head-BM7J6BEI.js +2 -0
  188. package/dist/bin/shell/chunks/html-to-markdown-G2FXKDLR.js +2 -0
  189. package/dist/bin/shell/chunks/join-5J5VA3I7.js +2 -0
  190. package/dist/bin/shell/chunks/jq-TUCIEKOF.js +2 -0
  191. package/dist/bin/shell/chunks/{js-exec-AKWY6BP5.js → js-exec-LZPKIZ5V.js} +11 -11
  192. package/dist/bin/shell/chunks/md5sum-GVZ66MRR.js +2 -0
  193. package/dist/bin/shell/chunks/nl-XLPXDHHK.js +2 -0
  194. package/dist/bin/shell/chunks/od-CRBL7ZML.js +2 -0
  195. package/dist/bin/shell/chunks/paste-7MEIW3PG.js +2 -0
  196. package/dist/bin/shell/chunks/python3-BBQ4SVHU.js +12 -0
  197. package/dist/bin/shell/chunks/rev-6LTZEDBA.js +2 -0
  198. package/dist/bin/shell/chunks/rg-UPQTBQZR.js +2 -0
  199. package/dist/bin/shell/chunks/sed-OKEUW2KT.js +2 -0
  200. package/dist/bin/shell/chunks/sha1sum-HFI2SRA4.js +2 -0
  201. package/dist/bin/shell/chunks/sha256sum-N44D3OCP.js +2 -0
  202. package/dist/bin/shell/chunks/sort-ES3NRFJA.js +2 -0
  203. package/dist/bin/shell/chunks/split-QFBCCUR5.js +2 -0
  204. package/dist/bin/shell/chunks/sqlite3-V4SEWTIR.js +2 -0
  205. package/dist/bin/shell/chunks/strings-YGI6HF5M.js +2 -0
  206. package/dist/bin/shell/chunks/tac-HWXFWOGO.js +2 -0
  207. package/dist/bin/shell/chunks/tail-YX6MELZ5.js +2 -0
  208. package/dist/bin/shell/chunks/tar-UO62YC6N.js +2 -0
  209. package/dist/bin/shell/chunks/tee-XKJM7HV7.js +2 -0
  210. package/dist/bin/shell/chunks/time-RPVNTV72.js +2 -0
  211. package/dist/bin/shell/chunks/timeout-4QMASFQG.js +2 -0
  212. package/dist/bin/shell/chunks/tr-A6IXSBQX.js +2 -0
  213. package/dist/bin/shell/chunks/unexpand-UCJETXUX.js +2 -0
  214. package/dist/bin/shell/chunks/uniq-2KXDTNDX.js +2 -0
  215. package/dist/bin/shell/chunks/wc-KTXPMRYY.js +2 -0
  216. package/dist/bin/shell/chunks/xan-BCGRY7KM.js +2 -0
  217. package/dist/bin/shell/chunks/xan-view-JFFJAU35.js +2 -0
  218. package/dist/bin/shell/chunks/xargs-EWL5DXR3.js +2 -0
  219. package/dist/bin/shell/chunks/yq-TKCR3BPF.js +2 -0
  220. package/dist/bin/shell/shell.js +284 -284
  221. package/dist/bundle/browser.js +712 -710
  222. package/dist/bundle/chunks/awk2-RXRC54TM.js +1 -0
  223. package/dist/bundle/chunks/base64-FJOOBRMC.js +1 -0
  224. package/dist/bundle/chunks/bash-4WLDO24C.js +1 -0
  225. package/dist/bundle/chunks/cat-VQEWZT5O.js +1 -0
  226. package/dist/bundle/chunks/{chunk-IVYA2HK4.js → chunk-2CDK4MMW.js} +72 -72
  227. package/dist/bundle/chunks/chunk-2TRDZQLB.js +17 -0
  228. package/dist/bundle/chunks/chunk-5DI2YNX7.js +10 -0
  229. package/dist/bundle/chunks/chunk-6N5CMDSQ.js +9 -0
  230. package/dist/bundle/chunks/{chunk-F23WWYKW.js → chunk-7P5JCWX5.js} +5 -5
  231. package/dist/bundle/chunks/chunk-7RIQPKJE.js +2 -0
  232. package/dist/bundle/chunks/{chunk-APT7OOP2.js → chunk-7ZUB672J.js} +1 -1
  233. package/dist/bundle/chunks/chunk-AH77CRWX.js +1 -0
  234. package/dist/bundle/chunks/{chunk-YSHZL3MF.js → chunk-B74TABJS.js} +3 -3
  235. package/dist/bundle/chunks/{chunk-QJ7O6ZN3.js → chunk-BAXBSHE5.js} +3 -3
  236. package/dist/bundle/chunks/{chunk-43RSSTFA.js → chunk-BGSUD5R5.js} +1 -1
  237. package/dist/bundle/chunks/chunk-CHRGJY5U.js +10 -0
  238. package/dist/bundle/chunks/chunk-CYJSRRNG.js +4 -0
  239. package/dist/bundle/chunks/{chunk-VBEY5J6R.js → chunk-DFS4EHCX.js} +23 -23
  240. package/dist/bundle/chunks/chunk-DIB23V32.js +8 -0
  241. package/dist/bundle/chunks/chunk-DMJSDIQO.js +6 -0
  242. package/dist/bundle/chunks/chunk-DRGAV7ST.js +11 -0
  243. package/dist/bundle/chunks/chunk-DZCB42NK.js +2 -0
  244. package/dist/bundle/chunks/{chunk-DCAAORBQ.js → chunk-EIUAYBIC.js} +1 -1
  245. package/dist/bundle/chunks/chunk-FGB5UXEW.js +15 -0
  246. package/dist/bundle/chunks/chunk-G22IYMH5.js +16 -0
  247. package/dist/bundle/chunks/chunk-GFPLGF6W.js +5 -0
  248. package/dist/bundle/chunks/chunk-HCKS7PTH.js +10 -0
  249. package/dist/bundle/chunks/{chunk-5V6VZH6T.js → chunk-HKY7IG73.js} +1 -1
  250. package/dist/bundle/chunks/chunk-IIJDG7QW.js +13 -0
  251. package/dist/bundle/chunks/{chunk-Z6LRHWXI.js → chunk-JKZMQVSS.js} +7 -7
  252. package/dist/bundle/chunks/chunk-JMNW4NXI.js +8 -0
  253. package/dist/bundle/chunks/{chunk-GJTDUJ5Q.js → chunk-K6LIBGJA.js} +1 -1
  254. package/dist/bundle/chunks/chunk-KBZ5NVXE.js +5 -0
  255. package/dist/bundle/chunks/chunk-KK2SFKTN.js +13 -0
  256. package/dist/bundle/chunks/{chunk-LTZRCH7N.js → chunk-LBUR6QMO.js} +1 -1
  257. package/dist/bundle/chunks/chunk-MBDW4C5R.js +8 -0
  258. package/dist/bundle/chunks/chunk-MIV7TH6W.js +32 -0
  259. package/dist/bundle/chunks/chunk-MOLNCDQJ.js +5 -0
  260. package/dist/bundle/chunks/chunk-OYFKMNOH.js +4 -0
  261. package/dist/bundle/chunks/{chunk-62RKD26F.js → chunk-Q7DN34BC.js} +6 -6
  262. package/dist/bundle/chunks/chunk-RGAX6VXO.js +6 -0
  263. package/dist/bundle/chunks/chunk-RHD3NWJY.js +15 -0
  264. package/dist/bundle/chunks/chunk-S7CS4O3M.js +5 -0
  265. package/dist/bundle/chunks/chunk-SFQDTSOG.js +8 -0
  266. package/dist/bundle/chunks/{chunk-BAQA74XA.js → chunk-SNN4IESC.js} +1 -1
  267. package/dist/bundle/chunks/{chunk-64BAICW3.js → chunk-T6RP4YO5.js} +1 -1
  268. package/dist/bundle/chunks/chunk-TWHVX65V.js +4 -0
  269. package/dist/bundle/chunks/chunk-U2ATS66X.js +4 -0
  270. package/dist/bundle/chunks/chunk-UGMTY5A7.js +15 -0
  271. package/dist/bundle/chunks/{chunk-XIZSGUXJ.js → chunk-UKBVVIW7.js} +4 -4
  272. package/dist/bundle/chunks/chunk-USP7VSKV.js +12 -0
  273. package/dist/bundle/chunks/{chunk-D6EWIDSU.js → chunk-UTKQPLMD.js} +13 -13
  274. package/dist/bundle/chunks/{chunk-5PYKJV42.js → chunk-V5MWI2OL.js} +1 -1
  275. package/dist/bundle/chunks/chunk-VQ7OTMJW.js +139 -0
  276. package/dist/bundle/chunks/{chunk-XKQRETAK.js → chunk-WEZK5ELQ.js} +1 -1
  277. package/dist/bundle/chunks/{chunk-YTNYSM6T.js → chunk-WURK7XMI.js} +4 -4
  278. package/dist/bundle/chunks/chunk-WZG5CB4V.js +7 -0
  279. package/dist/bundle/chunks/{chunk-VXBA5RYO.js → chunk-XDXPYGGJ.js} +1 -1
  280. package/dist/bundle/chunks/chunk-XUZRLD2X.js +35 -0
  281. package/dist/bundle/chunks/chunk-YDILEREV.js +7 -0
  282. package/dist/bundle/chunks/column-DCCLCHUR.js +1 -0
  283. package/dist/bundle/chunks/comm-AXP77KC4.js +1 -0
  284. package/dist/bundle/chunks/cut-RBX7IXC7.js +1 -0
  285. package/dist/bundle/chunks/diff-AYXX5MI5.js +1 -0
  286. package/dist/bundle/chunks/env-GBSZDQLS.js +1 -0
  287. package/dist/bundle/chunks/expand-UMGRCDTC.js +1 -0
  288. package/dist/bundle/chunks/{expansion-UGGADTZC.js → expansion-VBDYWVZR.js} +1 -1
  289. package/dist/bundle/chunks/{expr-DNFUYZGY.js → expr-YYCVMXE3.js} +1 -1
  290. package/dist/bundle/chunks/find-DH2ALKQS.js +1 -0
  291. package/dist/bundle/chunks/flag-coverage-FUTMQRVN.js +1 -0
  292. package/dist/bundle/chunks/fold-V23GDLZD.js +1 -0
  293. package/dist/bundle/chunks/grep-7CE2SS3X.js +1 -0
  294. package/dist/bundle/chunks/gzip-EVI6YRMT.js +1 -0
  295. package/dist/bundle/chunks/head-FG33BE3W.js +1 -0
  296. package/dist/bundle/chunks/html-to-markdown-AQHC3PHD.js +1 -0
  297. package/dist/bundle/chunks/join-TLHD7S7W.js +1 -0
  298. package/dist/bundle/chunks/jq-MOOFLU5X.js +1 -0
  299. package/dist/bundle/chunks/{js-exec-VXN6TZ7U.js → js-exec-2U7NEXAP.js} +11 -11
  300. package/dist/bundle/chunks/js-exec-worker.js +70 -7
  301. package/dist/bundle/chunks/md5sum-XMCB7L5Z.js +1 -0
  302. package/dist/bundle/chunks/nl-LBU6FPPF.js +1 -0
  303. package/dist/bundle/chunks/od-O6TPXWVX.js +1 -0
  304. package/dist/bundle/chunks/paste-HIF3YKHC.js +1 -0
  305. package/dist/bundle/chunks/python3-ZR6W2FR3.js +11 -0
  306. package/dist/bundle/chunks/rev-SKETTPXH.js +1 -0
  307. package/dist/bundle/chunks/rg-GMXITNCP.js +1 -0
  308. package/dist/bundle/chunks/sed-YRQXQDMQ.js +1 -0
  309. package/dist/bundle/chunks/sha1sum-ZHNS7PS4.js +1 -0
  310. package/dist/bundle/chunks/sha256sum-YWE2HB65.js +1 -0
  311. package/dist/bundle/chunks/sort-5KALNK6P.js +1 -0
  312. package/dist/bundle/chunks/split-4CXZNBGE.js +1 -0
  313. package/dist/bundle/chunks/sqlite3-FXN2MHWU.js +1 -0
  314. package/dist/bundle/chunks/sqlite3-worker.js +1728 -0
  315. package/dist/bundle/chunks/strings-7VYWRFIZ.js +1 -0
  316. package/dist/bundle/chunks/tac-74F3WHUM.js +1 -0
  317. package/dist/bundle/chunks/tail-EDLAF4WW.js +1 -0
  318. package/dist/bundle/chunks/tar-RKYTUGDT.js +1 -0
  319. package/dist/bundle/chunks/tee-DUMXETDQ.js +1 -0
  320. package/dist/bundle/chunks/time-U22WPHDM.js +1 -0
  321. package/dist/bundle/chunks/timeout-PWE4AOYD.js +1 -0
  322. package/dist/bundle/chunks/tr-2QSZN4JB.js +1 -0
  323. package/dist/bundle/chunks/unexpand-ZTD2RXS2.js +1 -0
  324. package/dist/bundle/chunks/uniq-DCP6SV3B.js +1 -0
  325. package/dist/bundle/chunks/wc-J6YO4AFR.js +1 -0
  326. package/dist/bundle/chunks/worker.js +21 -7
  327. package/dist/bundle/chunks/xan-CW6JZCU7.js +1 -0
  328. package/dist/bundle/chunks/xan-view-FLG5O7II.js +1 -0
  329. package/dist/bundle/chunks/xargs-LB2QOP6N.js +1 -0
  330. package/dist/bundle/chunks/yq-2NFJOC3M.js +1 -0
  331. package/dist/bundle/index.cjs +870 -868
  332. package/dist/bundle/index.js +250 -250
  333. package/dist/commands/js-exec/js-exec-worker.d.ts +2 -0
  334. package/dist/commands/search-engine/matcher.d.ts +6 -0
  335. package/dist/commands/search-engine/regex.d.ts +13 -0
  336. package/dist/commands/sqlite3/sqlite3.d.ts +1 -0
  337. package/dist/commands/sqlite3/worker.js +1728 -0
  338. package/dist/commands/worker-bridge/bridge-handler.d.ts +3 -1
  339. package/dist/commands/worker-bridge/protocol.d.ts +1 -0
  340. package/dist/commands/worker-bridge/sync-backend.d.ts +5 -0
  341. package/dist/encoding.d.ts +115 -0
  342. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +2 -0
  343. package/dist/fs/interface.d.ts +23 -1
  344. package/dist/fs/mountable-fs/mountable-fs.d.ts +2 -0
  345. package/dist/fs/overlay-fs/overlay-fs.d.ts +2 -0
  346. package/dist/fs/read-write-fs/read-write-fs.d.ts +2 -0
  347. package/dist/index.d.cts +2 -0
  348. package/dist/index.d.ts +2 -0
  349. package/dist/interpreter/interpreter.d.ts +2 -0
  350. package/dist/interpreter/types.d.ts +5 -0
  351. package/dist/network/dns-pin.d.ts +43 -0
  352. package/dist/types.d.ts +50 -6
  353. package/dist/utils/file-reader.d.ts +12 -5
  354. package/package.json +37 -35
  355. package/vendor/cpython-emscripten/python.wasm +0 -0
  356. package/dist/bin/chunks/awk2-RSUCURL4.js +0 -2
  357. package/dist/bin/chunks/base64-43M2R3GA.js +0 -2
  358. package/dist/bin/chunks/bash-6ZHZ6BX7.js +0 -2
  359. package/dist/bin/chunks/cat-XZIJZXKP.js +0 -2
  360. package/dist/bin/chunks/chunk-22NDZXS5.js +0 -33
  361. package/dist/bin/chunks/chunk-26NO42TF.js +0 -14
  362. package/dist/bin/chunks/chunk-2W2SCVT6.js +0 -140
  363. package/dist/bin/chunks/chunk-5G2VOPPJ.js +0 -7
  364. package/dist/bin/chunks/chunk-5WFYIUU2.js +0 -3
  365. package/dist/bin/chunks/chunk-AAW7UMPO.js +0 -9
  366. package/dist/bin/chunks/chunk-CGE2EHYP.js +0 -5
  367. package/dist/bin/chunks/chunk-CM4532DS.js +0 -36
  368. package/dist/bin/chunks/chunk-CQG2HEAL.js +0 -5
  369. package/dist/bin/chunks/chunk-E5BDLLK6.js +0 -15
  370. package/dist/bin/chunks/chunk-EUXCM6C4.js +0 -12
  371. package/dist/bin/chunks/chunk-F3LGZXLQ.js +0 -9
  372. package/dist/bin/chunks/chunk-FA2CHD73.js +0 -16
  373. package/dist/bin/chunks/chunk-FLPVVSN5.js +0 -5
  374. package/dist/bin/chunks/chunk-FSZWFMB4.js +0 -16
  375. package/dist/bin/chunks/chunk-GO6FXSC4.js +0 -6
  376. package/dist/bin/chunks/chunk-JQBC3FXE.js +0 -8
  377. package/dist/bin/chunks/chunk-KCMUAACL.js +0 -19
  378. package/dist/bin/chunks/chunk-LGJM5YFT.js +0 -17
  379. package/dist/bin/chunks/chunk-LMK6G2HH.js +0 -8
  380. package/dist/bin/chunks/chunk-MRP4ZCD7.js +0 -6
  381. package/dist/bin/chunks/chunk-OBI37ZY4.js +0 -9
  382. package/dist/bin/chunks/chunk-PXVBSPBE.js +0 -2
  383. package/dist/bin/chunks/chunk-RA3TG4UK.js +0 -9
  384. package/dist/bin/chunks/chunk-RBQGQWGV.js +0 -10
  385. package/dist/bin/chunks/chunk-RJSAGJQJ.js +0 -11
  386. package/dist/bin/chunks/chunk-ROJPSS6N.js +0 -3
  387. package/dist/bin/chunks/chunk-S7OHMN3F.js +0 -6
  388. package/dist/bin/chunks/chunk-TTNNO45C.js +0 -17
  389. package/dist/bin/chunks/chunk-WWZVR5NN.js +0 -6
  390. package/dist/bin/chunks/chunk-XXCTETRW.js +0 -11
  391. package/dist/bin/chunks/chunk-YEKSVVRC.js +0 -11
  392. package/dist/bin/chunks/chunk-ZA4HUKJ3.js +0 -13
  393. package/dist/bin/chunks/chunk-ZKC5HQYO.js +0 -14
  394. package/dist/bin/chunks/column-XGV32UPN.js +0 -2
  395. package/dist/bin/chunks/comm-R3F3Z5DX.js +0 -2
  396. package/dist/bin/chunks/cut-5EY2XPXX.js +0 -2
  397. package/dist/bin/chunks/diff-5NUI5BHG.js +0 -2
  398. package/dist/bin/chunks/env-NTPN5QYM.js +0 -2
  399. package/dist/bin/chunks/expand-26XPP5KB.js +0 -2
  400. package/dist/bin/chunks/find-7CVMEZBO.js +0 -2
  401. package/dist/bin/chunks/flag-coverage-OH2CJRFX.js +0 -2
  402. package/dist/bin/chunks/fold-XSVNTAWH.js +0 -2
  403. package/dist/bin/chunks/grep-7BJ7HFBM.js +0 -2
  404. package/dist/bin/chunks/gzip-LHOO65AN.js +0 -2
  405. package/dist/bin/chunks/head-YMNRW3F3.js +0 -2
  406. package/dist/bin/chunks/html-to-markdown-V6PK6S5U.js +0 -2
  407. package/dist/bin/chunks/join-Y4Q5WVVE.js +0 -2
  408. package/dist/bin/chunks/jq-4JWOFG7X.js +0 -2
  409. package/dist/bin/chunks/md5sum-NCLXV2S3.js +0 -2
  410. package/dist/bin/chunks/nl-XH3L75DR.js +0 -2
  411. package/dist/bin/chunks/od-52FBC34W.js +0 -2
  412. package/dist/bin/chunks/paste-3UVLMQ2K.js +0 -2
  413. package/dist/bin/chunks/python3-JUJKPBFB.js +0 -12
  414. package/dist/bin/chunks/rev-UHEPS2UL.js +0 -2
  415. package/dist/bin/chunks/rg-DK6FRF6Q.js +0 -2
  416. package/dist/bin/chunks/sed-WWXBUNG3.js +0 -2
  417. package/dist/bin/chunks/sha1sum-BHNJ5ALF.js +0 -2
  418. package/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +0 -2
  419. package/dist/bin/chunks/sort-7GENYU2I.js +0 -2
  420. package/dist/bin/chunks/split-YWV64TJH.js +0 -2
  421. package/dist/bin/chunks/sqlite3-CVNFMP3Z.js +0 -2
  422. package/dist/bin/chunks/strings-XXKZCWY5.js +0 -2
  423. package/dist/bin/chunks/tac-T42SKDDI.js +0 -2
  424. package/dist/bin/chunks/tail-V537TDFR.js +0 -2
  425. package/dist/bin/chunks/tar-GTGFEWDS.js +0 -2
  426. package/dist/bin/chunks/tee-HK2SYCAR.js +0 -2
  427. package/dist/bin/chunks/time-5R4QWCYF.js +0 -2
  428. package/dist/bin/chunks/timeout-Z24MNWOP.js +0 -2
  429. package/dist/bin/chunks/tr-4FPGAEVB.js +0 -2
  430. package/dist/bin/chunks/unexpand-OYZ7KOYR.js +0 -2
  431. package/dist/bin/chunks/uniq-TMSAIZM3.js +0 -2
  432. package/dist/bin/chunks/wc-ZIV3TFVG.js +0 -2
  433. package/dist/bin/chunks/xan-FKXPSPE5.js +0 -2
  434. package/dist/bin/chunks/xan-view-6J5MMMQB.js +0 -2
  435. package/dist/bin/chunks/xargs-SCYIFXOW.js +0 -2
  436. package/dist/bin/chunks/yq-RGXFWYJN.js +0 -2
  437. package/dist/bin/shell/chunks/awk2-RSUCURL4.js +0 -2
  438. package/dist/bin/shell/chunks/base64-43M2R3GA.js +0 -2
  439. package/dist/bin/shell/chunks/bash-6ZHZ6BX7.js +0 -2
  440. package/dist/bin/shell/chunks/cat-XZIJZXKP.js +0 -2
  441. package/dist/bin/shell/chunks/chunk-22NDZXS5.js +0 -33
  442. package/dist/bin/shell/chunks/chunk-26NO42TF.js +0 -14
  443. package/dist/bin/shell/chunks/chunk-2W2SCVT6.js +0 -140
  444. package/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +0 -7
  445. package/dist/bin/shell/chunks/chunk-5WFYIUU2.js +0 -3
  446. package/dist/bin/shell/chunks/chunk-AAW7UMPO.js +0 -9
  447. package/dist/bin/shell/chunks/chunk-CGE2EHYP.js +0 -5
  448. package/dist/bin/shell/chunks/chunk-CM4532DS.js +0 -36
  449. package/dist/bin/shell/chunks/chunk-CQG2HEAL.js +0 -5
  450. package/dist/bin/shell/chunks/chunk-E5BDLLK6.js +0 -15
  451. package/dist/bin/shell/chunks/chunk-EUXCM6C4.js +0 -12
  452. package/dist/bin/shell/chunks/chunk-F3LGZXLQ.js +0 -9
  453. package/dist/bin/shell/chunks/chunk-FA2CHD73.js +0 -16
  454. package/dist/bin/shell/chunks/chunk-FLPVVSN5.js +0 -5
  455. package/dist/bin/shell/chunks/chunk-FSZWFMB4.js +0 -16
  456. package/dist/bin/shell/chunks/chunk-GO6FXSC4.js +0 -6
  457. package/dist/bin/shell/chunks/chunk-HC7WB764.js +0 -2
  458. package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +0 -8
  459. package/dist/bin/shell/chunks/chunk-KCMUAACL.js +0 -19
  460. package/dist/bin/shell/chunks/chunk-LGJM5YFT.js +0 -17
  461. package/dist/bin/shell/chunks/chunk-LMK6G2HH.js +0 -8
  462. package/dist/bin/shell/chunks/chunk-MRP4ZCD7.js +0 -6
  463. package/dist/bin/shell/chunks/chunk-OBI37ZY4.js +0 -9
  464. package/dist/bin/shell/chunks/chunk-RA3TG4UK.js +0 -9
  465. package/dist/bin/shell/chunks/chunk-RBQGQWGV.js +0 -10
  466. package/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +0 -11
  467. package/dist/bin/shell/chunks/chunk-ROJPSS6N.js +0 -3
  468. package/dist/bin/shell/chunks/chunk-S7OHMN3F.js +0 -6
  469. package/dist/bin/shell/chunks/chunk-TTNNO45C.js +0 -17
  470. package/dist/bin/shell/chunks/chunk-WWZVR5NN.js +0 -6
  471. package/dist/bin/shell/chunks/chunk-XXCTETRW.js +0 -11
  472. package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +0 -11
  473. package/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +0 -13
  474. package/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +0 -14
  475. package/dist/bin/shell/chunks/column-XGV32UPN.js +0 -2
  476. package/dist/bin/shell/chunks/comm-R3F3Z5DX.js +0 -2
  477. package/dist/bin/shell/chunks/cut-5EY2XPXX.js +0 -2
  478. package/dist/bin/shell/chunks/diff-5NUI5BHG.js +0 -2
  479. package/dist/bin/shell/chunks/env-NTPN5QYM.js +0 -2
  480. package/dist/bin/shell/chunks/expand-26XPP5KB.js +0 -2
  481. package/dist/bin/shell/chunks/find-7CVMEZBO.js +0 -2
  482. package/dist/bin/shell/chunks/flag-coverage-OH2CJRFX.js +0 -2
  483. package/dist/bin/shell/chunks/fold-XSVNTAWH.js +0 -2
  484. package/dist/bin/shell/chunks/grep-7BJ7HFBM.js +0 -2
  485. package/dist/bin/shell/chunks/gzip-LHOO65AN.js +0 -2
  486. package/dist/bin/shell/chunks/head-YMNRW3F3.js +0 -2
  487. package/dist/bin/shell/chunks/html-to-markdown-V6PK6S5U.js +0 -2
  488. package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +0 -2
  489. package/dist/bin/shell/chunks/jq-4JWOFG7X.js +0 -2
  490. package/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +0 -2
  491. package/dist/bin/shell/chunks/nl-XH3L75DR.js +0 -2
  492. package/dist/bin/shell/chunks/od-52FBC34W.js +0 -2
  493. package/dist/bin/shell/chunks/paste-3UVLMQ2K.js +0 -2
  494. package/dist/bin/shell/chunks/python3-RRCCYJKA.js +0 -12
  495. package/dist/bin/shell/chunks/rev-UHEPS2UL.js +0 -2
  496. package/dist/bin/shell/chunks/rg-DK6FRF6Q.js +0 -2
  497. package/dist/bin/shell/chunks/sed-WWXBUNG3.js +0 -2
  498. package/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +0 -2
  499. package/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +0 -2
  500. package/dist/bin/shell/chunks/sort-7GENYU2I.js +0 -2
  501. package/dist/bin/shell/chunks/split-YWV64TJH.js +0 -2
  502. package/dist/bin/shell/chunks/sqlite3-CVNFMP3Z.js +0 -2
  503. package/dist/bin/shell/chunks/strings-XXKZCWY5.js +0 -2
  504. package/dist/bin/shell/chunks/tac-T42SKDDI.js +0 -2
  505. package/dist/bin/shell/chunks/tail-V537TDFR.js +0 -2
  506. package/dist/bin/shell/chunks/tar-GTGFEWDS.js +0 -2
  507. package/dist/bin/shell/chunks/tee-HK2SYCAR.js +0 -2
  508. package/dist/bin/shell/chunks/time-5R4QWCYF.js +0 -2
  509. package/dist/bin/shell/chunks/timeout-Z24MNWOP.js +0 -2
  510. package/dist/bin/shell/chunks/tr-4FPGAEVB.js +0 -2
  511. package/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +0 -2
  512. package/dist/bin/shell/chunks/uniq-TMSAIZM3.js +0 -2
  513. package/dist/bin/shell/chunks/wc-ZIV3TFVG.js +0 -2
  514. package/dist/bin/shell/chunks/xan-FKXPSPE5.js +0 -2
  515. package/dist/bin/shell/chunks/xan-view-6J5MMMQB.js +0 -2
  516. package/dist/bin/shell/chunks/xargs-SCYIFXOW.js +0 -2
  517. package/dist/bin/shell/chunks/yq-RGXFWYJN.js +0 -2
  518. package/dist/bundle/chunks/awk2-JFGEGLFP.js +0 -1
  519. package/dist/bundle/chunks/base64-4YMZCVJ5.js +0 -1
  520. package/dist/bundle/chunks/bash-IJWYRKFO.js +0 -1
  521. package/dist/bundle/chunks/cat-RDUMLXKC.js +0 -1
  522. package/dist/bundle/chunks/chunk-55VFSPNA.js +0 -2
  523. package/dist/bundle/chunks/chunk-7ESWU5HP.js +0 -14
  524. package/dist/bundle/chunks/chunk-7L36YK2X.js +0 -2
  525. package/dist/bundle/chunks/chunk-A7ICOL4V.js +0 -13
  526. package/dist/bundle/chunks/chunk-B53Y5JFV.js +0 -8
  527. package/dist/bundle/chunks/chunk-D4J545R4.js +0 -11
  528. package/dist/bundle/chunks/chunk-D6CWQ5DW.js +0 -5
  529. package/dist/bundle/chunks/chunk-DBKNVD4L.js +0 -9
  530. package/dist/bundle/chunks/chunk-EIZGF4BS.js +0 -8
  531. package/dist/bundle/chunks/chunk-GXVXFKBA.js +0 -5
  532. package/dist/bundle/chunks/chunk-HDQ56CKY.js +0 -15
  533. package/dist/bundle/chunks/chunk-HWBSOZZR.js +0 -35
  534. package/dist/bundle/chunks/chunk-I57KEIP3.js +0 -10
  535. package/dist/bundle/chunks/chunk-JVPRLUMK.js +0 -7
  536. package/dist/bundle/chunks/chunk-KMEYNNUA.js +0 -15
  537. package/dist/bundle/chunks/chunk-KX3P26DQ.js +0 -1
  538. package/dist/bundle/chunks/chunk-LWEGUNWT.js +0 -7
  539. package/dist/bundle/chunks/chunk-MDLLFABN.js +0 -4
  540. package/dist/bundle/chunks/chunk-MHTUABJP.js +0 -8
  541. package/dist/bundle/chunks/chunk-MYE6AGBJ.js +0 -16
  542. package/dist/bundle/chunks/chunk-NAERJDUW.js +0 -8
  543. package/dist/bundle/chunks/chunk-P7UWRQ44.js +0 -139
  544. package/dist/bundle/chunks/chunk-PP6PSHAB.js +0 -4
  545. package/dist/bundle/chunks/chunk-PYDZ2LCK.js +0 -16
  546. package/dist/bundle/chunks/chunk-PYSFUGCK.js +0 -10
  547. package/dist/bundle/chunks/chunk-QCDB2VPH.js +0 -6
  548. package/dist/bundle/chunks/chunk-SDNKECQQ.js +0 -5
  549. package/dist/bundle/chunks/chunk-TLSUDHID.js +0 -6
  550. package/dist/bundle/chunks/chunk-TOMNU26N.js +0 -4
  551. package/dist/bundle/chunks/chunk-TXBZCHCQ.js +0 -5
  552. package/dist/bundle/chunks/chunk-U6NMAV24.js +0 -32
  553. package/dist/bundle/chunks/chunk-VJFXDYWH.js +0 -10
  554. package/dist/bundle/chunks/chunk-VYOJP4TV.js +0 -13
  555. package/dist/bundle/chunks/chunk-WKFATFPP.js +0 -4
  556. package/dist/bundle/chunks/chunk-Z7JVV2SM.js +0 -12
  557. package/dist/bundle/chunks/column-WLPMMSTS.js +0 -1
  558. package/dist/bundle/chunks/comm-5SLSESQG.js +0 -1
  559. package/dist/bundle/chunks/cut-OPC3VAGB.js +0 -1
  560. package/dist/bundle/chunks/diff-HJF2MPDN.js +0 -1
  561. package/dist/bundle/chunks/env-5EPCWSXR.js +0 -1
  562. package/dist/bundle/chunks/expand-DTNXU4LQ.js +0 -1
  563. package/dist/bundle/chunks/find-KNMMLVJD.js +0 -1
  564. package/dist/bundle/chunks/flag-coverage-3WZU3PW6.js +0 -1
  565. package/dist/bundle/chunks/fold-LDSORVYE.js +0 -1
  566. package/dist/bundle/chunks/grep-2UMHPO7Y.js +0 -1
  567. package/dist/bundle/chunks/gzip-AQXSGOVS.js +0 -1
  568. package/dist/bundle/chunks/head-HT2B6D2J.js +0 -1
  569. package/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +0 -1
  570. package/dist/bundle/chunks/join-GG2LDHE5.js +0 -1
  571. package/dist/bundle/chunks/jq-CRLZNLQG.js +0 -1
  572. package/dist/bundle/chunks/md5sum-INMIK4DX.js +0 -1
  573. package/dist/bundle/chunks/nl-U5YJDM32.js +0 -1
  574. package/dist/bundle/chunks/od-VJEF2UR5.js +0 -1
  575. package/dist/bundle/chunks/paste-7N6AFSDS.js +0 -1
  576. package/dist/bundle/chunks/python3-BFV3N3GY.js +0 -11
  577. package/dist/bundle/chunks/rev-XOSYPP45.js +0 -1
  578. package/dist/bundle/chunks/rg-KYSTAD4Q.js +0 -1
  579. package/dist/bundle/chunks/sed-OFX3F4FE.js +0 -1
  580. package/dist/bundle/chunks/sha1sum-VJPNLNU6.js +0 -1
  581. package/dist/bundle/chunks/sha256sum-PI32XWXY.js +0 -1
  582. package/dist/bundle/chunks/sort-DCNRDA7U.js +0 -1
  583. package/dist/bundle/chunks/split-SITCSYCZ.js +0 -1
  584. package/dist/bundle/chunks/sqlite3-56UMWEY3.js +0 -1
  585. package/dist/bundle/chunks/strings-7PLOGTPD.js +0 -1
  586. package/dist/bundle/chunks/tac-SJGXQ4T2.js +0 -1
  587. package/dist/bundle/chunks/tail-S5ULNTJU.js +0 -1
  588. package/dist/bundle/chunks/tar-LYLTEJV3.js +0 -1
  589. package/dist/bundle/chunks/tee-O7VXZDCO.js +0 -1
  590. package/dist/bundle/chunks/time-DEUO3QV2.js +0 -1
  591. package/dist/bundle/chunks/timeout-VRKMCG72.js +0 -1
  592. package/dist/bundle/chunks/tr-2HXZRDSW.js +0 -1
  593. package/dist/bundle/chunks/unexpand-RGTMIGZM.js +0 -1
  594. package/dist/bundle/chunks/uniq-SUNANL47.js +0 -1
  595. package/dist/bundle/chunks/wc-TQB3VNOX.js +0 -1
  596. package/dist/bundle/chunks/xan-DHUKCGIW.js +0 -1
  597. package/dist/bundle/chunks/xan-view-OW2TB7Z3.js +0 -1
  598. package/dist/bundle/chunks/xargs-I6EZUCYF.js +0 -1
  599. package/dist/bundle/chunks/yq-NDDDSAXH.js +0 -1
@@ -0,0 +1,5 @@
1
+ import{a as T}from"./chunk-DZCB42NK.js";import{c as b}from"./chunk-AH77CRWX.js";import{a as M}from"./chunk-HWKDQ44K.js";import{a as S,b as F}from"./chunk-74CEPOFO.js";var H={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},O={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},N={name:"wc",async execute(a,f){if(F(a))return S(H);let s=M("wc",a,O);if(!s.ok)return s.error;let{lines:o,words:n}=s.result.flags,l=s.result.flags.bytes,e=s.result.flags.chars,t=s.result.positional;!o&&!n&&!l&&!e&&(o=n=l=!0);let c=l||e,i=await T(f,t,{cmdName:"wc",stopOnError:!1});if(t.length===0){let r=C(i.files[0].content,e);return{stdout:`${x(r,o,n,c,"",0)}
2
+ `,stderr:"",exitCode:0}}let d=[],m=0,g=0,u=0;for(let{filename:r,content:y}of i.files){let p=C(y,e);m+=p.lines,g+=p.words,u+=p.third,d.push({filename:r,stats:p})}let L=t.length>1?m:Math.max(...d.map(r=>r.stats.lines)),$=t.length>1?g:Math.max(...d.map(r=>r.stats.words)),B=t.length>1?u:Math.max(...d.map(r=>r.stats.third)),h=t.length>1?3:0;o&&(h=Math.max(h,String(L).length)),n&&(h=Math.max(h,String($).length)),c&&(h=Math.max(h,String(B).length));let w="";for(let{filename:r,stats:y}of d)w+=`${x(y,o,n,c,r,h)}
3
+ `;return t.length>1&&(w+=`${x({lines:m,words:g,third:u},o,n,c,"total",h)}
4
+ `),{stdout:w,stderr:i.stderr,exitCode:i.exitCode}}};function C(a,f){let s=a,o=s.length,n=f?Array.from(b(a)).length:o,l=0,e=0,t=!1;for(let c=0;c<o;c++){let i=s[c];i===`
5
+ `?(l++,t&&(e++,t=!1)):i===" "||i===" "||i==="\r"?t&&(e++,t=!1):t=!0}return t&&e++,{lines:l,words:e,third:n}}function x(a,f,s,o,n,l){let e=[];f&&e.push(String(a.lines).padStart(l)),s&&e.push(String(a.words).padStart(l)),o&&e.push(String(a.third).padStart(l));let t=e.join(" ");return n&&(t+=` ${n}`),t}var j={name:"wc",flags:[{flag:"-l",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-m",type:"boolean"}],stdinType:"text",needsFiles:!0};export{N as a,j as b};
@@ -0,0 +1,13 @@
1
+ import{c as j,d as y}from"./chunk-AH77CRWX.js";import{a as g,b as v,c as F}from"./chunk-74CEPOFO.js";var N={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};function I(i,s){return s?i.split(s):i.split(/[ \t]+/).filter(n=>n.length>0)}function L(i,s,n,f){let e=I(i,s),r=e[n-1]??"";return f&&(r=r.toLowerCase()),{fields:e,joinKey:r,original:i}}function m(i,s,n){let f=n.separator??" ";if(n.outputFormat){let l=[];for(let{file:c,field:p}of n.outputFormat){let a=c===1?i:s;a&&p===0?l.push(a.joinKey):a&&a.fields[p-1]!==void 0?l.push(a.fields[p-1]):l.push(n.emptyString)}return l.join(f)}let e=[],r=i?.joinKey??s?.joinKey??"";if(e.push(r),i)for(let l=0;l<i.fields.length;l++)l!==n.field1-1&&e.push(i.fields[l]);if(s)for(let l=0;l<s.fields.length;l++)l!==n.field2-1&&e.push(s.fields[l]);return e.join(f)}function U(i){let s=i.split(","),n=[];for(let f of s){let e=f.trim().match(/^(\d+)\.(\d+)$/);if(!e)return null;let r=Number.parseInt(e[1],10),l=Number.parseInt(e[2],10);if(r!==1&&r!==2)return null;n.push({file:r,field:l})}return n}var E={name:"join",execute:async(i,s)=>{if(v(i))return g(N);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},f=[],e=0;for(;e<i.length;){let t=i[e];if(t==="-1"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
2
+ `};n.field1=o,e+=2}else if(t==="-2"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
3
+ `};n.field2=o,e+=2}else if((t==="-t"||t==="--field-separator")&&e+1<i.length)n.separator=i[e+1],e+=2;else if(t.startsWith("-t")&&t.length>2)n.separator=t.slice(2),e++;else if(t==="-a"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
4
+ `};n.printUnpairable.add(o),e+=2}else if(t.match(/^-a[12]$/))n.printUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-v"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
5
+ `};n.onlyUnpairable.add(o),e+=2}else if(t.match(/^-v[12]$/))n.onlyUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-e"&&e+1<i.length)n.emptyString=i[e+1],e+=2;else if(t==="-o"&&e+1<i.length){let o=U(i[e+1]);if(!o)return{exitCode:1,stdout:"",stderr:`join: invalid field spec: '${i[e+1]}'
6
+ `};n.outputFormat=o,e+=2}else if(t==="-i"||t==="--ignore-case")n.ignoreCase=!0,e++;else if(t==="--"){f.push(...i.slice(e+1));break}else{if(t.startsWith("-")&&t!=="-")return F("join",t);f.push(t),e++}}if(f.length!==2)return{exitCode:1,stdout:"",stderr:f.length<2?`join: missing file operand
7
+ `:`join: extra operand
8
+ `};let r=[];for(let t of f)if(t==="-")r.push(j(s.stdin)??"");else{let o=s.fs.resolvePath(s.cwd,t),u=await s.fs.readFile(o);if(u===null)return{exitCode:1,stdout:"",stderr:`join: ${t}: No such file or directory
9
+ `};r.push(u)}let l=(t,o)=>{let u=t.split(`
10
+ `);return t.endsWith(`
11
+ `)&&u[u.length-1]===""&&u.pop(),u.filter(h=>h.length>0).map(h=>L(h,n.separator,o,n.ignoreCase))},c=l(r[0],n.field1),p=l(r[1],n.field2),a=new Map;for(let t of p){let o=a.get(t.joinKey);o?o.push(t):a.set(t.joinKey,[t])}let d=[],b=new Set;for(let t of c){let o=a.get(t.joinKey);if(o&&o.length>0){if(b.add(t.joinKey),n.onlyUnpairable.size===0)for(let u of o)d.push(m(t,u,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&d.push(m(t,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let t of p)b.has(t.joinKey)||d.push(m(null,t,n));return{exitCode:0,stdout:y(d.length>0?`${d.join(`
12
+ `)}
13
+ `:""),stderr:"",stdoutEncoding:"binary"}}},H={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,H as b};
@@ -28,4 +28,4 @@ When no FILE is given, or when FILE is -, read from standard input.`,options:["-
28
28
  `,exitCode:1};try{return v(s,I(e)),r.verbose?{stdout:"",stderr:`${t}: OK
29
29
  `,exitCode:0}:{stdout:"",stderr:"",exitCode:0}}catch(n){let a=n instanceof Error?n.message:"invalid";return{stdout:"",stderr:`${o}: ${t}: ${a}
30
30
  `,exitCode:1}}}async function C(e,t,r){let o=r==="zcat"?D:r==="gunzip"?U:O;if(w(e))return z(o);let s=$(r,e,T);if(!s.ok)return s.error.stderr.includes("unrecognized option"),s.error;let n=s.result.flags,a=s.result.positional,f=r==="gunzip"||r==="zcat"||n.decompress||n.uncompress,p=r==="zcat"||n.stdout||n.toStdout;if(n.list){a.length===0&&(a=["-"]);let l=` compressed uncompressed ratio uncompressed_name
31
- `,u="",g=0;for(let y of a){let h=await W(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}if(n.test){a.length===0&&(a=["-"]);let l="",u="",g=0;for(let y of a){let h=await A(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}a.length===0&&(a=["-"]);let d="",c="",i=0;for(let l of a){let u=await L(t,l,n,r,f,p);d+=u.stdout,c+=u.stderr,u.exitCode!==0&&(i=u.exitCode)}return{stdout:d,stderr:c,exitCode:i}}var G={name:"gzip",async execute(e,t){return{...await C(e,t,"gzip"),stdoutEncoding:"binary"}}},M={name:"gunzip",async execute(e,t){return{...await C(e,t,"gunzip"),stdoutEncoding:"binary"}}},Z={name:"zcat",async execute(e,t){return{...await C(e,t,"zcat"),stdoutEncoding:"binary"}}},R={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},K={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},j={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0};export{G as a,M as b,Z as c,R as d,K as e,j as f};
31
+ `,u="",g=0;for(let y of a){let h=await W(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}if(n.test){a.length===0&&(a=["-"]);let l="",u="",g=0;for(let y of a){let h=await A(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}a.length===0&&(a=["-"]);let d="",c="",i=0;for(let l of a){let u=await L(t,l,n,r,f,p);d+=u.stdout,c+=u.stderr,u.exitCode!==0&&(i=u.exitCode)}return{stdout:d,stderr:c,exitCode:i}}var Z={name:"gzip",async execute(e,t){return{...await C(e,t,"gzip"),stdoutEncoding:"binary"}}},R={name:"gunzip",async execute(e,t){return{...await C(e,t,"gunzip"),stdoutEncoding:"binary"}}},K={name:"zcat",async execute(e,t){return{...await C(e,t,"zcat"),stdoutEncoding:"binary"}}},j={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},J={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},Q={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0};export{Z as a,R as b,K as c,j as d,J as e,Q as f};
@@ -0,0 +1,8 @@
1
+ import{a as d}from"./chunk-OJDRYQWQ.js";import{a as f,b as m,c}from"./chunk-74CEPOFO.js";var g={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},M={name:"env",async execute(o,i){if(m(o))return f(g);let a=!1,r=[],u=new Map,t=-1;for(let n=0;n<o.length;n++){let e=o[n];if(e==="-i"||e==="--ignore-environment")a=!0;else if(e==="-u"&&n+1<o.length)r.push(o[++n]);else if(e.startsWith("-u"))r.push(e.slice(2));else if(e.startsWith("--unset="))r.push(e.slice(8));else{if(e.startsWith("--")&&e!=="--")return c("env",e);if(e.startsWith("-")&&e!=="-"){for(let l of e.slice(1))if(l!=="i"&&l!=="u")return c("env",`-${l}`);e.includes("i")&&(a=!0)}else if(e.includes("=")&&t===-1){let l=e.indexOf("="),v=e.slice(0,l),h=e.slice(l+1);u.set(v,h)}else{t=n;break}}}let s;if(a)s=new Map(u);else{s=new Map(i.env);for(let n of r)s.delete(n);for(let[n,e]of u)s.set(n,e)}if(t===-1){let n=[];for(let[e,l]of s)n.push(`${e}=${l}`);return{stdout:n.join(`
2
+ `)+(n.length>0?`
3
+ `:""),stderr:"",exitCode:0}}if(!i.exec)return{stdout:"",stderr:`env: command execution not supported in this context
4
+ `,exitCode:1};let p=o.slice(t);return i.exec("command",{cwd:i.cwd,env:d(s),replaceEnv:!0,stdin:i.stdin,stdinKind:"bytes",signal:i.signal,args:p})}},y={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},N={name:"printenv",async execute(o,i){if(m(o))return f(y);let a=o.filter(t=>!t.startsWith("-"));if(a.length===0){let t=[];for(let[s,p]of i.env)t.push(`${s}=${p}`);return{stdout:t.join(`
5
+ `)+(t.length>0?`
6
+ `:""),stderr:"",exitCode:0}}let r=[],u=0;for(let t of a){let s=i.env.get(t);s!==void 0?r.push(s):u=1}return{stdout:r.join(`
7
+ `)+(r.length>0?`
8
+ `:""),stderr:"",exitCode:u}}},C={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},F={name:"printenv",flags:[]};export{M as a,N as b,C as c,F as d};
@@ -0,0 +1,32 @@
1
+ import{f as G}from"./chunk-7TSDKFEO.js";import{a as z,b as E,c as U}from"./chunk-2TRDZQLB.js";import{a as q}from"./chunk-IPJHKYVM.js";import{a as $}from"./chunk-B74TABJS.js";import{c as L}from"./chunk-AH77CRWX.js";import{a as B,b as _,c as D}from"./chunk-74CEPOFO.js";var H=G({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),M=class{types;constructor(){this.types=new Map(Object.entries(H).map(([t,n])=>[t,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(t){let n=t.indexOf(":");if(n===-1)return;let s=t.slice(0,n),r=t.slice(n+1);if(r.startsWith("include:")){let l=r.slice(8),i=this.types.get(l);if(i){let a=this.types.get(s)||{extensions:[],globs:[]};a.extensions.push(...i.extensions),a.globs.push(...i.globs),this.types.set(s,a)}}else{let l=this.types.get(s)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let i=r.slice(1);l.extensions.includes(i)||l.extensions.push(i)}else l.globs.includes(r)||l.globs.push(r);this.types.set(s,l)}}clearType(t){let n=this.types.get(t);n&&(n.extensions=[],n.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,n){let s=t.toLowerCase();for(let r of n){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let l=this.types.get(r);if(l){for(let i of l.extensions)if(s.endsWith(i))return!0;for(let i of l.globs)if(i.includes("*")){let a=i.replace(/\./g,"\\.").replace(/\*/g,".*");if($(`^${a}$`,"i").test(t))return!0}else if(s===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let s of this.types.values()){for(let r of s.extensions)if(n.endsWith(r))return!0;for(let r of s.globs)if(r.includes("*")){let l=r.replace(/\./g,"\\.").replace(/\*/g,".*");if($(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function V(){let e=[];for(let[t,n]of Object.entries(H).sort()){let s=[];for(let r of n.extensions)s.push(`*${r}`);for(let r of n.globs)s.push(r);e.push(`${t}: ${s.join(", ")}`)}return`${e.join(`
2
+ `)}
3
+ `}function Z(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function se(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return n*1024;case"M":return n*1024*1024;case"G":return n*1024*1024*1024;default:return n}}function ne(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
4
+ `,exitCode:1}}function J(e){return null}var Y=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:J},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:J},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:se,validate:ne},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",ignored:!0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],re=new Map([["i",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["--ignore-case",e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],["s",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["--case-sensitive",e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],["S",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["--smart-case",e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],["F",e=>{e.fixedStrings=!0}],["--fixed-strings",e=>{e.fixedStrings=!0}],["w",e=>{e.wordRegexp=!0}],["--word-regexp",e=>{e.wordRegexp=!0}],["x",e=>{e.lineRegexp=!0}],["--line-regexp",e=>{e.lineRegexp=!0}],["v",e=>{e.invertMatch=!0}],["--invert-match",e=>{e.invertMatch=!0}],["U",e=>{e.multiline=!0}],["--multiline",e=>{e.multiline=!0}],["--multiline-dotall",e=>{e.multilineDotall=!0,e.multiline=!0}],["c",e=>{e.count=!0}],["--count",e=>{e.count=!0}],["--count-matches",e=>{e.countMatches=!0}],["l",e=>{e.filesWithMatches=!0}],["--files",e=>{e.files=!0}],["--files-with-matches",e=>{e.filesWithMatches=!0}],["--files-without-match",e=>{e.filesWithoutMatch=!0}],["--stats",e=>{e.stats=!0}],["o",e=>{e.onlyMatching=!0}],["--only-matching",e=>{e.onlyMatching=!0}],["q",e=>{e.quiet=!0}],["--quiet",e=>{e.quiet=!0}],["N",e=>{e.lineNumber=!1}],["--no-line-number",e=>{e.lineNumber=!1}],["H",e=>{e.withFilename=!0}],["--with-filename",e=>{e.withFilename=!0}],["I",e=>{e.noFilename=!0}],["--no-filename",e=>{e.noFilename=!0}],["0",e=>{e.nullSeparator=!0}],["--null",e=>{e.nullSeparator=!0}],["b",e=>{e.byteOffset=!0}],["--byte-offset",e=>{e.byteOffset=!0}],["--column",e=>{e.column=!0,e.lineNumber=!0}],["--no-column",e=>{e.column=!1}],["--vimgrep",e=>{e.vimgrep=!0,e.column=!0,e.lineNumber=!0}],["--json",e=>{e.json=!0}],["--hidden",e=>{e.hidden=!0}],["--no-ignore",e=>{e.noIgnore=!0}],["--no-ignore-dot",e=>{e.noIgnoreDot=!0}],["--no-ignore-vcs",e=>{e.noIgnoreVcs=!0}],["L",e=>{e.followSymlinks=!0}],["--follow",e=>{e.followSymlinks=!0}],["z",e=>{e.searchZip=!0}],["--search-zip",e=>{e.searchZip=!0}],["a",e=>{e.searchBinary=!0}],["--text",e=>{e.searchBinary=!0}],["--heading",e=>{e.heading=!0}],["--passthru",e=>{e.passthru=!0}],["--include-zero",e=>{e.includeZero=!0}],["--glob-case-insensitive",e=>{e.globCaseInsensitive=!0}]]),ie=new Set(["n","--line-number"]);function le(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function oe(e,t,n){let s=e[t];for(let r of Y){if(s.startsWith(`--${r.long}=`)){let l=s.slice(`--${r.long}=`.length),i=P(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s.startsWith(`-${r.short}`)&&s.length>2){let l=s.slice(2),i=P(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s===`-${r.short}`||s===`--${r.long}`){if(t+1>=e.length)return null;let l=e[t+1],i=P(n,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function ae(e){return Y.find(t=>t.short===e)}function P(e,t,n){if(t.validate){let r=t.validate(n);if(r)return r}if(t.ignored||!t.target)return;let s=t.parse?t.parse(n):n;t.multi?e[t.target].push(s):e[t.target]=s}function ce(e,t){let n=e[t];if(n==="--sort"&&t+1<e.length){let s=e[t+1];if(s==="path"||s==="none")return{value:s,newIndex:t+1}}if(n.startsWith("--sort=")){let s=n.slice(7);if(s==="path"||s==="none")return{value:s,newIndex:t}}return null}function fe(e,t){let n=e[t],s=n.match(/^-([ABC])(\d+)$/);return s?{flag:s[1],value:parseInt(s[2],10),newIndex:t}:(n==="-A"||n==="-B"||n==="-C")&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function ue(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function K(e){let t=Z(),n=null,s=[],r=-1,l=-1,i=-1,a=!1;for(let c=0;c<e.length;c++){let o=e[c];if(o.startsWith("-")&&o!=="-"){let u=fe(e,c);if(u){let{flag:f,value:x,newIndex:b}=u;f==="A"?r=Math.max(r,x):f==="B"?l=Math.max(l,x):i=x,c=b;continue}let d=ue(o);if(d!==null){t.maxCount=d;continue}let p=oe(e,c,t);if(p){if(p.error)return{success:!1,error:p.error};c=p.newIndex;continue}let g=ce(e,c);if(g){t.sort=g.value,c=g.newIndex;continue}let w=o.startsWith("--")?[o]:o.slice(1).split(""),m=!1;for(let f of w){if(ie.has(f)){t.lineNumber=!0,a=!0;continue}if(f==="u"||f==="--unrestricted"){le(t);continue}if(f==="P"||f==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
5
+ `,exitCode:1}};if(f.length===1){let b=ae(f);if(b){if(c+1>=e.length)return{success:!1,error:D("rg",`-${f}`)};let h=P(t,b,e[c+1]);if(h)return{success:!1,error:h};c++,m=!0;continue}}let x=re.get(f);if(x){x(t);continue}if(f.startsWith("--"))return{success:!1,error:D("rg",f)};if(f.length===1)return{success:!1,error:D("rg",`-${f}`)}}}else n===null&&t.patterns.length===0&&t.patternFiles.length===0?n=o:s.push(o)}return(r>=0||i>=0)&&(t.afterContext=Math.max(r>=0?r:0,i>=0?i:0)),(l>=0||i>=0)&&(t.beforeContext=Math.max(l>=0?l:0,i>=0?i:0)),n!==null&&t.patterns.push(n),(t.column||t.vimgrep)&&(a=!0),{success:!0,options:t,paths:s,explicitLineNumbers:a}}import{gunzipSync as he}from"node:zlib";var T=class{patterns=[];basePath;constructor(t="/"){this.basePath=t}parse(t){let n=t.split(`
6
+ `);for(let s of n){let r=s.replace(/\s+$/,"");if(!r||r.startsWith("#"))continue;let l=!1;r.startsWith("!")&&(l=!0,r=r.slice(1));let i=!1;r.endsWith("/")&&(i=!0,r=r.slice(0,-1));let a=!1;r.startsWith("/")?(a=!0,r=r.slice(1)):r.includes("/")&&!r.startsWith("**/")&&(a=!0);let c=this.patternToRegex(r,a);this.patterns.push({pattern:s,regex:c,negated:l,directoryOnly:i,rooted:a})}}patternToRegex(t,n){let s="";n?s="^":s="(?:^|/)";let r=0;for(;r<t.length;){let l=t[r];if(l==="*")t[r+1]==="*"?t[r+2]==="/"?(s+="(?:.*/)?",r+=3):(r+2>=t.length,s+=".*",r+=2):(s+="[^/]*",r++);else if(l==="?")s+="[^/]",r++;else if(l==="["){let i=r+1;for(i<t.length&&t[i]==="!"&&i++,i<t.length&&t[i]==="]"&&i++;i<t.length&&t[i]!=="]";)i++;if(i<t.length){let a=t.slice(r,i+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),s+=a,r=i+1}else s+="\\[",r++}else l==="/"?(s+="/",r++):(s+=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r++)}return s+="(?:/.*)?$",$(s)}matches(t,n){let s=t.replace(/^\.\//,"");s=s.replace(/^\//,"");let r=!1;for(let l of this.patterns)l.directoryOnly&&!n||l.regex.test(s)&&(r=!l.negated);return r}isWhitelisted(t,n){let s=t.replace(/^\.\//,"");s=s.replace(/^\//,"");for(let r of this.patterns)if(!(r.directoryOnly&&!n)&&r.negated&&r.regex.test(s))return!0;return!1}getBasePath(){return this.basePath}},k=class{parsers=[];fs;skipDotIgnore;skipVcsIgnore;loadedDirs=new Set;constructor(t,n,s=!1,r=!1){this.fs=t,this.skipDotIgnore=s,this.skipVcsIgnore=r}async load(t){let n=[],s=t;for(;;){n.unshift(s);let l=this.fs.resolvePath(s,"..");if(l===s)break;s=l}let r=[];this.skipVcsIgnore||r.push(".gitignore"),this.skipDotIgnore||r.push(".rgignore",".ignore");for(let l of n){this.loadedDirs.add(l);for(let i of r){let a=this.fs.resolvePath(l,i);try{let c=await this.fs.readFile(a),o=new T(l);o.parse(c),this.parsers.push(o)}catch{}}}}async loadForDirectory(t){if(this.loadedDirs.has(t))return;this.loadedDirs.add(t);let n=[];this.skipVcsIgnore||n.push(".gitignore"),this.skipDotIgnore||n.push(".rgignore",".ignore");for(let s of n){let r=this.fs.resolvePath(t,s);try{let l=await this.fs.readFile(r),i=new T(t);i.parse(l),this.parsers.push(i)}catch{}}}addPatternsFromContent(t,n){let s=new T(n);s.parse(t),this.parsers.push(s)}matches(t,n){for(let s of this.parsers){let r=s.getBasePath();if(!t.startsWith(r))continue;let l=t.slice(r.length).replace(/^\//,"");if(s.matches(l,n))return!0}return!1}isWhitelisted(t,n){for(let s of this.parsers){let r=s.getBasePath();if(!t.startsWith(r))continue;let l=t.slice(r.length).replace(/^\//,"");if(s.isWhitelisted(l,n))return!0}return!1}static isCommonIgnored(t){return new Set(["node_modules",".git",".svn",".hg","__pycache__",".pytest_cache",".mypy_cache","venv",".venv",".next",".nuxt",".cargo"]).has(t)}};async function A(e,t,n=!1,s=!1,r=[]){let l=new k(e,t,n,s);await l.load(t);for(let i of r)try{let a=e.resolvePath(t,i),c=await e.readFile(a);l.addPatternsFromContent(c,t)}catch{}return l}function ge(e){return e.length>=2&&e[0]===31&&e[1]===139}function pe(e){let t=!1;for(let n=0;n<e.length;n++){let s=e[n];s==="["&&!t?t=!0:s==="]"&&t&&(t=!1)}return t?`rg: glob '${e}' has an unclosed character class`:null}async function X(e){let{ctx:t,options:n,paths:s,explicitLineNumbers:r}=e;for(let f of n.globs){let x=f.startsWith("!")?f.slice(1):f,b=pe(x);if(b)return{stdout:"",stderr:`${b}
7
+ `,exitCode:1}}if(n.files){let f=[...n.patterns,...s];return xe(t,f,n)}let l=[...n.patterns];for(let f of n.patternFiles)try{let x;if(f==="-")x=L(t.stdin);else{let h=t.fs.resolvePath(t.cwd,f);x=await t.fs.readFile(h)}let b=x.split(`
8
+ `).filter(h=>h.length>0);l.push(...b)}catch{return{stdout:"",stderr:`rg: ${f}: No such file or directory
9
+ `,exitCode:2}}if(l.length===0)return n.patternFiles.length>0?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`rg: no pattern given
10
+ `,exitCode:2};let i=s.length===0?["."]:s,a=me(n,l),c,o;try{let f=de(l,n,a);c=f.regex,o=f.kResetGroup}catch{return{stdout:"",stderr:`rg: invalid regex: ${l.join(", ")}
11
+ `,exitCode:2}}let u=null;n.noIgnore||(u=await A(t.fs,t.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let d=new M;for(let f of n.typeClear)d.clearType(f);for(let f of n.typeAdd)d.addType(f);let{files:p,singleExplicitFile:g}=await Q(t,i,n,u,d);if(p.length===0)return{stdout:"",stderr:"",exitCode:1};let w=!n.noFilename&&(n.withFilename||!g||p.length>1),m=n.lineNumber;return r||(g&&p.length===1&&(m=!1),n.onlyMatching&&(m=!1)),we(t,p,c,n,w,m,o)}function me(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(n=>/[A-Z]/.test(n)):!1}function de(e,t,n){let s;return e.length===1?s=e[0]:s=e.map(r=>t.fixedStrings?r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):`(?:${r})`).join("|"),E(s,{mode:t.fixedStrings&&e.length===1?"fixed":"perl",ignoreCase:n,wholeWord:t.wordRegexp,lineRegexp:t.lineRegexp,multiline:t.multiline,multilineDotall:t.multilineDotall})}async function Q(e,t,n,s,r){let l=[],i=0,a=0;for(let o of t){let u=e.fs.resolvePath(e.cwd,o);try{let d=await e.fs.stat(u);if(d.isFile){if(i++,n.maxFilesize>0&&d.size>n.maxFilesize)continue;te(o,n,s,u,r)&&l.push(o)}else d.isDirectory&&(a++,await ee(e,o,u,0,n,s,r,l))}catch{}}return{files:n.sort==="path"?l.sort():l,singleExplicitFile:i===1&&a===0}}async function ee(e,t,n,s,r,l,i,a){if(!(s>=r.maxDepth)){l&&await l.loadForDirectory(n);try{let c=e.fs.readdirWithFileTypes?await e.fs.readdirWithFileTypes(n):(await e.fs.readdir(n)).map(o=>({name:o,isFile:void 0}));for(let o of c){let u=o.name;if(!r.noIgnore&&k.isCommonIgnored(u))continue;let d=u.startsWith("."),p=t==="."?u:t==="./"?`./${u}`:t.endsWith("/")?`${t}${u}`:`${t}/${u}`,g=e.fs.resolvePath(n,u),w,m,f=!1;if(o.isFile!==void 0&&"isDirectory"in o){let h=o;if(f=h.isSymbolicLink===!0,f&&!r.followSymlinks)continue;if(f&&r.followSymlinks)try{let y=await e.fs.stat(g);w=y.isFile,m=y.isDirectory}catch{continue}else w=h.isFile,m=h.isDirectory}else try{let h=e.fs.lstat?await e.fs.lstat(g):await e.fs.stat(g);if(f=h.isSymbolicLink===!0,f&&!r.followSymlinks)continue;let y=f&&r.followSymlinks?await e.fs.stat(g):h;w=y.isFile,m=y.isDirectory}catch{continue}if(!l?.matches(g,m)&&!(d&&!r.hidden&&!l?.isWhitelisted(g,m))){if(m)await ee(e,p,g,s+1,r,l,i,a);else if(w){if(r.maxFilesize>0)try{if((await e.fs.stat(g)).size>r.maxFilesize)continue}catch{continue}te(p,r,l,g,i)&&a.push(p)}}}}catch{}}}function te(e,t,n,s,r){let l=e.split("/").pop()||e;if(n?.matches(s,!1)||t.types.length>0&&!r.matchesType(l,t.types)||t.typesNot.length>0&&r.matchesType(l,t.typesNot))return!1;if(t.globs.length>0){let i=t.globCaseInsensitive,a=t.globs.filter(o=>!o.startsWith("!")),c=t.globs.filter(o=>o.startsWith("!")).map(o=>o.slice(1));if(a.length>0){let o=!1;for(let u of a)if(v(l,u,i)||v(e,u,i)){o=!0;break}if(!o)return!1}for(let o of c)if(o.startsWith("/")){let u=o.slice(1);if(v(e,u,i))return!1}else if(v(l,o,i)||v(e,o,i))return!1}if(t.iglobs.length>0){let i=t.iglobs.filter(c=>!c.startsWith("!")),a=t.iglobs.filter(c=>c.startsWith("!")).map(c=>c.slice(1));if(i.length>0){let c=!1;for(let o of i)if(v(l,o,!0)||v(e,o,!0)){c=!0;break}if(!c)return!1}for(let c of a)if(c.startsWith("/")){let o=c.slice(1);if(v(e,o,!0))return!1}else if(v(l,c,!0)||v(e,c,!0))return!1}return!0}function v(e,t,n=!1){let s="^";for(let r=0;r<t.length;r++){let l=t[r];if(l==="*")t[r+1]==="*"?(s+=".*",r++):s+="[^/]*";else if(l==="?")s+="[^/]";else if(l==="["){let i=r+1;for(i<t.length&&t[i]==="!"&&i++,i<t.length&&t[i]==="]"&&i++;i<t.length&&t[i]!=="]";)i++;if(i<t.length){let a=t.slice(r,i+1);a.startsWith("[!")&&(a=`[^${a.slice(2)}`),s+=a,r=i}else s+="\\["}else s+=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return s+="$",$(s,n?"i":"").test(e)}async function xe(e,t,n){let s=null;n.noIgnore||(s=await A(e.fs,e.cwd,n.noIgnoreDot,n.noIgnoreVcs,n.ignoreFiles));let r=new M;for(let o of n.typeClear)r.clearType(o);for(let o of n.typeAdd)r.addType(o);let l=t.length===0?["."]:t,{files:i}=await Q(e,l,n,s,r);if(i.length===0)return{stdout:"",stderr:"",exitCode:1};if(n.quiet)return{stdout:"",stderr:"",exitCode:0};let a=n.nullSeparator?"\0":`
12
+ `;return{stdout:i.map(o=>o+a).join(""),stderr:"",exitCode:0}}function ye(e,t){if(t.length===0)return!0;for(let n of t)if(v(e,n,!1))return!0;return!1}async function be(e,t,n,s){try{if(s.preprocessor&&e.exec){let i=n.split("/").pop()||n;if(ye(i,s.preprocessorGlobs)){let a=await e.exec(q([s.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[t]});if(a.exitCode===0&&a.stdout){let c=L(a.stdout),o=c.slice(0,8192);return{content:c,isBinary:o.includes("\0")}}}}if(s.searchZip&&n.endsWith(".gz")){let i=await e.fs.readFileBuffer(t);if(ge(i))try{let a=he(i),c=new TextDecoder().decode(a),o=c.slice(0,8192);return{content:c,isBinary:o.includes("\0")}}catch{return null}}let r=await e.fs.readFile(t),l=r.slice(0,8192);return{content:r,isBinary:l.includes("\0")}}catch{return null}}async function we(e,t,n,s,r,l,i){let a="",c=!1,o=[],u=0,d=0,p=0,g=50;e:for(let f=0;f<t.length;f+=g){let x=t.slice(f,f+g),b=await Promise.all(x.map(async h=>{let y=e.fs.resolvePath(e.cwd,h),F=await be(e,y,h,s);if(!F)return null;let{content:C,isBinary:N}=F;if(p+=C.length,N&&!s.searchBinary)return null;let W=r&&!s.heading?h:"",S=z(C,n,{invertMatch:s.invertMatch,showLineNumbers:l,countOnly:s.count,countMatches:s.countMatches,filename:W,onlyMatching:s.onlyMatching,beforeContext:s.beforeContext,afterContext:s.afterContext,maxCount:s.maxCount,contextSeparator:s.contextSeparator,showColumn:s.column,vimgrep:s.vimgrep,showByteOffset:s.byteOffset,replace:s.replace!==null?U(s.replace):null,passthru:s.passthru,multiline:s.multiline,kResetGroup:i});return s.json&&S.matched?{file:h,result:S,content:C,isBinary:!1}:{file:h,result:S}}));for(let h of b){if(!h)continue;let{file:y,result:F}=h;if(F.matched){if(c=!0,d++,u+=F.matchCount,s.quiet&&!s.json)break e;if(s.json&&!s.quiet){let C=h.content||"";o.push(JSON.stringify({type:"begin",data:{path:{text:y}}}));let N=C.split(`
13
+ `);n.lastIndex=0;let W=0;for(let S=0;S<N.length;S++){let j=N[S];n.lastIndex=0;let O=[];for(let I=n.exec(j);I!==null;I=n.exec(j)){let R={match:{text:I[0]},start:I.index,end:I.index+I[0].length};s.replace!==null&&(R.replacement={text:s.replace}),O.push(R),I[0].length===0&&n.lastIndex++}if(O.length>0){let I={type:"match",data:{path:{text:y},lines:{text:`${j}
14
+ `},line_number:S+1,absolute_offset:W,submatches:O}};o.push(JSON.stringify(I))}W+=j.length+1}o.push(JSON.stringify({type:"end",data:{path:{text:y},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:1,searches_with_match:1,bytes_searched:C.length,bytes_printed:0,matched_lines:F.matchCount,matches:F.matchCount}}}))}else if(s.filesWithMatches){let C=s.nullSeparator?"\0":`
15
+ `;a+=`${y}${C}`}else s.filesWithoutMatch||(s.heading&&!s.noFilename&&(a+=`${y}
16
+ `),a+=F.output)}else if(s.filesWithoutMatch){let C=s.nullSeparator?"\0":`
17
+ `;a+=`${y}${C}`}else s.includeZero&&(s.count||s.countMatches)&&(a+=F.output)}}s.json&&(o.push(JSON.stringify({type:"summary",data:{elapsed_total:{secs:0,nanos:0,human:"0s"},stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:t.length,searches_with_match:d,bytes_searched:p,bytes_printed:0,matched_lines:u,matches:u}}})),a=`${o.join(`
18
+ `)}
19
+ `);let w=s.quiet&&!s.json?"":a;if(s.stats&&!s.json){let f=["",`${u} matches`,`${u} matched lines`,`${d} files contained matches`,`${t.length} files searched`,`${p} bytes searched`].join(`
20
+ `);w+=`${f}
21
+ `}let m;return s.filesWithoutMatch?m=a.length>0?0:1:m=c?0:1,{stdout:w,stderr:"",exitCode:m}}var ve={name:"rg",summary:"recursively search for a pattern",usage:"rg [OPTIONS] PATTERN [PATH ...]",description:`rg (ripgrep) recursively searches directories for a regex pattern.
22
+ Unlike grep, rg is recursive by default and respects .gitignore files.
23
+
24
+ EXAMPLES:
25
+ rg foo Search for 'foo' in current directory
26
+ rg foo src/ Search in src/ directory
27
+ rg -i foo Case-insensitive search
28
+ rg -w foo Match whole words only
29
+ rg -t js foo Search only JavaScript files
30
+ rg -g '*.ts' foo Search files matching glob
31
+ rg --hidden foo Include hidden files
32
+ rg -l foo List files with matches only`,options:["-e, --regexp PATTERN search for PATTERN (can be used multiple times)","-f, --file FILE read patterns from FILE, one per line","-i, --ignore-case case-insensitive search","-s, --case-sensitive case-sensitive search (overrides smart-case)","-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)","-F, --fixed-strings treat pattern as literal string","-w, --word-regexp match whole words only","-x, --line-regexp match whole lines only","-v, --invert-match select non-matching lines","-r, --replace TEXT replace matches with TEXT","-c, --count print count of matching lines per file"," --count-matches print count of individual matches per file","-l, --files-with-matches print only file names with matches"," --files-without-match print file names without matches"," --files list files that would be searched","-o, --only-matching print only matching parts","-m, --max-count NUM stop after NUM matches per file","-q, --quiet suppress output, exit 0 on match"," --stats print search statistics","-n, --line-number print line numbers (default: on)","-N, --no-line-number do not print line numbers","-I, --no-filename suppress the prefixing of file names","-0, --null use NUL as filename separator","-b, --byte-offset show byte offset of each match"," --column show column number of first match"," --vimgrep show results in vimgrep format"," --json show results in JSON Lines format","-A NUM print NUM lines after each match","-B NUM print NUM lines before each match","-C NUM print NUM lines before and after each match"," --context-separator SEP separator for context groups (default: --)","-U, --multiline match patterns across lines","-z, --search-zip search in compressed files (gzip only)","-g, --glob GLOB include files matching GLOB","-t, --type TYPE only search files of TYPE (e.g., js, py, ts)","-T, --type-not TYPE exclude files of TYPE","-L, --follow follow symbolic links","-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)","-a, --text search binary files as text"," --hidden search hidden files and directories"," --no-ignore don't respect .gitignore/.ignore files","-d, --max-depth NUM maximum search depth"," --sort TYPE sort files (path, none)"," --heading show file path above matches"," --passthru print all lines (non-matches use - separator)"," --include-zero include files with 0 matches in count output"," --type-list list all available file types"," --help display this help and exit"]},Ge={name:"rg",async execute(e,t){if(_(e))return B(ve);if(e.includes("--type-list"))return{stdout:V(),stderr:"",exitCode:0};let n=K(e);return n.success?X({ctx:t,options:n.options,paths:n.paths,explicitLineNumbers:n.explicitLineNumbers}):n.error}},qe={name:"rg",flags:[{flag:"-i",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-N",type:"boolean"},{flag:"--hidden",type:"boolean"},{flag:"--no-ignore",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-g",type:"value",valueHint:"pattern"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-T",type:"value",valueHint:"string"}],needsArgs:!0};export{Ge as a,qe as b};
@@ -0,0 +1,5 @@
1
+ import{a as f}from"./chunk-DZCB42NK.js";import{a as d}from"./chunk-HWKDQ44K.js";import{a as m,b as p}from"./chunk-74CEPOFO.js";var b={name:"cat",summary:"concatenate files and print on the standard output",usage:"cat [OPTION]... [FILE]...",options:["-n, --number number all output lines"," --help display this help and exit"]},g={number:{short:"n",long:"number",type:"boolean"}},L={name:"cat",async execute(t,o){if(p(t))return m(b);let e=d("cat",t,g);if(!e.ok)return e.error;let r=e.result.flags.number,s=e.result.positional,a=await f(o,s,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),n="",l=1;for(let{content:i}of a.files){let u=i;if(r){let c=y(u,l);n+=c.content,l=c.nextLineNumber}else n+=u}return{stdout:n,stderr:a.stderr,exitCode:a.exitCode,stdoutEncoding:"binary"}}};function y(t,o){let e=t.split(`
2
+ `),r=t.endsWith(`
3
+ `),s=r?e.slice(0,-1):e;return{content:s.map((n,l)=>`${String(o+l).padStart(6," ")} ${n}`).join(`
4
+ `)+(r?`
5
+ `:""),nextLineNumber:o+s.length}}var T={name:"cat",flags:[{flag:"-n",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-t",type:"boolean"}],stdinType:"text",needsFiles:!0};export{L as a,T as b};
@@ -0,0 +1,4 @@
1
+ import{a as $}from"./chunk-IPJHKYVM.js";import{c as v}from"./chunk-AH77CRWX.js";import{a as L,b as M,c as w}from"./chunk-74CEPOFO.js";var N={name:"xargs",summary:"build and execute command lines from standard input",usage:"xargs [OPTION]... [COMMAND [INITIAL-ARGS]]",options:["-I REPLACE replace occurrences of REPLACE with input","-d DELIM use DELIM as input delimiter (e.g., -d '\\n' for newline)","-n NUM use at most NUM arguments per command line","-P NUM run at most NUM processes at a time","-0, --null items are separated by null, not whitespace","-t, --verbose print commands before executing","-r, --no-run-if-empty do not run command if input is empty"," --help display this help and exit"]},U={name:"xargs",async execute(l,i){if(M(l))return L(N);let m=null,g=null,c=null,o=null,h=!1,x=!1,y=!1,s=0;for(let e=0;e<l.length;e++){let t=l[e];if(t==="-I"&&e+1<l.length)m=l[++e],s=e+1;else if(t==="-d"&&e+1<l.length)g=l[++e].replace(/\\n/g,`
2
+ `).replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\0/g,"\0").replace(/\\\\/g,"\\"),s=e+1;else if(t==="-n"&&e+1<l.length)c=parseInt(l[++e],10),s=e+1;else if(t==="-P"&&e+1<l.length)o=parseInt(l[++e],10),s=e+1;else if(t==="-0"||t==="--null")h=!0,s=e+1;else if(t==="-t"||t==="--verbose")x=!0,s=e+1;else if(t==="-r"||t==="--no-run-if-empty")y=!0,s=e+1;else{if(t.startsWith("--"))return w("xargs",t);if(t.startsWith("-")&&t.length>1){for(let n of t.slice(1))if(!"0tr".includes(n))return w("xargs",`-${n}`);t.includes("0")&&(h=!0),t.includes("t")&&(x=!0),t.includes("r")&&(y=!0),s=e+1}else if(!t.startsWith("-")){s=e;break}}}let a=l.slice(s);a.length===0&&a.push("echo");let C=v(i.stdin),r;if(h?r=C.split("\0").filter(e=>e.length>0):g!==null?r=C.replace(/\n$/,"").split(g).filter(t=>t.length>0):r=C.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),r.length===0)return y?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0};let f="",u="",d=0,I=e=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(e)?`"${e.replace(/([\\"`$])/g,"\\$1")}"`:e,b=async e=>{if(x){let n=e.map(I).join(" ");u+=`${n}
3
+ `}return i.exec?i.exec($([e[0]]),{cwd:i.cwd,signal:i.signal,args:e.slice(1)}):{stdout:`${e.map(I).join(" ")}
4
+ `,stderr:"",exitCode:0}},A=async e=>{if(o!==null&&o>1)for(let t=0;t<e.length;t+=o){let n=e.slice(t,t+o),E=await Promise.all(n.map(b));for(let p of E)f+=p.stdout,u+=p.stderr,p.exitCode!==0&&(d=p.exitCode)}else for(let t of e){let n=await b(t);f+=n.stdout,u+=n.stderr,n.exitCode!==0&&(d=n.exitCode)}};if(m!==null){let e=r.map(t=>a.map(n=>n.replaceAll(m,t)));await A(e)}else if(c!==null){let e=[];for(let t=0;t<r.length;t+=c){let n=r.slice(t,t+c);e.push([...a,...n])}await A(e)}else{let e=[...a,...r],t=await b(e);f+=t.stdout,u+=t.stderr,d=t.exitCode}return{stdout:f,stderr:u,exitCode:d}}},O={name:"xargs",flags:[{flag:"-I",type:"value",valueHint:"string"},{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-0",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-r",type:"boolean"}],stdinType:"text"};export{U as a,O as b};
@@ -1,4 +1,4 @@
1
- import{a as y}from"./chunk-3THT3N7L.js";import{a as C}from"./chunk-HWKDQ44K.js";import{a as u,b as m}from"./chunk-74CEPOFO.js";var x={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
1
+ import{c as u}from"./chunk-AH77CRWX.js";import{a as S}from"./chunk-3THT3N7L.js";import{a as y}from"./chunk-HWKDQ44K.js";import{a as m,b as C}from"./chunk-74CEPOFO.js";var b={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
2
2
  a-z character range
3
3
  [:alnum:] all letters and digits
4
4
  [:alpha:] all letters
@@ -12,9 +12,9 @@ import{a as y}from"./chunk-3THT3N7L.js";import{a as C}from"./chunk-HWKDQ44K.js";
12
12
  [:graph:] all printable characters except space
13
13
  [:cntrl:] all control characters
14
14
  [:xdigit:] all hexadecimal digits
15
- \\n, \\t, \\r escape sequences`},b=new Map([["[:alnum:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"],["[:alpha:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"],["[:blank:]"," "],["[:cntrl:]",Array.from({length:32},(r,o)=>String.fromCharCode(o)).join("").concat("\x7F")],["[:digit:]","0123456789"],["[:graph:]",Array.from({length:94},(r,o)=>String.fromCharCode(33+o)).join("")],["[:lower:]","abcdefghijklmnopqrstuvwxyz"],["[:print:]",Array.from({length:95},(r,o)=>String.fromCharCode(32+o)).join("")],["[:punct:]","!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"],["[:space:]",`
16
- \r\f\v`],["[:upper:]","ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["[:xdigit:]","0123456789ABCDEFabcdef"]]);function S(r){let o="",e=0;for(;e<r.length;){if(r[e]==="["&&r[e+1]===":"){let a=!1;for(let[c,l]of b)if(r.slice(e).startsWith(c)){o+=l,e+=c.length,a=!0;break}if(a)continue}if(r[e]==="\\"&&e+1<r.length){let a=r[e+1];a==="n"?o+=`
17
- `:a==="t"?o+=" ":a==="r"?o+="\r":o+=a,e+=2;continue}if(e+2<r.length&&r[e+1]==="-"){let a=r.charCodeAt(e),c=r.charCodeAt(e+2);if(c-a>65536)throw new Error(`tr: character range too large: '${r[e]}-${r[e+2]}'`);for(let l=a;l<=c;l++)o+=String.fromCharCode(l);e+=3;continue}o+=r[e],e++}return o}var w={complement:{short:"c",long:"complement",type:"boolean"},complementUpper:{short:"C",type:"boolean"},delete:{short:"d",long:"delete",type:"boolean"},squeeze:{short:"s",long:"squeeze-repeats",type:"boolean"}},q={name:"tr",async execute(r,o){if(m(r))return u(x);let e=C("tr",r,w);if(!e.ok)return e.error;let a=e.result.flags.complement||e.result.flags.complementUpper,c=e.result.flags.delete,l=e.result.flags.squeeze,p=e.result.positional;if(p.length<1)return{stdout:"",stderr:`tr: missing operand
15
+ \\n, \\t, \\r escape sequences`},w=new Map([["[:alnum:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"],["[:alpha:]","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"],["[:blank:]"," "],["[:cntrl:]",Array.from({length:32},(r,o)=>String.fromCharCode(o)).join("").concat("\x7F")],["[:digit:]","0123456789"],["[:graph:]",Array.from({length:94},(r,o)=>String.fromCharCode(33+o)).join("")],["[:lower:]","abcdefghijklmnopqrstuvwxyz"],["[:print:]",Array.from({length:95},(r,o)=>String.fromCharCode(32+o)).join("")],["[:punct:]","!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"],["[:space:]",`
16
+ \r\f\v`],["[:upper:]","ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["[:xdigit:]","0123456789ABCDEFabcdef"]]);function x(r){let o="",e=0;for(;e<r.length;){if(r[e]==="["&&r[e+1]===":"){let a=!1;for(let[c,l]of w)if(r.slice(e).startsWith(c)){o+=l,e+=c.length,a=!0;break}if(a)continue}if(r[e]==="\\"&&e+1<r.length){let a=r[e+1];a==="n"?o+=`
17
+ `:a==="t"?o+=" ":a==="r"?o+="\r":o+=a,e+=2;continue}if(e+2<r.length&&r[e+1]==="-"){let a=r.charCodeAt(e),c=r.charCodeAt(e+2);if(c-a>65536)throw new Error(`tr: character range too large: '${r[e]}-${r[e+2]}'`);for(let l=a;l<=c;l++)o+=String.fromCharCode(l);e+=3;continue}o+=r[e],e++}return o}var z={complement:{short:"c",long:"complement",type:"boolean"},complementUpper:{short:"C",type:"boolean"},delete:{short:"d",long:"delete",type:"boolean"},squeeze:{short:"s",long:"squeeze-repeats",type:"boolean"}},M={name:"tr",async execute(r,o){if(C(r))return m(b);let e=y("tr",r,z);if(!e.ok)return e.error;let a=e.result.flags.complement||e.result.flags.complementUpper,c=e.result.flags.delete,l=e.result.flags.squeeze,p=e.result.positional;if(p.length<1)return{stdout:"",stderr:`tr: missing operand
18
18
  `,exitCode:1};if(!c&&!l&&p.length<2)return{stdout:"",stderr:`tr: missing operand after SET1
19
- `,exitCode:1};let d,s;try{d=S(p[0]),s=p.length>1?S(p[1]):""}catch(n){return{stdout:"",stderr:`${y(n.message)}
20
- `,exitCode:1}}let g=o.stdin,h=n=>{let t=d.includes(n);return a?!t:t},i="";if(c)for(let n of g)h(n)||(i+=n);else if(l&&p.length===1){let n="";for(let t of g)h(t)&&t===n||(i+=t,n=t)}else{if(a){let n=s.length>0?s[s.length-1]:"";for(let t of g)d.includes(t)?i+=t:i+=n}else{let n=new Map;for(let t=0;t<d.length;t++){let f=t<s.length?s[t]:s[s.length-1];n.set(d[t],f)}for(let t of g)i+=n.get(t)??t}if(l){let n="",t="";for(let f of i)s.includes(f)&&f===t||(n+=f,t=f);i=n}}return{stdout:i,stderr:"",exitCode:0}}},T={name:"tr",flags:[{flag:"-c",type:"boolean"},{flag:"-C",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-s",type:"boolean"}],stdinType:"text",needsArgs:!0};export{q as a,T as b};
19
+ `,exitCode:1};let d,s;try{d=x(p[0]),s=p.length>1?x(p[1]):""}catch(n){return{stdout:"",stderr:`${S(n.message)}
20
+ `,exitCode:1}}let g=u(o.stdin),h=n=>{let t=d.includes(n);return a?!t:t},i="";if(c)for(let n of g)h(n)||(i+=n);else if(l&&p.length===1){let n="";for(let t of g)h(t)&&t===n||(i+=t,n=t)}else{if(a){let n=s.length>0?s[s.length-1]:"";for(let t of g)d.includes(t)?i+=t:i+=n}else{let n=new Map;for(let t=0;t<d.length;t++){let f=t<s.length?s[t]:s[s.length-1];n.set(d[t],f)}for(let t of g)i+=n.get(t)??t}if(l){let n="",t="";for(let f of i)s.includes(f)&&f===t||(n+=f,t=f);i=n}}return{stdout:i,stderr:"",exitCode:0}}},k={name:"tr",flags:[{flag:"-c",type:"boolean"},{flag:"-C",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-s",type:"boolean"}],stdinType:"text",needsArgs:!0};export{M as a,k as b};
@@ -0,0 +1,6 @@
1
+ import{c as a}from"./chunk-AH77CRWX.js";import{a as c}from"./chunk-HWKDQ44K.js";import{a as u,b as p}from"./chunk-74CEPOFO.js";import*as g from"diff";var b={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:["-u, --unified output unified diff format (default)","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --help display this help and exit"]},C={unified:{short:"u",long:"unified",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},L={name:"diff",async execute(d,e){if(p(d))return u(b);let t=c("diff",d,C);if(!t.ok)return t.error;let m=t.result.flags.brief,h=t.result.flags.reportSame,y=t.result.flags.ignoreCase,l=t.result.positional;if(t.result.flags.unified,l.length<2)return{stdout:"",stderr:`diff: missing operand
2
+ `,exitCode:2};let i,s,[r,o]=l;try{i=r==="-"?a(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,r))}catch{return{stdout:"",stderr:`diff: ${r}: No such file or directory
3
+ `,exitCode:2}}try{s=o==="-"?a(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,o))}catch{return{stdout:"",stderr:`diff: ${o}: No such file or directory
4
+ `,exitCode:2}}let f=i,n=s;return y&&(f=f.toLowerCase(),n=n.toLowerCase()),f===n?h?{stdout:`Files ${r} and ${o} are identical
5
+ `,stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0}:m?{stdout:`Files ${r} and ${o} differ
6
+ `,stderr:"",exitCode:1}:{stdout:g.createTwoFilesPatch(r,o,i,s,"","",{context:3}),stderr:"",exitCode:1}}},P={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{L as a,P as b};
@@ -0,0 +1,15 @@
1
+ import{b as O}from"./chunk-DZCB42NK.js";import{c as F}from"./chunk-AH77CRWX.js";import{a as N,b as w,c as k}from"./chunk-74CEPOFO.js";var P=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),D=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]]);function x(u){let r=u.trim(),e=r.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!e){let n=parseFloat(r);return Number.isNaN(n)?0:n}let l=parseFloat(e[1]),s=(e[2]||"").toLowerCase(),i=P.get(s)??1;return l*i}function M(u){let r=u.trim().toLowerCase().slice(0,3);return D.get(r)??0}function q(u,r){let e=u.split(/(\d+)/),l=r.split(/(\d+)/),s=Math.max(e.length,l.length);for(let i=0;i<s;i++){let n=e[i]||"",d=l[i]||"",o=/^\d+$/.test(n)?parseInt(n,10):null,c=/^\d+$/.test(d)?parseInt(d,10):null;if(o!==null&&c!==null){if(o!==c)return o-c}else if(n!==d)return n.localeCompare(d)}return 0}function L(u){return u.replace(/[^a-zA-Z0-9\s]/g,"")}function v(u,r,e){let l=e!==null?e:/\s+/,s=u.split(l),i=r.startField-1;if(i>=s.length)return"";if(r.endField===void 0){let o=s[i]||"";return r.startChar!==void 0&&(o=o.slice(r.startChar-1)),r.ignoreLeading&&(o=o.trimStart()),o}let n=Math.min(r.endField-1,s.length-1),d="";for(let o=i;o<=n&&o<s.length;o++){let c=s[o]||"";if(o===i&&r.startChar!==void 0&&(c=c.slice(r.startChar-1)),o===n&&r.endChar!==void 0){let t=o===i&&r.startChar!==void 0?r.endChar-r.startChar+1:r.endChar;c=c.slice(0,t)}o>i&&(d+=e||" "),d+=c}return r.ignoreLeading&&(d=d.trimStart()),d}function I(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=L(l),s=L(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=M(l),n=M(s);return i-n}if(e.humanNumeric){let i=x(l),n=x(s);return i-n}if(e.versionSort)return q(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function B(u){let{keys:r,fieldDelimiter:e,numeric:l,ignoreCase:s,reverse:i,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c,ignoreLeadingBlanks:t,stable:a}=u;return(f,C)=>{let g=f,b=C;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=I(g,b,{numeric:l,ignoreCase:s,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c});if(h!==0)return i?-h:h;if(!a){let p=f.localeCompare(C);return i?-p:p}return 0}for(let m of r){let h=v(g,m,e),p=v(b,m,e);m.ignoreLeading&&(h=h.trimStart(),p=p.trimStart());let V={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},A=m.reverse??i,S=I(h,p,V);if(S!==0)return A?-S:S}if(!a){let m=f.localeCompare(C);return i?-m:m}return 0}}function E(u,r){if(r.keys.length===0){if(r.ignoreCase){let s=new Set;return u.filter(i=>{let n=i.toLowerCase();return s.has(n)?!1:(s.add(n),!0)})}return[...new Set(u)]}let e=r.keys[0],l=new Set;return u.filter(s=>{let i=v(s,e,r.fieldDelimiter);return(e.ignoreCase??r.ignoreCase)&&(i=i.toLowerCase()),l.has(i)?!1:(l.add(i),!0)})}function y(u){let r={startField:1},e="",l=u,s=l.match(/([bdfhMnrV]+)$/);s&&(e=s[1],l=l.slice(0,-e.length)),e.includes("n")&&(r.numeric=!0),e.includes("r")&&(r.reverse=!0),e.includes("f")&&(r.ignoreCase=!0),e.includes("b")&&(r.ignoreLeading=!0),e.includes("h")&&(r.humanNumeric=!0),e.includes("V")&&(r.versionSort=!0),e.includes("d")&&(r.dictionaryOrder=!0),e.includes("M")&&(r.monthSort=!0);let i=l.split(",");if(i.length===0||i[0]==="")return null;let n=i[0].split("."),d=parseInt(n[0],10);if(Number.isNaN(d)||d<1)return null;if(r.startField=d,n.length>1&&n[1]){let o=parseInt(n[1],10);!Number.isNaN(o)&&o>=1&&(r.startChar=o)}if(i.length>1&&i[1]){let o=i[1],c=o.match(/([bdfhMnrV]+)$/);if(c){let a=c[1];a.includes("n")&&(r.numeric=!0),a.includes("r")&&(r.reverse=!0),a.includes("f")&&(r.ignoreCase=!0),a.includes("b")&&(r.ignoreLeading=!0),a.includes("h")&&(r.humanNumeric=!0),a.includes("V")&&(r.versionSort=!0),a.includes("d")&&(r.dictionaryOrder=!0),a.includes("M")&&(r.monthSort=!0),o=o.slice(0,-a.length)}let t=o.split(".");if(t[0]){let a=parseInt(t[0],10);if(!Number.isNaN(a)&&a>=1&&(r.endField=a),t.length>1&&t[1]){let f=parseInt(t[1],10);!Number.isNaN(f)&&f>=1&&(r.endChar=f)}}}return r}var H={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
2
+ F is a field number (1-indexed)
3
+ C is a character position within the field (1-indexed)
4
+ OPTS can be: b d f h M n r V (per-key modifiers)
5
+
6
+ Examples:
7
+ -k1 sort by first field
8
+ -k2,2 sort by second field only
9
+ -k1.3 sort by first field starting at 3rd character
10
+ -k1,2n sort by fields 1-2 numerically
11
+ -k2 -k1 sort by field 2, then by field 1`},R={name:"sort",async execute(u,r){if(w(u))return N(H);let e={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},l=[];for(let c=0;c<u.length;c++){let t=u[c];if(t==="-r"||t==="--reverse")e.reverse=!0;else if(t==="-n"||t==="--numeric-sort")e.numeric=!0;else if(t==="-u"||t==="--unique")e.unique=!0;else if(t==="-f"||t==="--ignore-case")e.ignoreCase=!0;else if(t==="-h"||t==="--human-numeric-sort")e.humanNumeric=!0;else if(t==="-V"||t==="--version-sort")e.versionSort=!0;else if(t==="-d"||t==="--dictionary-order")e.dictionaryOrder=!0;else if(t==="-M"||t==="--month-sort")e.monthSort=!0;else if(t==="-b"||t==="--ignore-leading-blanks")e.ignoreLeadingBlanks=!0;else if(t==="-s"||t==="--stable")e.stable=!0;else if(t==="-c"||t==="--check")e.checkOnly=!0;else if(t==="-o"||t==="--output")e.outputFile=u[++c]||null;else if(t.startsWith("-o"))e.outputFile=t.slice(2)||null;else if(t.startsWith("--output="))e.outputFile=t.slice(9)||null;else if(t==="-t"||t==="--field-separator")e.fieldDelimiter=u[++c]||null;else if(t.startsWith("-t"))e.fieldDelimiter=t.slice(2)||null;else if(t.startsWith("--field-separator="))e.fieldDelimiter=t.slice(18)||null;else if(t==="-k"||t==="--key"){let a=u[++c];if(a){let f=y(a);f&&e.keys.push(f)}}else if(t.startsWith("-k")){let a=y(t.slice(2));a&&e.keys.push(a)}else if(t.startsWith("--key=")){let a=y(t.slice(6));a&&e.keys.push(a)}else{if(t.startsWith("--"))return k("sort",t);if(t.startsWith("-")&&!t.startsWith("--")){let a=!1;for(let f of t.slice(1))if(f==="r")e.reverse=!0;else if(f==="n")e.numeric=!0;else if(f==="u")e.unique=!0;else if(f==="f")e.ignoreCase=!0;else if(f==="h")e.humanNumeric=!0;else if(f==="V")e.versionSort=!0;else if(f==="d")e.dictionaryOrder=!0;else if(f==="M")e.monthSort=!0;else if(f==="b")e.ignoreLeadingBlanks=!0;else if(f==="s")e.stable=!0;else if(f==="c")e.checkOnly=!0;else{a=!0;break}if(a)return k("sort",t)}else l.push(t)}}let s=await O(r,l,{cmdName:"sort"});if(!s.ok)return s.error;let n=F(s.content).split(`
12
+ `);n.length>0&&n[n.length-1]===""&&n.pop();let d=B(e);if(e.checkOnly){let c=l.length>0?l[0]:"-";for(let t=1;t<n.length;t++)if(d(n[t-1],n[t])>0)return{stdout:"",stderr:`sort: ${c}:${t+1}: disorder: ${n[t]}
13
+ `,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}n.sort(d),e.unique&&(n=E(n,e));let o=n.length>0?`${n.join(`
14
+ `)}
15
+ `:"";if(e.outputFile){let c=r.fs.resolvePath(r.cwd,e.outputFile);return await r.fs.writeFile(c,o),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0}}},Y={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0};export{R as a,Y as b};
@@ -0,0 +1,5 @@
1
+ import{b as v}from"./chunk-DZCB42NK.js";import{c as y}from"./chunk-AH77CRWX.js";import{a as x,b as I,c as m}from"./chunk-74CEPOFO.js";var T={name:"cut",summary:"remove sections from each line of files",usage:"cut [OPTION]... [FILE]...",options:["-c LIST select only these characters","-d DELIM use DELIM instead of TAB for field delimiter","-f LIST select only these fields","-s, --only-delimited do not print lines without delimiters"," --help display this help and exit"]};function b(s){let c=[],l=s.split(",");for(let n of l)if(n.includes("-")){let[t,r]=n.split("-");c.push({start:t?parseInt(t,10):1,end:r?parseInt(r,10):null})}else{let t=parseInt(n,10);c.push({start:t,end:t})}return c}function w(s,c){let l=[];for(let n of c){let t=n.start-1,r=n.end===null?s.length:n.end;for(let i=t;i<r&&i<s.length;i++)i>=0&&!l.includes(s[i])&&l.push(s[i])}return l}var E={name:"cut",async execute(s,c){if(I(s))return x(T);let l=" ",n=null,t=null,r=!1,i=[];for(let o=0;o<s.length;o++){let e=s[o];if(e==="-d")l=s[++o]||" ";else if(e.startsWith("-d"))l=e.slice(2);else if(e==="-f")n=s[++o];else if(e.startsWith("-f"))n=e.slice(2);else if(e==="-c")t=s[++o];else if(e.startsWith("-c"))t=e.slice(2);else if(e==="-s"||e==="--only-delimited")r=!0;else{if(e.startsWith("--"))return m("cut",e);if(e.startsWith("-")){let f=!1;for(let u of e.slice(1))if(u==="s")r=!0;else if(!"dfc".includes(u)){f=!0;break}if(f)return m("cut",e)}else i.push(e)}}if(!n&&!t)return{stdout:"",stderr:`cut: you must specify a list of bytes, characters, or fields
2
+ `,exitCode:1};let p=await v(c,i,{cmdName:"cut"});if(!p.ok)return p.error;let a=(t?y(p.content):p.content).split(`
3
+ `);a.length>0&&a[a.length-1]===""&&a.pop();let g=b(n||t||"1"),h="";for(let o of a)if(t){let e=Array.from(o),f=[];for(let u of g){let F=u.start-1,H=u.end===null?e.length:u.end;for(let d=F;d<H&&d<e.length;d++)d>=0&&f.push(e[d])}h+=`${f.join("")}
4
+ `}else{if(r&&!o.includes(l))continue;let e=o.split(l),f=w(e,g);h+=`${f.join(l)}
5
+ `}return t?{stdout:h,stderr:"",exitCode:0}:{stdout:h,stderr:"",exitCode:0,stdoutKind:"bytes",stdoutEncoding:"binary"}}},S={name:"cut",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-f",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"string"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0};export{E as a,S as b};
@@ -0,0 +1,8 @@
1
+ import{a as x}from"./chunk-SNN4IESC.js";import{a as z,b as J}from"./chunk-2TRDZQLB.js";import{c as X}from"./chunk-AH77CRWX.js";import{a as Z,b as j,c as q}from"./chunk-74CEPOFO.js";var ie={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},K={name:"grep",async execute(t,s){if(j(t))return Z(ie);let l=!1,f=!1,c=!1,p=!1,m=!1,a=!1,n=!1,u=!1,y=!1,w=!1,h=!1,d=!1,F=!1,P=!1,B=!1,$=0,T=0,C=0,W=[],A=[],U=[],R=null,I=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.startsWith("-")&&i!=="-"){if(i==="-e"&&r+1<t.length){R=t[++r];continue}if(i.startsWith("--include=")){W.push(i.slice(10));continue}if(i.startsWith("--exclude=")){A.push(i.slice(10));continue}if(i.startsWith("--exclude-dir=")){U.push(i.slice(14));continue}if(i.startsWith("--max-count=")){$=parseInt(i.slice(12),10);continue}let b=i.match(/^-m(\d+)$/);if(b){$=parseInt(b[1],10);continue}if(i==="-m"&&r+1<t.length){$=parseInt(t[++r],10);continue}let o=i.match(/^-([ABC])(\d+)$/);if(o){let e=parseInt(o[2],10);o[1]==="A"?C=e:o[1]==="B"?T=e:o[1]==="C"&&(T=e,C=e);continue}if((i==="-A"||i==="-B"||i==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);i==="-A"?C=e:i==="-B"?T=e:(T=e,C=e);continue}let g=i.startsWith("--")?[i]:i.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")l=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")p=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")a=!0;else if(e==="r"||e==="R"||e==="--recursive")n=!0;else if(e==="w"||e==="--word-regexp")u=!0;else if(e==="x"||e==="--line-regexp")y=!0;else if(e==="E"||e==="--extended-regexp")w=!0;else if(e==="P"||e==="--perl-regexp")h=!0;else if(e==="F"||e==="--fixed-strings")d=!0;else if(e==="o"||e==="--only-matching")F=!0;else if(e==="h"||e==="--no-filename")P=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return q("grep",e);if(e.length===1)return q("grep",`-${e}`)}}else R===null?R=i:I.push(i)}if(R===null)return{stdout:"",stderr:`grep: missing pattern
2
+ `,exitCode:2};let ee=d?"fixed":w?"extended":h?"perl":"basic",L,O,Q;try{let r=J(R,{mode:ee,ignoreCase:l,wholeWord:u,lineRegexp:y});L=r.regex,O=r.kResetGroup,Q=r.preFilter}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${R}
3
+ `,exitCode:2}}if(I.length===0&&s.stdin!==void 0){let r=z(X(s.stdin),L,{invertMatch:c,showLineNumbers:f,countOnly:p,filename:"",onlyMatching:F,beforeContext:T,afterContext:C,maxCount:$,kResetGroup:O,preFilter:Q});return B?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(I.length===0)return{stdout:"",stderr:`grep: no input files
4
+ `,exitCode:2};let M="",S="",D=!1,k=!1,v=[];for(let r of I)if(r.includes("*")||r.includes("?")||r.includes("[")){let i=await re(r,s);if(n)for(let b of i){let o=await H(b.path,s,W,A,U,b.isFile);v.push(...o)}else v.push(...i)}else if(n){let i=await H(r,s,W,A,U);v.push(...i)}else v.push({path:r});let te=(v.length>1||n)&&!P,_=50;for(let r=0;r<v.length;r+=_){let i=v.slice(r,r+_),b=await Promise.all(i.map(async o=>{let g=o.path,e=g.split("/").pop()||g;if(A.length>0&&!n&&A.some(N=>x(e,N,{stripQuotes:!0}))||W.length>0&&!n&&!W.some(N=>x(e,N,{stripQuotes:!0})))return null;try{let N=s.fs.resolvePath(s.cwd,g),G=!1;if(o.isFile===void 0?G=(await s.fs.stat(N)).isDirectory:G=!o.isFile,G)return n?null:{error:`grep: ${g}: Is a directory
5
+ `};let se=await s.fs.readFile(N),ne=z(se,L,{invertMatch:c,showLineNumbers:f,countOnly:p,filename:te?g:"",onlyMatching:F,beforeContext:T,afterContext:C,maxCount:$,kResetGroup:O,preFilter:Q});return{file:g,result:ne}}catch{return{error:`grep: ${g}: No such file or directory
6
+ `}}}));for(let o of b){if(o===null)continue;if("error"in o&&o.error){S+=o.error,o.error.includes("Is a directory")||(k=!0);continue}if(!("file"in o)||!o.result)continue;let{file:g,result:e}=o;if(e.matched){if(D=!0,B)return{stdout:"",stderr:"",exitCode:0};m?M+=`${g}
7
+ `:a||(M+=e.output)}else a?M+=`${g}
8
+ `:p&&!m&&(M+=e.output)}}let E;return k?E=2:a?E=M.length>0?0:1:E=D?0:1,B?{stdout:"",stderr:"",exitCode:E}:{stdout:M,stderr:S,exitCode:E}}},V=256;async function Y(t,s,l,f,c=0){if(c>=V)return;let p=l.fs.resolvePath(l.cwd,t);try{if(!(await l.fs.stat(p)).isDirectory){let n=t.split("/").pop()||"";if(s){let u=s.replace(/^\//,"");x(n,u,{stripQuotes:!0})&&f.push(t)}return}let a=await l.fs.readdir(p);for(let n of a){let u=t==="."?n:`${t}/${n}`,y=l.fs.resolvePath(l.cwd,u);if((await l.fs.stat(y)).isDirectory)await Y(u,s,l,f,c+1);else if(s){let h=s.replace(/^\//,"");x(n,h,{stripQuotes:!0})&&f.push(u)}}}catch{}}async function re(t,s){let l=[],f=t.lastIndexOf("/"),c,p;if(f===-1?(c=s.cwd,p=t):(c=t.slice(0,f)||"/",p=t.slice(f+1)),t.includes("**")){let a=[],n=t.split("**"),u=n[0].replace(/\/$/,"")||".",y=n[1]||"";return await Y(u,y,s,a),a.map(w=>({path:w}))}let m=s.fs.resolvePath(s.cwd,c);try{if(s.fs.readdirWithFileTypes){let a=await s.fs.readdirWithFileTypes(m);for(let n of a)if(x(n.name,p,{stripQuotes:!0})){let u=f===-1?n.name:`${c}/${n.name}`;l.push({path:u,isFile:n.isFile})}}else{let a=await s.fs.readdir(m);for(let n of a)if(x(n,p,{stripQuotes:!0})){let u=f===-1?n:`${c}/${n}`;l.push({path:u})}}}catch{}return l.sort((a,n)=>a.path.localeCompare(n.path))}async function H(t,s,l=[],f=[],c=[],p,m=0){if(m>=V)return[];let a=s.fs.resolvePath(s.cwd,t),n=[];try{let u,y;if(p!==void 0)u=p,y=!p;else{let h=await s.fs.stat(a);u=h.isFile,y=h.isDirectory}if(u){let h=t.split("/").pop()||t;return f.length>0&&f.some(d=>x(h,d,{stripQuotes:!0}))?[]:l.length>0&&!l.some(d=>x(h,d,{stripQuotes:!0}))?[]:[{path:t,isFile:!0}]}if(!y)return[];let w=t.split("/").pop()||t;if(c.length>0&&c.some(h=>x(w,h,{stripQuotes:!0})))return[];if(s.fs.readdirWithFileTypes){let h=await s.fs.readdirWithFileTypes(a);for(let d of h){if(d.name.startsWith("."))continue;let F=t==="."?d.name:`${t}/${d.name}`,P=await H(F,s,l,f,c,d.isFile,m+1);n.push(...P)}}else{let h=await s.fs.readdir(a);for(let d of h){if(d.startsWith("."))continue;let F=t==="."?d:`${t}/${d}`,P=await H(F,s,l,f,c,void 0,m+1);n.push(...P)}}}catch{}return n}var ce={name:"fgrep",async execute(t,s){return K.execute(["-F",...t],s)}},pe={name:"egrep",async execute(t,s){return K.execute(["-E",...t],s)}},he={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},de={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},ge={name:"egrep",flags:[],stdinType:"text",needsArgs:!0};export{K as a,ce as b,pe as c,he as d,de as e,ge as f};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-YSHZL3MF.js";var g=2048,o=new Map;function u(l,c,t){let s=typeof t=="boolean"?{ignoreCase:t}:t??{},e=c;s.stripQuotes&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1));let i=s.ignoreCase?`i:${e}`:e,n=o.get(i);if(!n){if(n=a(e,s.ignoreCase),o.size>=g){let f=o.keys().next().value;f!==void 0&&o.delete(f)}o.set(i,n)}return n.test(l)}function a(l,c){let t="^";for(let s=0;s<l.length;s++){let e=l[s];if(e==="*")t+=".*";else if(e==="?")t+=".";else if(e==="["){let i=s+1;for(;i<l.length&&l[i]!=="]";)i++;t+=l.slice(s,i+1),s=i}else e==="."||e==="+"||e==="^"||e==="$"||e==="{"||e==="}"||e==="("||e===")"||e==="|"||e==="\\"?t+=`\\${e}`:t+=e}return t+="$",r(t,c?"i":"")}export{u as a};
1
+ import{a as r}from"./chunk-B74TABJS.js";var g=2048,o=new Map;function u(l,c,t){let s=typeof t=="boolean"?{ignoreCase:t}:t??{},e=c;s.stripQuotes&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1));let i=s.ignoreCase?`i:${e}`:e,n=o.get(i);if(!n){if(n=a(e,s.ignoreCase),o.size>=g){let f=o.keys().next().value;f!==void 0&&o.delete(f)}o.set(i,n)}return n.test(l)}function a(l,c){let t="^";for(let s=0;s<l.length;s++){let e=l[s];if(e==="*")t+=".*";else if(e==="?")t+=".";else if(e==="["){let i=s+1;for(;i<l.length&&l[i]!=="]";)i++;t+=l.slice(s,i+1),s=i}else e==="."||e==="+"||e==="^"||e==="$"||e==="{"||e==="}"||e==="("||e===")"||e==="|"||e==="\\"?t+=`\\${e}`:t+=e}return t+="$",r(t,c?"i":"")}export{u as a};
@@ -1 +1 @@
1
- import{a as n,b as i,c as r}from"./chunk-HDQ56CKY.js";import{a,b as s}from"./chunk-74CEPOFO.js";var f={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b};
1
+ import{a as n,b as i,c as r}from"./chunk-UGMTY5A7.js";import{a,b as s}from"./chunk-74CEPOFO.js";var f={name:"head",summary:"output the first part of files",usage:"head [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the first NUM bytes","-n, --lines=NUM print the first NUM lines (default 10)","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},m={name:"head",async execute(t,l){if(s(t))return a(f);let e=n(t,"head");if(!e.ok)return e.error;let{lines:o,bytes:p}=e.options;return i(l,e.options,"head",d=>r(d,o,p))}},g={name:"head",flags:[{flag:"-n",type:"value",valueHint:"number"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,g as b};
@@ -0,0 +1,4 @@
1
+ import{b as m}from"./chunk-DZCB42NK.js";import{c as d}from"./chunk-AH77CRWX.js";import{a as y}from"./chunk-HWKDQ44K.js";import{a as f,b as g}from"./chunk-74CEPOFO.js";var T={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},w={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},$={name:"uniq",async execute(p,h){if(g(p))return f(T);let o=y("uniq",p,w);if(!o.ok)return o.error;let{count:q,duplicatesOnly:b,uniqueOnly:C,ignoreCase:a}=o.result.flags,x=o.result.positional,r=await m(h,x,{cmdName:"uniq"});if(!r.ok)return r.error;let t=(a?d(r.content):r.content).split(`
2
+ `);if(t.length>0&&t[t.length-1]===""&&t.pop(),t.length===0)return{stdout:"",stderr:"",exitCode:0};let n=[],i=t[0],s=1,O=(e,u)=>a?e.toLowerCase()===u.toLowerCase():e===u;for(let e=1;e<t.length;e++)O(t[e],i)?s++:(n.push({line:i,count:s}),i=t[e],s=1);n.push({line:i,count:s});let c=n;b?c=n.filter(e=>e.count>1):C&&(c=n.filter(e=>e.count===1));let l="";for(let{line:e,count:u}of c)q?l+=`${String(u).padStart(4)} ${e}
3
+ `:l+=`${e}
4
+ `;return a?{stdout:l,stderr:"",exitCode:0}:{stdout:l,stderr:"",exitCode:0,stdoutKind:"bytes",stdoutEncoding:"binary"}}},k={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{$ as a,k as b};
@@ -0,0 +1,4 @@
1
+ import{c}from"./chunk-AH77CRWX.js";import{a as u,b as f,c as h}from"./chunk-74CEPOFO.js";import p from"turndown";var w={name:"html-to-markdown",summary:"convert HTML to Markdown (BashEnv extension)",usage:"html-to-markdown [OPTION]... [FILE]",description:["Convert HTML content to Markdown format using the turndown library.","This is a non-standard BashEnv extension command, not available in regular bash.","","Read HTML from FILE or standard input and output Markdown to standard output.","Commonly used with curl to convert web pages:"," curl -s https://example.com | html-to-markdown","","Supported HTML elements:"," - Headings (h1-h6) \u2192 # Markdown headings"," - Paragraphs (p) \u2192 Plain text with blank lines"," - Links (a) \u2192 [text](url)"," - Images (img) \u2192 ![alt](src)"," - Bold/Strong \u2192 **text**"," - Italic/Em \u2192 _text_"," - Code (code, pre) \u2192 `inline` or fenced blocks"," - Lists (ul, ol, li) \u2192 - or 1. items"," - Blockquotes \u2192 > quoted text"," - Horizontal rules (hr) \u2192 ---"],options:["-b, --bullet=CHAR bullet character for unordered lists (-, +, or *)","-c, --code=FENCE fence style for code blocks (``` or ~~~)","-r, --hr=STRING string for horizontal rules (default: ---)"," --heading-style=STYLE"," heading style: 'atx' for # headings (default),"," 'setext' for underlined headings (h1/h2 only)"," --help display this help and exit"],examples:["echo '<h1>Hello</h1><p>World</p>' | html-to-markdown","html-to-markdown page.html","curl -s https://example.com | html-to-markdown > page.md"]},y={name:"html-to-markdown",async execute(r,n){if(f(r))return u(w);let s="-",a="```",i="---",m="atx",o=[];for(let e=0;e<r.length;e++){let t=r[e];if(t==="-b"||t==="--bullet")s=r[++e]??"-";else if(t.startsWith("--bullet="))s=t.slice(9);else if(t==="-c"||t==="--code")a=r[++e]??"```";else if(t.startsWith("--code="))a=t.slice(7);else if(t==="-r"||t==="--hr")i=r[++e]??"---";else if(t.startsWith("--hr="))i=t.slice(5);else if(t.startsWith("--heading-style=")){let d=t.slice(16);(d==="setext"||d==="atx")&&(m=d)}else if(t==="-")o.push("-");else{if(t.startsWith("--"))return h("html-to-markdown",t);if(t.startsWith("-"))return h("html-to-markdown",t);o.push(t)}}let l;if(o.length===0||o.length===1&&o[0]==="-")l=c(n.stdin);else try{let e=n.fs.resolvePath(n.cwd,o[0]);l=await n.fs.readFile(e)}catch{return{stdout:"",stderr:`html-to-markdown: ${o[0]}: No such file or directory
2
+ `,exitCode:1}}if(!l.trim())return{stdout:"",stderr:"",exitCode:0};try{let e=new p({bulletListMarker:s,codeBlockStyle:"fenced",fence:a,hr:i,headingStyle:m});return e.remove(["script","style","footer"]),{stdout:`${e.turndown(l).trim()}
3
+ `,stderr:"",exitCode:0}}catch(e){return{stdout:"",stderr:`html-to-markdown: conversion error: ${e.message}
4
+ `,exitCode:1}}}},b={name:"html-to-markdown",flags:[],stdinType:"text"};export{y as a,b};
@@ -0,0 +1,15 @@
1
+ import{c}from"./chunk-74CEPOFO.js";function $(t,i){let r=10,s=null,o=!1,l=!1,n=!1,u=[];for(let f=0;f<t.length;f++){let e=t[f];if(e==="-n"&&f+1<t.length){let a=t[++f];i==="tail"&&a.startsWith("+")?(n=!0,r=parseInt(a.slice(1),10)):r=parseInt(a,10)}else if(i==="tail"&&e.startsWith("-n+"))n=!0,r=parseInt(e.slice(3),10);else if(e.startsWith("-n"))r=parseInt(e.slice(2),10);else if(e==="-c"&&f+1<t.length)s=parseInt(t[++f],10);else if(e.startsWith("-c"))s=parseInt(e.slice(2),10);else if(e.startsWith("--bytes="))s=parseInt(e.slice(8),10);else if(e.startsWith("--lines="))r=parseInt(e.slice(8),10);else if(e==="-q"||e==="--quiet"||e==="--silent")o=!0;else if(e==="-v"||e==="--verbose")l=!0;else if(e.match(/^-\d+$/))r=parseInt(e.slice(1),10);else{if(e.startsWith("--"))return{ok:!1,error:c(i,e)};if(e.startsWith("-")&&e!=="-")return{ok:!1,error:c(i,e)};u.push(e)}}return s!==null&&(Number.isNaN(s)||s<0)?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of bytes
2
+ `,exitCode:1}}:Number.isNaN(r)||r<0?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of lines
3
+ `,exitCode:1}}:{ok:!0,options:{lines:r,bytes:s,quiet:o,verbose:l,files:u,fromLine:n}}}async function g(t,i,r,s){let{quiet:o,verbose:l,files:n}=i;if(n.length===0)return{stdout:s(t.stdin),stderr:"",exitCode:0};let u="",f="",e=0,a=l||!o&&n.length>1,h=0;for(let p=0;p<n.length;p++){let d=n[p];try{let b=t.fs.resolvePath(t.cwd,d),x=await t.fs.readFile(b);a&&(h>0&&(u+=`
4
+ `),u+=`==> ${d} <==
5
+ `),u+=s(x),h++}catch{f+=`${r}: ${d}: No such file or directory
6
+ `,e=1}}return{stdout:u,stderr:f,exitCode:e}}function k(t,i,r){if(r!==null)return t.slice(0,r);if(i===0)return"";let s=0,o=0,l=t.length;for(;s<l&&o<i;){let n=t.indexOf(`
7
+ `,s);if(n===-1)return`${t}
8
+ `;o++,s=n+1}return s>0?t.slice(0,s):""}function v(t,i,r,s){if(r!==null)return t.slice(-r);let o=t.length;if(o===0)return"";if(s){let f=0,e=1;for(;f<o&&e<i;){let h=t.indexOf(`
9
+ `,f);if(h===-1)break;e++,f=h+1}let a=t.slice(f);return a.endsWith(`
10
+ `)?a:`${a}
11
+ `}if(i===0)return"";let l=o-1;t[l]===`
12
+ `&&l--;let n=0;for(;l>=0&&n<i;){if(t[l]===`
13
+ `&&(n++,n===i)){l++;break}l--}l<0&&(l=0);let u=t.slice(l);return t[o-1]===`
14
+ `?u:`${u}
15
+ `}export{$ as a,g as b,k as c,v as d};
@@ -1,4 +1,4 @@
1
- import{a as ye}from"./chunk-X2AJGDEF.js";import{b as Q}from"./chunk-5QMZ5MUS.js";import{a as U}from"./chunk-YSHZL3MF.js";import{a as pe,b as ge,c as ee}from"./chunk-74CEPOFO.js";var Ke="file",Je="link",Ve="symlink",ke="directory",Qe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},et={0:Ke,1:Je,2:Ve,3:"character-device",4:"block-device",5:ke,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},tt=new Uint8Array(512),_=new Uint8Array(0),T=new TextEncoder,ze=new TextDecoder;function P(e,t,i,r){r&&T.encodeInto(r,e.subarray(t,t+i))}function L(e,t,i,r){if(r===void 0)return;let n=r.toString(8).padStart(i-1,"0");T.encodeInto(n,e.subarray(t,t+i-1))}function S(e,t,i){let r=e.indexOf(0,t),n=r===-1||r>t+i?t+i:r;return ze.decode(e.subarray(t,n))}function ne(e,t,i){let r=0,n=t+i;for(let s=t;s<n;s++){let a=e[s];if(a===0)break;a!==32&&(r=r*8+(a-48))}return r}function W(e,t,i){if(e[t]&128){let r=0;r=e[t]&127;for(let n=1;n<i;n++)r=r*256+e[t+n];if(!Number.isSafeInteger(r))throw new Error("TAR number too large");return r}return ne(e,t,i)}var N=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return _;if(e instanceof Uint8Array)return e;if(typeof e=="string")return T.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var we=(e,t)=>{let i=e.split("/").filter(Boolean);return t>=i.length?"":i.slice(t).join("/")};function Ae(e,t){let{strip:i,filter:r,map:n}=t;if(!i&&!r&&!n)return e;let s={...e};if(i&&i>0){let o=we(s.name,i);if(!o)return null;if(s.name=s.type==="directory"&&!o.endsWith("/")?`${o}/`:o,s.linkname){let c=s.linkname.startsWith("/");if(c||s.type==="link"){let l=we(s.linkname,i);s.linkname=c?`/${l}`||"/":l}}}if(r?.(s)===!1)return null;let a=n?n(s):s;return a&&(!a.name||!a.name.trim()||a.name==="."||a.name==="/")?null:a}var re=32,rt=48;function nt(e){let t=ne(e,148,8),i=0;for(let r=0;r<e.length;r++)r>=148&&r<156?i+=re:i+=e[r];return t===i}function it(e){e.fill(re,148,156);let t=0;for(let i of e)t+=i;for(let i=153;i>=148;i--)e[i]=(t&7)+rt,t>>=3;e[154]=0,e[155]=re}var st=256;function ot(e){let t={};T.encode(e.name).length>100&&Ee(e.name)===null&&(t.path=e.name),e.linkname&&T.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&T.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&T.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let i=Object.entries(t);if(i.length===0)return null;let r=T.encode(i.map(([n,s])=>{let a=`${n}=${s}
1
+ import{a as ye}from"./chunk-X2AJGDEF.js";import{b as Q}from"./chunk-5QMZ5MUS.js";import{a as U}from"./chunk-B74TABJS.js";import{a as pe,b as ge,c as ee}from"./chunk-74CEPOFO.js";var Ke="file",Je="link",Ve="symlink",ke="directory",Qe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},et={0:Ke,1:Je,2:Ve,3:"character-device",4:"block-device",5:ke,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},tt=new Uint8Array(512),_=new Uint8Array(0),T=new TextEncoder,ze=new TextDecoder;function P(e,t,i,r){r&&T.encodeInto(r,e.subarray(t,t+i))}function L(e,t,i,r){if(r===void 0)return;let n=r.toString(8).padStart(i-1,"0");T.encodeInto(n,e.subarray(t,t+i-1))}function S(e,t,i){let r=e.indexOf(0,t),n=r===-1||r>t+i?t+i:r;return ze.decode(e.subarray(t,n))}function ne(e,t,i){let r=0,n=t+i;for(let s=t;s<n;s++){let a=e[s];if(a===0)break;a!==32&&(r=r*8+(a-48))}return r}function W(e,t,i){if(e[t]&128){let r=0;r=e[t]&127;for(let n=1;n<i;n++)r=r*256+e[t+n];if(!Number.isSafeInteger(r))throw new Error("TAR number too large");return r}return ne(e,t,i)}var N=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return _;if(e instanceof Uint8Array)return e;if(typeof e=="string")return T.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var we=(e,t)=>{let i=e.split("/").filter(Boolean);return t>=i.length?"":i.slice(t).join("/")};function Ae(e,t){let{strip:i,filter:r,map:n}=t;if(!i&&!r&&!n)return e;let s={...e};if(i&&i>0){let o=we(s.name,i);if(!o)return null;if(s.name=s.type==="directory"&&!o.endsWith("/")?`${o}/`:o,s.linkname){let c=s.linkname.startsWith("/");if(c||s.type==="link"){let l=we(s.linkname,i);s.linkname=c?`/${l}`||"/":l}}}if(r?.(s)===!1)return null;let a=n?n(s):s;return a&&(!a.name||!a.name.trim()||a.name==="."||a.name==="/")?null:a}var re=32,rt=48;function nt(e){let t=ne(e,148,8),i=0;for(let r=0;r<e.length;r++)r>=148&&r<156?i+=re:i+=e[r];return t===i}function it(e){e.fill(re,148,156);let t=0;for(let i of e)t+=i;for(let i=153;i>=148;i--)e[i]=(t&7)+rt,t>>=3;e[154]=0,e[155]=re}var st=256;function ot(e){let t={};T.encode(e.name).length>100&&Ee(e.name)===null&&(t.path=e.name),e.linkname&&T.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&T.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&T.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let i=Object.entries(t);if(i.length===0)return null;let r=T.encode(i.map(([n,s])=>{let a=`${n}=${s}
2
2
  `,o=T.encode(a).length+1,c=o+String(o).length;return c=o+String(c).length,`${c} ${a}`}).join(""));return{paxHeader:$e({name:ze.decode(T.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function Ee(e){let t=T.encode(e).length;if(t<=100||t>st)return null;for(let i=e.length-1;i>0;i--){if(e[i]!=="/")continue;let r=e.slice(0,i),n=e.slice(i+1);if(T.encode(r).length<=155&&T.encode(n).length<=100)return{prefix:r,name:n}}return null}function $e(e){let t=new Uint8Array(512),i=N(e)?0:e.size??0,r=e.name,n="";if(!e.pax?.path){let s=Ee(r);s&&(r=s.name,n=s.prefix)}return P(t,0,100,r),L(t,100,8,e.mode??(e.type==="directory"?493:420)),L(t,108,8,e.uid??0),L(t,116,8,e.gid??0),L(t,124,12,i),L(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),P(t,156,1,Qe[e.type??"file"]),P(t,157,100,e.linkname),P(t,257,6,"ustar\0"),P(t,263,2,"00"),P(t,265,32,e.uname),P(t,297,32,e.gname),P(t,345,155,n),it(t),t}function at(e,t){if(t&&!nt(e))throw new Error("Invalid tar header checksum.");let i=S(e,156,1),r={name:S(e,0,100),mode:ne(e,100,8),uid:W(e,108,8),gid:W(e,116,8),size:W(e,124,12),mtime:new Date(W(e,136,12)*1e3),type:et[i]||"file",linkname:S(e,157,100)},n=S(e,257,6);return N(r)&&(r.size=0),n.trim()==="ustar"&&(r.uname=S(e,265,32),r.gname=S(e,297,32)),n==="ustar"&&(r.prefix=S(e,345,155)),r}var be={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>parseInt(e,10)],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function lt(e){let t=new TextDecoder("utf-8"),i=Object.create(null),r=Object.create(null),n=0;for(;n<e.length;){let s=e.indexOf(32,n);if(s===-1)break;let a=parseInt(t.decode(e.subarray(n,s)),10);if(Number.isNaN(a)||a===0)break;let o=n+a,[c,l]=t.decode(e.subarray(s+1,o-1)).split("=",2);if(c&&l!==void 0&&(r[c]=l,Object.hasOwn(be,c))){let[f,u]=be[c],y=u(l);(typeof y=="string"||!Number.isNaN(y))&&(i[f]=y)}n=o}return Object.keys(r).length>0&&(i.pax=r),i}function xe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ct(e){switch(e){case"pax-global-header":case"pax-header":return lt;case"gnu-long-name":return t=>({name:S(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:S(t,0,t.length)});default:return}}function ft(e){let t=$e(e),i=ot(e);if(!i)return[t];let r=-i.paxBody.length&511,n=r>0?[tt.subarray(0,r)]:[];return[i.paxHeader,i.paxBody,...n,t]}var ut=new Uint8Array(512*2);function Be(e,t,i){let r=null,n=0,s=!1,a=o=>{let c=new Error(o);throw t(c),c};return{add(o){s&&a("No new tar entries after finalize."),r!==null&&a("Previous entry must be completed before adding a new one");let c=N(o)?0:o.size;(!Number.isSafeInteger(c)||c<0)&&a("Invalid tar entry size.");try{let l=ft({...o,size:c});for(let f of l)e(f);r={...o,size:c},n=0}catch(l){t(l)}},write(o){r||a("No active tar entry."),s&&a("Cannot write data after finalize.");let c=n+o.length;c>r.size&&a(`"${r.name}" exceeds given size of ${r.size} bytes.`);try{n=c,e(o)}catch(l){t(l)}},endEntry(){r||a("No active entry to end."),s&&a("Cannot end entry after finalize.");try{n!==r.size&&a(`Size mismatch for "${r.name}".`);let o=-r.size&511;o>0&&e(new Uint8Array(o)),r=null,n=0}catch(o){throw t(o),o}},finalize(){s&&a("Archive has already been finalized"),r!==null&&a("Cannot finalize while an entry is still active");try{e(ut),s=!0,i&&i()}catch(o){t(o)}}}}var j=256;function dt(){let e=new Array(j),t=e.length-1,i=0,r=0,n=0,s=o=>{let c=e[i];o===c.length?(e[i]=_,i=i+1&t):e[i]=c.subarray(o),n-=o,n===0&&e.length>j&&(e=new Array(j),t=j-1,i=0,r=0)};function a(o,c){if(c){let g=0,d=Math.min(o,n);for(;d>0;){let p=e[i],m=Math.min(d,p.length),x=m===p.length?p:p.subarray(0,m);if(s(m),d-=m,g+=m,!c(x))break}return g}if(n<o)return null;if(o===0)return _;let l=e[i];if(l.length>=o){let g=l.length===o?l:l.subarray(0,o);return s(o),g}let f=new Uint8Array(o),u=0,y=o;for(;y>0;){let g=e[i],d=Math.min(y,g.length);f.set(d===g.length?g:g.subarray(0,d),u),u+=d,y-=d,s(d)}return f}return{push:o=>{if(o.length===0)return;let c=r+1&t;if(c===i){let l=e.length,f=l*2,u=new Array(f),y=r-i+l&l-1;if(i<r)for(let g=0;g<y;g++)u[g]=e[i+g];else if(y>0){let g=l-i;for(let d=0;d<g;d++)u[d]=e[i+d];for(let d=0;d<r;d++)u[g+d]=e[d]}e=u,t=f-1,i=0,r=y,c=r+1&t}e[r]=o,r=c,n+=o.length},available:()=>n,peek:o=>{if(n<o)return null;if(o===0)return _;let c=e[i];if(c.length>=o)return c.length===o?c:c.subarray(0,o);let l=new Uint8Array(o),f=0,u=i;for(;f<o;){let y=e[u],g=Math.min(o-f,y.length);g===y.length?l.set(y,f):l.set(y.subarray(0,g),f),f+=g,u=u+1&t}return l},discard:o=>{if(o>n)throw new Error("Too many bytes consumed");if(o===0)return;let c=o;for(;c>0;){let l=e[i],f=Math.min(c,l.length);s(f),c-=f}},pull:a}}var te=0,D=1,H=new Error("Tar archive is truncated.");function Te(e={}){let t=e.strict??!1,{available:i,peek:r,push:n,discard:s,pull:a}=dt(),o=te,c=!1,l=!1,f=!1,u=null,y={},g={},d={isEntryActive:()=>o===D,isBodyComplete:()=>!u||u.remaining===0,canFinish:()=>!u||i()>=u.remaining+u.padding,write(p){if(c)throw new Error("Archive already ended.");n(p)},end(){c=!0},readHeader(){if(o!==te)throw new Error("Cannot read header while an entry is active");if(!l)for(;!l;){if(i()<512){if(c){if(i()>0&&t)throw H;l=!0;return}return null}let p=r(512);if(ve(p)){if(i()<512*2){if(c){if(t)throw H;l=!0;return}return null}if(ve(r(512*2).subarray(512))){s(512*2),l=!0,f=!0;return}if(t)throw new Error("Invalid tar header.");s(512);continue}let m;try{m=at(p,t)}catch(E){if(t)throw E;s(512);continue}let x=ct(m.type);if(x){let E=m.size+(-m.size&511);if(i()<512+E){if(c&&t)throw H;return null}s(512);let v=x(a(E).subarray(0,m.size)),$=m.type==="pax-global-header"?y:g;for(let z in v)$[z]=v[z];continue}s(512);let b=m;return m.prefix&&(b.name=`${m.prefix}/${b.name}`),xe(b,y),xe(b,g),b.name.endsWith("/")&&b.type==="file"&&(b.type=ke),g={},u={header:b,remaining:b.size,padding:-b.size&511},o=D,b}},streamBody(p){if(o!==D||!u||u.remaining===0)return 0;let m=Math.min(u.remaining,i());if(m===0)return 0;let x=a(m,p);return u.remaining-=x,x},skipPadding(){if(o!==D||!u)return!0;if(u.remaining>0)throw new Error("Body not fully consumed");return i()<u.padding?!1:(s(u.padding),u=null,o=te,!0)},skipEntry(){if(o!==D||!u)return!0;let p=Math.min(u.remaining,i());return p>0&&(s(p),u.remaining-=p),u.remaining>0?!1:d.skipPadding()},validateEOF(){if(t){if(!f)throw H;if(i()>0&&a(i()).some(p=>p!==0))throw new Error("Invalid EOF.")}}};return d}function ve(e){if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let i=0;i<t.length;i++)if(t[i]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function Fe(){return new CompressionStream("gzip")}function Ie(){return new DecompressionStream("gzip")}function mt(){let e,t;return{readable:new ReadableStream({start(i){e=i,t=Be(i.enqueue.bind(i),i.error.bind(i),i.close.bind(i))}}),controller:{add(i){let r=N(i);return t.add(i),r&&t.endEntry(),new WritableStream({write(n){t.write(n)},close(){r||t.endEntry()},abort(n){e.error(n)}})},finalize(){t.finalize()},error(i){e.error(i)}}}}async function Pe(e){let t=[],i=e.getReader(),r=0;try{for(;;){let{done:a,value:o}=await i.read();if(a)break;t.push(o),r+=o.length}let n=new Uint8Array(r),s=0;for(let a of t)n.set(a,s),s+=a.length;return n}finally{i.releaseLock()}}var Se=e=>e.pipeTo(new WritableStream);function ht(e={}){let t=Te(e),i=e.strict??!1,r=null,n=null,s=!1,a=!1,o=!1,c=!1,l=()=>{try{n?.close()}catch{}n=null},f=d=>{if(!c){c=!0;try{n?.error(d)}catch{}n=null;try{r.error(d)}catch{}r=null}},u=()=>{if(!c){c=!0,l();try{r.close()}catch{}r=null}},y=()=>{if(i)throw new Error("Tar archive is truncated.");u()},g=()=>{if(!(s||c||!r)){s=!0;try{for(;;){if(a){o&&(t.validateEOF(),u());break}if(t.isEntryActive()){if(o&&!t.canFinish()){y();break}if(n){if((n.desiredSize??1)<=0)break;if(t.streamBody(d=>(n.enqueue(d),(n.desiredSize??1)>0))===0&&!t.isBodyComplete()){o&&y();break}}else if(!t.skipEntry()){o&&y();break}if(t.isBodyComplete()&&(l(),!t.skipPadding())){o&&y();break}}else{if((r.desiredSize??0)<0)break;let d=t.readHeader();if(d===null){o&&u();break}if(d===void 0){if(o){t.validateEOF(),u();break}a=!0;break}r.enqueue({header:d,body:new ReadableStream({start(p){d.size===0?p.close():n=p},pull:g,cancel(){n=null,g()}})})}}}catch(d){throw f(d),d}finally{s=!1}}};return{readable:new ReadableStream({start(d){r=d},pull:g,cancel(d){d!==void 0?f(d):u()}},{highWaterMark:2}),writable:new WritableStream({write(d){try{if(a&&i&&d.some(p=>p!==0))throw new Error("Invalid EOF.");t.write(d),g()}catch(p){throw f(p),p}},close(){try{o=!0,t.end(),g()}catch(d){throw f(d),d}},abort(d){f(d)}})}}async function Oe(e){let{readable:t,controller:i}=mt();return await(async()=>{for(let r of e){let n=i.add(r.header),s="body"in r?r.body:r.data;if(!s){await n.close();continue}if(s instanceof ReadableStream)await s.pipeTo(n);else if(s instanceof Blob)await s.stream().pipeTo(n);else try{let a=await Ce(s);if(a.length>0){let o=n.getWriter();await o.write(a),await o.close()}else await n.close()}catch{throw new TypeError(`Unsupported content type for entry "${r.header.name}".`)}}})().then(()=>i.finalize()).catch(r=>i.error(r)),new Uint8Array(await Pe(t))}async function Ue(e,t={}){let i=e instanceof ReadableStream?e:new ReadableStream({start(s){s.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),s.close()}}),r=[],n=i.pipeThrough(ht(t));for await(let s of n){let a;try{a=Ae(s.header,t)}catch(o){throw await s.body.cancel(),o}if(a===null){await Se(s.body);continue}N(a)?(await Se(s.body),r.push({header:a})):r.push({header:a,data:await Pe(s.body)})}return r}import At from"seek-bzip";var pt=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let i=t<<24;for(let r=0;r<8;r++)i=i&2147483648?i<<1^79764919:i<<1;e[t]=i>>>0}return e})();function gt(e,t){return(e<<8^pt[(e>>>24^t)&255])>>>0}var ie=class{buffer=[];current=0;bitCount=0;writeBits(t,i){for(let r=t-1;r>=0;r--)this.current=this.current<<1|i>>>r&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(t){this.current=this.current<<1|t&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function yt(e){let t=[],i=0;for(;i<e.length;){let r=e[i],n=1;for(;i+n<e.length&&e[i+n]===r&&n<255;)n++;n>=4?(t.push(r,r,r,r),t.push(n-4),i+=n):(t.push(r),i++)}return new Uint8Array(t)}function wt(e){let t=e.length;if(t===0)return{transformed:new Uint8Array(0),pointer:0};let i=bt(e),r=new Uint8Array(t),n=0;for(let s=0;s<t;s++)i[s]===0?(n=s,r[s]=e[t-1]):r[s]=e[i[s]-1];return{transformed:r,pointer:n}}function bt(e){let t=e.length,i=new Int32Array(t),r=new Int32Array(t);for(let n=0;n<t;n++)i[n]=n,r[n]=e[n];for(let n=1;n<t;n*=2){let s=r.slice();i.sort((a,o)=>s[a]!==s[o]?s[a]-s[o]:s[(a+n)%t]-s[(o+n)%t]),r[i[0]]=0;for(let a=1;a<t;a++)s[i[a]]===s[i[a-1]]&&s[(i[a]+n)%t]===s[(i[a-1]+n)%t]?r[i[a]]=r[i[a-1]]:r[i[a]]=r[i[a-1]]+1;if(r[i[t-1]]===t-1)break}return i}function xt(e,t){let i=[];for(let a=0;a<256;a++)t[a]&&i.push(a);let r=new Array(256).fill(-1);for(let a=0;a<i.length;a++)r[i[a]]=a;let n=new Uint16Array(e.length),s=i.slice();for(let a=0;a<e.length;a++){let o=e[a],c=0;for(;s[c]!==o;)c++;if(n[a]=c,c>0){let l=s[c];for(let f=c;f>0;f--)s[f]=s[f-1];s[0]=l}}return{encoded:n,length:e.length}}function vt(e,t,i){let s=i+1,a=[],o=0;for(;o<t;)if(e[o]===0){let l=0;for(;o<t&&e[o]===0;)l++,o++;let f=l;for(;f>0;)f--,f&1?a.push(1):a.push(0),f>>>=1}else a.push(e[o]+1),o++;a.push(s);let c=new Uint16Array(a.length);for(let l=0;l<a.length;l++)c[l]=a[l];return{symbols:c,length:a.length,eob:s}}function Ne(e,t,i){if(t<=1){let l=new Array(e.length).fill(0);for(let f=0;f<e.length;f++)e[f]>0&&(l[f]=1);return{codeLengths:l,maxLen:1,minLen:1}}let r=[];for(let l=0;l<e.length;l++)e[l]>0&&r.push({freq:e[l],symbol:l,left:null,right:null});if(r.length===0)return{codeLengths:new Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let l=new Array(e.length).fill(0);return l[r[0].symbol]=1,{codeLengths:l,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((u,y)=>u.freq-y.freq);let l=r.shift(),f=r.shift();r.push({freq:l.freq+f.freq,symbol:-1,left:l,right:f})}let n=new Array(e.length).fill(0);function s(l,f){if(!l.left&&!l.right){n[l.symbol]=f;return}l.left&&s(l.left,f+1),l.right&&s(l.right,f+1)}s(r[0],0);let a=!0;for(;a;){a=!1;for(let l=0;l<n.length;l++)n[l]>i&&(n[l]=i,a=!0);if(a){let l=0;for(let f=0;f<n.length;f++)n[f]>0&&(l+=1/(1<<n[f]));if(l>1)for(let f=1;f<i&&l>1;f++)for(let u=0;u<n.length&&l>1;u++)n[u]===f&&(n[u]++,l-=1/(1<<f)-1/(1<<f+1));a=!1;for(let f=0;f<n.length;f++)if(n[f]>i){a=!0;break}}}let o=i,c=0;for(let l=0;l<n.length;l++)n[l]>0&&(n[l]<o&&(o=n[l]),n[l]>c&&(c=n[l]));return{codeLengths:n,maxLen:c,minLen:o}}function kt(e,t){let i=new Array(t).fill(0),r=e.slice(0,t),n=Math.max(...r,0),s=new Array(n+1).fill(0);for(let c=0;c<t;c++)r[c]>0&&s[r[c]]++;let a=new Array(n+1).fill(0),o=0;for(let c=1;c<=n;c++)o=o+s[c-1]<<1,a[c]=o;for(let c=0;c<t;c++)r[c]>0&&(i[c]=a[r[c]]++);return{codes:i,lengths:r}}function zt(e,t,i){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,i),e.writeBit(0);let r=yt(t),{transformed:n,pointer:s}=wt(r);e.writeBits(24,s);let a=new Array(256).fill(!1);for(let h=0;h<n.length;h++)a[n[h]]=!0;let o=new Array(16).fill(!1);for(let h=0;h<16;h++)for(let w=0;w<16;w++)if(a[h*16+w]){o[h]=!0;break}for(let h=0;h<16;h++)e.writeBit(o[h]?1:0);for(let h=0;h<16;h++)if(o[h])for(let w=0;w<16;w++)e.writeBit(a[h*16+w]?1:0);let c=0;for(let h=0;h<256;h++)a[h]&&c++;let{encoded:l,length:f}=xt(n,a),{symbols:u,length:y}=vt(l,f,c),g=c+2,d=50,p=Math.ceil(y/d),m;y<200?m=2:y<600?m=3:y<1200?m=4:y<2400?m=5:m=6,m>p&&(m=Math.max(2,p));let x=[];for(let h=0;h<m;h++)x.push(new Array(g).fill(0));let b=new Int32Array(p);for(let h=0;h<p;h++)b[h]=h%m;for(let h=0;h<p;h++){let w=h*d,k=Math.min(w+d,y),B=b[h];for(let C=w;C<k;C++)x[B][u[C]]++}function E(h){for(let w=0;w<g;w++)h[w]<1&&(h[w]=1)}let v=[];for(let h=0;h<m;h++)E(x[h]),v.push(Ne(x[h],g,20));for(let h=0;h<4;h++){for(let w=0;w<m;w++)x[w].fill(0);for(let w=0;w<p;w++){let k=w*d,B=Math.min(k+d,y),C=0,M=1/0;for(let I=0;I<m;I++){let J=0;for(let V=k;V<B;V++)J+=v[I].codeLengths[u[V]]||20;J<M&&(M=J,C=I)}b[w]=C;for(let I=k;I<B;I++)x[C][u[I]]++}for(let w=0;w<m;w++)E(x[w]),v[w]=Ne(x[w],g,20)}e.writeBits(3,m),e.writeBits(15,p);let $=[],z=[];for(let h=0;h<m;h++)z.push(h);for(let h=0;h<p;h++){let w=b[h],k=0;for(;z[k]!==w;)k++;if($.push(k),k>0){let B=z[k];for(let C=k;C>0;C--)z[C]=z[C-1];z[0]=B}}for(let h=0;h<p;h++){for(let w=0;w<$[h];w++)e.writeBit(1);e.writeBit(0)}for(let h=0;h<m;h++){let w=v[h].codeLengths,k=w[0];e.writeBits(5,k);for(let B=0;B<g;B++){let C=w[B];for(;k<C;)e.writeBit(1),e.writeBit(0),k++;for(;k>C;)e.writeBit(1),e.writeBit(1),k--;e.writeBit(0)}}for(let h=0;h<m;h++){let{codes:w,lengths:k}=kt(v[h].codeLengths,g);v[h]=Object.assign(v[h],{_codes:w,_lengths:k})}let he=0,R=0;for(let h=0;h<y;h++){(R===0||R>=d)&&(h>0&&he++,R=0);let w=b[he],k=v[w],B=u[h],C=k._lengths[B],M=k._codes[B];C>0&&e.writeBits(C,M),R++}}var Ct=10*1024*1024;function Le(e,t=9,i=Ct){if(t<1||t>9)throw new Error("Block size level must be 1-9");if(e.length>i)throw new Error(`Input too large for bzip2 compression (${e.length} bytes, max ${i})`);let r=t*1e5,n=new ie;n.writeBits(8,66),n.writeBits(8,90),n.writeBits(8,104),n.writeBits(8,48+t);let s=0,a=0;for(;a<e.length;){let o=Math.min(a+r,e.length),c=e.subarray(a,o),l=4294967295;for(let f=0;f<c.length;f++)l=gt(l,c[f]);l=~l>>>0,s=(s<<1|s>>>31)>>>0,s=(s^l)>>>0,zt(n,c,l),a=o}return n.writeBits(24,1536581),n.writeBits(24,3690640),n.writeBits(32,s),n.finish()}var X=null,Z=null;async function Me(){if(X)return X;if(Z)throw Z;try{return X=await Q.runTrustedAsync(()=>import("node-liblzma")),X}catch{throw Z=new Error("xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies."),Z}}var G=null,q=null;async function We(){if(G)return G;if(q)throw q;try{return G=await Q.runTrustedAsync(()=>import("@mongodb-js/zstd")),G}catch{throw q=new Error("zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd"),q}}var A=100*1024*1024,De=512,Re=1e4;function Et(e){let t="file";e.isDirectory?t="directory":e.isSymlink&&(t="symlink");let i=e.name;e.isDirectory&&!i.endsWith("/")&&(i+="/");let r;e.content!==void 0&&(typeof e.content=="string"?r=new TextEncoder().encode(e.content):r=e.content);let n=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:i,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:n,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??"",uname:"user",gname:"user"},body:r}}async function O(e){let t=e.map(Et);return Oe(t)}async function je(e){let t=await O(e),n=new ReadableStream({start(l){l.enqueue(t),l.close()}}).pipeThrough(Fe()).getReader(),s=[];for(;;){let{done:l,value:f}=await n.read();if(l)break;s.push(f)}let a=s.reduce((l,f)=>l+f.length,0),o=new Uint8Array(a),c=0;for(let l of s)o.set(l,c),c+=l.length;return o}async function F(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};if(e.length<De||e.length%De!==0)return{entries:[],error:"Invalid tar archive format"};try{let t=await Ue(e),i=[];for(let r of t){if(i.length>=Re)return{entries:i,error:`Too many entries (max ${Re})`};let n="file";switch(r.header.type){case"directory":n="directory";break;case"symlink":n="symlink";break;case"link":n="hardlink";break;case"file":n="file";break;default:n="other"}i.push({name:r.header.name,mode:r.header.mode??420,uid:r.header.uid??0,gid:r.header.gid??0,size:r.header.size,mtime:r.header.mtime??new Date,type:n,linkTarget:r.header.linkname||void 0,content:r.data??new Uint8Array(0)})}return{entries:i}}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function se(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let r=new ReadableStream({start(c){c.enqueue(e),c.close()}}).pipeThrough(Ie()).getReader(),n=[],s=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(s+=l.length,s>A)return await r.cancel(),{entries:[],error:`Decompressed archive too large (max ${A} bytes)`};n.push(l)}let a=new Uint8Array(s),o=0;for(let c of n)a.set(c,o),o+=c.length;return F(a)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:`Decompression failed: ${i}`}}}function oe(e){return e.length>=2&&e[0]===31&&e[1]===139}function ae(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function le(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function $t(e){let t=At.decode(Buffer.from(e));return new Uint8Array(t)}async function Bt(e){return Le(e,9)}async function Tt(e){let i=(await Me()).unxzSync(Buffer.from(e));return new Uint8Array(i)}async function St(e){let i=(await Me()).xzSync(Buffer.from(e));return new Uint8Array(i)}async function He(e){let t=await O(e);return Bt(t)}async function _e(e,t){if(!t?.allowNativeCodecs)throw new Error("xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return St(i)}async function ce(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let t=await $t(e);return t.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(t)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function fe(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await Tt(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function ue(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Ft(e){let i=await(await We()).compress(Buffer.from(e),3);return new Uint8Array(i)}async function It(e){let i=await(await We()).decompress(Buffer.from(e));return new Uint8Array(i)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw new Error("zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return Ft(i)}async function de(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await It(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function Ze(e){let t={create:!1,append:!1,update:!1,extract:!1,list:!1,file:"",autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:"",preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:"",excludeFrom:"",wildcards:!1},i=[],r=0;for(;r<e.length;){let n=e[r];if(n.startsWith("-")&&!n.startsWith("--")&&n.length>2){if(/^-\d+$/.test(n)){i.push(n),r++;continue}for(let s=1;s<n.length;s++){let a=n[s];switch(a){case"c":t.create=!0;break;case"r":t.append=!0;break;case"u":t.update=!0;break;case"x":t.extract=!0;break;case"t":t.list=!0;break;case"a":t.autoCompress=!0;break;case"z":t.gzip=!0;break;case"j":t.bzip2=!0;break;case"J":t.xz=!0;break;case"v":t.verbose=!0;break;case"O":t.toStdout=!0;break;case"k":t.keepOldFiles=!0;break;case"m":t.touch=!0;break;case"p":t.preserve=!0;break;case"P":t.absoluteNames=!0;break;case"f":if(s<n.length-1)t.file=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
3
3
  `,exitCode:2}};t.file=e[r]}break;case"C":if(s<n.length-1)t.directory=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
4
4
  `,exitCode:2}};t.directory=e[r]}break;case"T":if(s<n.length-1)t.filesFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
@@ -17,7 +17,7 @@ import{a as ye}from"./chunk-X2AJGDEF.js";import{b as Q}from"./chunk-5QMZ5MUS.js"
17
17
  `,exitCode:2}}let c="";if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(f,o)}catch(u){let y=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${y}
18
18
  `,exitCode:2}}}else c=Buffer.from(o).toString("latin1");let l=a;return s.length>0&&(l+=`${s.join(`
19
19
  `)}
20
- `),{stdout:c,stderr:l,exitCode:s.length>0?2:0}}async function Lt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
20
+ `),{stdout:c,stderr:l,exitCode:s.length>0?2:0,stdoutKind:c.length>0?"bytes":"text"}}async function Lt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
21
21
  `,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to append nothing to archive
22
22
  `,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
23
23
  `,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
@@ -51,7 +51,7 @@ import{a as ye}from"./chunk-X2AJGDEF.js";import{b as Q}from"./chunk-5QMZ5MUS.js"
51
51
  `,exitCode:2}}}else r=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
52
52
  `,exitCode:2};let l="";for(let f of n.entries){let u=qe(f.name,t.strip);if(!u)continue;let y=u.endsWith("/")?u.slice(0,-1):u;if(i.length>0){let g;if(t.wildcards?g=i.some(d=>Y(u,d)||Y(y,d)||u.startsWith(`${d}/`)):g=i.some(d=>u===d||u.startsWith(`${d}/`)||y===d),!g)continue}if(!me(u,t.exclude))if(t.verbose){let g=f.type==="directory",d=ye(f.mode,g),p=`${f.uid}/${f.gid}`,m=f.size.toString().padStart(8," "),x=Ut(f.mtime),b=`${d} ${p.padEnd(10)} ${m} ${x} ${u}`;f.type==="symlink"&&f.linkTarget&&(b+=` -> ${f.linkTarget}`),l+=`${b}
53
53
  `}else l+=`${u}
54
- `}return{stdout:l,stderr:"",exitCode:0}}var nr={name:"tar",async execute(e,t){if(ge(e))return pe(Pt);let i=Ze(e);if(!i.ok)return i.error;let{options:r,files:n}=i,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
54
+ `}return{stdout:l,stderr:"",exitCode:0}}var sr={name:"tar",async execute(e,t){if(ge(e))return pe(Pt);let i=Ze(e);if(!i.ok)return i.error;let{options:r,files:n}=i,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
55
55
  `,exitCode:2};if(s>1)return{stdout:"",stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
56
56
  `,exitCode:2};if(r.autoCompress&&r.file&&r.create){let c=r.file.toLowerCase();c.endsWith(".tar.gz")||c.endsWith(".tgz")?r.gzip=!0:c.endsWith(".tar.bz2")||c.endsWith(".tbz2")?r.bzip2=!0:c.endsWith(".tar.xz")||c.endsWith(".txz")?r.xz=!0:(c.endsWith(".tar.zst")||c.endsWith(".tzst"))&&(r.zstd=!0)}let a=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(a>1)return{stdout:"",stderr:`tar: You may not specify more than one compression option
57
57
  `,exitCode:2};if((r.append||r.update)&&a>0)return{stdout:"",stderr:`tar: Cannot append/update compressed archives - decompress first
@@ -59,4 +59,4 @@ import{a as ye}from"./chunk-X2AJGDEF.js";import{b as Q}from"./chunk-5QMZ5MUS.js"
59
59
  `).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));o=[...n,...f]}catch{return{stdout:"",stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory
60
60
  `,exitCode:2}}}if(r.excludeFrom){let c=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let f=(await t.fs.readFile(c)).split(`
61
61
  `).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));r.exclude.push(...f)}catch{return{stdout:"",stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory
62
- `,exitCode:2}}}return r.create?Nt(t,r,o):r.append?Lt(t,r,o):r.update?Dt(t,r,o):r.extract?Rt(t,r,o):Mt(t,r,o)}},ir={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{nr as a,ir as b};
62
+ `,exitCode:2}}}return r.create?Nt(t,r,o):r.append?Lt(t,r,o):r.update?Dt(t,r,o):r.extract?Rt(t,r,o):Mt(t,r,o)}},or={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{sr as a,or as b};
@@ -0,0 +1,12 @@
1
+ import{c as g}from"./chunk-AH77CRWX.js";import{a as y,b as $,c as F}from"./chunk-74CEPOFO.js";var b={name:"comm",summary:"compare two sorted files line by line",usage:"comm [OPTION]... FILE1 FILE2",options:["-1 suppress column 1 (lines unique to FILE1)","-2 suppress column 2 (lines unique to FILE2)","-3 suppress column 3 (lines that appear in both files)"," --help display this help and exit"]},E={name:"comm",async execute(m,a){if($(m))return y(b);let r=!1,l=!1,f=!1,i=[];for(let e of m)if(e==="-1")r=!0;else if(e==="-2")l=!0;else if(e==="-3")f=!0;else if(e==="-12"||e==="-21")r=!0,l=!0;else if(e==="-13"||e==="-31")r=!0,f=!0;else if(e==="-23"||e==="-32")l=!0,f=!0;else if(e==="-123"||e==="-132"||e==="-213"||e==="-231"||e==="-312"||e==="-321")r=!0,l=!0,f=!0;else{if(e.startsWith("-")&&e!=="-")return F("comm",e);i.push(e)}if(i.length!==2)return{stdout:"",stderr:`comm: missing operand
2
+ Try 'comm --help' for more information.
3
+ `,exitCode:1};let p=async e=>{if(e==="-")return g(a.stdin);try{let x=a.fs.resolvePath(a.cwd,e);return await a.fs.readFile(x)}catch{return null}},c=await p(i[0]);if(c===null)return{stdout:"",stderr:`comm: ${i[0]}: No such file or directory
4
+ `,exitCode:1};let d=await p(i[1]);if(d===null)return{stdout:"",stderr:`comm: ${i[1]}: No such file or directory
5
+ `,exitCode:1};let t=c.split(`
6
+ `),s=d.split(`
7
+ `);t.length>0&&t[t.length-1]===""&&t.pop(),s.length>0&&s[s.length-1]===""&&s.pop();let n=0,o=0,u="",h=r?"":" ",w=(r?"":" ")+(l?"":" ");for(;n<t.length||o<s.length;)n>=t.length?(l||(u+=`${h}${s[o]}
8
+ `),o++):o>=s.length?(r||(u+=`${t[n]}
9
+ `),n++):t[n]<s[o]?(r||(u+=`${t[n]}
10
+ `),n++):t[n]>s[o]?(l||(u+=`${h}${s[o]}
11
+ `),o++):(f||(u+=`${w}${t[n]}
12
+ `),n++,o++);return{stdout:u,stderr:"",exitCode:0}}},L={name:"comm",flags:[{flag:"-1",type:"boolean"},{flag:"-2",type:"boolean"},{flag:"-3",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,L as b};