@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,29 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as I}from"./chunk-NE4R2FVV.js";import{a as K,b as V}from"./chunk-MUFNRCMY.js";var B=(i,t,e)=>{let s=i instanceof RegExp?Y(i,e):i,n=t instanceof RegExp?Y(t,e):t,r=s!==null&&n!=null&&Et(s,n,e);return r&&{start:r[0],end:r[1],pre:e.slice(0,r[0]),body:e.slice(r[0]+s.length,r[1]),post:e.slice(r[1]+n.length)}},Y=(i,t)=>{let e=t.match(i);return e?e[0]:null},Et=(i,t,e)=>{let s,n,r,o,l,h=e.indexOf(i),c=e.indexOf(t,h+1),g=h;if(h>=0&&c>0){if(i===t)return[h,c];for(s=[],r=e.length;g>=0&&!l;){if(g===h)s.push(g),h=e.indexOf(i,g+1);else if(s.length===1){let a=s.pop();a!==void 0&&(l=[a,c])}else n=s.pop(),n!==void 0&&n<r&&(r=n,o=c),c=e.indexOf(t,g+1);g=h<c&&h>=0?h:c}s.length&&o!==void 0&&(l=[r,o])}return l};var Q="\0SLASH"+Math.random()+"\0",tt="\0OPEN"+Math.random()+"\0",q="\0CLOSE"+Math.random()+"\0",et="\0COMMA"+Math.random()+"\0",st="\0PERIOD"+Math.random()+"\0",Mt=new RegExp(Q,"g"),At=new RegExp(tt,"g"),Pt=new RegExp(q,"g"),Tt=new RegExp(et,"g"),Nt=new RegExp(st,"g"),Rt=/\\\\/g,vt=/\\{/g,Ot=/\\}/g,zt=/\\,/g,Ct=/\\\./g,Wt=1e5;function H(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function Dt(i){return i.replace(Rt,Q).replace(vt,tt).replace(Ot,q).replace(zt,et).replace(Ct,st)}function jt(i){return i.replace(Mt,"\\").replace(At,"{").replace(Pt,"}").replace(Tt,",").replace(Nt,".")}function nt(i){if(!i)return[""];let t=[],e=B("{","}",i);if(!e)return i.split(",");let{pre:s,body:n,post:r}=e,o=s.split(",");o[o.length-1]+="{"+n+"}";let l=nt(r);return r.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),t.push.apply(t,o),t}function it(i,t={}){if(!i)return[];let{max:e=Wt}=t;return i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),j(Dt(i),e,!0).map(jt)}function Lt(i){return"{"+i+"}"}function kt(i){return/^-?0\d/.test(i)}function _t(i,t){return i<=t}function Gt(i,t){return i>=t}function j(i,t,e){let s=[],n=B("{","}",i);if(!n)return[i];let r=n.pre,o=n.post.length?j(n.post,t,!1):[""];if(/\$$/.test(n.pre))for(let l=0;l<o.length&&l<t;l++){let h=r+"{"+n.body+"}"+o[l];s.push(h)}else{let l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),c=l||h,g=n.body.indexOf(",")>=0;if(!c&&!g)return n.post.match(/,(?!,).*\}/)?(i=n.pre+"{"+n.body+q+n.post,j(i,t,!0)):[i];let a;if(c)a=n.body.split(/\.\./);else if(a=nt(n.body),a.length===1&&a[0]!==void 0&&(a=j(a[0],t,!1).map(Lt),a.length===1))return o.map(u=>n.pre+a[0]+u);let p;if(c&&a[0]!==void 0&&a[1]!==void 0){let u=H(a[0]),d=H(a[1]),f=Math.max(a[0].length,a[1].length),$=a.length===3&&a[2]!==void 0?Math.max(Math.abs(H(a[2])),1):1,S=_t;d<u&&($*=-1,S=Gt);let b=a.some(kt);p=[];for(let y=u;S(y,d)&&p.length<t;y+=$){let w;if(h)w=String.fromCharCode(y),w==="\\"&&(w="");else if(w=String(y),b){let E=f-w.length;if(E>0){let x=new Array(E+1).join("0");y<0?w="-"+x+w.slice(1):w=x+w}}p.push(w)}}else{p=[];for(let u=0;u<a.length;u++)p.push.apply(p,j(a[u],t,!1))}for(let u=0;u<p.length;u++)for(let d=0;d<o.length&&s.length<t;d++){let f=r+p[u]+o[d];(!e||c||f)&&s.push(f)}}return s}var L=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var Ft={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},k=i=>i.replace(/[[\]\\-]/g,"\\$&"),Bt=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),rt=i=>i.join(""),ot=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],n=[],r=e+1,o=!1,l=!1,h=!1,c=!1,g=e,a="";t:for(;r<i.length;){let f=i.charAt(r);if((f==="!"||f==="^")&&r===e+1){c=!0,r++;continue}if(f==="]"&&o&&!h){g=r+1;break}if(o=!0,f==="\\"&&!h){h=!0,r++;continue}if(f==="["&&!h){for(let[$,[S,m,b]]of Object.entries(Ft))if(i.startsWith($,r)){if(a)return["$.",!1,i.length-e,!0];r+=$.length,b?n.push(S):s.push(S),l=l||m;continue t}}if(h=!1,a){f>a?s.push(k(a)+"-"+k(f)):f===a&&s.push(k(f)),a="",r++;continue}if(i.startsWith("-]",r+1)){s.push(k(f+"-")),r+=2;continue}if(i.startsWith("-",r+1)){a=f,r+=2;continue}s.push(k(f)),r++}if(g<r)return["",!1,0,!1];if(!s.length&&!n.length)return["$.",!1,i.length-e,!0];if(n.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!c){let f=s[0].length===2?s[0].slice(-1):s[0];return[Bt(f),!1,g-e,!1]}let p="["+(c?"^":"")+rt(s)+"]",u="["+(c?"":"^")+rt(n)+"]";return[s.length&&n.length?"("+p+"|"+u+")":s.length?p:u,l,g-e,!0]};var v=(i,{windowsPathsNoEscape:t=!1,magicalBraces:e=!0}={})=>e?t?i.replace(/\[([^/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?i.replace(/\[([^/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");var T,Ht=new Set(["!","?","+","*","@"]),J=i=>Ht.has(i),at=i=>J(i.type),qt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Jt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Ut=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),lt=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Zt="(?!(?:^|/)\\.\\.?(?:$|/))",_="(?!\\.)",Xt=new Set(["[","."]),Kt=new Set(["..","."]),Vt=new Set("().*{}+?[]^$\\!"),It=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),U="[^/]",ct=U+"*?",ht=U+"+?",Yt=0,z=class{type;#s;#n;#i=!1;#t=[];#e;#a;#c;#l=!1;#r;#o;#h=!1;id=++Yt;get depth(){return(this.#e?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#s.id,parent:this.#e?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,e,s={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?s:this.#s.#r,this.#c=this.#s===this?[]:this.#s.#c,t==="!"&&!this.#s.#l&&this.#c.push(this),this.#a=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#y(){if(this!==this.#s)throw new Error("should only call on root");if(this.#l)return this;this.toString(),this.#l=!0;let t;for(;t=this.#c.pop();){if(t.type!=="!")continue;let e=t,s=e.#e;for(;s;){for(let n=e.#a+1;!s.type&&n<s.#t.length;n++)for(let r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(s.#t[n])}e=s,s=e.#e}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof T&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){let t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#l&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#a===0)return!0;let t=this.#e;for(let e=0;e<this.#a;e++){let s=t.#t[e];if(!(s instanceof T&&s.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();let t=this.#e?this.#e.#t.length:0;return this.#a===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new T(this.type,t);for(let s of this.#t)e.copyIn(s);return e}static#f(t,e,s,n,r){let o=n.maxExtglobRecursion??2,l=!1,h=!1,c=-1,g=!1;if(e.type===null){let f=s,$="";for(;f<t.length;){let S=t.charAt(f++);if(l||S==="\\"){l=!l,$+=S;continue}if(h){f===c+1?(S==="^"||S==="!")&&(g=!0):S==="]"&&!(f===c+2&&g)&&(h=!1),$+=S;continue}else if(S==="["){h=!0,c=f,g=!1,$+=S;continue}if(!n.noext&&J(S)&&t.charAt(f)==="("&&r<=o){e.push($),$="";let b=new T(S,e);f=T.#f(t,b,f,n,r+1),e.push(b);continue}$+=S}return e.push($),f}let a=s+1,p=new T(null,e),u=[],d="";for(;a<t.length;){let f=t.charAt(a++);if(l||f==="\\"){l=!l,d+=f;continue}if(h){a===c+1?(f==="^"||f==="!")&&(g=!0):f==="]"&&!(a===c+2&&g)&&(h=!1),d+=f;continue}else if(f==="["){h=!0,c=a,g=!1,d+=f;continue}if(!n.noext&&J(f)&&t.charAt(a)==="("&&(r<=o||e&&e.#u(f))){let S=e&&e.#u(f)?0:1;p.push(d),d="";let m=new T(f,p);p.push(m),a=T.#f(t,m,a,n,r+S);continue}if(f==="|"){p.push(d),d="",u.push(p),p=new T(null,e);continue}if(f===")")return d===""&&e.#t.length===0&&(e.#h=!0),p.push(d),d="",e.push(...u,p),a;d+=f}return e.type=null,e.#n=void 0,e.#t=[t.substring(s-1)],a}#w(t){return this.#g(t,Jt)}#g(t,e=qt){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let s=t.#t[0];return!s||typeof s!="object"||s.type===null?!1:this.#u(s.type,e)}#u(t,e=Ut){return!!e.get(this.type)?.includes(t)}#S(t,e){let s=t.#t[0],n=new T(null,s,this.options);n.#t.push(""),s.push(n),this.#d(t,e)}#d(t,e){let s=t.#t[0];this.#t.splice(e,1,...s.#t);for(let n of s.#t)typeof n=="object"&&(n.#e=this);this.#o=void 0}#$(t){return!!lt.get(this.type)?.has(t)}#b(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let e=t.#t[0];return!e||typeof e!="object"||e.type===null?!1:this.#$(e.type)}#x(t){let e=lt.get(this.type),s=t.#t[0],n=e?.get(s.type);if(!n)return!1;this.#t=s.#t;for(let r of this.#t)typeof r=="object"&&(r.#e=this);this.type=n,this.#o=void 0,this.#h=!1}static fromGlob(t,e={}){let s=new T(null,void 0,e);return T.#f(t,s,0,e,0),s}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();let t=this.toString(),[e,s,n,r]=this.toRegExpSource();if(!(n||this.#n||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let l=(this.#r.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,l),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){let e=t??!!this.#r.dot;if(this.#s===this&&(this.#p(),this.#y()),!at(this)){let h=this.isStart()&&this.isEnd()&&!this.#t.some(u=>typeof u!="string"),c=this.#t.map(u=>{let[d,f,$,S]=typeof u=="string"?T.#E(u,this.#n,h):u.toRegExpSource(t);return this.#n=this.#n||$,this.#i=this.#i||S,d}).join(""),g="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Kt.has(this.#t[0]))){let d=Xt,f=e&&d.has(c.charAt(0))||c.startsWith("\\.")&&d.has(c.charAt(2))||c.startsWith("\\.\\.")&&d.has(c.charAt(4)),$=!e&&!t&&d.has(c.charAt(0));g=f?Zt:$?_:""}let a="";return this.isEnd()&&this.#s.#l&&this.#e?.type==="!"&&(a="(?:$|\\/)"),[g+c+a,v(c),this.#n=!!this.#n,this.#i]}let s=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#m(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let h=this.toString(),c=this;return c.#t=[h],c.type=null,c.#n=void 0,[h,v(this.toString()),!1,!1]}let o=!s||t||e||!_?"":this.#m(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let l="";if(this.type==="!"&&this.#h)l=(this.isStart()&&!e?_:"")+ht;else{let h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?_:"")+ct+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;l=n+r+h}return[l,v(r),this.#n=!!this.#n,this.#i]}#p(){if(at(this)){let t=0,e=!1;do{e=!0;for(let s=0;s<this.#t.length;s++){let n=this.#t[s];typeof n=="object"&&(n.#p(),this.#g(n)?(e=!1,this.#d(n,s)):this.#w(n)?(e=!1,this.#S(n,s)):this.#b(n)&&(e=!1,this.#x(n)))}}while(!e&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#o=void 0}#m(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,n,r,o]=e.toRegExpSource(t);return this.#i=this.#i||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#E(t,e,s=!1){let n=!1,r="",o=!1,l=!1;for(let h=0;h<t.length;h++){let c=t.charAt(h);if(n){n=!1,r+=(Vt.has(c)?"\\":"")+c;continue}if(c==="*"){if(l)continue;l=!0,r+=s&&/^[*]+$/.test(t)?ht:ct,e=!0;continue}else l=!1;if(c==="\\"){h===t.length-1?r+="\\\\":n=!0;continue}if(c==="["){let[g,a,p,u]=ot(t,h);if(p){r+=g,o=o||a,h+=p-1,e=e||u;continue}}if(c==="?"){r+=U,e=!0;continue}r+=It(c)}return[r,v(t),!!e,o]}};T=z;var Z=(i,{windowsPathsNoEscape:t=!1,magicalBraces:e=!1}={})=>e?t?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var M=(i,t,e={})=>(L(t),!e.nocomment&&t.charAt(0)==="#"?!1:new D(t,e).match(i)),Qt=/^\*+([^+@!?*[(]*)$/,te=i=>t=>!t.startsWith(".")&&t.endsWith(i),ee=i=>t=>t.endsWith(i),se=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),ne=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),ie=/^\*+\.\*+$/,re=i=>!i.startsWith(".")&&i.includes("."),oe=i=>i!=="."&&i!==".."&&i.includes("."),ae=/^\.\*+$/,le=i=>i!=="."&&i!==".."&&i.startsWith("."),ce=/^\*+$/,he=i=>i.length!==0&&!i.startsWith("."),fe=i=>i.length!==0&&i!=="."&&i!=="..",ue=/^\?+([^+@!?*[(]*)?$/,pe=([i,t=""])=>{let e=pt([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},ge=([i,t=""])=>{let e=gt([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},de=([i,t=""])=>{let e=gt([i]);return t?s=>e(s)&&s.endsWith(t):e},me=([i,t=""])=>{let e=pt([i]);return t?s=>e(s)&&s.endsWith(t):e},pt=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},gt=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},dt=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",ft={win32:{sep:"\\"},posix:{sep:"/"}},ye=dt==="win32"?ft.win32.sep:ft.posix.sep;M.sep=ye;var A=Symbol("globstar **");M.GLOBSTAR=A;var we="[^/]",Se=we+"*?",$e="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",be="(?:(?!(?:\\/|^)\\.).)*?",xe=(i,t={})=>e=>M(e,i,t);M.filter=xe;var N=(i,t={})=>Object.assign({},i,t),Ee=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return M;let t=M;return Object.assign((s,n,r={})=>t(s,n,N(i,r)),{Minimatch:class extends t.Minimatch{constructor(n,r={}){super(n,N(i,r))}static defaults(n){return t.defaults(N(i,n)).Minimatch}},AST:class extends t.AST{constructor(n,r,o={}){super(n,r,N(i,o))}static fromGlob(n,r={}){return t.AST.fromGlob(n,N(i,r))}},unescape:(s,n={})=>t.unescape(s,N(i,n)),escape:(s,n={})=>t.escape(s,N(i,n)),filter:(s,n={})=>t.filter(s,N(i,n)),defaults:s=>t.defaults(N(i,s)),makeRe:(s,n={})=>t.makeRe(s,N(i,n)),braceExpand:(s,n={})=>t.braceExpand(s,N(i,n)),match:(s,n,r={})=>t.match(s,n,N(i,r)),sep:t.sep,GLOBSTAR:A})};M.defaults=Ee;var mt=(i,t={})=>(L(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:it(i,{max:t.braceExpandMax}));M.braceExpand=mt;var Me=(i,t={})=>new D(i,t).makeRe();M.makeRe=Me;var Ae=(i,t,e={})=>{let s=new D(t,e);return i=i.filter(n=>s.match(n)),s.options.nonull&&!i.length&&i.push(t),i};M.match=Ae;var ut=/[?*]|[+@!]\(.*?\)|\[|\]/,Pe=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),D=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,e={}){L(t),e=e||{},this.options=e,this.maxGlobstarRecursion=e.maxGlobstarRecursion??200,this.pattern=t,this.platform=e.platform||dt,this.isWindows=this.platform==="win32";let s="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=r[0]===""&&r[1]===""&&(r[2]==="?"||!ut.test(r[2]))&&!ut.test(r[3]),c=/^[a-z]:/i.test(r[0]);if(h)return[...r.slice(0,4),...r.slice(4).map(g=>this.parse(g))];if(c)return[r[0],...r.slice(1).map(g=>this.parse(g))]}return r.map(h=>this.parse(h))});if(this.debug(this.pattern,n),this.set=n.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s of t)for(let n=0;n<s.length;n++)s[n]==="**"&&(s[n]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let n=s;for(;e[n+1]==="**";)n++;n!==s&&e.splice(s,n-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,n)=>{let r=s[s.length-1];return n==="**"&&r==="**"?s:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(s.pop(),s):(s.push(n),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){let r=t[n];n===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let n=t[s-1];n&&n!=="."&&n!==".."&&n!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(n))&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let n=-1;for(;(n=s.indexOf("**",n+1))!==-1;){let o=n;for(;s[o+1]==="**";)o++;o>n&&s.splice(n+1,o-n);let l=s[n+1],h=s[n+2],c=s[n+3];if(l!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;e=!0,s.splice(n,1);let g=s.slice(0);g[n]="**",t.push(g),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let l=s[o];o===1&&l===""&&s[0]===""||(l==="."||l==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let r=0;for(;(r=s.indexOf("..",r+1))!==-1;){let o=s[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let h=r===1&&s[r+1]==="**"?["."]:[];s.splice(r-1,2,...h),s.length===0&&s.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let n=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(n){t[e]=[],t[s]=n;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let n=0,r=0,o=[],l="";for(;n<t.length&&r<e.length;)if(t[n]===e[r])o.push(l==="b"?e[r]:t[n]),n++,r++;else if(s&&t[n]==="**"&&e[r]===t[n+1])o.push(t[n]),n++;else if(s&&e[r]==="**"&&t[n]===e[r+1])o.push(e[r]),r++;else if(t[n]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(l==="b")return!1;l="a",o.push(t[n]),n++,r++}else if(e[r]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(l==="a")return!1;l="b",o.push(e[r]),n++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let n=0,r=0;if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),h=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),a=h?3:l?0:void 0,p=g?3:c?0:void 0;if(typeof a=="number"&&typeof p=="number"){let[u,d]=[t[a],e[p]];u.toLowerCase()===d.toLowerCase()&&(e[p]=u,r=p,n=a)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),e.includes(A)?this.#s(t,e,s,n,r):this.#i(t,e,s,n,r)}#s(t,e,s,n,r){let o=e.indexOf(A,r),l=e.lastIndexOf(A),[h,c,g]=s?[e.slice(r,o),e.slice(o+1),[]]:[e.slice(r,o),e.slice(o+1,l),e.slice(l+1)];if(h.length){let m=t.slice(n,n+h.length);if(!this.#i(m,h,s,0,0))return!1;n+=h.length,r+=h.length}let a=0;if(g.length){if(g.length+n>t.length)return!1;let m=t.length-g.length;if(this.#i(t,g,s,m,0))a=g.length;else{if(t[t.length-1]!==""||n+g.length===t.length||(m--,!this.#i(t,g,s,m,0)))return!1;a=g.length+1}}if(!c.length){let m=!!a;for(let b=n;b<t.length-a;b++){let y=String(t[b]);if(m=!0,y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1}return s||m}let p=[[[],0]],u=p[0],d=0,f=[0];for(let m of c)m===A?(f.push(d),u=[[],0],p.push(u)):(u[0].push(m),d++);let $=p.length-1,S=t.length-a;for(let m of p)m[1]=S-(f[$--]+m[0].length);return!!this.#n(t,p,n,0,s,0,!!a)}#n(t,e,s,n,r,o,l){let h=e[n];if(!h){for(let a=s;a<t.length;a++){l=!0;let p=t[a];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return l}let[c,g]=h;for(;s<=g;){if(this.#i(t.slice(0,s+c.length),c,r,s,0)&&o<this.maxGlobstarRecursion){let u=this.#n(t,e,s+c.length,n+1,r,o+1,l);if(u!==!1)return u}let p=t[s];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;s++}return r||null}#i(t,e,s,n,r){let o,l,h,c;for(o=n,l=r,c=t.length,h=e.length;o<c&&l<h;o++,l++){this.debug("matchOne loop");let g=e[l],a=t[o];if(this.debug(e,g,a),g===!1||g===A)return!1;let p;if(typeof g=="string"?(p=a===g,this.debug("string match",g,a,p)):(p=g.test(a),this.debug("pattern match",g,a,p)),!p)return!1}if(o===c&&l===h)return!0;if(o===c)return s;if(l===h)return o===c-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return mt(this.pattern,this.options)}parse(t){L(t);let e=this.options;if(t==="**")return A;if(t==="")return"";let s,n=null;(s=t.match(ce))?n=e.dot?fe:he:(s=t.match(Qt))?n=(e.nocase?e.dot?ne:se:e.dot?ee:te)(s[1]):(s=t.match(ue))?n=(e.nocase?e.dot?ge:pe:e.dot?de:me)(s):(s=t.match(ie))?n=e.dot?oe:re:(s=t.match(ae))&&(n=le);let r=z.fromGlob(t,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Se:e.dot?$e:be,n=new Set(e.nocase?["i"]:[]),r=t.map(h=>{let c=h.map(a=>{if(a instanceof RegExp)for(let p of a.flags.split(""))n.add(p);return typeof a=="string"?Pe(a):a===A?A:a._src});c.forEach((a,p)=>{let u=c[p+1],d=c[p-1];a!==A||d===A||(d===void 0?u!==void 0&&u!==A?c[p+1]="(?:\\/|"+s+"\\/)?"+u:c[p]=s:u===void 0?c[p-1]=d+"(?:\\/|\\/"+s+")?":u!==A&&(c[p-1]=d+"(?:\\/|\\/"+s+"\\/)"+u,c[p+1]=A))});let g=c.filter(a=>a!==A);if(this.partial&&g.length>=1){let a=[];for(let p=1;p<=g.length;p++)a.push(g.slice(0,p).join("/"));return"(?:"+a.join("|")+")"}return g.join("/")}).join("|"),[o,l]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+l+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+l+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let n=this.slashSplit(t);this.debug(this.pattern,"split",n);let r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let l=n.length-2;!o&&l>=0;l--)o=n[l];for(let l of r){let h=n;if(s.matchBase&&l.length===1&&(h=[o]),this.matchOne(h,l,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return M.defaults(t).Minimatch}};M.AST=z;M.Minimatch=D;M.escape=Z;M.unescape=v;function G(i){if(i<1024)return String(i);if(i<1024*1024){let e=i/1024;return e<10?`${e.toFixed(1)}K`:`${Math.round(e)}K`}if(i<1024*1024*1024){let e=i/1048576;return e<10?`${e.toFixed(1)}M`:`${Math.round(e)}M`}let t=i/(1024*1024*1024);return t<10?`${t.toFixed(1)}G`:`${Math.round(t)}G`}function F(i){let e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i.getMonth()],s=String(i.getDate()).padStart(2," "),n=new Date,r=new Date(n.getTime()-4320*60*60*1e3);if(i>r){let l=String(i.getHours()).padStart(2,"0"),h=String(i.getMinutes()).padStart(2,"0");return`${e} ${s} ${l}:${h}`}let o=i.getFullYear();return`${e} ${s} ${o}`}function C(i){return i.isDirectory?"/":i.isSymbolicLink?"@":(i.mode&73)!==0?"*":""}var Te={name:"ls",summary:"list directory contents",usage:"ls [OPTION]... [FILE]...",options:["-a, --all do not ignore entries starting with .","-A, --almost-all do not list . and ..","-d, --directory list directories themselves, not their contents","-F, --classify append indicator (one of */=>@) to entries","-h, --human-readable with -l, print sizes like 1K 234M 2G etc.","-l use a long listing format","-r, --reverse reverse order while sorting","-R, --recursive list subdirectories recursively","-S sort by file size, largest first","-t sort by time, newest first","-1 list one file per line"," --help display this help and exit"]},Ne={showAll:{short:"a",long:"all",type:"boolean"},showAlmostAll:{short:"A",long:"almost-all",type:"boolean"},longFormat:{short:"l",type:"boolean"},humanReadable:{short:"h",long:"human-readable",type:"boolean"},recursive:{short:"R",long:"recursive",type:"boolean"},reverse:{short:"r",long:"reverse",type:"boolean"},sortBySize:{short:"S",type:"boolean"},classifyFiles:{short:"F",long:"classify",type:"boolean"},directoryOnly:{short:"d",long:"directory",type:"boolean"},sortByTime:{short:"t",type:"boolean"},onePerLine:{short:"1",type:"boolean"}},es={name:"ls",async execute(i,t){if(V(i))return K(Te);let e=I("ls",i,Ne);if(!e.ok)return e.error;let s=e.result.flags.showAll,n=e.result.flags.showAlmostAll,r=e.result.flags.longFormat,o=e.result.flags.humanReadable,l=e.result.flags.recursive,h=e.result.flags.reverse,c=e.result.flags.sortBySize,g=e.result.flags.classifyFiles,a=e.result.flags.directoryOnly,p=e.result.flags.sortByTime;e.result.flags.onePerLine;let u=e.result.positional;u.length===0&&u.push(".");let d="",f="",$=0;for(let S=0;S<u.length;S++){let m=u[S];if(S>0&&d&&!d.endsWith(`
4
+
5
+ `)&&(d+=`
6
+ `),a){let b=t.fs.resolvePath(t.cwd,m);try{let y=await t.fs.stat(b);if(r){let w=y.isDirectory?"drwxr-xr-x":"-rw-r--r--",E=g?C(await t.fs.lstat(b)):y.isDirectory?"/":"",x=y.size??0,P=o?G(x).padStart(5):String(x).padStart(5),R=y.mtime??new Date(0),W=F(R);d+=`${w} 1 user user ${P} ${W} ${m}${E}
7
+ `}else{let w=g?C(await t.fs.lstat(b)):"";d+=`${m}${w}
8
+ `}}catch{f+=`ls: cannot access '${m}': No such file or directory
9
+ `,$=2}continue}if(m.includes("*")||m.includes("?")||m.includes("[")){let b=await Re(m,t,s,n,r,h,o,c,g);d+=b.stdout,f+=b.stderr,b.exitCode!==0&&($=b.exitCode)}else{let b=await yt(m,t,s,n,r,l,u.length>1,h,o,c,g);d+=b.stdout,f+=b.stderr,b.exitCode!==0&&($=b.exitCode)}}return{stdout:d,stderr:f,exitCode:$}}};async function Re(i,t,e,s,n,r=!1,o=!1,l=!1,h=!1){let c=e||s,g=t.fs.getAllPaths(),a=t.fs.resolvePath(t.cwd,"."),p=[];for(let u of g){let d=u.startsWith(a)&&u.slice(a.length+1)||u;if(M(d,i)||M(u,i)){let f=d.split("/").pop()||d;if(!c&&f.startsWith("."))continue;p.push(d||u)}}if(p.length===0)return{stdout:"",stderr:`ls: ${i}: No such file or directory
10
+ `,exitCode:2};if(l){let u=[];for(let d of p){let f=t.fs.resolvePath(t.cwd,d);try{let $=await t.fs.stat(f);u.push({path:d,size:$.size??0})}catch{u.push({path:d,size:0})}}u.sort((d,f)=>f.size-d.size),p.length=0,p.push(...u.map(d=>d.path))}else p.sort();if(r&&p.reverse(),n){let u=[];for(let d of p){let f=t.fs.resolvePath(t.cwd,d);try{let $=await t.fs.stat(f),S=$.isDirectory?"drwxr-xr-x":"-rw-r--r--",m=h?C(await t.fs.lstat(f)):$.isDirectory?"/":"",b=$.size??0,y=o?G(b).padStart(5):String(b).padStart(5),w=$.mtime??new Date(0),E=F(w);u.push(`${S} 1 user user ${y} ${E} ${d}${m}`)}catch{u.push(`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${d}`)}}return{stdout:`${u.join(`
11
+ `)}
12
+ `,stderr:"",exitCode:0}}if(h){let u=[];for(let d of p){let f=t.fs.resolvePath(t.cwd,d);try{let $=await t.fs.lstat(f);u.push(`${d}${C($)}`)}catch{u.push(d)}}return{stdout:`${u.join(`
13
+ `)}
14
+ `,stderr:"",exitCode:0}}return{stdout:`${p.join(`
15
+ `)}
16
+ `,stderr:"",exitCode:0}}async function yt(i,t,e,s,n,r,o,l=!1,h=!1,c=!1,g=!1,a=!1){let p=e||s,u=t.fs.resolvePath(t.cwd,i);try{let d=await t.fs.stat(u);if(!d.isDirectory){let S=g?C(await t.fs.lstat(u)):"";if(n){let m=d.size??0,b=h?G(m).padStart(5):String(m).padStart(5),y=d.mtime??new Date(0),w=F(y);return{stdout:`-rw-r--r-- 1 user user ${b} ${w} ${i}${S}
17
+ `,stderr:"",exitCode:0}}return{stdout:`${i}${S}
18
+ `,stderr:"",exitCode:0}}let f=await t.fs.readdir(u);if(p||(f=f.filter(S=>!S.startsWith("."))),c){let S=[];for(let m of f){let b=u==="/"?`/${m}`:`${u}/${m}`;try{let y=await t.fs.stat(b);S.push({name:m,size:y.size??0})}catch{S.push({name:m,size:0})}}S.sort((m,b)=>b.size-m.size),f=S.map(m=>m.name)}else f.sort();e&&(f=[".","..",...f]),l&&f.reverse();let $="";if((r||o)&&($+=`${i}:
19
+ `),n){$+=`total ${f.length}
20
+ `;let S=f.filter(w=>w==="."||w===".."),m=f.filter(w=>w!=="."&&w!=="..");for(let w of S)$+=`drwxr-xr-x 1 user user 0 Jan 1 00:00 ${w}
21
+ `;let b=[];for(let w=0;w<m.length;w+=100){let E=m.slice(w,w+100),x=await Promise.all(E.map(async P=>{let R=u==="/"?`/${P}`:`${u}/${P}`;try{let W=await t.fs.stat(R),wt=W.isDirectory?"drwxr-xr-x":"-rw-r--r--",St=g?C(await t.fs.lstat(R)):W.isDirectory?"/":"",X=W.size??0,$t=h?G(X).padStart(5):String(X).padStart(5),bt=W.mtime??new Date(0),xt=F(bt);return{name:P,line:`${wt} 1 user user ${$t} ${xt} ${P}${St}
22
+ `}}catch{return{name:P,line:`-rw-r--r-- 1 user user 0 Jan 1 00:00 ${P}
23
+ `}}}));b.push(...x)}let y=new Map(m.map((w,E)=>[w,E]));b.sort((w,E)=>(y.get(w.name)??0)-(y.get(E.name)??0));for(let{line:w}of b)$+=w}else if(g){let S=[],m=f.filter(y=>y!=="."&&y!==".."),b=f.filter(y=>y==="."||y==="..");for(let y of b)S.push(`${y}/`);for(let y=0;y<m.length;y+=100){let w=m.slice(y,y+100),E=await Promise.all(w.map(async x=>{let P=u==="/"?`/${x}`:`${u}/${x}`;try{let R=await t.fs.lstat(P);return`${x}${C(R)}`}catch{return x}}));S.push(...E)}$+=S.join(`
24
+ `)+(S.length?`
25
+ `:"")}else $+=f.join(`
26
+ `)+(f.length?`
27
+ `:"");if(r){let S=f.filter(y=>y!=="."&&y!==".."),m=[];if(t.fs.readdirWithFileTypes)m=(await t.fs.readdirWithFileTypes(u)).filter(w=>w.isDirectory&&S.includes(w.name)).map(w=>({name:w.name,isDirectory:!0}));else for(let y=0;y<S.length;y+=100){let w=S.slice(y,y+100),E=await Promise.all(w.map(async x=>{let P=u==="/"?`/${x}`:`${u}/${x}`;try{let R=await t.fs.stat(P);return{name:x,isDirectory:R.isDirectory}}catch{return{name:x,isDirectory:!1}}}));m.push(...E.filter(x=>x.isDirectory))}m.sort((y,w)=>y.name.localeCompare(w.name)),l&&m.reverse();let b=[];for(let y=0;y<m.length;y+=100){let w=m.slice(y,y+100),E=await Promise.all(w.map(async x=>{let P=i==="."?`./${x.name}`:`${i}/${x.name}`,R=await yt(P,t,e,s,n,r,!1,l,h,c,g,!0);return{name:x.name,result:R}}));b.push(...E)}b.sort((y,w)=>y.name.localeCompare(w.name)),l&&b.reverse();for(let{result:y}of b)$+=`
28
+ `,$+=y.stdout}return{stdout:$,stderr:"",exitCode:0}}catch{return{stdout:"",stderr:`ls: ${i}: No such file or directory
29
+ `,exitCode:2}}}var ss={name:"ls",flags:[{flag:"-a",type:"boolean"},{flag:"-A",type:"boolean"},{flag:"-l",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"-F",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-1",type:"boolean"}],needsFiles:!0};export{es as a,ss 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{a as u}from"./chunk-NE4R2FVV.js";import{a as f,b as h}from"./chunk-MUFNRCMY.js";var g={name:"which",summary:"locate a command",usage:"which [-as] program ...",options:["-a List all instances of executables found","-s No output, just return 0 if found, 1 if not","--help display this help and exit"]},w={showAll:{short:"a",type:"boolean"},silent:{short:"s",type:"boolean"}},A={name:"which",async execute(s,e){if(h(s))return f(g);let t=u("which",s,w);if(!t.ok)return t.error;let c=t.result.flags.showAll,p=t.result.flags.silent,o=t.result.positional;if(o.length===0)return{stdout:"",stderr:"",exitCode:1};let d=(e.env.get("PATH")||"/usr/bin:/bin").split(":"),n="",a=!0;for(let m of o){let l=!1;for(let r of d){if(!r)continue;let i=e.fs.resolvePath(r,m);if(await e.fs.exists(i)&&(l=!0,p||(n+=`${i}
4
+ `),!c))break}l||(a=!1)}return{stdout:n,stderr:"",exitCode:a?0:1}}},v={name:"which",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"boolean"}],needsArgs:!0};export{A as a,v as b};
@@ -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 B}from"./chunk-7GBHDJNC.js";function T(t,n){let e=t.ignoreCase?n.toLowerCase():n,i=t.needles;for(let l=0;l<i.length;l++)if(e.indexOf(i[l])!==-1)return!0;return!1}function D(t,n){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,l)=>{if(i==="&")return n[0];if(l!==void 0)return n.groups?.[l]??"";let s=parseInt(i,10);return n[s]??""})}function Q(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:l=!1,countOnly:s=!1,countMatches:a=!1,filename:r="",onlyMatching:x=!1,beforeContext:S=0,afterContext:P=0,maxCount:k=0,contextSeparator:W="--",showColumn:z=!1,vimgrep:N=!1,showByteOffset:v=!1,replace:A=null,passthru:G=!1,multiline:F=!1,kResetGroup:R,preFilter:C}=e;if(F)return X(t,n,{invertMatch:i,showLineNumbers:l,countOnly:s,countMatches:a,filename:r,onlyMatching:x,beforeContext:S,afterContext:P,maxCount:k,contextSeparator:W,showColumn:z,showByteOffset:v,replace:A,kResetGroup:R,preFilter:C});let L=t.split(`
4
+ `),O=L.length,Z=O>0&&L[O-1]===""?O-1:O;if(s||a){let h=0,d=(a||x)&&!i;for(let f=0;f<Z;f++){let u=L[f];if(!(C&&!i&&!T(C,u)))if(n.lastIndex=0,d)for(let m=n.exec(u);m!==null;m=n.exec(u))h++,m[0].length===0&&n.lastIndex++;else n.test(u)!==i&&h++}return{output:`${r?`${r}:${h}`:String(h)}
5
+ `,matched:h>0,matchCount:h}}if(S===0&&P===0&&!G){let h=[],d=!1,o=0,f=0;for(let u=0;u<Z&&!(k>0&&o>=k);u++){let m=L[u],M=null;if(C&&!T(C,m)||(n.lastIndex=0,M=n.exec(m)),M!==null!==i)if(d=!0,o++,x)for(let $=M;$!==null;$=n.exec(m)){let y=R!==void 0?$[R]??"":$[0],j=A!==null?D(A,$):y,g=r?`${r}:`:"";v&&(g+=`${f+$.index}:`),l&&(g+=`${u+1}:`),z&&(g+=`${$.index+1}:`),h.push(g+j),$[0].length===0&&n.lastIndex++}else if(N)for(let $=M;$!==null;$=n.exec(m)){let y=r?`${r}:`:"";v&&(y+=`${f+$.index}:`),l&&(y+=`${u+1}:`),z&&(y+=`${$.index+1}:`),h.push(y+m),$[0].length===0&&n.lastIndex++}else{let $=M?M.index+1:1,y=m;A!==null&&(n.lastIndex=0,y=n.replace(m,(...g)=>{if(g[0].length===0)return"";let E=g,_=g[g.length-1];return typeof _=="object"&&_!==null?(E.groups=_,E.input=g[g.length-2],E.index=g[g.length-3]):(E.input=g[g.length-1],E.index=g[g.length-2]),D(A,E)}));let j=r?`${r}:`:"";v&&(j+=`${f+(M?M.index:0)}:`),l&&(j+=`${u+1}:`),z&&(j+=`${$}:`),h.push(j+y)}f+=m.length+1}return{output:h.length>0?`${h.join(`
6
+ `)}
7
+ `:"",matched:d,matchCount:o}}if(G){let h=[],d=!1,o=0;for(let f=0;f<Z;f++){let u=L[f],m;C&&!T(C,u)?m=!1:(n.lastIndex=0,m=n.test(u));let M=m!==i;M&&(d=!0,o++);let U=M?":":"-",$=r?`${r}${U}`:"";l&&($+=`${f+1}${U}`),h.push($+u)}return{output:h.length>0?`${h.join(`
8
+ `)}
9
+ `:"",matched:d,matchCount:o}}let p=[],I=0,w=new Set,b=-1,c=[];for(let h=0;h<Z&&!(k>0&&I>=k);h++){let d=L[h],o;C&&!T(C,d)?o=!1:(n.lastIndex=0,o=n.test(d)),o!==i&&(c.push(h),I++)}for(let h of c){let d=Math.max(0,h-S);b>=0&&d>b+1&&p.push(W);for(let f=d;f<h;f++)if(!w.has(f)){w.add(f),b=f;let u=L[f];l&&(u=`${f+1}-${u}`),r&&(u=`${r}-${u}`),p.push(u)}if(!w.has(h)){w.add(h),b=h;let f=L[h];if(x){n.lastIndex=0;for(let u=n.exec(f);u!==null;u=n.exec(f)){let m=R!==void 0?u[R]??"":u[0],M=A!==null?A:m,U=r?`${r}:`:"";l&&(U+=`${h+1}:`),z&&(U+=`${u.index+1}:`),p.push(U+M),u[0].length===0&&n.lastIndex++}}else{let u=f;l&&(u=`${h+1}:${u}`),r&&(u=`${r}:${u}`),p.push(u)}}let o=Math.min(Z-1,h+P);for(let f=h+1;f<=o;f++)if(!w.has(f)){w.add(f),b=f;let u=L[f];l&&(u=`${f+1}-${u}`),r&&(u=`${r}-${u}`),p.push(u)}}return{output:p.length>0?`${p.join(`
10
+ `)}
11
+ `:"",matched:I>0,matchCount:I}}function X(t,n,e){let{invertMatch:i,showLineNumbers:l,countOnly:s,countMatches:a,filename:r,onlyMatching:x,beforeContext:S,afterContext:P,maxCount:k,contextSeparator:W,showColumn:z,showByteOffset:N,replace:v,kResetGroup:A,preFilter:G}=e;if(G&&!i&&!T(G,t))return s||a?{output:`${r?`${r}:0`:"0"}
12
+ `,matched:!1,matchCount:0}:{output:"",matched:!1,matchCount:0};let F=t.split(`
13
+ `),R=F.length,C=R>0&&F[R-1]===""?R-1:R,L=[0];for(let c=0;c<t.length;c++)t[c]===`
14
+ `&&L.push(c+1);let O=c=>{let h=0;for(let d=0;d<L.length&&!(L[d]>c);d++)h=d;return h},Z=c=>{let h=O(c);return c-L[h]+1},p=[];n.lastIndex=0;for(let c=n.exec(t);c!==null&&!(k>0&&p.length>=k);c=n.exec(t)){let h=O(c.index),d=O(c.index+Math.max(0,c[0].length-1)),o=A!==void 0?c[A]??"":c[0];p.push({startLine:h,endLine:d,byteOffset:c.index,column:Z(c.index),matchText:o}),c[0].length===0&&n.lastIndex++}if(s||a){let c;if(a)c=i?0:p.length;else{let d=new Set;for(let o of p)for(let f=o.startLine;f<=o.endLine;f++)d.add(f);c=i?C-d.size:d.size}return{output:`${r?`${r}:${c}`:String(c)}
15
+ `,matched:c>0,matchCount:c}}if(i){let c=new Set;for(let d of p)for(let o=d.startLine;o<=d.endLine;o++)c.add(o);let h=[];for(let d=0;d<C;d++)if(!c.has(d)){let o=F[d];l&&(o=`${d+1}:${o}`),r&&(o=`${r}:${o}`),h.push(o)}return{output:h.length>0?`${h.join(`
16
+ `)}
17
+ `:"",matched:h.length>0,matchCount:h.length}}if(p.length===0)return{output:"",matched:!1,matchCount:0};let I=new Set,w=-1,b=[];for(let c of p){let h=Math.max(0,c.startLine-S),d=Math.min(C-1,c.endLine+P);w>=0&&h>w+1&&b.push(W);for(let o=h;o<c.startLine;o++)if(!I.has(o)){I.add(o),w=o;let f=F[o];l&&(f=`${o+1}-${f}`),r&&(f=`${r}-${f}`),b.push(f)}if(x){let o=v!==null?v:c.matchText,f=r?`${r}:`:"";N&&(f+=`${c.byteOffset}:`),l&&(f+=`${c.startLine+1}:`),z&&(f+=`${c.column}:`),b.push(f+o);for(let u=c.startLine;u<=c.endLine;u++)I.add(u),w=u}else for(let o=c.startLine;o<=c.endLine&&o<C;o++)if(!I.has(o)){I.add(o),w=o;let f=F[o];v!==null&&o===c.startLine&&(n.lastIndex=0,f=n.replace(f,v));let u=r?`${r}:`:"";N&&o===c.startLine&&(u+=`${c.byteOffset}:`),l&&(u+=`${o+1}:`),z&&o===c.startLine&&(u+=`${c.column}:`),b.push(u+f)}for(let o=c.endLine+1;o<=d;o++)if(!I.has(o)){I.add(o),w=o;let f=F[o];l&&(f=`${o+1}-${f}`),r&&(f=`${r}-${f}`),b.push(f)}}return{output:b.length>0?`${b.join(`
18
+ `)}
19
+ `:"",matched:!0,matchCount:p.length}}var q=new Map([["alpha","a-zA-Z"],["digit","0-9"],["alnum","a-zA-Z0-9"],["lower","a-z"],["upper","A-Z"],["xdigit","0-9A-Fa-f"],["space"," \\t\\n\\r\\f\\v"],["blank"," \\t"],["punct","!-/:-@\\[-`{-~"],["graph","!-~"],["print"," -~"],["cntrl","\\x00-\\x1F\\x7F"],["ascii","\\x00-\\x7F"],["word","a-zA-Z0-9_"]]);function K(t){let n="",e=0;for(;e<t.length;){if(t.slice(e,e+7)==="[[:<:]]"){n+="\\b",e+=7;continue}if(t.slice(e,e+7)==="[[:>:]]"){n+="\\b",e+=7;continue}if(t[e]==="["){let i="[";for(e++,e<t.length&&(t[e]==="^"||t[e]==="!")&&(i+="^",e++),e<t.length&&t[e]==="]"&&(i+="\\]",e++);e<t.length&&t[e]!=="]";){if(t[e]==="["&&e+1<t.length&&t[e+1]===":"){let l=t.indexOf(":]",e+2);if(l!==-1){let s=t.slice(e+2,l),a=q.get(s);if(a){i+=a,e=l+2;continue}}}if(t[e]==="\\"&&e+1<t.length){i+=t[e]+t[e+1],e+=2;continue}i+=t[e],e++}e<t.length&&t[e]==="]"&&(i+="]",e++),n+=i;continue}if(t[e]==="\\"&&e+1<t.length){n+=t[e]+t[e+1],e+=2;continue}n+=t[e],e++}return n}function H(t,n){let e,i;switch(n.mode){case"fixed":e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(e=K(t),e=e.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),n.mode==="perl"){e=ee(e),e=te(e),e=ne(e);let r=oe(e);e=r.pattern,i=r.kResetGroup}break}default:e=K(t),e=he(e);break}n.wholeWord&&(e=`\\b(?:${e})\\b`),n.lineRegexp&&(e=`^${e}$`);let l=/\\u\{[0-9A-Fa-f]+\}/.test(e),s="g"+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.multilineDotall?"s":"")+(l?"u":""),a=J(e,n.ignoreCase??!1);return{regex:B(e,s),kResetGroup:i,preFilter:a??void 0}}function J(t,n){let e=t;if(e.startsWith("\\b(?:")&&e.endsWith(")\\b")?e=e.slice(5,e.length-3):e.startsWith("\\b")&&e.endsWith("\\b")&&e.length>=4&&(e=e.slice(2,e.length-2)),e.length===0)return null;let i=V(e);if(i===null)return null;let l=[];for(let s of i){let a=Y(s);if(a===null||a.length===0)return null;l.push(a)}return l.length===0?null:{needles:n?l.map(s=>s.toLowerCase()):l,ignoreCase:n}}function V(t){let n=[],e=0,i=!1,l=0;for(let s=0;s<t.length;s++){let a=t[s];if(a==="\\"){s++;continue}if(i){a==="]"&&(i=!1);continue}if(a==="[")i=!0;else if(a==="(")e++;else if(a===")"){if(e--,e<0)return null}else a==="|"&&e===0&&(n.push(t.slice(l,s)),l=s+1)}return e!==0||i?null:(n.push(t.slice(l)),n)}function Y(t){let n=t;if(n.startsWith("^")&&(n=n.slice(1)),n.endsWith("$")){let i=0;for(let l=n.length-2;l>=0&&n[l]==="\\";l--)i++;i%2===0&&(n=n.slice(0,-1))}if(n.length===0)return null;let e="";for(let i=0;i<n.length;i++){let l=n[i];if(l==="\\"){let s=n[i+1];if(s===void 0||/[dDwWsSbBAZzGQE0-9ckpPNXRxuU]/.test(s))return null;s==="n"?e+=`
20
+ `:s==="t"?e+=" ":s==="r"?e+="\r":s==="f"?e+="\f":s==="v"?e+="\v":e+=s,i++;continue}if(/[.*+?^${}()|[\]]/.test(l))return null;e+=l}return e}function ee(t){let n="",e=0;for(;e<t.length;)if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="Q"){e+=2;let i="";for(;e<t.length;){if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="E"){e+=2;break}i+=t[e],e++}n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else n+=t[e],e++;return n}function te(t){return t.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function ne(t){let n="",e=0;for(;e<t.length;){if(t[e]==="("&&e+1<t.length&&t[e+1]==="?"){let i=t.slice(e).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(i){let l=i[1]||"",s=i[2]||"",a=i[3];if(a===":"){let r=e+i[0].length-1,x=ie(t,e);if(x!==-1){let S=t.slice(r+1,x),P=le(S,l,s);n+=`(?:${P})`,e=x+1;continue}}else if(a===")"||a===""){e+=i[0].length;continue}}}n+=t[e],e++}return n}function ie(t,n){let e=0,i=n;for(;i<t.length;){if(t[i]==="\\"){i+=2;continue}if(t[i]==="["){for(i++;i<t.length&&t[i]!=="]";)t[i]==="\\"&&i++,i++;i++;continue}if(t[i]==="(")e++;else if(t[i]===")"&&(e--,e===0))return i;i++}return-1}function le(t,n,e){let i=t;return n.includes("i")&&(i=se(i)),i}function se(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"){e+1<t.length?(n+=i+t[e+1],e+=2):(n+=i,e++);continue}if(i==="["){n+=i,e++,e<t.length&&t[e]==="^"&&(n+=t[e],e++);let l=[];for(;e<t.length&&t[e]!=="]";)if(t[e]==="\\")l.push(t[e]),e++,e<t.length&&(l.push(t[e]),e++);else if(t[e]==="-"&&l.length>0&&e+1<t.length&&t[e+1]!=="]"){let s=l[l.length-1],a=t[e+1];l.push("-"),l.push(a),/[a-z]/.test(s)&&/[a-z]/.test(a)?(l.push(s.toUpperCase()),l.push("-"),l.push(a.toUpperCase())):/[A-Z]/.test(s)&&/[A-Z]/.test(a)&&(l.push(s.toLowerCase()),l.push("-"),l.push(a.toLowerCase())),e+=2}else{let s=t[e];if(l.push(s),/[a-zA-Z]/.test(s)){let a=s===s.toLowerCase()?s.toUpperCase():s.toLowerCase();l.includes(a)||l.push(a)}e++}n+=l.join(""),e<t.length&&(n+=t[e],e++);continue}if(/[a-zA-Z]/.test(i)){let l=i.toLowerCase(),s=i.toUpperCase();n+=`[${s}${l}]`}else n+=i;e++}return n}function oe(t){let n=fe(t);if(n===-1)return{pattern:t};let e=t.slice(0,n),i=t.slice(n+2),l=ce(e);return{pattern:`(?:${e})(${i})`,kResetGroup:l+1}}function fe(t){let n=0;for(;n<t.length-1;)if(t[n]==="\\"){if(t[n+1]==="K"){let e=0,i=n-1;for(;i>=0&&t[i]==="\\";)e++,i--;if(e%2===0)return n}n+=2}else n++;return-1}function ce(t){let n=0,e=0;for(;e<t.length;){if(t[e]==="\\"){e+=2;continue}if(t[e]==="["){for(e++;e<t.length&&t[e]!=="]";)t[e]==="\\"&&e++,e++;e++;continue}if(t[e]==="(")if(e+1<t.length&&t[e+1]==="?"){if(e+2<t.length){let i=t[e+2];if(i===":"||i==="="||i==="!"){e++;continue}if(i==="<"&&e+3<t.length){let l=t[e+3];if(l==="="||l==="!"){e++;continue}n++,e++;continue}}}else n++;e++}return n}function ue(t){let n=t.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return n=n.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),n}function he(t){let n="",e=0,i=!0,l=0;for(;e<t.length;){let s=t[e];if(s==="["){for(n+=s,e++,e<t.length&&(t[e]==="^"||t[e]==="!")&&(n+=t[e],e++),e<t.length&&t[e]==="]"&&(n+=t[e],e++);e<t.length&&t[e]!=="]";)t[e]==="\\"&&e+1<t.length?(n+=t[e]+t[e+1],e+=2):(n+=t[e],e++);e<t.length&&t[e]==="]"&&(n+=t[e],e++),i=!1;continue}if(s==="\\"&&e+1<t.length){let a=t[e+1];if(a==="|"){n+="|",e+=2,i=!0;continue}if(a==="("){n+="(",e+=2,l++,i=!0;continue}if(a===")"){n+=")",e+=2,l=Math.max(0,l-1),i=!1;continue}if(a==="{"){let x=t.slice(e).match(/^\\{(\d+)(,(\d*)?)?\\}/);if(x){let S=x[1],P=x[2]!==void 0,k=x[3]||"";P?n+=`{${S},${k}}`:n+=`{${S}}`,e+=x[0].length,i=!1;continue}n+="\\{",e+=2,i=!1;continue}if(a==="}"){n+="\\}",e+=2,i=!1;continue}n+=s+a,e+=2,i=!1;continue}if(s==="*"&&i){n+="\\*",e++;continue}if(s==="^"){if(i){n+="^",e++;continue}n+="\\^",e++;continue}if(s==="$"){let a=e===t.length-1,r=e+2<t.length&&t[e+1]==="\\"&&t[e+2]===")";a||r?n+="$":n+="\\$",e++,i=!1;continue}s==="+"||s==="?"||s==="|"||s==="("||s===")"||s==="{"||s==="}"?n+=`\\${s}`:n+=s,e++,i=!1}return n}export{Q as a,H as b,ue as c};
@@ -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 j}from"./chunk-6GSBC77G.js";import{a as y}from"./chunk-VZK4FHWJ.js";import{e as v}from"./chunk-LNVSXNT7.js";var w=v(j(),1);function C(){return Object.create(null)}function E(e,r,o){e[r]=o}function b(e){let r=C();for(let o of Object.keys(e)){let s=e[o];(typeof s=="string"||typeof s=="number"||typeof s=="boolean"||s===null)&&(r[o]=s)}return r}function S(e){let r=w.default.parse(e.trim(),{header:!0,dynamicTyping:!0,skipEmptyLines:!0}),o=r.data.map(s=>b(s));return{headers:r.meta.fields||[],data:o}}function I(e,r){return r.length===0?`${e.join(",")}
4
+ `:`${w.default.unparse(r,{columns:e}).replace(/\r\n/g,`
5
+ `)}
6
+ `}async function g(e,r){let o=e.find(p=>!p.startsWith("-")),s;if(!o||o==="-")s=y(r.stdin);else try{let p=r.fs.resolvePath(r.cwd,o);s=await r.fs.readFile(p)}catch{return{headers:[],data:[],error:{stdout:"",stderr:`xan: ${o}: No such file or directory
7
+ `,exitCode:1}}}let{headers:i,data:f}=S(s);return{headers:i,data:f}}async function N(e,r){let o=0,s=[],i=[];for(let t=0;t<e.length;t++){let n=e[t];(n==="-l"||n==="--limit")&&t+1<e.length?o=Number.parseInt(e[++t],10):(n==="-s"||n==="--select")&&t+1<e.length?s=e[++t].split(","):n.startsWith("-")||i.push(n)}let{headers:f,data:p,error:d}=await g(i,r);if(d)return d;let c=s.length>0?s.filter(t=>f.includes(t)):f,l=o>0?p.slice(0,o):p,h=Math.max(...c.map(t=>t.length)),a=[],$="\u2500".repeat(80);for(let t=0;t<l.length;t++){let n=l[t];a.push(`Row n\xB0${t}`),a.push($);for(let u of c){let m=n[u],x=m==null?"":String(m);a.push(`${u.padEnd(h)} ${x}`)}t<l.length-1&&a.push("")}return{stdout:`${a.join(`
8
+ `)}
9
+ `,stderr:"",exitCode:0}}async function A(e,r){let o=0,s=[];for(let t=0;t<e.length;t++){let n=e[t];n==="-n"&&t+1<e.length?o=Number.parseInt(e[++t],10):n.startsWith("-")||s.push(n)}let{headers:i,data:f,error:p}=await g(s,r);if(p)return p;let d=o>0?f.slice(0,o):f,c=i.map(t=>t.length);for(let t of d)for(let n=0;n<i.length;n++){let u=String(t[i[n]]??"");c[n]=Math.max(c[n],u.length)}let l=[],h="\u2500",a="\u2502";l.push(`\u250C${c.map(t=>h.repeat(t+2)).join("\u252C")}\u2510`);let $=i.map((t,n)=>` ${t.padEnd(c[n])} `).join(a);l.push(`${a}${$}${a}`),l.push(`\u251C${c.map(t=>h.repeat(t+2)).join("\u253C")}\u2524`);for(let t of d){let n=i.map((u,m)=>` ${String(t[u]??"").padEnd(c[m])} `).join(a);l.push(`${a}${n}${a}`)}return l.push(`\u2514${c.map(t=>h.repeat(t+2)).join("\u2534")}\u2518`),{stdout:`${l.join(`
10
+ `)}
11
+ `,stderr:"",exitCode:0}}export{C as a,E as b,b as c,S as d,I as e,g as f,N as g,A as h};
@@ -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 O}from"./chunk-3MRB66F4.js";import{b as D}from"./chunk-O2BCKSMK.js";import{a as A,b as h}from"./chunk-NYIPFY36.js";import{a as F,b as g}from"./chunk-KRRM5UCC.js";import{b as T}from"./chunk-HL4ZS7TX.js";import{a as m,b as w}from"./chunk-PBOVSFTJ.js";var n={NOOP:0,READ_FILE:1,WRITE_FILE:2,STAT:3,READDIR:4,MKDIR:5,RM:6,EXISTS:7,APPEND_FILE:8,SYMLINK:9,READLINK:10,LSTAT:11,CHMOD:12,REALPATH:13,RENAME:14,COPY_FILE:15,WRITE_STDOUT:100,WRITE_STDERR:101,EXIT:102,HTTP_REQUEST:200,EXEC_COMMAND:300,INVOKE_TOOL:400},r={PENDING:0,READY:1,SUCCESS:2,ERROR:3},l={NONE:0,NOT_FOUND:1,IS_DIRECTORY:2,NOT_DIRECTORY:3,EXISTS:4,PERMISSION_DENIED:5,INVALID_PATH:6,IO_ERROR:7,TIMEOUT:8,NETWORK_ERROR:9,NETWORK_NOT_CONFIGURED:10},o={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},p={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:8388608,TOTAL:8392736},S={NONE:0,RECURSIVE:1,FORCE:2,MKDIR_RECURSIVE:1},u={IS_FILE:0,IS_DIRECTORY:1,IS_SYMLINK:2,MODE:4,SIZE:8,MTIME:16,TOTAL:24};function x(){return new A(p.TOTAL)}var R=class{int32View;uint8View;dataView;constructor(t){this.int32View=new Int32Array(t),this.uint8View=new Uint8Array(t),this.dataView=new DataView(t)}getOpCode(){return h.load(this.int32View,o.OP_CODE/4)}setOpCode(t){h.store(this.int32View,o.OP_CODE/4,t)}getStatus(){return h.load(this.int32View,o.STATUS/4)}setStatus(t){h.store(this.int32View,o.STATUS/4,t)}getPathLength(){return h.load(this.int32View,o.PATH_LENGTH/4)}setPathLength(t){h.store(this.int32View,o.PATH_LENGTH/4,t)}getDataLength(){return h.load(this.int32View,o.DATA_LENGTH/4)}setDataLength(t){h.store(this.int32View,o.DATA_LENGTH/4,t)}getResultLength(){return h.load(this.int32View,o.RESULT_LENGTH/4)}setResultLength(t){h.store(this.int32View,o.RESULT_LENGTH/4,t)}getErrorCode(){return h.load(this.int32View,o.ERROR_CODE/4)}setErrorCode(t){h.store(this.int32View,o.ERROR_CODE/4,t)}getFlags(){return h.load(this.int32View,o.FLAGS/4)}setFlags(t){h.store(this.int32View,o.FLAGS/4,t)}getMode(){return h.load(this.int32View,o.MODE/4)}setMode(t){h.store(this.int32View,o.MODE/4,t)}getPath(){let t=this.getPathLength(),e=this.uint8View.slice(o.PATH_BUFFER,o.PATH_BUFFER+t);return new TextDecoder().decode(e)}setPath(t){let e=new TextEncoder().encode(t);if(e.length>p.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${p.PATH_BUFFER}`);this.uint8View.set(e,o.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setData(t){if(t.length>p.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setDataLength(t.length)}getDataAsString(){let t=this.getData();return new TextDecoder().decode(t)}setDataFromString(t){let e=new TextEncoder().encode(t);this.setData(e)}getResult(){let t=this.getResultLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setResult(t){if(t.length>p.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setResultLength(t.length)}getResultAsString(){let t=this.getResult();return new TextDecoder().decode(t)}setResultFromString(t){let e=new TextEncoder().encode(t);this.setResult(e)}encodeStat(t){this.uint8View[o.DATA_BUFFER+u.IS_FILE]=t.isFile?1:0,this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(o.DATA_BUFFER+u.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(o.DATA_BUFFER+u.SIZE,e,!0),this.dataView.setFloat64(o.DATA_BUFFER+u.MTIME,t.mtime.getTime(),!0),this.setResultLength(u.TOTAL)}decodeStat(){return{isFile:this.uint8View[o.DATA_BUFFER+u.IS_FILE]===1,isDirectory:this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]===1,mode:this.dataView.getInt32(o.DATA_BUFFER+u.MODE,!0),size:this.dataView.getFloat64(o.DATA_BUFFER+u.SIZE,!0),mtime:new Date(this.dataView.getFloat64(o.DATA_BUFFER+u.MTIME,!0))}}waitForReady(t){return h.wait(this.int32View,o.STATUS/4,r.PENDING,t)}waitForReadyAsync(t){return h.waitAsync(this.int32View,o.STATUS/4,r.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let a=this.getStatus();if(a===r.READY)return!0;let s=Date.now()-e;if(s>=t)return!1;let i=t-s,c=h.waitAsync(this.int32View,o.STATUS/4,a,i);if(c.async&&await c.value==="timed-out")return!1}}waitForResult(t){return h.wait(this.int32View,o.STATUS/4,r.READY,t)}notify(){return h.notify(this.int32View,o.STATUS/4)}reset(){this.setOpCode(n.NOOP),this.setStatus(r.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(l.NONE),this.setFlags(S.NONE),this.setMode(0)}};var C=class{fs;cwd;commandName;secureFetch;maxOutputSize;exec;invokeTool;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;startTime=0;timeoutMs=0;constructor(t,e,a,s,i=void 0,c=0,d=void 0,E=void 0){this.fs=e,this.cwd=a,this.commandName=s,this.secureFetch=i,this.maxOutputSize=c,this.exec=d,this.invokeTool=E,this.protocol=new R(t)}remainingMs(){return Math.max(0,this.timeoutMs-(Date.now()-this.startTime))}raceDeadline(t){let e=this.remainingMs();if(e<=0)return this.running=!1,this.output.exitCode=124,this.output.stderr+=`
4
+ ${this.commandName}: execution timeout exceeded
5
+ `,Promise.reject(new Error("Operation timed out"));let a=t();return new Promise((s,i)=>{let c=F(()=>{this.running=!1,this.output.exitCode=124,this.output.stderr+=`
6
+ ${this.commandName}: execution timeout exceeded
7
+ `,i(new Error("Operation timed out"))},e);a.then(d=>{g(c),s(d)},d=>{g(c),i(d)})})}async run(t){for(this.running=!0,this.startTime=Date.now(),this.timeoutMs=t;this.running;){if(Date.now()-this.startTime>=t){this.output.stderr+=`
8
+ ${this.commandName}: execution timeout exceeded
9
+ `,this.output.exitCode=124;break}let a=this.remainingMs();if(!await this.protocol.waitUntilReady(a)){this.output.stderr+=`
10
+ ${this.commandName}: execution timeout exceeded
11
+ `,this.output.exitCode=124;break}let i=this.protocol.getOpCode();await this.handleOperation(i),this.protocol.notify()}return this.output}stop(){this.running=!1}async handleOperation(t){try{switch(t){case n.READ_FILE:await this.handleReadFile();break;case n.WRITE_FILE:await this.handleWriteFile();break;case n.STAT:await this.handleStat();break;case n.LSTAT:await this.handleLstat();break;case n.READDIR:await this.handleReaddir();break;case n.MKDIR:await this.handleMkdir();break;case n.RM:await this.handleRm();break;case n.EXISTS:await this.handleExists();break;case n.APPEND_FILE:await this.handleAppendFile();break;case n.SYMLINK:await this.handleSymlink();break;case n.READLINK:await this.handleReadlink();break;case n.CHMOD:await this.handleChmod();break;case n.REALPATH:await this.handleRealpath();break;case n.RENAME:await this.handleRename();break;case n.COPY_FILE:await this.handleCopyFile();break;case n.WRITE_STDOUT:this.handleWriteStdout();break;case n.WRITE_STDERR:this.handleWriteStderr();break;case n.EXIT:this.handleExit();break;case n.HTTP_REQUEST:await this.handleHttpRequest();break;case n.EXEC_COMMAND:await this.handleExecCommand();break;case n.INVOKE_TOOL:await this.handleInvokeTool();break;default:this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setStatus(r.ERROR)}}catch(e){this.setErrorFromException(e)}}resolvePath(t){return this.fs.resolvePath(this.cwd,t)}async handleReadFile(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readFileBuffer(t);this.protocol.setResult(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleWriteFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.writeFile(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleStat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.stat(t);this.protocol.encodeStat(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleLstat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.lstat(t);this.protocol.encodeStat(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleReaddir(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readdir(t);this.protocol.setResultFromString(JSON.stringify(e)),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleMkdir(){let t=this.resolvePath(this.protocol.getPath()),a=(this.protocol.getFlags()&S.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(t,{recursive:a}),this.protocol.setStatus(r.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleRm(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),a=(e&S.RECURSIVE)!==0,s=(e&S.FORCE)!==0;try{await this.fs.rm(t,{recursive:a,force:s}),this.protocol.setStatus(r.SUCCESS)}catch(i){this.setErrorFromException(i)}}async handleExists(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.exists(t);this.protocol.setResult(new Uint8Array([e?1:0])),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleAppendFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.appendFile(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleSymlink(){let t=this.protocol.getPath(),e=this.protocol.getDataAsString(),a=this.resolvePath(t);try{await this.fs.symlink(e,a),this.protocol.setStatus(r.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleReadlink(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readlink(t);this.protocol.setResultFromString(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleChmod(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getMode();try{await this.fs.chmod(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleRealpath(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.realpath(t);this.protocol.setResultFromString(e),this.protocol.setStatus(r.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRename(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.mv(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}async handleCopyFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.cp(t,e),this.protocol.setStatus(r.SUCCESS)}catch(a){this.setErrorFromException(a)}}handleWriteStdout(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stdout",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(r.ERROR);return}this.protocol.setStatus(r.SUCCESS)}handleWriteStderr(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stderr",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(r.ERROR);return}this.protocol.setStatus(r.SUCCESS)}handleExit(){let t=this.protocol.getFlags();this.outputLimitExceeded?this.output.exitCode===0&&(this.output.exitCode=1):this.output.exitCode=t,this.protocol.setStatus(r.SUCCESS),this.running=!1}tryAppendOutput(t,e){return this.outputLimitExceeded?!1:this.maxOutputSize<=0?(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0):this.output.stdout.length+this.output.stderr.length+e.length>this.maxOutputSize?!1:(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0)}appendOutputLimitError(){if(this.maxOutputSize<=0)return;let t=`${this.commandName}: total output size exceeded (>${this.maxOutputSize} bytes), increase executionLimits.maxOutputSize
12
+ `,e=t.length>this.maxOutputSize?t.slice(0,this.maxOutputSize):t;if(this.output.stderr.includes("total output size exceeded"))return;let s=this.output.stdout.length+this.output.stderr.length+e.length-this.maxOutputSize;if(s>0)if(this.output.stdout.length>=s)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-s);else{let i=s-this.output.stdout.length;this.output.stdout="",i>=this.output.stderr.length?this.output.stderr="":this.output.stderr=this.output.stderr.slice(0,this.output.stderr.length-i)}this.output.stderr+=e}async handleHttpRequest(){let t=this.secureFetch;if(!t){this.protocol.setErrorCode(l.NETWORK_NOT_CONFIGURED),this.protocol.setResultFromString("Network access not configured. Enable network in Bash options."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString();try{let s=a?JSON.parse(a):{},i=this.remainingMs(),c=await this.raceDeadline(()=>t(e,{method:s.method,headers:s.headers,body:s.body,timeoutMs:i})),d=JSON.stringify({status:c.status,statusText:c.statusText,headers:c.headers,bodyBase64:D(c.body,"base64"),url:c.url});this.protocol.setResultFromString(d),this.protocol.setStatus(r.SUCCESS)}catch(s){let i=m(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.NETWORK_ERROR),this.protocol.setResultFromString(i),this.protocol.setStatus(r.ERROR)}}async handleExecCommand(){let t=this.exec;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Command execution not available in this context."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString(),s=new AbortController;try{let i={cwd:this.cwd,signal:s.signal};if(a){let E=JSON.parse(a);E.stdin&&(i.stdin=E.stdin),E.args&&Array.isArray(E.args)&&(i.args=E.args.map(f=>String(f)),e=O([e]))}let c=await this.raceDeadline(()=>t(e,i)),d=JSON.stringify({stdout:c.stdout,stderr:c.stderr,exitCode:c.exitCode});this.protocol.setResultFromString(d),this.protocol.setStatus(r.SUCCESS)}catch(i){s.abort();let c=i instanceof Error?i.message:String(i);this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(c),this.protocol.setStatus(r.ERROR)}}async handleInvokeTool(){let t=this.invokeTool;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Tool invocation not available in this context."),this.protocol.setStatus(r.ERROR);return}let e=this.protocol.getPath(),a=this.protocol.getDataAsString();try{let s=await this.raceDeadline(()=>T.runTrustedAsync(()=>t(e,a)));this.protocol.setResultFromString(s),this.protocol.setStatus(r.SUCCESS)}catch(s){let i=w(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(i),this.protocol.setStatus(r.ERROR)}}setErrorFromException(t){let e=t instanceof Error?t.message:String(t),a=m(e),s=l.IO_ERROR,i=e.toLowerCase();i.includes("no such file")||i.includes("not found")||i.includes("enoent")?s=l.NOT_FOUND:i.includes("is a directory")||i.includes("eisdir")?s=l.IS_DIRECTORY:i.includes("not a directory")||i.includes("enotdir")?s=l.NOT_DIRECTORY:i.includes("already exists")||i.includes("eexist")?s=l.EXISTS:(i.includes("permission")||i.includes("eperm")||i.includes("eacces"))&&(s=l.PERMISSION_DENIED),this.protocol.setErrorCode(s),this.protocol.setResultFromString(a),this.protocol.setStatus(r.ERROR)}};export{x as a,C as b};
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as ye}from"./chunk-BIJXTWZ4.js";import{b as Q}from"./chunk-HL4ZS7TX.js";import{a as U}from"./chunk-7GBHDJNC.js";import{a as pe,b as ge,c as ee}from"./chunk-MUFNRCMY.js";var Ke="file",Je="link",Ve="symlink",ke="directory",Qe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},et={0:Ke,1:Je,2:Ve,3:"character-device",4:"block-device",5:ke,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},tt=new Uint8Array(512),_=new Uint8Array(0),T=new TextEncoder,ze=new TextDecoder;function P(e,t,i,r){r&&T.encodeInto(r,e.subarray(t,t+i))}function L(e,t,i,r){if(r===void 0)return;let n=r.toString(8).padStart(i-1,"0");T.encodeInto(n,e.subarray(t,t+i-1))}function S(e,t,i){let r=e.indexOf(0,t),n=r===-1||r>t+i?t+i:r;return ze.decode(e.subarray(t,n))}function ne(e,t,i){let r=0,n=t+i;for(let s=t;s<n;s++){let a=e[s];if(a===0)break;a!==32&&(r=r*8+(a-48))}return r}function W(e,t,i){if(e[t]&128){let r=0;r=e[t]&127;for(let n=1;n<i;n++)r=r*256+e[t+n];if(!Number.isSafeInteger(r))throw new Error("TAR number too large");return r}return ne(e,t,i)}var N=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return _;if(e instanceof Uint8Array)return e;if(typeof e=="string")return T.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var we=(e,t)=>{let i=e.split("/").filter(Boolean);return t>=i.length?"":i.slice(t).join("/")};function Ae(e,t){let{strip:i,filter:r,map:n}=t;if(!i&&!r&&!n)return e;let s={...e};if(i&&i>0){let o=we(s.name,i);if(!o)return null;if(s.name=s.type==="directory"&&!o.endsWith("/")?`${o}/`:o,s.linkname){let c=s.linkname.startsWith("/");if(c||s.type==="link"){let l=we(s.linkname,i);s.linkname=c?`/${l}`||"/":l}}}if(r?.(s)===!1)return null;let a=n?n(s):s;return a&&(!a.name||!a.name.trim()||a.name==="."||a.name==="/")?null:a}var re=32,rt=48;function nt(e){let t=ne(e,148,8),i=0;for(let r=0;r<e.length;r++)r>=148&&r<156?i+=re:i+=e[r];return t===i}function it(e){e.fill(re,148,156);let t=0;for(let i of e)t+=i;for(let i=153;i>=148;i--)e[i]=(t&7)+rt,t>>=3;e[154]=0,e[155]=re}var st=256;function ot(e){let t={};T.encode(e.name).length>100&&Ee(e.name)===null&&(t.path=e.name),e.linkname&&T.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&T.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&T.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let i=Object.entries(t);if(i.length===0)return null;let r=T.encode(i.map(([n,s])=>{let a=`${n}=${s}
4
+ `,o=T.encode(a).length+1,c=o+String(o).length;return c=o+String(c).length,`${c} ${a}`}).join(""));return{paxHeader:$e({name:ze.decode(T.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function Ee(e){let t=T.encode(e).length;if(t<=100||t>st)return null;for(let i=e.length-1;i>0;i--){if(e[i]!=="/")continue;let r=e.slice(0,i),n=e.slice(i+1);if(T.encode(r).length<=155&&T.encode(n).length<=100)return{prefix:r,name:n}}return null}function $e(e){let t=new Uint8Array(512),i=N(e)?0:e.size??0,r=e.name,n="";if(!e.pax?.path){let s=Ee(r);s&&(r=s.name,n=s.prefix)}return P(t,0,100,r),L(t,100,8,e.mode??(e.type==="directory"?493:420)),L(t,108,8,e.uid??0),L(t,116,8,e.gid??0),L(t,124,12,i),L(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),P(t,156,1,Qe[e.type??"file"]),P(t,157,100,e.linkname),P(t,257,6,"ustar\0"),P(t,263,2,"00"),P(t,265,32,e.uname),P(t,297,32,e.gname),P(t,345,155,n),it(t),t}function at(e,t){if(t&&!nt(e))throw new Error("Invalid tar header checksum.");let i=S(e,156,1),r={name:S(e,0,100),mode:ne(e,100,8),uid:W(e,108,8),gid:W(e,116,8),size:W(e,124,12),mtime:new Date(W(e,136,12)*1e3),type:et[i]||"file",linkname:S(e,157,100)},n=S(e,257,6);return N(r)&&(r.size=0),n.trim()==="ustar"&&(r.uname=S(e,265,32),r.gname=S(e,297,32)),n==="ustar"&&(r.prefix=S(e,345,155)),r}var be={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>parseInt(e,10)],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function lt(e){let t=new TextDecoder("utf-8"),i=Object.create(null),r=Object.create(null),n=0;for(;n<e.length;){let s=e.indexOf(32,n);if(s===-1)break;let a=parseInt(t.decode(e.subarray(n,s)),10);if(Number.isNaN(a)||a===0)break;let o=n+a,[c,l]=t.decode(e.subarray(s+1,o-1)).split("=",2);if(c&&l!==void 0&&(r[c]=l,Object.hasOwn(be,c))){let[f,u]=be[c],y=u(l);(typeof y=="string"||!Number.isNaN(y))&&(i[f]=y)}n=o}return Object.keys(r).length>0&&(i.pax=r),i}function xe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ct(e){switch(e){case"pax-global-header":case"pax-header":return lt;case"gnu-long-name":return t=>({name:S(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:S(t,0,t.length)});default:return}}function ft(e){let t=$e(e),i=ot(e);if(!i)return[t];let r=-i.paxBody.length&511,n=r>0?[tt.subarray(0,r)]:[];return[i.paxHeader,i.paxBody,...n,t]}var ut=new Uint8Array(512*2);function Be(e,t,i){let r=null,n=0,s=!1,a=o=>{let c=new Error(o);throw t(c),c};return{add(o){s&&a("No new tar entries after finalize."),r!==null&&a("Previous entry must be completed before adding a new one");let c=N(o)?0:o.size;(!Number.isSafeInteger(c)||c<0)&&a("Invalid tar entry size.");try{let l=ft({...o,size:c});for(let f of l)e(f);r={...o,size:c},n=0}catch(l){t(l)}},write(o){r||a("No active tar entry."),s&&a("Cannot write data after finalize.");let c=n+o.length;c>r.size&&a(`"${r.name}" exceeds given size of ${r.size} bytes.`);try{n=c,e(o)}catch(l){t(l)}},endEntry(){r||a("No active entry to end."),s&&a("Cannot end entry after finalize.");try{n!==r.size&&a(`Size mismatch for "${r.name}".`);let o=-r.size&511;o>0&&e(new Uint8Array(o)),r=null,n=0}catch(o){throw t(o),o}},finalize(){s&&a("Archive has already been finalized"),r!==null&&a("Cannot finalize while an entry is still active");try{e(ut),s=!0,i&&i()}catch(o){t(o)}}}}var j=256;function dt(){let e=new Array(j),t=e.length-1,i=0,r=0,n=0,s=o=>{let c=e[i];o===c.length?(e[i]=_,i=i+1&t):e[i]=c.subarray(o),n-=o,n===0&&e.length>j&&(e=new Array(j),t=j-1,i=0,r=0)};function a(o,c){if(c){let g=0,d=Math.min(o,n);for(;d>0;){let p=e[i],m=Math.min(d,p.length),x=m===p.length?p:p.subarray(0,m);if(s(m),d-=m,g+=m,!c(x))break}return g}if(n<o)return null;if(o===0)return _;let l=e[i];if(l.length>=o){let g=l.length===o?l:l.subarray(0,o);return s(o),g}let f=new Uint8Array(o),u=0,y=o;for(;y>0;){let g=e[i],d=Math.min(y,g.length);f.set(d===g.length?g:g.subarray(0,d),u),u+=d,y-=d,s(d)}return f}return{push:o=>{if(o.length===0)return;let c=r+1&t;if(c===i){let l=e.length,f=l*2,u=new Array(f),y=r-i+l&l-1;if(i<r)for(let g=0;g<y;g++)u[g]=e[i+g];else if(y>0){let g=l-i;for(let d=0;d<g;d++)u[d]=e[i+d];for(let d=0;d<r;d++)u[g+d]=e[d]}e=u,t=f-1,i=0,r=y,c=r+1&t}e[r]=o,r=c,n+=o.length},available:()=>n,peek:o=>{if(n<o)return null;if(o===0)return _;let c=e[i];if(c.length>=o)return c.length===o?c:c.subarray(0,o);let l=new Uint8Array(o),f=0,u=i;for(;f<o;){let y=e[u],g=Math.min(o-f,y.length);g===y.length?l.set(y,f):l.set(y.subarray(0,g),f),f+=g,u=u+1&t}return l},discard:o=>{if(o>n)throw new Error("Too many bytes consumed");if(o===0)return;let c=o;for(;c>0;){let l=e[i],f=Math.min(c,l.length);s(f),c-=f}},pull:a}}var te=0,D=1,H=new Error("Tar archive is truncated.");function Te(e={}){let t=e.strict??!1,{available:i,peek:r,push:n,discard:s,pull:a}=dt(),o=te,c=!1,l=!1,f=!1,u=null,y={},g={},d={isEntryActive:()=>o===D,isBodyComplete:()=>!u||u.remaining===0,canFinish:()=>!u||i()>=u.remaining+u.padding,write(p){if(c)throw new Error("Archive already ended.");n(p)},end(){c=!0},readHeader(){if(o!==te)throw new Error("Cannot read header while an entry is active");if(!l)for(;!l;){if(i()<512){if(c){if(i()>0&&t)throw H;l=!0;return}return null}let p=r(512);if(ve(p)){if(i()<512*2){if(c){if(t)throw H;l=!0;return}return null}if(ve(r(512*2).subarray(512))){s(512*2),l=!0,f=!0;return}if(t)throw new Error("Invalid tar header.");s(512);continue}let m;try{m=at(p,t)}catch(E){if(t)throw E;s(512);continue}let x=ct(m.type);if(x){let E=m.size+(-m.size&511);if(i()<512+E){if(c&&t)throw H;return null}s(512);let v=x(a(E).subarray(0,m.size)),$=m.type==="pax-global-header"?y:g;for(let z in v)$[z]=v[z];continue}s(512);let b=m;return m.prefix&&(b.name=`${m.prefix}/${b.name}`),xe(b,y),xe(b,g),b.name.endsWith("/")&&b.type==="file"&&(b.type=ke),g={},u={header:b,remaining:b.size,padding:-b.size&511},o=D,b}},streamBody(p){if(o!==D||!u||u.remaining===0)return 0;let m=Math.min(u.remaining,i());if(m===0)return 0;let x=a(m,p);return u.remaining-=x,x},skipPadding(){if(o!==D||!u)return!0;if(u.remaining>0)throw new Error("Body not fully consumed");return i()<u.padding?!1:(s(u.padding),u=null,o=te,!0)},skipEntry(){if(o!==D||!u)return!0;let p=Math.min(u.remaining,i());return p>0&&(s(p),u.remaining-=p),u.remaining>0?!1:d.skipPadding()},validateEOF(){if(t){if(!f)throw H;if(i()>0&&a(i()).some(p=>p!==0))throw new Error("Invalid EOF.")}}};return d}function ve(e){if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let i=0;i<t.length;i++)if(t[i]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function Fe(){return new CompressionStream("gzip")}function Ie(){return new DecompressionStream("gzip")}function mt(){let e,t;return{readable:new ReadableStream({start(i){e=i,t=Be(i.enqueue.bind(i),i.error.bind(i),i.close.bind(i))}}),controller:{add(i){let r=N(i);return t.add(i),r&&t.endEntry(),new WritableStream({write(n){t.write(n)},close(){r||t.endEntry()},abort(n){e.error(n)}})},finalize(){t.finalize()},error(i){e.error(i)}}}}async function Pe(e){let t=[],i=e.getReader(),r=0;try{for(;;){let{done:a,value:o}=await i.read();if(a)break;t.push(o),r+=o.length}let n=new Uint8Array(r),s=0;for(let a of t)n.set(a,s),s+=a.length;return n}finally{i.releaseLock()}}var Se=e=>e.pipeTo(new WritableStream);function ht(e={}){let t=Te(e),i=e.strict??!1,r=null,n=null,s=!1,a=!1,o=!1,c=!1,l=()=>{try{n?.close()}catch{}n=null},f=d=>{if(!c){c=!0;try{n?.error(d)}catch{}n=null;try{r.error(d)}catch{}r=null}},u=()=>{if(!c){c=!0,l();try{r.close()}catch{}r=null}},y=()=>{if(i)throw new Error("Tar archive is truncated.");u()},g=()=>{if(!(s||c||!r)){s=!0;try{for(;;){if(a){o&&(t.validateEOF(),u());break}if(t.isEntryActive()){if(o&&!t.canFinish()){y();break}if(n){if((n.desiredSize??1)<=0)break;if(t.streamBody(d=>(n.enqueue(d),(n.desiredSize??1)>0))===0&&!t.isBodyComplete()){o&&y();break}}else if(!t.skipEntry()){o&&y();break}if(t.isBodyComplete()&&(l(),!t.skipPadding())){o&&y();break}}else{if((r.desiredSize??0)<0)break;let d=t.readHeader();if(d===null){o&&u();break}if(d===void 0){if(o){t.validateEOF(),u();break}a=!0;break}r.enqueue({header:d,body:new ReadableStream({start(p){d.size===0?p.close():n=p},pull:g,cancel(){n=null,g()}})})}}}catch(d){throw f(d),d}finally{s=!1}}};return{readable:new ReadableStream({start(d){r=d},pull:g,cancel(d){d!==void 0?f(d):u()}},{highWaterMark:2}),writable:new WritableStream({write(d){try{if(a&&i&&d.some(p=>p!==0))throw new Error("Invalid EOF.");t.write(d),g()}catch(p){throw f(p),p}},close(){try{o=!0,t.end(),g()}catch(d){throw f(d),d}},abort(d){f(d)}})}}async function Oe(e){let{readable:t,controller:i}=mt();return await(async()=>{for(let r of e){let n=i.add(r.header),s="body"in r?r.body:r.data;if(!s){await n.close();continue}if(s instanceof ReadableStream)await s.pipeTo(n);else if(s instanceof Blob)await s.stream().pipeTo(n);else try{let a=await Ce(s);if(a.length>0){let o=n.getWriter();await o.write(a),await o.close()}else await n.close()}catch{throw new TypeError(`Unsupported content type for entry "${r.header.name}".`)}}})().then(()=>i.finalize()).catch(r=>i.error(r)),new Uint8Array(await Pe(t))}async function Ue(e,t={}){let i=e instanceof ReadableStream?e:new ReadableStream({start(s){s.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),s.close()}}),r=[],n=i.pipeThrough(ht(t));for await(let s of n){let a;try{a=Ae(s.header,t)}catch(o){throw await s.body.cancel(),o}if(a===null){await Se(s.body);continue}N(a)?(await Se(s.body),r.push({header:a})):r.push({header:a,data:await Pe(s.body)})}return r}import At from"seek-bzip";var pt=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let i=t<<24;for(let r=0;r<8;r++)i=i&2147483648?i<<1^79764919:i<<1;e[t]=i>>>0}return e})();function gt(e,t){return(e<<8^pt[(e>>>24^t)&255])>>>0}var ie=class{buffer=[];current=0;bitCount=0;writeBits(t,i){for(let r=t-1;r>=0;r--)this.current=this.current<<1|i>>>r&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(t){this.current=this.current<<1|t&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function yt(e){let t=[],i=0;for(;i<e.length;){let r=e[i],n=1;for(;i+n<e.length&&e[i+n]===r&&n<255;)n++;n>=4?(t.push(r,r,r,r),t.push(n-4),i+=n):(t.push(r),i++)}return new Uint8Array(t)}function wt(e){let t=e.length;if(t===0)return{transformed:new Uint8Array(0),pointer:0};let i=bt(e),r=new Uint8Array(t),n=0;for(let s=0;s<t;s++)i[s]===0?(n=s,r[s]=e[t-1]):r[s]=e[i[s]-1];return{transformed:r,pointer:n}}function bt(e){let t=e.length,i=new Int32Array(t),r=new Int32Array(t);for(let n=0;n<t;n++)i[n]=n,r[n]=e[n];for(let n=1;n<t;n*=2){let s=r.slice();i.sort((a,o)=>s[a]!==s[o]?s[a]-s[o]:s[(a+n)%t]-s[(o+n)%t]),r[i[0]]=0;for(let a=1;a<t;a++)s[i[a]]===s[i[a-1]]&&s[(i[a]+n)%t]===s[(i[a-1]+n)%t]?r[i[a]]=r[i[a-1]]:r[i[a]]=r[i[a-1]]+1;if(r[i[t-1]]===t-1)break}return i}function xt(e,t){let i=[];for(let a=0;a<256;a++)t[a]&&i.push(a);let r=new Array(256).fill(-1);for(let a=0;a<i.length;a++)r[i[a]]=a;let n=new Uint16Array(e.length),s=i.slice();for(let a=0;a<e.length;a++){let o=e[a],c=0;for(;s[c]!==o;)c++;if(n[a]=c,c>0){let l=s[c];for(let f=c;f>0;f--)s[f]=s[f-1];s[0]=l}}return{encoded:n,length:e.length}}function vt(e,t,i){let s=i+1,a=[],o=0;for(;o<t;)if(e[o]===0){let l=0;for(;o<t&&e[o]===0;)l++,o++;let f=l;for(;f>0;)f--,f&1?a.push(1):a.push(0),f>>>=1}else a.push(e[o]+1),o++;a.push(s);let c=new Uint16Array(a.length);for(let l=0;l<a.length;l++)c[l]=a[l];return{symbols:c,length:a.length,eob:s}}function Ne(e,t,i){if(t<=1){let l=new Array(e.length).fill(0);for(let f=0;f<e.length;f++)e[f]>0&&(l[f]=1);return{codeLengths:l,maxLen:1,minLen:1}}let r=[];for(let l=0;l<e.length;l++)e[l]>0&&r.push({freq:e[l],symbol:l,left:null,right:null});if(r.length===0)return{codeLengths:new Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let l=new Array(e.length).fill(0);return l[r[0].symbol]=1,{codeLengths:l,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((u,y)=>u.freq-y.freq);let l=r.shift(),f=r.shift();r.push({freq:l.freq+f.freq,symbol:-1,left:l,right:f})}let n=new Array(e.length).fill(0);function s(l,f){if(!l.left&&!l.right){n[l.symbol]=f;return}l.left&&s(l.left,f+1),l.right&&s(l.right,f+1)}s(r[0],0);let a=!0;for(;a;){a=!1;for(let l=0;l<n.length;l++)n[l]>i&&(n[l]=i,a=!0);if(a){let l=0;for(let f=0;f<n.length;f++)n[f]>0&&(l+=1/(1<<n[f]));if(l>1)for(let f=1;f<i&&l>1;f++)for(let u=0;u<n.length&&l>1;u++)n[u]===f&&(n[u]++,l-=1/(1<<f)-1/(1<<f+1));a=!1;for(let f=0;f<n.length;f++)if(n[f]>i){a=!0;break}}}let o=i,c=0;for(let l=0;l<n.length;l++)n[l]>0&&(n[l]<o&&(o=n[l]),n[l]>c&&(c=n[l]));return{codeLengths:n,maxLen:c,minLen:o}}function kt(e,t){let i=new Array(t).fill(0),r=e.slice(0,t),n=Math.max(...r,0),s=new Array(n+1).fill(0);for(let c=0;c<t;c++)r[c]>0&&s[r[c]]++;let a=new Array(n+1).fill(0),o=0;for(let c=1;c<=n;c++)o=o+s[c-1]<<1,a[c]=o;for(let c=0;c<t;c++)r[c]>0&&(i[c]=a[r[c]]++);return{codes:i,lengths:r}}function zt(e,t,i){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,i),e.writeBit(0);let r=yt(t),{transformed:n,pointer:s}=wt(r);e.writeBits(24,s);let a=new Array(256).fill(!1);for(let h=0;h<n.length;h++)a[n[h]]=!0;let o=new Array(16).fill(!1);for(let h=0;h<16;h++)for(let w=0;w<16;w++)if(a[h*16+w]){o[h]=!0;break}for(let h=0;h<16;h++)e.writeBit(o[h]?1:0);for(let h=0;h<16;h++)if(o[h])for(let w=0;w<16;w++)e.writeBit(a[h*16+w]?1:0);let c=0;for(let h=0;h<256;h++)a[h]&&c++;let{encoded:l,length:f}=xt(n,a),{symbols:u,length:y}=vt(l,f,c),g=c+2,d=50,p=Math.ceil(y/d),m;y<200?m=2:y<600?m=3:y<1200?m=4:y<2400?m=5:m=6,m>p&&(m=Math.max(2,p));let x=[];for(let h=0;h<m;h++)x.push(new Array(g).fill(0));let b=new Int32Array(p);for(let h=0;h<p;h++)b[h]=h%m;for(let h=0;h<p;h++){let w=h*d,k=Math.min(w+d,y),B=b[h];for(let C=w;C<k;C++)x[B][u[C]]++}function E(h){for(let w=0;w<g;w++)h[w]<1&&(h[w]=1)}let v=[];for(let h=0;h<m;h++)E(x[h]),v.push(Ne(x[h],g,20));for(let h=0;h<4;h++){for(let w=0;w<m;w++)x[w].fill(0);for(let w=0;w<p;w++){let k=w*d,B=Math.min(k+d,y),C=0,M=1/0;for(let I=0;I<m;I++){let J=0;for(let V=k;V<B;V++)J+=v[I].codeLengths[u[V]]||20;J<M&&(M=J,C=I)}b[w]=C;for(let I=k;I<B;I++)x[C][u[I]]++}for(let w=0;w<m;w++)E(x[w]),v[w]=Ne(x[w],g,20)}e.writeBits(3,m),e.writeBits(15,p);let $=[],z=[];for(let h=0;h<m;h++)z.push(h);for(let h=0;h<p;h++){let w=b[h],k=0;for(;z[k]!==w;)k++;if($.push(k),k>0){let B=z[k];for(let C=k;C>0;C--)z[C]=z[C-1];z[0]=B}}for(let h=0;h<p;h++){for(let w=0;w<$[h];w++)e.writeBit(1);e.writeBit(0)}for(let h=0;h<m;h++){let w=v[h].codeLengths,k=w[0];e.writeBits(5,k);for(let B=0;B<g;B++){let C=w[B];for(;k<C;)e.writeBit(1),e.writeBit(0),k++;for(;k>C;)e.writeBit(1),e.writeBit(1),k--;e.writeBit(0)}}for(let h=0;h<m;h++){let{codes:w,lengths:k}=kt(v[h].codeLengths,g);v[h]=Object.assign(v[h],{_codes:w,_lengths:k})}let he=0,R=0;for(let h=0;h<y;h++){(R===0||R>=d)&&(h>0&&he++,R=0);let w=b[he],k=v[w],B=u[h],C=k._lengths[B],M=k._codes[B];C>0&&e.writeBits(C,M),R++}}var Ct=10*1024*1024;function Le(e,t=9,i=Ct){if(t<1||t>9)throw new Error("Block size level must be 1-9");if(e.length>i)throw new Error(`Input too large for bzip2 compression (${e.length} bytes, max ${i})`);let r=t*1e5,n=new ie;n.writeBits(8,66),n.writeBits(8,90),n.writeBits(8,104),n.writeBits(8,48+t);let s=0,a=0;for(;a<e.length;){let o=Math.min(a+r,e.length),c=e.subarray(a,o),l=4294967295;for(let f=0;f<c.length;f++)l=gt(l,c[f]);l=~l>>>0,s=(s<<1|s>>>31)>>>0,s=(s^l)>>>0,zt(n,c,l),a=o}return n.writeBits(24,1536581),n.writeBits(24,3690640),n.writeBits(32,s),n.finish()}var X=null,Z=null;async function Me(){if(X)return X;if(Z)throw Z;try{return X=await Q.runTrustedAsync(()=>import("node-liblzma")),X}catch{throw Z=new Error("xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies."),Z}}var G=null,q=null;async function We(){if(G)return G;if(q)throw q;try{return G=await Q.runTrustedAsync(()=>import("@mongodb-js/zstd")),G}catch{throw q=new Error("zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd"),q}}var A=100*1024*1024,De=512,Re=1e4;function Et(e){let t="file";e.isDirectory?t="directory":e.isSymlink&&(t="symlink");let i=e.name;e.isDirectory&&!i.endsWith("/")&&(i+="/");let r;e.content!==void 0&&(typeof e.content=="string"?r=new TextEncoder().encode(e.content):r=e.content);let n=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:i,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:n,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??"",uname:"user",gname:"user"},body:r}}async function O(e){let t=e.map(Et);return Oe(t)}async function je(e){let t=await O(e),n=new ReadableStream({start(l){l.enqueue(t),l.close()}}).pipeThrough(Fe()).getReader(),s=[];for(;;){let{done:l,value:f}=await n.read();if(l)break;s.push(f)}let a=s.reduce((l,f)=>l+f.length,0),o=new Uint8Array(a),c=0;for(let l of s)o.set(l,c),c+=l.length;return o}async function F(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};if(e.length<De||e.length%De!==0)return{entries:[],error:"Invalid tar archive format"};try{let t=await Ue(e),i=[];for(let r of t){if(i.length>=Re)return{entries:i,error:`Too many entries (max ${Re})`};let n="file";switch(r.header.type){case"directory":n="directory";break;case"symlink":n="symlink";break;case"link":n="hardlink";break;case"file":n="file";break;default:n="other"}i.push({name:r.header.name,mode:r.header.mode??420,uid:r.header.uid??0,gid:r.header.gid??0,size:r.header.size,mtime:r.header.mtime??new Date,type:n,linkTarget:r.header.linkname||void 0,content:r.data??new Uint8Array(0)})}return{entries:i}}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function se(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let r=new ReadableStream({start(c){c.enqueue(e),c.close()}}).pipeThrough(Ie()).getReader(),n=[],s=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(s+=l.length,s>A)return await r.cancel(),{entries:[],error:`Decompressed archive too large (max ${A} bytes)`};n.push(l)}let a=new Uint8Array(s),o=0;for(let c of n)a.set(c,o),o+=c.length;return F(a)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:`Decompression failed: ${i}`}}}function oe(e){return e.length>=2&&e[0]===31&&e[1]===139}function ae(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function le(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function $t(e){let t=At.decode(Buffer.from(e));return new Uint8Array(t)}async function Bt(e){return Le(e,9)}async function Tt(e){let i=(await Me()).unxzSync(Buffer.from(e));return new Uint8Array(i)}async function St(e){let i=(await Me()).xzSync(Buffer.from(e));return new Uint8Array(i)}async function He(e){let t=await O(e);return Bt(t)}async function _e(e,t){if(!t?.allowNativeCodecs)throw new Error("xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return St(i)}async function ce(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let t=await $t(e);return t.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(t)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function fe(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await Tt(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function ue(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Ft(e){let i=await(await We()).compress(Buffer.from(e),3);return new Uint8Array(i)}async function It(e){let i=await(await We()).decompress(Buffer.from(e));return new Uint8Array(i)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw new Error("zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return Ft(i)}async function de(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await It(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function Ze(e){let t={create:!1,append:!1,update:!1,extract:!1,list:!1,file:"",autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:"",preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:"",excludeFrom:"",wildcards:!1},i=[],r=0;for(;r<e.length;){let n=e[r];if(n.startsWith("-")&&!n.startsWith("--")&&n.length>2){if(/^-\d+$/.test(n)){i.push(n),r++;continue}for(let s=1;s<n.length;s++){let a=n[s];switch(a){case"c":t.create=!0;break;case"r":t.append=!0;break;case"u":t.update=!0;break;case"x":t.extract=!0;break;case"t":t.list=!0;break;case"a":t.autoCompress=!0;break;case"z":t.gzip=!0;break;case"j":t.bzip2=!0;break;case"J":t.xz=!0;break;case"v":t.verbose=!0;break;case"O":t.toStdout=!0;break;case"k":t.keepOldFiles=!0;break;case"m":t.touch=!0;break;case"p":t.preserve=!0;break;case"P":t.absoluteNames=!0;break;case"f":if(s<n.length-1)t.file=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
5
+ `,exitCode:2}};t.file=e[r]}break;case"C":if(s<n.length-1)t.directory=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
6
+ `,exitCode:2}};t.directory=e[r]}break;case"T":if(s<n.length-1)t.filesFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
7
+ `,exitCode:2}};t.filesFrom=e[r]}break;case"X":if(s<n.length-1)t.excludeFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
8
+ `,exitCode:2}};t.excludeFrom=e[r]}break;default:return{ok:!1,error:ee("tar",`-${a}`)}}}r++;continue}if(n==="-c"||n==="--create")t.create=!0;else if(n==="-r"||n==="--append")t.append=!0;else if(n==="-u"||n==="--update")t.update=!0;else if(n==="-x"||n==="--extract"||n==="--get")t.extract=!0;else if(n==="-t"||n==="--list")t.list=!0;else if(n==="-a"||n==="--auto-compress")t.autoCompress=!0;else if(n==="-z"||n==="--gzip"||n==="--gunzip")t.gzip=!0;else if(n==="-j"||n==="--bzip2")t.bzip2=!0;else if(n==="-J"||n==="--xz")t.xz=!0;else if(n==="--zstd")t.zstd=!0;else if(n==="-v"||n==="--verbose")t.verbose=!0;else if(n==="-O"||n==="--to-stdout")t.toStdout=!0;else if(n==="-k"||n==="--keep-old-files")t.keepOldFiles=!0;else if(n==="-m"||n==="--touch")t.touch=!0;else if(n==="--wildcards")t.wildcards=!0;else if(n==="-p"||n==="--preserve"||n==="--preserve-permissions")t.preserve=!0;else if(n==="-P"||n==="--absolute-names")t.absoluteNames=!0;else if(n==="-f"||n==="--file"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
9
+ `,exitCode:2}};t.file=e[r]}else if(n.startsWith("--file="))t.file=n.substring(7);else if(n==="-C"||n==="--directory"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
10
+ `,exitCode:2}};t.directory=e[r]}else if(n.startsWith("--directory="))t.directory=n.substring(12);else if(n.startsWith("--strip-components=")||n.startsWith("--strip=")){let s=n.includes("--strip-components=")?n.substring(19):n.substring(8),a=parseInt(s,10);if(Number.isNaN(a)||a<0)return{ok:!1,error:{stdout:"",stderr:`tar: invalid number for --strip: '${s}'
11
+ `,exitCode:2}};t.strip=a}else if(n.startsWith("--exclude="))t.exclude.push(n.substring(10));else if(n==="--exclude"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option '--exclude' requires an argument
12
+ `,exitCode:2}};t.exclude.push(e[r])}else if(n==="-T"||n==="--files-from"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
13
+ `,exitCode:2}};t.filesFrom=e[r]}else if(n.startsWith("--files-from="))t.filesFrom=n.substring(13);else if(n==="-X"||n==="--exclude-from"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
14
+ `,exitCode:2}};t.excludeFrom=e[r]}else if(n.startsWith("--exclude-from="))t.excludeFrom=n.substring(15);else if(n==="--"){i.push(...e.slice(r+1));break}else{if(n.startsWith("-"))return{ok:!1,error:ee("tar",n)};i.push(n)}r++}return{ok:!0,options:t,files:i}}var Ge=100,Pt={name:"tar",summary:"manipulate tape archives",usage:"tar [options] [file...]",description:["Create, extract, or list contents of tar archives.","","One of -c, -r, -u, -x, or -t is required to specify the operation."],options:["-c, --create create a new archive","-r, --append append files to the end of an archive","-u, --update only append files newer than copy in archive","-x, --extract extract files from an archive","-t, --list list contents of an archive","-f, --file=ARCHIVE use archive file ARCHIVE","-a, --auto-compress use archive suffix to determine compression","-z, --gzip filter archive through gzip","-j, --bzip2 filter archive through bzip2","-J, --xz filter archive through xz","--zstd filter archive through zstd","-v, --verbose verbosely list files processed","-O, --to-stdout extract files to standard output","-k, --keep-old-files don't replace existing files when extracting","-m, --touch don't extract file modified time","-C, --directory=DIR change to directory DIR before performing operations","-p, --preserve preserve permissions","-P, --absolute-names do not strip leading '/' or block '..' paths","-T, --files-from=FILE read files to extract/create from FILE","-X, --exclude-from=FILE read exclude patterns from FILE","--strip=N strip N leading path components on extraction","--exclude=PATTERN exclude files matching PATTERN","--wildcards use wildcards for pattern matching"," --help display this help and exit"],examples:["tar -cvf archive.tar file1 file2 Create archive from files","tar -czvf archive.tar.gz dir/ Create gzip-compressed archive","tar -cjvf archive.tar.bz2 dir/ Create bzip2-compressed archive","tar -rf archive.tar newfile.txt Append file to archive","tar -uf archive.tar dir/ Update archive with newer files","tar -xvf archive.tar Extract archive","tar -xvf archive.tar -C /tmp Extract to /tmp","tar -tvf archive.tar List archive contents","tar -xzf archive.tar.gz Extract gzip archive","tar -xf archive.tar file1.txt Extract specific file","tar -xOf archive.tar file.txt Extract file to stdout","tar -xf archive.tar --wildcards '*.txt' Extract matching files"]};function me(e,t){let i=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;for(let r of t){let n=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,".");if(U(`^${n}$`).test(e)||U(`^${n}/`).test(e)||!r.includes("/")&&U(`^${n}$`).test(i))return!0}return!1}function Y(e,t){let i=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,"."),r=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;return U(`^${i}$`).test(e)||U(`^${i}$`).test(r)}function qe(e,t){if(t<=0)return e;let i=e.split("/").filter(r=>r!=="");return i.length<=t?"":i.slice(t).join("/")}function Ye(e){return e.split("/").some(t=>t==="..")}function Ot(e,t){if(t)return{safePath:e};let i=e.replace(/^\/+/,"");return i.length===0?{safePath:""}:Ye(i)?{error:"Path contains '..'"}:{safePath:i}}function Ut(e){let i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],r=e.getDate().toString().padStart(2," "),n=e.getHours().toString().padStart(2,"0"),s=e.getMinutes().toString().padStart(2,"0");return`${i} ${r} ${n}:${s}`}async function K(e,t,i,r){let n=[],s=[],a=e.fs.resolvePath(t,i);try{let o=await e.fs.stat(a);if(me(i,r))return{entries:n,errors:s};if(o.isDirectory){n.push({name:i,isDirectory:!0,mode:o.mode,mtime:o.mtime});let c=await e.fs.readdir(a);for(let l=0;l<c.length;l+=Ge){let f=c.slice(l,l+Ge),u=await Promise.all(f.map(y=>K(e,t,i?`${i}/${y}`:y,r)));for(let y of u)n.push(...y.entries),s.push(...y.errors)}}else if(o.isFile){let c=await e.fs.readFileBuffer(a);n.push({name:i,content:c,mode:o.mode,mtime:o.mtime})}else if(o.isSymbolicLink){let c=await e.fs.readlink(a);n.push({name:i,isSymlink:!0,linkTarget:c,mode:o.mode,mtime:o.mtime})}}catch(o){let c=o instanceof Error?o.message:"unknown error";s.push(`tar: ${i}: ${c}`)}return{entries:n,errors:s}}async function Nt(e,t,i){if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to create an empty archive
15
+ `,exitCode:2};let r=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,n=[],s=[],a="";for(let f of i){let{entries:u,errors:y}=await K(e,r,f,t.exclude);if(n.push(...u),s.push(...y),t.verbose)for(let g of u)a+=`${g.name}${g.isDirectory?"/":""}
16
+ `}if(n.length===0&&s.length>0)return{stdout:"",stderr:`${s.join(`
17
+ `)}
18
+ `,exitCode:2};let o;try{t.gzip?o=await je(n):t.bzip2?o=await He(n):t.xz?o=await _e(n):t.zstd?o=await Xe(n):o=await O(n)}catch(f){return{stdout:"",stderr:`tar: error creating archive: ${f instanceof Error?f.message:"unknown error"}
19
+ `,exitCode:2}}let c="";if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(f,o)}catch(u){let y=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${y}
20
+ `,exitCode:2}}}else c=Buffer.from(o).toString("latin1");let l=a;return s.length>0&&(l+=`${s.join(`
21
+ `)}
22
+ `),{stdout:c,stderr:l,exitCode:s.length>0?2:0,stdoutKind:c.length>0?"bytes":"text"}}async function Lt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
23
+ `,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to append nothing to archive
24
+ `,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
25
+ `,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
26
+ `,exitCode:2};let a=s.entries.map(d=>({name:d.name,content:d.content,mode:d.mode,mtime:d.mtime,isDirectory:d.type==="directory",isSymlink:d.type==="symlink",linkTarget:d.linkTarget,uid:d.uid,gid:d.gid})),o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let d of i){let{entries:p,errors:m}=await K(e,o,d,t.exclude);if(c.push(...p),l.push(...m),t.verbose)for(let x of p)f+=`${x.name}${x.isDirectory?"/":""}
27
+ `}let u=[...a,...c],y;try{y=await O(u)}catch(d){return{stdout:"",stderr:`tar: error creating archive: ${d instanceof Error?d.message:"unknown error"}
28
+ `,exitCode:2}}try{await e.fs.writeFile(r,y)}catch(d){let p=d instanceof Error?d.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${p}
29
+ `,exitCode:2}}let g=f;return l.length>0&&(g+=`${l.join(`
30
+ `)}
31
+ `),{stdout:"",stderr:g,exitCode:l.length>0?2:0}}async function Dt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot update stdin/stdout
32
+ `,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to update with nothing
33
+ `,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
34
+ `,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
35
+ `,exitCode:2};let a=new Map;for(let m of s.entries)a.set(m.name,m.mtime);let o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let m of i){let{entries:x,errors:b}=await K(e,o,m,t.exclude);l.push(...b);for(let E of x){let v=a.get(E.name);(!v||E.mtime&&E.mtime.getTime()>v.getTime())&&(c.push(E),t.verbose&&(f+=`${E.name}${E.isDirectory?"/":""}
36
+ `))}}if(c.length===0){let m="";return l.length>0&&(m=`${l.join(`
37
+ `)}
38
+ `),{stdout:"",stderr:m,exitCode:l.length>0?2:0}}let u=new Set(c.map(m=>m.name)),g=[...s.entries.filter(m=>!u.has(m.name)).map(m=>({name:m.name,content:m.content,mode:m.mode,mtime:m.mtime,isDirectory:m.type==="directory",isSymlink:m.type==="symlink",linkTarget:m.linkTarget,uid:m.uid,gid:m.gid})),...c],d;try{d=await O(g)}catch(m){return{stdout:"",stderr:`tar: error creating archive: ${m instanceof Error?m.message:"unknown error"}
39
+ `,exitCode:2}}try{await e.fs.writeFile(r,d)}catch(m){let x=m instanceof Error?m.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${x}
40
+ `,exitCode:2}}let p=f;return l.length>0&&(p+=`${l.join(`
41
+ `)}
42
+ `),{stdout:"",stderr:p,exitCode:l.length>0?2:0}}async function Rt(e,t,i){let r;if(t.file&&t.file!=="-"){let p=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(p)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
43
+ `,exitCode:2}}}else r=Uint8Array.from(e.stdin,p=>p.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
44
+ `,exitCode:2};let l=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,f=t.absoluteNames?i:i.map(p=>p.replace(/^\/+/,"")).filter(p=>p.length>0),u="",y="",g=[];if(t.directory&&!t.toStdout)try{await e.fs.mkdir(l,{recursive:!0})}catch{}for(let p of n.entries){let m=qe(p.name,t.strip);if(!m)continue;let x=Ot(m,t.absoluteNames);if(x.error){g.push(`tar: ${m}: ${x.error}`);continue}let b=x.safePath??"";if(!b)continue;let E=b.endsWith("/")?b.slice(0,-1):b;if(f.length>0){let $;if(t.wildcards?$=f.some(z=>Y(b,z)||Y(E,z)||b.startsWith(`${z}/`)):$=f.some(z=>b===z||b.startsWith(`${z}/`)||E===z),!$)continue}if(me(b,t.exclude))continue;let v=e.fs.resolvePath(l,b);try{if(p.type==="directory"){if(t.toStdout)continue;await e.fs.mkdir(v,{recursive:!0}),t.verbose&&(u+=`${b}
45
+ `)}else if(p.type==="file"){if(t.toStdout){y+=new TextDecoder().decode(p.content),t.verbose&&(u+=`${b}
46
+ `);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists
47
+ `);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}if(await e.fs.writeFile(v,p.content),t.preserve&&p.mode)try{await e.fs.chmod(v,p.mode)}catch{}t.verbose&&(u+=`${b}
48
+ `)}else if(p.type==="symlink"&&p.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(p.linkTarget.startsWith("/")||Ye(p.linkTarget))){g.push(`tar: ${b}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists
49
+ `);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}try{await e.fs.symlink(p.linkTarget,v)}catch{}t.verbose&&(u+=`${b}
50
+ `)}}catch($){let z=$ instanceof Error?$.message:"unknown error";g.push(`tar: ${b}: ${z}`)}}let d=u;return g.length>0&&(d+=`${g.join(`
51
+ `)}
52
+ `),{stdout:y,stderr:d,exitCode:g.length>0?2:0}}async function Mt(e,t,i){let r;if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
53
+ `,exitCode:2}}}else r=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
54
+ `,exitCode:2};let l="";for(let f of n.entries){let u=qe(f.name,t.strip);if(!u)continue;let y=u.endsWith("/")?u.slice(0,-1):u;if(i.length>0){let g;if(t.wildcards?g=i.some(d=>Y(u,d)||Y(y,d)||u.startsWith(`${d}/`)):g=i.some(d=>u===d||u.startsWith(`${d}/`)||y===d),!g)continue}if(!me(u,t.exclude))if(t.verbose){let g=f.type==="directory",d=ye(f.mode,g),p=`${f.uid}/${f.gid}`,m=f.size.toString().padStart(8," "),x=Ut(f.mtime),b=`${d} ${p.padEnd(10)} ${m} ${x} ${u}`;f.type==="symlink"&&f.linkTarget&&(b+=` -> ${f.linkTarget}`),l+=`${b}
55
+ `}else l+=`${u}
56
+ `}return{stdout:l,stderr:"",exitCode:0}}var sr={name:"tar",async execute(e,t){if(ge(e))return pe(Pt);let i=Ze(e);if(!i.ok)return i.error;let{options:r,files:n}=i,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
57
+ `,exitCode:2};if(s>1)return{stdout:"",stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
58
+ `,exitCode:2};if(r.autoCompress&&r.file&&r.create){let c=r.file.toLowerCase();c.endsWith(".tar.gz")||c.endsWith(".tgz")?r.gzip=!0:c.endsWith(".tar.bz2")||c.endsWith(".tbz2")?r.bzip2=!0:c.endsWith(".tar.xz")||c.endsWith(".txz")?r.xz=!0:(c.endsWith(".tar.zst")||c.endsWith(".tzst"))&&(r.zstd=!0)}let a=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(a>1)return{stdout:"",stderr:`tar: You may not specify more than one compression option
59
+ `,exitCode:2};if((r.append||r.update)&&a>0)return{stdout:"",stderr:`tar: Cannot append/update compressed archives - decompress first
60
+ `,exitCode:2};let o=n;if(r.filesFrom){let c=t.fs.resolvePath(t.cwd,r.filesFrom);try{let f=(await t.fs.readFile(c)).split(`
61
+ `).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));o=[...n,...f]}catch{return{stdout:"",stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory
62
+ `,exitCode:2}}}if(r.excludeFrom){let c=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let f=(await t.fs.readFile(c)).split(`
63
+ `).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));r.exclude.push(...f)}catch{return{stdout:"",stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory
64
+ `,exitCode:2}}}return r.create?Nt(t,r,o):r.append?Lt(t,r,o):r.update?Dt(t,r,o):r.extract?Rt(t,r,o):Mt(t,r,o)}},or={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{sr as a,or as b};
@@ -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 d}from"./chunk-VZK4FHWJ.js";import{a as f,b as c,c as u}from"./chunk-MUFNRCMY.js";var x={name:"expand",summary:"convert tabs to spaces",usage:"expand [OPTION]... [FILE]...",description:"Convert TABs in each FILE to spaces, writing to standard output. If no FILE is specified, standard input is read.",options:["-t N Use N spaces per tab (default: 8)","-t LIST Use comma-separated list of tab stops","-i Only convert leading tabs on each line"],examples:["expand file.txt # Convert all tabs to 8 spaces","expand -t 4 file.txt # Use 4-space tabs","expand -t 4,8,12 file.txt # Custom tab stops"]};function p(n){let i=n.split(",").map(o=>o.trim()),t=[];for(let o of i){let e=parseInt(o,10);if(Number.isNaN(e)||e<1)return null;t.push(e)}for(let o=1;o<t.length;o++)if(t[o]<=t[o-1])return null;return t}function g(n,i){if(i.length===1){let t=i[0];return t-n%t}for(let t of i)if(t>n)return t-n;if(i.length>=2){let t=i[i.length-1]-i[i.length-2],o=i[i.length-1],e=Math.floor((n-o)/t)+1;return o+e*t-n}return 1}function b(n,i){let{tabStops:t,leadingOnly:o}=i,e="",r=0,s=!0;for(let a of n)if(a===" ")if(o&&!s)e+=a,r++;else{let l=g(r,t);e+=" ".repeat(l),r+=l}else a!==" "&&a!==" "&&(s=!1),e+=a,r++;return e}function h(n,i){if(n==="")return"";let t=n.split(`
4
+ `),o=n.endsWith(`
5
+ `)&&t[t.length-1]==="";return o&&t.pop(),t.map(r=>b(r,i)).join(`
6
+ `)+(o?`
7
+ `:"")}var y={name:"expand",execute:async(n,i)=>{if(c(n))return f(x);let t={tabStops:[8],leadingOnly:!1},o=[],e=0;for(;e<n.length;){let s=n[e];if(s==="-t"&&e+1<n.length){let a=p(n[e+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${n[e+1]}'
8
+ `};t.tabStops=a,e+=2}else if(s.startsWith("-t")&&s.length>2){let a=p(s.slice(2));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${s.slice(2)}'
9
+ `};t.tabStops=a,e++}else if(s==="--tabs"&&e+1<n.length){let a=p(n[e+1]);if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${n[e+1]}'
10
+ `};t.tabStops=a,e+=2}else if(s.startsWith("--tabs=")){let a=p(s.slice(7));if(!a)return{exitCode:1,stdout:"",stderr:`expand: invalid tab size: '${s.slice(7)}'
11
+ `};t.tabStops=a,e++}else if(s==="-i"||s==="--initial")t.leadingOnly=!0,e++;else if(s==="--"){o.push(...n.slice(e+1));break}else{if(s.startsWith("-")&&s!=="-")return u("expand",s);o.push(s),e++}}let r="";if(o.length===0){let s=d(i.stdin)??"";r=h(s,t)}else for(let s of o){let a=i.fs.resolvePath(i.cwd,s),l=await i.fs.readFile(a);if(l===null)return{exitCode:1,stdout:r,stderr:`expand: ${s}: No such file or directory
12
+ `};r+=h(l,t)}return{exitCode:0,stdout:r,stderr:""}}},C={name:"expand",flags:[{flag:"-t",type:"value",valueHint:"number"},{flag:"-i",type:"boolean"}],stdinType:"text",needsFiles:!0};export{y as a,C 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 i}from"./chunk-BIJXTWZ4.js";import{a as u}from"./chunk-NE4R2FVV.js";import{a as g,b as m}from"./chunk-MUFNRCMY.js";var S={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},$={format:{short:"c",type:"string"}},A={name:"stat",async execute(n,a){if(m(n))return g(S);let o=u("stat",n,$);if(!o.ok)return o.error;let c=o.result.flags.format??null,f=o.result.positional;if(f.length===0)return{stdout:"",stderr:`stat: missing operand
4
+ `,exitCode:1};let r="",p="",d=!1;for(let s of f){let h=a.fs.resolvePath(a.cwd,s);try{let e=await a.fs.stat(h);if(c){let t=c,l=e.mode.toString(8),y=i(e.mode,e.isDirectory);t=t.replace(/%n/g,s),t=t.replace(/%N/g,`'${s}'`),t=t.replace(/%s/g,String(e.size)),t=t.replace(/%F/g,e.isDirectory?"directory":"regular file"),t=t.replace(/%a/g,l),t=t.replace(/%A/g,y),t=t.replace(/%u/g,"1000"),t=t.replace(/%U/g,"user"),t=t.replace(/%g/g,"1000"),t=t.replace(/%G/g,"group"),r+=`${t}
5
+ `}else{let t=e.mode.toString(8).padStart(4,"0"),l=i(e.mode,e.isDirectory);r+=` File: ${s}
6
+ `,r+=` Size: ${e.size} Blocks: ${Math.ceil(e.size/512)}
7
+ `,r+=`Access: (${t}/${l})
8
+ `,r+=`Modify: ${e.mtime.toISOString()}
9
+ `}}catch{p+=`stat: cannot stat '${s}': No such file or directory
10
+ `,d=!0}}return{stdout:r,stderr:p,exitCode:d?1:0}}},M={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{A as a,M as b};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ var n=class extends Error{stdout;stderr;constructor(t,e="",s=""){super(t),this.stdout=e,this.stderr=s}prependOutput(t,e){this.stdout=t+this.stdout,this.stderr=e+this.stderr}},c=class extends n{levels;name="BreakError";constructor(t=1,e="",s=""){super("break",e,s),this.levels=t}},a=class extends n{levels;name="ContinueError";constructor(t=1,e="",s=""){super("continue",e,s),this.levels=t}},i=class extends n{exitCode;name="ReturnError";constructor(t=0,e="",s=""){super("return",e,s),this.exitCode=t}},u=class extends n{exitCode;name="ErrexitError";constructor(t,e="",s=""){super(`errexit: command exited with status ${t}`,e,s),this.exitCode=t}},x=class extends n{varName;name="NounsetError";constructor(t,e=""){super(`${t}: unbound variable`,e,`bash: ${t}: unbound variable
4
+ `),this.varName=t}},d=class extends n{exitCode;name="ExitError";constructor(t,e="",s=""){super("exit",e,s),this.exitCode=t}},p=class extends n{name="ArithmeticError";fatal;constructor(t,e="",s="",o=!1){super(t,e,s),this.stderr=s||`bash: ${t}
5
+ `,this.fatal=o}},l=class extends n{name="BadSubstitutionError";constructor(t,e="",s=""){super(t,e,s),this.stderr=s||`bash: ${t}: bad substitution
6
+ `}},h=class extends n{name="GlobError";constructor(t,e="",s=""){super(`no match: ${t}`,e,s),this.stderr=s||`bash: no match: ${t}
7
+ `}},m=class extends n{name="BraceExpansionError";constructor(t,e="",s=""){super(t,e,s),this.stderr=s||`bash: ${t}
8
+ `}},b=class extends n{limitType;name="ExecutionLimitError";static EXIT_CODE=126;constructor(t,e,s="",o=""){super(t,s,o),this.limitType=e,this.stderr=o||`bash: ${t}
9
+ `}},f=class extends n{name="ExecutionAbortedError";constructor(t="",e=""){super("execution aborted",t,e)}},C=class extends n{name="SubshellExitError";constructor(t="",e=""){super("subshell exit",t,e)}},$=class extends n{exitCode;name="BuiltinFatalError";constructor(t,e="",s=""){super("builtin fatal error",e,s),this.exitCode=t}};function E(r){return r instanceof c||r instanceof a||r instanceof i}var v=class extends n{exitCode;name="PosixFatalError";constructor(t,e="",s=""){super("posix fatal error",e,s),this.exitCode=t}};export{c as a,a as b,i as c,u as d,x as e,d as f,p as g,l as h,h as i,m as j,b as k,f as l,C as m,$ as n,E as o,v as p};
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ import{a as j,b as y}from"./chunk-VZK4FHWJ.js";import{a as g,b as v,c as F}from"./chunk-MUFNRCMY.js";var N={name:"join",summary:"join lines of two files on a common field",usage:"join [OPTION]... FILE1 FILE2",description:"For each pair of input lines with identical join fields, write a line to standard output. The default join field is the first, delimited by blanks.",options:["-1 FIELD Join on this FIELD of file 1 (default: 1)","-2 FIELD Join on this FIELD of file 2 (default: 1)","-t CHAR Use CHAR as input and output field separator","-a FILENUM Also print unpairable lines from file FILENUM (1 or 2)","-v FILENUM Like -a but only output unpairable lines","-e STRING Replace missing fields with STRING","-o FORMAT Output format (comma-separated list of FILENUM.FIELD)","-i Ignore case when comparing fields"],examples:["join file1 file2 # Join on first field","join -1 2 -2 1 file1 file2 # Join file1 col 2 with file2 col 1","join -t ',' file1.csv file2.csv # Join CSV files","join -a 1 file1 file2 # Left outer join"]};function I(i,s){return s?i.split(s):i.split(/[ \t]+/).filter(n=>n.length>0)}function L(i,s,n,f){let e=I(i,s),r=e[n-1]??"";return f&&(r=r.toLowerCase()),{fields:e,joinKey:r,original:i}}function m(i,s,n){let f=n.separator??" ";if(n.outputFormat){let l=[];for(let{file:c,field:p}of n.outputFormat){let a=c===1?i:s;a&&p===0?l.push(a.joinKey):a&&a.fields[p-1]!==void 0?l.push(a.fields[p-1]):l.push(n.emptyString)}return l.join(f)}let e=[],r=i?.joinKey??s?.joinKey??"";if(e.push(r),i)for(let l=0;l<i.fields.length;l++)l!==n.field1-1&&e.push(i.fields[l]);if(s)for(let l=0;l<s.fields.length;l++)l!==n.field2-1&&e.push(s.fields[l]);return e.join(f)}function U(i){let s=i.split(","),n=[];for(let f of s){let e=f.trim().match(/^(\d+)\.(\d+)$/);if(!e)return null;let r=Number.parseInt(e[1],10),l=Number.parseInt(e[2],10);if(r!==1&&r!==2)return null;n.push({file:r,field:l})}return n}var E={name:"join",execute:async(i,s)=>{if(v(i))return g(N);let n={field1:1,field2:1,separator:null,printUnpairable:new Set,onlyUnpairable:new Set,emptyString:"",outputFormat:null,ignoreCase:!1},f=[],e=0;for(;e<i.length;){let t=i[e];if(t==="-1"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
4
+ `};n.field1=o,e+=2}else if(t==="-2"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(Number.isNaN(o)||o<1)return{exitCode:1,stdout:"",stderr:`join: invalid field number: '${i[e+1]}'
5
+ `};n.field2=o,e+=2}else if((t==="-t"||t==="--field-separator")&&e+1<i.length)n.separator=i[e+1],e+=2;else if(t.startsWith("-t")&&t.length>2)n.separator=t.slice(2),e++;else if(t==="-a"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
6
+ `};n.printUnpairable.add(o),e+=2}else if(t.match(/^-a[12]$/))n.printUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-v"&&e+1<i.length){let o=Number.parseInt(i[e+1],10);if(o!==1&&o!==2)return{exitCode:1,stdout:"",stderr:`join: invalid file number: '${i[e+1]}'
7
+ `};n.onlyUnpairable.add(o),e+=2}else if(t.match(/^-v[12]$/))n.onlyUnpairable.add(Number.parseInt(t[2],10)),e++;else if(t==="-e"&&e+1<i.length)n.emptyString=i[e+1],e+=2;else if(t==="-o"&&e+1<i.length){let o=U(i[e+1]);if(!o)return{exitCode:1,stdout:"",stderr:`join: invalid field spec: '${i[e+1]}'
8
+ `};n.outputFormat=o,e+=2}else if(t==="-i"||t==="--ignore-case")n.ignoreCase=!0,e++;else if(t==="--"){f.push(...i.slice(e+1));break}else{if(t.startsWith("-")&&t!=="-")return F("join",t);f.push(t),e++}}if(f.length!==2)return{exitCode:1,stdout:"",stderr:f.length<2?`join: missing file operand
9
+ `:`join: extra operand
10
+ `};let r=[];for(let t of f)if(t==="-")r.push(j(s.stdin)??"");else{let o=s.fs.resolvePath(s.cwd,t),u=await s.fs.readFile(o);if(u===null)return{exitCode:1,stdout:"",stderr:`join: ${t}: No such file or directory
11
+ `};r.push(u)}let l=(t,o)=>{let u=t.split(`
12
+ `);return t.endsWith(`
13
+ `)&&u[u.length-1]===""&&u.pop(),u.filter(h=>h.length>0).map(h=>L(h,n.separator,o,n.ignoreCase))},c=l(r[0],n.field1),p=l(r[1],n.field2),a=new Map;for(let t of p){let o=a.get(t.joinKey);o?o.push(t):a.set(t.joinKey,[t])}let d=[],b=new Set;for(let t of c){let o=a.get(t.joinKey);if(o&&o.length>0){if(b.add(t.joinKey),n.onlyUnpairable.size===0)for(let u of o)d.push(m(t,u,n))}else(n.printUnpairable.has(1)||n.onlyUnpairable.has(1))&&d.push(m(t,null,n))}if(n.printUnpairable.has(2)||n.onlyUnpairable.has(2))for(let t of p)b.has(t.joinKey)||d.push(m(null,t,n));return{exitCode:0,stdout:y(d.length>0?`${d.join(`
14
+ `)}
15
+ `:""),stderr:"",stdoutEncoding:"binary"}}},H={name:"join",flags:[{flag:"-1",type:"value",valueHint:"number"},{flag:"-2",type:"value",valueHint:"number"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-a",type:"value",valueHint:"number"},{flag:"-v",type:"value",valueHint:"number"},{flag:"-e",type:"value",valueHint:"string"},{flag:"-o",type:"value",valueHint:"format"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,H as b};