@eidos.space/just-bash 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/bin/chunks/{awk2-RLMNTGI7.js → awk2-M5P56WFW.js} +1 -1
  3. package/dist/bin/{shell/chunks/base64-RZRLGMB3.js → chunks/base64-3BBQMQBD.js} +1 -1
  4. package/dist/bin/{shell/chunks/bash-CLP24TE2.js → chunks/bash-JOHLB5EM.js} +1 -1
  5. package/dist/bin/{shell/chunks/cat-LQH5FSAR.js → chunks/cat-QS3FUD2R.js} +1 -1
  6. package/dist/bin/chunks/{chunk-L24QXM5S.js → chunk-2AUW2OVD.js} +1 -1
  7. package/dist/bin/chunks/{chunk-EDTBGO7F.js → chunk-3ERCSYXB.js} +1 -1
  8. package/dist/bin/{shell/chunks/chunk-X4MX6EHF.js → chunks/chunk-46EFQINR.js} +1 -1
  9. package/dist/bin/chunks/{chunk-7NC4CPHS.js → chunk-4HZ2J7WU.js} +1 -1
  10. package/dist/bin/{shell/chunks/chunk-UO5LOD7U.js → chunks/chunk-4J4HK3AP.js} +1 -1
  11. package/dist/bin/chunks/{chunk-PAYQNSZN.js → chunk-4TKEQ5JF.js} +1 -1
  12. package/dist/bin/chunks/{chunk-V2RP73X4.js → chunk-4TZMT56V.js} +1 -1
  13. package/dist/bin/chunks/{chunk-F3GKANW3.js → chunk-5MAZXOIE.js} +1 -1
  14. package/dist/bin/{shell/chunks/chunk-6FSBHK6H.js → chunks/chunk-6CMV7VZ7.js} +1 -1
  15. package/dist/bin/chunks/{chunk-FVRXEJYQ.js → chunk-7X6QFILN.js} +2 -2
  16. package/dist/bin/{shell/chunks/chunk-2SVX7I5P.js → chunks/chunk-A66SLDOH.js} +1 -1
  17. package/dist/bin/{shell/chunks/chunk-Q4UMTSRO.js → chunks/chunk-AIE46WV2.js} +1 -1
  18. package/dist/bin/chunks/{chunk-VBDLSL7Y.js → chunk-CVDY2PJ2.js} +1 -1
  19. package/dist/bin/{shell/chunks/chunk-H7JTIXAO.js → chunks/chunk-DSS5HVJD.js} +1 -1
  20. package/dist/bin/{shell/chunks/chunk-M65CQLJE.js → chunks/chunk-E2TTMLYF.js} +1 -1
  21. package/dist/bin/{shell/chunks/chunk-HN2DCT7T.js → chunks/chunk-E35XCU6G.js} +1 -1
  22. package/dist/bin/chunks/{chunk-JZW7NFK2.js → chunk-EVVJUFZE.js} +1 -1
  23. package/dist/bin/{shell/chunks/chunk-C7ISPH7Y.js → chunks/chunk-FKCULB5D.js} +1 -1
  24. package/dist/bin/chunks/{chunk-YY5PJR7O.js → chunk-G5P37XAS.js} +1 -1
  25. package/dist/bin/{shell/chunks/chunk-CAZ75E7E.js → chunks/chunk-IAGQA4VJ.js} +1 -1
  26. package/dist/bin/chunks/{chunk-22HCD466.js → chunk-JARRTDRA.js} +1 -1
  27. package/dist/bin/chunks/{chunk-JNUX75OX.js → chunk-JW42N6DP.js} +1 -1
  28. package/dist/bin/{shell/chunks/chunk-7UU7KPEM.js → chunks/chunk-LLC5H7UY.js} +1 -1
  29. package/dist/bin/{shell/chunks/chunk-NXVG64T3.js → chunks/chunk-MMSWVFQQ.js} +1 -1
  30. package/dist/bin/chunks/{chunk-2NRAWO6E.js → chunk-MQIPLKAA.js} +1 -1
  31. package/dist/bin/chunks/{chunk-YOKQNNQO.js → chunk-NK4UMOPJ.js} +1 -1
  32. package/dist/bin/{shell/chunks/chunk-OPMLWMNH.js → chunks/chunk-OUWMQLWU.js} +1 -1
  33. package/dist/bin/chunks/{chunk-KFMPGSUT.js → chunk-PEI4ZGEQ.js} +1 -1
  34. package/dist/bin/{shell/chunks/chunk-7AYT3UKI.js → chunks/chunk-PNPB62GH.js} +1 -1
  35. package/dist/bin/chunks/chunk-PUSAQWLR.js +3 -0
  36. package/dist/bin/chunks/{chunk-LAHBP3FW.js → chunk-QMRTESE5.js} +1 -1
  37. package/dist/bin/{shell/chunks/chunk-IZGLHVBB.js → chunks/chunk-RGDGVTPT.js} +1 -1
  38. package/dist/bin/chunks/{chunk-FKVQZWJQ.js → chunk-TO6JCMLQ.js} +1 -1
  39. package/dist/bin/{shell/chunks/chunk-F3WNDKOC.js → chunks/chunk-TVCXF3IW.js} +1 -1
  40. package/dist/bin/chunks/{chunk-J7TUF2VI.js → chunk-V2CUST2J.js} +1 -1
  41. package/dist/bin/{shell/chunks/chunk-XJ37N3S5.js → chunks/chunk-VZTJXRFX.js} +1 -1
  42. package/dist/bin/chunks/{column-AQB3A3PJ.js → column-W6LUR2XZ.js} +1 -1
  43. package/dist/bin/{shell/chunks/comm-Q4VDF6ZO.js → chunks/comm-YSS52S62.js} +1 -1
  44. package/dist/bin/chunks/{cut-ZI2HIAW7.js → cut-VWMTH3YP.js} +1 -1
  45. package/dist/bin/{shell/chunks/diff-YDJ42RKS.js → chunks/diff-E5JNYAA2.js} +1 -1
  46. package/dist/bin/chunks/{env-NY32PQJM.js → env-S6XWV5SK.js} +1 -1
  47. package/dist/bin/chunks/{expand-YYSO35NS.js → expand-AIAYIGRW.js} +1 -1
  48. package/dist/bin/chunks/{flag-coverage-RFKIBJ6L.js → flag-coverage-AIBITXZA.js} +1 -1
  49. package/dist/bin/{shell/chunks/fold-5MF7QZWQ.js → chunks/fold-4X7TIQ32.js} +1 -1
  50. package/dist/bin/chunks/{grep-VAYCFO4O.js → grep-7KM7ZRPL.js} +1 -1
  51. package/dist/bin/chunks/{gzip-UGBQQKIH.js → gzip-UUURHQYK.js} +1 -1
  52. package/dist/bin/chunks/{head-QNC2ZYDO.js → head-2NYUMA2U.js} +1 -1
  53. package/dist/bin/{shell/chunks/html-to-markdown-QEFY7XQR.js → chunks/html-to-markdown-TOIJDAT5.js} +1 -1
  54. package/dist/bin/{shell/chunks/join-EJ73DYTK.js → chunks/join-W23T6UW4.js} +1 -1
  55. package/dist/bin/chunks/{jq-GGTKKMEN.js → jq-PG5TWARX.js} +1 -1
  56. package/dist/bin/chunks/{js-exec-BC6NI55L.js → js-exec-YLOWUQR4.js} +1 -1
  57. package/dist/bin/chunks/{md5sum-MCVDIB35.js → md5sum-XTC5HSJD.js} +1 -1
  58. package/dist/bin/chunks/{nl-KUPLVCTS.js → nl-7NAYBH24.js} +1 -1
  59. package/dist/bin/chunks/{od-YQ5ZUI2H.js → od-BGNLMPXW.js} +1 -1
  60. package/dist/bin/{shell/chunks/paste-A5KKPWXX.js → chunks/paste-KM6YEJO3.js} +1 -1
  61. package/dist/bin/chunks/{python3-BQWDPUBM.js → python3-ABK6N2Y5.js} +1 -1
  62. package/dist/bin/chunks/{rev-PYHOZ4D4.js → rev-YHIGUK3P.js} +1 -1
  63. package/dist/bin/chunks/{rg-BGFMSIVK.js → rg-6FON3TGH.js} +1 -1
  64. package/dist/bin/chunks/{sed-FWA634SN.js → sed-LHKUKSBN.js} +1 -1
  65. package/dist/bin/chunks/{sha1sum-4KF52U3Y.js → sha1sum-VW2AMMXS.js} +1 -1
  66. package/dist/bin/chunks/{sha256sum-6YEPULPX.js → sha256sum-7O5NHH7H.js} +1 -1
  67. package/dist/bin/chunks/{sort-4C6WOKNK.js → sort-3BIIXAER.js} +1 -1
  68. package/dist/bin/chunks/{split-TV7NL7LA.js → split-3DTOTWCO.js} +1 -1
  69. package/dist/bin/chunks/{sqlite3-W777NCI4.js → sqlite3-AUZE77IO.js} +1 -1
  70. package/dist/bin/chunks/{strings-MDD72LR6.js → strings-LQXARN54.js} +1 -1
  71. package/dist/bin/{shell/chunks/tac-C2N4NQ6S.js → chunks/tac-24IIWF3C.js} +1 -1
  72. package/dist/bin/chunks/{tail-BCB5W6JC.js → tail-5BYXLCVJ.js} +1 -1
  73. package/dist/bin/chunks/{tar-DOO744MK.js → tar-PEHGL2NT.js} +1 -1
  74. package/dist/bin/chunks/{tee-UQHPO4OW.js → tee-CPC2RSEW.js} +1 -1
  75. package/dist/bin/chunks/{time-ZPY52VT2.js → time-7GPZMM6F.js} +1 -1
  76. package/dist/bin/chunks/{timeout-5AX3ZS3X.js → timeout-B2L3MWOL.js} +1 -1
  77. package/dist/bin/chunks/{tr-G7K6M6HP.js → tr-SGANQH42.js} +1 -1
  78. package/dist/bin/chunks/{unexpand-QIR4EDPG.js → unexpand-7TJPGTBZ.js} +1 -1
  79. package/dist/bin/chunks/{uniq-I7PVFJR4.js → uniq-VH2XX4GT.js} +1 -1
  80. package/dist/bin/{shell/chunks/wc-6NGWULAP.js → chunks/wc-LGTZO4AP.js} +1 -1
  81. package/dist/bin/chunks/{xan-KX4VPXUN.js → xan-I5ZN33WB.js} +1 -1
  82. package/dist/bin/chunks/{xan-view-JXOZLJ7S.js → xan-view-UGYNQULV.js} +1 -1
  83. package/dist/bin/chunks/{xargs-UWHPYLY7.js → xargs-2NR5N6L3.js} +1 -1
  84. package/dist/bin/chunks/{yq-GCDCJBKB.js → yq-3EZZPCM2.js} +1 -1
  85. package/dist/bin/just-bash.js +72 -72
  86. package/dist/bin/shell/chunks/{awk2-RLMNTGI7.js → awk2-M5P56WFW.js} +1 -1
  87. package/dist/bin/{chunks/base64-RZRLGMB3.js → shell/chunks/base64-3BBQMQBD.js} +1 -1
  88. package/dist/bin/{chunks/bash-CLP24TE2.js → shell/chunks/bash-JOHLB5EM.js} +1 -1
  89. package/dist/bin/{chunks/cat-LQH5FSAR.js → shell/chunks/cat-QS3FUD2R.js} +1 -1
  90. package/dist/bin/shell/chunks/{chunk-L24QXM5S.js → chunk-2AUW2OVD.js} +1 -1
  91. package/dist/bin/shell/chunks/{chunk-EDTBGO7F.js → chunk-3ERCSYXB.js} +1 -1
  92. package/dist/bin/{chunks/chunk-X4MX6EHF.js → shell/chunks/chunk-46EFQINR.js} +1 -1
  93. package/dist/bin/shell/chunks/{chunk-7NC4CPHS.js → chunk-4HZ2J7WU.js} +1 -1
  94. package/dist/bin/{chunks/chunk-UO5LOD7U.js → shell/chunks/chunk-4J4HK3AP.js} +1 -1
  95. package/dist/bin/shell/chunks/{chunk-PAYQNSZN.js → chunk-4TKEQ5JF.js} +1 -1
  96. package/dist/bin/shell/chunks/{chunk-V2RP73X4.js → chunk-4TZMT56V.js} +1 -1
  97. package/dist/bin/shell/chunks/{chunk-F3GKANW3.js → chunk-5MAZXOIE.js} +1 -1
  98. package/dist/bin/{chunks/chunk-6FSBHK6H.js → shell/chunks/chunk-6CMV7VZ7.js} +1 -1
  99. package/dist/bin/shell/chunks/{chunk-FVRXEJYQ.js → chunk-7X6QFILN.js} +2 -2
  100. package/dist/bin/{chunks/chunk-2SVX7I5P.js → shell/chunks/chunk-A66SLDOH.js} +1 -1
  101. package/dist/bin/{chunks/chunk-Q4UMTSRO.js → shell/chunks/chunk-AIE46WV2.js} +1 -1
  102. package/dist/bin/shell/chunks/{chunk-VBDLSL7Y.js → chunk-CVDY2PJ2.js} +1 -1
  103. package/dist/bin/{chunks/chunk-H7JTIXAO.js → shell/chunks/chunk-DSS5HVJD.js} +1 -1
  104. package/dist/bin/{chunks/chunk-M65CQLJE.js → shell/chunks/chunk-E2TTMLYF.js} +1 -1
  105. package/dist/bin/{chunks/chunk-HN2DCT7T.js → shell/chunks/chunk-E35XCU6G.js} +1 -1
  106. package/dist/bin/shell/chunks/{chunk-JZW7NFK2.js → chunk-EVVJUFZE.js} +1 -1
  107. package/dist/bin/{chunks/chunk-C7ISPH7Y.js → shell/chunks/chunk-FKCULB5D.js} +1 -1
  108. package/dist/bin/shell/chunks/{chunk-YY5PJR7O.js → chunk-G5P37XAS.js} +1 -1
  109. package/dist/bin/{chunks/chunk-CAZ75E7E.js → shell/chunks/chunk-IAGQA4VJ.js} +1 -1
  110. package/dist/bin/shell/chunks/{chunk-22HCD466.js → chunk-JARRTDRA.js} +1 -1
  111. package/dist/bin/shell/chunks/{chunk-JNUX75OX.js → chunk-JW42N6DP.js} +1 -1
  112. package/dist/bin/{chunks/chunk-7UU7KPEM.js → shell/chunks/chunk-LLC5H7UY.js} +1 -1
  113. package/dist/bin/{chunks/chunk-NXVG64T3.js → shell/chunks/chunk-MMSWVFQQ.js} +1 -1
  114. package/dist/bin/shell/chunks/{chunk-2NRAWO6E.js → chunk-MQIPLKAA.js} +1 -1
  115. package/dist/bin/shell/chunks/{chunk-YOKQNNQO.js → chunk-NK4UMOPJ.js} +1 -1
  116. package/dist/bin/{chunks/chunk-OPMLWMNH.js → shell/chunks/chunk-OUWMQLWU.js} +1 -1
  117. package/dist/bin/shell/chunks/{chunk-KFMPGSUT.js → chunk-PEI4ZGEQ.js} +1 -1
  118. package/dist/bin/{chunks/chunk-7AYT3UKI.js → shell/chunks/chunk-PNPB62GH.js} +1 -1
  119. package/dist/bin/shell/chunks/chunk-PUSAQWLR.js +3 -0
  120. package/dist/bin/shell/chunks/{chunk-LAHBP3FW.js → chunk-QMRTESE5.js} +1 -1
  121. package/dist/bin/{chunks/chunk-IZGLHVBB.js → shell/chunks/chunk-RGDGVTPT.js} +1 -1
  122. package/dist/bin/shell/chunks/{chunk-FKVQZWJQ.js → chunk-TO6JCMLQ.js} +1 -1
  123. package/dist/bin/{chunks/chunk-F3WNDKOC.js → shell/chunks/chunk-TVCXF3IW.js} +1 -1
  124. package/dist/bin/shell/chunks/{chunk-J7TUF2VI.js → chunk-V2CUST2J.js} +1 -1
  125. package/dist/bin/{chunks/chunk-XJ37N3S5.js → shell/chunks/chunk-VZTJXRFX.js} +1 -1
  126. package/dist/bin/shell/chunks/{column-AQB3A3PJ.js → column-W6LUR2XZ.js} +1 -1
  127. package/dist/bin/{chunks/comm-Q4VDF6ZO.js → shell/chunks/comm-YSS52S62.js} +1 -1
  128. package/dist/bin/shell/chunks/{cut-ZI2HIAW7.js → cut-VWMTH3YP.js} +1 -1
  129. package/dist/bin/{chunks/diff-YDJ42RKS.js → shell/chunks/diff-E5JNYAA2.js} +1 -1
  130. package/dist/bin/shell/chunks/{env-NY32PQJM.js → env-S6XWV5SK.js} +1 -1
  131. package/dist/bin/shell/chunks/{expand-YYSO35NS.js → expand-AIAYIGRW.js} +1 -1
  132. package/dist/bin/shell/chunks/{flag-coverage-RFKIBJ6L.js → flag-coverage-AIBITXZA.js} +1 -1
  133. package/dist/bin/{chunks/fold-5MF7QZWQ.js → shell/chunks/fold-4X7TIQ32.js} +1 -1
  134. package/dist/bin/shell/chunks/{grep-VAYCFO4O.js → grep-7KM7ZRPL.js} +1 -1
  135. package/dist/bin/shell/chunks/{gzip-UGBQQKIH.js → gzip-UUURHQYK.js} +1 -1
  136. package/dist/bin/shell/chunks/{head-QNC2ZYDO.js → head-2NYUMA2U.js} +1 -1
  137. package/dist/bin/{chunks/html-to-markdown-QEFY7XQR.js → shell/chunks/html-to-markdown-TOIJDAT5.js} +1 -1
  138. package/dist/bin/{chunks/join-EJ73DYTK.js → shell/chunks/join-W23T6UW4.js} +1 -1
  139. package/dist/bin/shell/chunks/{jq-GGTKKMEN.js → jq-PG5TWARX.js} +1 -1
  140. package/dist/bin/shell/chunks/{js-exec-BC6NI55L.js → js-exec-YLOWUQR4.js} +1 -1
  141. package/dist/bin/shell/chunks/{md5sum-MCVDIB35.js → md5sum-XTC5HSJD.js} +1 -1
  142. package/dist/bin/shell/chunks/{nl-KUPLVCTS.js → nl-7NAYBH24.js} +1 -1
  143. package/dist/bin/shell/chunks/{od-YQ5ZUI2H.js → od-BGNLMPXW.js} +1 -1
  144. package/dist/bin/{chunks/paste-A5KKPWXX.js → shell/chunks/paste-KM6YEJO3.js} +1 -1
  145. package/dist/bin/shell/chunks/{python3-BQWDPUBM.js → python3-ABK6N2Y5.js} +1 -1
  146. package/dist/bin/shell/chunks/{rev-PYHOZ4D4.js → rev-YHIGUK3P.js} +1 -1
  147. package/dist/bin/shell/chunks/{rg-BGFMSIVK.js → rg-6FON3TGH.js} +1 -1
  148. package/dist/bin/shell/chunks/{sed-FWA634SN.js → sed-LHKUKSBN.js} +1 -1
  149. package/dist/bin/shell/chunks/{sha1sum-4KF52U3Y.js → sha1sum-VW2AMMXS.js} +1 -1
  150. package/dist/bin/shell/chunks/{sha256sum-6YEPULPX.js → sha256sum-7O5NHH7H.js} +1 -1
  151. package/dist/bin/shell/chunks/{sort-4C6WOKNK.js → sort-3BIIXAER.js} +1 -1
  152. package/dist/bin/shell/chunks/{split-TV7NL7LA.js → split-3DTOTWCO.js} +1 -1
  153. package/dist/bin/shell/chunks/{sqlite3-W777NCI4.js → sqlite3-AUZE77IO.js} +1 -1
  154. package/dist/bin/shell/chunks/{strings-MDD72LR6.js → strings-LQXARN54.js} +1 -1
  155. package/dist/bin/{chunks/tac-C2N4NQ6S.js → shell/chunks/tac-24IIWF3C.js} +1 -1
  156. package/dist/bin/shell/chunks/{tail-BCB5W6JC.js → tail-5BYXLCVJ.js} +1 -1
  157. package/dist/bin/shell/chunks/{tar-DOO744MK.js → tar-PEHGL2NT.js} +1 -1
  158. package/dist/bin/shell/chunks/{tee-UQHPO4OW.js → tee-CPC2RSEW.js} +1 -1
  159. package/dist/bin/shell/chunks/{time-ZPY52VT2.js → time-7GPZMM6F.js} +1 -1
  160. package/dist/bin/shell/chunks/{timeout-5AX3ZS3X.js → timeout-B2L3MWOL.js} +1 -1
  161. package/dist/bin/shell/chunks/{tr-G7K6M6HP.js → tr-SGANQH42.js} +1 -1
  162. package/dist/bin/shell/chunks/{unexpand-QIR4EDPG.js → unexpand-7TJPGTBZ.js} +1 -1
  163. package/dist/bin/shell/chunks/{uniq-I7PVFJR4.js → uniq-VH2XX4GT.js} +1 -1
  164. package/dist/bin/{chunks/wc-6NGWULAP.js → shell/chunks/wc-LGTZO4AP.js} +1 -1
  165. package/dist/bin/shell/chunks/{xan-KX4VPXUN.js → xan-I5ZN33WB.js} +1 -1
  166. package/dist/bin/shell/chunks/{xan-view-JXOZLJ7S.js → xan-view-UGYNQULV.js} +1 -1
  167. package/dist/bin/shell/chunks/{xargs-UWHPYLY7.js → xargs-2NR5N6L3.js} +1 -1
  168. package/dist/bin/shell/chunks/{yq-GCDCJBKB.js → yq-3EZZPCM2.js} +1 -1
  169. package/dist/bin/shell/shell.js +73 -73
  170. package/dist/bundle/browser.js +3 -3
  171. package/dist/bundle/chunks/{awk2-LA3USKJP.js → awk2-2OROQ6TB.js} +1 -1
  172. package/dist/bundle/chunks/{base64-C2AIWVNC.js → base64-6IJBGYEA.js} +1 -1
  173. package/dist/bundle/chunks/{bash-YZ33HQZQ.js → bash-AT4DFUJM.js} +1 -1
  174. package/dist/bundle/chunks/{cat-TSFMZVYS.js → cat-Z4ATD4R2.js} +1 -1
  175. package/dist/bundle/chunks/{chunk-YCLFEX4T.js → chunk-4HV7HIHS.js} +1 -1
  176. package/dist/bundle/chunks/{chunk-S443BAN4.js → chunk-6HPVYB3B.js} +1 -1
  177. package/dist/bundle/chunks/chunk-6JHJPYPW.js +2 -0
  178. package/dist/bundle/chunks/{chunk-GJC3WVOW.js → chunk-7QLDUSO4.js} +1 -1
  179. package/dist/bundle/chunks/{chunk-RLAAFSP3.js → chunk-AAH22H6T.js} +1 -1
  180. package/dist/bundle/chunks/{chunk-OVGANXCG.js → chunk-AEU2AH3H.js} +1 -1
  181. package/dist/bundle/chunks/{chunk-XCQWV4AU.js → chunk-AK7Q2PNY.js} +1 -1
  182. package/dist/bundle/chunks/{chunk-S3LEJEPP.js → chunk-EO3OLY7H.js} +1 -1
  183. package/dist/bundle/chunks/{chunk-XDGLKIHR.js → chunk-G372PPPL.js} +1 -1
  184. package/dist/bundle/chunks/{chunk-U73A73IE.js → chunk-HGXBBQKY.js} +1 -1
  185. package/dist/bundle/chunks/{chunk-46RN27KI.js → chunk-IJZY7GO5.js} +1 -1
  186. package/dist/bundle/chunks/{chunk-VLCHOJWK.js → chunk-K57W527P.js} +1 -1
  187. package/dist/bundle/chunks/{chunk-GSPYNYZA.js → chunk-K5VKTLDB.js} +1 -1
  188. package/dist/bundle/chunks/{chunk-VPADYNBD.js → chunk-KHCKEMD6.js} +1 -1
  189. package/dist/bundle/chunks/{chunk-ICIEVHY5.js → chunk-KTWS34JV.js} +1 -1
  190. package/dist/bundle/chunks/{chunk-Q7H5W7YE.js → chunk-KUSBC35O.js} +2 -2
  191. package/dist/bundle/chunks/{chunk-UZR7BRBM.js → chunk-LJ64BU4T.js} +1 -1
  192. package/dist/bundle/chunks/{chunk-4N6J7B5P.js → chunk-MHOVZCXO.js} +1 -1
  193. package/dist/bundle/chunks/{chunk-UP6MSJGD.js → chunk-MLX6LCEH.js} +1 -1
  194. package/dist/bundle/chunks/{chunk-2JIPICV3.js → chunk-MSHY3ROY.js} +1 -1
  195. package/dist/bundle/chunks/{chunk-6VAT5Z2D.js → chunk-NHIFOLSI.js} +1 -1
  196. package/dist/bundle/chunks/{chunk-T4TFLF3R.js → chunk-O66VCFMW.js} +1 -1
  197. package/dist/bundle/chunks/{chunk-7JHM3L42.js → chunk-PAZDJXQ2.js} +1 -1
  198. package/dist/bundle/chunks/{chunk-FW54FHZR.js → chunk-PVSBJ7RN.js} +1 -1
  199. package/dist/bundle/chunks/{chunk-XYXUMFSU.js → chunk-PXGSAN5M.js} +1 -1
  200. package/dist/bundle/chunks/{chunk-FJK43EBQ.js → chunk-RCQPTKLM.js} +1 -1
  201. package/dist/bundle/chunks/{chunk-6LASZU3O.js → chunk-RLPRNBSA.js} +1 -1
  202. package/dist/bundle/chunks/{chunk-GGC5NEPZ.js → chunk-WLZQ2YQT.js} +1 -1
  203. package/dist/bundle/chunks/{chunk-FX7KQCEA.js → chunk-WQQIVUNI.js} +1 -1
  204. package/dist/bundle/chunks/{chunk-EBAPSGAO.js → chunk-WWZU6WGV.js} +1 -1
  205. package/dist/bundle/chunks/{chunk-LNBPBRV4.js → chunk-XY467F65.js} +1 -1
  206. package/dist/bundle/chunks/{chunk-KD3KENL6.js → chunk-YAIN5HNN.js} +1 -1
  207. package/dist/bundle/chunks/{chunk-HJBTD7PY.js → chunk-YOVBUIVE.js} +1 -1
  208. package/dist/bundle/chunks/{chunk-XHLMAZX2.js → chunk-ZALQAZQS.js} +1 -1
  209. package/dist/bundle/chunks/{chunk-N6DXJ2JN.js → chunk-ZSV2XR53.js} +1 -1
  210. package/dist/bundle/chunks/{chunk-ACSZB4FE.js → chunk-ZUKEFBW2.js} +1 -1
  211. package/dist/bundle/chunks/{column-XT6UFXNQ.js → column-WWAENDUI.js} +1 -1
  212. package/dist/bundle/chunks/{comm-VV2LDX2J.js → comm-RQ5XNTJM.js} +1 -1
  213. package/dist/bundle/chunks/{cut-OKARJCCV.js → cut-QWB7NUKQ.js} +1 -1
  214. package/dist/bundle/chunks/{diff-5MIVVRRQ.js → diff-X5UWGQ3A.js} +1 -1
  215. package/dist/bundle/chunks/{env-36M5BO7M.js → env-ZRQ43ZZD.js} +1 -1
  216. package/dist/bundle/chunks/{expand-JSPG6VOP.js → expand-EAKN4OXQ.js} +1 -1
  217. package/dist/bundle/chunks/{flag-coverage-YKB23BRI.js → flag-coverage-G33S37PG.js} +1 -1
  218. package/dist/bundle/chunks/{fold-4TQNYMSW.js → fold-D373LLSA.js} +1 -1
  219. package/dist/bundle/chunks/{grep-V3LQVMRQ.js → grep-SFR3IZ6K.js} +1 -1
  220. package/dist/bundle/chunks/{gzip-O5ASJAFY.js → gzip-CVIVKFF2.js} +1 -1
  221. package/dist/bundle/chunks/{head-442HYESI.js → head-FXWZSGHI.js} +1 -1
  222. package/dist/bundle/chunks/{html-to-markdown-WGBAMDHY.js → html-to-markdown-2JNCRZB7.js} +1 -1
  223. package/dist/bundle/chunks/{join-TBRGI3LQ.js → join-CTDW75RI.js} +1 -1
  224. package/dist/bundle/chunks/{jq-4XLYLOS5.js → jq-67Y32ADP.js} +1 -1
  225. package/dist/bundle/chunks/{js-exec-N5KEZBH7.js → js-exec-2N7YE6ER.js} +1 -1
  226. package/dist/bundle/chunks/{md5sum-SPU24VSG.js → md5sum-P4DXUWPM.js} +1 -1
  227. package/dist/bundle/chunks/{nl-WSDW7I4O.js → nl-SLUVZ3TI.js} +1 -1
  228. package/dist/bundle/chunks/{od-WOKFDJTP.js → od-LKZJLHVE.js} +1 -1
  229. package/dist/bundle/chunks/{paste-7JC6S4DX.js → paste-LIMPDS6X.js} +1 -1
  230. package/dist/bundle/chunks/{python3-POMOR4OA.js → python3-2AQWCGWL.js} +1 -1
  231. package/dist/bundle/chunks/{rev-5EHFX4EJ.js → rev-W4N6QLP5.js} +1 -1
  232. package/dist/bundle/chunks/{rg-S4FXYXWB.js → rg-QVQNBE57.js} +1 -1
  233. package/dist/bundle/chunks/{sed-S5UIK574.js → sed-6Q2OKXY5.js} +1 -1
  234. package/dist/bundle/chunks/{sha1sum-2PTOAFR6.js → sha1sum-UMR2BPZO.js} +1 -1
  235. package/dist/bundle/chunks/{sha256sum-NS7D3IXX.js → sha256sum-RPSA24NY.js} +1 -1
  236. package/dist/bundle/chunks/{sort-SW2YEO5B.js → sort-JRCEWR75.js} +1 -1
  237. package/dist/bundle/chunks/{split-4KKZZXXE.js → split-KAF43FGD.js} +1 -1
  238. package/dist/bundle/chunks/{sqlite3-CGOEFJAO.js → sqlite3-QVOVCFW4.js} +1 -1
  239. package/dist/bundle/chunks/{strings-6WDHLGMX.js → strings-5J5KERRU.js} +1 -1
  240. package/dist/bundle/chunks/{tac-2STMMJYW.js → tac-VQW3WZHD.js} +1 -1
  241. package/dist/bundle/chunks/{tail-R4PCA2C4.js → tail-CDOI2GPL.js} +1 -1
  242. package/dist/bundle/chunks/{tar-STHHZTZ6.js → tar-AIQ24PFK.js} +1 -1
  243. package/dist/bundle/chunks/{tee-YUZ2FKCJ.js → tee-SYEPHRRB.js} +1 -1
  244. package/dist/bundle/chunks/{time-D4LNBSWX.js → time-DAPKFIOQ.js} +1 -1
  245. package/dist/bundle/chunks/{timeout-YDCRSLPQ.js → timeout-4OGTKQLR.js} +1 -1
  246. package/dist/bundle/chunks/{tr-36LHWFRQ.js → tr-P4RRZUZU.js} +1 -1
  247. package/dist/bundle/chunks/{unexpand-CADSA4VO.js → unexpand-V5HMWT4F.js} +1 -1
  248. package/dist/bundle/chunks/{uniq-XSIZR6PB.js → uniq-ON4F3TGM.js} +1 -1
  249. package/dist/bundle/chunks/{wc-LF7NU4LA.js → wc-ASC6XKZW.js} +1 -1
  250. package/dist/bundle/chunks/{xan-Y6WF3IRG.js → xan-UGHT4U42.js} +1 -1
  251. package/dist/bundle/chunks/xan-view-HLIT2HYA.js +2 -0
  252. package/dist/bundle/chunks/{xargs-MGZPH7AX.js → xargs-7BH6BYXE.js} +1 -1
  253. package/dist/bundle/chunks/{yq-4QJW3EQG.js → yq-5UQZWCTQ.js} +1 -1
  254. package/dist/bundle/index.cjs +76 -76
  255. package/dist/bundle/index.js +52 -52
  256. package/package.json +1 -1
  257. package/dist/bin/chunks/chunk-VZK4FHWJ.js +0 -3
  258. package/dist/bin/shell/chunks/chunk-VZK4FHWJ.js +0 -3
  259. package/dist/bundle/chunks/chunk-NRSASXYY.js +0 -2
  260. package/dist/bundle/chunks/xan-view-HDVKHFC2.js +0 -2
