just-bash 2.9.4 → 2.9.5

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 (743) hide show
  1. package/dist/AGENTS.md +31 -2
  2. package/dist/Bash.d.ts +7 -1
  3. package/dist/bin/chunks/alias-3GODYSFD.js +2 -0
  4. package/dist/bin/chunks/awk2-JBWRWZZH.js +2 -0
  5. package/dist/bin/chunks/base64-OHU2WTUF.js +2 -0
  6. package/dist/bin/chunks/basename-KBUKWB2E.js +2 -0
  7. package/dist/bin/chunks/bash-RJTQJAKW.js +2 -0
  8. package/dist/bin/chunks/cat-3J7U3HHI.js +2 -0
  9. package/dist/bin/chunks/chmod-4O2C4V42.js +2 -0
  10. package/dist/bin/chunks/chunk-26NO42TF.js +14 -0
  11. package/dist/bin/chunks/chunk-2SIXTZCJ.js +5 -0
  12. package/dist/bin/chunks/chunk-3MBAUIBB.js +7 -0
  13. package/dist/bin/chunks/chunk-3Y32LPNT.js +2 -0
  14. package/dist/bin/chunks/chunk-4E3LY6YK.js +10 -0
  15. package/dist/bin/chunks/chunk-4P5OA25Z.js +26 -0
  16. package/dist/bin/chunks/chunk-4PS5JJDT.js +8 -0
  17. package/dist/bin/chunks/chunk-5G2VOPPJ.js +7 -0
  18. package/dist/bin/chunks/chunk-5U7Q4GUC.js +6 -0
  19. package/dist/bin/chunks/chunk-5VFN7VVJ.js +9 -0
  20. package/dist/bin/chunks/chunk-6VUEI2GS.js +9 -0
  21. package/dist/bin/chunks/chunk-7BORMNPQ.js +2 -0
  22. package/dist/bin/chunks/chunk-7ECKLAVW.js +11 -0
  23. package/dist/bin/{shell/chunks/sed-E4QAUCYQ.js → chunks/chunk-7FTB27TY.js} +36 -36
  24. package/dist/bin/chunks/{tr-IAUNBQKH.js → chunk-BDSRLH5T.js} +5 -5
  25. package/dist/bin/chunks/chunk-BYDV4VEF.js +3 -0
  26. package/dist/bin/{shell/chunks/yq-XD7UYY5C.js → chunks/chunk-CHQBMS62.js} +24 -24
  27. package/dist/bin/chunks/chunk-D2GFNFUN.js +7 -0
  28. package/dist/bin/chunks/chunk-DAGNL3F2.js +32 -0
  29. package/dist/bin/chunks/chunk-DSNA7727.js +13 -0
  30. package/dist/bin/chunks/{tar-CLEBMI4R.js → chunk-EFX3F2HZ.js} +6 -6
  31. package/dist/bin/chunks/{rmdir-OEMA5ZTD.js → chunk-EJQKHROT.js} +3 -3
  32. package/dist/bin/chunks/chunk-EUXCM6C4.js +12 -0
  33. package/dist/bin/{shell/chunks/xan-QLNZCWIG.js → chunks/chunk-F26OLHG5.js} +17 -17
  34. package/dist/bin/chunks/chunk-FLPVVSN5.js +5 -0
  35. package/dist/bin/chunks/{chunk-HSNUCOOQ.js → chunk-FZNYF2PQ.js} +2 -2
  36. package/dist/bin/chunks/chunk-ITA43A73.js +7 -0
  37. package/dist/bin/chunks/chunk-IY3BUFJK.js +5 -0
  38. package/dist/bin/chunks/chunk-JLX6YWGA.js +3 -0
  39. package/dist/bin/chunks/chunk-JQBC3FXE.js +8 -0
  40. package/dist/bin/chunks/chunk-JTF74J6E.js +2 -0
  41. package/dist/bin/chunks/chunk-JXC25GVQ.js +5 -0
  42. package/dist/bin/chunks/chunk-K47SEEPI.js +6 -0
  43. package/dist/bin/chunks/chunk-KLMOJKL4.js +16 -0
  44. package/dist/bin/chunks/chunk-KWLLB7S3.js +7 -0
  45. package/dist/bin/chunks/chunk-LJKIWB5F.js +4 -0
  46. package/dist/bin/chunks/chunk-LMK6G2HH.js +8 -0
  47. package/dist/bin/chunks/chunk-MAVV76T4.js +2 -0
  48. package/dist/bin/chunks/chunk-N43DJTSI.js +2 -0
  49. package/dist/bin/chunks/{file-MWSA2WYI.js → chunk-N5OTVT4F.js} +1 -1
  50. package/dist/bin/chunks/{time-F4NVQOJH.js → chunk-N73TVRMN.js} +5 -5
  51. package/dist/bin/chunks/chunk-NEQEZ32M.js +5 -0
  52. package/dist/bin/chunks/{sleep-O5BOTJGJ.js → chunk-NFZDITRV.js} +4 -4
  53. package/dist/bin/chunks/chunk-NSUMEERA.js +12 -0
  54. package/dist/bin/chunks/chunk-OIKCUTTB.js +6 -0
  55. package/dist/bin/chunks/chunk-P6GNZPVW.js +19 -0
  56. package/dist/bin/chunks/chunk-P7UCWJ33.js +12 -0
  57. package/dist/bin/chunks/{sqlite3-CUDCXXK3.js → chunk-PDVXLMUU.js} +9 -9
  58. package/dist/bin/chunks/chunk-PPBQJBC2.js +5 -0
  59. package/dist/bin/chunks/chunk-PQNTKMH3.js +6 -0
  60. package/dist/bin/chunks/chunk-PS4LOXE5.js +8 -0
  61. package/dist/bin/chunks/{chunk-B3E7BBYK.js → chunk-Q4AUWUII.js} +41 -41
  62. package/dist/bin/{shell/chunks/rg-IZR5557M.js → chunks/chunk-Q4QFIAHB.js} +9 -9
  63. package/dist/bin/chunks/chunk-QXB5WI2V.js +16 -0
  64. package/dist/bin/chunks/chunk-RJSAGJQJ.js +11 -0
  65. package/dist/bin/chunks/chunk-ROJPSS6N.js +3 -0
  66. package/dist/bin/chunks/chunk-RT7TRQVZ.js +3 -0
  67. package/dist/bin/chunks/chunk-S7OHMN3F.js +6 -0
  68. package/dist/bin/chunks/{nl-DSM3NUGM.js → chunk-SGA7Y45Z.js} +7 -7
  69. package/dist/bin/chunks/chunk-STU6KQN4.js +6 -0
  70. package/dist/bin/chunks/chunk-SXRVLCZ4.js +2 -0
  71. package/dist/bin/chunks/chunk-TEFXEYX3.js +3 -0
  72. package/dist/bin/chunks/chunk-THALLNXT.js +7 -0
  73. package/dist/bin/chunks/chunk-THLAHQXV.js +16 -0
  74. package/dist/bin/chunks/chunk-TIDZOIPX.js +3 -0
  75. package/dist/bin/chunks/chunk-VNER2XXL.js +7 -0
  76. package/dist/bin/chunks/chunk-W2FKF3MM.js +9 -0
  77. package/dist/bin/chunks/chunk-WT2HWDDA.js +9 -0
  78. package/dist/bin/chunks/chunk-X2I3PJTX.js +15 -0
  79. package/dist/bin/chunks/chunk-XAL6VWGA.js +9 -0
  80. package/dist/bin/chunks/{html-to-markdown-EPEXKI4B.js → chunk-XKPFI566.js} +9 -9
  81. package/dist/bin/chunks/chunk-YEKSVVRC.js +11 -0
  82. package/dist/bin/chunks/chunk-YLE2OYY6.js +2 -0
  83. package/dist/bin/chunks/chunk-YYQ22ZRL.js +8 -0
  84. package/dist/bin/chunks/chunk-ZA4HUKJ3.js +13 -0
  85. package/dist/bin/chunks/chunk-ZJSZ2BE5.js +21 -0
  86. package/dist/bin/chunks/chunk-ZKC5HQYO.js +14 -0
  87. package/dist/bin/chunks/clear-KRGKPFOI.js +2 -0
  88. package/dist/bin/chunks/column-XGV32UPN.js +2 -0
  89. package/dist/bin/chunks/comm-R3F3Z5DX.js +2 -0
  90. package/dist/bin/chunks/cp-XH2ZB7WT.js +2 -0
  91. package/dist/bin/chunks/cut-HDHQDWRG.js +2 -0
  92. package/dist/bin/chunks/date-6VDN5QZ5.js +2 -0
  93. package/dist/bin/chunks/diff-LE7GMFZD.js +2 -0
  94. package/dist/bin/chunks/dirname-5FAOMLBL.js +2 -0
  95. package/dist/bin/chunks/du-66BNA4IN.js +2 -0
  96. package/dist/bin/chunks/echo-2MUAOGUE.js +2 -0
  97. package/dist/bin/chunks/env-EVLPSWFF.js +2 -0
  98. package/dist/bin/chunks/expand-26XPP5KB.js +2 -0
  99. package/dist/bin/{shell/chunks/expansion-LR5H7O2U.js → chunks/expansion-HIAVHGBZ.js} +1 -1
  100. package/dist/bin/chunks/expr-MLHUWFYI.js +2 -0
  101. package/dist/bin/chunks/file-D5YKS5NV.js +2 -0
  102. package/dist/bin/chunks/find-K777TRNA.js +2 -0
  103. package/dist/bin/chunks/flag-coverage-FNEHS7AY.js +2 -0
  104. package/dist/bin/chunks/fold-XSVNTAWH.js +2 -0
  105. package/dist/bin/chunks/grep-FRIPZKKT.js +2 -0
  106. package/dist/bin/chunks/gzip-EENEW6WQ.js +2 -0
  107. package/dist/bin/chunks/head-YMNRW3F3.js +2 -0
  108. package/dist/bin/chunks/help-JF5TTAKQ.js +2 -0
  109. package/dist/bin/chunks/history-UUKG55YW.js +2 -0
  110. package/dist/bin/chunks/hostname-WY6RKE32.js +2 -0
  111. package/dist/bin/chunks/html-to-markdown-WVZA3MCP.js +2 -0
  112. package/dist/bin/chunks/join-Y4Q5WVVE.js +2 -0
  113. package/dist/bin/chunks/jq-3VHS7DR6.js +2 -0
  114. package/dist/bin/chunks/ln-5TCJXDGY.js +2 -0
  115. package/dist/bin/chunks/ls-ZXYOL67L.js +2 -0
  116. package/dist/bin/chunks/md5sum-NCLXV2S3.js +2 -0
  117. package/dist/bin/chunks/mkdir-6OKMS3KO.js +2 -0
  118. package/dist/bin/chunks/mv-OY7X62QC.js +2 -0
  119. package/dist/bin/chunks/nl-XH3L75DR.js +2 -0
  120. package/dist/bin/chunks/od-52FBC34W.js +2 -0
  121. package/dist/bin/chunks/paste-3UVLMQ2K.js +2 -0
  122. package/dist/bin/chunks/printf-TZC5BRAY.js +2 -0
  123. package/dist/bin/chunks/pwd-6VBAPL3Y.js +2 -0
  124. package/dist/bin/chunks/readlink-YNOUXNUY.js +2 -0
  125. package/dist/bin/chunks/rev-UHEPS2UL.js +2 -0
  126. package/dist/bin/chunks/rg-3R5G2XL4.js +2 -0
  127. package/dist/bin/chunks/rm-5QIBTLJG.js +2 -0
  128. package/dist/bin/chunks/rmdir-5KLM4EA6.js +2 -0
  129. package/dist/bin/chunks/sed-XP3QCHIB.js +2 -0
  130. package/dist/bin/chunks/seq-V7KBLSQ7.js +2 -0
  131. package/dist/bin/chunks/sha1sum-BHNJ5ALF.js +2 -0
  132. package/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +2 -0
  133. package/dist/bin/chunks/sleep-PICQVS6Q.js +2 -0
  134. package/dist/bin/chunks/sort-NZSEYCI6.js +2 -0
  135. package/dist/bin/chunks/split-NOZ7FFXW.js +2 -0
  136. package/dist/bin/chunks/sqlite3-4SEIR46P.js +2 -0
  137. package/dist/bin/chunks/stat-XH7E4E2C.js +2 -0
  138. package/dist/bin/chunks/strings-XXKZCWY5.js +2 -0
  139. package/dist/bin/chunks/tac-TZBNTR4K.js +2 -0
  140. package/dist/bin/chunks/tail-V537TDFR.js +2 -0
  141. package/dist/bin/chunks/tar-7B5KH3QG.js +2 -0
  142. package/dist/bin/chunks/tee-HK2SYCAR.js +2 -0
  143. package/dist/bin/chunks/time-4C3A4THJ.js +2 -0
  144. package/dist/bin/chunks/timeout-RS7REDYT.js +2 -0
  145. package/dist/bin/chunks/touch-DWKSZGOQ.js +2 -0
  146. package/dist/bin/chunks/tr-GDDRKGRB.js +2 -0
  147. package/dist/bin/chunks/tree-HEKABARE.js +2 -0
  148. package/dist/bin/chunks/true-DP5UZP52.js +2 -0
  149. package/dist/bin/chunks/unexpand-OYZ7KOYR.js +2 -0
  150. package/dist/bin/chunks/uniq-FZWFZEN5.js +2 -0
  151. package/dist/bin/chunks/wc-ZIV3TFVG.js +2 -0
  152. package/dist/bin/chunks/which-67WZ6OMV.js +2 -0
  153. package/dist/bin/chunks/whoami-E7PN2UWC.js +2 -0
  154. package/dist/bin/chunks/xan-EBI2W7YX.js +2 -0
  155. package/dist/bin/chunks/xargs-YWPEV2QC.js +2 -0
  156. package/dist/bin/chunks/yq-O56CEX4T.js +2 -0
  157. package/dist/bin/just-bash.js +190 -188
  158. package/dist/bin/shell/chunks/alias-3GODYSFD.js +2 -0
  159. package/dist/bin/shell/chunks/awk2-JBWRWZZH.js +2 -0
  160. package/dist/bin/shell/chunks/base64-OHU2WTUF.js +2 -0
  161. package/dist/bin/shell/chunks/basename-KBUKWB2E.js +2 -0
  162. package/dist/bin/shell/chunks/bash-RJTQJAKW.js +2 -0
  163. package/dist/bin/shell/chunks/cat-3J7U3HHI.js +2 -0
  164. package/dist/bin/shell/chunks/chmod-4O2C4V42.js +2 -0
  165. package/dist/bin/shell/chunks/chunk-26NO42TF.js +14 -0
  166. package/dist/bin/shell/chunks/chunk-2SIXTZCJ.js +5 -0
  167. package/dist/bin/shell/chunks/chunk-3MBAUIBB.js +7 -0
  168. package/dist/bin/shell/chunks/chunk-3Y32LPNT.js +2 -0
  169. package/dist/bin/shell/chunks/chunk-4E3LY6YK.js +10 -0
  170. package/dist/bin/shell/chunks/chunk-4P5OA25Z.js +26 -0
  171. package/dist/bin/shell/chunks/chunk-4PS5JJDT.js +8 -0
  172. package/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +7 -0
  173. package/dist/bin/shell/chunks/chunk-5U7Q4GUC.js +6 -0
  174. package/dist/bin/shell/chunks/chunk-5VFN7VVJ.js +9 -0
  175. package/dist/bin/shell/chunks/chunk-6VUEI2GS.js +9 -0
  176. package/dist/bin/shell/chunks/chunk-7BORMNPQ.js +2 -0
  177. package/dist/bin/shell/chunks/chunk-7ECKLAVW.js +11 -0
  178. package/dist/bin/{chunks/sed-E4QAUCYQ.js → shell/chunks/chunk-7FTB27TY.js} +36 -36
  179. package/dist/bin/shell/chunks/{tr-IAUNBQKH.js → chunk-BDSRLH5T.js} +5 -5
  180. package/dist/bin/shell/chunks/chunk-BYDV4VEF.js +3 -0
  181. package/dist/bin/{chunks/yq-XD7UYY5C.js → shell/chunks/chunk-CHQBMS62.js} +24 -24
  182. package/dist/bin/shell/chunks/chunk-D2GFNFUN.js +7 -0
  183. package/dist/bin/shell/chunks/chunk-DAGNL3F2.js +32 -0
  184. package/dist/bin/shell/chunks/chunk-DSNA7727.js +13 -0
  185. package/dist/bin/shell/chunks/{tar-CLEBMI4R.js → chunk-EFX3F2HZ.js} +6 -6
  186. package/dist/bin/shell/chunks/{rmdir-OEMA5ZTD.js → chunk-EJQKHROT.js} +3 -3
  187. package/dist/bin/shell/chunks/chunk-EUXCM6C4.js +12 -0
  188. package/dist/bin/{chunks/xan-QLNZCWIG.js → shell/chunks/chunk-F26OLHG5.js} +17 -17
  189. package/dist/bin/shell/chunks/chunk-FLPVVSN5.js +5 -0
  190. package/dist/bin/shell/chunks/{chunk-HSNUCOOQ.js → chunk-FZNYF2PQ.js} +2 -2
  191. package/dist/bin/shell/chunks/chunk-ITA43A73.js +7 -0
  192. package/dist/bin/shell/chunks/chunk-IY3BUFJK.js +5 -0
  193. package/dist/bin/shell/chunks/chunk-JLX6YWGA.js +3 -0
  194. package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +8 -0
  195. package/dist/bin/shell/chunks/chunk-JTF74J6E.js +2 -0
  196. package/dist/bin/shell/chunks/chunk-JXC25GVQ.js +5 -0
  197. package/dist/bin/shell/chunks/chunk-K47SEEPI.js +6 -0
  198. package/dist/bin/shell/chunks/chunk-KLMOJKL4.js +16 -0
  199. package/dist/bin/shell/chunks/chunk-KWLLB7S3.js +7 -0
  200. package/dist/bin/shell/chunks/chunk-LJKIWB5F.js +4 -0
  201. package/dist/bin/shell/chunks/chunk-LMK6G2HH.js +8 -0
  202. package/dist/bin/shell/chunks/chunk-MAVV76T4.js +2 -0
  203. package/dist/bin/shell/chunks/chunk-N43DJTSI.js +2 -0
  204. package/dist/bin/shell/chunks/{file-MWSA2WYI.js → chunk-N5OTVT4F.js} +1 -1
  205. package/dist/bin/shell/chunks/{time-F4NVQOJH.js → chunk-N73TVRMN.js} +5 -5
  206. package/dist/bin/shell/chunks/chunk-NEQEZ32M.js +5 -0
  207. package/dist/bin/shell/chunks/{sleep-O5BOTJGJ.js → chunk-NFZDITRV.js} +4 -4
  208. package/dist/bin/shell/chunks/chunk-NSUMEERA.js +12 -0
  209. package/dist/bin/shell/chunks/chunk-OIKCUTTB.js +6 -0
  210. package/dist/bin/shell/chunks/chunk-P6GNZPVW.js +19 -0
  211. package/dist/bin/shell/chunks/chunk-P7UCWJ33.js +12 -0
  212. package/dist/bin/shell/chunks/{sqlite3-CUDCXXK3.js → chunk-PDVXLMUU.js} +9 -9
  213. package/dist/bin/shell/chunks/chunk-PPBQJBC2.js +5 -0
  214. package/dist/bin/shell/chunks/chunk-PQNTKMH3.js +6 -0
  215. package/dist/bin/shell/chunks/chunk-PS4LOXE5.js +8 -0
  216. package/dist/bin/shell/chunks/{chunk-B3E7BBYK.js → chunk-Q4AUWUII.js} +41 -41
  217. package/dist/bin/{chunks/rg-IZR5557M.js → shell/chunks/chunk-Q4QFIAHB.js} +9 -9
  218. package/dist/bin/shell/chunks/chunk-QXB5WI2V.js +16 -0
  219. package/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +11 -0
  220. package/dist/bin/shell/chunks/chunk-ROJPSS6N.js +3 -0
  221. package/dist/bin/shell/chunks/chunk-RT7TRQVZ.js +3 -0
  222. package/dist/bin/shell/chunks/chunk-S7OHMN3F.js +6 -0
  223. package/dist/bin/shell/chunks/{nl-DSM3NUGM.js → chunk-SGA7Y45Z.js} +7 -7
  224. package/dist/bin/shell/chunks/chunk-STU6KQN4.js +6 -0
  225. package/dist/bin/shell/chunks/chunk-SXRVLCZ4.js +2 -0
  226. package/dist/bin/shell/chunks/chunk-TEFXEYX3.js +3 -0
  227. package/dist/bin/shell/chunks/chunk-THALLNXT.js +7 -0
  228. package/dist/bin/shell/chunks/chunk-THLAHQXV.js +16 -0
  229. package/dist/bin/shell/chunks/chunk-TIDZOIPX.js +3 -0
  230. package/dist/bin/shell/chunks/chunk-VNER2XXL.js +7 -0
  231. package/dist/bin/shell/chunks/chunk-W2FKF3MM.js +9 -0
  232. package/dist/bin/shell/chunks/chunk-WT2HWDDA.js +9 -0
  233. package/dist/bin/shell/chunks/chunk-X2I3PJTX.js +15 -0
  234. package/dist/bin/shell/chunks/chunk-XAL6VWGA.js +9 -0
  235. package/dist/bin/shell/chunks/{html-to-markdown-EPEXKI4B.js → chunk-XKPFI566.js} +9 -9
  236. package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +11 -0
  237. package/dist/bin/shell/chunks/chunk-YLE2OYY6.js +2 -0
  238. package/dist/bin/shell/chunks/chunk-YYQ22ZRL.js +8 -0
  239. package/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +13 -0
  240. package/dist/bin/shell/chunks/chunk-ZJSZ2BE5.js +21 -0
  241. package/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +14 -0
  242. package/dist/bin/shell/chunks/clear-KRGKPFOI.js +2 -0
  243. package/dist/bin/shell/chunks/column-XGV32UPN.js +2 -0
  244. package/dist/bin/shell/chunks/comm-R3F3Z5DX.js +2 -0
  245. package/dist/bin/shell/chunks/cp-XH2ZB7WT.js +2 -0
  246. package/dist/bin/shell/chunks/cut-HDHQDWRG.js +2 -0
  247. package/dist/bin/shell/chunks/date-6VDN5QZ5.js +2 -0
  248. package/dist/bin/shell/chunks/diff-LE7GMFZD.js +2 -0
  249. package/dist/bin/shell/chunks/dirname-5FAOMLBL.js +2 -0
  250. package/dist/bin/shell/chunks/du-66BNA4IN.js +2 -0
  251. package/dist/bin/shell/chunks/echo-2MUAOGUE.js +2 -0
  252. package/dist/bin/shell/chunks/env-EVLPSWFF.js +2 -0
  253. package/dist/bin/shell/chunks/expand-26XPP5KB.js +2 -0
  254. package/dist/bin/{chunks/expansion-LR5H7O2U.js → shell/chunks/expansion-HIAVHGBZ.js} +1 -1
  255. package/dist/bin/shell/chunks/expr-MLHUWFYI.js +2 -0
  256. package/dist/bin/shell/chunks/file-D5YKS5NV.js +2 -0
  257. package/dist/bin/shell/chunks/find-K777TRNA.js +2 -0
  258. package/dist/bin/shell/chunks/flag-coverage-FNEHS7AY.js +2 -0
  259. package/dist/bin/shell/chunks/fold-XSVNTAWH.js +2 -0
  260. package/dist/bin/shell/chunks/grep-FRIPZKKT.js +2 -0
  261. package/dist/bin/shell/chunks/gzip-EENEW6WQ.js +2 -0
  262. package/dist/bin/shell/chunks/head-YMNRW3F3.js +2 -0
  263. package/dist/bin/shell/chunks/help-JF5TTAKQ.js +2 -0
  264. package/dist/bin/shell/chunks/history-UUKG55YW.js +2 -0
  265. package/dist/bin/shell/chunks/hostname-WY6RKE32.js +2 -0
  266. package/dist/bin/shell/chunks/html-to-markdown-WVZA3MCP.js +2 -0
  267. package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +2 -0
  268. package/dist/bin/shell/chunks/jq-3VHS7DR6.js +2 -0
  269. package/dist/bin/shell/chunks/ln-5TCJXDGY.js +2 -0
  270. package/dist/bin/shell/chunks/ls-ZXYOL67L.js +2 -0
  271. package/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +2 -0
  272. package/dist/bin/shell/chunks/mkdir-6OKMS3KO.js +2 -0
  273. package/dist/bin/shell/chunks/mv-OY7X62QC.js +2 -0
  274. package/dist/bin/shell/chunks/nl-XH3L75DR.js +2 -0
  275. package/dist/bin/shell/chunks/od-52FBC34W.js +2 -0
  276. package/dist/bin/shell/chunks/paste-3UVLMQ2K.js +2 -0
  277. package/dist/bin/shell/chunks/printf-TZC5BRAY.js +2 -0
  278. package/dist/bin/shell/chunks/pwd-6VBAPL3Y.js +2 -0
  279. package/dist/bin/shell/chunks/readlink-YNOUXNUY.js +2 -0
  280. package/dist/bin/shell/chunks/rev-UHEPS2UL.js +2 -0
  281. package/dist/bin/shell/chunks/rg-3R5G2XL4.js +2 -0
  282. package/dist/bin/shell/chunks/rm-5QIBTLJG.js +2 -0
  283. package/dist/bin/shell/chunks/rmdir-5KLM4EA6.js +2 -0
  284. package/dist/bin/shell/chunks/sed-XP3QCHIB.js +2 -0
  285. package/dist/bin/shell/chunks/seq-V7KBLSQ7.js +2 -0
  286. package/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +2 -0
  287. package/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +2 -0
  288. package/dist/bin/shell/chunks/sleep-PICQVS6Q.js +2 -0
  289. package/dist/bin/shell/chunks/sort-NZSEYCI6.js +2 -0
  290. package/dist/bin/shell/chunks/split-NOZ7FFXW.js +2 -0
  291. package/dist/bin/shell/chunks/sqlite3-4SEIR46P.js +2 -0
  292. package/dist/bin/shell/chunks/stat-XH7E4E2C.js +2 -0
  293. package/dist/bin/shell/chunks/strings-XXKZCWY5.js +2 -0
  294. package/dist/bin/shell/chunks/tac-TZBNTR4K.js +2 -0
  295. package/dist/bin/shell/chunks/tail-V537TDFR.js +2 -0
  296. package/dist/bin/shell/chunks/tar-7B5KH3QG.js +2 -0
  297. package/dist/bin/shell/chunks/tee-HK2SYCAR.js +2 -0
  298. package/dist/bin/shell/chunks/time-4C3A4THJ.js +2 -0
  299. package/dist/bin/shell/chunks/timeout-RS7REDYT.js +2 -0
  300. package/dist/bin/shell/chunks/touch-DWKSZGOQ.js +2 -0
  301. package/dist/bin/shell/chunks/tr-GDDRKGRB.js +2 -0
  302. package/dist/bin/shell/chunks/tree-HEKABARE.js +2 -0
  303. package/dist/bin/shell/chunks/true-DP5UZP52.js +2 -0
  304. package/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +2 -0
  305. package/dist/bin/shell/chunks/uniq-FZWFZEN5.js +2 -0
  306. package/dist/bin/shell/chunks/wc-ZIV3TFVG.js +2 -0
  307. package/dist/bin/shell/chunks/which-67WZ6OMV.js +2 -0
  308. package/dist/bin/shell/chunks/whoami-E7PN2UWC.js +2 -0
  309. package/dist/bin/shell/chunks/xan-EBI2W7YX.js +2 -0
  310. package/dist/bin/shell/chunks/xargs-YWPEV2QC.js +2 -0
  311. package/dist/bin/shell/chunks/yq-O56CEX4T.js +2 -0
  312. package/dist/bin/shell/shell.js +192 -190
  313. package/dist/bundle/browser.js +773 -771
  314. package/dist/bundle/chunks/alias-JE7RI5QX.js +1 -0
  315. package/dist/bundle/chunks/awk2-M5NFQRYA.js +1 -0
  316. package/dist/bundle/chunks/base64-HYOQ5I2F.js +1 -0
  317. package/dist/bundle/chunks/basename-AA2KJYZQ.js +1 -0
  318. package/dist/bundle/chunks/bash-OVBCDR7G.js +1 -0
  319. package/dist/bundle/chunks/cat-C2OBLGHA.js +1 -0
  320. package/dist/bundle/chunks/chmod-MIKE3OIT.js +1 -0
  321. package/dist/bundle/chunks/chunk-27LMNKBP.js +7 -0
  322. package/dist/bundle/chunks/chunk-4HHKTUW3.js +2 -0
  323. package/dist/bundle/chunks/chunk-4Q4SM6WR.js +4 -0
  324. package/dist/bundle/chunks/chunk-55VFSPNA.js +2 -0
  325. package/dist/bundle/chunks/chunk-5V6VZH6T.js +1 -0
  326. package/dist/bundle/chunks/chunk-64BAICW3.js +1 -0
  327. package/dist/bundle/chunks/chunk-6NY2AP72.js +5 -0
  328. package/dist/bundle/chunks/chunk-7C6RBHP3.js +4 -0
  329. package/dist/bundle/chunks/chunk-7DBA735O.js +5 -0
  330. package/dist/bundle/chunks/chunk-A4HU7SVR.js +2 -0
  331. package/dist/bundle/chunks/chunk-A4JSPFCI.js +6 -0
  332. package/dist/bundle/chunks/chunk-A7A2DBEE.js +6 -0
  333. package/dist/bundle/chunks/chunk-A7ICOL4V.js +13 -0
  334. package/dist/bundle/chunks/chunk-ALLTKNUZ.js +5 -0
  335. package/dist/bundle/chunks/chunk-APT7OOP2.js +1 -0
  336. package/dist/bundle/chunks/{chunk-RERCNF7Z.js → chunk-CCL4U6Q4.js} +41 -41
  337. package/dist/bundle/chunks/{file-APPTAFMI.js → chunk-CR5AFCPT.js} +1 -1
  338. package/dist/bundle/chunks/{time-EGF4KTWV.js → chunk-CSBFBYLD.js} +5 -5
  339. package/dist/bundle/chunks/chunk-D4J545R4.js +11 -0
  340. package/dist/bundle/chunks/chunk-DCAAORBQ.js +1 -0
  341. package/dist/bundle/chunks/chunk-DZ33S2U7.js +31 -0
  342. package/dist/bundle/chunks/{nl-KWQGFZH5.js → chunk-F23WWYKW.js} +7 -7
  343. package/dist/bundle/chunks/chunk-GCTKCWKD.js +3 -0
  344. package/dist/bundle/chunks/{yq-JD6M7T5A.js → chunk-GOBUJIHS.js} +24 -24
  345. package/dist/bundle/chunks/chunk-GQ7SJRUH.js +12 -0
  346. package/dist/bundle/chunks/chunk-GXVXFKBA.js +5 -0
  347. package/dist/bundle/chunks/chunk-GZ2N3SXD.js +8 -0
  348. package/dist/bundle/chunks/{sqlite3-DK5YHTWU.js → chunk-HDZ4QEVJ.js} +9 -9
  349. package/dist/bundle/chunks/chunk-HJQJAYMS.js +2 -0
  350. package/dist/bundle/chunks/chunk-HXILPMCG.js +5 -0
  351. package/dist/bundle/chunks/chunk-IKZ5LEGB.js +6 -0
  352. package/dist/bundle/chunks/chunk-JSZMK2JZ.js +5 -0
  353. package/dist/bundle/chunks/chunk-JVPRLUMK.js +7 -0
  354. package/dist/bundle/chunks/chunk-K3PAWJ7V.js +7 -0
  355. package/dist/bundle/chunks/chunk-KAEMRWOH.js +15 -0
  356. package/dist/bundle/chunks/chunk-KTGH7NTP.js +15 -0
  357. package/dist/bundle/chunks/chunk-KY5VPZXG.js +23 -0
  358. package/dist/bundle/chunks/{printf-4U5V2VHK.js → chunk-L4KW73FJ.js} +11 -11
  359. package/dist/bundle/chunks/chunk-LL3S3NLB.js +1 -0
  360. package/dist/bundle/chunks/chunk-LWEGUNWT.js +7 -0
  361. package/dist/bundle/chunks/chunk-MDLLFABN.js +4 -0
  362. package/dist/bundle/chunks/chunk-NCNPKYJZ.js +2 -0
  363. package/dist/bundle/chunks/chunk-NQOQ2Q77.js +8 -0
  364. package/dist/bundle/chunks/chunk-NUYSJFDK.js +7 -0
  365. package/dist/bundle/chunks/chunk-OCK72LWW.js +4 -0
  366. package/dist/bundle/chunks/chunk-OCLXQMOG.js +6 -0
  367. package/dist/bundle/chunks/{rmdir-DU6C7ZEO.js → chunk-OCS6LSEM.js} +3 -3
  368. package/dist/bundle/chunks/chunk-OFJTSXN6.js +8 -0
  369. package/dist/bundle/chunks/chunk-OGDTSM2Q.js +8 -0
  370. package/dist/bundle/chunks/chunk-PP6PSHAB.js +4 -0
  371. package/dist/bundle/chunks/chunk-PYSFUGCK.js +10 -0
  372. package/dist/bundle/chunks/chunk-QCDB2VPH.js +6 -0
  373. package/dist/bundle/chunks/{rg-JNKRPEYR.js → chunk-QOENL5UZ.js} +9 -9
  374. package/dist/bundle/chunks/chunk-R6QSAL5T.js +1 -0
  375. package/dist/bundle/chunks/{chunk-WQCJYUEW.js → chunk-RSXSWZBQ.js} +2 -2
  376. package/dist/bundle/chunks/chunk-S6BBC45K.js +8 -0
  377. package/dist/bundle/chunks/chunk-SL4FN3A5.js +9 -0
  378. package/dist/bundle/chunks/chunk-SXR3EI72.js +4 -0
  379. package/dist/bundle/chunks/chunk-TLSUDHID.js +6 -0
  380. package/dist/bundle/chunks/chunk-U7QI5ZS5.js +4 -0
  381. package/dist/bundle/chunks/{xan-EN6JZQ3T.js → chunk-UAHZJD43.js} +17 -17
  382. package/dist/bundle/chunks/chunk-UYGR3CFC.js +2 -0
  383. package/dist/bundle/chunks/chunk-VJFXDYWH.js +10 -0
  384. package/dist/bundle/chunks/chunk-VOBGTVA6.js +6 -0
  385. package/dist/bundle/chunks/{sed-4K5HXNXE.js → chunk-VTHR2H5Q.js} +36 -36
  386. package/dist/bundle/chunks/chunk-VYOJP4TV.js +13 -0
  387. package/dist/bundle/chunks/{tar-5V4PGBFL.js → chunk-VZWXH2PZ.js} +6 -6
  388. package/dist/bundle/chunks/chunk-WEIVGBP5.js +20 -0
  389. package/dist/bundle/chunks/chunk-WMLBQOWO.js +9 -0
  390. package/dist/bundle/chunks/{tr-UJSEBPIQ.js → chunk-X6JMGGW2.js} +5 -5
  391. package/dist/bundle/chunks/chunk-XKQRETAK.js +1 -0
  392. package/dist/bundle/chunks/chunk-XNL7YAHW.js +11 -0
  393. package/dist/bundle/chunks/chunk-XVDPCNWR.js +11 -0
  394. package/dist/bundle/chunks/chunk-XZ3MZS57.js +6 -0
  395. package/dist/bundle/chunks/chunk-YYB54I7F.js +10 -0
  396. package/dist/bundle/chunks/chunk-Z7JVV2SM.js +12 -0
  397. package/dist/bundle/chunks/chunk-ZKLK6C7H.js +15 -0
  398. package/dist/bundle/chunks/clear-5CZ5X4YR.js +1 -0
  399. package/dist/bundle/chunks/column-WLPMMSTS.js +1 -0
  400. package/dist/bundle/chunks/comm-5SLSESQG.js +1 -0
  401. package/dist/bundle/chunks/cp-XOYR4ABJ.js +1 -0
  402. package/dist/bundle/chunks/cut-LO6YYY5P.js +1 -0
  403. package/dist/bundle/chunks/date-FT2P5UCQ.js +1 -0
  404. package/dist/bundle/chunks/diff-HJF2MPDN.js +1 -0
  405. package/dist/bundle/chunks/dirname-LEMTZZFS.js +1 -0
  406. package/dist/bundle/chunks/du-DM4QX4XA.js +1 -0
  407. package/dist/bundle/chunks/echo-O45JWWI2.js +1 -0
  408. package/dist/bundle/chunks/env-S547XMN7.js +1 -0
  409. package/dist/bundle/chunks/expand-DTNXU4LQ.js +1 -0
  410. package/dist/bundle/chunks/{expansion-OFFC2R4K.js → expansion-R2VVQUSY.js} +1 -1
  411. package/dist/bundle/chunks/expr-3572LAOT.js +1 -0
  412. package/dist/bundle/chunks/file-ZIGAJ4YS.js +1 -0
  413. package/dist/bundle/chunks/find-74OP3M7S.js +1 -0
  414. package/dist/bundle/chunks/flag-coverage-KDDXWVDJ.js +1 -0
  415. package/dist/bundle/chunks/fold-LDSORVYE.js +1 -0
  416. package/dist/bundle/chunks/grep-BPEMMINR.js +1 -0
  417. package/dist/bundle/chunks/gzip-UTSGNF5Z.js +1 -0
  418. package/dist/bundle/chunks/head-HT2B6D2J.js +1 -0
  419. package/dist/bundle/chunks/help-T2NGLTSG.js +1 -0
  420. package/dist/bundle/chunks/history-J4QRNGRO.js +1 -0
  421. package/dist/bundle/chunks/hostname-BK6HG2DE.js +1 -0
  422. package/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +1 -0
  423. package/dist/bundle/chunks/join-GG2LDHE5.js +1 -0
  424. package/dist/bundle/chunks/jq-HA6MN2H5.js +1 -0
  425. package/dist/bundle/chunks/ln-YAIFIHCT.js +1 -0
  426. package/dist/bundle/chunks/ls-OTONBH2E.js +1 -0
  427. package/dist/bundle/chunks/md5sum-INMIK4DX.js +1 -0
  428. package/dist/bundle/chunks/mkdir-QWGXDWUS.js +1 -0
  429. package/dist/bundle/chunks/mv-Z6MORUFL.js +1 -0
  430. package/dist/bundle/chunks/nl-U5YJDM32.js +1 -0
  431. package/dist/bundle/chunks/od-VJEF2UR5.js +1 -0
  432. package/dist/bundle/chunks/paste-7N6AFSDS.js +1 -0
  433. package/dist/bundle/chunks/printf-KGN6BDCY.js +1 -0
  434. package/dist/bundle/chunks/pwd-D4OZ7N27.js +1 -0
  435. package/dist/bundle/chunks/readlink-IEQO24KU.js +1 -0
  436. package/dist/bundle/chunks/rev-XOSYPP45.js +1 -0
  437. package/dist/bundle/chunks/rg-ORQK4GVH.js +1 -0
  438. package/dist/bundle/chunks/rm-KPTLPKPH.js +1 -0
  439. package/dist/bundle/chunks/rmdir-XTQXT7RK.js +1 -0
  440. package/dist/bundle/chunks/sed-MUVA7R2C.js +1 -0
  441. package/dist/bundle/chunks/seq-RN5ZUASB.js +1 -0
  442. package/dist/bundle/chunks/sha1sum-VJPNLNU6.js +1 -0
  443. package/dist/bundle/chunks/sha256sum-PI32XWXY.js +1 -0
  444. package/dist/bundle/chunks/sleep-JHK4I472.js +1 -0
  445. package/dist/bundle/chunks/sort-T7TNLWXL.js +1 -0
  446. package/dist/bundle/chunks/split-EZOC5IIZ.js +1 -0
  447. package/dist/bundle/chunks/sqlite3-Z2IGWYCE.js +1 -0
  448. package/dist/bundle/chunks/stat-74KBZFAX.js +1 -0
  449. package/dist/bundle/chunks/strings-7PLOGTPD.js +1 -0
  450. package/dist/bundle/chunks/tac-T7YAU2Y6.js +1 -0
  451. package/dist/bundle/chunks/tail-S5ULNTJU.js +1 -0
  452. package/dist/bundle/chunks/tar-K7K7BL55.js +1 -0
  453. package/dist/bundle/chunks/tee-O7VXZDCO.js +1 -0
  454. package/dist/bundle/chunks/time-BPT76IHZ.js +1 -0
  455. package/dist/bundle/chunks/timeout-5UJUQXOE.js +1 -0
  456. package/dist/bundle/chunks/touch-DX2IJOQ4.js +1 -0
  457. package/dist/bundle/chunks/tr-RYO2EDCA.js +1 -0
  458. package/dist/bundle/chunks/tree-LYXBS7DC.js +1 -0
  459. package/dist/bundle/chunks/true-WHJNXCHG.js +1 -0
  460. package/dist/bundle/chunks/unexpand-RGTMIGZM.js +1 -0
  461. package/dist/bundle/chunks/uniq-ZXE4O5XB.js +1 -0
  462. package/dist/bundle/chunks/wc-TQB3VNOX.js +1 -0
  463. package/dist/bundle/chunks/which-NCIYTMAT.js +1 -0
  464. package/dist/bundle/chunks/whoami-DGKU3D2X.js +1 -0
  465. package/dist/bundle/chunks/xan-6DLWA2BW.js +1 -0
  466. package/dist/bundle/chunks/xargs-OGI2NN6J.js +1 -0
  467. package/dist/bundle/chunks/yq-LO2NVDTD.js +1 -0
  468. package/dist/bundle/index.js +157 -155
  469. package/dist/commands/alias/alias.d.ts +3 -0
  470. package/dist/commands/awk/awk2.d.ts +2 -0
  471. package/dist/commands/awk/interpreter/context.d.ts +5 -0
  472. package/dist/commands/base64/base64.d.ts +2 -0
  473. package/dist/commands/basename/basename.d.ts +2 -0
  474. package/dist/commands/bash/bash.d.ts +3 -0
  475. package/dist/commands/cat/cat.d.ts +2 -0
  476. package/dist/commands/chmod/chmod.d.ts +2 -0
  477. package/dist/commands/clear/clear.d.ts +2 -0
  478. package/dist/commands/column/column.d.ts +2 -0
  479. package/dist/commands/comm/comm.d.ts +2 -0
  480. package/dist/commands/cp/cp.d.ts +2 -0
  481. package/dist/commands/cut/cut.d.ts +2 -0
  482. package/dist/commands/date/date.d.ts +2 -0
  483. package/dist/commands/diff/diff.d.ts +2 -0
  484. package/dist/commands/dirname/dirname.d.ts +2 -0
  485. package/dist/commands/du/du.d.ts +2 -0
  486. package/dist/commands/echo/echo.d.ts +2 -0
  487. package/dist/commands/env/env.d.ts +3 -0
  488. package/dist/commands/expand/expand.d.ts +2 -0
  489. package/dist/commands/expand/unexpand.d.ts +2 -0
  490. package/dist/commands/expr/expr.d.ts +2 -0
  491. package/dist/commands/file/file.d.ts +2 -0
  492. package/dist/commands/find/find.d.ts +2 -0
  493. package/dist/commands/flag-coverage.d.ts +2 -0
  494. package/dist/commands/fold/fold.d.ts +2 -0
  495. package/dist/commands/fuzz-flags-types.d.ts +17 -0
  496. package/dist/commands/fuzz-flags.d.ts +8 -0
  497. package/dist/commands/grep/grep.d.ts +4 -0
  498. package/dist/commands/gzip/gzip.d.ts +4 -0
  499. package/dist/commands/head/head.d.ts +2 -0
  500. package/dist/commands/help/help.d.ts +2 -0
  501. package/dist/commands/history/history.d.ts +2 -0
  502. package/dist/commands/hostname/hostname.d.ts +2 -0
  503. package/dist/commands/html-to-markdown/html-to-markdown.d.ts +2 -0
  504. package/dist/commands/join/join.d.ts +2 -0
  505. package/dist/commands/jq/jq.d.ts +2 -0
  506. package/dist/commands/ln/ln.d.ts +2 -0
  507. package/dist/commands/ls/ls.d.ts +2 -0
  508. package/dist/commands/md5sum/md5sum.d.ts +2 -0
  509. package/dist/commands/md5sum/sha1sum.d.ts +2 -0
  510. package/dist/commands/md5sum/sha256sum.d.ts +2 -0
  511. package/dist/commands/mkdir/mkdir.d.ts +2 -0
  512. package/dist/commands/mv/mv.d.ts +2 -0
  513. package/dist/commands/nl/nl.d.ts +2 -0
  514. package/dist/commands/od/od.d.ts +2 -0
  515. package/dist/commands/paste/paste.d.ts +2 -0
  516. package/dist/commands/printf/printf.d.ts +2 -0
  517. package/dist/commands/pwd/pwd.d.ts +2 -0
  518. package/dist/commands/query-engine/evaluator.d.ts +4 -0
  519. package/dist/commands/readlink/readlink.d.ts +2 -0
  520. package/dist/commands/rev/rev.d.ts +2 -0
  521. package/dist/commands/rg/rg.d.ts +2 -0
  522. package/dist/commands/rm/rm.d.ts +2 -0
  523. package/dist/commands/rmdir/rmdir.d.ts +2 -0
  524. package/dist/commands/sed/sed.d.ts +2 -0
  525. package/dist/commands/sed/types.d.ts +2 -0
  526. package/dist/commands/seq/seq.d.ts +2 -0
  527. package/dist/commands/sleep/sleep.d.ts +2 -0
  528. package/dist/commands/sort/sort.d.ts +2 -0
  529. package/dist/commands/split/split.d.ts +2 -0
  530. package/dist/commands/sqlite3/sqlite3.d.ts +2 -0
  531. package/dist/commands/stat/stat.d.ts +2 -0
  532. package/dist/commands/strings/strings.d.ts +2 -0
  533. package/dist/commands/tac/tac.d.ts +2 -0
  534. package/dist/commands/tail/tail.d.ts +2 -0
  535. package/dist/commands/tar/tar.d.ts +2 -0
  536. package/dist/commands/tee/tee.d.ts +2 -0
  537. package/dist/commands/time/time.d.ts +2 -0
  538. package/dist/commands/timeout/timeout.d.ts +2 -0
  539. package/dist/commands/touch/touch.d.ts +2 -0
  540. package/dist/commands/tr/tr.d.ts +2 -0
  541. package/dist/commands/tree/tree.d.ts +2 -0
  542. package/dist/commands/true/true.d.ts +3 -0
  543. package/dist/commands/uniq/uniq.d.ts +2 -0
  544. package/dist/commands/wc/wc.d.ts +2 -0
  545. package/dist/commands/which/which.d.ts +2 -0
  546. package/dist/commands/whoami/whoami.d.ts +2 -0
  547. package/dist/commands/xan/xan.d.ts +2 -0
  548. package/dist/commands/xargs/xargs.d.ts +2 -0
  549. package/dist/commands/yq/yq.d.ts +2 -0
  550. package/dist/fs/overlay-fs/overlay-fs.d.ts +7 -0
  551. package/dist/fs/read-write-fs/read-write-fs.d.ts +7 -0
  552. package/dist/interpreter/interpreter.d.ts +3 -1
  553. package/dist/interpreter/types.d.ts +3 -1
  554. package/dist/network/types.d.ts +11 -0
  555. package/dist/types.d.ts +12 -0
  556. package/package.json +1 -1
  557. package/dist/bin/chunks/alias-MGDOL4KG.js +0 -7
  558. package/dist/bin/chunks/awk2-OKD2P6CM.js +0 -21
  559. package/dist/bin/chunks/base64-43KPK6TL.js +0 -6
  560. package/dist/bin/chunks/basename-SO5MVUEX.js +0 -6
  561. package/dist/bin/chunks/bash-OAUBNRSG.js +0 -6
  562. package/dist/bin/chunks/cat-HNXE2ES2.js +0 -6
  563. package/dist/bin/chunks/chmod-TYLTHXFR.js +0 -9
  564. package/dist/bin/chunks/clear-CI7A5IXQ.js +0 -2
  565. package/dist/bin/chunks/column-HQ4AK5DM.js +0 -8
  566. package/dist/bin/chunks/comm-CPIFQTKY.js +0 -13
  567. package/dist/bin/chunks/cp-VFXCUKXO.js +0 -8
  568. package/dist/bin/chunks/cut-IHF6BEOO.js +0 -6
  569. package/dist/bin/chunks/date-IQLPMFYI.js +0 -5
  570. package/dist/bin/chunks/diff-ZGXLP3DN.js +0 -19
  571. package/dist/bin/chunks/dirname-EES7TR26.js +0 -5
  572. package/dist/bin/chunks/du-PECPOFQT.js +0 -8
  573. package/dist/bin/chunks/echo-7I42V66Q.js +0 -4
  574. package/dist/bin/chunks/env-W6IMQ43Y.js +0 -9
  575. package/dist/bin/chunks/expand-77K5HH2M.js +0 -11
  576. package/dist/bin/chunks/expr-433HIVAI.js +0 -5
  577. package/dist/bin/chunks/find-KHOYETRP.js +0 -11
  578. package/dist/bin/chunks/fold-452R4I2C.js +0 -12
  579. package/dist/bin/chunks/grep-BD56656Z.js +0 -9
  580. package/dist/bin/chunks/gzip-5ILPB46W.js +0 -32
  581. package/dist/bin/chunks/head-TJHLLIMR.js +0 -2
  582. package/dist/bin/chunks/help-L43ENI4H.js +0 -16
  583. package/dist/bin/chunks/history-56DL6SXU.js +0 -3
  584. package/dist/bin/chunks/hostname-WXDKRL2Z.js +0 -3
  585. package/dist/bin/chunks/join-3IXMEGNA.js +0 -14
  586. package/dist/bin/chunks/jq-EIPK4SZA.js +0 -13
  587. package/dist/bin/chunks/ln-EFFNQ3RY.js +0 -10
  588. package/dist/bin/chunks/ls-5LN47VHU.js +0 -26
  589. package/dist/bin/chunks/md5sum-VHPDBIVV.js +0 -2
  590. package/dist/bin/chunks/mkdir-XMSNS6S5.js +0 -7
  591. package/dist/bin/chunks/mv-P4KHB27X.js +0 -7
  592. package/dist/bin/chunks/od-KRKGC2U3.js +0 -5
  593. package/dist/bin/chunks/paste-UCH462KK.js +0 -8
  594. package/dist/bin/chunks/printf-4W7NDLLV.js +0 -15
  595. package/dist/bin/chunks/pwd-L26WH2K4.js +0 -3
  596. package/dist/bin/chunks/readlink-VL3R4LAM.js +0 -7
  597. package/dist/bin/chunks/rev-VP42N2JN.js +0 -7
  598. package/dist/bin/chunks/rm-S7ASVG34.js +0 -8
  599. package/dist/bin/chunks/seq-AVK43XM2.js +0 -7
  600. package/dist/bin/chunks/sha1sum-4SVNPPXZ.js +0 -2
  601. package/dist/bin/chunks/sha256sum-BM3AFTIE.js +0 -2
  602. package/dist/bin/chunks/sort-QF3YLXRW.js +0 -16
  603. package/dist/bin/chunks/split-7UP7EATZ.js +0 -16
  604. package/dist/bin/chunks/stat-ZZVPXHLF.js +0 -9
  605. package/dist/bin/chunks/strings-ZEKN6D4Q.js +0 -14
  606. package/dist/bin/chunks/tac-KNRFDAY7.js +0 -9
  607. package/dist/bin/chunks/tail-YAUIERGN.js +0 -2
  608. package/dist/bin/chunks/tee-XSKPK43X.js +0 -3
  609. package/dist/bin/chunks/timeout-JED4EKFH.js +0 -12
  610. package/dist/bin/chunks/touch-IBPHJBM3.js +0 -7
  611. package/dist/bin/chunks/tree-WC3AXFHC.js +0 -12
  612. package/dist/bin/chunks/true-OVATH2SQ.js +0 -2
  613. package/dist/bin/chunks/unexpand-BFVYAPOU.js +0 -11
  614. package/dist/bin/chunks/uniq-NNXAFO6D.js +0 -5
  615. package/dist/bin/chunks/wc-CZ2TD6T6.js +0 -6
  616. package/dist/bin/chunks/which-5QEJAXNR.js +0 -3
  617. package/dist/bin/chunks/whoami-JVLUNKSG.js +0 -3
  618. package/dist/bin/chunks/xargs-IWT2HHEA.js +0 -5
  619. package/dist/bin/shell/chunks/alias-MGDOL4KG.js +0 -7
  620. package/dist/bin/shell/chunks/awk2-OKD2P6CM.js +0 -21
  621. package/dist/bin/shell/chunks/base64-43KPK6TL.js +0 -6
  622. package/dist/bin/shell/chunks/basename-SO5MVUEX.js +0 -6
  623. package/dist/bin/shell/chunks/bash-OAUBNRSG.js +0 -6
  624. package/dist/bin/shell/chunks/cat-HNXE2ES2.js +0 -6
  625. package/dist/bin/shell/chunks/chmod-TYLTHXFR.js +0 -9
  626. package/dist/bin/shell/chunks/clear-CI7A5IXQ.js +0 -2
  627. package/dist/bin/shell/chunks/column-HQ4AK5DM.js +0 -8
  628. package/dist/bin/shell/chunks/comm-CPIFQTKY.js +0 -13
  629. package/dist/bin/shell/chunks/cp-VFXCUKXO.js +0 -8
  630. package/dist/bin/shell/chunks/cut-IHF6BEOO.js +0 -6
  631. package/dist/bin/shell/chunks/date-IQLPMFYI.js +0 -5
  632. package/dist/bin/shell/chunks/diff-ZGXLP3DN.js +0 -19
  633. package/dist/bin/shell/chunks/dirname-EES7TR26.js +0 -5
  634. package/dist/bin/shell/chunks/du-PECPOFQT.js +0 -8
  635. package/dist/bin/shell/chunks/echo-7I42V66Q.js +0 -4
  636. package/dist/bin/shell/chunks/env-W6IMQ43Y.js +0 -9
  637. package/dist/bin/shell/chunks/expand-77K5HH2M.js +0 -11
  638. package/dist/bin/shell/chunks/expr-433HIVAI.js +0 -5
  639. package/dist/bin/shell/chunks/find-KHOYETRP.js +0 -11
  640. package/dist/bin/shell/chunks/fold-452R4I2C.js +0 -12
  641. package/dist/bin/shell/chunks/grep-BD56656Z.js +0 -9
  642. package/dist/bin/shell/chunks/gzip-5ILPB46W.js +0 -32
  643. package/dist/bin/shell/chunks/head-TJHLLIMR.js +0 -2
  644. package/dist/bin/shell/chunks/help-L43ENI4H.js +0 -16
  645. package/dist/bin/shell/chunks/history-56DL6SXU.js +0 -3
  646. package/dist/bin/shell/chunks/hostname-WXDKRL2Z.js +0 -3
  647. package/dist/bin/shell/chunks/join-3IXMEGNA.js +0 -14
  648. package/dist/bin/shell/chunks/jq-EIPK4SZA.js +0 -13
  649. package/dist/bin/shell/chunks/ln-EFFNQ3RY.js +0 -10
  650. package/dist/bin/shell/chunks/ls-5LN47VHU.js +0 -26
  651. package/dist/bin/shell/chunks/md5sum-VHPDBIVV.js +0 -2
  652. package/dist/bin/shell/chunks/mkdir-XMSNS6S5.js +0 -7
  653. package/dist/bin/shell/chunks/mv-P4KHB27X.js +0 -7
  654. package/dist/bin/shell/chunks/od-KRKGC2U3.js +0 -5
  655. package/dist/bin/shell/chunks/paste-UCH462KK.js +0 -8
  656. package/dist/bin/shell/chunks/printf-4W7NDLLV.js +0 -15
  657. package/dist/bin/shell/chunks/pwd-L26WH2K4.js +0 -3
  658. package/dist/bin/shell/chunks/readlink-VL3R4LAM.js +0 -7
  659. package/dist/bin/shell/chunks/rev-VP42N2JN.js +0 -7
  660. package/dist/bin/shell/chunks/rm-S7ASVG34.js +0 -8
  661. package/dist/bin/shell/chunks/seq-AVK43XM2.js +0 -7
  662. package/dist/bin/shell/chunks/sha1sum-4SVNPPXZ.js +0 -2
  663. package/dist/bin/shell/chunks/sha256sum-BM3AFTIE.js +0 -2
  664. package/dist/bin/shell/chunks/sort-QF3YLXRW.js +0 -16
  665. package/dist/bin/shell/chunks/split-7UP7EATZ.js +0 -16
  666. package/dist/bin/shell/chunks/stat-ZZVPXHLF.js +0 -9
  667. package/dist/bin/shell/chunks/strings-ZEKN6D4Q.js +0 -14
  668. package/dist/bin/shell/chunks/tac-KNRFDAY7.js +0 -9
  669. package/dist/bin/shell/chunks/tail-YAUIERGN.js +0 -2
  670. package/dist/bin/shell/chunks/tee-XSKPK43X.js +0 -3
  671. package/dist/bin/shell/chunks/timeout-JED4EKFH.js +0 -12
  672. package/dist/bin/shell/chunks/touch-IBPHJBM3.js +0 -7
  673. package/dist/bin/shell/chunks/tree-WC3AXFHC.js +0 -12
  674. package/dist/bin/shell/chunks/true-OVATH2SQ.js +0 -2
  675. package/dist/bin/shell/chunks/unexpand-BFVYAPOU.js +0 -11
  676. package/dist/bin/shell/chunks/uniq-NNXAFO6D.js +0 -5
  677. package/dist/bin/shell/chunks/wc-CZ2TD6T6.js +0 -6
  678. package/dist/bin/shell/chunks/which-5QEJAXNR.js +0 -3
  679. package/dist/bin/shell/chunks/whoami-JVLUNKSG.js +0 -3
  680. package/dist/bin/shell/chunks/xargs-IWT2HHEA.js +0 -5
  681. package/dist/bundle/chunks/alias-YGOORMWI.js +0 -6
  682. package/dist/bundle/chunks/awk2-YNEKUV4T.js +0 -20
  683. package/dist/bundle/chunks/base64-2JFR3HGT.js +0 -5
  684. package/dist/bundle/chunks/basename-CFA5ZIGT.js +0 -5
  685. package/dist/bundle/chunks/bash-BYWM5OPC.js +0 -5
  686. package/dist/bundle/chunks/cat-GPKR7D6K.js +0 -5
  687. package/dist/bundle/chunks/chmod-ODWUR7E6.js +0 -8
  688. package/dist/bundle/chunks/clear-VT2LJIDX.js +0 -1
  689. package/dist/bundle/chunks/column-R6OLMEUA.js +0 -7
  690. package/dist/bundle/chunks/comm-AXQM7FFF.js +0 -12
  691. package/dist/bundle/chunks/cp-NJSENVKC.js +0 -7
  692. package/dist/bundle/chunks/cut-NVKWEAZF.js +0 -5
  693. package/dist/bundle/chunks/date-PN3CMG7K.js +0 -4
  694. package/dist/bundle/chunks/diff-ELUS3RW7.js +0 -6
  695. package/dist/bundle/chunks/dirname-YPJLCQYA.js +0 -4
  696. package/dist/bundle/chunks/du-T4JUAAB2.js +0 -7
  697. package/dist/bundle/chunks/echo-6S7WE7XB.js +0 -3
  698. package/dist/bundle/chunks/env-M3AXY56V.js +0 -8
  699. package/dist/bundle/chunks/expand-VSTNOVF5.js +0 -10
  700. package/dist/bundle/chunks/expr-YSFDPKPV.js +0 -4
  701. package/dist/bundle/chunks/find-WTVSUXL3.js +0 -10
  702. package/dist/bundle/chunks/fold-6CFXIPYZ.js +0 -11
  703. package/dist/bundle/chunks/grep-UTH3KDWL.js +0 -8
  704. package/dist/bundle/chunks/gzip-4P4KGYT5.js +0 -31
  705. package/dist/bundle/chunks/head-SA7P5NJ7.js +0 -1
  706. package/dist/bundle/chunks/help-UD3E73G5.js +0 -15
  707. package/dist/bundle/chunks/history-TMBGOQO6.js +0 -2
  708. package/dist/bundle/chunks/hostname-NWR32CGF.js +0 -2
  709. package/dist/bundle/chunks/html-to-markdown-ZK6GQVSL.js +0 -4
  710. package/dist/bundle/chunks/join-X3QYPZUA.js +0 -13
  711. package/dist/bundle/chunks/jq-6U2TPE6U.js +0 -12
  712. package/dist/bundle/chunks/ln-Y7YB677N.js +0 -9
  713. package/dist/bundle/chunks/ls-PUJHEPXS.js +0 -23
  714. package/dist/bundle/chunks/md5sum-TGZPGVOK.js +0 -1
  715. package/dist/bundle/chunks/mkdir-SF2UE4KB.js +0 -6
  716. package/dist/bundle/chunks/mv-JPBZPM4O.js +0 -6
  717. package/dist/bundle/chunks/od-3FPDPLWJ.js +0 -4
  718. package/dist/bundle/chunks/paste-QAP6Y75J.js +0 -7
  719. package/dist/bundle/chunks/pwd-S4NVAMC4.js +0 -2
  720. package/dist/bundle/chunks/readlink-EM4O3U4P.js +0 -6
  721. package/dist/bundle/chunks/rev-FKUV5GH5.js +0 -6
  722. package/dist/bundle/chunks/rm-MJFRIDNT.js +0 -7
  723. package/dist/bundle/chunks/seq-5VRIVQYP.js +0 -6
  724. package/dist/bundle/chunks/sha1sum-37LOTSQP.js +0 -1
  725. package/dist/bundle/chunks/sha256sum-I4J5BPZA.js +0 -1
  726. package/dist/bundle/chunks/sleep-AK4QE4WR.js +0 -9
  727. package/dist/bundle/chunks/sort-LT2PE47K.js +0 -15
  728. package/dist/bundle/chunks/split-LGSGJHV5.js +0 -15
  729. package/dist/bundle/chunks/stat-IOLJTP7U.js +0 -8
  730. package/dist/bundle/chunks/strings-LRU5XCFP.js +0 -13
  731. package/dist/bundle/chunks/tac-2X4JLF4W.js +0 -8
  732. package/dist/bundle/chunks/tail-52LRAWXT.js +0 -1
  733. package/dist/bundle/chunks/tee-4KHTWVWB.js +0 -2
  734. package/dist/bundle/chunks/timeout-X3X3N6IE.js +0 -11
  735. package/dist/bundle/chunks/touch-TDTEBHHI.js +0 -6
  736. package/dist/bundle/chunks/tree-UFVZH4SS.js +0 -11
  737. package/dist/bundle/chunks/true-CNJ54NE6.js +0 -1
  738. package/dist/bundle/chunks/unexpand-I7A2VXFD.js +0 -10
  739. package/dist/bundle/chunks/uniq-XBP4SJA3.js +0 -4
  740. package/dist/bundle/chunks/wc-VDPK3LVS.js +0 -5
  741. package/dist/bundle/chunks/which-GF77XMJD.js +0 -2
  742. package/dist/bundle/chunks/whoami-YUDAIS32.js +0 -2
  743. package/dist/bundle/chunks/xargs-4FRA6OJ7.js +0 -4
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as w}from"./chunk-5WFYIUU2.js";import"./chunk-OBH7XN5N.js";import{a as F,b as N,c as k}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var P=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),V=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=P.get(s)??1;return l*i}function L(u){let r=u.trim().toLowerCase().slice(0,3);return V.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 x(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=L(l),n=L(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,S)=>{let g=f,b=S;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=x(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(S);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},A=m.reverse??i,y=x(h,p,B);if(y!==0)return A?-y:y}if(!a){let m=f.localeCompare(S);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 C(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=C(a);f&&e.keys.push(f)}}else if(t.startsWith("-k")){let a=C(t.slice(2));a&&e.keys.push(a)}else if(t.startsWith("--key=")){let a=C(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),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0}}};export{j as sortCommand};
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as d,b as a,c as h}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var N={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, ..."]};function p(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 u=(l[2]||"").toUpperCase(),o=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return o===void 0?null:e*o}function k(s,l,e){if(l)return s.toString().padStart(e,"0");let u="abcdefghijklmnopqrstuvwxyz",t="",o=s;for(let r=0;r<e;r++)t=u[o%26]+t,o=Math.floor(o/26);return t}function y(s,l){let e=s.split(`
3
- `),u=s.endsWith(`
4
- `)&&e[e.length-1]==="";u&&e.pop();let t=[];for(let o=0;o<e.length;o+=l){let r=e.slice(o,o+l),c=o+l>=e.length&&!u?r.join(`
5
- `):`${r.join(`
6
- `)}
7
- `;t.push({content:c,hasContent:!0})}return t}function C(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[];for(let r=0;r<u.length;r+=l){let f=u.slice(r,r+l);o.push({content:t.decode(f),hasContent:f.length>0})}return o}function S(s,l){let u=new TextEncoder().encode(s),t=new TextDecoder,o=[],r=Math.ceil(u.length/l);for(let f=0;f<l;f++){let c=f*r,i=Math.min(c+r,u.length),n=u.slice(c,i);o.push({content:t.decode(n),hasContent:n.length>0})}return o}var $={name:"split",execute:async(s,l)=>{if(a(s))return d(N);let e={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],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=p(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=p(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==="--"){u.push(...s.slice(t+1));break}else{if(i.startsWith("-")&&i!=="-")return h("split",i);u.push(i),t++}}let o="-",r="x";u.length>=1&&(o=u[0]),u.length>=2&&(r=u[1]);let f;if(o==="-")f=l.stdin??"";else{let i=l.fs.resolvePath(l.cwd,o),n=await l.fs.readFile(i);if(n===null)return{exitCode:1,stdout:"",stderr:`split: ${o}: No such file or directory
16
- `};f=n}if(f==="")return{exitCode:0,stdout:"",stderr:""};let c;switch(e.mode){case"lines":c=y(f,e.lines);break;case"bytes":c=C(f,e.bytes);break;case"chunks":c=S(f,e.chunks);break;default:return e.mode}for(let i=0;i<c.length;i++){let n=c[i];if(!n.hasContent)continue;let m=k(i,e.useNumericSuffix,e.suffixLength),x=`${r}${m}${e.additionalSuffix}`,b=l.fs.resolvePath(l.cwd,x);await l.fs.writeFile(b,n.content)}return{exitCode:0,stdout:"",stderr:""}}};export{$ as split};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as d}from"./chunk-JBABAK44.js";import{a as u,b as g}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var S={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},$={format:{short:"c",type:"string"}},x={name:"stat",async execute(e,a){if(g(e))return u(S);let s=d("stat",e,$);if(!s.ok)return s.error;let n=s.result.flags.format??null,c=s.result.positional;if(c.length===0)return{stdout:"",stderr:`stat: missing operand
3
- `,exitCode:1};let o="",p="",f=!1;for(let i of c){let h=a.fs.resolvePath(a.cwd,i);try{let r=await a.fs.stat(h);if(n){let t=n,l=r.mode.toString(8),y=m(r.mode,r.isDirectory);t=t.replace(/%n/g,i),t=t.replace(/%N/g,`'${i}'`),t=t.replace(/%s/g,String(r.size)),t=t.replace(/%F/g,r.isDirectory?"directory":"regular file"),t=t.replace(/%a/g,l),t=t.replace(/%A/g,y),t=t.replace(/%u/g,"1000"),t=t.replace(/%U/g,"user"),t=t.replace(/%g/g,"1000"),t=t.replace(/%G/g,"group"),o+=`${t}
4
- `}else{let t=r.mode.toString(8).padStart(4,"0"),l=m(r.mode,r.isDirectory);o+=` File: ${i}
5
- `,o+=` Size: ${r.size} Blocks: ${Math.ceil(r.size/512)}
6
- `,o+=`Access: (${t}/${l})
7
- `,o+=`Modify: ${r.mtime.toISOString()}
8
- `}}catch{p+=`stat: cannot stat '${i}': No such file or directory
9
- `,f=!0}}return{stdout:o,stderr:p,exitCode:f?1:0}}};function m(e,a){let s=a?"d":"-",n=[e&256?"r":"-",e&128?"w":"-",e&64?"x":"-",e&32?"r":"-",e&16?"w":"-",e&8?"x":"-",e&4?"r":"-",e&2?"w":"-",e&1?"x":"-"];return s+n.join("")}export{x as statCommand};
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as c,b as f,c as d}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var m={name:"strings",summary:"print the sequences of printable characters in files",usage:"strings [OPTION]... [FILE]...",description:"For each FILE, print the printable character sequences that are at least MIN characters long. If no FILE is specified, standard input is read.",options:["-n MIN Print sequences of at least MIN characters (default: 4)","-t FORMAT Print offset before each string (o=octal, x=hex, d=decimal)","-a Scan the entire file (default behavior)","-e ENCODING Select character encoding (s=7-bit, S=8-bit)"],examples:["strings file.bin # Extract strings (min 4 chars)","strings -n 8 file.bin # Extract strings (min 8 chars)","strings -t x file.bin # Show hex offset","echo 'hello' | strings # Read from stdin"]};function p(n){return n>=32&&n<=126||n===9}function u(n,s){if(s===null)return"";switch(s){case"o":return`${n.toString(8).padStart(7," ")} `;case"x":return`${n.toString(16).padStart(7," ")} `;case"d":return`${n.toString(10).padStart(7," ")} `;default:return s}}function h(n,s){let o=[],r="",i=0,l=typeof n=="string"?new TextEncoder().encode(n):n;for(let e=0;e<l.length;e++){let t=l[e];if(p(t))r.length===0&&(i=e),r+=String.fromCharCode(t);else{if(r.length>=s.minLength){let a=u(i,s.offsetFormat);o.push(`${a}${r}`)}r=""}}if(r.length>=s.minLength){let e=u(i,s.offsetFormat);o.push(`${e}${r}`)}return o}var N={name:"strings",execute:async(n,s)=>{if(f(n))return c(m);let o={minLength:4,offsetFormat:null},r=[],i=0;for(;i<n.length;){let e=n[i];if(e==="-n"&&i+1<n.length){let t=Number.parseInt(n[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${n[i+1]}'
3
- `};o.minLength=t,i+=2}else if(e.match(/^-n\d+$/)){let t=Number.parseInt(e.slice(2),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${e.slice(2)}'
4
- `};o.minLength=t,i++}else if(e.match(/^-\d+$/)){let t=Number.parseInt(e.slice(1),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`strings: invalid minimum string length: '${e.slice(1)}'
5
- `};o.minLength=t,i++}else if(e==="-t"&&i+1<n.length){let t=n[i+1];if(t!=="o"&&t!=="x"&&t!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${t}'
6
- `};o.offsetFormat=t,i+=2}else if(e.startsWith("-t")&&e.length===3){let t=e[2];if(t!=="o"&&t!=="x"&&t!=="d")return{exitCode:1,stdout:"",stderr:`strings: invalid radix: '${t}'
7
- `};o.offsetFormat=t,i++}else if(e==="-a"||e==="--all"||e==="-")e==="-"&&r.push(e),i++;else if(e==="-e"&&i+1<n.length){let t=n[i+1];if(t!=="s"&&t!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${t}'
8
- `};i+=2}else if(e.startsWith("-e")&&e.length===3){let t=e[2];if(t!=="s"&&t!=="S")return{exitCode:1,stdout:"",stderr:`strings: invalid encoding: '${t}'
9
- `};i++}else if(e==="--"){r.push(...n.slice(i+1));break}else{if(e.startsWith("-")&&e!=="-")return d("strings",e);r.push(e),i++}}let l="";if(r.length===0){let e=s.stdin??"",t=h(e,o);l=t.length>0?`${t.join(`
10
- `)}
11
- `:""}else for(let e of r){let t;if(e==="-")t=s.stdin??"";else{let g=s.fs.resolvePath(s.cwd,e);if(t=await s.fs.readFile(g),t===null)return{exitCode:1,stdout:l,stderr:`strings: ${e}: No such file or directory
12
- `}}let a=h(t,o);a.length>0&&(l+=`${a.join(`
13
- `)}
14
- `)}return{exitCode:0,stdout:l,stderr:""}}};export{N as strings};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./chunk-KGOUQS5A.js";async function i(t,o){if(t.length>0&&t[0]!=="-"){let c=t[0].startsWith("/")?t[0]:`${o.cwd}/${t[0]}`;try{let n=(await o.fs.readFile(c)).split(`
3
- `);n[n.length-1]===""&&n.pop();let s=n.reverse();return{stdout:s.length>0?`${s.join(`
4
- `)}
5
- `:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${t[0]}: No such file or directory
6
- `,exitCode:1}}}let e=o.stdin.split(`
7
- `);e[e.length-1]===""&&e.pop();let r=e.reverse();return{stdout:r.length>0?`${r.join(`
8
- `)}
9
- `:"",stderr:"",exitCode:0}}var l={name:"tac",execute:i};export{l as tac};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a,b as n,d as l}from"./chunk-FSZWFMB4.js";import{a as i,b as s}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var h={name:"tail",summary:"output the last part of files",usage:"tail [OPTION]... [FILE]...",options:["-c, --bytes=NUM print the last NUM bytes","-n, --lines=NUM print the last NUM lines (default 10)","-n +NUM print starting from line NUM","-q, --quiet never print headers giving file names","-v, --verbose always print headers giving file names"," --help display this help and exit"]},c={name:"tail",async execute(t,r){if(s(t))return i(h);let e=a(t,"tail");if(!e.ok)return e.error;let{lines:o,bytes:p,fromLine:m}=e.options;return n(r,e.options,"tail",f=>l(f,o,p,m??!1))}};export{c as tailCommand};
@@ -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";import"./chunk-KGOUQS5A.js";var h={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"}},g={name:"tee",async execute(r,e){if(l(r))return p(h);let t=d("tee",r,m);if(!t.ok)return t.error;let{append:f}=t.result.flags,c=t.result.positional,o=e.stdin,n="",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{n+=`tee: ${i}: No such file or directory
3
- `,a=1}return{stdout:o,stderr:n,exitCode:a}}};export{g as teeCommand};
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as c,b as f,c as u}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var x={name:"timeout",summary:"run a command with a time limit",usage:"timeout [OPTION] DURATION COMMAND [ARG]...",description:`Start COMMAND, and kill it if still running after DURATION.
3
-
4
- DURATION is a number with optional suffix:
5
- s - seconds (default)
6
- m - minutes
7
- h - hours
8
- d - days`,options:["-k, --kill-after=DURATION send KILL signal after DURATION if still running","-s, --signal=SIGNAL specify signal to send (default: TERM)"," --preserve-status exit with same status as COMMAND, even on timeout"," --foreground run command in foreground"," --help display this help and exit"]};function O(r){let i=r.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!i)return null;let n=parseFloat(i[1]);switch(i[2]||"s"){case"s":return n*1e3;case"m":return n*60*1e3;case"h":return n*60*60*1e3;case"d":return n*24*60*60*1e3;default:return null}}var w={name:"timeout",async execute(r,i){if(f(r))return c(x);let n=!1,s=0;for(let t=0;t<r.length;t++){let e=r[t];if(e==="--preserve-status")n=!0,s=t+1;else if(e==="--foreground")s=t+1;else if(e==="-k"||e==="--kill-after")t++,s=t+1;else if(e.startsWith("--kill-after="))s=t+1;else if(e==="-s"||e==="--signal")t++,s=t+1;else if(e.startsWith("--signal="))s=t+1;else{if(e.startsWith("--")&&e!=="--")return u("timeout",e);if(e.startsWith("-")&&e.length>1&&e!=="--")if(e.startsWith("-k"))s=t+1;else if(e.startsWith("-s"))s=t+1;else return u("timeout",e);else{s=t;break}}}let o=r.slice(s);if(o.length===0)return{stdout:"",stderr:`timeout: missing operand
9
- `,exitCode:1};let a=o[0],l=O(a);if(l===null)return{stdout:"",stderr:`timeout: invalid time interval '${a}'
10
- `,exitCode:1};let m=o.slice(1);if(m.length===0)return{stdout:"",stderr:`timeout: missing operand
11
- `,exitCode:1};if(!i.exec)return{stdout:"",stderr:`timeout: exec not available
12
- `,exitCode:1};let h=m.map(t=>t.includes(" ")||t.includes(" ")?`'${t.replace(/'/g,"'\\''")}'`:t).join(" "),p=new Promise(t=>{setTimeout(()=>t({timedOut:!0}),l)}),g=i.exec(h,{cwd:i.cwd}).then(t=>({timedOut:!1,result:t})),d=await Promise.race([p,g]);return d.timedOut?{stdout:"",stderr:"",exitCode:124}:d.result}};export{w as timeoutCommand};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as m}from"./chunk-4VDEBYW7.js";import{c}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";function h(s){let i=s.replace(/\//g,"-"),r=new Date(i);if(!Number.isNaN(r.getTime()))return r;let a=i.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(a){let[,o,l,d]=a;if(r=new Date(Number.parseInt(o,10),Number.parseInt(l,10)-1,Number.parseInt(d,10)),!Number.isNaN(r.getTime()))return r}let u=i.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(u){let[,o,l,d,t,e,f]=u;if(r=new Date(Number.parseInt(o,10),Number.parseInt(l,10)-1,Number.parseInt(d,10),Number.parseInt(t,10),Number.parseInt(e,10),Number.parseInt(f,10)),!Number.isNaN(r.getTime()))return r}return null}var b={name:"touch",async execute(s,i){let r=[],a=null,u=!1;for(let t=0;t<s.length;t++){let e=s[t];if(e==="--"){r.push(...s.slice(t+1));break}else if(e==="-d"||e==="--date"){if(t+1>=s.length)return{stdout:"",stderr:`touch: option requires an argument -- 'd'
3
- `,exitCode:1};a=s[++t]}else if(e.startsWith("--date="))a=e.slice(7);else if(e==="-c"||e==="--no-create")u=!0;else if(e==="-a"||e==="-m"||e==="-r"||e==="-t")(e==="-r"||e==="-t")&&t++;else{if(e.startsWith("--"))return c("touch",e);if(e.startsWith("-")&&e.length>1){let f=!1;for(let n of e.slice(1))if(n==="c")u=!0;else if(!(n==="a"||n==="m"))if(n==="d"){if(t+1>=s.length)return{stdout:"",stderr:`touch: option requires an argument -- 'd'
4
- `,exitCode:1};a=s[++t],f=!0;break}else if(n==="r"||n==="t"){t++,f=!0;break}else return c("touch",`-${n}`);if(f)continue}else r.push(e)}}if(r.length===0)return{stdout:"",stderr:`touch: missing file operand
5
- `,exitCode:1};let o=null;if(a!==null&&(o=h(a),o===null))return{stdout:"",stderr:`touch: invalid date format '${a}'
6
- `,exitCode:1};let l="",d=0;for(let t of r)try{let e=i.fs.resolvePath(i.cwd,t);if(!await i.fs.exists(e)){if(u)continue;await i.fs.writeFile(e,"")}let n=o??new Date;await i.fs.utimes(e,n,n)}catch(e){l+=`touch: cannot touch '${t}': ${m(e)}
7
- `,d=1}return{stdout:"",stderr:l,exitCode:d}}};export{b as touchCommand};
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./chunk-OBH7XN5N.js";import{a as w}from"./chunk-JBABAK44.js";import{a as D,b as $}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var g={name:"tree",summary:"list contents of directories in a tree-like format",usage:"tree [OPTION]... [DIRECTORY]...",options:["-a include hidden files","-d list directories only","-L LEVEL limit depth of directory tree","-f print full path prefix for each file"," --help display this help and exit"]},T={showHidden:{short:"a",type:"boolean"},directoriesOnly:{short:"d",type:"boolean"},fullPath:{short:"f",type:"boolean"},maxDepth:{short:"L",type:"number"}},E={name:"tree",async execute(i,o){if($(i))return D(g);let s=w("tree",i,T);if(!s.ok)return s.error;let f={showHidden:s.result.flags.showHidden,directoriesOnly:s.result.flags.directoriesOnly,maxDepth:s.result.flags.maxDepth??null,fullPath:s.result.flags.fullPath},d=s.result.positional;d.length===0&&d.push(".");let t="",l="",a=0,n=0;for(let e of d){let r=await b(o,e,f,"",0);t+=r.output,l+=r.stderr,a+=r.dirCount,n+=r.fileCount}return t+=`
3
- ${a} director${a===1?"y":"ies"}`,f.directoriesOnly||(t+=`, ${n} file${n===1?"":"s"}`),t+=`
4
- `,{stdout:t,stderr:l,exitCode:l?1:0}}};async function b(i,o,s,f,d){let t={output:"",stderr:"",dirCount:0,fileCount:0},l=i.fs.resolvePath(i.cwd,o);try{if(!(await i.fs.stat(l)).isDirectory)return t.output=`${o}
5
- `,t.fileCount=1,t}catch{return t.stderr=`tree: ${o}: No such file or directory
6
- `,t}if(t.output=`${o}
7
- `,s.maxDepth!==null&&d>=s.maxDepth)return t;try{let a=[];if(i.fs.readdirWithFileTypes)a=(await i.fs.readdirWithFileTypes(l)).map(r=>({name:r.name,isDirectory:r.isDirectory}));else{let e=await i.fs.readdir(l);for(let r=0;r<e.length;r+=100){let h=e.slice(r,r+100),u=await Promise.all(h.map(async c=>{let m=l==="/"?`/${c}`:`${l}/${c}`;try{let y=await i.fs.stat(m);return{name:c,isDirectory:y.isDirectory}}catch{return null}}));a.push(...u.filter(c=>c!==null))}}let n=a.filter(e=>!(!s.showHidden&&e.name.startsWith(".")||s.directoriesOnly&&!e.isDirectory));n.sort((e,r)=>e.name.localeCompare(r.name));for(let e=0;e<n.length;e++){let r=n[e],h=l==="/"?`/${r.name}`:`${l}/${r.name}`,u=e===n.length-1,c=u?"`-- ":"|-- ",m=f+(u?" ":"| ");if(r.isDirectory){t.dirCount++;let y=s.fullPath?h:r.name;if(t.output+=`${f+c+y}
8
- `,s.maxDepth===null||d+1<s.maxDepth){let C=await P(i,h,s,m,d+1);t.output+=C.output,t.dirCount+=C.dirCount,t.fileCount+=C.fileCount}}else{t.fileCount++;let y=s.fullPath?h:r.name;t.output+=`${f+c+y}
9
- `}}}catch{t.stderr=`tree: ${o}: Permission denied
10
- `}return t}async function P(i,o,s,f,d){let t={output:"",stderr:"",dirCount:0,fileCount:0};if(s.maxDepth!==null&&d>=s.maxDepth)return t;try{let l=[];if(i.fs.readdirWithFileTypes)l=(await i.fs.readdirWithFileTypes(o)).map(e=>({name:e.name,isDirectory:e.isDirectory}));else{let n=await i.fs.readdir(o);for(let e=0;e<n.length;e+=100){let r=n.slice(e,e+100),h=await Promise.all(r.map(async u=>{let c=o==="/"?`/${u}`:`${o}/${u}`;try{let m=await i.fs.stat(c);return{name:u,isDirectory:m.isDirectory}}catch{return null}}));l.push(...h.filter(u=>u!==null))}}let a=l.filter(n=>!(!s.showHidden&&n.name.startsWith(".")||s.directoriesOnly&&!n.isDirectory));a.sort((n,e)=>n.name.localeCompare(e.name));for(let n=0;n<a.length;n++){let e=a[n],r=o==="/"?`/${e.name}`:`${o}/${e.name}`,h=n===a.length-1,u=h?"`-- ":"|-- ",c=f+(h?" ":"| ");if(e.isDirectory){t.dirCount++;let m=s.fullPath?r:e.name;t.output+=`${f+u+m}
11
- `;let y=await P(i,r,s,c,d+1);t.output+=y.output,t.dirCount+=y.dirCount,t.fileCount+=y.fileCount}else{t.fileCount++;let m=s.fullPath?r:e.name;t.output+=`${f+u+m}
12
- `}}}catch{}return t}export{E as treeCommand};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./chunk-KGOUQS5A.js";var e={name:"true",async execute(){return{stdout:"",stderr:"",exitCode:0}}},t={name:"false",async execute(){return{stdout:"",stderr:"",exitCode:1}}};export{t as falseCommand,e as trueCommand};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as b,b as g,c as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.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 d(s){let i=s.split(",").map(o=>o.trim()),e=[];for(let o of i){let n=parseInt(o,10);if(Number.isNaN(n)||n<1)return null;e.push(n)}for(let o=1;o<e.length;o++)if(e[o]<=e[o-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],o=i[i.length-1],n=Math.floor((s-o)/e)+1;return o+n*e}return-1}function L(s,i){let{tabStops:e,allBlanks:o}=i,n="",a=0,t="",l=0,u=!0,f=()=>{if(t.length===0)return;let r=l+t.length;if(!o&&!u){n+=t,t="";return}let p=l,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&&(l=a),t+=r,a++):r===" "?(f(),n+=r,a=v(a,e)):(f(),n+=r,a++,u=!1);return f(),n}function C(s,i){if(s==="")return"";let e=s.split(`
3
- `),o=s.endsWith(`
4
- `)&&e[e.length-1]==="";return o&&e.pop(),e.map(a=>L(a,i)).join(`
5
- `)+(o?`
6
- `:"")}var w={name:"unexpand",execute:async(s,i)=>{if(g(s))return b(k);let e={tabStops:[8],allBlanks:!1},o=[],n=0;for(;n<s.length;){let t=s[n];if(t==="-t"&&n+1<s.length){let l=d(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
7
- `};e.tabStops=l,n+=2}else if(t.startsWith("-t")&&t.length>2){let l=d(t.slice(2));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(2)}'
8
- `};e.tabStops=l,n++}else if(t==="--tabs"&&n+1<s.length){let l=d(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
9
- `};e.tabStops=l,n+=2}else if(t.startsWith("--tabs=")){let l=d(t.slice(7));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(7)}'
10
- `};e.tabStops=l,n++}else if(t==="-a"||t==="--all")e.allBlanks=!0,n++;else if(t==="--"){o.push(...s.slice(n+1));break}else{if(t.startsWith("-")&&t!=="-")return m("unexpand",t);o.push(t),n++}}let a="";if(o.length===0){let t=i.stdin??"";a=C(t,e)}else for(let t of o){let l=i.fs.resolvePath(i.cwd,t),u=await i.fs.readFile(l);if(u===null)return{exitCode:1,stdout:a,stderr:`unexpand: ${t}: No such file or directory
11
- `};a+=C(u,e)}return{exitCode:0,stdout:a,stderr:""}}};export{w as unexpand};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as g}from"./chunk-5WFYIUU2.js";import"./chunk-OBH7XN5N.js";import{a as f}from"./chunk-JBABAK44.js";import{a as p,b as d}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var b={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"}},P={name:"uniq",async execute(a,m){if(d(a))return p(b);let o=f("uniq",a,w);if(!o.ok)return o.error;let{count:h,duplicatesOnly:y,uniqueOnly:q,ignoreCase:C}=o.result.flags,O=o.result.positional,u=await g(m,O,{cmdName:"uniq"});if(!u.ok)return u.error;let n=u.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)=>C?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 l=t;y?l=t.filter(e=>e.count>1):q&&(l=t.filter(e=>e.count===1));let c="";for(let{line:e,count:s}of l)h?c+=`${String(s).padStart(4)} ${e}
4
- `:c+=`${e}
5
- `;return{stdout:c,stderr:"",exitCode:0}}};export{P as uniqCommand};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as b}from"./chunk-5WFYIUU2.js";import"./chunk-OBH7XN5N.js";import{a as S}from"./chunk-JBABAK44.js";import{a as x,b as y}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var F={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"}},I={name:"wc",async execute(a,c){if(y(a))return x(F);let n=S("wc",a,H);if(!n.ok)return n.error;let{lines:r,words:s}=n.result.flags,e=n.result.flags.bytes||n.result.flags.chars,t=n.result.positional;!r&&!s&&!e&&(r=s=e=!0);let i=await b(c,t,{cmdName:"wc",stopOnError:!1});if(t.length===0){let o=C(i.files[0].content);return{stdout:`${g(o,r,s,e,"",0)}
3
- `,stderr:"",exitCode:0}}let h=[],p=0,d=0,u=0;for(let{filename:o,content:w}of i.files){let f=C(w);p+=f.lines,d+=f.words,u+=f.chars,h.push({filename:o,stats:f})}let M=t.length>1?p:Math.max(...h.map(o=>o.stats.lines)),L=t.length>1?d:Math.max(...h.map(o=>o.stats.words)),$=t.length>1?u:Math.max(...h.map(o=>o.stats.chars)),l=t.length>1?3:0;r&&(l=Math.max(l,String(M).length)),s&&(l=Math.max(l,String(L).length)),e&&(l=Math.max(l,String($).length));let m="";for(let{filename:o,stats:w}of h)m+=`${g(w,r,s,e,o,l)}
4
- `;return t.length>1&&(m+=`${g({lines:p,words:d,chars:u},r,s,e,"total",l)}
5
- `),{stdout:m,stderr:i.stderr,exitCode:i.exitCode}}};function C(a){let c=a.length,n=0,r=0,s=!1;for(let e=0;e<c;e++){let t=a[e];t===`
6
- `?(n++,s&&(r++,s=!1)):t===" "||t===" "||t==="\r"?s&&(r++,s=!1):s=!0}return s&&r++,{lines:n,words:r,chars:c}}function g(a,c,n,r,s,e){let t=[];c&&t.push(String(a.lines).padStart(e)),n&&t.push(String(a.words).padStart(e)),r&&t.push(String(a.chars).padStart(e));let i=t.join(" ");return s&&(i+=` ${s}`),i}export{I as wcCommand};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as u}from"./chunk-JBABAK44.js";import{a as f,b as h}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var w={name:"which",summary:"locate a command",usage:"which [-as] program ...",options:["-a List all instances of executables found","-s No output, just return 0 if found, 1 if not","--help display this help and exit"]},g={showAll:{short:"a",type:"boolean"},silent:{short:"s",type:"boolean"}},A={name:"which",async execute(e,s){if(h(e))return f(w);let t=u("which",e,g);if(!t.ok)return t.error;let c=t.result.flags.showAll,p=t.result.flags.silent,o=t.result.positional;if(o.length===0)return{stdout:"",stderr:"",exitCode:1};let d=(s.env.get("PATH")||"/usr/bin:/bin").split(":"),n="",r=!0;for(let m of o){let a=!1;for(let i of d){if(!i)continue;let l=`${i}/${m}`;if(await s.fs.exists(l)&&(a=!0,p||(n+=`${l}
3
- `),!c))break}a||(r=!1)}return{stdout:n,stderr:"",exitCode:r?0:1}}};export{A as whichCommand};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./chunk-KGOUQS5A.js";async function e(t,o){return{stdout:`user
3
- `,stderr:"",exitCode:0}}var n={name:"whoami",execute:e};export{n as whoami};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as y,b,c as A}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var E={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(s,i){if(b(s))return y(E);let p=null,h=null,c=null,o=null,g=!1,x=!1,C=!1,l=0;for(let e=0;e<s.length;e++){let t=s[e];if(t==="-I"&&e+1<s.length)p=s[++e],l=e+1;else if(t==="-d"&&e+1<s.length)h=s[++e].replace(/\\n/g,`
3
- `).replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\0/g,"\0").replace(/\\\\/g,"\\"),l=e+1;else if(t==="-n"&&e+1<s.length)c=parseInt(s[++e],10),l=e+1;else if(t==="-P"&&e+1<s.length)o=parseInt(s[++e],10),l=e+1;else if(t==="-0"||t==="--null")g=!0,l=e+1;else if(t==="-t"||t==="--verbose")x=!0,l=e+1;else if(t==="-r"||t==="--no-run-if-empty")C=!0,l=e+1;else{if(t.startsWith("--"))return A("xargs",t);if(t.startsWith("-")&&t.length>1){for(let n of t.slice(1))if(!"0tr".includes(n))return A("xargs",`-${n}`);t.includes("0")&&(g=!0),t.includes("t")&&(x=!0),t.includes("r")&&(C=!0),l=e+1}else if(!t.startsWith("-")){l=e;break}}}let a=s.slice(l);a.length===0&&a.push("echo");let r;if(g?r=i.stdin.split("\0").filter(e=>e.length>0):h!==null?r=i.stdin.replace(/\n$/,"").split(h).filter(t=>t.length>0):r=i.stdin.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),r.length===0)return C?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0};let d="",u="",f=0,M=e=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(e)?`"${e.replace(/([\\"`$])/g,"\\$1")}"`:e,w=async e=>{let t=e.map(M).join(" ");return x&&(u+=`${t}
4
- `),i.exec?i.exec(t,{cwd:i.cwd}):{stdout:`${t}
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),$=await Promise.all(n.map(w));for(let m of $)d+=m.stdout,u+=m.stderr,m.exitCode!==0&&(f=m.exitCode)}else for(let t of e){let n=await w(t);d+=n.stdout,u+=n.stderr,n.exitCode!==0&&(f=n.exitCode)}};if(p!==null){let e=r.map(t=>a.map(n=>n.replaceAll(p,t)));await I(e)}else if(c!==null){let e=[];for(let t=0;t<r.length;t+=c){let n=r.slice(t,t+c);e.push([...a,...n])}await I(e)}else{let e=[...a,...r],t=await w(e);d+=t.stdout,u+=t.stderr,f=t.exitCode}return{stdout:d,stderr:u,exitCode:f}}};export{P as xargsCommand};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as r,b as d}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var u={name:"alias",summary:"define or display aliases",usage:"alias [name[=value] ...]",options:[" --help display this help and exit"]},o="BASH_ALIAS_",m={name:"alias",async execute(e,a){if(d(e))return r(u);if(e.length===0){let t="";for(let[i,s]of a.env)if(i.startsWith(o)){let n=i.slice(o.length);t+=`alias ${n}='${s}'
3
- `}return{stdout:t,stderr:"",exitCode:0}}let l=e[0]==="--"?e.slice(1):e;for(let t of l){let i=t.indexOf("=");if(i===-1){let s=o+t;return a.env.get(s)?{stdout:`alias ${t}='${a.env.get(s)}'
4
- `,stderr:"",exitCode:0}:{stdout:"",stderr:`alias: ${t}: not found
5
- `,exitCode:1}}else{let s=t.slice(0,i),n=t.slice(i+1);(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))&&(n=n.slice(1,-1)),a.env.set(o+s,n)}}return{stdout:"",stderr:"",exitCode:0}}},c={name:"unalias",async execute(e,a){if(d(e))return r({name:"unalias",summary:"remove alias definitions",usage:"unalias name [name ...]",options:["-a remove all aliases"," --help display this help and exit"]});if(e.length===0)return{stdout:"",stderr:`unalias: usage: unalias [-a] name [name ...]
6
- `,exitCode:1};if(e[0]==="-a"){for(let s of a.env.keys())s.startsWith(o)&&a.env.delete(s);return{stdout:"",stderr:"",exitCode:0}}let l=e[0]==="--"?e.slice(1):e,t=!1,i="";for(let s of l){let n=o+s;a.env.get(n)?a.env.delete(n):(i+=`unalias: ${s}: not found
7
- `,t=!0)}return{stdout:"",stderr:i,exitCode:t?1:0}}};export{m as aliasCommand,c as unaliasCommand};
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as se}from"./chunk-4PRVMER6.js";import{k as b}from"./chunk-K5IXNHO5.js";import{a as m,b as M}from"./chunk-SE4C7FJY.js";import{a as re,b as ie,c as j}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var be=1e4,Oe=100,Le=new M(/\s+/);function Q(e={}){let{fieldSep:t=Le,maxIterations:n=be,maxRecursionDepth:i=Oe,fs:a,cwd:s,exec:o}=e;return{FS:" ",OFS:" ",ORS:`
3
- `,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:i,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:a,cwd:s,exec:o}}function ae(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}function C(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function g(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}async function x(e,t){if(e.type==="regex")return e.pattern;let n=g(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function ce(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(C(await t.evalExpr(e.index)))}`:"$0":"$0"}function le(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return g(t.vars[e]??"")}function ue(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let i=parseInt(e.slice(1),10)-1;for(;n.fields.length<=i;)n.fields.push("");n.fields[i]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function Me(e,t,n){return e.length===0?t.line.length:g(await n.evalExpr(e[0])).length}async function Pe(e,t,n){if(e.length<2)return"";let i=g(await n.evalExpr(e[0])),a=Math.floor(C(await n.evalExpr(e[1])))-1;if(e.length>=3){let s=Math.floor(C(await n.evalExpr(e[2])));return i.substr(Math.max(0,a),s)}return i.substr(Math.max(0,a))}async function Te(e,t,n){if(e.length<2)return 0;let i=g(await n.evalExpr(e[0])),a=g(await n.evalExpr(e[1])),s=i.indexOf(a);return s===-1?0:s+1}async function Fe(e,t,n){if(e.length<2)return 0;let i=g(await n.evalExpr(e[0])),a=e[1];if(a.type!=="variable")return 0;let s=a.name,o=t.FS;if(e.length>=3){let h=e[2];if(h.type==="regex")o=m(h.pattern);else{let N=g(await n.evalExpr(h));o=N===" "?m("\\s+"):N}}else t.FS===" "&&(o=m("\\s+"));let l=typeof o=="string"?i.split(o):o.split(i);t.arrays[s]=Object.create(null);for(let h=0;h<l.length;h++)t.arrays[s][String(h+1)]=l[h];return l.length}async function _e(e,t,n){if(e.length<2)return 0;let i=await x(e[0],n),a=g(await n.evalExpr(e[1])),s=await ce(e[2],n),o=le(s,t);try{let h=m(i).replace(o,he(a)),N=h!==o?1:0;return ue(s,h,t),N}catch{return 0}}async function Ge(e,t,n){if(e.length<2)return 0;let i=await x(e[0],n),a=g(await n.evalExpr(e[1])),s=await ce(e[2],n),o=le(s,t);try{let l=m(i,"g"),h=l.match(o),N=h?h.length:0,k=l.replace(o,he(a));return ue(s,k,t),N}catch{return 0}}function he(e){return t=>{let n="",i=0;for(;i<e.length;)if(e[i]==="\\"&&i+1<e.length){let a=e[i+1];a==="&"?(n+="&",i+=2):a==="\\"?(n+="\\",i+=2):(n+=e[i+1],i+=2)}else e[i]==="&"?(n+=t,i++):(n+=e[i],i++);return n}}async function De(e,t,n){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let i=g(await n.evalExpr(e[0])),a=await x(e[1],n);try{let o=m(a).exec(i);if(o)return t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART}catch{}return t.RSTART=0,t.RLENGTH=-1,0}async function xe(e,t,n){if(e.length<3)return"";let i=await x(e[0],n),a=g(await n.evalExpr(e[1])),s=g(await n.evalExpr(e[2])),o=e.length>=4?g(await n.evalExpr(e[3])):t.line;try{let l=s.toLowerCase()==="g",h=l?0:parseInt(s,10)||1;if(l)return m(i,"g").replace(o,(k,...y)=>oe(a,k,y.slice(0,-2)));{let N=0;return m(i,"g").replace(o,(y,...I)=>(N++,N===h?oe(a,y,I.slice(0,-2)):y))}}catch{return o}}function oe(e,t,n){let i="",a=0;for(;a<e.length;)if(e[a]==="\\"&&a+1<e.length){let s=e[a+1];if(s==="&")i+="&",a+=2;else if(s==="0")i+=t,a+=2;else if(s>="1"&&s<="9"){let o=parseInt(s,10)-1;i+=n[o]||"",a+=2}else s==="n"?(i+=`
4
- `,a+=2):s==="t"?(i+=" ",a+=2):(i+=s,a+=2)}else e[a]==="&"?(i+=t,a++):(i+=e[a],a++);return i}async function Ue(e,t,n){return e.length===0?"":g(await n.evalExpr(e[0])).toLowerCase()}async function Be(e,t,n){return e.length===0?"":g(await n.evalExpr(e[0])).toUpperCase()}async function He(e,t,n){if(e.length===0)return"";let i=g(await n.evalExpr(e[0])),a=[];for(let s=1;s<e.length;s++)a.push(await n.evalExpr(e[s]));return U(i,a)}async function $e(e,t,n){return e.length===0?0:Math.floor(C(await n.evalExpr(e[0])))}async function We(e,t,n){return e.length===0?0:Math.sqrt(C(await n.evalExpr(e[0])))}async function Ve(e,t,n){return e.length===0?0:Math.sin(C(await n.evalExpr(e[0])))}async function Ke(e,t,n){return e.length===0?0:Math.cos(C(await n.evalExpr(e[0])))}async function Xe(e,t,n){let i=e.length>0?C(await n.evalExpr(e[0])):0,a=e.length>1?C(await n.evalExpr(e[1])):0;return Math.atan2(i,a)}async function je(e,t,n){return e.length===0?0:Math.log(C(await n.evalExpr(e[0])))}async function Qe(e,t,n){return e.length===0?1:Math.exp(C(await n.evalExpr(e[0])))}function qe(e,t,n){return t.random?t.random():Math.random()}async function ze(e,t,n){let i=e.length>0?C(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=i,i}function Je(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function q(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}function U(e,t){let n=0,i="",a=0;for(;a<e.length;)if(e[a]==="%"&&a+1<e.length){let s=a+1,o="",l="",h="",N,k=s;for(;s<e.length&&/\d/.test(e[s]);)s++;s>k&&e[s]==="$"?(N=parseInt(e.substring(k,s),10)-1,s++):s=k;let y=()=>{if(s<e.length){if(s+1<e.length&&(e[s]==="h"&&e[s+1]==="h"||e[s]==="l"&&e[s+1]==="l")){s+=2;return}/[lzjh]/.test(e[s])&&s++}};for(;s<e.length&&/[-+ #0]/.test(e[s]);)o+=e[s++];if(e[s]==="*"){let c=t[n++],p=c!==void 0?Math.floor(Number(c)):0;p<0?(o+="-",l=String(-p)):l=String(p),s++}else for(;s<e.length&&/\d/.test(e[s]);)l+=e[s++];if(e[s]===".")if(s++,e[s]==="*"){let c=t[n++];h=String(c!==void 0?Math.floor(Number(c)):0),s++}else for(;s<e.length&&/\d/.test(e[s]);)h+=e[s++];y();let I=e[s],w=t[N!==void 0?N:n];switch(I){case"s":{let c=w!==void 0?String(w):"";if(h&&(c=c.substring(0,parseInt(h,10))),l){let p=parseInt(l,10);o.includes("-")?c=c.padEnd(p):c=c.padStart(p)}i+=c,N===void 0&&n++;break}case"d":case"i":{let c=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(c)&&(c=0);let p=c<0,E=Math.abs(c).toString();if(h){let O=parseInt(h,10);E=E.padStart(O,"0")}let d="";p?d="-":o.includes("+")?d="+":o.includes(" ")&&(d=" ");let R=d+E;if(l){let O=parseInt(l,10);o.includes("-")?R=R.padEnd(O):o.includes("0")&&!h?R=d+E.padStart(O-d.length,"0"):R=R.padStart(O)}i+=R,N===void 0&&n++;break}case"f":{let c=w!==void 0?Number(w):0;Number.isNaN(c)&&(c=0);let p=h?parseInt(h,10):6,E=c.toFixed(p);if(l){let d=parseInt(l,10);o.includes("-")?E=E.padEnd(d):E=E.padStart(d)}i+=E,N===void 0&&n++;break}case"e":case"E":{let c=w!==void 0?Number(w):0;Number.isNaN(c)&&(c=0);let p=h?parseInt(h,10):6,E=c.toExponential(p);if(I==="E"&&(E=E.toUpperCase()),l){let d=parseInt(l,10);o.includes("-")?E=E.padEnd(d):E=E.padStart(d)}i+=E,N===void 0&&n++;break}case"g":case"G":{let c=w!==void 0?Number(w):0;Number.isNaN(c)&&(c=0);let p=h?parseInt(h,10):6,E=c!==0?Math.floor(Math.log10(Math.abs(c))):0,d;if(c===0?d="0":E<-4||E>=p?(d=c.toExponential(p-1),I==="G"&&(d=d.toUpperCase())):d=c.toPrecision(p),d.includes(".")&&(d=d.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),d.includes("e")&&(d=d.replace(/\.?0+e/,"e")),l){let R=parseInt(l,10);o.includes("-")?d=d.padEnd(R):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"x":case"X":{let c=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(c)&&(c=0);let p=Math.abs(c).toString(16);if(I==="X"&&(p=p.toUpperCase()),h){let R=parseInt(h,10);p=p.padStart(R,"0")}let E=c<0?"-":"",d=E+p;if(l){let R=parseInt(l,10);o.includes("-")?d=d.padEnd(R):o.includes("0")&&!h?d=E+p.padStart(R-E.length,"0"):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"o":{let c=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(c)&&(c=0);let p=Math.abs(c).toString(8);if(h){let R=parseInt(h,10);p=p.padStart(R,"0")}let E=c<0?"-":"",d=E+p;if(l){let R=parseInt(l,10);o.includes("-")?d=d.padEnd(R):o.includes("0")&&!h?d=E+p.padStart(R-E.length,"0"):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"c":{typeof w=="number"?i+=String.fromCharCode(w):i+=String(w??"").charAt(0)||"",N===void 0&&n++;break}case"%":i+="%";break;default:i+=e.substring(a,s+1)}a=s+1}else if(e[a]==="\\"&&a+1<e.length){let s=e[a+1];switch(s){case"n":i+=`
5
- `;break;case"t":i+=" ";break;case"r":i+="\r";break;case"\\":i+="\\";break;default:i+=s}a+=2}else i+=e[a++];return i}var pe=new Map([["length",Me],["substr",Pe],["index",Te],["split",Fe],["sub",_e],["gsub",Ge],["match",De],["gensub",xe],["tolower",Ue],["toupper",Be],["sprintf",He],["int",$e],["sqrt",We],["sin",Ve],["cos",Ke],["atan2",Xe],["log",je],["exp",Qe],["rand",qe],["srand",ze],["system",Je("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",q("systime")],["mktime",q("mktime")],["strftime",q("strftime")]]);function v(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function A(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function S(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function z(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function _(e,t){try{return m(e).test(t)}catch{return!1}}function fe(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function B(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function J(e,t,n){if(t===0)e.line=S(n),e.fields=fe(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=S(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function P(e,t){e.line=t,e.fields=fe(e,t),e.NF=e.fields.length}function de(e,t){if(e.FS=t,t===" ")e.fieldSep=new M(/\s+/);else try{e.fieldSep=m(t)}catch{e.fieldSep=m(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}function H(e,t){switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return e.vars[t]??""}function T(e,t,n){switch(t){case"FS":de(e,S(n));return;case"OFS":e.OFS=S(n);return;case"ORS":e.ORS=S(n);return;case"OFMT":e.OFMT=S(n);return;case"NR":e.NR=Math.floor(A(n));return;case"NF":{let i=Math.floor(A(n));if(i<e.NF)e.fields=e.fields.slice(0,i),e.line=e.fields.join(e.OFS);else if(i>e.NF){for(;e.fields.length<i;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=i;return}case"FNR":e.FNR=Math.floor(A(n));return;case"FILENAME":e.FILENAME=S(n);return;case"RSTART":e.RSTART=Math.floor(A(n));return;case"RLENGTH":e.RLENGTH=Math.floor(A(n));return;case"SUBSEP":e.SUBSEP=S(n);return}e.vars[t]=n}function G(e,t){let n=t,i=new Set,a=e.arrayAliases.get(n);for(;a!==void 0&&!i.has(n);)i.add(n),n=a,a=e.arrayAliases.get(n);return n}function $(e,t,n){if(t==="ARGV")return e.ARGV[n]??"";if(t==="ENVIRON")return e.ENVIRON[n]??"";let i=G(e,t);return e.arrays[i]?.[n]??""}function Z(e,t,n,i){let a=G(e,t);e.arrays[a]||(e.arrays[a]=Object.create(null)),e.arrays[a][n]=i}function Ee(e,t,n){if(t==="ARGV")return e.ARGV[n]!==void 0;if(t==="ENVIRON")return e.ENVIRON[n]!==void 0;let i=G(e,t);return e.arrays[i]?.[n]!==void 0}function Ne(e,t,n){let i=G(e,t);e.arrays[i]&&delete e.arrays[i][n]}function Se(e,t){let n=G(e,t);delete e.arrays[n]}var Y=null;function ye(e){Y=e}async function f(e,t){switch(t.type){case"number":return t.value;case"string":return t.value;case"regex":return _(t.pattern,e.line)?1:0;case"field":return Ze(e,t);case"variable":return H(e,t.name);case"array_access":return Ye(e,t);case"binary":return et(e,t);case"unary":return rt(e,t);case"ternary":return v(await f(e,t.condition))?await f(e,t.consequent):await f(e,t.alternate);case"call":return it(e,t.name,t.args);case"assignment":return at(e,t);case"pre_increment":return ot(e,t.operand);case"pre_decrement":return ct(e,t.operand);case"post_increment":return lt(e,t.operand);case"post_decrement":return ut(e,t.operand);case"in":return ht(e,t.key,t.array);case"getline":return pt(e,t.variable,t.file,t.command);case"tuple":return Et(e,t.elements);default:return""}}async function Ze(e,t){let n=Math.floor(A(await f(e,t.index)));return B(e,n)}async function Ye(e,t){let n=S(await f(e,t.key));return $(e,t.array,n)}async function et(e,t){let n=t.operator;if(n==="||")return v(await f(e,t.left))||v(await f(e,t.right))?1:0;if(n==="&&")return v(await f(e,t.left))&&v(await f(e,t.right))?1:0;if(n==="~"){let l=await f(e,t.left),h=t.right.type==="regex"?t.right.pattern:S(await f(e,t.right));try{return m(h).test(S(l))?1:0}catch{return 0}}if(n==="!~"){let l=await f(e,t.left),h=t.right.type==="regex"?t.right.pattern:S(await f(e,t.right));try{return m(h).test(S(l))?0:1}catch{return 1}}let i=await f(e,t.left),a=await f(e,t.right);if(n===" ")return S(i)+S(a);if(tt(n))return nt(i,a,n);let s=A(i),o=A(a);return ae(s,o,n)}function tt(e){return["<","<=",">",">=","==","!="].includes(e)}function nt(e,t,n){let i=z(e),a=z(t);if(i&&a){let l=A(e),h=A(t);switch(n){case"<":return l<h?1:0;case"<=":return l<=h?1:0;case">":return l>h?1:0;case">=":return l>=h?1:0;case"==":return l===h?1:0;case"!=":return l!==h?1:0}}let s=S(e),o=S(t);switch(n){case"<":return s<o?1:0;case"<=":return s<=o?1:0;case">":return s>o?1:0;case">=":return s>=o?1:0;case"==":return s===o?1:0;case"!=":return s!==o?1:0}return 0}async function rt(e,t){let n=await f(e,t.operand);switch(t.operator){case"!":return v(n)?0:1;case"-":return-A(n);case"+":return+A(n);default:return n}}async function it(e,t,n){let i=pe.get(t);if(i)return i(n,e,{evalExpr:s=>f(e,s)});let a=e.functions.get(t);return a?st(e,a,n):""}async function st(e,t,n){if(e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new b(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let i=Object.create(null);for(let o of t.params)i[o]=e.vars[o];let a=[];for(let o=0;o<t.params.length;o++){let l=t.params[o];if(o<n.length){let h=n[o];h.type==="variable"&&(e.arrayAliases.set(l,h.name),a.push(l));let N=await f(e,h);e.vars[l]=N}else e.vars[l]=""}e.hasReturn=!1,e.returnValue=void 0,Y&&await Y(e,t.body.statements);let s=e.returnValue??"";for(let o of t.params)i[o]!==void 0?e.vars[o]=i[o]:delete e.vars[o];for(let o of a)e.arrayAliases.delete(o);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,s}async function at(e,t){let n=await f(e,t.value),i=t.target,a=t.operator,s;if(a==="=")s=n;else{let o;if(i.type==="field"){let N=Math.floor(A(await f(e,i.index)));o=B(e,N)}else if(i.type==="variable")o=H(e,i.name);else{let N=S(await f(e,i.key));o=$(e,i.array,N)}let l=A(o),h=A(n);switch(a){case"+=":s=l+h;break;case"-=":s=l-h;break;case"*=":s=l*h;break;case"/=":s=h!==0?l/h:0;break;case"%=":s=h!==0?l%h:0;break;case"^=":s=l**h;break;default:s=n}}if(i.type==="field"){let o=Math.floor(A(await f(e,i.index)));J(e,o,s)}else if(i.type==="variable")T(e,i.name,s);else{let o=S(await f(e,i.key));Z(e,i.array,o,s)}return s}async function W(e,t,n,i){let a;if(t.type==="field"){let s=Math.floor(A(await f(e,t.index)));a=A(B(e,s)),J(e,s,a+n)}else if(t.type==="variable")a=A(H(e,t.name)),T(e,t.name,a+n);else{let s=S(await f(e,t.key));a=A($(e,t.array,s)),Z(e,t.array,s,a+n)}return i?a+n:a}async function ot(e,t){return W(e,t,1,!0)}async function ct(e,t){return W(e,t,-1,!0)}async function lt(e,t){return W(e,t,1,!1)}async function ut(e,t){return W(e,t,-1,!1)}async function ht(e,t,n){let i;if(t.type==="tuple"){let a=[];for(let s of t.elements)a.push(S(await f(e,s)));i=a.join(e.SUBSEP)}else i=S(await f(e,t));return Ee(e,n,i)?1:0}async function pt(e,t,n,i){if(i)return ft(e,t,i);if(n)return dt(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let a=e.lineIndex+1;if(a>=e.lines.length)return 0;let s=e.lines[a];return t?T(e,t,s):P(e,s),e.NR++,e.lineIndex=a,1}async function ft(e,t,n){if(!e.exec)return-1;let i=S(await f(e,n)),a=`__cmd_${i}`,s=`__cmdi_${i}`,o,l;if(e.vars[a]===void 0)try{o=(await e.exec(i)).stdout.split(`
6
- `),o.length>0&&o[o.length-1]===""&&o.pop(),e.vars[a]=JSON.stringify(o),e.vars[s]=-1,l=-1}catch{return-1}else o=JSON.parse(e.vars[a]),l=e.vars[s];let h=l+1;if(h>=o.length)return 0;let N=o[h];return e.vars[s]=h,t?T(e,t,N):P(e,N),1}async function dt(e,t,n){if(!e.fs||!e.cwd)return-1;let i=S(await f(e,n));if(i==="/dev/null")return 0;let a=e.fs.resolvePath(e.cwd,i),s=`__fc_${a}`,o=`__fi_${a}`,l,h;if(e.vars[s]===void 0)try{l=(await e.fs.readFile(a)).split(`
7
- `),l.length>0&&l[l.length-1]===""&&l.pop(),e.vars[s]=JSON.stringify(l),e.vars[o]=-1,h=-1}catch{return-1}else l=JSON.parse(e.vars[s]),h=e.vars[o];let N=h+1;if(N>=l.length)return 0;let k=l[N];return e.vars[o]=N,t?T(e,t,k):P(e,k),1}async function Et(e,t){if(t.length===0)return"";for(let n=0;n<t.length-1;n++)await f(e,t[n]);return f(e,t[t.length-1])}ye(F);async function F(e,t){for(let n of t)if(await L(e,n),Nt(e))break}function Nt(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}async function L(e,t){switch(t.type){case"block":await F(e,t.statements);break;case"expr_stmt":await f(e,t.expression);break;case"print":await St(e,t.args,t.output);break;case"printf":await yt(e,t.format,t.args,t.output);break;case"if":await Rt(e,t);break;case"while":await At(e,t);break;case"do_while":await mt(e,t);break;case"for":await It(e,t);break;case"for_in":await wt(e,t);break;case"break":e.loopBreak=!0;break;case"continue":e.loopContinue=!0;break;case"next":e.shouldNext=!0;break;case"nextfile":e.shouldNextFile=!0;break;case"exit":e.shouldExit=!0,e.exitCode=t.code?Math.floor(A(await f(e,t.code))):0;break;case"return":e.hasReturn=!0,e.returnValue=t.value?await f(e,t.value):"";break;case"delete":await gt(e,t.target);break}}async function St(e,t,n){let i=[];for(let s of t){let o=await f(e,s);typeof o=="number"?Number.isInteger(o)&&Math.abs(o)<Number.MAX_SAFE_INTEGER?i.push(String(o)):i.push(U(e.OFMT,[o])):i.push(S(o))}let a=i.join(e.OFS)+e.ORS;n?await Re(e,n.redirect,n.file,a):e.output+=a}async function yt(e,t,n,i){let a=S(await f(e,t)),s=[];for(let l of n)s.push(await f(e,l));let o=U(a,s);i?await Re(e,i.redirect,i.file,o):e.output+=o}async function Re(e,t,n,i){if(!e.fs||!e.cwd){e.output+=i;return}let a=S(await f(e,n)),s=e.fs.resolvePath(e.cwd,a);t===">"?e.openedFiles.has(s)?await e.fs.appendFile(s,i):(await e.fs.writeFile(s,i),e.openedFiles.add(s)):(e.openedFiles.has(s)||e.openedFiles.add(s),await e.fs.appendFile(s,i))}async function Rt(e,t){v(await f(e,t.condition))?await L(e,t.consequent):t.alternate&&await L(e,t.alternate)}async function At(e,t){let n=0;for(;v(await f(e,t.condition));){if(n++,n>e.maxIterations)throw new b(`awk: while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await L(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function mt(e,t){let n=0;do{if(n++,n>e.maxIterations)throw new b(`awk: do-while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await L(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}while(v(await f(e,t.condition)))}async function It(e,t){t.init&&await f(e,t.init);let n=0;for(;!t.condition||v(await f(e,t.condition));){if(n++,n>e.maxIterations)throw new b(`awk: for loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await L(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break;t.update&&await f(e,t.update)}}async function wt(e,t){let n=e.arrays[t.array];if(n)for(let i of Object.keys(n)){if(e.vars[t.variable]=i,e.loopContinue=!1,await L(e,t.body),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function gt(e,t){if(t.type==="array_access"){let n=S(await f(e,t.key));Ne(e,t.array,n)}else t.type==="variable"&&Se(e,t.name)}var D=class{ctx;program=null;rangeStates=[];constructor(t){this.ctx=t}execute(t){this.program=t,this.ctx.output="";for(let n of t.functions)this.ctx.functions.set(n.name,n);this.rangeStates=t.rules.map(()=>!1)}async executeBegin(){if(this.program){for(let t of this.program.rules)if(t.pattern?.type==="begin"&&(await F(this.ctx,t.action.statements),this.ctx.shouldExit))break}}async executeLine(t){if(!(!this.program||this.ctx.shouldExit)){P(this.ctx,t),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;for(let n=0;n<this.program.rules.length&&!(this.ctx.shouldExit||this.ctx.shouldNext||this.ctx.shouldNextFile);n++){let i=this.program.rules[n];i.pattern?.type==="begin"||i.pattern?.type==="end"||await this.matchesRule(i,n)&&await F(this.ctx,i.action.statements)}}}async executeEnd(){if(this.program&&!this.ctx.inEndBlock){this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;for(let t of this.program.rules)if(t.pattern?.type==="end"&&(await F(this.ctx,t.action.statements),this.ctx.shouldExit))break;this.ctx.inEndBlock=!1}}getOutput(){return this.ctx.output}getExitCode(){return this.ctx.exitCode}getContext(){return this.ctx}async matchesRule(t,n){let i=t.pattern;if(!i)return!0;switch(i.type){case"begin":case"end":return!1;case"regex_pattern":return _(i.pattern,this.ctx.line);case"expr_pattern":return v(await f(this.ctx,i.expression));case"range":{let a=await this.matchPattern(i.start),s=await this.matchPattern(i.end);return this.rangeStates[n]?(s&&(this.rangeStates[n]=!1),!0):a?(this.rangeStates[n]=!0,s&&(this.rangeStates[n]=!1),!0):!1}default:return!1}}async matchPattern(t){switch(t.type){case"regex_pattern":return _(t.pattern,this.ctx.line);case"expr_pattern":return v(await f(this.ctx,t.expression));default:return!1}}};var r;(function(e){e.NUMBER="NUMBER",e.STRING="STRING",e.REGEX="REGEX",e.IDENT="IDENT",e.BEGIN="BEGIN",e.END="END",e.IF="IF",e.ELSE="ELSE",e.WHILE="WHILE",e.DO="DO",e.FOR="FOR",e.IN="IN",e.BREAK="BREAK",e.CONTINUE="CONTINUE",e.NEXT="NEXT",e.NEXTFILE="NEXTFILE",e.EXIT="EXIT",e.RETURN="RETURN",e.DELETE="DELETE",e.FUNCTION="FUNCTION",e.PRINT="PRINT",e.PRINTF="PRINTF",e.GETLINE="GETLINE",e.PLUS="PLUS",e.MINUS="MINUS",e.STAR="STAR",e.SLASH="SLASH",e.PERCENT="PERCENT",e.CARET="CARET",e.EQ="EQ",e.NE="NE",e.LT="LT",e.GT="GT",e.LE="LE",e.GE="GE",e.MATCH="MATCH",e.NOT_MATCH="NOT_MATCH",e.AND="AND",e.OR="OR",e.NOT="NOT",e.ASSIGN="ASSIGN",e.PLUS_ASSIGN="PLUS_ASSIGN",e.MINUS_ASSIGN="MINUS_ASSIGN",e.STAR_ASSIGN="STAR_ASSIGN",e.SLASH_ASSIGN="SLASH_ASSIGN",e.PERCENT_ASSIGN="PERCENT_ASSIGN",e.CARET_ASSIGN="CARET_ASSIGN",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.QUESTION="QUESTION",e.COLON="COLON",e.COMMA="COMMA",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.LBRACKET="LBRACKET",e.RBRACKET="RBRACKET",e.DOLLAR="DOLLAR",e.APPEND="APPEND",e.PIPE="PIPE",e.EOF="EOF"})(r||(r={}));var vt=new Map([["BEGIN",r.BEGIN],["END",r.END],["if",r.IF],["else",r.ELSE],["while",r.WHILE],["do",r.DO],["for",r.FOR],["in",r.IN],["break",r.BREAK],["continue",r.CONTINUE],["next",r.NEXT],["nextfile",r.NEXTFILE],["exit",r.EXIT],["return",r.RETURN],["delete",r.DELETE],["function",r.FUNCTION],["print",r.PRINT],["printf",r.PRINTF],["getline",r.GETLINE]]);function kt(e){return e.replace(/\[\[:space:\]\]/g,"[ \\t\\n\\r\\f\\v]").replace(/\[\[:blank:\]\]/g,"[ \\t]").replace(/\[\[:alpha:\]\]/g,"[a-zA-Z]").replace(/\[\[:digit:\]\]/g,"[0-9]").replace(/\[\[:alnum:\]\]/g,"[a-zA-Z0-9]").replace(/\[\[:upper:\]\]/g,"[A-Z]").replace(/\[\[:lower:\]\]/g,"[a-z]").replace(/\[\[:punct:\]\]/g,"[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~]").replace(/\[\[:xdigit:\]\]/g,"[0-9A-Fa-f]").replace(/\[\[:graph:\]\]/g,"[!-~]").replace(/\[\[:print:\]\]/g,"[ -~]").replace(/\[\[:cntrl:\]\]/g,"[\\x00-\\x1f\\x7f]")}var V=class{input;pos=0;line=1;column=1;lastTokenType=null;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&(t.push(n),this.lastTokenType=n.type)}return t.push(this.makeToken(r.EOF,"")),t}makeToken(t,n){return{type:t,value:n,line:this.line,column:this.column}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
8
- `?(this.line++,this.column=1):this.column++,t}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.peek();if(t===" "||t===" "||t==="\r")this.advance();else if(t==="\\")if(this.peek(1)===`
9
- `)this.advance(),this.advance();else break;else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
10
- `;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let t=this.line,n=this.column,i=this.peek();return i===`
11
- `?(this.advance(),{type:r.NEWLINE,value:`
12
- `,line:t,column:n}):i==='"'?this.readString():i==="/"&&this.canBeRegex()?this.readRegex():this.isDigit(i)||i==="."&&this.isDigit(this.peek(1))?this.readNumber():this.isAlpha(i)||i==="_"?this.readIdentifier():this.readOperator()}canBeRegex(){return new Set([null,r.NEWLINE,r.SEMICOLON,r.LBRACE,r.RBRACE,r.LPAREN,r.LBRACKET,r.COMMA,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.AND,r.OR,r.NOT,r.MATCH,r.NOT_MATCH,r.QUESTION,r.COLON,r.LT,r.GT,r.LE,r.GE,r.EQ,r.NE,r.PLUS,r.MINUS,r.STAR,r.PERCENT,r.CARET,r.PRINT,r.PRINTF,r.IF,r.WHILE,r.DO,r.FOR,r.RETURN]).has(this.lastTokenType)}readString(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos<this.input.length&&this.peek()!=='"';)if(this.peek()==="\\"){this.advance();let a=this.advance();switch(a){case"n":i+=`
13
- `;break;case"t":i+=" ";break;case"r":i+="\r";break;case"f":i+="\f";break;case"b":i+="\b";break;case"v":i+="\v";break;case"a":i+="\x07";break;case"\\":i+="\\";break;case'"':i+='"';break;case"/":i+="/";break;case"x":{let s="";for(;s.length<2&&/[0-9a-fA-F]/.test(this.peek());)s+=this.advance();s.length>0?i+=String.fromCharCode(parseInt(s,16)):i+="x";break}default:if(/[0-7]/.test(a)){let s=a;for(;s.length<3&&/[0-7]/.test(this.peek());)s+=this.advance();i+=String.fromCharCode(parseInt(s,8))}else i+=a}}else i+=this.advance();return this.peek()==='"'&&this.advance(),{type:r.STRING,value:i,line:t,column:n}}readRegex(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos<this.input.length&&this.peek()!=="/";)if(this.peek()==="\\")i+=this.advance(),this.pos<this.input.length&&(i+=this.advance());else{if(this.peek()===`
14
- `)break;i+=this.advance()}return this.peek()==="/"&&this.advance(),i=kt(i),{type:r.REGEX,value:i,line:t,column:n}}readNumber(){let t=this.line,n=this.column,i="";for(;this.isDigit(this.peek());)i+=this.advance();if(this.peek()==="."&&this.isDigit(this.peek(1)))for(i+=this.advance();this.isDigit(this.peek());)i+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(i+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(i+=this.advance());this.isDigit(this.peek());)i+=this.advance();return{type:r.NUMBER,value:parseFloat(i),line:t,column:n}}readIdentifier(){let t=this.line,n=this.column,i="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)i+=this.advance();let a=vt.get(i);return a!==void 0?{type:a,value:i,line:t,column:n}:{type:r.IDENT,value:i,line:t,column:n}}readOperator(){let t=this.line,n=this.column,i=this.advance(),a=this.peek();switch(i){case"+":return a==="+"?(this.advance(),{type:r.INCREMENT,value:"++",line:t,column:n}):a==="="?(this.advance(),{type:r.PLUS_ASSIGN,value:"+=",line:t,column:n}):{type:r.PLUS,value:"+",line:t,column:n};case"-":return a==="-"?(this.advance(),{type:r.DECREMENT,value:"--",line:t,column:n}):a==="="?(this.advance(),{type:r.MINUS_ASSIGN,value:"-=",line:t,column:n}):{type:r.MINUS,value:"-",line:t,column:n};case"*":return a==="*"?(this.advance(),{type:r.CARET,value:"**",line:t,column:n}):a==="="?(this.advance(),{type:r.STAR_ASSIGN,value:"*=",line:t,column:n}):{type:r.STAR,value:"*",line:t,column:n};case"/":return a==="="?(this.advance(),{type:r.SLASH_ASSIGN,value:"/=",line:t,column:n}):{type:r.SLASH,value:"/",line:t,column:n};case"%":return a==="="?(this.advance(),{type:r.PERCENT_ASSIGN,value:"%=",line:t,column:n}):{type:r.PERCENT,value:"%",line:t,column:n};case"^":return a==="="?(this.advance(),{type:r.CARET_ASSIGN,value:"^=",line:t,column:n}):{type:r.CARET,value:"^",line:t,column:n};case"=":return a==="="?(this.advance(),{type:r.EQ,value:"==",line:t,column:n}):{type:r.ASSIGN,value:"=",line:t,column:n};case"!":return a==="="?(this.advance(),{type:r.NE,value:"!=",line:t,column:n}):a==="~"?(this.advance(),{type:r.NOT_MATCH,value:"!~",line:t,column:n}):{type:r.NOT,value:"!",line:t,column:n};case"<":return a==="="?(this.advance(),{type:r.LE,value:"<=",line:t,column:n}):{type:r.LT,value:"<",line:t,column:n};case">":return a==="="?(this.advance(),{type:r.GE,value:">=",line:t,column:n}):a===">"?(this.advance(),{type:r.APPEND,value:">>",line:t,column:n}):{type:r.GT,value:">",line:t,column:n};case"&":return a==="&"?(this.advance(),{type:r.AND,value:"&&",line:t,column:n}):{type:r.IDENT,value:"&",line:t,column:n};case"|":return a==="|"?(this.advance(),{type:r.OR,value:"||",line:t,column:n}):{type:r.PIPE,value:"|",line:t,column:n};case"~":return{type:r.MATCH,value:"~",line:t,column:n};case"?":return{type:r.QUESTION,value:"?",line:t,column:n};case":":return{type:r.COLON,value:":",line:t,column:n};case",":return{type:r.COMMA,value:",",line:t,column:n};case";":return{type:r.SEMICOLON,value:";",line:t,column:n};case"(":return{type:r.LPAREN,value:"(",line:t,column:n};case")":return{type:r.RPAREN,value:")",line:t,column:n};case"{":return{type:r.LBRACE,value:"{",line:t,column:n};case"}":return{type:r.RBRACE,value:"}",line:t,column:n};case"[":return{type:r.LBRACKET,value:"[",line:t,column:n};case"]":return{type:r.RBRACKET,value:"]",line:t,column:n};case"$":return{type:r.DOLLAR,value:"$",line:t,column:n};default:return{type:r.IDENT,value:i,line:t,column:n}}}isDigit(t){return t>="0"&&t<="9"}isAlpha(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isAlphaNumeric(t){return this.isDigit(t)||this.isAlpha(t)}};var u={LPAREN:"LPAREN",RPAREN:"RPAREN",QUESTION:"QUESTION",NEWLINE:"NEWLINE",SEMICOLON:"SEMICOLON",RBRACE:"RBRACE",COMMA:"COMMA",PIPE:"PIPE",GT:"GT",APPEND:"APPEND",AND:"AND",OR:"OR",ASSIGN:"ASSIGN",PLUS_ASSIGN:"PLUS_ASSIGN",MINUS_ASSIGN:"MINUS_ASSIGN",STAR_ASSIGN:"STAR_ASSIGN",SLASH_ASSIGN:"SLASH_ASSIGN",PERCENT_ASSIGN:"PERCENT_ASSIGN",CARET_ASSIGN:"CARET_ASSIGN",RBRACKET:"RBRACKET",COLON:"COLON",IN:"IN",PRINT:"PRINT",PRINTF:"PRINTF",IDENT:"IDENT",LT:"LT",LE:"LE",GE:"GE",EQ:"EQ",NE:"NE",MATCH:"MATCH",NOT_MATCH:"NOT_MATCH",NUMBER:"NUMBER",STRING:"STRING",DOLLAR:"DOLLAR",NOT:"NOT",MINUS:"MINUS",PLUS:"PLUS",INCREMENT:"INCREMENT",DECREMENT:"DECREMENT"};function ge(e){e.expect(u.PRINT);let t=[];if(e.check(u.NEWLINE)||e.check(u.SEMICOLON)||e.check(u.RBRACE)||e.check(u.PIPE)||e.check(u.GT)||e.check(u.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(t.push(K(e));e.check(u.COMMA);)e.advance(),t.push(K(e));let n;return e.check(u.GT)?(e.advance(),n={redirect:">",file:e.parsePrimary()}):e.check(u.APPEND)&&(e.advance(),n={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:n}}function K(e){return Ct(e)?ee(e,!0):ee(e,!1)}function ee(e,t){let n=t?e.parseTernary():bt(e);if(e.match(u.ASSIGN,u.PLUS_ASSIGN,u.MINUS_ASSIGN,u.STAR_ASSIGN,u.SLASH_ASSIGN,u.PERCENT_ASSIGN,u.CARET_ASSIGN)){let i=e.advance(),a=ee(e,t);if(n.type!=="variable"&&n.type!=="field"&&n.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(i.value)??"=",target:n,value:a}}return n}function Ct(e){let t=0,n=e.pos;for(;n<e.tokens.length;){let i=e.tokens[n];if(i.type===u.LPAREN&&t++,i.type===u.RPAREN&&t--,i.type===u.QUESTION&&t===0)return!0;if(i.type===u.NEWLINE||i.type===u.SEMICOLON||i.type===u.RBRACE||i.type===u.COMMA||i.type===u.PIPE)return!1;n++}return!1}function bt(e){let t=Ae(e);for(;e.check(u.OR);){e.advance();let n=Ae(e);t={type:"binary",operator:"||",left:t,right:n}}return t}function Ae(e){let t=me(e);for(;e.check(u.AND);){e.advance();let n=me(e);t={type:"binary",operator:"&&",left:t,right:n}}return t}function me(e){let t=Ot(e);if(e.check(u.IN)){e.advance();let n=String(e.expect(u.IDENT).value);return{type:"in",key:t,array:n}}return t}function Ot(e){let t=Ie(e);for(;Lt(e)&&!Mt(e);){let n=Ie(e);t={type:"binary",operator:" ",left:t,right:n}}return t}function Ie(e){let t=we(e);for(;e.match(u.MATCH,u.NOT_MATCH);){let n=e.advance().type===u.MATCH?"~":"!~",i=we(e);t={type:"binary",operator:n,left:t,right:i}}return t}function we(e){let t=e.parseAddSub();for(;e.match(u.LT,u.LE,u.GE,u.EQ,u.NE);){let n=e.advance(),i=e.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}function Lt(e){return e.match(u.NUMBER,u.STRING,u.IDENT,u.DOLLAR,u.LPAREN,u.NOT,u.MINUS,u.PLUS,u.INCREMENT,u.DECREMENT)}function Mt(e){return e.match(u.AND,u.OR,u.QUESTION,u.ASSIGN,u.PLUS_ASSIGN,u.MINUS_ASSIGN,u.STAR_ASSIGN,u.SLASH_ASSIGN,u.PERCENT_ASSIGN,u.CARET_ASSIGN,u.COMMA,u.SEMICOLON,u.NEWLINE,u.RBRACE,u.RPAREN,u.RBRACKET,u.COLON,u.PIPE,u.APPEND,u.GT,u.IN)}function ve(e){e.expect(u.PRINTF);let t=e.check(u.LPAREN);t&&(e.advance(),e.skipNewlines());let n=t?e.parseExpression():K(e),i=[];for(;e.check(u.COMMA);)e.advance(),t&&e.skipNewlines(),i.push(t?e.parseExpression():K(e));t&&(e.skipNewlines(),e.expect(u.RPAREN));let a;return e.check(u.GT)?(e.advance(),a={redirect:">",file:e.parsePrimary()}):e.check(u.APPEND)&&(e.advance(),a={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:n,args:i,output:a}}var X=class{tokens=[];pos=0;parse(t){let n=new V(t);return this.tokens=n.tokenize(),this.pos=0,this.parseProgram()}setPos(t){this.pos=t}current(){return this.tokens[this.pos]||{type:r.EOF,value:"",line:0,column:0}}advance(){let t=this.current();return this.pos<this.tokens.length&&this.pos++,t}match(...t){return t.includes(this.current().type)}check(t){return this.current().type===t}expect(t,n){if(!this.check(t)){let i=this.current();throw new Error(n||`Expected ${t}, got ${i.type} at line ${i.line}:${i.column}`)}return this.advance()}skipNewlines(){for(;this.check(r.NEWLINE);)this.advance()}skipTerminators(){for(;this.check(r.NEWLINE)||this.check(r.SEMICOLON);)this.advance()}parseProgram(){let t=[],n=[];for(this.skipNewlines();!this.check(r.EOF)&&(this.skipNewlines(),!this.check(r.EOF));)this.check(r.FUNCTION)?t.push(this.parseFunction()):n.push(this.parseRule()),this.skipTerminators();return{functions:t,rules:n}}parseFunction(){this.expect(r.FUNCTION);let t=this.expect(r.IDENT).value;this.expect(r.LPAREN);let n=[];if(!this.check(r.RPAREN))for(n.push(this.expect(r.IDENT).value);this.check(r.COMMA);)this.advance(),n.push(this.expect(r.IDENT).value);this.expect(r.RPAREN),this.skipNewlines();let i=this.parseBlock();return{name:t,params:n,body:i}}parseRule(){let t;if(this.check(r.BEGIN))this.advance(),t={type:"begin"};else if(this.check(r.END))this.advance(),t={type:"end"};else if(this.check(r.LBRACE))t=void 0;else if(this.check(r.REGEX)){let i=this.advance();if(this.check(r.AND)||this.check(r.OR)){let a={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:i.value}};t={type:"expr_pattern",expression:this.parseLogicalOrRest(a)}}else{let a={type:"regex_pattern",pattern:i.value};if(this.check(r.COMMA)){this.advance();let s;this.check(r.REGEX)?s={type:"regex_pattern",pattern:this.advance().value}:s={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:a,end:s}}else t=a}}else{let a={type:"expr_pattern",expression:this.parseExpression()};if(this.check(r.COMMA)){this.advance();let s;this.check(r.REGEX)?s={type:"regex_pattern",pattern:this.advance().value}:s={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:a,end:s}}else t=a}this.skipNewlines();let n;return this.check(r.LBRACE)?n=this.parseBlock():n={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:t,action:n}}parseBlock(){this.expect(r.LBRACE),this.skipNewlines();let t=[];for(;!this.check(r.RBRACE)&&!this.check(r.EOF);)t.push(this.parseStatement()),this.skipTerminators();return this.expect(r.RBRACE),{type:"block",statements:t}}parseStatement(){if(this.check(r.SEMICOLON)||this.check(r.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(r.LBRACE))return this.parseBlock();if(this.check(r.IF))return this.parseIf();if(this.check(r.WHILE))return this.parseWhile();if(this.check(r.DO))return this.parseDoWhile();if(this.check(r.FOR))return this.parseFor();if(this.check(r.BREAK))return this.advance(),{type:"break"};if(this.check(r.CONTINUE))return this.advance(),{type:"continue"};if(this.check(r.NEXT))return this.advance(),{type:"next"};if(this.check(r.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(r.EXIT)){this.advance();let n;return!this.check(r.NEWLINE)&&!this.check(r.SEMICOLON)&&!this.check(r.RBRACE)&&!this.check(r.EOF)&&(n=this.parseExpression()),{type:"exit",code:n}}if(this.check(r.RETURN)){this.advance();let n;return!this.check(r.NEWLINE)&&!this.check(r.SEMICOLON)&&!this.check(r.RBRACE)&&!this.check(r.EOF)&&(n=this.parseExpression()),{type:"return",value:n}}if(this.check(r.DELETE)){this.advance();let n=this.parsePrimary();if(n.type!=="array_access"&&n.type!=="variable")throw new Error("delete requires array element or array");return{type:"delete",target:n}}return this.check(r.PRINT)?ge(this):this.check(r.PRINTF)?ve(this):{type:"expr_stmt",expression:this.parseExpression()}}parseIf(){this.expect(r.IF),this.expect(r.LPAREN);let t=this.parseExpression();this.expect(r.RPAREN),this.skipNewlines();let n=this.parseStatement();this.skipTerminators();let i;return this.check(r.ELSE)&&(this.advance(),this.skipNewlines(),i=this.parseStatement()),{type:"if",condition:t,consequent:n,alternate:i}}parseWhile(){this.expect(r.WHILE),this.expect(r.LPAREN);let t=this.parseExpression();this.expect(r.RPAREN),this.skipNewlines();let n=this.parseStatement();return{type:"while",condition:t,body:n}}parseDoWhile(){this.expect(r.DO),this.skipNewlines();let t=this.parseStatement();this.skipNewlines(),this.expect(r.WHILE),this.expect(r.LPAREN);let n=this.parseExpression();return this.expect(r.RPAREN),{type:"do_while",body:t,condition:n}}parseFor(){if(this.expect(r.FOR),this.expect(r.LPAREN),this.check(r.IDENT)){let s=this.advance();if(this.check(r.IN)){this.advance();let o=this.expect(r.IDENT).value;this.expect(r.RPAREN),this.skipNewlines();let l=this.parseStatement();return{type:"for_in",variable:s.value,array:o,body:l}}this.pos--}let t;this.check(r.SEMICOLON)||(t=this.parseExpression()),this.expect(r.SEMICOLON);let n;this.check(r.SEMICOLON)||(n=this.parseExpression()),this.expect(r.SEMICOLON);let i;this.check(r.RPAREN)||(i=this.parseExpression()),this.expect(r.RPAREN),this.skipNewlines();let a=this.parseStatement();return{type:"for",init:t,condition:n,update:i,body:a}}parseExpression(){return this.parseAssignment()}parseAssignment(){let t=this.parseTernary();if(this.match(r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN)){let n=this.advance(),i=this.parseAssignment();if(t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:{"=":"=","+=":"+=","-=":"-=","*=":"*=","/=":"/=","%=":"%=","^=":"^="}[n.value],target:t,value:i}}return t}parseTernary(){let t=this.parsePipeGetline();if(this.check(r.QUESTION)){this.advance();let n=this.parseExpression();this.expect(r.COLON);let i=this.parseExpression();t={type:"ternary",condition:t,consequent:n,alternate:i}}return t}parsePipeGetline(){let t=this.parseOr();if(this.check(r.PIPE)){if(this.advance(),!this.check(r.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();let n;return this.check(r.IDENT)&&(n=this.advance().value),{type:"getline",command:t,variable:n}}return t}parseOr(){let t=this.parseAnd();for(;this.check(r.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalOrRest(t){for(t=this.parseLogicalAndRest(t);this.check(r.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalAndRest(t){for(;this.check(r.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseAnd(){let t=this.parseIn();for(;this.check(r.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseIn(){let t=this.parseConcatenation();if(this.check(r.IN)){this.advance();let n=this.expect(r.IDENT).value;return{type:"in",key:t,array:n}}return t}parseConcatenation(){let t=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){let n=this.parseMatch();t={type:"binary",operator:" ",left:t,right:n}}return t}parseMatch(){let t=this.parseComparison();for(;this.match(r.MATCH,r.NOT_MATCH);){let n=this.advance().type===r.MATCH?"~":"!~",i=this.parseComparison();t={type:"binary",operator:n,left:t,right:i}}return t}parseComparison(){let t=this.parseAddSub();for(;this.match(r.LT,r.LE,r.GT,r.GE,r.EQ,r.NE);){let n=this.advance(),i=this.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}canStartExpression(){return this.match(r.NUMBER,r.STRING,r.IDENT,r.DOLLAR,r.LPAREN,r.NOT,r.MINUS,r.PLUS,r.INCREMENT,r.DECREMENT)}isConcatTerminator(){return this.match(r.AND,r.OR,r.QUESTION,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.COMMA,r.SEMICOLON,r.NEWLINE,r.RBRACE,r.RPAREN,r.RBRACKET,r.COLON,r.PIPE,r.APPEND,r.IN)}parseAddSub(){let t=this.parseMulDiv();for(;this.match(r.PLUS,r.MINUS);){let n=this.advance().value,i=this.parseMulDiv();t={type:"binary",operator:n,left:t,right:i}}return t}parseMulDiv(){let t=this.parseUnary();for(;this.match(r.STAR,r.SLASH,r.PERCENT);){let n=this.advance(),i=this.parseUnary();t={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(n.value)??"*",left:t,right:i}}return t}parseUnary(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseUnary();return{type:"unary",operator:t,operand:n}}return this.parsePower()}parsePower(){let t=this.parsePostfix();if(this.check(r.CARET)){this.advance();let n=this.parsePower();t={type:"binary",operator:"^",left:t,right:n}}return t}parsePostfix(){let t=this.parsePrimary();if(this.check(r.INCREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:t}}if(this.check(r.DECREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:t}}return t}parseFieldIndex(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseFieldIndex();return{type:"unary",operator:t,operand:n}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let t=this.parseFieldIndexPrimary();if(this.check(r.CARET)){this.advance();let n=this.parseFieldIndexPower();t={type:"binary",operator:"^",left:t,right:n}}return t}parseFieldIndexPrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();return this.expect(r.RPAREN),t}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=this.parseExpression();if(this.check(r.COMMA)){let i=[n];for(;this.check(r.COMMA);)this.advance(),i.push(this.parseExpression());this.expect(r.RBRACKET);let a=i.reduce((s,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:s,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:t,key:a}}return this.expect(r.RBRACKET),{type:"array_access",array:t,key:n}}return{type:"variable",name:t}}throw new Error(`Unexpected token in field index: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}parsePrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();if(this.check(r.COMMA)){let n=[t];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"tuple",elements:n}}return this.expect(r.RPAREN),t}if(this.check(r.GETLINE)){this.advance();let t,n;return this.check(r.IDENT)&&(t=this.advance().value),this.check(r.LT)&&(this.advance(),n=this.parsePrimary()),{type:"getline",variable:t,file:n}}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(this.skipNewlines(),!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),this.skipNewlines(),n.push(this.parseExpression());return this.skipNewlines(),this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=[this.parseExpression()];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());this.expect(r.RBRACKET);let i;if(n.length===1)i=n[0];else{i=n[0];for(let a=1;a<n.length;a++)i={type:"binary",operator:" ",left:{type:"binary",operator:" ",left:i,right:{type:"variable",name:"SUBSEP"}},right:n[a]}}return{type:"array_access",array:t,key:i}}return{type:"variable",name:t}}throw new Error(`Unexpected token: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}};var Pt={name:"awk",summary:"pattern scanning and text processing language",usage:"awk [OPTIONS] 'PROGRAM' [FILE...]",options:["-F FS use FS as field separator","-v VAR=VAL assign VAL to variable VAR"," --help display this help and exit"]},kn={name:"awk",async execute(e,t){if(ie(e))return re(Pt);let n=new M(/\s+/),i=" ",a=Object.create(null),s=0;for(let c=0;c<e.length;c++){let p=e[c];if(p==="-F"&&c+1<e.length)i=te(e[++c]),n=ke(i),s=c+1;else if(p.startsWith("-F"))i=te(p.slice(2)),n=ke(i),s=c+1;else if(p==="-v"&&c+1<e.length){let E=e[++c],d=E.indexOf("=");if(d>0){let R=E.slice(0,d),O=te(E.slice(d+1));a[R]=O}s=c+1}else{if(p.startsWith("--"))return j("awk",p);if(p.startsWith("-")&&p.length>1){let E=p[1];if(E!=="F"&&E!=="v")return j("awk",`-${E}`);s=c+1}else if(!p.startsWith("-")){s=c;break}}}if(s>=e.length)return{stdout:"",stderr:`awk: missing program
15
- `,exitCode:1};let o=e[s],l=e.slice(s+1),h=new X,N;try{N=h.parse(o)}catch(c){return{stdout:"",stderr:`awk: ${c instanceof Error?c.message:String(c)}
16
- `,exitCode:1}}let k={readFile:t.fs.readFile.bind(t.fs),writeFile:t.fs.writeFile.bind(t.fs),appendFile:async(c,p)=>{try{let E=await t.fs.readFile(c);await t.fs.writeFile(c,E+p)}catch{await t.fs.writeFile(c,p)}},resolvePath:t.fs.resolvePath.bind(t.fs)},y=Q({fieldSep:n,maxIterations:t.limits?.maxAwkIterations,fs:k,cwd:t.cwd,exec:t.exec?c=>t.exec(c,{cwd:t.cwd}):void 0});y.FS=i,y.vars=Object.assign(Object.create(null),a),y.ARGC=l.length+1,y.ARGV=Object.create(null),y.ARGV[0]="awk";for(let c=0;c<l.length;c++)y.ARGV[String(c+1)]=l[c];y.ENVIRON=se(t.env);let I=new D(y);I.execute(N);let ne=N.rules.some(c=>c.pattern?.type!=="begin"&&c.pattern?.type!=="end"),w=N.rules.some(c=>c.pattern?.type==="end");try{if(await I.executeBegin(),y.shouldExit)return await I.executeEnd(),{stdout:I.getOutput(),stderr:"",exitCode:I.getExitCode()};if(!ne&&!w)return{stdout:I.getOutput(),stderr:"",exitCode:I.getExitCode()};let c=[];if(l.length>0)for(let p of l)try{let E=t.fs.resolvePath(t.cwd,p),R=(await t.fs.readFile(E)).split(`
17
- `);R.length>0&&R[R.length-1]===""&&R.pop(),c.push({filename:p,lines:R})}catch{return{stdout:"",stderr:`awk: ${p}: No such file or directory
18
- `,exitCode:1}}else{let p=t.stdin.split(`
19
- `);p.length>0&&p[p.length-1]===""&&p.pop(),c.push({filename:"",lines:p})}for(let p of c){for(y.FILENAME=p.filename,y.FNR=0,y.lines=p.lines,y.lineIndex=-1,y.shouldNextFile=!1;y.lineIndex<p.lines.length-1&&(y.lineIndex++,await I.executeLine(p.lines[y.lineIndex]),!(y.shouldExit||y.shouldNextFile)););if(y.shouldExit)break}return await I.executeEnd(),{stdout:I.getOutput(),stderr:"",exitCode:I.getExitCode()}}catch(c){let p=c instanceof Error?c.message:String(c),E=c instanceof b?b.EXIT_CODE:2;return{stdout:I.getOutput(),stderr:`awk: ${p}
20
- `,exitCode:E}}}};function te(e){return e.replace(/\\t/g," ").replace(/\\n/g,`
21
- `).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function ke(e){if(e===" ")return m("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return m(e)}catch{return m(Ce(e))}return m(Ce(e))}function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{kn as awkCommand2};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as f}from"./chunk-JBABAK44.js";import{a as l,b as u}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var g={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},b={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};async function p(r,o,a){if(o.length===0||o.length===1&&o[0]==="-")return{ok:!0,data:Uint8Array.from(r.stdin,e=>e.charCodeAt(0))};let s=[];for(let e of o){if(e==="-"){s.push(Uint8Array.from(r.stdin,t=>t.charCodeAt(0)));continue}try{let t=r.fs.resolvePath(r.cwd,e),n=await r.fs.readFileBuffer(t);s.push(n)}catch{return{ok:!1,error:{stdout:"",stderr:`${a}: ${e}: No such file or directory
3
- `,exitCode:1}}}}let c=s.reduce((e,t)=>e+t.length,0),i=new Uint8Array(c),d=0;for(let e of s)i.set(e,d),d+=e.length;return{ok:!0,data:i}}var y={name:"base64",async execute(r,o){if(u(r))return l(g);let a=f("base64",r,b);if(!a.ok)return a.error;let s=a.result.flags.decode,c=a.result.flags.wrap,i=a.result.positional;try{if(s){let t=await p(o,i,"base64");if(!t.ok)return t.error;let h=String.fromCharCode(...t.data).replace(/\s/g,"");return{stdout:atob(h),stderr:"",exitCode:0}}let d=await p(o,i,"base64");if(!d.ok)return d.error;let e=btoa(String.fromCharCode(...d.data));if(c>0){let t=[];for(let n=0;n<e.length;n+=c)t.push(e.slice(n,n+c));e=t.join(`
4
- `)+(e.length>0?`
5
- `:"")}return{stdout:e,stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`base64: invalid input
6
- `,exitCode:1}}}};export{y as base64Command};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as r,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var p={name:"basename",summary:"strip directory and suffix from filenames",usage:`basename NAME [SUFFIX]
3
- basename OPTION... NAME...`,options:["-a, --multiple support multiple arguments","-s, --suffix=SUFFIX remove a trailing SUFFIX"," --help display this help and exit"]},c={name:"basename",async execute(n,u){if(m(n))return r(p);let i=!1,s="",a=[];for(let t=0;t<n.length;t++){let e=n[t];e==="-a"||e==="--multiple"?i=!0:e==="-s"&&t+1<n.length?(s=n[++t],i=!0):e.startsWith("--suffix=")?(s=e.slice(9),i=!0):e.startsWith("-")||a.push(e)}if(a.length===0)return{stdout:"",stderr:`basename: missing operand
4
- `,exitCode:1};!i&&a.length>=2&&(s=a.pop()??"");let o=[];for(let t of a){let e=t.replace(/\/+$/,""),l=e.split("/").pop()||e;s&&l.endsWith(s)&&(l=l.slice(0,-s.length)),o.push(l)}return{stdout:`${o.join(`
5
- `)}
6
- `,stderr:"",exitCode:0}}};export{c as basenameCommand};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{c as d}from"./chunk-4PRVMER6.js";import{a as h,b as l}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var u={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).']},C={name:"bash",async execute(e,t){if(l(e))return h(u);if(e[0]==="-c"&&e.length>=2){let r=e[1],s=e[2]||"bash",c=e.slice(3);return i(r,s,c,t)}if(e.length===0)return t.stdin?.trim()?i(t.stdin,"bash",[],t):{stdout:"",stderr:"",exitCode:0};let n=e[0],o=e.slice(1);try{let r=t.fs.resolvePath(t.cwd,n),s=await t.fs.readFile(r);return i(s,n,o,t)}catch{return{stdout:"",stderr:`bash: ${n}: No such file or directory
3
- `,exitCode:127}}}},b={name:"sh",async execute(e,t){if(l(e))return h({...u,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(e[0]==="-c"&&e.length>=2){let r=e[1],s=e[2]||"sh",c=e.slice(3);return i(r,s,c,t)}if(e.length===0)return t.stdin?.trim()?i(t.stdin,"sh",[],t):{stdout:"",stderr:"",exitCode:0};let n=e[0],o=e.slice(1);try{let r=t.fs.resolvePath(t.cwd,n),s=await t.fs.readFile(r);return i(s,n,o,t)}catch{return{stdout:"",stderr:`sh: ${n}: No such file or directory
4
- `,exitCode:127}}}};async function i(e,t,n,o){if(!o.exec)return{stdout:"",stderr:`bash: internal error: exec function not available
5
- `,exitCode:1};let r=d(o.exportedEnv||{},{0:t,"#":String(n.length),"@":n.join(" "),"*":n.join(" ")});n.forEach((a,m)=>{r[String(m+1)]=a});let s=e;if(s.startsWith("#!")){let a=s.indexOf(`
6
- `);a!==-1&&(s=s.slice(a+1))}return await o.exec(s,{env:r,cwd:o.cwd})}export{C as bashCommand,b as shCommand};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as p}from"./chunk-5WFYIUU2.js";import"./chunk-OBH7XN5N.js";import{a as d}from"./chunk-JBABAK44.js";import{a as c,b as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var f={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"]},b={number:{short:"n",long:"number",type:"boolean"}},w={name:"cat",async execute(t,r){if(m(t))return c(f);let e=d("cat",t,b);if(!e.ok)return e.error;let s=e.result.flags.number,o=e.result.positional,a=await p(r,o,{cmdName:"cat",allowStdinMarker:!0,stopOnError:!1}),n="",i=1;for(let{content:l}of a.files)if(s){let u=h(l,i);n+=u.content,i=u.nextLineNumber}else n+=l;return{stdout:n,stderr:a.stderr,exitCode:a.exitCode}}};function h(t,r){let e=t.split(`
3
- `),s=t.endsWith(`
4
- `),o=s?e.slice(0,-1):e;return{content:o.map((n,i)=>`${String(r+i).padStart(6," ")} ${n}`).join(`
5
- `)+(s?`
6
- `:""),nextLineNumber:r+o.length}}export{w as catCommand};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as g,b as $}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var C={name:"chmod",summary:"change file mode bits",usage:"chmod [OPTIONS] MODE FILE...",options:["-R change files recursively","-v output a diagnostic for every file processed"," --help display this help and exit"]},R={name:"chmod",async execute(s,a){if($(s))return g(C);if(s.length<2)return{stdout:"",stderr:`chmod: missing operand
3
- `,exitCode:1};let e=!1,c=!1,o=0;for(;o<s.length&&s[o].startsWith("-");){let t=s[o];if(t==="-R"||t==="--recursive")e=!0,o++;else if(t==="-v"||t==="--verbose")c=!0,o++;else if(t==="--"){o++;break}else{if(/^[+-]?[rwxugo]+/.test(t)||/^\d+$/.test(t))break;if(/^-[Rv]+$/.test(t)){t.includes("R")&&(e=!0),t.includes("v")&&(c=!0),o++;continue}return{stdout:"",stderr:`chmod: invalid option -- '${t.slice(1)}'
4
- `,exitCode:1}}}if(s.length-o<2)return{stdout:"",stderr:`chmod: missing operand
5
- `,exitCode:1};let n=s[o],d=s.slice(o+1),r=/^[0-7]+$/.test(n),i;if(r)i=parseInt(n,8);else try{p(n,420)}catch{return{stdout:"",stderr:`chmod: invalid mode: '${n}'
6
- `,exitCode:1}}let f="",l="",u=!1;for(let t of d){let h=a.fs.resolvePath(a.cwd,t);try{let m;if(r&&i!==void 0)m=i;else{let w=await a.fs.stat(h);m=p(n,w.mode)}if(await a.fs.chmod(h,m),c&&(f+=`mode of '${t}' changed to ${m.toString(8).padStart(4,"0")}
7
- `),e&&(await a.fs.stat(h)).isDirectory){let y=await v(a,h,r?i:void 0,r?void 0:n,c);f+=y}}catch{l+=`chmod: cannot access '${t}': No such file or directory
8
- `,u=!0}}return{stdout:f,stderr:l,exitCode:u?1:0}}};async function v(s,a,e,c,o){let n="",d=await s.fs.readdir(a);for(let r of d){let i=a==="/"?`/${r}`:`${a}/${r}`,f;if(e!==void 0)f=e;else if(c!==void 0){let u=await s.fs.stat(i);f=p(c,u.mode)}else f=420;await s.fs.chmod(i,f),o&&(n+=`mode of '${i}' changed to ${f.toString(8).padStart(4,"0")}
9
- `),(await s.fs.stat(i)).isDirectory&&(n+=await v(s,i,e,c,o))}return n}function p(s,a=420){if(/^[0-7]+$/.test(s))return parseInt(s,8);let e=a&4095,c=s.split(",");for(let o of c){let n=o.match(/^([ugoa]*)([+\-=])([rwxXst]*)$/);if(!n)throw new Error(`Invalid mode: ${s}`);let d=n[1]||"a",r=n[2],i=n[3];(d==="a"||d==="")&&(d="ugo");let f=0;i.includes("r")&&(f|=4),i.includes("w")&&(f|=2),(i.includes("x")||i.includes("X"))&&(f|=1);let l=0;i.includes("s")&&(d.includes("u")&&(l|=2048),d.includes("g")&&(l|=1024)),i.includes("t")&&(l|=512);for(let u of d){let t=0;u==="u"?t=6:u==="g"?t=3:u==="o"&&(t=0);let h=f<<t;r==="+"?e|=h:r==="-"?e&=~h:r==="="&&(e&=~(7<<t),e|=h)}r==="+"?e|=l:r==="-"?e&=~l:r==="="&&(i.includes("s")&&(d.includes("u")&&(e&=-2049,e|=l&2048),d.includes("g")&&(e&=-1025,e|=l&1024)),i.includes("t")&&(e&=-513,e|=l&512))}return e}export{R as chmodCommand};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as e,b as r}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var t={name:"clear",summary:"clear the terminal screen",usage:"clear [OPTIONS]",options:[" --help display this help and exit"]},s={name:"clear",async execute(a,c){return r(a)?e(t):{stdout:"\x1B[2J\x1B[H",stderr:"",exitCode:0}}};export{s as clearCommand};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as C}from"./chunk-JBABAK44.js";import{a as y,b as F}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var W={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"]},j={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 I(t,e,o){return e?o?t.split(e):t.split(e).filter(n=>n.length>0):o?t.split(/[ \t]/):t.split(/[ \t]+/).filter(n=>n.length>0)}function x(t){let e=[];for(let o of t)for(let n=0;n<o.length;n++){let l=o[n].length;(e[n]===void 0||l>e[n])&&(e[n]=l)}return e}function E(t,e){if(t.length===0)return"";let o=x(t),n=[];for(let l of t){let a=[];for(let s=0;s<l.length;s++)s===l.length-1?a.push(l[s]):a.push(l[s].padEnd(o[s]));n.push(a.join(e))}return n.join(`
3
- `)}function M(t,e,o){if(t.length===0)return"";let n=Math.max(...t.map(c=>c.length)),l=o.length,a=n+l,s=Math.max(1,Math.floor((e+l)/a)),h=Math.ceil(t.length/s),p=[];for(let c=0;c<h;c++){let i=[];for(let r=0;r<s;r++){let m=r*h+c;m<t.length&&(r===s-1||(r+1)*h+c>=t.length?i.push(t[m]):i.push(t[m].padEnd(n)))}p.push(i.join(o))}return p.join(`
4
- `)}var T={name:"column",execute:async(t,e)=>{if(F(t))return y(W);let o=C("column",t,j);if(!o.ok)return o.error;let{table:n,separator:l,outputSep:a,width:s,noMerge:h}=o.result.flags,p=o.result.positional,c=a??" ",i;if(p.length===0)i=e.stdin??"";else{let u=[];for(let f of p)if(f==="-")u.push(e.stdin??"");else{let w=e.fs.resolvePath(e.cwd,f),b=await e.fs.readFile(w);if(b===null)return{exitCode:1,stdout:"",stderr:`column: ${f}: No such file or directory
5
- `};u.push(b)}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),d;if(n){let u=g.map(f=>I(f,l,h));d=E(u,c)}else{let u=[];for(let f of g){let w=I(f,l,h);u.push(...w)}d=M(u,s,c)}return d.length>0&&(d+=`
8
- `),{exitCode:0,stdout:d,stderr:""}}};export{T as column};
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as g,b as $,c as y}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var x={name:"comm",summary:"compare two sorted files line by line",usage:"comm [OPTION]... FILE1 FILE2",options:["-1 suppress column 1 (lines unique to FILE1)","-2 suppress column 2 (lines unique to FILE2)","-3 suppress column 3 (lines that appear in both files)"," --help display this help and exit"]},I={name:"comm",async execute(p,c){if($(p))return g(x);let o=!1,i=!1,f=!1,l=[];for(let e of p)if(e==="-1")o=!0;else if(e==="-2")i=!0;else if(e==="-3")f=!0;else if(e==="-12"||e==="-21")o=!0,i=!0;else if(e==="-13"||e==="-31")o=!0,f=!0;else if(e==="-23"||e==="-32")i=!0,f=!0;else if(e==="-123"||e==="-132"||e==="-213"||e==="-231"||e==="-312"||e==="-321")o=!0,i=!0,f=!0;else{if(e.startsWith("-")&&e!=="-")return y("comm",e);l.push(e)}if(l.length!==2)return{stdout:"",stderr:`comm: missing operand
3
- Try 'comm --help' for more information.
4
- `,exitCode:1};let m=async e=>{if(e==="-")return c.stdin;try{let F=c.fs.resolvePath(c.cwd,e);return await c.fs.readFile(F)}catch{return null}},a=await m(l[0]);if(a===null)return{stdout:"",stderr:`comm: ${l[0]}: No such file or directory
5
- `,exitCode:1};let h=await m(l[1]);if(h===null)return{stdout:"",stderr:`comm: ${l[1]}: No such file or directory
6
- `,exitCode:1};let t=a.split(`
7
- `),s=h.split(`
8
- `);t.length>0&&t[t.length-1]===""&&t.pop(),s.length>0&&s[s.length-1]===""&&s.pop();let n=0,r=0,u="",d=o?"":" ",w=(o?"":" ")+(i?"":" ");for(;n<t.length||r<s.length;)n>=t.length?(i||(u+=`${d}${s[r]}
9
- `),r++):r>=s.length?(o||(u+=`${t[n]}
10
- `),n++):t[n]<s[r]?(o||(u+=`${t[n]}
11
- `),n++):t[n]>s[r]?(i||(u+=`${d}${s[r]}
12
- `),r++):(f||(u+=`${w}${t[n]}
13
- `),n++,r++);return{stdout:u,stderr:"",exitCode:0}}};export{I as commCommand};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as m}from"./chunk-JBABAK44.js";import{a as $}from"./chunk-4VDEBYW7.js";import{a as g,b as y}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var D={name:"cp",summary:"copy files and directories",usage:"cp [OPTION]... SOURCE... DEST",options:["-r, -R, --recursive copy directories recursively","-n, --no-clobber do not overwrite an existing file","-p, --preserve preserve file attributes","-v, --verbose explain what is being done"," --help display this help and exit"]},E={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},preserve:{short:"p",long:"preserve",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},R={name:"cp",async execute(f,e){if(y(f))return g(D);let t=m("cp",f,E);if(!t.ok)return t.error;let u=t.result.flags.recursive||t.result.flags.recursiveUpper,w=t.result.flags.noClobber,C=t.result.flags.preserve,P=t.result.flags.verbose,a=t.result.positional;if(a.length<2)return{stdout:"",stderr:`cp: missing destination file operand
3
- `,exitCode:1};let d=a.pop()??"",h=a,o=e.fs.resolvePath(e.cwd,d),v="",n="",l=0,p=!1;try{p=(await e.fs.stat(o)).isDirectory}catch{}if(h.length>1&&!p)return{stdout:"",stderr:`cp: target '${d}' is not a directory
4
- `,exitCode:1};for(let r of h)try{let i=e.fs.resolvePath(e.cwd,r),s=await e.fs.stat(i),c=o;if(p){let b=r.split("/").pop()||r;c=o==="/"?`/${b}`:`${o}/${b}`}if(s.isDirectory&&!u){n+=`cp: -r not specified; omitting directory '${r}'
5
- `,l=1;continue}if(w)try{await e.fs.stat(c);continue}catch{}await e.fs.cp(i,c,{recursive:u}),P&&(v+=`'${r}' -> '${c}'
6
- `)}catch(i){let s=$(i);s.includes("ENOENT")||s.includes("no such file")?n+=`cp: cannot stat '${r}': No such file or directory
7
- `:n+=`cp: cannot copy '${r}': ${s}
8
- `,l=1}return{stdout:v,stderr:n,exitCode:l}}};export{R as cpCommand};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{b as x}from"./chunk-5WFYIUU2.js";import"./chunk-OBH7XN5N.js";import{a as y,b as I,c as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.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 k(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 C(t,c){let l=[];for(let n of c){let s=n.start-1,r=n.end===null?t.length:n.end;for(let i=s;i<r&&i<t.length;i++)i>=0&&!l.includes(t[i])&&l.push(t[i])}return l}var E={name:"cut",async execute(t,c){if(I(t))return y(W);let l=" ",n=null,s=null,r=!1,i=[];for(let o=0;o<t.length;o++){let e=t[o];if(e==="-d")l=t[++o]||" ";else if(e.startsWith("-d"))l=e.slice(2);else if(e==="-f")n=t[++o];else if(e.startsWith("-f"))n=e.slice(2);else if(e==="-c")s=t[++o];else if(e.startsWith("-c"))s=e.slice(2);else if(e==="-s"||e==="--only-delimited")r=!0;else{if(e.startsWith("--"))return m("cut",e);if(e.startsWith("-")){let f=!1;for(let u of e.slice(1))if(u==="s")r=!0;else if(!"dfc".includes(u)){f=!0;break}if(f)return m("cut",e)}else i.push(e)}}if(!n&&!s)return{stdout:"",stderr:`cut: you must specify a list of bytes, characters, or fields
3
- `,exitCode:1};let p=await x(c,i,{cmdName:"cut"});if(!p.ok)return p.error;let a=p.content.split(`
4
- `);a.length>0&&a[a.length-1]===""&&a.pop();let g=k(n||s||"1"),h="";for(let o of a)if(s){let e=o.split(""),f=[];for(let u of g){let w=u.start-1,L=u.end===null?e.length:u.end;for(let d=w;d<L&&d<e.length;d++)d>=0&&f.push(e[d])}h+=`${f.join("")}
5
- `}else{if(r&&!o.includes(l))continue;let e=o.split(l),f=C(e,g);h+=`${f.join(l)}
6
- `}return{stdout:h,stderr:"",exitCode:0}}};export{E as cutCommand};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as g,b as k,c as m}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var p={name:"date",summary:"display the current time in the given FORMAT",usage:"date [OPTION]... [+FORMAT]",options:["-d, --date=STRING display time described by STRING","-u, --utc print Coordinated Universal Time (UTC)","-I, --iso-8601 output date/time in ISO 8601 format","-R, --rfc-email output RFC 5322 date format"," --help display this help and exit"]},M=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function n(t,i=2){return String(t).padStart(i,"0")}function T(t){let i=-t.getTimezoneOffset();return`${i>=0?"+":"-"}${n(Math.floor(Math.abs(i)/60))}${n(Math.abs(i)%60)}`}function d(t,i,r){let a=r?{Y:t.getUTCFullYear(),m:t.getUTCMonth(),D:t.getUTCDate(),H:t.getUTCHours(),M:t.getUTCMinutes(),S:t.getUTCSeconds(),w:t.getUTCDay()}:{Y:t.getFullYear(),m:t.getMonth(),D:t.getDate(),H:t.getHours(),M:t.getMinutes(),S:t.getSeconds(),w:t.getDay()},e="",o=0;for(;o<i.length;){if(i[o]==="%"&&o+1<i.length){let c=i[++o];switch(c){case"%":e+="%";break;case"a":e+=M[a.w];break;case"b":case"h":e+=h[a.m];break;case"d":e+=n(a.D);break;case"e":e+=String(a.D).padStart(2," ");break;case"F":e+=`${a.Y}-${n(a.m+1)}-${n(a.D)}`;break;case"H":e+=n(a.H);break;case"I":e+=n(a.H%12||12);break;case"m":e+=n(a.m+1);break;case"M":e+=n(a.M);break;case"n":e+=`
3
- `;break;case"p":e+=a.H<12?"AM":"PM";break;case"P":e+=a.H<12?"am":"pm";break;case"R":e+=`${n(a.H)}:${n(a.M)}`;break;case"s":e+=Math.floor(t.getTime()/1e3);break;case"S":e+=n(a.S);break;case"t":e+=" ";break;case"T":e+=`${n(a.H)}:${n(a.M)}:${n(a.S)}`;break;case"u":e+=a.w||7;break;case"w":e+=a.w;break;case"y":e+=n(a.Y%100);break;case"Y":e+=a.Y;break;case"z":e+=r?"+0000":T(t);break;case"Z":e+=r?"UTC":Intl.DateTimeFormat().resolvedOptions().timeZone;break;default:e+=`%${c}`}}else e+=i[o];o++}return e}function S(t){let i=new Date(t);if(!Number.isNaN(i.getTime()))return i;if(/^\d+$/.test(t))return new Date(Number.parseInt(t,10)*1e3);let r=t.toLowerCase();return r==="now"||r==="today"?new Date:r==="yesterday"?new Date(Date.now()-864e5):r==="tomorrow"?new Date(Date.now()+864e5):null}var w={name:"date",async execute(t,i){if(k(t))return g(p);let r=!1,a=null,e=null,o=!1,c=!1;for(let f=0;f<t.length;f++){let s=t[f];if(s==="-u"||s==="--utc")r=!0;else if(s==="-d"||s==="--date")a=t[++f]??"";else if(s.startsWith("--date="))a=s.slice(7);else if(s==="-I"||s==="--iso-8601")o=!0;else if(s==="-R"||s==="--rfc-email")c=!0;else if(s.startsWith("+"))e=s.slice(1);else{if(s.startsWith("--"))return m("date",s);if(s.startsWith("-"))for(let b of s.slice(1))if(b==="u")r=!0;else if(b==="I")o=!0;else if(b==="R")c=!0;else return m("date",`-${b}`)}}let l=a!==null?S(a):new Date;if(!l)return{stdout:"",stderr:`date: invalid date '${a}'
4
- `,exitCode:1};let u;return e?u=d(l,e,r):o?u=d(l,"%Y-%m-%dT%H:%M:%S%z",r):c?u=d(l,"%a, %d %b %Y %H:%M:%S %z",r):u=d(l,"%a %b %e %H:%M:%S %Z %Y",r),{stdout:`${u}
5
- `,stderr:"",exitCode:0}}};export{w as dateCommand};