@jerryan/just-bash 3.10.0 → 3.11.0

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 (382) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +2 -2
  3. package/dist/AGENTS.md +2 -2
  4. package/dist/abort-signals.d.ts +10 -0
  5. package/dist/bin/chunks/awk2-LCV2AUIX.js +3 -0
  6. package/dist/bin/{shell/chunks/base64-TQ5KOCNW.js → chunks/base64-OLYCF2PC.js} +1 -1
  7. package/dist/bin/chunks/{cat-BQ7FQTN5.js → cat-UJLF2DU2.js} +1 -1
  8. package/dist/bin/{shell/chunks/chmod-S4ARARR4.js → chunks/chmod-V5F4BXZ2.js} +1 -1
  9. package/dist/bin/chunks/{chunk-V4S4A7M6.js → chunk-2TEF4USR.js} +1 -1
  10. package/dist/bin/chunks/{chunk-N26Y42L6.js → chunk-3M5OMKFS.js} +1 -1
  11. package/dist/bin/chunks/chunk-4NYJ4ZTO.js +17 -0
  12. package/dist/bin/{shell/chunks/chunk-M3Z5NZXT.js → chunks/chunk-572NXISH.js} +1 -1
  13. package/dist/bin/chunks/chunk-5NWK7A4R.js +13 -0
  14. package/dist/bin/{shell/chunks/chunk-YXPSX3SI.js → chunks/chunk-623Q77WZ.js} +1 -1
  15. package/dist/bin/chunks/chunk-6NG4ULJM.js +7 -0
  16. package/dist/bin/chunks/{chunk-QFOXSCOD.js → chunk-726WDFMQ.js} +1 -1
  17. package/dist/bin/chunks/{chunk-4JPWP5WS.js → chunk-AJ3CSZ34.js} +1 -1
  18. package/dist/bin/{shell/chunks/chunk-VTAMGD42.js → chunks/chunk-APEQNYAO.js} +1 -1
  19. package/dist/bin/chunks/chunk-BFLKIASG.js +7 -0
  20. package/dist/bin/chunks/{chunk-IOKQFPM6.js → chunk-BRB5PJ3E.js} +1 -1
  21. package/dist/bin/chunks/{chunk-ZVG47PYA.js → chunk-BVBYPYA5.js} +1 -1
  22. package/dist/bin/chunks/{chunk-K65FCSAT.js → chunk-BZJ77YQD.js} +1 -1
  23. package/dist/bin/{shell/chunks/chunk-GR4ZHKXI.js → chunks/chunk-C2BLJ3AE.js} +1 -1
  24. package/dist/bin/{shell/chunks/chunk-R7THHH4J.js → chunks/chunk-C45GTJTD.js} +1 -1
  25. package/dist/bin/chunks/{chunk-GOWX7VPU.js → chunk-CTS7QXCJ.js} +1 -1
  26. package/dist/bin/chunks/{chunk-42AMF6EE.js → chunk-DTNGYQCJ.js} +1 -1
  27. package/dist/bin/chunks/{chunk-TW2IJRUF.js → chunk-ENEHPI32.js} +1 -1
  28. package/dist/bin/chunks/{chunk-E54Z6VIE.js → chunk-ERYPQAZE.js} +5 -5
  29. package/dist/bin/chunks/{chunk-PQ2INDRF.js → chunk-GB3KUAFV.js} +1 -1
  30. package/dist/bin/{shell/chunks/chunk-E2O6S35K.js → chunks/chunk-HFVQCXYX.js} +1 -1
  31. package/dist/bin/chunks/{chunk-IRCAXXH6.js → chunk-HSWCKN2X.js} +1 -1
  32. package/dist/bin/chunks/{chunk-B6WWC6K3.js → chunk-I6MS5ZWE.js} +1 -1
  33. package/dist/bin/chunks/{chunk-V4U26ZWL.js → chunk-IOFXLMNJ.js} +1 -1
  34. package/dist/bin/chunks/chunk-IX6QY5JW.js +5 -0
  35. package/dist/bin/chunks/{chunk-QKJAAJ7J.js → chunk-IXTPVJ6W.js} +1 -1
  36. package/dist/bin/chunks/{chunk-OUQKFRVR.js → chunk-JBYLHCKP.js} +1 -1
  37. package/dist/bin/chunks/{chunk-NXUXZWS5.js → chunk-JLRB7DV3.js} +1 -1
  38. package/dist/bin/{shell/chunks/chunk-GKJD4ULC.js → chunks/chunk-KH6YLKPE.js} +1 -1
  39. package/dist/bin/{shell/chunks/chunk-Z3TCELKN.js → chunks/chunk-KXSDVBJA.js} +1 -1
  40. package/dist/bin/chunks/{chunk-DYIBFLS3.js → chunk-LOU52GPJ.js} +2 -2
  41. package/dist/bin/{shell/chunks/chunk-L345YZ6R.js → chunks/chunk-LVT5R45K.js} +1 -1
  42. package/dist/bin/{shell/chunks/chunk-PTUQEN6I.js → chunks/chunk-M345X45Z.js} +7 -7
  43. package/dist/bin/chunks/{chunk-MWQMHODV.js → chunk-NDS7PYKD.js} +1 -1
  44. package/dist/bin/chunks/chunk-O3PNT72D.js +3 -0
  45. package/dist/bin/chunks/chunk-OGOISDGZ.js +3 -0
  46. package/dist/bin/chunks/chunk-OSW4MDDH.js +21 -0
  47. package/dist/bin/chunks/{chunk-FPWHWWXO.js → chunk-OXV2B2YS.js} +1 -1
  48. package/dist/bin/chunks/{chunk-QMPZXXEK.js → chunk-OY25E3ZN.js} +1 -1
  49. package/dist/bin/{shell/chunks/chunk-O2BCKSMK.js → chunks/chunk-PEJXCXSY.js} +1 -1
  50. package/dist/bin/{shell/chunks/chunk-6KHZX4HU.js → chunks/chunk-PLLMJHMV.js} +1 -1
  51. package/dist/bin/{shell/chunks/chunk-6TUILMPB.js → chunks/chunk-QELDDRV5.js} +1 -1
  52. package/dist/bin/chunks/{chunk-3FQBUEB6.js → chunk-RC4UXNHA.js} +1 -1
  53. package/dist/bin/{shell/chunks/chunk-H7PD6FLC.js → chunks/chunk-RE7Z53A3.js} +1 -1
  54. package/dist/bin/chunks/chunk-SCQRBEQW.js +275 -0
  55. package/dist/bin/chunks/{chunk-3DWQCLNP.js → chunk-SS2OPV62.js} +1 -1
  56. package/dist/bin/{shell/chunks/chunk-CC2AQ6B7.js → chunks/chunk-U6JTVQU6.js} +1 -1
  57. package/dist/bin/{shell/chunks/chunk-UNCYBFWT.js → chunks/chunk-UFAYH3WW.js} +1 -1
  58. package/dist/bin/chunks/chunk-UPUFWGHR.js +3 -0
  59. package/dist/bin/{shell/chunks/chunk-HARVZWUX.js → chunks/chunk-UU42WPB7.js} +1 -1
  60. package/dist/bin/chunks/{chunk-CNVNOT67.js → chunk-UW4E5XU5.js} +1 -1
  61. package/dist/bin/{shell/chunks/chunk-F4ACJZIY.js → chunks/chunk-WLQ2KWS3.js} +1 -1
  62. package/dist/bin/chunks/{chunk-MVBK66TR.js → chunk-WPJ5CECR.js} +1 -1
  63. package/dist/bin/chunks/{chunk-ANX7U57Q.js → chunk-XBOBVLRL.js} +2 -2
  64. package/dist/bin/chunks/{chunk-HZGHQZSY.js → chunk-Z3MXFCN7.js} +1 -1
  65. package/dist/bin/chunks/{column-AJFK3TWF.js → column-AL4LR5PO.js} +1 -1
  66. package/dist/bin/chunks/{cp-WRBRHVVD.js → cp-XJWV46T5.js} +1 -1
  67. package/dist/bin/chunks/{curl-NHNZ46BU.js → curl-HZ5SBTVY.js} +11 -11
  68. package/dist/bin/chunks/{cut-42X6363P.js → cut-LNJEMWBJ.js} +1 -1
  69. package/dist/bin/chunks/dist-4NZ74CRE.js +141 -0
  70. package/dist/bin/chunks/{expr-PQEPO5TE.js → expr-GLGO2VEZ.js} +1 -1
  71. package/dist/bin/chunks/{file-JA7QI2YT.js → file-7M5LLZJY.js} +1 -1
  72. package/dist/bin/chunks/{find-T3JZPTUX.js → find-3QDGII35.js} +1 -1
  73. package/dist/bin/chunks/flag-coverage-AGEO3F6X.js +3 -0
  74. package/dist/bin/chunks/{grep-VXWNMIDD.js → grep-AZJ2CMYE.js} +1 -1
  75. package/dist/bin/chunks/{gzip-EXJSFNCU.js → gzip-W5CL2E2W.js} +1 -1
  76. package/dist/bin/{shell/chunks/head-QKVY3SIO.js → chunks/head-ABLEKDMV.js} +1 -1
  77. package/dist/bin/{shell/chunks/help-HVIDHJ6M.js → chunks/help-EXVKU23F.js} +1 -1
  78. package/dist/bin/chunks/{html-to-markdown-XUMA42ZC.js → html-to-markdown-FDNPIEKZ.js} +1 -1
  79. package/dist/bin/{shell/chunks/jq-YS4PR46D.js → chunks/jq-5SOTL7D7.js} +1 -1
  80. package/dist/bin/chunks/{js-exec-PLUMFEX6.js → js-exec-LISDW7YC.js} +1 -1
  81. package/dist/bin/chunks/js-exec-worker.js +1 -0
  82. package/dist/bin/{shell/chunks/ls-LOCOWLZ3.js → chunks/ls-EEX3YIOF.js} +1 -1
  83. package/dist/bin/chunks/mkdir-KDEZTR53.js +3 -0
  84. package/dist/bin/chunks/mktemp-OYQYUB5H.js +3 -0
  85. package/dist/bin/chunks/{mv-NAMOL2HF.js → mv-35V6IA5V.js} +1 -1
  86. package/dist/bin/chunks/{od-2GXD4D5K.js → od-TD5LZDUM.js} +1 -1
  87. package/dist/bin/{shell/chunks/paste-DWWA3JTW.js → chunks/paste-QJG6BYAP.js} +1 -1
  88. package/dist/bin/chunks/{python3-J5GXF27H.js → python3-P6MZ44HK.js} +1 -1
  89. package/dist/bin/{shell/chunks/rg-XF5U7GS2.js → chunks/rg-B2DVJQVY.js} +1 -1
  90. package/dist/bin/chunks/rm-HCMKNRM2.js +3 -0
  91. package/dist/bin/{shell/chunks/rmdir-W73C4GEA.js → chunks/rmdir-WGVUYGPF.js} +1 -1
  92. package/dist/bin/{shell/chunks/sed-SY63U2YX.js → chunks/sed-66XZQ75T.js} +1 -1
  93. package/dist/bin/chunks/{seq-X2EAOGV5.js → seq-KBVCQ4WT.js} +1 -1
  94. package/dist/bin/{shell/chunks/sleep-MOJQBZMY.js → chunks/sleep-4O22Z4DI.js} +1 -1
  95. package/dist/bin/chunks/{split-2VXPZJJ4.js → split-OK6JHDWZ.js} +1 -1
  96. package/dist/bin/chunks/sqlite3-57ACN7ES.js +3 -0
  97. package/dist/bin/chunks/{stat-LROLDXHH.js → stat-VNNI7JDZ.js} +1 -1
  98. package/dist/bin/chunks/{tail-UOTUV25D.js → tail-PAHZX3MA.js} +1 -1
  99. package/dist/bin/chunks/{tar-7XOP7VOX.js → tar-RPVTXGFJ.js} +1 -1
  100. package/dist/bin/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
  101. package/dist/bin/chunks/timeout-XMTXHNFF.js +3 -0
  102. package/dist/bin/{shell/chunks/tr-PVFO6FRY.js → chunks/tr-ETPC3LHV.js} +1 -1
  103. package/dist/bin/chunks/worker.js +5 -0
  104. package/dist/bin/chunks/{xan-RMH6JEXM.js → xan-XZHKEPJ4.js} +1 -1
  105. package/dist/bin/chunks/{xan-view-PD26QEFN.js → xan-view-CNGKCABE.js} +1 -1
  106. package/dist/bin/chunks/yes-2EQTNSIB.js +3 -0
  107. package/dist/bin/chunks/yq-T6S3IDKY.js +3 -0
  108. package/dist/bin/just-bash.js +291 -286
  109. package/dist/bin/shell/chunks/awk2-LCV2AUIX.js +3 -0
  110. package/dist/bin/{chunks/base64-TQ5KOCNW.js → shell/chunks/base64-OLYCF2PC.js} +1 -1
  111. package/dist/bin/shell/chunks/{cat-BQ7FQTN5.js → cat-UJLF2DU2.js} +1 -1
  112. package/dist/bin/{chunks/chmod-S4ARARR4.js → shell/chunks/chmod-V5F4BXZ2.js} +1 -1
  113. package/dist/bin/shell/chunks/{chunk-V4S4A7M6.js → chunk-2TEF4USR.js} +1 -1
  114. package/dist/bin/shell/chunks/{chunk-N26Y42L6.js → chunk-3M5OMKFS.js} +1 -1
  115. package/dist/bin/shell/chunks/chunk-4NYJ4ZTO.js +17 -0
  116. package/dist/bin/{chunks/chunk-M3Z5NZXT.js → shell/chunks/chunk-572NXISH.js} +1 -1
  117. package/dist/bin/shell/chunks/chunk-5NWK7A4R.js +13 -0
  118. package/dist/bin/{chunks/chunk-YXPSX3SI.js → shell/chunks/chunk-623Q77WZ.js} +1 -1
  119. package/dist/bin/shell/chunks/chunk-6NG4ULJM.js +7 -0
  120. package/dist/bin/shell/chunks/{chunk-QFOXSCOD.js → chunk-726WDFMQ.js} +1 -1
  121. package/dist/bin/shell/chunks/{chunk-4JPWP5WS.js → chunk-AJ3CSZ34.js} +1 -1
  122. package/dist/bin/{chunks/chunk-VTAMGD42.js → shell/chunks/chunk-APEQNYAO.js} +1 -1
  123. package/dist/bin/shell/chunks/chunk-BFLKIASG.js +7 -0
  124. package/dist/bin/shell/chunks/{chunk-IOKQFPM6.js → chunk-BRB5PJ3E.js} +1 -1
  125. package/dist/bin/shell/chunks/{chunk-ZVG47PYA.js → chunk-BVBYPYA5.js} +1 -1
  126. package/dist/bin/shell/chunks/{chunk-K65FCSAT.js → chunk-BZJ77YQD.js} +1 -1
  127. package/dist/bin/{chunks/chunk-GR4ZHKXI.js → shell/chunks/chunk-C2BLJ3AE.js} +1 -1
  128. package/dist/bin/{chunks/chunk-R7THHH4J.js → shell/chunks/chunk-C45GTJTD.js} +1 -1
  129. package/dist/bin/shell/chunks/{chunk-GOWX7VPU.js → chunk-CTS7QXCJ.js} +1 -1
  130. package/dist/bin/shell/chunks/{chunk-42AMF6EE.js → chunk-DTNGYQCJ.js} +1 -1
  131. package/dist/bin/shell/chunks/{chunk-TW2IJRUF.js → chunk-ENEHPI32.js} +1 -1
  132. package/dist/bin/shell/chunks/{chunk-E54Z6VIE.js → chunk-ERYPQAZE.js} +5 -5
  133. package/dist/bin/shell/chunks/{chunk-PQ2INDRF.js → chunk-GB3KUAFV.js} +1 -1
  134. package/dist/bin/{chunks/chunk-E2O6S35K.js → shell/chunks/chunk-HFVQCXYX.js} +1 -1
  135. package/dist/bin/shell/chunks/{chunk-IRCAXXH6.js → chunk-HSWCKN2X.js} +1 -1
  136. package/dist/bin/shell/chunks/{chunk-B6WWC6K3.js → chunk-I6MS5ZWE.js} +1 -1
  137. package/dist/bin/shell/chunks/{chunk-V4U26ZWL.js → chunk-IOFXLMNJ.js} +1 -1
  138. package/dist/bin/shell/chunks/chunk-IX6QY5JW.js +5 -0
  139. package/dist/bin/shell/chunks/{chunk-QKJAAJ7J.js → chunk-IXTPVJ6W.js} +1 -1
  140. package/dist/bin/shell/chunks/{chunk-OUQKFRVR.js → chunk-JBYLHCKP.js} +1 -1
  141. package/dist/bin/shell/chunks/{chunk-NXUXZWS5.js → chunk-JLRB7DV3.js} +1 -1
  142. package/dist/bin/{chunks/chunk-GKJD4ULC.js → shell/chunks/chunk-KH6YLKPE.js} +1 -1
  143. package/dist/bin/{chunks/chunk-Z3TCELKN.js → shell/chunks/chunk-KXSDVBJA.js} +1 -1
  144. package/dist/bin/shell/chunks/{chunk-DYIBFLS3.js → chunk-LOU52GPJ.js} +2 -2
  145. package/dist/bin/{chunks/chunk-L345YZ6R.js → shell/chunks/chunk-LVT5R45K.js} +1 -1
  146. package/dist/bin/{chunks/chunk-PTUQEN6I.js → shell/chunks/chunk-M345X45Z.js} +7 -7
  147. package/dist/bin/shell/chunks/{chunk-MWQMHODV.js → chunk-NDS7PYKD.js} +1 -1
  148. package/dist/bin/shell/chunks/chunk-O3PNT72D.js +3 -0
  149. package/dist/bin/shell/chunks/chunk-OGOISDGZ.js +3 -0
  150. package/dist/bin/shell/chunks/chunk-OSW4MDDH.js +21 -0
  151. package/dist/bin/shell/chunks/{chunk-FPWHWWXO.js → chunk-OXV2B2YS.js} +1 -1
  152. package/dist/bin/shell/chunks/{chunk-QMPZXXEK.js → chunk-OY25E3ZN.js} +1 -1
  153. package/dist/bin/{chunks/chunk-O2BCKSMK.js → shell/chunks/chunk-PEJXCXSY.js} +1 -1
  154. package/dist/bin/{chunks/chunk-6KHZX4HU.js → shell/chunks/chunk-PLLMJHMV.js} +1 -1
  155. package/dist/bin/{chunks/chunk-6TUILMPB.js → shell/chunks/chunk-QELDDRV5.js} +1 -1
  156. package/dist/bin/shell/chunks/{chunk-3FQBUEB6.js → chunk-RC4UXNHA.js} +1 -1
  157. package/dist/bin/{chunks/chunk-H7PD6FLC.js → shell/chunks/chunk-RE7Z53A3.js} +1 -1
  158. package/dist/bin/shell/chunks/chunk-SCQRBEQW.js +275 -0
  159. package/dist/bin/shell/chunks/{chunk-3DWQCLNP.js → chunk-SS2OPV62.js} +1 -1
  160. package/dist/bin/{chunks/chunk-CC2AQ6B7.js → shell/chunks/chunk-U6JTVQU6.js} +1 -1
  161. package/dist/bin/{chunks/chunk-UNCYBFWT.js → shell/chunks/chunk-UFAYH3WW.js} +1 -1
  162. package/dist/bin/shell/chunks/chunk-UPUFWGHR.js +3 -0
  163. package/dist/bin/{chunks/chunk-HARVZWUX.js → shell/chunks/chunk-UU42WPB7.js} +1 -1
  164. package/dist/bin/shell/chunks/{chunk-CNVNOT67.js → chunk-UW4E5XU5.js} +1 -1
  165. package/dist/bin/{chunks/chunk-F4ACJZIY.js → shell/chunks/chunk-WLQ2KWS3.js} +1 -1
  166. package/dist/bin/shell/chunks/{chunk-MVBK66TR.js → chunk-WPJ5CECR.js} +1 -1
  167. package/dist/bin/shell/chunks/{chunk-ANX7U57Q.js → chunk-XBOBVLRL.js} +2 -2
  168. package/dist/bin/shell/chunks/{chunk-HZGHQZSY.js → chunk-Z3MXFCN7.js} +1 -1
  169. package/dist/bin/shell/chunks/{column-AJFK3TWF.js → column-AL4LR5PO.js} +1 -1
  170. package/dist/bin/shell/chunks/{cp-WRBRHVVD.js → cp-XJWV46T5.js} +1 -1
  171. package/dist/bin/shell/chunks/{curl-NHNZ46BU.js → curl-HZ5SBTVY.js} +11 -11
  172. package/dist/bin/shell/chunks/{cut-42X6363P.js → cut-LNJEMWBJ.js} +1 -1
  173. package/dist/bin/shell/chunks/dist-4NZ74CRE.js +141 -0
  174. package/dist/bin/shell/chunks/{expr-PQEPO5TE.js → expr-GLGO2VEZ.js} +1 -1
  175. package/dist/bin/shell/chunks/{file-JA7QI2YT.js → file-7M5LLZJY.js} +1 -1
  176. package/dist/bin/shell/chunks/{find-T3JZPTUX.js → find-3QDGII35.js} +1 -1
  177. package/dist/bin/shell/chunks/flag-coverage-AGEO3F6X.js +3 -0
  178. package/dist/bin/shell/chunks/{grep-VXWNMIDD.js → grep-AZJ2CMYE.js} +1 -1
  179. package/dist/bin/shell/chunks/{gzip-EXJSFNCU.js → gzip-W5CL2E2W.js} +1 -1
  180. package/dist/bin/{chunks/head-QKVY3SIO.js → shell/chunks/head-ABLEKDMV.js} +1 -1
  181. package/dist/bin/{chunks/help-HVIDHJ6M.js → shell/chunks/help-EXVKU23F.js} +1 -1
  182. package/dist/bin/shell/chunks/{html-to-markdown-XUMA42ZC.js → html-to-markdown-FDNPIEKZ.js} +1 -1
  183. package/dist/bin/{chunks/jq-YS4PR46D.js → shell/chunks/jq-5SOTL7D7.js} +1 -1
  184. package/dist/bin/shell/chunks/{js-exec-PLUMFEX6.js → js-exec-LISDW7YC.js} +1 -1
  185. package/dist/bin/{chunks/ls-LOCOWLZ3.js → shell/chunks/ls-EEX3YIOF.js} +1 -1
  186. package/dist/bin/shell/chunks/mkdir-KDEZTR53.js +3 -0
  187. package/dist/bin/shell/chunks/mktemp-OYQYUB5H.js +3 -0
  188. package/dist/bin/shell/chunks/{mv-NAMOL2HF.js → mv-35V6IA5V.js} +1 -1
  189. package/dist/bin/shell/chunks/{od-2GXD4D5K.js → od-TD5LZDUM.js} +1 -1
  190. package/dist/bin/{chunks/paste-DWWA3JTW.js → shell/chunks/paste-QJG6BYAP.js} +1 -1
  191. package/dist/bin/shell/chunks/{python3-J5GXF27H.js → python3-P6MZ44HK.js} +1 -1
  192. package/dist/bin/{chunks/rg-XF5U7GS2.js → shell/chunks/rg-B2DVJQVY.js} +1 -1
  193. package/dist/bin/shell/chunks/rm-HCMKNRM2.js +3 -0
  194. package/dist/bin/{chunks/rmdir-W73C4GEA.js → shell/chunks/rmdir-WGVUYGPF.js} +1 -1
  195. package/dist/bin/{chunks/sed-SY63U2YX.js → shell/chunks/sed-66XZQ75T.js} +1 -1
  196. package/dist/bin/shell/chunks/{seq-X2EAOGV5.js → seq-KBVCQ4WT.js} +1 -1
  197. package/dist/bin/{chunks/sleep-MOJQBZMY.js → shell/chunks/sleep-4O22Z4DI.js} +1 -1
  198. package/dist/bin/shell/chunks/{split-2VXPZJJ4.js → split-OK6JHDWZ.js} +1 -1
  199. package/dist/bin/shell/chunks/sqlite3-57ACN7ES.js +3 -0
  200. package/dist/bin/shell/chunks/{stat-LROLDXHH.js → stat-VNNI7JDZ.js} +1 -1
  201. package/dist/bin/shell/chunks/{tail-UOTUV25D.js → tail-PAHZX3MA.js} +1 -1
  202. package/dist/bin/shell/chunks/{tar-7XOP7VOX.js → tar-RPVTXGFJ.js} +1 -1
  203. package/dist/bin/shell/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
  204. package/dist/bin/shell/chunks/timeout-XMTXHNFF.js +3 -0
  205. package/dist/bin/{chunks/tr-PVFO6FRY.js → shell/chunks/tr-ETPC3LHV.js} +1 -1
  206. package/dist/bin/shell/chunks/{xan-RMH6JEXM.js → xan-XZHKEPJ4.js} +1 -1
  207. package/dist/bin/shell/chunks/{xan-view-PD26QEFN.js → xan-view-CNGKCABE.js} +1 -1
  208. package/dist/bin/shell/chunks/yes-2EQTNSIB.js +3 -0
  209. package/dist/bin/shell/chunks/yq-T6S3IDKY.js +3 -0
  210. package/dist/bin/shell/shell.js +337 -332
  211. package/dist/browser.d.ts +1 -1
  212. package/dist/bundle/browser.js +741 -730
  213. package/dist/bundle/chunks/awk2-TLK6FCHV.js +2 -0
  214. package/dist/bundle/chunks/{base64-MHVQ5XHI.js → base64-GUZMZ645.js} +1 -1
  215. package/dist/bundle/chunks/{cat-VZBWBIJB.js → cat-LG4YGKUE.js} +1 -1
  216. package/dist/bundle/chunks/{chmod-KMFNCMRX.js → chmod-XUKPG2M4.js} +1 -1
  217. package/dist/bundle/chunks/{chunk-WNH3HOQA.js → chunk-353VO5TF.js} +1 -1
  218. package/dist/bundle/chunks/{chunk-O5OYOY3C.js → chunk-37UJACD6.js} +1 -1
  219. package/dist/bundle/chunks/{chunk-MMXJJCAE.js → chunk-3LGQ6XEC.js} +1 -1
  220. package/dist/bundle/chunks/{chunk-P57S6Z6R.js → chunk-3ZY5QX3G.js} +1 -1
  221. package/dist/bundle/chunks/{chunk-5KOWUQOZ.js → chunk-4VU4IF3W.js} +1 -1
  222. package/dist/bundle/chunks/{chunk-SIOONII3.js → chunk-52W2IWA7.js} +1 -1
  223. package/dist/bundle/chunks/chunk-5IB57TIJ.js +274 -0
  224. package/dist/bundle/chunks/chunk-5J4S2LP5.js +2 -0
  225. package/dist/bundle/chunks/{chunk-PCPW54JH.js → chunk-5LDRJ22P.js} +1 -1
  226. package/dist/bundle/chunks/{chunk-BKUWXPEM.js → chunk-654CJKE3.js} +1 -1
  227. package/dist/bundle/chunks/{chunk-EZNS4GF7.js → chunk-67ODVGSB.js} +1 -1
  228. package/dist/bundle/chunks/{chunk-6QF3PCMO.js → chunk-6HQQON3N.js} +1 -1
  229. package/dist/bundle/chunks/{chunk-U57DSHID.js → chunk-6P2DITXT.js} +1 -1
  230. package/dist/bundle/chunks/{chunk-THDUQVY3.js → chunk-74IR77AZ.js} +1 -1
  231. package/dist/bundle/chunks/{chunk-S3ENGQML.js → chunk-7DVD6YCI.js} +1 -1
  232. package/dist/bundle/chunks/{chunk-HXWB4Z5X.js → chunk-7II7XIVI.js} +1 -1
  233. package/dist/bundle/chunks/{chunk-AYSZ5MAE.js → chunk-A3C4Z3Q3.js} +1 -1
  234. package/dist/bundle/chunks/chunk-A6SU3BZX.js +6 -0
  235. package/dist/bundle/chunks/{chunk-5NUTFEEG.js → chunk-AMXNXHXK.js} +1 -1
  236. package/dist/bundle/chunks/{chunk-QJ7OXJAZ.js → chunk-BLG7RWH4.js} +1 -1
  237. package/dist/bundle/chunks/{chunk-XQ2ZZFO6.js → chunk-BQTWRHZR.js} +2 -2
  238. package/dist/bundle/chunks/{chunk-6IFH67ZB.js → chunk-BZ2OMW2T.js} +1 -1
  239. package/dist/bundle/chunks/{chunk-CH7SUFFO.js → chunk-CORCIYJD.js} +1 -1
  240. package/dist/bundle/chunks/{chunk-LGIJSCWH.js → chunk-EQDVNHQS.js} +1 -1
  241. package/dist/bundle/chunks/{chunk-U4K5ZDWK.js → chunk-EZEO6MFE.js} +1 -1
  242. package/dist/bundle/chunks/{chunk-4CDTAUYP.js → chunk-EZT6M2HG.js} +1 -1
  243. package/dist/bundle/chunks/{chunk-4MJ7VJG4.js → chunk-H7UVJSZR.js} +1 -1
  244. package/dist/bundle/chunks/{chunk-5EI7WSRV.js → chunk-HYQGYXGZ.js} +1 -1
  245. package/dist/bundle/chunks/{chunk-6IA4DXG2.js → chunk-IPKSYZ3R.js} +1 -1
  246. package/dist/bundle/chunks/{chunk-TLPMB3FO.js → chunk-KJBPGFZD.js} +1 -1
  247. package/dist/bundle/chunks/chunk-L7NEGEOJ.js +16 -0
  248. package/dist/bundle/chunks/{chunk-YFFU74KY.js → chunk-MJEJ7QEY.js} +1 -1
  249. package/dist/bundle/chunks/{chunk-QJFYYEFV.js → chunk-N36I27VM.js} +1 -1
  250. package/dist/bundle/chunks/chunk-N5L7E4EL.js +6 -0
  251. package/dist/bundle/chunks/{chunk-IXFQXNL4.js → chunk-NFW4YKDO.js} +1 -1
  252. package/dist/bundle/chunks/{chunk-PASYAXFP.js → chunk-NOX3PCUH.js} +1 -1
  253. package/dist/bundle/chunks/{chunk-MQKGGNPS.js → chunk-NXBUT5V2.js} +2 -2
  254. package/dist/bundle/chunks/{chunk-4KZT23KR.js → chunk-O5BHWBYH.js} +1 -1
  255. package/dist/bundle/chunks/{chunk-DVSA72LH.js → chunk-QTL2XC4B.js} +1 -1
  256. package/dist/bundle/chunks/chunk-RK2WBVP4.js +2 -0
  257. package/dist/bundle/chunks/{chunk-BLPYR4TN.js → chunk-RVBBGZ22.js} +1 -1
  258. package/dist/bundle/chunks/{chunk-PS2RJNZZ.js → chunk-SXQJYLP7.js} +1 -1
  259. package/dist/bundle/chunks/{chunk-FXAKF2QS.js → chunk-T7OAZEXT.js} +1 -1
  260. package/dist/bundle/chunks/{chunk-O452S4KX.js → chunk-URIKBXSE.js} +1 -1
  261. package/dist/bundle/chunks/{chunk-6BSOPPZH.js → chunk-UVQC75LS.js} +7 -7
  262. package/dist/bundle/chunks/chunk-VCREDMWH.js +4 -0
  263. package/dist/bundle/chunks/{chunk-DDPD7SIB.js → chunk-VQ6EUBJ3.js} +1 -1
  264. package/dist/bundle/chunks/{chunk-4OKRFRMS.js → chunk-VQEB6E2M.js} +1 -1
  265. package/dist/bundle/chunks/{chunk-R2FBRMDU.js → chunk-VWUMR4IC.js} +1 -1
  266. package/dist/bundle/chunks/{chunk-XXBIOG4R.js → chunk-WDY2TNMK.js} +1 -1
  267. package/dist/bundle/chunks/{chunk-H4AFUSSQ.js → chunk-XT7EK6BR.js} +1 -1
  268. package/dist/bundle/chunks/{chunk-BS6EJR2R.js → chunk-XUTEQMTL.js} +5 -5
  269. package/dist/bundle/chunks/{chunk-KIGPB52X.js → chunk-XZ34OGNM.js} +1 -1
  270. package/dist/bundle/chunks/chunk-YUITEK6N.js +12 -0
  271. package/dist/bundle/chunks/chunk-YZCPEJRE.js +20 -0
  272. package/dist/bundle/chunks/chunk-ZUEPJPYA.js +2 -0
  273. package/dist/bundle/chunks/{column-QJI65SH2.js → column-T4LGMRJG.js} +1 -1
  274. package/dist/bundle/chunks/{cp-P2D2L6PC.js → cp-ZDDVNITX.js} +1 -1
  275. package/dist/bundle/chunks/{curl-K4WT7UPN.js → curl-RCRD36LD.js} +11 -11
  276. package/dist/bundle/chunks/{cut-FMDNVWQN.js → cut-35WER2E2.js} +1 -1
  277. package/dist/bundle/chunks/{expr-A5XITHQD.js → expr-KSNRNE7V.js} +1 -1
  278. package/dist/bundle/chunks/{file-6AYYTULJ.js → file-XH37HMGV.js} +1 -1
  279. package/dist/bundle/chunks/{find-IUWEB4XQ.js → find-3AONTPPM.js} +1 -1
  280. package/dist/bundle/chunks/flag-coverage-6YGO7STE.js +2 -0
  281. package/dist/bundle/chunks/{grep-Q2O5EIXQ.js → grep-WW5KJPUG.js} +1 -1
  282. package/dist/bundle/chunks/{gzip-VUJBDHZ5.js → gzip-ISZXQNJJ.js} +1 -1
  283. package/dist/bundle/chunks/{head-6UIPFWVJ.js → head-VYXZQLPZ.js} +1 -1
  284. package/dist/bundle/chunks/{help-QDDMBDU7.js → help-62M75TSG.js} +1 -1
  285. package/dist/bundle/chunks/{html-to-markdown-PE6BPRPA.js → html-to-markdown-4LXS3A44.js} +1 -1
  286. package/dist/bundle/chunks/{jq-UKAA3QWU.js → jq-3IVOWP3G.js} +1 -1
  287. package/dist/bundle/chunks/{js-exec-6RW7WZCG.js → js-exec-T2WEE4KG.js} +1 -1
  288. package/dist/bundle/chunks/js-exec-worker.js +1 -0
  289. package/dist/bundle/chunks/{ls-ECKG2XHZ.js → ls-FC3CSHKE.js} +1 -1
  290. package/dist/bundle/chunks/mkdir-DPFWDY25.js +2 -0
  291. package/dist/bundle/chunks/mktemp-SW2AHXZW.js +2 -0
  292. package/dist/bundle/chunks/{mv-IF55A2UD.js → mv-PWCFXEF2.js} +1 -1
  293. package/dist/bundle/chunks/{od-Z4AIL3P4.js → od-VJ6PBBEI.js} +1 -1
  294. package/dist/bundle/chunks/{paste-ZNHNSRBW.js → paste-TIQETHSO.js} +1 -1
  295. package/dist/bundle/chunks/{python3-XHTOW7VA.js → python3-6JEP7ZZK.js} +1 -1
  296. package/dist/bundle/chunks/{rg-E6H2HACA.js → rg-2OPJ5V3D.js} +1 -1
  297. package/dist/bundle/chunks/rm-AZZM5DCE.js +2 -0
  298. package/dist/bundle/chunks/{rmdir-WKKBLZ54.js → rmdir-YXYSZD4X.js} +1 -1
  299. package/dist/bundle/chunks/{sed-6G32B25J.js → sed-HYSBLGO5.js} +1 -1
  300. package/dist/bundle/chunks/{seq-B6KDLMYQ.js → seq-M2S4FRN4.js} +1 -1
  301. package/dist/bundle/chunks/{sleep-25QUPVDK.js → sleep-YC4HFEGC.js} +1 -1
  302. package/dist/bundle/chunks/{split-NEU2K2YN.js → split-UOPIWKKE.js} +1 -1
  303. package/dist/bundle/chunks/sqlite3-XCROTL6G.js +2 -0
  304. package/dist/bundle/chunks/{stat-LXFZND2P.js → stat-I3FPUTR7.js} +1 -1
  305. package/dist/bundle/chunks/{tail-UBGSN4JF.js → tail-WK3WACZK.js} +1 -1
  306. package/dist/bundle/chunks/{tar-LE7LAAIX.js → tar-VZYMNZV2.js} +1 -1
  307. package/dist/bundle/chunks/{time-NERE2JJ2.js → time-N6J6DC6C.js} +1 -1
  308. package/dist/bundle/chunks/timeout-UDR5J2MP.js +2 -0
  309. package/dist/bundle/chunks/{tr-UI2LA3GA.js → tr-VI5PIA4A.js} +1 -1
  310. package/dist/bundle/chunks/worker.js +5 -0
  311. package/dist/bundle/chunks/{xan-UIL24CGT.js → xan-DL576EIT.js} +1 -1
  312. package/dist/bundle/chunks/xan-view-GJVN6IHX.js +2 -0
  313. package/dist/bundle/chunks/yes-OVJMX6NM.js +2 -0
  314. package/dist/bundle/chunks/yq-KYPU4LQP.js +2 -0
  315. package/dist/bundle/index.cjs +1079 -1068
  316. package/dist/bundle/index.js +336 -331
  317. package/dist/commands/mktemp/mktemp.d.ts +4 -0
  318. package/dist/commands/registry.d.ts +1 -1
  319. package/dist/commands/yes/yes.d.ts +4 -0
  320. package/dist/custom-commands.d.ts +7 -0
  321. package/dist/fs/create-exclusive.d.ts +30 -0
  322. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +8 -1
  323. package/dist/fs/interface.d.ts +37 -0
  324. package/dist/fs/mountable-fs/mountable-fs.d.ts +18 -1
  325. package/dist/fs/overlay-fs/overlay-fs.d.ts +19 -1
  326. package/dist/fs/read-write-fs/read-write-fs.d.ts +22 -1
  327. package/dist/index.d.cts +1 -1
  328. package/dist/index.d.ts +1 -1
  329. package/dist/interpreter/expansion/array-prefix-suffix.d.ts +2 -1
  330. package/dist/interpreter/expansion/parameter-ops.d.ts +1 -0
  331. package/dist/interpreter/expansion/pattern-removal.d.ts +3 -0
  332. package/dist/interpreter/expansion/variable.d.ts +1 -1
  333. package/dist/interpreter/helpers/loop.d.ts +32 -0
  334. package/dist/network/dns-pin.d.ts +1 -32
  335. package/dist/network/fetch.d.ts +1 -1
  336. package/dist/security/trusted-globals.d.ts +8 -0
  337. package/package.json +3 -4
  338. package/dist/bin/chunks/awk2-NTRVFXRA.js +0 -3
  339. package/dist/bin/chunks/chunk-3PCPQIUD.js +0 -3
  340. package/dist/bin/chunks/chunk-HWI42GQO.js +0 -7
  341. package/dist/bin/chunks/chunk-I57EACSL.js +0 -3
  342. package/dist/bin/chunks/chunk-NSI6LMDS.js +0 -16
  343. package/dist/bin/chunks/chunk-ONF4KUYV.js +0 -13
  344. package/dist/bin/chunks/chunk-PRVPFKTC.js +0 -276
  345. package/dist/bin/chunks/chunk-U5JLGI56.js +0 -21
  346. package/dist/bin/chunks/dist-5MWO25Y4.js +0 -141
  347. package/dist/bin/chunks/flag-coverage-LVKHEUTL.js +0 -3
  348. package/dist/bin/chunks/mkdir-VHLJ3E65.js +0 -3
  349. package/dist/bin/chunks/rm-L4RHENMV.js +0 -3
  350. package/dist/bin/chunks/sqlite3-3S5HIA5W.js +0 -3
  351. package/dist/bin/chunks/timeout-RQOWSWYG.js +0 -3
  352. package/dist/bin/chunks/yq-CWBZMGUV.js +0 -3
  353. package/dist/bin/shell/chunks/awk2-NTRVFXRA.js +0 -3
  354. package/dist/bin/shell/chunks/chunk-3PCPQIUD.js +0 -3
  355. package/dist/bin/shell/chunks/chunk-HWI42GQO.js +0 -7
  356. package/dist/bin/shell/chunks/chunk-I57EACSL.js +0 -3
  357. package/dist/bin/shell/chunks/chunk-NSI6LMDS.js +0 -16
  358. package/dist/bin/shell/chunks/chunk-ONF4KUYV.js +0 -13
  359. package/dist/bin/shell/chunks/chunk-PRVPFKTC.js +0 -276
  360. package/dist/bin/shell/chunks/chunk-U5JLGI56.js +0 -21
  361. package/dist/bin/shell/chunks/dist-5MWO25Y4.js +0 -141
  362. package/dist/bin/shell/chunks/flag-coverage-LVKHEUTL.js +0 -3
  363. package/dist/bin/shell/chunks/mkdir-VHLJ3E65.js +0 -3
  364. package/dist/bin/shell/chunks/rm-L4RHENMV.js +0 -3
  365. package/dist/bin/shell/chunks/sqlite3-3S5HIA5W.js +0 -3
  366. package/dist/bin/shell/chunks/timeout-RQOWSWYG.js +0 -3
  367. package/dist/bin/shell/chunks/yq-CWBZMGUV.js +0 -3
  368. package/dist/bundle/chunks/awk2-VS5QVYHU.js +0 -2
  369. package/dist/bundle/chunks/chunk-35MBA3VY.js +0 -12
  370. package/dist/bundle/chunks/chunk-4WRO2G22.js +0 -15
  371. package/dist/bundle/chunks/chunk-BRJERIF4.js +0 -2
  372. package/dist/bundle/chunks/chunk-FTET43KM.js +0 -2
  373. package/dist/bundle/chunks/chunk-GRUZ4SBY.js +0 -275
  374. package/dist/bundle/chunks/chunk-Y6JBSHCM.js +0 -20
  375. package/dist/bundle/chunks/chunk-ZBUZKIPX.js +0 -6
  376. package/dist/bundle/chunks/flag-coverage-SZ4AUPRQ.js +0 -2
  377. package/dist/bundle/chunks/mkdir-YL7XGMD7.js +0 -2
  378. package/dist/bundle/chunks/rm-CWLMERIO.js +0 -2
  379. package/dist/bundle/chunks/sqlite3-KJ5NMKBM.js +0 -2
  380. package/dist/bundle/chunks/timeout-37GM7IIL.js +0 -2
  381. package/dist/bundle/chunks/xan-view-FOCYCKZQ.js +0 -2
  382. package/dist/bundle/chunks/yq-ZRNZKDLE.js +0 -2
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{d as l,e as u}from"./chunk-QKJAAJ7J.js";import{randomBytes as h}from"node:crypto";var d=class{options;protocolToken=h(16).toString("hex");deadline;cleanups=[];cancelHandler;canceledReason;closed=!1;constructor(t){this.options=t,this.deadline=Date.now()+t.timeoutMs}arm(t){if(this.cancelHandler)throw new Error("worker request is already armed");this.cancelHandler=t;let a=this.options.signal;if(a){let i=()=>this.cancel("abort");a.addEventListener("abort",i,{once:!0}),this.cleanups.push(()=>a.removeEventListener("abort",i)),a.aborted&&this.cancel("abort")}if(!this.canceledReason){let i=l(()=>this.cancel("timeout"),Math.max(0,this.options.timeoutMs));i!==void 0&&this.cleanups.push(()=>u(i))}}get isCanceled(){return this.canceledReason!==void 0}remainingTimeMs(){return Math.max(0,this.deadline-Date.now())}timeoutMessage(t="Execution"){return`${t} timeout: exceeded ${this.options.timeoutMs}ms limit`}abortMessage(){return"Execution aborted"}assertMessageSize(t,a){if(f(t,this.options.maxMessageBytes)>this.options.maxMessageBytes)throw new Error(`${this.options.commandName}: worker ${a} exceeds ${this.options.maxMessageBytes} byte limit`)}async terminate(t){if(!t)return!0;try{return await t.terminate(),!0}catch{return!1}}close(){if(!this.closed){this.closed=!0;for(let t=this.cleanups.length-1;t>=0;t--)this.cleanups[t]();this.cleanups.length=0,this.cancelHandler=void 0}}cancel(t){this.closed||this.canceledReason||(this.canceledReason=t,this.cancelHandler?.(t))}};function f(o,t){let a=function*(n){for(let e in n)Object.hasOwn(n,e)&&(yield[e,n[e]])},i=[{kind:"value",value:o}],c=new WeakSet,s=0;for(;i.length>0&&s<=t;){let n=i.pop();if(!n)break;if(n.kind==="array"){n.index<n.value.length&&(i.push({...n,index:n.index+1}),i.push({kind:"value",value:n.value[n.index]}));continue}if(n.kind==="object"){let r=n.iterator.next();r.done||(s+=8+Buffer.byteLength(r.value[0],"utf8"),i.push(n),i.push({kind:"value",value:r.value[1]}));continue}let e=n.value;if(e==null)s+=4;else if(typeof e=="string")s+=Buffer.byteLength(e,"utf8");else if(typeof e=="number"||typeof e=="bigint")s+=8;else if(typeof e=="boolean")s+=1;else if(typeof e=="object"){if(c.has(e))continue;if(c.add(e),ArrayBuffer.isView(e))s+=e.byteLength;else if(e instanceof ArrayBuffer||e instanceof SharedArrayBuffer)s+=e.byteLength;else if(Array.isArray(e)){if(e.length>Math.floor((t-s)/8))return t+1;s+=e.length*8,i.push({kind:"array",value:e,index:0})}else i.push({kind:"object",iterator:a(e)})}}return s}export{d as a};
3
+ import{d as l,e as u}from"./chunk-IXTPVJ6W.js";import{randomBytes as h}from"node:crypto";var d=class{options;protocolToken=h(16).toString("hex");deadline;cleanups=[];cancelHandler;canceledReason;closed=!1;constructor(t){this.options=t,this.deadline=Date.now()+t.timeoutMs}arm(t){if(this.cancelHandler)throw new Error("worker request is already armed");this.cancelHandler=t;let a=this.options.signal;if(a){let i=()=>this.cancel("abort");a.addEventListener("abort",i,{once:!0}),this.cleanups.push(()=>a.removeEventListener("abort",i)),a.aborted&&this.cancel("abort")}if(!this.canceledReason){let i=l(()=>this.cancel("timeout"),Math.max(0,this.options.timeoutMs));i!==void 0&&this.cleanups.push(()=>u(i))}}get isCanceled(){return this.canceledReason!==void 0}remainingTimeMs(){return Math.max(0,this.deadline-Date.now())}timeoutMessage(t="Execution"){return`${t} timeout: exceeded ${this.options.timeoutMs}ms limit`}abortMessage(){return"Execution aborted"}assertMessageSize(t,a){if(f(t,this.options.maxMessageBytes)>this.options.maxMessageBytes)throw new Error(`${this.options.commandName}: worker ${a} exceeds ${this.options.maxMessageBytes} byte limit`)}async terminate(t){if(!t)return!0;try{return await t.terminate(),!0}catch{return!1}}close(){if(!this.closed){this.closed=!0;for(let t=this.cleanups.length-1;t>=0;t--)this.cleanups[t]();this.cleanups.length=0,this.cancelHandler=void 0}}cancel(t){this.closed||this.canceledReason||(this.canceledReason=t,this.cancelHandler?.(t))}};function f(o,t){let a=function*(n){for(let e in n)Object.hasOwn(n,e)&&(yield[e,n[e]])},i=[{kind:"value",value:o}],c=new WeakSet,s=0;for(;i.length>0&&s<=t;){let n=i.pop();if(!n)break;if(n.kind==="array"){n.index<n.value.length&&(i.push({...n,index:n.index+1}),i.push({kind:"value",value:n.value[n.index]}));continue}if(n.kind==="object"){let r=n.iterator.next();r.done||(s+=8+Buffer.byteLength(r.value[0],"utf8"),i.push(n),i.push({kind:"value",value:r.value[1]}));continue}let e=n.value;if(e==null)s+=4;else if(typeof e=="string")s+=Buffer.byteLength(e,"utf8");else if(typeof e=="number"||typeof e=="bigint")s+=8;else if(typeof e=="boolean")s+=1;else if(typeof e=="object"){if(c.has(e))continue;if(c.add(e),ArrayBuffer.isView(e))s+=e.byteLength;else if(e instanceof ArrayBuffer||e instanceof SharedArrayBuffer)s+=e.byteLength;else if(Array.isArray(e)){if(e.length>Math.floor((t-s)/8))return t+1;s+=e.length*8,i.push({kind:"array",value:e,index:0})}else i.push({kind:"object",iterator:a(e)})}}return s}export{d as a};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as g}from"./chunk-3MRB66F4.js";import{c as p}from"./chunk-TW2IJRUF.js";import{a as h}from"./chunk-MROECM42.js";import{a as f}from"./chunk-PBOVSFTJ.js";var T={name:"time",async execute(r,s){let a="%e %M",o=null,u=!1,c=!1,t=0;for(;t<r.length;){let e=r[t];if(e==="-f"||e==="--format"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-f'
3
+ import{a as g}from"./chunk-3MRB66F4.js";import{c as p}from"./chunk-ENEHPI32.js";import{a as h}from"./chunk-MROECM42.js";import{a as f}from"./chunk-PBOVSFTJ.js";var T={name:"time",async execute(r,s){let a="%e %M",o=null,u=!1,c=!1,t=0;for(;t<r.length;){let e=r[t];if(e==="-f"||e==="--format"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-f'
4
4
  `,exitCode:1};a=r[t],t++}else if(e==="-o"||e==="--output"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-o'
5
5
  `,exitCode:1};o=r[t],t++}else if(e==="-a"||e==="--append")u=!0,t++;else if(e==="-v"||e==="--verbose")a=`Command being timed: %C
6
6
  Elapsed (wall clock) time: %e seconds
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{f as Y}from"./chunk-47IFMQYS.js";import{a as K}from"./chunk-3MRB66F4.js";import{a as P,b as J,c as D}from"./chunk-QFOXSCOD.js";import{a as W}from"./chunk-YXPSX3SI.js";import{b as N}from"./chunk-GR4ZHKXI.js";import{d as H}from"./chunk-I57EACSL.js";import{d as Z}from"./chunk-AIWBN36Z.js";import{l as M}from"./chunk-FUT3X2GJ.js";import{a as G,b as T,e as _}from"./chunk-CPKBPQ2C.js";import{a as q,b as V,c as E}from"./chunk-MUFNRCMY.js";var X=Y({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),j=class{types;constructor(){this.types=new Map(Object.entries(X).map(([t,s])=>[t,{extensions:[...s.extensions],globs:[...s.globs]}]))}addType(t){let s=t.indexOf(":");if(s===-1)return;let n=t.slice(0,s),r=t.slice(s+1);if(r.startsWith("include:")){let i=r.slice(8),l=this.types.get(i);if(l){let o=this.types.get(n)||{extensions:[],globs:[]};o.extensions.push(...l.extensions),o.globs.push(...l.globs),this.types.set(n,o)}}else{let i=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let l=r.slice(1);i.extensions.includes(l)||i.extensions.push(l)}else i.globs.includes(r)||i.globs.push(r);this.types.set(n,i)}}clearType(t){let s=this.types.get(t);s&&(s.extensions=[],s.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,s){let n=t.toLowerCase();for(let r of s){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let i=this.types.get(r);if(i){for(let l of i.extensions)if(n.endsWith(l))return!0;for(let l of i.globs)if(l.includes("*")){let o=l.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${o}$`,"i").test(t))return!0}else if(n===l.toLowerCase())return!0}}return!1}matchesAnyType(t){let s=t.toLowerCase();for(let n of this.types.values()){for(let r of n.extensions)if(s.endsWith(r))return!0;for(let r of n.globs)if(r.includes("*")){let i=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${i}$`,"i").test(t))return!0}else if(s===r.toLowerCase())return!0}return!1}};function Q(){let e=[];for(let[t,s]of Object.entries(X).sort()){let n=[];for(let r of s.extensions)n.push(`*${r}`);for(let r of s.globs)n.push(r);e.push(`${t}: ${n.join(", ")}`)}return`${e.join(`
3
+ import{f as Y}from"./chunk-47IFMQYS.js";import{a as K}from"./chunk-3MRB66F4.js";import{a as P,b as J,c as D}from"./chunk-726WDFMQ.js";import{a as W}from"./chunk-623Q77WZ.js";import{b as N}from"./chunk-C2BLJ3AE.js";import{e as H}from"./chunk-O3PNT72D.js";import{d as Z}from"./chunk-AIWBN36Z.js";import{l as M}from"./chunk-FUT3X2GJ.js";import{a as G,b as T,e as _}from"./chunk-CPKBPQ2C.js";import{a as q,b as V,c as E}from"./chunk-MUFNRCMY.js";var X=Y({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),j=class{types;constructor(){this.types=new Map(Object.entries(X).map(([t,s])=>[t,{extensions:[...s.extensions],globs:[...s.globs]}]))}addType(t){let s=t.indexOf(":");if(s===-1)return;let n=t.slice(0,s),r=t.slice(s+1);if(r.startsWith("include:")){let i=r.slice(8),l=this.types.get(i);if(l){let o=this.types.get(n)||{extensions:[],globs:[]};o.extensions.push(...l.extensions),o.globs.push(...l.globs),this.types.set(n,o)}}else{let i=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let l=r.slice(1);i.extensions.includes(l)||i.extensions.push(l)}else i.globs.includes(r)||i.globs.push(r);this.types.set(n,i)}}clearType(t){let s=this.types.get(t);s&&(s.extensions=[],s.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,s){let n=t.toLowerCase();for(let r of s){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let i=this.types.get(r);if(i){for(let l of i.extensions)if(n.endsWith(l))return!0;for(let l of i.globs)if(l.includes("*")){let o=l.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${o}$`,"i").test(t))return!0}else if(n===l.toLowerCase())return!0}}return!1}matchesAnyType(t){let s=t.toLowerCase();for(let n of this.types.values()){for(let r of n.extensions)if(s.endsWith(r))return!0;for(let r of n.globs)if(r.includes("*")){let i=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${i}$`,"i").test(t))return!0}else if(s===r.toLowerCase())return!0}return!1}};function Q(){let e=[];for(let[t,s]of Object.entries(X).sort()){let n=[];for(let r of s.extensions)n.push(`*${r}`);for(let r of s.globs)n.push(r);e.push(`${t}: ${n.join(", ")}`)}return`${e.join(`
4
4
  `)}
5
5
  `}function ee(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:512*1024*1024,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function ue(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let s=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return s*1024;case"M":return s*1024*1024;case"G":return s*1024*1024*1024;default:return s}}function fe(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
6
6
  `,exitCode:1}}function he(e,t){return!/^\d+$/.test(t)||!Number.isSafeInteger(Number(t))?{stdout:"",stderr:`rg: invalid --${e} value: ${t}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
+ var t=class extends Error{code="ENOSYS";constructor(e,r){super(`ENOSYS: filesystem cannot create entries atomically, ${r} '${e}'`),this.name="ExclusiveCreateUnsupportedError"}};async function a(c,e,r){if(!c.createExclusive)throw new t(e,r.directory?"mkdir":"open");await c.createExclusive(e,r)}export{t as a,a as b};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as w}from"./chunk-QES5OSUC.js";import{b as m}from"./chunk-GR4ZHKXI.js";import{d as v}from"./chunk-I57EACSL.js";import{e as B}from"./chunk-AIWBN36Z.js";import{l as z}from"./chunk-FUT3X2GJ.js";import{a as L}from"./chunk-NE4R2FVV.js";import{a as F,b as E}from"./chunk-MUFNRCMY.js";import{constants as C,gunzipSync as _,gzipSync as A}from"node:zlib";var D={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
3
+ import{a as w}from"./chunk-QES5OSUC.js";import{b as m}from"./chunk-C2BLJ3AE.js";import{e as v}from"./chunk-O3PNT72D.js";import{e as B}from"./chunk-AIWBN36Z.js";import{l as z}from"./chunk-FUT3X2GJ.js";import{a as L}from"./chunk-NE4R2FVV.js";import{a as F,b as E}from"./chunk-MUFNRCMY.js";import{constants as C,gunzipSync as _,gzipSync as A}from"node:zlib";var D={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
4
4
 
5
5
  When no FILE is given, or when FILE is -, read from standard input.
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as m}from"./chunk-YXPSX3SI.js";import{b as x}from"./chunk-GR4ZHKXI.js";import{a as w}from"./chunk-PBOVSFTJ.js";var k={name:"expr",async execute(i,a){if(i.length===0)return{stdout:"",stderr:`expr: missing operand
3
+ import{a as m}from"./chunk-623Q77WZ.js";import{b as x}from"./chunk-C2BLJ3AE.js";import{a as w}from"./chunk-PBOVSFTJ.js";var k={name:"expr",async execute(i,a){if(i.length===0)return{stdout:"",stderr:`expr: missing operand
4
4
  `,exitCode:2};try{let t=S(i,h=>a.executionScope?.consumeWork(h,"expr index")),f=t==="0"||t===""?1:0;return{stdout:`${t}
5
5
  `,stderr:"",exitCode:f}}catch(t){return x(t),{stdout:"",stderr:`expr: ${w(t.message)}
6
6
  `,exitCode:2}}}};function S(i,a){if(i.length===1)return i[0];let t=0;function f(){let e=h();for(;t<i.length&&i[t]==="|";){t++;let r=h();if(e!=="0"&&e!=="")return e;e=r}return e}function h(){let e=g();for(;t<i.length&&i[t]==="&";){t++;let r=g();(e==="0"||e===""||r==="0"||r==="")&&(e="0")}return e}function g(){let e=p();for(;t<i.length;){let r=i[t];if(["=","!=","<",">","<=",">="].includes(r)){t++;let s=p(),o=parseInt(e,10),n=parseInt(s,10),l=!Number.isNaN(o)&&!Number.isNaN(n),c;r==="="?c=l?o===n:e===s:r==="!="?c=l?o!==n:e!==s:r==="<"?c=l?o<n:e<s:r===">"?c=l?o>n:e>s:r==="<="?c=l?o<=n:e<=s:c=l?o>=n:e>=s,e=c?"1":"0"}else break}return e}function p(){let e=N();for(;t<i.length;){let r=i[t];if(r==="+"||r==="-"){t++;let s=N(),o=parseInt(e,10),n=parseInt(s,10);if(Number.isNaN(o)||Number.isNaN(n))throw new Error("non-integer argument");e=String(r==="+"?o+n:o-n)}else break}return e}function N(){let e=d();for(;t<i.length;){let r=i[t];if(r==="*"||r==="/"||r==="%"){t++;let s=d(),o=parseInt(e,10),n=parseInt(s,10);if(Number.isNaN(o)||Number.isNaN(n))throw new Error("non-integer argument");if((r==="/"||r==="%")&&n===0)throw new Error("division by zero");r==="*"?e=String(o*n):r==="/"?e=String(Math.trunc(o/n)):e=String(o%n)}else break}return e}function d(){let e=u();for(;t<i.length&&i[t]===":";){t++;let r=u(),o=m(`^${r}`).match(e);o?e=o[1]!==void 0?o[1]:String(o[0].length):e="0"}return e}function u(){if(t>=i.length)throw new Error("syntax error");let e=i[t];if(e==="match"){t++;let r=u(),s=u(),n=m(s).match(r);return n?n[1]!==void 0?n[1]:String(n[0].length):"0"}if(e==="substr"){t++;let r=u(),s=parseInt(u(),10),o=parseInt(u(),10);if(Number.isNaN(s)||Number.isNaN(o))throw new Error("non-integer argument");return r.substring(s-1,s-1+o)}if(e==="index"){t++;let r=u(),s=u();a(s.length+r.length);let o=new Set;for(let n=0;n<s.length;n++)o.add(s[n]);for(let n=0;n<r.length;n++)if(o.has(r[n]))return String(n+1);return"0"}if(e==="length"){t++;let r=u();return String(r.length)}if(e==="("){t++;let r=f();if(t>=i.length||i[t]!==")")throw new Error("syntax error");return t++,r}return t++,e}let b=f();if(t!==i.length)throw new Error("syntax error");return b}var C={name:"expr",flags:[],needsArgs:!0};export{k as a,C as b};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{c as n}from"./chunk-OHFB3M3X.js";import{a as d}from"./chunk-PBOVSFTJ.js";import{a as u}from"./chunk-NE4R2FVV.js";import{a as g}from"./chunk-I4IRHQDW.js";var b={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},C={name:"rm",async execute(v,s){let e=u("rm",v,b);if(!e.ok)return e.error;let l=e.result.flags.recursive||e.result.flags.recursiveUpper,a=e.result.flags.force,y=e.result.flags.verbose,f=e.result.positional;if(f.length===0)return a?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
3
+ import{c as n}from"./chunk-OHFB3M3X.js";import{a as g}from"./chunk-I4IRHQDW.js";import{a as d}from"./chunk-PBOVSFTJ.js";import{a as u}from"./chunk-NE4R2FVV.js";var b={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},C={name:"rm",async execute(v,s){let e=u("rm",v,b);if(!e.ok)return e.error;let l=e.result.flags.recursive||e.result.flags.recursiveUpper,a=e.result.flags.force,y=e.result.flags.verbose,f=e.result.positional;if(f.length===0)return a?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
4
4
  `,exitCode:1};let c="",t="",i=0;for(let r of f)try{let o=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(o)).isDirectory&&!l){t+=`rm: cannot remove '${r}': Is a directory
5
5
  `,i=1;continue}await s.fs.rm(o,{recursive:l,force:a}),y&&(c+=`removed '${r}'
6
6
  `)}catch(o){let m=g(o),p=n(o,"ENOENT");if(a&&p)continue;p?t+=`rm: cannot remove '${r}': No such file or directory
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{b as A}from"./chunk-GR4ZHKXI.js";import{l as f}from"./chunk-FUT3X2GJ.js";import{a as z,b as T}from"./chunk-CPKBPQ2C.js";import{a as _}from"./chunk-PBOVSFTJ.js";import{a as B}from"./chunk-NE4R2FVV.js";import{a as M,b as q}from"./chunk-MUFNRCMY.js";var L={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
3
+ import{b as A}from"./chunk-C2BLJ3AE.js";import{l as f}from"./chunk-FUT3X2GJ.js";import{a as z,b as T}from"./chunk-CPKBPQ2C.js";import{a as _}from"./chunk-PBOVSFTJ.js";import{a as B}from"./chunk-NE4R2FVV.js";import{a as M,b as q}from"./chunk-MUFNRCMY.js";var L={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
4
4
  a-z character range
5
5
  [:alnum:] all letters and digits
6
6
  [:alpha:] all letters
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-V4U26ZWL.js";import{b as V,d as Qe}from"./chunk-ONF4KUYV.js";import{d as Ge,f as Xe,g as oe}from"./chunk-47IFMQYS.js";import{a as Z}from"./chunk-YXPSX3SI.js";import{b as Ye}from"./chunk-2UV6ZFHK.js";import{b as q}from"./chunk-GR4ZHKXI.js";import{a as W,c as se,d as re}from"./chunk-I57EACSL.js";import{l as E}from"./chunk-FUT3X2GJ.js";import{a as K,b as Y}from"./chunk-CPKBPQ2C.js";import{a as J,b as ne}from"./chunk-MUFNRCMY.js";var G=class{input;pos=0;tokens=[];maxSourceLength;maxTokens;constructor(t,n={}){this.input=t,this.maxSourceLength=n.maxSourceLength??1024*1024,this.maxTokens=n.maxTokens??1e5}tokenize(){if(this.input.length>this.maxSourceLength)throw new E(`xan: expression length limit exceeded (${this.maxSourceLength})`,"string_length");for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let t=this.nextToken();t&&(this.assertTokenCapacity(),this.tokens.push(t))}return this.assertTokenCapacity(),this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}assertTokenCapacity(){if(this.tokens.length>=this.maxTokens)throw new E(`xan: expression token limit exceeded (${this.maxTokens})`,"array_elements")}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.input[this.pos];if(t===" "||t===" "||t===`
3
+ import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-IOFXLMNJ.js";import{b as V,d as Qe}from"./chunk-5NWK7A4R.js";import{d as Ge,f as Xe,g as oe}from"./chunk-47IFMQYS.js";import{a as Z}from"./chunk-623Q77WZ.js";import{b as Ye}from"./chunk-2UV6ZFHK.js";import{b as q}from"./chunk-C2BLJ3AE.js";import{a as W,d as se,e as re}from"./chunk-O3PNT72D.js";import{l as E}from"./chunk-FUT3X2GJ.js";import{a as K,b as Y}from"./chunk-CPKBPQ2C.js";import{a as J,b as ne}from"./chunk-MUFNRCMY.js";var G=class{input;pos=0;tokens=[];maxSourceLength;maxTokens;constructor(t,n={}){this.input=t,this.maxSourceLength=n.maxSourceLength??1024*1024,this.maxTokens=n.maxTokens??1e5}tokenize(){if(this.input.length>this.maxSourceLength)throw new E(`xan: expression length limit exceeded (${this.maxSourceLength})`,"string_length");for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let t=this.nextToken();t&&(this.assertTokenCapacity(),this.tokens.push(t))}return this.assertTokenCapacity(),this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}assertTokenCapacity(){if(this.tokens.length>=this.maxTokens)throw new E(`xan: expression token limit exceeded (${this.maxTokens})`,"array_elements")}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.input[this.pos];if(t===" "||t===" "||t===`
4
4
  `||t==="\r")this.pos++;else if(t==="#")for(;this.pos<this.input.length&&this.input[this.pos]!==`
5
5
  `;)this.pos++;else break}}nextToken(){let t=this.pos,n=this.input[this.pos];if(n>="0"&&n<="9")return this.readNumber();if(n==='"'||n==="'"||n==="`")return this.readString(n);if(n==="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(n==="/"){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:t}):(this.pos++,{type:"/",value:"/",pos:t}):this.readRegex()}if(this.match("not in"))return{type:"not in",value:"not in",pos:t};if(this.match("=>"))return{type:"=>",value:"=>",pos:t};if(this.match("**"))return{type:"**",value:"**",pos:t};if(this.match("++"))return{type:"++",value:"++",pos:t};if(this.match("//"))return{type:"//",value:"//",pos:t};if(this.match("=="))return{type:"==",value:"==",pos:t};if(this.match("!="))return{type:"!=",value:"!=",pos:t};if(this.match("<="))return{type:"<=",value:"<=",pos:t};if(this.match(">="))return{type:">=",value:">=",pos:t};if(this.match("&&"))return{type:"&&",value:"&&",pos:t};if(this.match("||"))return{type:"||",value:"||",pos:t};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(n);if(r!==void 0)return this.pos++,{type:r,value:n,pos:t};if(this.isIdentStart(n))return this.readIdentifier();throw new Error(`Unexpected character '${n}' at position ${this.pos}`)}match(t){if(this.input.slice(this.pos,this.pos+t.length)===t){if(/^[a-zA-Z]/.test(t)){let n=this.input[this.pos+t.length];if(n&&this.isIdentChar(n))return!1}return this.pos+=t.length,!0}return!1}isIdentStart(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"}isIdentChar(t){return this.isIdentStart(t)||t>="0"&&t<="9"}readNumber(){let t=this.pos,n=!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==="."&&!n&&!s)n=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,n=!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(t,this.pos).replace(/_/g,"");return{type:n?"float":"int",value:r,pos:t}}readString(t){let n=this.pos;this.pos++;let s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===t)return this.pos++,{type:"string",value:s,pos:n};if(r==="\\"){if(this.pos++,this.pos<this.input.length){let o=this.input[this.pos];switch(o){case"n":s+=`
6
6
  `;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 ${n}`)}readRegex(){let t=this.pos;this.pos++;let n="",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:n+(s?`/${s}`:""),pos:t}}r==="\\"?(n+=r,this.pos++,this.pos<this.input.length&&(n+=this.input[this.pos],this.pos++)):(n+=r,this.pos++)}throw new Error(`Unterminated regex starting at position ${t}`)}readIdentifier(){let t=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let n=!1;this.pos<this.input.length&&this.input[this.pos]==="?"&&(n=!0,this.pos++);let s=this.input.slice(t,n?this.pos-1:this.pos);n&&(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(/\?$/,""),i=r.get(o);return i!==void 0&&!n?{type:i,value:o,pos:t}:{type:"ident",value:s,pos:t}}};function z(e){return{maxSourceLength:e.limits.maxStringLength,maxTokens:e.limits.maxQueryTokens,maxAstNodes:e.limits.maxQueryElements,maxOperations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth}}var D={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},ee=class{pos=0;tokens;depth=0;operations=0;astNodes=0;limits;constructor(t,n={}){this.tokens=t,this.limits={maxSourceLength:n.maxSourceLength??1024*1024,maxTokens:n.maxTokens??1e5,maxDepth:n.maxDepth??100,maxOperations:n.maxOperations??1e5,maxAstNodes:n.maxAstNodes??1e5};let s=0;for(let r of t)this.useOperation(),r.type==="("||r.type==="["||r.type==="{"?(s++,s>this.limits.maxDepth&&this.throwDepthLimit()):(r.type===")"||r.type==="]"||r.type==="}")&&(s=Math.max(0,s-1))}parse(){let t=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return t}parseExpr(t){return this.withDepth(()=>this.parseExprInner(t))}parseExprInner(t){let n=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r<t)break;n=this.parseInfix(n,r)}return n}useOperation(t=1){if(t>this.limits.maxOperations-this.operations)throw new E(`xan: expression parser operation limit exceeded (${this.limits.maxOperations})`,"iterations");this.operations+=t}withDepth(t){this.depth>=this.limits.maxDepth&&this.throwDepthLimit(),this.depth++;try{return t()}finally{this.depth--}}throwDepthLimit(){throw new E(`xan: expression parser depth limit exceeded (${this.limits.maxDepth})`,"recursion")}addAstNode(){if(this.astNodes>=this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements");this.astNodes++}parsePrefix(){let t=this.peek();switch(t.type){case"int":return this.advance(),{type:"int",value:Number.parseInt(t.value,10)};case"float":return this.advance(),{type:"float",value:Number.parseFloat(t.value)};case"string":return this.advance(),{type:"string",value:t.value};case"regex":{this.advance();let n=t.value.split("/"),s=n.length>1?n[n.length-1]:"";return{type:"regex",pattern:n.slice(0,-1).join("/")||t.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 n=t.value,s=n.endsWith("?"),r=s?n.slice(0,-1):n;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 n=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 i=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:i},r)}this.pos=n}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let n=this.parseExpr(D.UNARY);return n.type==="int"?{type:"int",value:-n.value}:n.type==="float"?{type:"float",value:-n.value}:{type:"func",name:"neg",args:[{expr:n}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(D.UNARY)}]};default:throw new Error(`Unexpected token: ${t.type} (${t.value})`)}}parseFunctionCall(t){this.expect("(");let n=[];if(this.peek().type!==")")do{n.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,i=this.pos+1;i<this.tokens.length&&this.tokens[i].type==="="&&(s=o,this.advance(),this.advance())}let r=this.parseExpr(0);n.push({name:s,expr:r})}while(this.peek().type===",");return this.expect(")"),{type:"func",name:t.toLowerCase(),args:n}}parseList(){this.expect("[");let t=[];if(this.peek().type!=="]")do t.length>0&&this.peek().type===","&&this.advance(),t.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:t}}parseMap(){this.expect("{");let t=[];if(this.peek().type!=="}")do{t.length>0&&this.peek().type===","&&this.advance();let n;if(this.peek().type==="ident")n=this.peek().value,this.advance();else if(this.peek().type==="string")n=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);t.push({key:n,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:t}}parseInfix(t,n){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 i=this.parseExpr(n+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:t},{expr:i}]}}if(s.type==="|"){this.advance();let i=this.parseExpr(n);return this.handlePipe(t,i)}if(s.type===".")return this.advance(),this.handleDot(t);if(s.type==="[")return this.advance(),this.handleIndexing(t);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(t,n){if(n.type==="identifier")return{type:"func",name:n.name,args:[{expr:t}]};if(n.type==="func"){let s=this.countUnderscores(n);return s===0?n:s===1?this.fillUnderscore(n,t):{type:"pipeline",exprs:[t,n]}}return this.countUnderscores(n)===1?this.fillUnderscore(n,t):n}handleDot(t){let n=this.peek();if(n.type==="ident"){let s=n.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:t}),r}return{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}if(n.type==="int"){let s=Number.parseInt(n.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"int",value:s}}]}}if(n.type==="string"){let s=n.value;return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${n.type}`)}handleIndexing(t){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:{type:"int",value:0}},{expr:s}]}}let n=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t},{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:n},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:t},{expr:n}]}}countUnderscores(t){let n=[t],s=0;for(;n.length>0;){this.useOperation();let r=n.pop();if(!r)break;if(r.type==="underscore")s++;else if(r.type==="func")for(let o of r.args)n.push(o.expr);else if(r.type==="list")n.push(...r.elements);else if(r.type==="map")for(let o of r.entries)n.push(o.value);if(n.length>this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements")}return s}fillUnderscore(t,n){return this.withDepth(()=>this.fillUnderscoreInner(t,n))}fillUnderscoreInner(t,n){return this.useOperation(),t.type==="underscore"?n:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.fillUnderscore(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.fillUnderscore(s.value,n)}))}:t}bindLambdaArgs(t,n){return{...t,body:this.bindLambdaArgsInExpr(t.body,n)}}bindLambdaArgsInExpr(t,n){return this.withDepth(()=>this.bindLambdaArgsInExprInner(t,n))}bindLambdaArgsInExprInner(t,n){return this.useOperation(),t.type==="identifier"&&n.includes(t.name)?{type:"lambdaBinding",name:t.name}:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.bindLambdaArgsInExpr(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,n)}))}:t}getInfixPrec(t){switch(t){case"|":return D.PIPE;case"||":case"or":return D.OR;case"&&":case"and":return D.AND;case"==":case"!=":case"eq":case"ne":return D.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return D.COMPARISON;case"+":case"-":case"++":return D.ADDITIVE;case"*":case"/":case"//":case"%":return D.MULTIPLICATIVE;case"**":return D.POWER;case".":case"[":return D.POSTFIX;default:return-1}}isRightAssoc(t){return t==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(t){return this.tokens[this.pos+t]||{type:"eof",value:"",pos:0}}advance(){return this.useOperation(),this.addAstNode(),this.tokens[this.pos++]}expect(t){let n=this.peek();if(n.type!==t)throw new Error(`Expected ${t}, got ${n.type}`);return this.advance()}};function X(e,t={}){let n=[],r=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize(),o=0,i=()=>r[o]||{type:"eof",value:"",pos:0},p=()=>r[o++];for(;i().type!=="eof";){if(i().type===","&&n.length>0){p();continue}let h=[],m=0,c=o;for(;i().type!=="eof";){let l=i();if((l.type===","||l.type==="as")&&m===0)break;(l.type==="("||l.type==="["||l.type==="{")&&m++,(l.type===")"||l.type==="]"||l.type==="}")&&m--,h.push(p())}h.push({type:"eof",value:"",pos:0});let d=new ee(h,t).parse(),u;if(i().type==="as")if(p(),i().type==="("){p();let l=[];for(;i().type!==")"&&i().type!=="eof";)if((i().type==="ident"||i().type==="string")&&(l.push(i().value),p()),i().type===",")p();else if(i().type!==")"&&i().type!=="eof")throw new Error(`Expected tuple alias, got ${i().type}`);if(i().type!==")")throw new Error("Expected ')' after tuple alias");p(),u=l}else if(i().type==="ident"||i().type==="string")u=i().value,p();else throw new Error(`Expected name after 'as', got ${i().type}`);else u=e.slice(r[c].pos,r[o-1]?.pos||e.length).trim(),d.type==="identifier"&&(u=d.name);n.push({expr:d,name:u})}return n}function B(e,t={}){let s=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize();return new ee(s,t).parse()}function R(e,t){return t.length===0?O(e,[]):t.length===1?{type:"Pipe",left:t[0],right:O(e,[])}:{type:"Pipe",left:t[0],right:O(e,t.slice(1))}}var le={add:e=>L("+",e[0],e[1]),sub:e=>L("-",e[0],e[1]),mul:e=>L("*",e[0],e[1]),div:e=>L("/",e[0],e[1]),mod:e=>L("%",e[0],e[1]),idiv:e=>O("floor",[L("/",e[0],e[1])]),pow:e=>R("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>L("==",e[0],e[1]),"!=":e=>L("!=",e[0],e[1]),"<":e=>L("<",e[0],e[1]),"<=":e=>L("<=",e[0],e[1]),">":e=>L(">",e[0],e[1]),">=":e=>L(">=",e[0],e[1]),eq:e=>L("==",M(e[0]),M(e[1])),ne:e=>L("!=",M(e[0]),M(e[1])),lt:e=>L("<",M(e[0]),M(e[1])),le:e=>L("<=",M(e[0]),M(e[1])),gt:e=>L(">",M(e[0]),M(e[1])),ge:e=>L(">=",M(e[0]),M(e[1])),and:e=>L("and",e[0],e[1]),or:e=>L("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>R("length",e),length:e=>R("length",e),upper:e=>R("ascii_upcase",e),lower:e=>R("ascii_downcase",e),trim:e=>R("trim",e),ltrim:e=>e.length===0?O("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?O("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("rtrimstr",[{type:"Literal",value:" "}])},split:e=>R("split",e),join:e=>e.length===1?O("join",[{type:"Literal",value:""}]):R("join",e),concat:e=>L("+",e[0],e[1]),startswith:e=>R("startswith",e),endswith:e=>R("endswith",e),contains:e=>R("contains",e),replace:e=>R("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:L("+",e[1],e[2])},abs:e=>R("fabs",e),floor:e=>R("floor",e),ceil:e=>R("ceil",e),round:e=>R("round",e),sqrt:e=>R("sqrt",e),log:e=>R("log",e),log10:e=>R("log10",e),log2:e=>R("log2",e),exp:e=>R("exp",e),sin:e=>R("sin",e),cos:e=>R("cos",e),tan:e=>R("tan",e),asin:e=>R("asin",e),acos:e=>R("acos",e),atan:e=>R("atan",e),min:e=>R("min",e),max:e=>R("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=>O("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=>O("select",e),empty:()=>O("empty",[]),count:()=>O("length",[]),sum:e=>e.length===0?O("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:O("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},type:"type",isnull:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:null}):L("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:""}):L("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?O("tonumber",[]):O("tonumber",e),tostring:e=>e.length===0?O("tostring",[]):O("tostring",e),if:e=>st(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 t=e[e.length-1];for(let n=e.length-2;n>=0;n--){let s=e[n],r=L("and",L("!=",s,{type:"Literal",value:null}),L("!=",s,{type:"Literal",value:""}));t=st(r,s,t)}return t},index:()=>({type:"Field",name:"_row_index"}),now:()=>O("now",[]),fmt:e=>O("tostring",e),format:e=>O("tostring",e)};Object.setPrototypeOf(le,null);function L(e,t,n){return{type:"BinaryOp",op:e,left:t,right:n}}function O(e,t){return{type:"Call",name:e,args:t}}var mt="then";function st(e,t,n){let s=Xe({type:"Cond",cond:e,elifs:[],else:n||{type:"Literal",value:null}});return s[mt]=t,s}function M(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function U(e,t=!0,n={}){let s={nodes:0,operations:0,maxNodes:n.maxAstNodes??1e5,maxOperations:n.maxOperations??1e5,maxDepth:n.maxDepth??100};return rt(e,t,s,0)}function rt(e,t,n,s){if(s>=n.maxDepth)throw new E(`xan: expression conversion depth limit exceeded (${n.maxDepth})`,"recursion");if(++n.nodes>n.maxNodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(++n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations");let r=o=>rt(o,t,n,s+1);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 t?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{if(e.args.length>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");let o=e.args.map(p=>r(p.expr));if(e.name==="coalesce"){let p=Math.max(0,o.length-1)*7;if(p>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(n.nodes+=p,n.operations+=o.length,n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations")}let i=Object.hasOwn(le,e.name)?le[e.name]:void 0;return typeof i=="function"?i(o):O(typeof i=="string"?i:e.name,o)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((o,i,p)=>{let h=r(i);return p===0?h:{type:"Comma",left:o,right:h}},null)};case"map":return{type:"Object",entries:e.entries.map(o=>({key:o.key,value:r(o.value)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?r(e.start):void 0,end:e.end?r(e.end):void 0};case"lambda":return r(e.body);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function Q(e){return e<2?0:Math.ceil(e*Math.log2(e))}function ue(e,t={}){let n=t.maxArrayElements??1e5,s=t.maxStringLength??10*1024*1024,r=t.maxIterations??1e5,o=t.maxDepth??100;if(K(e)>s)throw new E(`xan: aggregation expression length limit exceeded (${s} bytes)`,"string_length");let i=[],p=0,h=0,m=()=>{if(t.consumeWork?.(),++h>r)throw new E(`xan: aggregation parser operation limit exceeded (${r})`,"iterations")};for(;p<e.length;){for(m();p<e.length&&(e[p]===" "||e[p]===",");)p++;if(p>=e.length)break;let c=p;for(;p<e.length&&/\w/.test(e[p]);)p++;let a=e.slice(c,p);for(;p<e.length&&e[p]===" ";)p++;if(e[p]!=="(")break;p++;let d=1,u=p;for(;p<e.length&&d>0;){if(m(),e[p]==="("?d++:e[p]===")"&&d--,d>o)throw new E(`xan: aggregation parser depth limit exceeded (${o})`,"recursion");d>0&&p++}let l=e.slice(u,p).trim();for(p++;p<e.length&&e[p]===" ";)p++;let f="";if(e.slice(p,p+3).toLowerCase()==="as "){for(p+=3;p<e.length&&e[p]===" ";)p++;let x=p;for(;p<e.length&&/\w/.test(e[p]);)p++;f=e.slice(x,p)}if(f||(f=l?`${a}(${l})`:`${a}()`),i.length>=n)throw new E(`xan: aggregation specification limit exceeded (${n})`,"array_elements");i.push({func:a,expr:l,alias:f})}return i}function ft(e){return/^\w+$/.test(e)}function ht(e,t,n){let s=V(e,t,n);return s.length>0?s[0]:null}function ce(e,t,n={},s={}){let{func:r,expr:o}=t,i=s.maxArrayElements??1e5,p=s.maxStringLength??10*1024*1024,h=s.maxIterations??1e5,m={maxSourceLength:p,maxTokens:i,maxAstNodes:i,maxOperations:h,maxDepth:s.maxDepth??100};if(e.length>i)throw new E(`xan: aggregation input limit exceeded (${i})`,"array_elements");if(r==="count"&&!o)return e.length;let c=ft(o),a=c?null:U(B(o,m),!0,m),d;if(c)d=f=>f[o];else{if(a===null)throw new Error("xan: missing compiled aggregation expression");d=f=>ht(f,a,n)}if(r==="all"||r==="any"){let f=0;for(let x of e){if(s.consumeWork?.(),++f>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let g=!!d(x);if(r==="all"&&!g)return!1;if(r==="any"&&g)return!0}return r==="all"}let u=[],l=0;for(let f of e){if(s.consumeWork?.(),++l>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let x=d(f);if(x!=null){if(u.length>=i)throw new E(`xan: aggregation value limit exceeded (${i})`,"array_elements");u.push(x)}}switch(r){case"count":{if(c)return u.length;let f=0;for(let x of u)s.consumeWork?.(),x&&f++;return f}case"sum":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return f}case"mean":case"avg":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return u.length>0?f/u.length:0}case"min":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.min(f,g)}return f}case"max":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.max(f,g)}return f}case"first":return u.length>0?u[0]:null;case"last":return u.length>0?u[u.length-1]:null;case"median":{let f=[];for(let g of u){s.consumeWork?.();let y=typeof g=="number"?g:Number.parseFloat(String(g));Number.isNaN(y)||f.push(y)}if(s.consumeWork?.(Q(f.length)),f.sort((g,y)=>g-y),f.length===0)return null;let x=Math.floor(f.length/2);return f.length%2===0?(f[x-1]+f[x])/2:f[x]}case"mode":{let f=new Map;for(let y of u){s.consumeWork?.();let w=String(y);f.set(w,(f.get(w)||0)+1)}let x=0,g=null;for(let[y,w]of f)s.consumeWork?.(),w>x&&(x=w,g=y);return g}case"cardinality":{let f=new Set;for(let x of u)s.consumeWork?.(),f.add(String(x));return f.size}case"values":return ot(u,!1,p,s);case"distinct_values":return ot(u,!0,p,s);default:return null}}function it(e,t,n={},s={}){let r=F();for(let o of t)b(r,o.alias,ce(e,o,n,s));return r}function ot(e,t,n,s){let r=[],o=t?new Set:null,i=0;for(let p of e){s.consumeWork?.();let h=String(p);if(o?.has(h))continue;o?.add(h);let m=K(h)+(r.length>0?1:0);if(m>n-i)throw new E(`xan: aggregation string limit exceeded (${n} bytes)`,"string_length");r.push(h),i+=m}return t&&(s.consumeWork?.(Q(r.length)),r.sort()),r.join("|")}function lt(e,t){return{maxArrayElements:e.limits.maxArrayElements,maxStringLength:e.limits.maxStringLength,maxIterations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth,consumeWork:(n=1)=>t.consumeWork(n)}}function at(e,t,n){let s=e.size-(t&&e.has("")?1:0);return n>0?Math.min(s,n):s}async function pe(e,t){let n="",s=[];for(let d of e)d.startsWith("-")||(n?s.push(d):n=d);if(!n)return{stdout:"",stderr:`xan agg: no aggregation expression
@@ -62,7 +62,7 @@ import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k
62
62
  `,exitCode:1};i=o[0].headers}let m=[];for(let{headers:c,data:a}of o)for(let d of a){let u=F();for(let l of i)b(u,l,c.includes(l)?d[l]:"");m.push(u)}return{stdout:C(i,m,t),stderr:"",exitCode:0}}async function Be(e,t){let n="",s=[],r=!1,o=!1,i=[];for(let u=0;u<e.length;u++){let l=e[u];(l==="-s"||l==="--select")&&u+1<e.length?s=e[++u].split(","):l==="-v"||l==="--invert"?r=!0:l==="-i"||l==="--ignore-case"?o=!0:l==="-r"||l==="--regex"||l.startsWith("-")||(n?i.push(l):n=l)}if(!n)return{stdout:"",stderr:`xan search: no pattern specified
63
63
  `,exitCode:1};let{headers:p,data:h,error:m}=await k(i,t);if(m)return m;let c=s.length>0?s:p,a;try{a=Z(n,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${n}'
64
64
  `,exitCode:1}}let d=h.filter(u=>{let l=c.some(f=>{let x=u[f];return x!=null&&a.test(String(x))});return r?!l:l});return{stdout:C(p,d,t),stderr:"",exitCode:0}}async function He(e,t){let n="",s=[];for(let l of e)l.startsWith("-")||(n?s.push(l):n=l);if(!n)return{stdout:"",stderr:`xan flatmap: no expression specified
65
- `,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-PD26QEFN.js");return n(e,t)}var dt=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),St=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",...dt]),pt={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.
65
+ `,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-CNGKCABE.js");return n(e,t)}var dt=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),St=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",...dt]),pt={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.
66
66
  It provides a simple, ergonomic interface for common data operations.
67
67
 
68
68
  COMMANDS:
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as n}from"./chunk-BIJXTWZ4.js";import{b as $}from"./chunk-GR4ZHKXI.js";import{l as F}from"./chunk-FUT3X2GJ.js";import{a as S}from"./chunk-CPKBPQ2C.js";import{a as x}from"./chunk-NE4R2FVV.js";import{a as z,b as O}from"./chunk-MUFNRCMY.js";var M={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},E={format:{short:"c",type:"string"}},I={name:"stat",async execute(l,s){if(O(l))return z(M);let o=x("stat",l,E);if(!o.ok)return o.error;let m=o.result.flags.format??null,u=o.result.positional;if(u.length===0)return{stdout:"",stderr:`stat: missing operand
3
+ import{a as n}from"./chunk-BIJXTWZ4.js";import{b as $}from"./chunk-C2BLJ3AE.js";import{l as F}from"./chunk-FUT3X2GJ.js";import{a as S}from"./chunk-CPKBPQ2C.js";import{a as x}from"./chunk-NE4R2FVV.js";import{a as z,b as O}from"./chunk-MUFNRCMY.js";var M={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},E={format:{short:"c",type:"string"}},I={name:"stat",async execute(l,s){if(O(l))return z(M);let o=x("stat",l,E);if(!o.ok)return o.error;let m=o.result.flags.format??null,u=o.result.positional;if(u.length===0)return{stdout:"",stderr:`stat: missing operand
4
4
  `,exitCode:1};let c="",f="",p=!1,d=0,g=Math.min(s.limits.maxOutputSize,s.limits.maxStringLength),h=e=>{let r=S(e);if(r>g-d)throw new F(`stat: output size limit exceeded (${g} bytes)`,"output_size");c+=e,d+=r};for(let e of u){let r=s.fs.resolvePath(s.cwd,e);try{let t=await s.fs.stat(r);if(m){let a=t.mode.toString(8),i=n(t.mode,t.isDirectory),w=new Map([["%n",e],["%N",`'${e}'`],["%s",String(t.size)],["%F",t.isDirectory?"directory":"regular file"],["%a",a],["%A",i],["%u","1000"],["%U","user"],["%g","1000"],["%G","group"]]),A=m.replace(/%[nNsFaAuUgG]/g,y=>w.get(y)??y);h(`${A}
5
5
  `)}else{let a=t.mode.toString(8).padStart(4,"0"),i=n(t.mode,t.isDirectory);h(` File: ${e}
6
6
  Size: ${t.size} Blocks: ${Math.ceil(t.size/512)}
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b}from"./chunk-N26Y42L6.js";import"./chunk-I57EACSL.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as column,b as flagsForFuzzing};
3
+ import{a,b}from"./chunk-3M5OMKFS.js";import"./chunk-O3PNT72D.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as column,b as flagsForFuzzing};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b}from"./chunk-IRCAXXH6.js";import"./chunk-AIWBN36Z.js";import"./chunk-UBA7DOWE.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as cpCommand,b as flagsForFuzzing};
3
+ import{a,b}from"./chunk-HSWCKN2X.js";import"./chunk-AIWBN36Z.js";import"./chunk-UBA7DOWE.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-I4IRHQDW.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as cpCommand,b as flagsForFuzzing};
@@ -1,31 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{b as W}from"./chunk-O2BCKSMK.js";import{d as w}from"./chunk-TW2IJRUF.js";import{a as g}from"./chunk-I4IRHQDW.js";import{a as H,b as x,c as T}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";function b(s){return encodeURIComponent(s).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16)}`).replace(/%20/g,"+").replace(/%[0-9A-F]{2}/g,e=>e.toLowerCase())}function O(s){let e=s.indexOf("=");if(e>=0){let i=s.slice(0,e),r=s.slice(e+1),o=b(r);return i?`${i}=${o}`:o}return b(s)}function F(s){let e=s.indexOf("=");if(e<0)return null;let i=s.slice(0,e),r=s.slice(e+1),o,t,a=r.match(/;type=([^;]+)$/);a&&(t=a[1],r=r.slice(0,-a[0].length));let n=r.match(/;filename=([^;]+)/);return n&&(o=n[1],r=r.replace(n[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(o=o??r.slice(1).split("/").pop()),{name:i,value:r,filename:o,contentType:t}}function $(s,e){let i=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let o of s){let t=o.value;if(t.startsWith("@")||t.startsWith("<")){let n=t.slice(1);t=e.get(n)??""}let a=`--${i}\r
3
+ import{a as k,b as E}from"./chunk-PEJXCXSY.js";import{d as w}from"./chunk-ENEHPI32.js";import{a as x,b as W,d as F}from"./chunk-CPKBPQ2C.js";import{a as S}from"./chunk-I4IRHQDW.js";import{a as O,b as $,c as g}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";function b(s){return encodeURIComponent(s).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16)}`).replace(/%20/g,"+").replace(/%[0-9A-F]{2}/g,e=>e.toLowerCase())}function C(s){let e=s.indexOf("=");if(e>=0){let i=s.slice(0,e),r=s.slice(e+1),o=b(r);return i?`${i}=${o}`:o}return b(s)}function P(s){let e=s.indexOf("=");if(e<0)return null;let i=s.slice(0,e),r=s.slice(e+1),o,t,a=r.match(/;type=([^;]+)$/);a&&(t=a[1],r=r.slice(0,-a[0].length));let n=r.match(/;filename=([^;]+)/);return n&&(o=n[1],r=r.replace(n[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(o=o??r.slice(1).split("/").pop()),{name:i,value:r,filename:o,contentType:t}}function A(s,e){let i=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let o of s){let t=o.value;if(t.startsWith("@")||t.startsWith("<")){let n=t.slice(1);t=e.get(n)??""}let a=`--${i}\r
4
4
  `;o.filename?(a+=`Content-Disposition: form-data; name="${o.name}"; filename="${o.filename}"\r
5
5
  `,o.contentType&&(a+=`Content-Type: ${o.contentType}\r
6
6
  `)):a+=`Content-Disposition: form-data; name="${o.name}"\r
7
7
  `,a+=`\r
8
8
  ${t}\r
9
9
  `,r.push(a)}return r.push(`--${i}--\r
10
- `),{body:r.join(""),boundary:i}}var S={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data (DATA=@file reads from file, strips newlines)","-G, --get Append data payloads to URL query string"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data (DATA=@file reads file verbatim)"," --data-urlencode DATA URL-encode and POST data (supports @file and name@file)","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-D, --dump-header FILE Write response headers to FILE (`-` for stdout)","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]};function m(s,e,i){i.allowFile&&e.startsWith("@")?s.dataParts.push({file:{path:e.slice(1),mode:i.binary?"binary":"ascii"}}):s.dataParts.push({value:e}),i.binary&&(s.dataBinary=!0)}function k(s,e){if(e.startsWith("@")){s.dataParts.push({file:{path:e.slice(1),mode:"urlencode"}});return}let i=e.indexOf("@"),r=e.indexOf("=");if(i>0&&(r<0||i<r)){s.dataParts.push({file:{path:e.slice(i+1),mode:"urlencode",name:e.slice(0,i)}});return}s.dataParts.push({value:O(e)})}function C(s){let e={method:"GET",headers:new w,dataParts:[],dataBinary:!1,getMode:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1},i=!1,r=!1;for(let o=0;o<s.length;o++){let t=s[o];if(t==="-X"||t==="--request")e.method=s[++o]??"GET",r=!0;else if(t.startsWith("-X"))e.method=t.slice(2),r=!0;else if(t.startsWith("--request="))e.method=t.slice(10),r=!0;else if(t==="-H"||t==="--header"){let a=s[++o];if(a){let n=a.indexOf(":");if(n>0){let f=a.slice(0,n).trim(),l=a.slice(n+1).trim();e.headers.append(f,l)}}}else if(t.startsWith("--header=")){let a=t.slice(9),n=a.indexOf(":");if(n>0){let f=a.slice(0,n).trim(),l=a.slice(n+1).trim();e.headers.append(f,l)}}else if(t==="-G"||t==="--get")e.getMode=!0,r||(e.method="GET");else if(t==="-d"||t==="--data")m(e,s[++o]??"",{binary:!1,allowFile:!0}),i=!0;else if(t==="--data-raw")m(e,s[++o]??"",{binary:!1,allowFile:!1}),i=!0;else if(t.startsWith("-d"))m(e,t.slice(2),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data="))m(e,t.slice(7),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data-raw="))m(e,t.slice(11),{binary:!1,allowFile:!1}),i=!0;else if(t==="--data-binary")m(e,s[++o]??"",{binary:!0,allowFile:!0}),i=!0;else if(t.startsWith("--data-binary="))m(e,t.slice(14),{binary:!0,allowFile:!0}),i=!0;else if(t==="--data-urlencode")k(e,s[++o]??""),i=!0;else if(t.startsWith("--data-urlencode="))k(e,t.slice(17)),i=!0;else if(t==="-F"||t==="--form"){let a=s[++o]??"",n=F(a);n&&e.formFields.push(n),i=!0}else if(t.startsWith("--form=")){let a=t.slice(7),n=F(a);n&&e.formFields.push(n),i=!0}else if(t==="-u"||t==="--user")e.user=s[++o];else if(t.startsWith("-u"))e.user=t.slice(2);else if(t.startsWith("--user="))e.user=t.slice(7);else if(t==="-A"||t==="--user-agent")e.headers.set("User-Agent",s[++o]??"");else if(t.startsWith("-A"))e.headers.set("User-Agent",t.slice(2));else if(t.startsWith("--user-agent="))e.headers.set("User-Agent",t.slice(13));else if(t==="-e"||t==="--referer")e.headers.set("Referer",s[++o]??"");else if(t.startsWith("-e"))e.headers.set("Referer",t.slice(2));else if(t.startsWith("--referer="))e.headers.set("Referer",t.slice(10));else if(t==="-b"||t==="--cookie")e.headers.set("Cookie",s[++o]??"");else if(t.startsWith("-b"))e.headers.set("Cookie",t.slice(2));else if(t.startsWith("--cookie="))e.headers.set("Cookie",t.slice(9));else if(t==="-c"||t==="--cookie-jar")e.cookieJar=s[++o];else if(t.startsWith("--cookie-jar="))e.cookieJar=t.slice(13);else if(t==="-T"||t==="--upload-file")e.uploadFile=s[++o],e.method==="GET"&&(e.method="PUT");else if(t.startsWith("--upload-file="))e.uploadFile=t.slice(14),e.method==="GET"&&(e.method="PUT");else if(t==="-m"||t==="--max-time"){let a=parseFloat(s[++o]??"0");!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--max-time=")){let a=parseFloat(t.slice(11));!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t==="--connect-timeout"){let a=parseFloat(s[++o]??"0");!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--connect-timeout=")){let a=parseFloat(t.slice(18));!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t==="-o"||t==="--output")e.outputFile=s[++o];else if(t.startsWith("--output="))e.outputFile=t.slice(9);else if(t==="-D"||t==="--dump-header"){let a=s[++o];if(a===void 0)return{stdout:"",stderr:`curl: option ${t}: requires parameter
10
+ `),{body:r.join(""),boundary:i}}var D={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data (DATA=@file reads from file, strips newlines)","-G, --get Append data payloads to URL query string"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data (DATA=@file reads file verbatim)"," --data-urlencode DATA URL-encode and POST data (supports @file and name@file)","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-D, --dump-header FILE Write response headers to FILE (`-` for stdout)","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]};function h(s,e,i){i.allowFile&&e.startsWith("@")?s.dataParts.push({file:{path:e.slice(1),mode:i.binary?"binary":"ascii"}}):s.dataParts.push({value:e}),i.binary&&(s.dataBinary=!0)}function R(s,e){if(e.startsWith("@")){s.dataParts.push({file:{path:e.slice(1),mode:"urlencode"}});return}let i=e.indexOf("@"),r=e.indexOf("=");if(i>0&&(r<0||i<r)){s.dataParts.push({file:{path:e.slice(i+1),mode:"urlencode",name:e.slice(0,i)}});return}s.dataParts.push({value:C(e)})}function M(s){let e={method:"GET",headers:new w,dataParts:[],dataBinary:!1,getMode:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1},i=!1,r=!1;for(let o=0;o<s.length;o++){let t=s[o];if(t==="-X"||t==="--request")e.method=s[++o]??"GET",r=!0;else if(t.startsWith("-X"))e.method=t.slice(2),r=!0;else if(t.startsWith("--request="))e.method=t.slice(10),r=!0;else if(t==="-H"||t==="--header"){let a=s[++o];if(a){let n=a.indexOf(":");if(n>0){let l=a.slice(0,n).trim(),d=a.slice(n+1).trim();e.headers.append(l,d)}}}else if(t.startsWith("--header=")){let a=t.slice(9),n=a.indexOf(":");if(n>0){let l=a.slice(0,n).trim(),d=a.slice(n+1).trim();e.headers.append(l,d)}}else if(t==="-G"||t==="--get")e.getMode=!0,r||(e.method="GET");else if(t==="-d"||t==="--data")h(e,s[++o]??"",{binary:!1,allowFile:!0}),i=!0;else if(t==="--data-raw")h(e,s[++o]??"",{binary:!1,allowFile:!1}),i=!0;else if(t.startsWith("-d"))h(e,t.slice(2),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data="))h(e,t.slice(7),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data-raw="))h(e,t.slice(11),{binary:!1,allowFile:!1}),i=!0;else if(t==="--data-binary")h(e,s[++o]??"",{binary:!0,allowFile:!0}),i=!0;else if(t.startsWith("--data-binary="))h(e,t.slice(14),{binary:!0,allowFile:!0}),i=!0;else if(t==="--data-urlencode")R(e,s[++o]??""),i=!0;else if(t.startsWith("--data-urlencode="))R(e,t.slice(17)),i=!0;else if(t==="-F"||t==="--form"){let a=s[++o]??"",n=P(a);n&&e.formFields.push(n),i=!0}else if(t.startsWith("--form=")){let a=t.slice(7),n=P(a);n&&e.formFields.push(n),i=!0}else if(t==="-u"||t==="--user")e.user=s[++o];else if(t.startsWith("-u"))e.user=t.slice(2);else if(t.startsWith("--user="))e.user=t.slice(7);else if(t==="-A"||t==="--user-agent")e.headers.set("User-Agent",s[++o]??"");else if(t.startsWith("-A"))e.headers.set("User-Agent",t.slice(2));else if(t.startsWith("--user-agent="))e.headers.set("User-Agent",t.slice(13));else if(t==="-e"||t==="--referer")e.headers.set("Referer",s[++o]??"");else if(t.startsWith("-e"))e.headers.set("Referer",t.slice(2));else if(t.startsWith("--referer="))e.headers.set("Referer",t.slice(10));else if(t==="-b"||t==="--cookie")e.headers.set("Cookie",s[++o]??"");else if(t.startsWith("-b"))e.headers.set("Cookie",t.slice(2));else if(t.startsWith("--cookie="))e.headers.set("Cookie",t.slice(9));else if(t==="-c"||t==="--cookie-jar")e.cookieJar=s[++o];else if(t.startsWith("--cookie-jar="))e.cookieJar=t.slice(13);else if(t==="-T"||t==="--upload-file")e.uploadFile=s[++o],e.method==="GET"&&(e.method="PUT");else if(t.startsWith("--upload-file="))e.uploadFile=t.slice(14),e.method==="GET"&&(e.method="PUT");else if(t==="-m"||t==="--max-time"){let a=parseFloat(s[++o]??"0");!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--max-time=")){let a=parseFloat(t.slice(11));!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t==="--connect-timeout"){let a=parseFloat(s[++o]??"0");!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--connect-timeout=")){let a=parseFloat(t.slice(18));!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t==="-o"||t==="--output")e.outputFile=s[++o];else if(t.startsWith("--output="))e.outputFile=t.slice(9);else if(t==="-D"||t==="--dump-header"){let a=s[++o];if(a===void 0)return{stdout:"",stderr:`curl: option ${t}: requires parameter
11
11
  `,exitCode:1};if(a==="")return{stdout:"",stderr:`curl: option ${t}: blank argument where content is expected
12
12
  `,exitCode:1};e.dumpHeader=a}else if(t.startsWith("--dump-header=")){let a=t.slice(14);if(a==="")return{stdout:"",stderr:`curl: option --dump-header: blank argument where content is expected
13
13
  `,exitCode:1};e.dumpHeader=a}else if(t.startsWith("-D")&&t.length>2)e.dumpHeader=t.slice(2);else if(t==="-O"||t==="--remote-name")e.useRemoteName=!0;else if(t==="-I"||t==="--head")e.headOnly=!0,e.method="HEAD",r=!0;else if(t==="-i"||t==="--include")e.includeHeaders=!0;else if(t==="-s"||t==="--silent")e.silent=!0;else if(t==="-S"||t==="--show-error")e.showError=!0;else if(t==="-f"||t==="--fail")e.failSilently=!0;else if(t==="-L"||t==="--location")e.followRedirects=!0;else if(t==="--max-redirs"){let a=s[++o];if(a===void 0||!/^\d+$/.test(a))return{stdout:"",stderr:`curl: option --max-redirs: expected a non-negative integer
14
14
  `,exitCode:2};let n=Number(a);if(!Number.isSafeInteger(n))return{stdout:"",stderr:`curl: option --max-redirs: value is out of range
15
15
  `,exitCode:2};e.maxRedirects=n}else if(t.startsWith("--max-redirs=")){let a=t.slice(13);if(!/^\d+$/.test(a)||!Number.isSafeInteger(Number(a)))return{stdout:"",stderr:`curl: option --max-redirs: expected a non-negative integer
16
- `,exitCode:2};e.maxRedirects=Number(a)}else if(t==="-w"||t==="--write-out")e.writeOut=s[++o];else if(t.startsWith("--write-out="))e.writeOut=t.slice(12);else if(t==="-v"||t==="--verbose")e.verbose=!0;else{if(t.startsWith("--")&&t!=="--")return T("curl",t);if(t.startsWith("-")&&t!=="-")for(let a of t.slice(1))switch(a){case"s":e.silent=!0;break;case"S":e.showError=!0;break;case"f":e.failSilently=!0;break;case"L":e.followRedirects=!0;break;case"I":e.headOnly=!0,e.method="HEAD",r=!0;break;case"i":e.includeHeaders=!0;break;case"O":e.useRemoteName=!0;break;case"v":e.verbose=!0;break;case"G":e.getMode=!0,r||(e.method="GET");break;default:return T("curl",`-${a}`)}else t.startsWith("-")||(e.url=t)}}return i&&!r&&!e.getMode&&(e.method="POST"),e}function R(s){return Object.entries(s).map(([e,i])=>`${e}: ${i}`).join(`\r
17
- `)}function h(s,e,i){return`HTTP/1.1 ${s} ${e}\r
18
- ${R(i)}\r
16
+ `,exitCode:2};e.maxRedirects=Number(a)}else if(t==="-w"||t==="--write-out")e.writeOut=s[++o];else if(t.startsWith("--write-out="))e.writeOut=t.slice(12);else if(t==="-v"||t==="--verbose")e.verbose=!0;else{if(t.startsWith("--")&&t!=="--")return g("curl",t);if(t.startsWith("-")&&t!=="-")for(let a of t.slice(1))switch(a){case"s":e.silent=!0;break;case"S":e.showError=!0;break;case"f":e.failSilently=!0;break;case"L":e.followRedirects=!0;break;case"I":e.headOnly=!0,e.method="HEAD",r=!0;break;case"i":e.includeHeaders=!0;break;case"O":e.useRemoteName=!0;break;case"v":e.verbose=!0;break;case"G":e.getMode=!0,r||(e.method="GET");break;default:return g("curl",`-${a}`)}else t.startsWith("-")||(e.url=t)}}return i&&!r&&!e.getMode&&(e.method="POST"),e}function N(s){return Object.entries(s).map(([e,i])=>`${e}: ${i}`).join(`\r
17
+ `)}function m(s,e,i){return`HTTP/1.1 ${s} ${e}\r
18
+ ${N(i)}\r
19
19
  \r
20
- `}function E(s){try{return new URL(s).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function P(s,e){let i=s;return i=i.replace(/%\{http_code\}/g,String(e.status)),i=i.replace(/%\{content_type\}/g,e.headers["content-type"]||""),i=i.replace(/%\{url_effective\}/g,e.url),i=i.replace(/%\{size_download\}/g,String(e.bodyLength)),i=i.replace(/\\n/g,`
21
- `),i}async function D(s,e){if(s.dataParts.length===0)return;let i=[];for(let r of s.dataParts)if(r.file){let o=e.fs.resolvePath(e.cwd,r.file.path),t=await e.fs.readFile(o);if(r.file.mode==="ascii")i.push(t.replace(/[\r\n]/g,""));else if(r.file.mode==="binary")i.push(t);else{let a=b(t);i.push(r.file.name?`${r.file.name}=${a}`:a)}}else i.push(r.value??"");return i.join("&")}async function M(s,e,i){if(s.uploadFile){let r=e.fs.resolvePath(e.cwd,s.uploadFile);return{body:await e.fs.readFile(r)}}if(s.formFields.length>0){let r=new Map;for(let a of s.formFields)if(a.value.startsWith("@")||a.value.startsWith("<")){let n=e.fs.resolvePath(e.cwd,a.value.slice(1));try{let f=await e.fs.readFile(n);r.set(a.value.slice(1),f)}catch{r.set(a.value.slice(1),"")}}let{body:o,boundary:t}=$(s.formFields,r);return{body:o,contentType:`multipart/form-data; boundary=${t}`}}return i!==void 0&&!s.getMode?{body:i,contentType:"application/x-www-form-urlencoded"}:{}}function N(s,e){if(!e)return s;let i=s.indexOf("#"),r=i===-1?s:s.slice(0,i),o=i===-1?"":s.slice(i),t=r.endsWith("?")||r.endsWith("&")?"":r.includes("?")?"&":"?";return`${r}${t}${e}${o}`}function L(s,e){let i=new w(s.headers);if(s.user){let r=Buffer.from(s.user).toString("base64");i.set("Authorization",`Basic ${r}`)}return e&&!i.has("Content-Type")&&i.set("Content-Type",e),i}async function U(s,e,i){if(!s.cookieJar)return;let r=e["set-cookie"];if(!r)return;let o=i.fs.resolvePath(i.cwd,s.cookieJar);await i.fs.writeFile(o,r)}function I(s){return W(s,"binary")}function B(s,e,i){let r="";if(s.verbose){r+=`> ${s.method} ${i}
20
+ `}function L(s){try{return new URL(s).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function v(s,e){let i=s;return i=i.replace(/%\{http_code\}/g,String(e.status)),i=i.replace(/%\{content_type\}/g,e.headers["content-type"]||""),i=i.replace(/%\{url_effective\}/g,e.url),i=i.replace(/%\{size_download\}/g,String(e.bodyLength)),i=i.replace(/\\n/g,`
21
+ `),i}var U=new TextEncoder,B=new TextDecoder("utf8",{ignoreBOM:!0});async function I(s,e){if(s.dataParts.length===0)return;let i=[],r=!1,o=!1;for(let l of s.dataParts)if(l.file){if(l.file.mode==="binary"){o=!0,l.file.path==="-"?(i.push(k(r?F:e.stdin,"binary")),r=!0):i.push(await e.fs.readFileBuffer(e.fs.resolvePath(e.cwd,l.file.path)));continue}let d=l.file.path==="-"?W(r?F:e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,l.file.path));if(l.file.path==="-"&&(r=!0),l.file.mode==="ascii")i.push(d.replace(/[\r\n]/g,""));else{let p=b(d);i.push(l.file.name?`${l.file.name}=${p}`:p)}}else i.push(l.value??"");if(!o)return i.join("&");let t=i.length-1;for(let l of i)t+=typeof l=="string"?x(l):l.byteLength;let a=new Uint8Array(t),n=0;for(let l=0;l<i.length;l+=1){l>0&&(a[n]=38,n+=1);let d=i[l];typeof d=="string"?n+=U.encodeInto(d,a.subarray(n)).written:(a.set(d,n),n+=d.byteLength)}return a}async function q(s,e,i){if(s.uploadFile){let r=e.fs.resolvePath(e.cwd,s.uploadFile);return{body:await e.fs.readFile(r)}}if(s.formFields.length>0){let r=new Map;for(let a of s.formFields)if(a.value.startsWith("@")||a.value.startsWith("<")){let n=e.fs.resolvePath(e.cwd,a.value.slice(1));try{let l=await e.fs.readFile(n);r.set(a.value.slice(1),l)}catch{r.set(a.value.slice(1),"")}}let{body:o,boundary:t}=A(s.formFields,r);return{body:o,contentType:`multipart/form-data; boundary=${t}`}}return i!==void 0&&!s.getMode?{body:i,contentType:"application/x-www-form-urlencoded"}:{}}function j(s,e){if(!e)return s;let i=s.indexOf("#"),r=i===-1?s:s.slice(0,i),o=i===-1?"":s.slice(i),t=r.endsWith("?")||r.endsWith("&")?"":r.includes("?")?"&":"?";return`${r}${t}${e}${o}`}function G(s,e){let i=new w(s.headers);if(s.user){let r=Buffer.from(s.user).toString("base64");i.set("Authorization",`Basic ${r}`)}return e&&!i.has("Content-Type")&&i.set("Content-Type",e),i}async function _(s,e,i){if(!s.cookieJar)return;let r=e["set-cookie"];if(!r)return;let o=i.fs.resolvePath(i.cwd,s.cookieJar);await i.fs.writeFile(o,r)}function J(s){return E(s,"binary")}function X(s,e,i){let r="";if(s.verbose){r+=`> ${s.method} ${i}
22
22
  `;for(let[o,t]of s.headers)r+=`> ${o}: ${t}
23
23
  `;r+=`>
24
24
  `,r+=`< HTTP/1.1 ${e.status} ${e.statusText}
25
25
  `;for(let[o,t]of Object.entries(e.headers))r+=`< ${o}: ${t}
26
26
  `;r+=`<
27
- `}return s.includeHeaders&&!s.verbose&&(r+=h(e.status,e.statusText,e.headers)),s.headOnly?s.includeHeaders||s.verbose||(r+=h(e.status,e.statusText,e.headers)):r+=I(e.body),s.writeOut&&(r+=P(s.writeOut,{status:e.status,headers:e.headers,url:e.url,bodyLength:e.body.byteLength})),r}var ie={name:"curl",async execute(s,e){if(x(s))return H(S);let i=C(s);if("exitCode"in i)return i;let r=i;if(!r.url)return{stdout:"",stderr:`curl: no URL specified
27
+ `}return s.includeHeaders&&!s.verbose&&(r+=m(e.status,e.statusText,e.headers)),s.headOnly?s.includeHeaders||s.verbose||(r+=m(e.status,e.statusText,e.headers)):r+=J(e.body),s.writeOut&&(r+=v(s.writeOut,{status:e.status,headers:e.headers,url:e.url,bodyLength:e.body.byteLength})),r}var ce={name:"curl",async execute(s,e){if($(s))return O(D);let i=M(s);if("exitCode"in i)return i;let r=i;if(!r.url)return{stdout:"",stderr:`curl: no URL specified
28
28
  `,exitCode:2};if(!e.fetch)return{stdout:"",stderr:`curl: internal error: fetch not available
29
- `,exitCode:1};let o=r.url;o.match(/^https?:\/\//)||(o=`https://${o}`);try{let t=await D(r,e);r.getMode&&(o=N(o,t));let{body:a,contentType:n}=await M(r,e,t),f=L(r,n);if(r.dumpHeader!==void 0&&r.dumpHeader!=="-"){let d=e.fs.resolvePath(e.cwd,r.dumpHeader);await e.fs.writeFile(d,"")}let l=await e.fetch(o,{method:r.method,headers:f,body:a,followRedirects:r.followRedirects,timeoutMs:r.timeoutMs,maxRedirects:r.maxRedirects,signal:e.signal});await U(r,l.headers,e);let A=h(l.status,l.statusText,l.headers),c="";if(l.redirectChain)for(let d of l.redirectChain)c+=h(d.status,d.statusText,d.headers);if(c+=A,r.dumpHeader!==void 0&&r.dumpHeader!=="-"){let d=e.fs.resolvePath(e.cwd,r.dumpHeader);await e.fs.writeFile(d,c)}if(r.failSilently&&l.status>=400){let d=r.showError||!r.silent?`curl: (22) The requested URL returned error: ${l.status}
30
- `:"",p=r.dumpHeader==="-"?c:"";return{stdout:p,stderr:d,exitCode:22,stdoutKind:p?"bytes":void 0}}let v=!!(r.outputFile||r.useRemoteName),u=v&&!r.verbose?"":B(r,l,o);if(v){let d=r.outputFile||E(o),p=e.fs.resolvePath(e.cwd,d);if(await e.fs.writeFile(p,r.headOnly?"":l.body),r.verbose?u=(r.dumpHeader==="-"?c:"")+u:r.dumpHeader==="-"?u=c:u="",r.writeOut){let y=P(r.writeOut,{status:l.status,headers:l.headers,url:l.url,bodyLength:l.body.byteLength});r.verbose?u+=y:r.dumpHeader==="-"?u=c+y:u=y}}else r.dumpHeader==="-"&&(u=c+u);return{stdout:u,stderr:"",exitCode:0,stdoutKind:"bytes"}}catch(t){let a=g(t),n=1;return a.includes("Network access denied")?n=7:a.includes("HTTP method")&&a.includes("not allowed")?n=3:a.includes("Redirect target not in allow-list")||a.includes("Too many redirects")?n=47:a.includes("aborted")&&(n=28),{stdout:"",stderr:!r.silent||r.showError?`curl: (${n}) ${a}
31
- `:"",exitCode:n}}}};export{ie as curlCommand};
29
+ `,exitCode:1};let o=r.url;o.match(/^https?:\/\//)||(o=`https://${o}`);try{let t=await I(r,e);r.getMode&&(o=j(o,t instanceof Uint8Array?B.decode(t):t));let{body:a,contentType:n}=await q(r,e,t),l=G(r,n);if(r.dumpHeader!==void 0&&r.dumpHeader!=="-"){let u=e.fs.resolvePath(e.cwd,r.dumpHeader);await e.fs.writeFile(u,"")}let d=await e.fetch(o,{method:r.method,headers:l,body:a,followRedirects:r.followRedirects,timeoutMs:r.timeoutMs,maxRedirects:r.maxRedirects,signal:e.signal});await _(r,d.headers,e);let p=m(d.status,d.statusText,d.headers),c="";if(d.redirectChain)for(let u of d.redirectChain)c+=m(u.status,u.statusText,u.headers);if(c+=p,r.dumpHeader!==void 0&&r.dumpHeader!=="-"){let u=e.fs.resolvePath(e.cwd,r.dumpHeader);await e.fs.writeFile(u,c)}if(r.failSilently&&d.status>=400){let u=r.showError||!r.silent?`curl: (22) The requested URL returned error: ${d.status}
30
+ `:"",y=r.dumpHeader==="-"?c:"";return{stdout:y,stderr:u,exitCode:22,stdoutKind:y?"bytes":void 0}}let H=!!(r.outputFile||r.useRemoteName),f=H&&!r.verbose?"":X(r,d,o);if(H){let u=r.outputFile||L(o),y=e.fs.resolvePath(e.cwd,u);if(await e.fs.writeFile(y,r.headOnly?"":d.body),r.verbose?f=(r.dumpHeader==="-"?c:"")+f:r.dumpHeader==="-"?f=c:f="",r.writeOut){let T=v(r.writeOut,{status:d.status,headers:d.headers,url:d.url,bodyLength:d.body.byteLength});r.verbose?f+=T:r.dumpHeader==="-"?f=c+T:f=T}}else r.dumpHeader==="-"&&(f=c+f);return{stdout:f,stderr:"",exitCode:0,stdoutKind:"bytes"}}catch(t){let a=S(t),n=1;return a.includes("Network access denied")?n=7:a.includes("HTTP method")&&a.includes("not allowed")?n=3:a.includes("Redirect target not in allow-list")||a.includes("Too many redirects")?n=47:a.includes("aborted")&&(n=28),{stdout:"",stderr:!r.silent||r.showError?`curl: (${n}) ${a}
31
+ `:"",exitCode:n}}}};export{ce as curlCommand};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b}from"./chunk-GOWX7VPU.js";import"./chunk-2UV6ZFHK.js";import"./chunk-I57EACSL.js";import"./chunk-7JZKVC3F.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as cutCommand,b as flagsForFuzzing};
3
+ import{a,b}from"./chunk-CTS7QXCJ.js";import"./chunk-2UV6ZFHK.js";import"./chunk-O3PNT72D.js";import"./chunk-7JZKVC3F.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as cutCommand,b as flagsForFuzzing};