@@ -3,7 +3,7 @@ var g3=Object.create;var cl=Object.defineProperty;var y3=Object.getOwnPropertyDe
3
3
  This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`,de=class extends Error{violation;constructor(t,n){super(t+A3),this.violation=n,this.name="SecurityViolationError"}},Ue=!pr&&pl?new pl:null,S3=1e3;fl={enabled:!0,auditMode:!1};Et=class e{static instance=null;static importHooksRegistered=!1;static trustedExecutionDepth=new Map;config;refCount=0;patchFailures=[];activeExecutionIds=new Set;contextCache=new Map;originalDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(t){this.config=t}static getInstance(t){let n=v3(t);if(!e.instance)e.instance=new e(n);else{let r=e.instance.config;if(n.enabled!==r.enabled||n.auditMode!==r.auditMode)throw new Error(`DefenseInDepthBox config conflict: requested {enabled: ${n.enabled}, auditMode: ${n.auditMode}} but singleton already has {enabled: ${r.enabled}, auditMode: ${r.auditMode}}. All Bash instances must use the same defense-in-depth security settings, or call DefenseInDepthBox.resetInstance() between incompatible configurations.`)}return e.instance}static resetInstance(){e.instance&&(e.instance.forceDeactivate(),e.instance=null),e.trustedExecutionDepth.clear()}static isInSandboxedContext(){return Ue?Ue?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(Ue)return Ue?.getStore()?.executionId}static enterTrustedScope(t){let n=e.trustedExecutionDepth.get(t)??0;e.trustedExecutionDepth.set(t,n+1)}static leaveTrustedScope(t){let n=e.trustedExecutionDepth.get(t);if(n){if(n===1){e.trustedExecutionDepth.delete(t);return}e.trustedExecutionDepth.set(t,n-1)}}static isTrustedScopeActive(t){return t?(e.trustedExecutionDepth.get(t)??0)>0:!1}isExecutionIdActive(t){return this.activeExecutionIds.has(t)}getCachedContext(t){let n=this.contextCache.get(t);return n||(n={sandboxActive:!0,executionId:t},this.contextCache.set(t,n)),n}getPreferredActiveExecutionId(){if(this.activeExecutionIds.size!==0)for(let t of this.activeExecutionIds)return t}static bindCurrentContext(t){if(!Ue)return t;let n=e.instance,r=Ue.getStore(),s=r?.sandboxActive===!0?r.executionId:n?.getPreferredActiveExecutionId();if(!s)return t;let i=n?.getCachedContext(s)??{sandboxActive:!0,executionId:s};return((...o)=>{let a=e.instance;if(!(a&&!a.isExecutionIdActive(s)&&(a.recordViolation("bound_callback_after_deactivate","bound callback","Bound callback blocked after originating execution was deactivated"),!a.config.auditMode)))return C3(i,t,...o)})}isEnabled(){return this.config.enabled===!0&&Ue!==null&&!pr}updateConfig(t){this.config={...this.config,...t}}activate(){if(pr||!this.config.enabled||!Ue){let r=E1(),s=!1;return{run:i=>s?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):i(),deactivate:()=>{s=!0},executionId:r}}this.refCount++,this.refCount===1&&(this.applyPatches(),this.activationTime=Date.now());let t=E1(),n=!1;return{run:r=>n?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):(this.activeExecutionIds.add(t),Ue.run({sandboxActive:!0,executionId:t},r)),deactivate:()=>{n||(n=!0,this.activeExecutionIds.delete(t),this.contextCache.delete(t),this.refCount--,this.refCount===0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.refCount<0&&(this.refCount=0))},executionId:t}}forceDeactivate(){this.refCount>0&&(this.restorePatches(),this.totalActiveTimeMs+=Date.now()-this.activationTime),this.activeExecutionIds.clear(),this.contextCache.clear(),this.refCount=0}isActive(){return this.refCount>0}getStats(){return{violationsBlocked:this.violations.length,violations:[...this.violations],activeTimeMs:this.totalActiveTimeMs+(this.refCount>0?Date.now()-this.activationTime:0),refCount:this.refCount}}getPatchFailures(){return[...this.patchFailures]}clearViolations(){this.violations=[]}getPathForTarget(t,n){return t===globalThis?`globalThis.${n}`:t===process?`process.${n}`:t===Error?`Error.${n}`:t===Function.prototype?`Function.prototype.${n}`:t===Object.prototype?`Object.prototype.${n}`:`<object>.${n}`}static runTrusted(t){if(!Ue)return t();let n=Ue.getStore();if(!n)return t();let{executionId:r}=n;return Ue.run({...n,trusted:!0},()=>{e.enterTrustedScope(r);try{let s=t();return typeof s=="object"&&s!==null&&"finally"in s&&typeof s.finally=="function"?s.finally(()=>{e.leaveTrustedScope(r)}):(e.leaveTrustedScope(r),s)}catch(s){throw e.leaveTrustedScope(r),s}})}static async runTrustedAsync(t){if(!Ue)return t();let n=Ue.getStore();if(!n)return t();let{executionId:r}=n;return Ue.run({...n,trusted:!0},async()=>{e.enterTrustedScope(r);try{return await t()}finally{e.leaveTrustedScope(r)}})}shouldBlock(){if(pr||this.config.auditMode||!Ue)return!1;let t=Ue?.getStore();return!(t?.sandboxActive!==!0||t.trusted||e.isTrustedScopeActive(t.executionId))}recordViolation(t,n,r){let s={timestamp:Date.now(),type:t,message:r,path:n,stack:new Error().stack,executionId:Ue?.getStore()?.executionId};if(this.violations.length<S3&&this.violations.push(s),this.config.onViolation)try{this.config.onViolation(s)}catch(i){console.debug("[DefenseInDepthBox] onViolation callback threw:",i instanceof Error?i.message:i)}return s}createBlockingProxy(t,n,r){let s=this;return new Proxy(t,{apply(i,o,a){if(s.shouldBlock()){let l=`${n} is blocked during script execution`,c=s.recordViolation(r,n,l);throw new de(l,c)}return s.config.auditMode&&Ue?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} called (audit mode)`),Reflect.apply(i,o,a)},construct(i,o,a){if(s.shouldBlock()){let l=`${n} constructor is blocked during script execution`,c=s.recordViolation(r,n,l);throw new de(l,c)}return s.config.auditMode&&Ue?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} constructor called (audit mode)`),Reflect.construct(i,o,a)}})}createBlockingObjectProxy(t,n,r,s){let i=this;return new Proxy(t,{get(o,a,l){if(i.shouldBlock()){if(s&&typeof a=="string"&&s.has(a))return Reflect.get(o,a,l);let c=`${n}.${String(a)}`,u=`${c} is blocked during script execution`,f=i.recordViolation(r,c,u);throw new de(u,f)}if(i.config.auditMode&&Ue?.getStore()?.sandboxActive===!0){let c=`${n}.${String(a)}`;i.recordViolation(r,c,`${c} accessed (audit mode)`)}return Reflect.get(o,a,l)},set(o,a,l,c){if(i.shouldBlock()){let u=`${n}.${String(a)}`,f=`${u} modification is blocked during script execution`,p=i.recordViolation(r,u,f);throw new de(f,p)}return Reflect.set(o,a,l,c)},ownKeys(o){if(i.shouldBlock()){let a=`${n} enumeration is blocked during script execution`,l=i.recordViolation(r,n,a);throw new de(a,l)}return Reflect.ownKeys(o)},getOwnPropertyDescriptor(o,a){if(i.shouldBlock()){let l=`${n}.${String(a)}`,c=`${l} descriptor access is blocked during script execution`,u=i.recordViolation(r,l,c);throw new de(c,u)}return Reflect.getOwnPropertyDescriptor(o,a)},has(o,a){if(i.shouldBlock()){let l=`${n}.${String(a)}`,c=`${l} existence check is blocked during script execution`,u=i.recordViolation(r,l,c);throw new de(c,u)}return Reflect.has(o,a)},deleteProperty(o,a){if(i.shouldBlock()){let l=`${n}.${String(a)}`,c=`${l} deletion is blocked during script execution`,u=i.recordViolation(r,l,c);throw new de(c,u)}return Reflect.deleteProperty(o,a)},setPrototypeOf(o,a){if(i.shouldBlock()){let l=`${n} setPrototypeOf is blocked during script execution`,c=i.recordViolation(r,n,l);throw new de(l,c)}return Reflect.setPrototypeOf(o,a)},defineProperty(o,a,l){if(i.shouldBlock()){let c=`${n}.${String(a)}`,u=`${c} defineProperty is blocked during script execution`,f=i.recordViolation(r,c,u);throw new de(u,f)}return Reflect.defineProperty(o,a,l)}})}applyPatches(){this.patchFailures=[];let t=b1(),n=new Set(["process_send","process_channel","process_stdout","process_stderr"]);for(let i of t)n.has(i.violationType)||this.applyPatch(i);this.protectConstructorChain(),this.protectErrorPrepareStackTrace(),this.protectPromiseThen(),this.protectDynamicImport(),this.protectModuleLoad(),this.protectModuleResolveFilename(),this.protectProcessMainModule(),this.protectProcessExecPath(),this.lockWellKnownSymbols(),this.protectProxyRevocable();let r=["Function.prototype.constructor","Module._load"],s=this.patchFailures.filter(i=>r.includes(i));if(s.length>0)throw this.restorePatches(),new Error(`DefenseInDepthBox: critical patches failed: ${s.join(", ")}`)}protectConstructorChain(){this.patchPrototypeConstructor(Function.prototype,"Function.prototype.constructor","function_constructor");try{let t=Object.getPrototypeOf(async()=>{}).constructor;t&&t!==Function&&this.patchPrototypeConstructor(t.prototype,"AsyncFunction.prototype.constructor","async_function_constructor")}catch(t){this.patchFailures.push("AsyncFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncFunction.prototype.constructor:",t instanceof Error?t.message:t)}try{let t=Object.getPrototypeOf(function*(){}).constructor;t&&t!==Function&&this.patchPrototypeConstructor(t.prototype,"GeneratorFunction.prototype.constructor","generator_function_constructor")}catch(t){this.patchFailures.push("GeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch GeneratorFunction.prototype.constructor:",t instanceof Error?t.message:t)}try{let t=Object.getPrototypeOf(async function*(){}).constructor,n=Object.getPrototypeOf(async()=>{}).constructor;t&&t!==Function&&t!==n&&this.patchPrototypeConstructor(t.prototype,"AsyncGeneratorFunction.prototype.constructor","async_generator_function_constructor")}catch(t){this.patchFailures.push("AsyncGeneratorFunction.prototype.constructor"),console.debug("[DefenseInDepthBox] Could not patch AsyncGeneratorFunction.prototype.constructor:",t instanceof Error?t.message:t)}}protectErrorPrepareStackTrace(){let t=this;try{let n=Object.getOwnPropertyDescriptor(Error,"prepareStackTrace");this.originalDescriptors.push({target:Error,prop:"prepareStackTrace",descriptor:n});let r=n?.value;Object.defineProperty(Error,"prepareStackTrace",{get(){return r},set(s){if(t.shouldBlock()){let i="Error.prepareStackTrace modification is blocked during script execution",o=t.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",i);throw new de(i,o)}t.config.auditMode&&Ue?.getStore()?.sandboxActive===!0&&t.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),r=s},configurable:!0})}catch(n){this.patchFailures.push("Error.prepareStackTrace"),console.debug("[DefenseInDepthBox] Could not protect Error.prepareStackTrace:",n instanceof Error?n.message:n)}}protectPromiseThen(){let t=this;try{let i=function(...o){return Ue.run(this.captured,()=>{if(!this.box.isExecutionIdActive(this.executionId)){if(this.box.recordViolation("promise_then_after_deactivate","Promise.then","Promise.then callback is blocked after defense deactivation"),this.box.config.auditMode)return Reflect.apply(this.cb,void 0,o);if(this.kind==="fulfilled")return o[0];throw o[0]}return Reflect.apply(this.cb,void 0,o)})};var n=i;let r=Object.getOwnPropertyDescriptor(Promise.prototype,"then");this.originalDescriptors.push({target:Promise.prototype,prop:"then",descriptor:r});let s=r?.value;if(typeof s!="function")return;Object.defineProperty(Promise.prototype,"then",{value:function(a,l){if(!Ue)return Reflect.apply(s,this,[a,l]);let c=Ue.getStore(),u=c?.sandboxActive===!0&&c.trusted!==!0?c.executionId:void 0;if(!u)return Reflect.apply(s,this,[a,l]);let f=t.getCachedContext(u),p=(h,d)=>typeof h!="function"?h:i.bind({box:t,executionId:u,captured:f,cb:h,kind:d});return Reflect.apply(s,this,[p(a,"fulfilled"),p(l,"rejected")])},writable:!0,configurable:!0})}catch(r){this.patchFailures.push("Promise.prototype.then"),console.debug("[DefenseInDepthBox] Could not protect Promise.prototype.then:",r instanceof Error?r.message:r)}}patchPrototypeConstructor(t,n,r){let s=this;try{let i=Object.getOwnPropertyDescriptor(t,"constructor");this.originalDescriptors.push({target:t,prop:"constructor",descriptor:i});let o=i?.value;Object.defineProperty(t,"constructor",{get(){if(s.shouldBlock()){let a=`${n} access is blocked during script execution`,l=s.recordViolation(r,n,a);throw new de(a,l)}return s.config.auditMode&&Ue?.getStore()?.sandboxActive===!0&&s.recordViolation(r,n,`${n} accessed (audit mode)`),o},set(a){if(s.shouldBlock()){let l=`${n} modification is blocked during script execution`,c=s.recordViolation(r,n,l);throw new de(l,c)}Object.defineProperty(this,"constructor",{value:a,writable:!0,configurable:!0})},configurable:!0})}catch(i){this.patchFailures.push(n),console.debug(`[DefenseInDepthBox] Could not patch ${n}:`,i instanceof Error?i.message:i)}}protectProcessMainModule(){if(typeof process>"u")return;let t=this;try{let n=Object.getOwnPropertyDescriptor(process,"mainModule");this.originalDescriptors.push({target:process,prop:"mainModule",descriptor:n});let r=n?.value;r!==void 0&&Object.defineProperty(process,"mainModule",{get(){if(t.shouldBlock()){let s="process.mainModule access is blocked during script execution",i=t.recordViolation("process_main_module","process.mainModule",s);throw new de(s,i)}return t.config.auditMode&&Ue?.getStore()?.sandboxActive===!0&&t.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),r},set(s){if(t.shouldBlock()){let i="process.mainModule modification is blocked during script execution",o=t.recordViolation("process_main_module","process.mainModule",i);throw new de(i,o)}Object.defineProperty(process,"mainModule",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(n){this.patchFailures.push("process.mainModule"),console.debug("[DefenseInDepthBox] Could not protect process.mainModule:",n instanceof Error?n.message:n)}}protectProcessExecPath(){if(typeof process>"u")return;let t=this;try{let n=Object.getOwnPropertyDescriptor(process,"execPath");this.originalDescriptors.push({target:process,prop:"execPath",descriptor:n});let r=n?.value??process.execPath;Object.defineProperty(process,"execPath",{get(){if(t.shouldBlock()){let s="process.execPath access is blocked during script execution",i=t.recordViolation("process_exec_path","process.execPath",s);throw new de(s,i)}return t.config.auditMode&&Ue?.getStore()?.sandboxActive===!0&&t.recordViolation("process_exec_path","process.execPath","process.execPath accessed (audit mode)"),r},set(s){if(t.shouldBlock()){let i="process.execPath modification is blocked during script execution",o=t.recordViolation("process_exec_path","process.execPath",i);throw new de(i,o)}Object.defineProperty(process,"execPath",{value:s,writable:!0,configurable:!0})},configurable:!0})}catch(n){this.patchFailures.push("process.execPath"),console.debug("[DefenseInDepthBox] Could not protect process.execPath:",n instanceof Error?n.message:n)}}lockWellKnownSymbols(){let t=(n,r)=>{try{let s=Object.getOwnPropertyDescriptor(n,r);if(s?.configurable){if("value"in s){Object.defineProperty(n,r,{...s,configurable:!1,writable:!1});return}Object.defineProperty(n,r,{...s,configurable:!1})}}catch{}};for(let n of[Array,Map,Set,RegExp,Promise])t(n,Symbol.species);for(let n of[Array.prototype,String.prototype,Map.prototype,Set.prototype])t(n,Symbol.iterator);t(Symbol.prototype,Symbol.toPrimitive),t(Date.prototype,Symbol.toPrimitive);for(let n of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])t(RegExp.prototype,n);t(Function.prototype,Symbol.hasInstance),t(Array.prototype,Symbol.unscopables);for(let n of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])t(n,Symbol.toStringTag);try{let n=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");this.originalDescriptors.push({target:Error,prop:"stackTraceLimit",descriptor:n}),Object.defineProperty(Error,"stackTraceLimit",{value:Error.stackTraceLimit,writable:!1,configurable:!0})}catch{}}protectProxyRevocable(){let t=this;try{let n=Proxy.revocable;if(typeof n!="function")return;let r=Object.getOwnPropertyDescriptor(Proxy,"revocable");this.originalDescriptors.push({target:Proxy,prop:"revocable",descriptor:r}),Object.defineProperty(Proxy,"revocable",{value:function(i,o){if(t.shouldBlock()){let a="Proxy.revocable is blocked during script execution",l=t.recordViolation("proxy","Proxy.revocable",a);throw new de(a,l)}return t.config.auditMode&&Ue?.getStore()?.sandboxActive===!0&&t.recordViolation("proxy","Proxy.revocable","Proxy.revocable called (audit mode)"),n(i,o)},writable:!1,configurable:!0})}catch(n){this.patchFailures.push("Proxy.revocable"),console.debug("[DefenseInDepthBox] Could not protect Proxy.revocable:",n instanceof Error?n.message:n)}}protectDynamicImport(){if(!(pr||e.importHooksRegistered))try{let t=this,n=rr("node:module"),r=new Set;for(let o of n.builtinModules??[]){let a=o.startsWith("node:")?o.slice(5):o;r.add(a);let l=a.indexOf("/");l>0&&r.add(a.slice(0,l))}let s=o=>{if(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.startsWith("file:")||o.startsWith("data:")||o.startsWith("blob:")||o.startsWith("http:")||o.startsWith("https:"))return!1;let a=o.startsWith("node:")?o.slice(5):o;if(!a)return!1;if(typeof n.isBuiltin=="function"&&n.isBuiltin(a)||r.has(a))return!0;let l=a.indexOf("/");return l>0&&r.has(a.slice(0,l))},i=()=>{let o=Ue?.getStore();return t.config.auditMode===!0&&o?.sandboxActive===!0&&o.trusted!==!0&&!e.isTrustedScopeActive(o.executionId)};if(typeof n.registerHooks=="function"){n.registerHooks({resolve(o,a,l){if(o.startsWith("data:")||o.startsWith("blob:"))throw new Error(`dynamic import of ${o.startsWith("data:")?"data:":"blob:"} URLs is blocked by defense-in-depth`);if(s(o)){let c=`import(${o})`,u=`dynamic import of Node.js builtin '${o}' is blocked during script execution`;if(t.shouldBlock()){let f=t.recordViolation("dynamic_import_builtin",c,u);throw new de(u,f)}i()&&t.recordViolation("dynamic_import_builtin",c,`dynamic import of Node.js builtin '${o}' called (audit mode)`)}return l(o,a)}}),e.importHooksRegistered=!0;return}if(typeof n.register=="function"){let o=["export async function resolve(specifier, context, nextResolve) {",' if (specifier.startsWith("data:") || specifier.startsWith("blob:")) {',' throw new Error("dynamic import of " + (specifier.startsWith("data:") ? "data:" : "blob:") + " URLs is blocked by defense-in-depth");'," }"," return nextResolve(specifier, context);","}"].join(`
