just-binary 2.9.8

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 (841) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +458 -0
  3. package/dist/AGENTS.md +323 -0
  4. package/dist/Bash.d.ts +179 -0
  5. package/dist/ast/types.d.ts +615 -0
  6. package/dist/banned-patterns-test.d.ts +8 -0
  7. package/dist/bin/chunks/alias-23G4Q2RS.js +2 -0
  8. package/dist/bin/chunks/awk2-Z6VRXKAK.js +2 -0
  9. package/dist/bin/chunks/base64-DNX4WCIO.js +2 -0
  10. package/dist/bin/chunks/basename-MPQ7M4RF.js +2 -0
  11. package/dist/bin/chunks/bash-OQ32Y5I6.js +2 -0
  12. package/dist/bin/chunks/bytes-6YUZMX3P.js +2 -0
  13. package/dist/bin/chunks/cat-CL5ISR5P.js +2 -0
  14. package/dist/bin/chunks/chmod-R6IWRSKZ.js +2 -0
  15. package/dist/bin/chunks/chunk-227L3ACM.js +23 -0
  16. package/dist/bin/chunks/chunk-2QA4P6HI.js +12 -0
  17. package/dist/bin/chunks/chunk-3MFM4GSH.js +36 -0
  18. package/dist/bin/chunks/chunk-3UP5LXDO.js +3 -0
  19. package/dist/bin/chunks/chunk-47P7JSQI.js +2 -0
  20. package/dist/bin/chunks/chunk-4KBTPDQB.js +3 -0
  21. package/dist/bin/chunks/chunk-4UK2MV3F.js +13 -0
  22. package/dist/bin/chunks/chunk-4VDEBYW7.js +2 -0
  23. package/dist/bin/chunks/chunk-563AO4OL.js +7 -0
  24. package/dist/bin/chunks/chunk-5HDWUXRX.js +7 -0
  25. package/dist/bin/chunks/chunk-5MCFI6LE.js +5 -0
  26. package/dist/bin/chunks/chunk-6CZOPIZD.js +6 -0
  27. package/dist/bin/chunks/chunk-6FNFX5GG.js +5 -0
  28. package/dist/bin/chunks/chunk-6NYIHYDY.js +7 -0
  29. package/dist/bin/chunks/chunk-6Y4TKR73.js +16 -0
  30. package/dist/bin/chunks/chunk-7C7WEK46.js +23 -0
  31. package/dist/bin/chunks/chunk-7TNGQWY6.js +6 -0
  32. package/dist/bin/chunks/chunk-7UAWRBQS.js +9 -0
  33. package/dist/bin/chunks/chunk-ARGU3OIG.js +17 -0
  34. package/dist/bin/chunks/chunk-BA3A5BYZ.js +3 -0
  35. package/dist/bin/chunks/chunk-BB7T22CF.js +140 -0
  36. package/dist/bin/chunks/chunk-BY24LKGP.js +8 -0
  37. package/dist/bin/chunks/chunk-CRHN4WNQ.js +63 -0
  38. package/dist/bin/chunks/chunk-ELZHJGI7.js +10 -0
  39. package/dist/bin/chunks/chunk-F46CSMUF.js +2 -0
  40. package/dist/bin/chunks/chunk-FQX4G5RH.js +7 -0
  41. package/dist/bin/chunks/chunk-G43H2WGH.js +17 -0
  42. package/dist/bin/chunks/chunk-GIFF636B.js +2 -0
  43. package/dist/bin/chunks/chunk-GMJWC3MC.js +12 -0
  44. package/dist/bin/chunks/chunk-HVDU57EV.js +16 -0
  45. package/dist/bin/chunks/chunk-HWGK3XW7.js +6 -0
  46. package/dist/bin/chunks/chunk-HYR7G7KS.js +3 -0
  47. package/dist/bin/chunks/chunk-I2225JSU.js +14 -0
  48. package/dist/bin/chunks/chunk-I2FUQZXU.js +11 -0
  49. package/dist/bin/chunks/chunk-IBHPKKIT.js +10 -0
  50. package/dist/bin/chunks/chunk-IKNNFJNZ.js +14 -0
  51. package/dist/bin/chunks/chunk-INPUJM7Y.js +8 -0
  52. package/dist/bin/chunks/chunk-IOBKPMWJ.js +9 -0
  53. package/dist/bin/chunks/chunk-IYSA2L6A.js +13 -0
  54. package/dist/bin/chunks/chunk-JMLNX7GE.js +287 -0
  55. package/dist/bin/chunks/chunk-K2K4KPOQ.js +3 -0
  56. package/dist/bin/chunks/chunk-K6DD7NH3.js +9 -0
  57. package/dist/bin/chunks/chunk-KFLJ4EMB.js +4 -0
  58. package/dist/bin/chunks/chunk-KOMDAXHM.js +7 -0
  59. package/dist/bin/chunks/chunk-KV7ZTM2R.js +11 -0
  60. package/dist/bin/chunks/chunk-LCCVVEJA.js +10 -0
  61. package/dist/bin/chunks/chunk-LUPJK5US.js +84 -0
  62. package/dist/bin/chunks/chunk-LWF3XDOC.js +32 -0
  63. package/dist/bin/chunks/chunk-LXNARM2C.js +9 -0
  64. package/dist/bin/chunks/chunk-LXZS3X5T.js +9 -0
  65. package/dist/bin/chunks/chunk-M4ICSCXT.js +100 -0
  66. package/dist/bin/chunks/chunk-MEBZXRGE.js +5 -0
  67. package/dist/bin/chunks/chunk-MSPSS36S.js +16 -0
  68. package/dist/bin/chunks/chunk-N335RIGZ.js +20 -0
  69. package/dist/bin/chunks/chunk-N5KGQWJH.js +5 -0
  70. package/dist/bin/chunks/chunk-NDHTQE5T.js +8 -0
  71. package/dist/bin/chunks/chunk-NF5G7X3O.js +7 -0
  72. package/dist/bin/chunks/chunk-NGKNJ6V2.js +11 -0
  73. package/dist/bin/chunks/chunk-OBH7XN5N.js +1 -0
  74. package/dist/bin/chunks/chunk-OKQ6RACF.js +73 -0
  75. package/dist/bin/chunks/chunk-PBY7XGZ6.js +8 -0
  76. package/dist/bin/chunks/chunk-PHHNNFRS.js +6 -0
  77. package/dist/bin/chunks/chunk-PO6Y7TWQ.js +6 -0
  78. package/dist/bin/chunks/chunk-Q4TLKLIZ.js +12 -0
  79. package/dist/bin/chunks/chunk-QS6LP3E3.js +6 -0
  80. package/dist/bin/chunks/chunk-QT2GMJRJ.js +8 -0
  81. package/dist/bin/chunks/chunk-QUVW3R4I.js +5 -0
  82. package/dist/bin/chunks/chunk-QUYWT2TY.js +21 -0
  83. package/dist/bin/chunks/chunk-QWUII542.js +2 -0
  84. package/dist/bin/chunks/chunk-R5EQDD5Y.js +13 -0
  85. package/dist/bin/chunks/chunk-RQSPCXDR.js +2 -0
  86. package/dist/bin/chunks/chunk-RTC6C5QW.js +2 -0
  87. package/dist/bin/chunks/chunk-S5W2KVHC.js +2 -0
  88. package/dist/bin/chunks/chunk-SDXDICI4.js +2 -0
  89. package/dist/bin/chunks/chunk-SE4C7FJY.js +33 -0
  90. package/dist/bin/chunks/chunk-SX7TI7Q2.js +3 -0
  91. package/dist/bin/chunks/chunk-TDJ55L4A.js +16 -0
  92. package/dist/bin/chunks/chunk-TNPUAMV3.js +8 -0
  93. package/dist/bin/chunks/chunk-TSGSFBQI.js +14 -0
  94. package/dist/bin/chunks/chunk-U5ZE562V.js +2 -0
  95. package/dist/bin/chunks/chunk-UIMH6I3G.js +33 -0
  96. package/dist/bin/chunks/chunk-UXPY5T2P.js +9 -0
  97. package/dist/bin/chunks/chunk-UYBH3FNE.js +2 -0
  98. package/dist/bin/chunks/chunk-V5I6PHN2.js +14 -0
  99. package/dist/bin/chunks/chunk-VOTJNR36.js +5 -0
  100. package/dist/bin/chunks/chunk-W5XFREQC.js +3 -0
  101. package/dist/bin/chunks/chunk-X2MOXVGO.js +26 -0
  102. package/dist/bin/chunks/chunk-XOGQUO62.js +2 -0
  103. package/dist/bin/chunks/chunk-Y57BDPQ5.js +6 -0
  104. package/dist/bin/chunks/chunk-YE6KXFFU.js +2 -0
  105. package/dist/bin/chunks/chunk-YEPWKN4F.js +3 -0
  106. package/dist/bin/chunks/chunk-ZEDWVSUZ.js +19 -0
  107. package/dist/bin/chunks/chunk-ZI4TTZL5.js +21 -0
  108. package/dist/bin/chunks/chunk-ZZVIGHYS.js +7 -0
  109. package/dist/bin/chunks/clear-27OP2FQZ.js +2 -0
  110. package/dist/bin/chunks/column-FJNKONCJ.js +2 -0
  111. package/dist/bin/chunks/comm-5FNEJE7X.js +2 -0
  112. package/dist/bin/chunks/cp-LVKHKFHQ.js +2 -0
  113. package/dist/bin/chunks/curl-S4FJSZA5.js +26 -0
  114. package/dist/bin/chunks/cut-UXU6PNTT.js +2 -0
  115. package/dist/bin/chunks/date-GGPTXVUT.js +2 -0
  116. package/dist/bin/chunks/diff-3V3FOITV.js +2 -0
  117. package/dist/bin/chunks/dirname-455JDV2M.js +2 -0
  118. package/dist/bin/chunks/du-WUEAQO2W.js +2 -0
  119. package/dist/bin/chunks/echo-HBXOI5TQ.js +2 -0
  120. package/dist/bin/chunks/env-MXFHTVHS.js +2 -0
  121. package/dist/bin/chunks/expand-F4FM4ML2.js +2 -0
  122. package/dist/bin/chunks/expansion-7AYBVOIQ.js +2 -0
  123. package/dist/bin/chunks/expr-5ZKR5ER5.js +2 -0
  124. package/dist/bin/chunks/file-BFN7BKUR.js +2 -0
  125. package/dist/bin/chunks/find-W4BCEJEC.js +2 -0
  126. package/dist/bin/chunks/flag-coverage-DBKGNLJO.js +2 -0
  127. package/dist/bin/chunks/fold-AE57YLOS.js +2 -0
  128. package/dist/bin/chunks/grep-I63BWUKL.js +2 -0
  129. package/dist/bin/chunks/gzip-X5IDXWZE.js +2 -0
  130. package/dist/bin/chunks/head-TBQETLQX.js +2 -0
  131. package/dist/bin/chunks/help-HGMKZ2GW.js +2 -0
  132. package/dist/bin/chunks/history-2DYRIL3U.js +2 -0
  133. package/dist/bin/chunks/hostname-RWEPTCXH.js +2 -0
  134. package/dist/bin/chunks/html-to-markdown-2VQWCEKU.js +2 -0
  135. package/dist/bin/chunks/join-TRRWQBEU.js +2 -0
  136. package/dist/bin/chunks/jq-NFKKH27D.js +2 -0
  137. package/dist/bin/chunks/ln-BSEVUP2J.js +2 -0
  138. package/dist/bin/chunks/ls-IJLTWVOI.js +2 -0
  139. package/dist/bin/chunks/md5sum-ZIQHOC4K.js +2 -0
  140. package/dist/bin/chunks/mkdir-KYFAO2SF.js +2 -0
  141. package/dist/bin/chunks/mv-TWM2PA7Q.js +2 -0
  142. package/dist/bin/chunks/nl-XLF2HFST.js +2 -0
  143. package/dist/bin/chunks/od-BOM6JPTH.js +2 -0
  144. package/dist/bin/chunks/paste-FUGXVGJX.js +2 -0
  145. package/dist/bin/chunks/printf-XUGNJ3QM.js +2 -0
  146. package/dist/bin/chunks/pwd-RZG6GZEU.js +2 -0
  147. package/dist/bin/chunks/python3-PIXJS3YM.js +14 -0
  148. package/dist/bin/chunks/readlink-4SOSIDHE.js +2 -0
  149. package/dist/bin/chunks/rev-5E5UGSUZ.js +2 -0
  150. package/dist/bin/chunks/rg-4YJSQZN7.js +2 -0
  151. package/dist/bin/chunks/rm-3PFOF4E3.js +2 -0
  152. package/dist/bin/chunks/rmdir-CSK7CGH5.js +2 -0
  153. package/dist/bin/chunks/sed-XBCUZMEP.js +2 -0
  154. package/dist/bin/chunks/seq-H7ID4VMK.js +2 -0
  155. package/dist/bin/chunks/sha1sum-EDQNYXXH.js +2 -0
  156. package/dist/bin/chunks/sha256sum-APTG6DO2.js +2 -0
  157. package/dist/bin/chunks/sleep-PNT7KILS.js +2 -0
  158. package/dist/bin/chunks/sort-ELAGZUES.js +2 -0
  159. package/dist/bin/chunks/split-QGXYUWBC.js +2 -0
  160. package/dist/bin/chunks/sqlite3-ELLMKNNJ.js +2 -0
  161. package/dist/bin/chunks/stat-Q2TZRKO3.js +2 -0
  162. package/dist/bin/chunks/strings-IGEGP5QX.js +2 -0
  163. package/dist/bin/chunks/tac-VOEDJLLG.js +2 -0
  164. package/dist/bin/chunks/tail-JOQASWMV.js +2 -0
  165. package/dist/bin/chunks/tar-2UVSVD3P.js +2 -0
  166. package/dist/bin/chunks/tee-IQLEDZOQ.js +2 -0
  167. package/dist/bin/chunks/time-VRCJK2LI.js +2 -0
  168. package/dist/bin/chunks/timeout-A36YWZWR.js +2 -0
  169. package/dist/bin/chunks/touch-5ECNQNBP.js +2 -0
  170. package/dist/bin/chunks/tr-AVALLN54.js +2 -0
  171. package/dist/bin/chunks/tree-UFM5EDXS.js +2 -0
  172. package/dist/bin/chunks/true-BU5JSAAW.js +2 -0
  173. package/dist/bin/chunks/unexpand-TDRWZW5F.js +2 -0
  174. package/dist/bin/chunks/uniq-IKBUNAMN.js +2 -0
  175. package/dist/bin/chunks/wc-2R4RS2SX.js +2 -0
  176. package/dist/bin/chunks/which-6UVGMXDF.js +2 -0
  177. package/dist/bin/chunks/whoami-N6TLTETT.js +2 -0
  178. package/dist/bin/chunks/worker.js +2260 -0
  179. package/dist/bin/chunks/xan-JX5QUK32.js +2 -0
  180. package/dist/bin/chunks/xan-view-NFMUMJ7Z.js +2 -0
  181. package/dist/bin/chunks/xargs-4MYN4U3C.js +2 -0
  182. package/dist/bin/chunks/yq-EHDQVD7S.js +2 -0
  183. package/dist/bin/just-bash.js +732 -0
  184. package/dist/bin/shell/chunks/alias-23G4Q2RS.js +2 -0
  185. package/dist/bin/shell/chunks/awk2-Z6VRXKAK.js +2 -0
  186. package/dist/bin/shell/chunks/base64-DNX4WCIO.js +2 -0
  187. package/dist/bin/shell/chunks/basename-MPQ7M4RF.js +2 -0
  188. package/dist/bin/shell/chunks/bash-OQ32Y5I6.js +2 -0
  189. package/dist/bin/shell/chunks/bytes-6YUZMX3P.js +2 -0
  190. package/dist/bin/shell/chunks/cat-CL5ISR5P.js +2 -0
  191. package/dist/bin/shell/chunks/chmod-R6IWRSKZ.js +2 -0
  192. package/dist/bin/shell/chunks/chunk-227L3ACM.js +23 -0
  193. package/dist/bin/shell/chunks/chunk-2QA4P6HI.js +12 -0
  194. package/dist/bin/shell/chunks/chunk-3MFM4GSH.js +36 -0
  195. package/dist/bin/shell/chunks/chunk-3UP5LXDO.js +3 -0
  196. package/dist/bin/shell/chunks/chunk-47P7JSQI.js +2 -0
  197. package/dist/bin/shell/chunks/chunk-4KBTPDQB.js +3 -0
  198. package/dist/bin/shell/chunks/chunk-4UK2MV3F.js +13 -0
  199. package/dist/bin/shell/chunks/chunk-4VDEBYW7.js +2 -0
  200. package/dist/bin/shell/chunks/chunk-563AO4OL.js +7 -0
  201. package/dist/bin/shell/chunks/chunk-5HDWUXRX.js +7 -0
  202. package/dist/bin/shell/chunks/chunk-5MCFI6LE.js +5 -0
  203. package/dist/bin/shell/chunks/chunk-6CZOPIZD.js +6 -0
  204. package/dist/bin/shell/chunks/chunk-6FNFX5GG.js +5 -0
  205. package/dist/bin/shell/chunks/chunk-6NYIHYDY.js +7 -0
  206. package/dist/bin/shell/chunks/chunk-6Y4TKR73.js +16 -0
  207. package/dist/bin/shell/chunks/chunk-7C7WEK46.js +23 -0
  208. package/dist/bin/shell/chunks/chunk-7TNGQWY6.js +6 -0
  209. package/dist/bin/shell/chunks/chunk-7UAWRBQS.js +9 -0
  210. package/dist/bin/shell/chunks/chunk-ARGU3OIG.js +17 -0
  211. package/dist/bin/shell/chunks/chunk-BA3A5BYZ.js +3 -0
  212. package/dist/bin/shell/chunks/chunk-BB7T22CF.js +140 -0
  213. package/dist/bin/shell/chunks/chunk-BY24LKGP.js +8 -0
  214. package/dist/bin/shell/chunks/chunk-CRHN4WNQ.js +63 -0
  215. package/dist/bin/shell/chunks/chunk-ELZHJGI7.js +10 -0
  216. package/dist/bin/shell/chunks/chunk-F46CSMUF.js +2 -0
  217. package/dist/bin/shell/chunks/chunk-FQX4G5RH.js +7 -0
  218. package/dist/bin/shell/chunks/chunk-G43H2WGH.js +17 -0
  219. package/dist/bin/shell/chunks/chunk-GIFF636B.js +2 -0
  220. package/dist/bin/shell/chunks/chunk-GMJWC3MC.js +12 -0
  221. package/dist/bin/shell/chunks/chunk-HVDU57EV.js +16 -0
  222. package/dist/bin/shell/chunks/chunk-HWGK3XW7.js +6 -0
  223. package/dist/bin/shell/chunks/chunk-HYR7G7KS.js +3 -0
  224. package/dist/bin/shell/chunks/chunk-I2225JSU.js +14 -0
  225. package/dist/bin/shell/chunks/chunk-I2FUQZXU.js +11 -0
  226. package/dist/bin/shell/chunks/chunk-IBHPKKIT.js +10 -0
  227. package/dist/bin/shell/chunks/chunk-IKNNFJNZ.js +14 -0
  228. package/dist/bin/shell/chunks/chunk-INPUJM7Y.js +8 -0
  229. package/dist/bin/shell/chunks/chunk-IOBKPMWJ.js +9 -0
  230. package/dist/bin/shell/chunks/chunk-IYSA2L6A.js +13 -0
  231. package/dist/bin/shell/chunks/chunk-JMLNX7GE.js +287 -0
  232. package/dist/bin/shell/chunks/chunk-K2K4KPOQ.js +3 -0
  233. package/dist/bin/shell/chunks/chunk-K6DD7NH3.js +9 -0
  234. package/dist/bin/shell/chunks/chunk-KFLJ4EMB.js +4 -0
  235. package/dist/bin/shell/chunks/chunk-KOMDAXHM.js +7 -0
  236. package/dist/bin/shell/chunks/chunk-KV7ZTM2R.js +11 -0
  237. package/dist/bin/shell/chunks/chunk-LCCVVEJA.js +10 -0
  238. package/dist/bin/shell/chunks/chunk-LUPJK5US.js +84 -0
  239. package/dist/bin/shell/chunks/chunk-LWF3XDOC.js +32 -0
  240. package/dist/bin/shell/chunks/chunk-LXNARM2C.js +9 -0
  241. package/dist/bin/shell/chunks/chunk-LXZS3X5T.js +9 -0
  242. package/dist/bin/shell/chunks/chunk-M4ICSCXT.js +100 -0
  243. package/dist/bin/shell/chunks/chunk-MEBZXRGE.js +5 -0
  244. package/dist/bin/shell/chunks/chunk-MSPSS36S.js +16 -0
  245. package/dist/bin/shell/chunks/chunk-N335RIGZ.js +20 -0
  246. package/dist/bin/shell/chunks/chunk-N5KGQWJH.js +5 -0
  247. package/dist/bin/shell/chunks/chunk-NDHTQE5T.js +8 -0
  248. package/dist/bin/shell/chunks/chunk-NF5G7X3O.js +7 -0
  249. package/dist/bin/shell/chunks/chunk-NGKNJ6V2.js +11 -0
  250. package/dist/bin/shell/chunks/chunk-OBH7XN5N.js +1 -0
  251. package/dist/bin/shell/chunks/chunk-OKQ6RACF.js +73 -0
  252. package/dist/bin/shell/chunks/chunk-PBY7XGZ6.js +8 -0
  253. package/dist/bin/shell/chunks/chunk-PHHNNFRS.js +6 -0
  254. package/dist/bin/shell/chunks/chunk-PO6Y7TWQ.js +6 -0
  255. package/dist/bin/shell/chunks/chunk-Q4TLKLIZ.js +12 -0
  256. package/dist/bin/shell/chunks/chunk-QS6LP3E3.js +6 -0
  257. package/dist/bin/shell/chunks/chunk-QT2GMJRJ.js +8 -0
  258. package/dist/bin/shell/chunks/chunk-QUVW3R4I.js +5 -0
  259. package/dist/bin/shell/chunks/chunk-QUYWT2TY.js +21 -0
  260. package/dist/bin/shell/chunks/chunk-QWUII542.js +2 -0
  261. package/dist/bin/shell/chunks/chunk-R5EQDD5Y.js +13 -0
  262. package/dist/bin/shell/chunks/chunk-RQSPCXDR.js +2 -0
  263. package/dist/bin/shell/chunks/chunk-RTC6C5QW.js +2 -0
  264. package/dist/bin/shell/chunks/chunk-S5W2KVHC.js +2 -0
  265. package/dist/bin/shell/chunks/chunk-SDXDICI4.js +2 -0
  266. package/dist/bin/shell/chunks/chunk-SE4C7FJY.js +33 -0
  267. package/dist/bin/shell/chunks/chunk-SX7TI7Q2.js +3 -0
  268. package/dist/bin/shell/chunks/chunk-TDJ55L4A.js +16 -0
  269. package/dist/bin/shell/chunks/chunk-TNPUAMV3.js +8 -0
  270. package/dist/bin/shell/chunks/chunk-TSGSFBQI.js +14 -0
  271. package/dist/bin/shell/chunks/chunk-U5ZE562V.js +2 -0
  272. package/dist/bin/shell/chunks/chunk-UIMH6I3G.js +33 -0
  273. package/dist/bin/shell/chunks/chunk-UXPY5T2P.js +9 -0
  274. package/dist/bin/shell/chunks/chunk-UYBH3FNE.js +2 -0
  275. package/dist/bin/shell/chunks/chunk-V5I6PHN2.js +14 -0
  276. package/dist/bin/shell/chunks/chunk-VOTJNR36.js +5 -0
  277. package/dist/bin/shell/chunks/chunk-W5XFREQC.js +3 -0
  278. package/dist/bin/shell/chunks/chunk-X2MOXVGO.js +26 -0
  279. package/dist/bin/shell/chunks/chunk-XOGQUO62.js +2 -0
  280. package/dist/bin/shell/chunks/chunk-Y57BDPQ5.js +6 -0
  281. package/dist/bin/shell/chunks/chunk-YE6KXFFU.js +2 -0
  282. package/dist/bin/shell/chunks/chunk-YEPWKN4F.js +3 -0
  283. package/dist/bin/shell/chunks/chunk-ZEDWVSUZ.js +19 -0
  284. package/dist/bin/shell/chunks/chunk-ZI4TTZL5.js +21 -0
  285. package/dist/bin/shell/chunks/chunk-ZZVIGHYS.js +7 -0
  286. package/dist/bin/shell/chunks/clear-27OP2FQZ.js +2 -0
  287. package/dist/bin/shell/chunks/column-FJNKONCJ.js +2 -0
  288. package/dist/bin/shell/chunks/comm-5FNEJE7X.js +2 -0
  289. package/dist/bin/shell/chunks/cp-LVKHKFHQ.js +2 -0
  290. package/dist/bin/shell/chunks/curl-S4FJSZA5.js +26 -0
  291. package/dist/bin/shell/chunks/cut-UXU6PNTT.js +2 -0
  292. package/dist/bin/shell/chunks/date-GGPTXVUT.js +2 -0
  293. package/dist/bin/shell/chunks/diff-3V3FOITV.js +2 -0
  294. package/dist/bin/shell/chunks/dirname-455JDV2M.js +2 -0
  295. package/dist/bin/shell/chunks/du-WUEAQO2W.js +2 -0
  296. package/dist/bin/shell/chunks/echo-HBXOI5TQ.js +2 -0
  297. package/dist/bin/shell/chunks/env-MXFHTVHS.js +2 -0
  298. package/dist/bin/shell/chunks/expand-F4FM4ML2.js +2 -0
  299. package/dist/bin/shell/chunks/expansion-7AYBVOIQ.js +2 -0
  300. package/dist/bin/shell/chunks/expr-5ZKR5ER5.js +2 -0
  301. package/dist/bin/shell/chunks/file-BFN7BKUR.js +2 -0
  302. package/dist/bin/shell/chunks/find-W4BCEJEC.js +2 -0
  303. package/dist/bin/shell/chunks/flag-coverage-DBKGNLJO.js +2 -0
  304. package/dist/bin/shell/chunks/fold-AE57YLOS.js +2 -0
  305. package/dist/bin/shell/chunks/grep-I63BWUKL.js +2 -0
  306. package/dist/bin/shell/chunks/gzip-X5IDXWZE.js +2 -0
  307. package/dist/bin/shell/chunks/head-TBQETLQX.js +2 -0
  308. package/dist/bin/shell/chunks/help-HGMKZ2GW.js +2 -0
  309. package/dist/bin/shell/chunks/history-2DYRIL3U.js +2 -0
  310. package/dist/bin/shell/chunks/hostname-RWEPTCXH.js +2 -0
  311. package/dist/bin/shell/chunks/html-to-markdown-2VQWCEKU.js +2 -0
  312. package/dist/bin/shell/chunks/join-TRRWQBEU.js +2 -0
  313. package/dist/bin/shell/chunks/jq-NFKKH27D.js +2 -0
  314. package/dist/bin/shell/chunks/ln-BSEVUP2J.js +2 -0
  315. package/dist/bin/shell/chunks/ls-IJLTWVOI.js +2 -0
  316. package/dist/bin/shell/chunks/md5sum-ZIQHOC4K.js +2 -0
  317. package/dist/bin/shell/chunks/mkdir-KYFAO2SF.js +2 -0
  318. package/dist/bin/shell/chunks/mv-TWM2PA7Q.js +2 -0
  319. package/dist/bin/shell/chunks/nl-XLF2HFST.js +2 -0
  320. package/dist/bin/shell/chunks/od-BOM6JPTH.js +2 -0
  321. package/dist/bin/shell/chunks/paste-FUGXVGJX.js +2 -0
  322. package/dist/bin/shell/chunks/printf-XUGNJ3QM.js +2 -0
  323. package/dist/bin/shell/chunks/pwd-RZG6GZEU.js +2 -0
  324. package/dist/bin/shell/chunks/python3-PIXJS3YM.js +14 -0
  325. package/dist/bin/shell/chunks/readlink-4SOSIDHE.js +2 -0
  326. package/dist/bin/shell/chunks/rev-5E5UGSUZ.js +2 -0
  327. package/dist/bin/shell/chunks/rg-4YJSQZN7.js +2 -0
  328. package/dist/bin/shell/chunks/rm-3PFOF4E3.js +2 -0
  329. package/dist/bin/shell/chunks/rmdir-CSK7CGH5.js +2 -0
  330. package/dist/bin/shell/chunks/sed-XBCUZMEP.js +2 -0
  331. package/dist/bin/shell/chunks/seq-H7ID4VMK.js +2 -0
  332. package/dist/bin/shell/chunks/sha1sum-EDQNYXXH.js +2 -0
  333. package/dist/bin/shell/chunks/sha256sum-APTG6DO2.js +2 -0
  334. package/dist/bin/shell/chunks/sleep-PNT7KILS.js +2 -0
  335. package/dist/bin/shell/chunks/sort-ELAGZUES.js +2 -0
  336. package/dist/bin/shell/chunks/split-QGXYUWBC.js +2 -0
  337. package/dist/bin/shell/chunks/sqlite3-ELLMKNNJ.js +2 -0
  338. package/dist/bin/shell/chunks/stat-Q2TZRKO3.js +2 -0
  339. package/dist/bin/shell/chunks/strings-IGEGP5QX.js +2 -0
  340. package/dist/bin/shell/chunks/tac-VOEDJLLG.js +2 -0
  341. package/dist/bin/shell/chunks/tail-JOQASWMV.js +2 -0
  342. package/dist/bin/shell/chunks/tar-2UVSVD3P.js +2 -0
  343. package/dist/bin/shell/chunks/tee-IQLEDZOQ.js +2 -0
  344. package/dist/bin/shell/chunks/time-VRCJK2LI.js +2 -0
  345. package/dist/bin/shell/chunks/timeout-A36YWZWR.js +2 -0
  346. package/dist/bin/shell/chunks/touch-5ECNQNBP.js +2 -0
  347. package/dist/bin/shell/chunks/tr-AVALLN54.js +2 -0
  348. package/dist/bin/shell/chunks/tree-UFM5EDXS.js +2 -0
  349. package/dist/bin/shell/chunks/true-BU5JSAAW.js +2 -0
  350. package/dist/bin/shell/chunks/unexpand-TDRWZW5F.js +2 -0
  351. package/dist/bin/shell/chunks/uniq-IKBUNAMN.js +2 -0
  352. package/dist/bin/shell/chunks/wc-2R4RS2SX.js +2 -0
  353. package/dist/bin/shell/chunks/which-6UVGMXDF.js +2 -0
  354. package/dist/bin/shell/chunks/whoami-N6TLTETT.js +2 -0
  355. package/dist/bin/shell/chunks/xan-JX5QUK32.js +2 -0
  356. package/dist/bin/shell/chunks/xan-view-NFMUMJ7Z.js +2 -0
  357. package/dist/bin/shell/chunks/xargs-4MYN4U3C.js +2 -0
  358. package/dist/bin/shell/chunks/yq-EHDQVD7S.js +2 -0
  359. package/dist/bin/shell/shell.js +711 -0
  360. package/dist/browser.d.ts +22 -0
  361. package/dist/bundle/browser.js +1481 -0
  362. package/dist/bundle/chunks/alias-T2KDAHDL.js +1 -0
  363. package/dist/bundle/chunks/awk2-UIH6CPHX.js +1 -0
  364. package/dist/bundle/chunks/base64-RY5JPAQL.js +1 -0
  365. package/dist/bundle/chunks/basename-QT55QR7O.js +1 -0
  366. package/dist/bundle/chunks/bash-BZZ6TUGW.js +1 -0
  367. package/dist/bundle/chunks/bytes-W6ESHQ7F.js +1 -0
  368. package/dist/bundle/chunks/cat-WUR2OJUG.js +1 -0
  369. package/dist/bundle/chunks/chmod-LTQYKUUW.js +1 -0
  370. package/dist/bundle/chunks/chunk-24BT6QUB.js +11 -0
  371. package/dist/bundle/chunks/chunk-274QVGRQ.js +2 -0
  372. package/dist/bundle/chunks/chunk-2IKXAFP4.js +11 -0
  373. package/dist/bundle/chunks/chunk-2IO54DPD.js +1 -0
  374. package/dist/bundle/chunks/chunk-2VAJD54D.js +13 -0
  375. package/dist/bundle/chunks/chunk-34P4G5H7.js +5 -0
  376. package/dist/bundle/chunks/chunk-3OY3UJDR.js +62 -0
  377. package/dist/bundle/chunks/chunk-3R6EWKMD.js +13 -0
  378. package/dist/bundle/chunks/chunk-3SPSXVPQ.js +2 -0
  379. package/dist/bundle/chunks/chunk-43RXAZRC.js +7 -0
  380. package/dist/bundle/chunks/chunk-44UOCSGV.js +1 -0
  381. package/dist/bundle/chunks/chunk-47LWQIG6.js +15 -0
  382. package/dist/bundle/chunks/chunk-4L3Y4LKT.js +5 -0
  383. package/dist/bundle/chunks/chunk-4LYDOEQ6.js +4 -0
  384. package/dist/bundle/chunks/chunk-4Q5DFBVQ.js +6 -0
  385. package/dist/bundle/chunks/chunk-4R5AUIZ4.js +6 -0
  386. package/dist/bundle/chunks/chunk-4UTZCT3W.js +2 -0
  387. package/dist/bundle/chunks/chunk-5FDLF2FN.js +5 -0
  388. package/dist/bundle/chunks/chunk-5HJSZMTG.js +1 -0
  389. package/dist/bundle/chunks/chunk-5NR6JZM4.js +12 -0
  390. package/dist/bundle/chunks/chunk-5PL72KVW.js +7 -0
  391. package/dist/bundle/chunks/chunk-6BM2WKUH.js +23 -0
  392. package/dist/bundle/chunks/chunk-6HLDZZOT.js +4 -0
  393. package/dist/bundle/chunks/chunk-7MKBHGLS.js +1 -0
  394. package/dist/bundle/chunks/chunk-7VHVF5PX.js +20 -0
  395. package/dist/bundle/chunks/chunk-A3YV3X3J.js +6 -0
  396. package/dist/bundle/chunks/chunk-AJNR4FJT.js +8 -0
  397. package/dist/bundle/chunks/chunk-AMQM5ZPF.js +1 -0
  398. package/dist/bundle/chunks/chunk-BCDE2QUY.js +1 -0
  399. package/dist/bundle/chunks/chunk-BMKJMOWP.js +2 -0
  400. package/dist/bundle/chunks/chunk-BVFIC7R6.js +4 -0
  401. package/dist/bundle/chunks/chunk-CC4HUWHZ.js +4 -0
  402. package/dist/bundle/chunks/chunk-CNCKROJZ.js +10 -0
  403. package/dist/bundle/chunks/chunk-CSFZQCAK.js +139 -0
  404. package/dist/bundle/chunks/chunk-CU7G2LMR.js +1 -0
  405. package/dist/bundle/chunks/chunk-CZP7PMAG.js +4 -0
  406. package/dist/bundle/chunks/chunk-D2OUCFAU.js +8 -0
  407. package/dist/bundle/chunks/chunk-DQXLKPVQ.js +7 -0
  408. package/dist/bundle/chunks/chunk-E6IR6BWV.js +286 -0
  409. package/dist/bundle/chunks/chunk-ELZ2RVIZ.js +11 -0
  410. package/dist/bundle/chunks/chunk-EVNUXIEZ.js +2 -0
  411. package/dist/bundle/chunks/chunk-F6FQRFZU.js +6 -0
  412. package/dist/bundle/chunks/chunk-FAECBHMR.js +2 -0
  413. package/dist/bundle/chunks/chunk-FBOLGXN4.js +16 -0
  414. package/dist/bundle/chunks/chunk-FNIOXBJW.js +9 -0
  415. package/dist/bundle/chunks/chunk-GD5SDRL7.js +5 -0
  416. package/dist/bundle/chunks/chunk-GEAGCSIY.js +31 -0
  417. package/dist/bundle/chunks/chunk-GI2KN5IL.js +22 -0
  418. package/dist/bundle/chunks/chunk-GOG2LNAH.js +9 -0
  419. package/dist/bundle/chunks/chunk-H2ENJVUI.js +10 -0
  420. package/dist/bundle/chunks/chunk-HDNR2KMO.js +13 -0
  421. package/dist/bundle/chunks/chunk-HJ37IXKX.js +12 -0
  422. package/dist/bundle/chunks/chunk-I36BZMR3.js +1 -0
  423. package/dist/bundle/chunks/chunk-I6YSZMB6.js +15 -0
  424. package/dist/bundle/chunks/chunk-IJXFPKNC.js +1 -0
  425. package/dist/bundle/chunks/chunk-IXD4Z54Z.js +8 -0
  426. package/dist/bundle/chunks/chunk-J44PYBAW.js +2 -0
  427. package/dist/bundle/chunks/chunk-JDREUEBG.js +9 -0
  428. package/dist/bundle/chunks/chunk-KA244HSE.js +5 -0
  429. package/dist/bundle/chunks/chunk-KKZJ6K7R.js +8 -0
  430. package/dist/bundle/chunks/chunk-KZ3P3SVS.js +22 -0
  431. package/dist/bundle/chunks/chunk-LIVSDOY2.js +1 -0
  432. package/dist/bundle/chunks/chunk-LX7SQKLW.js +15 -0
  433. package/dist/bundle/chunks/chunk-M5O5DYR7.js +1 -0
  434. package/dist/bundle/chunks/chunk-MML7K3J2.js +6 -0
  435. package/dist/bundle/chunks/chunk-N4GRDEVJ.js +5 -0
  436. package/dist/bundle/chunks/chunk-NPZMNEW5.js +6 -0
  437. package/dist/bundle/chunks/chunk-NUFRM6SI.js +0 -0
  438. package/dist/bundle/chunks/chunk-O7N2RCS7.js +1 -0
  439. package/dist/bundle/chunks/chunk-OSYLT4VG.js +4 -0
  440. package/dist/bundle/chunks/chunk-OXRHP7HO.js +3 -0
  441. package/dist/bundle/chunks/chunk-OZOS3R6K.js +99 -0
  442. package/dist/bundle/chunks/chunk-OZQ4AW5X.js +8 -0
  443. package/dist/bundle/chunks/chunk-PNGAWBIZ.js +10 -0
  444. package/dist/bundle/chunks/chunk-PPUKM2B7.js +13 -0
  445. package/dist/bundle/chunks/chunk-PTELGM2J.js +7 -0
  446. package/dist/bundle/chunks/chunk-Q3TLRYBC.js +72 -0
  447. package/dist/bundle/chunks/chunk-Q5AOYNOX.js +6 -0
  448. package/dist/bundle/chunks/chunk-QEKGAAIL.js +1 -0
  449. package/dist/bundle/chunks/chunk-QIL3FXIC.js +6 -0
  450. package/dist/bundle/chunks/chunk-QNZEO23C.js +8 -0
  451. package/dist/bundle/chunks/chunk-R4IVADTA.js +7 -0
  452. package/dist/bundle/chunks/chunk-RK57WTFF.js +12 -0
  453. package/dist/bundle/chunks/chunk-RU5M6ZRS.js +4 -0
  454. package/dist/bundle/chunks/chunk-SBVBPPEQ.js +5 -0
  455. package/dist/bundle/chunks/chunk-SP22LBKJ.js +20 -0
  456. package/dist/bundle/chunks/chunk-UKS3AEEA.js +32 -0
  457. package/dist/bundle/chunks/chunk-UYR5HJI6.js +7 -0
  458. package/dist/bundle/chunks/chunk-V6ANTLBA.js +15 -0
  459. package/dist/bundle/chunks/chunk-VLGZJRPG.js +16 -0
  460. package/dist/bundle/chunks/chunk-VZUQMDOT.js +2 -0
  461. package/dist/bundle/chunks/chunk-XDQU6V6S.js +19 -0
  462. package/dist/bundle/chunks/chunk-XRVUJRYI.js +35 -0
  463. package/dist/bundle/chunks/chunk-YNYSPYQ5.js +32 -0
  464. package/dist/bundle/chunks/clear-NLKZY76S.js +1 -0
  465. package/dist/bundle/chunks/column-S7P64XRJ.js +1 -0
  466. package/dist/bundle/chunks/comm-FPLN4BYY.js +1 -0
  467. package/dist/bundle/chunks/cp-W5HXJH5J.js +1 -0
  468. package/dist/bundle/chunks/curl-UFR6W4B6.js +25 -0
  469. package/dist/bundle/chunks/cut-VNFQFCA7.js +1 -0
  470. package/dist/bundle/chunks/date-EDSSFONA.js +1 -0
  471. package/dist/bundle/chunks/diff-RR5VJXIT.js +1 -0
  472. package/dist/bundle/chunks/dirname-V7Z24BGZ.js +1 -0
  473. package/dist/bundle/chunks/du-QKRPQIMY.js +1 -0
  474. package/dist/bundle/chunks/echo-TR3BM2AJ.js +1 -0
  475. package/dist/bundle/chunks/env-SVQBHVZF.js +1 -0
  476. package/dist/bundle/chunks/expand-ZVCJ72RF.js +1 -0
  477. package/dist/bundle/chunks/expansion-OBOJBZTH.js +1 -0
  478. package/dist/bundle/chunks/expr-QRA5KFYV.js +1 -0
  479. package/dist/bundle/chunks/file-TORG4IVZ.js +1 -0
  480. package/dist/bundle/chunks/find-NAGPRRQ7.js +1 -0
  481. package/dist/bundle/chunks/flag-coverage-FMTW4YWD.js +1 -0
  482. package/dist/bundle/chunks/fold-L4U6GS2N.js +1 -0
  483. package/dist/bundle/chunks/grep-D6AI423Z.js +1 -0
  484. package/dist/bundle/chunks/gzip-4EFUBHN7.js +1 -0
  485. package/dist/bundle/chunks/head-KBQT2JAC.js +1 -0
  486. package/dist/bundle/chunks/help-F3TJS3LS.js +1 -0
  487. package/dist/bundle/chunks/history-OKEAINJD.js +1 -0
  488. package/dist/bundle/chunks/hostname-AGIPNJOC.js +1 -0
  489. package/dist/bundle/chunks/html-to-markdown-P2LSCPVF.js +1 -0
  490. package/dist/bundle/chunks/join-FTSZAZYU.js +1 -0
  491. package/dist/bundle/chunks/jq-TNIKCGGT.js +1 -0
  492. package/dist/bundle/chunks/ln-BWYUCELO.js +1 -0
  493. package/dist/bundle/chunks/ls-6BM6G675.js +1 -0
  494. package/dist/bundle/chunks/md5sum-ALFVDB3W.js +1 -0
  495. package/dist/bundle/chunks/mkdir-I3BZBLTZ.js +1 -0
  496. package/dist/bundle/chunks/mv-76WRD5SE.js +1 -0
  497. package/dist/bundle/chunks/nl-77Q7V2GV.js +1 -0
  498. package/dist/bundle/chunks/od-AA6TIC6A.js +1 -0
  499. package/dist/bundle/chunks/paste-C6JKQOHO.js +1 -0
  500. package/dist/bundle/chunks/printf-WOYMDX2I.js +1 -0
  501. package/dist/bundle/chunks/pwd-BE3B3ZPG.js +1 -0
  502. package/dist/bundle/chunks/python3-QFUFNW7I.js +13 -0
  503. package/dist/bundle/chunks/readlink-QI6K7ZZX.js +1 -0
  504. package/dist/bundle/chunks/rev-2FZQEIQG.js +1 -0
  505. package/dist/bundle/chunks/rg-CNS6SD3V.js +1 -0
  506. package/dist/bundle/chunks/rm-JMWEKCU4.js +1 -0
  507. package/dist/bundle/chunks/rmdir-5HDB4IQ7.js +1 -0
  508. package/dist/bundle/chunks/sed-CSUGXVBJ.js +1 -0
  509. package/dist/bundle/chunks/seq-UP62NDEL.js +1 -0
  510. package/dist/bundle/chunks/sha1sum-XXYTWQIW.js +1 -0
  511. package/dist/bundle/chunks/sha256sum-GD6AFWG3.js +1 -0
  512. package/dist/bundle/chunks/sleep-225KIGXI.js +1 -0
  513. package/dist/bundle/chunks/sort-BIWEEIVX.js +1 -0
  514. package/dist/bundle/chunks/split-QUFGLTTX.js +1 -0
  515. package/dist/bundle/chunks/sqlite3-3ZFEGTQ7.js +1 -0
  516. package/dist/bundle/chunks/stat-DIMPSC6S.js +1 -0
  517. package/dist/bundle/chunks/strings-LECMRXOT.js +1 -0
  518. package/dist/bundle/chunks/tac-A6JKZKWL.js +1 -0
  519. package/dist/bundle/chunks/tail-YGDXZZGG.js +1 -0
  520. package/dist/bundle/chunks/tar-7KN7KZ6S.js +1 -0
  521. package/dist/bundle/chunks/tee-J4MBDQJZ.js +1 -0
  522. package/dist/bundle/chunks/time-CVS7ESWV.js +1 -0
  523. package/dist/bundle/chunks/timeout-UX2PSLYJ.js +1 -0
  524. package/dist/bundle/chunks/touch-ATQADRUQ.js +1 -0
  525. package/dist/bundle/chunks/tr-QVFN4YWH.js +1 -0
  526. package/dist/bundle/chunks/tree-IY7WNFVF.js +1 -0
  527. package/dist/bundle/chunks/true-AKKYE7WM.js +1 -0
  528. package/dist/bundle/chunks/unexpand-2WTX7UPB.js +1 -0
  529. package/dist/bundle/chunks/uniq-XS6VGRO2.js +1 -0
  530. package/dist/bundle/chunks/wc-22EISCPD.js +1 -0
  531. package/dist/bundle/chunks/which-IWHCX6SW.js +1 -0
  532. package/dist/bundle/chunks/whoami-HCON4D7C.js +1 -0
  533. package/dist/bundle/chunks/worker.js +2260 -0
  534. package/dist/bundle/chunks/xan-XDECJHII.js +1 -0
  535. package/dist/bundle/chunks/xan-view-IJ4EABH7.js +1 -0
  536. package/dist/bundle/chunks/xargs-5MMN7C6P.js +1 -0
  537. package/dist/bundle/chunks/yq-LQX5YIGM.js +1 -0
  538. package/dist/bundle/index.js +688 -0
  539. package/dist/commands/alias/alias.d.ts +6 -0
  540. package/dist/commands/awk/ast.d.ts +202 -0
  541. package/dist/commands/awk/awk2.d.ts +9 -0
  542. package/dist/commands/awk/builtins.d.ts +17 -0
  543. package/dist/commands/awk/interpreter/context.d.ts +73 -0
  544. package/dist/commands/awk/interpreter/expressions.d.ts +17 -0
  545. package/dist/commands/awk/interpreter/fields.d.ts +25 -0
  546. package/dist/commands/awk/interpreter/index.d.ts +8 -0
  547. package/dist/commands/awk/interpreter/interpreter.d.ts +52 -0
  548. package/dist/commands/awk/interpreter/statements.d.ts +11 -0
  549. package/dist/commands/awk/interpreter/type-coercion.d.ts +32 -0
  550. package/dist/commands/awk/interpreter/types.d.ts +13 -0
  551. package/dist/commands/awk/interpreter/variables.d.ts +35 -0
  552. package/dist/commands/awk/lexer.d.ts +100 -0
  553. package/dist/commands/awk/parser2-print.d.ts +35 -0
  554. package/dist/commands/awk/parser2.d.ts +81 -0
  555. package/dist/commands/base64/base64.d.ts +7 -0
  556. package/dist/commands/basename/basename.d.ts +4 -0
  557. package/dist/commands/bash/bash.d.ts +6 -0
  558. package/dist/commands/browser-excluded.d.ts +16 -0
  559. package/dist/commands/cat/cat.d.ts +4 -0
  560. package/dist/commands/chmod/chmod.d.ts +4 -0
  561. package/dist/commands/clear/clear.d.ts +4 -0
  562. package/dist/commands/column/column.d.ts +11 -0
  563. package/dist/commands/comm/comm.d.ts +12 -0
  564. package/dist/commands/cp/cp.d.ts +4 -0
  565. package/dist/commands/curl/curl.d.ts +8 -0
  566. package/dist/commands/curl/form.d.ts +21 -0
  567. package/dist/commands/curl/help.d.ts +9 -0
  568. package/dist/commands/curl/parse.d.ts +9 -0
  569. package/dist/commands/curl/response-formatting.d.ts +20 -0
  570. package/dist/commands/curl/types.d.ts +31 -0
  571. package/dist/commands/cut/cut.d.ts +4 -0
  572. package/dist/commands/date/date.d.ts +7 -0
  573. package/dist/commands/diff/diff.d.ts +7 -0
  574. package/dist/commands/dirname/dirname.d.ts +4 -0
  575. package/dist/commands/du/du.d.ts +4 -0
  576. package/dist/commands/echo/echo.d.ts +4 -0
  577. package/dist/commands/env/env.d.ts +6 -0
  578. package/dist/commands/expand/expand.d.ts +12 -0
  579. package/dist/commands/expand/unexpand.d.ts +12 -0
  580. package/dist/commands/expr/expr.d.ts +9 -0
  581. package/dist/commands/file/file.d.ts +9 -0
  582. package/dist/commands/find/find.d.ts +4 -0
  583. package/dist/commands/find/matcher.d.ts +69 -0
  584. package/dist/commands/find/parser.d.ts +2 -0
  585. package/dist/commands/find/types.d.ts +88 -0
  586. package/dist/commands/flag-coverage.d.ts +2 -0
  587. package/dist/commands/fold/fold.d.ts +12 -0
  588. package/dist/commands/fuzz-flags-types.d.ts +17 -0
  589. package/dist/commands/fuzz-flags.d.ts +8 -0
  590. package/dist/commands/grep/grep.d.ts +8 -0
  591. package/dist/commands/gzip/gzip.d.ts +13 -0
  592. package/dist/commands/head/head-tail-shared.d.ts +38 -0
  593. package/dist/commands/head/head.d.ts +4 -0
  594. package/dist/commands/help/help.d.ts +4 -0
  595. package/dist/commands/help.d.ts +16 -0
  596. package/dist/commands/history/history.d.ts +4 -0
  597. package/dist/commands/hostname/hostname.d.ts +11 -0
  598. package/dist/commands/html-to-markdown/html-to-markdown.d.ts +9 -0
  599. package/dist/commands/join/join.d.ts +12 -0
  600. package/dist/commands/jq/jq.d.ts +9 -0
  601. package/dist/commands/ln/ln.d.ts +4 -0
  602. package/dist/commands/ls/ls.d.ts +4 -0
  603. package/dist/commands/md5sum/checksum.d.ts +7 -0
  604. package/dist/commands/md5sum/md5sum.d.ts +4 -0
  605. package/dist/commands/md5sum/sha1sum.d.ts +4 -0
  606. package/dist/commands/md5sum/sha256sum.d.ts +4 -0
  607. package/dist/commands/mkdir/mkdir.d.ts +4 -0
  608. package/dist/commands/mv/mv.d.ts +4 -0
  609. package/dist/commands/nl/nl.d.ts +12 -0
  610. package/dist/commands/od/od.d.ts +12 -0
  611. package/dist/commands/paste/paste.d.ts +4 -0
  612. package/dist/commands/printf/escapes.d.ts +31 -0
  613. package/dist/commands/printf/printf.d.ts +4 -0
  614. package/dist/commands/printf/strftime.d.ts +9 -0
  615. package/dist/commands/pwd/pwd.d.ts +4 -0
  616. package/dist/commands/python3/fs-bridge-handler.d.ts +50 -0
  617. package/dist/commands/python3/protocol.d.ts +138 -0
  618. package/dist/commands/python3/python3.d.ts +11 -0
  619. package/dist/commands/python3/sync-fs-backend.d.ts +59 -0
  620. package/dist/commands/python3/worker.d.ts +22 -0
  621. package/dist/commands/query-engine/builtins/array-builtins.d.ts +20 -0
  622. package/dist/commands/query-engine/builtins/control-builtins.d.ts +18 -0
  623. package/dist/commands/query-engine/builtins/date-builtins.d.ts +15 -0
  624. package/dist/commands/query-engine/builtins/format-builtins.d.ts +11 -0
  625. package/dist/commands/query-engine/builtins/index-builtins.d.ts +16 -0
  626. package/dist/commands/query-engine/builtins/index.d.ts +17 -0
  627. package/dist/commands/query-engine/builtins/math-builtins.d.ts +15 -0
  628. package/dist/commands/query-engine/builtins/navigation-builtins.d.ts +18 -0
  629. package/dist/commands/query-engine/builtins/object-builtins.d.ts +15 -0
  630. package/dist/commands/query-engine/builtins/path-builtins.d.ts +20 -0
  631. package/dist/commands/query-engine/builtins/sql-builtins.d.ts +16 -0
  632. package/dist/commands/query-engine/builtins/string-builtins.d.ts +15 -0
  633. package/dist/commands/query-engine/builtins/type-builtins.d.ts +11 -0
  634. package/dist/commands/query-engine/evaluator.d.ts +37 -0
  635. package/dist/commands/query-engine/index.d.ts +8 -0
  636. package/dist/commands/query-engine/parser-types.d.ts +171 -0
  637. package/dist/commands/query-engine/parser.d.ts +9 -0
  638. package/dist/commands/query-engine/path-operations.d.ts +15 -0
  639. package/dist/commands/query-engine/safe-object.d.ts +59 -0
  640. package/dist/commands/query-engine/value-operations.d.ts +41 -0
  641. package/dist/commands/readlink/readlink.d.ts +4 -0
  642. package/dist/commands/registry.d.ts +45 -0
  643. package/dist/commands/rev/rev.d.ts +13 -0
  644. package/dist/commands/rg/file-types.d.ts +49 -0
  645. package/dist/commands/rg/gitignore.d.ts +98 -0
  646. package/dist/commands/rg/rg-options.d.ts +61 -0
  647. package/dist/commands/rg/rg-parser.d.ts +20 -0
  648. package/dist/commands/rg/rg-search.d.ts +15 -0
  649. package/dist/commands/rg/rg.d.ts +14 -0
  650. package/dist/commands/rm/rm.d.ts +4 -0
  651. package/dist/commands/rmdir/rmdir.d.ts +4 -0
  652. package/dist/commands/search-engine/index.d.ts +10 -0
  653. package/dist/commands/search-engine/matcher.d.ts +60 -0
  654. package/dist/commands/search-engine/regex.d.ts +33 -0
  655. package/dist/commands/sed/executor.d.ts +7 -0
  656. package/dist/commands/sed/lexer.d.ts +86 -0
  657. package/dist/commands/sed/parser.d.ts +18 -0
  658. package/dist/commands/sed/sed-regex.d.ts +23 -0
  659. package/dist/commands/sed/sed.d.ts +4 -0
  660. package/dist/commands/sed/types.d.ts +219 -0
  661. package/dist/commands/seq/seq.d.ts +16 -0
  662. package/dist/commands/sleep/sleep.d.ts +4 -0
  663. package/dist/commands/sort/comparator.d.ts +9 -0
  664. package/dist/commands/sort/parser.d.ts +11 -0
  665. package/dist/commands/sort/sort.d.ts +4 -0
  666. package/dist/commands/sort/types.d.ts +30 -0
  667. package/dist/commands/split/split.d.ts +12 -0
  668. package/dist/commands/sqlite3/formatters.d.ts +15 -0
  669. package/dist/commands/sqlite3/sqlite3.d.ts +16 -0
  670. package/dist/commands/sqlite3/worker.d.ts +44 -0
  671. package/dist/commands/stat/stat.d.ts +4 -0
  672. package/dist/commands/strings/strings.d.ts +12 -0
  673. package/dist/commands/tac/tac.d.ts +11 -0
  674. package/dist/commands/tail/tail.d.ts +4 -0
  675. package/dist/commands/tar/archive.d.ts +107 -0
  676. package/dist/commands/tar/tar-options.d.ts +36 -0
  677. package/dist/commands/tar/tar.d.ts +10 -0
  678. package/dist/commands/tee/tee.d.ts +4 -0
  679. package/dist/commands/time/time.d.ts +27 -0
  680. package/dist/commands/timeout/timeout.d.ts +4 -0
  681. package/dist/commands/touch/touch.d.ts +4 -0
  682. package/dist/commands/tr/tr.d.ts +4 -0
  683. package/dist/commands/tree/tree.d.ts +4 -0
  684. package/dist/commands/true/true.d.ts +6 -0
  685. package/dist/commands/uniq/uniq.d.ts +4 -0
  686. package/dist/commands/wc/wc.d.ts +4 -0
  687. package/dist/commands/which/which.d.ts +4 -0
  688. package/dist/commands/whoami/whoami.d.ts +11 -0
  689. package/dist/commands/xan/aggregation.d.ts +20 -0
  690. package/dist/commands/xan/column-selection.d.ts +19 -0
  691. package/dist/commands/xan/csv.d.ts +37 -0
  692. package/dist/commands/xan/moonblade-parser.d.ts +80 -0
  693. package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
  694. package/dist/commands/xan/moonblade-tokenizer.d.ts +25 -0
  695. package/dist/commands/xan/subcommands.d.ts +15 -0
  696. package/dist/commands/xan/xan-agg.d.ts +8 -0
  697. package/dist/commands/xan/xan-columns.d.ts +8 -0
  698. package/dist/commands/xan/xan-core.d.ts +10 -0
  699. package/dist/commands/xan/xan-data.d.ts +52 -0
  700. package/dist/commands/xan/xan-filter.d.ts +8 -0
  701. package/dist/commands/xan/xan-map.d.ts +11 -0
  702. package/dist/commands/xan/xan-reshape.d.ts +40 -0
  703. package/dist/commands/xan/xan-simple.d.ts +40 -0
  704. package/dist/commands/xan/xan-view.d.ts +12 -0
  705. package/dist/commands/xan/xan.d.ts +10 -0
  706. package/dist/commands/xargs/xargs.d.ts +4 -0
  707. package/dist/commands/yq/formats.d.ts +64 -0
  708. package/dist/commands/yq/yq.d.ts +13 -0
  709. package/dist/custom-commands.d.ts +61 -0
  710. package/dist/fs/encoding.d.ts +17 -0
  711. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +63 -0
  712. package/dist/fs/in-memory-fs/index.d.ts +1 -0
  713. package/dist/fs/init.d.ts +12 -0
  714. package/dist/fs/interface.d.ts +219 -0
  715. package/dist/fs/mountable-fs/index.d.ts +1 -0
  716. package/dist/fs/mountable-fs/mountable-fs.d.ts +120 -0
  717. package/dist/fs/overlay-fs/index.d.ts +1 -0
  718. package/dist/fs/overlay-fs/overlay-fs.d.ts +126 -0
  719. package/dist/fs/read-write-fs/index.d.ts +1 -0
  720. package/dist/fs/read-write-fs/read-write-fs.d.ts +69 -0
  721. package/dist/index.d.ts +19 -0
  722. package/dist/interpreter/alias-expansion.d.ts +23 -0
  723. package/dist/interpreter/arithmetic.d.ts +24 -0
  724. package/dist/interpreter/assignment-expansion.d.ts +24 -0
  725. package/dist/interpreter/builtin-dispatch.d.ts +39 -0
  726. package/dist/interpreter/builtins/break.d.ts +6 -0
  727. package/dist/interpreter/builtins/cd.d.ts +6 -0
  728. package/dist/interpreter/builtins/compgen.d.ts +26 -0
  729. package/dist/interpreter/builtins/complete.d.ts +17 -0
  730. package/dist/interpreter/builtins/compopt.d.ts +28 -0
  731. package/dist/interpreter/builtins/continue.d.ts +6 -0
  732. package/dist/interpreter/builtins/declare-array-parsing.d.ts +14 -0
  733. package/dist/interpreter/builtins/declare-print.d.ts +39 -0
  734. package/dist/interpreter/builtins/declare.d.ts +35 -0
  735. package/dist/interpreter/builtins/dirs.d.ts +29 -0
  736. package/dist/interpreter/builtins/eval.d.ts +9 -0
  737. package/dist/interpreter/builtins/exit.d.ts +5 -0
  738. package/dist/interpreter/builtins/export.d.ts +14 -0
  739. package/dist/interpreter/builtins/getopts.d.ts +18 -0
  740. package/dist/interpreter/builtins/hash.d.ts +19 -0
  741. package/dist/interpreter/builtins/help.d.ts +12 -0
  742. package/dist/interpreter/builtins/index.d.ts +45 -0
  743. package/dist/interpreter/builtins/let.d.ts +18 -0
  744. package/dist/interpreter/builtins/local.d.ts +6 -0
  745. package/dist/interpreter/builtins/mapfile.d.ts +17 -0
  746. package/dist/interpreter/builtins/read.d.ts +6 -0
  747. package/dist/interpreter/builtins/return.d.ts +6 -0
  748. package/dist/interpreter/builtins/set.d.ts +9 -0
  749. package/dist/interpreter/builtins/shift.d.ts +15 -0
  750. package/dist/interpreter/builtins/shopt.d.ts +7 -0
  751. package/dist/interpreter/builtins/source.d.ts +6 -0
  752. package/dist/interpreter/builtins/unset.d.ts +16 -0
  753. package/dist/interpreter/builtins/variable-assignment.d.ts +66 -0
  754. package/dist/interpreter/command-resolution.d.ts +43 -0
  755. package/dist/interpreter/conditionals.d.ts +17 -0
  756. package/dist/interpreter/control-flow.d.ts +21 -0
  757. package/dist/interpreter/errors.d.ts +150 -0
  758. package/dist/interpreter/expansion/analysis.d.ts +37 -0
  759. package/dist/interpreter/expansion/arith-text-expansion.d.ts +20 -0
  760. package/dist/interpreter/expansion/array-pattern-ops.d.ts +21 -0
  761. package/dist/interpreter/expansion/array-prefix-suffix.d.ts +46 -0
  762. package/dist/interpreter/expansion/array-slice-transform.d.ts +36 -0
  763. package/dist/interpreter/expansion/array-word-expansion.d.ts +39 -0
  764. package/dist/interpreter/expansion/brace-range.d.ts +20 -0
  765. package/dist/interpreter/expansion/command-substitution.d.ts +23 -0
  766. package/dist/interpreter/expansion/glob-escape.d.ts +32 -0
  767. package/dist/interpreter/expansion/indirect-expansion.d.ts +42 -0
  768. package/dist/interpreter/expansion/parameter-ops.d.ts +113 -0
  769. package/dist/interpreter/expansion/pattern-expansion.d.ts +23 -0
  770. package/dist/interpreter/expansion/pattern-removal.d.ts +18 -0
  771. package/dist/interpreter/expansion/pattern.d.ts +23 -0
  772. package/dist/interpreter/expansion/positional-params.d.ts +59 -0
  773. package/dist/interpreter/expansion/prompt.d.ts +39 -0
  774. package/dist/interpreter/expansion/quoting.d.ts +13 -0
  775. package/dist/interpreter/expansion/tilde.d.ts +12 -0
  776. package/dist/interpreter/expansion/unquoted-expansion.d.ts +76 -0
  777. package/dist/interpreter/expansion/variable-attrs.d.ts +19 -0
  778. package/dist/interpreter/expansion/variable.d.ts +43 -0
  779. package/dist/interpreter/expansion/word-glob-expansion.d.ts +33 -0
  780. package/dist/interpreter/expansion/word-split.d.ts +29 -0
  781. package/dist/interpreter/expansion.d.ts +57 -0
  782. package/dist/interpreter/functions.d.ts +12 -0
  783. package/dist/interpreter/helpers/array.d.ts +43 -0
  784. package/dist/interpreter/helpers/condition.d.ts +18 -0
  785. package/dist/interpreter/helpers/errors.d.ts +8 -0
  786. package/dist/interpreter/helpers/file-tests.d.ts +33 -0
  787. package/dist/interpreter/helpers/ifs.d.ts +104 -0
  788. package/dist/interpreter/helpers/loop.d.ts +24 -0
  789. package/dist/interpreter/helpers/nameref.d.ts +65 -0
  790. package/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
  791. package/dist/interpreter/helpers/quoting.d.ts +24 -0
  792. package/dist/interpreter/helpers/readonly.d.ts +45 -0
  793. package/dist/interpreter/helpers/regex.d.ts +8 -0
  794. package/dist/interpreter/helpers/result.d.ts +62 -0
  795. package/dist/interpreter/helpers/shell-constants.d.ts +25 -0
  796. package/dist/interpreter/helpers/shellopts.d.ts +28 -0
  797. package/dist/interpreter/helpers/statements.d.ts +20 -0
  798. package/dist/interpreter/helpers/string-compare.d.ts +24 -0
  799. package/dist/interpreter/helpers/string-tests.d.ts +13 -0
  800. package/dist/interpreter/helpers/tilde.d.ts +13 -0
  801. package/dist/interpreter/helpers/variable-tests.d.ts +9 -0
  802. package/dist/interpreter/helpers/word-matching.d.ts +26 -0
  803. package/dist/interpreter/helpers/word-parts.d.ts +29 -0
  804. package/dist/interpreter/helpers/xtrace.d.ts +18 -0
  805. package/dist/interpreter/index.d.ts +3 -0
  806. package/dist/interpreter/interpreter.d.ts +65 -0
  807. package/dist/interpreter/pipeline-execution.d.ts +16 -0
  808. package/dist/interpreter/redirections.d.ts +51 -0
  809. package/dist/interpreter/simple-command-assignments.d.ts +29 -0
  810. package/dist/interpreter/subshell-group.d.ts +32 -0
  811. package/dist/interpreter/type-command.d.ts +37 -0
  812. package/dist/interpreter/types.d.ts +317 -0
  813. package/dist/limits.d.ts +42 -0
  814. package/dist/network/allow-list/shared.d.ts +45 -0
  815. package/dist/network/allow-list.d.ts +51 -0
  816. package/dist/network/fetch.d.ts +25 -0
  817. package/dist/network/index.d.ts +7 -0
  818. package/dist/network/types.d.ts +96 -0
  819. package/dist/parser/arithmetic-parser.d.ts +23 -0
  820. package/dist/parser/arithmetic-primaries.d.ts +45 -0
  821. package/dist/parser/command-parser.d.ts +10 -0
  822. package/dist/parser/compound-parser.d.ts +28 -0
  823. package/dist/parser/conditional-parser.d.ts +8 -0
  824. package/dist/parser/expansion-parser.d.ts +16 -0
  825. package/dist/parser/lexer.d.ts +192 -0
  826. package/dist/parser/parser-substitution.d.ts +62 -0
  827. package/dist/parser/parser.d.ts +135 -0
  828. package/dist/parser/types.d.ts +25 -0
  829. package/dist/parser/word-parser.d.ts +33 -0
  830. package/dist/sandbox/Command.d.ts +28 -0
  831. package/dist/sandbox/Sandbox.d.ts +60 -0
  832. package/dist/sandbox/index.d.ts +2 -0
  833. package/dist/shell-metadata.d.ts +28 -0
  834. package/dist/test-utils.d.ts +15 -0
  835. package/dist/types.d.ts +148 -0
  836. package/dist/utils/args.d.ts +55 -0
  837. package/dist/utils/bytes.d.ts +39 -0
  838. package/dist/utils/constants.d.ts +15 -0
  839. package/dist/utils/file-reader.d.ts +67 -0
  840. package/dist/utils/glob.d.ts +25 -0
  841. package/package.json +115 -0
