just-bash-nx 2.14.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (894) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +201 -0
  3. package/README.md +573 -0
  4. package/dist/AGENTS.md +325 -0
  5. package/dist/Bash.d.ts +229 -0
  6. package/dist/ast/types.d.ts +609 -0
  7. package/dist/banned-patterns-test.d.ts +1 -0
  8. package/dist/bin/chunks/alias-3GODYSFD.js +2 -0
  9. package/dist/bin/chunks/awk2-RSUCURL4.js +2 -0
  10. package/dist/bin/chunks/base64-43M2R3GA.js +2 -0
  11. package/dist/bin/chunks/basename-KBUKWB2E.js +2 -0
  12. package/dist/bin/chunks/bash-6ZHZ6BX7.js +2 -0
  13. package/dist/bin/chunks/cat-XZIJZXKP.js +2 -0
  14. package/dist/bin/chunks/chmod-N5CQATDW.js +2 -0
  15. package/dist/bin/chunks/chunk-22NDZXS5.js +33 -0
  16. package/dist/bin/chunks/chunk-26NO42TF.js +14 -0
  17. package/dist/bin/chunks/chunk-2W2SCVT6.js +140 -0
  18. package/dist/bin/chunks/chunk-3MBAUIBB.js +7 -0
  19. package/dist/bin/chunks/chunk-3Y32LPNT.js +2 -0
  20. package/dist/bin/chunks/chunk-4CFAYBLV.js +21 -0
  21. package/dist/bin/chunks/chunk-4OALHZXB.js +2 -0
  22. package/dist/bin/chunks/chunk-4PRVMER6.js +2 -0
  23. package/dist/bin/chunks/chunk-4VDEBYW7.js +2 -0
  24. package/dist/bin/chunks/chunk-54G6AE72.js +32 -0
  25. package/dist/bin/chunks/chunk-5G2VOPPJ.js +7 -0
  26. package/dist/bin/chunks/chunk-5WFYIUU2.js +3 -0
  27. package/dist/bin/chunks/chunk-6KZRLMG3.js +8 -0
  28. package/dist/bin/chunks/chunk-7ADG3DNO.js +8 -0
  29. package/dist/bin/chunks/chunk-7BORMNPQ.js +2 -0
  30. package/dist/bin/chunks/chunk-7G3MC56B.js +7 -0
  31. package/dist/bin/chunks/chunk-AAW7UMPO.js +9 -0
  32. package/dist/bin/chunks/chunk-AXWFPG37.js +10 -0
  33. package/dist/bin/chunks/chunk-AZ3RUDR2.js +9 -0
  34. package/dist/bin/chunks/chunk-BGGF3ELU.js +5 -0
  35. package/dist/bin/chunks/chunk-BYDV4VEF.js +3 -0
  36. package/dist/bin/chunks/chunk-CGE2EHYP.js +5 -0
  37. package/dist/bin/chunks/chunk-CM4532DS.js +36 -0
  38. package/dist/bin/chunks/chunk-CQG2HEAL.js +5 -0
  39. package/dist/bin/chunks/chunk-D5WP4CKS.js +3 -0
  40. package/dist/bin/chunks/chunk-DOXYBGNA.js +12 -0
  41. package/dist/bin/chunks/chunk-E5BDLLK6.js +15 -0
  42. package/dist/bin/chunks/chunk-EJQKHROT.js +14 -0
  43. package/dist/bin/chunks/chunk-EONWONZV.js +2 -0
  44. package/dist/bin/chunks/chunk-EPPBDXOG.js +8 -0
  45. package/dist/bin/chunks/chunk-EUXCM6C4.js +12 -0
  46. package/dist/bin/chunks/chunk-EWDHVLQL.js +21 -0
  47. package/dist/bin/chunks/chunk-F3LGZXLQ.js +9 -0
  48. package/dist/bin/chunks/chunk-FA2CHD73.js +16 -0
  49. package/dist/bin/chunks/chunk-FIHFXGT6.js +287 -0
  50. package/dist/bin/chunks/chunk-FLPVVSN5.js +5 -0
  51. package/dist/bin/chunks/chunk-FSZWFMB4.js +16 -0
  52. package/dist/bin/chunks/chunk-GO6FXSC4.js +6 -0
  53. package/dist/bin/chunks/chunk-GOJZHH3L.js +6 -0
  54. package/dist/bin/chunks/chunk-GTNBSMZR.js +23 -0
  55. package/dist/bin/chunks/chunk-IDGH4PGU.js +3 -0
  56. package/dist/bin/chunks/chunk-IO2FYBEM.js +6 -0
  57. package/dist/bin/chunks/chunk-ITA43A73.js +7 -0
  58. package/dist/bin/chunks/chunk-JBABAK44.js +4 -0
  59. package/dist/bin/chunks/chunk-JDNI5HBX.js +33 -0
  60. package/dist/bin/chunks/chunk-JLX6YWGA.js +3 -0
  61. package/dist/bin/chunks/chunk-JQBC3FXE.js +8 -0
  62. package/dist/bin/chunks/chunk-JTF74J6E.js +2 -0
  63. package/dist/bin/chunks/chunk-KCMUAACL.js +19 -0
  64. package/dist/bin/chunks/chunk-KGOUQS5A.js +2 -0
  65. package/dist/bin/chunks/chunk-L6XUBS6H.js +84 -0
  66. package/dist/bin/chunks/chunk-LCDPWJBA.js +15 -0
  67. package/dist/bin/chunks/chunk-LGJM5YFT.js +17 -0
  68. package/dist/bin/chunks/chunk-LIYVQA3X.js +2 -0
  69. package/dist/bin/chunks/chunk-LJKIWB5F.js +4 -0
  70. package/dist/bin/chunks/chunk-LMK6G2HH.js +8 -0
  71. package/dist/bin/chunks/chunk-LOJMXC4F.js +5 -0
  72. package/dist/bin/chunks/chunk-MAVV76T4.js +2 -0
  73. package/dist/bin/chunks/chunk-MO4RPBN2.js +2 -0
  74. package/dist/bin/chunks/chunk-MRP4ZCD7.js +6 -0
  75. package/dist/bin/chunks/chunk-N43DJTSI.js +2 -0
  76. package/dist/bin/chunks/chunk-NAX7MTAR.js +21 -0
  77. package/dist/bin/chunks/chunk-NSUMEERA.js +12 -0
  78. package/dist/bin/chunks/chunk-NTW6IA45.js +2 -0
  79. package/dist/bin/chunks/chunk-OBH7XN5N.js +1 -0
  80. package/dist/bin/chunks/chunk-OBI37ZY4.js +9 -0
  81. package/dist/bin/chunks/chunk-OOJCYVYF.js +2 -0
  82. package/dist/bin/chunks/chunk-ORUYSLP4.js +16 -0
  83. package/dist/bin/chunks/chunk-OXHVTSNH.js +74 -0
  84. package/dist/bin/chunks/chunk-PNI5NMXP.js +100 -0
  85. package/dist/bin/chunks/chunk-PPBQJBC2.js +5 -0
  86. package/dist/bin/chunks/chunk-PQNTKMH3.js +6 -0
  87. package/dist/bin/chunks/chunk-PS4LOXE5.js +8 -0
  88. package/dist/bin/chunks/chunk-PXVBSPBE.js +2 -0
  89. package/dist/bin/chunks/chunk-RA3TG4UK.js +9 -0
  90. package/dist/bin/chunks/chunk-RBQGQWGV.js +10 -0
  91. package/dist/bin/chunks/chunk-RJSAGJQJ.js +11 -0
  92. package/dist/bin/chunks/chunk-RLNOQILG.js +2 -0
  93. package/dist/bin/chunks/chunk-ROJPSS6N.js +3 -0
  94. package/dist/bin/chunks/chunk-RT7TRQVZ.js +3 -0
  95. package/dist/bin/chunks/chunk-S3QAKT3R.js +11 -0
  96. package/dist/bin/chunks/chunk-S7OHMN3F.js +6 -0
  97. package/dist/bin/chunks/chunk-SGA7Y45Z.js +17 -0
  98. package/dist/bin/chunks/chunk-SXRVLCZ4.js +2 -0
  99. package/dist/bin/chunks/chunk-TEFXEYX3.js +3 -0
  100. package/dist/bin/chunks/chunk-THALLNXT.js +7 -0
  101. package/dist/bin/chunks/chunk-TTNNO45C.js +17 -0
  102. package/dist/bin/chunks/chunk-UFJFAFSS.js +28 -0
  103. package/dist/bin/chunks/chunk-V7ZOPVQS.js +2 -0
  104. package/dist/bin/chunks/chunk-VNER2XXL.js +7 -0
  105. package/dist/bin/chunks/chunk-WLBA7L7U.js +23 -0
  106. package/dist/bin/chunks/chunk-WWZVR5NN.js +6 -0
  107. package/dist/bin/chunks/chunk-WXMBDX4P.js +14 -0
  108. package/dist/bin/chunks/chunk-XXCTETRW.js +11 -0
  109. package/dist/bin/chunks/chunk-XY5HGZW5.js +8 -0
  110. package/dist/bin/chunks/chunk-YEKSVVRC.js +11 -0
  111. package/dist/bin/chunks/chunk-YLE2OYY6.js +2 -0
  112. package/dist/bin/chunks/chunk-YMMJLYIX.js +2 -0
  113. package/dist/bin/chunks/chunk-YTIURC67.js +2 -0
  114. package/dist/bin/chunks/chunk-YU6OGPZR.js +5 -0
  115. package/dist/bin/chunks/chunk-YWZOGBFE.js +9 -0
  116. package/dist/bin/chunks/chunk-ZA4HUKJ3.js +13 -0
  117. package/dist/bin/chunks/chunk-ZKC5HQYO.js +14 -0
  118. package/dist/bin/chunks/chunk-ZSVBYEY4.js +6 -0
  119. package/dist/bin/chunks/chunk-ZUDPEMHG.js +63 -0
  120. package/dist/bin/chunks/clear-KRGKPFOI.js +2 -0
  121. package/dist/bin/chunks/column-XGV32UPN.js +2 -0
  122. package/dist/bin/chunks/comm-R3F3Z5DX.js +2 -0
  123. package/dist/bin/chunks/cp-XH2ZB7WT.js +2 -0
  124. package/dist/bin/chunks/curl-2DCNBIKJ.js +26 -0
  125. package/dist/bin/chunks/cut-5EY2XPXX.js +2 -0
  126. package/dist/bin/chunks/date-WUPBL2TL.js +2 -0
  127. package/dist/bin/chunks/diff-5NUI5BHG.js +2 -0
  128. package/dist/bin/chunks/dirname-5FAOMLBL.js +2 -0
  129. package/dist/bin/chunks/du-LDAPXSGF.js +2 -0
  130. package/dist/bin/chunks/echo-2MUAOGUE.js +2 -0
  131. package/dist/bin/chunks/env-NTPN5QYM.js +2 -0
  132. package/dist/bin/chunks/expand-26XPP5KB.js +2 -0
  133. package/dist/bin/chunks/expansion-QUT3FT7V.js +2 -0
  134. package/dist/bin/chunks/expr-G4EF4POQ.js +2 -0
  135. package/dist/bin/chunks/file-MMSHRWCJ.js +2 -0
  136. package/dist/bin/chunks/find-7CVMEZBO.js +2 -0
  137. package/dist/bin/chunks/flag-coverage-UJISFT4M.js +2 -0
  138. package/dist/bin/chunks/fold-XSVNTAWH.js +2 -0
  139. package/dist/bin/chunks/grep-7BJ7HFBM.js +2 -0
  140. package/dist/bin/chunks/gzip-LHOO65AN.js +2 -0
  141. package/dist/bin/chunks/head-YMNRW3F3.js +2 -0
  142. package/dist/bin/chunks/help-DVG4AAGE.js +2 -0
  143. package/dist/bin/chunks/history-UUKG55YW.js +2 -0
  144. package/dist/bin/chunks/hostname-WY6RKE32.js +2 -0
  145. package/dist/bin/chunks/html-to-markdown-V6PK6S5U.js +2 -0
  146. package/dist/bin/chunks/join-Y4Q5WVVE.js +2 -0
  147. package/dist/bin/chunks/jq-4JWOFG7X.js +2 -0
  148. package/dist/bin/chunks/js-exec-RWEELTC2.js +97 -0
  149. package/dist/bin/chunks/js-exec-worker.js +4380 -0
  150. package/dist/bin/chunks/ln-EGC4HRXZ.js +2 -0
  151. package/dist/bin/chunks/ls-WONXDVOX.js +2 -0
  152. package/dist/bin/chunks/md5sum-NCLXV2S3.js +2 -0
  153. package/dist/bin/chunks/mkdir-Z47OISSR.js +2 -0
  154. package/dist/bin/chunks/mv-OY7X62QC.js +2 -0
  155. package/dist/bin/chunks/nl-XH3L75DR.js +2 -0
  156. package/dist/bin/chunks/od-52FBC34W.js +2 -0
  157. package/dist/bin/chunks/paste-3UVLMQ2K.js +2 -0
  158. package/dist/bin/chunks/printf-NA7DYZBO.js +2 -0
  159. package/dist/bin/chunks/pwd-6VBAPL3Y.js +2 -0
  160. package/dist/bin/chunks/python3-JUJKPBFB.js +12 -0
  161. package/dist/bin/chunks/readlink-BD5VFOC5.js +2 -0
  162. package/dist/bin/chunks/rev-UHEPS2UL.js +2 -0
  163. package/dist/bin/chunks/rg-DK6FRF6Q.js +2 -0
  164. package/dist/bin/chunks/rm-L3NZOLLG.js +2 -0
  165. package/dist/bin/chunks/rmdir-5KLM4EA6.js +2 -0
  166. package/dist/bin/chunks/sed-WWXBUNG3.js +2 -0
  167. package/dist/bin/chunks/seq-V7KBLSQ7.js +2 -0
  168. package/dist/bin/chunks/sha1sum-BHNJ5ALF.js +2 -0
  169. package/dist/bin/chunks/sha256sum-HJJ3NJ5L.js +2 -0
  170. package/dist/bin/chunks/sleep-ND6FZRZ4.js +2 -0
  171. package/dist/bin/chunks/sort-7GENYU2I.js +2 -0
  172. package/dist/bin/chunks/split-YWV64TJH.js +2 -0
  173. package/dist/bin/chunks/sqlite3-CVNFMP3Z.js +2 -0
  174. package/dist/bin/chunks/stat-XS2LXYS2.js +2 -0
  175. package/dist/bin/chunks/strings-XXKZCWY5.js +2 -0
  176. package/dist/bin/chunks/tac-T42SKDDI.js +2 -0
  177. package/dist/bin/chunks/tail-V537TDFR.js +2 -0
  178. package/dist/bin/chunks/tar-GTGFEWDS.js +2 -0
  179. package/dist/bin/chunks/tee-HK2SYCAR.js +2 -0
  180. package/dist/bin/chunks/time-5R4QWCYF.js +2 -0
  181. package/dist/bin/chunks/timeout-Z24MNWOP.js +2 -0
  182. package/dist/bin/chunks/touch-DWKSZGOQ.js +2 -0
  183. package/dist/bin/chunks/tr-4FPGAEVB.js +2 -0
  184. package/dist/bin/chunks/tree-HEKABARE.js +2 -0
  185. package/dist/bin/chunks/true-DP5UZP52.js +2 -0
  186. package/dist/bin/chunks/unexpand-OYZ7KOYR.js +2 -0
  187. package/dist/bin/chunks/uniq-TMSAIZM3.js +2 -0
  188. package/dist/bin/chunks/wc-ZIV3TFVG.js +2 -0
  189. package/dist/bin/chunks/which-5PO4LAOG.js +2 -0
  190. package/dist/bin/chunks/whoami-E7PN2UWC.js +2 -0
  191. package/dist/bin/chunks/worker.js +3136 -0
  192. package/dist/bin/chunks/xan-FKXPSPE5.js +2 -0
  193. package/dist/bin/chunks/xan-view-6J5MMMQB.js +2 -0
  194. package/dist/bin/chunks/xargs-SCYIFXOW.js +2 -0
  195. package/dist/bin/chunks/yq-RGXFWYJN.js +2 -0
  196. package/dist/bin/just-bash.js +754 -0
  197. package/dist/bin/shell/chunks/alias-3GODYSFD.js +2 -0
  198. package/dist/bin/shell/chunks/awk2-RSUCURL4.js +2 -0
  199. package/dist/bin/shell/chunks/base64-43M2R3GA.js +2 -0
  200. package/dist/bin/shell/chunks/basename-KBUKWB2E.js +2 -0
  201. package/dist/bin/shell/chunks/bash-6ZHZ6BX7.js +2 -0
  202. package/dist/bin/shell/chunks/cat-XZIJZXKP.js +2 -0
  203. package/dist/bin/shell/chunks/chmod-N5CQATDW.js +2 -0
  204. package/dist/bin/shell/chunks/chunk-22NDZXS5.js +33 -0
  205. package/dist/bin/shell/chunks/chunk-26NO42TF.js +14 -0
  206. package/dist/bin/shell/chunks/chunk-2W2SCVT6.js +140 -0
  207. package/dist/bin/shell/chunks/chunk-3MBAUIBB.js +7 -0
  208. package/dist/bin/shell/chunks/chunk-3Y32LPNT.js +2 -0
  209. package/dist/bin/shell/chunks/chunk-4CFAYBLV.js +21 -0
  210. package/dist/bin/shell/chunks/chunk-4OALHZXB.js +2 -0
  211. package/dist/bin/shell/chunks/chunk-4PRVMER6.js +2 -0
  212. package/dist/bin/shell/chunks/chunk-4VDEBYW7.js +2 -0
  213. package/dist/bin/shell/chunks/chunk-54G6AE72.js +32 -0
  214. package/dist/bin/shell/chunks/chunk-5G2VOPPJ.js +7 -0
  215. package/dist/bin/shell/chunks/chunk-5WFYIUU2.js +3 -0
  216. package/dist/bin/shell/chunks/chunk-6KZRLMG3.js +8 -0
  217. package/dist/bin/shell/chunks/chunk-7ADG3DNO.js +8 -0
  218. package/dist/bin/shell/chunks/chunk-7BORMNPQ.js +2 -0
  219. package/dist/bin/shell/chunks/chunk-7G3MC56B.js +7 -0
  220. package/dist/bin/shell/chunks/chunk-AAW7UMPO.js +9 -0
  221. package/dist/bin/shell/chunks/chunk-AXWFPG37.js +10 -0
  222. package/dist/bin/shell/chunks/chunk-AZ3RUDR2.js +9 -0
  223. package/dist/bin/shell/chunks/chunk-BGGF3ELU.js +5 -0
  224. package/dist/bin/shell/chunks/chunk-BYDV4VEF.js +3 -0
  225. package/dist/bin/shell/chunks/chunk-CGE2EHYP.js +5 -0
  226. package/dist/bin/shell/chunks/chunk-CM4532DS.js +36 -0
  227. package/dist/bin/shell/chunks/chunk-CQG2HEAL.js +5 -0
  228. package/dist/bin/shell/chunks/chunk-D5WP4CKS.js +3 -0
  229. package/dist/bin/shell/chunks/chunk-DOXYBGNA.js +12 -0
  230. package/dist/bin/shell/chunks/chunk-E5BDLLK6.js +15 -0
  231. package/dist/bin/shell/chunks/chunk-EJQKHROT.js +14 -0
  232. package/dist/bin/shell/chunks/chunk-EONWONZV.js +2 -0
  233. package/dist/bin/shell/chunks/chunk-EPPBDXOG.js +8 -0
  234. package/dist/bin/shell/chunks/chunk-EUXCM6C4.js +12 -0
  235. package/dist/bin/shell/chunks/chunk-EWDHVLQL.js +21 -0
  236. package/dist/bin/shell/chunks/chunk-F3LGZXLQ.js +9 -0
  237. package/dist/bin/shell/chunks/chunk-FA2CHD73.js +16 -0
  238. package/dist/bin/shell/chunks/chunk-FIHFXGT6.js +287 -0
  239. package/dist/bin/shell/chunks/chunk-FLPVVSN5.js +5 -0
  240. package/dist/bin/shell/chunks/chunk-FSZWFMB4.js +16 -0
  241. package/dist/bin/shell/chunks/chunk-GO6FXSC4.js +6 -0
  242. package/dist/bin/shell/chunks/chunk-GOJZHH3L.js +6 -0
  243. package/dist/bin/shell/chunks/chunk-GTNBSMZR.js +23 -0
  244. package/dist/bin/shell/chunks/chunk-HC7WB764.js +2 -0
  245. package/dist/bin/shell/chunks/chunk-IDGH4PGU.js +3 -0
  246. package/dist/bin/shell/chunks/chunk-IO2FYBEM.js +6 -0
  247. package/dist/bin/shell/chunks/chunk-ITA43A73.js +7 -0
  248. package/dist/bin/shell/chunks/chunk-JBABAK44.js +4 -0
  249. package/dist/bin/shell/chunks/chunk-JDNI5HBX.js +33 -0
  250. package/dist/bin/shell/chunks/chunk-JLX6YWGA.js +3 -0
  251. package/dist/bin/shell/chunks/chunk-JQBC3FXE.js +8 -0
  252. package/dist/bin/shell/chunks/chunk-JTF74J6E.js +2 -0
  253. package/dist/bin/shell/chunks/chunk-KCMUAACL.js +19 -0
  254. package/dist/bin/shell/chunks/chunk-KGOUQS5A.js +2 -0
  255. package/dist/bin/shell/chunks/chunk-L6XUBS6H.js +84 -0
  256. package/dist/bin/shell/chunks/chunk-LCDPWJBA.js +15 -0
  257. package/dist/bin/shell/chunks/chunk-LGJM5YFT.js +17 -0
  258. package/dist/bin/shell/chunks/chunk-LIYVQA3X.js +2 -0
  259. package/dist/bin/shell/chunks/chunk-LJKIWB5F.js +4 -0
  260. package/dist/bin/shell/chunks/chunk-LMK6G2HH.js +8 -0
  261. package/dist/bin/shell/chunks/chunk-LOJMXC4F.js +5 -0
  262. package/dist/bin/shell/chunks/chunk-MAVV76T4.js +2 -0
  263. package/dist/bin/shell/chunks/chunk-MO4RPBN2.js +2 -0
  264. package/dist/bin/shell/chunks/chunk-MRP4ZCD7.js +6 -0
  265. package/dist/bin/shell/chunks/chunk-N43DJTSI.js +2 -0
  266. package/dist/bin/shell/chunks/chunk-NAX7MTAR.js +21 -0
  267. package/dist/bin/shell/chunks/chunk-NSUMEERA.js +12 -0
  268. package/dist/bin/shell/chunks/chunk-NTW6IA45.js +2 -0
  269. package/dist/bin/shell/chunks/chunk-OBH7XN5N.js +1 -0
  270. package/dist/bin/shell/chunks/chunk-OBI37ZY4.js +9 -0
  271. package/dist/bin/shell/chunks/chunk-OOJCYVYF.js +2 -0
  272. package/dist/bin/shell/chunks/chunk-ORUYSLP4.js +16 -0
  273. package/dist/bin/shell/chunks/chunk-OXHVTSNH.js +74 -0
  274. package/dist/bin/shell/chunks/chunk-PNI5NMXP.js +100 -0
  275. package/dist/bin/shell/chunks/chunk-PPBQJBC2.js +5 -0
  276. package/dist/bin/shell/chunks/chunk-PQNTKMH3.js +6 -0
  277. package/dist/bin/shell/chunks/chunk-PS4LOXE5.js +8 -0
  278. package/dist/bin/shell/chunks/chunk-RA3TG4UK.js +9 -0
  279. package/dist/bin/shell/chunks/chunk-RBQGQWGV.js +10 -0
  280. package/dist/bin/shell/chunks/chunk-RJSAGJQJ.js +11 -0
  281. package/dist/bin/shell/chunks/chunk-RLNOQILG.js +2 -0
  282. package/dist/bin/shell/chunks/chunk-ROJPSS6N.js +3 -0
  283. package/dist/bin/shell/chunks/chunk-RT7TRQVZ.js +3 -0
  284. package/dist/bin/shell/chunks/chunk-S3QAKT3R.js +11 -0
  285. package/dist/bin/shell/chunks/chunk-S7OHMN3F.js +6 -0
  286. package/dist/bin/shell/chunks/chunk-SGA7Y45Z.js +17 -0
  287. package/dist/bin/shell/chunks/chunk-SXRVLCZ4.js +2 -0
  288. package/dist/bin/shell/chunks/chunk-TEFXEYX3.js +3 -0
  289. package/dist/bin/shell/chunks/chunk-THALLNXT.js +7 -0
  290. package/dist/bin/shell/chunks/chunk-TTNNO45C.js +17 -0
  291. package/dist/bin/shell/chunks/chunk-UFJFAFSS.js +28 -0
  292. package/dist/bin/shell/chunks/chunk-V7ZOPVQS.js +2 -0
  293. package/dist/bin/shell/chunks/chunk-VNER2XXL.js +7 -0
  294. package/dist/bin/shell/chunks/chunk-WLBA7L7U.js +23 -0
  295. package/dist/bin/shell/chunks/chunk-WWZVR5NN.js +6 -0
  296. package/dist/bin/shell/chunks/chunk-WXMBDX4P.js +14 -0
  297. package/dist/bin/shell/chunks/chunk-XXCTETRW.js +11 -0
  298. package/dist/bin/shell/chunks/chunk-XY5HGZW5.js +8 -0
  299. package/dist/bin/shell/chunks/chunk-YEKSVVRC.js +11 -0
  300. package/dist/bin/shell/chunks/chunk-YLE2OYY6.js +2 -0
  301. package/dist/bin/shell/chunks/chunk-YMMJLYIX.js +2 -0
  302. package/dist/bin/shell/chunks/chunk-YTIURC67.js +2 -0
  303. package/dist/bin/shell/chunks/chunk-YU6OGPZR.js +5 -0
  304. package/dist/bin/shell/chunks/chunk-YWZOGBFE.js +9 -0
  305. package/dist/bin/shell/chunks/chunk-ZA4HUKJ3.js +13 -0
  306. package/dist/bin/shell/chunks/chunk-ZKC5HQYO.js +14 -0
  307. package/dist/bin/shell/chunks/chunk-ZSVBYEY4.js +6 -0
  308. package/dist/bin/shell/chunks/chunk-ZUDPEMHG.js +63 -0
  309. package/dist/bin/shell/chunks/clear-KRGKPFOI.js +2 -0
  310. package/dist/bin/shell/chunks/column-XGV32UPN.js +2 -0
  311. package/dist/bin/shell/chunks/comm-R3F3Z5DX.js +2 -0
  312. package/dist/bin/shell/chunks/cp-XH2ZB7WT.js +2 -0
  313. package/dist/bin/shell/chunks/curl-2DCNBIKJ.js +26 -0
  314. package/dist/bin/shell/chunks/cut-5EY2XPXX.js +2 -0
  315. package/dist/bin/shell/chunks/date-WUPBL2TL.js +2 -0
  316. package/dist/bin/shell/chunks/diff-5NUI5BHG.js +2 -0
  317. package/dist/bin/shell/chunks/dirname-5FAOMLBL.js +2 -0
  318. package/dist/bin/shell/chunks/du-LDAPXSGF.js +2 -0
  319. package/dist/bin/shell/chunks/echo-2MUAOGUE.js +2 -0
  320. package/dist/bin/shell/chunks/env-NTPN5QYM.js +2 -0
  321. package/dist/bin/shell/chunks/expand-26XPP5KB.js +2 -0
  322. package/dist/bin/shell/chunks/expansion-QUT3FT7V.js +2 -0
  323. package/dist/bin/shell/chunks/expr-G4EF4POQ.js +2 -0
  324. package/dist/bin/shell/chunks/file-MMSHRWCJ.js +2 -0
  325. package/dist/bin/shell/chunks/find-7CVMEZBO.js +2 -0
  326. package/dist/bin/shell/chunks/flag-coverage-UJISFT4M.js +2 -0
  327. package/dist/bin/shell/chunks/fold-XSVNTAWH.js +2 -0
  328. package/dist/bin/shell/chunks/grep-7BJ7HFBM.js +2 -0
  329. package/dist/bin/shell/chunks/gzip-LHOO65AN.js +2 -0
  330. package/dist/bin/shell/chunks/head-YMNRW3F3.js +2 -0
  331. package/dist/bin/shell/chunks/help-DVG4AAGE.js +2 -0
  332. package/dist/bin/shell/chunks/history-UUKG55YW.js +2 -0
  333. package/dist/bin/shell/chunks/hostname-WY6RKE32.js +2 -0
  334. package/dist/bin/shell/chunks/html-to-markdown-V6PK6S5U.js +2 -0
  335. package/dist/bin/shell/chunks/join-Y4Q5WVVE.js +2 -0
  336. package/dist/bin/shell/chunks/jq-4JWOFG7X.js +2 -0
  337. package/dist/bin/shell/chunks/js-exec-AKWY6BP5.js +97 -0
  338. package/dist/bin/shell/chunks/ln-EGC4HRXZ.js +2 -0
  339. package/dist/bin/shell/chunks/ls-WONXDVOX.js +2 -0
  340. package/dist/bin/shell/chunks/md5sum-NCLXV2S3.js +2 -0
  341. package/dist/bin/shell/chunks/mkdir-Z47OISSR.js +2 -0
  342. package/dist/bin/shell/chunks/mv-OY7X62QC.js +2 -0
  343. package/dist/bin/shell/chunks/nl-XH3L75DR.js +2 -0
  344. package/dist/bin/shell/chunks/od-52FBC34W.js +2 -0
  345. package/dist/bin/shell/chunks/paste-3UVLMQ2K.js +2 -0
  346. package/dist/bin/shell/chunks/printf-NA7DYZBO.js +2 -0
  347. package/dist/bin/shell/chunks/pwd-6VBAPL3Y.js +2 -0
  348. package/dist/bin/shell/chunks/python3-RRCCYJKA.js +12 -0
  349. package/dist/bin/shell/chunks/readlink-BD5VFOC5.js +2 -0
  350. package/dist/bin/shell/chunks/rev-UHEPS2UL.js +2 -0
  351. package/dist/bin/shell/chunks/rg-DK6FRF6Q.js +2 -0
  352. package/dist/bin/shell/chunks/rm-L3NZOLLG.js +2 -0
  353. package/dist/bin/shell/chunks/rmdir-5KLM4EA6.js +2 -0
  354. package/dist/bin/shell/chunks/sed-WWXBUNG3.js +2 -0
  355. package/dist/bin/shell/chunks/seq-V7KBLSQ7.js +2 -0
  356. package/dist/bin/shell/chunks/sha1sum-BHNJ5ALF.js +2 -0
  357. package/dist/bin/shell/chunks/sha256sum-HJJ3NJ5L.js +2 -0
  358. package/dist/bin/shell/chunks/sleep-ND6FZRZ4.js +2 -0
  359. package/dist/bin/shell/chunks/sort-7GENYU2I.js +2 -0
  360. package/dist/bin/shell/chunks/split-YWV64TJH.js +2 -0
  361. package/dist/bin/shell/chunks/sqlite3-CVNFMP3Z.js +2 -0
  362. package/dist/bin/shell/chunks/stat-XS2LXYS2.js +2 -0
  363. package/dist/bin/shell/chunks/strings-XXKZCWY5.js +2 -0
  364. package/dist/bin/shell/chunks/tac-T42SKDDI.js +2 -0
  365. package/dist/bin/shell/chunks/tail-V537TDFR.js +2 -0
  366. package/dist/bin/shell/chunks/tar-GTGFEWDS.js +2 -0
  367. package/dist/bin/shell/chunks/tee-HK2SYCAR.js +2 -0
  368. package/dist/bin/shell/chunks/time-5R4QWCYF.js +2 -0
  369. package/dist/bin/shell/chunks/timeout-Z24MNWOP.js +2 -0
  370. package/dist/bin/shell/chunks/touch-DWKSZGOQ.js +2 -0
  371. package/dist/bin/shell/chunks/tr-4FPGAEVB.js +2 -0
  372. package/dist/bin/shell/chunks/tree-HEKABARE.js +2 -0
  373. package/dist/bin/shell/chunks/true-DP5UZP52.js +2 -0
  374. package/dist/bin/shell/chunks/unexpand-OYZ7KOYR.js +2 -0
  375. package/dist/bin/shell/chunks/uniq-TMSAIZM3.js +2 -0
  376. package/dist/bin/shell/chunks/wc-ZIV3TFVG.js +2 -0
  377. package/dist/bin/shell/chunks/which-5PO4LAOG.js +2 -0
  378. package/dist/bin/shell/chunks/whoami-E7PN2UWC.js +2 -0
  379. package/dist/bin/shell/chunks/xan-FKXPSPE5.js +2 -0
  380. package/dist/bin/shell/chunks/xan-view-6J5MMMQB.js +2 -0
  381. package/dist/bin/shell/chunks/xargs-SCYIFXOW.js +2 -0
  382. package/dist/bin/shell/chunks/yq-RGXFWYJN.js +2 -0
  383. package/dist/bin/shell/shell.js +733 -0
  384. package/dist/browser.d.ts +23 -0
  385. package/dist/bundle/browser.js +1515 -0
  386. package/dist/bundle/chunks/alias-JE7RI5QX.js +1 -0
  387. package/dist/bundle/chunks/awk2-JFGEGLFP.js +1 -0
  388. package/dist/bundle/chunks/base64-4YMZCVJ5.js +1 -0
  389. package/dist/bundle/chunks/basename-AA2KJYZQ.js +1 -0
  390. package/dist/bundle/chunks/bash-IJWYRKFO.js +1 -0
  391. package/dist/bundle/chunks/cat-RDUMLXKC.js +1 -0
  392. package/dist/bundle/chunks/chmod-SYMGL4JA.js +1 -0
  393. package/dist/bundle/chunks/chunk-24IMIIXA.js +1 -0
  394. package/dist/bundle/chunks/chunk-3THT3N7L.js +1 -0
  395. package/dist/bundle/chunks/chunk-3ZUFRYJ4.js +1 -0
  396. package/dist/bundle/chunks/chunk-43RSSTFA.js +73 -0
  397. package/dist/bundle/chunks/chunk-44UOCSGV.js +1 -0
  398. package/dist/bundle/chunks/chunk-4GTNDTRF.js +7 -0
  399. package/dist/bundle/chunks/chunk-4HHKTUW3.js +2 -0
  400. package/dist/bundle/chunks/chunk-4Q4SM6WR.js +4 -0
  401. package/dist/bundle/chunks/chunk-55VFSPNA.js +2 -0
  402. package/dist/bundle/chunks/chunk-5PYKJV42.js +4 -0
  403. package/dist/bundle/chunks/chunk-5QMZ5MUS.js +4 -0
  404. package/dist/bundle/chunks/chunk-5QVNJEHU.js +8 -0
  405. package/dist/bundle/chunks/chunk-5V6VZH6T.js +1 -0
  406. package/dist/bundle/chunks/chunk-62RKD26F.js +20 -0
  407. package/dist/bundle/chunks/chunk-64BAICW3.js +1 -0
  408. package/dist/bundle/chunks/chunk-74CEPOFO.js +22 -0
  409. package/dist/bundle/chunks/chunk-7ESWU5HP.js +14 -0
  410. package/dist/bundle/chunks/chunk-7L36YK2X.js +2 -0
  411. package/dist/bundle/chunks/chunk-7TSDKFEO.js +1 -0
  412. package/dist/bundle/chunks/chunk-A4HU7SVR.js +2 -0
  413. package/dist/bundle/chunks/chunk-A4JSPFCI.js +6 -0
  414. package/dist/bundle/chunks/chunk-A5O5YHGN.js +1 -0
  415. package/dist/bundle/chunks/chunk-A65PWWJC.js +2 -0
  416. package/dist/bundle/chunks/chunk-A7A2DBEE.js +6 -0
  417. package/dist/bundle/chunks/chunk-A7ICOL4V.js +13 -0
  418. package/dist/bundle/chunks/chunk-ALLTKNUZ.js +5 -0
  419. package/dist/bundle/chunks/chunk-APT7OOP2.js +1 -0
  420. package/dist/bundle/chunks/chunk-B53Y5JFV.js +8 -0
  421. package/dist/bundle/chunks/chunk-BAQA74XA.js +1 -0
  422. package/dist/bundle/chunks/chunk-CWQS3NFK.js +1 -0
  423. package/dist/bundle/chunks/chunk-D4J545R4.js +11 -0
  424. package/dist/bundle/chunks/chunk-D6CWQ5DW.js +5 -0
  425. package/dist/bundle/chunks/chunk-D6EWIDSU.js +20 -0
  426. package/dist/bundle/chunks/chunk-D7MEQ3VN.js +4 -0
  427. package/dist/bundle/chunks/chunk-DBKNVD4L.js +9 -0
  428. package/dist/bundle/chunks/chunk-DCAAORBQ.js +1 -0
  429. package/dist/bundle/chunks/chunk-DXB73IDG.js +1 -0
  430. package/dist/bundle/chunks/chunk-EEXR5ZDP.js +2 -0
  431. package/dist/bundle/chunks/chunk-EIZGF4BS.js +8 -0
  432. package/dist/bundle/chunks/chunk-F23WWYKW.js +16 -0
  433. package/dist/bundle/chunks/chunk-GCTKCWKD.js +3 -0
  434. package/dist/bundle/chunks/chunk-GFQRA5P5.js +7 -0
  435. package/dist/bundle/chunks/chunk-GJTDUJ5Q.js +10 -0
  436. package/dist/bundle/chunks/chunk-GOV5EKKI.js +9 -0
  437. package/dist/bundle/chunks/chunk-GXVXFKBA.js +5 -0
  438. package/dist/bundle/chunks/chunk-HDQ56CKY.js +15 -0
  439. package/dist/bundle/chunks/chunk-HJQJAYMS.js +2 -0
  440. package/dist/bundle/chunks/chunk-HJWBQKYG.js +5 -0
  441. package/dist/bundle/chunks/chunk-HL6NGDO2.js +22 -0
  442. package/dist/bundle/chunks/chunk-HWBSOZZR.js +35 -0
  443. package/dist/bundle/chunks/chunk-HWKDQ44K.js +3 -0
  444. package/dist/bundle/chunks/chunk-I57KEIP3.js +10 -0
  445. package/dist/bundle/chunks/chunk-IPJHKYVM.js +1 -0
  446. package/dist/bundle/chunks/chunk-IVYA2HK4.js +286 -0
  447. package/dist/bundle/chunks/chunk-JVPRLUMK.js +7 -0
  448. package/dist/bundle/chunks/chunk-KMEYNNUA.js +15 -0
  449. package/dist/bundle/chunks/chunk-KX3P26DQ.js +1 -0
  450. package/dist/bundle/chunks/chunk-LL3S3NLB.js +1 -0
  451. package/dist/bundle/chunks/chunk-LTZRCH7N.js +31 -0
  452. package/dist/bundle/chunks/chunk-LWEGUNWT.js +7 -0
  453. package/dist/bundle/chunks/chunk-MDDMCKUK.js +6 -0
  454. package/dist/bundle/chunks/chunk-MDLLFABN.js +4 -0
  455. package/dist/bundle/chunks/chunk-MHTUABJP.js +8 -0
  456. package/dist/bundle/chunks/chunk-MIZPJHVH.js +7 -0
  457. package/dist/bundle/chunks/chunk-MLXIYONF.js +15 -0
  458. package/dist/bundle/chunks/chunk-MYE6AGBJ.js +16 -0
  459. package/dist/bundle/chunks/chunk-NAERJDUW.js +8 -0
  460. package/dist/bundle/chunks/chunk-NCNPKYJZ.js +2 -0
  461. package/dist/bundle/chunks/chunk-NUFRM6SI.js +0 -0
  462. package/dist/bundle/chunks/chunk-NUYSJFDK.js +7 -0
  463. package/dist/bundle/chunks/chunk-OCLXQMOG.js +6 -0
  464. package/dist/bundle/chunks/chunk-OCS6LSEM.js +13 -0
  465. package/dist/bundle/chunks/chunk-OJDRYQWQ.js +1 -0
  466. package/dist/bundle/chunks/chunk-P7UWRQ44.js +139 -0
  467. package/dist/bundle/chunks/chunk-PBXLG62G.js +8 -0
  468. package/dist/bundle/chunks/chunk-PP6PSHAB.js +4 -0
  469. package/dist/bundle/chunks/chunk-PXTK5WE2.js +20 -0
  470. package/dist/bundle/chunks/chunk-PYDZ2LCK.js +16 -0
  471. package/dist/bundle/chunks/chunk-PYSFUGCK.js +10 -0
  472. package/dist/bundle/chunks/chunk-QCDB2VPH.js +6 -0
  473. package/dist/bundle/chunks/chunk-QJ7O6ZN3.js +5 -0
  474. package/dist/bundle/chunks/chunk-R6QSAL5T.js +1 -0
  475. package/dist/bundle/chunks/chunk-R6VWJ2ZL.js +1 -0
  476. package/dist/bundle/chunks/chunk-RPNGRAAP.js +7 -0
  477. package/dist/bundle/chunks/chunk-SDNKECQQ.js +5 -0
  478. package/dist/bundle/chunks/chunk-T56QNPHK.js +14 -0
  479. package/dist/bundle/chunks/chunk-TLSUDHID.js +6 -0
  480. package/dist/bundle/chunks/chunk-TOMNU26N.js +4 -0
  481. package/dist/bundle/chunks/chunk-TXBZCHCQ.js +5 -0
  482. package/dist/bundle/chunks/chunk-U6NMAV24.js +32 -0
  483. package/dist/bundle/chunks/chunk-V7TAPXDL.js +27 -0
  484. package/dist/bundle/chunks/chunk-VBEY5J6R.js +99 -0
  485. package/dist/bundle/chunks/chunk-VJFXDYWH.js +10 -0
  486. package/dist/bundle/chunks/chunk-VOBGTVA6.js +6 -0
  487. package/dist/bundle/chunks/chunk-VXBA5RYO.js +5 -0
  488. package/dist/bundle/chunks/chunk-VYOJP4TV.js +13 -0
  489. package/dist/bundle/chunks/chunk-WKFATFPP.js +4 -0
  490. package/dist/bundle/chunks/chunk-X2AJGDEF.js +1 -0
  491. package/dist/bundle/chunks/chunk-XIZSGUXJ.js +62 -0
  492. package/dist/bundle/chunks/chunk-XKQRETAK.js +1 -0
  493. package/dist/bundle/chunks/chunk-XVDPCNWR.js +11 -0
  494. package/dist/bundle/chunks/chunk-YSHZL3MF.js +32 -0
  495. package/dist/bundle/chunks/chunk-YTNYSM6T.js +11 -0
  496. package/dist/bundle/chunks/chunk-Z6LRHWXI.js +13 -0
  497. package/dist/bundle/chunks/chunk-Z7JVV2SM.js +12 -0
  498. package/dist/bundle/chunks/clear-5CZ5X4YR.js +1 -0
  499. package/dist/bundle/chunks/column-WLPMMSTS.js +1 -0
  500. package/dist/bundle/chunks/comm-5SLSESQG.js +1 -0
  501. package/dist/bundle/chunks/cp-XOYR4ABJ.js +1 -0
  502. package/dist/bundle/chunks/curl-47BFPSFW.js +25 -0
  503. package/dist/bundle/chunks/cut-OPC3VAGB.js +1 -0
  504. package/dist/bundle/chunks/date-DD7FVA2V.js +1 -0
  505. package/dist/bundle/chunks/diff-HJF2MPDN.js +1 -0
  506. package/dist/bundle/chunks/dirname-LEMTZZFS.js +1 -0
  507. package/dist/bundle/chunks/du-WO2ENHXQ.js +1 -0
  508. package/dist/bundle/chunks/echo-O45JWWI2.js +1 -0
  509. package/dist/bundle/chunks/env-5EPCWSXR.js +1 -0
  510. package/dist/bundle/chunks/expand-DTNXU4LQ.js +1 -0
  511. package/dist/bundle/chunks/expansion-UGGADTZC.js +1 -0
  512. package/dist/bundle/chunks/expr-DNFUYZGY.js +1 -0
  513. package/dist/bundle/chunks/file-IGDTDPLG.js +1 -0
  514. package/dist/bundle/chunks/find-KNMMLVJD.js +1 -0
  515. package/dist/bundle/chunks/flag-coverage-B26Z36PC.js +1 -0
  516. package/dist/bundle/chunks/fold-LDSORVYE.js +1 -0
  517. package/dist/bundle/chunks/grep-2UMHPO7Y.js +1 -0
  518. package/dist/bundle/chunks/gzip-AQXSGOVS.js +1 -0
  519. package/dist/bundle/chunks/head-HT2B6D2J.js +1 -0
  520. package/dist/bundle/chunks/help-VVWX7SA5.js +1 -0
  521. package/dist/bundle/chunks/history-J4QRNGRO.js +1 -0
  522. package/dist/bundle/chunks/hostname-BK6HG2DE.js +1 -0
  523. package/dist/bundle/chunks/html-to-markdown-TFCECAGV.js +1 -0
  524. package/dist/bundle/chunks/join-GG2LDHE5.js +1 -0
  525. package/dist/bundle/chunks/jq-CRLZNLQG.js +1 -0
  526. package/dist/bundle/chunks/js-exec-VXN6TZ7U.js +96 -0
  527. package/dist/bundle/chunks/js-exec-worker.js +4380 -0
  528. package/dist/bundle/chunks/ln-4TRFBYAT.js +1 -0
  529. package/dist/bundle/chunks/ls-KSXFZCWH.js +1 -0
  530. package/dist/bundle/chunks/md5sum-INMIK4DX.js +1 -0
  531. package/dist/bundle/chunks/mkdir-TDEMSB6C.js +1 -0
  532. package/dist/bundle/chunks/mv-Z6MORUFL.js +1 -0
  533. package/dist/bundle/chunks/nl-U5YJDM32.js +1 -0
  534. package/dist/bundle/chunks/od-VJEF2UR5.js +1 -0
  535. package/dist/bundle/chunks/paste-7N6AFSDS.js +1 -0
  536. package/dist/bundle/chunks/printf-CX64KX2P.js +1 -0
  537. package/dist/bundle/chunks/pwd-D4OZ7N27.js +1 -0
  538. package/dist/bundle/chunks/python3-BFV3N3GY.js +11 -0
  539. package/dist/bundle/chunks/readlink-MI4GCHJF.js +1 -0
  540. package/dist/bundle/chunks/rev-XOSYPP45.js +1 -0
  541. package/dist/bundle/chunks/rg-KYSTAD4Q.js +1 -0
  542. package/dist/bundle/chunks/rm-RTZG23RL.js +1 -0
  543. package/dist/bundle/chunks/rmdir-XTQXT7RK.js +1 -0
  544. package/dist/bundle/chunks/sed-OFX3F4FE.js +1 -0
  545. package/dist/bundle/chunks/seq-RN5ZUASB.js +1 -0
  546. package/dist/bundle/chunks/sha1sum-VJPNLNU6.js +1 -0
  547. package/dist/bundle/chunks/sha256sum-PI32XWXY.js +1 -0
  548. package/dist/bundle/chunks/sleep-VZFPZFWA.js +1 -0
  549. package/dist/bundle/chunks/sort-DCNRDA7U.js +1 -0
  550. package/dist/bundle/chunks/split-SITCSYCZ.js +1 -0
  551. package/dist/bundle/chunks/sqlite3-56UMWEY3.js +1 -0
  552. package/dist/bundle/chunks/stat-BT5A227F.js +1 -0
  553. package/dist/bundle/chunks/strings-7PLOGTPD.js +1 -0
  554. package/dist/bundle/chunks/tac-SJGXQ4T2.js +1 -0
  555. package/dist/bundle/chunks/tail-S5ULNTJU.js +1 -0
  556. package/dist/bundle/chunks/tar-LYLTEJV3.js +1 -0
  557. package/dist/bundle/chunks/tee-O7VXZDCO.js +1 -0
  558. package/dist/bundle/chunks/time-DEUO3QV2.js +1 -0
  559. package/dist/bundle/chunks/timeout-VRKMCG72.js +1 -0
  560. package/dist/bundle/chunks/touch-DX2IJOQ4.js +1 -0
  561. package/dist/bundle/chunks/tr-2HXZRDSW.js +1 -0
  562. package/dist/bundle/chunks/tree-LYXBS7DC.js +1 -0
  563. package/dist/bundle/chunks/true-WHJNXCHG.js +1 -0
  564. package/dist/bundle/chunks/unexpand-RGTMIGZM.js +1 -0
  565. package/dist/bundle/chunks/uniq-SUNANL47.js +1 -0
  566. package/dist/bundle/chunks/wc-TQB3VNOX.js +1 -0
  567. package/dist/bundle/chunks/which-XZHEH76L.js +1 -0
  568. package/dist/bundle/chunks/whoami-DGKU3D2X.js +1 -0
  569. package/dist/bundle/chunks/worker.js +3136 -0
  570. package/dist/bundle/chunks/xan-DHUKCGIW.js +1 -0
  571. package/dist/bundle/chunks/xan-view-OW2TB7Z3.js +1 -0
  572. package/dist/bundle/chunks/xargs-I6EZUCYF.js +1 -0
  573. package/dist/bundle/chunks/yq-NDDDSAXH.js +1 -0
  574. package/dist/bundle/index.cjs +2178 -0
  575. package/dist/bundle/index.js +709 -0
  576. package/dist/commands/alias/alias.d.ts +6 -0
  577. package/dist/commands/awk/ast.d.ts +202 -0
  578. package/dist/commands/awk/awk2.d.ts +9 -0
  579. package/dist/commands/awk/builtins.d.ts +17 -0
  580. package/dist/commands/awk/interpreter/context.d.ts +75 -0
  581. package/dist/commands/awk/interpreter/expressions.d.ts +17 -0
  582. package/dist/commands/awk/interpreter/fields.d.ts +25 -0
  583. package/dist/commands/awk/interpreter/index.d.ts +8 -0
  584. package/dist/commands/awk/interpreter/interpreter.d.ts +54 -0
  585. package/dist/commands/awk/interpreter/statements.d.ts +11 -0
  586. package/dist/commands/awk/interpreter/type-coercion.d.ts +32 -0
  587. package/dist/commands/awk/interpreter/types.d.ts +13 -0
  588. package/dist/commands/awk/interpreter/variables.d.ts +35 -0
  589. package/dist/commands/awk/lexer.d.ts +100 -0
  590. package/dist/commands/awk/parser2-print.d.ts +35 -0
  591. package/dist/commands/awk/parser2.d.ts +81 -0
  592. package/dist/commands/base64/base64.d.ts +7 -0
  593. package/dist/commands/basename/basename.d.ts +4 -0
  594. package/dist/commands/bash/bash.d.ts +6 -0
  595. package/dist/commands/browser-excluded.d.ts +16 -0
  596. package/dist/commands/cat/cat.d.ts +4 -0
  597. package/dist/commands/chmod/chmod.d.ts +4 -0
  598. package/dist/commands/clear/clear.d.ts +4 -0
  599. package/dist/commands/column/column.d.ts +11 -0
  600. package/dist/commands/comm/comm.d.ts +12 -0
  601. package/dist/commands/cp/cp.d.ts +4 -0
  602. package/dist/commands/curl/curl.d.ts +8 -0
  603. package/dist/commands/curl/form.d.ts +21 -0
  604. package/dist/commands/curl/help.d.ts +9 -0
  605. package/dist/commands/curl/parse.d.ts +9 -0
  606. package/dist/commands/curl/response-formatting.d.ts +20 -0
  607. package/dist/commands/curl/types.d.ts +31 -0
  608. package/dist/commands/cut/cut.d.ts +4 -0
  609. package/dist/commands/date/date.d.ts +7 -0
  610. package/dist/commands/diff/diff.d.ts +7 -0
  611. package/dist/commands/dirname/dirname.d.ts +4 -0
  612. package/dist/commands/du/du.d.ts +4 -0
  613. package/dist/commands/duration.d.ts +5 -0
  614. package/dist/commands/echo/echo.d.ts +4 -0
  615. package/dist/commands/env/env.d.ts +6 -0
  616. package/dist/commands/expand/expand.d.ts +12 -0
  617. package/dist/commands/expand/unexpand.d.ts +12 -0
  618. package/dist/commands/expr/expr.d.ts +9 -0
  619. package/dist/commands/file/file.d.ts +9 -0
  620. package/dist/commands/find/find.d.ts +4 -0
  621. package/dist/commands/find/matcher.d.ts +69 -0
  622. package/dist/commands/find/parser.d.ts +2 -0
  623. package/dist/commands/find/types.d.ts +88 -0
  624. package/dist/commands/flag-coverage.d.ts +2 -0
  625. package/dist/commands/fold/fold.d.ts +12 -0
  626. package/dist/commands/format-mode.d.ts +4 -0
  627. package/dist/commands/fuzz-flags-types.d.ts +17 -0
  628. package/dist/commands/fuzz-flags.d.ts +8 -0
  629. package/dist/commands/grep/grep.d.ts +8 -0
  630. package/dist/commands/gzip/gzip.d.ts +13 -0
  631. package/dist/commands/head/head-tail-shared.d.ts +38 -0
  632. package/dist/commands/head/head.d.ts +4 -0
  633. package/dist/commands/help/help.d.ts +4 -0
  634. package/dist/commands/help.d.ts +16 -0
  635. package/dist/commands/history/history.d.ts +4 -0
  636. package/dist/commands/hostname/hostname.d.ts +11 -0
  637. package/dist/commands/html-to-markdown/html-to-markdown.d.ts +9 -0
  638. package/dist/commands/join/join.d.ts +12 -0
  639. package/dist/commands/jq/jq.d.ts +9 -0
  640. package/dist/commands/js-exec/fetch-polyfill.d.ts +6 -0
  641. package/dist/commands/js-exec/js-exec-worker.d.ts +30 -0
  642. package/dist/commands/js-exec/js-exec.d.ts +11 -0
  643. package/dist/commands/js-exec/module-shims.d.ts +29 -0
  644. package/dist/commands/js-exec/path-polyfill.d.ts +6 -0
  645. package/dist/commands/ln/ln.d.ts +4 -0
  646. package/dist/commands/ls/ls.d.ts +4 -0
  647. package/dist/commands/md5sum/checksum.d.ts +7 -0
  648. package/dist/commands/md5sum/md5sum.d.ts +4 -0
  649. package/dist/commands/md5sum/sha1sum.d.ts +4 -0
  650. package/dist/commands/md5sum/sha256sum.d.ts +4 -0
  651. package/dist/commands/mkdir/mkdir.d.ts +4 -0
  652. package/dist/commands/mv/mv.d.ts +4 -0
  653. package/dist/commands/nl/nl.d.ts +12 -0
  654. package/dist/commands/od/od.d.ts +12 -0
  655. package/dist/commands/paste/paste.d.ts +4 -0
  656. package/dist/commands/printf/escapes.d.ts +25 -0
  657. package/dist/commands/printf/printf.d.ts +4 -0
  658. package/dist/commands/printf/strftime.d.ts +9 -0
  659. package/dist/commands/pwd/pwd.d.ts +4 -0
  660. package/dist/commands/python3/python3.d.ts +16 -0
  661. package/dist/commands/python3/worker.d.ts +28 -0
  662. package/dist/commands/query-engine/builtins/array-builtins.d.ts +20 -0
  663. package/dist/commands/query-engine/builtins/control-builtins.d.ts +18 -0
  664. package/dist/commands/query-engine/builtins/date-builtins.d.ts +15 -0
  665. package/dist/commands/query-engine/builtins/format-builtins.d.ts +11 -0
  666. package/dist/commands/query-engine/builtins/index-builtins.d.ts +16 -0
  667. package/dist/commands/query-engine/builtins/index.d.ts +17 -0
  668. package/dist/commands/query-engine/builtins/math-builtins.d.ts +15 -0
  669. package/dist/commands/query-engine/builtins/navigation-builtins.d.ts +18 -0
  670. package/dist/commands/query-engine/builtins/object-builtins.d.ts +15 -0
  671. package/dist/commands/query-engine/builtins/path-builtins.d.ts +20 -0
  672. package/dist/commands/query-engine/builtins/sql-builtins.d.ts +16 -0
  673. package/dist/commands/query-engine/builtins/string-builtins.d.ts +15 -0
  674. package/dist/commands/query-engine/builtins/type-builtins.d.ts +11 -0
  675. package/dist/commands/query-engine/evaluator.d.ts +41 -0
  676. package/dist/commands/query-engine/index.d.ts +8 -0
  677. package/dist/commands/query-engine/parser-types.d.ts +171 -0
  678. package/dist/commands/query-engine/parser.d.ts +9 -0
  679. package/dist/commands/query-engine/path-operations.d.ts +15 -0
  680. package/dist/commands/query-engine/safe-object.d.ts +83 -0
  681. package/dist/commands/query-engine/value-operations.d.ts +41 -0
  682. package/dist/commands/readlink/readlink.d.ts +4 -0
  683. package/dist/commands/registry.d.ts +56 -0
  684. package/dist/commands/rev/rev.d.ts +13 -0
  685. package/dist/commands/rg/file-types.d.ts +49 -0
  686. package/dist/commands/rg/gitignore.d.ts +98 -0
  687. package/dist/commands/rg/rg-options.d.ts +61 -0
  688. package/dist/commands/rg/rg-parser.d.ts +20 -0
  689. package/dist/commands/rg/rg-search.d.ts +15 -0
  690. package/dist/commands/rg/rg.d.ts +14 -0
  691. package/dist/commands/rm/rm.d.ts +4 -0
  692. package/dist/commands/rmdir/rmdir.d.ts +4 -0
  693. package/dist/commands/search-engine/index.d.ts +10 -0
  694. package/dist/commands/search-engine/matcher.d.ts +60 -0
  695. package/dist/commands/search-engine/regex.d.ts +33 -0
  696. package/dist/commands/sed/executor.d.ts +7 -0
  697. package/dist/commands/sed/lexer.d.ts +86 -0
  698. package/dist/commands/sed/parser.d.ts +18 -0
  699. package/dist/commands/sed/sed-regex.d.ts +23 -0
  700. package/dist/commands/sed/sed.d.ts +4 -0
  701. package/dist/commands/sed/types.d.ts +216 -0
  702. package/dist/commands/seq/seq.d.ts +16 -0
  703. package/dist/commands/sleep/sleep.d.ts +4 -0
  704. package/dist/commands/sort/comparator.d.ts +9 -0
  705. package/dist/commands/sort/parser.d.ts +11 -0
  706. package/dist/commands/sort/sort.d.ts +4 -0
  707. package/dist/commands/sort/types.d.ts +30 -0
  708. package/dist/commands/split/split.d.ts +12 -0
  709. package/dist/commands/sqlite3/formatters.d.ts +15 -0
  710. package/dist/commands/sqlite3/sqlite3.d.ts +22 -0
  711. package/dist/commands/sqlite3/worker.d.ts +45 -0
  712. package/dist/commands/stat/stat.d.ts +4 -0
  713. package/dist/commands/strings/strings.d.ts +12 -0
  714. package/dist/commands/tac/tac.d.ts +11 -0
  715. package/dist/commands/tail/tail.d.ts +4 -0
  716. package/dist/commands/tar/archive.d.ts +135 -0
  717. package/dist/commands/tar/bzip2-compress.d.ts +17 -0
  718. package/dist/commands/tar/tar-options.d.ts +37 -0
  719. package/dist/commands/tar/tar.d.ts +10 -0
  720. package/dist/commands/tee/tee.d.ts +4 -0
  721. package/dist/commands/time/time.d.ts +27 -0
  722. package/dist/commands/timeout/timeout.d.ts +4 -0
  723. package/dist/commands/touch/touch.d.ts +4 -0
  724. package/dist/commands/tr/tr.d.ts +4 -0
  725. package/dist/commands/tree/tree.d.ts +4 -0
  726. package/dist/commands/true/true.d.ts +6 -0
  727. package/dist/commands/uniq/uniq.d.ts +4 -0
  728. package/dist/commands/wc/wc.d.ts +4 -0
  729. package/dist/commands/which/which.d.ts +4 -0
  730. package/dist/commands/whoami/whoami.d.ts +11 -0
  731. package/dist/commands/worker-bridge/bridge-handler.d.ts +71 -0
  732. package/dist/commands/worker-bridge/protocol.d.ts +140 -0
  733. package/dist/commands/worker-bridge/sync-backend.d.ts +81 -0
  734. package/dist/commands/xan/aggregation.d.ts +20 -0
  735. package/dist/commands/xan/column-selection.d.ts +19 -0
  736. package/dist/commands/xan/csv.d.ts +37 -0
  737. package/dist/commands/xan/moonblade-parser.d.ts +80 -0
  738. package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
  739. package/dist/commands/xan/moonblade-tokenizer.d.ts +25 -0
  740. package/dist/commands/xan/subcommands.d.ts +15 -0
  741. package/dist/commands/xan/xan-agg.d.ts +8 -0
  742. package/dist/commands/xan/xan-columns.d.ts +8 -0
  743. package/dist/commands/xan/xan-core.d.ts +10 -0
  744. package/dist/commands/xan/xan-data.d.ts +52 -0
  745. package/dist/commands/xan/xan-filter.d.ts +8 -0
  746. package/dist/commands/xan/xan-map.d.ts +11 -0
  747. package/dist/commands/xan/xan-reshape.d.ts +40 -0
  748. package/dist/commands/xan/xan-simple.d.ts +40 -0
  749. package/dist/commands/xan/xan-view.d.ts +12 -0
  750. package/dist/commands/xan/xan.d.ts +10 -0
  751. package/dist/commands/xargs/xargs.d.ts +4 -0
  752. package/dist/commands/yq/formats.d.ts +64 -0
  753. package/dist/commands/yq/yq.d.ts +13 -0
  754. package/dist/custom-commands.d.ts +42 -0
  755. package/dist/fs/encoding.d.ts +17 -0
  756. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +73 -0
  757. package/dist/fs/in-memory-fs/index.d.ts +1 -0
  758. package/dist/fs/init.d.ts +22 -0
  759. package/dist/fs/interface.d.ts +229 -0
  760. package/dist/fs/mountable-fs/index.d.ts +1 -0
  761. package/dist/fs/mountable-fs/mountable-fs.d.ts +116 -0
  762. package/dist/fs/overlay-fs/index.d.ts +1 -0
  763. package/dist/fs/overlay-fs/overlay-fs.d.ts +163 -0
  764. package/dist/fs/path-utils.d.ts +46 -0
  765. package/dist/fs/read-write-fs/index.d.ts +1 -0
  766. package/dist/fs/read-write-fs/read-write-fs.d.ts +96 -0
  767. package/dist/fs/real-fs-utils.d.ts +90 -0
  768. package/dist/fs/sanitize-error.d.ts +19 -0
  769. package/dist/index.d.cts +27 -0
  770. package/dist/index.d.ts +27 -0
  771. package/dist/interpreter/alias-expansion.d.ts +23 -0
  772. package/dist/interpreter/arithmetic.d.ts +24 -0
  773. package/dist/interpreter/assignment-expansion.d.ts +24 -0
  774. package/dist/interpreter/builtin-dispatch.d.ts +39 -0
  775. package/dist/interpreter/builtins/break.d.ts +6 -0
  776. package/dist/interpreter/builtins/cd.d.ts +6 -0
  777. package/dist/interpreter/builtins/compgen.d.ts +26 -0
  778. package/dist/interpreter/builtins/complete.d.ts +17 -0
  779. package/dist/interpreter/builtins/compopt.d.ts +28 -0
  780. package/dist/interpreter/builtins/continue.d.ts +6 -0
  781. package/dist/interpreter/builtins/declare-array-parsing.d.ts +14 -0
  782. package/dist/interpreter/builtins/declare-print.d.ts +39 -0
  783. package/dist/interpreter/builtins/declare.d.ts +35 -0
  784. package/dist/interpreter/builtins/dirs.d.ts +29 -0
  785. package/dist/interpreter/builtins/eval.d.ts +9 -0
  786. package/dist/interpreter/builtins/exit.d.ts +5 -0
  787. package/dist/interpreter/builtins/export.d.ts +14 -0
  788. package/dist/interpreter/builtins/getopts.d.ts +18 -0
  789. package/dist/interpreter/builtins/hash.d.ts +19 -0
  790. package/dist/interpreter/builtins/help.d.ts +12 -0
  791. package/dist/interpreter/builtins/index.d.ts +45 -0
  792. package/dist/interpreter/builtins/let.d.ts +18 -0
  793. package/dist/interpreter/builtins/local.d.ts +6 -0
  794. package/dist/interpreter/builtins/mapfile.d.ts +17 -0
  795. package/dist/interpreter/builtins/read.d.ts +6 -0
  796. package/dist/interpreter/builtins/return.d.ts +6 -0
  797. package/dist/interpreter/builtins/set.d.ts +9 -0
  798. package/dist/interpreter/builtins/shift.d.ts +15 -0
  799. package/dist/interpreter/builtins/shopt.d.ts +7 -0
  800. package/dist/interpreter/builtins/source.d.ts +6 -0
  801. package/dist/interpreter/builtins/unset.d.ts +16 -0
  802. package/dist/interpreter/builtins/variable-assignment.d.ts +66 -0
  803. package/dist/interpreter/command-resolution.d.ts +43 -0
  804. package/dist/interpreter/conditionals.d.ts +17 -0
  805. package/dist/interpreter/control-flow.d.ts +21 -0
  806. package/dist/interpreter/defense-aware-command-context.d.ts +6 -0
  807. package/dist/interpreter/errors.d.ts +158 -0
  808. package/dist/interpreter/expansion/analysis.d.ts +37 -0
  809. package/dist/interpreter/expansion/arith-text-expansion.d.ts +20 -0
  810. package/dist/interpreter/expansion/array-pattern-ops.d.ts +21 -0
  811. package/dist/interpreter/expansion/array-prefix-suffix.d.ts +46 -0
  812. package/dist/interpreter/expansion/array-slice-transform.d.ts +36 -0
  813. package/dist/interpreter/expansion/array-word-expansion.d.ts +39 -0
  814. package/dist/interpreter/expansion/brace-range.d.ts +20 -0
  815. package/dist/interpreter/expansion/command-substitution.d.ts +23 -0
  816. package/dist/interpreter/expansion/glob-escape.d.ts +32 -0
  817. package/dist/interpreter/expansion/indirect-expansion.d.ts +42 -0
  818. package/dist/interpreter/expansion/parameter-ops.d.ts +113 -0
  819. package/dist/interpreter/expansion/pattern-expansion.d.ts +23 -0
  820. package/dist/interpreter/expansion/pattern-removal.d.ts +18 -0
  821. package/dist/interpreter/expansion/pattern.d.ts +23 -0
  822. package/dist/interpreter/expansion/positional-params.d.ts +59 -0
  823. package/dist/interpreter/expansion/prompt.d.ts +39 -0
  824. package/dist/interpreter/expansion/quoting.d.ts +13 -0
  825. package/dist/interpreter/expansion/tilde.d.ts +12 -0
  826. package/dist/interpreter/expansion/unquoted-expansion.d.ts +76 -0
  827. package/dist/interpreter/expansion/variable-attrs.d.ts +19 -0
  828. package/dist/interpreter/expansion/variable.d.ts +36 -0
  829. package/dist/interpreter/expansion/word-glob-expansion.d.ts +33 -0
  830. package/dist/interpreter/expansion/word-split.d.ts +29 -0
  831. package/dist/interpreter/expansion.d.ts +53 -0
  832. package/dist/interpreter/functions.d.ts +12 -0
  833. package/dist/interpreter/helpers/array.d.ts +43 -0
  834. package/dist/interpreter/helpers/condition.d.ts +22 -0
  835. package/dist/interpreter/helpers/errors.d.ts +8 -0
  836. package/dist/interpreter/helpers/file-tests.d.ts +33 -0
  837. package/dist/interpreter/helpers/ifs.d.ts +104 -0
  838. package/dist/interpreter/helpers/loop.d.ts +24 -0
  839. package/dist/interpreter/helpers/nameref.d.ts +65 -0
  840. package/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
  841. package/dist/interpreter/helpers/quoting.d.ts +24 -0
  842. package/dist/interpreter/helpers/readonly.d.ts +45 -0
  843. package/dist/interpreter/helpers/regex.d.ts +8 -0
  844. package/dist/interpreter/helpers/result.d.ts +60 -0
  845. package/dist/interpreter/helpers/shell-constants.d.ts +25 -0
  846. package/dist/interpreter/helpers/shellopts.d.ts +28 -0
  847. package/dist/interpreter/helpers/statements.d.ts +20 -0
  848. package/dist/interpreter/helpers/string-compare.d.ts +24 -0
  849. package/dist/interpreter/helpers/string-tests.d.ts +13 -0
  850. package/dist/interpreter/helpers/tilde.d.ts +13 -0
  851. package/dist/interpreter/helpers/variable-tests.d.ts +9 -0
  852. package/dist/interpreter/helpers/word-matching.d.ts +26 -0
  853. package/dist/interpreter/helpers/word-parts.d.ts +22 -0
  854. package/dist/interpreter/helpers/xtrace.d.ts +18 -0
  855. package/dist/interpreter/index.d.ts +3 -0
  856. package/dist/interpreter/interpreter.d.ts +77 -0
  857. package/dist/interpreter/pipeline-execution.d.ts +16 -0
  858. package/dist/interpreter/redirections.d.ts +51 -0
  859. package/dist/interpreter/simple-command-assignments.d.ts +29 -0
  860. package/dist/interpreter/subshell-group.d.ts +32 -0
  861. package/dist/interpreter/type-command.d.ts +37 -0
  862. package/dist/interpreter/types.d.ts +344 -0
  863. package/dist/limits.d.ts +52 -0
  864. package/dist/network/allow-list/shared.d.ts +57 -0
  865. package/dist/network/allow-list.d.ts +59 -0
  866. package/dist/network/fetch.d.ts +25 -0
  867. package/dist/network/index.d.ts +7 -0
  868. package/dist/network/types.d.ts +155 -0
  869. package/dist/parser/arithmetic-parser.d.ts +23 -0
  870. package/dist/parser/arithmetic-primaries.d.ts +45 -0
  871. package/dist/parser/command-parser.d.ts +10 -0
  872. package/dist/parser/compound-parser.d.ts +28 -0
  873. package/dist/parser/conditional-parser.d.ts +8 -0
  874. package/dist/parser/expansion-parser.d.ts +16 -0
  875. package/dist/parser/lexer.d.ts +197 -0
  876. package/dist/parser/parser-substitution.d.ts +62 -0
  877. package/dist/parser/parser.d.ts +135 -0
  878. package/dist/parser/types.d.ts +25 -0
  879. package/dist/parser/word-parser.d.ts +33 -0
  880. package/dist/sandbox/Command.d.ts +35 -0
  881. package/dist/sandbox/Sandbox.d.ts +90 -0
  882. package/dist/sandbox/index.d.ts +2 -0
  883. package/dist/shell-metadata.d.ts +25 -0
  884. package/dist/timers.d.ts +4 -0
  885. package/dist/types.d.ts +198 -0
  886. package/dist/utils/args.d.ts +55 -0
  887. package/dist/utils/constants.d.ts +15 -0
  888. package/dist/utils/file-reader.d.ts +67 -0
  889. package/dist/utils/glob.d.ts +25 -0
  890. package/dist/vitest-setup.d.ts +1 -0
  891. package/package.json +127 -0
  892. package/vendor/cpython-emscripten/python.cjs +2 -0
  893. package/vendor/cpython-emscripten/python.wasm +3 -0
  894. package/vendor/cpython-emscripten/python313.zip +0 -0
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import{a as w,b as v,c as $}from"./chunk-GTNBSMZR.js";var R={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"]},C={name:"chmod",async execute(s,a){if(v(s))return w(R);if(s.length<2)return{stdout:"",stderr:`chmod: missing operand
3
+ `,exitCode:1};let e=!1,c=!1,i=0;for(;i<s.length&&s[i].startsWith("-");){let t=s[i];if(t==="-R"||t==="--recursive")e=!0,i++;else if(t==="-v"||t==="--verbose")c=!0,i++;else if(t==="--"){i++;break}else{if(/^[+-]?[rwxugo]+/.test(t)||/^\d+$/.test(t))break;if(/^-[Rv]+$/.test(t)){t.includes("R")&&(e=!0),t.includes("v")&&(c=!0),i++;continue}return $("chmod",t)}}if(s.length-i<2)return{stdout:"",stderr:`chmod: missing operand
4
+ `,exitCode:1};let n=s[i],l=s.slice(i+1),r=/^[0-7]+$/.test(n),o;if(r)o=parseInt(n,8);else try{p(n,420)}catch{return{stdout:"",stderr:`chmod: invalid mode: '${n}'
5
+ `,exitCode:1}}let f="",d="",u=!1;for(let t of l){let h=a.fs.resolvePath(a.cwd,t);try{let m;if(r&&o!==void 0)m=o;else{let g=await a.fs.stat(h);m=p(n,g.mode)}if(await a.fs.chmod(h,m),c&&(f+=`mode of '${t}' changed to ${m.toString(8).padStart(4,"0")}
6
+ `),e&&(await a.fs.stat(h)).isDirectory){let I=await y(a,h,r?o:void 0,r?void 0:n,c);f+=I}}catch{d+=`chmod: cannot access '${t}': No such file or directory
7
+ `,u=!0}}return{stdout:f,stderr:d,exitCode:u?1:0}}};async function y(s,a,e,c,i){let n="",l=await s.fs.readdir(a);for(let r of l){let o=a==="/"?`/${r}`:`${a}/${r}`,f;if(e!==void 0)f=e;else if(c!==void 0){let u=await s.fs.stat(o);f=p(c,u.mode)}else f=420;await s.fs.chmod(o,f),i&&(n+=`mode of '${o}' changed to ${f.toString(8).padStart(4,"0")}
8
+ `),(await s.fs.stat(o)).isDirectory&&(n+=await y(s,o,e,c,i))}return n}function p(s,a=420){if(/^[0-7]+$/.test(s))return parseInt(s,8);let e=a&4095,c=s.split(",");for(let i of c){let n=i.match(/^([ugoa]*)([+\-=])([rwxXst]*)$/);if(!n)throw new Error(`Invalid mode: ${s}`);let l=n[1]||"a",r=n[2],o=n[3];(l==="a"||l==="")&&(l="ugo");let f=0;o.includes("r")&&(f|=4),o.includes("w")&&(f|=2),(o.includes("x")||o.includes("X"))&&(f|=1);let d=0;o.includes("s")&&(l.includes("u")&&(d|=2048),l.includes("g")&&(d|=1024)),o.includes("t")&&(d|=512);for(let u of l){let t=0;u==="u"?t=6:u==="g"?t=3:u==="o"&&(t=0);let h=f<<t;r==="+"?e|=h:r==="-"?e&=~h:r==="="&&(e&=~(7<<t),e|=h)}r==="+"?e|=d:r==="-"?e&=~d:r==="="&&(o.includes("s")&&(l.includes("u")&&(e&=-2049,e|=d&2048),l.includes("g")&&(e&=-1025,e|=d&1024)),o.includes("t")&&(e&=-513,e|=d&512))}return e}var O={name:"chmod",flags:[{flag:"-R",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{C as a,O as b};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{a as s}from"./chunk-OBI37ZY4.js";var a=s("sha1sum","sha1","compute SHA1 message digest"),m={name:"sha1sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import{a as f}from"./chunk-RLNOQILG.js";import{a as d}from"./chunk-JBABAK44.js";import{a as l}from"./chunk-4VDEBYW7.js";var p={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},b={name:"mkdir",async execute(m,t){let e=d("mkdir",m,p);if(!e.ok)return e.error;let u=e.result.flags.recursive,g=e.result.flags.verbose,n=e.result.positional;if(n.length===0)return{stdout:"",stderr:`mkdir: missing operand
3
+ `,exitCode:1};let a="",o="",c=0;for(let r of n)try{let i=t.fs.resolvePath(t.cwd,r);await t.fs.mkdir(i,{recursive:u}),g&&(a+=`mkdir: created directory '${r}'
4
+ `)}catch(i){let s=l(i);s.includes("ENOENT")||s.includes("no such file")?o+=`mkdir: cannot create directory '${r}': No such file or directory
5
+ `:s.includes("EEXIST")||s.includes("already exists")?o+=`mkdir: cannot create directory '${r}': File exists
6
+ `:o+=`mkdir: cannot create directory '${r}': ${f(s)}
7
+ `,c=1}return{stdout:a,stderr:o,exitCode:c}}},h={name:"mkdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{b as a,h as b};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import{a as v}from"./chunk-4PRVMER6.js";import{a as c,b as f,c as m}from"./chunk-GTNBSMZR.js";var g={name:"env",summary:"run a program in a modified environment",usage:"env [OPTION]... [NAME=VALUE]... [COMMAND [ARG]...]",options:["-i, --ignore-environment start with an empty environment","-u NAME, --unset=NAME remove NAME from the environment"," --help display this help and exit"]},w={name:"env",async execute(o,i){if(f(o))return c(g);let a=!1,r=[],u=new Map,t=-1;for(let n=0;n<o.length;n++){let e=o[n];if(e==="-i"||e==="--ignore-environment")a=!0;else if(e==="-u"&&n+1<o.length)r.push(o[++n]);else if(e.startsWith("-u"))r.push(e.slice(2));else if(e.startsWith("--unset="))r.push(e.slice(8));else{if(e.startsWith("--")&&e!=="--")return m("env",e);if(e.startsWith("-")&&e!=="-"){for(let l of e.slice(1))if(l!=="i"&&l!=="u")return m("env",`-${l}`);e.includes("i")&&(a=!0)}else if(e.includes("=")&&t===-1){let l=e.indexOf("="),d=e.slice(0,l),h=e.slice(l+1);u.set(d,h)}else{t=n;break}}}let s;if(a)s=new Map(u);else{s=new Map(i.env);for(let n of r)s.delete(n);for(let[n,e]of u)s.set(n,e)}if(t===-1){let n=[];for(let[e,l]of s)n.push(`${e}=${l}`);return{stdout:n.join(`
3
+ `)+(n.length>0?`
4
+ `:""),stderr:"",exitCode:0}}if(!i.exec)return{stdout:"",stderr:`env: command execution not supported in this context
5
+ `,exitCode:1};let p=o.slice(t);return i.exec("command",{cwd:i.cwd,env:v(s),replaceEnv:!0,stdin:i.stdin,signal:i.signal,args:p})}},x={name:"printenv",summary:"print all or part of environment",usage:"printenv [OPTION]... [VARIABLE]...",options:[" --help display this help and exit"]},E={name:"printenv",async execute(o,i){if(f(o))return c(x);let a=o.filter(t=>!t.startsWith("-"));if(a.length===0){let t=[];for(let[s,p]of i.env)t.push(`${s}=${p}`);return{stdout:t.join(`
6
+ `)+(t.length>0?`
7
+ `:""),stderr:"",exitCode:0}}let r=[],u=0;for(let t of a){let s=i.env.get(t);s!==void 0?r.push(s):u=1}return{stdout:r.join(`
8
+ `)+(r.length>0?`
9
+ `:""),stderr:"",exitCode:u}}},M={name:"env",flags:[{flag:"-i",type:"boolean"},{flag:"-u",type:"value",valueHint:"string"}]},N={name:"printenv",flags:[]};export{w as a,E as b,M as c,N as d};
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import{a as d}from"./chunk-YTIURC67.js";import{a as n,b as i}from"./chunk-OOJCYVYF.js";import{a,b as l}from"./chunk-GTNBSMZR.js";var u={name:"sleep",summary:"delay for a specified amount of time",usage:"sleep NUMBER[SUFFIX]",description:`Pause for NUMBER seconds. SUFFIX may be:
3
+ s - seconds (default)
4
+ m - minutes
5
+ h - hours
6
+ d - days
7
+
8
+ NUMBER may be a decimal number.`,options:[" --help display this help and exit"]},m=36e5,h={name:"sleep",async execute(r,s){if(l(r))return a(u);if(r.length===0)return{stdout:"",stderr:`sleep: missing operand
9
+ `,exitCode:1};let t=0;for(let e of r){let o=d(e);if(o===null)return{stdout:"",stderr:`sleep: invalid time interval '${e}'
10
+ `,exitCode:1};t+=o}return t>m&&(t=m),s.signal?.aborted?{stdout:"",stderr:"",exitCode:0}:(s.sleep?await s.sleep(t):s.signal?await new Promise(e=>{let o=()=>{i(p),e()},p=n(()=>{s.signal?.removeEventListener("abort",o),e()},t);s.signal?.addEventListener("abort",o,{once:!0})}):await new Promise(e=>n(e,t)),{stdout:"",stderr:"",exitCode:0})}},b={name:"sleep",flags:[],needsArgs:!0};export{h as a,b};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import{a as p}from"./chunk-RLNOQILG.js";import{a as m,b as g,c as h}from"./chunk-GTNBSMZR.js";var y={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"]},v={name:"ln",async execute(n,s){if(g(n))return m(y);let r=!1,a=!1,f=!1,t=0;for(;t<n.length&&n[t].startsWith("-");){let e=n[t];if(e==="-s"||e==="--symbolic")r=!0,t++;else if(e==="-f"||e==="--force")a=!0,t++;else if(e==="-v"||e==="--verbose")f=!0,t++;else if(e==="-n"||e==="--no-dereference")t++;else if(/^-[sfvn]+$/.test(e))e.includes("s")&&(r=!0),e.includes("f")&&(a=!0),e.includes("v")&&(f=!0),t++;else if(e==="--"){t++;break}else return h("ln",e)}let d=n.slice(t);if(d.length<2)return{stdout:"",stderr:`ln: missing file operand
3
+ `,exitCode:1};let i=d[0],l=d[1],o=s.fs.resolvePath(s.cwd,l);if(await s.fs.exists(o))if(a)try{await s.fs.rm(o,{force:!0})}catch{return{stdout:"",stderr:`ln: cannot remove '${l}': Permission denied
4
+ `,exitCode:1}}else return{stdout:"",stderr:`ln: failed to create ${r?"symbolic ":""}link '${l}': File exists
5
+ `,exitCode:1};try{if(r)await s.fs.symlink(i,o);else{let e=s.fs.resolvePath(s.cwd,i);if(!await s.fs.exists(e))return{stdout:"",stderr:`ln: failed to access '${i}': No such file or directory
6
+ `,exitCode:1};await s.fs.link(e,o)}}catch(e){let u=e;return u.message.includes("EPERM")?{stdout:"",stderr:`ln: '${i}': hard link not allowed for directory
7
+ `,exitCode:1}:{stdout:"",stderr:`ln: ${p(u.message)}
8
+ `,exitCode:1}}let c="";return f&&(c=`'${l}' -> '${i}'
9
+ `),{stdout:c,stderr:"",exitCode:0}}},$={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{v as a,$ as b};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import{a}from"./chunk-JDNI5HBX.js";import{a as d}from"./chunk-RLNOQILG.js";var S={name:"expr",async execute(s,r){if(s.length===0)return{stdout:"",stderr:`expr: missing operand
3
+ `,exitCode:2};try{let c=x(s),h=c==="0"||c===""?1:0;return{stdout:`${c}
4
+ `,stderr:"",exitCode:h}}catch(c){return{stdout:"",stderr:`expr: ${d(c.message)}
5
+ `,exitCode:2}}}};function x(s){if(s.length===1)return s[0];let r=0;function c(){let e=h();for(;r<s.length&&s[r]==="|";){r++;let t=h();if(e!=="0"&&e!=="")return e;e=t}return e}function h(){let e=m();for(;r<s.length&&s[r]==="&";){r++;let t=m();(e==="0"||e===""||t==="0"||t==="")&&(e="0")}return e}function m(){let e=g();for(;r<s.length;){let t=s[r];if(["=","!=","<",">","<=",">="].includes(t)){r++;let o=g(),n=parseInt(e,10),i=parseInt(o,10),f=!Number.isNaN(n)&&!Number.isNaN(i),l;t==="="?l=f?n===i:e===o:t==="!="?l=f?n!==i:e!==o:t==="<"?l=f?n<i:e<o:t===">"?l=f?n>i:e>o:t==="<="?l=f?n<=i:e<=o:l=f?n>=i:e>=o,e=l?"1":"0"}else break}return e}function g(){let e=p();for(;r<s.length;){let t=s[r];if(t==="+"||t==="-"){r++;let o=p(),n=parseInt(e,10),i=parseInt(o,10);if(Number.isNaN(n)||Number.isNaN(i))throw new Error("non-integer argument");e=String(t==="+"?n+i:n-i)}else break}return e}function p(){let e=N();for(;r<s.length;){let t=s[r];if(t==="*"||t==="/"||t==="%"){r++;let o=N(),n=parseInt(e,10),i=parseInt(o,10);if(Number.isNaN(n)||Number.isNaN(i))throw new Error("non-integer argument");if((t==="/"||t==="%")&&i===0)throw new Error("division by zero");t==="*"?e=String(n*i):t==="/"?e=String(Math.trunc(n/i)):e=String(n%i)}else break}return e}function N(){let e=u();for(;r<s.length&&s[r]===":";){r++;let t=u(),n=a(`^${t}`).match(e);n?e=n[1]!==void 0?n[1]:String(n[0].length):e="0"}return e}function u(){if(r>=s.length)throw new Error("syntax error");let e=s[r];if(e==="match"){r++;let t=u(),o=u(),i=a(o).match(t);return i?i[1]!==void 0?i[1]:String(i[0].length):"0"}if(e==="substr"){r++;let t=u(),o=parseInt(u(),10),n=parseInt(u(),10);if(Number.isNaN(o)||Number.isNaN(n))throw new Error("non-integer argument");return t.substring(o-1,o-1+n)}if(e==="index"){r++;let t=u(),o=u();for(let n=0;n<t.length;n++)if(o.includes(t[n]))return String(n+1);return"0"}if(e==="length"){r++;let t=u();return String(t.length)}if(e==="("){r++;let t=c();if(r>=s.length||s[r]!==")")throw new Error("syntax error");return r++,t}return r++,e}return c()}var E={name:"expr",flags:[],needsArgs:!0};export{S as a,E as b};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ async function t(e,n){return{stdout:`localhost
3
+ `,stderr:"",exitCode:0}}var o={name:"hostname",execute:t},s={name:"hostname",flags:[]};export{o as a,s as b};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import{b as g}from"./chunk-5WFYIUU2.js";import{a as d}from"./chunk-JBABAK44.js";import{a as p,b as f}from"./chunk-GTNBSMZR.js";var O={name:"uniq",summary:"report or omit repeated lines",usage:"uniq [OPTION]... [INPUT [OUTPUT]]",options:["-c, --count prefix lines by the number of occurrences","-d, --repeated only print duplicate lines","-i, --ignore-case ignore case when comparing","-u, --unique only print unique lines"," --help display this help and exit"]},w={count:{short:"c",long:"count",type:"boolean"},duplicatesOnly:{short:"d",long:"repeated",type:"boolean"},uniqueOnly:{short:"u",long:"unique",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},N={name:"uniq",async execute(c,y){if(f(c))return p(O);let o=d("uniq",c,w);if(!o.ok)return o.error;let{count:m,duplicatesOnly:h,uniqueOnly:q,ignoreCase:b}=o.result.flags,C=o.result.positional,l=await g(y,C,{cmdName:"uniq"});if(!l.ok)return l.error;let n=l.content.split(`
3
+ `);if(n.length>0&&n[n.length-1]===""&&n.pop(),n.length===0)return{stdout:"",stderr:"",exitCode:0};let t=[],r=n[0],i=1,x=(e,s)=>b?e.toLowerCase()===s.toLowerCase():e===s;for(let e=1;e<n.length;e++)x(n[e],r)?i++:(t.push({line:r,count:i}),r=n[e],i=1);t.push({line:r,count:i});let u=t;h?u=t.filter(e=>e.count>1):q&&(u=t.filter(e=>e.count===1));let a="";for(let{line:e,count:s}of u)m?a+=`${String(s).padStart(4)} ${e}
4
+ `:a+=`${e}
5
+ `;return{stdout:a,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},P={name:"uniq",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{N as a,P as b};
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import{a as q,b as w}from"./chunk-OOJCYVYF.js";import{c as b}from"./chunk-MO4RPBN2.js";import{b as j}from"./chunk-YU6OGPZR.js";import{a as E,b as g}from"./chunk-RLNOQILG.js";import{a as C,b as M}from"./chunk-GTNBSMZR.js";import{randomBytes as z}from"node:crypto";import{existsSync as T}from"node:fs";import{dirname as X,join as x}from"node:path";import{fileURLToPath as Y}from"node:url";import{Worker as G}from"node:worker_threads";import K from"sql.js";function A(e,t,r){switch(r.mode){case"list":return O(e,t,r);case"csv":return P(e,t,r);case"json":return N(e,t);case"line":return R(e,t,r);case"column":return F(e,t,r);case"table":return Q(e,t,r);case"markdown":return U(e,t,r);case"tabs":return W(e,t,r);case"box":return D(e,t,r);case"quote":return H(e,t,r);case"html":return J(e,t,r);case"ascii":return _(e,t,r)}}function f(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function O(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function P(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(L).join(","));for(let a of t)n.push(a.map(o=>L(f(o,r.nullValue))).join(","));return n.length>0?`${n.join(`
3
+ `)}
4
+ `:""}function L(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(`
5
+ `)?`"${e.replace(/"/g,'""')}"`:e}function B(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function I(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):B(e):JSON.stringify(e)}function N(e,t){return t.length===0?"":`[${t.map(n=>`{${e.map((o,i)=>`${JSON.stringify(o)}:${I(n[i])}`).join(",")}}`).join(`,
6
+ `)}]
7
+ `}function R(e,t,r){if(e.length===0||t.length===0)return"";let n=Math.max(5,...e.map(o=>o.length)),a=[];for(let o of t)for(let i=0;i<e.length;i++){let s=e[i].padStart(n);a.push(`${s} = ${f(o[i],r.nullValue)}`)}return`${a.join(`
8
+ `)}
9
+ `}function F(e,t,r){if(e.length===0)return"";let n=e.map(o=>o.length);for(let o of t)for(let i=0;i<o.length;i++){let s=f(o[i],r.nullValue).length;s>n[i]&&(n[i]=s)}let a=[];r.header&&(a.push(e.map((o,i)=>o.padEnd(n[i])).join(" ")),a.push(n.map(o=>"-".repeat(o)).join(" ")));for(let o of t)a.push(o.map((i,s)=>f(i,r.nullValue).padEnd(n[s])).join(" "));return a.length>0?`${a.join(`
10
+ `)}
11
+ `:""}function Q(e,t,r){if(e.length===0)return"";let n=e.map(i=>i.length);for(let i of t)for(let s=0;s<i.length;s++){let m=f(i[s],r.nullValue).length;m>n[s]&&(n[s]=m)}let a=[],o=`+${n.map(i=>"-".repeat(i+2)).join("+")}+`;a.push(o),r.header&&(a.push(`| ${e.map((i,s)=>i.padEnd(n[s])).join(" | ")} |`),a.push(o));for(let i of t)a.push(`| ${i.map((s,m)=>f(s,r.nullValue).padEnd(n[m])).join(" | ")} |`);return a.push(o),`${a.join(`
12
+ `)}
13
+ `}function U(e,t,r){if(e.length===0)return"";let n=[];r.header&&(n.push(`| ${e.join(" | ")} |`),n.push(`|${e.map(()=>"---").join("|")}|`));for(let a of t)n.push(`| ${a.map(o=>f(o,r.nullValue)).join(" | ")} |`);return n.length>0?`${n.join(`
14
+ `)}
15
+ `:""}function W(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(" "));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(" "));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function D(e,t,r){if(e.length===0)return"";let n=e.map(o=>o.length);for(let o of t)for(let i=0;i<o.length;i++){let s=f(o[i],r.nullValue).length;s>n[i]&&(n[i]=s)}let a=[];a.push(`\u250C${n.map(o=>"\u2500".repeat(o+2)).join("\u252C")}\u2510`),a.push(`\u2502 ${e.map((o,i)=>o.padEnd(n[i])).join(" \u2502 ")} \u2502`),a.push(`\u251C${n.map(o=>"\u2500".repeat(o+2)).join("\u253C")}\u2524`);for(let o of t)a.push(`\u2502 ${o.map((i,s)=>f(i,r.nullValue).padEnd(n[s])).join(" \u2502 ")} \u2502`);return a.push(`\u2514${n.map(o=>"\u2500".repeat(o+2)).join("\u2534")}\u2518`),`${a.join(`
16
+ `)}
17
+ `}function H(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(a=>`'${a}'`).join(","));for(let a of t)n.push(a.map(o=>o==null?"NULL":typeof o=="number"?Number.isInteger(o)?String(o):B(o):`'${String(o)}'`).join(","));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function J(e,t,r){let n=[];r.header&&e.length>0&&(n.push(`<TR>${e.map(a=>`<TH>${V(a)}</TH>`).join("")}`),n.push("</TR>"));for(let a of t)n.push(`<TR>${a.map(o=>`<TD>${V(f(o,r.nullValue))}</TD>`).join("")}`),n.push("</TR>");return n.length>0?`${n.join(`
18
+ `)}
19
+ `:""}function V(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function _(e,t,r){let o=[];r.header&&e.length>0&&o.push(e.join(""));for(let i of t)o.push(i.map(s=>f(s,r.nullValue)).join(""));return o.length>0?o.join("")+"":""}var Z=5e3,v={name:"sqlite3",summary:"SQLite database CLI",usage:"sqlite3 [OPTIONS] DATABASE [SQL]",options:["-list output in list mode (default)","-csv output in CSV mode","-json output in JSON mode","-line output in line mode","-column output in column mode","-table output as ASCII table","-markdown output as markdown table","-tabs output in tab-separated mode","-box output in Unicode box mode","-quote output in SQL quote mode","-html output as HTML table","-ascii output in ASCII mode (control chars)","-header show column headers","-noheader hide column headers","-separator SEP field separator for list mode (default: |)","-newline SEP row separator (default: \\n)","-nullvalue TEXT text for NULL values (default: empty)","-readonly open database read-only (no writeback)","-bail stop on first error","-echo print SQL before execution","-cmd COMMAND run SQL command before main SQL","-version show SQLite version","-- end of options","--help show this help"],examples:['sqlite3 :memory: "CREATE TABLE t(x); INSERT INTO t VALUES(1); SELECT * FROM t"','sqlite3 -json data.db "SELECT * FROM users"','sqlite3 -csv -header data.db "SELECT id, name FROM products"','sqlite3 -box data.db "SELECT * FROM users"']};function ee(e){let t={mode:"list",header:!1,separator:"|",newline:`
20
+ `,nullValue:"",readonly:!1,bail:!1,echo:!1,cmd:null},r=null,n=null,a=!1,o=!1;for(let i=0;i<e.length;i++){let s=e[i];if(o){r===null?r=s:n===null&&(n=s);continue}if(s==="--")o=!0;else if(s==="-version")a=!0;else if(s==="-list")t.mode="list";else if(s==="-csv")t.mode="csv";else if(s==="-json")t.mode="json";else if(s==="-line")t.mode="line";else if(s==="-column")t.mode="column";else if(s==="-table")t.mode="table";else if(s==="-markdown")t.mode="markdown";else if(s==="-tabs")t.mode="tabs";else if(s==="-box")t.mode="box";else if(s==="-quote")t.mode="quote";else if(s==="-html")t.mode="html";else if(s==="-ascii")t.mode="ascii";else if(s==="-header")t.header=!0;else if(s==="-noheader")t.header=!1;else if(s==="-readonly")t.readonly=!0;else if(s==="-bail")t.bail=!0;else if(s==="-echo")t.echo=!0;else if(s==="-separator"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -separator
21
+ `,exitCode:1};t.separator=e[++i]}else if(s==="-newline"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -newline
22
+ `,exitCode:1};t.newline=e[++i]}else if(s==="-nullvalue"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -nullvalue
23
+ `,exitCode:1};t.nullValue=e[++i]}else if(s==="-cmd"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -cmd
24
+ `,exitCode:1};t.cmd=e[++i]}else{if(s.startsWith("-"))return{stdout:"",stderr:`sqlite3: Error: unknown option: ${s.startsWith("--")?s.slice(1):s}
25
+ Use -help for a list of options.
26
+ `,exitCode:1};r===null?r=s:n===null&&(n=s)}}return{options:t,database:r,sql:n,showVersion:a}}async function re(){let e=await j.runTrustedAsync(()=>K()),t=new e.Database;try{let r=t.exec("SELECT sqlite_version()");return r.length>0&&r[0].values.length>0?String(r[0].values[0][0]):"unknown"}finally{t.close()}}function te(){let e=X(Y(import.meta.url)),t=x(e,"../../commands/sqlite3/worker.js");if(T(t))return t;let r=x(e,"worker.js");if(T(r))return r;let n=x(e,"../../../dist/commands/sqlite3/worker.js");if(T(n))return n;throw new Error("sqlite3 worker not found. Run 'pnpm build' to compile the worker.")}var ne={createWorker(e,t){return new G(e,{workerData:t})}};function oe(){return z(16).toString("hex")}function se(e,t){if(!e||typeof e!="object")return{success:!1,error:"Malformed worker response"};let r=e;return typeof r.protocolToken!="string"||r.protocolToken!==t?{success:!1,error:"Malformed worker response: invalid protocol token"}:r.type==="security-violation"?{success:!1,error:`Security violation: ${typeof r.violation?.type=="string"?r.violation.type:"unknown"}`}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?Array.isArray(r.results)?typeof r.hasModifications!="boolean"?{success:!1,error:"Malformed worker response: missing hasModifications flag"}:r.dbBuffer!==null&&r.dbBuffer!==void 0&&!(r.dbBuffer instanceof Uint8Array)?{success:!1,error:"Malformed worker response: invalid dbBuffer"}:{success:!0,results:r.results,hasModifications:r.hasModifications,dbBuffer:r.dbBuffer===void 0?null:r.dbBuffer,defenseStats:r.defenseStats}:{success:!1,error:"Malformed worker response: missing results array"}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}async function ie(e,t,r){try{let n=te();return await new Promise((a,o)=>{let i=j.runTrusted(()=>ne.createWorker(n,e)),s=b(r,"sqlite3","worker timeout callback",()=>{i.terminate(),a({success:!1,error:`Query timeout: execution exceeded ${t}ms limit`})}),c=q(()=>{try{s()}catch(u){let l=u instanceof Error?u.message:String(u);a({success:!1,error:g(l)})}},t),S=b(r,"sqlite3","worker message callback",u=>{w(c),a(se(u,e.protocolToken))}),$=b(r,"sqlite3","worker error callback",u=>{w(c),o(u)}),y=b(r,"sqlite3","worker exit callback",u=>{w(c),u!==0&&a({success:!1,error:`Worker exited with code ${u}`})}),p=u=>{try{S(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);a({success:!1,error:g(d)})}},k=u=>{try{$(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);o(new Error(g(d)))}},h=u=>{try{y(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);a({success:!1,error:g(d)})}};i.on("message",p),i.on("error",k),i.on("exit",h)})}catch(n){let a=g(n.message);throw new Error(`sqlite3 worker failed to load: ${a}`)}}var $e={name:"sqlite3",async execute(e,t){if(M(e)||e.includes("-help"))return C(v);let r=ee(e);if("exitCode"in r)return r;let{options:n,database:a,sql:o,showVersion:i}=r;if(i)return{stdout:`${await re()}
27
+ `,stderr:"",exitCode:0};if(!a)return{stdout:"",stderr:`sqlite3: missing database argument
28
+ `,exitCode:1};let s=o||t.stdin.trim();if(n.cmd&&(s=n.cmd+(s?`; ${s}`:"")),!s)return{stdout:"",stderr:`sqlite3: no SQL provided
29
+ `,exitCode:1};let m=a===":memory:",c="",S=null;try{m||(c=t.fs.resolvePath(t.cwd,a),await t.fs.exists(c)&&(S=await t.fs.readFileBuffer(c)))}catch(l){let d=E(l.message);return{stdout:"",stderr:`sqlite3: unable to open database "${a}": ${d}
30
+ `,exitCode:1}}let $=t.limits?.maxSqliteTimeoutMs??Z,y={protocolToken:oe(),dbBuffer:S,sql:s,options:{bail:n.bail,echo:n.echo}},p;try{p=await ie(y,$,t.requireDefenseContext)}catch(l){return{stdout:"",stderr:`sqlite3: worker error: ${g(l.message)}
31
+ `,exitCode:1}}if(!p.success)return{stdout:"",stderr:`sqlite3: ${g(p.error)}
32
+ `,exitCode:1};let k={mode:n.mode,header:n.header,separator:n.separator,newline:n.newline,nullValue:n.nullValue},h="";n.echo&&(h+=`${s}
33
+ `);let u=!1;for(let l of p.results)if(l.type==="error"){if(n.bail)return{stdout:h,stderr:`Error: ${l.error}
34
+ `,exitCode:1};h+=`Error: ${l.error}
35
+ `,u=!0}else l.columns&&l.rows&&(l.rows.length>0||n.header)&&(h+=A(l.columns,l.rows,k));if(p.hasModifications&&!n.readonly&&!m&&c&&p.dbBuffer)try{await t.fs.writeFile(c,p.dbBuffer)}catch(l){let d=E(l.message);return{stdout:h,stderr:`sqlite3: failed to write database: ${d}
36
+ `,exitCode:1}}return{stdout:h,stderr:"",exitCode:u&&n.bail?1:0}}},ye={name:"sqlite3",flags:[],needsArgs:!0};export{ne as a,$e as b,ye as c};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import{a as L}from"./chunk-4OALHZXB.js";import{a as A,b as v,c as b}from"./chunk-GTNBSMZR.js";var $={name:"xargs",summary:"build and execute command lines from standard input",usage:"xargs [OPTION]... [COMMAND [INITIAL-ARGS]]",options:["-I REPLACE replace occurrences of REPLACE with input","-d DELIM use DELIM as input delimiter (e.g., -d '\\n' for newline)","-n NUM use at most NUM arguments per command line","-P NUM run at most NUM processes at a time","-0, --null items are separated by null, not whitespace","-t, --verbose print commands before executing","-r, --no-run-if-empty do not run command if input is empty"," --help display this help and exit"]},P={name:"xargs",async execute(l,r){if(v(l))return A($);let m=null,g=null,c=null,o=null,h=!1,x=!1,y=!1,s=0;for(let e=0;e<l.length;e++){let t=l[e];if(t==="-I"&&e+1<l.length)m=l[++e],s=e+1;else if(t==="-d"&&e+1<l.length)g=l[++e].replace(/\\n/g,`
3
+ `).replace(/\\t/g," ").replace(/\\r/g,"\r").replace(/\\0/g,"\0").replace(/\\\\/g,"\\"),s=e+1;else if(t==="-n"&&e+1<l.length)c=parseInt(l[++e],10),s=e+1;else if(t==="-P"&&e+1<l.length)o=parseInt(l[++e],10),s=e+1;else if(t==="-0"||t==="--null")h=!0,s=e+1;else if(t==="-t"||t==="--verbose")x=!0,s=e+1;else if(t==="-r"||t==="--no-run-if-empty")y=!0,s=e+1;else{if(t.startsWith("--"))return b("xargs",t);if(t.startsWith("-")&&t.length>1){for(let n of t.slice(1))if(!"0tr".includes(n))return b("xargs",`-${n}`);t.includes("0")&&(h=!0),t.includes("t")&&(x=!0),t.includes("r")&&(y=!0),s=e+1}else if(!t.startsWith("-")){s=e;break}}}let a=l.slice(s);a.length===0&&a.push("echo");let i;if(h?i=r.stdin.split("\0").filter(e=>e.length>0):g!==null?i=r.stdin.replace(/\n$/,"").split(g).filter(t=>t.length>0):i=r.stdin.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),i.length===0)return y?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0};let d="",u="",f=0,w=e=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(e)?`"${e.replace(/([\\"`$])/g,"\\$1")}"`:e,C=async e=>{if(x){let n=e.map(w).join(" ");u+=`${n}
4
+ `}return r.exec?r.exec(L([e[0]]),{cwd:r.cwd,signal:r.signal,args:e.slice(1)}):{stdout:`${e.map(w).join(" ")}
5
+ `,stderr:"",exitCode:0}},I=async e=>{if(o!==null&&o>1)for(let t=0;t<e.length;t+=o){let n=e.slice(t,t+o),M=await Promise.all(n.map(C));for(let p of M)d+=p.stdout,u+=p.stderr,p.exitCode!==0&&(f=p.exitCode)}else for(let t of e){let n=await C(t);d+=n.stdout,u+=n.stderr,n.exitCode!==0&&(f=n.exitCode)}};if(m!==null){let e=i.map(t=>a.map(n=>n.replaceAll(m,t)));await I(e)}else if(c!==null){let e=[];for(let t=0;t<i.length;t+=c){let n=i.slice(t,t+c);e.push([...a,...n])}await I(e)}else{let e=[...a,...i],t=await C(e);d+=t.stdout,u+=t.stderr,f=t.exitCode}return{stdout:d,stderr:u,exitCode:f}}},H={name:"xargs",flags:[{flag:"-I",type:"value",valueHint:"string"},{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-n",type:"value",valueHint:"number"},{flag:"-0",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-r",type:"boolean"}],stdinType:"text"};export{P as a,H as b};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ function i(t,l,e){let c=t;e>=0&&c.length>e&&(c=c.slice(0,e));let n=Math.abs(l);return n>c.length&&(l<0?c=c.padEnd(n," "):c=c.padStart(n," ")),c}function h(t,l){let e=l,c=0,n=-1,a=!1;for(e<t.length&&t[e]==="-"&&(a=!0,e++);e<t.length&&/\d/.test(t[e]);)c=c*10+parseInt(t[e],10),e++;if(e<t.length&&t[e]===".")for(e++,n=0;e<t.length&&/\d/.test(t[e]);)n=n*10+parseInt(t[e],10),e++;return a&&c>0&&(c=-c),[c,n,e-l]}function r(t){let l="",e=0;for(;e<t.length;)if(t[e]==="\\"&&e+1<t.length)switch(t[e+1]){case"n":l+=`
3
+ `,e+=2;break;case"t":l+=" ",e+=2;break;case"r":l+="\r",e+=2;break;case"\\":l+="\\",e+=2;break;case"a":l+="\x07",e+=2;break;case"b":l+="\b",e+=2;break;case"f":l+="\f",e+=2;break;case"v":l+="\v",e+=2;break;case"e":case"E":l+="\x1B",e+=2;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{let n="",a=e+1;for(;a<t.length&&a<e+4&&/[0-7]/.test(t[a]);)n+=t[a],a++;l+=String.fromCharCode(parseInt(n,8)),e=a;break}case"x":{let n=[],a=e;for(;a+3<t.length&&t[a]==="\\"&&t[a+1]==="x"&&/[0-9a-fA-F]{2}/.test(t.slice(a+2,a+4));)n.push(parseInt(t.slice(a+2,a+4),16)),a+=4;if(n.length>0){try{let s=new TextDecoder("utf-8",{fatal:!0});l+=s.decode(new Uint8Array(n))}catch{for(let s of n)l+=String.fromCharCode(s)}e=a}else l+=t[e],e++;break}case"u":{let n="",a=e+2;for(;a<t.length&&a<e+6&&/[0-9a-fA-F]/.test(t[a]);)n+=t[a],a++;n?(l+=String.fromCodePoint(parseInt(n,16)),e=a):(l+="\\u",e+=2);break}case"U":{let n="",a=e+2;for(;a<t.length&&a<e+10&&/[0-9a-fA-F]/.test(t[a]);)n+=t[a],a++;n?(l+=String.fromCodePoint(parseInt(n,16)),e=a):(l+="\\U",e+=2);break}default:l+=t[e],e++}else l+=t[e],e++;return l}export{i as a,h as b,r as c};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import{a as x}from"./chunk-YTIURC67.js";import{a as O}from"./chunk-4OALHZXB.js";import{a as c,b as p}from"./chunk-OOJCYVYF.js";import{a as h,b as A,c as u}from"./chunk-GTNBSMZR.js";var v={name:"timeout",summary:"run a command with a time limit",usage:"timeout [OPTION] DURATION COMMAND [ARG]...",description:`Start COMMAND, and kill it if still running after DURATION.
3
+
4
+ DURATION is a number with optional suffix:
5
+ s - seconds (default)
6
+ m - minutes
7
+ h - hours
8
+ d - days`,options:["-k, --kill-after=DURATION send KILL signal after DURATION if still running","-s, --signal=SIGNAL specify signal to send (default: TERM)"," --preserve-status exit with same status as COMMAND, even on timeout"," --foreground run command in foreground"," --help display this help and exit"]},N={name:"timeout",async execute(s,r){if(A(s))return h(v);let i=0;for(let e=0;e<s.length;e++){let t=s[e];if(t==="--preserve-status")i=e+1;else if(t==="--foreground")i=e+1;else if(t==="-k"||t==="--kill-after")e++,i=e+1;else if(t.startsWith("--kill-after="))i=e+1;else if(t==="-s"||t==="--signal")e++,i=e+1;else if(t.startsWith("--signal="))i=e+1;else{if(t.startsWith("--")&&t!=="--")return u("timeout",t);if(t.startsWith("-")&&t.length>1&&t!=="--")if(t.startsWith("-k"))i=e+1;else if(t.startsWith("-s"))i=e+1;else return u("timeout",t);else{i=e;break}}}let n=s.slice(i);if(n.length===0)return{stdout:"",stderr:`timeout: missing operand
9
+ `,exitCode:1};let m=n[0],d=x(m);if(d===null)return{stdout:"",stderr:`timeout: invalid time interval '${m}'
10
+ `,exitCode:1};let o=n.slice(1);if(o.length===0)return{stdout:"",stderr:`timeout: missing operand
11
+ `,exitCode:1};if(!r.exec)return{stdout:"",stderr:`timeout: exec not available
12
+ `,exitCode:1};let f=new AbortController,a;try{let e=new Promise(l=>{a=c(()=>{f.abort(),l({timedOut:!0})},d)}),t=r.exec(O([o[0]]),{cwd:r.cwd,signal:f.signal,stdin:r.stdin,args:o.slice(1)}).then(l=>({timedOut:!1,result:l})),g=await Promise.race([e,t]);return g.timedOut?{stdout:"",stderr:"",exitCode:124}:g.result}finally{a!==void 0&&p(a)}}},D={name:"timeout",flags:[{flag:"-k",type:"value",valueHint:"string"},{flag:"-s",type:"value",valueHint:"string"},{flag:"--preserve-status",type:"boolean"},{flag:"--foreground",type:"boolean"}],needsArgs:!0,minArgs:2};export{N as a,D as b};
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import{a as S,b as A}from"./chunk-IO2FYBEM.js";import{d as O}from"./chunk-V7ZOPVQS.js";import{a as M,b as R}from"./chunk-MO4RPBN2.js";import{a as D}from"./chunk-YU6OGPZR.js";import{a as L}from"./chunk-5WFYIUU2.js";import{k as C}from"./chunk-6KZRLMG3.js";import{a as N}from"./chunk-RLNOQILG.js";import{a as F,b as z,c as E}from"./chunk-GTNBSMZR.js";function V(t){let o=[],s=0,a=t.length;for(;s<a;){for(;s<a&&/\s/.test(t[s]);)s++;if(s>=a)break;let u=s,i=t[s];if(i==="{"||i==="["){let l=i,f=i==="{"?"}":"]",c=1,p=!1,g=!1;for(s++;s<a&&c>0;){let h=t[s];g?g=!1:h==="\\"?g=!0:h==='"'?p=!p:p||(h===l?c++:h===f&&c--),s++}if(c!==0)throw new Error(`Unexpected end of JSON input at position ${s} (unclosed ${l})`);o.push(O(JSON.parse(t.slice(u,s))))}else if(i==='"'){let l=!1;for(s++;s<a;){let f=t[s];if(l)l=!1;else if(f==="\\")l=!0;else if(f==='"'){s++;break}s++}o.push(O(JSON.parse(t.slice(u,s))))}else if(i==="-"||i>="0"&&i<="9"){for(;s<a&&/[\d.eE+-]/.test(t[s]);)s++;o.push(O(JSON.parse(t.slice(u,s))))}else if(t.slice(s,s+4)==="true")o.push(!0),s+=4;else if(t.slice(s,s+5)==="false")o.push(!1),s+=5;else if(t.slice(s,s+4)==="null")o.push(null),s+=4;else{let l=t.slice(s,s+10);throw new Error(`Invalid JSON at position ${u}: unexpected '${l.split(/\s/)[0]}'`)}}return o}var B={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE]",options:["-R, --raw-input read input as raw strings, not JSON","-r, --raw-output output strings without quotes","-c, --compact compact output (no pretty printing)","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --arg name value bind $name to string value"," --tab use tabs for indentation"," --help display this help and exit"]};function x(t,o,s,a,u,i=0){if(t===null||t===void 0)return"null";if(typeof t=="boolean")return String(t);if(typeof t=="number")return Number.isFinite(t)?String(t):"null";if(typeof t=="string")return s?t:JSON.stringify(t);let l=u?" ":" ";if(Array.isArray(t))return t.length===0?"[]":o?`[${t.map(c=>x(c,!0,!1,a,u)).join(",")}]`:`[
3
+ ${t.map(c=>l.repeat(i+1)+x(c,!1,!1,a,u,i+1)).join(`,
4
+ `)}
5
+ ${l.repeat(i)}]`;if(typeof t=="object"){let f=Object.keys(t);return a&&(f=f.sort()),f.length===0?"{}":o?`{${f.map(p=>`${JSON.stringify(p)}:${x(t[p],!0,!1,a,u)}`).join(",")}}`:`{
6
+ ${f.map(p=>{let g=x(t[p],!1,!1,a,u,i+1);return`${l.repeat(i+1)}${JSON.stringify(p)}: ${g}`}).join(`,
7
+ `)}
8
+ ${l.repeat(i)}}`}return String(t)}var K={name:"jq",async execute(t,o){M(o.requireDefenseContext,"jq","execution entry");let s=(n,e)=>R(o.requireDefenseContext,"jq",n,e);if(z(t))return F(B);let a=!1,u=!1,i=!1,l=!1,f=!1,c=!1,p=!1,g=!1,h=!1,J=new Map,I=".",k=!1,j=[];for(let n=0;n<t.length;n++){let e=t[n];if(e==="-R"||e==="--raw-input")u=!0;else if(e==="-r"||e==="--raw-output")a=!0;else if(e==="-c"||e==="--compact-output")i=!0;else if(e==="-e"||e==="--exit-status")l=!0;else if(e==="-s"||e==="--slurp")f=!0;else if(e==="-n"||e==="--null-input")c=!0;else if(e==="-j"||e==="--join-output")p=!0;else if(!(e==="-a"||e==="--ascii")){if(e==="-S"||e==="--sort-keys")g=!0;else if(!(e==="-C"||e==="--color")){if(!(e==="-M"||e==="--monochrome"))if(e==="--tab")h=!0;else if(e==="--arg"){let r=t[n+1],$=t[n+2];if(r===void 0||$===void 0)return{stdout:"",stderr:`jq: --arg requires two arguments
9
+ `,exitCode:2};J.set(`$${r}`,$),n+=2}else if(e==="-")j.push("-");else{if(e.startsWith("--"))return E("jq",e);if(e.startsWith("-")){for(let r of e.slice(1))if(r==="R")u=!0;else if(r==="r")a=!0;else if(r==="c")i=!0;else if(r==="e")l=!0;else if(r==="s")f=!0;else if(r==="n")c=!0;else if(r==="j")p=!0;else if(r!=="a"){if(r==="S")g=!0;else if(r!=="C"){if(r!=="M")return E("jq",`-${r}`)}}}else k?j.push(e):(I=e,k=!0)}}}}let y=[];if(!c)if(j.length===0||j.length===1&&j[0]==="-")y.push({source:"stdin",content:o.stdin});else{let n=await s("file read",()=>L(o,j,{cmdName:"jq",stopOnError:!0}));if(n.exitCode!==0)return{stdout:"",stderr:n.stderr,exitCode:2};y=n.files.map(e=>({source:e.filename||"stdin",content:e.content}))}try{let n=A(I),e=[],r={limits:o.limits?{maxIterations:o.limits.maxJqIterations}:void 0,env:o.env,vars:J,coverage:o.coverage,requireDefenseContext:o.requireDefenseContext};if(c)e=S(null,n,r);else if(u&&f){let m=y.map(({content:d})=>d).join("");e=S(m,n,r)}else if(u)for(let{content:m}of y){let d=m.split(`
10
+ `);d.length>0&&d.at(-1)===""&&d.pop();for(let w of d)e.push(...S(w,n,r))}else if(f){let m=[];for(let{content:d}of y){let w=d.trim();w&&m.push(...V(w))}e=S(m,n,r)}else for(let{content:m}of y){let d=m.trim();if(!d)continue;let w=V(d);for(let W of w)e.push(...S(W,n,r))}let $=e.map(m=>x(m,i,a,g,h)),H=p?"":`
11
+ `,q=$.join(H),b=o.limits?.maxStringLength;if(b!==void 0&&b>0&&q.length>b)throw new C(`jq: output size limit exceeded (${b} bytes)`,"string_length");let P=l&&(e.length===0||e.every(m=>m==null||m===!1))?1:0;return{stdout:q?p?q:`${q}
12
+ `:"",stderr:"",exitCode:P}}catch(n){if(n instanceof D)throw n;if(n instanceof C)return{stdout:"",stderr:`jq: ${N(n.message)}
13
+ `,exitCode:C.EXIT_CODE};let e=N(n.message);return e.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${e}
14
+ `,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${e}
15
+ `,exitCode:5}}}},v={name:"jq",flags:[{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"text",needsArgs:!0};export{K as a,v as b};
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import{a as p}from"./chunk-JBABAK44.js";import{a as g}from"./chunk-4VDEBYW7.js";var x=`Usage: rmdir [-pv] DIRECTORY...
3
+ Remove empty directories.
4
+
5
+ Options:
6
+ -p, --parents Remove DIRECTORY and its ancestors
7
+ -v, --verbose Output a diagnostic for every directory processed`,y={parents:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},help:{long:"help",type:"boolean"}},D={name:"rmdir",async execute(t,r){let e=p("rmdir",t,y);if(!e.ok)return e.error;if(e.result.flags.help)return{stdout:`${x}
8
+ `,stderr:"",exitCode:0};let a=e.result.flags.parents,o=e.result.flags.verbose,s=e.result.positional;if(s.length===0)return{stdout:"",stderr:`rmdir: missing operand
9
+ `,exitCode:1};let c="",n="",i=0;for(let u of s){let d=await b(r,u,a,o);c+=d.stdout,n+=d.stderr,d.exitCode!==0&&(i=d.exitCode)}return{stdout:c,stderr:n,exitCode:i}}};async function b(t,r,e,a){let o="",s="",n=t.fs.resolvePath(t.cwd,r),i=await v(t,n,r,a);if(o+=i.stdout,s+=i.stderr,i.exitCode!==0)return{stdout:o,stderr:s,exitCode:i.exitCode};if(e){let u=n,d=r;for(;;){let l=C(u),f=C(d);if(l===u||l==="/"||l==="."||f==="."||f==="")break;let m=await v(t,l,f,a);if(o+=m.stdout,m.exitCode!==0)break;u=l,d=f}}return{stdout:o,stderr:s,exitCode:0}}async function v(t,r,e,a){try{if(!await t.fs.exists(r))return{stdout:"",stderr:`rmdir: failed to remove '${e}': No such file or directory
10
+ `,exitCode:1};if(!(await t.fs.stat(r)).isDirectory)return{stdout:"",stderr:`rmdir: failed to remove '${e}': Not a directory
11
+ `,exitCode:1};if((await t.fs.readdir(r)).length>0)return{stdout:"",stderr:`rmdir: failed to remove '${e}': Directory not empty
12
+ `,exitCode:1};await t.fs.rm(r,{recursive:!1,force:!1});let n="";return a&&(n=`rmdir: removing directory, '${e}'
13
+ `),{stdout:n,stderr:"",exitCode:0}}catch(o){let s=g(o);return{stdout:"",stderr:`rmdir: failed to remove '${e}': ${s}
14
+ `,exitCode:1}}}function C(t){let r=t.replace(/\/+$/,""),e=r.lastIndexOf("/");return e===-1?".":e===0?"/":r.substring(0,e)}var $={name:"rmdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{D as a,$ as b};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{a as r}from"./chunk-JDNI5HBX.js";var g=2048,o=new Map;function u(l,c,t){let s=typeof t=="boolean"?{ignoreCase:t}:t??{},e=c;s.stripQuotes&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1));let i=s.ignoreCase?`i:${e}`:e,n=o.get(i);if(!n){if(n=a(e,s.ignoreCase),o.size>=g){let f=o.keys().next().value;f!==void 0&&o.delete(f)}o.set(i,n)}return n.test(l)}function a(l,c){let t="^";for(let s=0;s<l.length;s++){let e=l[s];if(e==="*")t+=".*";else if(e==="?")t+=".";else if(e==="["){let i=s+1;for(;i<l.length&&l[i]!=="]";)i++;t+=l.slice(s,i+1),s=i}else e==="."||e==="+"||e==="^"||e==="$"||e==="{"||e==="}"||e==="("||e===")"||e==="|"||e==="\\"?t+=`\\${e}`:t+=e}return t+="$",r(t,c?"i":"")}export{u as a};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import{a as p}from"./chunk-RLNOQILG.js";import{a as m}from"./chunk-JBABAK44.js";import{a as u}from"./chunk-4VDEBYW7.js";var v={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},E={name:"rm",async execute(g,s){let e=m("rm",g,v);if(!e.ok)return e.error;let i=e.result.flags.recursive||e.result.flags.recursiveUpper,a=e.result.flags.force,d=e.result.flags.verbose,c=e.result.positional;if(c.length===0)return a?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
3
+ `,exitCode:1};let f="",t="",l=0;for(let r of c)try{let n=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(n)).isDirectory&&!i){t+=`rm: cannot remove '${r}': Is a directory
4
+ `,l=1;continue}await s.fs.rm(n,{recursive:i,force:a}),d&&(f+=`removed '${r}'
5
+ `)}catch(n){if(!a){let o=u(n);o.includes("ENOENT")||o.includes("no such file")?t+=`rm: cannot remove '${r}': No such file or directory
6
+ `:o.includes("ENOTEMPTY")||o.includes("not empty")?t+=`rm: cannot remove '${r}': Directory not empty
7
+ `:t+=`rm: cannot remove '${r}': ${p(o)}
8
+ `,l=1}}return{stdout:f,stderr:t,exitCode:l}}},$={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{E as a,$ as b};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import{a as p,b as h,c as w}from"./chunk-GTNBSMZR.js";var m={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};function g(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function y(s,r){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=r,l=[],e="",t=0,o=-1,f=0;for(let c=0;c<s.length;c++){let a=s[c],d=g(a,t,i);t+d>n&&e.length>0?u&&o>=0?(l.push(e.slice(0,o+1)),e=e.slice(o+1)+a,t=t-f-1+d,o=-1,f=0):(l.push(e),e=a,t=d,o=-1,f=0):(e+=a,t+=d,(a===" "||a===" ")&&(o=e.length-1,f=t-d))}return e.length>0&&l.push(e),l.join(`
3
+ `)}function b(s,r){if(s==="")return"";let n=s.split(`
4
+ `),u=s.endsWith(`
5
+ `)&&n[n.length-1]==="";return u&&n.pop(),n.map(l=>y(l,r)).join(`
6
+ `)+(u?`
7
+ `:"")}var k={name:"fold",execute:async(s,r)=>{if(h(s))return p(m);let n={width:80,breakAtSpaces:!1,countBytes:!1},u=[],i=0;for(;i<s.length;){let e=s[i];if(e==="-w"&&i+1<s.length){let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
8
+ `};n.width=t,i+=2}else if(e.startsWith("-w")&&e.length>2){let t=parseInt(e.slice(2),10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${e.slice(2)}'
9
+ `};n.width=t,i++}else if(e==="-s")n.breakAtSpaces=!0,i++;else if(e==="-b")n.countBytes=!0,i++;else if(e==="-bs"||e==="-sb")n.breakAtSpaces=!0,n.countBytes=!0,i++;else if(e.match(/^-[sb]+w\d+$/)){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=e.replace(/^-[sb]+w/,""),o=parseInt(t,10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${t}'
10
+ `};n.width=o,i++}else if(e.match(/^-[sb]+w$/)&&i+1<s.length){e.includes("s")&&(n.breakAtSpaces=!0),e.includes("b")&&(n.countBytes=!0);let t=parseInt(s[i+1],10);if(Number.isNaN(t)||t<1)return{exitCode:1,stdout:"",stderr:`fold: invalid number of columns: '${s[i+1]}'
11
+ `};n.width=t,i+=2}else if(e==="--"){u.push(...s.slice(i+1));break}else if(e.startsWith("-")&&e!=="-"){let t=e.slice(1),o=!1;for(let f of t)if(f==="s")n.breakAtSpaces=!0;else if(f==="b")n.countBytes=!0;else{o=!0;break}if(o)return w("fold",e);i++}else u.push(e),i++}let l="";if(u.length===0){let e=r.stdin??"";l=b(e,n)}else for(let e of u){let t=r.fs.resolvePath(r.cwd,e),o=await r.fs.readFile(t);if(o===null)return{exitCode:1,stdout:l,stderr:`fold: ${e}: No such file or directory
12
+ `};l+=b(o,n)}return{exitCode:0,stdout:l,stderr:""}}},x={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0};export{k as a,x as b};
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import{a as de}from"./chunk-4PRVMER6.js";import{a as D,b as _}from"./chunk-MO4RPBN2.js";import{a as x}from"./chunk-YU6OGPZR.js";import{a as v,b as H}from"./chunk-JDNI5HBX.js";import{k as P}from"./chunk-6KZRLMG3.js";import{a as pe,b as fe,c as re}from"./chunk-GTNBSMZR.js";var Ue=1e4,Be=100,He=new H(/\s+/);function ie(e={}){let{fieldSep:t=He,maxIterations:n=Ue,maxRecursionDepth:i=Be,maxOutputSize:s=0,fs:a,cwd:o,exec:l,coverage:u,requireDefenseContext:N}=e;return{FS:" ",OFS:" ",ORS:`
3
+ `,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:i,maxOutputSize:s,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:a,cwd:o,exec:l,coverage:u,requireDefenseContext:N}}function Ee(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}function M(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function k(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}async function z(e,t){if(e.type==="regex")return e.pattern;let n=k(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function ye(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(M(await t.evalExpr(e.index)))}`:"$0":"$0"}function Se(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return k(t.vars[e]??"")}function me(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let i=parseInt(e.slice(1),10)-1;for(;n.fields.length<=i;)n.fields.push("");n.fields[i]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function $e(e,t,n){return e.length===0?t.line.length:k(await n.evalExpr(e[0])).length}async function We(e,t,n){if(e.length<2)return"";let i=k(await n.evalExpr(e[0])),s=Math.floor(M(await n.evalExpr(e[1])))-1;if(e.length>=3){let a=Math.floor(M(await n.evalExpr(e[2])));return i.substr(Math.max(0,s),a)}return i.substr(Math.max(0,s))}async function Ve(e,t,n){if(e.length<2)return 0;let i=k(await n.evalExpr(e[0])),s=k(await n.evalExpr(e[1])),a=i.indexOf(s);return a===-1?0:a+1}async function Ke(e,t,n){if(e.length<2)return 0;let i=k(await n.evalExpr(e[0])),s=e[1];if(s.type!=="variable")return 0;let a=s.name,o=t.FS;if(e.length>=3){let u=e[2];if(u.type==="regex")o=v(u.pattern);else{let N=k(await n.evalExpr(u));o=N===" "?v("\\s+"):N}}else t.FS===" "&&(o=v("\\s+"));let l=typeof o=="string"?i.split(o):o.split(i);t.arrays[a]=Object.create(null);for(let u=0;u<l.length;u++)t.arrays[a][String(u+1)]=l[u];return l.length}async function Xe(e,t,n){if(e.length<2)return 0;let i=await z(e[0],n),s=k(await n.evalExpr(e[1])),a=await ye(e[2],n),o=Se(a,t);try{let u=v(i).replace(o,we(s)),N=u!==o?1:0;return me(a,u,t),N}catch{return 0}}async function qe(e,t,n){if(e.length<2)return 0;let i=await z(e[0],n),s=k(await n.evalExpr(e[1])),a=await ye(e[2],n),o=Se(a,t);try{let l=v(i,"g"),u=l.match(o),N=u?u.length:0,A=l.replace(o,we(s));return me(a,A,t),N}catch{return 0}}function we(e){return t=>{let n="",i=0;for(;i<e.length;)if(e[i]==="\\"&&i+1<e.length){let s=e[i+1];s==="&"?(n+="&",i+=2):s==="\\"?(n+="\\",i+=2):(n+=e[i+1],i+=2)}else e[i]==="&"?(n+=t,i++):(n+=e[i],i++);return n}}async function ze(e,t,n){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let i=k(await n.evalExpr(e[0])),s=await z(e[1],n);try{let o=v(s).exec(i);if(o)return t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART}catch{}return t.RSTART=0,t.RLENGTH=-1,0}async function je(e,t,n){if(e.length<3)return"";let i=await z(e[0],n),s=k(await n.evalExpr(e[1])),a=k(await n.evalExpr(e[2])),o=e.length>=4?k(await n.evalExpr(e[3])):t.line;try{let l=a.toLowerCase()==="g",u=l?0:parseInt(a,10)||1;if(l)return v(i,"g").replace(o,(A,...C)=>Ne(s,A,C.slice(0,-2)));{let N=0;return v(i,"g").replace(o,(C,...O)=>(N++,N===u?Ne(s,C,O.slice(0,-2)):C))}}catch{return o}}function Ne(e,t,n){let i="",s=0;for(;s<e.length;)if(e[s]==="\\"&&s+1<e.length){let a=e[s+1];if(a==="&")i+="&",s+=2;else if(a==="0")i+=t,s+=2;else if(a>="1"&&a<="9"){let o=parseInt(a,10)-1;i+=n[o]||"",s+=2}else a==="n"?(i+=`
4
+ `,s+=2):a==="t"?(i+=" ",s+=2):(i+=a,s+=2)}else e[s]==="&"?(i+=t,s++):(i+=e[s],s++);return i}async function Qe(e,t,n){return e.length===0?"":k(await n.evalExpr(e[0])).toLowerCase()}async function Je(e,t,n){return e.length===0?"":k(await n.evalExpr(e[0])).toUpperCase()}async function Ze(e,t,n){if(e.length===0)return"";let i=k(await n.evalExpr(e[0])),s=[];for(let a=1;a<e.length;a++)s.push(await n.evalExpr(e[a]));return j(i,s)}async function Ye(e,t,n){return e.length===0?0:Math.floor(M(await n.evalExpr(e[0])))}async function et(e,t,n){return e.length===0?0:Math.sqrt(M(await n.evalExpr(e[0])))}async function tt(e,t,n){return e.length===0?0:Math.sin(M(await n.evalExpr(e[0])))}async function nt(e,t,n){return e.length===0?0:Math.cos(M(await n.evalExpr(e[0])))}async function rt(e,t,n){let i=e.length>0?M(await n.evalExpr(e[0])):0,s=e.length>1?M(await n.evalExpr(e[1])):0;return Math.atan2(i,s)}async function it(e,t,n){return e.length===0?0:Math.log(M(await n.evalExpr(e[0])))}async function st(e,t,n){return e.length===0?1:Math.exp(M(await n.evalExpr(e[0])))}function at(e,t,n){return t.random?t.random():Math.random()}async function ot(e,t,n){let i=e.length>0?M(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=i,i}function lt(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function se(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}var U=1e4;function j(e,t){let n=0,i="",s=0;for(;s<e.length;)if(e[s]==="%"&&s+1<e.length){let a=s+1,o="",l="",u="",N,A=a;for(;a<e.length&&/\d/.test(e[a]);)a++;a>A&&e[a]==="$"?(N=parseInt(e.substring(A,a),10)-1,a++):a=A;let C=()=>{if(a<e.length){if(a+1<e.length&&(e[a]==="h"&&e[a+1]==="h"||e[a]==="l"&&e[a+1]==="l")){a+=2;return}/[lzjh]/.test(e[a])&&a++}};for(;a<e.length&&/[-+ #0]/.test(e[a]);)o+=e[a++];if(e[a]==="*"){let d=t[n++],R=d!==void 0?Math.floor(Number(d)):0;R<0?(o+="-",l=String(Math.min(-R,U))):l=String(Math.min(R,U)),a++}else for(;a<e.length&&/\d/.test(e[a]);)l+=e[a++];if(l&&parseInt(l,10)>U&&(l=String(U)),e[a]==="."){if(a++,e[a]==="*"){let d=t[n++];u=String(Math.min(d!==void 0?Math.floor(Number(d)):0,U)),a++}else for(;a<e.length&&/\d/.test(e[a]);)u+=e[a++];u&&parseInt(u,10)>U&&(u=String(U))}C();let O=e[a],w=t[N!==void 0?N:n];switch(O){case"s":{let d=w!==void 0?String(w):"";if(u&&(d=d.substring(0,parseInt(u,10))),l){let R=parseInt(l,10);o.includes("-")?d=d.padEnd(R):d=d.padStart(R)}i+=d,N===void 0&&n++;break}case"d":case"i":{let d=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(d)&&(d=0);let R=d<0,h=Math.abs(d).toString();if(u){let F=parseInt(u,10);h=h.padStart(F,"0")}let c="";R?c="-":o.includes("+")?c="+":o.includes(" ")&&(c=" ");let E=c+h;if(l){let F=parseInt(l,10);o.includes("-")?E=E.padEnd(F):o.includes("0")&&!u?E=c+h.padStart(F-c.length,"0"):E=E.padStart(F)}i+=E,N===void 0&&n++;break}case"f":{let d=w!==void 0?Number(w):0;Number.isNaN(d)&&(d=0);let R=u?parseInt(u,10):6,h=d.toFixed(R);if(l){let c=parseInt(l,10);o.includes("-")?h=h.padEnd(c):h=h.padStart(c)}i+=h,N===void 0&&n++;break}case"e":case"E":{let d=w!==void 0?Number(w):0;Number.isNaN(d)&&(d=0);let R=u?parseInt(u,10):6,h=d.toExponential(R);if(O==="E"&&(h=h.toUpperCase()),l){let c=parseInt(l,10);o.includes("-")?h=h.padEnd(c):h=h.padStart(c)}i+=h,N===void 0&&n++;break}case"g":case"G":{let d=w!==void 0?Number(w):0;Number.isNaN(d)&&(d=0);let R=u?parseInt(u,10):6,h=d!==0?Math.floor(Math.log10(Math.abs(d))):0,c;if(d===0?c="0":h<-4||h>=R?(c=d.toExponential(R-1),O==="G"&&(c=c.toUpperCase())):c=d.toPrecision(R),c.includes(".")&&(c=c.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),c.includes("e")&&(c=c.replace(/\.?0+e/,"e")),l){let E=parseInt(l,10);o.includes("-")?c=c.padEnd(E):c=c.padStart(E)}i+=c,N===void 0&&n++;break}case"x":case"X":{let d=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(d)&&(d=0);let R=Math.abs(d).toString(16);if(O==="X"&&(R=R.toUpperCase()),u){let E=parseInt(u,10);R=R.padStart(E,"0")}let h=d<0?"-":"",c=h+R;if(l){let E=parseInt(l,10);o.includes("-")?c=c.padEnd(E):o.includes("0")&&!u?c=h+R.padStart(E-h.length,"0"):c=c.padStart(E)}i+=c,N===void 0&&n++;break}case"o":{let d=w!==void 0?Math.floor(Number(w)):0;Number.isNaN(d)&&(d=0);let R=Math.abs(d).toString(8);if(u){let E=parseInt(u,10);R=R.padStart(E,"0")}let h=d<0?"-":"",c=h+R;if(l){let E=parseInt(l,10);o.includes("-")?c=c.padEnd(E):o.includes("0")&&!u?c=h+R.padStart(E-h.length,"0"):c=c.padStart(E)}i+=c,N===void 0&&n++;break}case"c":{typeof w=="number"?i+=String.fromCharCode(w):i+=String(w??"").charAt(0)||"",N===void 0&&n++;break}case"%":i+="%";break;default:i+=e.substring(s,a+1)}s=a+1}else if(e[s]==="\\"&&s+1<e.length){let a=e[s+1];switch(a){case"n":i+=`
5
+ `;break;case"t":i+=" ";break;case"r":i+="\r";break;case"\\":i+="\\";break;default:i+=a}s+=2}else i+=e[s++];return i}var Re=new Map([["length",$e],["substr",We],["index",Ve],["split",Ke],["sub",Xe],["gsub",qe],["match",ze],["gensub",je],["tolower",Qe],["toupper",Je],["sprintf",Ze],["int",Ye],["sqrt",et],["sin",tt],["cos",nt],["atan2",rt],["log",it],["exp",st],["rand",at],["srand",ot],["system",lt("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",se("systime")],["mktime",se("mktime")],["strftime",se("strftime")]]);function b(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function g(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function m(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function ae(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function K(e,t){try{return v(e).test(t)}catch{return!1}}function ge(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function Q(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function oe(e,t,n){if(t===0)e.line=m(n),e.fields=ge(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=m(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function $(e,t){e.line=t,e.fields=ge(e,t),e.NF=e.fields.length}function Ae(e,t){if(e.FS=t,t===" ")e.fieldSep=new H(/\s+/);else try{e.fieldSep=v(t)}catch{e.fieldSep=v(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}function J(e,t){switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return e.vars[t]??""}function W(e,t,n){switch(t){case"FS":Ae(e,m(n));return;case"OFS":e.OFS=m(n);return;case"ORS":e.ORS=m(n);return;case"OFMT":e.OFMT=m(n);return;case"NR":e.NR=Math.floor(g(n));return;case"NF":{let i=Math.floor(g(n));if(i<e.NF)e.fields=e.fields.slice(0,i),e.line=e.fields.join(e.OFS);else if(i>e.NF){for(;e.fields.length<i;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=i;return}case"FNR":e.FNR=Math.floor(g(n));return;case"FILENAME":e.FILENAME=m(n);return;case"RSTART":e.RSTART=Math.floor(g(n));return;case"RLENGTH":e.RLENGTH=Math.floor(g(n));return;case"SUBSEP":e.SUBSEP=m(n);return}e.vars[t]=n}function X(e,t){let n=t,i=new Set,s=e.arrayAliases.get(n);for(;s!==void 0&&!i.has(n);)i.add(n),n=s,s=e.arrayAliases.get(n);return n}function Z(e,t,n){if(t==="ARGV")return e.ARGV[n]??"";if(t==="ENVIRON")return e.ENVIRON[n]??"";let i=X(e,t);return e.arrays[i]?.[n]??""}function le(e,t,n,i){let s=X(e,t);e.arrays[s]||(e.arrays[s]=Object.create(null)),e.arrays[s][n]=i}function ve(e,t,n){if(t==="ARGV")return e.ARGV[n]!==void 0;if(t==="ENVIRON")return e.ENVIRON[n]!==void 0;let i=X(e,t);return e.arrays[i]?.[n]!==void 0}function Ie(e,t,n){let i=X(e,t);e.arrays[i]&&delete e.arrays[i][n]}function ke(e,t){let n=X(e,t);delete e.arrays[n]}var Ce=null;function be(e){Ce=e}function L(e,t){D(e.requireDefenseContext,"awk",t)}function S(e,t,n){return _(e.requireDefenseContext,"awk",t,n)}async function f(e,t){switch(L(e,"expression evaluation"),e.coverage?.hit(`awk:expr:${t.type}`),t.type){case"number":return t.value;case"string":return t.value;case"regex":return K(t.pattern,e.line)?1:0;case"field":return ut(e,t);case"variable":return J(e,t.name);case"array_access":return ct(e,t);case"binary":return ht(e,t);case"unary":return dt(e,t);case"ternary":return b(await S(e,"ternary condition evaluation",()=>f(e,t.condition)))?await S(e,"ternary consequent evaluation",()=>f(e,t.consequent)):await S(e,"ternary alternate evaluation",()=>f(e,t.alternate));case"call":return Et(e,t.name,t.args);case"assignment":return yt(e,t);case"pre_increment":return St(e,t.operand);case"pre_decrement":return mt(e,t.operand);case"post_increment":return wt(e,t.operand);case"post_decrement":return Rt(e,t.operand);case"in":return gt(e,t.key,t.array);case"getline":return At(e,t.variable,t.file,t.command);case"tuple":return kt(e,t.elements);default:return""}}async function ut(e,t){L(e,"field reference evaluation");let n=Math.floor(g(await S(e,"field index evaluation",()=>f(e,t.index))));return Q(e,n)}async function ct(e,t){L(e,"array access evaluation");let n=m(await S(e,"array key evaluation",()=>f(e,t.key)));return Z(e,t.array,n)}async function ht(e,t){L(e,"binary expression evaluation");let n=t.operator;if(n==="||")return b(await S(e,"logical-or left evaluation",()=>f(e,t.left)))||b(await S(e,"logical-or right evaluation",()=>f(e,t.right)))?1:0;if(n==="&&")return b(await S(e,"logical-and left evaluation",()=>f(e,t.left)))&&b(await S(e,"logical-and right evaluation",()=>f(e,t.right)))?1:0;if(n==="~"){let l=await S(e,"regex left evaluation",()=>f(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let u=t.right.type==="regex"?t.right.pattern:m(await S(e,"regex right evaluation",()=>f(e,t.right)));try{return v(u).test(m(l))?1:0}catch{return 0}}if(n==="!~"){let l=await S(e,"negated-regex left evaluation",()=>f(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let u=t.right.type==="regex"?t.right.pattern:m(await S(e,"negated-regex right evaluation",()=>f(e,t.right)));try{return v(u).test(m(l))?0:1}catch{return 1}}let i=await S(e,"binary left evaluation",()=>f(e,t.left)),s=await S(e,"binary right evaluation",()=>f(e,t.right));if(n===" "){let l=m(i)+m(s);if(e.maxOutputSize>0&&l.length>e.maxOutputSize)throw new P(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output);return l}if(pt(n))return ft(i,s,n);let a=g(i),o=g(s);return Ee(a,o,n)}function pt(e){return["<","<=",">",">=","==","!="].includes(e)}function ft(e,t,n){let i=ae(e),s=ae(t);if(i&&s){let l=g(e),u=g(t);switch(n){case"<":return l<u?1:0;case"<=":return l<=u?1:0;case">":return l>u?1:0;case">=":return l>=u?1:0;case"==":return l===u?1:0;case"!=":return l!==u?1:0}}let a=m(e),o=m(t);switch(n){case"<":return a<o?1:0;case"<=":return a<=o?1:0;case">":return a>o?1:0;case">=":return a>=o?1:0;case"==":return a===o?1:0;case"!=":return a!==o?1:0}return 0}async function dt(e,t){L(e,"unary expression evaluation");let n=await S(e,"unary operand evaluation",()=>f(e,t.operand));switch(t.operator){case"!":return b(n)?0:1;case"-":return-g(n);case"+":return+g(n);default:return n}}async function Et(e,t,n){L(e,"function call evaluation");let i=Re.get(t);if(i)return i(n,e,{evalExpr:a=>f(e,a)});let s=e.functions.get(t);return s?Nt(e,s,n):""}async function Nt(e,t,n){if(L(e,"user function call"),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new P(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let i=Object.create(null);for(let l of t.params)i[l]=e.vars[l];let s=[];for(let l=0;l<t.params.length;l++){let u=t.params[l];if(l<n.length){let N=n[l];N.type==="variable"&&(e.arrayAliases.set(u,N.name),s.push(u));let A=await S(e,"user function argument evaluation",()=>f(e,N));e.vars[u]=A}else e.vars[u]=""}e.hasReturn=!1,e.returnValue=void 0;let a=Ce;a&&await S(e,"user function body execution",()=>a(e,t.body.statements));let o=e.returnValue??"";for(let l of t.params)i[l]!==void 0?e.vars[l]=i[l]:delete e.vars[l];for(let l of s)e.arrayAliases.delete(l);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,o}async function yt(e,t){L(e,"assignment evaluation");let n=await S(e,"assignment value evaluation",()=>f(e,t.value)),i=t.target,s=t.operator,a;if(s==="=")a=n;else{let o;if(i.type==="field"){let N=Math.floor(g(await S(e,"assignment field index",()=>f(e,i.index))));o=Q(e,N)}else if(i.type==="variable")o=J(e,i.name);else{let N=m(await S(e,"assignment array key",()=>f(e,i.key)));o=Z(e,i.array,N)}let l=g(o),u=g(n);switch(s){case"+=":a=l+u;break;case"-=":a=l-u;break;case"*=":a=l*u;break;case"/=":a=u!==0?l/u:0;break;case"%=":a=u!==0?l%u:0;break;case"^=":a=l**u;break;default:a=n}}if(i.type==="field"){let o=Math.floor(g(await S(e,"assignment target field index",()=>f(e,i.index))));oe(e,o,a)}else if(i.type==="variable")W(e,i.name,a);else{let o=m(await S(e,"assignment target array key",()=>f(e,i.key)));le(e,i.array,o,a)}return a}async function Y(e,t,n,i){L(e,"inc/dec evaluation");let s;if(t.type==="field"){let a=Math.floor(g(await S(e,"inc/dec field index",()=>f(e,t.index))));s=g(Q(e,a)),oe(e,a,s+n)}else if(t.type==="variable")s=g(J(e,t.name)),W(e,t.name,s+n);else{let a=m(await S(e,"inc/dec array key",()=>f(e,t.key)));s=g(Z(e,t.array,a)),le(e,t.array,a,s+n)}return i?s+n:s}async function St(e,t){return Y(e,t,1,!0)}async function mt(e,t){return Y(e,t,-1,!0)}async function wt(e,t){return Y(e,t,1,!1)}async function Rt(e,t){return Y(e,t,-1,!1)}async function gt(e,t,n){L(e,"in-expression evaluation");let i;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let s=[];for(let a of t.elements)s.push(m(await S(e,"tuple key element evaluation",()=>f(e,a))));i=s.join(e.SUBSEP)}else i=m(await S(e,"in-expression key evaluation",()=>f(e,t)));return ve(e,n,i)?1:0}async function At(e,t,n,i){if(L(e,"getline evaluation"),i)return vt(e,t,i);if(n)return It(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let s=e.lineIndex+1;if(s>=e.lines.length)return 0;let a=e.lines[s];return t?W(e,t,a):$(e,a),e.NR++,e.lineIndex=s,1}async function vt(e,t,n){let i=e.exec;if(!i)return-1;L(e,"getline command source");let s=m(await S(e,"getline command expression",()=>f(e,n))),a=`__cmd_${s}`,o=`__cmdi_${s}`,l,u;if(e.vars[a]===void 0)try{l=(await S(e,"getline command exec",()=>i(s))).stdout.split(`
6
+ `),l.length>0&&l[l.length-1]===""&&l.pop(),e.vars[a]=JSON.stringify(l),e.vars[o]=-1,u=-1}catch(C){if(C instanceof x)throw C;return-1}else l=JSON.parse(e.vars[a]),u=e.vars[o];let N=u+1;if(N>=l.length)return 0;let A=l[N];return e.vars[o]=N,t?W(e,t,A):$(e,A),1}async function It(e,t,n){let i=e.fs;if(!i||!e.cwd)return-1;L(e,"getline file source");let s=m(await S(e,"getline filename evaluation",()=>f(e,n)));if(s==="/dev/null")return 0;let a=i.resolvePath(e.cwd,s),o=`__fc_${a}`,l=`__fi_${a}`,u,N;if(e.vars[o]===void 0)try{u=(await S(e,"getline file read",()=>i.readFile(a))).split(`
7
+ `),u.length>0&&u[u.length-1]===""&&u.pop(),e.vars[o]=JSON.stringify(u),e.vars[l]=-1,N=-1}catch(O){if(O instanceof x)throw O;return-1}else u=JSON.parse(e.vars[o]),N=e.vars[l];let A=N+1;if(A>=u.length)return 0;let C=u[A];return e.vars[l]=A,t?W(e,t,C):$(e,C),1}async function kt(e,t){if(L(e,"tuple evaluation"),t.length===0)return"";for(let n=0;n<t.length-1;n++)await S(e,"tuple intermediate element",()=>f(e,t[n]));return S(e,"tuple final element",()=>f(e,t[t.length-1]))}be(V);function ue(e){if(e.maxOutputSize>0&&e.output.length>e.maxOutputSize)throw new P(`awk: output size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output)}function T(e,t){D(e.requireDefenseContext,"awk",t)}function y(e,t,n){return _(e.requireDefenseContext,"awk",t,n)}async function V(e,t){T(e,"block execution");for(let n of t)if(await y(e,"statement execution",()=>B(e,n)),Ct(e))break}function Ct(e){return e.shouldExit||e.shouldNext||e.shouldNextFile||e.loopBreak||e.loopContinue||e.hasReturn}async function B(e,t){switch(T(e,"single statement execution"),e.coverage?.hit(`awk:stmt:${t.type}`),t.type){case"block":await y(e,"nested block statement",()=>V(e,t.statements));break;case"expr_stmt":await y(e,"expression statement",()=>f(e,t.expression));break;case"print":await y(e,"print statement",()=>bt(e,t.args,t.output));break;case"printf":await y(e,"printf statement",()=>Ot(e,t.format,t.args,t.output));break;case"if":await y(e,"if statement",()=>Lt(e,t));break;case"while":await y(e,"while statement",()=>Mt(e,t));break;case"do_while":await y(e,"do-while statement",()=>Pt(e,t));break;case"for":await y(e,"for statement",()=>Tt(e,t));break;case"for_in":await y(e,"for-in statement",()=>Ft(e,t));break;case"break":e.loopBreak=!0;break;case"continue":e.loopContinue=!0;break;case"next":e.shouldNext=!0;break;case"nextfile":e.shouldNextFile=!0;break;case"exit":e.shouldExit=!0;{let n=t.code;e.exitCode=n?Math.floor(g(await y(e,"exit code expression",()=>f(e,n)))):0}break;case"return":e.hasReturn=!0;{let n=t.value;e.returnValue=n?await y(e,"return expression",()=>f(e,n)):""}break;case"delete":await y(e,"delete statement",()=>Dt(e,t.target));break}}async function bt(e,t,n){T(e,"print execution");let i=[];for(let a of t){let o=await y(e,"print argument evaluation",()=>f(e,a));typeof o=="number"?Number.isInteger(o)&&Math.abs(o)<Number.MAX_SAFE_INTEGER?i.push(String(o)):i.push(j(e.OFMT,[o])):i.push(m(o))}let s=i.join(e.OFS)+e.ORS;n?await y(e,"print redirection write",()=>Oe(e,n.redirect,n.file,s)):(e.output+=s,ue(e))}async function Ot(e,t,n,i){T(e,"printf execution");let s=m(await y(e,"printf format evaluation",()=>f(e,t))),a=[];for(let l of n)a.push(await y(e,"printf argument evaluation",()=>f(e,l)));let o=j(s,a);i?await y(e,"printf redirection write",()=>Oe(e,i.redirect,i.file,o)):(e.output+=o,ue(e))}async function Oe(e,t,n,i){T(e,"file write execution");let s=e.fs;if(!s||!e.cwd){e.output+=i,ue(e);return}let a=m(await y(e,"redirection filename evaluation",()=>f(e,n))),o=s.resolvePath(e.cwd,a);t===">"?e.openedFiles.has(o)?await y(e,"redirection append write",()=>s.appendFile(o,i)):(await y(e,"redirection overwrite write",()=>s.writeFile(o,i)),e.openedFiles.add(o)):(e.openedFiles.has(o)||e.openedFiles.add(o),await y(e,"redirection append mode write",()=>s.appendFile(o,i)))}async function Lt(e,t){if(T(e,"if execution"),b(await y(e,"if condition evaluation",()=>f(e,t.condition))))await y(e,"if consequent execution",()=>B(e,t.consequent));else if(t.alternate){let n=t.alternate;await y(e,"if alternate execution",()=>B(e,n))}}async function Mt(e,t){T(e,"while execution");let n=0;for(;b(await y(e,"while condition evaluation",()=>f(e,t.condition)));){if(n++,n>e.maxIterations)throw new P(`awk: while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await y(e,"while body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function Pt(e,t){T(e,"do-while execution");let n=0;do{if(n++,n>e.maxIterations)throw new P(`awk: do-while loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await y(e,"do-while body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}while(b(await y(e,"do-while condition evaluation",()=>f(e,t.condition))))}async function Tt(e,t){T(e,"for execution");let n=t.init,i=t.condition,s=t.update;n&&await y(e,"for init evaluation",()=>f(e,n));let a=0;for(;!i||b(await y(e,"for condition evaluation",()=>f(e,i)));){if(a++,a>e.maxIterations)throw new P(`awk: for loop exceeded maximum iterations (${e.maxIterations})`,"iterations",e.output);if(e.loopContinue=!1,await y(e,"for body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break;s&&await y(e,"for update evaluation",()=>f(e,s))}}async function Ft(e,t){T(e,"for-in execution");let n=e.arrays[t.array];if(n)for(let i of Object.keys(n)){if(e.vars[t.variable]=i,e.loopContinue=!1,await y(e,"for-in body execution",()=>B(e,t.body)),e.loopBreak){e.loopBreak=!1;break}if(e.shouldExit||e.shouldNext||e.hasReturn)break}}async function Dt(e,t){if(T(e,"delete execution"),t.type==="array_access"){let n=m(await y(e,"delete key evaluation",()=>f(e,t.key)));Ie(e,t.array,n)}else t.type==="variable"&&ke(e,t.name)}var q=class{ctx;program=null;rangeStates=[];constructor(t){this.ctx=t}assertDefenseContext(t){D(this.ctx.requireDefenseContext,"awk",t)}withDefenseContext(t,n){return _(this.ctx.requireDefenseContext,"awk",t,n)}execute(t){this.assertDefenseContext("program initialization"),this.program=t,this.ctx.output="";for(let n of t.functions)this.ctx.functions.set(n.name,n);this.rangeStates=t.rules.map(()=>!1)}async executeBegin(){if(this.assertDefenseContext("BEGIN execution entry"),!!this.program){for(let t of this.program.rules)if(t.pattern?.type==="begin"&&(await this.withDefenseContext("BEGIN block execution",()=>V(this.ctx,t.action.statements)),this.ctx.shouldExit))break}}async executeLine(t){if(this.assertDefenseContext("line execution entry"),!(!this.program||this.ctx.shouldExit)){$(this.ctx,t),this.ctx.NR++,this.ctx.FNR++,this.ctx.shouldNext=!1;for(let n=0;n<this.program.rules.length&&!(this.ctx.shouldExit||this.ctx.shouldNext||this.ctx.shouldNextFile);n++){let i=this.program.rules[n];i.pattern?.type==="begin"||i.pattern?.type==="end"||await this.withDefenseContext("rule match",()=>this.matchesRule(i,n))&&await this.withDefenseContext("rule block execution",()=>V(this.ctx,i.action.statements))}}}async executeEnd(){if(this.assertDefenseContext("END execution entry"),!!this.program&&!this.ctx.inEndBlock){this.ctx.inEndBlock=!0,this.ctx.shouldExit=!1;for(let t of this.program.rules)if(t.pattern?.type==="end"&&(await this.withDefenseContext("END block execution",()=>V(this.ctx,t.action.statements)),this.ctx.shouldExit))break;this.ctx.inEndBlock=!1}}getOutput(){return this.ctx.output}getExitCode(){return this.ctx.exitCode}getContext(){return this.ctx}async matchesRule(t,n){this.assertDefenseContext("rule matching");let i=t.pattern;if(!i)return!0;switch(i.type){case"begin":case"end":return!1;case"regex_pattern":return K(i.pattern,this.ctx.line);case"expr_pattern":return b(await this.withDefenseContext("expression pattern evaluation",()=>f(this.ctx,i.expression)));case"range":{let s=await this.withDefenseContext("range start pattern",()=>this.matchPattern(i.start)),a=await this.withDefenseContext("range end pattern",()=>this.matchPattern(i.end));return this.rangeStates[n]?(a&&(this.rangeStates[n]=!1),!0):s?(this.rangeStates[n]=!0,a&&(this.rangeStates[n]=!1),!0):!1}default:return!1}}async matchPattern(t){switch(this.assertDefenseContext("pattern matching"),t.type){case"regex_pattern":return K(t.pattern,this.ctx.line);case"expr_pattern":return b(await this.withDefenseContext("nested expression pattern",()=>f(this.ctx,t.expression)));default:return!1}}};var r;(function(e){e.NUMBER="NUMBER",e.STRING="STRING",e.REGEX="REGEX",e.IDENT="IDENT",e.BEGIN="BEGIN",e.END="END",e.IF="IF",e.ELSE="ELSE",e.WHILE="WHILE",e.DO="DO",e.FOR="FOR",e.IN="IN",e.BREAK="BREAK",e.CONTINUE="CONTINUE",e.NEXT="NEXT",e.NEXTFILE="NEXTFILE",e.EXIT="EXIT",e.RETURN="RETURN",e.DELETE="DELETE",e.FUNCTION="FUNCTION",e.PRINT="PRINT",e.PRINTF="PRINTF",e.GETLINE="GETLINE",e.PLUS="PLUS",e.MINUS="MINUS",e.STAR="STAR",e.SLASH="SLASH",e.PERCENT="PERCENT",e.CARET="CARET",e.EQ="EQ",e.NE="NE",e.LT="LT",e.GT="GT",e.LE="LE",e.GE="GE",e.MATCH="MATCH",e.NOT_MATCH="NOT_MATCH",e.AND="AND",e.OR="OR",e.NOT="NOT",e.ASSIGN="ASSIGN",e.PLUS_ASSIGN="PLUS_ASSIGN",e.MINUS_ASSIGN="MINUS_ASSIGN",e.STAR_ASSIGN="STAR_ASSIGN",e.SLASH_ASSIGN="SLASH_ASSIGN",e.PERCENT_ASSIGN="PERCENT_ASSIGN",e.CARET_ASSIGN="CARET_ASSIGN",e.INCREMENT="INCREMENT",e.DECREMENT="DECREMENT",e.QUESTION="QUESTION",e.COLON="COLON",e.COMMA="COMMA",e.SEMICOLON="SEMICOLON",e.NEWLINE="NEWLINE",e.LPAREN="LPAREN",e.RPAREN="RPAREN",e.LBRACE="LBRACE",e.RBRACE="RBRACE",e.LBRACKET="LBRACKET",e.RBRACKET="RBRACKET",e.DOLLAR="DOLLAR",e.APPEND="APPEND",e.PIPE="PIPE",e.EOF="EOF"})(r||(r={}));var _t=new Map([["BEGIN",r.BEGIN],["END",r.END],["if",r.IF],["else",r.ELSE],["while",r.WHILE],["do",r.DO],["for",r.FOR],["in",r.IN],["break",r.BREAK],["continue",r.CONTINUE],["next",r.NEXT],["nextfile",r.NEXTFILE],["exit",r.EXIT],["return",r.RETURN],["delete",r.DELETE],["function",r.FUNCTION],["print",r.PRINT],["printf",r.PRINTF],["getline",r.GETLINE]]);function Gt(e){return e.replace(/\[\[:space:\]\]/g,"[ \\t\\n\\r\\f\\v]").replace(/\[\[:blank:\]\]/g,"[ \\t]").replace(/\[\[:alpha:\]\]/g,"[a-zA-Z]").replace(/\[\[:digit:\]\]/g,"[0-9]").replace(/\[\[:alnum:\]\]/g,"[a-zA-Z0-9]").replace(/\[\[:upper:\]\]/g,"[A-Z]").replace(/\[\[:lower:\]\]/g,"[a-z]").replace(/\[\[:punct:\]\]/g,"[!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~]").replace(/\[\[:xdigit:\]\]/g,"[0-9A-Fa-f]").replace(/\[\[:graph:\]\]/g,"[!-~]").replace(/\[\[:print:\]\]/g,"[ -~]").replace(/\[\[:cntrl:\]\]/g,"[\\x00-\\x1f\\x7f]")}var xt=new Set([r.COMMA,r.LBRACE,r.AND,r.OR,r.QUESTION,r.COLON,r.DO,r.ELSE,r.IF,r.WHILE]),ee=class{input;pos=0;line=1;column=1;lastTokenType=null;constructor(t){this.input=t}tokenize(){let t=[];for(;this.pos<this.input.length;){let n=this.nextToken();n&&(t.push(n),this.lastTokenType=n.type)}return t.push(this.makeToken(r.EOF,"")),t}makeToken(t,n){return{type:t,value:n,line:this.line,column:this.column}}peek(t=0){return this.input[this.pos+t]||""}advance(){let t=this.input[this.pos++]||"";return t===`
8
+ `?(this.line++,this.column=1):this.column++,t}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.peek();if(t===" "||t===" "||t==="\r")this.advance();else if(t==="\\")if(this.peek(1)===`
9
+ `)this.advance(),this.advance();else break;else if(t==="#")for(;this.pos<this.input.length&&this.peek()!==`
10
+ `;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let t=this.line,n=this.column,i=this.peek();return i===`
11
+ `?(this.advance(),this.lastTokenType!==null&&xt.has(this.lastTokenType)?this.nextToken():{type:r.NEWLINE,value:`
12
+ `,line:t,column:n}):i==='"'?this.readString():i==="/"&&this.canBeRegex()?this.readRegex():this.isDigit(i)||i==="."&&this.isDigit(this.peek(1))?this.readNumber():this.isAlpha(i)||i==="_"?this.readIdentifier():this.readOperator()}canBeRegex(){return new Set([null,r.NEWLINE,r.SEMICOLON,r.LBRACE,r.RBRACE,r.LPAREN,r.LBRACKET,r.COMMA,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.AND,r.OR,r.NOT,r.MATCH,r.NOT_MATCH,r.QUESTION,r.COLON,r.LT,r.GT,r.LE,r.GE,r.EQ,r.NE,r.PLUS,r.MINUS,r.STAR,r.PERCENT,r.CARET,r.PRINT,r.PRINTF,r.IF,r.WHILE,r.DO,r.FOR,r.RETURN]).has(this.lastTokenType)}readString(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos<this.input.length&&this.peek()!=='"';)if(this.peek()==="\\"){this.advance();let s=this.advance();switch(s){case"n":i+=`
13
+ `;break;case"t":i+=" ";break;case"r":i+="\r";break;case"f":i+="\f";break;case"b":i+="\b";break;case"v":i+="\v";break;case"a":i+="\x07";break;case"\\":i+="\\";break;case'"':i+='"';break;case"/":i+="/";break;case"x":{let a="";for(;a.length<2&&/[0-9a-fA-F]/.test(this.peek());)a+=this.advance();a.length>0?i+=String.fromCharCode(parseInt(a,16)):i+="x";break}default:if(/[0-7]/.test(s)){let a=s;for(;a.length<3&&/[0-7]/.test(this.peek());)a+=this.advance();i+=String.fromCharCode(parseInt(a,8))}else i+=s}}else i+=this.advance();return this.peek()==='"'&&this.advance(),{type:r.STRING,value:i,line:t,column:n}}readRegex(){let t=this.line,n=this.column;this.advance();let i="";for(;this.pos<this.input.length&&this.peek()!=="/";)if(this.peek()==="\\")i+=this.advance(),this.pos<this.input.length&&(i+=this.advance());else{if(this.peek()===`
14
+ `)break;i+=this.advance()}return this.peek()==="/"&&this.advance(),i=Gt(i),{type:r.REGEX,value:i,line:t,column:n}}readNumber(){let t=this.line,n=this.column,i="";for(;this.isDigit(this.peek());)i+=this.advance();if(this.peek()==="."&&this.isDigit(this.peek(1)))for(i+=this.advance();this.isDigit(this.peek());)i+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(i+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(i+=this.advance());this.isDigit(this.peek());)i+=this.advance();return{type:r.NUMBER,value:parseFloat(i),line:t,column:n}}readIdentifier(){let t=this.line,n=this.column,i="";for(;this.isAlphaNumeric(this.peek())||this.peek()==="_";)i+=this.advance();let s=_t.get(i);return s!==void 0?{type:s,value:i,line:t,column:n}:{type:r.IDENT,value:i,line:t,column:n}}readOperator(){let t=this.line,n=this.column,i=this.advance(),s=this.peek();switch(i){case"+":return s==="+"?(this.advance(),{type:r.INCREMENT,value:"++",line:t,column:n}):s==="="?(this.advance(),{type:r.PLUS_ASSIGN,value:"+=",line:t,column:n}):{type:r.PLUS,value:"+",line:t,column:n};case"-":return s==="-"?(this.advance(),{type:r.DECREMENT,value:"--",line:t,column:n}):s==="="?(this.advance(),{type:r.MINUS_ASSIGN,value:"-=",line:t,column:n}):{type:r.MINUS,value:"-",line:t,column:n};case"*":return s==="*"?(this.advance(),{type:r.CARET,value:"**",line:t,column:n}):s==="="?(this.advance(),{type:r.STAR_ASSIGN,value:"*=",line:t,column:n}):{type:r.STAR,value:"*",line:t,column:n};case"/":return s==="="?(this.advance(),{type:r.SLASH_ASSIGN,value:"/=",line:t,column:n}):{type:r.SLASH,value:"/",line:t,column:n};case"%":return s==="="?(this.advance(),{type:r.PERCENT_ASSIGN,value:"%=",line:t,column:n}):{type:r.PERCENT,value:"%",line:t,column:n};case"^":return s==="="?(this.advance(),{type:r.CARET_ASSIGN,value:"^=",line:t,column:n}):{type:r.CARET,value:"^",line:t,column:n};case"=":return s==="="?(this.advance(),{type:r.EQ,value:"==",line:t,column:n}):{type:r.ASSIGN,value:"=",line:t,column:n};case"!":return s==="="?(this.advance(),{type:r.NE,value:"!=",line:t,column:n}):s==="~"?(this.advance(),{type:r.NOT_MATCH,value:"!~",line:t,column:n}):{type:r.NOT,value:"!",line:t,column:n};case"<":return s==="="?(this.advance(),{type:r.LE,value:"<=",line:t,column:n}):{type:r.LT,value:"<",line:t,column:n};case">":return s==="="?(this.advance(),{type:r.GE,value:">=",line:t,column:n}):s===">"?(this.advance(),{type:r.APPEND,value:">>",line:t,column:n}):{type:r.GT,value:">",line:t,column:n};case"&":return s==="&"?(this.advance(),{type:r.AND,value:"&&",line:t,column:n}):{type:r.IDENT,value:"&",line:t,column:n};case"|":return s==="|"?(this.advance(),{type:r.OR,value:"||",line:t,column:n}):{type:r.PIPE,value:"|",line:t,column:n};case"~":return{type:r.MATCH,value:"~",line:t,column:n};case"?":return{type:r.QUESTION,value:"?",line:t,column:n};case":":return{type:r.COLON,value:":",line:t,column:n};case",":return{type:r.COMMA,value:",",line:t,column:n};case";":return{type:r.SEMICOLON,value:";",line:t,column:n};case"(":return{type:r.LPAREN,value:"(",line:t,column:n};case")":return{type:r.RPAREN,value:")",line:t,column:n};case"{":return{type:r.LBRACE,value:"{",line:t,column:n};case"}":return{type:r.RBRACE,value:"}",line:t,column:n};case"[":return{type:r.LBRACKET,value:"[",line:t,column:n};case"]":return{type:r.RBRACKET,value:"]",line:t,column:n};case"$":return{type:r.DOLLAR,value:"$",line:t,column:n};default:return{type:r.IDENT,value:i,line:t,column:n}}}isDigit(t){return t>="0"&&t<="9"}isAlpha(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isAlphaNumeric(t){return this.isDigit(t)||this.isAlpha(t)}};var p={LPAREN:"LPAREN",RPAREN:"RPAREN",QUESTION:"QUESTION",NEWLINE:"NEWLINE",SEMICOLON:"SEMICOLON",RBRACE:"RBRACE",COMMA:"COMMA",PIPE:"PIPE",GT:"GT",APPEND:"APPEND",AND:"AND",OR:"OR",ASSIGN:"ASSIGN",PLUS_ASSIGN:"PLUS_ASSIGN",MINUS_ASSIGN:"MINUS_ASSIGN",STAR_ASSIGN:"STAR_ASSIGN",SLASH_ASSIGN:"SLASH_ASSIGN",PERCENT_ASSIGN:"PERCENT_ASSIGN",CARET_ASSIGN:"CARET_ASSIGN",RBRACKET:"RBRACKET",COLON:"COLON",IN:"IN",PRINT:"PRINT",PRINTF:"PRINTF",IDENT:"IDENT",LT:"LT",LE:"LE",GE:"GE",EQ:"EQ",NE:"NE",MATCH:"MATCH",NOT_MATCH:"NOT_MATCH",NUMBER:"NUMBER",STRING:"STRING",DOLLAR:"DOLLAR",NOT:"NOT",MINUS:"MINUS",PLUS:"PLUS",INCREMENT:"INCREMENT",DECREMENT:"DECREMENT"};function Fe(e){e.expect(p.PRINT);let t=[];if(e.check(p.NEWLINE)||e.check(p.SEMICOLON)||e.check(p.RBRACE)||e.check(p.PIPE)||e.check(p.GT)||e.check(p.APPEND))t.push({type:"field",index:{type:"number",value:0}});else for(t.push(te(e));e.check(p.COMMA);)e.advance(),t.push(te(e));let n;return e.check(p.GT)?(e.advance(),n={redirect:">",file:e.parsePrimary()}):e.check(p.APPEND)&&(e.advance(),n={redirect:">>",file:e.parsePrimary()}),{type:"print",args:t,output:n}}function te(e){return Ut(e)?ce(e,!0):ce(e,!1)}function ce(e,t){let n=t?e.parseTernary():Bt(e);if(e.match(p.ASSIGN,p.PLUS_ASSIGN,p.MINUS_ASSIGN,p.STAR_ASSIGN,p.SLASH_ASSIGN,p.PERCENT_ASSIGN,p.CARET_ASSIGN)){let i=e.advance(),s=ce(e,t);if(n.type!=="variable"&&n.type!=="field"&&n.type!=="array_access")throw new Error("Invalid assignment target");return{type:"assignment",operator:new Map([["=","="],["+=","+="],["-=","-="],["*=","*="],["/=","/="],["%=","%="],["^=","^="]]).get(i.value)??"=",target:n,value:s}}return n}function Ut(e){let t=0,n=e.pos;for(;n<e.tokens.length;){let i=e.tokens[n];if(i.type===p.LPAREN&&t++,i.type===p.RPAREN&&t--,i.type===p.QUESTION&&t===0)return!0;if(i.type===p.NEWLINE||i.type===p.SEMICOLON||i.type===p.RBRACE||i.type===p.COMMA||i.type===p.PIPE)return!1;n++}return!1}function Bt(e){let t=Le(e);for(;e.check(p.OR);){e.advance();let n=Le(e);t={type:"binary",operator:"||",left:t,right:n}}return t}function Le(e){let t=Me(e);for(;e.check(p.AND);){e.advance();let n=Me(e);t={type:"binary",operator:"&&",left:t,right:n}}return t}function Me(e){let t=Ht(e);if(e.check(p.IN)){e.advance();let n=String(e.expect(p.IDENT).value);return{type:"in",key:t,array:n}}return t}function Ht(e){let t=Pe(e);for(;$t(e)&&!Wt(e);){let n=Pe(e);t={type:"binary",operator:" ",left:t,right:n}}return t}function Pe(e){let t=Te(e);for(;e.match(p.MATCH,p.NOT_MATCH);){let n=e.advance().type===p.MATCH?"~":"!~",i=Te(e);t={type:"binary",operator:n,left:t,right:i}}return t}function Te(e){let t=e.parseAddSub();for(;e.match(p.LT,p.LE,p.GE,p.EQ,p.NE);){let n=e.advance(),i=e.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}function $t(e){return e.match(p.NUMBER,p.STRING,p.IDENT,p.DOLLAR,p.LPAREN,p.NOT,p.MINUS,p.PLUS,p.INCREMENT,p.DECREMENT)}function Wt(e){return e.match(p.AND,p.OR,p.QUESTION,p.ASSIGN,p.PLUS_ASSIGN,p.MINUS_ASSIGN,p.STAR_ASSIGN,p.SLASH_ASSIGN,p.PERCENT_ASSIGN,p.CARET_ASSIGN,p.COMMA,p.SEMICOLON,p.NEWLINE,p.RBRACE,p.RPAREN,p.RBRACKET,p.COLON,p.PIPE,p.APPEND,p.GT,p.IN)}function De(e){e.expect(p.PRINTF);let t=e.check(p.LPAREN);t&&(e.advance(),e.skipNewlines());let n=t?e.parseExpression():te(e),i=[];for(;e.check(p.COMMA);)e.advance(),t&&e.skipNewlines(),i.push(t?e.parseExpression():te(e));t&&(e.skipNewlines(),e.expect(p.RPAREN));let s;return e.check(p.GT)?(e.advance(),s={redirect:">",file:e.parsePrimary()}):e.check(p.APPEND)&&(e.advance(),s={redirect:">>",file:e.parsePrimary()}),{type:"printf",format:n,args:i,output:s}}var ne=class{tokens=[];pos=0;parse(t){let n=new ee(t);return this.tokens=n.tokenize(),this.pos=0,this.parseProgram()}setPos(t){this.pos=t}current(){return this.tokens[this.pos]||{type:r.EOF,value:"",line:0,column:0}}advance(){let t=this.current();return this.pos<this.tokens.length&&this.pos++,t}match(...t){return t.includes(this.current().type)}check(t){return this.current().type===t}expect(t,n){if(!this.check(t)){let i=this.current();throw new Error(n||`Expected ${t}, got ${i.type} at line ${i.line}:${i.column}`)}return this.advance()}skipNewlines(){for(;this.check(r.NEWLINE);)this.advance()}skipTerminators(){for(;this.check(r.NEWLINE)||this.check(r.SEMICOLON);)this.advance()}parseProgram(){let t=[],n=[];for(this.skipNewlines();!this.check(r.EOF)&&(this.skipNewlines(),!this.check(r.EOF));)this.check(r.FUNCTION)?t.push(this.parseFunction()):n.push(this.parseRule()),this.skipTerminators();return{functions:t,rules:n}}parseFunction(){this.expect(r.FUNCTION);let t=this.expect(r.IDENT).value;this.expect(r.LPAREN);let n=[];if(!this.check(r.RPAREN))for(n.push(this.expect(r.IDENT).value);this.check(r.COMMA);)this.advance(),n.push(this.expect(r.IDENT).value);this.expect(r.RPAREN),this.skipNewlines();let i=this.parseBlock();return{name:t,params:n,body:i}}parseRule(){let t;if(this.check(r.BEGIN))this.advance(),t={type:"begin"};else if(this.check(r.END))this.advance(),t={type:"end"};else if(this.check(r.LBRACE))t=void 0;else if(this.check(r.REGEX)){let i=this.advance();if(this.check(r.AND)||this.check(r.OR)){let s={type:"binary",operator:"~",left:{type:"field",index:{type:"number",value:0}},right:{type:"regex",pattern:i.value}};t={type:"expr_pattern",expression:this.parseLogicalOrRest(s)}}else{let s={type:"regex_pattern",pattern:i.value};if(this.check(r.COMMA)){this.advance();let a;this.check(r.REGEX)?a={type:"regex_pattern",pattern:this.advance().value}:a={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:a}}else t=s}}else{let s={type:"expr_pattern",expression:this.parseExpression()};if(this.check(r.COMMA)){this.advance();let a;this.check(r.REGEX)?a={type:"regex_pattern",pattern:this.advance().value}:a={type:"expr_pattern",expression:this.parseExpression()},t={type:"range",start:s,end:a}}else t=s}this.skipNewlines();let n;return this.check(r.LBRACE)?n=this.parseBlock():n={type:"block",statements:[{type:"print",args:[{type:"field",index:{type:"number",value:0}}]}]},{pattern:t,action:n}}parseBlock(){this.expect(r.LBRACE),this.skipNewlines();let t=[];for(;!this.check(r.RBRACE)&&!this.check(r.EOF);)t.push(this.parseStatement()),this.skipTerminators();return this.expect(r.RBRACE),{type:"block",statements:t}}parseStatement(){if(this.check(r.SEMICOLON)||this.check(r.NEWLINE))return this.advance(),{type:"block",statements:[]};if(this.check(r.LBRACE))return this.parseBlock();if(this.check(r.IF))return this.parseIf();if(this.check(r.WHILE))return this.parseWhile();if(this.check(r.DO))return this.parseDoWhile();if(this.check(r.FOR))return this.parseFor();if(this.check(r.BREAK))return this.advance(),{type:"break"};if(this.check(r.CONTINUE))return this.advance(),{type:"continue"};if(this.check(r.NEXT))return this.advance(),{type:"next"};if(this.check(r.NEXTFILE))return this.advance(),{type:"nextfile"};if(this.check(r.EXIT)){this.advance();let n;return!this.check(r.NEWLINE)&&!this.check(r.SEMICOLON)&&!this.check(r.RBRACE)&&!this.check(r.EOF)&&(n=this.parseExpression()),{type:"exit",code:n}}if(this.check(r.RETURN)){this.advance();let n;return!this.check(r.NEWLINE)&&!this.check(r.SEMICOLON)&&!this.check(r.RBRACE)&&!this.check(r.EOF)&&(n=this.parseExpression()),{type:"return",value:n}}if(this.check(r.DELETE)){this.advance();let n=this.parsePrimary();if(n.type!=="array_access"&&n.type!=="variable")throw new Error("delete requires array element or array");return{type:"delete",target:n}}return this.check(r.PRINT)?Fe(this):this.check(r.PRINTF)?De(this):{type:"expr_stmt",expression:this.parseExpression()}}parseIf(){this.expect(r.IF),this.expect(r.LPAREN);let t=this.parseExpression();this.expect(r.RPAREN),this.skipNewlines();let n=this.parseStatement();this.skipTerminators();let i;return this.check(r.ELSE)&&(this.advance(),this.skipNewlines(),i=this.parseStatement()),{type:"if",condition:t,consequent:n,alternate:i}}parseWhile(){this.expect(r.WHILE),this.expect(r.LPAREN);let t=this.parseExpression();this.expect(r.RPAREN),this.skipNewlines();let n=this.parseStatement();return{type:"while",condition:t,body:n}}parseDoWhile(){this.expect(r.DO),this.skipNewlines();let t=this.parseStatement();this.skipNewlines(),this.expect(r.WHILE),this.expect(r.LPAREN);let n=this.parseExpression();return this.expect(r.RPAREN),{type:"do_while",body:t,condition:n}}parseFor(){if(this.expect(r.FOR),this.expect(r.LPAREN),this.check(r.IDENT)){let a=this.advance();if(this.check(r.IN)){this.advance();let o=this.expect(r.IDENT).value;this.expect(r.RPAREN),this.skipNewlines();let l=this.parseStatement();return{type:"for_in",variable:a.value,array:o,body:l}}this.pos--}let t;this.check(r.SEMICOLON)||(t=this.parseExpression()),this.expect(r.SEMICOLON);let n;this.check(r.SEMICOLON)||(n=this.parseExpression()),this.expect(r.SEMICOLON);let i;this.check(r.RPAREN)||(i=this.parseExpression()),this.expect(r.RPAREN),this.skipNewlines();let s=this.parseStatement();return{type:"for",init:t,condition:n,update:i,body:s}}parseExpression(){return this.parseAssignment()}parseAssignment(){let t=this.parseTernary();if(this.match(r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN)){let n=this.advance(),i=this.parseAssignment();if(t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid assignment target");let s=new Set(["=","+=","-=","*=","/=","%=","^="]),a=n.value;if(!s.has(a))throw new Error(`Unknown assignment operator: ${a}`);return{type:"assignment",operator:a,target:t,value:i}}return t}parseTernary(){let t=this.parsePipeGetline();if(this.check(r.QUESTION)){this.advance();let n=this.parseExpression();this.expect(r.COLON);let i=this.parseExpression();t={type:"ternary",condition:t,consequent:n,alternate:i}}return t}parsePipeGetline(){let t=this.parseOr();if(this.check(r.PIPE)){if(this.advance(),!this.check(r.GETLINE))throw new Error("Expected 'getline' after '|' in expression context");this.advance();let n;return this.check(r.IDENT)&&(n=this.advance().value),{type:"getline",command:t,variable:n}}return t}parseOr(){let t=this.parseAnd();for(;this.check(r.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalOrRest(t){for(t=this.parseLogicalAndRest(t);this.check(r.OR);){this.advance();let n=this.parseAnd();t={type:"binary",operator:"||",left:t,right:n}}return t}parseLogicalAndRest(t){for(;this.check(r.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseAnd(){let t=this.parseIn();for(;this.check(r.AND);){this.advance();let n=this.parseIn();t={type:"binary",operator:"&&",left:t,right:n}}return t}parseIn(){let t=this.parseConcatenation();if(this.check(r.IN)){this.advance();let n=this.expect(r.IDENT).value;return{type:"in",key:t,array:n}}return t}parseConcatenation(){let t=this.parseMatch();for(;this.canStartExpression()&&!this.isConcatTerminator();){let n=this.parseMatch();t={type:"binary",operator:" ",left:t,right:n}}return t}parseMatch(){let t=this.parseComparison();for(;this.match(r.MATCH,r.NOT_MATCH);){let n=this.advance().type===r.MATCH?"~":"!~",i=this.parseComparison();t={type:"binary",operator:n,left:t,right:i}}return t}parseComparison(){let t=this.parseAddSub();for(;this.match(r.LT,r.LE,r.GT,r.GE,r.EQ,r.NE);){let n=this.advance(),i=this.parseAddSub();t={type:"binary",operator:new Map([["<","<"],["<=","<="],[">",">"],[">=",">="],["==","=="],["!=","!="]]).get(n.value)??"==",left:t,right:i}}return t}canStartExpression(){return this.match(r.NUMBER,r.STRING,r.IDENT,r.DOLLAR,r.LPAREN,r.NOT,r.MINUS,r.PLUS,r.INCREMENT,r.DECREMENT)}isConcatTerminator(){return this.match(r.AND,r.OR,r.QUESTION,r.ASSIGN,r.PLUS_ASSIGN,r.MINUS_ASSIGN,r.STAR_ASSIGN,r.SLASH_ASSIGN,r.PERCENT_ASSIGN,r.CARET_ASSIGN,r.COMMA,r.SEMICOLON,r.NEWLINE,r.RBRACE,r.RPAREN,r.RBRACKET,r.COLON,r.PIPE,r.APPEND,r.IN)}parseAddSub(){let t=this.parseMulDiv();for(;this.match(r.PLUS,r.MINUS);){let n=this.advance().value,i=this.parseMulDiv();t={type:"binary",operator:n,left:t,right:i}}return t}parseMulDiv(){let t=this.parseUnary();for(;this.match(r.STAR,r.SLASH,r.PERCENT);){let n=this.advance(),i=this.parseUnary();t={type:"binary",operator:new Map([["*","*"],["/","/"],["%","%"]]).get(n.value)??"*",left:t,right:i}}return t}parseUnary(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseUnary();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseUnary();return{type:"unary",operator:t,operand:n}}return this.parsePower()}parsePower(){let t=this.parsePostfix();if(this.check(r.CARET)){this.advance();let n=this.parsePower();t={type:"binary",operator:"^",left:t,right:n}}return t}parsePostfix(){let t=this.parsePrimary();if(this.check(r.INCREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid increment operand");return{type:"post_increment",operand:t}}if(this.check(r.DECREMENT)){if(this.advance(),t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access")throw new Error("Invalid decrement operand");return{type:"post_decrement",operand:t}}return t}parseFieldIndex(){if(this.check(r.INCREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"+",operand:{type:"unary",operator:"+",operand:t}}:{type:"pre_increment",operand:t}}if(this.check(r.DECREMENT)){this.advance();let t=this.parseFieldIndex();return t.type!=="variable"&&t.type!=="field"&&t.type!=="array_access"?{type:"unary",operator:"-",operand:{type:"unary",operator:"-",operand:t}}:{type:"pre_decrement",operand:t}}if(this.match(r.NOT,r.MINUS,r.PLUS)){let t=this.advance().value,n=this.parseFieldIndex();return{type:"unary",operator:t,operand:n}}return this.parseFieldIndexPower()}parseFieldIndexPower(){let t=this.parseFieldIndexPrimary();if(this.check(r.CARET)){this.advance();let n=this.parseFieldIndexPower();t={type:"binary",operator:"^",left:t,right:n}}return t}parseFieldIndexPrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();return this.expect(r.RPAREN),t}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=this.parseExpression();if(this.check(r.COMMA)){let i=[n];for(;this.check(r.COMMA);)this.advance(),i.push(this.parseExpression());this.expect(r.RBRACKET);let s=i.reduce((a,o)=>({type:"binary",operator:" ",left:{type:"binary",operator:" ",left:a,right:{type:"variable",name:"SUBSEP"}},right:o}));return{type:"array_access",array:t,key:s}}return this.expect(r.RBRACKET),{type:"array_access",array:t,key:n}}return{type:"variable",name:t}}throw new Error(`Unexpected token in field index: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}parsePrimary(){if(this.check(r.NUMBER))return{type:"number",value:this.advance().value};if(this.check(r.STRING))return{type:"string",value:this.advance().value};if(this.check(r.REGEX))return{type:"regex",pattern:this.advance().value};if(this.check(r.DOLLAR))return this.advance(),{type:"field",index:this.parseFieldIndex()};if(this.check(r.LPAREN)){this.advance();let t=this.parseExpression();if(this.check(r.COMMA)){let n=[t];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());return this.expect(r.RPAREN),{type:"tuple",elements:n}}return this.expect(r.RPAREN),t}if(this.check(r.GETLINE)){this.advance();let t,n;return this.check(r.IDENT)&&(t=this.advance().value),this.check(r.LT)&&(this.advance(),n=this.parsePrimary()),{type:"getline",variable:t,file:n}}if(this.check(r.IDENT)){let t=this.advance().value;if(this.check(r.LPAREN)){this.advance();let n=[];if(this.skipNewlines(),!this.check(r.RPAREN))for(n.push(this.parseExpression());this.check(r.COMMA);)this.advance(),this.skipNewlines(),n.push(this.parseExpression());return this.skipNewlines(),this.expect(r.RPAREN),{type:"call",name:t,args:n}}if(this.check(r.LBRACKET)){this.advance();let n=[this.parseExpression()];for(;this.check(r.COMMA);)this.advance(),n.push(this.parseExpression());this.expect(r.RBRACKET);let i;if(n.length===1)i=n[0];else{i=n[0];for(let s=1;s<n.length;s++)i={type:"binary",operator:" ",left:{type:"binary",operator:" ",left:i,right:{type:"variable",name:"SUBSEP"}},right:n[s]}}return{type:"array_access",array:t,key:i}}return{type:"variable",name:t}}throw new Error(`Unexpected token: ${this.current().type} at line ${this.current().line}:${this.current().column}`)}};var Vt={name:"awk",summary:"pattern scanning and text processing language",usage:"awk [OPTIONS] 'PROGRAM' [FILE...]",options:["-F FS use FS as field separator","-v VAR=VAL assign VAL to variable VAR"," --help display this help and exit"]},Vn={name:"awk",async execute(e,t){D(t.requireDefenseContext,"awk","execution entry");let n=(h,c)=>_(t.requireDefenseContext,"awk",h,c);if(fe(e))return pe(Vt);let i=new H(/\s+/),s=" ",a=Object.create(null),o=0;for(let h=0;h<e.length;h++){let c=e[h];if(c==="-F"&&h+1<e.length)s=he(e[++h]),i=_e(s),o=h+1;else if(c.startsWith("-F"))s=he(c.slice(2)),i=_e(s),o=h+1;else if(c==="-v"&&h+1<e.length){let E=e[++h],F=E.indexOf("=");if(F>0){let G=E.slice(0,F),xe=he(E.slice(F+1));a[G]=xe}o=h+1}else{if(c.startsWith("--"))return re("awk",c);if(c.startsWith("-")&&c.length>1){let E=c[1];if(E!=="F"&&E!=="v")return re("awk",`-${E}`);o=h+1}else if(!c.startsWith("-")){o=h;break}}}if(o>=e.length)return{stdout:"",stderr:`awk: missing program
15
+ `,exitCode:1};let l=e[o],u=e.slice(o+1),N=new ne,A;try{A=N.parse(l)}catch(h){return{stdout:"",stderr:`awk: ${h instanceof Error?h.message:String(h)}
16
+ `,exitCode:1}}let C={readFile:t.fs.readFile.bind(t.fs),writeFile:t.fs.writeFile.bind(t.fs),appendFile:async(h,c)=>{try{let E=await n("appendFile read",()=>t.fs.readFile(h));await n("appendFile write",()=>t.fs.writeFile(h,E+c))}catch(E){if(E instanceof x)throw E;await n("appendFile create",()=>t.fs.writeFile(h,c))}},resolvePath:t.fs.resolvePath.bind(t.fs)},O=t.exec,I=ie({fieldSep:i,maxIterations:t.limits?.maxAwkIterations,maxOutputSize:t.limits?.maxStringLength,fs:C,cwd:t.cwd,exec:O?h=>n("command pipe exec",()=>O(h,{cwd:t.cwd,signal:t.signal})):void 0,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext});I.FS=s,I.vars=Object.assign(Object.create(null),a),I.ARGC=u.length+1,I.ARGV=Object.create(null),I.ARGV[0]="awk";for(let h=0;h<u.length;h++)I.ARGV[String(h+1)]=u[h];I.ENVIRON=de(t.env);let w=new q(I);w.execute(A);let d=A.rules.some(h=>h.pattern?.type!=="begin"&&h.pattern?.type!=="end"),R=A.rules.some(h=>h.pattern?.type==="end");try{if(await n("BEGIN execution",()=>w.executeBegin()),I.shouldExit)return await n("END execution after BEGIN exit",()=>w.executeEnd()),{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()};if(!d&&!R)return{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()};let h=[];if(u.length>0)for(let c of u)try{let E=t.fs.resolvePath(t.cwd,c),G=(await n("input file read",()=>t.fs.readFile(E))).split(`
17
+ `);G.length>0&&G[G.length-1]===""&&G.pop(),h.push({filename:c,lines:G})}catch(E){if(E instanceof x)throw E;return{stdout:"",stderr:`awk: ${c}: No such file or directory
18
+ `,exitCode:1}}else{let c=t.stdin.split(`
19
+ `);c.length>0&&c[c.length-1]===""&&c.pop(),h.push({filename:"",lines:c})}for(let c of h){for(I.FILENAME=c.filename,I.FNR=0,I.lines=c.lines,I.lineIndex=-1,I.shouldNextFile=!1;I.lineIndex<c.lines.length-1;){I.lineIndex++;let E=I.lineIndex;if(await n("line execution",()=>w.executeLine(c.lines[E])),I.shouldExit||I.shouldNextFile)break}if(I.shouldExit)break}return await n("END execution",()=>w.executeEnd()),{stdout:w.getOutput(),stderr:"",exitCode:w.getExitCode()}}catch(h){if(h instanceof x)throw h;let c=h instanceof Error?h.message:String(h),E=h instanceof P?P.EXIT_CODE:2;return{stdout:w.getOutput(),stderr:`awk: ${c}
20
+ `,exitCode:E}}}};function he(e){return e.replace(/\\t/g," ").replace(/\\n/g,`
21
+ `).replace(/\\r/g,"\r").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\a/g,"\x07").replace(/\\v/g,"\v").replace(/\\\\/g,"\\")}function _e(e){if(e===" ")return v("\\s+");if(/[[\](){}.*+?^$|\\]/.test(e))try{return v(e)}catch{return v(Ge(e))}return v(Ge(e))}function Ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Kn={name:"awk",flags:[{flag:"-F",type:"value",valueHint:"delimiter"},{flag:"-v",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{Vn as a,Kn as b};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ async function c(e,t){if(e.length>0&&e[0]!=="-"){let i=t.fs.resolvePath(t.cwd,e[0]);try{let s=(await t.fs.readFile(i)).split(`
3
+ `);s[s.length-1]===""&&s.pop();let r=s.reverse();return{stdout:r.length>0?`${r.join(`
4
+ `)}
5
+ `:"",stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`tac: ${e[0]}: No such file or directory
6
+ `,exitCode:1}}}let n=t.stdin.split(`
7
+ `);n[n.length-1]===""&&n.pop();let o=n.reverse();return{stdout:o.length>0?`${o.join(`
8
+ `)}
9
+ `:"",stderr:"",exitCode:0}}var l={name:"tac",execute:c},a={name:"tac",flags:[],stdinType:"text",needsFiles:!0};export{l as a,a as b};
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import{b as w}from"./chunk-5WFYIUU2.js";import{a as F,b as N,c as k}from"./chunk-GTNBSMZR.js";var A=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),P=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]]);function O(u){let r=u.trim(),e=r.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!e){let n=parseFloat(r);return Number.isNaN(n)?0:n}let l=parseFloat(e[1]),s=(e[2]||"").toLowerCase(),i=A.get(s)??1;return l*i}function x(u){let r=u.trim().toLowerCase().slice(0,3);return P.get(r)??0}function D(u,r){let e=u.split(/(\d+)/),l=r.split(/(\d+)/),s=Math.max(e.length,l.length);for(let i=0;i<s;i++){let n=e[i]||"",d=l[i]||"",o=/^\d+$/.test(n)?parseInt(n,10):null,c=/^\d+$/.test(d)?parseInt(d,10):null;if(o!==null&&c!==null){if(o!==c)return o-c}else if(n!==d)return n.localeCompare(d)}return 0}function M(u){return u.replace(/[^a-zA-Z0-9\s]/g,"")}function v(u,r,e){let l=e!==null?e:/\s+/,s=u.split(l),i=r.startField-1;if(i>=s.length)return"";if(r.endField===void 0){let o=s[i]||"";return r.startChar!==void 0&&(o=o.slice(r.startChar-1)),r.ignoreLeading&&(o=o.trimStart()),o}let n=Math.min(r.endField-1,s.length-1),d="";for(let o=i;o<=n&&o<s.length;o++){let c=s[o]||"";if(o===i&&r.startChar!==void 0&&(c=c.slice(r.startChar-1)),o===n&&r.endChar!==void 0){let t=o===i&&r.startChar!==void 0?r.endChar-r.startChar+1:r.endChar;c=c.slice(0,t)}o>i&&(d+=e||" "),d+=c}return r.ignoreLeading&&(d=d.trimStart()),d}function L(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=M(l),s=M(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=x(l),n=x(s);return i-n}if(e.humanNumeric){let i=O(l),n=O(s);return i-n}if(e.versionSort)return D(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function I(u){let{keys:r,fieldDelimiter:e,numeric:l,ignoreCase:s,reverse:i,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c,ignoreLeadingBlanks:t,stable:a}=u;return(f,C)=>{let g=f,b=C;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=L(g,b,{numeric:l,ignoreCase:s,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c});if(h!==0)return i?-h:h;if(!a){let p=f.localeCompare(C);return i?-p:p}return 0}for(let m of r){let h=v(g,m,e),p=v(b,m,e);m.ignoreLeading&&(h=h.trimStart(),p=p.trimStart());let B={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},V=m.reverse??i,S=L(h,p,B);if(S!==0)return V?-S:S}if(!a){let m=f.localeCompare(C);return i?-m:m}return 0}}function E(u,r){if(r.keys.length===0){if(r.ignoreCase){let s=new Set;return u.filter(i=>{let n=i.toLowerCase();return s.has(n)?!1:(s.add(n),!0)})}return[...new Set(u)]}let e=r.keys[0],l=new Set;return u.filter(s=>{let i=v(s,e,r.fieldDelimiter);return(e.ignoreCase??r.ignoreCase)&&(i=i.toLowerCase()),l.has(i)?!1:(l.add(i),!0)})}function y(u){let r={startField:1},e="",l=u,s=l.match(/([bdfhMnrV]+)$/);s&&(e=s[1],l=l.slice(0,-e.length)),e.includes("n")&&(r.numeric=!0),e.includes("r")&&(r.reverse=!0),e.includes("f")&&(r.ignoreCase=!0),e.includes("b")&&(r.ignoreLeading=!0),e.includes("h")&&(r.humanNumeric=!0),e.includes("V")&&(r.versionSort=!0),e.includes("d")&&(r.dictionaryOrder=!0),e.includes("M")&&(r.monthSort=!0);let i=l.split(",");if(i.length===0||i[0]==="")return null;let n=i[0].split("."),d=parseInt(n[0],10);if(Number.isNaN(d)||d<1)return null;if(r.startField=d,n.length>1&&n[1]){let o=parseInt(n[1],10);!Number.isNaN(o)&&o>=1&&(r.startChar=o)}if(i.length>1&&i[1]){let o=i[1],c=o.match(/([bdfhMnrV]+)$/);if(c){let a=c[1];a.includes("n")&&(r.numeric=!0),a.includes("r")&&(r.reverse=!0),a.includes("f")&&(r.ignoreCase=!0),a.includes("b")&&(r.ignoreLeading=!0),a.includes("h")&&(r.humanNumeric=!0),a.includes("V")&&(r.versionSort=!0),a.includes("d")&&(r.dictionaryOrder=!0),a.includes("M")&&(r.monthSort=!0),o=o.slice(0,-a.length)}let t=o.split(".");if(t[0]){let a=parseInt(t[0],10);if(!Number.isNaN(a)&&a>=1&&(r.endField=a),t.length>1&&t[1]){let f=parseInt(t[1],10);!Number.isNaN(f)&&f>=1&&(r.endChar=f)}}}return r}var q={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
3
+ F is a field number (1-indexed)
4
+ C is a character position within the field (1-indexed)
5
+ OPTS can be: b d f h M n r V (per-key modifiers)
6
+
7
+ Examples:
8
+ -k1 sort by first field
9
+ -k2,2 sort by second field only
10
+ -k1.3 sort by first field starting at 3rd character
11
+ -k1,2n sort by fields 1-2 numerically
12
+ -k2 -k1 sort by field 2, then by field 1`},j={name:"sort",async execute(u,r){if(N(u))return F(q);let e={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},l=[];for(let c=0;c<u.length;c++){let t=u[c];if(t==="-r"||t==="--reverse")e.reverse=!0;else if(t==="-n"||t==="--numeric-sort")e.numeric=!0;else if(t==="-u"||t==="--unique")e.unique=!0;else if(t==="-f"||t==="--ignore-case")e.ignoreCase=!0;else if(t==="-h"||t==="--human-numeric-sort")e.humanNumeric=!0;else if(t==="-V"||t==="--version-sort")e.versionSort=!0;else if(t==="-d"||t==="--dictionary-order")e.dictionaryOrder=!0;else if(t==="-M"||t==="--month-sort")e.monthSort=!0;else if(t==="-b"||t==="--ignore-leading-blanks")e.ignoreLeadingBlanks=!0;else if(t==="-s"||t==="--stable")e.stable=!0;else if(t==="-c"||t==="--check")e.checkOnly=!0;else if(t==="-o"||t==="--output")e.outputFile=u[++c]||null;else if(t.startsWith("-o"))e.outputFile=t.slice(2)||null;else if(t.startsWith("--output="))e.outputFile=t.slice(9)||null;else if(t==="-t"||t==="--field-separator")e.fieldDelimiter=u[++c]||null;else if(t.startsWith("-t"))e.fieldDelimiter=t.slice(2)||null;else if(t.startsWith("--field-separator="))e.fieldDelimiter=t.slice(18)||null;else if(t==="-k"||t==="--key"){let a=u[++c];if(a){let f=y(a);f&&e.keys.push(f)}}else if(t.startsWith("-k")){let a=y(t.slice(2));a&&e.keys.push(a)}else if(t.startsWith("--key=")){let a=y(t.slice(6));a&&e.keys.push(a)}else{if(t.startsWith("--"))return k("sort",t);if(t.startsWith("-")&&!t.startsWith("--")){let a=!1;for(let f of t.slice(1))if(f==="r")e.reverse=!0;else if(f==="n")e.numeric=!0;else if(f==="u")e.unique=!0;else if(f==="f")e.ignoreCase=!0;else if(f==="h")e.humanNumeric=!0;else if(f==="V")e.versionSort=!0;else if(f==="d")e.dictionaryOrder=!0;else if(f==="M")e.monthSort=!0;else if(f==="b")e.ignoreLeadingBlanks=!0;else if(f==="s")e.stable=!0;else if(f==="c")e.checkOnly=!0;else{a=!0;break}if(a)return k("sort",t)}else l.push(t)}}let s=await w(r,l,{cmdName:"sort"});if(!s.ok)return s.error;let n=s.content.split(`
13
+ `);n.length>0&&n[n.length-1]===""&&n.pop();let d=I(e);if(e.checkOnly){let c=l.length>0?l[0]:"-";for(let t=1;t<n.length;t++)if(d(n[t-1],n[t])>0)return{stdout:"",stderr:`sort: ${c}:${t+1}: disorder: ${n[t]}
14
+ `,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}n.sort(d),e.unique&&(n=E(n,e));let o=n.length>0?`${n.join(`
15
+ `)}
16
+ `:"";if(e.outputFile){let c=r.fs.resolvePath(r.cwd,e.outputFile);return await r.fs.writeFile(c,o,"binary"),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0,stdoutEncoding:"binary"}}},U={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0};export{j as a,U as b};