4
4
  `);n.register(`data:text/javascript,${encodeURIComponent(o)}`),e.importHooksRegistered=!0}}catch(t){console.debug("[DefenseInDepthBox] Could not register import() hooks:",t instanceof Error?t.message:t)}}protectModuleLoad(){if(!pr)try{let t=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(t=o.constructor)}if(!t&&typeof rr<"u"&&typeof rr.main<"u"&&(t=rr.main.constructor),!t||typeof t._load!="function")return;let n=t._load,r=Object.getOwnPropertyDescriptor(t,"_load");this.originalDescriptors.push({target:t,prop:"_load",descriptor:r});let i=this.createBlockingProxy(n,"Module._load","module_load");Object.defineProperty(t,"_load",{value:i,writable:!0,configurable:!0})}catch(t){this.patchFailures.push("Module._load"),console.debug("[DefenseInDepthBox] Could not protect Module._load:",t instanceof Error?t.message:t)}}protectModuleResolveFilename(){if(!pr)try{let t=null;if(typeof process<"u"){let o=process.mainModule;o&&typeof o=="object"&&(t=o.constructor)}if(!t&&typeof rr<"u"&&typeof rr.main<"u"&&(t=rr.main.constructor),!t||typeof t._resolveFilename!="function")return;let n=t._resolveFilename,r=Object.getOwnPropertyDescriptor(t,"_resolveFilename");this.originalDescriptors.push({target:t,prop:"_resolveFilename",descriptor:r});let i=this.createBlockingProxy(n,"Module._resolveFilename","module_resolve_filename");Object.defineProperty(t,"_resolveFilename",{value:i,writable:!0,configurable:!0})}catch(t){this.patchFailures.push("Module._resolveFilename"),console.debug("[DefenseInDepthBox] Could not protect Module._resolveFilename:",t instanceof Error?t.message:t)}}applyPatch(t){let{target:n,prop:r,violationType:s,strategy:i}=t;try{let o=n[r];if(o===void 0)return;let a=Object.getOwnPropertyDescriptor(n,r);if(this.originalDescriptors.push({target:n,prop:r,descriptor:a}),i==="freeze")typeof o=="object"&&o!==null&&Object.freeze(o);else{let l=this.getPathForTarget(n,r),c=typeof o=="function"?this.createBlockingProxy(o,l,s):this.createBlockingObjectProxy(o,l,s,t.allowedKeys);Object.defineProperty(n,r,{value:c,writable:!0,configurable:!0})}}catch(o){let a=this.getPathForTarget(n,r);this.patchFailures.push(a),console.debug(`[DefenseInDepthBox] Could not patch ${a}:`,o instanceof Error?o.message:o)}}restorePatches(){for(let t=this.originalDescriptors.length-1;t>=0;t--){let{target:n,prop:r,descriptor:s}=this.originalDescriptors[t];try{s?Object.defineProperty(n,r,s):delete n[r]}catch(i){let o=this.getPathForTarget(n,r);console.debug(`[DefenseInDepthBox] Could not restore ${o}:`,i instanceof Error?i.message:i)}}this.originalDescriptors=[]}}});function I3(e){return typeof e!="function"?e:Et.bindCurrentContext(e)}var k3,N3,oT,aT,Dr,us,ri=v(()=>{"use strict";dn();k3=globalThis.setTimeout.bind(globalThis),N3=globalThis.clearTimeout.bind(globalThis),oT=globalThis.setInterval.bind(globalThis),aT=globalThis.clearInterval.bind(globalThis);Dr=((e,t,...n)=>k3(I3(e),t,...n)),us=N3});var A1={};ee(A1,{echoCommand:()=>O3,flagsForFuzzing:()=>R3});function T3(e){let t="",n=0;for(;n<e.length;)if(e[n]==="\\"){if(n+1>=e.length){t+="\\";break}let r=e[n+1];switch(r){case"\\":t+="\\",n+=2;break;case"n":t+=`
5
5
  `,n+=2;break;case"t":t+=" ",n+=2;break;case"r":t+="\r",n+=2;break;case"a":t+="\x07",n+=2;break;case"b":t+="\b",n+=2;break;case"f":t+="\f",n+=2;break;case"v":t+="\v",n+=2;break;case"e":case"E":t+="\x1B",n+=2;break;case"c":return{output:t,stop:!0};case"0":{let s="",i=n+2;for(;i<e.length&&i<n+5&&/[0-7]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\0";else{let o=parseInt(s,8)%256;t+=String.fromCharCode(o)}n=i;break}case"x":{let s="",i=n+2;for(;i<e.length&&i<n+4&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\\x",n+=2;else{let o=parseInt(s,16);t+=String.fromCharCode(o),n=i}break}case"u":{let s="",i=n+2;for(;i<e.length&&i<n+6&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\\u",n+=2;else{let o=parseInt(s,16);t+=String.fromCodePoint(o),n=i}break}case"U":{let s="",i=n+2;for(;i<e.length&&i<n+10&&/[0-9a-fA-F]/.test(e[i]);)s+=e[i],i++;if(s.length===0)t+="\\U",n+=2;else{let o=parseInt(s,16);try{t+=String.fromCodePoint(o)}catch{t+=`\\U${s}`}n=i}break}default:t+=`\\${r}`,n+=2}}else t+=e[n],n++;return{output:t,stop:!1}}var O3,R3,S1=v(()=>{"use strict";O3={name:"echo",async execute(e,t){let n=!1,r=t.xpgEcho??!1,s=0;for(;s<e.length;){let o=e[s];if(o==="-n")n=!0,s++;else if(o==="-e")r=!0,s++;else if(o==="-E")r=!1,s++;else if(o==="-ne"||o==="-en")n=!0,r=!0,s++;else break}let i=e.slice(s).join(" ");if(r){let o=T3(i);if(i=o.output,o.stop)return{stdout:i,stderr:"",exitCode:0}}return n||(i+=`
