@demicodes/just-bash 3.0.1-demi.2

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 (903) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +201 -0
  3. package/README.md +620 -0
  4. package/dist/AGENTS.md +327 -0
  5. package/dist/Bash.d.ts +256 -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-YRVAW27Y.js +3 -0
  9. package/dist/bin/chunks/awk2-XSVZFGAA.js +3 -0
  10. package/dist/bin/chunks/base64-RZRLGMB3.js +3 -0
  11. package/dist/bin/chunks/basename-F3AQ4KAQ.js +3 -0
  12. package/dist/bin/chunks/bash-CLP24TE2.js +3 -0
  13. package/dist/bin/chunks/cat-LQH5FSAR.js +3 -0
  14. package/dist/bin/chunks/chmod-S564JCJW.js +3 -0
  15. package/dist/bin/chunks/chunk-22HCD466.js +3 -0
  16. package/dist/bin/chunks/chunk-2AIXTPH2.js +9 -0
  17. package/dist/bin/chunks/chunk-2ETT4ELS.js +4 -0
  18. package/dist/bin/chunks/chunk-2FCLTY3Z.js +15 -0
  19. package/dist/bin/chunks/chunk-2GG3NVC4.js +10 -0
  20. package/dist/bin/chunks/chunk-2NRAWO6E.js +7 -0
  21. package/dist/bin/chunks/chunk-2SVX7I5P.js +14 -0
  22. package/dist/bin/chunks/chunk-2TVVPMMT.js +34 -0
  23. package/dist/bin/chunks/chunk-3MRB66F4.js +3 -0
  24. package/dist/bin/chunks/chunk-3WIMLJM7.js +8 -0
  25. package/dist/bin/chunks/chunk-42Z7Z3TQ.js +288 -0
  26. package/dist/bin/chunks/chunk-4BNS566Q.js +4 -0
  27. package/dist/bin/chunks/chunk-52Z5MJO2.js +17 -0
  28. package/dist/bin/chunks/chunk-5WLKCCX7.js +6 -0
  29. package/dist/bin/chunks/chunk-5XSZHUEI.js +15 -0
  30. package/dist/bin/chunks/chunk-6FSBHK6H.js +22 -0
  31. package/dist/bin/chunks/chunk-6GSBC77G.js +22 -0
  32. package/dist/bin/chunks/chunk-6UL3WIEK.js +3 -0
  33. package/dist/bin/chunks/chunk-6WJQNLR2.js +7 -0
  34. package/dist/bin/chunks/chunk-77MLOOQS.js +11 -0
  35. package/dist/bin/chunks/chunk-7AYT3UKI.js +6 -0
  36. package/dist/bin/chunks/chunk-7GBHDJNC.js +34 -0
  37. package/dist/bin/chunks/chunk-7JZKVC3F.js +2 -0
  38. package/dist/bin/chunks/chunk-7NDRU2ZN.js +5 -0
  39. package/dist/bin/chunks/chunk-7UU7KPEM.js +7 -0
  40. package/dist/bin/chunks/chunk-7VCQWCSH.js +15 -0
  41. package/dist/bin/chunks/chunk-AGKL4LDL.js +4 -0
  42. package/dist/bin/chunks/chunk-AJF3OBTR.js +4 -0
  43. package/dist/bin/chunks/chunk-B2DRBHGQ.js +3 -0
  44. package/dist/bin/chunks/chunk-BE4PARL3.js +13 -0
  45. package/dist/bin/chunks/chunk-BGX3RW7H.js +10 -0
  46. package/dist/bin/chunks/chunk-BIJXTWZ4.js +3 -0
  47. package/dist/bin/chunks/chunk-BPZJYOUA.js +33 -0
  48. package/dist/bin/chunks/chunk-C7ISPH7Y.js +18 -0
  49. package/dist/bin/chunks/chunk-CAZ75E7E.js +3 -0
  50. package/dist/bin/chunks/chunk-DJAX3ZRG.js +8 -0
  51. package/dist/bin/chunks/chunk-DYIBFLS3.js +17 -0
  52. package/dist/bin/chunks/chunk-EDTBGO7F.js +37 -0
  53. package/dist/bin/chunks/chunk-F3GKANW3.js +12 -0
  54. package/dist/bin/chunks/chunk-F3WNDKOC.js +3 -0
  55. package/dist/bin/chunks/chunk-FKVQZWJQ.js +10 -0
  56. package/dist/bin/chunks/chunk-FX7BQD2Q.js +20 -0
  57. package/dist/bin/chunks/chunk-G4AUMZUY.js +4 -0
  58. package/dist/bin/chunks/chunk-H7JTIXAO.js +4 -0
  59. package/dist/bin/chunks/chunk-HADFAIPZ.js +17 -0
  60. package/dist/bin/chunks/chunk-HL4ZS7TX.js +6 -0
  61. package/dist/bin/chunks/chunk-HN2DCT7T.js +13 -0
  62. package/dist/bin/chunks/chunk-HSTAQAVQ.js +11 -0
  63. package/dist/bin/chunks/chunk-I4IRHQDW.js +3 -0
  64. package/dist/bin/chunks/chunk-IWXPUD2J.js +12 -0
  65. package/dist/bin/chunks/chunk-IZGLHVBB.js +8 -0
  66. package/dist/bin/chunks/chunk-J7TUF2VI.js +9 -0
  67. package/dist/bin/chunks/chunk-JXLDT4KX.js +4 -0
  68. package/dist/bin/chunks/chunk-KFMPGSUT.js +9 -0
  69. package/dist/bin/chunks/chunk-KI54R2QB.js +3 -0
  70. package/dist/bin/chunks/chunk-KRRM5UCC.js +3 -0
  71. package/dist/bin/chunks/chunk-KUMHQGUR.js +3 -0
  72. package/dist/bin/chunks/chunk-LNNWMRCB.js +3 -0
  73. package/dist/bin/chunks/chunk-LNVSXNT7.js +3 -0
  74. package/dist/bin/chunks/chunk-LZHWUYJZ.js +24 -0
  75. package/dist/bin/chunks/chunk-MLUOPG3W.js +3 -0
  76. package/dist/bin/chunks/chunk-MROECM42.js +3 -0
  77. package/dist/bin/chunks/chunk-MUFNRCMY.js +24 -0
  78. package/dist/bin/chunks/chunk-NE4R2FVV.js +5 -0
  79. package/dist/bin/chunks/chunk-NKAT2N47.js +7 -0
  80. package/dist/bin/chunks/chunk-NYIPFY36.js +3 -0
  81. package/dist/bin/chunks/chunk-O2BCKSMK.js +3 -0
  82. package/dist/bin/chunks/chunk-OLEQNRKX.js +8 -0
  83. package/dist/bin/chunks/chunk-OPMLWMNH.js +17 -0
  84. package/dist/bin/chunks/chunk-PAYQNSZN.js +18 -0
  85. package/dist/bin/chunks/chunk-PBOVSFTJ.js +3 -0
  86. package/dist/bin/chunks/chunk-PSGVOB5U.js +3 -0
  87. package/dist/bin/chunks/chunk-PXP4YYZA.js +13 -0
  88. package/dist/bin/chunks/chunk-PZQVSQX6.js +4 -0
  89. package/dist/bin/chunks/chunk-Q2GOPGDA.js +6 -0
  90. package/dist/bin/chunks/chunk-QL33F2W6.js +8 -0
  91. package/dist/bin/chunks/chunk-QPHXCMJV.js +80 -0
  92. package/dist/bin/chunks/chunk-RJUDCNEZ.js +29 -0
  93. package/dist/bin/chunks/chunk-RVPTAYDS.js +4 -0
  94. package/dist/bin/chunks/chunk-SAF4OIHD.js +20 -0
  95. package/dist/bin/chunks/chunk-SMLKRKMP.js +11 -0
  96. package/dist/bin/chunks/chunk-SMSELHIY.js +12 -0
  97. package/dist/bin/chunks/chunk-T74E2U4J.js +64 -0
  98. package/dist/bin/chunks/chunk-UO5LOD7U.js +12 -0
  99. package/dist/bin/chunks/chunk-UOMNSQEZ.js +10 -0
  100. package/dist/bin/chunks/chunk-UVKD35GR.js +9 -0
  101. package/dist/bin/chunks/chunk-V2RP73X4.js +15 -0
  102. package/dist/bin/chunks/chunk-VP3OTMHX.js +22 -0
  103. package/dist/bin/chunks/chunk-VZK4FHWJ.js +3 -0
  104. package/dist/bin/chunks/chunk-WDWNEHHE.js +9 -0
  105. package/dist/bin/chunks/chunk-X4MX6EHF.js +6 -0
  106. package/dist/bin/chunks/chunk-X5WRKSEU.js +101 -0
  107. package/dist/bin/chunks/chunk-XBB73LFB.js +5 -0
  108. package/dist/bin/chunks/chunk-XCUJL2AJ.js +141 -0
  109. package/dist/bin/chunks/chunk-XHCCSVP6.js +9 -0
  110. package/dist/bin/chunks/chunk-XJ37N3S5.js +7 -0
  111. package/dist/bin/chunks/chunk-XPTYN6UE.js +8 -0
  112. package/dist/bin/chunks/chunk-XRUDFQG5.js +7 -0
  113. package/dist/bin/chunks/chunk-YJ5OCPSK.js +7 -0
  114. package/dist/bin/chunks/chunk-YOIFOOGX.js +9 -0
  115. package/dist/bin/chunks/chunk-YOKQNNQO.js +6 -0
  116. package/dist/bin/chunks/chunk-YR32XGKD.js +3 -0
  117. package/dist/bin/chunks/chunk-YUZRUF5F.js +10 -0
  118. package/dist/bin/chunks/chunk-YY5PJR7O.js +7 -0
  119. package/dist/bin/chunks/chunk-ZAMAXG5K.js +85 -0
  120. package/dist/bin/chunks/chunk-ZFUVUYWG.js +15 -0
  121. package/dist/bin/chunks/clear-FGNEKYDU.js +3 -0
  122. package/dist/bin/chunks/column-AQB3A3PJ.js +3 -0
  123. package/dist/bin/chunks/comm-Q4VDF6ZO.js +3 -0
  124. package/dist/bin/chunks/cp-HYXTMN3D.js +3 -0
  125. package/dist/bin/chunks/curl-PLHETP4J.js +27 -0
  126. package/dist/bin/chunks/cut-ZI2HIAW7.js +3 -0
  127. package/dist/bin/chunks/date-OFYBOAUE.js +3 -0
  128. package/dist/bin/chunks/diff-TL7IV4S2.js +3 -0
  129. package/dist/bin/chunks/dirname-VCINTLPD.js +3 -0
  130. package/dist/bin/chunks/du-4LRQIGRG.js +3 -0
  131. package/dist/bin/chunks/echo-KCOHTNDF.js +3 -0
  132. package/dist/bin/chunks/env-NY32PQJM.js +3 -0
  133. package/dist/bin/chunks/expand-YYSO35NS.js +3 -0
  134. package/dist/bin/chunks/expansion-YT6DLHRE.js +3 -0
  135. package/dist/bin/chunks/expr-XNBNPKSF.js +3 -0
  136. package/dist/bin/chunks/file-U4GYVT3G.js +3 -0
  137. package/dist/bin/chunks/find-CZ6UMSZX.js +3 -0
  138. package/dist/bin/chunks/flag-coverage-MPBSMQIN.js +3 -0
  139. package/dist/bin/chunks/fold-5MF7QZWQ.js +3 -0
  140. package/dist/bin/chunks/grep-JCHLTP7S.js +3 -0
  141. package/dist/bin/chunks/gzip-UGBQQKIH.js +3 -0
  142. package/dist/bin/chunks/head-77V5O3RE.js +3 -0
  143. package/dist/bin/chunks/help-CGUEOGXQ.js +3 -0
  144. package/dist/bin/chunks/history-AQQWW3QB.js +3 -0
  145. package/dist/bin/chunks/hostname-USNWOQCK.js +3 -0
  146. package/dist/bin/chunks/html-to-markdown-PHASM44U.js +3 -0
  147. package/dist/bin/chunks/join-EJ73DYTK.js +3 -0
  148. package/dist/bin/chunks/jq-W6KOII4Y.js +3 -0
  149. package/dist/bin/chunks/js-exec-BC6NI55L.js +98 -0
  150. package/dist/bin/chunks/js-exec-worker.js +4639 -0
  151. package/dist/bin/chunks/ln-LP4HMCSM.js +3 -0
  152. package/dist/bin/chunks/ls-YGNSAGDK.js +3 -0
  153. package/dist/bin/chunks/md5sum-MCVDIB35.js +3 -0
  154. package/dist/bin/chunks/mkdir-P4DKRCDX.js +3 -0
  155. package/dist/bin/chunks/mv-QQK4FQX6.js +3 -0
  156. package/dist/bin/chunks/nl-KUPLVCTS.js +3 -0
  157. package/dist/bin/chunks/od-YQ5ZUI2H.js +3 -0
  158. package/dist/bin/chunks/paste-A5KKPWXX.js +3 -0
  159. package/dist/bin/chunks/printf-XXZMDRGE.js +3 -0
  160. package/dist/bin/chunks/pwd-FCNDA467.js +3 -0
  161. package/dist/bin/chunks/python3-BQWDPUBM.js +13 -0
  162. package/dist/bin/chunks/readlink-25V57VOL.js +3 -0
  163. package/dist/bin/chunks/rev-PYHOZ4D4.js +3 -0
  164. package/dist/bin/chunks/rg-OHJSRKFS.js +3 -0
  165. package/dist/bin/chunks/rm-ECNUFR66.js +3 -0
  166. package/dist/bin/chunks/rmdir-DLOHIA7Q.js +3 -0
  167. package/dist/bin/chunks/sed-4GRUPTAO.js +3 -0
  168. package/dist/bin/chunks/seq-UXDJE6FB.js +3 -0
  169. package/dist/bin/chunks/sha1sum-4KF52U3Y.js +3 -0
  170. package/dist/bin/chunks/sha256sum-6YEPULPX.js +3 -0
  171. package/dist/bin/chunks/sleep-QHAPNY3Q.js +3 -0
  172. package/dist/bin/chunks/sort-4C6WOKNK.js +3 -0
  173. package/dist/bin/chunks/split-TV7NL7LA.js +3 -0
  174. package/dist/bin/chunks/sqlite3-W777NCI4.js +3 -0
  175. package/dist/bin/chunks/sqlite3-worker.js +1728 -0
  176. package/dist/bin/chunks/stat-BD6KT3BP.js +3 -0
  177. package/dist/bin/chunks/strings-MDD72LR6.js +3 -0
  178. package/dist/bin/chunks/tac-C2N4NQ6S.js +3 -0
  179. package/dist/bin/chunks/tail-LGNECVQA.js +3 -0
  180. package/dist/bin/chunks/tar-K6HVPBVB.js +3 -0
  181. package/dist/bin/chunks/tee-UQHPO4OW.js +3 -0
  182. package/dist/bin/chunks/time-ZPY52VT2.js +3 -0
  183. package/dist/bin/chunks/timeout-5AX3ZS3X.js +3 -0
  184. package/dist/bin/chunks/touch-DFGSVIX7.js +3 -0
  185. package/dist/bin/chunks/tr-G7K6M6HP.js +3 -0
  186. package/dist/bin/chunks/tree-6D7SMPUR.js +3 -0
  187. package/dist/bin/chunks/true-SKL4L7JP.js +3 -0
  188. package/dist/bin/chunks/unexpand-QIR4EDPG.js +3 -0
  189. package/dist/bin/chunks/uniq-I7PVFJR4.js +3 -0
  190. package/dist/bin/chunks/wc-6NGWULAP.js +3 -0
  191. package/dist/bin/chunks/which-LCXKCLFC.js +3 -0
  192. package/dist/bin/chunks/whoami-TZDZDU7T.js +3 -0
  193. package/dist/bin/chunks/worker.js +3150 -0
  194. package/dist/bin/chunks/xan-LGEJUGOM.js +3 -0
  195. package/dist/bin/chunks/xan-view-L75WEJE2.js +3 -0
  196. package/dist/bin/chunks/xargs-UWHPYLY7.js +3 -0
  197. package/dist/bin/chunks/yq-V6YWS23E.js +3 -0
  198. package/dist/bin/just-bash.js +778 -0
  199. package/dist/bin/shell/chunks/alias-YRVAW27Y.js +3 -0
  200. package/dist/bin/shell/chunks/awk2-XSVZFGAA.js +3 -0
  201. package/dist/bin/shell/chunks/base64-RZRLGMB3.js +3 -0
  202. package/dist/bin/shell/chunks/basename-F3AQ4KAQ.js +3 -0
  203. package/dist/bin/shell/chunks/bash-CLP24TE2.js +3 -0
  204. package/dist/bin/shell/chunks/cat-LQH5FSAR.js +3 -0
  205. package/dist/bin/shell/chunks/chmod-S564JCJW.js +3 -0
  206. package/dist/bin/shell/chunks/chunk-22HCD466.js +3 -0
  207. package/dist/bin/shell/chunks/chunk-2AIXTPH2.js +9 -0
  208. package/dist/bin/shell/chunks/chunk-2ETT4ELS.js +4 -0
  209. package/dist/bin/shell/chunks/chunk-2FCLTY3Z.js +15 -0
  210. package/dist/bin/shell/chunks/chunk-2GG3NVC4.js +10 -0
  211. package/dist/bin/shell/chunks/chunk-2NRAWO6E.js +7 -0
  212. package/dist/bin/shell/chunks/chunk-2SVX7I5P.js +14 -0
  213. package/dist/bin/shell/chunks/chunk-2TVVPMMT.js +34 -0
  214. package/dist/bin/shell/chunks/chunk-3MRB66F4.js +3 -0
  215. package/dist/bin/shell/chunks/chunk-3WIMLJM7.js +8 -0
  216. package/dist/bin/shell/chunks/chunk-42Z7Z3TQ.js +288 -0
  217. package/dist/bin/shell/chunks/chunk-4BNS566Q.js +4 -0
  218. package/dist/bin/shell/chunks/chunk-52Z5MJO2.js +17 -0
  219. package/dist/bin/shell/chunks/chunk-5WLKCCX7.js +6 -0
  220. package/dist/bin/shell/chunks/chunk-5XSZHUEI.js +15 -0
  221. package/dist/bin/shell/chunks/chunk-6FSBHK6H.js +22 -0
  222. package/dist/bin/shell/chunks/chunk-6GSBC77G.js +22 -0
  223. package/dist/bin/shell/chunks/chunk-6UL3WIEK.js +3 -0
  224. package/dist/bin/shell/chunks/chunk-6WJQNLR2.js +7 -0
  225. package/dist/bin/shell/chunks/chunk-77MLOOQS.js +11 -0
  226. package/dist/bin/shell/chunks/chunk-7AYT3UKI.js +6 -0
  227. package/dist/bin/shell/chunks/chunk-7GBHDJNC.js +34 -0
  228. package/dist/bin/shell/chunks/chunk-7JZKVC3F.js +2 -0
  229. package/dist/bin/shell/chunks/chunk-7NDRU2ZN.js +5 -0
  230. package/dist/bin/shell/chunks/chunk-7UU7KPEM.js +7 -0
  231. package/dist/bin/shell/chunks/chunk-7VCQWCSH.js +15 -0
  232. package/dist/bin/shell/chunks/chunk-AGKL4LDL.js +4 -0
  233. package/dist/bin/shell/chunks/chunk-AJF3OBTR.js +4 -0
  234. package/dist/bin/shell/chunks/chunk-B2DRBHGQ.js +3 -0
  235. package/dist/bin/shell/chunks/chunk-BE4PARL3.js +13 -0
  236. package/dist/bin/shell/chunks/chunk-BGX3RW7H.js +10 -0
  237. package/dist/bin/shell/chunks/chunk-BIJXTWZ4.js +3 -0
  238. package/dist/bin/shell/chunks/chunk-BPZJYOUA.js +33 -0
  239. package/dist/bin/shell/chunks/chunk-C7ISPH7Y.js +18 -0
  240. package/dist/bin/shell/chunks/chunk-CAZ75E7E.js +3 -0
  241. package/dist/bin/shell/chunks/chunk-DJAX3ZRG.js +8 -0
  242. package/dist/bin/shell/chunks/chunk-DYIBFLS3.js +17 -0
  243. package/dist/bin/shell/chunks/chunk-EDTBGO7F.js +37 -0
  244. package/dist/bin/shell/chunks/chunk-F3GKANW3.js +12 -0
  245. package/dist/bin/shell/chunks/chunk-F3WNDKOC.js +3 -0
  246. package/dist/bin/shell/chunks/chunk-FKVQZWJQ.js +10 -0
  247. package/dist/bin/shell/chunks/chunk-FX7BQD2Q.js +20 -0
  248. package/dist/bin/shell/chunks/chunk-G4AUMZUY.js +4 -0
  249. package/dist/bin/shell/chunks/chunk-H7JTIXAO.js +4 -0
  250. package/dist/bin/shell/chunks/chunk-HADFAIPZ.js +17 -0
  251. package/dist/bin/shell/chunks/chunk-HL4ZS7TX.js +6 -0
  252. package/dist/bin/shell/chunks/chunk-HN2DCT7T.js +13 -0
  253. package/dist/bin/shell/chunks/chunk-HSTAQAVQ.js +11 -0
  254. package/dist/bin/shell/chunks/chunk-I4IRHQDW.js +3 -0
  255. package/dist/bin/shell/chunks/chunk-IWXPUD2J.js +12 -0
  256. package/dist/bin/shell/chunks/chunk-IZGLHVBB.js +8 -0
  257. package/dist/bin/shell/chunks/chunk-J7TUF2VI.js +9 -0
  258. package/dist/bin/shell/chunks/chunk-JXLDT4KX.js +4 -0
  259. package/dist/bin/shell/chunks/chunk-KFMPGSUT.js +9 -0
  260. package/dist/bin/shell/chunks/chunk-KI54R2QB.js +3 -0
  261. package/dist/bin/shell/chunks/chunk-KRRM5UCC.js +3 -0
  262. package/dist/bin/shell/chunks/chunk-KUMHQGUR.js +3 -0
  263. package/dist/bin/shell/chunks/chunk-LNNWMRCB.js +3 -0
  264. package/dist/bin/shell/chunks/chunk-LNVSXNT7.js +3 -0
  265. package/dist/bin/shell/chunks/chunk-LZHWUYJZ.js +24 -0
  266. package/dist/bin/shell/chunks/chunk-MLUOPG3W.js +3 -0
  267. package/dist/bin/shell/chunks/chunk-MROECM42.js +3 -0
  268. package/dist/bin/shell/chunks/chunk-MUFNRCMY.js +24 -0
  269. package/dist/bin/shell/chunks/chunk-NE4R2FVV.js +5 -0
  270. package/dist/bin/shell/chunks/chunk-NKAT2N47.js +7 -0
  271. package/dist/bin/shell/chunks/chunk-NYIPFY36.js +3 -0
  272. package/dist/bin/shell/chunks/chunk-O2BCKSMK.js +3 -0
  273. package/dist/bin/shell/chunks/chunk-OLEQNRKX.js +8 -0
  274. package/dist/bin/shell/chunks/chunk-OPMLWMNH.js +17 -0
  275. package/dist/bin/shell/chunks/chunk-PAYQNSZN.js +18 -0
  276. package/dist/bin/shell/chunks/chunk-PBOVSFTJ.js +3 -0
  277. package/dist/bin/shell/chunks/chunk-PSGVOB5U.js +3 -0
  278. package/dist/bin/shell/chunks/chunk-PXP4YYZA.js +13 -0
  279. package/dist/bin/shell/chunks/chunk-PZQVSQX6.js +4 -0
  280. package/dist/bin/shell/chunks/chunk-Q2GOPGDA.js +6 -0
  281. package/dist/bin/shell/chunks/chunk-QL33F2W6.js +8 -0
  282. package/dist/bin/shell/chunks/chunk-QPHXCMJV.js +80 -0
  283. package/dist/bin/shell/chunks/chunk-RJUDCNEZ.js +29 -0
  284. package/dist/bin/shell/chunks/chunk-RVPTAYDS.js +4 -0
  285. package/dist/bin/shell/chunks/chunk-SAF4OIHD.js +20 -0
  286. package/dist/bin/shell/chunks/chunk-SMLKRKMP.js +11 -0
  287. package/dist/bin/shell/chunks/chunk-SMSELHIY.js +12 -0
  288. package/dist/bin/shell/chunks/chunk-T74E2U4J.js +64 -0
  289. package/dist/bin/shell/chunks/chunk-UO5LOD7U.js +12 -0
  290. package/dist/bin/shell/chunks/chunk-UOMNSQEZ.js +10 -0
  291. package/dist/bin/shell/chunks/chunk-UVKD35GR.js +9 -0
  292. package/dist/bin/shell/chunks/chunk-V2RP73X4.js +15 -0
  293. package/dist/bin/shell/chunks/chunk-VP3OTMHX.js +22 -0
  294. package/dist/bin/shell/chunks/chunk-VZK4FHWJ.js +3 -0
  295. package/dist/bin/shell/chunks/chunk-WDWNEHHE.js +9 -0
  296. package/dist/bin/shell/chunks/chunk-X4MX6EHF.js +6 -0
  297. package/dist/bin/shell/chunks/chunk-X5WRKSEU.js +101 -0
  298. package/dist/bin/shell/chunks/chunk-XBB73LFB.js +5 -0
  299. package/dist/bin/shell/chunks/chunk-XCUJL2AJ.js +141 -0
  300. package/dist/bin/shell/chunks/chunk-XHCCSVP6.js +9 -0
  301. package/dist/bin/shell/chunks/chunk-XJ37N3S5.js +7 -0
  302. package/dist/bin/shell/chunks/chunk-XPTYN6UE.js +8 -0
  303. package/dist/bin/shell/chunks/chunk-XRUDFQG5.js +7 -0
  304. package/dist/bin/shell/chunks/chunk-YJ5OCPSK.js +7 -0
  305. package/dist/bin/shell/chunks/chunk-YOIFOOGX.js +9 -0
  306. package/dist/bin/shell/chunks/chunk-YOKQNNQO.js +6 -0
  307. package/dist/bin/shell/chunks/chunk-YR32XGKD.js +3 -0
  308. package/dist/bin/shell/chunks/chunk-YUZRUF5F.js +10 -0
  309. package/dist/bin/shell/chunks/chunk-YY5PJR7O.js +7 -0
  310. package/dist/bin/shell/chunks/chunk-ZAMAXG5K.js +85 -0
  311. package/dist/bin/shell/chunks/chunk-ZFUVUYWG.js +15 -0
  312. package/dist/bin/shell/chunks/clear-FGNEKYDU.js +3 -0
  313. package/dist/bin/shell/chunks/column-AQB3A3PJ.js +3 -0
  314. package/dist/bin/shell/chunks/comm-Q4VDF6ZO.js +3 -0
  315. package/dist/bin/shell/chunks/cp-HYXTMN3D.js +3 -0
  316. package/dist/bin/shell/chunks/curl-PLHETP4J.js +27 -0
  317. package/dist/bin/shell/chunks/cut-ZI2HIAW7.js +3 -0
  318. package/dist/bin/shell/chunks/date-OFYBOAUE.js +3 -0
  319. package/dist/bin/shell/chunks/diff-TL7IV4S2.js +3 -0
  320. package/dist/bin/shell/chunks/dirname-VCINTLPD.js +3 -0
  321. package/dist/bin/shell/chunks/du-4LRQIGRG.js +3 -0
  322. package/dist/bin/shell/chunks/echo-KCOHTNDF.js +3 -0
  323. package/dist/bin/shell/chunks/env-NY32PQJM.js +3 -0
  324. package/dist/bin/shell/chunks/expand-YYSO35NS.js +3 -0
  325. package/dist/bin/shell/chunks/expansion-YT6DLHRE.js +3 -0
  326. package/dist/bin/shell/chunks/expr-XNBNPKSF.js +3 -0
  327. package/dist/bin/shell/chunks/file-U4GYVT3G.js +3 -0
  328. package/dist/bin/shell/chunks/find-CZ6UMSZX.js +3 -0
  329. package/dist/bin/shell/chunks/flag-coverage-MPBSMQIN.js +3 -0
  330. package/dist/bin/shell/chunks/fold-5MF7QZWQ.js +3 -0
  331. package/dist/bin/shell/chunks/grep-JCHLTP7S.js +3 -0
  332. package/dist/bin/shell/chunks/gzip-UGBQQKIH.js +3 -0
  333. package/dist/bin/shell/chunks/head-77V5O3RE.js +3 -0
  334. package/dist/bin/shell/chunks/help-CGUEOGXQ.js +3 -0
  335. package/dist/bin/shell/chunks/history-AQQWW3QB.js +3 -0
  336. package/dist/bin/shell/chunks/hostname-USNWOQCK.js +3 -0
  337. package/dist/bin/shell/chunks/html-to-markdown-PHASM44U.js +3 -0
  338. package/dist/bin/shell/chunks/join-EJ73DYTK.js +3 -0
  339. package/dist/bin/shell/chunks/jq-W6KOII4Y.js +3 -0
  340. package/dist/bin/shell/chunks/js-exec-BC6NI55L.js +98 -0
  341. package/dist/bin/shell/chunks/ln-LP4HMCSM.js +3 -0
  342. package/dist/bin/shell/chunks/ls-YGNSAGDK.js +3 -0
  343. package/dist/bin/shell/chunks/md5sum-MCVDIB35.js +3 -0
  344. package/dist/bin/shell/chunks/mkdir-P4DKRCDX.js +3 -0
  345. package/dist/bin/shell/chunks/mv-QQK4FQX6.js +3 -0
  346. package/dist/bin/shell/chunks/nl-KUPLVCTS.js +3 -0
  347. package/dist/bin/shell/chunks/od-YQ5ZUI2H.js +3 -0
  348. package/dist/bin/shell/chunks/paste-A5KKPWXX.js +3 -0
  349. package/dist/bin/shell/chunks/printf-XXZMDRGE.js +3 -0
  350. package/dist/bin/shell/chunks/pwd-FCNDA467.js +3 -0
  351. package/dist/bin/shell/chunks/python3-BQWDPUBM.js +13 -0
  352. package/dist/bin/shell/chunks/readlink-25V57VOL.js +3 -0
  353. package/dist/bin/shell/chunks/rev-PYHOZ4D4.js +3 -0
  354. package/dist/bin/shell/chunks/rg-OHJSRKFS.js +3 -0
  355. package/dist/bin/shell/chunks/rm-ECNUFR66.js +3 -0
  356. package/dist/bin/shell/chunks/rmdir-DLOHIA7Q.js +3 -0
  357. package/dist/bin/shell/chunks/sed-4GRUPTAO.js +3 -0
  358. package/dist/bin/shell/chunks/seq-UXDJE6FB.js +3 -0
  359. package/dist/bin/shell/chunks/sha1sum-4KF52U3Y.js +3 -0
  360. package/dist/bin/shell/chunks/sha256sum-6YEPULPX.js +3 -0
  361. package/dist/bin/shell/chunks/sleep-QHAPNY3Q.js +3 -0
  362. package/dist/bin/shell/chunks/sort-4C6WOKNK.js +3 -0
  363. package/dist/bin/shell/chunks/split-TV7NL7LA.js +3 -0
  364. package/dist/bin/shell/chunks/sqlite3-W777NCI4.js +3 -0
  365. package/dist/bin/shell/chunks/stat-BD6KT3BP.js +3 -0
  366. package/dist/bin/shell/chunks/strings-MDD72LR6.js +3 -0
  367. package/dist/bin/shell/chunks/tac-C2N4NQ6S.js +3 -0
  368. package/dist/bin/shell/chunks/tail-LGNECVQA.js +3 -0
  369. package/dist/bin/shell/chunks/tar-K6HVPBVB.js +3 -0
  370. package/dist/bin/shell/chunks/tee-UQHPO4OW.js +3 -0
  371. package/dist/bin/shell/chunks/time-ZPY52VT2.js +3 -0
  372. package/dist/bin/shell/chunks/timeout-5AX3ZS3X.js +3 -0
  373. package/dist/bin/shell/chunks/touch-DFGSVIX7.js +3 -0
  374. package/dist/bin/shell/chunks/tr-G7K6M6HP.js +3 -0
  375. package/dist/bin/shell/chunks/tree-6D7SMPUR.js +3 -0
  376. package/dist/bin/shell/chunks/true-SKL4L7JP.js +3 -0
  377. package/dist/bin/shell/chunks/unexpand-QIR4EDPG.js +3 -0
  378. package/dist/bin/shell/chunks/uniq-I7PVFJR4.js +3 -0
  379. package/dist/bin/shell/chunks/wc-6NGWULAP.js +3 -0
  380. package/dist/bin/shell/chunks/which-LCXKCLFC.js +3 -0
  381. package/dist/bin/shell/chunks/whoami-TZDZDU7T.js +3 -0
  382. package/dist/bin/shell/chunks/xan-LGEJUGOM.js +3 -0
  383. package/dist/bin/shell/chunks/xan-view-L75WEJE2.js +3 -0
  384. package/dist/bin/shell/chunks/xargs-UWHPYLY7.js +3 -0
  385. package/dist/bin/shell/chunks/yq-V6YWS23E.js +3 -0
  386. package/dist/bin/shell/shell.js +757 -0
  387. package/dist/browser.d.ts +23 -0
  388. package/dist/bundle/browser.js +1546 -0
  389. package/dist/bundle/chunks/alias-RTYYYW3D.js +2 -0
  390. package/dist/bundle/chunks/awk2-GS47M5U7.js +2 -0
  391. package/dist/bundle/chunks/base64-C2AIWVNC.js +2 -0
  392. package/dist/bundle/chunks/basename-UB3CIYNI.js +2 -0
  393. package/dist/bundle/chunks/bash-YZ33HQZQ.js +2 -0
  394. package/dist/bundle/chunks/cat-TSFMZVYS.js +2 -0
  395. package/dist/bundle/chunks/chmod-TFEPA42X.js +2 -0
  396. package/dist/bundle/chunks/chunk-27JIFWUR.js +3 -0
  397. package/dist/bundle/chunks/chunk-2JIPICV3.js +13 -0
  398. package/dist/bundle/chunks/chunk-2SMD2AUA.js +3 -0
  399. package/dist/bundle/chunks/chunk-2VDTE5BV.js +14 -0
  400. package/dist/bundle/chunks/chunk-2VJJEDV2.js +8 -0
  401. package/dist/bundle/chunks/chunk-4JLVZKHC.js +8 -0
  402. package/dist/bundle/chunks/chunk-4MZPEZTU.js +3 -0
  403. package/dist/bundle/chunks/chunk-4N6J7B5P.js +6 -0
  404. package/dist/bundle/chunks/chunk-4WKZNNJK.js +2 -0
  405. package/dist/bundle/chunks/chunk-5A3ZCIHP.js +2 -0
  406. package/dist/bundle/chunks/chunk-5H5SCKJM.js +11 -0
  407. package/dist/bundle/chunks/chunk-5IFY2NZJ.js +19 -0
  408. package/dist/bundle/chunks/chunk-6LASZU3O.js +5 -0
  409. package/dist/bundle/chunks/chunk-6SHYIICL.js +4 -0
  410. package/dist/bundle/chunks/chunk-6VAT5Z2D.js +5 -0
  411. package/dist/bundle/chunks/chunk-7AISL3XV.js +12 -0
  412. package/dist/bundle/chunks/chunk-7EUWTCWK.js +2 -0
  413. package/dist/bundle/chunks/chunk-7F47ISLI.js +33 -0
  414. package/dist/bundle/chunks/chunk-7JHM3L42.js +6 -0
  415. package/dist/bundle/chunks/chunk-A4R2GWRF.js +9 -0
  416. package/dist/bundle/chunks/chunk-AA63C4TN.js +23 -0
  417. package/dist/bundle/chunks/chunk-ACSZB4FE.js +11 -0
  418. package/dist/bundle/chunks/chunk-BOZLBWPL.js +100 -0
  419. package/dist/bundle/chunks/chunk-BU36VZYL.js +4 -0
  420. package/dist/bundle/chunks/chunk-BVKWRAS6.js +12 -0
  421. package/dist/bundle/chunks/chunk-BXERNLCU.js +33 -0
  422. package/dist/bundle/chunks/chunk-BZUGFHVS.js +2 -0
  423. package/dist/bundle/chunks/chunk-CBJVD2XA.js +7 -0
  424. package/dist/bundle/chunks/chunk-CN5XGDNN.js +6 -0
  425. package/dist/bundle/chunks/chunk-DLL7UR66.js +2 -0
  426. package/dist/bundle/chunks/chunk-DVHZ434T.js +10 -0
  427. package/dist/bundle/chunks/chunk-EBAPSGAO.js +9 -0
  428. package/dist/bundle/chunks/chunk-EXLJT6MD.js +140 -0
  429. package/dist/bundle/chunks/chunk-FAXLQUCQ.js +10 -0
  430. package/dist/bundle/chunks/chunk-FE7TPM5F.js +79 -0
  431. package/dist/bundle/chunks/chunk-FHC24QSK.js +7 -0
  432. package/dist/bundle/chunks/chunk-FJK43EBQ.js +14 -0
  433. package/dist/bundle/chunks/chunk-FOCWZZDE.js +2 -0
  434. package/dist/bundle/chunks/chunk-FW54FHZR.js +2 -0
  435. package/dist/bundle/chunks/chunk-FX4RBUYU.js +5 -0
  436. package/dist/bundle/chunks/chunk-FZRQOL3C.js +7 -0
  437. package/dist/bundle/chunks/chunk-GGC5NEPZ.js +8 -0
  438. package/dist/bundle/chunks/chunk-GJC3WVOW.js +2 -0
  439. package/dist/bundle/chunks/chunk-GSPYNYZA.js +6 -0
  440. package/dist/bundle/chunks/chunk-HBVMHTO5.js +2 -0
  441. package/dist/bundle/chunks/chunk-HDRAUQK2.js +2 -0
  442. package/dist/bundle/chunks/chunk-HJBTD7PY.js +21 -0
  443. package/dist/bundle/chunks/chunk-ICIEVHY5.js +36 -0
  444. package/dist/bundle/chunks/chunk-J2XQNA2Z.js +8 -0
  445. package/dist/bundle/chunks/chunk-JYUAM3H7.js +16 -0
  446. package/dist/bundle/chunks/chunk-KD3KENL6.js +11 -0
  447. package/dist/bundle/chunks/chunk-KWGBQNTV.js +32 -0
  448. package/dist/bundle/chunks/chunk-KXUUKRXD.js +2 -0
  449. package/dist/bundle/chunks/chunk-L2UW7DWF.js +2 -0
  450. package/dist/bundle/chunks/chunk-L64BMZUV.js +2 -0
  451. package/dist/bundle/chunks/chunk-L66DE7G5.js +21 -0
  452. package/dist/bundle/chunks/chunk-LPJEKUCB.js +8 -0
  453. package/dist/bundle/chunks/chunk-LSLPJOYM.js +3 -0
  454. package/dist/bundle/chunks/chunk-LWXDWLMH.js +14 -0
  455. package/dist/bundle/chunks/chunk-MFDPAVC6.js +14 -0
  456. package/dist/bundle/chunks/chunk-MLIO3BK2.js +7 -0
  457. package/dist/bundle/chunks/chunk-MQKGGNPS.js +16 -0
  458. package/dist/bundle/chunks/chunk-NRSASXYY.js +2 -0
  459. package/dist/bundle/chunks/chunk-OGJ5CFPR.js +9 -0
  460. package/dist/bundle/chunks/chunk-OVGANXCG.js +8 -0
  461. package/dist/bundle/chunks/chunk-QAYAQNCG.js +23 -0
  462. package/dist/bundle/chunks/chunk-QIQMJJZ4.js +4 -0
  463. package/dist/bundle/chunks/chunk-R4IFXNY5.js +28 -0
  464. package/dist/bundle/chunks/chunk-R74UQCKX.js +5 -0
  465. package/dist/bundle/chunks/chunk-RBQG6ZUG.js +3 -0
  466. package/dist/bundle/chunks/chunk-S3LEJEPP.js +2 -0
  467. package/dist/bundle/chunks/chunk-S443BAN4.js +7 -0
  468. package/dist/bundle/chunks/chunk-SBBYKIYU.js +3 -0
  469. package/dist/bundle/chunks/chunk-SETW5JBN.js +9 -0
  470. package/dist/bundle/chunks/chunk-SHKOQWO4.js +3 -0
  471. package/dist/bundle/chunks/chunk-SJYEXC2Z.js +14 -0
  472. package/dist/bundle/chunks/chunk-STHBFACM.js +1 -0
  473. package/dist/bundle/chunks/chunk-SX2HC7SO.js +2 -0
  474. package/dist/bundle/chunks/chunk-T3EYGW4N.js +63 -0
  475. package/dist/bundle/chunks/chunk-T4TFLF3R.js +16 -0
  476. package/dist/bundle/chunks/chunk-TDD4NFYE.js +2 -0
  477. package/dist/bundle/chunks/chunk-TN7HHBQW.js +5 -0
  478. package/dist/bundle/chunks/chunk-U73A73IE.js +17 -0
  479. package/dist/bundle/chunks/chunk-UIJUTQPH.js +3 -0
  480. package/dist/bundle/chunks/chunk-UP6MSJGD.js +17 -0
  481. package/dist/bundle/chunks/chunk-UURAZSVT.js +10 -0
  482. package/dist/bundle/chunks/chunk-V6PSIUPR.js +11 -0
  483. package/dist/bundle/chunks/chunk-V77XGLKX.js +5 -0
  484. package/dist/bundle/chunks/chunk-VBRPS3D5.js +2 -0
  485. package/dist/bundle/chunks/chunk-VLCHOJWK.js +6 -0
  486. package/dist/bundle/chunks/chunk-W5DWRFSU.js +2 -0
  487. package/dist/bundle/chunks/chunk-WM5IJFMP.js +8 -0
  488. package/dist/bundle/chunks/chunk-WN7T6YIH.js +287 -0
  489. package/dist/bundle/chunks/chunk-WNH3HOQA.js +2 -0
  490. package/dist/bundle/chunks/chunk-WPGQVBSY.js +6 -0
  491. package/dist/bundle/chunks/chunk-XCQWV4AU.js +12 -0
  492. package/dist/bundle/chunks/chunk-XHLMAZX2.js +5 -0
  493. package/dist/bundle/chunks/chunk-XRFHFXFP.js +2 -0
  494. package/dist/bundle/chunks/chunk-Y4LIDHSD.js +7 -0
  495. package/dist/bundle/chunks/chunk-Y4SO5AJF.js +16 -0
  496. package/dist/bundle/chunks/chunk-YCLFEX4T.js +3 -0
  497. package/dist/bundle/chunks/chunk-YRXX457F.js +6 -0
  498. package/dist/bundle/chunks/chunk-YS4NUBYX.js +9 -0
  499. package/dist/bundle/chunks/chunk-ZDIT6ST5.js +7 -0
  500. package/dist/bundle/chunks/chunk-ZDPFA4L3.js +6 -0
  501. package/dist/bundle/chunks/chunk-ZLAEZD2P.js +21 -0
  502. package/dist/bundle/chunks/clear-HKGFEOF6.js +2 -0
  503. package/dist/bundle/chunks/column-XT6UFXNQ.js +2 -0
  504. package/dist/bundle/chunks/comm-VV2LDX2J.js +2 -0
  505. package/dist/bundle/chunks/cp-BISAAS7A.js +2 -0
  506. package/dist/bundle/chunks/curl-GRYA74XW.js +26 -0
  507. package/dist/bundle/chunks/cut-OKARJCCV.js +2 -0
  508. package/dist/bundle/chunks/date-XKUEQ4WF.js +2 -0
  509. package/dist/bundle/chunks/diff-MWJFIG7X.js +2 -0
  510. package/dist/bundle/chunks/dirname-MPHRFUTI.js +2 -0
  511. package/dist/bundle/chunks/du-572XNP42.js +2 -0
  512. package/dist/bundle/chunks/echo-NDWZZHPO.js +2 -0
  513. package/dist/bundle/chunks/env-36M5BO7M.js +2 -0
  514. package/dist/bundle/chunks/expand-JSPG6VOP.js +2 -0
  515. package/dist/bundle/chunks/expansion-2O6WLRBD.js +2 -0
  516. package/dist/bundle/chunks/expr-6MFJ5XZG.js +2 -0
  517. package/dist/bundle/chunks/file-55SY74D5.js +2 -0
  518. package/dist/bundle/chunks/find-BKC2BIAO.js +2 -0
  519. package/dist/bundle/chunks/flag-coverage-4GZNBF47.js +2 -0
  520. package/dist/bundle/chunks/fold-4TQNYMSW.js +2 -0
  521. package/dist/bundle/chunks/grep-2ILJFW6Y.js +2 -0
  522. package/dist/bundle/chunks/gzip-O5ASJAFY.js +2 -0
  523. package/dist/bundle/chunks/head-BALRBIDD.js +2 -0
  524. package/dist/bundle/chunks/help-HZ6M2CKN.js +2 -0
  525. package/dist/bundle/chunks/history-WYYKSLSZ.js +2 -0
  526. package/dist/bundle/chunks/hostname-C4HQXXUP.js +2 -0
  527. package/dist/bundle/chunks/html-to-markdown-JW4MSQZO.js +2 -0
  528. package/dist/bundle/chunks/join-TBRGI3LQ.js +2 -0
  529. package/dist/bundle/chunks/jq-QLLVLUWT.js +2 -0
  530. package/dist/bundle/chunks/js-exec-N5KEZBH7.js +97 -0
  531. package/dist/bundle/chunks/js-exec-worker.js +4639 -0
  532. package/dist/bundle/chunks/ln-4LGSXXGD.js +2 -0
  533. package/dist/bundle/chunks/ls-ZJGQER7M.js +2 -0
  534. package/dist/bundle/chunks/md5sum-SPU24VSG.js +2 -0
  535. package/dist/bundle/chunks/mkdir-MEPGZOB6.js +2 -0
  536. package/dist/bundle/chunks/mv-W5BIQ646.js +2 -0
  537. package/dist/bundle/chunks/nl-WSDW7I4O.js +2 -0
  538. package/dist/bundle/chunks/od-WOKFDJTP.js +2 -0
  539. package/dist/bundle/chunks/paste-7JC6S4DX.js +2 -0
  540. package/dist/bundle/chunks/printf-I2B4W2XW.js +2 -0
  541. package/dist/bundle/chunks/pwd-WE6EN5AV.js +2 -0
  542. package/dist/bundle/chunks/python3-POMOR4OA.js +12 -0
  543. package/dist/bundle/chunks/readlink-OPJF4DL5.js +2 -0
  544. package/dist/bundle/chunks/rev-5EHFX4EJ.js +2 -0
  545. package/dist/bundle/chunks/rg-X6MJUOKW.js +2 -0
  546. package/dist/bundle/chunks/rm-SSGETQVQ.js +2 -0
  547. package/dist/bundle/chunks/rmdir-OC4ZLPYA.js +2 -0
  548. package/dist/bundle/chunks/sed-JWIN756M.js +2 -0
  549. package/dist/bundle/chunks/seq-M5EC7Q57.js +2 -0
  550. package/dist/bundle/chunks/sha1sum-2PTOAFR6.js +2 -0
  551. package/dist/bundle/chunks/sha256sum-NS7D3IXX.js +2 -0
  552. package/dist/bundle/chunks/sleep-X22JJINO.js +2 -0
  553. package/dist/bundle/chunks/sort-SW2YEO5B.js +2 -0
  554. package/dist/bundle/chunks/split-4KKZZXXE.js +2 -0
  555. package/dist/bundle/chunks/sqlite3-CGOEFJAO.js +2 -0
  556. package/dist/bundle/chunks/sqlite3-worker.js +1728 -0
  557. package/dist/bundle/chunks/stat-CD34IZ4P.js +2 -0
  558. package/dist/bundle/chunks/strings-6WDHLGMX.js +2 -0
  559. package/dist/bundle/chunks/tac-2STMMJYW.js +2 -0
  560. package/dist/bundle/chunks/tail-3JSKDTET.js +2 -0
  561. package/dist/bundle/chunks/tar-WT6S4IJX.js +2 -0
  562. package/dist/bundle/chunks/tee-YUZ2FKCJ.js +2 -0
  563. package/dist/bundle/chunks/time-D4LNBSWX.js +2 -0
  564. package/dist/bundle/chunks/timeout-YDCRSLPQ.js +2 -0
  565. package/dist/bundle/chunks/touch-UA33VN3N.js +2 -0
  566. package/dist/bundle/chunks/tr-36LHWFRQ.js +2 -0
  567. package/dist/bundle/chunks/tree-YLD52CNT.js +2 -0
  568. package/dist/bundle/chunks/true-FHQXJXBE.js +2 -0
  569. package/dist/bundle/chunks/unexpand-CADSA4VO.js +2 -0
  570. package/dist/bundle/chunks/uniq-XSIZR6PB.js +2 -0
  571. package/dist/bundle/chunks/wc-LF7NU4LA.js +2 -0
  572. package/dist/bundle/chunks/which-XEM24D5D.js +2 -0
  573. package/dist/bundle/chunks/whoami-XMTX52VE.js +2 -0
  574. package/dist/bundle/chunks/worker.js +3150 -0
  575. package/dist/bundle/chunks/xan-5D7XBVRF.js +2 -0
  576. package/dist/bundle/chunks/xan-view-P7JTBY6N.js +2 -0
  577. package/dist/bundle/chunks/xargs-MGZPH7AX.js +2 -0
  578. package/dist/bundle/chunks/yq-6N2YNRZS.js +2 -0
  579. package/dist/bundle/index.cjs +2209 -0
  580. package/dist/bundle/index.js +733 -0
  581. package/dist/commands/alias/alias.d.ts +6 -0
  582. package/dist/commands/awk/ast.d.ts +202 -0
  583. package/dist/commands/awk/awk2.d.ts +9 -0
  584. package/dist/commands/awk/builtins.d.ts +17 -0
  585. package/dist/commands/awk/interpreter/context.d.ts +75 -0
  586. package/dist/commands/awk/interpreter/expressions.d.ts +17 -0
  587. package/dist/commands/awk/interpreter/fields.d.ts +25 -0
  588. package/dist/commands/awk/interpreter/index.d.ts +8 -0
  589. package/dist/commands/awk/interpreter/interpreter.d.ts +54 -0
  590. package/dist/commands/awk/interpreter/statements.d.ts +11 -0
  591. package/dist/commands/awk/interpreter/type-coercion.d.ts +32 -0
  592. package/dist/commands/awk/interpreter/types.d.ts +13 -0
  593. package/dist/commands/awk/interpreter/variables.d.ts +35 -0
  594. package/dist/commands/awk/lexer.d.ts +100 -0
  595. package/dist/commands/awk/parser2-print.d.ts +35 -0
  596. package/dist/commands/awk/parser2.d.ts +81 -0
  597. package/dist/commands/base64/base64.d.ts +7 -0
  598. package/dist/commands/basename/basename.d.ts +4 -0
  599. package/dist/commands/bash/bash.d.ts +6 -0
  600. package/dist/commands/browser-excluded.d.ts +16 -0
  601. package/dist/commands/cat/cat.d.ts +4 -0
  602. package/dist/commands/chmod/chmod.d.ts +4 -0
  603. package/dist/commands/clear/clear.d.ts +4 -0
  604. package/dist/commands/column/column.d.ts +11 -0
  605. package/dist/commands/comm/comm.d.ts +12 -0
  606. package/dist/commands/cp/cp.d.ts +4 -0
  607. package/dist/commands/curl/curl.d.ts +8 -0
  608. package/dist/commands/curl/form.d.ts +21 -0
  609. package/dist/commands/curl/help.d.ts +9 -0
  610. package/dist/commands/curl/parse.d.ts +9 -0
  611. package/dist/commands/curl/response-formatting.d.ts +20 -0
  612. package/dist/commands/curl/types.d.ts +60 -0
  613. package/dist/commands/cut/cut.d.ts +4 -0
  614. package/dist/commands/date/date.d.ts +7 -0
  615. package/dist/commands/diff/diff.d.ts +7 -0
  616. package/dist/commands/dirname/dirname.d.ts +4 -0
  617. package/dist/commands/du/du.d.ts +4 -0
  618. package/dist/commands/duration.d.ts +5 -0
  619. package/dist/commands/echo/echo.d.ts +4 -0
  620. package/dist/commands/env/env.d.ts +6 -0
  621. package/dist/commands/expand/expand.d.ts +12 -0
  622. package/dist/commands/expand/unexpand.d.ts +12 -0
  623. package/dist/commands/expr/expr.d.ts +9 -0
  624. package/dist/commands/file/file.d.ts +9 -0
  625. package/dist/commands/find/find.d.ts +4 -0
  626. package/dist/commands/find/matcher.d.ts +69 -0
  627. package/dist/commands/find/parser.d.ts +2 -0
  628. package/dist/commands/find/types.d.ts +88 -0
  629. package/dist/commands/flag-coverage.d.ts +2 -0
  630. package/dist/commands/fold/fold.d.ts +12 -0
  631. package/dist/commands/format-mode.d.ts +4 -0
  632. package/dist/commands/fuzz-flags-types.d.ts +17 -0
  633. package/dist/commands/fuzz-flags.d.ts +8 -0
  634. package/dist/commands/grep/grep.d.ts +8 -0
  635. package/dist/commands/gzip/gzip.d.ts +13 -0
  636. package/dist/commands/head/head-tail-shared.d.ts +38 -0
  637. package/dist/commands/head/head.d.ts +4 -0
  638. package/dist/commands/help/help.d.ts +4 -0
  639. package/dist/commands/help.d.ts +16 -0
  640. package/dist/commands/history/history.d.ts +4 -0
  641. package/dist/commands/hostname/hostname.d.ts +11 -0
  642. package/dist/commands/html-to-markdown/html-to-markdown.d.ts +9 -0
  643. package/dist/commands/index.d.ts +1 -0
  644. package/dist/commands/join/join.d.ts +12 -0
  645. package/dist/commands/jq/jq.d.ts +9 -0
  646. package/dist/commands/js-exec/fetch-polyfill.d.ts +6 -0
  647. package/dist/commands/js-exec/js-exec-worker.d.ts +32 -0
  648. package/dist/commands/js-exec/js-exec.d.ts +11 -0
  649. package/dist/commands/js-exec/module-shims.d.ts +29 -0
  650. package/dist/commands/js-exec/path-polyfill.d.ts +6 -0
  651. package/dist/commands/ln/ln.d.ts +4 -0
  652. package/dist/commands/ls/ls.d.ts +4 -0
  653. package/dist/commands/md5sum/checksum.d.ts +7 -0
  654. package/dist/commands/md5sum/md5sum.d.ts +4 -0
  655. package/dist/commands/md5sum/sha1sum.d.ts +4 -0
  656. package/dist/commands/md5sum/sha256sum.d.ts +4 -0
  657. package/dist/commands/mkdir/mkdir.d.ts +4 -0
  658. package/dist/commands/mv/mv.d.ts +4 -0
  659. package/dist/commands/nl/nl.d.ts +12 -0
  660. package/dist/commands/od/od.d.ts +12 -0
  661. package/dist/commands/paste/paste.d.ts +4 -0
  662. package/dist/commands/printf/escapes.d.ts +25 -0
  663. package/dist/commands/printf/printf.d.ts +4 -0
  664. package/dist/commands/printf/strftime.d.ts +9 -0
  665. package/dist/commands/pwd/pwd.d.ts +4 -0
  666. package/dist/commands/python3/python3.d.ts +16 -0
  667. package/dist/commands/python3/worker.d.ts +28 -0
  668. package/dist/commands/query-engine/builtins/array-builtins.d.ts +20 -0
  669. package/dist/commands/query-engine/builtins/control-builtins.d.ts +18 -0
  670. package/dist/commands/query-engine/builtins/date-builtins.d.ts +15 -0
  671. package/dist/commands/query-engine/builtins/format-builtins.d.ts +11 -0
  672. package/dist/commands/query-engine/builtins/index-builtins.d.ts +16 -0
  673. package/dist/commands/query-engine/builtins/index.d.ts +17 -0
  674. package/dist/commands/query-engine/builtins/math-builtins.d.ts +15 -0
  675. package/dist/commands/query-engine/builtins/navigation-builtins.d.ts +18 -0
  676. package/dist/commands/query-engine/builtins/object-builtins.d.ts +15 -0
  677. package/dist/commands/query-engine/builtins/path-builtins.d.ts +20 -0
  678. package/dist/commands/query-engine/builtins/sql-builtins.d.ts +16 -0
  679. package/dist/commands/query-engine/builtins/string-builtins.d.ts +15 -0
  680. package/dist/commands/query-engine/builtins/type-builtins.d.ts +11 -0
  681. package/dist/commands/query-engine/evaluator.d.ts +40 -0
  682. package/dist/commands/query-engine/index.d.ts +8 -0
  683. package/dist/commands/query-engine/parser-types.d.ts +171 -0
  684. package/dist/commands/query-engine/parser.d.ts +9 -0
  685. package/dist/commands/query-engine/path-operations.d.ts +15 -0
  686. package/dist/commands/query-engine/safe-object.d.ts +83 -0
  687. package/dist/commands/query-engine/value-operations.d.ts +41 -0
  688. package/dist/commands/readlink/readlink.d.ts +4 -0
  689. package/dist/commands/registry.d.ts +56 -0
  690. package/dist/commands/rev/rev.d.ts +13 -0
  691. package/dist/commands/rg/file-types.d.ts +49 -0
  692. package/dist/commands/rg/gitignore.d.ts +98 -0
  693. package/dist/commands/rg/rg-options.d.ts +61 -0
  694. package/dist/commands/rg/rg-parser.d.ts +20 -0
  695. package/dist/commands/rg/rg-search.d.ts +15 -0
  696. package/dist/commands/rg/rg.d.ts +14 -0
  697. package/dist/commands/rm/rm.d.ts +4 -0
  698. package/dist/commands/rmdir/rmdir.d.ts +4 -0
  699. package/dist/commands/search-engine/index.d.ts +10 -0
  700. package/dist/commands/search-engine/matcher.d.ts +66 -0
  701. package/dist/commands/search-engine/regex.d.ts +46 -0
  702. package/dist/commands/sed/executor.d.ts +7 -0
  703. package/dist/commands/sed/lexer.d.ts +86 -0
  704. package/dist/commands/sed/parser.d.ts +18 -0
  705. package/dist/commands/sed/sed-regex.d.ts +23 -0
  706. package/dist/commands/sed/sed.d.ts +4 -0
  707. package/dist/commands/sed/types.d.ts +216 -0
  708. package/dist/commands/seq/seq.d.ts +16 -0
  709. package/dist/commands/sleep/sleep.d.ts +4 -0
  710. package/dist/commands/sort/comparator.d.ts +9 -0
  711. package/dist/commands/sort/parser.d.ts +11 -0
  712. package/dist/commands/sort/sort.d.ts +4 -0
  713. package/dist/commands/sort/types.d.ts +30 -0
  714. package/dist/commands/split/split.d.ts +12 -0
  715. package/dist/commands/sqlite3/formatters.d.ts +15 -0
  716. package/dist/commands/sqlite3/sqlite3.d.ts +23 -0
  717. package/dist/commands/sqlite3/worker.d.ts +45 -0
  718. package/dist/commands/sqlite3/worker.js +1728 -0
  719. package/dist/commands/stat/stat.d.ts +4 -0
  720. package/dist/commands/strings/strings.d.ts +12 -0
  721. package/dist/commands/tac/tac.d.ts +11 -0
  722. package/dist/commands/tail/tail.d.ts +4 -0
  723. package/dist/commands/tar/archive.d.ts +135 -0
  724. package/dist/commands/tar/bzip2-compress.d.ts +17 -0
  725. package/dist/commands/tar/tar-options.d.ts +37 -0
  726. package/dist/commands/tar/tar.d.ts +10 -0
  727. package/dist/commands/tee/tee.d.ts +4 -0
  728. package/dist/commands/time/time.d.ts +27 -0
  729. package/dist/commands/timeout/timeout.d.ts +4 -0
  730. package/dist/commands/touch/touch.d.ts +4 -0
  731. package/dist/commands/tr/tr.d.ts +4 -0
  732. package/dist/commands/tree/tree.d.ts +4 -0
  733. package/dist/commands/true/true.d.ts +6 -0
  734. package/dist/commands/uniq/uniq.d.ts +4 -0
  735. package/dist/commands/wc/wc.d.ts +4 -0
  736. package/dist/commands/which/which.d.ts +4 -0
  737. package/dist/commands/whoami/whoami.d.ts +11 -0
  738. package/dist/commands/worker-bridge/bridge-handler.d.ts +73 -0
  739. package/dist/commands/worker-bridge/protocol.d.ts +141 -0
  740. package/dist/commands/worker-bridge/sync-backend.d.ts +86 -0
  741. package/dist/commands/xan/aggregation.d.ts +20 -0
  742. package/dist/commands/xan/column-selection.d.ts +19 -0
  743. package/dist/commands/xan/csv.d.ts +37 -0
  744. package/dist/commands/xan/moonblade-parser.d.ts +80 -0
  745. package/dist/commands/xan/moonblade-to-jq.d.ts +12 -0
  746. package/dist/commands/xan/moonblade-tokenizer.d.ts +25 -0
  747. package/dist/commands/xan/subcommands.d.ts +15 -0
  748. package/dist/commands/xan/xan-agg.d.ts +8 -0
  749. package/dist/commands/xan/xan-columns.d.ts +8 -0
  750. package/dist/commands/xan/xan-core.d.ts +10 -0
  751. package/dist/commands/xan/xan-data.d.ts +52 -0
  752. package/dist/commands/xan/xan-filter.d.ts +8 -0
  753. package/dist/commands/xan/xan-map.d.ts +11 -0
  754. package/dist/commands/xan/xan-reshape.d.ts +40 -0
  755. package/dist/commands/xan/xan-simple.d.ts +40 -0
  756. package/dist/commands/xan/xan-view.d.ts +12 -0
  757. package/dist/commands/xan/xan.d.ts +10 -0
  758. package/dist/commands/xargs/xargs.d.ts +4 -0
  759. package/dist/commands/yq/formats.d.ts +64 -0
  760. package/dist/commands/yq/yq.d.ts +13 -0
  761. package/dist/custom-commands.d.ts +42 -0
  762. package/dist/encoding.d.ts +115 -0
  763. package/dist/fs/encoding.d.ts +17 -0
  764. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +75 -0
  765. package/dist/fs/in-memory-fs/index.d.ts +1 -0
  766. package/dist/fs/init.d.ts +22 -0
  767. package/dist/fs/interface.d.ts +251 -0
  768. package/dist/fs/mountable-fs/index.d.ts +1 -0
  769. package/dist/fs/mountable-fs/mountable-fs.d.ts +118 -0
  770. package/dist/fs/overlay-fs/index.d.ts +1 -0
  771. package/dist/fs/overlay-fs/overlay-fs.d.ts +165 -0
  772. package/dist/fs/path-utils.d.ts +46 -0
  773. package/dist/fs/read-write-fs/index.d.ts +1 -0
  774. package/dist/fs/read-write-fs/read-write-fs.d.ts +98 -0
  775. package/dist/fs/real-fs-utils.d.ts +90 -0
  776. package/dist/fs/sanitize-error.d.ts +19 -0
  777. package/dist/index.d.cts +29 -0
  778. package/dist/index.d.ts +29 -0
  779. package/dist/interpreter/alias-expansion.d.ts +23 -0
  780. package/dist/interpreter/arithmetic.d.ts +24 -0
  781. package/dist/interpreter/assignment-expansion.d.ts +24 -0
  782. package/dist/interpreter/builtin-dispatch.d.ts +39 -0
  783. package/dist/interpreter/builtins/break.d.ts +6 -0
  784. package/dist/interpreter/builtins/cd.d.ts +6 -0
  785. package/dist/interpreter/builtins/compgen.d.ts +26 -0
  786. package/dist/interpreter/builtins/complete.d.ts +17 -0
  787. package/dist/interpreter/builtins/compopt.d.ts +28 -0
  788. package/dist/interpreter/builtins/continue.d.ts +6 -0
  789. package/dist/interpreter/builtins/declare-array-parsing.d.ts +14 -0
  790. package/dist/interpreter/builtins/declare-print.d.ts +39 -0
  791. package/dist/interpreter/builtins/declare.d.ts +35 -0
  792. package/dist/interpreter/builtins/dirs.d.ts +29 -0
  793. package/dist/interpreter/builtins/eval.d.ts +9 -0
  794. package/dist/interpreter/builtins/exit.d.ts +5 -0
  795. package/dist/interpreter/builtins/export.d.ts +14 -0
  796. package/dist/interpreter/builtins/getopts.d.ts +18 -0
  797. package/dist/interpreter/builtins/hash.d.ts +19 -0
  798. package/dist/interpreter/builtins/help.d.ts +12 -0
  799. package/dist/interpreter/builtins/index.d.ts +45 -0
  800. package/dist/interpreter/builtins/let.d.ts +18 -0
  801. package/dist/interpreter/builtins/local.d.ts +6 -0
  802. package/dist/interpreter/builtins/mapfile.d.ts +17 -0
  803. package/dist/interpreter/builtins/read.d.ts +6 -0
  804. package/dist/interpreter/builtins/return.d.ts +6 -0
  805. package/dist/interpreter/builtins/set.d.ts +9 -0
  806. package/dist/interpreter/builtins/shift.d.ts +15 -0
  807. package/dist/interpreter/builtins/shopt.d.ts +7 -0
  808. package/dist/interpreter/builtins/source.d.ts +6 -0
  809. package/dist/interpreter/builtins/unset.d.ts +16 -0
  810. package/dist/interpreter/builtins/variable-assignment.d.ts +66 -0
  811. package/dist/interpreter/command-resolution.d.ts +43 -0
  812. package/dist/interpreter/conditionals.d.ts +17 -0
  813. package/dist/interpreter/control-flow.d.ts +21 -0
  814. package/dist/interpreter/defense-aware-command-context.d.ts +6 -0
  815. package/dist/interpreter/errors.d.ts +167 -0
  816. package/dist/interpreter/expansion/analysis.d.ts +37 -0
  817. package/dist/interpreter/expansion/arith-text-expansion.d.ts +20 -0
  818. package/dist/interpreter/expansion/array-pattern-ops.d.ts +21 -0
  819. package/dist/interpreter/expansion/array-prefix-suffix.d.ts +46 -0
  820. package/dist/interpreter/expansion/array-slice-transform.d.ts +36 -0
  821. package/dist/interpreter/expansion/array-word-expansion.d.ts +39 -0
  822. package/dist/interpreter/expansion/brace-range.d.ts +20 -0
  823. package/dist/interpreter/expansion/command-substitution.d.ts +23 -0
  824. package/dist/interpreter/expansion/glob-escape.d.ts +32 -0
  825. package/dist/interpreter/expansion/indirect-expansion.d.ts +42 -0
  826. package/dist/interpreter/expansion/parameter-ops.d.ts +113 -0
  827. package/dist/interpreter/expansion/pattern-expansion.d.ts +23 -0
  828. package/dist/interpreter/expansion/pattern-removal.d.ts +18 -0
  829. package/dist/interpreter/expansion/pattern.d.ts +23 -0
  830. package/dist/interpreter/expansion/positional-params.d.ts +59 -0
  831. package/dist/interpreter/expansion/prompt.d.ts +39 -0
  832. package/dist/interpreter/expansion/quoting.d.ts +13 -0
  833. package/dist/interpreter/expansion/tilde.d.ts +12 -0
  834. package/dist/interpreter/expansion/unquoted-expansion.d.ts +76 -0
  835. package/dist/interpreter/expansion/variable-attrs.d.ts +19 -0
  836. package/dist/interpreter/expansion/variable.d.ts +36 -0
  837. package/dist/interpreter/expansion/word-glob-expansion.d.ts +33 -0
  838. package/dist/interpreter/expansion/word-split.d.ts +29 -0
  839. package/dist/interpreter/expansion.d.ts +53 -0
  840. package/dist/interpreter/functions.d.ts +12 -0
  841. package/dist/interpreter/helpers/array.d.ts +43 -0
  842. package/dist/interpreter/helpers/condition.d.ts +22 -0
  843. package/dist/interpreter/helpers/errors.d.ts +8 -0
  844. package/dist/interpreter/helpers/file-tests.d.ts +33 -0
  845. package/dist/interpreter/helpers/ifs.d.ts +104 -0
  846. package/dist/interpreter/helpers/loop.d.ts +24 -0
  847. package/dist/interpreter/helpers/nameref.d.ts +65 -0
  848. package/dist/interpreter/helpers/numeric-compare.d.ts +13 -0
  849. package/dist/interpreter/helpers/quoting.d.ts +24 -0
  850. package/dist/interpreter/helpers/readonly.d.ts +45 -0
  851. package/dist/interpreter/helpers/regex.d.ts +8 -0
  852. package/dist/interpreter/helpers/result.d.ts +60 -0
  853. package/dist/interpreter/helpers/shell-constants.d.ts +25 -0
  854. package/dist/interpreter/helpers/shellopts.d.ts +28 -0
  855. package/dist/interpreter/helpers/statements.d.ts +20 -0
  856. package/dist/interpreter/helpers/string-compare.d.ts +24 -0
  857. package/dist/interpreter/helpers/string-tests.d.ts +13 -0
  858. package/dist/interpreter/helpers/tilde.d.ts +13 -0
  859. package/dist/interpreter/helpers/variable-tests.d.ts +9 -0
  860. package/dist/interpreter/helpers/word-matching.d.ts +26 -0
  861. package/dist/interpreter/helpers/word-parts.d.ts +22 -0
  862. package/dist/interpreter/helpers/xtrace.d.ts +18 -0
  863. package/dist/interpreter/index.d.ts +4 -0
  864. package/dist/interpreter/interpreter.d.ts +91 -0
  865. package/dist/interpreter/pipeline-execution.d.ts +16 -0
  866. package/dist/interpreter/redirections.d.ts +60 -0
  867. package/dist/interpreter/simple-command-assignments.d.ts +29 -0
  868. package/dist/interpreter/subshell-group.d.ts +32 -0
  869. package/dist/interpreter/type-command.d.ts +37 -0
  870. package/dist/interpreter/types.d.ts +393 -0
  871. package/dist/limits.d.ts +52 -0
  872. package/dist/network/allow-list/shared.d.ts +59 -0
  873. package/dist/network/allow-list.d.ts +59 -0
  874. package/dist/network/dns-pin.d.ts +43 -0
  875. package/dist/network/fetch.d.ts +25 -0
  876. package/dist/network/index.d.ts +7 -0
  877. package/dist/network/types.d.ts +155 -0
  878. package/dist/parser/arithmetic-parser.d.ts +23 -0
  879. package/dist/parser/arithmetic-primaries.d.ts +45 -0
  880. package/dist/parser/command-parser.d.ts +10 -0
  881. package/dist/parser/compound-parser.d.ts +28 -0
  882. package/dist/parser/conditional-parser.d.ts +8 -0
  883. package/dist/parser/expansion-parser.d.ts +16 -0
  884. package/dist/parser/lexer.d.ts +197 -0
  885. package/dist/parser/parser-substitution.d.ts +76 -0
  886. package/dist/parser/parser.d.ts +136 -0
  887. package/dist/parser/types.d.ts +25 -0
  888. package/dist/parser/word-parser.d.ts +33 -0
  889. package/dist/sandbox/Command.d.ts +35 -0
  890. package/dist/sandbox/Sandbox.d.ts +90 -0
  891. package/dist/sandbox/index.d.ts +2 -0
  892. package/dist/shell-metadata.d.ts +25 -0
  893. package/dist/timers.d.ts +4 -0
  894. package/dist/types.d.ts +248 -0
  895. package/dist/utils/args.d.ts +55 -0
  896. package/dist/utils/constants.d.ts +15 -0
  897. package/dist/utils/file-reader.d.ts +74 -0
  898. package/dist/utils/glob.d.ts +25 -0
  899. package/dist/vitest-setup.d.ts +1 -0
  900. package/package.json +188 -0
  901. package/vendor/cpython-emscripten/python.cjs +2 -0
  902. package/vendor/cpython-emscripten/python.wasm +0 -0
  903. package/vendor/cpython-emscripten/python313.zip +0 -0
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as $}from"./chunk-NE4R2FVV.js";import{a as z,b as w}from"./chunk-MUFNRCMY.js";import{constants as x,gunzipSync as F,gzipSync as S}from"node:zlib";var O={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
4
+
5
+ When no FILE is given, or when FILE is -, read from standard input.
6
+
7
+ With -d, decompress instead.`,options:["-c, --stdout write to standard output, keep original files","-d, --decompress decompress","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not save or restore the original name and timestamp","-N, --name save or restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode","-1, --fast compress faster","-9, --best compress better"," --help display this help and exit"]},U={name:"gunzip",summary:"decompress files",usage:"gunzip [OPTION]... [FILE]...",description:`Decompress FILEs (by default, in-place).
8
+
9
+ When no FILE is given, or when FILE is -, read from standard input.`,options:["-c, --stdout write to standard output, keep original files","-f, --force force overwrite of output file","-k, --keep keep (don't delete) input files","-l, --list list compressed file contents","-n, --no-name do not restore the original name and timestamp","-N, --name restore the original file name and timestamp","-q, --quiet suppress all warnings","-r, --recursive operate recursively on directories","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},D={name:"zcat",summary:"decompress files to stdout",usage:"zcat [OPTION]... [FILE]...",description:`Decompress FILEs to standard output.
10
+
11
+ When no FILE is given, or when FILE is -, read from standard input.`,options:["-f, --force force; read compressed data even from a terminal","-l, --list list compressed file contents","-q, --quiet suppress all warnings","-S, --suffix=SUF use suffix SUF on compressed files (default: .gz)","-t, --test test compressed file integrity","-v, --verbose verbose mode"," --help display this help and exit"]},T={stdout:{short:"c",long:"stdout",type:"boolean"},toStdout:{long:"to-stdout",type:"boolean"},decompress:{short:"d",long:"decompress",type:"boolean"},uncompress:{long:"uncompress",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},keep:{short:"k",long:"keep",type:"boolean"},list:{short:"l",long:"list",type:"boolean"},noName:{short:"n",long:"no-name",type:"boolean"},name:{short:"N",long:"name",type:"boolean"},quiet:{short:"q",long:"quiet",type:"boolean"},recursive:{short:"r",long:"recursive",type:"boolean"},suffix:{short:"S",long:"suffix",type:"string",default:".gz"},test:{short:"t",long:"test",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"},fast:{short:"1",long:"fast",type:"boolean"},level2:{short:"2",type:"boolean"},level3:{short:"3",type:"boolean"},level4:{short:"4",type:"boolean"},level5:{short:"5",type:"boolean"},level6:{short:"6",type:"boolean"},level7:{short:"7",type:"boolean"},level8:{short:"8",type:"boolean"},best:{short:"9",long:"best",type:"boolean"}};function E(e){return e.best?x.Z_BEST_COMPRESSION:e.level8?8:e.level7?7:e.level6?6:e.level5?5:e.level4?4:e.level3?3:e.level2?2:e.fast?x.Z_BEST_SPEED:x.Z_DEFAULT_COMPRESSION}function k(e){if(e.length<10)return{originalName:null,mtime:null,headerSize:0};if(e[0]!==31||e[1]!==139)return{originalName:null,mtime:null,headerSize:0};let t=e[3],r=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,o=10;if(t&4){if(o+2>e.length)return{originalName:null,mtime:null,headerSize:0};let n=e[o]|e[o+1]<<8;o+=2+n}let s=null;if(t&8){let n=o;for(;o<e.length&&e[o]!==0;)o++;o<e.length&&(s=new TextDecoder().decode(e.slice(n,o)),o++)}if(t&16){for(;o<e.length&&e[o]!==0;)o++;o++}return t&2&&(o+=2),{originalName:s,mtime:r>0?new Date(r*1e3):null,headerSize:o}}function q(e){if(e.length<4)return 0;let t=e.length;return e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24}function b(e){return e.length>=2&&e[0]===31&&e[1]===139}function m(e){return Buffer.from(e).toString("latin1")}function I(e){return e.limits?.maxOutputSize??0}function v(e,t){if(t>0){if(q(e)>t)throw new Error(`decompressed data exceeds limit (${t} bytes)`);return F(e,{maxOutputLength:t})}return F(e)}async function L(e,t,r,o,s,n){let a=r.suffix,f,p,d,c=I(e);if(t==="-"||t==="")if(d=Uint8Array.from(e.stdin,i=>i.charCodeAt(0)),s){if(!b(d))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: stdin: not in gzip format
12
+ `,exitCode:1};try{let i=v(d,c);return{stdout:m(i),stderr:"",exitCode:0}}catch(i){let l=i instanceof Error?i.message:"unknown error";return{stdout:"",stderr:`${o}: stdin: ${l}
13
+ `,exitCode:1}}}else{let i=E(r),l=S(d,{level:i});return{stdout:m(l),stderr:"",exitCode:0}}f=e.fs.resolvePath(e.cwd,t);try{if((await e.fs.stat(f)).isDirectory)return r.recursive?await P(e,f,r,o,s,n):r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: is a directory -- ignored
14
+ `,exitCode:1}}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory
15
+ `,exitCode:1}}try{d=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory
16
+ `,exitCode:1}}if(s){if(!t.endsWith(a))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: unknown suffix -- ignored
17
+ `,exitCode:1};if(!b(d))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: not in gzip format
18
+ `,exitCode:1};let i;try{i=v(d,c)}catch(l){let u=l instanceof Error?l.message:"unknown error";return{stdout:"",stderr:`${o}: ${t}: ${u}
19
+ `,exitCode:1}}if(n)return{stdout:m(i),stderr:"",exitCode:0};if(r.name){let l=k(d);l.originalName?p=e.fs.resolvePath(e.cwd,l.originalName):p=f.slice(0,-a.length)}else p=f.slice(0,-a.length);if(!r.force)try{return await e.fs.stat(p),{stdout:"",stderr:`${o}: ${p} already exists; not overwritten
20
+ `,exitCode:1}}catch{}if(await e.fs.writeFile(p,i),!r.keep&&!n&&await e.fs.rm(f),r.verbose){let l=d.length>0?((1-d.length/i.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${l}% -- replaced with ${p.split("/").pop()}
21
+ `,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}else{if(t.endsWith(a))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t} already has ${a} suffix -- unchanged
22
+ `,exitCode:1};let i=E(r),l;try{l=S(d,{level:i})}catch(u){let g=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`${o}: ${t}: ${g}
23
+ `,exitCode:1}}if(n)return{stdout:m(l),stderr:"",exitCode:0};if(p=f+a,!r.force)try{return await e.fs.stat(p),{stdout:"",stderr:`${o}: ${p} already exists; not overwritten
24
+ `,exitCode:1}}catch{}if(await e.fs.writeFile(p,l),!r.keep&&!n&&await e.fs.rm(f),r.verbose){let u=d.length>0?((1-l.length/d.length)*100).toFixed(1):"0.0";return{stdout:"",stderr:`${t}: ${u}% -- replaced with ${p.split("/").pop()}
25
+ `,exitCode:0}}return{stdout:"",stderr:"",exitCode:0}}}async function P(e,t,r,o,s,n){let a=await e.fs.readdir(t),f="",p="",d=0;for(let c of a){let i=e.fs.resolvePath(t,c),l=await e.fs.stat(i);if(l.isDirectory){let u=await P(e,i,r,o,s,n);f+=u.stdout,p+=u.stderr,u.exitCode!==0&&(d=u.exitCode)}else if(l.isFile){let u=r.suffix;if(s&&!c.endsWith(u)||!s&&c.endsWith(u))continue;let g=i.startsWith(`${e.cwd}/`)?i.slice(e.cwd.length+1):i,y=await L(e,g,r,o,s,n);f+=y.stdout,p+=y.stderr,y.exitCode!==0&&(d=y.exitCode)}}return{stdout:f,stderr:p,exitCode:d}}async function W(e,t,r,o){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,i=>i.charCodeAt(0));else{let i=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(i)}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory
26
+ `,exitCode:1}}}if(!b(s))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: not in gzip format
27
+ `,exitCode:1};let n=s.length,a=q(s),f=a>0?((1-n/a)*100).toFixed(1):"0.0",d=k(s).originalName||(t==="-"?"":t.replace(/\.gz$/,""));return{stdout:`${n.toString().padStart(10)} ${a.toString().padStart(10)} ${f.padStart(5)}% ${d}
28
+ `,stderr:"",exitCode:0}}async function A(e,t,r,o){let s;if(t==="-"||t==="")s=Uint8Array.from(e.stdin,n=>n.charCodeAt(0));else{let n=e.fs.resolvePath(e.cwd,t);try{s=await e.fs.readFileBuffer(n)}catch{return{stdout:"",stderr:`${o}: ${t}: No such file or directory
29
+ `,exitCode:1}}}if(!b(s))return r.quiet?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`${o}: ${t}: not in gzip format
30
+ `,exitCode:1};try{return v(s,I(e)),r.verbose?{stdout:"",stderr:`${t}: OK
31
+ `,exitCode:0}:{stdout:"",stderr:"",exitCode:0}}catch(n){let a=n instanceof Error?n.message:"invalid";return{stdout:"",stderr:`${o}: ${t}: ${a}
32
+ `,exitCode:1}}}async function C(e,t,r){let o=r==="zcat"?D:r==="gunzip"?U:O;if(w(e))return z(o);let s=$(r,e,T);if(!s.ok)return s.error.stderr.includes("unrecognized option"),s.error;let n=s.result.flags,a=s.result.positional,f=r==="gunzip"||r==="zcat"||n.decompress||n.uncompress,p=r==="zcat"||n.stdout||n.toStdout;if(n.list){a.length===0&&(a=["-"]);let l=` compressed uncompressed ratio uncompressed_name
33
+ `,u="",g=0;for(let y of a){let h=await W(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}if(n.test){a.length===0&&(a=["-"]);let l="",u="",g=0;for(let y of a){let h=await A(t,y,n,r);l+=h.stdout,u+=h.stderr,h.exitCode!==0&&(g=h.exitCode)}return{stdout:l,stderr:u,exitCode:g}}a.length===0&&(a=["-"]);let d="",c="",i=0;for(let l of a){let u=await L(t,l,n,r,f,p);d+=u.stdout,c+=u.stderr,u.exitCode!==0&&(i=u.exitCode)}return{stdout:d,stderr:c,exitCode:i}}var Z={name:"gzip",async execute(e,t){return{...await C(e,t,"gzip"),stdoutEncoding:"binary"}}},R={name:"gunzip",async execute(e,t){return{...await C(e,t,"gunzip"),stdoutEncoding:"binary"}}},K={name:"zcat",async execute(e,t){return{...await C(e,t,"zcat"),stdoutEncoding:"binary"}}},j={name:"gzip",flags:[{flag:"-c",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-1",type:"boolean"},{flag:"-9",type:"boolean"}],stdinType:"binary",needsFiles:!0},J={name:"gunzip",flags:[{flag:"-c",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-k",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0},Q={name:"zcat",flags:[{flag:"-f",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-v",type:"boolean"}],stdinType:"binary",needsFiles:!0};export{Z as a,R as b,K as c,j as d,J as e,Q as f};
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as f}from"./chunk-VZK4FHWJ.js";import{a as m,b as c,c as b}from"./chunk-MUFNRCMY.js";var p={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};function N(r,s,i){let l=String(r);switch(s){case"ln":return l.padEnd(i);case"rn":return l.padStart(i);case"rz":return l.padStart(i,"0");default:return s}}function v(r,s){switch(s){case"a":return!0;case"t":return r.trim().length>0;case"n":return!1;default:return s}}function h(r,s,i){if(r==="")return{output:"",nextNumber:i};let l=r.split(`
4
+ `),t=[],u=i,a=r.endsWith(`
5
+ `)&&l[l.length-1]==="";a&&l.pop();for(let n of l)if(v(n,s.bodyStyle)){let e=N(u,s.numberFormat,s.width);t.push(`${e}${s.separator}${n}`),u+=s.increment}else{let e=" ".repeat(s.width);t.push(`${e}${s.separator}${n}`)}return{output:t.join(`
6
+ `)+(a?`
7
+ `:""),nextNumber:u}}var w={name:"nl",execute:async(r,s)=>{if(c(r))return m(p);let i={bodyStyle:"t",numberFormat:"rn",width:6,separator:" ",startNumber:1,increment:1},l=[],t=0;for(;t<r.length;){let n=r[t];if(n==="-b"&&t+1<r.length){let e=r[t+1];if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
8
+ `};i.bodyStyle=e,t+=2}else if(n.startsWith("-b")){let e=n.slice(2);if(e!=="a"&&e!=="t"&&e!=="n")return{exitCode:1,stdout:"",stderr:`nl: invalid body numbering style: '${e}'
9
+ `};i.bodyStyle=e,t++}else if(n==="-n"&&t+1<r.length){let e=r[t+1];if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
10
+ `};i.numberFormat=e,t+=2}else if(n.startsWith("-n")){let e=n.slice(2);if(e!=="ln"&&e!=="rn"&&e!=="rz")return{exitCode:1,stdout:"",stderr:`nl: invalid line numbering format: '${e}'
11
+ `};i.numberFormat=e,t++}else if(n==="-w"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${r[t+1]}'
12
+ `};i.width=e,t+=2}else if(n.startsWith("-w")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e)||e<1)return{exitCode:1,stdout:"",stderr:`nl: invalid line number field width: '${n.slice(2)}'
13
+ `};i.width=e,t++}else if(n==="-s"&&t+1<r.length)i.separator=r[t+1],t+=2;else if(n.startsWith("-s"))i.separator=n.slice(2),t++;else if(n==="-v"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${r[t+1]}'
14
+ `};i.startNumber=e,t+=2}else if(n.startsWith("-v")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid starting line number: '${n.slice(2)}'
15
+ `};i.startNumber=e,t++}else if(n==="-i"&&t+1<r.length){let e=parseInt(r[t+1],10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${r[t+1]}'
16
+ `};i.increment=e,t+=2}else if(n.startsWith("-i")){let e=parseInt(n.slice(2),10);if(Number.isNaN(e))return{exitCode:1,stdout:"",stderr:`nl: invalid line number increment: '${n.slice(2)}'
17
+ `};i.increment=e,t++}else if(n==="--"){l.push(...r.slice(t+1));break}else{if(n.startsWith("-")&&n!=="-")return b("nl",n);l.push(n),t++}}let u="",a=i.startNumber;if(l.length===0){let n=f(s.stdin)??"";u=h(n,i,a).output}else for(let n of l){let e=s.fs.resolvePath(s.cwd,n),o=await s.fs.readFile(e);if(o===null)return{exitCode:1,stdout:u,stderr:`nl: ${n}: No such file or directory
18
+ `};let d=h(o,i,a);u+=d.output,a=d.nextNumber}return{exitCode:0,stdout:u,stderr:""}}},g={name:"nl",flags:[{flag:"-b",type:"value",valueHint:"string"},{flag:"-n",type:"value",valueHint:"string"},{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"value",valueHint:"string"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-i",type:"value",valueHint:"number"}],stdinType:"text",needsFiles:!0};export{w as a,g as b};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as m}from"./chunk-FKVQZWJQ.js";var s=m("md5sum","md5","compute MD5 message digest"),o={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{s as a,o as b};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as r,b as u}from"./chunk-MUFNRCMY.js";var d={name:"alias",summary:"define or display aliases",usage:"alias [name[=value] ...]",options:[" --help display this help and exit"]},o="BASH_ALIAS_",m={name:"alias",async execute(e,a){if(u(e))return r(d);if(e.length===0){let s="";for(let[i,t]of a.env)if(i.startsWith(o)){let n=i.slice(o.length);s+=`alias ${n}='${t}'
4
+ `}return{stdout:s,stderr:"",exitCode:0}}let l=e[0]==="--"?e.slice(1):e;for(let s of l){let i=s.indexOf("=");if(i===-1){let t=o+s;return a.env.get(t)?{stdout:`alias ${s}='${a.env.get(t)}'
5
+ `,stderr:"",exitCode:0}:{stdout:"",stderr:`alias: ${s}: not found
6
+ `,exitCode:1}}else{let t=s.slice(0,i),n=s.slice(i+1);(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))&&(n=n.slice(1,-1)),a.env.set(o+t,n)}}return{stdout:"",stderr:"",exitCode:0}}},c={name:"unalias",async execute(e,a){if(u(e))return r({name:"unalias",summary:"remove alias definitions",usage:"unalias name [name ...]",options:["-a remove all aliases"," --help display this help and exit"]});if(e.length===0)return{stdout:"",stderr:`unalias: usage: unalias [-a] name [name ...]
7
+ `,exitCode:1};if(e[0]==="-a"){for(let t of a.env.keys())t.startsWith(o)&&a.env.delete(t);return{stdout:"",stderr:"",exitCode:0}}let l=e[0]==="--"?e.slice(1):e,s=!1,i="";for(let t of l){let n=o+t;a.env.get(n)?a.env.delete(n):(i+=`unalias: ${t}: not found
8
+ `,s=!0)}return{stdout:"",stderr:i,exitCode:s?1:0}}},p={name:"alias",flags:[]},h={name:"unalias",flags:[{flag:"-a",type:"boolean"}]};export{m as a,c as b,p as c,h as d};
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as r}from"./chunk-3MRB66F4.js";var c=new Map([["File operations",["ls","cat","head","tail","wc","touch","mkdir","rm","cp","mv","ln","chmod","stat","readlink"]],["Text processing",["grep","sed","awk","sort","uniq","cut","tr","tee","diff"]],["Search",["find"]],["Navigation & paths",["pwd","basename","dirname","tree","du"]],["Environment & shell",["echo","printf","env","printenv","export","alias","unalias","history","clear","true","false","bash","sh"]],["Data processing",["xargs","jq","base64","date"]],["Network",["curl","html-to-markdown"]]]);function d(n){let e=[],s=new Set(n);e.push(`Available commands:
4
+ `);let t=[];for(let[a,l]of c){let o=l.filter(i=>s.has(i));if(o.length>0){e.push(` ${a}:`),e.push(` ${o.join(", ")}
5
+ `);for(let i of o)s.delete(i)}}for(let a of s)t.push(a);return t.length>0&&(e.push(" Other:"),e.push(` ${t.sort().join(", ")}
6
+ `)),e.push("Use '<command> --help' for details on a specific command."),`${e.join(`
7
+ `)}
8
+ `}var h={name:"help",async execute(n,e){if(n.includes("--help")||n.includes("-h"))return{stdout:`help - display available commands
9
+
10
+ Usage: help [command]
11
+
12
+ Options:
13
+ -h, --help Show this help message
14
+
15
+ If a command name is provided, shows help for that command.
16
+ Otherwise, lists all available commands.
17
+ `,stderr:"",exitCode:0};if(n.length>0&&e.exec){let t=n[0];return e.exec(r([t]),{cwd:e.cwd,signal:e.signal,args:["--help"]})}let s=e.getRegisteredCommands?.()??[];return{stdout:d(s),stderr:"",exitCode:0}}},p={name:"help",flags:[]};export{h as a,p as b};
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as q,b as w}from"./chunk-KRRM5UCC.js";import{c as b}from"./chunk-LNNWMRCB.js";import{b as E}from"./chunk-HL4ZS7TX.js";import{a as x}from"./chunk-VZK4FHWJ.js";import{a as T,b as g}from"./chunk-PBOVSFTJ.js";import{a as C,b as M}from"./chunk-MUFNRCMY.js";import{randomBytes as Y}from"node:crypto";import{existsSync as G}from"node:fs";import{dirname as K,join as $,sep as O}from"node:path";import{fileURLToPath as Z}from"node:url";import{Worker as v}from"node:worker_threads";import ee from"sql.js";function B(e,t,r){switch(r.mode){case"list":return N(e,t,r);case"csv":return R(e,t,r);case"json":return W(e,t);case"line":return F(e,t,r);case"column":return Q(e,t,r);case"table":return U(e,t,r);case"markdown":return H(e,t,r);case"tabs":return J(e,t,r);case"box":return _(e,t,r);case"quote":return z(e,t,r);case"html":return D(e,t,r);case"ascii":return X(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 N(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 R(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(`
4
+ `)}
5
+ `:""}function L(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(`
6
+ `)?`"${e.replace(/"/g,'""')}"`:e}function A(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function P(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):A(e):JSON.stringify(e)}function W(e,t){return t.length===0?"":`[${t.map(n=>`{${e.map((o,i)=>`${JSON.stringify(o)}:${P(n[i])}`).join(",")}}`).join(`,
7
+ `)}]
8
+ `}function F(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(`
9
+ `)}
10
+ `}function Q(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(`
11
+ `)}
12
+ `:""}function U(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(`
13
+ `)}
14
+ `}function H(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(`
15
+ `)}
16
+ `:""}function J(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 _(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(`
17
+ `)}
18
+ `}function z(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):A(o):`'${String(o)}'`).join(","));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function D(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(`
19
+ `)}
20
+ `:""}function V(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function X(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 re=5e3,te={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 ne(e){let t={mode:"list",header:!1,separator:"|",newline:`
21
+ `,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
22
+ `,exitCode:1};t.separator=e[++i]}else if(s==="-newline"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -newline
23
+ `,exitCode:1};t.newline=e[++i]}else if(s==="-nullvalue"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -nullvalue
24
+ `,exitCode:1};t.nullValue=e[++i]}else if(s==="-cmd"){if(i+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -cmd
25
+ `,exitCode:1};t.cmd=e[++i]}else{if(s.startsWith("-"))return{stdout:"",stderr:`sqlite3: Error: unknown option: ${s.startsWith("--")?s.slice(1):s}
26
+ Use -help for a list of options.
27
+ `,exitCode:1};r===null?r=s:n===null&&(n=s)}}return{options:t,database:r,sql:n,showVersion:a}}async function oe(){let e=await E.runTrustedAsync(()=>ee()),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 I(e=K(Z(import.meta.url))){let t=[$(e,"sqlite3-worker.js"),$(e,"../../commands/sqlite3/worker.js")];(e.endsWith(`${O}commands${O}sqlite3`)||e.endsWith("/commands/sqlite3"))&&t.push($(e,"worker.js")),t.push($(e,"../../../dist/commands/sqlite3/worker.js"));for(let r of t)if(G(r))return r;throw new Error("sqlite3 worker not found. Run 'pnpm build' to compile the worker.")}var se={createWorker(e,t){return new v(e,{workerData:t})},findWorkerPath:I};function ie(){return Y(16).toString("hex")}function ae(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 le(e,t,r){try{let n=I();return await new Promise((a,o)=>{let i=E.runTrusted(()=>se.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(ae(u,e.protocolToken))}),y=b(r,"sqlite3","worker error callback",u=>{w(c),o(u)}),k=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)})}},j=u=>{try{y(u)}catch(l){w(c);let d=l instanceof Error?l.message:String(l);o(new Error(g(d)))}},h=u=>{try{k(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",j),i.on("exit",h)})}catch(n){let a=g(n.message);throw new Error(`sqlite3 worker failed to load: ${a}`)}}var je={name:"sqlite3",async execute(e,t){if(M(e)||e.includes("-help"))return C(te);let r=ne(e);if("exitCode"in r)return r;let{options:n,database:a,sql:o,showVersion:i}=r;if(i)return{stdout:`${await oe()}
28
+ `,stderr:"",exitCode:0};if(!a)return{stdout:"",stderr:`sqlite3: missing database argument
29
+ `,exitCode:1};let s=o||x(t.stdin).trim();if(n.cmd&&(s=n.cmd+(s?`; ${s}`:"")),!s)return{stdout:"",stderr:`sqlite3: no SQL provided
30
+ `,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=T(l.message);return{stdout:"",stderr:`sqlite3: unable to open database "${a}": ${d}
31
+ `,exitCode:1}}let y=t.limits?.maxSqliteTimeoutMs??re,k={protocolToken:ie(),dbBuffer:S,sql:s,options:{bail:n.bail,echo:n.echo}},p;try{p=await le(k,y,t.requireDefenseContext)}catch(l){return{stdout:"",stderr:`sqlite3: worker error: ${g(l.message)}
32
+ `,exitCode:1}}if(!p.success)return{stdout:"",stderr:`sqlite3: ${g(p.error)}
33
+ `,exitCode:1};let j={mode:n.mode,header:n.header,separator:n.separator,newline:n.newline,nullValue:n.nullValue},h="";n.echo&&(h+=`${s}
34
+ `);let u=!1;for(let l of p.results)if(l.type==="error"){if(n.bail)return{stdout:h,stderr:`Error: ${l.error}
35
+ `,exitCode:1};h+=`Error: ${l.error}
36
+ `,u=!0}else l.columns&&l.rows&&(l.rows.length>0||n.header)&&(h+=B(l.columns,l.rows,j));if(p.hasModifications&&!n.readonly&&!m&&c&&p.dbBuffer)try{await t.fs.writeFile(c,p.dbBuffer)}catch(l){let d=T(l.message);return{stdout:h,stderr:`sqlite3: failed to write database: ${d}
37
+ `,exitCode:1}}return{stdout:h,stderr:"",exitCode:u&&n.bail?1:0}}},Ee={name:"sqlite3",flags:[],needsArgs:!0};export{se as a,je as b,Ee as c};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as g}from"./chunk-VZK4FHWJ.js";import{a as b,b as m,c as v}from"./chunk-MUFNRCMY.js";var L={name:"unexpand",summary:"convert spaces to tabs",usage:"unexpand [OPTION]... [FILE]...",description:"Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-a Convert all sequences of blanks (not just leading)"],examples:["unexpand file.txt # Convert leading spaces to tabs","unexpand -a file.txt # Convert all space sequences","unexpand -t 4 file.txt # Use 4-space tabs"]};function f(s){let i=s.split(",").map(o=>o.trim()),e=[];for(let o of i){let n=parseInt(o,10);if(Number.isNaN(n)||n<1)return null;e.push(n)}for(let o=1;o<e.length;o++)if(e[o]<=e[o-1])return null;return e}function C(s,i){if(i.length===1){let e=i[0];return s+(e-s%e)}for(let e of i)if(e>s)return e;if(i.length>=2){let e=i[i.length-1]-i[i.length-2],o=i[i.length-1],n=Math.floor((s-o)/e)+1;return o+n*e}return-1}function N(s,i){let{tabStops:e,allBlanks:o}=i,n="",a=0,t="",l=0,u=!0,d=()=>{if(t.length===0)return;let r=l+t.length;if(!o&&!u){n+=t,t="";return}let p=l,c="";for(;p<r;){let h=C(p,e);if(h<=r&&h>p)c+=" ",p=h;else break}let x=r-p;x>0&&(c+=" ".repeat(x)),n+=c,t=""};for(let r of s)r===" "?(t.length===0&&(l=a),t+=r,a++):r===" "?(d(),n+=r,a=C(a,e)):(d(),n+=r,a++,u=!1);return d(),n}function k(s,i){if(s==="")return"";let e=s.split(`
4
+ `),o=s.endsWith(`
5
+ `)&&e[e.length-1]==="";return o&&e.pop(),e.map(a=>N(a,i)).join(`
6
+ `)+(o?`
7
+ `:"")}var I={name:"unexpand",execute:async(s,i)=>{if(m(s))return b(L);let e={tabStops:[8],allBlanks:!1},o=[],n=0;for(;n<s.length;){let t=s[n];if(t==="-t"&&n+1<s.length){let l=f(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
8
+ `};e.tabStops=l,n+=2}else if(t.startsWith("-t")&&t.length>2){let l=f(t.slice(2));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(2)}'
9
+ `};e.tabStops=l,n++}else if(t==="--tabs"&&n+1<s.length){let l=f(s[n+1]);if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${s[n+1]}'
10
+ `};e.tabStops=l,n+=2}else if(t.startsWith("--tabs=")){let l=f(t.slice(7));if(!l)return{exitCode:1,stdout:"",stderr:`unexpand: invalid tab size: '${t.slice(7)}'
11
+ `};e.tabStops=l,n++}else if(t==="-a"||t==="--all")e.allBlanks=!0,n++;else if(t==="--"){o.push(...s.slice(n+1));break}else{if(t.startsWith("-")&&t!=="-")return v("unexpand",t);o.push(t),n++}}let a="";if(o.length===0){let t=g(i.stdin)??"";a=k(t,e)}else for(let t of o){let l=i.fs.resolvePath(i.cwd,t),u=await i.fs.readFile(l);if(u===null)return{exitCode:1,stdout:a,stderr:`unexpand: ${t}: No such file or directory
12
+ `};a+=k(u,e)}return{exitCode:0,stdout:a,stderr:""}}},T={name:"unexpand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-a",type:"boolean"}],stdinType:"text",needsFiles:!0};export{I as a,T as b};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as s}from"./chunk-FKVQZWJQ.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,10 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as U}from"./chunk-VZK4FHWJ.js";import{a as $,b as F,c as k}from"./chunk-MUFNRCMY.js";var L=new Map([["sha1","SHA-1"],["sha256","SHA-256"]]);function D(n){function h(r,u){return r<<u|r>>>32-u}let g=new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]),A=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],b=n.length*8,c=(n.length%64<56?56:120)-n.length%64,s=new Uint8Array(n.length+c+8);s.set(n),s[n.length]=128;let d=new DataView(s.buffer);d.setUint32(s.length-8,b>>>0,!0),d.setUint32(s.length-4,Math.floor(b/4294967296),!0);let w=1732584193,l=4023233417,p=2562383102,e=271733878;for(let r=0;r<s.length;r+=64){let u=new Uint32Array(16);for(let t=0;t<16;t++)u[t]=d.getUint32(r+t*4,!0);let m=w,a=l,x=p,o=e;for(let t=0;t<64;t++){let i,y;t<16?(i=a&x|~a&o,y=t):t<32?(i=o&a|~o&x,y=(5*t+1)%16):t<48?(i=a^x^o,y=(3*t+5)%16):(i=x^(a|~o),y=7*t%16),i=i+m+g[t]+u[y]>>>0,m=o,o=x,x=a,a=a+h(i,A[t])>>>0}w=w+m>>>0,l=l+a>>>0,p=p+x>>>0,e=e+o>>>0}let f=new Uint8Array(16);return new DataView(f.buffer).setUint32(0,w,!0),new DataView(f.buffer).setUint32(4,l,!0),new DataView(f.buffer).setUint32(8,p,!0),new DataView(f.buffer).setUint32(12,e,!0),Array.from(f).map(r=>r.toString(16).padStart(2,"0")).join("")}async function C(n,h){if(n==="md5")return D(h);let g=L.get(n);if(!g)throw new Error(`Unknown algorithm: ${n}`);let A=await globalThis.crypto.subtle.digest(g,new Uint8Array(h).buffer);return Array.from(new Uint8Array(A)).map(b=>b.toString(16).padStart(2,"0")).join("")}function I(n,h,g){let A={name:n,summary:g,usage:`${n} [OPTION]... [FILE]...`,options:["-c, --check read checksums from FILEs and check them"," --help display this help and exit"]};return{name:n,async execute(b,c){if(F(b))return $(A);let s=!1,d=[];for(let e of b)if(e==="-c"||e==="--check")s=!0;else if(!(e==="-b"||e==="-t"||e==="--binary"||e==="--text")){if(e.startsWith("-")&&e!=="-")return k(n,e);d.push(e)}d.length===0&&d.push("-");let w=async e=>{if(e==="-")return Uint8Array.from(c.stdin,f=>f.charCodeAt(0));try{return await c.fs.readFileBuffer(c.fs.resolvePath(c.cwd,e))}catch{return null}};if(s){let e=0,f="";for(let r of d){let u=r==="-"?U(c.stdin):await c.fs.readFile(c.fs.resolvePath(c.cwd,r)).catch(()=>null);if(u===null)return{stdout:"",stderr:`${n}: ${r}: No such file or directory
4
+ `,exitCode:1};for(let m of u.split(`
5
+ `)){let a=m.match(/^([a-fA-F0-9]+)\s+[* ]?(.+)$/);if(!a)continue;let[,x,o]=a,t=await w(o);if(t===null){f+=`${o}: FAILED open or read
6
+ `,e++;continue}let i=await C(h,t)===x.toLowerCase();f+=`${o}: ${i?"OK":"FAILED"}
7
+ `,i||e++}}return e>0&&(f+=`${n}: WARNING: ${e} computed checksum${e>1?"s":""} did NOT match
8
+ `),{stdout:f,stderr:"",exitCode:e>0?1:0}}let l="",p=0;for(let e of d){let f=await w(e);if(f===null){l+=`${n}: ${e}: No such file or directory
9
+ `,p=1;continue}l+=`${await C(h,f)} ${e}
10
+ `}return{stdout:l,stderr:"",exitCode:p}}}}export{I as a};
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as D}from"./chunk-VZK4FHWJ.js";import{a as N}from"./chunk-NE4R2FVV.js";import{a as H,b as A}from"./chunk-MUFNRCMY.js";var b=class{diff(e,n,t={}){let i;typeof t=="function"?(i=t,t={}):"callback"in t&&(i=t.callback);let d=this.castInput(e,t),o=this.castInput(n,t),s=this.removeEmpty(this.tokenize(d,t)),a=this.removeEmpty(this.tokenize(o,t));return this.diffWithOptionsObj(s,a,t,i)}diffWithOptionsObj(e,n,t,i){var d;let o=l=>{if(l=this.postProcess(l,t),i){setTimeout(function(){i(l)},0);return}else return l},s=n.length,a=e.length,u=1,r=s+a;t.maxEditLength!=null&&(r=Math.min(r,t.maxEditLength));let g=(d=t.timeout)!==null&&d!==void 0?d:1/0,w=Date.now()+g,m=[{oldPos:-1,lastComponent:void 0}],C=this.extractCommon(m[0],n,e,0,t);if(m[0].oldPos+1>=a&&C+1>=s)return o(this.buildValues(m[0].lastComponent,n,e));let P=-1/0,x=1/0,L=()=>{for(let l=Math.max(P,-u);l<=Math.min(x,u);l+=2){let c,h=m[l-1],p=m[l+1];h&&(m[l-1]=void 0);let y=!1;if(p){let S=p.oldPos-l;y=p&&0<=S&&S<s}let v=h&&h.oldPos+1<a;if(!y&&!v){m[l]=void 0;continue}if(!v||y&&h.oldPos<p.oldPos?c=this.addToPath(p,!0,!1,0,t):c=this.addToPath(h,!1,!0,1,t),C=this.extractCommon(c,n,e,l,t),c.oldPos+1>=a&&C+1>=s)return o(this.buildValues(c.lastComponent,n,e))||!0;m[l]=c,c.oldPos+1>=a&&(x=Math.min(x,l-1)),C+1>=s&&(P=Math.max(P,l+1))}u++};if(i)(function l(){setTimeout(function(){if(u>r||Date.now()>w)return i(void 0);L()||l()},0)})();else for(;u<=r&&Date.now()<=w;){let l=L();if(l)return l}}addToPath(e,n,t,i,d){let o=e.lastComponent;return o&&!d.oneChangePerToken&&o.added===n&&o.removed===t?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:t,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:t,previousComponent:o}}}extractCommon(e,n,t,i,d){let o=n.length,s=t.length,a=e.oldPos,u=a-i,r=0;for(;u+1<o&&a+1<s&&this.equals(t[a+1],n[u+1],d);)u++,a++,r++,d.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return r&&!d.oneChangePerToken&&(e.lastComponent={count:r,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,u}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let i=[],d;for(;e;)i.push(e),d=e.previousComponent,delete e.previousComponent,e=d;i.reverse();let o=i.length,s=0,a=0,u=0;for(;s<o;s++){let r=i[s];if(r.removed)r.value=this.join(t.slice(u,u+r.count)),u+=r.count;else{if(!r.added&&this.useLongestToken){let g=n.slice(a,a+r.count);g=g.map(function(w,m){let C=t[u+m];return C.length>w.length?C:w}),r.value=this.join(g)}else r.value=this.join(n.slice(a,a+r.count));a+=r.count,r.added||(u+=r.count)}}return i}};var I=class extends b{constructor(){super(...arguments),this.tokenize=W}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
4
+ `))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
5
+ `))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
6
+ `)&&(e=e.slice(0,-1)),n.endsWith(`
7
+ `)&&(n=n.slice(0,-1))),super.equals(e,n,t)}},O=new I;function T(f,e,n){return O.diff(f,e,n)}function W(f,e){e.stripTrailingCr&&(f=f.replace(/\r\n/g,`
8
+ `));let n=[],t=f.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let i=0;i<t.length;i++){let d=t[i];i%2&&!e.newlineIsToken?n[n.length-1]+=d:n.push(d)}return n}var j={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function F(f,e,n,t,i,d,o){let s;o?typeof o=="function"?s={callback:o}:s=o:s={},typeof s.context>"u"&&(s.context=4);let a=s.context;if(s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){let{callback:r}=s;T(n,t,Object.assign(Object.assign({},s),{callback:g=>{let w=u(g);r(w)}}))}else return u(T(n,t,s));function u(r){if(!r)return;r.push({value:"",lines:[]});function g(l){return l.map(function(c){return" "+c})}let w=[],m=0,C=0,P=[],x=1,L=1;for(let l=0;l<r.length;l++){let c=r[l],h=c.lines||R(c.value);if(c.lines=h,c.added||c.removed){if(!m){let p=r[l-1];m=x,C=L,p&&(P=a>0?g(p.lines.slice(-a)):[],m-=P.length,C-=P.length)}for(let p of h)P.push((c.added?"+":"-")+p);c.added?L+=h.length:x+=h.length}else{if(m)if(h.length<=a*2&&l<r.length-2)for(let p of g(h))P.push(p);else{let p=Math.min(h.length,a);for(let v of g(h.slice(0,p)))P.push(v);let y={oldStart:m,oldLines:x-m+p,newStart:C,newLines:L-C+p,lines:P};w.push(y),m=0,C=0,P=[]}x+=h.length,L+=h.length}}for(let l of w)for(let c=0;c<l.lines.length;c++)l.lines[c].endsWith(`
9
+ `)?l.lines[c]=l.lines[c].slice(0,-1):(l.lines.splice(c+1,0,"\"),c++);return{oldFileName:f,newFileName:e,oldHeader:i,newHeader:d,hunks:w}}}function E(f,e){if(e||(e=j),Array.isArray(f)){if(f.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return f.map(t=>E(t,e)).join(`
10
+ `)}let n=[];e.includeIndex&&f.oldFileName==f.newFileName&&n.push("Index: "+f.oldFileName),e.includeUnderline&&n.push("==================================================================="),e.includeFileHeaders&&(n.push("--- "+f.oldFileName+(typeof f.oldHeader>"u"?"":" "+f.oldHeader)),n.push("+++ "+f.newFileName+(typeof f.newHeader>"u"?"":" "+f.newHeader)));for(let t=0;t<f.hunks.length;t++){let i=f.hunks[t];i.oldLines===0&&(i.oldStart-=1),i.newLines===0&&(i.newStart-=1),n.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@");for(let d of i.lines)n.push(d)}return n.join(`
11
+ `)+`
12
+ `}function k(f,e,n,t,i,d,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:s}=o;F(f,e,n,t,i,d,Object.assign(Object.assign({},o),{callback:a=>{s(a?E(a,o.headerOptions):void 0)}}))}else{let s=F(f,e,n,t,i,d,o);return s?E(s,o?.headerOptions):void 0}}function R(f){let e=f.endsWith(`
13
+ `),n=f.split(`
14
+ `).map(t=>t+`
15
+ `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}var z={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:["-u, --unified output unified diff format (default)","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --help display this help and exit"]},_={unified:{short:"u",long:"unified",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"}},ee={name:"diff",async execute(f,e){if(A(f))return H(z);let n=N("diff",f,_);if(!n.ok)return n.error;let t=n.result.flags.brief,i=n.result.flags.reportSame,d=n.result.flags.ignoreCase,o=n.result.positional;if(n.result.flags.unified,o.length<2)return{stdout:"",stderr:`diff: missing operand
16
+ `,exitCode:2};let s,a,[u,r]=o;try{s=u==="-"?D(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,u))}catch{return{stdout:"",stderr:`diff: ${u}: No such file or directory
17
+ `,exitCode:2}}try{a=r==="-"?D(e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,r))}catch{return{stdout:"",stderr:`diff: ${r}: No such file or directory
18
+ `,exitCode:2}}let g=s,w=a;return d&&(g=g.toLowerCase(),w=w.toLowerCase()),g===w?i?{stdout:`Files ${u} and ${r} are identical
19
+ `,stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0}:t?{stdout:`Files ${u} and ${r} differ
20
+ `,stderr:"",exitCode:1}:{stdout:k(u,r,s,a,"","",{context:3}),stderr:"",exitCode:1}}},ne={name:"diff",flags:[{flag:"-u",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{ee as a,ne as b};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ var o={name:"pwd",async execute(l,a){let t=!1;for(let e of l)if(e==="-P")t=!0;else if(e==="-L")t=!1;else{if(e==="--")break;e.startsWith("-")}let s=a.cwd;if(t)try{s=await a.fs.realpath(a.cwd)}catch{}return{stdout:`${s}
4
+ `,stderr:"",exitCode:0}}},f={name:"pwd",flags:[{flag:"-P",type:"boolean"},{flag:"-L",type:"boolean"}]};export{o as a,f as b};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{c as u,d as m}from"./chunk-VZK4FHWJ.js";async function w(t,n,s){let{cmdName:r,allowStdinMarker:d=!0,stopOnError:i=!1,batchSize:f=100}=s;if(n.length===0)return{files:[{filename:"",content:t.stdin}],stderr:"",exitCode:0};let a=[],c="",l=0;for(let o=0;o<n.length;o+=f){let h=n.slice(o,o+f),p=await Promise.all(h.map(async e=>{if(d&&e==="-")return{filename:"-",content:t.stdin,error:null};try{let C=t.fs.resolvePath(t.cwd,e),y=await m(t.fs,C);return{filename:e,content:y,error:null}}catch{return{filename:e,content:u,error:`${r}: ${e}: No such file or directory
4
+ `}}}));for(let e of p)if(e.error){if(c+=e.error,l=1,i)return{files:a,stderr:c,exitCode:l}}else a.push({filename:e.filename,content:e.content})}return{files:a,stderr:c,exitCode:l}}async function T(t,n,s){let r=await w(t,n,{...s,stopOnError:!0});return r.exitCode!==0?{ok:!1,error:{stdout:"",stderr:r.stderr,exitCode:r.exitCode}}:{ok:!0,content:r.files.map(i=>i.content).join("")}}export{w as a,T as b};
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{b,d as g}from"./chunk-VZK4FHWJ.js";import{c as p}from"./chunk-MUFNRCMY.js";function $(t,i){let r=10,s=null,f=!1,l=!1,n=!1,u=[];for(let o=0;o<t.length;o++){let e=t[o];if(e==="-n"&&o+1<t.length){let a=t[++o];i==="tail"&&a.startsWith("+")?(n=!0,r=parseInt(a.slice(1),10)):r=parseInt(a,10)}else if(i==="tail"&&e.startsWith("-n+"))n=!0,r=parseInt(e.slice(3),10);else if(e.startsWith("-n"))r=parseInt(e.slice(2),10);else if(e==="-c"&&o+1<t.length)s=parseInt(t[++o],10);else if(e.startsWith("-c"))s=parseInt(e.slice(2),10);else if(e.startsWith("--bytes="))s=parseInt(e.slice(8),10);else if(e.startsWith("--lines="))r=parseInt(e.slice(8),10);else if(e==="-q"||e==="--quiet"||e==="--silent")f=!0;else if(e==="-v"||e==="--verbose")l=!0;else if(e.match(/^-\d+$/))r=parseInt(e.slice(1),10);else{if(e.startsWith("--"))return{ok:!1,error:p(i,e)};if(e.startsWith("-")&&e!=="-")return{ok:!1,error:p(i,e)};u.push(e)}}return s!==null&&(Number.isNaN(s)||s<0)?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of bytes
4
+ `,exitCode:1}}:Number.isNaN(r)||r<0?{ok:!1,error:{stdout:"",stderr:`${i}: invalid number of lines
5
+ `,exitCode:1}}:{ok:!0,options:{lines:r,bytes:s,quiet:f,verbose:l,files:u,fromLine:n}}}async function k(t,i,r,s){let{quiet:f,verbose:l,files:n}=i;if(n.length===0)return{stdout:s(t.stdin),stderr:"",exitCode:0,stdoutEncoding:"binary"};let u="",o="",e=0,a=l||!f&&n.length>1,d=0;for(let h=0;h<n.length;h++){let c=n[h];try{let x=t.fs.resolvePath(t.cwd,c),w=await g(t.fs,x);a&&(d>0&&(u+=`
6
+ `),u+=b(`==> ${c} <==
7
+ `)),u+=s(w),d++}catch{o+=`${r}: ${c}: No such file or directory
8
+ `,e=1}}return{stdout:u,stderr:o,exitCode:e,stdoutEncoding:"binary"}}function v(t,i,r){if(r!==null)return t.slice(0,r);if(i===0)return"";let s=0,f=0,l=t.length;for(;s<l&&f<i;){let n=t.indexOf(`
9
+ `,s);if(n===-1)return`${t}
10
+ `;f++,s=n+1}return s>0?t.slice(0,s):""}function C(t,i,r,s){if(r!==null)return t.slice(-r);let f=t.length;if(f===0)return"";if(s){let o=0,e=1;for(;o<f&&e<i;){let d=t.indexOf(`
11
+ `,o);if(d===-1)break;e++,o=d+1}let a=t.slice(o);return a.endsWith(`
12
+ `)?a:`${a}
13
+ `}if(i===0)return"";let l=f-1;t[l]===`
14
+ `&&l--;let n=0;for(;l>=0&&n<i;){if(t[l]===`
15
+ `&&(n++,n===i)){l++;break}l--}l<0&&(l=0);let u=t.slice(l);return t[f-1]===`
16
+ `?u:`${u}
17
+ `}export{$ as a,k as b,v as c,C as d};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as g}from"./chunk-LNVSXNT7.js";function v(){let a=[{prop:"Function",target:globalThis,violationType:"function_constructor",strategy:"throw",reason:"Function constructor allows arbitrary code execution"},{prop:"eval",target:globalThis,violationType:"eval",strategy:"throw",reason:"eval() allows arbitrary code execution"},{prop:"setTimeout",target:globalThis,violationType:"setTimeout",strategy:"throw",reason:"setTimeout with string argument allows code execution"},{prop:"setInterval",target:globalThis,violationType:"setInterval",strategy:"throw",reason:"setInterval with string argument allows code execution"},{prop:"setImmediate",target:globalThis,violationType:"setImmediate",strategy:"throw",reason:"setImmediate could be used to escape sandbox context"},{prop:"env",target:process,violationType:"process_env",strategy:"throw",reason:"process.env could leak sensitive environment variables",allowedKeys:new Set(["NODE_V8_COVERAGE","NODE_DEBUG","NODE_DEBUG_NATIVE","NODE_COMPILE_CACHE","WATCH_REPORT_DEPENDENCIES","FORCE_COLOR","DEBUG","UNDICI_NO_FG","JEST_WORKER_ID","__MINIMATCH_TESTING_PLATFORM__","LOG_TOKENS","LOG_STREAM"])},{prop:"binding",target:process,violationType:"process_binding",strategy:"throw",reason:"process.binding provides access to native Node.js modules"},{prop:"_linkedBinding",target:process,violationType:"process_binding",strategy:"throw",reason:"process._linkedBinding provides access to native Node.js modules"},{prop:"dlopen",target:process,violationType:"process_dlopen",strategy:"throw",reason:"process.dlopen allows loading native addons"},{prop:"getBuiltinModule",target:process,violationType:"process_get_builtin_module",strategy:"throw",reason:"process.getBuiltinModule allows loading native Node.js modules (fs, child_process, vm)"},{prop:"exit",target:process,violationType:"process_exit",strategy:"throw",reason:"process.exit could terminate the interpreter"},{prop:"abort",target:process,violationType:"process_exit",strategy:"throw",reason:"process.abort could crash the interpreter"},{prop:"kill",target:process,violationType:"process_kill",strategy:"throw",reason:"process.kill could signal other processes"},{prop:"setuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setuid could escalate privileges"},{prop:"setgid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgid could escalate privileges"},{prop:"seteuid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.seteuid could escalate effective user privileges"},{prop:"setegid",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setegid could escalate effective group privileges"},{prop:"initgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.initgroups could modify supplementary group IDs"},{prop:"setgroups",target:process,violationType:"process_setuid",strategy:"throw",reason:"process.setgroups could modify supplementary group IDs"},{prop:"umask",target:process,violationType:"process_umask",strategy:"throw",reason:"process.umask could modify file creation permissions"},{prop:"argv",target:process,violationType:"process_argv",strategy:"throw",reason:"process.argv may contain secrets in CLI arguments"},{prop:"cwd",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.cwd could disclose real host working directory path"},{prop:"chdir",target:process,violationType:"process_chdir",strategy:"throw",reason:"process.chdir could confuse the interpreter's CWD tracking"},{prop:"report",target:process,violationType:"process_report",strategy:"throw",reason:"process.report could disclose full environment, host paths, and system info"},{prop:"loadEnvFile",target:process,violationType:"process_env",strategy:"throw",reason:"process.loadEnvFile could load env files bypassing env proxy"},{prop:"setUncaughtExceptionCaptureCallback",target:process,violationType:"process_exception_handler",strategy:"throw",reason:"setUncaughtExceptionCaptureCallback could intercept security errors"},{prop:"send",target:process,violationType:"process_send",strategy:"throw",reason:"process.send could communicate with parent process in IPC contexts"},{prop:"channel",target:process,violationType:"process_channel",strategy:"throw",reason:"process.channel could access IPC channel to parent process"},{prop:"cpuUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.cpuUsage could enable timing side-channel attacks"},{prop:"memoryUsage",target:process,violationType:"process_timing",strategy:"throw",reason:"process.memoryUsage could enable timing side-channel attacks"},{prop:"hrtime",target:process,violationType:"process_timing",strategy:"throw",reason:"process.hrtime could enable timing side-channel attacks"},{prop:"WeakRef",target:globalThis,violationType:"weak_ref",strategy:"throw",reason:"WeakRef could be used to leak references outside sandbox"},{prop:"FinalizationRegistry",target:globalThis,violationType:"finalization_registry",strategy:"throw",reason:"FinalizationRegistry could be used to leak references outside sandbox"},{prop:"Reflect",target:globalThis,violationType:"reflect",strategy:"freeze",reason:"Reflect provides introspection capabilities"},{prop:"Proxy",target:globalThis,violationType:"proxy",strategy:"throw",reason:"Proxy allows intercepting and modifying object behavior"},{prop:"WebAssembly",target:globalThis,violationType:"webassembly",strategy:"throw",reason:"WebAssembly allows executing arbitrary compiled code"},{prop:"SharedArrayBuffer",target:globalThis,violationType:"shared_array_buffer",strategy:"throw",reason:"SharedArrayBuffer could enable side-channel communication or timing attacks"},{prop:"Atomics",target:globalThis,violationType:"atomics",strategy:"throw",reason:"Atomics could enable side-channel communication or timing attacks"},{prop:"performance",target:globalThis,violationType:"performance_timing",strategy:"throw",reason:"performance.now() provides sub-millisecond timing for side-channel attacks"},{prop:"stdout",target:process,violationType:"process_stdout",strategy:"throw",reason:"process.stdout could bypass interpreter output to write to host stdout"},{prop:"stderr",target:process,violationType:"process_stderr",strategy:"throw",reason:"process.stderr could bypass interpreter output to write to host stderr"},{prop:"__defineGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineGetter__ allows prototype pollution via getter injection"},{prop:"__defineSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__defineSetter__ allows prototype pollution via setter injection"},{prop:"__lookupGetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupGetter__ enables introspection for prototype pollution attacks"},{prop:"__lookupSetter__",target:Object.prototype,violationType:"prototype_mutation",strategy:"throw",reason:"__lookupSetter__ enables introspection for prototype pollution attacks"},{prop:"JSON",target:globalThis,violationType:"json_mutation",strategy:"freeze",reason:"Freeze JSON to prevent mutation of parsing/serialization"},{prop:"Math",target:globalThis,violationType:"math_mutation",strategy:"freeze",reason:"Freeze Math to prevent mutation of math utilities"}];try{let e=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&a.push({prop:"constructor",target:Object.getPrototypeOf(async()=>{}),violationType:"async_function_constructor",strategy:"throw",reason:"AsyncFunction constructor allows arbitrary async code execution"})}catch{}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&a.push({prop:"constructor",target:Object.getPrototypeOf(function*(){}),violationType:"generator_function_constructor",strategy:"throw",reason:"GeneratorFunction constructor allows arbitrary generator code execution"})}catch{}try{let e=Object.getPrototypeOf(async function*(){}).constructor;e&&e!==Function&&e!==Object.getPrototypeOf(async()=>{}).constructor&&a.push({prop:"constructor",target:Object.getPrototypeOf(async function*(){}),violationType:"async_generator_function_constructor",strategy:"throw",reason:"AsyncGeneratorFunction constructor allows arbitrary async generator code execution"})}catch{}return a.filter(e=>{try{return e.target[e.prop]!==void 0}catch{return!1}})}var f=typeof __BROWSER__<"u"&&__BROWSER__;function w(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let e=Math.random()*16|0;return(a==="x"?e:e&3|8).toString(16)})}var x=null;if(!f)try{let{AsyncLocalStorage:a}=g("node:async_hooks");x=a}catch{}var k=`
4
+
5
+ This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`,d=class extends Error{violation;constructor(e,t){super(e+k),this.violation=t,this.name="SecurityViolationError"}},u=!f&&x?new x:null,T=1e3;function D(a,e,...t){return u.run(a,()=>e(...t))}var m={enabled:!0,auditMode:!1};function E(a){return a===void 0?{...m,enabled:!1}:typeof a=="boolean"?{...m,enabled:a}:{...m,...a}}var _=class a{static instance=null;static importHooksRegistered=!1;static trustedExecutionDepth=new Map;config;refCount=0;patchFailures=[];activeExecutionIds=new Set;contextCache=new Map;originalDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(e){this.config=e}static getInstance(e){let t=E(e);if(!a.instance)a.instance=new a(t);else{let r=a.instance.config;if(t.enabled!==r.enabled||t.auditMode!==r.auditMode)throw new Error(`DefenseInDepthBox config conflict: requested {enabled: ${t.enabled}, auditMode: ${t.auditMode}} but singleton already has {enabled: ${r.enabled}, auditMode: ${r.auditMode}}. All Bash instances must use the same defense-in-depth security settings, or call DefenseInDepthBox.resetInstance() between incompatible configurations.`)}return a.instance}static resetInstance(){a.instance&&(a.instance.forceDeactivate(),a.instance=null),a.trustedExecutionDepth.clear()}static isInSandboxedContext(){return u?u?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(u)return u?.getStore()?.executionId}static enterTrustedScope(e){let t=a.trustedExecutionDepth.get(e)??0;a.trustedExecutionDepth.set(e,t+1)}static leaveTrustedScope(e){let t=a.trustedExecutionDepth.get(e);if(t){if(t===1){a.trustedExecutionDepth.delete(e);return}a.trustedExecutionDepth.set(e,t-1)}}static isTrustedScopeActive(e){return e?(a.trustedExecutionDepth.get(e)??0)>0:!1}isExecutionIdActive(e){return this.activeExecutionIds.has(e)}getCachedContext(e){let t=this.contextCache.get(e);return t||(t={sandboxActive:!0,executionId:e},this.contextCache.set(e,t)),t}getPreferredActiveExecutionId(){if(this.activeExecutionIds.size!==0)for(let e of this.activeExecutionIds)return e}static bindCurrentContext(e){if(!u)return e;let t=a.instance,r=u.getStore(),s=r?.sandboxActive===!0?r.executionId:t?.getPreferredActiveExecutionId();if(!s)return e;let n=t?.getCachedContext(s)??{sandboxActive:!0,executionId:s};return((...o)=>{let i=a.instance;if(!(i&&!i.isExecutionIdActive(s)&&(i.recordViolation("bound_callback_after_deactivate","bound callback","Bound callback blocked after originating execution was deactivated"),!i.config.auditMode)))return D(n,e,...o)})}isEnabled(){return this.config.enabled===!0&&u!==null&&!f}updateConfig(e){this.config={...this.config,...e}}activate(){if(f||!this.config.enabled||!u){let r=w(),s=!1;return{run:n=>s?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):n(),deactivate:()=>{s=!0},executionId:r}}this.refCount++,this.refCount===1&&(this.applyPatches(),this.activationTime=Date.now());let e=w(),t=!1;return{run:r=>t?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):(this.activeExecutionIds.add(e),u.run({sandboxActive:!0,executionId:e},r)),deactivate:()=>{t||(t=!0,this.activeExecutionIds.delete(e),this.contextCache.delete(e),this.refCount--,this.refCount===0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount<0&&(this.refCount=0))},executionId:e}}forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0}isActive(){return this.refCount>0}getStats(){return{violationsBlocked:this.violations.length,violations:[...this.violations],activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}getPatchFailures(){return[...this.patchFailures]}clearViolations(){this.violations=[]}getPathForTarget(e,t){return e===globalThis?`globalThis.${t}`:e===process?`process.${t}`:e===Error?`Error.${t}`:e===Function.prototype?`Function.prototype.${t}`:e===Object.prototype?`Object.prototype.${t}`:`<object>.${t}`}static runTrusted(e){if(!u)return e();let t=u.getStore();if(!t)return e();let{executionId:r}=t;return u.run({...t,trusted:!0},()=>{a.enterTrustedScope(r);try{let s=e();return typeof s=="object"&&s!==null&&"finally"in s&&typeof s.finally=="function"?s.finally(()=>{a.leaveTrustedScope(r)}):(a.leaveTrustedScope(r),s)}catch(s){throw a.leaveTrustedScope(r),s}})}static async runTrustedAsync(e){if(!u)return e();let t=u.getStore();if(!t)return e();let{executionId:r}=t;return u.run({...t,trusted:!0},async()=>{a.enterTrustedScope(r);try{return await e()}finally{a.leaveTrustedScope(r)}})}shouldBlock(){if(f||this.config.auditMode||!u)return!1;let e=u?.getStore();return!(e?.sandboxActive!==!0||e.trusted||a.isTrustedScopeActive(e.executionId))}recordViolation(e,t,r){let s={timestamp:Date.now(),type:e,message:r,path:t,stack:new Error().stack,executionId:u?.getStore()?.executionId};if(this.violations.length<T&&this.violations.push(s),this.config.onViolation)try{this.config.onViolation(s)}catch(n){console.debug("[DefenseInDepthBox] onViolation callback threw:",n instanceof Error?n.message:n)}return s}createBlockingProxy(e,t,r){let s=this;return new Proxy(e,{apply(n,o,i){if(s.shouldBlock()){let c=`${t} is blocked during script execution`,l=s.recordViolation(r,t,c);throw new d(c,l)}return s.config.auditMode&&u?.getStore()?.sandboxActive===!0&&s.recordViolation(r,t,`${t} called (audit mode)`),Reflect.apply(n,o,i)},construct(n,o,i){if(s.shouldBlock()){let c=`${t} constructor is blocked during script execution`,l=s.recordViolation(r,t,c);throw new d(c,l)}return s.config.auditMode&&u?.getStore()?.sandboxActive===!0&&s.recordViolation(r,t,`${t} constructor called (audit mode)`),Reflect.construct(n,o,i)}})}createBlockingObjectProxy(e,t,r,s){let n=this;return new Proxy(e,{get(o,i,c){if(n.shouldBlock()){if(s&&typeof i=="string"&&s.has(i))return Reflect.get(o,i,c);let l=`${t}.${String(i)}`,p=`${l} is blocked during script execution`,h=n.recordViolation(r,l,p);throw new d(p,h)}if(n.config.auditMode&&u?.getStore()?.sandboxActive===!0){let l=`${t}.${String(i)}`;n.recordViolation(r,l,`${l} accessed (audit mode)`)}return Reflect.get(o,i,c)},set(o,i,c,l){if(n.shouldBlock()){let p=`${t}.${String(i)}`,h=`${p} modification is blocked during script execution`,y=n.recordViolation(r,p,h);throw new d(h,y)}return Reflect.set(o,i,c,l)},ownKeys(o){if(n.shouldBlock()){let i=`${t} enumeration is blocked during script execution`,c=n.recordViolation(r,t,i);throw new d(i,c)}return Reflect.ownKeys(o)},getOwnPropertyDescriptor(o,i){if(n.shouldBlock()){let c=`${t}.${String(i)}`,l=`${c} descriptor access is blocked during script execution`,p=n.recordViolation(r,c,l);throw new d(l,p)}return Reflect.getOwnPropertyDescriptor(o,i)},has(o,i){if(n.shouldBlock()){let c=`${t}.${String(i)}`,l=`${c} existence check is blocked during script execution`,p=n.recordViolation(r,c,l);throw new d(l,p)}return Reflect.has(o,i)},deleteProperty(o,i){if(n.shouldBlock()){let c=`${t}.${String(i)}`,l=`${c} deletion is blocked during script execution`,p=n.recordViolation(r,c,l);throw new d(l,p)}return Reflect.deleteProperty(o,i)},setPrototypeOf(o,i){if(n.shouldBlock()){let c=`${t} setPrototypeOf is blocked during script execution`,l=n.recordViolation(r,t,c);throw new d(c,l)}return Reflect.setPrototypeOf(o,i)},defineProperty(o,i,c){if(n.shouldBlock()){let l=`${t}.${String(i)}`,p=`${l} defineProperty is blocked during script execution`,h=n.recordViolation(r,l,p);throw new d(p,h)}return Reflect.defineProperty(o,i,c)}})}applyPatches(){this.patchFailures=[];let e=v(),t=new Set(["process_send","process_channel","process_stdout","process_stderr"]);for(let n of e)t.has(n.violationType)||this.applyPatch(n);this.protectConstructorChain(),this.protectErrorPrepareStackTrace(),this.protectPromiseThen(),this.protectDynamicImport(),this.protectModuleLoad(),this.protectModuleResolveFilename(),this.protectProcessMainModule(),this.protectProcessExecPath(),this.lockWellKnownSymbols(),this.protectProxyRevocable();let r=["Function.prototype.constructor","Module._load"],s=this.patchFailures.filter(n=>r.includes(n));if(s.length>0)throw this.restorePatches(),new Error(`DefenseInDepthBox: critical patches failed: ${s.join(", ")}`)}protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,"Function.prototype.constructor","function_constructor");try{let e=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"AsyncFunction.prototype.constructor","async_function_constructor")}catch(e){this.patchFailures.push("AsyncFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(function*(){}).constructor;e&&e!==Function&&this.patchPrototypeConstructor(e.prototype,"GeneratorFunction.prototype.constructor","generator_function_constructor")}catch(e){this.patchFailures.push("GeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}try{let e=Object.getPrototypeOf(async function*(){}).constructor,t=Object.getPrototypeOf(async()=>{}).constructor;e&&e!==Function&&e!==t&&this.patchPrototypeConstructor(e.prototype,"AsyncGeneratorFunction.prototype.constructor","async_generator_function_constructor")}catch(e){this.patchFailures.push("AsyncGeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:",e instanceof Error?e.message:e)}}protectErrorPrepareStackTrace(){let e=this;try{let t=Object.getOwnPropertyDescriptor(Error,"prepareStackTrace");this.originalDescriptors.push({target:Error,prop:"prepareStackTrace",descriptor:t});let r=t?.value;Object.defineProperty(Error,"prepareStackTrace",{get(){return r},set(s){if(e.shouldBlock()){let n="Error.prepareStackTrace modification is blocked during script execution",o=e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",n);throw new d(n,o)}e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),r=s},configurable:!0})}catch(t){this.patchFailures.push("Error.prepareStackTrace"),console.debug("[DefenseInDepthBox] Could not protect Error.prepareStackTrace:",t instanceof Error?t.message:t)}}protectPromiseThen(){let e=this;try{let n=function(...o){return u.run(this.captured,()=>{if(!this.box.isExecutionIdActive(this.executionId)){if(this.box.recordViolation("promise_then_after_deactivate","Promise.then","Promise.then callback is blocked after defense deactivation"),this.box.config.auditMode)return Reflect.apply(this.cb,void 0,o);if(this.kind==="fulfilled")return o[0];throw o[0]}return Reflect.apply(this.cb,void 0,o)})};var t=n;let r=Object.getOwnPropertyDescriptor(Promise.prototype,"then");this.originalDescriptors.push({target:Promise.prototype,prop:"then",descriptor:r});let s=r?.value;if(typeof s!="function")return;Object.defineProperty(Promise.prototype,"then",{value:function(i,c){if(!u)return Reflect.apply(s,this,[i,c]);let l=u.getStore(),p=l?.sandboxActive===!0&&l.trusted!==!0?l.executionId:void 0;if(!p)return Reflect.apply(s,this,[i,c]);let h=e.getCachedContext(p),y=(b,P)=>typeof b!="function"?b:n.bind({box:e,executionId:p,captured:h,cb:b,kind:P});return Reflect.apply(s,this,[y(i,"fulfilled"),y(c,"rejected")])},writable:!0,configurable:!0})}catch(r){this.patchFailures.push("Promise.prototype.then"),console.debug("[DefenseInDepthBox] Could not protect Promise.prototype.then:",r instanceof Error?r.message:r)}}patchPrototypeConstructor(e,t,r){let s=this;try{let n=Object.getOwnPropertyDescriptor(e,"constructor");this.originalDescriptors.push({target:e,prop:"constructor",descriptor:n});let o=n?.value;Object.defineProperty(e,"constructor",{get(){if(s.shouldBlock()){let i=`${t} access is blocked during script execution`,c=s.recordViolation(r,t,i);throw new d(i,c)}return s.config.auditMode&&u?.getStore()?.sandboxActive===!0&&s.recordViolation(r,t,`${t} accessed (audit mode)`),o},set(i){if(s.shouldBlock()){let c=`${t} modification is blocked during script execution`,l=s.recordViolation(r,t,c);throw new d(c,l)}Object.defineProperty(this,"constructor",{value:i,writable:!0,configurable:!0})},configurable:!0})}catch(n){this.patchFailures.push(t),console.debug(`[DefenseInDepthBox] Could not patch ${t}:`,n instanceof Error?n.message:n)}}protectProcessMainModule(){if(typeof process>"u")return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,"mainModule");this.originalDescriptors.push({target:process,prop:"mainModule",descriptor:t});let r=t?.value;r!==void 0&&Object.defineProperty(process,"mainModule",{get(){if(e.shouldBlock()){let s="process.mainModule access is blocked during script execution",n=e.recordViolation("process_main_module","process.mainModule",s);throw new d(s,n)}return e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),r},set(s){if(e.shouldBlock()){let n="process.mainModule modification is blocked during script execution",o=e.recordViolation("process_main_module","process.mainModule",n);throw new d(n,o)}Object.defineProperty(process,"mainModule",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(t){this.patchFailures.push("process.mainModule"),console.debug("[DefenseInDepthBox] Could not protect process.mainModule:",t instanceof Error?t.message:t)}}protectProcessExecPath(){if(typeof process>"u")return;let e=this;try{let t=Object.getOwnPropertyDescriptor(process,"execPath");this.originalDescriptors.push({target:process,prop:"execPath",descriptor:t});let r=t?.value??process.execPath;Object.defineProperty(process,"execPath",{get(){if(e.shouldBlock()){let s="process.execPath access is blocked during script execution",n=e.recordViolation("process_exec_path","process.execPath",s);throw new d(s,n)}return e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("process_exec_path","process.execPath","process.execPath accessed (audit mode)"),r},set(s){if(e.shouldBlock()){let n="process.execPath modification is blocked during script execution",o=e.recordViolation("process_exec_path","process.execPath",n);throw new d(n,o)}Object.defineProperty(process,"execPath",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(t){this.patchFailures.push("process.execPath"),console.debug("[DefenseInDepthBox] Could not protect process.execPath:",t instanceof Error?t.message:t)}}lockWellKnownSymbols(){let e=(t,r)=>{try{let s=Object.getOwnPropertyDescriptor(t,r);if(s?.configurable){if("value"in s){Object.defineProperty(t,r,{...s,configurable:!1,writable:!1});return}Object.defineProperty(t,r,{...s,configurable:!1})}}catch{}};for(let t of[Array,Map,Set,RegExp,Promise])e(t,Symbol.species);for(let t of[Array.prototype,String.prototype,Map.prototype,Set.prototype])e(t,Symbol.iterator);e(Symbol.prototype,Symbol.toPrimitive),e(Date.prototype,Symbol.toPrimitive);for(let t of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])e(RegExp.prototype,t);e(Function.prototype,Symbol.hasInstance),e(Array.prototype,Symbol.unscopables);for(let t of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])e(t,Symbol.toStringTag);try{let t=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");this.originalDescriptors.push({target:Error,prop:"stackTraceLimit",descriptor:t}),Object.defineProperty(Error,"stackTraceLimit",{value:Error.stackTraceLimit,writable:!1,configurable:!0})}catch{}}protectProxyRevocable(){let e=this;try{let t=Proxy.revocable;if(typeof t!="function")return;let r=Object.getOwnPropertyDescriptor(Proxy,"revocable");this.originalDescriptors.push({target:Proxy,prop:"revocable",descriptor:r}),Object.defineProperty(Proxy,"revocable",{value:function(n,o){if(e.shouldBlock()){let i="Proxy.revocable is blocked during script execution",c=e.recordViolation("proxy","Proxy.revocable",i);throw new d(i,c)}return e.config.auditMode&&u?.getStore()?.sandboxActive===!0&&e.recordViolation("proxy","Proxy.revocable","Proxy.revocable called (audit mode)"),t(n,o)},writable:!1,configurable:!0})}catch(t){this.patchFailures.push("Proxy.revocable"),console.debug("[DefenseInDepthBox] Could not protect Proxy.revocable:",t instanceof Error?t.message:t)}}protectDynamicImport(){if(!(f||a.importHooksRegistered))try{let e=this,t=g("node:module"),r=new Set;for(let o of t.builtinModules??[]){let i=o.startsWith("node:")?o.slice(5):o;r.add(i);let c=i.indexOf("/");c>0&&r.add(i.slice(0,c))}let s=o=>{if(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.startsWith("file:")||o.startsWith("data:")||o.startsWith("blob:")||o.startsWith("http:")||o.startsWith("https:"))return!1;let i=o.startsWith("node:")?o.slice(5):o;if(!i)return!1;if(typeof t.isBuiltin=="function"&&t.isBuiltin(i)||r.has(i))return!0;let c=i.indexOf("/");return c>0&&r.has(i.slice(0,c))},n=()=>{let o=u?.getStore();return e.config.auditMode===!0&&o?.sandboxActive===!0&&o.trusted!==!0&&!a.isTrustedScopeActive(o.executionId)};if(typeof t.registerHooks=="function"){t.registerHooks({resolve(o,i,c){if(o.startsWith("data:")||o.startsWith("blob:"))throw new Error(`dynamic import of ${o.startsWith("data:")?"data:":"blob:"} URLs is blocked by defense-in-depth`);if(s(o)){let l=`import(${o})`,p=`dynamic import of Node.js builtin '${o}' is blocked during script execution`;if(e.shouldBlock()){let h=e.recordViolation("dynamic_import_builtin",l,p);throw new d(p,h)}n()&&e.recordViolation("dynamic_import_builtin",l,`dynamic import of Node.js builtin '${o}' called (audit mode)`)}return c(o,i)}}),a.importHooksRegistered=!0;return}if(typeof t.register=="function"){let o=["export async function resolve(specifier, context, nextResolve) {",' if (specifier.startsWith("data:") || specifier.startsWith("blob:")) {',' throw new Error("dynamic import of " + (specifier.startsWith("data:") ? "data:" : "blob:") + " URLs is blocked by defense-in-depth");'," }"," return nextResolve(specifier, context);","}"].join(`
6
+ `);t.register(`data:text/javascript,${encodeURIComponent(o)}`),a.importHooksRegistered=!0}}catch(e){console.debug("[DefenseInDepthBox] Could not register import() hooks:",e instanceof Error?e.message:e)}}protectModuleLoad(){if(!f)try{let e=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(e=o.constructor)}if(!e&&typeof g<"u"&&typeof g.main<"u"&&(e=g.main.constructor),!e||typeof e._load!="function")return;let t=e._load,r=Object.getOwnPropertyDescriptor(e,"_load");this.originalDescriptors.push({target:e,prop:"_load",descriptor:r});let n=this.createBlockingProxy(t,"Module._load","module_load");Object.defineProperty(e,"_load",{value:n,writable:!0,configurable:!0})}catch(e){this.patchFailures.push("Module._load"),console.debug("[DefenseInDepthBox] Could not protect Module._load:",e instanceof Error?e.message:e)}}protectModuleResolveFilename(){if(!f)try{let e=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(e=o.constructor)}if(!e&&typeof g<"u"&&typeof g.main<"u"&&(e=g.main.constructor),!e||typeof e._resolveFilename!="function")return;let t=e._resolveFilename,r=Object.getOwnPropertyDescriptor(e,"_resolveFilename");this.originalDescriptors.push({target:e,prop:"_resolveFilename",descriptor:r});let n=this.createBlockingProxy(t,"Module._resolveFilename","module_resolve_filename");Object.defineProperty(e,"_resolveFilename",{value:n,writable:!0,configurable:!0})}catch(e){this.patchFailures.push("Module._resolveFilename"),console.debug("[DefenseInDepthBox] Could not protect Module._resolveFilename:",e instanceof Error?e.message:e)}}applyPatch(e){let{target:t,prop:r,violationType:s,strategy:n}=e;try{let o=t[r];if(o===void 0)return;let i=Object.getOwnPropertyDescriptor(t,r);if(this.originalDescriptors.push({target:t,prop:r,descriptor:i}),n==="freeze")typeof o=="object"&&o!==null&&Object.freeze(o);else{let c=this.getPathForTarget(t,r),l=typeof o=="function"?this.createBlockingProxy(o,c,s):this.createBlockingObjectProxy(o,c,s,e.allowedKeys);Object.defineProperty(t,r,{value:l,writable:!0,configurable:!0})}}catch(o){let i=this.getPathForTarget(t,r);this.patchFailures.push(i),console.debug(`[DefenseInDepthBox] Could not patch ${i}:`,o instanceof Error?o.message:o)}}restorePatches(){for(let e=this.originalDescriptors.length-1;e>=0;e--){let{target:t,prop:r,descriptor:s}=this.originalDescriptors[e];try{s?Object.defineProperty(t,r,s):delete t[r]}catch(n){let o=this.getPathForTarget(t,r);console.debug(`[DefenseInDepthBox] Could not restore ${o}:`,n instanceof Error?n.message:n)}}this.originalDescriptors=[]}};export{d as a,_ as b};
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as p}from"./chunk-VZK4FHWJ.js";import{a as h,b as w,c as b}from"./chunk-MUFNRCMY.js";var g={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 y(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function N(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=y(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(`
4
+ `)}function m(s,r){if(s==="")return"";let n=s.split(`
5
+ `),u=s.endsWith(`
6
+ `)&&n[n.length-1]==="";return u&&n.pop(),n.map(l=>N(l,r)).join(`
7
+ `)+(u?`
8
+ `:"")}var I={name:"fold",execute:async(s,r)=>{if(w(s))return h(g);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]}'
9
+ `};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)}'
10
+ `};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}'
11
+ `};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]}'
12
+ `};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 b("fold",e);i++}else u.push(e),i++}let l="";if(u.length===0){let e=p(r.stdin)??"";l=m(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
13
+ `};l+=m(o,n)}return{exitCode:0,stdout:l,stderr:""}}},C={name:"fold",flags:[{flag:"-w",type:"value",valueHint:"number"},{flag:"-s",type:"boolean"},{flag:"-b",type:"boolean"}],stdinType:"text",needsFiles:!0};export{I as a,C as b};
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as x}from"./chunk-YR32XGKD.js";import{a as D,b as ee}from"./chunk-SAF4OIHD.js";import{a as K}from"./chunk-VZK4FHWJ.js";import{a as V,b as Y,c as z}from"./chunk-MUFNRCMY.js";var le={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},te={name:"grep",async execute(t,s){if(Y(t))return V(le);let l=!1,f=!1,u=!1,p=!1,m=!1,a=!1,n=!1,c=!1,y=!1,w=!1,h=!1,d=!1,F=!1,C=!1,I=!1,W=0,P=0,T=0,A=[],E=[],U=[],R=null,H=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.startsWith("-")&&i!=="-"){if(i==="-e"&&r+1<t.length){R=t[++r];continue}if(i.startsWith("--include=")){A.push(i.slice(10));continue}if(i.startsWith("--exclude=")){E.push(i.slice(10));continue}if(i.startsWith("--exclude-dir=")){U.push(i.slice(14));continue}if(i.startsWith("--max-count=")){W=parseInt(i.slice(12),10);continue}let b=i.match(/^-m(\d+)$/);if(b){W=parseInt(b[1],10);continue}if(i==="-m"&&r+1<t.length){W=parseInt(t[++r],10);continue}let o=i.match(/^-([ABC])(\d+)$/);if(o){let e=parseInt(o[2],10);o[1]==="A"?T=e:o[1]==="B"?P=e:o[1]==="C"&&(P=e,T=e);continue}if((i==="-A"||i==="-B"||i==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);i==="-A"?T=e:i==="-B"?P=e:(P=e,T=e);continue}let g=i.startsWith("--")?[i]:i.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")l=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")u=!0;else if(e==="c"||e==="--count")p=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")a=!0;else if(e==="r"||e==="R"||e==="--recursive")n=!0;else if(e==="w"||e==="--word-regexp")c=!0;else if(e==="x"||e==="--line-regexp")y=!0;else if(e==="E"||e==="--extended-regexp")w=!0;else if(e==="P"||e==="--perl-regexp")h=!0;else if(e==="F"||e==="--fixed-strings")d=!0;else if(e==="o"||e==="--only-matching")F=!0;else if(e==="h"||e==="--no-filename")C=!0;else if(e==="q"||e==="--quiet"||e==="--silent")I=!0;else{if(e.startsWith("--"))return z("grep",e);if(e.length===1)return z("grep",`-${e}`)}}else R===null?R=i:H.push(i)}if(R===null)return{stdout:"",stderr:`grep: missing pattern
4
+ `,exitCode:2};let ie=d?"fixed":w?"extended":h?"perl":"basic",O,Q,$;try{let r=ee(R,{mode:ie,ignoreCase:l,wholeWord:c,lineRegexp:y});O=r.regex,Q=r.kResetGroup,$=r.preFilter}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${R}
5
+ `,exitCode:2}}if(H.length===0&&s.stdin!==void 0){let r=D(K(s.stdin),O,{invertMatch:u,showLineNumbers:f,countOnly:p,filename:"",onlyMatching:F,beforeContext:P,afterContext:T,maxCount:W,kResetGroup:Q,preFilter:$});return I?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(H.length===0)return{stdout:"",stderr:`grep: no input files
6
+ `,exitCode:2};let M="",k="",_=!1,X=!1,v=[];for(let r of H)if(r.includes("*")||r.includes("?")||r.includes("[")){let i=await oe(r,s);if(n)for(let b of i){let o=await L(b.path,s,A,E,U,b.isFile);v.push(...o)}else v.push(...i)}else if(n){let i=await L(r,s,A,E,U);v.push(...i)}else v.push({path:r});let Z=(v.length>1||n)&&!C,j=50;for(let r=0;r<v.length;r+=j){let i=v.slice(r,r+j),b=await Promise.all(i.map(async o=>{let g=o.path,e=g.split("/").pop()||g;if(E.length>0&&!n&&E.some(N=>x(e,N,{stripQuotes:!0}))||A.length>0&&!n&&!A.some(N=>x(e,N,{stripQuotes:!0})))return null;try{let N=s.fs.resolvePath(s.cwd,g),G=!1;if(o.isFile===void 0?G=(await s.fs.stat(N)).isDirectory:G=!o.isFile,G)return n?null:{error:`grep: ${g}: Is a directory
7
+ `};let S=await s.fs.readFile(N);if($&&!u){let J=$.ignoreCase?S.toLowerCase():S;if(!$.needles.some(q=>J.includes(q))){if(p){let q=Z?`${g}:0`:"0";return{file:g,result:{output:`${q}
8
+ `,matched:!1,matchCount:0}}}return{file:g,result:{output:"",matched:!1,matchCount:0}}}}let re=D(S,O,{invertMatch:u,showLineNumbers:f,countOnly:p,filename:Z?g:"",onlyMatching:F,beforeContext:P,afterContext:T,maxCount:W,kResetGroup:Q,preFilter:$});return{file:g,result:re}}catch{return{error:`grep: ${g}: No such file or directory
9
+ `}}}));for(let o of b){if(o===null)continue;if("error"in o&&o.error){k+=o.error,o.error.includes("Is a directory")||(X=!0);continue}if(!("file"in o)||!o.result)continue;let{file:g,result:e}=o;if(e.matched){if(_=!0,I)return{stdout:"",stderr:"",exitCode:0};m?M+=`${g}
10
+ `:a||(M+=e.output)}else a?M+=`${g}
11
+ `:p&&!m&&(M+=e.output)}}let B;return X?B=2:a?B=M.length>0?0:1:B=_?0:1,I?{stdout:"",stderr:"",exitCode:B}:{stdout:M,stderr:k,exitCode:B}}},se=256;async function ne(t,s,l,f,u=0){if(u>=se)return;let p=l.fs.resolvePath(l.cwd,t);try{if(!(await l.fs.stat(p)).isDirectory){let n=t.split("/").pop()||"";if(s){let c=s.replace(/^\//,"");x(n,c,{stripQuotes:!0})&&f.push(t)}return}let a=await l.fs.readdir(p);for(let n of a){let c=t==="."?n:`${t}/${n}`,y=l.fs.resolvePath(l.cwd,c);if((await l.fs.stat(y)).isDirectory)await ne(c,s,l,f,u+1);else if(s){let h=s.replace(/^\//,"");x(n,h,{stripQuotes:!0})&&f.push(c)}}}catch{}}async function oe(t,s){let l=[],f=t.lastIndexOf("/"),u,p;if(f===-1?(u=s.cwd,p=t):(u=t.slice(0,f)||"/",p=t.slice(f+1)),t.includes("**")){let a=[],n=t.split("**"),c=n[0].replace(/\/$/,"")||".",y=n[1]||"";return await ne(c,y,s,a),a.map(w=>({path:w}))}let m=s.fs.resolvePath(s.cwd,u);try{if(s.fs.readdirWithFileTypes){let a=await s.fs.readdirWithFileTypes(m);for(let n of a)if(x(n.name,p,{stripQuotes:!0})){let c=f===-1?n.name:`${u}/${n.name}`;l.push({path:c,isFile:n.isFile})}}else{let a=await s.fs.readdir(m);for(let n of a)if(x(n,p,{stripQuotes:!0})){let c=f===-1?n:`${u}/${n}`;l.push({path:c})}}}catch{}return l.sort((a,n)=>a.path.localeCompare(n.path))}async function L(t,s,l=[],f=[],u=[],p,m=0){if(m>=se)return[];let a=s.fs.resolvePath(s.cwd,t),n=[];try{let c,y;if(p!==void 0)c=p,y=!p;else{let h=await s.fs.stat(a);c=h.isFile,y=h.isDirectory}if(c){let h=t.split("/").pop()||t;return f.length>0&&f.some(d=>x(h,d,{stripQuotes:!0}))?[]:l.length>0&&!l.some(d=>x(h,d,{stripQuotes:!0}))?[]:[{path:t,isFile:!0}]}if(!y)return[];let w=t.split("/").pop()||t;if(u.length>0&&u.some(h=>x(w,h,{stripQuotes:!0})))return[];if(s.fs.readdirWithFileTypes){let h=await s.fs.readdirWithFileTypes(a);for(let d of h){if(d.name.startsWith("."))continue;let F=t==="."?d.name:`${t}/${d.name}`,C=await L(F,s,l,f,u,d.isFile,m+1);n.push(...C)}}else{let h=await s.fs.readdir(a);for(let d of h){if(d.startsWith("."))continue;let F=t==="."?d:`${t}/${d}`,C=await L(F,s,l,f,u,void 0,m+1);n.push(...C)}}}catch{}return n}var pe={name:"fgrep",async execute(t,s){return te.execute(["-F",...t],s)}},he={name:"egrep",async execute(t,s){return te.execute(["-E",...t],s)}},de={name:"grep",flags:[{flag:"-E",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-P",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-w",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-L",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-o",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-m",type:"value",valueHint:"number"},{flag:"-A",type:"value",valueHint:"number"},{flag:"-B",type:"value",valueHint:"number"},{flag:"-C",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"pattern"}],stdinType:"text",needsArgs:!0},ge={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},me={name:"egrep",flags:[],stdinType:"text",needsArgs:!0};export{te as a,pe as b,he as c,de as d,ge as e,me as f};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ function n(e){return e instanceof Error?e.message:String(e)}export{n as a};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as fe}from"./chunk-BIJXTWZ4.js";import{a as Y}from"./chunk-YR32XGKD.js";import{a as ne}from"./chunk-3MRB66F4.js";import{a as te}from"./chunk-7GBHDJNC.js";import{a as oe,b as pe,c as ce}from"./chunk-JXLDT4KX.js";import{a as ie,b as le}from"./chunk-MUFNRCMY.js";function k(e,t){switch(e.type){case"name":{let n=e.pattern,a=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(a){let s=a[1],o=t.name;if(e.ignoreCase){if(!o.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!o.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,a=t.relativePath,s=n.split("/");for(let i=0;i<s.length-1;i++){let r=s[i];if(r&&r!=="."&&r!==".."&&!r.includes("*")&&!r.includes("?")&&!r.includes("[")){let p=`/${r}/`;if(e.ignoreCase){if(!a.toLowerCase().includes(p.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!a.includes(p))return{matches:!1,pruned:!1,printed:!1}}}let o=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(o){let i=o[1];if(e.ignoreCase){if(!a.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!a.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(a,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:te(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let a=(Date.now()-t.mtime)/(1e3*60*60*24),s;return e.comparison==="more"?s=a>e.days:e.comparison==="less"?s=a<e.days:s=Math.floor(a)===e.days,{matches:s,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let a;return e.comparison==="more"?a=t.size>n:e.comparison==="less"?a=t.size<n:e.unit==="b"?a=Math.ceil(t.size/512)===e.value:a=t.size===n,{matches:a,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,a=e.mode&511,s;return e.matchType==="exact"?s=n===a:e.matchType==="all"?s=(n&a)===a:s=(n&a)!==0,{matches:s,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=k(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=k(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let a=k(e.right,t);return{matches:a.matches,pruned:n.pruned||a.pruned,printed:n.printed||a.printed}}case"or":{let n=k(e.left,t);if(n.matches)return n;let a=k(e.right,t);return{matches:a.matches,pruned:n.pruned||a.pruned,printed:a.printed}}}}function _(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return _(e.expr);case"and":case"or":return _(e.left)||_(e.right)}}function j(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return j(e.expr);case"and":case"or":return j(e.left)||j(e.right);default:return!1}}function ue(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=Ee(e);if(Me(e)&&n.length===1){let o=n[0].split("/").filter(i=>i.length>0);if(o.length>=2)for(let i=o.length-2;i>=0;i--){let r=o[i];if(!r.includes("*")&&!r.includes("?")&&!r.includes("[")&&r!=="."&&r!==".."){let p=o[i+1];if(p&&(p.includes("*")||p.includes("?"))){t.terminalDirName=r;let l=p.match(/^\*(\.[a-zA-Z0-9]+)$/);l&&(t.requiredExtension=l[1])}break}}}return t}function Ee(e){let t=[],n=a=>{a.type==="path"?t.push(a.pattern):a.type==="not"?n(a.expr):(a.type==="and"||a.type==="or")&&(n(a.left),n(a.right))};return n(e),t}function Me(e){let t=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?t(n.expr):n.type==="and"||n.type==="or"?t(n.left)||t(n.right):!1;return t(e)}function he(e){let t=[],n=a=>{a&&(a.type==="newer"?t.push(a.refPath):a.type==="not"?n(a.expr):(a.type==="and"||a.type==="or")&&(n(a.left),n(a.right)))};return n(e),t}function J(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return J(e.expr);case"and":case"or":return J(e.left)&&J(e.right)}}function L(e,t,n,a,s){switch(e.type){case"name":{let o=e.pattern,i=o.match(/^\*(\.[a-zA-Z0-9]+)$/);if(i){let r=i[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(r.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(r))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t,o,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let o=e.pattern,i=o.split("/");for(let p=0;p<i.length-1;p++){let l=i[p];if(l&&l!=="."&&l!==".."&&!l.includes("*")&&!l.includes("?")&&!l.includes("[")){let d=`/${l}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(d.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(d))return{matches:!1,pruned:!1,printed:!1}}}let r=o.match(/\*(\.[a-zA-Z0-9]+)$/);if(r){let p=r[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(p.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(p))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(n,o,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let o=e.ignoreCase?"i":"";return{matches:te(e.pattern,o).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:a,pruned:!1,printed:!1}:e.fileType==="d"?{matches:s,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let o=L(e.expr,t,n,a,s);return{matches:!o.matches,pruned:o.pruned,printed:!1}}case"and":{let o=L(e.left,t,n,a,s);if(!o.matches)return{matches:!1,pruned:o.pruned,printed:!1};let i=L(e.right,t,n,a,s);return{matches:i.matches,pruned:o.pruned||i.pruned,printed:o.printed||i.printed}}case"or":{let o=L(e.left,t,n,a,s);if(o.matches)return o;let i=L(e.right,t,n,a,s);return{matches:i.matches,pruned:o.pruned||i.pruned,printed:i.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function V(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return V(e.expr);case"and":case"or":return V(e.left)||V(e.right);default:return!1}}function z(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return z(e.expr);case"and":case"or":return z(e.left)&&z(e.right)}}function de(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!z(e))return se(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:k(e,n).pruned}}function se(e,t){switch(e.type){case"or":{if(z(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(k(e.left,n).pruned)return{shouldPrune:!0}}return se(e.right,t)}case"and":{if(z(e.left)&&z(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:k(e,n).pruned}}if(z(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return k(e.left,n).matches?se(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function me(e,t){let n=[],a=[],s=t;for(;s<e.length;){let i=e[s];if(i==="("||i==="\\("){n.push({type:"lparen"}),s++;continue}if(i===")"||i==="\\)"){n.push({type:"rparen"}),s++;continue}if(i==="-name"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s]}});else if(i==="-iname"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}});else if(i==="-path"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s]}});else if(i==="-ipath"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}});else if(i==="-regex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}});else if(i==="-iregex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}});else if(i==="-type"&&s+1<e.length){let r=e[++s];if(r==="f"||r==="d")n.push({type:"expr",expr:{type:"type",fileType:r}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${r}
4
+ `,actions:[]}}else if(i==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(i==="-mtime"&&s+1<e.length){let r=e[++s],p="exact",l=r;r.startsWith("+")?(p="more",l=r.slice(1)):r.startsWith("-")&&(p="less",l=r.slice(1));let d=parseInt(l,10);Number.isNaN(d)||n.push({type:"expr",expr:{type:"mtime",days:d,comparison:p}})}else if(i==="-newer"&&s+1<e.length){let r=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:r}})}else if(i==="-size"&&s+1<e.length){let r=e[++s],p="exact",l=r;r.startsWith("+")?(p="more",l=r.slice(1)):r.startsWith("-")&&(p="less",l=r.slice(1));let d=l.match(/^(\d+)([ckMGb])?$/);if(d){let O=parseInt(d[1],10),x=d[2]||"b";n.push({type:"expr",expr:{type:"size",value:O,unit:x,comparison:p}})}}else if(i==="-perm"&&s+1<e.length){let r=e[++s],p="exact",l=r;r.startsWith("-")?(p="all",l=r.slice(1)):r.startsWith("/")&&(p="any",l=r.slice(1));let d=parseInt(l,8);Number.isNaN(d)||n.push({type:"expr",expr:{type:"perm",mode:d,matchType:p}})}else if(i==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(i==="-not"||i==="!")n.push({type:"not"});else if(i==="-o"||i==="-or")n.push({type:"op",op:"or"});else if(i==="-a"||i==="-and")n.push({type:"op",op:"and"});else if(i==="-maxdepth"||i==="-mindepth")s++;else if(i!=="-depth")if(i==="-exec"){let r=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)r.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let p=e[s]==="+";a.push({type:"exec",command:r,batchMode:p})}else if(i==="-print")n.push({type:"expr",expr:{type:"print"}}),a.push({type:"print"});else if(i==="-print0")a.push({type:"print0"});else if(i==="-printf"&&s+1<e.length){let r=e[++s];a.push({type:"printf",format:r})}else if(i==="-delete")a.push({type:"delete"});else{if(i.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${i}'
5
+ `,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:a};let o=Fe(n);return o.error?{expr:null,pathIndex:s,error:o.error,actions:a}:{expr:o.expr,pathIndex:s,actions:a}}function Fe(e){let t=0;function n(){let r=a();if(!r)return null;for(;t<e.length;){let p=e[t];if(p.type==="op"&&p.op==="or"){t++;let l=a();if(!l)return r;r={type:"or",left:r,right:l}}else break}return r}function a(){let r=s();if(!r)return null;for(;t<e.length;){let p=e[t];if(p.type==="op"&&p.op==="and"){t++;let l=s();if(!l)return r;r={type:"and",left:r,right:l}}else if(p.type==="expr"||p.type==="not"||p.type==="lparen"){let l=s();if(!l)return r;r={type:"and",left:r,right:l}}else break}return r}function s(){if(t<e.length&&e[t].type==="not"){t++;let r=s();return r?{type:"not",expr:r}:null}return o()}function o(){if(t>=e.length)return null;let r=e[t];if(r.type==="lparen"){t++;let p=n();return t<e.length&&e[t].type==="rparen"&&t++,p}return r.type==="expr"?(t++,r.expr):(r.type==="rparen",null)}return{expr:n()}}var ye=500;function Ie(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function xe(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}var $e={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},Re=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),je={name:"find",async execute(e,t){if(le(e))return ie($e);let n=[],a=null,s=null,o=!1,i=!1;for(let c=0;c<e.length;c++){let f=e[c];if(f==="-maxdepth"&&c+1<e.length)i=!0,a=parseInt(e[++c],10);else if(f==="-mindepth"&&c+1<e.length)i=!0,s=parseInt(e[++c],10);else if(f==="-depth")i=!0,o=!0;else if(f==="-exec")for(i=!0,c++;c<e.length&&e[c]!==";"&&e[c]!=="+";)c++;else!f.startsWith("-")&&f!==";"&&f!=="+"&&f!=="("&&f!==")"&&f!=="\\("&&f!=="\\)"&&f!=="!"?i||n.push(f):Re.has(f)?(i=!0,c++):(f.startsWith("-")||f==="("||f==="\\("||f==="!")&&(i=!0)}n.length===0&&n.push(".");let{expr:r,error:p,actions:l}=me(e,0);if(p)return{stdout:"",stderr:p,exitCode:1};let d=l.some(c=>c.type==="print"),O=l.length===0,x=[],ge=l.some(c=>c.type==="printf"),re=[],B="",q=0,we=he(r),U=new Map;for(let c of we){let f=t.fs.resolvePath(t.cwd,c);try{let u=await t.fs.stat(f);U.set(c,u.mtime?.getTime()??Date.now())}catch{}}let De=l.some(c=>{if(c.type!=="printf")return!1;let f=c.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),Te=_(r)||De,Ce=j(r),K=ue(r),ae=V(r),Pe=J(r),Se=typeof t.fs.readdirWithFileTypes=="function";for(let c of n){let G=function(h){let $=s===null||h.depth>=s,P=!1;if($&&r!==null){let S=Date.now(),y;if(Pe)y=L(r,h.name,h.relativePath,h.isFile,h.isDirectory);else{let m={name:h.name,relativePath:h.relativePath,isFile:h.isFile,isDirectory:h.isDirectory,isEmpty:h.isEmpty,mtime:h.stat?.mtime?.getTime()??Date.now(),size:h.stat?.size??0,mode:h.stat?.mode??420,newerRefTimes:U};y=k(r,m)}$=y.matches,P=d?y.printed:$,u.evalCalls++,u.evalTime+=Date.now()-S}else $&&(P=!0);return P?{print:!0,printfData:ge?{path:h.relativePath,name:h.name,size:h.stat?.size??0,mtime:h.stat?.mtime?.getTime()??Date.now(),mode:h.stat?.mode??420,isDirectory:h.isDirectory,depth:h.depth,startingPoint:c}:null}:{print:!1,printfData:null}};var We=G;c.length>1&&c.endsWith("/")&&(c=c.slice(0,-1));let f=t.fs.resolvePath(t.cwd,c);try{await t.fs.stat(f)}catch{B+=`find: ${c}: No such file or directory
6
+ `,q=1;continue}let u=Ie(),M=Date.now();async function N(h){let{path:b,depth:$,typeInfo:P}=h;if(u.nodeCount++,$>(a??256))return null;let v,S,y;if(P&&!Te)v=P.isFile,S=P.isDirectory;else{try{let A=Date.now();y=await t.fs.stat(b),u.statCalls++,u.statTime+=Date.now()-A}catch{return null}if(!y)return null;v=y.isFile,S=y.isDirectory}let m;b===f?m=c.split("/").pop()||c:m=b.split("/").pop()||"";let g=b===f?c:c==="."?`./${b.slice(f==="/"?f.length:f.length+1)}`:c+b.slice(f.length),T=[],C=null,w=null,D=!1;S&&ae&&!o&&(D=de(r,{name:m,relativePath:g,isFile:v,isDirectory:S}).shouldPrune,D&&u.earlyPrunes++);let F=$>=(a??256),I=K.terminalDirName!==null&&m===K.terminalDirName,Z=!F&&!I&&!D;if(S&&((Z||Ce||I)&&!D)){let A=Date.now();if(Se&&t.fs.readdirWithFileTypes){if(C=await t.fs.readdirWithFileTypes(b),w=C.map(E=>E.name),u.readdirCalls++,u.readdirTime+=Date.now()-A,Z)T=C.map((E,R)=>({path:b==="/"?`/${E.name}`:`${b}/${E.name}`,depth:$+1,typeInfo:{isFile:E.isFile,isDirectory:E.isDirectory},resultIndex:R}));else if(I){let E=K.requiredExtension;T=C.filter(R=>R.isFile&&(!E||R.name.endsWith(E))).map((R,ve)=>({path:b==="/"?`/${R.name}`:`${b}/${R.name}`,depth:$+1,typeInfo:{isFile:R.isFile,isDirectory:R.isDirectory},resultIndex:ve}))}}else w=await t.fs.readdir(b),u.readdirCalls++,u.readdirTime+=Date.now()-A,Z&&(T=w.map((E,R)=>({path:b==="/"?`/${E}`:`${b}/${E}`,depth:$+1,resultIndex:R})))}let Q=v?(y?.size??0)===0:w!==null&&w.length===0,H=D;if(!o&&r!==null&&!D&&ae){let A=Date.now(),E={name:m,relativePath:g,isFile:v,isDirectory:S,isEmpty:Q,mtime:y?.mtime?.getTime()??Date.now(),size:y?.size??0,mode:y?.mode??420,newerRefTimes:U};H=k(r,E).pruned,u.evalCalls++,u.evalTime+=Date.now()-A}return{relativePath:g,name:m,isFile:v,isDirectory:S,isEmpty:Q,stat:y,depth:$,children:H?[]:T,pruned:H}}async function be(){let h={paths:[],printfData:[]};if(o){let y=function(m){let g={paths:[],printfData:[]},T=P[m];if(!T)return g;for(let D of T.childIndices){let F=y(D);g.paths.push(...F.paths),g.printfData.push(...F.printfData)}let{print:C,printfData:w}=G(T.node);return C&&(g.paths.push(T.node.relativePath),w&&g.printfData.push(w)),g};var b=y;let P=[],v=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],S=new Map;for(;v.length>0;){let m=Date.now(),g=v.splice(0,ye),T=await Promise.all(g.map(C=>N(C.item)));u.batchCount++,u.batchTime+=Date.now()-m;for(let C=0;C<g.length;C++){let w=T[C],D=g[C];if(!w)continue;let F=P.length;if(D.parentIndex>=0){let I=S.get(D.parentIndex)||[];I.push(F),S.set(D.parentIndex,I)}P.push({node:w,parentIndex:D.parentIndex,childIndices:[]});for(let I=0;I<w.children.length;I++)v.push({item:w.children[I],parentIndex:F,childOrderInParent:I})}}for(let[m,g]of S)m>=0&&m<P.length&&(P[m].childIndices=g);if(P.length>0){let m=y(0);h.paths.push(...m.paths),h.printfData.push(...m.printfData)}}else{let m=function(g){let T=P.get(g);T&&(h.paths.push(T.path),T.printfData&&h.printfData.push(T.printfData));let C=y.get(g);if(C)for(let w of C)m(w)};var $=m;let P=new Map,v=0,S=[{item:{path:f,depth:0,resultIndex:0},orderIndex:v++}],y=new Map;for(;S.length>0;){let g=Date.now(),T=S.splice(0,ye),C=await Promise.all(T.map(async({item:w,orderIndex:D})=>{let F=await N(w);return F?{node:F,orderIndex:D}:null}));u.batchCount++,u.batchTime+=Date.now()-g;for(let w of C){if(!w)continue;let{node:D,orderIndex:F}=w,{print:I,printfData:Z}=G(D);if(I&&P.set(F,{path:D.relativePath,printfData:Z}),D.children.length>0){let ee=[];for(let Q of D.children){let H=v++;ee.push(H),S.push({item:Q,orderIndex:H})}y.set(F,ee)}}}m(0)}return h}let X=await be();if(x.push(...X.paths),re.push(...X.printfData),t.trace){let h=Date.now()-M;xe(t.trace,u,h),t.trace({category:"find",name:"searchPath",durationMs:h,details:{path:c,resultsFound:X.paths.length}})}}let W="";if(l.length>0)for(let c of l)switch(c.type){case"print":W+=x.length>0?`${x.join(`
7
+ `)}
8
+ `:"";break;case"print0":W+=x.length>0?`${x.join("\0")}\0`:"";break;case"delete":{let f=[...x].sort((u,M)=>M.length-u.length);for(let u of f){let M=t.fs.resolvePath(t.cwd,u);try{await t.fs.rm(M,{recursive:!1})}catch(N){let G=N instanceof Error?N.message:String(N);B+=`find: cannot delete '${u}': ${G}
9
+ `,q=1}}break}case"printf":for(let f of re)W+=ke(c.format,f);break;case"exec":if(!t.exec)return{stdout:"",stderr:`find: -exec not supported in this context
10
+ `,exitCode:1};if(c.batchMode){let f=[];for(let M of c.command)M==="{}"?f.push(...x):f.push(M);let u=await t.exec(ne([f[0]]),{cwd:t.cwd,signal:t.signal,args:f.slice(1)});W+=u.stdout,B+=u.stderr,u.exitCode!==0&&(q=u.exitCode)}else for(let f of x){let u=c.command.map(N=>N==="{}"?f:N),M=await t.exec(ne([u[0]]),{cwd:t.cwd,signal:t.signal,args:u.slice(1)});W+=M.stdout,B+=M.stderr,M.exitCode!==0&&(q=M.exitCode)}break}else O&&(W=x.length>0?`${x.join(`
11
+ `)}
12
+ `:"");return{stdout:W,stderr:B,exitCode:q}}};function ke(e,t){let n=ce(e),a="",s=0;for(;s<n.length;)if(n[s]==="%"&&s+1<n.length){if(s++,n[s]==="%"){a+="%",s++;continue}let[o,i,r]=pe(n,s);if(s+=r,s>=n.length){a+="%";break}let p=n[s],l;switch(p){case"f":l=t.name,s++;break;case"h":{let d=t.path.lastIndexOf("/");l=d>0?t.path.slice(0,d):".",s++;break}case"p":l=t.path,s++;break;case"P":{let d=t.startingPoint;t.path===d?l="":t.path.startsWith(`${d}/`)?l=t.path.slice(d.length+1):d==="."&&t.path.startsWith("./")?l=t.path.slice(2):l=t.path,s++;break}case"s":l=String(t.size),s++;break;case"d":l=String(t.depth),s++;break;case"m":l=(t.mode&511).toString(8),s++;break;case"M":l=fe(t.mode,t.isDirectory),s++;break;case"t":{let d=new Date(t.mtime);l=Ne(d),s++;break}case"T":{if(s+1<n.length){let d=n[s+1],O=new Date(t.mtime);l=ze(O,d),s+=2}else l="%T",s++;break}default:a+=`%${o!==0||i!==-1?`${o}.${i}`:""}${p}`,s++;continue}a+=oe(l,o,i)}else a+=n[s],s++;return a}function Ne(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=t[e.getDay()],s=n[e.getMonth()],o=String(e.getDate()).padStart(2," "),i=String(e.getHours()).padStart(2,"0"),r=String(e.getMinutes()).padStart(2,"0"),p=String(e.getSeconds()).padStart(2,"0"),l=e.getFullYear();return`${a} ${s} ${o} ${i}:${r}:${p} ${l}`}function ze(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var Je={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0};export{je as a,Je as b};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as f}from"./chunk-VZK4FHWJ.js";import{a,b as c,c as d}from"./chunk-MUFNRCMY.js";var u={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};function p(r){return Array.from(r).reverse().join("")}var g={name:"rev",execute:async(r,s)=>{if(c(r))return a(u);let o=[];for(let e of r)if(e==="--"){let t=r.indexOf(e);o.push(...r.slice(t+1));break}else{if(e.startsWith("-")&&e!=="-")return d("rev",e);o.push(e)}let n="",l=e=>{let t=e.split(`
4
+ `),i=e.endsWith(`
5
+ `)&&t[t.length-1]==="";return i&&t.pop(),t.map(p).join(`
6
+ `)+(i?`
7
+ `:"")};if(o.length===0){let e=f(s.stdin)??"";n=l(e)}else for(let e of o)if(e==="-"){let t=f(s.stdin)??"";n+=l(t)}else{let t=s.fs.resolvePath(s.cwd,e),i=await s.fs.readFile(t);if(i===null)return{exitCode:1,stdout:n,stderr:`rev: ${e}: No such file or directory
8
+ `};n+=l(i)}return{exitCode:0,stdout:n,stderr:""}}},y={name:"rev",flags:[],stdinType:"text",needsFiles:!0};export{g as a,y as b};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as m}from"./chunk-VZK4FHWJ.js";import{a as x}from"./chunk-NE4R2FVV.js";import{a as g,b as y}from"./chunk-MUFNRCMY.js";var L={name:"paste",summary:"merge lines of files",usage:"paste [OPTION]... [FILE]...",description:["Write lines consisting of the sequentially corresponding lines from","each FILE, separated by TABs, to standard output.","","With no FILE, or when FILE is -, read standard input."],options:["-d, --delimiters=LIST reuse characters from LIST instead of TABs","-s, --serial paste one file at a time instead of in parallel"," --help display this help and exit"],examples:["paste file1 file2 Merge file1 and file2 side by side","paste -d, file1 file2 Use comma as delimiter","paste -s file1 Paste all lines of file1 on one line","paste - - < file Paste pairs of lines from file"]},T={delimiter:{short:"d",long:"delimiters",type:"string",default:" "},serial:{short:"s",long:"serial",type:"boolean"}},w={name:"paste",async execute(s,n){if(y(s))return g(L);let i=x("paste",s,T);if(!i.ok)return i.error;let l=i.result.flags.delimiter,d=i.result.flags.serial,p=i.result.positional;if(p.length===0)return{stdout:"",stderr:`usage: paste [-s] [-d delimiters] file ...
4
+ `,exitCode:1};let c=m(n.stdin),a=c?c.split(`
5
+ `):[""];a.length>0&&a[a.length-1]===""&&a.pop();let F=p.filter(e=>e==="-").length,f=[],h=0;for(let e of p)if(e==="-"){let t=[];for(let o=h;o<a.length;o+=F)t.push(a[o]);f.push(t),h++}else{let t=n.fs.resolvePath(n.cwd,e);try{let r=(await n.fs.readFile(t)).split(`
6
+ `);r.length>0&&r[r.length-1]===""&&r.pop(),f.push(r)}catch{return{stdout:"",stderr:`paste: ${e}: No such file or directory
7
+ `,exitCode:1}}}let u="";if(d)for(let e of f)e&&(u+=`${I(e,l)}
8
+ `);else{let e=Math.max(...f.map(t=>t?.length??0));for(let t=0;t<e;t++){let o=[];for(let r of f)o.push(r?.[t]??"");u+=`${I(o,l)}
9
+ `}}return{stdout:u,stderr:"",exitCode:0}}};function I(s,n){if(s.length===0)return"";if(s.length===1)return s[0];let i=s[0];for(let l=1;l<s.length;l++){let d=(l-1)%n.length;i+=n[d]+s[l]}return i}var E={name:"paste",flags:[{flag:"-d",type:"value",valueHint:"delimiter"},{flag:"-s",type:"boolean"}],stdinType:"text",needsFiles:!0};export{w as a,E as b};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ 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+=`
4
+ `,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};