@jerryan/just-bash 3.6.1 → 3.8.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 (328) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +15 -5
  3. package/dist/AGENTS.md +2 -2
  4. package/dist/Bash.d.ts +4 -2
  5. package/dist/bin/chunks/{awk2-KO7ZE3P7.js → awk2-NTRVFXRA.js} +1 -1
  6. package/dist/bin/chunks/chmod-GX5SYTRL.js +3 -0
  7. package/dist/bin/chunks/chunk-2NJJXU4K.js +27 -0
  8. package/dist/bin/{shell/chunks/chunk-ZMGLTHSU.js → chunks/chunk-3ROYEBJI.js} +1 -1
  9. package/dist/bin/chunks/chunk-6FGMEZZP.js +20 -0
  10. package/dist/bin/chunks/chunk-6JUPBMCR.js +13 -0
  11. package/dist/bin/{shell/chunks/chunk-3DWQCLNP.js → chunks/chunk-7WBCA2BB.js} +1 -1
  12. package/dist/bin/chunks/{chunk-LE2XKKGQ.js → chunk-ABP4OLJV.js} +1 -1
  13. package/dist/bin/{shell/chunks/chunk-7PUOS2OO.js → chunks/chunk-ANX7U57Q.js} +1 -1
  14. package/dist/bin/chunks/{chunk-B2GCIQI2.js → chunk-BB5VTPMQ.js} +1 -1
  15. package/dist/bin/chunks/chunk-CN4JKMTR.js +8 -0
  16. package/dist/bin/chunks/{chunk-WFHYGSLJ.js → chunk-CNVNOT67.js} +1 -1
  17. package/dist/bin/{shell/chunks/chunk-6ESRNSO7.js → chunks/chunk-DRPHNXG7.js} +1 -1
  18. package/dist/bin/chunks/chunk-F2PYTUMR.js +9 -0
  19. package/dist/bin/{shell/chunks/chunk-OXLC2WWX.js → chunks/chunk-H7PD6FLC.js} +10 -10
  20. package/dist/bin/chunks/chunk-HWK7KFGB.js +3 -0
  21. package/dist/bin/{shell/chunks/chunk-QYZN33JA.js → chunks/chunk-IOKQFPM6.js} +1 -1
  22. package/dist/bin/chunks/{chunk-M7SIPZZZ.js → chunk-KMYJMEON.js} +1 -1
  23. package/dist/bin/chunks/chunk-KNTDFP7X.js +12 -0
  24. package/dist/bin/{shell/chunks/chunk-RPUFEP5O.js → chunks/chunk-M3Z5NZXT.js} +1 -1
  25. package/dist/bin/chunks/chunk-MBREBDZQ.js +3 -0
  26. package/dist/bin/{shell/chunks/chunk-L345YZ6R.js → chunks/chunk-MF3GVFLC.js} +1 -1
  27. package/dist/bin/{shell/chunks/chunk-YCOJCFGU.js → chunks/chunk-MPFNZYEA.js} +1 -1
  28. package/dist/bin/chunks/chunk-OHFB3M3X.js +3 -0
  29. package/dist/bin/{shell/chunks/chunk-F3UDTTI7.js → chunks/chunk-ONF4KUYV.js} +1 -1
  30. package/dist/bin/chunks/chunk-PPVF2N6C.js +3 -0
  31. package/dist/bin/chunks/{chunk-V2XF3TTW.js → chunk-PRVPFKTC.js} +1 -1
  32. package/dist/bin/{shell/chunks/chunk-7VWOECJ3.js → chunks/chunk-PTUQEN6I.js} +1 -1
  33. package/dist/bin/chunks/{chunk-R2J5MJOM.js → chunk-QFOXSCOD.js} +1 -1
  34. package/dist/bin/{shell/chunks/chunk-6TUILMPB.js → chunks/chunk-QFTZKD5O.js} +1 -1
  35. package/dist/bin/chunks/{chunk-HQ63MFHG.js → chunk-QJWFCA7P.js} +1 -1
  36. package/dist/bin/chunks/chunk-RTN6X652.js +11 -0
  37. package/dist/bin/chunks/{chunk-67XYNGRV.js → chunk-T6OIISUC.js} +1 -1
  38. package/dist/bin/{shell/chunks/chunk-JELR4642.js → chunks/chunk-U5JLGI56.js} +13 -13
  39. package/dist/bin/chunks/{chunk-7PPAWLUI.js → chunk-V4S4A7M6.js} +1 -1
  40. package/dist/bin/{shell/chunks/chunk-DZAFUADN.js → chunks/chunk-VPSBWWXM.js} +1 -1
  41. package/dist/bin/chunks/{chunk-GA5TPRMF.js → chunk-YXPSX3SI.js} +11 -11
  42. package/dist/bin/chunks/{chunk-472JZJ2D.js → chunk-ZVG47PYA.js} +1 -1
  43. package/dist/bin/chunks/cp-YLP7ULVT.js +3 -0
  44. package/dist/bin/{shell/chunks/diff-YXZZCUSQ.js → chunks/diff-JSJ56EOK.js} +1 -1
  45. package/dist/bin/chunks/du-DH76GZJ3.js +3 -0
  46. package/dist/bin/chunks/{expr-NNMDHOCN.js → expr-PQEPO5TE.js} +1 -1
  47. package/dist/bin/chunks/{file-4T64QNLS.js → file-JA7QI2YT.js} +1 -1
  48. package/dist/bin/chunks/find-MHC4QV6H.js +3 -0
  49. package/dist/bin/chunks/flag-coverage-2H5CPEM6.js +3 -0
  50. package/dist/bin/chunks/{grep-CVU5V66H.js → grep-VXWNMIDD.js} +1 -1
  51. package/dist/bin/chunks/gzip-UQZL4R74.js +3 -0
  52. package/dist/bin/chunks/{jq-V7OTAVU5.js → jq-YS4PR46D.js} +1 -1
  53. package/dist/bin/chunks/js-exec-T3SAB2B6.js +1651 -0
  54. package/dist/bin/chunks/ln-XVC53673.js +3 -0
  55. package/dist/bin/chunks/ls-5Z45FV4U.js +3 -0
  56. package/dist/bin/chunks/mkdir-YJ3SOVRP.js +3 -0
  57. package/dist/bin/chunks/mv-EOOP2TO3.js +3 -0
  58. package/dist/bin/chunks/python3-3ERN3L6S.js +23 -0
  59. package/dist/bin/chunks/readlink-EJ3IKLWW.js +3 -0
  60. package/dist/bin/chunks/rg-WHVR3YDT.js +3 -0
  61. package/dist/bin/chunks/rm-B4LVIG7A.js +3 -0
  62. package/dist/bin/chunks/rmdir-PRNISPBA.js +3 -0
  63. package/dist/bin/{shell/chunks/sed-4LVDFHIJ.js → chunks/sed-SY63U2YX.js} +1 -1
  64. package/dist/bin/{shell/chunks/sleep-MOJQBZMY.js → chunks/sleep-DVFE2GSF.js} +1 -1
  65. package/dist/bin/chunks/split-HIFKSV2A.js +3 -0
  66. package/dist/bin/chunks/sqlite3-KNN6V2W6.js +3 -0
  67. package/dist/bin/{shell/chunks/tar-7HGZIMZD.js → chunks/tar-7XOP7VOX.js} +1 -1
  68. package/dist/bin/chunks/{timeout-RQOWSWYG.js → timeout-YGFHQJKX.js} +1 -1
  69. package/dist/bin/chunks/worker.js +120 -109
  70. package/dist/bin/chunks/{xan-WW53ETXT.js → xan-RMH6JEXM.js} +1 -1
  71. package/dist/bin/chunks/{yq-MYZOS2WN.js → yq-CWBZMGUV.js} +1 -1
  72. package/dist/bin/just-bash.js +355 -350
  73. package/dist/bin/shell/chunks/{awk2-KO7ZE3P7.js → awk2-NTRVFXRA.js} +1 -1
  74. package/dist/bin/shell/chunks/chmod-GX5SYTRL.js +3 -0
  75. package/dist/bin/shell/chunks/chunk-2NJJXU4K.js +27 -0
  76. package/dist/bin/{chunks/chunk-ZMGLTHSU.js → shell/chunks/chunk-3ROYEBJI.js} +1 -1
  77. package/dist/bin/shell/chunks/chunk-6FGMEZZP.js +20 -0
  78. package/dist/bin/shell/chunks/chunk-6JUPBMCR.js +13 -0
  79. package/dist/bin/{chunks/chunk-3DWQCLNP.js → shell/chunks/chunk-7WBCA2BB.js} +1 -1
  80. package/dist/bin/shell/chunks/{chunk-LE2XKKGQ.js → chunk-ABP4OLJV.js} +1 -1
  81. package/dist/bin/{chunks/chunk-7PUOS2OO.js → shell/chunks/chunk-ANX7U57Q.js} +1 -1
  82. package/dist/bin/shell/chunks/{chunk-B2GCIQI2.js → chunk-BB5VTPMQ.js} +1 -1
  83. package/dist/bin/shell/chunks/chunk-CN4JKMTR.js +8 -0
  84. package/dist/bin/shell/chunks/{chunk-WFHYGSLJ.js → chunk-CNVNOT67.js} +1 -1
  85. package/dist/bin/{chunks/chunk-6ESRNSO7.js → shell/chunks/chunk-DRPHNXG7.js} +1 -1
  86. package/dist/bin/shell/chunks/chunk-F2PYTUMR.js +9 -0
  87. package/dist/bin/{chunks/chunk-OXLC2WWX.js → shell/chunks/chunk-H7PD6FLC.js} +10 -10
  88. package/dist/bin/shell/chunks/chunk-HWK7KFGB.js +3 -0
  89. package/dist/bin/{chunks/chunk-QYZN33JA.js → shell/chunks/chunk-IOKQFPM6.js} +1 -1
  90. package/dist/bin/shell/chunks/{chunk-M7SIPZZZ.js → chunk-KMYJMEON.js} +1 -1
  91. package/dist/bin/shell/chunks/chunk-KNTDFP7X.js +12 -0
  92. package/dist/bin/{chunks/chunk-RPUFEP5O.js → shell/chunks/chunk-M3Z5NZXT.js} +1 -1
  93. package/dist/bin/shell/chunks/chunk-MBREBDZQ.js +3 -0
  94. package/dist/bin/{chunks/chunk-L345YZ6R.js → shell/chunks/chunk-MF3GVFLC.js} +1 -1
  95. package/dist/bin/{chunks/chunk-YCOJCFGU.js → shell/chunks/chunk-MPFNZYEA.js} +1 -1
  96. package/dist/bin/shell/chunks/chunk-OHFB3M3X.js +3 -0
  97. package/dist/bin/{chunks/chunk-F3UDTTI7.js → shell/chunks/chunk-ONF4KUYV.js} +1 -1
  98. package/dist/bin/shell/chunks/chunk-PPVF2N6C.js +3 -0
  99. package/dist/bin/shell/chunks/{chunk-V2XF3TTW.js → chunk-PRVPFKTC.js} +1 -1
  100. package/dist/bin/{chunks/chunk-7VWOECJ3.js → shell/chunks/chunk-PTUQEN6I.js} +1 -1
  101. package/dist/bin/shell/chunks/{chunk-R2J5MJOM.js → chunk-QFOXSCOD.js} +1 -1
  102. package/dist/bin/{chunks/chunk-6TUILMPB.js → shell/chunks/chunk-QFTZKD5O.js} +1 -1
  103. package/dist/bin/shell/chunks/{chunk-HQ63MFHG.js → chunk-QJWFCA7P.js} +1 -1
  104. package/dist/bin/shell/chunks/chunk-RTN6X652.js +11 -0
  105. package/dist/bin/shell/chunks/{chunk-67XYNGRV.js → chunk-T6OIISUC.js} +1 -1
  106. package/dist/bin/{chunks/chunk-JELR4642.js → shell/chunks/chunk-U5JLGI56.js} +13 -13
  107. package/dist/bin/shell/chunks/{chunk-7PPAWLUI.js → chunk-V4S4A7M6.js} +1 -1
  108. package/dist/bin/{chunks/chunk-DZAFUADN.js → shell/chunks/chunk-VPSBWWXM.js} +1 -1
  109. package/dist/bin/shell/chunks/{chunk-GA5TPRMF.js → chunk-YXPSX3SI.js} +11 -11
  110. package/dist/bin/shell/chunks/{chunk-472JZJ2D.js → chunk-ZVG47PYA.js} +1 -1
  111. package/dist/bin/shell/chunks/cp-YLP7ULVT.js +3 -0
  112. package/dist/bin/{chunks/diff-YXZZCUSQ.js → shell/chunks/diff-JSJ56EOK.js} +1 -1
  113. package/dist/bin/shell/chunks/du-DH76GZJ3.js +3 -0
  114. package/dist/bin/shell/chunks/{expr-NNMDHOCN.js → expr-PQEPO5TE.js} +1 -1
  115. package/dist/bin/shell/chunks/{file-4T64QNLS.js → file-JA7QI2YT.js} +1 -1
  116. package/dist/bin/shell/chunks/find-MHC4QV6H.js +3 -0
  117. package/dist/bin/shell/chunks/flag-coverage-2H5CPEM6.js +3 -0
  118. package/dist/bin/shell/chunks/{grep-CVU5V66H.js → grep-VXWNMIDD.js} +1 -1
  119. package/dist/bin/shell/chunks/gzip-UQZL4R74.js +3 -0
  120. package/dist/bin/shell/chunks/{jq-V7OTAVU5.js → jq-YS4PR46D.js} +1 -1
  121. package/dist/bin/shell/chunks/js-exec-T3SAB2B6.js +1651 -0
  122. package/dist/bin/shell/chunks/ln-XVC53673.js +3 -0
  123. package/dist/bin/shell/chunks/ls-5Z45FV4U.js +3 -0
  124. package/dist/bin/shell/chunks/mkdir-YJ3SOVRP.js +3 -0
  125. package/dist/bin/shell/chunks/mv-EOOP2TO3.js +3 -0
  126. package/dist/bin/shell/chunks/python3-3ERN3L6S.js +23 -0
  127. package/dist/bin/shell/chunks/readlink-EJ3IKLWW.js +3 -0
  128. package/dist/bin/shell/chunks/rg-WHVR3YDT.js +3 -0
  129. package/dist/bin/shell/chunks/rm-B4LVIG7A.js +3 -0
  130. package/dist/bin/shell/chunks/rmdir-PRNISPBA.js +3 -0
  131. package/dist/bin/{chunks/sed-4LVDFHIJ.js → shell/chunks/sed-SY63U2YX.js} +1 -1
  132. package/dist/bin/{chunks/sleep-MOJQBZMY.js → shell/chunks/sleep-DVFE2GSF.js} +1 -1
  133. package/dist/bin/shell/chunks/split-HIFKSV2A.js +3 -0
  134. package/dist/bin/shell/chunks/sqlite3-KNN6V2W6.js +3 -0
  135. package/dist/bin/{chunks/tar-7HGZIMZD.js → shell/chunks/tar-7XOP7VOX.js} +1 -1
  136. package/dist/bin/shell/chunks/{timeout-RQOWSWYG.js → timeout-YGFHQJKX.js} +1 -1
  137. package/dist/bin/shell/chunks/{xan-WW53ETXT.js → xan-RMH6JEXM.js} +1 -1
  138. package/dist/bin/shell/chunks/{yq-MYZOS2WN.js → yq-CWBZMGUV.js} +1 -1
  139. package/dist/bin/shell/shell.js +397 -392
  140. package/dist/bundle/browser.js +693 -669
  141. package/dist/bundle/chunks/{awk2-W6BNZEJN.js → awk2-VS5QVYHU.js} +1 -1
  142. package/dist/bundle/chunks/chmod-TEY5MD2W.js +2 -0
  143. package/dist/bundle/chunks/{chunk-26GP3ACY.js → chunk-35MBA3VY.js} +1 -1
  144. package/dist/bundle/chunks/chunk-3CIDHL5V.js +11 -0
  145. package/dist/bundle/chunks/chunk-3OBCZP7T.js +12 -0
  146. package/dist/bundle/chunks/{chunk-F6XU52K3.js → chunk-45QZRGYF.js} +1 -1
  147. package/dist/bundle/chunks/chunk-4CC3OZPU.js +2 -0
  148. package/dist/bundle/chunks/{chunk-73JQKNZT.js → chunk-4KZT23KR.js} +11 -11
  149. package/dist/bundle/chunks/{chunk-PJM5C3HZ.js → chunk-5EI7WSRV.js} +10 -10
  150. package/dist/bundle/chunks/{chunk-T6DNSPYO.js → chunk-6BSOPPZH.js} +1 -1
  151. package/dist/bundle/chunks/{chunk-DAKEIWT3.js → chunk-6HO6HX7V.js} +1 -1
  152. package/dist/bundle/chunks/{chunk-XVSR5HHH.js → chunk-6QAM55HM.js} +1 -1
  153. package/dist/bundle/chunks/chunk-A257L6QO.js +7 -0
  154. package/dist/bundle/chunks/{chunk-UC76ZOWM.js → chunk-ATGOUOX2.js} +1 -1
  155. package/dist/bundle/chunks/chunk-B6OSJB22.js +26 -0
  156. package/dist/bundle/chunks/{chunk-2TSZPVPI.js → chunk-BLPYR4TN.js} +1 -1
  157. package/dist/bundle/chunks/{chunk-VJ6UXG2R.js → chunk-CH7SUFFO.js} +1 -1
  158. package/dist/bundle/chunks/{chunk-FQUVK4Q5.js → chunk-DDPD7SIB.js} +1 -1
  159. package/dist/bundle/chunks/{chunk-TLPMB3FO.js → chunk-DMWNBCXJ.js} +1 -1
  160. package/dist/bundle/chunks/{chunk-ZXFELXJH.js → chunk-FSKXIFYT.js} +1 -1
  161. package/dist/bundle/chunks/{chunk-KEMO3CBM.js → chunk-GNPLDVBD.js} +1 -1
  162. package/dist/bundle/chunks/{chunk-FZZL53S2.js → chunk-GRUZ4SBY.js} +1 -1
  163. package/dist/bundle/chunks/{chunk-RPKJJFGZ.js → chunk-HCKTU6IR.js} +1 -1
  164. package/dist/bundle/chunks/{chunk-4EDQZIAN.js → chunk-LGIJSCWH.js} +1 -1
  165. package/dist/bundle/chunks/chunk-LRFR25IP.js +8 -0
  166. package/dist/bundle/chunks/chunk-MWL2I5BV.js +19 -0
  167. package/dist/bundle/chunks/{chunk-6IA4DXG2.js → chunk-N3A4JVFJ.js} +1 -1
  168. package/dist/bundle/chunks/{chunk-PPEXVPHR.js → chunk-O452S4KX.js} +1 -1
  169. package/dist/bundle/chunks/chunk-RWQWFXMH.js +10 -0
  170. package/dist/bundle/chunks/chunk-S6DNKKUL.js +2 -0
  171. package/dist/bundle/chunks/{chunk-NBNI7G66.js → chunk-SE23TEGG.js} +1 -1
  172. package/dist/bundle/chunks/chunk-T5ZEIOJ3.js +2 -0
  173. package/dist/bundle/chunks/{chunk-ULXTDFQC.js → chunk-U57DSHID.js} +1 -1
  174. package/dist/bundle/chunks/{chunk-6DDRR56B.js → chunk-WE7BJ7YU.js} +1 -1
  175. package/dist/bundle/chunks/chunk-WXPNKIIH.js +2 -0
  176. package/dist/bundle/chunks/{chunk-5I5U6IYI.js → chunk-XQ2ZZFO6.js} +1 -1
  177. package/dist/bundle/chunks/{chunk-YFFU74KY.js → chunk-XV2V56NQ.js} +1 -1
  178. package/dist/bundle/chunks/{chunk-FIMF2TLE.js → chunk-Y6JBSHCM.js} +13 -13
  179. package/dist/bundle/chunks/cp-UR762VVT.js +2 -0
  180. package/dist/bundle/chunks/{diff-CSARC7WF.js → diff-VDB6RXHO.js} +1 -1
  181. package/dist/bundle/chunks/du-EQKH3UNA.js +2 -0
  182. package/dist/bundle/chunks/{expr-XSBELPAC.js → expr-A5XITHQD.js} +1 -1
  183. package/dist/bundle/chunks/{file-URNAD6FQ.js → file-6AYYTULJ.js} +1 -1
  184. package/dist/bundle/chunks/find-RLKBCGJR.js +2 -0
  185. package/dist/bundle/chunks/flag-coverage-UMQ3BWDP.js +2 -0
  186. package/dist/bundle/chunks/{grep-4AYF3A5J.js → grep-Q2O5EIXQ.js} +1 -1
  187. package/dist/bundle/chunks/gzip-KC5ENBD2.js +2 -0
  188. package/dist/bundle/chunks/{jq-NY7PCVMH.js → jq-UKAA3QWU.js} +1 -1
  189. package/dist/bundle/chunks/js-exec-ZQMIYQTH.js +1650 -0
  190. package/dist/bundle/chunks/ln-CEM7GDB5.js +2 -0
  191. package/dist/bundle/chunks/ls-WH5S4PPL.js +2 -0
  192. package/dist/bundle/chunks/mkdir-Z6MMWH3D.js +2 -0
  193. package/dist/bundle/chunks/mv-WE7DBLEK.js +2 -0
  194. package/dist/bundle/chunks/python3-QB7OE256.js +22 -0
  195. package/dist/bundle/chunks/readlink-JSRKXLLQ.js +2 -0
  196. package/dist/bundle/chunks/rg-JKB7DR66.js +2 -0
  197. package/dist/bundle/chunks/rm-IGPLE632.js +2 -0
  198. package/dist/bundle/chunks/rmdir-3WTXMVKI.js +2 -0
  199. package/dist/bundle/chunks/{sed-LIRH26EA.js → sed-6G32B25J.js} +1 -1
  200. package/dist/bundle/chunks/{sleep-25QUPVDK.js → sleep-PPRBTSVR.js} +1 -1
  201. package/dist/bundle/chunks/split-HUKVGJTW.js +2 -0
  202. package/dist/bundle/chunks/sqlite3-KB3MXTTM.js +2 -0
  203. package/dist/bundle/chunks/{tar-B72KU357.js → tar-LE7LAAIX.js} +1 -1
  204. package/dist/bundle/chunks/{timeout-37GM7IIL.js → timeout-C6WDYPLV.js} +1 -1
  205. package/dist/bundle/chunks/worker.js +120 -109
  206. package/dist/bundle/chunks/{xan-UIGVJCMA.js → xan-UIL24CGT.js} +1 -1
  207. package/dist/bundle/chunks/{yq-FGNXZCGX.js → yq-ZRNZKDLE.js} +1 -1
  208. package/dist/bundle/index.cjs +2677 -1101
  209. package/dist/bundle/index.js +346 -341
  210. package/dist/commands/diff/format.d.ts +46 -0
  211. package/dist/commands/js-exec/js-exec.d.ts +1 -14
  212. package/dist/commands/js-exec/run-runtime.d.ts +10 -0
  213. package/dist/commands/worker-bridge/bridge-handler.d.ts +0 -3
  214. package/dist/commands/worker-bridge/protocol.d.ts +57 -23
  215. package/dist/fs/fs-error.d.ts +43 -0
  216. package/dist/fs/interface.d.ts +13 -0
  217. package/dist/fs/mountable-fs/mountable-fs.d.ts +20 -0
  218. package/dist/fs/overlay-fs/apply.d.ts +2 -1
  219. package/dist/fs/overlay-fs/index.d.ts +0 -1
  220. package/dist/fs/overlay-fs/overlay-fs.d.ts +14 -0
  221. package/dist/fs/path-utils.d.ts +5 -0
  222. package/dist/fs/traversal.d.ts +9 -0
  223. package/dist/fs/vfs-template.d.ts +38 -15
  224. package/dist/index.d.cts +2 -1
  225. package/dist/index.d.ts +2 -1
  226. package/dist/interpreter/builtin-dispatch.d.ts +10 -0
  227. package/dist/interpreter/builtin-manifest.d.ts +273 -0
  228. package/dist/interpreter/builtins/help.d.ts +6 -0
  229. package/dist/interpreter/builtins/shopt.d.ts +3 -0
  230. package/dist/interpreter/helpers/shell-constants.d.ts +0 -20
  231. package/dist/interpreter/helpers/substitution-status.d.ts +34 -0
  232. package/dist/interpreter/interpreter.d.ts +1 -1
  233. package/dist/interpreter/types.d.ts +8 -1
  234. package/dist/limits.d.ts +2 -0
  235. package/dist/timers.d.ts +0 -9
  236. package/dist/types.d.ts +4 -3
  237. package/package.json +8 -8
  238. package/dist/bin/chunks/chmod-WYYTXGVB.js +0 -3
  239. package/dist/bin/chunks/chunk-23OI2XDJ.js +0 -20
  240. package/dist/bin/chunks/chunk-43E7AR6A.js +0 -3
  241. package/dist/bin/chunks/chunk-AI7JUA46.js +0 -13
  242. package/dist/bin/chunks/chunk-CL7IYCGG.js +0 -20
  243. package/dist/bin/chunks/chunk-GQKQEK5N.js +0 -11
  244. package/dist/bin/chunks/chunk-JHEAT7AR.js +0 -12
  245. package/dist/bin/chunks/chunk-OLEQNRKX.js +0 -8
  246. package/dist/bin/chunks/chunk-QKJAAJ7J.js +0 -3
  247. package/dist/bin/chunks/chunk-SE7JHGP3.js +0 -9
  248. package/dist/bin/chunks/chunk-WEHA3JFD.js +0 -3
  249. package/dist/bin/chunks/chunk-YQEKKZTU.js +0 -12
  250. package/dist/bin/chunks/cp-OMVKM35F.js +0 -3
  251. package/dist/bin/chunks/du-LUFPVLNW.js +0 -3
  252. package/dist/bin/chunks/find-AWH2KOY7.js +0 -3
  253. package/dist/bin/chunks/flag-coverage-FYJ2V7J4.js +0 -3
  254. package/dist/bin/chunks/gzip-FDPA6EKG.js +0 -3
  255. package/dist/bin/chunks/js-exec-5QZZCOR7.js +0 -99
  256. package/dist/bin/chunks/js-exec-worker.js +0 -4931
  257. package/dist/bin/chunks/ln-B35EKC2Q.js +0 -3
  258. package/dist/bin/chunks/ls-Q6ZZ6SQ2.js +0 -3
  259. package/dist/bin/chunks/mkdir-74BP5NTG.js +0 -3
  260. package/dist/bin/chunks/mv-76LAHXFR.js +0 -3
  261. package/dist/bin/chunks/python3-TMFYDQAP.js +0 -14
  262. package/dist/bin/chunks/readlink-EHXJNW62.js +0 -3
  263. package/dist/bin/chunks/rg-PXNKNIMY.js +0 -3
  264. package/dist/bin/chunks/rm-NLG5344W.js +0 -3
  265. package/dist/bin/chunks/rmdir-7ZIVFZJX.js +0 -3
  266. package/dist/bin/chunks/split-ZNNNHKSP.js +0 -3
  267. package/dist/bin/chunks/sqlite3-3EUPHVEZ.js +0 -3
  268. package/dist/bin/shell/chunks/chmod-WYYTXGVB.js +0 -3
  269. package/dist/bin/shell/chunks/chunk-23OI2XDJ.js +0 -20
  270. package/dist/bin/shell/chunks/chunk-43E7AR6A.js +0 -3
  271. package/dist/bin/shell/chunks/chunk-AI7JUA46.js +0 -13
  272. package/dist/bin/shell/chunks/chunk-CL7IYCGG.js +0 -20
  273. package/dist/bin/shell/chunks/chunk-GQKQEK5N.js +0 -11
  274. package/dist/bin/shell/chunks/chunk-JHEAT7AR.js +0 -12
  275. package/dist/bin/shell/chunks/chunk-OLEQNRKX.js +0 -8
  276. package/dist/bin/shell/chunks/chunk-QKJAAJ7J.js +0 -3
  277. package/dist/bin/shell/chunks/chunk-SE7JHGP3.js +0 -9
  278. package/dist/bin/shell/chunks/chunk-WEHA3JFD.js +0 -3
  279. package/dist/bin/shell/chunks/chunk-YQEKKZTU.js +0 -12
  280. package/dist/bin/shell/chunks/cp-OMVKM35F.js +0 -3
  281. package/dist/bin/shell/chunks/du-LUFPVLNW.js +0 -3
  282. package/dist/bin/shell/chunks/find-AWH2KOY7.js +0 -3
  283. package/dist/bin/shell/chunks/flag-coverage-FYJ2V7J4.js +0 -3
  284. package/dist/bin/shell/chunks/gzip-FDPA6EKG.js +0 -3
  285. package/dist/bin/shell/chunks/js-exec-5QZZCOR7.js +0 -99
  286. package/dist/bin/shell/chunks/ln-B35EKC2Q.js +0 -3
  287. package/dist/bin/shell/chunks/ls-Q6ZZ6SQ2.js +0 -3
  288. package/dist/bin/shell/chunks/mkdir-74BP5NTG.js +0 -3
  289. package/dist/bin/shell/chunks/mv-76LAHXFR.js +0 -3
  290. package/dist/bin/shell/chunks/python3-TMFYDQAP.js +0 -14
  291. package/dist/bin/shell/chunks/readlink-EHXJNW62.js +0 -3
  292. package/dist/bin/shell/chunks/rg-PXNKNIMY.js +0 -3
  293. package/dist/bin/shell/chunks/rm-NLG5344W.js +0 -3
  294. package/dist/bin/shell/chunks/rmdir-7ZIVFZJX.js +0 -3
  295. package/dist/bin/shell/chunks/split-ZNNNHKSP.js +0 -3
  296. package/dist/bin/shell/chunks/sqlite3-3EUPHVEZ.js +0 -3
  297. package/dist/bundle/chunks/chmod-WM2JFFQC.js +0 -2
  298. package/dist/bundle/chunks/chunk-7IJWBG4I.js +0 -2
  299. package/dist/bundle/chunks/chunk-FSJ6TTCC.js +0 -19
  300. package/dist/bundle/chunks/chunk-G3IRZ4FN.js +0 -8
  301. package/dist/bundle/chunks/chunk-MLIO3BK2.js +0 -7
  302. package/dist/bundle/chunks/chunk-PS2RJNZZ.js +0 -2
  303. package/dist/bundle/chunks/chunk-TBVD66LC.js +0 -10
  304. package/dist/bundle/chunks/chunk-ULXGGWAD.js +0 -11
  305. package/dist/bundle/chunks/chunk-UTKGYVUZ.js +0 -7
  306. package/dist/bundle/chunks/chunk-W2Z6LYL6.js +0 -11
  307. package/dist/bundle/chunks/chunk-WN54B5NQ.js +0 -12
  308. package/dist/bundle/chunks/chunk-YUSFCOM7.js +0 -2
  309. package/dist/bundle/chunks/cp-2KZIPZJS.js +0 -2
  310. package/dist/bundle/chunks/du-7AZCLKR6.js +0 -2
  311. package/dist/bundle/chunks/find-END3EAHV.js +0 -2
  312. package/dist/bundle/chunks/flag-coverage-XSPWRCVG.js +0 -2
  313. package/dist/bundle/chunks/gzip-RQOBR22H.js +0 -2
  314. package/dist/bundle/chunks/js-exec-57QMXJG5.js +0 -98
  315. package/dist/bundle/chunks/js-exec-worker.js +0 -4931
  316. package/dist/bundle/chunks/ln-OPY2ZVGQ.js +0 -2
  317. package/dist/bundle/chunks/ls-ZPXGZX63.js +0 -2
  318. package/dist/bundle/chunks/mkdir-WDDKK2P3.js +0 -2
  319. package/dist/bundle/chunks/mv-ZF6UBVRB.js +0 -2
  320. package/dist/bundle/chunks/python3-NNONJINM.js +0 -13
  321. package/dist/bundle/chunks/readlink-U5OM5A3M.js +0 -2
  322. package/dist/bundle/chunks/rg-NAMXBYKS.js +0 -2
  323. package/dist/bundle/chunks/rm-R2ZENNSN.js +0 -2
  324. package/dist/bundle/chunks/rmdir-YJKPQVCK.js +0 -2
  325. package/dist/bundle/chunks/split-JICLAMP6.js +0 -2
  326. package/dist/bundle/chunks/sqlite3-M4UZPXDO.js +0 -2
  327. package/dist/commands/js-exec/js-exec-worker.d.ts +0 -33
  328. package/dist/fs/overlay-fs/merge.d.ts +0 -24
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as A}from"./chunk-3MRB66F4.js";import{b as f}from"./chunk-O2BCKSMK.js";import{a as O,b as h}from"./chunk-TW2IJRUF.js";import{d as F,e as g}from"./chunk-QKJAAJ7J.js";import{b as m}from"./chunk-HWI42GQO.js";import{a as T,b as w}from"./chunk-PBOVSFTJ.js";var n={NOOP:0,READ_FILE:1,WRITE_FILE:2,STAT:3,READDIR:4,MKDIR:5,RM:6,EXISTS:7,APPEND_FILE:8,SYMLINK:9,READLINK:10,LSTAT:11,CHMOD:12,REALPATH:13,RENAME:14,COPY_FILE:15,WRITE_FILE_RANGE:17,READ_RESULT_RANGE:18,WRITE_STDOUT:100,WRITE_STDERR:101,EXIT:102,HTTP_REQUEST:200,EXEC_COMMAND:300,INVOKE_TOOL:400},a={PENDING:0,READY:1,SUCCESS:2,ERROR:3},l={NONE:0,NOT_FOUND:1,IS_DIRECTORY:2,NOT_DIRECTORY:3,EXISTS:4,PERMISSION_DENIED:5,INVALID_PATH:6,IO_ERROR:7,TIMEOUT:8,NETWORK_ERROR:9,NETWORK_NOT_CONFIGURED:10,NOT_EMPTY:11},i={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},E={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:8388608,TOTAL:8392736},R={NONE:0,RECURSIVE:1,FORCE:2,MKDIR_RECURSIVE:1},u={IS_FILE:0,IS_DIRECTORY:1,IS_SYMLINK:2,MODE:4,SIZE:8,MTIME:16,TOTAL:24};function x(){return new O(E.TOTAL)}var S=class{int32View;uint8View;dataView;constructor(t){this.int32View=new Int32Array(t),this.uint8View=new Uint8Array(t),this.dataView=new DataView(t)}getOpCode(){return h.load(this.int32View,i.OP_CODE/4)}setOpCode(t){h.store(this.int32View,i.OP_CODE/4,t)}getStatus(){return h.load(this.int32View,i.STATUS/4)}setStatus(t){h.store(this.int32View,i.STATUS/4,t)}getPathLength(){return h.load(this.int32View,i.PATH_LENGTH/4)}setPathLength(t){h.store(this.int32View,i.PATH_LENGTH/4,t)}getDataLength(){return h.load(this.int32View,i.DATA_LENGTH/4)}setDataLength(t){h.store(this.int32View,i.DATA_LENGTH/4,t)}getResultLength(){return h.load(this.int32View,i.RESULT_LENGTH/4)}setResultLength(t){h.store(this.int32View,i.RESULT_LENGTH/4,t)}getErrorCode(){return h.load(this.int32View,i.ERROR_CODE/4)}setErrorCode(t){h.store(this.int32View,i.ERROR_CODE/4,t)}getFlags(){return h.load(this.int32View,i.FLAGS/4)}setFlags(t){h.store(this.int32View,i.FLAGS/4,t)}getMode(){return h.load(this.int32View,i.MODE/4)}setMode(t){h.store(this.int32View,i.MODE/4,t)}getPath(){let t=this.getPathLength(),e=this.uint8View.slice(i.PATH_BUFFER,i.PATH_BUFFER+t);return new TextDecoder().decode(e)}setPath(t){let e=new TextEncoder().encode(t);if(e.length>E.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${E.PATH_BUFFER}`);this.uint8View.set(e,i.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(i.DATA_BUFFER,i.DATA_BUFFER+t)}setData(t){if(t.length>E.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${E.DATA_BUFFER}`);this.uint8View.set(t,i.DATA_BUFFER),this.setDataLength(t.length)}getDataAsString(){let t=this.getData();return new TextDecoder().decode(t)}setDataFromString(t){let e=new TextEncoder().encode(t);this.setData(e)}getResult(){let t=this.getResultLength();return this.uint8View.slice(i.DATA_BUFFER,i.DATA_BUFFER+t)}setResult(t){if(t.length>E.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${E.DATA_BUFFER}`);this.uint8View.set(t,i.DATA_BUFFER),this.setResultLength(t.length)}setResultPrefix(t){if(t.length>2147483647)throw new Error(`Result too large: ${t.length} exceeds int32`);let e=Math.min(t.length,E.DATA_BUFFER);this.uint8View.set(t.subarray(0,e),i.DATA_BUFFER),this.setResultLength(t.length)}getResultAsString(){let t=this.getResult();return new TextDecoder().decode(t)}setResultFromString(t){let e=new TextEncoder().encode(t);this.setResult(e)}encodeStat(t){this.uint8View[i.DATA_BUFFER+u.IS_FILE]=t.isFile?1:0,this.uint8View[i.DATA_BUFFER+u.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[i.DATA_BUFFER+u.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(i.DATA_BUFFER+u.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(i.DATA_BUFFER+u.SIZE,e,!0),this.dataView.setFloat64(i.DATA_BUFFER+u.MTIME,t.mtime.getTime(),!0),this.setResultLength(u.TOTAL)}decodeStat(){return{isFile:this.uint8View[i.DATA_BUFFER+u.IS_FILE]===1,isDirectory:this.uint8View[i.DATA_BUFFER+u.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[i.DATA_BUFFER+u.IS_SYMLINK]===1,mode:this.dataView.getInt32(i.DATA_BUFFER+u.MODE,!0),size:this.dataView.getFloat64(i.DATA_BUFFER+u.SIZE,!0),mtime:new Date(this.dataView.getFloat64(i.DATA_BUFFER+u.MTIME,!0))}}waitForReady(t){return h.wait(this.int32View,i.STATUS/4,a.PENDING,t)}waitForReadyAsync(t){return h.waitAsync(this.int32View,i.STATUS/4,a.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let o=this.getStatus();if(o===a.READY)return!0;let s=Date.now()-e;if(s>=t)return!1;let r=t-s,c=h.waitAsync(this.int32View,i.STATUS/4,o,r);if(c.async&&await c.value==="timed-out")return!1}}waitForResult(t){return h.wait(this.int32View,i.STATUS/4,a.READY,t)}notify(){return h.notify(this.int32View,i.STATUS/4)}reset(){this.setOpCode(n.NOOP),this.setStatus(a.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(l.NONE),this.setFlags(R.NONE),this.setMode(0)}};var D=class{fs;cwd;commandName;secureFetch;maxOutputSize;exec;invokeTool;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;startTime=0;timeoutMs=0;lastResult=null;constructor(t,e,o,s,r=void 0,c=0,d=void 0,p=void 0){this.fs=e,this.cwd=o,this.commandName=s,this.secureFetch=r,this.maxOutputSize=c,this.exec=d,this.invokeTool=p,this.protocol=new S(t)}remainingMs(){return Math.max(0,this.timeoutMs-(Date.now()-this.startTime))}raceDeadline(t){let e=this.remainingMs();if(e<=0)return this.running=!1,this.output.exitCode=124,this.output.stderr+=`
4
- ${this.commandName}: execution timeout exceeded
5
- `,Promise.reject(new Error("Operation timed out"));let o=t();return e===Number.POSITIVE_INFINITY?o:new Promise((s,r)=>{let c=F(()=>{this.running=!1,this.output.exitCode=124,this.output.stderr+=`
6
- ${this.commandName}: execution timeout exceeded
7
- `,r(new Error("Operation timed out"))},e);o.then(d=>{g(c),s(d)},d=>{g(c),r(d)})})}async run(t){for(this.running=!0,this.startTime=Date.now(),this.timeoutMs=t;this.running;){if(Date.now()-this.startTime>=t){this.output.stderr+=`
8
- ${this.commandName}: execution timeout exceeded
9
- `,this.output.exitCode=124;break}let o=this.remainingMs();if(!await this.protocol.waitUntilReady(o)){this.output.stderr+=`
10
- ${this.commandName}: execution timeout exceeded
11
- `,this.output.exitCode=124;break}if(!this.running)break;let r=this.protocol.getOpCode();await this.handleOperation(r),this.protocol.notify()}return this.output}stop(){this.running=!1,this.lastResult=null,this.protocol.setStatus(a.READY),this.protocol.notify()}async handleOperation(t){try{switch(t){case n.READ_FILE:await this.handleReadFile();break;case n.WRITE_FILE:await this.handleWriteFile();break;case n.STAT:await this.handleStat();break;case n.LSTAT:await this.handleLstat();break;case n.READDIR:await this.handleReaddir();break;case n.MKDIR:await this.handleMkdir();break;case n.READ_RESULT_RANGE:this.handleReadResultRange();break;case n.WRITE_FILE_RANGE:await this.handleWriteFileRange();break;case n.RM:await this.handleRm();break;case n.EXISTS:await this.handleExists();break;case n.APPEND_FILE:await this.handleAppendFile();break;case n.SYMLINK:await this.handleSymlink();break;case n.READLINK:await this.handleReadlink();break;case n.CHMOD:await this.handleChmod();break;case n.REALPATH:await this.handleRealpath();break;case n.RENAME:await this.handleRename();break;case n.COPY_FILE:await this.handleCopyFile();break;case n.WRITE_STDOUT:this.handleWriteStdout();break;case n.WRITE_STDERR:this.handleWriteStderr();break;case n.EXIT:this.handleExit();break;case n.HTTP_REQUEST:await this.handleHttpRequest();break;case n.EXEC_COMMAND:await this.handleExecCommand();break;case n.INVOKE_TOOL:await this.handleInvokeTool();break;default:this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setStatus(a.ERROR)}}catch(e){this.setErrorFromException(e)}}publishResult(t){let e=typeof t=="string"?new TextEncoder().encode(t):t;this.lastResult=e,this.protocol.setResultPrefix(e),this.protocol.setStatus(a.SUCCESS)}handleReadResultRange(){let t=this.protocol.getFlags(),e=this.protocol.getMode(),o=this.lastResult;if(!o||t>o.length){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("No retained result for range read"),this.protocol.setStatus(a.ERROR);return}this.protocol.setResult(o.subarray(t,t+e)),this.protocol.setStatus(a.SUCCESS)}resolvePath(t){return this.fs.resolvePath(this.cwd,t)}async handleReadFile(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readFileBuffer(t);this.publishResult(e)}catch(e){this.setErrorFromException(e)}}async handleWriteFileRange(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),o=this.protocol.getData();try{if(e===0)await this.fs.writeFile(t,o);else{let s=await this.fs.stat(t);if(s.size!==e)throw new Error(`EIO: non-sequential range write to '${t}': offset ${e} != size ${s.size}`);await this.fs.appendFile(t,o)}this.protocol.setStatus(a.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleWriteFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.writeFile(t,e),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}async handleStat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.stat(t);this.protocol.encodeStat(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleLstat(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.lstat(t);this.protocol.encodeStat(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleReaddir(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readdir(t);this.publishResult(JSON.stringify(e))}catch(e){this.setErrorFromException(e)}}async handleMkdir(){let t=this.resolvePath(this.protocol.getPath()),o=(this.protocol.getFlags()&R.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(t,{recursive:o}),this.protocol.setStatus(a.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleRm(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),o=(e&R.RECURSIVE)!==0,s=(e&R.FORCE)!==0;try{await this.fs.rm(t,{recursive:o,force:s}),this.protocol.setStatus(a.SUCCESS)}catch(r){this.setErrorFromException(r)}}async handleExists(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.exists(t);this.protocol.setResult(new Uint8Array([e?1:0])),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleAppendFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.appendFile(t,e),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}async handleSymlink(){let t=this.protocol.getPath(),e=this.protocol.getDataAsString(),o=this.resolvePath(t);try{await this.fs.symlink(e,o),this.protocol.setStatus(a.SUCCESS)}catch(s){this.setErrorFromException(s)}}async handleReadlink(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readlink(t);this.protocol.setResultFromString(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleChmod(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getMode();try{await this.fs.chmod(t,e),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}async handleRealpath(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.realpath(t);this.protocol.setResultFromString(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleRename(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.mv(t,e),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}async handleCopyFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.resolvePath(this.protocol.getDataAsString());try{await this.fs.cp(t,e),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}handleWriteStdout(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stdout",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(a.ERROR);return}this.protocol.setStatus(a.SUCCESS)}handleWriteStderr(){let t=this.protocol.getDataAsString();if(!this.tryAppendOutput("stderr",t)){this.outputLimitExceeded=!0,this.output.exitCode=1,this.appendOutputLimitError(),this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Output size limit exceeded"),this.protocol.setStatus(a.ERROR);return}this.protocol.setStatus(a.SUCCESS)}handleExit(){let t=this.protocol.getFlags();this.outputLimitExceeded?this.output.exitCode===0&&(this.output.exitCode=1):this.output.exitCode=t,this.protocol.setStatus(a.SUCCESS),this.running=!1}tryAppendOutput(t,e){return this.outputLimitExceeded?!1:this.maxOutputSize<=0?(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0):this.output.stdout.length+this.output.stderr.length+e.length>this.maxOutputSize?!1:(t==="stdout"?this.output.stdout+=e:this.output.stderr+=e,!0)}appendOutputLimitError(){if(this.maxOutputSize<=0)return;let t=`${this.commandName}: total output size exceeded (>${this.maxOutputSize} bytes), increase executionLimits.maxOutputSize
12
- `,e=t.length>this.maxOutputSize?t.slice(0,this.maxOutputSize):t;if(this.output.stderr.includes("total output size exceeded"))return;let s=this.output.stdout.length+this.output.stderr.length+e.length-this.maxOutputSize;if(s>0)if(this.output.stdout.length>=s)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-s);else{let r=s-this.output.stdout.length;this.output.stdout="",r>=this.output.stderr.length?this.output.stderr="":this.output.stderr=this.output.stderr.slice(0,this.output.stderr.length-r)}this.output.stderr+=e}async handleHttpRequest(){let t=this.secureFetch;if(!t){this.protocol.setErrorCode(l.NETWORK_NOT_CONFIGURED),this.protocol.setResultFromString("Network access not configured. Enable network in Bash options."),this.protocol.setStatus(a.ERROR);return}let e=this.protocol.getPath(),o=this.protocol.getDataAsString();try{let s=o?JSON.parse(o):{},r=this.remainingMs(),c=await this.raceDeadline(()=>t(e,{method:s.method,headers:s.headers,body:s.body,timeoutMs:r})),d=JSON.stringify({status:c.status,statusText:c.statusText,headers:c.headers,bodyBase64:f(c.body,"base64"),url:c.url});this.publishResult(d)}catch(s){let r=T(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.NETWORK_ERROR),this.protocol.setResultFromString(r),this.protocol.setStatus(a.ERROR)}}async handleExecCommand(){let t=this.exec;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Command execution not available in this context."),this.protocol.setStatus(a.ERROR);return}let e=this.protocol.getPath(),o=this.protocol.getDataAsString(),s=new AbortController;try{let r={cwd:this.cwd,signal:s.signal};if(o){let p=JSON.parse(o);p.stdin&&(r.stdin=p.stdin),p.args&&Array.isArray(p.args)&&(r.args=p.args.map(C=>String(C)),e=A([e]))}let c=await this.raceDeadline(()=>t(e,r)),d=JSON.stringify({stdout:c.stdout,stderr:c.stderr,exitCode:c.exitCode});this.publishResult(d)}catch(r){s.abort();let c=r instanceof Error?r.message:String(r);this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(c),this.protocol.setStatus(a.ERROR)}}async handleInvokeTool(){let t=this.invokeTool;if(!t){this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString("Tool invocation not available in this context."),this.protocol.setStatus(a.ERROR);return}let e=this.protocol.getPath(),o=this.protocol.getDataAsString();try{let s=await this.raceDeadline(()=>m.runTrustedAsync(()=>t(e,o)));this.publishResult(s)}catch(s){let r=w(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setResultFromString(r),this.protocol.setStatus(a.ERROR)}}setErrorFromException(t){let e=t instanceof Error?t.message:String(t),o=T(e),s=l.IO_ERROR,r=e.toLowerCase();r.includes("no such file")||r.includes("not found")||r.includes("enoent")?s=l.NOT_FOUND:r.includes("is a directory")||r.includes("eisdir")?s=l.IS_DIRECTORY:r.includes("not a directory")||r.includes("enotdir")?s=l.NOT_DIRECTORY:r.includes("not empty")||r.includes("enotempty")?s=l.NOT_EMPTY:r.includes("already exists")||r.includes("eexist")?s=l.EXISTS:(r.includes("permission")||r.includes("eperm")||r.includes("eacces"))&&(s=l.PERMISSION_DENIED),this.protocol.setErrorCode(s),this.protocol.setResultFromString(o),this.protocol.setStatus(a.ERROR)}};export{x as a,D as b};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as f}from"./chunk-PBOVSFTJ.js";import{a as d}from"./chunk-NE4R2FVV.js";import{a as l}from"./chunk-I4IRHQDW.js";var p={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},b={name:"mkdir",async execute(m,t){let e=d("mkdir",m,p);if(!e.ok)return e.error;let u=e.result.flags.recursive,g=e.result.flags.verbose,n=e.result.positional;if(n.length===0)return{stdout:"",stderr:`mkdir: missing operand
4
- `,exitCode:1};let a="",o="",c=0;for(let r of n)try{let i=t.fs.resolvePath(t.cwd,r);await t.fs.mkdir(i,{recursive:u}),g&&(a+=`mkdir: created directory '${r}'
5
- `)}catch(i){let s=l(i);s.includes("ENOENT")||s.includes("no such file")?o+=`mkdir: cannot create directory '${r}': No such file or directory
6
- `:s.includes("EEXIST")||s.includes("already exists")?o+=`mkdir: cannot create directory '${r}': File exists
7
- `:o+=`mkdir: cannot create directory '${r}': ${f(s)}
8
- `,c=1}return{stdout:a,stderr:o,exitCode:c}}},h={name:"mkdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{b as a,h as b};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{b as a}from"./chunk-HWI42GQO.js";var r=globalThis.setTimeout.bind(globalThis),l=globalThis.clearTimeout.bind(globalThis),T=globalThis.setInterval.bind(globalThis),f=globalThis.clearInterval.bind(globalThis);function u(e){return typeof e!="function"?e:a.bindCurrentContext(e)}var b=((e,n,...i)=>r(u(e),n,...i)),d=l,I=((e,n,...i)=>r(e,n,...i)),c=2147483647;function _(e,n){if(n===Number.POSITIVE_INFINITY)return;let i=u(e),t={cleared:!1,remainingMs:Math.max(0,n),timer:void 0},o=()=>{if(t.cleared)return;let s=Math.min(t.remainingMs,c);t.timer=r(()=>{t.cleared||(t.remainingMs-=s,t.remainingMs>0?o():i())},s)};return o(),t}function g(e){e&&(e.cleared=!0,e.timer!==void 0&&l(e.timer))}export{b as a,d as b,I as c,_ as d,g as e};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as g}from"./chunk-PBOVSFTJ.js";import{a as u}from"./chunk-NE4R2FVV.js";import{a as p}from"./chunk-I4IRHQDW.js";var y={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"}},$={name:"rm",async execute(d,s){let e=u("rm",d,y);if(!e.ok)return e.error;let l=e.result.flags.recursive||e.result.flags.recursiveUpper,a=e.result.flags.force,v=e.result.flags.verbose,c=e.result.positional;if(c.length===0)return a?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
4
- `,exitCode:1};let f="",o="",i=0;for(let r of c)try{let n=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(n)).isDirectory&&!l){o+=`rm: cannot remove '${r}': Is a directory
5
- `,i=1;continue}await s.fs.rm(n,{recursive:l,force:a}),v&&(f+=`removed '${r}'
6
- `)}catch(n){let t=p(n),m=t.startsWith("ENOENT");if(a&&m)continue;m?o+=`rm: cannot remove '${r}': No such file or directory
7
- `:t.includes("ENOTEMPTY")||t.includes("not empty")?o+=`rm: cannot remove '${r}': Directory not empty
8
- `:o+=`rm: cannot remove '${r}': ${g(t)}
9
- `,i=1}return{stdout:f,stderr:o,exitCode:i}}},C={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{$ as a,C as b};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as l,b as k,d as v,f as m}from"./chunk-43E7AR6A.js";import{l as u,m as y}from"./chunk-FUT3X2GJ.js";import{a as g}from"./chunk-PBOVSFTJ.js";var w=class extends Error{operation;virtualPath;name="FileSystemPolicyError";constructor(t,r,n){super(`${t}: ${g(n)}`),this.operation=t,this.virtualPath=r}};function b(e){if(e.identity!==void 0)return`identity:${e.identity}`;if(e.dev!==void 0&&e.ino!==void 0)return`inode:${String(e.dev)}:${String(e.ino)}`}function P(e){let t=e instanceof Error?e.message:String(e);return t.includes("ENOENT")||t.includes("no such file")}async function f(e,t,r){let n=l(t),s;try{s=await e.stat(n)}catch(a){if(!P(a))return{existence:"unknown"}}if(s!==void 0){let a=b(s);try{return{existence:"existing",canonicalPath:l(await e.realpath(n)),stableIdentity:a}}catch{return a===void 0?{existence:"unknown"}:{existence:"existing",stableIdentity:a}}}let i=[],o=n;for(;;){r?.checkpoint();let a=v(o);if(a===o)return{existence:"unknown"};i.unshift(o.slice(a==="/"?1:a.length+1)),o=a;try{let c=l(await e.realpath(o));return{existence:"missing",canonicalPath:i.reduce((h,d)=>m(h,d),c)}}catch(c){if(!P(c))return{existence:"missing"}}}}async function T(e,t,r){let[n,s]=await Promise.all([f(e,t),f(e,r)]);return n.existence==="unknown"||s.existence==="unknown"?"unknown":n.existence==="missing"||s.existence==="missing"?n.existence!==s.existence?"different":n.canonicalPath!==void 0&&n.canonicalPath===s.canonicalPath?"same":"unknown":n.stableIdentity!==void 0&&s.stableIdentity!==void 0?n.stableIdentity===s.stableIdentity?"same":"different":n.canonicalPath!==void 0&&n.canonicalPath===s.canonicalPath?"same":"unknown"}async function z(e,t,r,n){let[s,i]=await Promise.all([f(e,t,n),f(e,r,n)]);return s.existence!=="existing"||s.canonicalPath===void 0||i.existence==="unknown"||i.canonicalPath===void 0?"unknown":k(s.canonicalPath,i.canonicalPath)?"inside":"outside"}var x=class{options;entries=0;discoveredEntries=1;work=0;constructor(t){this.options=t}checkpoint(t=1){if(this.options.signal?.aborted)throw new y;if(this.options.executionScope?.throwIfAborted(this.options.site),!Number.isSafeInteger(t)||t<0||t>this.options.limits.maxTraversalWork-this.work)throw new u(`${this.options.site}: ${this.options.label??"filesystem traversal work"} limit exceeded (${this.options.limits.maxTraversalWork})`,"iterations");this.work+=t,this.options.executionScope?.consumeWork(t,`${this.options.site} filesystem traversal`)}visit(t){if(this.checkpoint(),t>this.options.limits.maxTraversalDepth)throw new u(`${this.options.site}: ${this.options.label??"filesystem traversal"} depth limit exceeded (${this.options.limits.maxTraversalDepth})`,"recursion");if(++this.entries>this.options.limits.maxTraversalEntries)throw new u(`${this.options.site}: ${this.options.label??"filesystem traversal"} entry limit exceeded (${this.options.limits.maxTraversalEntries})`,"iterations")}discover(t){if(!Number.isSafeInteger(t)||t<0||t>this.options.limits.maxTraversalEntries-this.discoveredEntries)throw new u(`${this.options.site}: ${this.options.label??"filesystem traversal"} entry limit exceeded (${this.options.limits.maxTraversalEntries})`,"iterations");this.checkpoint(t),this.discoveredEntries+=t}};async function D(e,t){let r=e.budget??new x(e),n=[{kind:"enter",path:l(e.root),depth:0}],s=new Set;for(;n.length>0;){r.checkpoint(0);let i=n.pop();if(!i)break;if(i.kind==="leave"){e.includeLeave&&await t({path:i.path,depth:i.depth,stat:i.stat,isSymlink:i.isSymlink,phase:"leave"}),i.identity&&s.delete(i.identity);continue}r.visit(i.depth);let o=await e.fs.lstat(i.path),a=o.isSymbolicLink,c=a&&e.symlinks==="follow"?await e.fs.stat(i.path):o;if(await t({path:i.path,depth:i.depth,stat:c,isSymlink:a,phase:"enter"}),!c.isDirectory||a&&e.symlinks!=="follow")continue;let h=b(c)??await e.fs.realpath(i.path).then(l).catch(()=>{});if(h!==void 0){if(s.has(h))throw new w(e.site,i.path,"symbolic-link directory cycle detected");s.add(h)}n.push({kind:"leave",path:i.path,depth:i.depth,stat:c,isSymlink:a,identity:h});let d=await e.fs.readdir(i.path);r.checkpoint(),d.sort((p,$)=>p.localeCompare($));for(let p=d.length-1;p>=0;p--)n.push({kind:"enter",path:m(i.path,d[p]),depth:i.depth+1})}}export{f as a,T as b,z as c,x as d,D as e};
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as h}from"./chunk-PBOVSFTJ.js";import{a as m,b as g,c as p}from"./chunk-MUFNRCMY.js";var y={name:"ln",summary:"make links between files",usage:"ln [OPTIONS] TARGET LINK_NAME",options:["-s create a symbolic link instead of a hard link","-f remove existing destination files","-n treat LINK_NAME as a normal file if it is a symbolic link to a directory","-v print name of each linked file"," --help display this help and exit"]},v={name:"ln",async execute(n,s){if(g(n))return m(y);let i=!1,f=!1,d=!1,t=0;for(;t<n.length&&n[t].startsWith("-");){let e=n[t];if(e==="-s"||e==="--symbolic")i=!0,t++;else if(e==="-f"||e==="--force")f=!0,t++;else if(e==="-v"||e==="--verbose")d=!0,t++;else if(e==="-n"||e==="--no-dereference")t++;else if(/^-[sfvn]+$/.test(e))e.includes("s")&&(i=!0),e.includes("f")&&(f=!0),e.includes("v")&&(d=!0),t++;else if(e==="--"){t++;break}else return p("ln",e)}let r=n.slice(t);if(r.length<2)return{stdout:"",stderr:`ln: missing file operand
4
- `,exitCode:1};if(r.length>2)return{stdout:"",stderr:`ln: extra operand '${r[2]}'
5
- `,exitCode:1};let l=r[0],o=r[1],a=s.fs.resolvePath(s.cwd,o);if(await s.fs.exists(a))if(f)try{await s.fs.rm(a,{force:!0})}catch{return{stdout:"",stderr:`ln: cannot remove '${o}': Permission denied
6
- `,exitCode:1}}else return{stdout:"",stderr:`ln: failed to create ${i?"symbolic ":""}link '${o}': File exists
7
- `,exitCode:1};try{if(i)await s.fs.symlink(l,a);else{let e=s.fs.resolvePath(s.cwd,l);if(!await s.fs.exists(e))return{stdout:"",stderr:`ln: failed to access '${l}': No such file or directory
8
- `,exitCode:1};await s.fs.link(e,a)}}catch(e){let u=e;return u.message.includes("EPERM")?{stdout:"",stderr:i?`ln: failed to create symbolic link '${o}': Operation not permitted
9
- `:`ln: '${l}': hard link not allowed for directory
10
- `,exitCode:1}:{stdout:"",stderr:`ln: ${h(u.message)}
11
- `,exitCode:1}}let c="";return d&&(c=`'${o}' -> '${l}'
12
- `),{stdout:c,stderr:"",exitCode:0}}},$={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{v as a,$ as b};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b}from"./chunk-AI7JUA46.js";import"./chunk-WEHA3JFD.js";import"./chunk-43E7AR6A.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.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};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b}from"./chunk-6ESRNSO7.js";import"./chunk-WEHA3JFD.js";import"./chunk-43E7AR6A.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as duCommand,b as flagsForFuzzing};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b}from"./chunk-B2GCIQI2.js";import"./chunk-BIJXTWZ4.js";import"./chunk-QYZN33JA.js";import"./chunk-3MRB66F4.js";import"./chunk-K27FY3ES.js";import"./chunk-GA5TPRMF.js";import"./chunk-YERKK5B3.js";import"./chunk-I57EACSL.js";import"./chunk-WEHA3JFD.js";import"./chunk-43E7AR6A.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-PBOVSFTJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as findCommand,b as flagsForFuzzing};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{b as yr}from"./chunk-RPUFEP5O.js";import{b as Ar}from"./chunk-V2XF3TTW.js";import{b as $r}from"./chunk-7PUOS2OO.js";import"./chunk-V4U26ZWL.js";import"./chunk-KP2UH5CJ.js";import{c as Sr}from"./chunk-YCOJCFGU.js";import"./chunk-3DWQCLNP.js";import{b as wr}from"./chunk-PQ2INDRF.js";import{b as xr}from"./chunk-DYIBFLS3.js";import{b as vr}from"./chunk-RVPTAYDS.js";import{b as kr}from"./chunk-TYBXHT6W.js";import{b as qr}from"./chunk-AJF3OBTR.js";import{b as Cr}from"./chunk-2ETT4ELS.js";import{b as br}from"./chunk-OUQKFRVR.js";import{d as Ir,e as Mr,f as jr}from"./chunk-HQ63MFHG.js";import"./chunk-QES5OSUC.js";import{b as tr}from"./chunk-6TUILMPB.js";import{b as lr}from"./chunk-CC2AQ6B7.js";import{b as ur}from"./chunk-QMPZXXEK.js";import{b as pr}from"./chunk-WFHYGSLJ.js";import{b as er}from"./chunk-LXFMIXGA.js";import{b as dr}from"./chunk-WFVCEB5T.js";import{b as cr}from"./chunk-KG2KXL4Y.js";import"./chunk-2YLY6FJA.js";import{b as hr}from"./chunk-OXLC2WWX.js";import{c as or,d as ar}from"./chunk-KI54R2QB.js";import{b as sr}from"./chunk-KUMHQGUR.js";import{c as ir,d as gr}from"./chunk-MYTNZ7MA.js";import{b as mr}from"./chunk-7PPAWLUI.js";import"./chunk-F3UDTTI7.js";import{b as Fr}from"./chunk-FPWHWWXO.js";import{b as zr}from"./chunk-23OI2XDJ.js";import{b as fr}from"./chunk-LJQIAFWS.js";import{b as nr}from"./chunk-L345YZ6R.js";import"./chunk-B2DRBHGQ.js";import{b as R}from"./chunk-YJ5OCPSK.js";import{b as U}from"./chunk-Q2GOPGDA.js";import{b as V}from"./chunk-PXP4YYZA.js";import{b as W}from"./chunk-6ESRNSO7.js";import{c as X,d as Y}from"./chunk-YUZRUF5F.js";import{c as Z,d as _}from"./chunk-DJAX3ZRG.js";import{b as N}from"./chunk-PZQVSQX6.js";import{b as rr}from"./chunk-SDGPS6XI.js";import{b as G}from"./chunk-SC5TEGMM.js";import{b as H}from"./chunk-5SKEZPTU.js";import{b as J}from"./chunk-OYXHOZZ4.js";import{b as K}from"./chunk-M7SIPZZZ.js";import{b as L}from"./chunk-N26Y42L6.js";import{b as O}from"./chunk-4JF56A3P.js";import{b as P}from"./chunk-AGKL4LDL.js";import{b as Q}from"./chunk-B2GCIQI2.js";import{b as y}from"./chunk-FHMIEBRM.js";import{b as A}from"./chunk-7FGDUBSN.js";import{b as $}from"./chunk-GOWX7VPU.js";import{b as S}from"./chunk-B6WWC6K3.js";import{b as T}from"./chunk-MVBK66TR.js";import{b as B}from"./chunk-YIANER7Y.js";import{b as D}from"./chunk-HDWHYM2T.js";import{b as E}from"./chunk-Q3LE3Y66.js";import{b as w}from"./chunk-3FQBUEB6.js";import{b as x}from"./chunk-45DUHCXR.js";import{b as v}from"./chunk-HZGHQZSY.js";import"./chunk-BIJXTWZ4.js";import{d as k,e as q,f as C}from"./chunk-JELR4642.js";import"./chunk-QYZN33JA.js";import{b}from"./chunk-DZAFUADN.js";import"./chunk-47IFMQYS.js";import"./chunk-3MRB66F4.js";import"./chunk-R2J5MJOM.js";import{b as I}from"./chunk-7VWOECJ3.js";import{b as M}from"./chunk-472JZJ2D.js";import{b as j}from"./chunk-FONAGXRJ.js";import{b as t}from"./chunk-SE7JHGP3.js";import{b as l}from"./chunk-AI7JUA46.js";import{b as u}from"./chunk-GQKQEK5N.js";import{b as p}from"./chunk-YQEKKZTU.js";import{b as e}from"./chunk-67XYNGRV.js";import{b as d}from"./chunk-G4AUMZUY.js";import{b as c}from"./chunk-LE2XKKGQ.js";import{b as h}from"./chunk-VTAMGD42.js";import"./chunk-6KHZX4HU.js";import"./chunk-3PCPQIUD.js";import"./chunk-TW2IJRUF.js";import"./chunk-QKJAAJ7J.js";import"./chunk-K27FY3ES.js";import"./chunk-MROECM42.js";import"./chunk-42AMF6EE.js";import"./chunk-GA5TPRMF.js";import{b as i}from"./chunk-CMTQFWZK.js";import{b as g}from"./chunk-NXUXZWS5.js";import"./chunk-2UV6ZFHK.js";import"./chunk-GR4ZHKXI.js";import"./chunk-HWI42GQO.js";import{b as m}from"./chunk-WAJVRK5B.js";import"./chunk-HW2VJKFH.js";import"./chunk-YERKK5B3.js";import{b as F}from"./chunk-CL7IYCGG.js";import"./chunk-I57EACSL.js";import"./chunk-7JZKVC3F.js";import{b as z}from"./chunk-OLEQNRKX.js";import{b as f}from"./chunk-ZMGLTHSU.js";import"./chunk-WEHA3JFD.js";import"./chunk-43E7AR6A.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import{b as n}from"./chunk-QL33F2W6.js";import"./chunk-I4IRHQDW.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a,b,c,d,e,f}from"./chunk-HQ63MFHG.js";import"./chunk-QES5OSUC.js";import"./chunk-GR4ZHKXI.js";import"./chunk-HWI42GQO.js";import"./chunk-I57EACSL.js";import"./chunk-WEHA3JFD.js";import"./chunk-43E7AR6A.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{d as flagsForFuzzing,b as gunzipCommand,e as gunzipFlagsForFuzzing,a as gzipCommand,c as zcatCommand,f as zcatFlagsForFuzzing};
@@ -1,99 +0,0 @@
1
- #!/usr/bin/env node
2
- import{createRequire} from"node:module";const require=createRequire(import.meta.url);
3
- import{a as A,b as B}from"./chunk-JHEAT7AR.js";import{a as q}from"./chunk-3DWQCLNP.js";import"./chunk-3MRB66F4.js";import"./chunk-O2BCKSMK.js";import"./chunk-TW2IJRUF.js";import{b as v,c as j}from"./chunk-QKJAAJ7J.js";import{a as F}from"./chunk-MROECM42.js";import{b as C}from"./chunk-HWI42GQO.js";import{b as E}from"./chunk-CPKBPQ2C.js";import{a as W,b as h}from"./chunk-PBOVSFTJ.js";import{a as S}from"./chunk-I4IRHQDW.js";import{b as M}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";import{AsyncLocalStorage as H}from"node:async_hooks";import{fileURLToPath as J}from"node:url";import{Worker as L}from"node:worker_threads";var O=new H,P=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
4
-
5
- Usage: js-exec [OPTIONS] [-c CODE | FILE] [ARGS...]
6
-
7
- Options:
8
- -c CODE Execute inline code
9
- -m, --module Enable ES module mode (import/export)
10
- --strip-types Strip TypeScript type annotations
11
- --version, -V Show version
12
- --help Show this help
13
-
14
- Examples:
15
- js-exec -c "console.log(1 + 2)"
16
- js-exec script.js
17
- js-exec app.ts
18
- echo 'console.log("hello")' | js-exec
19
-
20
- File Extension Auto-Detection:
21
- .js script mode (module mode if top-level await detected)
22
- .mjs ES module mode
23
- .ts, .mts ES module mode + TypeScript stripping
24
-
25
- Node.js Compatibility:
26
- Code written for Node.js largely works here. Both require and import
27
- are supported, the node: prefix works, and standard globals like process,
28
- console, and fetch are available. All I/O is synchronous.
29
-
30
- Available modules:
31
- fs, path, child_process, process, console,
32
- os, url, assert, util, events, buffer, stream,
33
- string_decoder, querystring
34
-
35
- fs (global, require('fs'), or import from 'node:fs'):
36
- readFileSync, writeFileSync, appendFileSync, copyFileSync, renameSync
37
- readdirSync, mkdirSync, rmSync, unlinkSync, rmdirSync
38
- statSync, lstatSync, existsSync, realpathSync, chmodSync
39
- symlinkSync, readlinkSync, readFileBuffer
40
- fs.promises.readFile, fs.promises.writeFile, fs.promises.access, ...
41
-
42
- path: join, resolve, dirname, basename, extname, normalize,
43
- relative, isAbsolute, parse, format, sep, delimiter
44
-
45
- child_process:
46
- execSync(cmd) throws on non-zero exit, returns stdout
47
- spawnSync(cmd, args) returns { stdout, stderr, status }
48
-
49
- process (also global): argv, cwd(), exit(), env, platform, arch,
50
- version, versions
51
-
52
- os: platform(), arch(), homedir(), tmpdir(), type(), hostname(),
53
- EOL, cpus(), endianness()
54
-
55
- url: URL, URLSearchParams, parse(), format()
56
-
57
- assert: ok(), equal(), strictEqual(), deepEqual(), throws(),
58
- doesNotThrow(), fail()
59
-
60
- util: format(), inspect(), promisify(), types, inherits()
61
-
62
- events: EventEmitter (on, once, emit, off, removeListener, ...)
63
-
64
- buffer: Buffer.from(), Buffer.alloc(), Buffer.concat(),
65
- Buffer.isBuffer(), toString(), slice(), equals()
66
-
67
- stream: Readable, Writable, Duplex, Transform, PassThrough, pipeline
68
-
69
- string_decoder: StringDecoder (write, end)
70
-
71
- querystring: parse(), stringify(), escape(), unescape()
72
-
73
- Other Globals:
74
- console log (stdout), error/warn (stderr)
75
- fetch(url, opts) HTTP; returns Promise<Response> (Web Fetch API)
76
- URL, URLSearchParams, Headers, Request, Response
77
- Buffer Buffer.from(), Buffer.alloc(), etc.
78
-
79
- Not Available:
80
- http, https, net, tls, crypto, zlib, dns, cluster, worker_threads,
81
- vm, v8, readline, and other Node.js built-in modules that require
82
- native bindings. Use fetch() for HTTP requests.
83
-
84
- Limits:
85
- Memory: 64 MB per execution
86
- Timeout: 10 s by default; configurable via maxJsTimeoutMs
87
- Engine: QuickJS (compiled to WebAssembly)
88
- `;function N(r){let e={code:null,scriptFile:null,showVersion:!1,scriptArgs:[],isModule:!1,stripTypes:!1};if(r.length===0)return e;for(let t=0;t<r.length;t++){let s=r[t];if(s==="-m"||s==="--module"){e.isModule=!0;continue}if(s==="--strip-types"){e.stripTypes=!0;continue}if(s==="-c")return t+1>=r.length?{stdout:"",stderr:`js-exec: option requires an argument -- 'c'
89
- `,exitCode:2}:(e.code=r[t+1],e.scriptArgs=r.slice(t+2),e);if(s==="--version"||s==="-V")return e.showVersion=!0,e;if(s.startsWith("-")&&s!=="-"&&s!=="--")return{stdout:"",stderr:`js-exec: unrecognized option '${s}'
90
- `,exitCode:2};if(s==="--")return t+1<r.length&&(e.scriptFile=r[t+1],e.scriptArgs=r.slice(t+2)),e;if(!s.startsWith("-"))return e.scriptFile=s,e.scriptArgs=r.slice(t+1),e}return e}var l=null,y=null,c=[],n=null,x=null,U=1e3,R=5e3;function fe(r){R=r}function pe(){return l!==null}function _(r,e,t){r.controller.close();let s=!1,o=()=>{if(!s&&(s=!0,v(i),n===r)){x="worker termination was not acknowledged";for(let a of c)a.bridgeHandler.stop(),a.resolve({success:!1,error:x});c.length=0,r.resolve(t)}},u=()=>{s||(s=!0,v(i),n===r&&(r.resolve(t),n=null,g()))},i=j(()=>{o()},U);r.controller.terminate(e).then(a=>a?u():o(),o)}function me(){y&&(v(y),y=null),n?.bridgeHandler.stop(),n=null;for(let e of c)e.bridgeHandler.stop();c.length=0;let r=l;l=null,r&&r.terminate(),x=null}var D=J(new URL("./js-exec-worker.js",import.meta.url));function g(){if(n||c.length===0)return;let r=c.shift();if(!r)return;n=r;let e=null;try{e=V(),e.postMessage(r.input)}catch(t){r.bridgeHandler.stop();let s={success:!1,error:h(S(t))},o=e??l;l===o&&(l=null),o?_(r,o,s):(r.resolve(s),n===r&&(n=null),g())}}function $(r,e){if(!r||typeof r!="object")return{success:!1,error:"Malformed worker response"};let t=r;return typeof t.protocolToken!="string"||t.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:typeof t.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:t.success?{success:!0}:{success:!1,type:t.type==="initialization-failure"?"initialization-failure":void 0,error:typeof t.error=="string"&&t.error.length>0?t.error:"Worker execution failed"}}function V(){if(y&&(v(y),y=null),l)return l;let r=C.runTrusted(()=>new L(D));return l=r,r.on("message",e=>{if(l===r){if(n){let t;try{n.controller.assertMessageSize(e,"response"),t=$(e,n.input.protocolToken)}catch(s){t={success:!1,error:h(S(s))}}if(t.type==="initialization-failure"){x=t.error??"Worker initialization failed",n.bridgeHandler.stop(),n.resolve(t),n=null;for(let s of c)s.bridgeHandler.stop(),s.resolve({success:!1,type:"initialization-failure",error:x});c.length=0,l=null,r.terminate();return}n.resolve(t),n=null}c.length>0?g():Q()}}),r.on("error",e=>{if(l===r){if(n){let t=h(S(e));n.resolve({success:!1,error:t}),n=null}for(let t of c)t.resolve({success:!1,error:"Worker crashed"});c.length=0,l=null}}),r.on("exit",()=>{l===r&&(l=null,n&&(n.resolve({success:!1,error:"Worker exited unexpectedly"}),n=null),c.length>0&&g())}),r}function Q(){y=j(()=>{l&&!n&&c.length===0&&(l.terminate(),l=null)},R)}async function G(r,e,t,s=[],o,u,i){return O.getStore()?{stdout:"",stderr:`js-exec: recursive invocation is not supported
91
- `,exitCode:1}:Y(r,e,t,s,o,u,i)}async function K(r,e,t,s){let o,u=new Promise(d=>{o=d}),i={input:r,bridgeHandler:e,resolve:()=>{},controller:s};s.assertMessageSize({...r,sharedBuffer:void 0},"request");let a=d=>{e.stop();let f={success:!1,error:d==="abort"?i.controller.abortMessage():i.controller.timeoutMessage()};if(n===i){let p=l;l=null,p?_(i,p,f):(i.resolve(f),n=null,g())}else{let p=c.indexOf(i);p!==-1&&c.splice(p,1),i.resolve(f),n||g()}};if(i.resolve=d=>{i.controller.close(),o(d)},i.controller.arm(a),!i.controller.isCanceled){c.push(i);try{g()}catch(d){let f=c.indexOf(i);throw f!==-1&&c.splice(f,1),i.controller.close(),d}}let[m,k]=await Promise.all([e.run(t),u.catch(d=>({success:!1,error:h(S(d))}))]);return{bridgeOutput:m,workerResult:k}}function X(r){return r.limits.maxJsTimeoutMs}async function Y(r,e,t,s=[],o,u,i){if(x!==null)return{stdout:"",stderr:`js-exec: ${h(x)}
92
- `,exitCode:1};let a=A(),m=e.exec,k=m?(b,I)=>O.run(!0,()=>m(b,I)):void 0,d=new B(a,e.fs,e.cwd,"js-exec",e.fetch,e.limits.maxOutputSize,k,e.invokeTool),f=X(e),p=new q({commandName:"js-exec",timeoutMs:f,signal:e.signal,maxMessageBytes:e.limits.maxWorkerMessageBytes}),z={protocolToken:p.protocolToken,sharedBuffer:a,jsCode:r,cwd:e.cwd,env:F(e.env),args:s,scriptPath:t,bootstrapCode:o,isModule:u,stripTypes:i,timeoutMs:f,hasInvokeTool:e.invokeTool!==void 0},{bridgeOutput:T,workerResult:w}=await K(z,d,f,p);if(!w.success&&w.error){let b=w.error===p.timeoutMessage()||w.error===p.abortMessage();return{stdout:T.stdout,stderr:`${T.stderr}js-exec: ${h(w.error)}
93
- `,exitCode:T.exitCode||(b?124:1)}}return{...T}}var he={name:"js-exec",async execute(r,e){if(M(r))return{stdout:P,stderr:"",exitCode:0};let t=N(r);if("exitCode"in t)return t;if(t.showVersion)return{stdout:`QuickJS (quickjs-emscripten)
94
- `,stderr:"",exitCode:0};let s,o;if(t.code!==null)s=t.code,o="-c";else if(t.scriptFile!==null){let m=e.fs.resolvePath(e.cwd,t.scriptFile);if(!await e.fs.exists(m))return{stdout:"",stderr:`js-exec: can't open file '${t.scriptFile}': No such file or directory
95
- `,exitCode:2};try{s=await e.fs.readFile(m),o=m}catch(k){return{stdout:"",stderr:`js-exec: can't open file '${t.scriptFile}': ${W(k.message)}
96
- `,exitCode:2}}}else if(E(e.stdin).trim())s=E(e.stdin),o="<stdin>";else return{stdout:"",stderr:`js-exec: no input provided (use -c CODE or provide a script file)
97
- `,exitCode:2};let u=t.isModule,i=t.stripTypes;o&&o!=="-c"&&o!=="<stdin>"&&((o.endsWith(".mjs")||o.endsWith(".mts")||o.endsWith(".ts"))&&(u=!0),(o.endsWith(".ts")||o.endsWith(".mts"))&&(i=!0)),!u&&/\bawait\s+[\w([`]/.test(s)&&(u=!0);let a=e.jsBootstrapCode;return G(s,e,o,t.scriptArgs,a,u,i)}},ye={name:"node",async execute(){return{stdout:"",stderr:`node: this sandbox uses js-exec instead of node
98
-
99
- ${P}`,exitCode:1}}};export{pe as _hasSharedJsExecWorkerForTests,me as _resetJsExecWorkerForTests,fe as _setJsExecWorkerIdleTimeoutMsForTests,he as jsExecCommand,ye as nodeStubCommand};