6
- `),{stdout:i,stderr:"",exitCode:0}}},R3={name:"echo",flags:[{flag:"-n",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-E",type:"boolean"}],stdinType:"none",needsArgs:!0}});function ae(e){let t=e;if(!t)return t;let n=!1;for(let s=0;s<t.length;s++){let i=t.charCodeAt(s);if(i>255)return t;i>127&&(n=!0)}if(!n)return t;let r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);try{return $3.decode(r)}catch{return t}}function Un(e){if(!e)return e;let t=P3.encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return n}function D3(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}async function Bn(e,t){return typeof e.readFileBytes=="function"?e.readFileBytes(t):D3(await e.readFileBuffer(t))}function _3(e){return e.stdoutKind?e.stdoutKind:e.stdoutEncoding==="binary"?"bytes":"text"}function hl(e){return _3(e)==="bytes"?e.stdout:Un(e.stdout)}var $3,P3,C1,ge=v(()=>{"use strict";$3=new TextDecoder("utf-8",{fatal:!0}),P3=new TextEncoder;C1=""});function M(e){let t=`${e.name} - ${e.summary}
6
+ `),{stdout:i,stderr:"",exitCode:0}}},R3={name:"echo",flags:[{flag:"-n",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-E",type:"boolean"}],stdinType:"none",needsArgs:!0}});function ae(e){let t=e;if(!t)return t;let n=!1,r=!1;for(let a=0;a<t.length;a++){let l=t.charCodeAt(a);l>255?r=!0:l>127&&(n=!0)}if(!n)return t;let s=[],i=new TextEncoder;for(let a=0;a<t.length;a++){let l=t.charCodeAt(a);if(l>255){let c=i.encode(t[a]);for(let u=0;u<c.length;u++)s.push(c[u])}else s.push(l)}let o=new Uint8Array(s);try{return $3.decode(o)}catch{return t}}function Un(e){if(!e)return e;let t=P3.encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return n}function D3(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}async function Bn(e,t){return typeof e.readFileBytes=="function"?e.readFileBytes(t):D3(await e.readFileBuffer(t))}function _3(e){return e.stdoutKind?e.stdoutKind:e.stdoutEncoding==="binary"?"bytes":"text"}function hl(e){return _3(e)==="bytes"?e.stdout:Un(e.stdout)}var $3,P3,C1,ge=v(()=>{"use strict";$3=new TextDecoder("utf-8",{fatal:!0}),P3=new TextEncoder;C1=""});function M(e){let t=`${e.name} - ${e.summary}
7
7
 
8
8
  `;if(t+=`Usage: ${e.usage}
9
9
  `,e.description){if(t+=`
@@ -1485,7 +1485,7 @@ ${e} ()
1485
1485
  `,127):W(`bash: ${t}: command not found
1486
1486
  `,127);if("error"in c)return c.error==="permission_denied"?W(`bash: ${t}: Permission denied
1487
1487
  `,126):W(`bash: ${t}: No such file or directory
1488
- `,127);if("script"in c)return t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,c.path)),await a(c.path,n,r);let{cmd:u,path:f}=c;t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,f));let p=r||i.state.groupStdin||"",h=u.custom?ae(p):p,d=o(),m={fs:i.fs,cwd:i.state.cwd,env:i.state.env,exportedEnv:d,stdin:h,limits:i.limits,exec:i.execFn,fetch:i.fetch,getRegisteredCommands:()=>Array.from(i.commands.keys()),sleep:i.sleep,trace:i.trace,fileDescriptors:i.state.fileDescriptors,xpgEcho:i.state.shoptOptions.xpg_echo,coverage:i.coverage,signal:i.state.signal,requireDefenseContext:i.requireDefenseContext,jsBootstrapCode:i.jsBootstrapCode,invokeTool:i.invokeTool},g=C4(m,t);try{let y=()=>Mt(i.requireDefenseContext,"command",`${t} execution`,()=>u.execute(n,g));return u.trusted?await Et.runTrustedAsync(()=>y()):await y()}catch(y){if(y instanceof X||y instanceof de)throw y;return W(`${t}: ${je(Xe(y))}
1488
+ `,127);if("script"in c)return t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,c.path)),await a(c.path,n,r);let{cmd:u,path:f}=c;t.includes("/")||(i.state.hashTable||(i.state.hashTable=new Map),i.state.hashTable.set(t,f));let p=r||i.state.groupStdin||"",h=u.custom?ae(p):p,d=o(),m={fs:i.fs,cwd:i.state.cwd,env:i.state.env,exportedEnv:d,stdin:h,limits:i.limits,exec:i.execFn,fetch:i.fetch,getRegisteredCommands:()=>Array.from(i.commands.keys()),sleep:i.sleep,trace:i.trace,fileDescriptors:i.state.fileDescriptors,xpgEcho:i.state.shoptOptions.xpg_echo,coverage:i.coverage,signal:i.state.signal,requireDefenseContext:i.requireDefenseContext,jsBootstrapCode:i.jsBootstrapCode,invokeTool:i.invokeTool},g=u.custom?n.map(w=>ae(w)):n,y=C4(m,t);try{let w=()=>Mt(i.requireDefenseContext,"command",`${t} execution`,()=>u.execute(g,y));return u.trusted?await Et.runTrustedAsync(()=>w()):await w()}catch(w){if(w instanceof X||w instanceof de)throw w;return W(`${t}: ${je(Xe(w))}
1489
1489
  `)}}zt();Ae();jt();async function f1(e,t){let n=e.state.inCondition;e.state.inCondition=!0;let r="",s="",i=0;try{for(let o of t){let a=await e.executeStatement(o);r+=a.stdout,s+=a.stderr,i=a.exitCode}}finally{e.state.inCondition=n}return{stdout:r,stderr:s,exitCode:i}}Ae();ln();function Zi(e,t,n,r){if(e instanceof Tt)return t+=e.stdout,n+=e.stderr,e.levels>1&&r>1?(e.levels--,e.stdout=t,e.stderr=n,{action:"rethrow",stdout:t,stderr:n,error:e}):{action:"break",stdout:t,stderr:n};if(e instanceof Ot)return t+=e.stdout,n+=e.stderr,e.levels>1&&r>1?(e.levels--,e.stdout=t,e.stderr=n,{action:"rethrow",stdout:t,stderr:n,error:e}):{action:"continue",stdout:t,stderr:n};if(e instanceof Ct||e instanceof Vt||e instanceof we||e instanceof X)return e.prependOutput(t,n),{action:"rethrow",stdout:t,stderr:n,error:e};let s=Xe(e);return{action:"error",stdout:t,stderr:`${n}${s}
1490
1490
  `,exitCode:1}}Ae();ln();async function nl(e,t,n="",r=""){let s=n,i=r,o=0;try{for(let a of t){let l=await e.executeStatement(a);s+=l.stdout,i+=l.stderr,o=l.exitCode}}catch(a){if(Yi(a)||a instanceof Vt||a instanceof we||a instanceof X||a instanceof zn)throw a.prependOutput(s,i),a;return{stdout:s,stderr:`${i}${Xe(a)}
1491
1491
  `,exitCode:1}}return{stdout:s,stderr:i,exitCode:o}}async function P4(e,t){let n="",r="";for(let s of t.clauses){let i=await f1(e,s.condition);if(n+=i.stdout,r+=i.stderr,i.exitCode===0)return nl(e,s.body,n,r)}return t.elseBody?nl(e,t.elseBody,n,r):z(n,r,0)}async function D4(e,t){let n=await nr(e,t.redirections);if(n)return n;let r="",s="",i=0,o=0;if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(t.variable))return W(`bash: \`${t.variable}': not a valid identifier
@@ -1567,7 +1567,7 @@ ${e.terminator}`}function qI(e){return`(${Sn(e.body)})${Mn(e.redirections)}`}fun
1567
1567
  `,exitCode:2,env:yn(this.state.env,n?.env)});if(f instanceof RangeError)return this.logResult({stdout:"",stderr:`bash: ${je(f.message)}
1568
1568
  `,exitCode:1,env:yn(this.state.env,n?.env)});throw f}finally{u?.deactivate()}}async readFile(t){return this.fs.readFile(this.fs.resolvePath(this.state.cwd,t))}async writeFile(t,n){return this.fs.writeFile(this.fs.resolvePath(this.state.cwd,t),n)}getCwd(){return this.state.cwd}getEnv(){return vt(this.state.env)}registerTransformPlugin(t){this.transformPlugins.push(t)}transform(t){let n=h3(t),r=Rn(n,{maxHeredocSize:this.limits.maxHeredocSize}),s=Object.create(null);for(let i of this.transformPlugins){let o=i.transform({ast:r,metadata:s});r=o.ast,o.metadata&&(s=zr(s,o.metadata))}return{script:a3(r),ast:r,metadata:s}}};function h3(e){let t=e.split(`
1569
1569
  `),n=[],r=[];for(let s=0;s<t.length;s++){let i=t[s];if(r.length>0){let l=r[r.length-1];if((l.stripTabs?i.replace(/^\t+/,""):i)===l.delimiter){n.push(i.trimStart()),r.pop();continue}n.push(i);continue}let o=i.trimStart();n.push(o);let a=/<<(-?)\s*(['"]?)([\w-]+)\2/g;for(let l of o.matchAll(a)){let c=l[1]==="-",u=l[3];r.push({delimiter:u,stripTabs:c})}}return n.join(`