@@ -0,0 +1,12 @@
1
+ import{a as G,c as H}from"./chunk-BMKJMOWP.js";import{k as O}from"./chunk-PTELGM2J.js";import{a as _}from"./chunk-44UOCSGV.js";import{a as L,b as q}from"./chunk-KZ3P3SVS.js";import{g,h,j as J,l as Y,m as z,n as P}from"./chunk-O7N2RCS7.js";import{sprintf as M}from"sprintf-js";function X(e,o,n){let t=new Date(o*1e3),a="",s=0;for(;s<e.length;)if(e[s]==="%"&&s+1<e.length){let r=e[s+1],i=ce(t,r,n);i!==null?(a+=i,s+=2):(a+=e[s],s++)}else a+=e[s],s++;return a}function oe(e,o){let n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",hour12:!1,timeZone:o};try{let a=new Intl.DateTimeFormat("en-US",n).formatToParts(e),s=c=>a.find(u=>u.type===c)?.value??"",r=new Map([["Sun",0],["Mon",1],["Tue",2],["Wed",3],["Thu",4],["Fri",5],["Sat",6]]),i=s("weekday");return{year:Number.parseInt(s("year"),10)||e.getFullYear(),month:Number.parseInt(s("month"),10)||e.getMonth()+1,day:Number.parseInt(s("day"),10)||e.getDate(),hour:Number.parseInt(s("hour"),10)||e.getHours(),minute:Number.parseInt(s("minute"),10)||e.getMinutes(),second:Number.parseInt(s("second"),10)||e.getSeconds(),weekday:r.get(i)??e.getDay()}}catch{return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),weekday:e.getDay()}}}function ce(e,o,n){let t=oe(e,n),a=(c,u=2)=>String(c).padStart(u,"0"),s=Q(t.year,t.month,t.day),r=R(t.year,t.month,t.day,t.weekday,0),i=R(t.year,t.month,t.day,t.weekday,1);switch(o){case"a":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.weekday];case"A":return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][t.weekday];case"b":case"h":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.month-1];case"B":return["January","February","March","April","May","June","July","August","September","October","November","December"][t.month-1];case"c":return`${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][t.weekday]} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.month-1]} ${String(t.day).padStart(2," ")} ${a(t.hour)}:${a(t.minute)}:${a(t.second)} ${t.year}`;case"C":return a(Math.floor(t.year/100));case"d":return a(t.day);case"D":return`${a(t.month)}/${a(t.day)}/${a(t.year%100)}`;case"e":return String(t.day).padStart(2," ");case"F":return`${t.year}-${a(t.month)}-${a(t.day)}`;case"g":return a(V(t.year,t.month,t.day)%100);case"G":return String(V(t.year,t.month,t.day));case"H":return a(t.hour);case"I":return a(t.hour%12||12);case"j":return String(s).padStart(3,"0");case"k":return String(t.hour).padStart(2," ");case"l":return String(t.hour%12||12).padStart(2," ");case"m":return a(t.month);case"M":return a(t.minute);case"n":return`
2
+ `;case"N":return"000000000";case"p":return t.hour<12?"AM":"PM";case"P":return t.hour<12?"am":"pm";case"r":return`${a(t.hour%12||12)}:${a(t.minute)}:${a(t.second)} ${t.hour<12?"AM":"PM"}`;case"R":return`${a(t.hour)}:${a(t.minute)}`;case"s":return String(Math.floor(e.getTime()/1e3));case"S":return a(t.second);case"t":return" ";case"T":return`${a(t.hour)}:${a(t.minute)}:${a(t.second)}`;case"u":return String(t.weekday===0?7:t.weekday);case"U":return a(r);case"V":return a(fe(t.year,t.month,t.day));case"w":return String(t.weekday);case"W":return a(i);case"x":return`${a(t.month)}/${a(t.day)}/${a(t.year%100)}`;case"X":return`${a(t.hour)}:${a(t.minute)}:${a(t.second)}`;case"y":return a(t.year%100);case"Y":return String(t.year);case"z":return ue(e,n);case"Z":return le(e,n);case"%":return"%";default:return null}}function ue(e,o){if(!o){let r=-e.getTimezoneOffset(),i=r>=0?"+":"-",c=Math.floor(Math.abs(r)/60),u=Math.abs(r)%60;return`${i}${String(c).padStart(2,"0")}${String(u).padStart(2,"0")}`}try{let c=new Intl.DateTimeFormat("en-US",{timeZone:o,timeZoneName:"longOffset"}).formatToParts(e).find(u=>u.type==="timeZoneName");if(c){let u=c.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(u)return`${u[1]}${u[2]}${u[3]}`;if(c.value==="GMT"||c.value==="UTC")return"+0000"}}catch{}let n=-e.getTimezoneOffset(),t=n>=0?"+":"-",a=Math.floor(Math.abs(n)/60),s=Math.abs(n)%60;return`${t}${String(a).padStart(2,"0")}${String(s).padStart(2,"0")}`}function le(e,o){try{return new Intl.DateTimeFormat("en-US",{timeZone:o,timeZoneName:"short"}).formatToParts(e).find(s=>s.type==="timeZoneName")?.value??"UTC"}catch{return"UTC"}}function Q(e,o,n){let t=[31,28,31,30,31,30,31,31,30,31,30,31];(e%4===0&&e%100!==0||e%400===0)&&(t[1]=29);let s=n;for(let r=0;r<o-1;r++)s+=t[r];return s}function R(e,o,n,t,a){let s=Q(e,o,n),c=(new Date(e,0,1).getDay()-a+7)%7,u=(t-a+7)%7,l=s-1+c;return Math.floor((l-u+7)/7)}function fe(e,o,n){let t=new Date(e,o-1,n,12,0,0);t.setDate(t.getDate()+3-(t.getDay()+6)%7);let a=new Date(t.getFullYear(),0,4);a.setDate(a.getDate()+3-(a.getDay()+6)%7);let s=t.getTime()-a.getTime();return 1+Math.round(s/(10080*60*1e3))}function V(e,o,n){let t=new Date(e,o-1,n,12,0,0);return t.setDate(t.getDate()+3-(t.getDay()+6)%7),t.getFullYear()}var E=new TextEncoder;function C(e,o){for(let n=0;n<o.length;n++)e.push(o[n])}function v(e,o){C(e,E.encode(o))}var de={name:"printf",summary:"format and print data",usage:"printf [-v var] FORMAT [ARGUMENT...]",options:[" -v var assign the output to shell variable VAR rather than display it"," --help display this help and exit"],notes:["FORMAT controls the output like in C printf.","Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)","Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)","Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)","Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)"]},Fe={name:"printf",async execute(e,o){let n=Y(e);if(q(n))return L(de);if(n.length===0)return{stdout:g,stderr:h(`printf: usage: printf format [arguments]
3
+ `),exitCode:2};let t=null,a=0;for(;a<n.length;){let c=n[a];if(c==="--"){a++;break}if(c==="-v"){if(a+1>=n.length)return{stdout:g,stderr:h(`printf: -v: option requires an argument
4
+ `),exitCode:1};if(t=n[a+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[^\]]+\])?$/.test(t))return{stdout:g,stderr:h(`printf: \`${t}': not a valid identifier
5
+ `),exitCode:2};a+=2}else{if(c.startsWith("-")&&c!=="-")break;break}}if(a>=n.length)return{stdout:g,stderr:h(`printf: usage: printf format [arguments]
6
+ `),exitCode:1};let s=n[a],r=n.slice(a+1),i=e.slice(a+1);try{let c=H(s),u=g,l=0,b=!1,f="",I=z(o.env,"TZ")||void 0,x=o.limits?.maxStringLength;do{let{result:y,argsConsumed:S,error:k,errMsg:w,stopped:m}=pe(c,r,l,I,i);if(u=J(u,y),x!==void 0&&x>0&&u.length>x)throw new O(`printf: output size limit exceeded (${x} bytes)`,"string_length");if(l+=S,k&&(b=!0,w&&(f=w)),m)break}while(l<r.length&&l>0);if(l===0&&r.length>0,t){let y=new TextDecoder().decode(u),S=t.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[(['"]?)(.+?)\2\]$/);if(S){let k=S[1],w=S[3];w=w.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,(m,T)=>z(o.env,T)),P(o.env,`${k}_${w}`,y)}else P(o.env,t,y);return{stdout:g,stderr:h(f),exitCode:b?1:0}}return{stdout:u,stderr:h(f),exitCode:b?1:0}}catch(c){if(c instanceof O)throw c;return{stdout:g,stderr:h(`printf: ${_(c)}
7
+ `),exitCode:1}}}};function he(e){return String.fromCharCode(e)}function K(e){return e>=48&&e<=57}function pe(e,o,n,t,a){let s=[],r=0,i=0,c=!1,u="";for(;r<e.length;)if(e[r]===37&&r+1<e.length){let l=r;if(r++,e[r]===37){s.push(37),r++;continue}let f=new TextDecoder().decode(e.subarray(l)).match(/^%(-?\d*)(?:\.(\d+))?\(([^)]*)\)T/);if(f){let $=f[1]?parseInt(f[1],10):0,N=f[2]?parseInt(f[2],10):-1,ae=f[3],ie=E.encode(f[0]),A=o[n+i]||"";i++;let D;A===""||A==="-1"||A==="-2"?D=Math.floor(Date.now()/1e3):D=parseInt(A,10)||0;let p=X(ae,D,t);if(N>=0&&p.length>N&&(p=p.slice(0,N)),$!==0){let W=Math.abs($);p.length<W&&($<0?p=p.padEnd(W," "):p=p.padStart(W," "))}v(s,p),r=l+ie.length;continue}for(;r<e.length&&(e[r]===43||e[r]===45||e[r]===48||e[r]===32||e[r]===35||e[r]===39);)r++;let I=!1;if(e[r]===42)I=!0,r++;else for(;r<e.length&&K(e[r]);)r++;let x=!1;if(e[r]===46)if(r++,e[r]===42)x=!0,r++;else for(;r<e.length&&K(e[r]);)r++;r<e.length&&(e[r]===104||e[r]===108||e[r]===76)&&r++;let y=r<e.length?e[r]:0,S=y?he(y):"";r++;let k=e.subarray(l,r),m=new TextDecoder().decode(k);if(I){let $=parseInt(o[n+i]||"0",10);i++,m=m.replace("*",String($))}if(x){let $=parseInt(o[n+i]||"0",10);i++,m=m.replace(".*",`.${$}`)}let T=n+i,j=o[T]||"",te=a?.[T]??h(j);i++;let{value:re,rawBytes:Z,parseError:ne,parseErrMsg:B,stopped:se}=me(m,S,j,te);if(Z?C(s,Z):v(s,re),ne&&(c=!0,B&&(u=B)),se)return{result:new Uint8Array(s),argsConsumed:i,error:c,errMsg:u,stopped:!0}}else s.push(e[r]),r++;return{result:new Uint8Array(s),argsConsumed:i,error:c,errMsg:u,stopped:!1}}function me(e,o,n,t){let a=!1,s="";switch(o){case"d":case"i":{let r=F(n);return a=d,a&&(s=`printf: ${n}: invalid number
8
+ `),{value:ee(e,r),parseError:a,parseErrMsg:s}}case"o":{let r=F(n);return a=d,a&&(s=`printf: ${n}: invalid number
9
+ `),{value:ge(e,r),parseError:a,parseErrMsg:s}}case"u":{let r=F(n);a=d,a&&(s=`printf: ${n}: invalid number
10
+ `);let i=r<0?r>>>0:r;return{value:ee(e.replace("u","d"),i),parseError:a,parseErrMsg:s}}case"x":case"X":{let r=F(n);return a=d,a&&(s=`printf: ${n}: invalid number
11
+ `),{value:xe(e,r),parseError:a,parseErrMsg:s}}case"e":case"E":case"f":case"F":case"g":case"G":{let r=parseFloat(n)||0;return{value:$e(e,o,r),parseError:!1,parseErrMsg:""}}case"c":{if(n==="")return{value:"",parseError:!1,parseErrMsg:""};let r=E.encode(n);return{value:"",rawBytes:new Uint8Array([r[0]]),parseError:!1,parseErrMsg:""}}case"s":return{value:Se(e,n),parseError:!1,parseErrMsg:""};case"q":return{value:we(e,t??h(n)),parseError:!1,parseErrMsg:""};case"b":{let r=Me(n);return{value:"",rawBytes:r.value,parseError:!1,parseErrMsg:"",stopped:r.stopped}}default:try{return{value:M(e,n),parseError:!1,parseErrMsg:""}}catch{return{value:"",parseError:!0,parseErrMsg:`printf: [sprintf] unexpected placeholder
12
+ `}}}}var d=!1;function F(e){d=!1;let o=e.trimStart(),n=o!==o.trimEnd();if(e=o.trimEnd(),e.startsWith("'")&&e.length>=2||e.startsWith('"')&&e.length>=2)return e.charCodeAt(1);if(e.startsWith("\\'")&&e.length>=3||e.startsWith('\\"')&&e.length>=3)return e.charCodeAt(2);if(e.startsWith("+")&&(e=e.slice(1)),e.startsWith("0x")||e.startsWith("0X")){let t=parseInt(e,16);return Number.isNaN(t)?(d=!0,0):(n&&(d=!0),t)}if(e.startsWith("0")&&e.length>1&&/^-?0[0-7]+$/.test(e))return n&&(d=!0),parseInt(e,8)||0;if(/^\d+#/.test(e)){d=!0;let t=e.match(/^(\d+)#/);return t?parseInt(t[1],10):0}if(e!==""&&!/^-?\d+$/.test(e)){d=!0;let t=parseInt(e,10);return Number.isNaN(t)?0:t}return n&&(d=!0),parseInt(e,10)||0}function ee(e,o){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!n)return M(e.replace(/\.\d*/,""),o);let t=n[1]||"",a=n[2]?parseInt(n[2],10):0,s=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,r=o<0,i=Math.abs(o),c=String(i);s>=0&&(c=c.padStart(s,"0"));let u="";r?u="-":t.includes("+")?u="+":t.includes(" ")&&(u=" ");let l=u+c;return a>l.length&&(t.includes("-")?l=l.padEnd(a," "):t.includes("0")&&s<0?l=u+c.padStart(a-u.length,"0"):l=l.padStart(a," ")),l}function ge(e,o){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!n)return M(e,o);let t=n[1]||"",a=n[2]?parseInt(n[2],10):0,s=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,r=Math.abs(o).toString(8);s>=0&&(r=r.padStart(s,"0")),t.includes("#")&&!r.startsWith("0")&&(r=`0${r}`);let i=r;return a>i.length&&(t.includes("-")?i=i.padEnd(a," "):t.includes("0")&&s<0?i=i.padStart(a,"0"):i=i.padStart(a," ")),i}function xe(e,o){let n=e.includes("X"),t=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!t)return M(e,o);let a=t[1]||"",s=t[2]?parseInt(t[2],10):0,r=t[3]!==void 0?t[4]?parseInt(t[4],10):0:-1,i=Math.abs(o).toString(16);n&&(i=i.toUpperCase()),r>=0&&(i=i.padStart(r,"0"));let c="";a.includes("#")&&o!==0&&(c=n?"0X":"0x");let u=c+i;return s>u.length&&(a.includes("-")?u=u.padEnd(s," "):a.includes("0")&&r<0?u=c+i.padStart(s-c.length,"0"):u=u.padStart(s," ")),u}function U(e){return e<128?1:(e&224)===192?2:(e&240)===224?3:(e&248)===240?4:0}function ye(e){if(e.length===0)return"''";let o=!0;for(let s=0;s<e.length;s++){let r=e[s];if(!(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===46||r===95||r===47||r===45)){o=!1;break}}if(o)return new TextDecoder().decode(e);let n=!1;for(let s=0;s<e.length;s++){let r=e[s];if(r<32||r===127){n=!0;break}if(r>=128){let i=U(r);if(i===0||s+i>e.length){n=!0;break}let c=!0;for(let u=1;u<i;u++)if((e[s+u]&192)!==128){c=!1;break}if(!c){n=!0;break}s+=i-1}}if(n){let s="$'";for(let r=0;r<e.length;r++){let i=e[r];if(i===39)s+="\\'";else if(i===92)s+="\\\\";else if(i===10)s+="\\n";else if(i===9)s+="\\t";else if(i===13)s+="\\r";else if(i===7)s+="\\a";else if(i===8)s+="\\b";else if(i===12)s+="\\f";else if(i===11)s+="\\v";else if(i===27)s+="\\E";else if(i<32||i===127)s+=`\\${i.toString(8).padStart(3,"0")}`;else if(i>=128){let c=U(i),u=c>0&&r+c<=e.length;if(u){for(let l=1;l<c;l++)if((e[r+l]&192)!==128){u=!1;break}}if(u){let l=new TextDecoder().decode(e.subarray(r,r+c));s+=l,r+=c-1}else s+=`\\${i.toString(8).padStart(3,"0")}`}else i===34?s+='\\"':s+=String.fromCharCode(i)}return s+="'",s}let t=new Set(" |&;<>()$`\\\"'*?[#~=%!{}".split("").map(s=>s.charCodeAt(0))),a="";for(let s=0;s<e.length;s++){let r=e[s];if(r>=128){let i=U(r),c=new TextDecoder().decode(e.subarray(s,s+i));a+=c,s+=i-1}else t.has(r)?a+=`\\${String.fromCharCode(r)}`:a+=String.fromCharCode(r)}return a}function Se(e,o){let n=e.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!n)return M(e.replace(/0+(?=\d)/,""),o);let t=n[1]==="-",a=n[2]?parseInt(n[2],10):0,s=n[3]!==void 0?n[4]?parseInt(n[4],10):0:-1,r=t?-a:a;return G(o,r,s)}function we(e,o){let n=ye(o),t=e.match(/^%(-?)(\d*)q$/);if(!t)return n;let a=t[1]==="-",s=t[2]?parseInt(t[2],10):0,r=n;return s>r.length&&(a?r=r.padEnd(s," "):r=r.padStart(s," ")),r}function $e(e,o,n){let t=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!t)return M(e,n);let a=t[1]||"",s=t[2]?parseInt(t[2],10):0,r=t[3]!==void 0?t[4]?parseInt(t[4],10):0:6,i,c=o.toLowerCase();if(c==="e"?(i=n.toExponential(r),i=i.replace(/e([+-])(\d)$/,"e$10$2"),o==="E"&&(i=i.toUpperCase())):c==="f"?(i=n.toFixed(r),a.includes("#")&&r===0&&!i.includes(".")&&(i+=".")):c==="g"?(i=n.toPrecision(r||1),a.includes("#")||(i=i.replace(/\.?0+$/,""),i=i.replace(/\.?0+e/,"e")),i=i.replace(/e([+-])(\d)$/,"e$10$2"),o==="G"&&(i=i.toUpperCase())):i=n.toString(),n>=0&&(a.includes("+")?i=`+${i}`:a.includes(" ")&&(i=` ${i}`)),s>i.length)if(a.includes("-"))i=i.padEnd(s," ");else if(a.includes("0")){let u=i.match(/^[+ -]/)?.[0]||"",l=u?i.slice(1):i;i=u+l.padStart(s-u.length,"0")}else i=i.padStart(s," ");return i}function Me(e){let o=[],n=0;for(;n<e.length;)if(e[n]==="\\"&&n+1<e.length)switch(e[n+1]){case"n":o.push(10),n+=2;break;case"t":o.push(9),n+=2;break;case"r":o.push(13),n+=2;break;case"\\":o.push(92),n+=2;break;case"a":o.push(7),n+=2;break;case"b":o.push(8),n+=2;break;case"f":o.push(12),n+=2;break;case"v":o.push(11),n+=2;break;case"c":return{value:new Uint8Array(o),stopped:!0};case"x":{let a=n,s=!1;for(;a+1<e.length&&e[a]==="\\"&&e[a+1]==="x";){let r="",i=a+2;for(;i<e.length&&i<a+4&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;if(r)o.push(parseInt(r,16)),a=i,s=!0;else break}s?n=a:(v(o,"\\x"),n+=2);break}case"u":{let a="",s=n+2;for(;s<e.length&&s<n+6&&/[0-9a-fA-F]/.test(e[s]);)a+=e[s],s++;a?(C(o,E.encode(String.fromCodePoint(parseInt(a,16)))),n=s):(v(o,"\\u"),n+=2);break}case"0":{let a="",s=n+2;for(;s<e.length&&s<n+5&&/[0-7]/.test(e[s]);)a+=e[s],s++;a?o.push(parseInt(a,8)&255):o.push(0),n=s;break}case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let a="",s=n+1;for(;s<e.length&&s<n+4&&/[0-7]/.test(e[s]);)a+=e[s],s++;o.push(parseInt(a,8)&255),n=s;break}default:v(o,e[n]),n++}else{let t=e.charCodeAt(n);if(t<128)o.push(t),n++;else{let a=t>=55296&&t<=56319&&n+1<e.length?e.slice(n,n+2):e[n];C(o,E.encode(a)),n+=a.length}}return{value:new Uint8Array(o),stopped:!1}}var Ce={name:"printf",flags:[{flag:"-v",type:"value",valueHint:"string"}],stdinType:"none",needsArgs:!0};export{Fe as a,Ce as b};
@@ -0,0 +1 @@
1
+ import{a as m}from"./chunk-AJNR4FJT.js";var s=m("md5sum","md5","compute MD5 message digest"),o={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{s as a,o as b};
@@ -0,0 +1,15 @@
1
+ import{a as b,b as x,c as g}from"./chunk-KZ3P3SVS.js";import{g as r,h as d,i as h,l as m}from"./chunk-O7N2RCS7.js";var v={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 N(a){let l=a.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!l)return null;let i=Number.parseInt(l[1],10);if(Number.isNaN(i)||i<1)return null;let t=(l[2]||"").toUpperCase(),e=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(t);return e===void 0?null:i*e}function S(a,l,i){if(l)return a.toString().padStart(i,"0");let t="abcdefghijklmnopqrstuvwxyz",o="",e=a;for(let u=0;u<i;u++)o=t[e%26]+o,e=Math.floor(e/26);return o}function I(a,l){let i=a.split(`
2
+ `),t=a.endsWith(`
3
+ `)&&i[i.length-1]==="";t&&i.pop();let o=[];for(let e=0;e<i.length;e+=l){let u=i.slice(e,e+l),f=e+l>=i.length&&!t?u.join(`
4
+ `):`${u.join(`
5
+ `)}
6
+ `;o.push({content:f,hasContent:!0})}return o}function $(a,l){let t=new TextEncoder().encode(a),o=new TextDecoder,e=[];for(let u=0;u<t.length;u+=l){let c=t.slice(u,u+l);e.push({content:o.decode(c),hasContent:c.length>0})}return e}function w(a,l){let t=new TextEncoder().encode(a),o=new TextDecoder,e=[],u=Math.ceil(t.length/l);for(let c=0;c<l;c++){let f=c*u,p=Math.min(f+u,t.length),n=t.slice(f,p);e.push({content:o.decode(n),hasContent:n.length>0})}return e}var L={name:"split",execute:async(a,l)=>{let i=m(a);if(x(i))return b(v);let t={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},o=[],e=0;for(;e<i.length;){let n=i[e];if(n==="-l"&&e+1<i.length){let s=Number.parseInt(i[e+1],10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:r,stderr:d(`split: invalid number of lines: '${i[e+1]}'
7
+ `)};t.mode="lines",t.lines=s,e+=2}else if(n.match(/^-l\d+$/)){let s=Number.parseInt(n.slice(2),10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:r,stderr:d(`split: invalid number of lines: '${n.slice(2)}'
8
+ `)};t.mode="lines",t.lines=s,e++}else if(n==="-b"&&e+1<i.length){let s=N(i[e+1]);if(s===null)return{exitCode:1,stdout:r,stderr:d(`split: invalid number of bytes: '${i[e+1]}'
9
+ `)};t.mode="bytes",t.bytes=s,e+=2}else if(n.match(/^-b.+$/)){let s=N(n.slice(2));if(s===null)return{exitCode:1,stdout:r,stderr:d(`split: invalid number of bytes: '${n.slice(2)}'
10
+ `)};t.mode="bytes",t.bytes=s,e++}else if(n==="-n"&&e+1<i.length){let s=Number.parseInt(i[e+1],10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:r,stderr:d(`split: invalid number of chunks: '${i[e+1]}'
11
+ `)};t.mode="chunks",t.chunks=s,e+=2}else if(n.match(/^-n\d+$/)){let s=Number.parseInt(n.slice(2),10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:r,stderr:d(`split: invalid number of chunks: '${n.slice(2)}'
12
+ `)};t.mode="chunks",t.chunks=s,e++}else if(n==="-a"&&e+1<i.length){let s=Number.parseInt(i[e+1],10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:r,stderr:d(`split: invalid suffix length: '${i[e+1]}'
13
+ `)};t.suffixLength=s,e+=2}else if(n.match(/^-a\d+$/)){let s=Number.parseInt(n.slice(2),10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:r,stderr:d(`split: invalid suffix length: '${n.slice(2)}'
14
+ `)};t.suffixLength=s,e++}else if(n==="-d"||n==="--numeric-suffixes")t.useNumericSuffix=!0,e++;else if(n.startsWith("--additional-suffix="))t.additionalSuffix=n.slice(20),e++;else if(n==="--additional-suffix"&&e+1<i.length)t.additionalSuffix=i[e+1],e+=2;else if(n==="--"){o.push(...i.slice(e+1));break}else{if(n.startsWith("-")&&n!=="-")return g("split",n);o.push(n),e++}}let u="-",c="x";o.length>=1&&(u=o[0]),o.length>=2&&(c=o[1]);let f;if(u==="-")f=h(l.stdin);else{let n=l.fs.resolvePath(l.cwd,u),s=await l.fs.readFile(n);if(s===null)return{exitCode:1,stdout:r,stderr:d(`split: ${u}: No such file or directory
15
+ `)};f=s}if(f==="")return{exitCode:0,stdout:r,stderr:r};let p;switch(t.mode){case"lines":p=I(f,t.lines);break;case"bytes":p=$(f,t.bytes);break;case"chunks":p=w(f,t.chunks);break;default:return t.mode}for(let n=0;n<p.length;n++){let s=p[n];if(!s.hasContent)continue;let k=S(n,t.useNumericSuffix,t.suffixLength),y=`${c}${k}${t.additionalSuffix}`,C=l.fs.resolvePath(l.cwd,y);await l.fs.writeFile(C,s.content)}return{exitCode:0,stdout:r,stderr:r}}},P={name:"split",flags:[{flag:"-l",type:"value",valueHint:"number"},{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-d",type:"boolean"},{flag:"-a",type:"value",valueHint:"number"}],needsFiles:!0};export{L as a,P as b};
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-YNYSPYQ5.js";var r=new Map;function h(l,c,t){let s=typeof t=="boolean"?{ignoreCase:t}:t??{},e=c;s.stripQuotes&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1));let i=s.ignoreCase?`i:${e}`:e,o=r.get(i);return o||(o=f(e,s.ignoreCase),r.set(i,o)),o.test(l)}function f(l,c){let t="^";for(let s=0;s<l.length;s++){let e=l[s];if(e==="*")t+=".*";else if(e==="?")t+=".";else if(e==="["){let i=s+1;for(;i<l.length&&l[i]!=="]";)i++;t+=l.slice(s,i+1),s=i}else e==="."||e==="+"||e==="^"||e==="$"||e==="{"||e==="}"||e==="("||e===")"||e==="|"||e==="\\"?t+=`\\${e}`:t+=e}return t+="$",n(t,c?"i":"")}export{h as a};
@@ -0,0 +1,8 @@
1
+ import{a as C,b as I}from"./chunk-KZ3P3SVS.js";import{g as p,h as m,l as y}from"./chunk-O7N2RCS7.js";var E={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"]},A={name:"chmod",async execute(a,f){let e=y(a);if(I(e))return C(E);if(e.length<2)return{stdout:p,stderr:m(`chmod: missing operand
2
+ `),exitCode:1};let l=!1,c=!1,t=0;for(;t<e.length&&e[t].startsWith("-");){let o=e[t];if(o==="-R"||o==="--recursive")l=!0,t++;else if(o==="-v"||o==="--verbose")c=!0,t++;else if(o==="--"){t++;break}else{if(/^[+-]?[rwxugo]+/.test(o)||/^\d+$/.test(o))break;if(/^-[Rv]+$/.test(o)){o.includes("R")&&(l=!0),o.includes("v")&&(c=!0),t++;continue}return{stdout:p,stderr:m(`chmod: invalid option -- '${o.slice(1)}'
3
+ `),exitCode:1}}}if(e.length-t<2)return{stdout:p,stderr:m(`chmod: missing operand
4
+ `),exitCode:1};let i=e[t],d=e.slice(t+1),s=/^[0-7]+$/.test(i),n;if(s)n=parseInt(i,8);else try{v(i,420)}catch{return{stdout:p,stderr:m(`chmod: invalid mode: '${i}'
5
+ `),exitCode:1}}let r="",u="",h=!1;for(let o of d){let g=f.fs.resolvePath(f.cwd,o);try{let w;if(s&&n!==void 0)w=n;else{let $=await f.fs.stat(g);w=v(i,$.mode)}if(await f.fs.chmod(g,w),c&&(r+=`mode of '${o}' changed to ${w.toString(8).padStart(4,"0")}
6
+ `),l&&(await f.fs.stat(g)).isDirectory){let b=await R(f,g,s?n:void 0,s?void 0:i,c);r+=b}}catch{u+=`chmod: cannot access '${o}': No such file or directory
7
+ `,h=!0}}return{stdout:m(r),stderr:m(u),exitCode:h?1:0}}};async function R(a,f,e,l,c){let t="",i=await a.fs.readdir(f);for(let d of i){let s=f==="/"?`/${d}`:`${f}/${d}`,n;if(e!==void 0)n=e;else if(l!==void 0){let u=await a.fs.stat(s);n=v(l,u.mode)}else n=420;await a.fs.chmod(s,n),c&&(t+=`mode of '${s}' changed to ${n.toString(8).padStart(4,"0")}
8
+ `),(await a.fs.stat(s)).isDirectory&&(t+=await R(a,s,e,l,c))}return t}function v(a,f=420){if(/^[0-7]+$/.test(a))return parseInt(a,8);let e=f&4095,l=a.split(",");for(let c of l){let t=c.match(/^([ugoa]*)([+\-=])([rwxXst]*)$/);if(!t)throw new Error(`Invalid mode: ${a}`);let i=t[1]||"a",d=t[2],s=t[3];(i==="a"||i==="")&&(i="ugo");let n=0;s.includes("r")&&(n|=4),s.includes("w")&&(n|=2),(s.includes("x")||s.includes("X"))&&(n|=1);let r=0;s.includes("s")&&(i.includes("u")&&(r|=2048),i.includes("g")&&(r|=1024)),s.includes("t")&&(r|=512);for(let u of i){let h=0;u==="u"?h=6:u==="g"?h=3:u==="o"&&(h=0);let o=n<<h;d==="+"?e|=o:d==="-"?e&=~o:d==="="&&(e&=~(7<<h),e|=o)}d==="+"?e|=r:d==="-"?e&=~r:d==="="&&(s.includes("s")&&(i.includes("u")&&(e&=-2049,e|=r&2048),i.includes("g")&&(e&=-1025,e|=r&1024)),s.includes("t")&&(e&=-513,e|=r&512))}return e}var F={name:"chmod",flags:[{flag:"-R",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{A as a,F as b};
@@ -0,0 +1,2 @@
1
+ import{g as s,h as r,l as f}from"./chunk-O7N2RCS7.js";var c={name:"pwd",async execute(l,t){let n=f(l),a=!1;for(let e of n)if(e==="-P")a=!0;else if(e==="-L")a=!1;else{if(e==="--")break;e.startsWith("-")}let o=t.cwd;if(a)try{o=await t.fs.realpath(t.cwd)}catch{}return{stdout:r(`${o}
2
+ `),stderr:s,exitCode:0}}},i={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]};export{c as a,i as b};
@@ -0,0 +1,9 @@
1
+ import{a as p,b as y}from"./chunk-KZ3P3SVS.js";import{g as n,h as i,l as h}from"./chunk-O7N2RCS7.js";var k={name:"ln",summary:"make links between files",usage:"ln [OPTIONS] TARGET LINK_NAME",options:["-s create a symbolic link instead of a hard link","-f remove existing destination files","-n treat LINK_NAME as a normal file if it is a symbolic link to a directory","-v print name of each linked file"," --help display this help and exit"]},$={name:"ln",async execute(b,s){let r=h(b);if(y(r))return p(k);let o=!1,d=!1,c=!1,t=0;for(;t<r.length&&r[t].startsWith("-");){let e=r[t];if(e==="-s"||e==="--symbolic")o=!0,t++;else if(e==="-f"||e==="--force")d=!0,t++;else if(e==="-v"||e==="--verbose")c=!0,t++;else if(e==="-n"||e==="--no-dereference")t++;else if(/^-[sfvn]+$/.test(e))e.includes("s")&&(o=!0),e.includes("f")&&(d=!0),e.includes("v")&&(c=!0),t++;else if(e==="--"){t++;break}else return{stdout:n,stderr:i(`ln: invalid option -- '${e.slice(1)}'
2
+ `),exitCode:1}}let u=r.slice(t);if(u.length<2)return{stdout:n,stderr:i(`ln: missing file operand
3
+ `),exitCode:1};let l=u[0],a=u[1],f=s.fs.resolvePath(s.cwd,a);if(await s.fs.exists(f))if(d)try{await s.fs.rm(f,{force:!0})}catch{return{stdout:n,stderr:i(`ln: cannot remove '${a}': Permission denied
4
+ `),exitCode:1}}else return{stdout:n,stderr:i(`ln: failed to create ${o?"symbolic ":""}link '${a}': File exists
5
+ `),exitCode:1};try{if(o)await s.fs.symlink(l,f);else{let e=s.fs.resolvePath(s.cwd,l);if(!await s.fs.exists(e))return{stdout:n,stderr:i(`ln: failed to access '${l}': No such file or directory
6
+ `),exitCode:1};await s.fs.link(e,f)}}catch(e){let g=e;return g.message.includes("EPERM")?{stdout:n,stderr:i(`ln: '${l}': hard link not allowed for directory
7
+ `),exitCode:1}:{stdout:n,stderr:i(`ln: ${g.message}
8
+ `),exitCode:1}}let m="";return c&&(m=`'${a}' -> '${l}'
9
+ `),{stdout:i(m),stderr:n,exitCode:0}}},x={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{$ as a,x as b};
@@ -0,0 +1,5 @@
1
+ import{a as f,b as u}from"./chunk-KZ3P3SVS.js";import{g as r,h as o,l as p}from"./chunk-O7N2RCS7.js";var g={name:"basename",summary:"strip directory and suffix from filenames",usage:`basename NAME [SUFFIX]
2
+ basename OPTION... NAME...`,options:["-a, --multiple support multiple arguments","-s, --suffix=SUFFIX remove a trailing SUFFIX"," --help display this help and exit"]},b={name:"basename",async execute(c,d){let a=p(c);if(u(a))return f(g);let l=!1,t="",n=[];for(let s=0;s<a.length;s++){let e=a[s];e==="-a"||e==="--multiple"?l=!0:e==="-s"&&s+1<a.length?(t=a[++s],l=!0):e.startsWith("--suffix=")?(t=e.slice(9),l=!0):e.startsWith("-")||n.push(e)}if(n.length===0)return{stdout:r,stderr:o(`basename: missing operand
3
+ `),exitCode:1};!l&&n.length>=2&&(t=n.pop()??"");let m=[];for(let s of n){let e=s.replace(/\/+$/,""),i=e.split("/").pop()||e;t&&i.endsWith(t)&&(i=i.slice(0,-t.length)),m.push(i)}return{stdout:o(`${m.join(`
4
+ `)}
5
+ `),stderr:r,exitCode:0}}},F={name:"basename",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"value",valueHint:"string"}],needsArgs:!0};export{b as a,F as b};
@@ -0,0 +1,8 @@
1
+ import{g as s,h as o,i as d,l as a}from"./chunk-O7N2RCS7.js";async function f(l,r){let e=a(l);if(e.length>0&&e[0]!=="-"){let u=e[0].startsWith("/")?e[0]:`${r.cwd}/${e[0]}`;try{let n=(await r.fs.readFile(u)).split(`
2
+ `);n[n.length-1]===""&&n.pop();let i=n.reverse();return{stdout:o(i.length>0?`${i.join(`
3
+ `)}
4
+ `:""),stderr:s,exitCode:0}}catch{return{stdout:s,stderr:o(`tac: ${e[0]}: No such file or directory
5
+ `),exitCode:1}}}let t=d(r.stdin).split(`
6
+ `);t[t.length-1]===""&&t.pop();let c=t.reverse();return{stdout:o(c.length>0?`${c.join(`
7
+ `)}
8
+ `:""),stderr:s,exitCode:0}}var h={name:"tac",execute:f},x={name:"tac",flags:[],stdinType:"text",needsFiles:!0};export{h as a,x as b};
@@ -0,0 +1,22 @@
1
+ import{g as s,h as o}from"./chunk-O7N2RCS7.js";function p(e){let t=`${e.name} - ${e.summary}
2
+
3
+ `;if(t+=`Usage: ${e.usage}
4
+ `,e.description){if(t+=`
5
+ Description:
6
+ `,typeof e.description=="string")for(let n of e.description.split(`
7
+ `))t+=n?` ${n}
8
+ `:`
9
+ `;else if(e.description.length>0)for(let n of e.description)t+=n?` ${n}
10
+ `:`
11
+ `}if(e.options&&e.options.length>0){t+=`
12
+ Options:
13
+ `;for(let n of e.options)t+=` ${n}
14
+ `}if(e.examples&&e.examples.length>0){t+=`
15
+ Examples:
16
+ `;for(let n of e.examples)t+=` ${n}
17
+ `}if(e.notes&&e.notes.length>0){t+=`
18
+ Notes:
19
+ `;for(let n of e.notes)t+=` ${n}
20
+ `}return{stdout:o(t),stderr:s,exitCode:0}}function i(e){return e.includes("--help")}function l(e,t){let n=t.startsWith("--")?`${e}: unrecognized option '${t}'
21
+ `:`${e}: invalid option -- '${t.replace(/^-/,"")}'
22
+ `;return{stdout:s,stderr:o(n),exitCode:1}}export{p as a,i as b,l as c};
@@ -0,0 +1 @@
1
+ import{a as c,b as t}from"./chunk-KZ3P3SVS.js";import{g as e,h as r,l as a}from"./chunk-O7N2RCS7.js";var l={name:"clear",summary:"clear the terminal screen",usage:"clear [OPTIONS]",options:[" --help display this help and exit"]},d={name:"clear",async execute(n,s){let o=a(n);return t(o)?c(l):{stdout:r("\x1B[2J\x1B[H"),stderr:e,exitCode:0}}},u={name:"clear",flags:[]};export{d as a,u as b};
@@ -0,0 +1,15 @@
1
+ import{g as c,h as i,l}from"./chunk-O7N2RCS7.js";var m=new Map([["File operations",["ls","cat","head","tail","wc","touch","mkdir","rm","cp","mv","ln","chmod","stat","readlink"]],["Text processing",["grep","sed","awk","sort","uniq","cut","tr","tee","diff"]],["Search",["find"]],["Navigation & paths",["pwd","basename","dirname","tree","du"]],["Environment & shell",["echo","printf","env","printenv","export","alias","unalias","history","clear","true","false","bash","sh"]],["Data processing",["xargs","jq","base64","date"]],["Network",["curl","html-to-markdown"]]]);function h(o){let e=[],n=new Set(o);e.push(`Available commands:
2
+ `);let s=[];for(let[t,d]of m){let a=d.filter(r=>n.has(r));if(a.length>0){e.push(` ${t}:`),e.push(` ${a.join(", ")}
3
+ `);for(let r of a)n.delete(r)}}for(let t of n)s.push(t);return s.length>0&&(e.push(" Other:"),e.push(` ${s.sort().join(", ")}
4
+ `)),e.push("Use '<command> --help' for details on a specific command."),`${e.join(`
5
+ `)}
6
+ `}var u={name:"help",async execute(o,e){let n=l(o);if(n.includes("--help")||n.includes("-h"))return{stdout:i(`help - display available commands
7
+
8
+ Usage: help [command]
9
+
10
+ Options:
11
+ -h, --help Show this help message
12
+
13
+ If a command name is provided, shows help for that command.
14
+ Otherwise, lists all available commands.
15
+ `),stderr:c,exitCode:0};if(n.length>0&&e.exec){let t=n[0];return e.exec(`${t} --help`,{cwd:e.cwd})}let s=e.getRegisteredCommands?.()??[];return{stdout:i(h(s)),stderr:c,exitCode:0}}},f={name:"help",flags:[]};export{u as a,f as b};
@@ -0,0 +1 @@
1
+ import{g as e}from"./chunk-O7N2RCS7.js";var r={name:"true",async execute(){return{stdout:e,stderr:e,exitCode:0}}},o={name:"false",async execute(){return{stdout:e,stderr:e,exitCode:1}}},s={name:"true",flags:[]},a={name:"false",flags:[]};export{r as a,o as b,s as c,a as d};
@@ -0,0 +1,6 @@
1
+ import{a as c,b as p}from"./chunk-KZ3P3SVS.js";import{g as i,h as r,l as f,m,n as g}from"./chunk-O7N2RCS7.js";var h={name:"alias",summary:"define or display aliases",usage:"alias [name[=value] ...]",options:[" --help display this help and exit"]},l="BASH_ALIAS_",x={name:"alias",async execute(d,a){let e=f(d);if(p(e))return c(h);if(e.length===0){let s="";for(let n of a.env.keys())if(n.startsWith(l)){let t=n.slice(l.length);s+=`alias ${t}='${m(a.env,n)}'
2
+ `}return{stdout:r(s),stderr:i,exitCode:0}}let u=e[0]==="--"?e.slice(1):e;for(let s of u){let n=s.indexOf("=");if(n===-1){let t=l+s;return a.env.get(t)?{stdout:r(`alias ${s}='${m(a.env,t)}'
3
+ `),stderr:i,exitCode:0}:{stdout:i,stderr:r(`alias: ${s}: not found
4
+ `),exitCode:1}}else{let t=s.slice(0,n),o=s.slice(n+1);(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))&&(o=o.slice(1,-1)),g(a.env,l+t,o)}}return{stdout:i,stderr:i,exitCode:0}}},C={name:"unalias",async execute(d,a){let e=f(d);if(p(e))return c({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:i,stderr:r(`unalias: usage: unalias [-a] name [name ...]
5
+ `),exitCode:1};if(e[0]==="-a"){for(let t of a.env.keys())t.startsWith(l)&&a.env.delete(t);return{stdout:i,stderr:i,exitCode:0}}let u=e[0]==="--"?e.slice(1):e,s=!1,n="";for(let t of u){let o=l+t;a.env.get(o)?a.env.delete(o):(n+=`unalias: ${t}: not found
6
+ `,s=!0)}return{stdout:i,stderr:r(n),exitCode:s?1:0}}},A={name:"alias",flags:[]},F={name:"unalias",flags:[{flag:"-a",type:"boolean"}]};export{x as a,C as b,A as c,F as d};
@@ -0,0 +1,5 @@
1
+ import{a as m}from"./chunk-OXRHP7HO.js";import{a as h,b}from"./chunk-KZ3P3SVS.js";import{g as d,h as i,l as g}from"./chunk-O7N2RCS7.js";var B={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"]},F={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};async function y(n,a,c){if(a.length===0||a.length===1&&a[0]==="-")return{ok:!0,data:n.stdin};let r=[];for(let e of a){if(e==="-"){r.push(n.stdin);continue}try{let t=n.fs.resolvePath(n.cwd,e),o=await n.fs.readFileBuffer(t);r.push(o)}catch{return{ok:!1,error:{stdout:d,stderr:i(`${c}: ${e}: No such file or directory
2
+ `),exitCode:1}}}}let l=r.reduce((e,t)=>e+t.length,0),s=new Uint8Array(l),f=0;for(let e of r)s.set(e,f),f+=e.length;return{ok:!0,data:s}}var v={name:"base64",async execute(n,a){let c=g(n);if(b(c))return h(B);let r=m("base64",c,F);if(!r.ok)return r.error;let l=r.result.flags.decode,s=r.result.flags.wrap,f=r.result.positional;try{if(l){let o=await y(a,f,"base64");if(!o.ok)return o.error;if(typeof Buffer<"u"){let k=Buffer.from(o.data).toString("utf8").replace(/\s/g,""),p=Buffer.from(k,"base64");return{stdout:new Uint8Array(p.buffer,p.byteOffset,p.byteLength),stderr:d,exitCode:0}}let w=String.fromCharCode(...o.data).replace(/\s/g,""),C=atob(w);return{stdout:i(C),stderr:d,exitCode:0}}let e=await y(a,f,"base64");if(!e.ok)return e.error;let t;if(typeof Buffer<"u"?t=Buffer.from(e.data).toString("base64"):t=btoa(String.fromCharCode(...e.data)),s>0){let o=[];for(let u=0;u<t.length;u+=s)o.push(t.slice(u,u+s));t=o.join(`
3
+ `)+(t.length>0?`
4
+ `:"")}return{stdout:i(t),stderr:d,exitCode:0}}catch{return{stdout:d,stderr:i(`base64: invalid input
5
+ `),exitCode:1}}}},A={name:"base64",flags:[{flag:"-d",type:"boolean"},{flag:"-w",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{v as a,A as b};
@@ -0,0 +1,6 @@
1
+ import{a as y}from"./chunk-OXRHP7HO.js";import{a as h,b as m}from"./chunk-KZ3P3SVS.js";import{g as e,h as o,i as d,l as g}from"./chunk-O7N2RCS7.js";import*as b from"diff";var A={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:["-u, --unified output unified diff format (default)","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --help display this help and exit"]},E={unified:{short:"u",long:"unified",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},I={name:"diff",async execute(C,t){let l=g(C);if(m(l))return h(A);let r=y("diff",l,E);if(!r.ok)return r.error;let w=r.result.flags.brief,F=r.result.flags.reportSame,$=r.result.flags.ignoreCase,u=r.result.positional;if(r.result.flags.unified,u.length<2)return{stdout:e,stderr:o(`diff: missing operand
2
+ `),exitCode:2};let f,n,[i,s]=u;try{f=i==="-"?t.stdin:await t.fs.readFileBuffer(t.fs.resolvePath(t.cwd,i))}catch{return{stdout:e,stderr:o(`diff: ${i}: No such file or directory
3
+ `),exitCode:2}}try{n=s==="-"?t.stdin:await t.fs.readFileBuffer(t.fs.resolvePath(t.cwd,s))}catch{return{stdout:e,stderr:o(`diff: ${s}: No such file or directory
4
+ `),exitCode:2}}let x=f.length===n.length&&f.every((q,v)=>q===n[v]),c=d(f),p=d(n),a=x;if(!a&&$&&(a=c.toLowerCase()===p.toLowerCase()),a)return F?{stdout:o(`Files ${i} and ${s} are identical
5
+ `),stderr:e,exitCode:0}:{stdout:e,stderr:e,exitCode:0};if(w)return{stdout:o(`Files ${i} and ${s} differ
6
+ `),stderr:e,exitCode:1};let P=b.createTwoFilesPatch(i,s,c,p,"","",{context:3});return{stdout:o(P),stderr:e,exitCode:1}}},N={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{I as a,N as b};
File without changes
@@ -0,0 +1 @@
1
+ var s=Object.create;var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var v=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),w=(e,t)=>{for(var r in t)u(e,r,{get:t[r],enumerable:!0})},i=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of l(t))!p.call(e,d)&&d!==r&&u(e,d,{get:()=>t[d],enumerable:!(n=f(t,d))||n.enumerable});return e};var y=(e,t,r)=>(r=e!=null?s(h(e)):{},i(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e)),E=e=>i(u({},"__esModule",{value:!0}),e);var c=new TextEncoder,o=new TextDecoder,x=new Uint8Array(0);function m(e){return c.encode(e)}function A(e){return o.decode(e)}function T(e,t){if(e.length===0)return t;if(t.length===0)return e;let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function z(e){return e.length===0}function U(e){return e.map(t=>o.decode(t))}function D(e,t,r=""){let n=e.get(t);return n!==void 0?o.decode(n):r}function G(e,t,r){e.set(t,c.encode(r))}function M(e){return{get(t){let r=e.get(t);return r!==void 0?o.decode(r):void 0},set(t,r){return e.set(t,c.encode(r)),this},has(t){return e.has(t)},delete(t){return e.delete(t)},get size(){return e.size},clear(){e.clear()},keys(){return e.keys()},*values(){for(let t of e.values())yield o.decode(t)},*entries(){for(let[t,r]of e.entries())yield[t,o.decode(r)]},forEach(t){for(let[r,n]of e)t(o.decode(n),r,this)},[Symbol.iterator](){return this.entries()},[Symbol.toStringTag]:"StringEnvAdapter"}}function N(e){let t=e.length;for(;t>0&&e[t-1]===10;)t--;return t===e.length?e:t===0?x:e.subarray(0,t)}export{v as a,g as b,a as c,w as d,y as e,E as f,x as g,m as h,A as i,T as j,z as k,U as l,D as m,G as n,M as o,N as p};
@@ -0,0 +1,4 @@
1
+ import{g as c,h as p,l as y}from"./chunk-O7N2RCS7.js";async function B(S,u){let a=y(S),s="octal",r=[],i=[];for(let t=0;t<a.length;t++){let e=a[t];if(e==="-c")r.push("char");else if(e==="-An"||e==="-A"&&a[t+1]==="n")s="none",e==="-A"&&t++;else if(e==="-t"&&a[t+1]){let n=a[++t];n==="x1"?r.push("hex"):n==="c"?r.push("char"):n.startsWith("o")&&r.push("octal")}else(!e.startsWith("-")||e==="-")&&i.push(e)}r.length===0&&r.push("octal");let g=u.stdin;if(i.length>0&&i[0]!=="-"){let t=i[0].startsWith("/")?i[0]:`${u.cwd}/${i[0]}`;try{g=await u.fs.readFileBuffer(t)}catch{return{stdout:c,stderr:p(`od: ${i[0]}: No such file or directory
2
+ `),exitCode:1}}}let x=r.includes("char");function $(t){return t===0?" \\0":t===7?" \\a":t===8?" \\b":t===9?" \\t":t===10?" \\n":t===11?" \\v":t===12?" \\f":t===13?" \\r":t>=32&&t<127?` ${String.fromCharCode(t)}`:` ${t.toString(8).padStart(3,"0")}`}function v(t){return x?` ${t.toString(16).padStart(2,"0")}`:` ${t.toString(16).padStart(2,"0")}`}function A(t){return` ${t.toString(8).padStart(3,"0")}`}let o=Array.from(g),d=16,f=[];for(let t=0;t<o.length;t+=d){let e=o.slice(t,t+d);for(let n=0;n<r.length;n++){let m=r[n],l;m==="char"?l=e.map($):m==="hex"?l=e.map(v):l=e.map(A);let h="";n===0&&s!=="none"?h=`${t.toString(8).padStart(7,"0")} `:(n>0||s==="none")&&(h=s==="none"?"":" "),f.push(h+l.join(""))}}return s!=="none"&&o.length>0&&f.push(o.length.toString(8).padStart(7,"0")),{stdout:p(f.length>0?`${f.join(`
3
+ `)}
4
+ `:""),stderr:c,exitCode:0}}var F={name:"od",execute:B},b={name:"od",flags:[{flag:"-c",type:"boolean"},{flag:"-A",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"string"},{flag:"-N",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{F as a,b};
@@ -0,0 +1,3 @@
1
+ import{c as g}from"./chunk-KZ3P3SVS.js";import{g as p,h as d}from"./chunk-O7N2RCS7.js";function O(a,i,h){let b=new Map,k=new Map;for(let[t,e]of Object.entries(h)){let n={name:t,type:e.type};e.short&&b.set(e.short,n),e.long&&k.set(e.long,n)}let s=Object.create(null);for(let[t,e]of Object.entries(h))e.default!==void 0?s[t]=e.default:e.type==="boolean"&&(s[t]=!1);let m=[],x=!1;for(let t=0;t<i.length;t++){let e=i[t];if(x||!e.startsWith("-")||e==="-"){m.push(e);continue}if(e==="--"){x=!0;continue}if(e.startsWith("--")){let n=e.indexOf("="),o,r;n!==-1?(o=e.slice(2,n),r=e.slice(n+1)):o=e.slice(2);let l=k.get(o);if(!l)return{ok:!1,error:g(a,e)};let{name:f,type:u}=l;if(u==="boolean")s[f]=!0;else{if(r===void 0){if(t+1>=i.length)return{ok:!1,error:{stdout:p,stderr:d(`${a}: option '--${o}' requires an argument
2
+ `),exitCode:1}};r=i[++t]}s[f]=u==="number"?parseInt(r,10):r}}else{let n=e.slice(1);for(let o=0;o<n.length;o++){let r=n[o],l=b.get(r);if(!l)return{ok:!1,error:g(a,`-${r}`)};let{name:f,type:u}=l;if(u==="boolean")s[f]=!0;else{let c;if(o+1<n.length)c=n.slice(o+1);else if(t+1<i.length)c=i[++t];else return{ok:!1,error:{stdout:p,stderr:d(`${a}: option requires an argument -- '${r}'
3
+ `),exitCode:1}};s[f]=u==="number"?parseInt(c,10):c;break}}}}return{ok:!0,result:{flags:s,positional:m}}}export{O as a};
@@ -0,0 +1,99 @@
1
+ import{a as w}from"./chunk-YNYSPYQ5.js";import{k as S}from"./chunk-PTELGM2J.js";import{a as J,b as Y,c as W}from"./chunk-KZ3P3SVS.js";import{g as R,h as C,i as D,l as Q}from"./chunk-O7N2RCS7.js";var q=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]);function U(i){let e="",t=0,n=!1;for(;t<i.length;){if(i[t]==="["&&!n){if(i[t+1]==="["&&i[t+2]===":"){let s=i.indexOf(":]]",t+3);if(s!==-1){let r=i.slice(t+3,s),a=q.get(r);if(a){e+=`[${a}]`,t=s+3;continue}}}if(i[t+1]==="^"&&i[t+2]==="["&&i[t+3]===":"){let s=i.indexOf(":]]",t+4);if(s!==-1){let r=i.slice(t+4,s),a=q.get(r);if(a){e+=`[^${a}]`,t=s+3;continue}}}e+="[",t++,n=!0,t<i.length&&i[t]==="^"&&(e+="^",t++),t<i.length&&i[t]==="]"&&(e+="\\]",t++);continue}if(n){if(i[t]==="]"){e+="]",t++,n=!1;continue}if(i[t]==="["&&i[t+1]===":"){let s=i.indexOf(":]",t+2);if(s!==-1){let r=i.slice(t+2,s),a=q.get(r);if(a){e+=a,t=s+2;continue}}}if(i[t]==="\\"&&t+1<i.length){e+=i[t]+i[t+1],t+=2;continue}e+=i[t],t++;continue}if(i[t]==="\\"&&t+1<i.length){let s=i[t+1];if(s==="+"||s==="?"||s==="|"){e+=s,t+=2;continue}if(s==="("||s===")"){e+=s,t+=2;continue}if(s==="{"||s==="}"){e+=s,t+=2;continue}if(s==="t"){e+=" ",t+=2;continue}if(s==="n"){e+=`
2
+ `,t+=2;continue}if(s==="r"){e+="\r",t+=2;continue}e+=i[t]+s,t+=2;continue}if(i[t]==="+"||i[t]==="?"||i[t]==="|"||i[t]==="("||i[t]===")"){e+=`\\${i[t]}`,t++;continue}if(i[t]==="^"&&!(e===""||e.endsWith("("))){e+="\\^",t++;continue}if(i[t]==="$"){let s=t===i.length-1,r=t+2<i.length&&i[t+1]==="\\"&&i[t+2]===")";if(!s&&!r){e+="\\$",t++;continue}}e+=i[t],t++}return e}function H(i){let e="",t=!1;for(let n=0;n<i.length;n++)i[n]==="["&&!t?(t=!0,e+="[",n++,n<i.length&&i[n]==="^"&&(e+="^",n++),n<i.length&&i[n]==="]"&&(e+="]",n++),n--):i[n]==="]"&&t?(t=!1,e+="]"):!t&&i[n]==="{"&&i[n+1]===","?(e+="{0,",n++):e+=i[n];return e}function ee(i){let e="";for(let t=0;t<i.length;t++){let n=i[t],s=n.charCodeAt(0);n==="\\"?e+="\\\\":n===" "?e+="\\t":n===`
3
+ `?e+=`$
4
+ `:n==="\r"?e+="\\r":n==="\x07"?e+="\\a":n==="\b"?e+="\\b":n==="\f"?e+="\\f":n==="\v"?e+="\\v":s<32||s>=127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=n}return`${e}$`}var ue=1e4;function te(i,e,t){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:i,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],pendingExecute:void 0,rangeStates:t||new Map,linesConsumedInCycle:0}}function de(i){return typeof i=="object"&&"first"in i&&"step"in i}function he(i){return typeof i=="object"&&"offset"in i}function L(i,e,t,n,s){if(i==="$")return e===t;if(typeof i=="number")return e===i;if(de(i)){let{first:r,step:a}=i;return a===0?e===r:(e-r)%a===0&&e>=r}if(typeof i=="object"&&"pattern"in i)try{let r=i.pattern;r===""&&s?.lastPattern?r=s.lastPattern:r!==""&&s&&(s.lastPattern=r);let a=H(U(r));return w(a).test(n)}catch{return!1}return!1}function z(i){let e=t=>t===void 0?"undefined":t==="$"?"$":typeof t=="number"?String(t):"pattern"in t?`/${t.pattern}/`:"first"in t?`${t.first}~${t.step}`:"unknown";return`${e(i.start)},${e(i.end)}`}function fe(i,e,t,n,s,r){if(!i||!i.start&&!i.end)return!0;let a=i.start,l=i.end;if(a!==void 0&&l===void 0)return L(a,e,t,n,r);if(a!==void 0&&l!==void 0){let o=typeof a=="object"&&"pattern"in a,u=typeof l=="object"&&"pattern"in l,p=he(l);if(p&&s){let g=z(i),f=s.get(g);if(f||(f={active:!1},s.set(g,f)),f.active){let b=f.startLine||e;return e>=b+l.offset&&(f.active=!1,s.set(g,f)),!0}else return L(a,e,t,n,r)?(f.active=!0,f.startLine=e,s.set(g,f),l.offset===0&&(f.active=!1,s.set(g,f)),!0):!1}if(!o&&!u&&!p){let g=typeof a=="number"?a:a==="$"?t:1,f=typeof l=="number"?l:t;if(g<=f)return e>=g&&e<=f;if(s){let b=z(i),d=s.get(b);return d||(d={active:!1},s.set(b,d)),!d.completed&&e>=g?(d.completed=!0,s.set(b,d),!0):!1}return!1}if(s){let g=z(i),f=s.get(g);if(f||(f={active:!1},s.set(g,f)),f.active)return L(l,e,t,n,r)&&(f.active=!1,typeof a=="number"&&(f.completed=!0),s.set(g,f)),!0;{if(f.completed)return!1;let b=!1;return typeof a=="number"?b=e>=a:b=L(a,e,t,n,r),b?(f.active=!0,f.startLine=e,s.set(g,f),L(l,e,t,n,r)&&(f.active=!1,typeof a=="number"&&(f.completed=!0),s.set(g,f)),!0):!1}}return L(a,e,t,n,r)}return!0}function N(i,e,t,n,s,r){let a=fe(i,e,t,n,s,r);return i?.negated?!a:a}function pe(i,e,t,n){let s="",r=0,a=!1;for(;r<=i.length;){e.lastIndex=r;let l=e.exec(i);if(!l){s+=i.slice(r);break}if(l.index!==r){s+=i.slice(r,l.index),r=l.index,a=!1;continue}let o=l[0],u=l.slice(1);if(a&&o.length===0){if(r<i.length)s+=i[r],r++;else break;a=!1;continue}if(s+=n(o,u),a=!1,o.length===0)if(r<i.length)s+=i[r],r++;else break;else r+=o.length,a=!0}return s}function V(i,e,t){let n="",s=0;for(;s<i.length;){if(i[s]==="\\"&&s+1<i.length){let r=i[s+1];if(r==="&"){n+="&",s+=2;continue}if(r==="n"){n+=`
5
+ `,s+=2;continue}if(r==="t"){n+=" ",s+=2;continue}if(r==="r"){n+="\r",s+=2;continue}let a=parseInt(r,10);if(a===0){n+=e,s+=2;continue}if(a>=1&&a<=9){n+=t[a-1]||"",s+=2;continue}n+=r,s+=2;continue}if(i[s]==="&"){n+=e,s++;continue}n+=i[s],s++}return n}function me(i,e){let{lineNumber:t,totalLines:n,patternSpace:s}=e;if(i.type==="label"){e.coverage?.hit(`sed:cmd:${i.type}`);return}if(N(i.address,t,n,s,e.rangeStates,e))switch(e.coverage?.hit(`sed:cmd:${i.type}`),i.type){case"substitute":{let r=i,a="";r.global&&(a+="g"),r.ignoreCase&&(a+="i");let l=r.pattern;l===""&&e.lastPattern?l=e.lastPattern:l!==""&&(e.lastPattern=l);let o=H(r.extendedRegex?l:U(l));try{let u=w(o,a),p=u.test(e.patternSpace);if(u.lastIndex=0,p){if(e.substitutionMade=!0,r.nthOccurrence&&r.nthOccurrence>0&&!r.global){let x=0,g=r.nthOccurrence,f=w(o,`g${r.ignoreCase?"i":""}`);e.patternSpace=f.replace(e.patternSpace,(b,...d)=>{if(x++,x===g){let h=d.slice(0,-2);return V(r.replacement,b,h)}return b})}else if(r.global){let x=w(o,`g${r.ignoreCase?"i":""}`);e.patternSpace=pe(e.patternSpace,x,r.replacement,(g,f)=>V(r.replacement,g,f))}else e.patternSpace=u.replace(e.patternSpace,(x,...g)=>{let f=g.slice(0,-2);return V(r.replacement,x,f)});r.printOnMatch&&e.lineNumberOutput.push(e.patternSpace)}}catch{}break}case"print":e.lineNumberOutput.push(e.patternSpace);break;case"printFirstLine":{let r=e.patternSpace.indexOf(`
6
+ `);r!==-1?e.lineNumberOutput.push(e.patternSpace.slice(0,r)):e.lineNumberOutput.push(e.patternSpace);break}case"delete":e.deleted=!0;break;case"deleteFirstLine":{let r=e.patternSpace.indexOf(`
7
+ `);r!==-1?(e.patternSpace=e.patternSpace.slice(r+1),e.restartCycle=!0,e.inDRestartedCycle=!0):e.deleted=!0;break}case"zap":e.patternSpace="";break;case"append":e.appendBuffer.push(i.text);break;case"insert":e.appendBuffer.unshift(`__INSERT__${i.text}`);break;case"change":e.deleted=!0,e.changedText=i.text;break;case"hold":e.holdSpace=e.patternSpace;break;case"holdAppend":e.holdSpace?e.holdSpace+=`
8
+ ${e.patternSpace}`:e.holdSpace=e.patternSpace;break;case"get":e.patternSpace=e.holdSpace;break;case"getAppend":e.patternSpace+=`
9
+ ${e.holdSpace}`;break;case"exchange":{let r=e.patternSpace;e.patternSpace=e.holdSpace,e.holdSpace=r;break}case"next":e.printed=!0;break;case"quit":e.quit=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"quitSilent":e.quit=!0,e.quitSilent=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"list":{let r=ee(e.patternSpace);e.lineNumberOutput.push(r);break}case"printFilename":e.currentFilename&&e.lineNumberOutput.push(e.currentFilename);break;case"version":{let r=[4,8,0];if(i.minVersion){let a=i.minVersion.split("."),l=[],o=!1;for(let u of a){let p=parseInt(u,10);if(Number.isNaN(p)||p<0){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: invalid version string: ${i.minVersion}`,o=!0;break}l.push(p)}if(!o){for(;l.length<3;)l.push(0);for(let u=0;u<3;u++){if(l[u]>r[u]){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: this is not GNU sed version ${i.minVersion}`;break}if(l[u]<r[u])break}}}break}case"readFile":e.pendingFileReads.push({filename:i.filename,wholeFile:!0});break;case"readFileLine":e.pendingFileReads.push({filename:i.filename,wholeFile:!1});break;case"writeFile":e.pendingFileWrites.push({filename:i.filename,content:`${e.patternSpace}
10
+ `});break;case"writeFirstLine":{let r=e.patternSpace.indexOf(`
11
+ `),a=r!==-1?e.patternSpace.slice(0,r):e.patternSpace;e.pendingFileWrites.push({filename:i.filename,content:`${a}
12
+ `});break}case"execute":i.command?e.pendingExecute={command:i.command,replacePattern:!1}:e.pendingExecute={command:e.patternSpace,replacePattern:!0};break;case"transliterate":e.patternSpace=ge(e.patternSpace,i);break;case"lineNumber":e.lineNumberOutput.push(String(e.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function ge(i,e){let t="";for(let n of i){let s=e.source.indexOf(n);s!==-1?t+=e.dest[s]:t+=n}return t}function X(i,e,t,n){let s=new Map;for(let o=0;o<i.length;o++){let u=i[o];u.type==="label"&&s.set(u.name,o)}let r=n?.maxIterations??ue,a=0,l=0;for(;l<i.length;){if(a++,a>r)throw new S(`sed: command execution exceeded maximum iterations (${r})`,"iterations");if(e.deleted||e.quit||e.quitSilent||e.restartCycle)break;let o=i[l];if(o.type==="next"){if(N(o.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:next"),e.nCommandOutput.push(e.patternSpace),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let u=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace=u,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1,e.substitutionMade=!1}else{e.quit=!0,e.deleted=!0;break}l++;continue}if(o.type==="nextAppend"){if(N(o.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:nextAppend"),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let u=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace+=`
13
+ ${u}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;break}l++;continue}if(o.type==="branch"){let u=o;if(N(u.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)){if(e.coverage?.hit("sed:cmd:branch"),u.label){let p=s.get(u.label);if(p!==void 0){l=p;continue}e.branchRequest=u.label;break}break}l++;continue}if(o.type==="branchOnSubst"){let u=o;if(N(u.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnSubst"),e.substitutionMade)){if(e.substitutionMade=!1,u.label){let p=s.get(u.label);if(p!==void 0){l=p;continue}e.branchRequest=u.label;break}break}l++;continue}if(o.type==="branchOnNoSubst"){let u=o;if(N(u.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnNoSubst"),!e.substitutionMade)){if(u.label){let p=s.get(u.label);if(p!==void 0){l=p;continue}e.branchRequest=u.label;break}break}l++;continue}if(o.type==="group"){let u=o;if(N(u.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:group"),X(u.commands,e,t,n),e.branchRequest)){let p=s.get(e.branchRequest);if(p!==void 0){e.branchRequest=void 0,l=p;continue}break}l++;continue}me(o,e),l++}return e.linesConsumedInCycle}var c;(function(i){i.NUMBER="NUMBER",i.DOLLAR="DOLLAR",i.PATTERN="PATTERN",i.STEP="STEP",i.RELATIVE_OFFSET="RELATIVE_OFFSET",i.LBRACE="LBRACE",i.RBRACE="RBRACE",i.SEMICOLON="SEMICOLON",i.NEWLINE="NEWLINE",i.COMMA="COMMA",i.NEGATION="NEGATION",i.COMMAND="COMMAND",i.SUBSTITUTE="SUBSTITUTE",i.TRANSLITERATE="TRANSLITERATE",i.LABEL_DEF="LABEL_DEF",i.BRANCH="BRANCH",i.BRANCH_ON_SUBST="BRANCH_ON_SUBST",i.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",i.TEXT_CMD="TEXT_CMD",i.FILE_READ="FILE_READ",i.FILE_READ_LINE="FILE_READ_LINE",i.FILE_WRITE="FILE_WRITE",i.FILE_WRITE_LINE="FILE_WRITE_LINE",i.EXECUTE="EXECUTE",i.VERSION="VERSION",i.EOF="EOF",i.ERROR="ERROR"})(c||(c={}));var _=class{input;pos=0;line=1;column=1;constructor(e){this.input=e}tokenize(){let e=[];for(;this.pos<this.input.length;){let t=this.nextToken();t&&e.push(t)}return e.push(this.makeToken(c.EOF,"")),e}makeToken(e,t,n){return{type:e,value:t,line:this.line,column:this.column,...n}}peek(e=0){return this.input[this.pos+e]||""}advance(){let e=this.input[this.pos++]||"";return e===`
14
+ `?(this.line++,this.column=1):this.column++,e}readEscapedString(e){let t="";for(;this.pos<this.input.length&&this.peek()!==e;)if(this.peek()==="\\"){this.advance();let n=this.advance();n==="n"?t+=`
15
+ `:n==="t"?t+=" ":t+=n}else{if(this.peek()===`
16
+ `)return null;t+=this.advance()}return t}skipWhitespace(){for(;this.pos<this.input.length;){let e=this.peek();if(e===" "||e===" "||e==="\r")this.advance();else if(e==="#")for(;this.pos<this.input.length&&this.peek()!==`
17
+ `;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let e=this.line,t=this.column,n=this.peek();return n===`
18
+ `?(this.advance(),{type:c.NEWLINE,value:`
19
+ `,line:e,column:t}):n===";"?(this.advance(),{type:c.SEMICOLON,value:";",line:e,column:t}):n==="{"?(this.advance(),{type:c.LBRACE,value:"{",line:e,column:t}):n==="}"?(this.advance(),{type:c.RBRACE,value:"}",line:e,column:t}):n===","?(this.advance(),{type:c.COMMA,value:",",line:e,column:t}):n==="!"?(this.advance(),{type:c.NEGATION,value:"!",line:e,column:t}):n==="$"?(this.advance(),{type:c.DOLLAR,value:"$",line:e,column:t}):this.isDigit(n)?this.readNumber():n==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():n==="/"?this.readPattern():n===":"?this.readLabelDef():this.readCommand()}readNumber(){let e=this.line,t=this.column,n="";for(;this.isDigit(this.peek());)n+=this.advance();if(this.peek()==="~"){this.advance();let s="";for(;this.isDigit(this.peek());)s+=this.advance();let r=parseInt(n,10),a=parseInt(s,10)||0;return{type:c.STEP,value:`${r}~${a}`,first:r,step:a,line:e,column:t}}return{type:c.NUMBER,value:parseInt(n,10),line:e,column:t}}readRelativeOffset(){let e=this.line,t=this.column;this.advance();let n="";for(;this.isDigit(this.peek());)n+=this.advance();let s=parseInt(n,10)||0;return{type:c.RELATIVE_OFFSET,value:`+${s}`,offset:s,line:e,column:t}}readPattern(){let e=this.line,t=this.column;this.advance();let n="",s=!1;for(;this.pos<this.input.length;){let r=this.peek();if(r==="/"&&!s)break;if(r==="\\")n+=this.advance(),this.pos<this.input.length&&this.peek()!==`
20
+ `&&(n+=this.advance());else{if(r===`
21
+ `)break;r==="["&&!s?(s=!0,n+=this.advance(),this.peek()==="^"&&(n+=this.advance()),this.peek()==="]"&&(n+=this.advance())):r==="]"&&s?(s=!1,n+=this.advance()):n+=this.advance()}}return this.peek()==="/"&&this.advance(),{type:c.PATTERN,value:n,pattern:n,line:e,column:t}}readLabelDef(){let e=this.line,t=this.column;for(this.advance();this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
22
+ `||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:c.LABEL_DEF,value:n,label:n,line:e,column:t}}readCommand(){let e=this.line,t=this.column,n=this.advance();switch(n){case"s":return this.readSubstitute(e,t);case"y":return this.readTransliterate(e,t);case"a":case"i":case"c":return this.readTextCommand(n,e,t);case"b":return this.readBranch(c.BRANCH,"b",e,t);case"t":return this.readBranch(c.BRANCH_ON_SUBST,"t",e,t);case"T":return this.readBranch(c.BRANCH_ON_NO_SUBST,"T",e,t);case"r":return this.readFileCommand(c.FILE_READ,"r",e,t);case"R":return this.readFileCommand(c.FILE_READ_LINE,"R",e,t);case"w":return this.readFileCommand(c.FILE_WRITE,"w",e,t);case"W":return this.readFileCommand(c.FILE_WRITE_LINE,"W",e,t);case"e":return this.readExecute(e,t);case"p":case"P":case"d":case"D":case"h":case"H":case"g":case"G":case"x":case"n":case"N":case"q":case"Q":case"z":case"=":case"l":case"F":return{type:c.COMMAND,value:n,line:e,column:t};case"v":return this.readVersion(e,t);default:return{type:c.ERROR,value:n,line:e,column:t}}}readSubstitute(e,t){let n=this.advance();if(!n||n===`
23
+ `)return{type:c.ERROR,value:"s",line:e,column:t};let s="",r=!1;for(;this.pos<this.input.length;){let o=this.peek();if(o===n&&!r)break;if(o==="\\")this.advance(),this.pos<this.input.length&&this.peek()!==`
24
+ `?this.peek()===n&&!r?s+=this.advance():(s+="\\",s+=this.advance()):s+="\\";else{if(o===`
25
+ `)break;o==="["&&!r?(r=!0,s+=this.advance(),this.peek()==="^"&&(s+=this.advance()),this.peek()==="]"&&(s+=this.advance())):o==="]"&&r?(r=!1,s+=this.advance()):s+=this.advance()}}if(this.peek()!==n)return{type:c.ERROR,value:"unterminated substitution pattern",line:e,column:t};this.advance();let a="";for(;this.pos<this.input.length&&this.peek()!==n;)if(this.peek()==="\\")if(this.advance(),this.pos<this.input.length){let o=this.peek();o==="\\"?(this.advance(),this.pos<this.input.length&&this.peek()===`
26
+ `?(a+=`
27
+ `,this.advance()):a+="\\"):o===`
28
+ `?(a+=`
29
+ `,this.advance()):a+=`\\${this.advance()}`}else a+="\\";else{if(this.peek()===`
30
+ `)break;a+=this.advance()}this.peek()===n&&this.advance();let l="";for(;this.pos<this.input.length;){let o=this.peek();if(o==="g"||o==="i"||o==="p"||o==="I"||this.isDigit(o))l+=this.advance();else break}return{type:c.SUBSTITUTE,value:`s${n}${s}${n}${a}${n}${l}`,pattern:s,replacement:a,flags:l,line:e,column:t}}readTransliterate(e,t){let n=this.advance();if(!n||n===`
31
+ `)return{type:c.ERROR,value:"y",line:e,column:t};let s=this.readEscapedString(n);if(s===null||this.peek()!==n)return{type:c.ERROR,value:"unterminated transliteration source",line:e,column:t};this.advance();let r=this.readEscapedString(n);if(r===null||this.peek()!==n)return{type:c.ERROR,value:"unterminated transliteration dest",line:e,column:t};this.advance();let a=this.peek();for(;a===" "||a===" ";)this.advance(),a=this.peek();return a!==""&&a!==";"&&a!==`
32
+ `&&a!=="}"?{type:c.ERROR,value:"extra text at the end of a transform command",line:e,column:t}:{type:c.TRANSLITERATE,value:`y${n}${s}${n}${r}${n}`,source:s,dest:r,line:e,column:t}}readTextCommand(e,t,n){let s=!1;this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===`
33
+ `||this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&(s=!0,this.advance()),(this.peek()===" "||this.peek()===" ")&&this.advance(),this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&this.advance(),s&&this.peek()===`
34
+ `&&this.advance();let r="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
35
+ `){if(r.endsWith("\\")){r=`${r.slice(0,-1)}
36
+ `,this.advance();continue}break}if(a==="\\"&&this.pos+1<this.input.length){let l=this.input[this.pos+1];if(l==="n"){r+=`
37
+ `,this.advance(),this.advance();continue}if(l==="t"){r+=" ",this.advance(),this.advance();continue}if(l==="r"){r+="\r",this.advance(),this.advance();continue}}r+=this.advance()}return{type:c.TEXT_CMD,value:e,text:r,line:t,column:n}}readBranch(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let a=this.peek();if(a===" "||a===" "||a===`
38
+ `||a===";"||a==="}"||a==="{")break;r+=this.advance()}return{type:e,value:t,label:r||void 0,line:n,column:s}}readVersion(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
39
+ `||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:c.VERSION,value:"v",label:n||void 0,line:e,column:t}}readFileCommand(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let r="";for(;this.pos<this.input.length;){let a=this.peek();if(a===`
40
+ `||a===";")break;r+=this.advance()}return{type:e,value:t,filename:r.trim(),line:n,column:s}}readExecute(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
41
+ `||s===";")break;n+=this.advance()}return{type:c.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var G=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new _(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(c.NEWLINE)||this.check(c.SEMICOLON)){this.advance();continue}let s=this.parseCommand();if(s.error)return{commands:[],error:s.error};s.command&&e.push(s.command)}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(c.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(c.NEWLINE)||this.check(c.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case c.COMMAND:return this.parseSimpleCommand(n,t);case c.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case c.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case c.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case c.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case c.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case c.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case c.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case c.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case c.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case c.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case c.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case c.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case c.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case c.LBRACE:return this.parseGroup(t);case c.RBRACE:return{command:null};case c.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,r=n.match(/(\d+)/);return r&&(s=parseInt(r[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(c.RBRACE);){if(this.check(c.NEWLINE)||this.check(c.SEMICOLON)){this.advance();continue}let n=this.parseCommand();if(n.error)return{command:null,error:n.error};n.command&&t.push(n.command)}return this.check(c.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(c.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(c.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case c.NUMBER:return this.advance(),e.value;case c.DOLLAR:return this.advance(),"$";case c.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case c.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case c.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:c.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===c.EOF}};function ne(i,e=!1){let t=!1,n=!1,s=[];for(let o=0;o<i.length;o++){let u=i[o];if(s.length===0&&o===0){let p=u.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let x=p[1].toLowerCase();x.includes("n")&&(t=!0),x.includes("r")&&(n=!0),u=u.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
42
+ ${u}`}else s.push(u)}let r=s.join(`
43
+ `),l=new G([r],e||n).parse();if(!l.error&&l.commands.length>0){let o=be(l.commands);if(o)return{commands:[],error:o,silentMode:t,extendedRegexMode:n}}return{...l,silentMode:t,extendedRegexMode:n}}function be(i){let e=new Set;ie(i,e);let t=se(i,e);if(t)return`undefined label '${t}'`}function ie(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&ie(t.commands,e)}function se(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=se(t.commands,e);if(n)return n}}}var Ee={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
44
+ s/regexp/replacement/[flags] substitute
45
+ d delete pattern space
46
+ p print pattern space
47
+ a\\ text append text after line
48
+ i\\ text insert text before line
49
+ c\\ text change (replace) line with text
50
+ h copy pattern space to hold space
51
+ H append pattern space to hold space
52
+ g copy hold space to pattern space
53
+ G append hold space to pattern space
54
+ x exchange pattern and hold spaces
55
+ n read next line into pattern space
56
+ N append next line to pattern space
57
+ y/source/dest/ transliterate characters
58
+ = print line number
59
+ l list pattern space (escape special chars)
60
+ b [label] branch to label
61
+ t [label] branch on substitution
62
+ T [label] branch if no substitution
63
+ :label define label
64
+ q quit
65
+ Q quit without printing
66
+
67
+ Addresses:
68
+ N line number
69
+ $ last line
70
+ /regexp/ lines matching regexp
71
+ N,M range from line N to M
72
+ first~step every step-th line starting at first`};async function j(i,e,t,n={}){let{limits:s,filename:r,fs:a,cwd:l,coverage:o}=n,u=i.endsWith(`
73
+ `),p=i.split(`
74
+ `);p.length>0&&p[p.length-1]===""&&p.pop();let x=p.length,g="",f,b=!1,d=s?.maxStringLength??0,h=y=>{if(g+=y,d>0&&g.length>d)throw new S(`sed: output size limit exceeded (${d} bytes)`,"string_length")},E="",k,A=new Map,M=new Map,T=new Map,B=new Map,re=s?{maxIterations:s.maxSedIterations}:void 0;for(let y=0;y<p.length;y++){let m={...te(x,r,A),patternSpace:p[y],holdSpace:E,lastPattern:k,lineNumber:y+1,totalLines:x,substitutionMade:!1,coverage:o},ae={lines:p,currentLineIndex:y},Z=0,ce=1e4;m.linesConsumedInCycle=0;do{if(Z++,Z>ce)break;if(m.restartCycle=!1,m.pendingFileReads=[],m.pendingFileWrites=[],X(e,m,ae,re),a&&l){for(let v of m.pendingFileReads){let I=a.resolvePath(l,v.filename);try{if(v.wholeFile){let O=await a.readFile(I);m.appendBuffer.push(O.replace(/\n$/,""))}else{if(!M.has(I)){let oe=await a.readFile(I);M.set(I,oe.split(`
75
+ `)),T.set(I,0)}let O=M.get(I),$=T.get(I);O&&$!==void 0&&$<O.length&&(m.appendBuffer.push(O[$]),T.set(I,$+1))}}catch{}}for(let v of m.pendingFileWrites){let I=a.resolvePath(l,v.filename),O=B.get(I)||"";B.set(I,O+v.content)}}}while(m.restartCycle&&!m.deleted&&!m.quit&&!m.quitSilent);if(y+=m.linesConsumedInCycle,E=m.holdSpace,k=m.lastPattern,!t)for(let v of m.nCommandOutput)h(`${v}
76
+ `);let le=m.lineNumberOutput.length>0;for(let v of m.lineNumberOutput)h(`${v}
77
+ `);let K=[],P=[];for(let v of m.appendBuffer)v.startsWith("__INSERT__")?K.push(v.slice(10)):P.push(v);for(let v of K)h(`${v}
78
+ `);let F=!1;!m.deleted&&!m.quitSilent?t?m.printed&&(h(`${m.patternSpace}
79
+ `),F=!0):(h(`${m.patternSpace}
80
+ `),F=!0):m.changedText!==void 0&&(h(`${m.changedText}
81
+ `),F=!0);for(let v of P)h(`${v}
82
+ `);if(b=(le||F)&&P.length===0,m.quit||m.quitSilent){if(m.exitCode!==void 0&&(f=m.exitCode),m.errorMessage)return{output:"",exitCode:f||1,errorMessage:m.errorMessage};break}}if(a&&l)for(let[y,m]of B)try{await a.writeFile(y,m)}catch{}return!u&&b&&g.endsWith(`
83
+ `)&&(g=g.slice(0,-1)),{output:g,exitCode:f}}var $e={name:"sed",async execute(i,e){let t=Q(i);if(Y(t))return J(Ee);let n=[],s=[],r=!1,a=!1,l=!1,o=[];for(let d=0;d<t.length;d++){let h=t[d];if(h==="-n"||h==="--quiet"||h==="--silent")r=!0;else if(h==="-i"||h==="--in-place")a=!0;else if(h.startsWith("-i"))a=!0;else if(h==="-E"||h==="-r"||h==="--regexp-extended")l=!0;else if(h==="-e")d+1<t.length&&n.push(t[++d]);else if(h==="-f")d+1<t.length&&s.push(t[++d]);else{if(h.startsWith("--"))return W("sed",h);if(h==="-")o.push(h);else if(h.startsWith("-")&&h.length>1){for(let E of h.slice(1))if(E!=="n"&&E!=="e"&&E!=="f"&&E!=="i"&&E!=="E"&&E!=="r")return W("sed",`-${E}`);h.includes("n")&&(r=!0),h.includes("i")&&(a=!0),(h.includes("E")||h.includes("r"))&&(l=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&d+1<t.length&&n.push(t[++d]),h.includes("f")&&!h.includes("e")&&d+1<t.length&&s.push(t[++d])}else!h.startsWith("-")&&n.length===0&&s.length===0?n.push(h):h.startsWith("-")||o.push(h)}}for(let d of s){let h=e.fs.resolvePath(e.cwd,d);try{let E=await e.fs.readFile(h);for(let k of E.split(`
84
+ `)){let A=k.trim();A&&!A.startsWith("#")&&n.push(A)}}catch{return{stdout:R,stderr:C(`sed: couldn't open file ${d}: No such file or directory
85
+ `),exitCode:1}}}if(n.length===0)return{stdout:R,stderr:C(`sed: no script specified
86
+ `),exitCode:1};let{commands:u,error:p,silentMode:x}=ne(n,l);if(p)return{stdout:R,stderr:C(`sed: ${p}
87
+ `),exitCode:1};let g=!!(r||x);if(a){if(o.length===0)return{stdout:R,stderr:C(`sed: -i requires at least one file argument
88
+ `),exitCode:1};for(let d of o){if(d==="-")continue;let h=e.fs.resolvePath(e.cwd,d);try{let E=await e.fs.readFile(h),k=await j(E,u,g,{limits:e.limits,filename:d,fs:e.fs,cwd:e.cwd,coverage:e.coverage});if(k.errorMessage)return{stdout:R,stderr:C(`${k.errorMessage}
89
+ `),exitCode:k.exitCode??1};await e.fs.writeFile(h,k.output)}catch(E){return E instanceof S?{stdout:R,stderr:C(`sed: ${E.message}
90
+ `),exitCode:S.EXIT_CODE}:{stdout:R,stderr:C(`sed: ${d}: No such file or directory
91
+ `),exitCode:1}}}return{stdout:R,stderr:R,exitCode:0}}let f="";if(o.length===0){f=D(e.stdin);try{let d=await j(f,u,g,{limits:e.limits,fs:e.fs,cwd:e.cwd,coverage:e.coverage});return{stdout:C(d.output),stderr:C(d.errorMessage?`${d.errorMessage}
92
+ `:""),exitCode:d.exitCode??0}}catch(d){if(d instanceof S)return{stdout:R,stderr:C(`sed: ${d.message}
93
+ `),exitCode:S.EXIT_CODE};throw d}}let b=!1;for(let d of o){let h;if(d==="-")b?h="":(h=D(e.stdin),b=!0);else{let E=e.fs.resolvePath(e.cwd,d);try{h=await e.fs.readFile(E)}catch(k){return k instanceof S?{stdout:R,stderr:C(`sed: ${k.message}
94
+ `),exitCode:S.EXIT_CODE}:{stdout:R,stderr:C(`sed: ${d}: No such file or directory
95
+ `),exitCode:1}}}f.length>0&&h.length>0&&!f.endsWith(`
96
+ `)&&(f+=`
97
+ `),f+=h}try{let d=await j(f,u,g,{limits:e.limits,filename:o.length===1?o[0]:void 0,fs:e.fs,cwd:e.cwd,coverage:e.coverage});return{stdout:C(d.output),stderr:C(d.errorMessage?`${d.errorMessage}
98
+ `:""),exitCode:d.exitCode??0}}catch(d){if(d instanceof S)return{stdout:R,stderr:C(`sed: ${d.message}
99
+ `),exitCode:S.EXIT_CODE};throw d}}},_e={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{$e as a,_e as b};
@@ -0,0 +1,8 @@
1
+ import{a as S}from"./chunk-OXRHP7HO.js";import{a as h,b as y}from"./chunk-KZ3P3SVS.js";import{g as d,h as l,l as m}from"./chunk-O7N2RCS7.js";var A={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"]},O={format:{short:"c",type:"string"}},C={name:"stat",async execute(e,a){let i=m(e);if(y(i))return h(A);let s=S("stat",i,O);if(!s.ok)return s.error;let p=s.result.flags.format??null,f=s.result.positional;if(f.length===0)return{stdout:d,stderr:l(`stat: missing operand
2
+ `),exitCode:1};let o="",g="",u=!1;for(let n of f){let F=a.fs.resolvePath(a.cwd,n);try{let r=await a.fs.stat(F);if(p){let t=p,c=r.mode.toString(8),x=$(r.mode,r.isDirectory);t=t.replace(/%n/g,n),t=t.replace(/%N/g,`'${n}'`),t=t.replace(/%s/g,String(r.size)),t=t.replace(/%F/g,r.isDirectory?"directory":"regular file"),t=t.replace(/%a/g,c),t=t.replace(/%A/g,x),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}
3
+ `}else{let t=r.mode.toString(8).padStart(4,"0"),c=$(r.mode,r.isDirectory);o+=` File: ${n}
4
+ `,o+=` Size: ${r.size} Blocks: ${Math.ceil(r.size/512)}
5
+ `,o+=`Access: (${t}/${c})
6
+ `,o+=`Modify: ${r.mtime.toISOString()}
7
+ `}}catch{g+=`stat: cannot stat '${n}': No such file or directory
8
+ `,u=!0}}return{stdout:l(o),stderr:l(g),exitCode:u?1:0}}};function $(e,a){let i=a?"d":"-",s=[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 i+s.join("")}var D={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{C as a,D as b};
@@ -0,0 +1,10 @@
1
+ import{a as C,b as k,c as L}from"./chunk-KZ3P3SVS.js";import{g as f,h as p,i as m,l as v}from"./chunk-O7N2RCS7.js";var F={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 h(r){let a=r.split(",").map(n=>n.trim()),e=[];for(let n of a){let i=parseInt(n,10);if(Number.isNaN(i)||i<1)return null;e.push(i)}for(let n=1;n<e.length;n++)if(e[n]<=e[n-1])return null;return e}function N(r,a){if(a.length===1){let e=a[0];return r+(e-r%e)}for(let e of a)if(e>r)return e;if(a.length>=2){let e=a[a.length-1]-a[a.length-2],n=a[a.length-1],i=Math.floor((r-n)/e)+1;return n+i*e}return-1}function I(r,a){let{tabStops:e,allBlanks:n}=a,i="",s=0,l="",t=0,o=!0,d=()=>{if(l.length===0)return;let u=t+l.length;if(!n&&!o){i+=l,l="";return}let c=t,g="";for(;c<u;){let x=N(c,e);if(x<=u&&x>c)g+=" ",c=x;else break}let b=u-c;b>0&&(g+=" ".repeat(b)),i+=g,l=""};for(let u of r)u===" "?(l.length===0&&(t=s),l+=u,s++):u===" "?(d(),i+=u,s=N(s,e)):(d(),i+=u,s++,o=!1);return d(),i}function w(r,a){if(r==="")return"";let e=r.split(`
2
+ `),n=r.endsWith(`
3
+ `)&&e[e.length-1]==="";return n&&e.pop(),e.map(s=>I(s,a)).join(`
4
+ `)+(n?`
5
+ `:"")}var z={name:"unexpand",execute:async(r,a)=>{let e=v(r);if(k(e))return C(F);let n={tabStops:[8],allBlanks:!1},i=[],s=0;for(;s<e.length;){let t=e[s];if(t==="-t"&&s+1<e.length){let o=h(e[s+1]);if(!o)return{exitCode:1,stdout:f,stderr:p(`unexpand: invalid tab size: '${e[s+1]}'
6
+ `)};n.tabStops=o,s+=2}else if(t.startsWith("-t")&&t.length>2){let o=h(t.slice(2));if(!o)return{exitCode:1,stdout:f,stderr:p(`unexpand: invalid tab size: '${t.slice(2)}'
7
+ `)};n.tabStops=o,s++}else if(t==="--tabs"&&s+1<e.length){let o=h(e[s+1]);if(!o)return{exitCode:1,stdout:f,stderr:p(`unexpand: invalid tab size: '${e[s+1]}'
8
+ `)};n.tabStops=o,s+=2}else if(t.startsWith("--tabs=")){let o=h(t.slice(7));if(!o)return{exitCode:1,stdout:f,stderr:p(`unexpand: invalid tab size: '${t.slice(7)}'
9
+ `)};n.tabStops=o,s++}else if(t==="-a"||t==="--all")n.allBlanks=!0,s++;else if(t==="--"){i.push(...e.slice(s+1));break}else{if(t.startsWith("-")&&t!=="-")return L("unexpand",t);i.push(t),s++}}let l="";if(i.length===0){let t=m(a.stdin);l=w(t,n)}else for(let t of i){let o=a.fs.resolvePath(a.cwd,t),d=await a.fs.readFile(o);if(d===null)return{exitCode:1,stdout:p(l),stderr:p(`unexpand: ${t}: No such file or directory
10
+ `)};l+=w(d,n)}return{exitCode:0,stdout:p(l),stderr:f}}},B={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0};export{z as a,B as b};
@@ -0,0 +1,13 @@
1
+ import{a as F,b as I,c as L}from"./chunk-KZ3P3SVS.js";import{g as u,h as p,i as v,l as N}from"./chunk-O7N2RCS7.js";var w={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};function U(a,l){return l?a.split(l):a.split(/[ \t]+/).filter(i=>i.length>0)}function C(a,l,i,n){let r=U(a,l),e=r[i-1]??"";return n&&(e=e.toLowerCase()),{fields:r,joinKey:e,original:a}}function j(a,l,i){let n=i.separator??" ";if(i.outputFormat){let o=[];for(let{file:m,field:c}of i.outputFormat){let d=m===1?a:l;d&&c===0?o.push(d.joinKey):d&&d.fields[c-1]!==void 0?o.push(d.fields[c-1]):o.push(i.emptyString)}return o.join(n)}let r=[],e=a?.joinKey??l?.joinKey??"";if(r.push(e),a)for(let o=0;o<a.fields.length;o++)o!==i.field1-1&&r.push(a.fields[o]);if(l)for(let o=0;o<l.fields.length;o++)o!==i.field2-1&&r.push(l.fields[o]);return r.join(n)}function x(a){let l=a.split(","),i=[];for(let n of l){let r=n.trim().match(/^(\d+)\.(\d+)$/);if(!r)return null;let e=Number.parseInt(r[1],10),o=Number.parseInt(r[2],10);if(e!==1&&e!==2)return null;i.push({file:e,field:o})}return i}var K={name:"join",execute:async(a,l)=>{let i=N(a);if(I(i))return F(w);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},r=[],e=0;for(;e<i.length;){let t=i[e];if(t==="-1"&&e+1<i.length){let s=Number.parseInt(i[e+1],10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:u,stderr:p(`join: invalid field number: '${i[e+1]}'
2
+ `)};n.field1=s,e+=2}else if(t==="-2"&&e+1<i.length){let s=Number.parseInt(i[e+1],10);if(Number.isNaN(s)||s<1)return{exitCode:1,stdout:u,stderr:p(`join: invalid field number: '${i[e+1]}'
3
+ `)};n.field2=s,e+=2}else if((t==="-t"||t==="--field-separator")&&e+1<i.length)n.separator=i[e+1],e+=2;else if(t.startsWith("-t")&&t.length>2)n.separator=t.slice(2),e++;else if(t==="-a"&&e+1<i.length){let s=Number.parseInt(i[e+1],10);if(s!==1&&s!==2)return{exitCode:1,stdout:u,stderr:p(`join: invalid file number: '${i[e+1]}'
4
+ `)};n.printUnpairable.add(s),e+=2}else if(t.match(/^-a[12]$/))n.printUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-v"&&e+1<i.length){let s=Number.parseInt(i[e+1],10);if(s!==1&&s!==2)return{exitCode:1,stdout:u,stderr:p(`join: invalid file number: '${i[e+1]}'
5
+ `)};n.onlyUnpairable.add(s),e+=2}else if(t.match(/^-v[12]$/))n.onlyUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-e"&&e+1<i.length)n.emptyString=i[e+1],e+=2;else if(t==="-o"&&e+1<i.length){let s=x(i[e+1]);if(!s)return{exitCode:1,stdout:u,stderr:p(`join: invalid field spec: '${i[e+1]}'
6
+ `)};n.outputFormat=s,e+=2}else if(t==="-i"||t==="--ignore-case")n.ignoreCase=!0,e++;else if(t==="--"){r.push(...i.slice(e+1));break}else{if(t.startsWith("-")&&t!=="-")return L("join",t);r.push(t),e++}}if(r.length!==2)return{exitCode:1,stdout:u,stderr:p(r.length<2?`join: missing file operand
7
+ `:`join: extra operand
8
+ `)};let o=[];for(let t of r)if(t==="-")o.push(v(l.stdin));else{let s=l.fs.resolvePath(l.cwd,t),f=await l.fs.readFile(s);if(f===null)return{exitCode:1,stdout:u,stderr:p(`join: ${t}: No such file or directory
9
+ `)};o.push(f)}let m=(t,s)=>{let f=t.split(`
10
+ `);return t.endsWith(`
11
+ `)&&f[f.length-1]===""&&f.pop(),f.filter(b=>b.length>0).map(b=>C(b,n.separator,s,n.ignoreCase))},c=m(o[0],n.field1),d=m(o[1],n.field2),g=new Map;for(let t of d){let s=g.get(t.joinKey);s?s.push(t):g.set(t.joinKey,[t])}let h=[],y=new Set;for(let t of c){let s=g.get(t.joinKey);if(s&&s.length>0){if(y.add(t.joinKey),n.onlyUnpairable.size===0)for(let f of s)h.push(j(t,f,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&h.push(j(t,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let t of d)y.has(t.joinKey)||h.push(j(null,t,n));return{exitCode:0,stdout:p(h.length>0?`${h.join(`
12
+ `)}
13
+ `:""),stderr:u}}},$={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{K as a,$ as b};
@@ -0,0 +1,7 @@
1
+ import{g as n,h as c,j as i}from"./chunk-O7N2RCS7.js";var r=class extends Error{stdout;stderr;constructor(t,s=n,e=n){super(t),this.stdout=s,this.stderr=e}prependOutput(t,s){this.stdout=i(t,this.stdout),this.stderr=i(s,this.stderr)}},u=class extends r{levels;name="BreakError";constructor(t=1,s=n,e=n){super("break",s,e),this.levels=t}},x=class extends r{levels;name="ContinueError";constructor(t=1,s=n,e=n){super("continue",s,e),this.levels=t}},h=class extends r{exitCode;name="ReturnError";constructor(t=0,s=n,e=n){super("return",s,e),this.exitCode=t}},l=class extends r{exitCode;name="ErrexitError";constructor(t,s=n,e=n){super(`errexit: command exited with status ${t}`,s,e),this.exitCode=t}},p=class extends r{varName;name="NounsetError";constructor(t,s=n){super(`${t}: unbound variable`,s,c(`bash: ${t}: unbound variable
2
+ `)),this.varName=t}},d=class extends r{exitCode;name="ExitError";constructor(t,s=n,e=n){super("exit",s,e),this.exitCode=t}},m=class extends r{name="ArithmeticError";fatal;constructor(t,s=n,e=n,a=!1){super(t,s,e),this.stderr=e.length>0?e:c(`bash: ${t}
3
+ `),this.fatal=a}},b=class extends r{name="BadSubstitutionError";constructor(t,s=n,e=n){super(t,s,e),this.stderr=e.length>0?e:c(`bash: ${t}: bad substitution
4
+ `)}},f=class extends r{name="GlobError";constructor(t,s=n,e=n){super(`no match: ${t}`,s,e),this.stderr=e.length>0?e:c(`bash: no match: ${t}
5
+ `)}},$=class extends r{name="BraceExpansionError";constructor(t,s=n,e=n){super(t,s,e),this.stderr=e.length>0?e:c(`bash: ${t}
6
+ `)}},C=class extends r{limitType;name="ExecutionLimitError";static EXIT_CODE=126;constructor(t,s,e=n,a=n){super(t,e,a),this.limitType=s,this.stderr=a.length>0?a:c(`bash: ${t}
7
+ `)}},v=class extends r{name="SubshellExitError";constructor(t=n,s=n){super("subshell exit",t,s)}};function y(o){return o instanceof u||o instanceof x||o instanceof h}var E=class extends r{exitCode;name="PosixFatalError";constructor(t,s=n,e=n){super("posix fatal error",s,e),this.exitCode=t}};export{u as a,x as b,h as c,l as d,p as e,d as f,m as g,b as h,f as i,$ as j,C as k,v as l,y as m,E as n};