just-bash-nx 2.14.6 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) 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 +6 -5
  355. package/dist/bin/chunks/awk2-RSUCURL4.js +0 -2
  356. package/dist/bin/chunks/base64-43M2R3GA.js +0 -2
  357. package/dist/bin/chunks/bash-6ZHZ6BX7.js +0 -2
  358. package/dist/bin/chunks/cat-XZIJZXKP.js +0 -2
  359. package/dist/bin/chunks/chunk-22NDZXS5.js +0 -33
  360. package/dist/bin/chunks/chunk-26NO42TF.js +0 -14
  361. package/dist/bin/chunks/chunk-2W2SCVT6.js +0 -140
  362. package/dist/bin/chunks/chunk-5G2VOPPJ.js +0 -7
  363. package/dist/bin/chunks/chunk-5WFYIUU2.js +0 -3
  364. package/dist/bin/chunks/chunk-AAW7UMPO.js +0 -9
  365. package/dist/bin/chunks/chunk-CGE2EHYP.js +0 -5
  366. package/dist/bin/chunks/chunk-CM4532DS.js +0 -36
  367. package/dist/bin/chunks/chunk-CQG2HEAL.js +0 -5
  368. package/dist/bin/chunks/chunk-E5BDLLK6.js +0 -15
  369. package/dist/bin/chunks/chunk-EUXCM6C4.js +0 -12
  370. package/dist/bin/chunks/chunk-F3LGZXLQ.js +0 -9
  371. package/dist/bin/chunks/chunk-FA2CHD73.js +0 -16
  372. package/dist/bin/chunks/chunk-FLPVVSN5.js +0 -5
  373. package/dist/bin/chunks/chunk-FSZWFMB4.js +0 -16
  374. package/dist/bin/chunks/chunk-GO6FXSC4.js +0 -6
  375. package/dist/bin/chunks/chunk-JQBC3FXE.js +0 -8
  376. package/dist/bin/chunks/chunk-KCMUAACL.js +0 -19
  377. package/dist/bin/chunks/chunk-LGJM5YFT.js +0 -17
  378. package/dist/bin/chunks/chunk-LMK6G2HH.js +0 -8
  379. package/dist/bin/chunks/chunk-MRP4ZCD7.js +0 -6
  380. package/dist/bin/chunks/chunk-OBI37ZY4.js +0 -9
  381. package/dist/bin/chunks/chunk-PXVBSPBE.js +0 -2
  382. package/dist/bin/chunks/chunk-RA3TG4UK.js +0 -9
  383. package/dist/bin/chunks/chunk-RBQGQWGV.js +0 -10
  384. package/dist/bin/chunks/chunk-RJSAGJQJ.js +0 -11
  385. package/dist/bin/chunks/chunk-ROJPSS6N.js +0 -3
  386. package/dist/bin/chunks/chunk-S7OHMN3F.js +0 -6
  387. package/dist/bin/chunks/chunk-TTNNO45C.js +0 -17
  388. package/dist/bin/chunks/chunk-WWZVR5NN.js +0 -6
  389. package/dist/bin/chunks/chunk-XXCTETRW.js +0 -11
  390. package/dist/bin/chunks/chunk-YEKSVVRC.js +0 -11
  391. package/dist/bin/chunks/chunk-ZA4HUKJ3.js +0 -13
  392. package/dist/bin/chunks/chunk-ZKC5HQYO.js +0 -14
  393. package/dist/bin/chunks/column-XGV32UPN.js +0 -2
  394. package/dist/bin/chunks/comm-R3F3Z5DX.js +0 -2
  395. package/dist/bin/chunks/cut-5EY2XPXX.js +0 -2
  396. package/dist/bin/chunks/diff-5NUI5BHG.js +0 -2
  397. package/dist/bin/chunks/env-NTPN5QYM.js +0 -2
  398. package/dist/bin/chunks/expand-26XPP5KB.js +0 -2
  399. package/dist/bin/chunks/find-7CVMEZBO.js +0 -2
  400. package/dist/bin/chunks/flag-coverage-OH2CJRFX.js +0 -2
  401. package/dist/bin/chunks/fold-XSVNTAWH.js +0 -2
  402. package/dist/bin/chunks/grep-7BJ7HFBM.js +0 -2
  403. package/dist/bin/chunks/gzip-LHOO65AN.js +0 -2
  404. package/dist/bin/chunks/head-YMNRW3F3.js +0 -2
  405. package/dist/bin/chunks/html-to-markdown-V6PK6S5U.js +0 -2
  406. package/dist/bin/chunks/join-Y4Q5WVVE.js +0 -2
  407. package/dist/bin/chunks/jq-4JWOFG7X.js +0 -2
  408. package/dist/bin/chunks/md5sum-NCLXV2S3.js +0 -2
  409. package/dist/bin/chunks/nl-XH3L75DR.js +0 -2
  410. package/dist/bin/chunks/od-52FBC34W.js +0 -2
  411. package/dist/bin/chunks/paste-3UVLMQ2K.js +0 -2
  412. package/dist/bin/chunks/python3-JUJKPBFB.js +0 -12
  413. package/dist/bin/chunks/rev-UHEPS2UL.js +0 -2
  414. package/dist/bin/chunks/rg-DK6FRF6Q.js +0 -2
  415. package/dist/bin/chunks/sed-WWXBUNG3.js +0 -2
  416. package/dist/bin/chunks/sha1sum-BHNJ5ALF.js +0 -2
  417. package/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +0 -2
  418. package/dist/bin/chunks/sort-7GENYU2I.js +0 -2
  419. package/dist/bin/chunks/split-YWV64TJH.js +0 -2
  420. package/dist/bin/chunks/sqlite3-CVNFMP3Z.js +0 -2
  421. package/dist/bin/chunks/strings-XXKZCWY5.js +0 -2
  422. package/dist/bin/chunks/tac-T42SKDDI.js +0 -2
  423. package/dist/bin/chunks/tail-V537TDFR.js +0 -2
  424. package/dist/bin/chunks/tar-GTGFEWDS.js +0 -2
  425. package/dist/bin/chunks/tee-HK2SYCAR.js +0 -2
  426. package/dist/bin/chunks/time-5R4QWCYF.js +0 -2
  427. package/dist/bin/chunks/timeout-Z24MNWOP.js +0 -2
  428. package/dist/bin/chunks/tr-4FPGAEVB.js +0 -2
  429. package/dist/bin/chunks/unexpand-OYZ7KOYR.js +0 -2
  430. package/dist/bin/chunks/uniq-TMSAIZM3.js +0 -2
  431. package/dist/bin/chunks/wc-ZIV3TFVG.js +0 -2
  432. package/dist/bin/chunks/xan-FKXPSPE5.js +0 -2
  433. package/dist/bin/chunks/xan-view-6J5MMMQB.js +0 -2
  434. package/dist/bin/chunks/xargs-SCYIFXOW.js +0 -2
  435. package/dist/bin/chunks/yq-RGXFWYJN.js +0 -2
  436. package/dist/bin/shell/chunks/awk2-RSUCURL4.js +0 -2
  437. package/dist/bin/shell/chunks/base64-43M2R3GA.js +0 -2
  438. package/dist/bin/shell/chunks/bash-6ZHZ6BX7.js +0 -2
  439. package/dist/bin/shell/chunks/cat-XZIJZXKP.js +0 -2
  440. package/dist/bin/shell/chunks/chunk-22NDZXS5.js +0 -33
  441. package/dist/bin/shell/chunks/chunk-26NO42TF.js +0 -14
  442. package/dist/bin/shell/chunks/chunk-2W2SCVT6.js +0 -140
  443. package/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +0 -7
  444. package/dist/bin/shell/chunks/chunk-5WFYIUU2.js +0 -3
  445. package/dist/bin/shell/chunks/chunk-AAW7UMPO.js +0 -9
  446. package/dist/bin/shell/chunks/chunk-CGE2EHYP.js +0 -5
  447. package/dist/bin/shell/chunks/chunk-CM4532DS.js +0 -36
  448. package/dist/bin/shell/chunks/chunk-CQG2HEAL.js +0 -5
  449. package/dist/bin/shell/chunks/chunk-E5BDLLK6.js +0 -15
  450. package/dist/bin/shell/chunks/chunk-EUXCM6C4.js +0 -12
  451. package/dist/bin/shell/chunks/chunk-F3LGZXLQ.js +0 -9
  452. package/dist/bin/shell/chunks/chunk-FA2CHD73.js +0 -16
  453. package/dist/bin/shell/chunks/chunk-FLPVVSN5.js +0 -5
  454. package/dist/bin/shell/chunks/chunk-FSZWFMB4.js +0 -16
  455. package/dist/bin/shell/chunks/chunk-GO6FXSC4.js +0 -6
  456. package/dist/bin/shell/chunks/chunk-HC7WB764.js +0 -2
  457. package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +0 -8
  458. package/dist/bin/shell/chunks/chunk-KCMUAACL.js +0 -19
  459. package/dist/bin/shell/chunks/chunk-LGJM5YFT.js +0 -17
  460. package/dist/bin/shell/chunks/chunk-LMK6G2HH.js +0 -8
  461. package/dist/bin/shell/chunks/chunk-MRP4ZCD7.js +0 -6
  462. package/dist/bin/shell/chunks/chunk-OBI37ZY4.js +0 -9
  463. package/dist/bin/shell/chunks/chunk-RA3TG4UK.js +0 -9
  464. package/dist/bin/shell/chunks/chunk-RBQGQWGV.js +0 -10
  465. package/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +0 -11
  466. package/dist/bin/shell/chunks/chunk-ROJPSS6N.js +0 -3
  467. package/dist/bin/shell/chunks/chunk-S7OHMN3F.js +0 -6
  468. package/dist/bin/shell/chunks/chunk-TTNNO45C.js +0 -17
  469. package/dist/bin/shell/chunks/chunk-WWZVR5NN.js +0 -6
  470. package/dist/bin/shell/chunks/chunk-XXCTETRW.js +0 -11
  471. package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +0 -11
  472. package/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +0 -13
  473. package/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +0 -14
  474. package/dist/bin/shell/chunks/column-XGV32UPN.js +0 -2
  475. package/dist/bin/shell/chunks/comm-R3F3Z5DX.js +0 -2
  476. package/dist/bin/shell/chunks/cut-5EY2XPXX.js +0 -2
  477. package/dist/bin/shell/chunks/diff-5NUI5BHG.js +0 -2
  478. package/dist/bin/shell/chunks/env-NTPN5QYM.js +0 -2
  479. package/dist/bin/shell/chunks/expand-26XPP5KB.js +0 -2
  480. package/dist/bin/shell/chunks/find-7CVMEZBO.js +0 -2
  481. package/dist/bin/shell/chunks/flag-coverage-OH2CJRFX.js +0 -2
  482. package/dist/bin/shell/chunks/fold-XSVNTAWH.js +0 -2
  483. package/dist/bin/shell/chunks/grep-7BJ7HFBM.js +0 -2
  484. package/dist/bin/shell/chunks/gzip-LHOO65AN.js +0 -2
  485. package/dist/bin/shell/chunks/head-YMNRW3F3.js +0 -2
  486. package/dist/bin/shell/chunks/html-to-markdown-V6PK6S5U.js +0 -2
  487. package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +0 -2
  488. package/dist/bin/shell/chunks/jq-4JWOFG7X.js +0 -2
  489. package/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +0 -2
  490. package/dist/bin/shell/chunks/nl-XH3L75DR.js +0 -2
  491. package/dist/bin/shell/chunks/od-52FBC34W.js +0 -2
  492. package/dist/bin/shell/chunks/paste-3UVLMQ2K.js +0 -2
  493. package/dist/bin/shell/chunks/python3-RRCCYJKA.js +0 -12
  494. package/dist/bin/shell/chunks/rev-UHEPS2UL.js +0 -2
  495. package/dist/bin/shell/chunks/rg-DK6FRF6Q.js +0 -2
  496. package/dist/bin/shell/chunks/sed-WWXBUNG3.js +0 -2
  497. package/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +0 -2
  498. package/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +0 -2
  499. package/dist/bin/shell/chunks/sort-7GENYU2I.js +0 -2
  500. package/dist/bin/shell/chunks/split-YWV64TJH.js +0 -2
  501. package/dist/bin/shell/chunks/sqlite3-CVNFMP3Z.js +0 -2
  502. package/dist/bin/shell/chunks/strings-XXKZCWY5.js +0 -2
  503. package/dist/bin/shell/chunks/tac-T42SKDDI.js +0 -2
  504. package/dist/bin/shell/chunks/tail-V537TDFR.js +0 -2
  505. package/dist/bin/shell/chunks/tar-GTGFEWDS.js +0 -2
  506. package/dist/bin/shell/chunks/tee-HK2SYCAR.js +0 -2
  507. package/dist/bin/shell/chunks/time-5R4QWCYF.js +0 -2
  508. package/dist/bin/shell/chunks/timeout-Z24MNWOP.js +0 -2
  509. package/dist/bin/shell/chunks/tr-4FPGAEVB.js +0 -2
  510. package/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +0 -2
  511. package/dist/bin/shell/chunks/uniq-TMSAIZM3.js +0 -2
  512. package/dist/bin/shell/chunks/wc-ZIV3TFVG.js +0 -2
  513. package/dist/bin/shell/chunks/xan-FKXPSPE5.js +0 -2
  514. package/dist/bin/shell/chunks/xan-view-6J5MMMQB.js +0 -2
  515. package/dist/bin/shell/chunks/xargs-SCYIFXOW.js +0 -2
  516. package/dist/bin/shell/chunks/yq-RGXFWYJN.js +0 -2
  517. package/dist/bundle/chunks/awk2-JFGEGLFP.js +0 -1
  518. package/dist/bundle/chunks/base64-4YMZCVJ5.js +0 -1
  519. package/dist/bundle/chunks/bash-IJWYRKFO.js +0 -1
  520. package/dist/bundle/chunks/cat-RDUMLXKC.js +0 -1
  521. package/dist/bundle/chunks/chunk-55VFSPNA.js +0 -2
  522. package/dist/bundle/chunks/chunk-7ESWU5HP.js +0 -14
  523. package/dist/bundle/chunks/chunk-7L36YK2X.js +0 -2
  524. package/dist/bundle/chunks/chunk-A7ICOL4V.js +0 -13
  525. package/dist/bundle/chunks/chunk-B53Y5JFV.js +0 -8
  526. package/dist/bundle/chunks/chunk-D4J545R4.js +0 -11
  527. package/dist/bundle/chunks/chunk-D6CWQ5DW.js +0 -5
  528. package/dist/bundle/chunks/chunk-DBKNVD4L.js +0 -9
  529. package/dist/bundle/chunks/chunk-EIZGF4BS.js +0 -8
  530. package/dist/bundle/chunks/chunk-GXVXFKBA.js +0 -5
  531. package/dist/bundle/chunks/chunk-HDQ56CKY.js +0 -15
  532. package/dist/bundle/chunks/chunk-HWBSOZZR.js +0 -35
  533. package/dist/bundle/chunks/chunk-I57KEIP3.js +0 -10
  534. package/dist/bundle/chunks/chunk-JVPRLUMK.js +0 -7
  535. package/dist/bundle/chunks/chunk-KMEYNNUA.js +0 -15
  536. package/dist/bundle/chunks/chunk-KX3P26DQ.js +0 -1
  537. package/dist/bundle/chunks/chunk-LWEGUNWT.js +0 -7
  538. package/dist/bundle/chunks/chunk-MDLLFABN.js +0 -4
  539. package/dist/bundle/chunks/chunk-MHTUABJP.js +0 -8
  540. package/dist/bundle/chunks/chunk-MYE6AGBJ.js +0 -16
  541. package/dist/bundle/chunks/chunk-NAERJDUW.js +0 -8
  542. package/dist/bundle/chunks/chunk-P7UWRQ44.js +0 -139
  543. package/dist/bundle/chunks/chunk-PP6PSHAB.js +0 -4
  544. package/dist/bundle/chunks/chunk-PYDZ2LCK.js +0 -16
  545. package/dist/bundle/chunks/chunk-PYSFUGCK.js +0 -10
  546. package/dist/bundle/chunks/chunk-QCDB2VPH.js +0 -6
  547. package/dist/bundle/chunks/chunk-SDNKECQQ.js +0 -5
  548. package/dist/bundle/chunks/chunk-TLSUDHID.js +0 -6
  549. package/dist/bundle/chunks/chunk-TOMNU26N.js +0 -4
  550. package/dist/bundle/chunks/chunk-TXBZCHCQ.js +0 -5
  551. package/dist/bundle/chunks/chunk-U6NMAV24.js +0 -32
  552. package/dist/bundle/chunks/chunk-VJFXDYWH.js +0 -10
  553. package/dist/bundle/chunks/chunk-VYOJP4TV.js +0 -13
  554. package/dist/bundle/chunks/chunk-WKFATFPP.js +0 -4
  555. package/dist/bundle/chunks/chunk-Z7JVV2SM.js +0 -12
  556. package/dist/bundle/chunks/column-WLPMMSTS.js +0 -1
  557. package/dist/bundle/chunks/comm-5SLSESQG.js +0 -1
  558. package/dist/bundle/chunks/cut-OPC3VAGB.js +0 -1
  559. package/dist/bundle/chunks/diff-HJF2MPDN.js +0 -1
  560. package/dist/bundle/chunks/env-5EPCWSXR.js +0 -1
  561. package/dist/bundle/chunks/expand-DTNXU4LQ.js +0 -1
  562. package/dist/bundle/chunks/find-KNMMLVJD.js +0 -1
  563. package/dist/bundle/chunks/flag-coverage-3WZU3PW6.js +0 -1
  564. package/dist/bundle/chunks/fold-LDSORVYE.js +0 -1
  565. package/dist/bundle/chunks/grep-2UMHPO7Y.js +0 -1
  566. package/dist/bundle/chunks/gzip-AQXSGOVS.js +0 -1
  567. package/dist/bundle/chunks/head-HT2B6D2J.js +0 -1
  568. package/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +0 -1
  569. package/dist/bundle/chunks/join-GG2LDHE5.js +0 -1
  570. package/dist/bundle/chunks/jq-CRLZNLQG.js +0 -1
  571. package/dist/bundle/chunks/md5sum-INMIK4DX.js +0 -1
  572. package/dist/bundle/chunks/nl-U5YJDM32.js +0 -1
  573. package/dist/bundle/chunks/od-VJEF2UR5.js +0 -1
  574. package/dist/bundle/chunks/paste-7N6AFSDS.js +0 -1
  575. package/dist/bundle/chunks/python3-BFV3N3GY.js +0 -11
  576. package/dist/bundle/chunks/rev-XOSYPP45.js +0 -1
  577. package/dist/bundle/chunks/rg-KYSTAD4Q.js +0 -1
  578. package/dist/bundle/chunks/sed-OFX3F4FE.js +0 -1
  579. package/dist/bundle/chunks/sha1sum-VJPNLNU6.js +0 -1
  580. package/dist/bundle/chunks/sha256sum-PI32XWXY.js +0 -1
  581. package/dist/bundle/chunks/sort-DCNRDA7U.js +0 -1
  582. package/dist/bundle/chunks/split-SITCSYCZ.js +0 -1
  583. package/dist/bundle/chunks/sqlite3-56UMWEY3.js +0 -1
  584. package/dist/bundle/chunks/strings-7PLOGTPD.js +0 -1
  585. package/dist/bundle/chunks/tac-SJGXQ4T2.js +0 -1
  586. package/dist/bundle/chunks/tail-S5ULNTJU.js +0 -1
  587. package/dist/bundle/chunks/tar-LYLTEJV3.js +0 -1
  588. package/dist/bundle/chunks/tee-O7VXZDCO.js +0 -1
  589. package/dist/bundle/chunks/time-DEUO3QV2.js +0 -1
  590. package/dist/bundle/chunks/timeout-VRKMCG72.js +0 -1
  591. package/dist/bundle/chunks/tr-2HXZRDSW.js +0 -1
  592. package/dist/bundle/chunks/unexpand-RGTMIGZM.js +0 -1
  593. package/dist/bundle/chunks/uniq-SUNANL47.js +0 -1
  594. package/dist/bundle/chunks/wc-TQB3VNOX.js +0 -1
  595. package/dist/bundle/chunks/xan-DHUKCGIW.js +0 -1
  596. package/dist/bundle/chunks/xan-view-OW2TB7Z3.js +0 -1
  597. package/dist/bundle/chunks/xargs-I6EZUCYF.js +0 -1
  598. package/dist/bundle/chunks/yq-NDDDSAXH.js +0 -1
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as g}from"./chunk-5WFYIUU2.js";import{a as d}from"./chunk-JBABAK44.js";import{a as p,b as f}from"./chunk-GTNBSMZR.js";var O={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"}},N={name:"uniq",async execute(c,y){if(f(c))return p(O);let o=d("uniq",c,w);if(!o.ok)return o.error;let{count:m,duplicatesOnly:h,uniqueOnly:q,ignoreCase:b}=o.result.flags,C=o.result.positional,l=await g(y,C,{cmdName:"uniq"});if(!l.ok)return l.error;let n=l.content.split(`
3
- `);if(n.length>0&&n[n.length-1]===""&&n.pop(),n.length===0)return{stdout:"",stderr:"",exitCode:0};let t=[],r=n[0],i=1,x=(e,s)=>b?e.toLowerCase()===s.toLowerCase():e===s;for(let e=1;e<n.length;e++)x(n[e],r)?i++:(t.push({line:r,count:i}),r=n[e],i=1);t.push({line:r,count:i});let u=t;h?u=t.filter(e=>e.count>1):q&&(u=t.filter(e=>e.count===1));let a="";for(let{line:e,count:s}of u)m?a+=`${String(s).padStart(4)} ${e}
4
- `:a+=`${e}
5
- `;return{stdout:a,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},P={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{N as a,P as b};
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as q,b as w}from"./chunk-OOJCYVYF.js";import{c as b}from"./chunk-MO4RPBN2.js";import{b as j}from"./chunk-YU6OGPZR.js";import{a as E,b as g}from"./chunk-RLNOQILG.js";import{a as C,b as M}from"./chunk-GTNBSMZR.js";import{randomBytes as z}from"node:crypto";import{existsSync as T}from"node:fs";import{dirname as X,join as x}from"node:path";import{fileURLToPath as Y}from"node:url";import{Worker as G}from"node:worker_threads";import K from"sql.js";function A(e,t,r){switch(r.mode){case"list":return O(e,t,r);case"csv":return P(e,t,r);case"json":return N(e,t);case"line":return R(e,t,r);case"column":return F(e,t,r);case"table":return Q(e,t,r);case"markdown":return U(e,t,r);case"tabs":return W(e,t,r);case"box":return D(e,t,r);case"quote":return H(e,t,r);case"html":return J(e,t,r);case"ascii":return _(e,t,r)}}function f(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function O(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function P(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(L).join(","));for(let a of t)n.push(a.map(o=>L(f(o,r.nullValue))).join(","));return n.length>0?`${n.join(`
3
- `)}
4
- `:""}function L(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(`
5
- `)?`"${e.replace(/"/g,'""')}"`:e}function B(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function I(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):B(e):JSON.stringify(e)}function N(e,t){return t.length===0?"":`[${t.map(n=>`{${e.map((o,i)=>`${JSON.stringify(o)}:${I(n[i])}`).join(",")}}`).join(`,
6
- `)}]
7
- `}function R(e,t,r){if(e.length===0||t.length===0)return"";let n=Math.max(5,...e.map(o=>o.length)),a=[];for(let o of t)for(let i=0;i<e.length;i++){let s=e[i].padStart(n);a.push(`${s} = ${f(o[i],r.nullValue)}`)}return`${a.join(`
8
- `)}
9
- `}function F(e,t,r){if(e.length===0)return"";let n=e.map(o=>o.length);for(let o of t)for(let i=0;i<o.length;i++){let s=f(o[i],r.nullValue).length;s>n[i]&&(n[i]=s)}let a=[];r.header&&(a.push(e.map((o,i)=>o.padEnd(n[i])).join(" ")),a.push(n.map(o=>"-".repeat(o)).join(" ")));for(let o of t)a.push(o.map((i,s)=>f(i,r.nullValue).padEnd(n[s])).join(" "));return a.length>0?`${a.join(`
10
- `)}
11
- `:""}function Q(e,t,r){if(e.length===0)return"";let n=e.map(i=>i.length);for(let i of t)for(let s=0;s<i.length;s++){let m=f(i[s],r.nullValue).length;m>n[s]&&(n[s]=m)}let a=[],o=`+${n.map(i=>"-".repeat(i+2)).join("+")}+`;a.push(o),r.header&&(a.push(`| ${e.map((i,s)=>i.padEnd(n[s])).join(" | ")} |`),a.push(o));for(let i of t)a.push(`| ${i.map((s,m)=>f(s,r.nullValue).padEnd(n[m])).join(" | ")} |`);return a.push(o),`${a.join(`
12
- `)}
13
- `}function U(e,t,r){if(e.length===0)return"";let n=[];r.header&&(n.push(`| ${e.join(" | ")} |`),n.push(`|${e.map(()=>"---").join("|")}|`));for(let a of t)n.push(`| ${a.map(o=>f(o,r.nullValue)).join(" | ")} |`);return n.length>0?`${n.join(`
14
- `)}
15
- `:""}function W(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(" "));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(" "));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function D(e,t,r){if(e.length===0)return"";let n=e.map(o=>o.length);for(let o of t)for(let i=0;i<o.length;i++){let s=f(o[i],r.nullValue).length;s>n[i]&&(n[i]=s)}let a=[];a.push(`\u250C${n.map(o=>"\u2500".repeat(o+2)).join("\u252C")}\u2510`),a.push(`\u2502 ${e.map((o,i)=>o.padEnd(n[i])).join(" \u2502 ")} \u2502`),a.push(`\u251C${n.map(o=>"\u2500".repeat(o+2)).join("\u253C")}\u2524`);for(let o of t)a.push(`\u2502 ${o.map((i,s)=>f(i,r.nullValue).padEnd(n[s])).join(" \u2502 ")} \u2502`);return a.push(`\u2514${n.map(o=>"\u2500".repeat(o+2)).join("\u2534")}\u2518`),`${a.join(`
16
- `)}
17
- `}function H(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(a=>`'${a}'`).join(","));for(let a of t)n.push(a.map(o=>o==null?"NULL":typeof o=="number"?Number.isInteger(o)?String(o):B(o):`'${String(o)}'`).join(","));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function J(e,t,r){let n=[];r.header&&e.length>0&&(n.push(`<TR>${e.map(a=>`<TH>${V(a)}</TH>`).join("")}`),n.push("</TR>"));for(let a of t)n.push(`<TR>${a.map(o=>`<TD>${V(f(o,r.nullValue))}</TD>`).join("")}`),n.push("</TR>");return n.length>0?`${n.join(`
18
- `)}
19
- `:""}function V(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function _(e,t,r){let o=[];r.header&&e.length>0&&o.push(e.join(""));for(let i of t)o.push(i.map(s=>f(s,r.nullValue)).join(""));return o.length>0?o.join("")+"":""}var Z=5e3,v={name:"sqlite3",summary:"SQLite database CLI",usage:"sqlite3 [OPTIONS] DATABASE [SQL]",options:["-list output in list mode (default)","-csv output in CSV mode","-json output in JSON mode","-line output in line mode","-column output in column mode","-table output as ASCII table","-markdown output as markdown table","-tabs output in tab-separated mode","-box output in Unicode box mode","-quote output in SQL quote mode","-html output as HTML table","-ascii output in ASCII mode (control chars)","-header show column headers","-noheader hide column headers","-separator SEP field separator for list mode (default: |)","-newline SEP row separator (default: \\n)","-nullvalue TEXT text for NULL values (default: empty)","-readonly open database read-only (no writeback)","-bail stop on first error","-echo print SQL before execution","-cmd COMMAND run SQL command before main SQL","-version show SQLite version","-- end of options","--help show this help"],examples:['sqlite3 :memory: "CREATE TABLE t(x); INSERT INTO t VALUES(1); SELECT * FROM t"','sqlite3 -json data.db "SELECT * FROM users"','sqlite3 -csv -header data.db "SELECT id, name FROM products"','sqlite3 -box data.db "SELECT * FROM users"']};function ee(e){let t={mode:"list",header:!1,separator:"|",newline:`
20
- `,nullValue:"",readonly:!1,bail:!1,echo:!1,cmd:null},r=null,n=null,a=!1,o=!1;for(let i=0;i<e.length;i++){let s=e[i];if(o){r===null?r=s:n===null&&(n=s);continue}if(s==="--")o=!0;else if(s==="-version")a=!0;else if(s==="-list")t.mode="list";else if(s==="-csv")t.mode="csv";else if(s==="-json")t.mode="json";else if(s==="-line")t.mode="line";else if(s==="-column")t.mode="column";else if(s==="-table")t.mode="table";else if(s==="-markdown")t.mode="markdown";else if(s==="-tabs")t.mode="tabs";else if(s==="-box")t.mode="box";else if(s==="-quote")t.mode="quote";else if(s==="-html")t.mode="html";else if(s==="-ascii")t.mode="ascii";else if(s==="-header")t.header=!0;else if(s==="-noheader")t.header=!1;else if(s==="-readonly")t.readonly=!0;else if(s==="-bail")t.bail=!0;else if(s==="-echo")t.echo=!0;else if(s==="-separator"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -separator
21
- `,exitCode:1};t.separator=e[++i]}else if(s==="-newline"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -newline
22
- `,exitCode:1};t.newline=e[++i]}else if(s==="-nullvalue"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -nullvalue
23
- `,exitCode:1};t.nullValue=e[++i]}else if(s==="-cmd"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -cmd
24
- `,exitCode:1};t.cmd=e[++i]}else{if(s.startsWith("-"))return{stdout:"",stderr:`sqlite3: Error: unknown option: ${s.startsWith("--")?s.slice(1):s}
25
- Use -help for a list of options.
26
- `,exitCode:1};r===null?r=s:n===null&&(n=s)}}return{options:t,database:r,sql:n,showVersion:a}}async function re(){let e=await j.runTrustedAsync(()=>K()),t=new e.Database;try{let r=t.exec("SELECT sqlite_version()");return r.length>0&&r[0].values.length>0?String(r[0].values[0][0]):"unknown"}finally{t.close()}}function te(){let e=X(Y(import.meta.url)),t=x(e,"../../commands/sqlite3/worker.js");if(T(t))return t;let r=x(e,"worker.js");if(T(r))return r;let n=x(e,"../../../dist/commands/sqlite3/worker.js");if(T(n))return n;throw new Error("sqlite3 worker not found. Run 'pnpm build' to compile the worker.")}var ne={createWorker(e,t){return new G(e,{workerData:t})}};function oe(){return z(16).toString("hex")}function se(e,t){if(!e||typeof e!="object")return{success:!1,error:"Malformed worker response"};let r=e;return typeof r.protocolToken!="string"||r.protocolToken!==t?{success:!1,error:"Malformed worker response: invalid protocol token"}:r.type==="security-violation"?{success:!1,error:`Security violation: ${typeof r.violation?.type=="string"?r.violation.type:"unknown"}`}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?Array.isArray(r.results)?typeof r.hasModifications!="boolean"?{success:!1,error:"Malformed worker response: missing hasModifications flag"}:r.dbBuffer!==null&&r.dbBuffer!==void 0&&!(r.dbBuffer instanceof Uint8Array)?{success:!1,error:"Malformed worker response: invalid dbBuffer"}:{success:!0,results:r.results,hasModifications:r.hasModifications,dbBuffer:r.dbBuffer===void 0?null:r.dbBuffer,defenseStats:r.defenseStats}:{success:!1,error:"Malformed worker response: missing results array"}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}async function ie(e,t,r){try{let n=te();return await new Promise((a,o)=>{let i=j.runTrusted(()=>ne.createWorker(n,e)),s=b(r,"sqlite3","worker timeout callback",()=>{i.terminate(),a({success:!1,error:`Query timeout: execution exceeded ${t}ms limit`})}),c=q(()=>{try{s()}catch(u){let l=u instanceof Error?u.message:String(u);a({success:!1,error:g(l)})}},t),S=b(r,"sqlite3","worker message callback",u=>{w(c),a(se(u,e.protocolToken))}),$=b(r,"sqlite3","worker error callback",u=>{w(c),o(u)}),y=b(r,"sqlite3","worker exit callback",u=>{w(c),u!==0&&a({success:!1,error:`Worker exited with code ${u}`})}),p=u=>{try{S(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);a({success:!1,error:g(d)})}},k=u=>{try{$(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);o(new Error(g(d)))}},h=u=>{try{y(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);a({success:!1,error:g(d)})}};i.on("message",p),i.on("error",k),i.on("exit",h)})}catch(n){let a=g(n.message);throw new Error(`sqlite3 worker failed to load: ${a}`)}}var $e={name:"sqlite3",async execute(e,t){if(M(e)||e.includes("-help"))return C(v);let r=ee(e);if("exitCode"in r)return r;let{options:n,database:a,sql:o,showVersion:i}=r;if(i)return{stdout:`${await re()}
27
- `,stderr:"",exitCode:0};if(!a)return{stdout:"",stderr:`sqlite3: missing database argument
28
- `,exitCode:1};let s=o||t.stdin.trim();if(n.cmd&&(s=n.cmd+(s?`; ${s}`:"")),!s)return{stdout:"",stderr:`sqlite3: no SQL provided
29
- `,exitCode:1};let m=a===":memory:",c="",S=null;try{m||(c=t.fs.resolvePath(t.cwd,a),await t.fs.exists(c)&&(S=await t.fs.readFileBuffer(c)))}catch(l){let d=E(l.message);return{stdout:"",stderr:`sqlite3: unable to open database "${a}": ${d}
30
- `,exitCode:1}}let $=t.limits?.maxSqliteTimeoutMs??Z,y={protocolToken:oe(),dbBuffer:S,sql:s,options:{bail:n.bail,echo:n.echo}},p;try{p=await ie(y,$,t.requireDefenseContext)}catch(l){return{stdout:"",stderr:`sqlite3: worker error: ${g(l.message)}
31
- `,exitCode:1}}if(!p.success)return{stdout:"",stderr:`sqlite3: ${g(p.error)}
32
- `,exitCode:1};let k={mode:n.mode,header:n.header,separator:n.separator,newline:n.newline,nullValue:n.nullValue},h="";n.echo&&(h+=`${s}
33
- `);let u=!1;for(let l of p.results)if(l.type==="error"){if(n.bail)return{stdout:h,stderr:`Error: ${l.error}
34
- `,exitCode:1};h+=`Error: ${l.error}
35
- `,u=!0}else l.columns&&l.rows&&(l.rows.length>0||n.header)&&(h+=A(l.columns,l.rows,k));if(p.hasModifications&&!n.readonly&&!m&&c&&p.dbBuffer)try{await t.fs.writeFile(c,p.dbBuffer)}catch(l){let d=E(l.message);return{stdout:h,stderr:`sqlite3: failed to write database: ${d}
36
- `,exitCode:1}}return{stdout:h,stderr:"",exitCode:u&&n.bail?1:0}}},ye={name:"sqlite3",flags:[],needsArgs:!0};export{ne as a,$e as b,ye as c};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as L}from"./chunk-4OALHZXB.js";import{a as A,b as v,c as b}from"./chunk-GTNBSMZR.js";var $={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"]},P={name:"xargs",async execute(l,r){if(v(l))return A($);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,`
3
- `).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 b("xargs",t);if(t.startsWith("-")&&t.length>1){for(let n of t.slice(1))if(!"0tr".includes(n))return b("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 i;if(h?i=r.stdin.split("\0").filter(e=>e.length>0):g!==null?i=r.stdin.replace(/\n$/,"").split(g).filter(t=>t.length>0):i=r.stdin.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),i.length===0)return y?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0};let d="",u="",f=0,w=e=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(e)?`"${e.replace(/([\\"`$])/g,"\\$1")}"`:e,C=async e=>{if(x){let n=e.map(w).join(" ");u+=`${n}
4
- `}return r.exec?r.exec(L([e[0]]),{cwd:r.cwd,signal:r.signal,args:e.slice(1)}):{stdout:`${e.map(w).join(" ")}
5
- `,stderr:"",exitCode:0}},I=async e=>{if(o!==null&&o>1)for(let t=0;t<e.length;t+=o){let n=e.slice(t,t+o),M=await Promise.all(n.map(C));for(let p of M)d+=p.stdout,u+=p.stderr,p.exitCode!==0&&(f=p.exitCode)}else for(let t of e){let n=await C(t);d+=n.stdout,u+=n.stderr,n.exitCode!==0&&(f=n.exitCode)}};if(m!==null){let e=i.map(t=>a.map(n=>n.replaceAll(m,t)));await I(e)}else if(c!==null){let e=[];for(let t=0;t<i.length;t+=c){let n=i.slice(t,t+c);e.push([...a,...n])}await I(e)}else{let e=[...a,...i],t=await C(e);d+=t.stdout,u+=t.stderr,f=t.exitCode}return{stdout:d,stderr:u,exitCode:f}}},H={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{P as a,H as b};
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as S,b as A}from"./chunk-IO2FYBEM.js";import{d as O}from"./chunk-V7ZOPVQS.js";import{a as M,b as R}from"./chunk-MO4RPBN2.js";import{a as D}from"./chunk-YU6OGPZR.js";import{a as L}from"./chunk-5WFYIUU2.js";import{k as C}from"./chunk-6KZRLMG3.js";import{a as N}from"./chunk-RLNOQILG.js";import{a as F,b as z,c as E}from"./chunk-GTNBSMZR.js";function V(t){let o=[],s=0,a=t.length;for(;s<a;){for(;s<a&&/\s/.test(t[s]);)s++;if(s>=a)break;let u=s,i=t[s];if(i==="{"||i==="["){let l=i,f=i==="{"?"}":"]",c=1,p=!1,g=!1;for(s++;s<a&&c>0;){let h=t[s];g?g=!1:h==="\\"?g=!0:h==='"'?p=!p:p||(h===l?c++:h===f&&c--),s++}if(c!==0)throw new Error(`Unexpected end of JSON input at position ${s} (unclosed ${l})`);o.push(O(JSON.parse(t.slice(u,s))))}else if(i==='"'){let l=!1;for(s++;s<a;){let f=t[s];if(l)l=!1;else if(f==="\\")l=!0;else if(f==='"'){s++;break}s++}o.push(O(JSON.parse(t.slice(u,s))))}else if(i==="-"||i>="0"&&i<="9"){for(;s<a&&/[\d.eE+-]/.test(t[s]);)s++;o.push(O(JSON.parse(t.slice(u,s))))}else if(t.slice(s,s+4)==="true")o.push(!0),s+=4;else if(t.slice(s,s+5)==="false")o.push(!1),s+=5;else if(t.slice(s,s+4)==="null")o.push(null),s+=4;else{let l=t.slice(s,s+10);throw new Error(`Invalid JSON at position ${u}: unexpected '${l.split(/\s/)[0]}'`)}}return o}var B={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE]",options:["-R, --raw-input read input as raw strings, not JSON","-r, --raw-output output strings without quotes","-c, --compact compact output (no pretty printing)","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --arg name value bind $name to string value"," --tab use tabs for indentation"," --help display this help and exit"]};function x(t,o,s,a,u,i=0){if(t===null||t===void 0)return"null";if(typeof t=="boolean")return String(t);if(typeof t=="number")return Number.isFinite(t)?String(t):"null";if(typeof t=="string")return s?t:JSON.stringify(t);let l=u?" ":" ";if(Array.isArray(t))return t.length===0?"[]":o?`[${t.map(c=>x(c,!0,!1,a,u)).join(",")}]`:`[
3
- ${t.map(c=>l.repeat(i+1)+x(c,!1,!1,a,u,i+1)).join(`,
4
- `)}
5
- ${l.repeat(i)}]`;if(typeof t=="object"){let f=Object.keys(t);return a&&(f=f.sort()),f.length===0?"{}":o?`{${f.map(p=>`${JSON.stringify(p)}:${x(t[p],!0,!1,a,u)}`).join(",")}}`:`{
6
- ${f.map(p=>{let g=x(t[p],!1,!1,a,u,i+1);return`${l.repeat(i+1)}${JSON.stringify(p)}: ${g}`}).join(`,
7
- `)}
8
- ${l.repeat(i)}}`}return String(t)}var K={name:"jq",async execute(t,o){M(o.requireDefenseContext,"jq","execution entry");let s=(n,e)=>R(o.requireDefenseContext,"jq",n,e);if(z(t))return F(B);let a=!1,u=!1,i=!1,l=!1,f=!1,c=!1,p=!1,g=!1,h=!1,J=new Map,I=".",k=!1,j=[];for(let n=0;n<t.length;n++){let e=t[n];if(e==="-R"||e==="--raw-input")u=!0;else if(e==="-r"||e==="--raw-output")a=!0;else if(e==="-c"||e==="--compact-output")i=!0;else if(e==="-e"||e==="--exit-status")l=!0;else if(e==="-s"||e==="--slurp")f=!0;else if(e==="-n"||e==="--null-input")c=!0;else if(e==="-j"||e==="--join-output")p=!0;else if(!(e==="-a"||e==="--ascii")){if(e==="-S"||e==="--sort-keys")g=!0;else if(!(e==="-C"||e==="--color")){if(!(e==="-M"||e==="--monochrome"))if(e==="--tab")h=!0;else if(e==="--arg"){let r=t[n+1],$=t[n+2];if(r===void 0||$===void 0)return{stdout:"",stderr:`jq: --arg requires two arguments
9
- `,exitCode:2};J.set(`$${r}`,$),n+=2}else if(e==="-")j.push("-");else{if(e.startsWith("--"))return E("jq",e);if(e.startsWith("-")){for(let r of e.slice(1))if(r==="R")u=!0;else if(r==="r")a=!0;else if(r==="c")i=!0;else if(r==="e")l=!0;else if(r==="s")f=!0;else if(r==="n")c=!0;else if(r==="j")p=!0;else if(r!=="a"){if(r==="S")g=!0;else if(r!=="C"){if(r!=="M")return E("jq",`-${r}`)}}}else k?j.push(e):(I=e,k=!0)}}}}let y=[];if(!c)if(j.length===0||j.length===1&&j[0]==="-")y.push({source:"stdin",content:o.stdin});else{let n=await s("file read",()=>L(o,j,{cmdName:"jq",stopOnError:!0}));if(n.exitCode!==0)return{stdout:"",stderr:n.stderr,exitCode:2};y=n.files.map(e=>({source:e.filename||"stdin",content:e.content}))}try{let n=A(I),e=[],r={limits:o.limits?{maxIterations:o.limits.maxJqIterations}:void 0,env:o.env,vars:J,coverage:o.coverage,requireDefenseContext:o.requireDefenseContext};if(c)e=S(null,n,r);else if(u&&f){let m=y.map(({content:d})=>d).join("");e=S(m,n,r)}else if(u)for(let{content:m}of y){let d=m.split(`
10
- `);d.length>0&&d.at(-1)===""&&d.pop();for(let w of d)e.push(...S(w,n,r))}else if(f){let m=[];for(let{content:d}of y){let w=d.trim();w&&m.push(...V(w))}e=S(m,n,r)}else for(let{content:m}of y){let d=m.trim();if(!d)continue;let w=V(d);for(let W of w)e.push(...S(W,n,r))}let $=e.map(m=>x(m,i,a,g,h)),H=p?"":`
11
- `,q=$.join(H),b=o.limits?.maxStringLength;if(b!==void 0&&b>0&&q.length>b)throw new C(`jq: output size limit exceeded (${b} bytes)`,"string_length");let P=l&&(e.length===0||e.every(m=>m==null||m===!1))?1:0;return{stdout:q?p?q:`${q}
12
- `:"",stderr:"",exitCode:P}}catch(n){if(n instanceof D)throw n;if(n instanceof C)return{stdout:"",stderr:`jq: ${N(n.message)}
13
- `,exitCode:C.EXIT_CODE};let e=N(n.message);return e.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${e}
14
- `,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${e}
15
- `,exitCode:5}}}},v={name:"jq",flags:[{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"text",needsArgs:!0};export{K as a,v as b};
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as p,b as h,c as w}from"./chunk-GTNBSMZR.js";var m={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};function g(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function y(s,r){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=r,l=[],e="",t=0,o=-1,f=0;for(let c=0;c<s.length;c++){let a=s[c],d=g(a,t,i);t+d>n&&e.length>0?u&&o>=0?(l.push(e.slice(0,o+1)),e=e.slice(o+1)+a,t=t-f-1+d,o=-1,f=0):(l.push(e),e=a,t=d,o=-1,f=0):(e+=a,t+=d,(a===" "||a===" ")&&(o=e.length-1,f=t-d))}return e.length>0&&l.push(e),l.join(`
3
- `)}function b(s,r){if(s==="")return"";let n=s.split(`
4
- `),u=s.endsWith(`
5
- `)&&n[n.length-1]==="";return u&&n.pop(),n.map(l=>y(l,r)).join(`
6
- `)+(u?`
7
- `:"")}var k={name:"fold",execute:async(s,r)=>{if(h(s))return p(m);let n={width:80,breakAtSpaces:!1,countBytes:!1},u=[],i=0;for(;i<s.length;){let e=s[i];if(e==="-w"&&i+1<s.length){let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
8
- `};n.width=t,i+=2}else if(e.startsWith("-w")&&e.length>2){let t=parseInt(e.slice(2),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${e.slice(2)}'
9
- `};n.width=t,i++}else if(e==="-s")n.breakAtSpaces=!0,i++;else if(e==="-b")n.countBytes=!0,i++;else if(e==="-bs"||e==="-sb")n.breakAtSpaces=!0,n.countBytes=!0,i++;else if(e.match(/^-[sb]+w\d+$/)){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=e.replace(/^-[sb]+w/,""),o=parseInt(t,10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${t}'
10
- `};n.width=o,i++}else if(e.match(/^-[sb]+w$/)&&i+1<s.length){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
11
- `};n.width=t,i+=2}else if(e==="--"){u.push(...s.slice(i+1));break}else if(e.startsWith("-")&&e!=="-"){let t=e.slice(1),o=!1;for(let f of t)if(f==="s")n.breakAtSpaces=!0;else if(f==="b")n.countBytes=!0;else{o=!0;break}if(o)return w("fold",e);i++}else u.push(e),i++}let l="";if(u.length===0){let e=r.stdin??"";l=b(e,n)}else for(let e of u){let t=r.fs.resolvePath(r.cwd,e),o=await r.fs.readFile(t);if(o===null)return{exitCode:1,stdout:l,stderr:`fold: ${e}: No such file or directory
12
- `};l+=b(o,n)}return{exitCode:0,stdout:l,stderr:""}}},x={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0};export{k as a,x as b};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- async function c(e,t){if(e.length>0&&e[0]!=="-"){let i=t.fs.resolvePath(t.cwd,e[0]);try{let s=(await t.fs.readFile(i)).split(`
3
- `);s[s.length-1]===""&&s.pop();let r=s.reverse();return{stdout:r.length>0?`${r.join(`
4
- `)}
5
- `:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${e[0]}: No such file or directory
6
- `,exitCode:1}}}let n=t.stdin.split(`
7
- `);n[n.length-1]===""&&n.pop();let o=n.reverse();return{stdout:o.length>0?`${o.join(`
8
- `)}
9
- `:"",stderr:"",exitCode:0}}var l={name:"tac",execute:c},a={name:"tac",flags:[],stdinType:"text",needsFiles:!0};export{l as a,a as b};
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as w}from"./chunk-5WFYIUU2.js";import{a as F,b as N,c as k}from"./chunk-GTNBSMZR.js";var A=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),P=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 O(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=A.get(s)??1;return l*i}function x(u){let r=u.trim().toLowerCase().slice(0,3);return P.get(r)??0}function D(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 M(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 L(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=M(l),s=M(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=x(l),n=x(s);return i-n}if(e.humanNumeric){let i=O(l),n=O(s);return i-n}if(e.versionSort)return D(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function I(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=L(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 B={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},V=m.reverse??i,S=L(h,p,B);if(S!==0)return V?-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 q={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]]
3
- F is a field number (1-indexed)
4
- C is a character position within the field (1-indexed)
5
- OPTS can be: b d f h M n r V (per-key modifiers)
6
-
7
- Examples:
8
- -k1 sort by first field
9
- -k2,2 sort by second field only
10
- -k1.3 sort by first field starting at 3rd character
11
- -k1,2n sort by fields 1-2 numerically
12
- -k2 -k1 sort by field 2, then by field 1`},j={name:"sort",async execute(u,r){if(N(u))return F(q);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 w(r,l,{cmdName:"sort"});if(!s.ok)return s.error;let n=s.content.split(`
13
- `);n.length>0&&n[n.length-1]===""&&n.pop();let d=I(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]}
14
- `,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}n.sort(d),e.unique&&(n=E(n,e));let o=n.length>0?`${n.join(`
15
- `)}
16
- `:"";if(e.outputFile){let c=r.fs.resolvePath(r.cwd,e.outputFile);return await r.fs.writeFile(c,o,"binary"),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},U={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{j as a,U as b};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- async function x(a,u){let o="octal",n=[],i=[];for(let t=0;t<a.length;t++){let e=a[t];if(e==="-c")n.push("char");else if(e==="-An"||e==="-A"&&a[t+1]==="n")o="none",e==="-A"&&t++;else if(e==="-t"&&a[t+1]){let r=a[++t];r==="x1"?n.push("hex"):r==="c"?n.push("char"):r.startsWith("o")&&n.push("octal")}else(!e.startsWith("-")||e==="-")&&i.push(e)}n.length===0&&n.push("octal");let c=u.stdin;if(i.length>0&&i[0]!=="-"){let t=i[0].startsWith("/")?i[0]:`${u.cwd}/${i[0]}`;try{c=await u.fs.readFile(t)}catch{return{stdout:"",stderr:`od: ${i[0]}: No such file or directory
3
- `,exitCode:1}}}let d=n.includes("char");function m(t){return t===0?" \\0":t===7?" \\a":t===8?" \\b":t===9?" \\t":t===10?" \\n":t===11?" \\v":t===12?" \\f":t===13?" \\r":t>=32&&t<127?` ${String.fromCharCode(t)}`:` ${t.toString(8).padStart(3,"0")}`}function y(t){return d?` ${t.toString(16).padStart(2,"0")}`:` ${t.toString(16).padStart(2,"0")}`}function S(t){return` ${t.toString(8).padStart(3,"0")}`}let s=[];for(let t of c)s.push(t.charCodeAt(0));let p=16,f=[];for(let t=0;t<s.length;t+=p){let e=s.slice(t,t+p);for(let r=0;r<n.length;r++){let g=n[r],l;g==="char"?l=e.map(m):g==="hex"?l=e.map(y):l=e.map(S);let h="";r===0&&o!=="none"?h=`${t.toString(8).padStart(7,"0")} `:(r>0||o==="none")&&(h=o==="none"?"":" "),f.push(h+l.join(""))}}return o!=="none"&&s.length>0&&f.push(s.length.toString(8).padStart(7,"0")),{stdout:f.length>0?`${f.join(`
4
- `)}
5
- `:"",stderr:"",exitCode:0}}var $={name:"od",execute:x},v={name:"od",flags:[{flag:"-c",type:"boolean"},{flag:"-A",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-N",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{$ as a,v as b};
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import{c}from"./chunk-GTNBSMZR.js";function I(t,r){let i=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];r==="tail"&&a.startsWith("+")?(n=!0,i=parseInt(a.slice(1),10)):i=parseInt(a,10)}else if(r==="tail"&&e.startsWith("-n+"))n=!0,i=parseInt(e.slice(3),10);else if(e.startsWith("-n"))i=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="))i=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+$/))i=parseInt(e.slice(1),10);else{if(e.startsWith("--"))return{ok:!1,error:c(r,e)};if(e.startsWith("-")&&e!=="-")return{ok:!1,error:c(r,e)};u.push(e)}}return s!==null&&(Number.isNaN(s)||s<0)?{ok:!1,error:{stdout:"",stderr:`${r}: invalid number of bytes
3
- `,exitCode:1}}:Number.isNaN(i)||i<0?{ok:!1,error:{stdout:"",stderr:`${r}: invalid number of lines
4
- `,exitCode:1}}:{ok:!0,options:{lines:i,bytes:s,quiet:o,verbose:l,files:u,fromLine:n}}}async function W(t,r,i,s){let{quiet:o,verbose:l,files:n}=r;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 d=0;d<n.length;d++){let p=n[d];try{let b=t.fs.resolvePath(t.cwd,p),x=await t.fs.readFile(b);a&&(h>0&&(u+=`
5
- `),u+=`==> ${p} <==
6
- `),u+=s(x),h++}catch{f+=`${i}: ${p}: No such file or directory
7
- `,e=1}}return{stdout:u,stderr:f,exitCode:e}}function $(t,r,i){if(i!==null)return t.slice(0,i);if(r===0)return"";let s=0,o=0,l=t.length;for(;s<l&&o<r;){let n=t.indexOf(`
8
- `,s);if(n===-1)return`${t}
9
- `;o++,s=n+1}return s>0?t.slice(0,s):""}function g(t,r,i,s){if(i!==null)return t.slice(-i);let o=t.length;if(o===0)return"";if(s){let f=0,e=1;for(;f<o&&e<r;){let h=t.indexOf(`
10
- `,f);if(h===-1)break;e++,f=h+1}let a=t.slice(f);return a.endsWith(`
11
- `)?a:`${a}
12
- `}if(r===0)return"";let l=o-1;t[l]===`
13
- `&&l--;let n=0;for(;l>=0&&n<r;){if(t[l]===`
14
- `&&(n++,n===r)){l++;break}l--}l<0&&(l=0);let u=t.slice(l);return t[o-1]===`
15
- `?u:`${u}
16
- `}export{I as a,W as b,$ as c,g as d};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{c as u}from"./chunk-4PRVMER6.js";import{a as l,b as h}from"./chunk-GTNBSMZR.js";var d={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},y={name:"bash",async execute(t,e){if(h(t))return l(d);if(t[0]==="-c"&&t.length>=2){let i=t[1],s=t[2]||"bash",c=t.slice(3);return o(i,s,c,e)}if(t.length===0)return e.stdin?.trim()?o(e.stdin,"bash",[],e):{stdout:"",stderr:"",exitCode:0};let n=t[0],r=t.slice(1);try{let i=e.fs.resolvePath(e.cwd,n),s=await e.fs.readFile(i);return o(s,n,r,e)}catch{return{stdout:"",stderr:`bash: ${n}: No such file or directory
3
- `,exitCode:127}}}},C={name:"sh",async execute(t,e){if(h(t))return l({...d,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(t[0]==="-c"&&t.length>=2){let i=t[1],s=t[2]||"sh",c=t.slice(3);return o(i,s,c,e)}if(t.length===0)return e.stdin?.trim()?o(e.stdin,"sh",[],e):{stdout:"",stderr:"",exitCode:0};let n=t[0],r=t.slice(1);try{let i=e.fs.resolvePath(e.cwd,n),s=await e.fs.readFile(i);return o(s,n,r,e)}catch{return{stdout:"",stderr:`sh: ${n}: No such file or directory
4
- `,exitCode:127}}}};async function o(t,e,n,r){if(!r.exec)return{stdout:"",stderr:`bash: internal error: exec function not available
5
- `,exitCode:1};let i=u(r.exportedEnv||{},{0:e,"#":String(n.length),"@":n.join(" "),"*":n.join(" ")});n.forEach((a,m)=>{i[String(m+1)]=a});let s=t;if(s.startsWith("#!")){let a=s.indexOf(`
6
- `);a!==-1&&(s=s.slice(a+1))}return await r.exec(s,{env:i,cwd:r.cwd,stdin:r.stdin,signal:r.signal})}var b={name:"bash",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"},P={name:"sh",flags:[{flag:"-c",type:"value",valueHint:"string"}],stdinType:"text"};export{y as a,C as b,b as c,P as d};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- function c(t){if(!t||t==="/")return"/";let e=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;e.startsWith("/")||(e=`/${e}`);let n=e.split("/").filter(r=>r&&r!=="."),s=[];for(let r of n)r===".."?s.pop():s.push(r);return`/${s.join("/")}`||"/"}function h(t,e){if(t.includes("\0"))throw new Error(`ENOENT: path contains null byte, ${e} '${t}'`)}function p(t){let e=c(t);if(e==="/")return"/";let n=e.lastIndexOf("/");return n===0?"/":e.slice(0,n)}function y(t,e){if(e.startsWith("/"))return c(e);let n=t==="/"?`/${e}`:`${t}/${e}`;return c(n)}function m(t,e){return t==="/"?`/${e}`:`${t}/${e}`}function v(t,e){if(e.startsWith("/"))return c(e);let n=p(t);return c(m(n,e))}import*as i from"node:fs";import*as o from"node:path";function d(t,e){if(t===e)return!0;let n=t[e.length];return(n==="/"||n==="\\")&&t.startsWith(e)}function f(t,e){try{let n=i.realpathSync(t);return d(n,e)?n:null}catch(n){if(n.code==="ENOENT"){let s=o.dirname(t);if(s===t)return null;let r=f(s,e);if(r===null)return null;try{if(i.lstatSync(t).isSymbolicLink()){let l=i.readlinkSync(t),u=o.isAbsolute(l)?l:o.resolve(o.dirname(t),l);if(f(u,e)===null)return null}}catch{}return o.join(r,o.basename(t))}return null}}function P(t,e,n){let s=f(t,n);if(s===null)return null;let r=o.resolve(t),a=r.slice(e.length),l=s.slice(n.length);if(a!==l)return null;try{if(i.lstatSync(r).isSymbolicLink())return null}catch{}return s}function $(t,e){if(!i.existsSync(t))throw new Error(`${e} root does not exist`);if(!i.statSync(t).isDirectory())throw new Error(`${e} root is not a directory`)}function D(t,e){if(!o.isAbsolute(t))return{withinRoot:!0,relativePath:t};let n;try{n=i.realpathSync(t)}catch{n=o.resolve(t)}return d(n,e)?{withinRoot:!0,relativePath:n.slice(e.length).replace(/\\/g,"/")||"/"}:{withinRoot:!1,safeName:o.basename(t)}}function N(t,e,n,s){let r=t;if(r.path===void 0){for(let l of s)if(r.message?.includes(l))throw t}let a=r.code||"EIO";throw new Error(`${a}: ${n} '${e}'`)}export{c as a,h as b,p as c,y as d,m as e,v as f,d as g,f as h,P as i,$ as j,D as k,N as l};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as g}from"./chunk-JBABAK44.js";import{a as c,b as m}from"./chunk-GTNBSMZR.js";var I={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},F={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},P={name:"paste",async execute(s,i){if(m(s))return c(I);let n=g("paste",s,F);if(!n.ok)return n.error;let l=n.result.flags.delimiter,d=n.result.flags.serial,p=n.result.positional;if(p.length===0)return{stdout:"",stderr:`usage: paste [-s] [-d delimiters] file ...
3
- `,exitCode:1};let a=i.stdin?i.stdin.split(`
4
- `):[""];a.length>0&&a[a.length-1]===""&&a.pop();let x=p.filter(e=>e==="-").length,f=[],h=0;for(let e of p)if(e==="-"){let t=[];for(let o=h;o<a.length;o+=x)t.push(a[o]);f.push(t),h++}else{let t=i.fs.resolvePath(i.cwd,e);try{let r=(await i.fs.readFile(t)).split(`
5
- `);r.length>0&&r[r.length-1]===""&&r.pop(),f.push(r)}catch{return{stdout:"",stderr:`paste: ${e}: No such file or directory
6
- `,exitCode:1}}}let u="";if(d)for(let e of f)e&&(u+=`${y(e,l)}
7
- `);else{let e=Math.max(...f.map(t=>t?.length??0));for(let t=0;t<e;t++){let o=[];for(let r of f)o.push(r?.[t]??"");u+=`${y(o,l)}
8
- `}}return{stdout:u,stderr:"",exitCode:0}}};function y(s,i){if(s.length===0)return"";if(s.length===1)return s[0];let n=s[0];for(let l=1;l<s.length;l++){let d=(l-1)%i.length;n+=i[d]+s[l]}return n}var T={name:"paste",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0};export{P as a,T as b};
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as A}from"./chunk-JBABAK44.js";import{a as S,b as H}from"./chunk-GTNBSMZR.js";var b=class{diff(e,n,t={}){let i;typeof t=="function"?(i=t,t={}):"callback"in t&&(i=t.callback);let d=this.castInput(e,t),o=this.castInput(n,t),s=this.removeEmpty(this.tokenize(d,t)),a=this.removeEmpty(this.tokenize(o,t));return this.diffWithOptionsObj(s,a,t,i)}diffWithOptionsObj(e,n,t,i){var d;let o=l=>{if(l=this.postProcess(l,t),i){setTimeout(function(){i(l)},0);return}else return l},s=n.length,a=e.length,u=1,r=s+a;t.maxEditLength!=null&&(r=Math.min(r,t.maxEditLength));let g=(d=t.timeout)!==null&&d!==void 0?d:1/0,w=Date.now()+g,m=[{oldPos:-1,lastComponent:void 0}],C=this.extractCommon(m[0],n,e,0,t);if(m[0].oldPos+1>=a&&C+1>=s)return o(this.buildValues(m[0].lastComponent,n,e));let P=-1/0,x=1/0,L=()=>{for(let l=Math.max(P,-u);l<=Math.min(x,u);l+=2){let c,h=m[l-1],p=m[l+1];h&&(m[l-1]=void 0);let y=!1;if(p){let k=p.oldPos-l;y=p&&0<=k&&k<s}let v=h&&h.oldPos+1<a;if(!y&&!v){m[l]=void 0;continue}if(!v||y&&h.oldPos<p.oldPos?c=this.addToPath(p,!0,!1,0,t):c=this.addToPath(h,!1,!0,1,t),C=this.extractCommon(c,n,e,l,t),c.oldPos+1>=a&&C+1>=s)return o(this.buildValues(c.lastComponent,n,e))||!0;m[l]=c,c.oldPos+1>=a&&(x=Math.min(x,l-1)),C+1>=s&&(P=Math.max(P,l+1))}u++};if(i)(function l(){setTimeout(function(){if(u>r||Date.now()>w)return i(void 0);L()||l()},0)})();else for(;u<=r&&Date.now()<=w;){let l=L();if(l)return l}}addToPath(e,n,t,i,d){let o=e.lastComponent;return o&&!d.oneChangePerToken&&o.added===n&&o.removed===t?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:t,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:t,previousComponent:o}}}extractCommon(e,n,t,i,d){let o=n.length,s=t.length,a=e.oldPos,u=a-i,r=0;for(;u+1<o&&a+1<s&&this.equals(t[a+1],n[u+1],d);)u++,a++,r++,d.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return r&&!d.oneChangePerToken&&(e.lastComponent={count:r,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,u}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let i=[],d;for(;e;)i.push(e),d=e.previousComponent,delete e.previousComponent,e=d;i.reverse();let o=i.length,s=0,a=0,u=0;for(;s<o;s++){let r=i[s];if(r.removed)r.value=this.join(t.slice(u,u+r.count)),u+=r.count;else{if(!r.added&&this.useLongestToken){let g=n.slice(a,a+r.count);g=g.map(function(w,m){let C=t[u+m];return C.length>w.length?C:w}),r.value=this.join(g)}else r.value=this.join(n.slice(a,a+r.count));a+=r.count,r.added||(u+=r.count)}}return i}};var D=class extends b{constructor(){super(...arguments),this.tokenize=O}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
3
- `))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
4
- `))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
5
- `)&&(e=e.slice(0,-1)),n.endsWith(`
6
- `)&&(n=n.slice(0,-1))),super.equals(e,n,t)}},j=new D;function I(f,e,n){return j.diff(f,e,n)}function O(f,e){e.stripTrailingCr&&(f=f.replace(/\r\n/g,`
7
- `));let n=[],t=f.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let i=0;i<t.length;i++){let d=t[i];i%2&&!e.newlineIsToken?n[n.length-1]+=d:n.push(d)}return n}var N={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function F(f,e,n,t,i,d,o){let s;o?typeof o=="function"?s={callback:o}:s=o:s={},typeof s.context>"u"&&(s.context=4);let a=s.context;if(s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){let{callback:r}=s;I(n,t,Object.assign(Object.assign({},s),{callback:g=>{let w=u(g);r(w)}}))}else return u(I(n,t,s));function u(r){if(!r)return;r.push({value:"",lines:[]});function g(l){return l.map(function(c){return" "+c})}let w=[],m=0,C=0,P=[],x=1,L=1;for(let l=0;l<r.length;l++){let c=r[l],h=c.lines||W(c.value);if(c.lines=h,c.added||c.removed){if(!m){let p=r[l-1];m=x,C=L,p&&(P=a>0?g(p.lines.slice(-a)):[],m-=P.length,C-=P.length)}for(let p of h)P.push((c.added?"+":"-")+p);c.added?L+=h.length:x+=h.length}else{if(m)if(h.length<=a*2&&l<r.length-2)for(let p of g(h))P.push(p);else{let p=Math.min(h.length,a);for(let v of g(h.slice(0,p)))P.push(v);let y={oldStart:m,oldLines:x-m+p,newStart:C,newLines:L-C+p,lines:P};w.push(y),m=0,C=0,P=[]}x+=h.length,L+=h.length}}for(let l of w)for(let c=0;c<l.lines.length;c++)l.lines[c].endsWith(`
8
- `)?l.lines[c]=l.lines[c].slice(0,-1):(l.lines.splice(c+1,0,"\"),c++);return{oldFileName:f,newFileName:e,oldHeader:i,newHeader:d,hunks:w}}}function E(f,e){if(e||(e=N),Array.isArray(f)){if(f.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return f.map(t=>E(t,e)).join(`
9
- `)}let n=[];e.includeIndex&&f.oldFileName==f.newFileName&&n.push("Index: "+f.oldFileName),e.includeUnderline&&n.push("==================================================================="),e.includeFileHeaders&&(n.push("--- "+f.oldFileName+(typeof f.oldHeader>"u"?"":" "+f.oldHeader)),n.push("+++ "+f.newFileName+(typeof f.newHeader>"u"?"":" "+f.newHeader)));for(let t=0;t<f.hunks.length;t++){let i=f.hunks[t];i.oldLines===0&&(i.oldStart-=1),i.newLines===0&&(i.newStart-=1),n.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@");for(let d of i.lines)n.push(d)}return n.join(`
10
- `)+`
11
- `}function T(f,e,n,t,i,d,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:s}=o;F(f,e,n,t,i,d,Object.assign(Object.assign({},o),{callback:a=>{s(a?E(a,o.headerOptions):void 0)}}))}else{let s=F(f,e,n,t,i,d,o);return s?E(s,o?.headerOptions):void 0}}function W(f){let e=f.endsWith(`
12
- `),n=f.split(`
13
- `).map(t=>t+`
14
- `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}var M={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"]},z={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"}},Q={name:"diff",async execute(f,e){if(H(f))return S(M);let n=A("diff",f,z);if(!n.ok)return n.error;let t=n.result.flags.brief,i=n.result.flags.reportSame,d=n.result.flags.ignoreCase,o=n.result.positional;if(n.result.flags.unified,o.length<2)return{stdout:"",stderr:`diff: missing operand
15
- `,exitCode:2};let s,a,[u,r]=o;try{s=u==="-"?e.stdin:await e.fs.readFile(e.fs.resolvePath(e.cwd,u))}catch{return{stdout:"",stderr:`diff: ${u}: No such file or directory
16
- `,exitCode:2}}try{a=r==="-"?e.stdin:await e.fs.readFile(e.fs.resolvePath(e.cwd,r))}catch{return{stdout:"",stderr:`diff: ${r}: No such file or directory
17
- `,exitCode:2}}let g=s,w=a;return d&&(g=g.toLowerCase(),w=w.toLowerCase()),g===w?i?{stdout:`Files ${u} and ${r} are identical
18
- `,stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0}:t?{stdout:`Files ${u} and ${r} differ
19
- `,stderr:"",exitCode:1}:{stdout:T(u,r,s,a,"","",{context:3}),stderr:"",exitCode:1}}},Z={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{Q as a,Z as b};
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a,b as d,c as h}from"./chunk-GTNBSMZR.js";var k={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},p=1e5;function m(s){let l=s.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!l)return null;let e=Number.parseInt(l[1],10);if(Number.isNaN(e)||e<1)return null;let o=(l[2]||"").toUpperCase(),u=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(o);return u===void 0?null:e*u}function y(s,l,e){if(l)return s.toString().padStart(e,"0");let o="abcdefghijklmnopqrstuvwxyz",t="",u=s;for(let r=0;r<e;r++)t=o[u%26]+t,u=Math.floor(u/26);return t}function g(s,l){let e=s.split(`
3
- `),o=s.endsWith(`
4
- `)&&e[e.length-1]==="";o&&e.pop();let t=[];for(let u=0;u<e.length;u+=l){let r=e.slice(u,u+l),c=u+l>=e.length&&!o?r.join(`
5
- `):`${r.join(`
6
- `)}
7
- `;t.push({content:c,hasContent:!0})}return t}function C(s,l){let o=new TextEncoder().encode(s),t=new TextDecoder,u=[];for(let r=0;r<o.length;r+=l){let f=o.slice(r,r+l);u.push({content:t.decode(f),hasContent:f.length>0})}return u}function S(s,l){let o=new TextEncoder().encode(s),t=new TextDecoder,u=[],r=Math.ceil(o.length/l);for(let f=0;f<l;f++){let c=f*r,i=Math.min(c+r,o.length),n=o.slice(c,i);u.push({content:t.decode(n),hasContent:n.length>0})}return u}var I={name:"split",execute:async(s,l)=>{if(d(s))return a(k);let e={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},o=[],t=0;for(;t<s.length;){let i=s[t];if(i==="-l"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s[t+1]}'
8
- `};e.mode="lines",e.lines=n,t+=2}else if(i.match(/^-l\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${i.slice(2)}'
9
- `};e.mode="lines",e.lines=n,t++}else if(i==="-b"&&t+1<s.length){let n=m(s[t+1]);if(n===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s[t+1]}'
10
- `};e.mode="bytes",e.bytes=n,t+=2}else if(i.match(/^-b.+$/)){let n=m(i.slice(2));if(n===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${i.slice(2)}'
11
- `};e.mode="bytes",e.bytes=n,t++}else if(i==="-n"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${s[t+1]}'
12
- `};e.mode="chunks",e.chunks=n,t+=2}else if(i.match(/^-n\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid number of chunks: '${i.slice(2)}'
13
- `};e.mode="chunks",e.chunks=n,t++}else if(i==="-a"&&t+1<s.length){let n=Number.parseInt(s[t+1],10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${s[t+1]}'
14
- `};e.suffixLength=n,t+=2}else if(i.match(/^-a\d+$/)){let n=Number.parseInt(i.slice(2),10);if(Number.isNaN(n)||n<1)return{exitCode:1,stdout:"",stderr:`split: invalid suffix length: '${i.slice(2)}'
15
- `};e.suffixLength=n,t++}else if(i==="-d"||i==="--numeric-suffixes")e.useNumericSuffix=!0,t++;else if(i.startsWith("--additional-suffix="))e.additionalSuffix=i.slice(20),t++;else if(i==="--additional-suffix"&&t+1<s.length)e.additionalSuffix=s[t+1],t+=2;else if(i==="--"){o.push(...s.slice(t+1));break}else{if(i.startsWith("-")&&i!=="-")return h("split",i);o.push(i),t++}}let u="-",r="x";o.length>=1&&(u=o[0]),o.length>=2&&(r=o[1]);let f;if(u==="-")f=l.stdin??"";else{let i=l.fs.resolvePath(l.cwd,u),n=await l.fs.readFile(i);if(n===null)return{exitCode:1,stdout:"",stderr:`split: ${u}: No such file or directory
16
- `};f=n}if(f==="")return{exitCode:0,stdout:"",stderr:""};let c;switch(e.mode){case"lines":c=g(f,e.lines);break;case"bytes":c=C(f,e.bytes);break;case"chunks":c=S(f,e.chunks);break;default:return e.mode}if(c.length>p)return{exitCode:1,stdout:"",stderr:`split: too many output files (${c.length}), limit is ${p}
17
- `};for(let i=0;i<c.length;i++){let n=c[i];if(!n.hasContent)continue;let x=y(i,e.useNumericSuffix,e.suffixLength),b=`${r}${x}${e.additionalSuffix}`,N=l.fs.resolvePath(l.cwd,b);await l.fs.writeFile(N,n.content)}return{exitCode:0,stdout:"",stderr:""}}},$={name:"split",flags:[{flag:"-l",type:"value",valueHint:"number"},{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-d",type:"boolean"},{flag:"-a",type:"value",valueHint:"number"}],needsFiles:!0};export{I as a,$ as b};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as x}from"./chunk-JBABAK44.js";import{a as b,b as F}from"./chunk-GTNBSMZR.js";var v={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},H={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};function C(t,e,l){return e?l?t.split(e):t.split(e).filter(n=>n.length>0):l?t.split(/[ \t]/):t.split(/[ \t]+/).filter(n=>n.length>0)}function I(t){let e=[];for(let l of t)for(let n=0;n<l.length;n++){let o=l[n].length;(e[n]===void 0||o>e[n])&&(e[n]=o)}return e}function W(t,e){if(t.length===0)return"";let l=I(t),n=[];for(let o of t){let c=[];for(let s=0;s<o.length;s++)s===o.length-1?c.push(o[s]):c.push(o[s].padEnd(l[s]));n.push(c.join(e))}return n.join(`
3
- `)}function j(t,e,l){if(t.length===0)return"";let n=Math.max(...t.map(a=>a.length)),o=l.length,c=n+o,s=Math.max(1,Math.floor((e+o)/c)),p=Math.ceil(t.length/s),d=[];for(let a=0;a<p;a++){let i=[];for(let r=0;r<s;r++){let m=r*p+a;m<t.length&&(r===s-1||(r+1)*p+a>=t.length?i.push(t[m]):i.push(t[m].padEnd(n)))}d.push(i.join(l))}return d.join(`
4
- `)}var M={name:"column",execute:async(t,e)=>{if(F(t))return b(v);let l=x("column",t,H);if(!l.ok)return l.error;let{table:n,separator:o,outputSep:c,width:s,noMerge:p}=l.result.flags,d=l.result.positional,a=c??" ",i;if(d.length===0)i=e.stdin??"";else{let u=[];for(let f of d)if(f==="-")u.push(e.stdin??"");else{let w=e.fs.resolvePath(e.cwd,f),y=await e.fs.readFile(w);if(y===null)return{exitCode:1,stdout:"",stderr:`column: ${f}: No such file or directory
5
- `};u.push(y)}i=u.join("")}if(i===""||i.trim()==="")return{exitCode:0,stdout:"",stderr:""};let r=i.split(`
6
- `);i.endsWith(`
7
- `)&&r[r.length-1]===""&&r.pop();let g=r.filter(u=>u.trim().length>0),h;if(n){let u=g.map(f=>C(f,o,p));h=W(u,a)}else{let u=[];for(let f of g){let w=C(f,o,p);u.push(...w)}h=j(u,s,a)}return h.length>0&&(h+=`
8
- `),{exitCode:0,stdout:h,stderr:""}}},P={name:"column",flags:[{flag:"-t",type:"boolean"},{flag:"-s",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"string"},{flag:"-c",type:"value",valueHint:"number"},{flag:"-n",type:"boolean"}],stdinType:"text",needsFiles:!0};export{M as a,P as b};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as f}from"./chunk-5WFYIUU2.js";import{a as d}from"./chunk-JBABAK44.js";import{a as m,b as p}from"./chunk-GTNBSMZR.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"}},F={name:"cat",async execute(n,s){if(p(n))return m(b);let e=d("cat",n,g);if(!e.ok)return e.error;let r=e.result.flags.number,t=e.result.positional,a=await f(s,t,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),o="",l=1;for(let{content:i}of a.files)if(r){let c=y(i,l);o+=c.content,l=c.nextLineNumber}else o+=i;let u=t.length>0&&t.some(i=>i!=="-");return{stdout:o,stderr:a.stderr,exitCode:a.exitCode,...u?{stdoutEncoding:"binary"}:{}}}};function y(n,s){let e=n.split(`
3
- `),r=n.endsWith(`
4
- `),t=r?e.slice(0,-1):e;return{content:t.map((o,l)=>`${String(s+l).padStart(6," ")} ${o}`).join(`
5
- `)+(r?`
6
- `:""),nextLineNumber:s+t.length}}var w={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{F as a,w as b};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as m,b as y,c as k}from"./chunk-GTNBSMZR.js";var F=new Map([["sha1","SHA-1"],["sha256","SHA-256"]]);function L(n){function h(r,u){return r<<u|r>>>32-u}let g=new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]),A=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],b=n.length*8,o=(n.length%64<56?56:120)-n.length%64,s=new Uint8Array(n.length+o+8);s.set(n),s[n.length]=128;let d=new DataView(s.buffer);d.setUint32(s.length-8,b>>>0,!0),d.setUint32(s.length-4,Math.floor(b/4294967296),!0);let w=1732584193,l=4023233417,p=2562383102,e=271733878;for(let r=0;r<s.length;r+=64){let u=new Uint32Array(16);for(let t=0;t<16;t++)u[t]=d.getUint32(r+t*4,!0);let U=w,a=l,x=p,c=e;for(let t=0;t<64;t++){let i,$;t<16?(i=a&x|~a&c,$=t):t<32?(i=c&a|~c&x,$=(5*t+1)%16):t<48?(i=a^x^c,$=(3*t+5)%16):(i=x^(a|~c),$=7*t%16),i=i+U+g[t]+u[$]>>>0,U=c,c=x,x=a,a=a+h(i,A[t])>>>0}w=w+U>>>0,l=l+a>>>0,p=p+x>>>0,e=e+c>>>0}let f=new Uint8Array(16);return new DataView(f.buffer).setUint32(0,w,!0),new DataView(f.buffer).setUint32(4,l,!0),new DataView(f.buffer).setUint32(8,p,!0),new DataView(f.buffer).setUint32(12,e,!0),Array.from(f).map(r=>r.toString(16).padStart(2,"0")).join("")}async function C(n,h){if(n==="md5")return L(h);let g=F.get(n);if(!g)throw new Error(`Unknown algorithm: ${n}`);let A=await globalThis.crypto.subtle.digest(g,new Uint8Array(h).buffer);return Array.from(new Uint8Array(A)).map(b=>b.toString(16).padStart(2,"0")).join("")}function S(n,h,g){let A={name:n,summary:g,usage:`${n} [OPTION]... [FILE]...`,options:["-c, --check read checksums from FILEs and check them"," --help display this help and exit"]};return{name:n,async execute(b,o){if(y(b))return m(A);let s=!1,d=[];for(let e of b)if(e==="-c"||e==="--check")s=!0;else if(!(e==="-b"||e==="-t"||e==="--binary"||e==="--text")){if(e.startsWith("-")&&e!=="-")return k(n,e);d.push(e)}d.length===0&&d.push("-");let w=async e=>{if(e==="-")return Uint8Array.from(o.stdin,f=>f.charCodeAt(0));try{return await o.fs.readFileBuffer(o.fs.resolvePath(o.cwd,e))}catch{return null}};if(s){let e=0,f="";for(let r of d){let u=r==="-"?o.stdin:await o.fs.readFile(o.fs.resolvePath(o.cwd,r)).catch(()=>null);if(u===null)return{stdout:"",stderr:`${n}: ${r}: No such file or directory
3
- `,exitCode:1};for(let U of u.split(`
4
- `)){let a=U.match(/^([a-fA-F0-9]+)\s+[* ]?(.+)$/);if(!a)continue;let[,x,c]=a,t=await w(c);if(t===null){f+=`${c}: FAILED open or read
5
- `,e++;continue}let i=await C(h,t)===x.toLowerCase();f+=`${c}: ${i?"OK":"FAILED"}
6
- `,i||e++}}return e>0&&(f+=`${n}: WARNING: ${e} computed checksum${e>1?"s":""} did NOT match
7
- `),{stdout:f,stderr:"",exitCode:e>0?1:0}}let l="",p=0;for(let e of d){let f=await w(e);if(f===null){l+=`${n}: ${e}: No such file or directory
8
- `,p=1;continue}l+=`${await C(h,f)} ${e}
9
- `}return{stdout:l,stderr:"",exitCode:p}}}}export{S as a};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as x}from"./chunk-EONWONZV.js";import{a as q,b as Z}from"./chunk-TTNNO45C.js";import{a as _,b as X,c as G}from"./chunk-GTNBSMZR.js";var se={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"]},j={name:"grep",async execute(t,s){if(X(t))return _(se);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,v=!1,P=!1,B=!1,$=0,T=0,C=0,W=[],A=[],L=[],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=")){L.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")v=!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 G("grep",e);if(e.length===1)return G("grep",`-${e}`)}}else R===null?R=i:I.push(i)}if(R===null)return{stdout:"",stderr:`grep: missing pattern
3
- `,exitCode:2};let V=d?"fixed":w?"extended":h?"perl":"basic",O,Q;try{let r=Z(R,{mode:V,ignoreCase:l,wholeWord:u,lineRegexp:y});O=r.regex,Q=r.kResetGroup}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${R}
4
- `,exitCode:2}}if(I.length===0&&s.stdin!==void 0){let r=q(s.stdin,O,{invertMatch:c,showLineNumbers:f,countOnly:p,filename:"",onlyMatching:v,beforeContext:T,afterContext:C,maxCount:$,kResetGroup: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
5
- `,exitCode:2};let M="",z="",S=!1,D=!1,F=[];for(let r of I)if(r.includes("*")||r.includes("?")||r.includes("[")){let i=await ne(r,s);if(n)for(let b of i){let o=await H(b.path,s,W,A,L,b.isFile);F.push(...o)}else F.push(...i)}else if(n){let i=await H(r,s,W,A,L);F.push(...i)}else F.push({path:r});let Y=(F.length>1||n)&&!P,k=50;for(let r=0;r<F.length;r+=k){let i=F.slice(r,r+k),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),U=!1;if(o.isFile===void 0?U=(await s.fs.stat(N)).isDirectory:U=!o.isFile,U)return n?null:{error:`grep: ${g}: Is a directory
6
- `};let ee=await s.fs.readFile(N),te=q(ee,O,{invertMatch:c,showLineNumbers:f,countOnly:p,filename:Y?g:"",onlyMatching:v,beforeContext:T,afterContext:C,maxCount:$,kResetGroup:Q});return{file:g,result:te}}catch{return{error:`grep: ${g}: No such file or directory
7
- `}}}));for(let o of b){if(o===null)continue;if("error"in o&&o.error){z+=o.error,o.error.includes("Is a directory")||(D=!0);continue}if(!("file"in o)||!o.result)continue;let{file:g,result:e}=o;if(e.matched){if(S=!0,B)return{stdout:"",stderr:"",exitCode:0};m?M+=`${g}
8
- `:a||(M+=e.output)}else a?M+=`${g}
9
- `:p&&!m&&(M+=e.output)}}let E;return D?E=2:a?E=M.length>0?0:1:E=S?0:1,B?{stdout:"",stderr:"",exitCode:E}:{stdout:M,stderr:z,exitCode:E}}},J=256;async function K(t,s,l,f,c=0){if(c>=J)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 K(u,s,l,f,c+1);else if(s){let h=s.replace(/^\//,"");x(n,h,{stripQuotes:!0})&&f.push(u)}}}catch{}}async function ne(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 K(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>=J)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 v=t==="."?d.name:`${t}/${d.name}`,P=await H(v,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 v=t==="."?d:`${t}/${d}`,P=await H(v,s,l,f,c,void 0,m+1);n.push(...P)}}}catch{}return n}var ae={name:"fgrep",async execute(t,s){return j.execute(["-F",...t],s)}},fe={name:"egrep",async execute(t,s){return j.execute(["-E",...t],s)}},ue={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},ce={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},pe={name:"egrep",flags:[],stdinType:"text",needsArgs:!0};export{j as a,ae as b,fe as c,ue as d,ce as e,pe as f};
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as v}from"./chunk-4CFAYBLV.js";import{e as x}from"./chunk-KGOUQS5A.js";var w=x(v(),1);function j(){return Object.create(null)}function S(e,o,r){e[o]=r}function C(e){let o=j();for(let r of Object.keys(e)){let s=e[r];(typeof s=="string"||typeof s=="number"||typeof s=="boolean"||s===null)&&(o[r]=s)}return o}function b(e){let o=w.default.parse(e.trim(),{header:!0,dynamicTyping:!0,skipEmptyLines:!0}),r=o.data.map(s=>C(s));return{headers:o.meta.fields||[],data:r}}function R(e,o){return o.length===0?`${e.join(",")}
3
- `:`${w.default.unparse(o,{columns:e}).replace(/\r\n/g,`
4
- `)}
5
- `}async function g(e,o){let r=e.find(p=>!p.startsWith("-")),s;if(!r||r==="-")s=o.stdin;else try{let p=o.fs.resolvePath(o.cwd,r);s=await o.fs.readFile(p)}catch{return{headers:[],data:[],error:{stdout:"",stderr:`xan: ${r}: No such file or directory
6
- `,exitCode:1}}}let{headers:i,data:f}=b(s);return{headers:i,data:f}}async function W(e,o){let r=0,s=[],i=[];for(let t=0;t<e.length;t++){let n=e[t];(n==="-l"||n==="--limit")&&t+1<e.length?r=Number.parseInt(e[++t],10):(n==="-s"||n==="--select")&&t+1<e.length?s=e[++t].split(","):n.startsWith("-")||i.push(n)}let{headers:f,data:p,error:d}=await g(i,o);if(d)return d;let c=s.length>0?s.filter(t=>f.includes(t)):f,l=r>0?p.slice(0,r):p,h=Math.max(...c.map(t=>t.length)),a=[],$="\u2500".repeat(80);for(let t=0;t<l.length;t++){let n=l[t];a.push(`Row n\xB0${t}`),a.push($);for(let u of c){let m=n[u],y=m==null?"":String(m);a.push(`${u.padEnd(h)} ${y}`)}t<l.length-1&&a.push("")}return{stdout:`${a.join(`
7
- `)}
8
- `,stderr:"",exitCode:0}}async function k(e,o){let r=0,s=[];for(let t=0;t<e.length;t++){let n=e[t];n==="-n"&&t+1<e.length?r=Number.parseInt(e[++t],10):n.startsWith("-")||s.push(n)}let{headers:i,data:f,error:p}=await g(s,o);if(p)return p;let d=r>0?f.slice(0,r):f,c=i.map(t=>t.length);for(let t of d)for(let n=0;n<i.length;n++){let u=String(t[i[n]]??"");c[n]=Math.max(c[n],u.length)}let l=[],h="\u2500",a="\u2502";l.push(`\u250C${c.map(t=>h.repeat(t+2)).join("\u252C")}\u2510`);let $=i.map((t,n)=>` ${t.padEnd(c[n])} `).join(a);l.push(`${a}${$}${a}`),l.push(`\u251C${c.map(t=>h.repeat(t+2)).join("\u253C")}\u2524`);for(let t of d){let n=i.map((u,m)=>` ${String(t[u]??"").padEnd(c[m])} `).join(a);l.push(`${a}${n}${a}`)}return l.push(`\u2514${c.map(t=>h.repeat(t+2)).join("\u2534")}\u2518`),{stdout:`${l.join(`
9
- `)}
10
- `,stderr:"",exitCode:0}}export{j as a,S as b,C as c,b as d,R as e,g as f,W as g,k as h};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as d,b as f,c as u}from"./chunk-GTNBSMZR.js";var h={name:"expand",summary:"convert tabs to spaces",usage:"expand [OPTION]... [FILE]...",description:"Convert TABs in each FILE to spaces, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-i Only convert leading tabs on each line"],examples:["expand file.txt # Convert all tabs to 8 spaces","expand -t 4 file.txt # Use 4-space tabs","expand -t 4,8,12 file.txt # Custom tab stops"]};function p(n){let i=n.split(",").map(o=>o.trim()),t=[];for(let o of i){let e=parseInt(o,10);if(Number.isNaN(e)||e<1)return null;t.push(e)}for(let o=1;o<t.length;o++)if(t[o]<=t[o-1])return null;return t}function x(n,i){if(i.length===1){let t=i[0];return t-n%t}for(let t of i)if(t>n)return t-n;if(i.length>=2){let t=i[i.length-1]-i[i.length-2],o=i[i.length-1],e=Math.floor((n-o)/t)+1;return o+e*t-n}return 1}function g(n,i){let{tabStops:t,leadingOnly:o}=i,e="",l=0,s=!0;for(let a of n)if(a===" ")if(o&&!s)e+=a,l++;else{let r=x(l,t);e+=" ".repeat(r),l+=r}else a!==" "&&a!==" "&&(s=!1),e+=a,l++;return e}function c(n,i){if(n==="")return"";let t=n.split(`
3
- `),o=n.endsWith(`
4
- `)&&t[t.length-1]==="";return o&&t.pop(),t.map(l=>g(l,i)).join(`
5
- `)+(o?`
6
- `:"")}var m={name:"expand",execute:async(n,i)=>{if(f(n))return d(h);let t={tabStops:[8],leadingOnly:!1},o=[],e=0;for(;e<n.length;){let s=n[e];if(s==="-t"&&e+1<n.length){let a=p(n[e+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${n[e+1]}'
7
- `};t.tabStops=a,e+=2}else if(s.startsWith("-t")&&s.length>2){let a=p(s.slice(2));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${s.slice(2)}'
8
- `};t.tabStops=a,e++}else if(s==="--tabs"&&e+1<n.length){let a=p(n[e+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${n[e+1]}'
9
- `};t.tabStops=a,e+=2}else if(s.startsWith("--tabs=")){let a=p(s.slice(7));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${s.slice(7)}'
10
- `};t.tabStops=a,e++}else if(s==="-i"||s==="--initial")t.leadingOnly=!0,e++;else if(s==="--"){o.push(...n.slice(e+1));break}else{if(s.startsWith("-")&&s!=="-")return u("expand",s);o.push(s),e++}}let l="";if(o.length===0){let s=i.stdin??"";l=c(s,t)}else for(let s of o){let a=i.fs.resolvePath(i.cwd,s),r=await i.fs.readFile(a);if(r===null)return{exitCode:1,stdout:l,stderr:`expand: ${s}: No such file or directory
11
- `};l+=c(r,t)}return{exitCode:0,stdout:l,stderr:""}}},v={name:"expand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{m as a,v as b};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as d}from"./chunk-JBABAK44.js";import{a as p,b as l}from"./chunk-GTNBSMZR.js";var u={name:"tee",summary:"read from stdin and write to stdout and files",usage:"tee [OPTION]... [FILE]...",options:["-a, --append append to the given FILEs, do not overwrite"," --help display this help and exit"]},m={append:{short:"a",long:"append",type:"boolean"}},y={name:"tee",async execute(n,e){if(l(n))return p(u);let t=d("tee",n,m);if(!t.ok)return t.error;let{append:f}=t.result.flags,c=t.result.positional,o=e.stdin,r="",a=0;for(let i of c)try{let s=e.fs.resolvePath(e.cwd,i);f?await e.fs.appendFile(s,o):await e.fs.writeFile(s,o)}catch{r+=`tee: ${i}: No such file or directory
3
- `,a=1}return{stdout:o,stderr:r,exitCode:a}}},w={name:"tee",flags:[{flag:"-a",type:"boolean"}],stdinType:"text",needsArgs:!0};export{y as a,w as b};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as S}from"./chunk-5WFYIUU2.js";import{a as b}from"./chunk-JBABAK44.js";import{a as x,b as y}from"./chunk-GTNBSMZR.js";var $={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"]},H={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"}},E={name:"wc",async execute(a,c){if(y(a))return x($);let n=b("wc",a,H);if(!n.ok)return n.error;let{lines:o,words:e}=n.result.flags,s=n.result.flags.bytes||n.result.flags.chars,t=n.result.positional;!o&&!e&&!s&&(o=e=s=!0);let i=await S(c,t,{cmdName:"wc",stopOnError:!1});if(t.length===0){let r=C(i.files[0].content);return{stdout:`${w(r,o,e,s,"",0)}
3
- `,stderr:"",exitCode:0}}let h=[],p=0,d=0,u=0;for(let{filename:r,content:m}of i.files){let f=C(m);p+=f.lines,d+=f.words,u+=f.chars,h.push({filename:r,stats:f})}let F=t.length>1?p:Math.max(...h.map(r=>r.stats.lines)),M=t.length>1?d:Math.max(...h.map(r=>r.stats.words)),L=t.length>1?u:Math.max(...h.map(r=>r.stats.chars)),l=t.length>1?3:0;o&&(l=Math.max(l,String(F).length)),e&&(l=Math.max(l,String(M).length)),s&&(l=Math.max(l,String(L).length));let g="";for(let{filename:r,stats:m}of h)g+=`${w(m,o,e,s,r,l)}
4
- `;return t.length>1&&(g+=`${w({lines:p,words:d,chars:u},o,e,s,"total",l)}
5
- `),{stdout:g,stderr:i.stderr,exitCode:i.exitCode}}};function C(a){let c=a.length,n=0,o=0,e=!1;for(let s=0;s<c;s++){let t=a[s];t===`
6
- `?(n++,e&&(o++,e=!1)):t===" "||t===" "||t==="\r"?e&&(o++,e=!1):e=!0}return e&&o++,{lines:n,words:o,chars:c}}function w(a,c,n,o,e,s){let t=[];c&&t.push(String(a.lines).padStart(s)),n&&t.push(String(a.words).padStart(s)),o&&t.push(String(a.chars).padStart(s));let i=t.join(" ");return e&&(i+=` ${e}`),i}var I={name:"wc",flags:[{flag:"-l",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-m",type:"boolean"}],stdinType:"text",needsFiles:!0};export{E as a,I as b};
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as N}from"./chunk-JDNI5HBX.js";function B(n,t){return n.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,s)=>{if(i==="&")return t[0];if(s!==void 0)return t.groups?.[s]??"";let h=parseInt(i,10);return t[h]??""})}function D(n,t,e={}){let{invertMatch:i=!1,showLineNumbers:s=!1,countOnly:h=!1,countMatches:d=!1,filename:a="",onlyMatching:m=!1,beforeContext:I=0,afterContext:R=0,maxCount:S=0,contextSeparator:F="--",showColumn:O=!1,vimgrep:G=!1,showByteOffset:P=!1,replace:k=null,passthru:y=!1,multiline:j=!1,kResetGroup:A}=e;if(j)return Q(n,t,{invertMatch:i,showLineNumbers:s,countOnly:h,countMatches:d,filename:a,onlyMatching:m,beforeContext:I,afterContext:R,maxCount:S,contextSeparator:F,showColumn:O,showByteOffset:P,replace:k,kResetGroup:A});let x=n.split(`
3
- `),Z=x.length,v=Z>0&&x[Z-1]===""?Z-1:Z;if(h||d){let f=0,r=(d||m)&&!i;for(let l=0;l<v;l++)if(t.lastIndex=0,r)for(let u=t.exec(x[l]);u!==null;u=t.exec(x[l]))f++,u[0].length===0&&t.lastIndex++;else t.test(x[l])!==i&&f++;return{output:`${a?`${a}:${f}`:String(f)}
4
- `,matched:f>0,matchCount:f}}if(I===0&&R===0&&!y){let f=[],r=!1,o=0,l=0;for(let u=0;u<v&&!(S>0&&o>=S);u++){let L=x[u];if(t.lastIndex=0,t.test(L)!==i)if(r=!0,o++,m){t.lastIndex=0;for(let $=t.exec(L);$!==null;$=t.exec(L)){let b=A!==void 0?$[A]??"":$[0],T=k!==null?B(k,$):b,z=a?`${a}:`:"";P&&(z+=`${l+$.index}:`),s&&(z+=`${u+1}:`),O&&(z+=`${$.index+1}:`),f.push(z+T),$[0].length===0&&t.lastIndex++}}else if(G){t.lastIndex=0;for(let $=t.exec(L);$!==null;$=t.exec(L)){let b=a?`${a}:`:"";P&&(b+=`${l+$.index}:`),s&&(b+=`${u+1}:`),O&&(b+=`${$.index+1}:`),f.push(b+L),$[0].length===0&&t.lastIndex++}}else{t.lastIndex=0;let $=t.exec(L),b=$?$.index+1:1,T=L;k!==null&&(t.lastIndex=0,T=t.replace(L,(...M)=>{if(M[0].length===0)return"";let U=M,_=M[M.length-1];return typeof _=="object"&&_!==null?(U.groups=_,U.input=M[M.length-2],U.index=M[M.length-3]):(U.input=M[M.length-1],U.index=M[M.length-2]),B(k,U)}));let z=a?`${a}:`:"";P&&(z+=`${l+($?$.index:0)}:`),s&&(z+=`${u+1}:`),O&&(z+=`${b}:`),f.push(z+T)}l+=L.length+1}return{output:f.length>0?`${f.join(`
5
- `)}
6
- `:"",matched:r,matchCount:o}}if(y){let f=[],r=!1,o=0;for(let l=0;l<v;l++){let u=x[l];t.lastIndex=0;let E=t.test(u)!==i;E&&(r=!0,o++);let $=E?":":"-",b=a?`${a}${$}`:"";s&&(b+=`${l+1}${$}`),f.push(b+u)}return{output:f.length>0?`${f.join(`
7
- `)}
8
- `:"",matched:r,matchCount:o}}let g=[],w=0,p=new Set,C=-1,c=[];for(let f=0;f<v&&!(S>0&&w>=S);f++)t.lastIndex=0,t.test(x[f])!==i&&(c.push(f),w++);for(let f of c){let r=Math.max(0,f-I);C>=0&&r>C+1&&g.push(F);for(let l=r;l<f;l++)if(!p.has(l)){p.add(l),C=l;let u=x[l];s&&(u=`${l+1}-${u}`),a&&(u=`${a}-${u}`),g.push(u)}if(!p.has(f)){p.add(f),C=f;let l=x[f];if(m){t.lastIndex=0;for(let u=t.exec(l);u!==null;u=t.exec(l)){let L=A!==void 0?u[A]??"":u[0],E=k!==null?k:L,$=a?`${a}:`:"";s&&($+=`${f+1}:`),O&&($+=`${u.index+1}:`),g.push($+E),u[0].length===0&&t.lastIndex++}}else{let u=l;s&&(u=`${f+1}:${u}`),a&&(u=`${a}:${u}`),g.push(u)}}let o=Math.min(v-1,f+R);for(let l=f+1;l<=o;l++)if(!p.has(l)){p.add(l),C=l;let u=x[l];s&&(u=`${l+1}-${u}`),a&&(u=`${a}-${u}`),g.push(u)}}return{output:g.length>0?`${g.join(`
9
- `)}
10
- `:"",matched:w>0,matchCount:w}}function Q(n,t,e){let{invertMatch:i,showLineNumbers:s,countOnly:h,countMatches:d,filename:a,onlyMatching:m,beforeContext:I,afterContext:R,maxCount:S,contextSeparator:F,showColumn:O,showByteOffset:G,replace:P,kResetGroup:k}=e,y=n.split(`
11
- `),j=y.length,A=j>0&&y[j-1]===""?j-1:j,x=[0];for(let c=0;c<n.length;c++)n[c]===`
12
- `&&x.push(c+1);let Z=c=>{let f=0;for(let r=0;r<x.length&&!(x[r]>c);r++)f=r;return f},v=c=>{let f=Z(c);return c-x[f]+1},g=[];t.lastIndex=0;for(let c=t.exec(n);c!==null&&!(S>0&&g.length>=S);c=t.exec(n)){let f=Z(c.index),r=Z(c.index+Math.max(0,c[0].length-1)),o=k!==void 0?c[k]??"":c[0];g.push({startLine:f,endLine:r,byteOffset:c.index,column:v(c.index),matchText:o}),c[0].length===0&&t.lastIndex++}if(h||d){let c;if(d)c=i?0:g.length;else{let r=new Set;for(let o of g)for(let l=o.startLine;l<=o.endLine;l++)r.add(l);c=i?A-r.size:r.size}return{output:`${a?`${a}:${c}`:String(c)}
13
- `,matched:c>0,matchCount:c}}if(i){let c=new Set;for(let r of g)for(let o=r.startLine;o<=r.endLine;o++)c.add(o);let f=[];for(let r=0;r<A;r++)if(!c.has(r)){let o=y[r];s&&(o=`${r+1}:${o}`),a&&(o=`${a}:${o}`),f.push(o)}return{output:f.length>0?`${f.join(`
14
- `)}
15
- `:"",matched:f.length>0,matchCount:f.length}}if(g.length===0)return{output:"",matched:!1,matchCount:0};let w=new Set,p=-1,C=[];for(let c of g){let f=Math.max(0,c.startLine-I),r=Math.min(A-1,c.endLine+R);p>=0&&f>p+1&&C.push(F);for(let o=f;o<c.startLine;o++)if(!w.has(o)){w.add(o),p=o;let l=y[o];s&&(l=`${o+1}-${l}`),a&&(l=`${a}-${l}`),C.push(l)}if(m){let o=P!==null?P:c.matchText,l=a?`${a}:`:"";G&&(l+=`${c.byteOffset}:`),s&&(l+=`${c.startLine+1}:`),O&&(l+=`${c.column}:`),C.push(l+o);for(let u=c.startLine;u<=c.endLine;u++)w.add(u),p=u}else for(let o=c.startLine;o<=c.endLine&&o<A;o++)if(!w.has(o)){w.add(o),p=o;let l=y[o];P!==null&&o===c.startLine&&(t.lastIndex=0,l=t.replace(l,P));let u=a?`${a}:`:"";G&&o===c.startLine&&(u+=`${c.byteOffset}:`),s&&(u+=`${o+1}:`),O&&o===c.startLine&&(u+=`${c.column}:`),C.push(u+l)}for(let o=c.endLine+1;o<=r;o++)if(!w.has(o)){w.add(o),p=o;let l=y[o];s&&(l=`${o+1}-${l}`),a&&(l=`${a}-${l}`),C.push(l)}}return{output:C.length>0?`${C.join(`
16
- `)}
17
- `:"",matched:!0,matchCount:g.length}}var q=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]]);function K(n){let t="",e=0;for(;e<n.length;){if(n.slice(e,e+7)==="[[:<:]]"){t+="\\b",e+=7;continue}if(n.slice(e,e+7)==="[[:>:]]"){t+="\\b",e+=7;continue}if(n[e]==="["){let i="[";for(e++,e<n.length&&(n[e]==="^"||n[e]==="!")&&(i+="^",e++),e<n.length&&n[e]==="]"&&(i+="\\]",e++);e<n.length&&n[e]!=="]";){if(n[e]==="["&&e+1<n.length&&n[e+1]===":"){let s=n.indexOf(":]",e+2);if(s!==-1){let h=n.slice(e+2,s),d=q.get(h);if(d){i+=d,e=s+2;continue}}}if(n[e]==="\\"&&e+1<n.length){i+=n[e]+n[e+1],e+=2;continue}i+=n[e],e++}e<n.length&&n[e]==="]"&&(i+="]",e++),t+=i;continue}if(n[e]==="\\"&&e+1<n.length){t+=n[e]+n[e+1],e+=2;continue}t+=n[e],e++}return t}function W(n,t){let e,i;switch(t.mode){case"fixed":e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(e=K(n),e=e.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),t.mode==="perl"){e=X(e),e=H(e),e=J(e);let d=ne(e);e=d.pattern,i=d.kResetGroup}break}default:e=K(n),e=se(e);break}t.wholeWord&&(e=`\\b(?:${e})\\b`),t.lineRegexp&&(e=`^${e}$`);let s=/\\u\{[0-9A-Fa-f]+\}/.test(e),h="g"+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.multilineDotall?"s":"")+(s?"u":"");return{regex:N(e,h),kResetGroup:i}}function X(n){let t="",e=0;for(;e<n.length;)if(n[e]==="\\"&&e+1<n.length&&n[e+1]==="Q"){e+=2;let i="";for(;e<n.length;){if(n[e]==="\\"&&e+1<n.length&&n[e+1]==="E"){e+=2;break}i+=n[e],e++}t+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else t+=n[e],e++;return t}function H(n){return n.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function J(n){let t="",e=0;for(;e<n.length;){if(n[e]==="("&&e+1<n.length&&n[e+1]==="?"){let i=n.slice(e).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(i){let s=i[1]||"",h=i[2]||"",d=i[3];if(d===":"){let a=e+i[0].length-1,m=V(n,e);if(m!==-1){let I=n.slice(a+1,m),R=Y(I,s,h);t+=`(?:${R})`,e=m+1;continue}}else if(d===")"||d===""){e+=i[0].length;continue}}}t+=n[e],e++}return t}function V(n,t){let e=0,i=t;for(;i<n.length;){if(n[i]==="\\"){i+=2;continue}if(n[i]==="["){for(i++;i<n.length&&n[i]!=="]";)n[i]==="\\"&&i++,i++;i++;continue}if(n[i]==="(")e++;else if(n[i]===")"&&(e--,e===0))return i;i++}return-1}function Y(n,t,e){let i=n;return t.includes("i")&&(i=ee(i)),i}function ee(n){let t="",e=0;for(;e<n.length;){let i=n[e];if(i==="\\"){e+1<n.length?(t+=i+n[e+1],e+=2):(t+=i,e++);continue}if(i==="["){t+=i,e++,e<n.length&&n[e]==="^"&&(t+=n[e],e++);let s=[];for(;e<n.length&&n[e]!=="]";)if(n[e]==="\\")s.push(n[e]),e++,e<n.length&&(s.push(n[e]),e++);else if(n[e]==="-"&&s.length>0&&e+1<n.length&&n[e+1]!=="]"){let h=s[s.length-1],d=n[e+1];s.push("-"),s.push(d),/[a-z]/.test(h)&&/[a-z]/.test(d)?(s.push(h.toUpperCase()),s.push("-"),s.push(d.toUpperCase())):/[A-Z]/.test(h)&&/[A-Z]/.test(d)&&(s.push(h.toLowerCase()),s.push("-"),s.push(d.toLowerCase())),e+=2}else{let h=n[e];if(s.push(h),/[a-zA-Z]/.test(h)){let d=h===h.toLowerCase()?h.toUpperCase():h.toLowerCase();s.includes(d)||s.push(d)}e++}t+=s.join(""),e<n.length&&(t+=n[e],e++);continue}if(/[a-zA-Z]/.test(i)){let s=i.toLowerCase(),h=i.toUpperCase();t+=`[${h}${s}]`}else t+=i;e++}return t}function ne(n){let t=te(n);if(t===-1)return{pattern:n};let e=n.slice(0,t),i=n.slice(t+2),s=ie(e);return{pattern:`(?:${e})(${i})`,kResetGroup:s+1}}function te(n){let t=0;for(;t<n.length-1;)if(n[t]==="\\"){if(n[t+1]==="K"){let e=0,i=t-1;for(;i>=0&&n[i]==="\\";)e++,i--;if(e%2===0)return t}t+=2}else t++;return-1}function ie(n){let t=0,e=0;for(;e<n.length;){if(n[e]==="\\"){e+=2;continue}if(n[e]==="["){for(e++;e<n.length&&n[e]!=="]";)n[e]==="\\"&&e++,e++;e++;continue}if(n[e]==="(")if(e+1<n.length&&n[e+1]==="?"){if(e+2<n.length){let i=n[e+2];if(i===":"||i==="="||i==="!"){e++;continue}if(i==="<"&&e+3<n.length){let s=n[e+3];if(s==="="||s==="!"){e++;continue}t++,e++;continue}}}else t++;e++}return t}function le(n){let t=n.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return t=t.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),t=t.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),t}function se(n){let t="",e=0,i=!0,s=0;for(;e<n.length;){let h=n[e];if(h==="["){for(t+=h,e++,e<n.length&&(n[e]==="^"||n[e]==="!")&&(t+=n[e],e++),e<n.length&&n[e]==="]"&&(t+=n[e],e++);e<n.length&&n[e]!=="]";)n[e]==="\\"&&e+1<n.length?(t+=n[e]+n[e+1],e+=2):(t+=n[e],e++);e<n.length&&n[e]==="]"&&(t+=n[e],e++),i=!1;continue}if(h==="\\"&&e+1<n.length){let d=n[e+1];if(d==="|"){t+="|",e+=2,i=!0;continue}if(d==="("){t+="(",e+=2,s++,i=!0;continue}if(d===")"){t+=")",e+=2,s=Math.max(0,s-1),i=!1;continue}if(d==="{"){let m=n.slice(e).match(/^\\{(\d+)(,(\d*)?)?\\}/);if(m){let I=m[1],R=m[2]!==void 0,S=m[3]||"";R?t+=`{${I},${S}}`:t+=`{${I}}`,e+=m[0].length,i=!1;continue}t+="\\{",e+=2,i=!1;continue}if(d==="}"){t+="\\}",e+=2,i=!1;continue}t+=h+d,e+=2,i=!1;continue}if(h==="*"&&i){t+="\\*",e++;continue}if(h==="^"){if(i){t+="^",e++;continue}t+="\\^",e++;continue}if(h==="$"){let d=e===n.length-1,a=e+2<n.length&&n[e+1]==="\\"&&n[e+2]===")";d||a?t+="$":t+="\\$",e++,i=!1;continue}h==="+"||h==="?"||h==="|"||h==="("||h===")"||h==="{"||h==="}"?t+=`\\${h}`:t+=h,e++,i=!1}return t}export{D as a,W as b,le as c};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as x}from"./chunk-5WFYIUU2.js";import{a as y,b as I,c as g}from"./chunk-GTNBSMZR.js";var w={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 F(t){let c=[],l=t.split(",");for(let n of l)if(n.includes("-")){let[s,r]=n.split("-");c.push({start:s?parseInt(s,10):1,end:r?parseInt(r,10):null})}else{let s=parseInt(n,10);c.push({start:s,end:s})}return c}function L(t,c){let l=[];for(let n of c){let s=n.start-1,r=n.end===null?t.length:n.end;for(let o=s;o<r&&o<t.length;o++)o>=0&&!l.includes(t[o])&&l.push(t[o])}return l}var k={name:"cut",async execute(t,c){if(I(t))return y(w);let l=" ",n=null,s=null,r=!1,o=[];for(let i=0;i<t.length;i++){let e=t[i];if(e==="-d")l=t[++i]||" ";else if(e.startsWith("-d"))l=e.slice(2);else if(e==="-f")n=t[++i];else if(e.startsWith("-f"))n=e.slice(2);else if(e==="-c")s=t[++i];else if(e.startsWith("-c"))s=e.slice(2);else if(e==="-s"||e==="--only-delimited")r=!0;else{if(e.startsWith("--"))return g("cut",e);if(e.startsWith("-")){let a=!1;for(let f of e.slice(1))if(f==="s")r=!0;else if(!"dfc".includes(f)){a=!0;break}if(a)return g("cut",e)}else o.push(e)}}if(!n&&!s)return{stdout:"",stderr:`cut: you must specify a list of bytes, characters, or fields
3
- `,exitCode:1};let p=await x(c,o,{cmdName:"cut"});if(!p.ok)return p.error;let u=p.content.split(`
4
- `);u.length>0&&u[u.length-1]===""&&u.pop();let m=F(n||s||"1"),h="";for(let i of u)if(s){let e=i.split(""),a=[];for(let f of m){let v=f.start-1,H=f.end===null?e.length:f.end;for(let d=v;d<H&&d<e.length;d++)d>=0&&a.push(e[d])}h+=`${a.join("")}
5
- `}else{if(r&&!i.includes(l))continue;let e=i.split(l),a=L(e,m);h+=`${a.join(l)}
6
- `}return{stdout:h,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},C={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{k as a,C as b};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as F}from"./chunk-4OALHZXB.js";import{b as A}from"./chunk-NTW6IA45.js";import{a as w,b as n}from"./chunk-LIYVQA3X.js";import{a as T,b as g}from"./chunk-OOJCYVYF.js";import{a as m}from"./chunk-RLNOQILG.js";var h={NOOP:0,READ_FILE:1,WRITE_FILE:2,STAT:3,READDIR:4,MKDIR:5,RM:6,EXISTS:7,APPEND_FILE:8,SYMLINK:9,READLINK:10,LSTAT:11,CHMOD:12,REALPATH:13,RENAME:14,COPY_FILE:15,WRITE_STDOUT:100,WRITE_STDERR:101,EXIT:102,HTTP_REQUEST:200,EXEC_COMMAND:300},a={PENDING:0,READY:1,SUCCESS:2,ERROR:3},u={NONE:0,NOT_FOUND:1,IS_DIRECTORY:2,NOT_DIRECTORY:3,EXISTS:4,PERMISSION_DENIED:5,INVALID_PATH:6,IO_ERROR:7,TIMEOUT:8,NETWORK_ERROR:9,NETWORK_NOT_CONFIGURED:10},s={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},E={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:1048576,TOTAL:1052704},S={NONE:0,RECURSIVE:1,FORCE:2,MKDIR_RECURSIVE:1},l={IS_FILE:0,IS_DIRECTORY:1,IS_SYMLINK:2,MODE:4,SIZE:8,MTIME:16,TOTAL:24};function f(){return new w(E.TOTAL)}var R=class{int32View;uint8View;dataView;constructor(t){this.int32View=new Int32Array(t),this.uint8View=new Uint8Array(t),this.dataView=new DataView(t)}getOpCode(){return n.load(this.int32View,s.OP_CODE/4)}setOpCode(t){n.store(this.int32View,s.OP_CODE/4,t)}getStatus(){return n.load(this.int32View,s.STATUS/4)}setStatus(t){n.store(this.int32View,s.STATUS/4,t)}getPathLength(){return n.load(this.int32View,s.PATH_LENGTH/4)}setPathLength(t){n.store(this.int32View,s.PATH_LENGTH/4,t)}getDataLength(){return n.load(this.int32View,s.DATA_LENGTH/4)}setDataLength(t){n.store(this.int32View,s.DATA_LENGTH/4,t)}getResultLength(){return n.load(this.int32View,s.RESULT_LENGTH/4)}setResultLength(t){n.store(this.int32View,s.RESULT_LENGTH/4,t)}getErrorCode(){return n.load(this.int32View,s.ERROR_CODE/4)}setErrorCode(t){n.store(this.int32View,s.ERROR_CODE/4,t)}getFlags(){return n.load(this.int32View,s.FLAGS/4)}setFlags(t){n.store(this.int32View,s.FLAGS/4,t)}getMode(){return n.load(this.int32View,s.MODE/4)}setMode(t){n.store(this.int32View,s.MODE/4,t)}getPath(){let t=this.getPathLength(),e=this.uint8View.slice(s.PATH_BUFFER,s.PATH_BUFFER+t);return new TextDecoder().decode(e)}setPath(t){let e=new TextEncoder().encode(t);if(e.length>E.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${E.PATH_BUFFER}`);this.uint8View.set(e,s.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(s.DATA_BUFFER,s.DATA_BUFFER+t)}setData(t){if(t.length>E.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${E.DATA_BUFFER}`);this.uint8View.set(t,s.DATA_BUFFER),this.setDataLength(t.length)}getDataAsString(){let t=this.getData();return new TextDecoder().decode(t)}setDataFromString(t){let e=new TextEncoder().encode(t);this.setData(e)}getResult(){let t=this.getResultLength();return this.uint8View.slice(s.DATA_BUFFER,s.DATA_BUFFER+t)}setResult(t){if(t.length>E.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${E.DATA_BUFFER}`);this.uint8View.set(t,s.DATA_BUFFER),this.setResultLength(t.length)}getResultAsString(){let t=this.getResult();return new TextDecoder().decode(t)}setResultFromString(t){let e=new TextEncoder().encode(t);this.setResult(e)}encodeStat(t){this.uint8View[s.DATA_BUFFER+l.IS_FILE]=t.isFile?1:0,this.uint8View[s.DATA_BUFFER+l.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[s.DATA_BUFFER+l.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(s.DATA_BUFFER+l.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(s.DATA_BUFFER+l.SIZE,e,!0),this.dataView.setFloat64(s.DATA_BUFFER+l.MTIME,t.mtime.getTime(),!0),this.setResultLength(l.TOTAL)}decodeStat(){return{isFile:this.uint8View[s.DATA_BUFFER+l.IS_FILE]===1,isDirectory:this.uint8View[s.DATA_BUFFER+l.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[s.DATA_BUFFER+l.IS_SYMLINK]===1,mode:this.dataView.getInt32(s.DATA_BUFFER+l.MODE,!0),size:this.dataView.getFloat64(s.DATA_BUFFER+l.SIZE,!0),mtime:new Date(this.dataView.getFloat64(s.DATA_BUFFER+l.MTIME,!0))}}waitForReady(t){return n.wait(this.int32View,s.STATUS/4,a.PENDING,t)}waitForReadyAsync(t){return n.waitAsync(this.int32View,s.STATUS/4,a.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let r=this.getStatus();if(r===a.READY)return!0;let o=Date.now()-e;if(o>=t)return!1;let i=t-o,c=n.waitAsync(this.int32View,s.STATUS/4,r,i);if(c.async&&await c.value==="timed-out")return!1}}waitForResult(t){return n.wait(this.int32View,s.STATUS/4,a.READY,t)}notify(){return n.notify(this.int32View,s.STATUS/4)}reset(){this.setOpCode(h.NOOP),this.setStatus(a.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(u.NONE),this.setFlags(S.NONE),this.setMode(0)}};var O=class{fs;cwd;commandName;secureFetch;maxOutputSize;exec;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;startTime=0;timeoutMs=0;constructor(t,e,r,o,i=void 0,c=0,d=void 0){this.fs=e,this.cwd=r,this.commandName=o,this.secureFetch=i,this.maxOutputSize=c,this.exec=d,this.protocol=new R(t)}remainingMs(){return Math.max(0,this.timeoutMs-(Date.now()-this.startTime))}raceDeadline(t){let e=this.remainingMs();if(e<=0)return this.running=!1,this.output.exitCode=124,this.output.stderr+=`
3
- ${this.commandName}: execution timeout exceeded
4
- `,Promise.reject(new Error("Operation timed out"));let r=t();return new Promise((o,i)=>{let c=T(()=>{this.running=!1,this.output.exitCode=124,this.output.stderr+=`
5
- ${this.commandName}: execution timeout exceeded
6
- `,i(new Error("Operation timed out"))},e);r.then(d=>{g(c),o(d)},d=>{g(c),i(d)})})}async run(t){for(this.running=!0,this.startTime=Date.now(),this.timeoutMs=t;this.running;){if(Date.now()-this.startTime>=t){this.output.stderr+=`
7
- ${this.commandName}: execution timeout exceeded
8
- `,this.output.exitCode=124;break}let r=this.remainingMs();if(!await this.protocol.waitUntilReady(r)){this.output.stderr+=`
9
- ${this.commandName}: execution timeout exceeded
10
- `,this.output.exitCode=124;break}let i=this.protocol.getOpCode();await this.handleOperation(i),this.protocol.notify()}return this.output}stop(){this.running=!1}async handleOperation(t){try{switch(t){case h.READ_FILE:await this.handleReadFile();break;case h.WRITE_FILE:await this.handleWriteFile();break;case h.STAT:await this.handleStat();break;case h.LSTAT:await this.handleLstat();break;case h.READDIR:await this.handleReaddir();break;case h.MKDIR:await this.handleMkdir();break;case h.RM:await this.handleRm();break;case h.EXISTS:await this.handleExists();break;case h.APPEND_FILE:await this.handleAppendFile();break;case h.SYMLINK:await this.handleSymlink();break;case h.READLINK:await this.handleReadlink();break;case h.CHMOD:await this.handleChmod();break;case h.REALPATH:await this.handleRealpath();break;case h.RENAME:await this.handleRename();break;case h.COPY_FILE:await this.handleCopyFile();break;case h.WRITE_STDOUT:this.handleWriteStdout();break;case h.WRITE_STDERR:this.handleWriteStderr();break;case h.EXIT:this.handleExit();break;case h.HTTP_REQUEST:await this.handleHttpRequest();break;case h.EXEC_COMMAND:await this.handleExecCommand();break;default:this.protocol.setErrorCode(u.IO_ERROR),this.protocol.setStatus(a.ERROR)}}catch(e){this.setErrorFromException(e)}}resolvePath(t){return this.fs.resolvePath(this.cwd,t)}async handleReadFile(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readFileBuffer(t);this.protocol.setResult(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleWriteFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.writeFile(t,e),this.protocol.setStatus(a.SUCCESS)}catch(r){this.setErrorFromException(r)}}async handleStat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.stat(t);this.protocol.encodeStat(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleLstat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.lstat(t);this.protocol.encodeStat(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleReaddir(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readdir(t);this.protocol.setResultFromString(JSON.stringify(e)),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleMkdir(){let t=this.resolvePath(this.protocol.getPath()),r=(this.protocol.getFlags()&S.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(t,{recursive:r}),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}async handleRm(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),r=(e&S.RECURSIVE)!==0,o=(e&S.FORCE)!==0;try{await this.fs.rm(t,{recursive:r,force:o}),this.protocol.setStatus(a.SUCCESS)}catch(i){this.setErrorFromException(i)}}async handleExists(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.exists(t);this.protocol.setResult(new Uint8Array([e?1:0])),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleAppendFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.appendFile(t,e),this.protocol.setStatus(a.SUCCESS)}catch(r){this.setErrorFromException(r)}}async handleSymlink(){let t=this.protocol.getPath(),e=this.protocol.getDataAsString(),r=this.resolvePath(t);try{await this.fs.symlink(e,r),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}async handleReadlink(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readlink(t);this.protocol.setResultFromString(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleChmod(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getMode();try{await this.fs.chmod(t,e),this.protocol.setStatus(a.SUCCESS)}catch(r){this.setErrorFromException(r)}}async handleRealpath(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.realpath(t);this.protocol.setResultFromString(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRename(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.mv(t,e),this.protocol.setStatus(a.SUCCESS)}catch(r){this.setErrorFromException(r)}}async handleCopyFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.cp(t,e),this.protocol.setStatus(a.SUCCESS)}catch(r){this.setErrorFromException(r)}}handleWriteStdout(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stdout",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(u.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(a.ERROR);return}this.protocol.setStatus(a.SUCCESS)}handleWriteStderr(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stderr",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(u.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(a.ERROR);return}this.protocol.setStatus(a.SUCCESS)}handleExit(){let t=this.protocol.getFlags();this.outputLimitExceeded?this.output.exitCode===0&&(this.output.exitCode=1):this.output.exitCode=t,this.protocol.setStatus(a.SUCCESS),this.running=!1}tryAppendOutput(t,e){return this.outputLimitExceeded?!1:this.maxOutputSize<=0?(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0):this.output.stdout.length+this.output.stderr.length+e.length>this.maxOutputSize?!1:(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0)}appendOutputLimitError(){if(this.maxOutputSize<=0)return;let t=`${this.commandName}: total output size exceeded (>${this.maxOutputSize} bytes), increase executionLimits.maxOutputSize
11
- `,e=t.length>this.maxOutputSize?t.slice(0,this.maxOutputSize):t;if(this.output.stderr.includes("total output size exceeded"))return;let o=this.output.stdout.length+this.output.stderr.length+e.length-this.maxOutputSize;if(o>0)if(this.output.stdout.length>=o)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-o);else{let i=o-this.output.stdout.length;this.output.stdout="",i>=this.output.stderr.length?this.output.stderr="":this.output.stderr=this.output.stderr.slice(0,this.output.stderr.length-i)}this.output.stderr+=e}async handleHttpRequest(){let t=this.secureFetch;if(!t){this.protocol.setErrorCode(u.NETWORK_NOT_CONFIGURED),this.protocol.setResultFromString("Network access not configured. Enable network in Bash options."),this.protocol.setStatus(a.ERROR);return}let e=this.protocol.getPath(),r=this.protocol.getDataAsString();try{let o=r?JSON.parse(r):{},i=this.remainingMs(),c=await this.raceDeadline(()=>t(e,{method:o.method,headers:o.headers,body:o.body,timeoutMs:i})),d=JSON.stringify({status:c.status,statusText:c.statusText,headers:c.headers,bodyBase64:A(c.body,"base64"),url:c.url});this.protocol.setResultFromString(d),this.protocol.setStatus(a.SUCCESS)}catch(o){let i=m(o instanceof Error?o.message:String(o));this.protocol.setErrorCode(u.NETWORK_ERROR),this.protocol.setResultFromString(i),this.protocol.setStatus(a.ERROR)}}async handleExecCommand(){let t=this.exec;if(!t){this.protocol.setErrorCode(u.IO_ERROR),this.protocol.setResultFromString("Command execution not available in this context."),this.protocol.setStatus(a.ERROR);return}let e=this.protocol.getPath(),r=this.protocol.getDataAsString(),o=new AbortController;try{let i={cwd:this.cwd,signal:o.signal};if(r){let p=JSON.parse(r);p.stdin&&(i.stdin=p.stdin),p.args&&Array.isArray(p.args)&&(i.args=p.args.map(C=>String(C)),e=F([e]))}let c=await this.raceDeadline(()=>t(e,i)),d=JSON.stringify({stdout:c.stdout,stderr:c.stderr,exitCode:c.exitCode});this.protocol.setResultFromString(d),this.protocol.setStatus(a.SUCCESS)}catch(i){o.abort();let c=i instanceof Error?i.message:String(i);this.protocol.setErrorCode(u.IO_ERROR),this.protocol.setResultFromString(c),this.protocol.setStatus(a.ERROR)}}setErrorFromException(t){let e=t instanceof Error?t.message:String(t),r=m(e),o=u.IO_ERROR,i=e.toLowerCase();i.includes("no such file")||i.includes("not found")||i.includes("enoent")?o=u.NOT_FOUND:i.includes("is a directory")||i.includes("eisdir")?o=u.IS_DIRECTORY:i.includes("not a directory")||i.includes("enotdir")?o=u.NOT_DIRECTORY:i.includes("already exists")||i.includes("eexist")?o=u.EXISTS:(i.includes("permission")||i.includes("eperm")||i.includes("eacces"))&&(o=u.PERMISSION_DENIED),this.protocol.setErrorCode(o),this.protocol.setResultFromString(r),this.protocol.setStatus(a.ERROR)}};export{f as a,O as b};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as g,b,c as m}from"./chunk-GTNBSMZR.js";var k={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};function f(s){let i=s.split(",").map(l=>l.trim()),e=[];for(let l of i){let n=parseInt(l,10);if(Number.isNaN(n)||n<1)return null;e.push(n)}for(let l=1;l<e.length;l++)if(e[l]<=e[l-1])return null;return e}function v(s,i){if(i.length===1){let e=i[0];return s+(e-s%e)}for(let e of i)if(e>s)return e;if(i.length>=2){let e=i[i.length-1]-i[i.length-2],l=i[i.length-1],n=Math.floor((s-l)/e)+1;return l+n*e}return-1}function L(s,i){let{tabStops:e,allBlanks:l}=i,n="",o=0,t="",a=0,u=!0,d=()=>{if(t.length===0)return;let r=a+t.length;if(!l&&!u){n+=t,t="";return}let p=a,c="";for(;p<r;){let h=v(p,e);if(h<=r&&h>p)c+=" ",p=h;else break}let x=r-p;x>0&&(c+=" ".repeat(x)),n+=c,t=""};for(let r of s)r===" "?(t.length===0&&(a=o),t+=r,o++):r===" "?(d(),n+=r,o=v(o,e)):(d(),n+=r,o++,u=!1);return d(),n}function C(s,i){if(s==="")return"";let e=s.split(`
3
- `),l=s.endsWith(`
4
- `)&&e[e.length-1]==="";return l&&e.pop(),e.map(o=>L(o,i)).join(`
5
- `)+(l?`
6
- `:"")}var w={name:"unexpand",execute:async(s,i)=>{if(b(s))return g(k);let e={tabStops:[8],allBlanks:!1},l=[],n=0;for(;n<s.length;){let t=s[n];if(t==="-t"&&n+1<s.length){let a=f(s[n+1]);if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
7
- `};e.tabStops=a,n+=2}else if(t.startsWith("-t")&&t.length>2){let a=f(t.slice(2));if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(2)}'
8
- `};e.tabStops=a,n++}else if(t==="--tabs"&&n+1<s.length){let a=f(s[n+1]);if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
9
- `};e.tabStops=a,n+=2}else if(t.startsWith("--tabs=")){let a=f(t.slice(7));if(!a)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(7)}'
10
- `};e.tabStops=a,n++}else if(t==="-a"||t==="--all")e.allBlanks=!0,n++;else if(t==="--"){l.push(...s.slice(n+1));break}else{if(t.startsWith("-")&&t!=="-")return m("unexpand",t);l.push(t),n++}}let o="";if(l.length===0){let t=i.stdin??"";o=C(t,e)}else for(let t of l){let a=i.fs.resolvePath(i.cwd,t),u=await i.fs.readFile(a);if(u===null)return{exitCode:1,stdout:o,stderr:`unexpand: ${t}: No such file or directory
11
- `};o+=C(u,e)}return{exitCode:0,stdout:o,stderr:""}}},F={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0};export{w as a,F as b};