1570
- `)}var YI=new TextDecoder("utf-8",{fatal:!0});function d3(e){if(!e)return e;let t=!1;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s>255)return e;s>127&&(t=!0)}if(!t)return e;let n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);try{return YI.decode(n)}catch{return e}}function JI(e,t){if(e!==void 0)return t==="bytes"?e:Un(e)}ge();var al=class{baseFs;mounts=new Map;constructor(t){if(this.baseFs=t?.base??new lr,t?.mounts)for(let{mountPoint:n,filesystem:r}of t.mounts)this.mount(n,r)}mount(t,n){this.validateMountPath(t);let r=ke(t);this.validateMount(r),this.mounts.set(r,{mountPoint:r,filesystem:n})}unmount(t){let n=ke(t);if(!this.mounts.has(n))throw new Error(`No filesystem mounted at '${t}'`);this.mounts.delete(n)}getMounts(){return Array.from(this.mounts.values()).map(t=>({mountPoint:t.mountPoint,filesystem:t.filesystem}))}isMountPoint(t){let n=ke(t);return this.mounts.has(n)}validateMountPath(t){let n=t.split("/");for(let r of n)if(r==="."||r==="..")throw new Error(`Invalid mount point '${t}': contains '.' or '..' segments`)}validateMount(t){if(t==="/")throw new Error("Cannot mount at root '/'");for(let n of this.mounts.keys())if(n!==t){if(t.startsWith(`${n}/`))throw new Error(`Cannot mount at '${t}': inside existing mount '${n}'`);if(n.startsWith(`${t}/`))throw new Error(`Cannot mount at '${t}': would contain existing mount '${n}'`)}}routePath(t){lt(t,"access");let n=ke(t),r=null,s=0;for(let i of this.mounts.values()){let o=i.mountPoint;if(n===o)return{fs:i.filesystem,relativePath:"/"};n.startsWith(`${o}/`)&&o.length>s&&(r=i,s=o.length)}if(r){let i=n.slice(s);return{fs:r.filesystem,relativePath:i||"/"}}return{fs:this.baseFs,relativePath:n}}getChildMountPoints(t){let n=ke(t),r=n==="/"?"/":`${n}/`,s=[];for(let i of this.mounts.keys())if(i.startsWith(r)){let a=i.slice(r.length).split("/")[0];a&&!s.includes(a)&&s.push(a)}return s}async readFile(t,n){let{fs:r,relativePath:s}=this.routePath(t);return r.readFile(s,n)}async readFileBytes(t){let{fs:n,relativePath:r}=this.routePath(t);return Bn(n,r)}async readFileBuffer(t){let{fs:n,relativePath:r}=this.routePath(t);return n.readFileBuffer(r)}async writeFile(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.writeFile(i,n,r)}async appendFile(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.appendFile(i,n,r)}async exists(t){let n=ke(t);if(this.mounts.has(n)||this.getChildMountPoints(n).length>0)return!0;let{fs:s,relativePath:i}=this.routePath(t);return s.exists(i)}async stat(t){let n=ke(t),r=this.mounts.get(n);if(r)try{return await r.filesystem.stat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(n).length>0)try{return await this.baseFs.stat(n)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:o}=this.routePath(t);return i.stat(o)}async lstat(t){let n=ke(t),r=this.mounts.get(n);if(r)try{return await r.filesystem.lstat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(n).length>0)try{return await this.baseFs.lstat(n)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:o}=this.routePath(t);return i.lstat(o)}async mkdir(t,n){let r=ke(t);if(this.mounts.has(r)){if(n?.recursive)return;throw new Error(`EEXIST: directory already exists, mkdir '${t}'`)}if(this.getChildMountPoints(r).length>0&&n?.recursive)return;let{fs:i,relativePath:o}=this.routePath(t);return i.mkdir(o,n)}async readdir(t){let n=ke(t),r=new Set,s=null,{fs:i,relativePath:o}=this.routePath(t);try{let l=await i.readdir(o);for(let c of l)r.add(c)}catch(l){let c=l.code,u=l.message||"";if(c!=="ENOENT"&&!u.includes("ENOENT"))throw l;s=l}let a=this.getChildMountPoints(n);for(let l of a)r.add(l);if(r.size===0&&s&&!this.mounts.has(n))throw s;return Array.from(r).sort()}async rm(t,n){let r=ke(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot remove '${t}'`);if(this.getChildMountPoints(r).length>0)throw new Error(`EBUSY: contains mount points, cannot remove '${t}'`);let{fs:i,relativePath:o}=this.routePath(t);return i.rm(o,n)}async cp(t,n,r){let s=this.routePath(t),i=this.routePath(n);return s.fs===i.fs?s.fs.cp(s.relativePath,i.relativePath,r):this.crossMountCopy(t,n,r)}async mv(t,n){let r=ke(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot move '${t}'`);let s=this.routePath(t),i=this.routePath(n);if(s.fs===i.fs)return s.fs.mv(s.relativePath,i.relativePath);await this.cp(t,n,{recursive:!0}),await this.rm(t,{recursive:!0})}resolvePath(t,n){return pa(t,n)}getAllPaths(){let t=new Set;for(let n of this.baseFs.getAllPaths())t.add(n);for(let n of this.mounts.keys()){let r=n.split("/").filter(Boolean),s="";for(let o of r)s=`${s}/${o}`,t.add(s);let i=this.mounts.get(n);if(i)for(let o of i.filesystem.getAllPaths())o==="/"?t.add(n):t.add(`${n}${o}`)}return Array.from(t).sort()}async chmod(t,n){let r=ke(t),s=this.mounts.get(r);if(s)return s.filesystem.chmod("/",n);let{fs:i,relativePath:o}=this.routePath(t);return i.chmod(o,n)}async symlink(t,n){let{fs:r,relativePath:s}=this.routePath(n);return r.symlink(t,s)}async link(t,n){let r=this.routePath(t),s=this.routePath(n);if(r.fs!==s.fs)throw new Error(`EXDEV: cross-device link not permitted, link '${t}' -> '${n}'`);return r.fs.link(r.relativePath,s.relativePath)}async readlink(t){let{fs:n,relativePath:r}=this.routePath(t);return n.readlink(r)}async realpath(t){let n=ke(t);if(this.mounts.get(n))return n;let{fs:s,relativePath:i}=this.routePath(t),o=await s.realpath(i);for(let[a,l]of this.mounts)if(n===a||n.startsWith(`${a}/`))return o==="/"?a:`${a}${o}`;return o}async crossMountCopy(t,n,r){let s=await this.lstat(t);if(s.isFile){let i=await this.readFileBuffer(t);await this.writeFile(n,i),await this.chmod(n,s.mode)}else if(s.isDirectory){if(!r?.recursive)throw new Error(`cp: ${t} is a directory (not copied)`);await this.mkdir(n,{recursive:!0});let i=await this.readdir(t);for(let o of i){let a=br(t,o),l=br(n,o);await this.crossMountCopy(a,l,r)}}else if(s.isSymbolicLink){let i=await this.readlink(t);await this.symlink(i,n)}}async utimes(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.utimes(i,n,r)}};export{w1 as Bash,lr as InMemoryFs,al as MountableFs,Ln as NetworkAccessDeniedError,Js as RedirectNotAllowedError,Ys as TooManyRedirectsError,Tv as defineCommand,Nv as getCommandNames,Iv as getNetworkCommandNames};
1570
+ `)}var YI=new TextDecoder("utf-8",{fatal:!0});function d3(e){if(!e)return e;let t=!1,n=!1;for(let o=0;o<e.length;o++){let a=e.charCodeAt(o);a>255?n=!0:a>127&&(t=!0)}if(!t)return e;let r=[],s=new TextEncoder;for(let o=0;o<e.length;o++){let a=e.charCodeAt(o);if(a>255){let l=s.encode(e[o]);for(let c=0;c<l.length;c++)r.push(l[c])}else r.push(a)}let i=new Uint8Array(r);try{return YI.decode(i)}catch{return e}}function JI(e,t){if(e!==void 0)return t==="bytes"?e:Un(e)}ge();var al=class{baseFs;mounts=new Map;constructor(t){if(this.baseFs=t?.base??new lr,t?.mounts)for(let{mountPoint:n,filesystem:r}of t.mounts)this.mount(n,r)}mount(t,n){this.validateMountPath(t);let r=ke(t);this.validateMount(r),this.mounts.set(r,{mountPoint:r,filesystem:n})}unmount(t){let n=ke(t);if(!this.mounts.has(n))throw new Error(`No filesystem mounted at '${t}'`);this.mounts.delete(n)}getMounts(){return Array.from(this.mounts.values()).map(t=>({mountPoint:t.mountPoint,filesystem:t.filesystem}))}isMountPoint(t){let n=ke(t);return this.mounts.has(n)}validateMountPath(t){let n=t.split("/");for(let r of n)if(r==="."||r==="..")throw new Error(`Invalid mount point '${t}': contains '.' or '..' segments`)}validateMount(t){if(t==="/")throw new Error("Cannot mount at root '/'");for(let n of this.mounts.keys())if(n!==t){if(t.startsWith(`${n}/`))throw new Error(`Cannot mount at '${t}': inside existing mount '${n}'`);if(n.startsWith(`${t}/`))throw new Error(`Cannot mount at '${t}': would contain existing mount '${n}'`)}}routePath(t){lt(t,"access");let n=ke(t),r=null,s=0;for(let i of this.mounts.values()){let o=i.mountPoint;if(n===o)return{fs:i.filesystem,relativePath:"/"};n.startsWith(`${o}/`)&&o.length>s&&(r=i,s=o.length)}if(r){let i=n.slice(s);return{fs:r.filesystem,relativePath:i||"/"}}return{fs:this.baseFs,relativePath:n}}getChildMountPoints(t){let n=ke(t),r=n==="/"?"/":`${n}/`,s=[];for(let i of this.mounts.keys())if(i.startsWith(r)){let a=i.slice(r.length).split("/")[0];a&&!s.includes(a)&&s.push(a)}return s}async readFile(t,n){let{fs:r,relativePath:s}=this.routePath(t);return r.readFile(s,n)}async readFileBytes(t){let{fs:n,relativePath:r}=this.routePath(t);return Bn(n,r)}async readFileBuffer(t){let{fs:n,relativePath:r}=this.routePath(t);return n.readFileBuffer(r)}async writeFile(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.writeFile(i,n,r)}async appendFile(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.appendFile(i,n,r)}async exists(t){let n=ke(t);if(this.mounts.has(n)||this.getChildMountPoints(n).length>0)return!0;let{fs:s,relativePath:i}=this.routePath(t);return s.exists(i)}async stat(t){let n=ke(t),r=this.mounts.get(n);if(r)try{return await r.filesystem.stat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(n).length>0)try{return await this.baseFs.stat(n)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:o}=this.routePath(t);return i.stat(o)}async lstat(t){let n=ke(t),r=this.mounts.get(n);if(r)try{return await r.filesystem.lstat("/")}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}if(this.getChildMountPoints(n).length>0)try{return await this.baseFs.lstat(n)}catch{return{isFile:!1,isDirectory:!0,isSymbolicLink:!1,mode:493,size:0,mtime:new Date}}let{fs:i,relativePath:o}=this.routePath(t);return i.lstat(o)}async mkdir(t,n){let r=ke(t);if(this.mounts.has(r)){if(n?.recursive)return;throw new Error(`EEXIST: directory already exists, mkdir '${t}'`)}if(this.getChildMountPoints(r).length>0&&n?.recursive)return;let{fs:i,relativePath:o}=this.routePath(t);return i.mkdir(o,n)}async readdir(t){let n=ke(t),r=new Set,s=null,{fs:i,relativePath:o}=this.routePath(t);try{let l=await i.readdir(o);for(let c of l)r.add(c)}catch(l){let c=l.code,u=l.message||"";if(c!=="ENOENT"&&!u.includes("ENOENT"))throw l;s=l}let a=this.getChildMountPoints(n);for(let l of a)r.add(l);if(r.size===0&&s&&!this.mounts.has(n))throw s;return Array.from(r).sort()}async rm(t,n){let r=ke(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot remove '${t}'`);if(this.getChildMountPoints(r).length>0)throw new Error(`EBUSY: contains mount points, cannot remove '${t}'`);let{fs:i,relativePath:o}=this.routePath(t);return i.rm(o,n)}async cp(t,n,r){let s=this.routePath(t),i=this.routePath(n);return s.fs===i.fs?s.fs.cp(s.relativePath,i.relativePath,r):this.crossMountCopy(t,n,r)}async mv(t,n){let r=ke(t);if(this.mounts.has(r))throw new Error(`EBUSY: mount point, cannot move '${t}'`);let s=this.routePath(t),i=this.routePath(n);if(s.fs===i.fs)return s.fs.mv(s.relativePath,i.relativePath);await this.cp(t,n,{recursive:!0}),await this.rm(t,{recursive:!0})}resolvePath(t,n){return pa(t,n)}getAllPaths(){let t=new Set;for(let n of this.baseFs.getAllPaths())t.add(n);for(let n of this.mounts.keys()){let r=n.split("/").filter(Boolean),s="";for(let o of r)s=`${s}/${o}`,t.add(s);let i=this.mounts.get(n);if(i)for(let o of i.filesystem.getAllPaths())o==="/"?t.add(n):t.add(`${n}${o}`)}return Array.from(t).sort()}async chmod(t,n){let r=ke(t),s=this.mounts.get(r);if(s)return s.filesystem.chmod("/",n);let{fs:i,relativePath:o}=this.routePath(t);return i.chmod(o,n)}async symlink(t,n){let{fs:r,relativePath:s}=this.routePath(n);return r.symlink(t,s)}async link(t,n){let r=this.routePath(t),s=this.routePath(n);if(r.fs!==s.fs)throw new Error(`EXDEV: cross-device link not permitted, link '${t}' -> '${n}'`);return r.fs.link(r.relativePath,s.relativePath)}async readlink(t){let{fs:n,relativePath:r}=this.routePath(t);return n.readlink(r)}async realpath(t){let n=ke(t);if(this.mounts.get(n))return n;let{fs:s,relativePath:i}=this.routePath(t),o=await s.realpath(i);for(let[a,l]of this.mounts)if(n===a||n.startsWith(`${a}/`))return o==="/"?a:`${a}${o}`;return o}async crossMountCopy(t,n,r){let s=await this.lstat(t);if(s.isFile){let i=await this.readFileBuffer(t);await this.writeFile(n,i),await this.chmod(n,s.mode)}else if(s.isDirectory){if(!r?.recursive)throw new Error(`cp: ${t} is a directory (not copied)`);await this.mkdir(n,{recursive:!0});let i=await this.readdir(t);for(let o of i){let a=br(t,o),l=br(n,o);await this.crossMountCopy(a,l,r)}}else if(s.isSymbolicLink){let i=await this.readlink(t);await this.symlink(i,n)}}async utimes(t,n,r){let{fs:s,relativePath:i}=this.routePath(t);return s.utimes(i,n,r)}};export{w1 as Bash,lr as InMemoryFs,al as MountableFs,Ln as NetworkAccessDeniedError,Js as RedirectNotAllowedError,Ys as TooManyRedirectsError,Tv as defineCommand,Nv as getCommandNames,Iv as getNetworkCommandNames};
1571
1571
  /*! Bundled license information:
1572
1572
 
1573
1573
  re2js/build/index.esm.js:
@@ -1,2 +1,2 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a,b}from"./chunk-LNBPBRV4.js";import"./chunk-DLL7UR66.js";import"./chunk-L64BMZUV.js";import"./chunk-TN7HHBQW.js";import"./chunk-4RUAZWKT.js";import"./chunk-NRSASXYY.js";import"./chunk-SAI2SPQQ.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as awkCommand2,b as flagsForFuzzing};
2
+ import{a,b}from"./chunk-XY467F65.js";import"./chunk-DLL7UR66.js";import"./chunk-L64BMZUV.js";import"./chunk-TN7HHBQW.js";import"./chunk-4RUAZWKT.js";import"./chunk-6JHJPYPW.js";import"./chunk-SAI2SPQQ.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as awkCommand2,b as flagsForFuzzing};
@@ -1,2 +1,2 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a,b}from"./chunk-CN5XGDNN.js";import"./chunk-NRSASXYY.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as base64Command,b as flagsForFuzzing};
2
+ import{a,b}from"./chunk-CN5XGDNN.js";import"./chunk-6JHJPYPW.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as base64Command,b as flagsForFuzzing};
@@ -1,2 +1,2 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-GSPYNYZA.js";import"./chunk-DLL7UR66.js";import"./chunk-NRSASXYY.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as bashCommand,c as flagsForFuzzing,b as shCommand,d as shFlagsForFuzzing};
2
+ import{a,b,c,d}from"./chunk-K5VKTLDB.js";import"./chunk-DLL7UR66.js";import"./chunk-6JHJPYPW.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as bashCommand,c as flagsForFuzzing,b as shCommand,d as shFlagsForFuzzing};
@@ -1,2 +1,2 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a,b}from"./chunk-4N6J7B5P.js";import"./chunk-YCLFEX4T.js";import"./chunk-NRSASXYY.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as catCommand,b as flagsForFuzzing};
2
+ import{a,b}from"./chunk-MHOVZCXO.js";import"./chunk-4HV7HIHS.js";import"./chunk-6JHJPYPW.js";import"./chunk-STHBFACM.js";import"./chunk-QIQMJJZ4.js";import"./chunk-QAYAQNCG.js";import"./chunk-BZUGFHVS.js";export{a as catCommand,b as flagsForFuzzing};
@@ -1,3 +1,3 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{e as u,f as m}from"./chunk-NRSASXYY.js";async function w(t,n,s){let{cmdName:r,allowStdinMarker:d=!0,stopOnError:i=!1,batchSize:f=100}=s;if(n.length===0)return{files:[{filename:"",content:t.stdin}],stderr:"",exitCode:0};let a=[],c="",l=0;for(let o=0;o<n.length;o+=f){let h=n.slice(o,o+f),p=await Promise.all(h.map(async e=>{if(d&&e==="-")return{filename:"-",content:t.stdin,error:null};try{let C=t.fs.resolvePath(t.cwd,e),y=await m(t.fs,C);return{filename:e,content:y,error:null}}catch{return{filename:e,content:u,error:`${r}: ${e}: No such file or directory
2
+ import{e as u,f as m}from"./chunk-6JHJPYPW.js";async function w(t,n,s){let{cmdName:r,allowStdinMarker:d=!0,stopOnError:i=!1,batchSize:f=100}=s;if(n.length===0)return{files:[{filename:"",content:t.stdin}],stderr:"",exitCode:0};let a=[],c="",l=0;for(let o=0;o<n.length;o+=f){let h=n.slice(o,o+f),p=await Promise.all(h.map(async e=>{if(d&&e==="-")return{filename:"-",content:t.stdin,error:null};try{let C=t.fs.resolvePath(t.cwd,e),y=await m(t.fs,C);return{filename:e,content:y,error:null}}catch{return{filename:e,content:u,error:`${r}: ${e}: No such file or directory
3
3
  `}}}));for(let e of p)if(e.error){if(c+=e.error,l=1,i)return{files:a,stderr:c,exitCode:l}}else a.push({filename:e.filename,content:e.content})}return{files:a,stderr:c,exitCode:l}}async function T(t,n,s){let r=await w(t,n,{...s,stopOnError:!0});return r.exitCode!==0?{ok:!1,error:{stdout:"",stderr:r.stderr,exitCode:r.exitCode}}:{ok:!0,content:r.files.map(i=>i.content).join("")}}export{w as a,T as b};
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{c as f}from"./chunk-NRSASXYY.js";import{a,b as c,c as d}from"./chunk-QAYAQNCG.js";var u={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};function p(r){return Array.from(r).reverse().join("")}var g={name:"rev",execute:async(r,s)=>{if(c(r))return a(u);let o=[];for(let e of r)if(e==="--"){let t=r.indexOf(e);o.push(...r.slice(t+1));break}else{if(e.startsWith("-")&&e!=="-")return d("rev",e);o.push(e)}let n="",l=e=>{let t=e.split(`
2
+ import{c as f}from"./chunk-6JHJPYPW.js";import{a,b as c,c as d}from"./chunk-QAYAQNCG.js";var u={name:"rev",summary:"reverse lines characterwise",usage:"rev [file ...]",description:"Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.",examples:["echo 'hello' | rev # Output: olleh","rev file.txt # Reverse each line in file"]};function p(r){return Array.from(r).reverse().join("")}var g={name:"rev",execute:async(r,s)=>{if(c(r))return a(u);let o=[];for(let e of r)if(e==="--"){let t=r.indexOf(e);o.push(...r.slice(t+1));break}else{if(e.startsWith("-")&&e!=="-")return d("rev",e);o.push(e)}let n="",l=e=>{let t=e.split(`
3
3
  `),i=e.endsWith(`
4
4
  `)&&t[t.length-1]==="";return i&&t.pop(),t.map(p).join(`
5
5
  `)+(i?`
@@ -0,0 +1,2 @@
1
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
+ var a=new TextDecoder("utf-8",{fatal:!0}),y=new TextEncoder;function h(t){return t}function B(t){return t}function g(t){let e=t;if(!e)return e;let n=!1,r=!1;for(let o=0;o<e.length;o++){let u=e.charCodeAt(o);u>255?r=!0:u>127&&(n=!0)}if(!n)return e;let i=[],s=new TextEncoder;for(let o=0;o<e.length;o++){let u=e.charCodeAt(o);if(u>255){let d=s.encode(e[o]);for(let c=0;c<d.length;c++)i.push(d[c])}else i.push(u)}let f=new Uint8Array(i);try{return a.decode(f)}catch{return e}}function x(t){if(!t)return t;let e=y.encode(t),n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return n}var b="";function l(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}async function E(t,e){return typeof t.readFileBytes=="function"?t.readFileBytes(e):l(await t.readFileBuffer(e))}function p(t){return t.stdoutKind?t.stdoutKind:t.stdoutEncoding==="binary"?"bytes":"text"}function F(t){return p(t)==="bytes"?t.stdout:x(t.stdout)}function T(t){return{stdout:t,stdoutKind:"text"}}function m(t){return{stdout:t,stdoutKind:"bytes",stdoutEncoding:"binary"}}export{h as a,B as b,g as c,x as d,b as e,E as f,p as g,F as h,T as i,m as j};
@@ -1,2 +1,2 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as m}from"./chunk-EBAPSGAO.js";var s=m("md5sum","md5","compute MD5 message digest"),o={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{s as a,o as b};
2
+ import{a as m}from"./chunk-WWZU6WGV.js";var s=m("md5sum","md5","compute MD5 message digest"),o={name:"md5sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{s as a,o as b};
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{c as D}from"./chunk-NRSASXYY.js";import{a as N}from"./chunk-QIQMJJZ4.js";import{a as H,b as A}from"./chunk-QAYAQNCG.js";var b=class{diff(e,n,t={}){let i;typeof t=="function"?(i=t,t={}):"callback"in t&&(i=t.callback);let d=this.castInput(e,t),o=this.castInput(n,t),s=this.removeEmpty(this.tokenize(d,t)),a=this.removeEmpty(this.tokenize(o,t));return this.diffWithOptionsObj(s,a,t,i)}diffWithOptionsObj(e,n,t,i){var d;let o=l=>{if(l=this.postProcess(l,t),i){setTimeout(function(){i(l)},0);return}else return l},s=n.length,a=e.length,u=1,r=s+a;t.maxEditLength!=null&&(r=Math.min(r,t.maxEditLength));let g=(d=t.timeout)!==null&&d!==void 0?d:1/0,w=Date.now()+g,m=[{oldPos:-1,lastComponent:void 0}],C=this.extractCommon(m[0],n,e,0,t);if(m[0].oldPos+1>=a&&C+1>=s)return o(this.buildValues(m[0].lastComponent,n,e));let P=-1/0,x=1/0,L=()=>{for(let l=Math.max(P,-u);l<=Math.min(x,u);l+=2){let c,h=m[l-1],p=m[l+1];h&&(m[l-1]=void 0);let y=!1;if(p){let S=p.oldPos-l;y=p&&0<=S&&S<s}let v=h&&h.oldPos+1<a;if(!y&&!v){m[l]=void 0;continue}if(!v||y&&h.oldPos<p.oldPos?c=this.addToPath(p,!0,!1,0,t):c=this.addToPath(h,!1,!0,1,t),C=this.extractCommon(c,n,e,l,t),c.oldPos+1>=a&&C+1>=s)return o(this.buildValues(c.lastComponent,n,e))||!0;m[l]=c,c.oldPos+1>=a&&(x=Math.min(x,l-1)),C+1>=s&&(P=Math.max(P,l+1))}u++};if(i)(function l(){setTimeout(function(){if(u>r||Date.now()>w)return i(void 0);L()||l()},0)})();else for(;u<=r&&Date.now()<=w;){let l=L();if(l)return l}}addToPath(e,n,t,i,d){let o=e.lastComponent;return o&&!d.oneChangePerToken&&o.added===n&&o.removed===t?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:t,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:t,previousComponent:o}}}extractCommon(e,n,t,i,d){let o=n.length,s=t.length,a=e.oldPos,u=a-i,r=0;for(;u+1<o&&a+1<s&&this.equals(t[a+1],n[u+1],d);)u++,a++,r++,d.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return r&&!d.oneChangePerToken&&(e.lastComponent={count:r,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,u}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let i=[],d;for(;e;)i.push(e),d=e.previousComponent,delete e.previousComponent,e=d;i.reverse();let o=i.length,s=0,a=0,u=0;for(;s<o;s++){let r=i[s];if(r.removed)r.value=this.join(t.slice(u,u+r.count)),u+=r.count;else{if(!r.added&&this.useLongestToken){let g=n.slice(a,a+r.count);g=g.map(function(w,m){let C=t[u+m];return C.length>w.length?C:w}),r.value=this.join(g)}else r.value=this.join(n.slice(a,a+r.count));a+=r.count,r.added||(u+=r.count)}}return i}};var I=class extends b{constructor(){super(...arguments),this.tokenize=W}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
2
+ import{c as D}from"./chunk-6JHJPYPW.js";import{a as N}from"./chunk-QIQMJJZ4.js";import{a as H,b as A}from"./chunk-QAYAQNCG.js";var b=class{diff(e,n,t={}){let i;typeof t=="function"?(i=t,t={}):"callback"in t&&(i=t.callback);let d=this.castInput(e,t),o=this.castInput(n,t),s=this.removeEmpty(this.tokenize(d,t)),a=this.removeEmpty(this.tokenize(o,t));return this.diffWithOptionsObj(s,a,t,i)}diffWithOptionsObj(e,n,t,i){var d;let o=l=>{if(l=this.postProcess(l,t),i){setTimeout(function(){i(l)},0);return}else return l},s=n.length,a=e.length,u=1,r=s+a;t.maxEditLength!=null&&(r=Math.min(r,t.maxEditLength));let g=(d=t.timeout)!==null&&d!==void 0?d:1/0,w=Date.now()+g,m=[{oldPos:-1,lastComponent:void 0}],C=this.extractCommon(m[0],n,e,0,t);if(m[0].oldPos+1>=a&&C+1>=s)return o(this.buildValues(m[0].lastComponent,n,e));let P=-1/0,x=1/0,L=()=>{for(let l=Math.max(P,-u);l<=Math.min(x,u);l+=2){let c,h=m[l-1],p=m[l+1];h&&(m[l-1]=void 0);let y=!1;if(p){let S=p.oldPos-l;y=p&&0<=S&&S<s}let v=h&&h.oldPos+1<a;if(!y&&!v){m[l]=void 0;continue}if(!v||y&&h.oldPos<p.oldPos?c=this.addToPath(p,!0,!1,0,t):c=this.addToPath(h,!1,!0,1,t),C=this.extractCommon(c,n,e,l,t),c.oldPos+1>=a&&C+1>=s)return o(this.buildValues(c.lastComponent,n,e))||!0;m[l]=c,c.oldPos+1>=a&&(x=Math.min(x,l-1)),C+1>=s&&(P=Math.max(P,l+1))}u++};if(i)(function l(){setTimeout(function(){if(u>r||Date.now()>w)return i(void 0);L()||l()},0)})();else for(;u<=r&&Date.now()<=w;){let l=L();if(l)return l}}addToPath(e,n,t,i,d){let o=e.lastComponent;return o&&!d.oneChangePerToken&&o.added===n&&o.removed===t?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:t,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:t,previousComponent:o}}}extractCommon(e,n,t,i,d){let o=n.length,s=t.length,a=e.oldPos,u=a-i,r=0;for(;u+1<o&&a+1<s&&this.equals(t[a+1],n[u+1],d);)u++,a++,r++,d.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return r&&!d.oneChangePerToken&&(e.lastComponent={count:r,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,u}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){let i=[],d;for(;e;)i.push(e),d=e.previousComponent,delete e.previousComponent,e=d;i.reverse();let o=i.length,s=0,a=0,u=0;for(;s<o;s++){let r=i[s];if(r.removed)r.value=this.join(t.slice(u,u+r.count)),u+=r.count;else{if(!r.added&&this.useLongestToken){let g=n.slice(a,a+r.count);g=g.map(function(w,m){let C=t[u+m];return C.length>w.length?C:w}),r.value=this.join(g)}else r.value=this.join(n.slice(a,a+r.count));a+=r.count,r.added||(u+=r.count)}}return i}};var I=class extends b{constructor(){super(...arguments),this.tokenize=W}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
3
3
  `))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
4
4
  `))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
5
5
  `)&&(e=e.slice(0,-1)),n.endsWith(`
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{c as y}from"./chunk-NRSASXYY.js";import{a as C}from"./chunk-QIQMJJZ4.js";import{a as F,b as x}from"./chunk-QAYAQNCG.js";var H={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},I={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};function v(t,e,o){return e?o?t.split(e):t.split(e).filter(n=>n.length>0):o?t.split(/[ \t]/):t.split(/[ \t]+/).filter(n=>n.length>0)}function T(t){let e=[];for(let o of t)for(let n=0;n<o.length;n++){let l=o[n].length;(e[n]===void 0||l>e[n])&&(e[n]=l)}return e}function W(t,e){if(t.length===0)return"";let o=T(t),n=[];for(let l of t){let c=[];for(let s=0;s<l.length;s++)s===l.length-1?c.push(l[s]):c.push(l[s].padEnd(o[s]));n.push(c.join(e))}return n.join(`
2
+ import{c as y}from"./chunk-6JHJPYPW.js";import{a as C}from"./chunk-QIQMJJZ4.js";import{a as F,b as x}from"./chunk-QAYAQNCG.js";var H={name:"column",summary:"columnate lists",usage:"column [OPTION]... [FILE]...",description:"Format input into multiple columns. By default, fills rows first. Use -t to create a table based on whitespace-delimited input.",options:["-t Create a table (determine columns from input)","-s SEP Input field delimiter (default: whitespace)","-o SEP Output field delimiter (default: two spaces)","-c WIDTH Output width for fill mode (default: 80)","-n Don't merge multiple adjacent delimiters"],examples:["ls | column # Fill columns with ls output","cat data | column -t # Format as table","column -t -s ',' file # Format CSV as table","column -c 40 file # Fill 40-char wide columns"]},I={table:{short:"t",long:"table",type:"boolean"},separator:{short:"s",type:"string"},outputSep:{short:"o",type:"string"},width:{short:"c",type:"number",default:80},noMerge:{short:"n",type:"boolean"}};function v(t,e,o){return e?o?t.split(e):t.split(e).filter(n=>n.length>0):o?t.split(/[ \t]/):t.split(/[ \t]+/).filter(n=>n.length>0)}function T(t){let e=[];for(let o of t)for(let n=0;n<o.length;n++){let l=o[n].length;(e[n]===void 0||l>e[n])&&(e[n]=l)}return e}function W(t,e){if(t.length===0)return"";let o=T(t),n=[];for(let l of t){let c=[];for(let s=0;s<l.length;s++)s===l.length-1?c.push(l[s]):c.push(l[s].padEnd(o[s]));n.push(c.join(e))}return n.join(`
3
3
  `)}function j(t,e,o){if(t.length===0)return"";let n=Math.max(...t.map(a=>a.length)),l=o.length,c=n+l,s=Math.max(1,Math.floor((e+l)/c)),p=Math.ceil(t.length/s),d=[];for(let a=0;a<p;a++){let i=[];for(let r=0;r<s;r++){let m=r*p+a;m<t.length&&(r===s-1||(r+1)*p+a>=t.length?i.push(t[m]):i.push(t[m].padEnd(n)))}d.push(i.join(o))}return d.join(`
4
4
  `)}var S={name:"column",execute:async(t,e)=>{if(x(t))return F(H);let o=C("column",t,I);if(!o.ok)return o.error;let{table:n,separator:l,outputSep:c,width:s,noMerge:p}=o.result.flags,d=o.result.positional,a=c??" ",i;if(d.length===0)i=y(e.stdin)??"";else{let u=[];for(let f of d)if(f==="-")u.push(y(e.stdin)??"");else{let w=e.fs.resolvePath(e.cwd,f),b=await e.fs.readFile(w);if(b===null)return{exitCode:1,stdout:"",stderr:`column: ${f}: No such file or directory
5
5
  `};u.push(b)}i=u.join("")}if(i===""||i.trim()==="")return{exitCode:0,stdout:"",stderr:""};let r=i.split(`
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{c as p}from"./chunk-NRSASXYY.js";import{a as h,b as w,c as b}from"./chunk-QAYAQNCG.js";var g={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};function y(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function N(s,r){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=r,l=[],e="",t=0,o=-1,f=0;for(let c=0;c<s.length;c++){let a=s[c],d=y(a,t,i);t+d>n&&e.length>0?u&&o>=0?(l.push(e.slice(0,o+1)),e=e.slice(o+1)+a,t=t-f-1+d,o=-1,f=0):(l.push(e),e=a,t=d,o=-1,f=0):(e+=a,t+=d,(a===" "||a===" ")&&(o=e.length-1,f=t-d))}return e.length>0&&l.push(e),l.join(`
2
+ import{c as p}from"./chunk-6JHJPYPW.js";import{a as h,b as w,c as b}from"./chunk-QAYAQNCG.js";var g={name:"fold",summary:"wrap each input line to fit in specified width",usage:"fold [OPTION]... [FILE]...",description:"Wrap input lines in each FILE, writing to standard output. If no FILE is specified, standard input is read.",options:["-w WIDTH Use WIDTH columns instead of 80","-s Break at spaces","-b Count bytes rather than columns"],examples:["fold -w 40 file.txt # Wrap at 40 columns","fold -sw 40 file.txt # Word wrap at 40 columns","echo 'long line' | fold -w 5 # Force wrap at 5"]};function y(s,r,n){return n?new TextEncoder().encode(s).length:s===" "?8-r%8:s==="\b"?-1:1}function N(s,r){if(s.length===0)return s;let{width:n,breakAtSpaces:u,countBytes:i}=r,l=[],e="",t=0,o=-1,f=0;for(let c=0;c<s.length;c++){let a=s[c],d=y(a,t,i);t+d>n&&e.length>0?u&&o>=0?(l.push(e.slice(0,o+1)),e=e.slice(o+1)+a,t=t-f-1+d,o=-1,f=0):(l.push(e),e=a,t=d,o=-1,f=0):(e+=a,t+=d,(a===" "||a===" ")&&(o=e.length-1,f=t-d))}return e.length>0&&l.push(e),l.join(`
3
3
  `)}function m(s,r){if(s==="")return"";let n=s.split(`
4
4
  `),u=s.endsWith(`
5
5
  `)&&n[n.length-1]==="";return u&&n.pop(),n.map(l=>N(l,r)).join(`
@@ -1,2 +1,2 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as s}from"./chunk-EBAPSGAO.js";var a=s("sha1sum","sha1","compute SHA1 message digest"),m={name:"sha1sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
2
+ import{a as s}from"./chunk-WWZU6WGV.js";var a=s("sha1sum","sha1","compute SHA1 message digest"),m={name:"sha1sum",flags:[{flag:"-c",type:"boolean"}],needsFiles:!0};export{a,m as b};
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as x}from"./chunk-AQ6FYS2X.js";import{a as z,b as J}from"./chunk-CHFEPBH4.js";import{c as X}from"./chunk-NRSASXYY.js";import{a as Z,b as j,c as q}from"./chunk-QAYAQNCG.js";var ie={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},K={name:"grep",async execute(t,s){if(j(t))return Z(ie);let l=!1,f=!1,c=!1,p=!1,m=!1,a=!1,n=!1,u=!1,y=!1,w=!1,h=!1,d=!1,F=!1,P=!1,B=!1,$=0,T=0,C=0,W=[],A=[],U=[],R=null,I=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.startsWith("-")&&i!=="-"){if(i==="-e"&&r+1<t.length){R=t[++r];continue}if(i.startsWith("--include=")){W.push(i.slice(10));continue}if(i.startsWith("--exclude=")){A.push(i.slice(10));continue}if(i.startsWith("--exclude-dir=")){U.push(i.slice(14));continue}if(i.startsWith("--max-count=")){$=parseInt(i.slice(12),10);continue}let b=i.match(/^-m(\d+)$/);if(b){$=parseInt(b[1],10);continue}if(i==="-m"&&r+1<t.length){$=parseInt(t[++r],10);continue}let o=i.match(/^-([ABC])(\d+)$/);if(o){let e=parseInt(o[2],10);o[1]==="A"?C=e:o[1]==="B"?T=e:o[1]==="C"&&(T=e,C=e);continue}if((i==="-A"||i==="-B"||i==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);i==="-A"?C=e:i==="-B"?T=e:(T=e,C=e);continue}let g=i.startsWith("--")?[i]:i.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")l=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")p=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")a=!0;else if(e==="r"||e==="R"||e==="--recursive")n=!0;else if(e==="w"||e==="--word-regexp")u=!0;else if(e==="x"||e==="--line-regexp")y=!0;else if(e==="E"||e==="--extended-regexp")w=!0;else if(e==="P"||e==="--perl-regexp")h=!0;else if(e==="F"||e==="--fixed-strings")d=!0;else if(e==="o"||e==="--only-matching")F=!0;else if(e==="h"||e==="--no-filename")P=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return q("grep",e);if(e.length===1)return q("grep",`-${e}`)}}else R===null?R=i:I.push(i)}if(R===null)return{stdout:"",stderr:`grep: missing pattern
2
+ import{a as x}from"./chunk-AQ6FYS2X.js";import{a as z,b as J}from"./chunk-CHFEPBH4.js";import{c as X}from"./chunk-6JHJPYPW.js";import{a as Z,b as j,c as q}from"./chunk-QAYAQNCG.js";var ie={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},K={name:"grep",async execute(t,s){if(j(t))return Z(ie);let l=!1,f=!1,c=!1,p=!1,m=!1,a=!1,n=!1,u=!1,y=!1,w=!1,h=!1,d=!1,F=!1,P=!1,B=!1,$=0,T=0,C=0,W=[],A=[],U=[],R=null,I=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.startsWith("-")&&i!=="-"){if(i==="-e"&&r+1<t.length){R=t[++r];continue}if(i.startsWith("--include=")){W.push(i.slice(10));continue}if(i.startsWith("--exclude=")){A.push(i.slice(10));continue}if(i.startsWith("--exclude-dir=")){U.push(i.slice(14));continue}if(i.startsWith("--max-count=")){$=parseInt(i.slice(12),10);continue}let b=i.match(/^-m(\d+)$/);if(b){$=parseInt(b[1],10);continue}if(i==="-m"&&r+1<t.length){$=parseInt(t[++r],10);continue}let o=i.match(/^-([ABC])(\d+)$/);if(o){let e=parseInt(o[2],10);o[1]==="A"?C=e:o[1]==="B"?T=e:o[1]==="C"&&(T=e,C=e);continue}if((i==="-A"||i==="-B"||i==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);i==="-A"?C=e:i==="-B"?T=e:(T=e,C=e);continue}let g=i.startsWith("--")?[i]:i.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")l=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")p=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")a=!0;else if(e==="r"||e==="R"||e==="--recursive")n=!0;else if(e==="w"||e==="--word-regexp")u=!0;else if(e==="x"||e==="--line-regexp")y=!0;else if(e==="E"||e==="--extended-regexp")w=!0;else if(e==="P"||e==="--perl-regexp")h=!0;else if(e==="F"||e==="--fixed-strings")d=!0;else if(e==="o"||e==="--only-matching")F=!0;else if(e==="h"||e==="--no-filename")P=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return q("grep",e);if(e.length===1)return q("grep",`-${e}`)}}else R===null?R=i:I.push(i)}if(R===null)return{stdout:"",stderr:`grep: missing pattern
3
3
  `,exitCode:2};let ee=d?"fixed":w?"extended":h?"perl":"basic",L,O,Q;try{let r=J(R,{mode:ee,ignoreCase:l,wholeWord:u,lineRegexp:y});L=r.regex,O=r.kResetGroup,Q=r.preFilter}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${R}
4
4
  `,exitCode:2}}if(I.length===0&&s.stdin!==void 0){let r=z(X(s.stdin),L,{invertMatch:c,showLineNumbers:f,countOnly:p,filename:"",onlyMatching:F,beforeContext:T,afterContext:C,maxCount:$,kResetGroup:O,preFilter:Q});return B?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(I.length===0)return{stdout:"",stderr:`grep: no input files
5
5
  `,exitCode:2};let M="",S="",D=!1,k=!1,v=[];for(let r of I)if(r.includes("*")||r.includes("?")||r.includes("[")){let i=await re(r,s);if(n)for(let b of i){let o=await H(b.path,s,W,A,U,b.isFile);v.push(...o)}else v.push(...i)}else if(n){let i=await H(r,s,W,A,U);v.push(...i)}else v.push({path:r});let te=(v.length>1||n)&&!P,_=50;for(let r=0;r<v.length;r+=_){let i=v.slice(r,r+_),b=await Promise.all(i.map(async o=>{let g=o.path,e=g.split("/").pop()||g;if(A.length>0&&!n&&A.some(N=>x(e,N,{stripQuotes:!0}))||W.length>0&&!n&&!W.some(N=>x(e,N,{stripQuotes:!0})))return null;try{let N=s.fs.resolvePath(s.cwd,g),G=!1;if(o.isFile===void 0?G=(await s.fs.stat(N)).isDirectory:G=!o.isFile,G)return n?null:{error:`grep: ${g}: Is a directory
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{c as f}from"./chunk-NRSASXYY.js";import{a as m,b as c,c as b}from"./chunk-QAYAQNCG.js";var p={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};function N(r,s,i){let l=String(r);switch(s){case"ln":return l.padEnd(i);case"rn":return l.padStart(i);case"rz":return l.padStart(i,"0");default:return s}}function v(r,s){switch(s){case"a":return!0;case"t":return r.trim().length>0;case"n":return!1;default:return s}}function h(r,s,i){if(r==="")return{output:"",nextNumber:i};let l=r.split(`
2
+ import{c as f}from"./chunk-6JHJPYPW.js";import{a as m,b as c,c as b}from"./chunk-QAYAQNCG.js";var p={name:"nl",summary:"number lines of files",usage:"nl [OPTION]... [FILE]...",description:"Write each FILE to standard output, with line numbers added. If no FILE is specified, standard input is read.",options:["-b STYLE Body numbering style: a (all), t (non-empty), n (none)","-n FORMAT Number format: ln (left), rn (right), rz (right zeros)","-w WIDTH Number width (default: 6)","-s SEP Separator after number (default: TAB)","-v START Starting line number (default: 1)","-i INCR Line number increment (default: 1)"],examples:["nl file.txt # Number non-empty lines","nl -ba file.txt # Number all lines","nl -n rz -w 3 file.txt # Right-justified with zeros","nl -s ': ' file.txt # Use ': ' as separator"]};function N(r,s,i){let l=String(r);switch(s){case"ln":return l.padEnd(i);case"rn":return l.padStart(i);case"rz":return l.padStart(i,"0");default:return s}}function v(r,s){switch(s){case"a":return!0;case"t":return r.trim().length>0;case"n":return!1;default:return s}}function h(r,s,i){if(r==="")return{output:"",nextNumber:i};let l=r.split(`
3
3
  `),t=[],u=i,a=r.endsWith(`
4
4
  `)&&l[l.length-1]==="";a&&l.pop();for(let n of l)if(v(n,s.bodyStyle)){let e=N(u,s.numberFormat,s.width);t.push(`${e}${s.separator}${n}`),u+=s.increment}else{let e=" ".repeat(s.width);t.push(`${e}${s.separator}${n}`)}return{output:t.join(`
5
5
  `)+(a?`
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as U,b as z}from"./chunk-L64BMZUV.js";import{a as I}from"./chunk-TN7HHBQW.js";import{a as A}from"./chunk-4RUAZWKT.js";import{c as P}from"./chunk-NRSASXYY.js";import{k}from"./chunk-SAI2SPQQ.js";import{a as L}from"./chunk-FOCWZZDE.js";import{a as te,b as ne,c as W}from"./chunk-QAYAQNCG.js";var H=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]);function V(i){let e="",t=0,n=!1;for(;t<i.length;){if(i[t]==="["&&!n){if(i[t+1]==="["&&i[t+2]===":"){let s=i.indexOf(":]]",t+3);if(s!==-1){let a=i.slice(t+3,s),r=H.get(a);if(r){e+=`[${r}]`,t=s+3;continue}}}if(i[t+1]==="^"&&i[t+2]==="["&&i[t+3]===":"){let s=i.indexOf(":]]",t+4);if(s!==-1){let a=i.slice(t+4,s),r=H.get(a);if(r){e+=`[^${r}]`,t=s+3;continue}}}e+="[",t++,n=!0,t<i.length&&i[t]==="^"&&(e+="^",t++),t<i.length&&i[t]==="]"&&(e+="\\]",t++);continue}if(n){if(i[t]==="]"){e+="]",t++,n=!1;continue}if(i[t]==="["&&i[t+1]===":"){let s=i.indexOf(":]",t+2);if(s!==-1){let a=i.slice(t+2,s),r=H.get(a);if(r){e+=r,t=s+2;continue}}}if(i[t]==="\\"&&t+1<i.length){e+=i[t]+i[t+1],t+=2;continue}e+=i[t],t++;continue}if(i[t]==="\\"&&t+1<i.length){let s=i[t+1];if(s==="+"||s==="?"||s==="|"){e+=s,t+=2;continue}if(s==="("||s===")"){e+=s,t+=2;continue}if(s==="{"||s==="}"){e+=s,t+=2;continue}if(s==="t"){e+=" ",t+=2;continue}if(s==="n"){e+=`
2
+ import{a as U,b as z}from"./chunk-L64BMZUV.js";import{a as I}from"./chunk-TN7HHBQW.js";import{a as A}from"./chunk-4RUAZWKT.js";import{c as P}from"./chunk-6JHJPYPW.js";import{k}from"./chunk-SAI2SPQQ.js";import{a as L}from"./chunk-FOCWZZDE.js";import{a as te,b as ne,c as W}from"./chunk-QAYAQNCG.js";var H=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]);function V(i){let e="",t=0,n=!1;for(;t<i.length;){if(i[t]==="["&&!n){if(i[t+1]==="["&&i[t+2]===":"){let s=i.indexOf(":]]",t+3);if(s!==-1){let a=i.slice(t+3,s),r=H.get(a);if(r){e+=`[${r}]`,t=s+3;continue}}}if(i[t+1]==="^"&&i[t+2]==="["&&i[t+3]===":"){let s=i.indexOf(":]]",t+4);if(s!==-1){let a=i.slice(t+4,s),r=H.get(a);if(r){e+=`[^${r}]`,t=s+3;continue}}}e+="[",t++,n=!0,t<i.length&&i[t]==="^"&&(e+="^",t++),t<i.length&&i[t]==="]"&&(e+="\\]",t++);continue}if(n){if(i[t]==="]"){e+="]",t++,n=!1;continue}if(i[t]==="["&&i[t+1]===":"){let s=i.indexOf(":]",t+2);if(s!==-1){let a=i.slice(t+2,s),r=H.get(a);if(r){e+=r,t=s+2;continue}}}if(i[t]==="\\"&&t+1<i.length){e+=i[t]+i[t+1],t+=2;continue}e+=i[t],t++;continue}if(i[t]==="\\"&&t+1<i.length){let s=i[t+1];if(s==="+"||s==="?"||s==="|"){e+=s,t+=2;continue}if(s==="("||s===")"){e+=s,t+=2;continue}if(s==="{"||s==="}"){e+=s,t+=2;continue}if(s==="t"){e+=" ",t+=2;continue}if(s==="n"){e+=`
3
3
  `,t+=2;continue}if(s==="r"){e+="\r",t+=2;continue}e+=i[t]+s,t+=2;continue}if(i[t]==="+"||i[t]==="?"||i[t]==="|"||i[t]==="("||i[t]===")"){e+=`\\${i[t]}`,t++;continue}if(i[t]==="^"&&!(e===""||e.endsWith("("))){e+="\\^",t++;continue}if(i[t]==="$"){let s=t===i.length-1,a=t+2<i.length&&i[t+1]==="\\"&&i[t+2]===")";if(!s&&!a){e+="\\$",t++;continue}}e+=i[t],t++}return e}function X(i){let e="",t=!1;for(let n=0;n<i.length;n++)i[n]==="["&&!t?(t=!0,e+="[",n++,n<i.length&&i[n]==="^"&&(e+="^",n++),n<i.length&&i[n]==="]"&&(e+="]",n++),n--):i[n]==="]"&&t?(t=!1,e+="]"):!t&&i[n]==="{"&&i[n+1]===","?(e+="{0,",n++):e+=i[n];return e}function ie(i){let e="";for(let t=0;t<i.length;t++){let n=i[t],s=n.charCodeAt(0);n==="\\"?e+="\\\\":n===" "?e+="\\t":n===`
4
4
  `?e+=`$
5
5
  `:n==="\r"?e+="\\r":n==="\x07"?e+="\\a":n==="\b"?e+="\\b":n==="\f"?e+="\\f":n==="\v"?e+="\\v":s<32||s>=127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=n}return`${e}$`}var pe=1e4;function re(i,e,t){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:i,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],rangeStates:t||new Map,linesConsumedInCycle:0}}function me(i){return typeof i=="object"&&"first"in i&&"step"in i}function ge(i){return typeof i=="object"&&"offset"in i}function N(i,e,t,n,s){if(i==="$")return e===t;if(typeof i=="number")return e===i;if(me(i)){let{first:a,step:r}=i;return r===0?e===a:(e-a)%r===0&&e>=a}if(typeof i=="object"&&"pattern"in i)try{let a=i.pattern;a===""&&s?.lastPattern?a=s.lastPattern:a!==""&&s&&(s.lastPattern=a);let r=X(V(a));return A(r).test(n)}catch{return!1}return!1}function G(i){let e=t=>t===void 0?"undefined":t==="$"?"$":typeof t=="number"?String(t):"pattern"in t?`/${t.pattern}/`:"first"in t?`${t.first}~${t.step}`:"unknown";return`${e(i.start)},${e(i.end)}`}function be(i,e,t,n,s,a){if(!i||!i.start&&!i.end)return!0;let r=i.start,l=i.end;if(r!==void 0&&l===void 0)return N(r,e,t,n,a);if(r!==void 0&&l!==void 0){let c=typeof r=="object"&&"pattern"in r,f=typeof l=="object"&&"pattern"in l,p=ge(l);if(p&&s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active){let E=d.startLine||e;return e>=E+l.offset&&(d.active=!1,s.set(g,d)),!0}else return N(r,e,t,n,a)?(d.active=!0,d.startLine=e,s.set(g,d),l.offset===0&&(d.active=!1,s.set(g,d)),!0):!1}if(!c&&!f&&!p){let g=typeof r=="number"?r:r==="$"?t:1,d=typeof l=="number"?l:t;if(g<=d)return e>=g&&e<=d;if(s){let E=G(i),u=s.get(E);return u||(u={active:!1},s.set(E,u)),!u.completed&&e>=g?(u.completed=!0,s.set(E,u),!0):!1}return!1}if(s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active)return N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0;{if(d.completed)return!1;let E=!1;return typeof r=="number"?E=e>=r:E=N(r,e,t,n,a),E?(d.active=!0,d.startLine=e,s.set(g,d),N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0):!1}}return N(r,e,t,n,a)}return!0}function w(i,e,t,n,s,a){let r=be(i,e,t,n,s,a);return i?.negated?!r:r}function Ee(i,e,t,n){let s="",a=0,r=!1;for(;a<=i.length;){e.lastIndex=a;let l=e.exec(i);if(!l){s+=i.slice(a);break}if(l.index!==a){s+=i.slice(a,l.index),a=l.index,r=!1;continue}let c=l[0],f=l.slice(1);if(r&&c.length===0){if(a<i.length)s+=i[a],a++;else break;r=!1;continue}if(s+=n(c,f),r=!1,c.length===0)if(a<i.length)s+=i[a],a++;else break;else a+=c.length,r=!0}return s}function j(i,e,t){let n="",s=0;for(;s<i.length;){if(i[s]==="\\"&&s+1<i.length){let a=i[s+1];if(a==="&"){n+="&",s+=2;continue}if(a==="n"){n+=`
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as T}from"./chunk-YCLFEX4T.js";import{c as b}from"./chunk-NRSASXYY.js";import{a as M}from"./chunk-QIQMJJZ4.js";import{a as S,b as F}from"./chunk-QAYAQNCG.js";var H={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},O={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},N={name:"wc",async execute(a,f){if(F(a))return S(H);let s=M("wc",a,O);if(!s.ok)return s.error;let{lines:o,words:n}=s.result.flags,l=s.result.flags.bytes,e=s.result.flags.chars,t=s.result.positional;!o&&!n&&!l&&!e&&(o=n=l=!0);let c=l||e,i=await T(f,t,{cmdName:"wc",stopOnError:!1});if(t.length===0){let r=C(i.files[0].content,e);return{stdout:`${x(r,o,n,c,"",0)}
2
+ import{a as T}from"./chunk-4HV7HIHS.js";import{c as b}from"./chunk-6JHJPYPW.js";import{a as M}from"./chunk-QIQMJJZ4.js";import{a as S,b as F}from"./chunk-QAYAQNCG.js";var H={name:"wc",summary:"print newline, word, and byte counts for each file",usage:"wc [OPTION]... [FILE]...",options:["-c, --bytes print the byte counts","-m, --chars print the character counts","-l, --lines print the newline counts","-w, --words print the word counts"," --help display this help and exit"]},O={lines:{short:"l",long:"lines",type:"boolean"},words:{short:"w",long:"words",type:"boolean"},bytes:{short:"c",long:"bytes",type:"boolean"},chars:{short:"m",long:"chars",type:"boolean"}},N={name:"wc",async execute(a,f){if(F(a))return S(H);let s=M("wc",a,O);if(!s.ok)return s.error;let{lines:o,words:n}=s.result.flags,l=s.result.flags.bytes,e=s.result.flags.chars,t=s.result.positional;!o&&!n&&!l&&!e&&(o=n=l=!0);let c=l||e,i=await T(f,t,{cmdName:"wc",stopOnError:!1});if(t.length===0){let r=C(i.files[0].content,e);return{stdout:`${x(r,o,n,c,"",0)}
3
3
  `,stderr:"",exitCode:0}}let d=[],m=0,g=0,u=0;for(let{filename:r,content:y}of i.files){let p=C(y,e);m+=p.lines,g+=p.words,u+=p.third,d.push({filename:r,stats:p})}let L=t.length>1?m:Math.max(...d.map(r=>r.stats.lines)),$=t.length>1?g:Math.max(...d.map(r=>r.stats.words)),B=t.length>1?u:Math.max(...d.map(r=>r.stats.third)),h=t.length>1?3:0;o&&(h=Math.max(h,String(L).length)),n&&(h=Math.max(h,String($).length)),c&&(h=Math.max(h,String(B).length));let w="";for(let{filename:r,stats:y}of d)w+=`${x(y,o,n,c,r,h)}
4
4
  `;return t.length>1&&(w+=`${x({lines:m,words:g,third:u},o,n,c,"total",h)}
5
5
  `),{stdout:w,stderr:i.stderr,exitCode:i.exitCode}}};function C(a,f){let s=a,o=s.length,n=f?Array.from(b(a)).length:o,l=0,e=0,t=!1;for(let c=0;c<o;c++){let i=s[c];i===`
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{c as u}from"./chunk-DLL7UR66.js";import{c as l}from"./chunk-NRSASXYY.js";import{a as d,b as h}from"./chunk-QAYAQNCG.js";var m={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},F={name:"bash",async execute(t,e){if(h(t))return d(m);if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"bash",c=t.slice(3);return r(s,n,c,e)}if(t.length===0){let s=l(e.stdin);return s.trim()?r(s,"bash",[],e):{stdout:"",stderr:"",exitCode:0}}let o=t[0],i=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,o),n=await e.fs.readFile(s);return r(n,o,i,e)}catch{return{stdout:"",stderr:`bash: ${o}: No such file or directory
2
+ import{c as u}from"./chunk-DLL7UR66.js";import{c as l}from"./chunk-6JHJPYPW.js";import{a as d,b as h}from"./chunk-QAYAQNCG.js";var m={name:"bash",summary:"execute shell commands or scripts",usage:"bash [OPTIONS] [SCRIPT_FILE] [ARGUMENTS...]",options:["-c COMMAND execute COMMAND string"," --help display this help and exit"],notes:["Without -c, reads and executes commands from SCRIPT_FILE.","Arguments are passed as $1, $2, etc. to the script.",'$0 is set to the script name (or "bash" with -c).']},F={name:"bash",async execute(t,e){if(h(t))return d(m);if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"bash",c=t.slice(3);return r(s,n,c,e)}if(t.length===0){let s=l(e.stdin);return s.trim()?r(s,"bash",[],e):{stdout:"",stderr:"",exitCode:0}}let o=t[0],i=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,o),n=await e.fs.readFile(s);return r(n,o,i,e)}catch{return{stdout:"",stderr:`bash: ${o}: No such file or directory
3
3
  `,exitCode:127}}}},P={name:"sh",async execute(t,e){if(h(t))return d({...m,name:"sh",summary:"execute shell commands or scripts (POSIX shell)"});if(t[0]==="-c"&&t.length>=2){let s=t[1],n=t[2]||"sh",c=t.slice(3);return r(s,n,c,e)}if(t.length===0){let s=l(e.stdin);return s.trim()?r(s,"sh",[],e):{stdout:"",stderr:"",exitCode:0}}let o=t[0],i=t.slice(1);try{let s=e.fs.resolvePath(e.cwd,o),n=await e.fs.readFile(s);return r(n,o,i,e)}catch{return{stdout:"",stderr:`sh: ${o}: No such file or directory
4
4
  `,exitCode:127}}}};async function r(t,e,o,i){if(!i.exec)return{stdout:"",stderr:`bash: internal error: exec function not available
5
5
  `,exitCode:1};let s=u(i.exportedEnv||{},{0:e,"#":String(o.length),"@":o.join(" "),"*":o.join(" ")});o.forEach((a,p)=>{s[String(p+1)]=a});let n=t;if(n.startsWith("#!")){let a=n.indexOf(`
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as j}from"./chunk-4I3HOE5Z.js";import{c as y}from"./chunk-NRSASXYY.js";import{e as v}from"./chunk-BZUGFHVS.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(",")}
2
+ import{a as j}from"./chunk-4I3HOE5Z.js";import{c as y}from"./chunk-6JHJPYPW.js";import{e as v}from"./chunk-BZUGFHVS.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(",")}
3
3
  `:`${w.default.unparse(r,{columns:e}).replace(/\r\n/g,`
4
4
  `)}
5
5
  `}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
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as q,b as w}from"./chunk-XRFHFXFP.js";import{c as b}from"./chunk-L64BMZUV.js";import{b as E}from"./chunk-TN7HHBQW.js";import{c as x}from"./chunk-NRSASXYY.js";import{a as T,b as g}from"./chunk-FOCWZZDE.js";import{a as C,b as M}from"./chunk-QAYAQNCG.js";import{randomBytes as Y}from"node:crypto";import{existsSync as G}from"node:fs";import{dirname as K,join as $,sep as O}from"node:path";import{fileURLToPath as Z}from"node:url";import{Worker as v}from"node:worker_threads";import ee from"sql.js";function B(e,t,r){switch(r.mode){case"list":return N(e,t,r);case"csv":return R(e,t,r);case"json":return W(e,t);case"line":return F(e,t,r);case"column":return Q(e,t,r);case"table":return U(e,t,r);case"markdown":return H(e,t,r);case"tabs":return J(e,t,r);case"box":return _(e,t,r);case"quote":return z(e,t,r);case"html":return D(e,t,r);case"ascii":return X(e,t,r)}}function f(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function N(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function R(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(L).join(","));for(let a of t)n.push(a.map(o=>L(f(o,r.nullValue))).join(","));return n.length>0?`${n.join(`
2
+ import{a as q,b as w}from"./chunk-XRFHFXFP.js";import{c as b}from"./chunk-L64BMZUV.js";import{b as E}from"./chunk-TN7HHBQW.js";import{c as x}from"./chunk-6JHJPYPW.js";import{a as T,b as g}from"./chunk-FOCWZZDE.js";import{a as C,b as M}from"./chunk-QAYAQNCG.js";import{randomBytes as Y}from"node:crypto";import{existsSync as G}from"node:fs";import{dirname as K,join as $,sep as O}from"node:path";import{fileURLToPath as Z}from"node:url";import{Worker as v}from"node:worker_threads";import ee from"sql.js";function B(e,t,r){switch(r.mode){case"list":return N(e,t,r);case"csv":return R(e,t,r);case"json":return W(e,t);case"line":return F(e,t,r);case"column":return Q(e,t,r);case"table":return U(e,t,r);case"markdown":return H(e,t,r);case"tabs":return J(e,t,r);case"box":return _(e,t,r);case"quote":return z(e,t,r);case"html":return D(e,t,r);case"ascii":return X(e,t,r)}}function f(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function N(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let a of t)n.push(a.map(o=>f(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function R(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(L).join(","));for(let a of t)n.push(a.map(o=>L(f(o,r.nullValue))).join(","));return n.length>0?`${n.join(`
3
3
  `)}
4
4
  `:""}function L(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(`
5
5
  `)?`"${e.replace(/"/g,'""')}"`:e}function A(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function P(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):A(e):JSON.stringify(e)}function W(e,t){return t.length===0?"":`[${t.map(n=>`{${e.map((o,i)=>`${JSON.stringify(o)}:${P(n[i])}`).join(",")}}`).join(`,
@@ -1,5 +1,5 @@
1
1
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
2
- import{a as F,b,c as M,d as He,e as w,f as v,g as Y,h as Z}from"./chunk-VPADYNBD.js";import{a as st}from"./chunk-4I3HOE5Z.js";import{a as $}from"./chunk-LEKBROJD.js";import{f as qe,g as X}from"./chunk-4WKZNNJK.js";import{a as J}from"./chunk-4RUAZWKT.js";import{a as _e}from"./chunk-YCLFEX4T.js";import{c as _}from"./chunk-NRSASXYY.js";import{a as D,b as G}from"./chunk-QAYAQNCG.js";import{b as We,d as et,e as tt,f as nt}from"./chunk-BZUGFHVS.js";var q,Je=We(()=>{"use strict";q=class{input;pos=0;tokens=[];constructor(n){this.input=n}tokenize(){for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let n=this.nextToken();n&&this.tokens.push(n)}return this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}skipWhitespace(){for(;this.pos<this.input.length;){let n=this.input[this.pos];if(n===" "||n===" "||n===`
2
+ import{a as F,b,c as M,d as He,e as w,f as v,g as Y,h as Z}from"./chunk-KHCKEMD6.js";import{a as st}from"./chunk-4I3HOE5Z.js";import{a as $}from"./chunk-LEKBROJD.js";import{f as qe,g as X}from"./chunk-4WKZNNJK.js";import{a as J}from"./chunk-4RUAZWKT.js";import{a as _e}from"./chunk-4HV7HIHS.js";import{c as _}from"./chunk-6JHJPYPW.js";import{a as D,b as G}from"./chunk-QAYAQNCG.js";import{b as We,d as et,e as tt,f as nt}from"./chunk-BZUGFHVS.js";var q,Je=We(()=>{"use strict";q=class{input;pos=0;tokens=[];constructor(n){this.input=n}tokenize(){for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let n=this.nextToken();n&&this.tokens.push(n)}return this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}skipWhitespace(){for(;this.pos<this.input.length;){let n=this.input[this.pos];if(n===" "||n===" "||n===`
3
3
  `||n==="\r")this.pos++;else if(n==="#")for(;this.pos<this.input.length&&this.input[this.pos]!==`
4
4
  `;)this.pos++;else break}}nextToken(){let n=this.pos,t=this.input[this.pos];if(t>="0"&&t<="9")return this.readNumber();if(t==='"'||t==="'"||t==="`")return this.readString(t);if(t==="b"&&this.pos+1<this.input.length){let o=this.input[this.pos+1];if(o==='"'||o==="'"||o==="`")return this.pos++,this.readString(o)}if(t==="/"){let o=this.tokens[this.tokens.length-1];return o&&(o.type==="int"||o.type==="float"||o.type==="string"||o.type==="ident"||o.type===")"||o.type==="]")?this.input[this.pos+1]==="/"?(this.pos+=2,{type:"//",value:"//",pos:n}):(this.pos++,{type:"/",value:"/",pos:n}):this.readRegex()}if(this.match("not in"))return{type:"not in",value:"not in",pos:n};if(this.match("=>"))return{type:"=>",value:"=>",pos:n};if(this.match("**"))return{type:"**",value:"**",pos:n};if(this.match("++"))return{type:"++",value:"++",pos:n};if(this.match("//"))return{type:"//",value:"//",pos:n};if(this.match("=="))return{type:"==",value:"==",pos:n};if(this.match("!="))return{type:"!=",value:"!=",pos:n};if(this.match("<="))return{type:"<=",value:"<=",pos:n};if(this.match(">="))return{type:">=",value:">=",pos:n};if(this.match("&&"))return{type:"&&",value:"&&",pos:n};if(this.match("||"))return{type:"||",value:"||",pos:n};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(t);if(r!==void 0)return this.pos++,{type:r,value:t,pos:n};if(this.isIdentStart(t))return this.readIdentifier();throw new Error(`Unexpected character '${t}' at position ${this.pos}`)}match(n){if(this.input.slice(this.pos,this.pos+n.length)===n){if(/^[a-zA-Z]/.test(n)){let t=this.input[this.pos+n.length];if(t&&this.isIdentChar(t))return!1}return this.pos+=n.length,!0}return!1}isIdentStart(n){return n>="a"&&n<="z"||n>="A"&&n<="Z"||n==="_"}isIdentChar(n){return this.isIdentStart(n)||n>="0"&&n<="9"}readNumber(){let n=this.pos,t=!1,s=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(o>="0"&&o<="9")this.pos++;else if(o==="_")this.pos++;else if(o==="."&&!t&&!s)t=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,t=!0,this.pos++,this.pos<this.input.length&&(this.input[this.pos]==="+"||this.input[this.pos]==="-")&&this.pos++;else break}let r=this.input.slice(n,this.pos).replace(/_/g,"");return{type:t?"float":"int",value:r,pos:n}}readString(n){let t=this.pos;this.pos++;let s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===n)return this.pos++,{type:"string",value:s,pos:t};if(r==="\\"){if(this.pos++,this.pos<this.input.length){let o=this.input[this.pos];switch(o){case"n":s+=`
5
5
  `;break;case"r":s+="\r";break;case"t":s+=" ";break;case"\\":s+="\\";break;case'"':s+='"';break;case"'":s+="'";break;case"`":s+="`";break;case"0":s+="\0";break;default:s+=o}this.pos++}}else s+=r,this.pos++}throw new Error(`Unterminated string starting at position ${t}`)}readRegex(){let n=this.pos;this.pos++;let t="",s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r==="/"){for(this.pos++;this.pos<this.input.length&&this.input[this.pos]==="i";)s+=this.input[this.pos],this.pos++;return{type:"regex",value:t+(s?`/${s}`:""),pos:n}}r==="\\"?(t+=r,this.pos++,this.pos<this.input.length&&(t+=this.input[this.pos],this.pos++)):(t+=r,this.pos++)}throw new Error(`Unterminated regex starting at position ${n}`)}readIdentifier(){let n=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let t=!1;this.pos<this.input.length&&this.input[this.pos]==="?"&&(t=!0,this.pos++);let s=this.input.slice(n,t?this.pos-1:this.pos);t&&(s+="?");let r=new Map([["true","true"],["false","false"],["null","null"],["and","and"],["or","or"],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["in","in"],["as","as"],["_","_"]]),o=s.replace(/\?$/,""),a=r.get(o);return a!==void 0&&!t?{type:a,value:o,pos:n}:{type:"ident",value:s,pos:n}}}});var ze={};et(ze,{parseMoonblade:()=>H,parseNamedExpressions:()=>U});function U(e){let n=[],s=new q(e).tokenize(),r=0,o=()=>s[r]||{type:"eof",value:"",pos:0},a=()=>s[r++];for(;o().type!=="eof";){if(o().type===","&&n.length>0){a();continue}let d=[],u=0,p=r;for(;o().type!=="eof";){let i=o();if((i.type===","||i.type==="as")&&u===0)break;(i.type==="("||i.type==="["||i.type==="{")&&u++,(i.type===")"||i.type==="]"||i.type==="}")&&u--,d.push(a())}d.push({type:"eof",value:"",pos:0});let h=new z(d).parse(),l;if(o().type==="as")if(a(),o().type==="("){a();let i=[];for(;o().type!==")"&&o().type!=="eof";)(o().type==="ident"||o().type==="string")&&(i.push(o().value),a()),o().type===","&&a();o().type===")"&&a(),l=i}else if(o().type==="ident"||o().type==="string")l=o().value,a();else throw new Error(`Expected name after 'as', got ${o().type}`);else l=e.slice(s[p].pos,s[r-1]?.pos||e.length).trim(),h.type==="identifier"&&(l=h.name);n.push({expr:h,name:l})}return n}function H(e){let t=new q(e).tokenize();return new z(t).parse()}var R,z,V=We(()=>{"use strict";Je();R={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},z=class{pos=0;tokens;constructor(n){this.tokens=n}parse(){let n=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return n}parseExpr(n){let t=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r<n)break;t=this.parseInfix(t,r)}return t}parsePrefix(){let n=this.peek();switch(n.type){case"int":return this.advance(),{type:"int",value:Number.parseInt(n.value,10)};case"float":return this.advance(),{type:"float",value:Number.parseFloat(n.value)};case"string":return this.advance(),{type:"string",value:n.value};case"regex":{this.advance();let t=n.value.split("/"),s=t.length>1?t[t.length-1]:"";return{type:"regex",pattern:t.slice(0,-1).join("/")||n.value,caseInsensitive:s.includes("i")}}case"true":return this.advance(),{type:"bool",value:!0};case"false":return this.advance(),{type:"bool",value:!1};case"null":return this.advance(),{type:"null"};case"_":return this.advance(),{type:"underscore"};case"ident":{let t=n.value,s=t.endsWith("?"),r=s?t.slice(0,-1):t;if(this.advance(),this.peek().type==="(")return this.parseFunctionCall(r);if(this.peek().type==="=>"){this.advance();let o=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:[r],body:o},[r])}return{type:"identifier",name:r,unsure:s}}case"(":{this.advance();let t=this.pos;if(this.peek().type===")"){if(this.advance(),this.peek().type==="=>"){this.advance();let r=this.parseExpr(0);return{type:"lambda",params:[],body:r}}throw new Error("Empty parentheses not allowed")}if(this.peek().type==="ident"){let r=[this.peek().value];this.advance();let o=!0;for(;this.peek().type===",";)if(this.advance(),this.peek().type==="ident")r.push(this.peek().value),this.advance();else{o=!1;break}if(o&&this.peek().type===")"&&this.peekAt(1).type==="=>"){this.advance(),this.advance();let a=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:a},r)}this.pos=t}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let t=this.parseExpr(R.UNARY);return t.type==="int"?{type:"int",value:-t.value}:t.type==="float"?{type:"float",value:-t.value}:{type:"func",name:"neg",args:[{expr:t}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(R.UNARY)}]};default:throw new Error(`Unexpected token: ${n.type} (${n.value})`)}}parseFunctionCall(n){this.expect("(");let t=[];if(this.peek().type!==")")do{t.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,a=this.pos+1;a<this.tokens.length&&this.tokens[a].type==="="&&(s=o,this.advance(),this.advance())}let r=this.parseExpr(0);t.push({name:s,expr:r})}while(this.peek().type===",");return this.expect(")"),{type:"func",name:n.toLowerCase(),args:t}}parseList(){this.expect("[");let n=[];if(this.peek().type!=="]")do n.length>0&&this.peek().type===","&&this.advance(),n.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:n}}parseMap(){this.expect("{");let n=[];if(this.peek().type!=="}")do{n.length>0&&this.peek().type===","&&this.advance();let t;if(this.peek().type==="ident")t=this.peek().value,this.advance();else if(this.peek().type==="string")t=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);n.push({key:t,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:n}}parseInfix(n,t){let s=this.peek(),o=new Map([["+","add"],["-","sub"],["*","mul"],["/","div"],["//","idiv"],["%","mod"],["**","pow"],["++","concat"],["==","=="],["!=","!="],["<","<"],["<=","<="],[">",">"],[">=",">="],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["&&","and"],["and","and"],["||","or"],["or","or"]]).get(s.type);if(o!==void 0){this.advance();let a=this.parseExpr(t+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:n},{expr:a}]}}if(s.type==="|"){this.advance();let a=this.parseExpr(t);return this.handlePipe(n,a)}if(s.type===".")return this.advance(),this.handleDot(n);if(s.type==="[")return this.advance(),this.handleIndexing(n);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(t+1)},{expr:n}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(t+1)},{expr:n}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(n,t){if(t.type==="identifier")return{type:"func",name:t.name,args:[{expr:n}]};if(t.type==="func"){let s=this.countUnderscores(t);return s===0?t:s===1?this.fillUnderscore(t,n):{type:"pipeline",exprs:[n,t]}}return this.countUnderscores(t)===1?this.fillUnderscore(t,n):t}handleDot(n){let t=this.peek();if(t.type==="ident"){let s=t.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:n}),r}return{type:"func",name:"get",args:[{expr:n},{expr:{type:"string",value:s}}]}}if(t.type==="int"){let s=Number.parseInt(t.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:n},{expr:{type:"int",value:s}}]}}if(t.type==="string"){let s=t.value;return this.advance(),{type:"func",name:"get",args:[{expr:n},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${t.type}`)}handleIndexing(n){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:n},{expr:{type:"int",value:0}},{expr:s}]}}let t=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:n},{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:n},{expr:t},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:n},{expr:t}]}}countUnderscores(n){return n.type==="underscore"?1:n.type==="func"?n.args.reduce((t,s)=>t+this.countUnderscores(s.expr),0):n.type==="list"?n.elements.reduce((t,s)=>t+this.countUnderscores(s),0):n.type==="map"?n.entries.reduce((t,s)=>t+this.countUnderscores(s.value),0):0}fillUnderscore(n,t){return n.type==="underscore"?t:n.type==="func"?{...n,args:n.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,t)}))}:n.type==="list"?{...n,elements:n.elements.map(s=>this.fillUnderscore(s,t))}:n.type==="map"?{...n,entries:n.entries.map(s=>({...s,value:this.fillUnderscore(s.value,t)}))}:n}bindLambdaArgs(n,t){return{...n,body:this.bindLambdaArgsInExpr(n.body,t)}}bindLambdaArgsInExpr(n,t){return n.type==="identifier"&&t.includes(n.name)?{type:"lambdaBinding",name:n.name}:n.type==="func"?{...n,args:n.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,t)}))}:n.type==="list"?{...n,elements:n.elements.map(s=>this.bindLambdaArgsInExpr(s,t))}:n.type==="map"?{...n,entries:n.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,t)}))}:n}getInfixPrec(n){switch(n){case"|":return R.PIPE;case"||":case"or":return R.OR;case"&&":case"and":return R.AND;case"==":case"!=":case"eq":case"ne":return R.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return R.COMPARISON;case"+":case"-":case"++":return R.ADDITIVE;case"*":case"/":case"//":case"%":return R.MULTIPLICATIVE;case"**":return R.POWER;case".":case"[":return R.POSTFIX;default:return-1}}isRightAssoc(n){return n==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(n){return this.tokens[this.pos+n]||{type:"eof",value:"",pos:0}}advance(){return this.tokens[this.pos++]}expect(n){let t=this.peek();if(t.type!==n)throw new Error(`Expected ${n}, got ${t.type}`);return this.advance()}}});V();function E(e,n){return n.length===0?I(e,[]):n.length===1?{type:"Pipe",left:n[0],right:I(e,[])}:{type:"Pipe",left:n[0],right:I(e,n.slice(1))}}var K={add:e=>S("+",e[0],e[1]),sub:e=>S("-",e[0],e[1]),mul:e=>S("*",e[0],e[1]),div:e=>S("/",e[0],e[1]),mod:e=>S("%",e[0],e[1]),idiv:e=>I("floor",[S("/",e[0],e[1])]),pow:e=>E("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>S("==",e[0],e[1]),"!=":e=>S("!=",e[0],e[1]),"<":e=>S("<",e[0],e[1]),"<=":e=>S("<=",e[0],e[1]),">":e=>S(">",e[0],e[1]),">=":e=>S(">=",e[0],e[1]),eq:e=>S("==",P(e[0]),P(e[1])),ne:e=>S("!=",P(e[0]),P(e[1])),lt:e=>S("<",P(e[0]),P(e[1])),le:e=>S("<=",P(e[0]),P(e[1])),gt:e=>S(">",P(e[0]),P(e[1])),ge:e=>S(">=",P(e[0]),P(e[1])),and:e=>S("and",e[0],e[1]),or:e=>S("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>E("length",e),length:e=>E("length",e),upper:e=>E("ascii_upcase",e),lower:e=>E("ascii_downcase",e),trim:e=>E("trim",e),ltrim:e=>e.length===0?I("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:I("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?I("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:I("rtrimstr",[{type:"Literal",value:" "}])},split:e=>E("split",e),join:e=>e.length===1?I("join",[{type:"Literal",value:""}]):E("join",e),concat:e=>S("+",e[0],e[1]),startswith:e=>E("startswith",e),endswith:e=>E("endswith",e),contains:e=>E("contains",e),replace:e=>E("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:S("+",e[1],e[2])},abs:e=>E("fabs",e),floor:e=>E("floor",e),ceil:e=>E("ceil",e),round:e=>E("round",e),sqrt:e=>E("sqrt",e),log:e=>E("log",e),log10:e=>E("log10",e),log2:e=>E("log2",e),exp:e=>E("exp",e),sin:e=>E("sin",e),cos:e=>E("cos",e),tan:e=>E("tan",e),asin:e=>E("asin",e),acos:e=>E("acos",e),atan:e=>E("atan",e),min:e=>E("min",e),max:e=>E("max",e),first:e=>e.length===0?{type:"Index",index:{type:"Literal",value:0}}:{type:"Index",index:{type:"Literal",value:0},base:e[0]},last:e=>e.length===0?{type:"Index",index:{type:"Literal",value:-1}}:{type:"Index",index:{type:"Literal",value:-1},base:e[0]},get:e=>e.length===1?{type:"Index",index:e[0]}:{type:"Index",index:e[1],base:e[0]},slice:e=>e.length===1?{type:"Slice",base:e[0]}:e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:e[2]},keys:"keys",values:"values",entries:e=>I("to_entries",e),from_entries:"from_entries",reverse:"reverse",sort:"sort",sort_by:"sort_by",group_by:"group_by",unique:"unique",unique_by:"unique_by",flatten:"flatten",map:e=>({type:"Pipe",left:e[0],right:{type:"Array",elements:e[1]}}),select:e=>I("select",e),empty:()=>I("empty",[]),count:()=>I("length",[]),sum:e=>e.length===0?I("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:I("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:S("/",I("add",[]),I("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:S("/",I("add",[]),I("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:S("/",I("add",[]),I("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:S("/",I("add",[]),I("length",[]))},type:"type",isnull:e=>e.length===0?S("==",{type:"Identity"},{type:"Literal",value:null}):S("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?S("==",{type:"Identity"},{type:"Literal",value:""}):S("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?I("tonumber",[]):I("tonumber",e),tostring:e=>e.length===0?I("tostring",[]):I("tostring",e),if:e=>Ke(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:"Literal",value:null};if(e.length===1)return e[0];let[n,...t]=e,s=S("and",S("!=",n,{type:"Literal",value:null}),S("!=",n,{type:"Literal",value:""}));return Ke(s,n,t.length===1?t[0]:K.coalesce(t))},index:()=>({type:"Field",name:"_row_index"}),now:()=>I("now",[]),fmt:e=>I("tostring",e),format:e=>I("tostring",e)};Object.setPrototypeOf(K,null);function S(e,n,t){return{type:"BinaryOp",op:e,left:n,right:t}}function I(e,n){return{type:"Call",name:e,args:n}}var rt="then";function Ke(e,n,t){let s=qe({type:"Cond",cond:e,elifs:[],else:t||{type:"Literal",value:null}});return s[rt]=n,s}function P(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function O(e,n=!0){switch(e.type){case"int":case"float":return{type:"Literal",value:e.value};case"string":return{type:"Literal",value:e.value};case"bool":return{type:"Literal",value:e.value};case"null":return{type:"Literal",value:null};case"underscore":return{type:"Index",base:{type:"Identity"},index:{type:"Literal",value:"_"}};case"identifier":return n?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{let t=e.args.map(r=>O(r.expr,n)),s=Object.hasOwn(K,e.name)?K[e.name]:void 0;return typeof s=="function"?s(t):I(typeof s=="string"?s:e.name,t)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((t,s,r)=>{let o=O(s,n);return r===0?o:{type:"Comma",left:t,right:o}},null)};case"map":return{type:"Object",entries:e.entries.map(t=>({key:t.key,value:O(t.value,n)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?O(e.start,n):void 0,end:e.end?O(e.end,n):void 0};case"lambda":return O(e.body,n);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function ee(e){let n=[],t=0;for(;t<e.length;){for(;t<e.length&&(e[t]===" "||e[t]===",");)t++;if(t>=e.length)break;let s=t;for(;t<e.length&&/\w/.test(e[t]);)t++;let r=e.slice(s,t);for(;t<e.length&&e[t]===" ";)t++;if(e[t]!=="(")break;t++;let o=1,a=t;for(;t<e.length&&o>0;)e[t]==="("?o++:e[t]===")"&&o--,o>0&&t++;let d=e.slice(a,t).trim();for(t++;t<e.length&&e[t]===" ";)t++;let u="";if(e.slice(t,t+3).toLowerCase()==="as "){for(t+=3;t<e.length&&e[t]===" ";)t++;let p=t;for(;t<e.length&&/\w/.test(e[t]);)t++;u=e.slice(p,t)}u||(u=d?`${r}(${d})`:`${r}()`),n.push({func:r,expr:d,alias:u})}return n}function Be(e){return/^\w+$/.test(e)}function Q(e,n,t){let s=O(H(n)),r=$(e,s,t);return r.length>0?r[0]:null}function te(e,n,t={}){let{func:s,expr:r}=n;if(s==="count"&&!r)return e.length;let o;switch(Be(r)?o=e.map(a=>a[r]).filter(a=>a!=null):o=e.map(a=>Q(a,r,t)).filter(a=>a!=null),s){case"count":return Be(r)?o.length:o.filter(a=>!!a).length;case"sum":return o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d))).reduce((d,u)=>d+u,0);case"mean":case"avg":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?a.reduce((d,u)=>d+u,0)/a.length:0}case"min":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?Math.min(...a):null}case"max":{let a=o.map(d=>typeof d=="number"?d:Number.parseFloat(String(d)));return a.length>0?Math.max(...a):null}case"first":return o.length>0?o[0]:null;case"last":return o.length>0?o[o.length-1]:null;case"median":{let a=o.map(u=>typeof u=="number"?u:Number.parseFloat(String(u))).filter(u=>!Number.isNaN(u)).sort((u,p)=>u-p);if(a.length===0)return null;let d=Math.floor(a.length/2);return a.length%2===0?(a[d-1]+a[d])/2:a[d]}case"mode":{let a=new Map;for(let p of o){let c=String(p);a.set(c,(a.get(c)||0)+1)}let d=0,u=null;for(let[p,c]of a)c>d&&(d=c,u=p);return u}case"cardinality":return new Set(o.map(d=>String(d))).size;case"values":return o.map(a=>String(a)).join("|");case"distinct_values":return[...new Set(o.map(d=>String(d)))].sort().join("|");case"all":{if(e.length===0)return!0;for(let a of e)if(!Q(a,r,t))return!1;return!0}case"any":{for(let a of e)if(Q(a,r,t))return!0;return!1}default:return null}}function Ge(e,n,t={}){let s=F();for(let r of n)b(s,r.alias,te(e,r,t));return s}async function ne(e,n){let t="",s=[];for(let c of e)c.startsWith("-")||(t?s.push(c):t=c);if(!t)return{stdout:"",stderr:`xan agg: no aggregation expression
@@ -59,7 +59,7 @@ import{a as F,b,c as M,d as He,e as w,f as v,g as Y,h as Z}from"./chunk-VPADYNBD
59
59
  `,exitCode:1};a=o[0].headers}let d=[];for(let{headers:u,data:p}of o)for(let c of p){let h=F();for(let l of a)b(h,l,u.includes(l)?c[l]:"");d.push(h)}return{stdout:w(a,d),stderr:"",exitCode:0}}async function De(e,n){let t="",s=[],r=!1,o=!1,a=[];for(let i=0;i<e.length;i++){let f=e[i];(f==="-s"||f==="--select")&&i+1<e.length?s=e[++i].split(","):f==="-v"||f==="--invert"?r=!0:f==="-i"||f==="--ignore-case"?o=!0:f==="-r"||f==="--regex"||f.startsWith("-")||(t?a.push(f):t=f)}if(!t)return{stdout:"",stderr:`xan search: no pattern specified
60
60
  `,exitCode:1};let{headers:d,data:u,error:p}=await v(a,n);if(p)return p;let c=s.length>0?s:d,h;try{h=J(t,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${t}'
61
61
  `,exitCode:1}}let l=u.filter(i=>{let f=c.some(m=>{let g=i[m];return g!=null&&h.test(String(g))});return r?!f:f});return{stdout:w(d,l),stderr:"",exitCode:0}}async function Ue(e,n){let t="",s=[];for(let l of e)l.startsWith("-")||(t?s.push(l):t=l);if(!t)return{stdout:"",stderr:`xan flatmap: no expression specified
62
- `,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let u=U(t).map(({expr:l,name:i})=>({alias:typeof i=="string"?i:i[0],ast:O(l)})),p={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},c=[...r,...u.map(l=>l.alias)],h=[];for(let l of o){let i=[],f=1;for(let m of u){let g=$(l,m.ast,p),y=g.length>0&&Array.isArray(g[0])?g[0]:g;i.push(y),f=Math.max(f,y.length)}for(let m=0;m<f;m++){let g=M(l);for(let y=0;y<u.length;y++){let x=i[y][m]??null;b(g,u[y].alias,x)}h.push(g)}}return{stdout:w(c,h),stderr:"",exitCode:0}}async function Ve(e,n){let{cmdView:t}=await import("./xan-view-HDVKHFC2.js");return t(e,n)}var Qe=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),pt=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...Qe]),Ze={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
62
+ `,exitCode:1};let{headers:r,data:o,error:a}=await v(s,n);if(a)return a;let u=U(t).map(({expr:l,name:i})=>({alias:typeof i=="string"?i:i[0],ast:O(l)})),p={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0},c=[...r,...u.map(l=>l.alias)],h=[];for(let l of o){let i=[],f=1;for(let m of u){let g=$(l,m.ast,p),y=g.length>0&&Array.isArray(g[0])?g[0]:g;i.push(y),f=Math.max(f,y.length)}for(let m=0;m<f;m++){let g=M(l);for(let y=0;y<u.length;y++){let x=i[y][m]??null;b(g,u[y].alias,x)}h.push(g)}}return{stdout:w(c,h),stderr:"",exitCode:0}}async function Ve(e,n){let{cmdView:t}=await import("./xan-view-HLIT2HYA.js");return t(e,n)}var Qe=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),pt=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...Qe]),Ze={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
63
63
  It provides a simple, ergonomic interface for common data operations.
64
64
 
65
65
  COMMANDS: