just-bash 2.12.3 → 2.12.5

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 (312) hide show
  1. package/dist/bin/chunks/awk2-4MK3F3NZ.js +2 -0
  2. package/dist/bin/chunks/{chmod-4O2C4V42.js → chmod-N5CQATDW.js} +1 -1
  3. package/dist/bin/chunks/chunk-2HDH5VPF.js +12 -0
  4. package/dist/bin/chunks/chunk-5ATRLST6.js +100 -0
  5. package/dist/bin/chunks/{chunk-3NVWSLHI.js → chunk-6W7JTG6A.js} +99 -99
  6. package/dist/bin/chunks/chunk-7ADG3DNO.js +8 -0
  7. package/dist/bin/chunks/chunk-DERQIX2O.js +36 -0
  8. package/dist/bin/{shell/chunks/chunk-7SWOLTCR.js → chunks/chunk-EMSJEY2U.js} +1 -1
  9. package/dist/bin/chunks/{chunk-2SIXTZCJ.js → chunk-EZS766DD.js} +4 -4
  10. package/dist/bin/chunks/chunk-LWKIHJ5L.js +13 -0
  11. package/dist/bin/chunks/chunk-MY5PY2PL.js +2 -0
  12. package/dist/bin/chunks/{chunk-OKL2SPHK.js → chunk-O5B6WWQQ.js} +39 -39
  13. package/dist/bin/chunks/chunk-OQV5J23L.js +7 -0
  14. package/dist/bin/chunks/chunk-Q5MYEU7X.js +5 -0
  15. package/dist/bin/chunks/chunk-QZNF3Y3J.js +2 -0
  16. package/dist/bin/chunks/chunk-R2LDP472.js +8 -0
  17. package/dist/bin/chunks/chunk-RDGXTKIB.js +21 -0
  18. package/dist/bin/chunks/chunk-RS2PRILS.js +10 -0
  19. package/dist/bin/chunks/chunk-STOAUD75.js +11 -0
  20. package/dist/bin/chunks/chunk-SXB55JOI.js +2 -0
  21. package/dist/bin/chunks/chunk-SYG3IW7P.js +2 -0
  22. package/dist/bin/chunks/chunk-SYL34GE7.js +21 -0
  23. package/dist/bin/chunks/chunk-UT6LUTWP.js +2 -0
  24. package/dist/bin/chunks/chunk-VIYJJTN2.js +14 -0
  25. package/dist/bin/chunks/chunk-W752QGNZ.js +6 -0
  26. package/dist/bin/chunks/{chunk-435ZOZCY.js → chunk-WWVVJW3F.js} +13 -13
  27. package/dist/bin/{shell/chunks/chunk-GA6KXSOC.js → chunks/chunk-YFPDB4PH.js} +1 -1
  28. package/dist/bin/chunks/chunk-YMMJLYIX.js +2 -0
  29. package/dist/bin/chunks/chunk-YTIURC67.js +2 -0
  30. package/dist/bin/chunks/chunk-YWZOGBFE.js +9 -0
  31. package/dist/bin/chunks/chunk-YX7OOTPO.js +9 -0
  32. package/dist/bin/chunks/chunk-ZRRNCS7N.js +2 -0
  33. package/dist/bin/chunks/chunk-ZSVBYEY4.js +6 -0
  34. package/dist/bin/chunks/curl-GIQ5S66Y.js +26 -0
  35. package/dist/bin/{shell/chunks/expansion-TCB3WZP5.js → chunks/expansion-JBCP2CHQ.js} +1 -1
  36. package/dist/bin/chunks/expr-VEFRBJT4.js +2 -0
  37. package/dist/bin/chunks/find-MTLF23HX.js +2 -0
  38. package/dist/bin/chunks/flag-coverage-NDF6MQAO.js +2 -0
  39. package/dist/bin/{shell/chunks/grep-F3GT2VPG.js → chunks/grep-OZJTRD4D.js} +1 -1
  40. package/dist/bin/chunks/jq-F7FJ46VM.js +2 -0
  41. package/dist/bin/chunks/ln-VAOSD4HK.js +2 -0
  42. package/dist/bin/chunks/mkdir-CH7JGW4N.js +2 -0
  43. package/dist/bin/chunks/python3-QBGIYRFR.js +17 -0
  44. package/dist/bin/{shell/chunks/readlink-YNOUXNUY.js → chunks/readlink-BD5VFOC5.js} +1 -1
  45. package/dist/bin/chunks/rm-GWYJO4W7.js +2 -0
  46. package/dist/bin/chunks/sed-ENUQOCBB.js +2 -0
  47. package/dist/bin/chunks/sleep-5T34UFNF.js +2 -0
  48. package/dist/bin/chunks/sqlite3-4SBQACEE.js +2 -0
  49. package/dist/bin/chunks/stat-XS2LXYS2.js +2 -0
  50. package/dist/bin/chunks/tar-3UIZ4IRM.js +2 -0
  51. package/dist/bin/chunks/time-GZSHCM77.js +2 -0
  52. package/dist/bin/chunks/timeout-7ECKKPNP.js +2 -0
  53. package/dist/bin/chunks/tr-LZF57GYP.js +2 -0
  54. package/dist/bin/chunks/worker.js +162 -31
  55. package/dist/bin/chunks/xan-5QTBTP4U.js +2 -0
  56. package/dist/bin/chunks/yq-O5RSLLA3.js +2 -0
  57. package/dist/bin/just-bash.js +281 -281
  58. package/dist/bin/shell/chunks/awk2-4MK3F3NZ.js +2 -0
  59. package/dist/bin/shell/chunks/{chmod-4O2C4V42.js → chmod-N5CQATDW.js} +1 -1
  60. package/dist/bin/shell/chunks/chunk-2HDH5VPF.js +12 -0
  61. package/dist/bin/shell/chunks/chunk-5ATRLST6.js +100 -0
  62. package/dist/bin/shell/chunks/{chunk-3NVWSLHI.js → chunk-6W7JTG6A.js} +99 -99
  63. package/dist/bin/shell/chunks/chunk-7ADG3DNO.js +8 -0
  64. package/dist/bin/shell/chunks/chunk-D64U2VGQ.js +2 -0
  65. package/dist/bin/shell/chunks/chunk-DERQIX2O.js +36 -0
  66. package/dist/bin/{chunks/chunk-7SWOLTCR.js → shell/chunks/chunk-EMSJEY2U.js} +1 -1
  67. package/dist/bin/shell/chunks/{chunk-2SIXTZCJ.js → chunk-EZS766DD.js} +4 -4
  68. package/dist/bin/shell/chunks/chunk-LWKIHJ5L.js +13 -0
  69. package/dist/bin/shell/chunks/{chunk-OKL2SPHK.js → chunk-O5B6WWQQ.js} +39 -39
  70. package/dist/bin/shell/chunks/chunk-OQV5J23L.js +7 -0
  71. package/dist/bin/shell/chunks/chunk-Q5MYEU7X.js +5 -0
  72. package/dist/bin/shell/chunks/chunk-QZNF3Y3J.js +2 -0
  73. package/dist/bin/shell/chunks/chunk-R2LDP472.js +8 -0
  74. package/dist/bin/shell/chunks/chunk-RDGXTKIB.js +21 -0
  75. package/dist/bin/shell/chunks/chunk-RS2PRILS.js +10 -0
  76. package/dist/bin/shell/chunks/chunk-STOAUD75.js +11 -0
  77. package/dist/bin/shell/chunks/chunk-SXB55JOI.js +2 -0
  78. package/dist/bin/shell/chunks/chunk-SYG3IW7P.js +2 -0
  79. package/dist/bin/shell/chunks/chunk-SYL34GE7.js +21 -0
  80. package/dist/bin/shell/chunks/chunk-UT6LUTWP.js +2 -0
  81. package/dist/bin/shell/chunks/chunk-VIYJJTN2.js +14 -0
  82. package/dist/bin/shell/chunks/chunk-W752QGNZ.js +6 -0
  83. package/dist/bin/shell/chunks/{chunk-435ZOZCY.js → chunk-WWVVJW3F.js} +13 -13
  84. package/dist/bin/{chunks/chunk-GA6KXSOC.js → shell/chunks/chunk-YFPDB4PH.js} +1 -1
  85. package/dist/bin/shell/chunks/chunk-YMMJLYIX.js +2 -0
  86. package/dist/bin/shell/chunks/chunk-YTIURC67.js +2 -0
  87. package/dist/bin/shell/chunks/chunk-YWZOGBFE.js +9 -0
  88. package/dist/bin/shell/chunks/chunk-YX7OOTPO.js +9 -0
  89. package/dist/bin/shell/chunks/chunk-ZRRNCS7N.js +2 -0
  90. package/dist/bin/shell/chunks/chunk-ZSVBYEY4.js +6 -0
  91. package/dist/bin/shell/chunks/curl-GIQ5S66Y.js +26 -0
  92. package/dist/bin/{chunks/expansion-TCB3WZP5.js → shell/chunks/expansion-JBCP2CHQ.js} +1 -1
  93. package/dist/bin/shell/chunks/expr-VEFRBJT4.js +2 -0
  94. package/dist/bin/shell/chunks/find-MTLF23HX.js +2 -0
  95. package/dist/bin/shell/chunks/flag-coverage-NDF6MQAO.js +2 -0
  96. package/dist/bin/{chunks/grep-F3GT2VPG.js → shell/chunks/grep-OZJTRD4D.js} +1 -1
  97. package/dist/bin/shell/chunks/jq-F7FJ46VM.js +2 -0
  98. package/dist/bin/shell/chunks/ln-VAOSD4HK.js +2 -0
  99. package/dist/bin/shell/chunks/mkdir-CH7JGW4N.js +2 -0
  100. package/dist/bin/shell/chunks/python3-XN7O5X3A.js +17 -0
  101. package/dist/bin/{chunks/readlink-YNOUXNUY.js → shell/chunks/readlink-BD5VFOC5.js} +1 -1
  102. package/dist/bin/shell/chunks/rm-GWYJO4W7.js +2 -0
  103. package/dist/bin/shell/chunks/sed-ENUQOCBB.js +2 -0
  104. package/dist/bin/shell/chunks/sleep-5T34UFNF.js +2 -0
  105. package/dist/bin/shell/chunks/sqlite3-4SBQACEE.js +2 -0
  106. package/dist/bin/shell/chunks/stat-XS2LXYS2.js +2 -0
  107. package/dist/bin/shell/chunks/tar-3UIZ4IRM.js +2 -0
  108. package/dist/bin/shell/chunks/time-GZSHCM77.js +2 -0
  109. package/dist/bin/shell/chunks/timeout-7ECKKPNP.js +2 -0
  110. package/dist/bin/shell/chunks/tr-LZF57GYP.js +2 -0
  111. package/dist/bin/shell/chunks/xan-5QTBTP4U.js +2 -0
  112. package/dist/bin/shell/chunks/yq-O5RSLLA3.js +2 -0
  113. package/dist/bin/shell/shell.js +241 -241
  114. package/dist/bundle/browser.js +718 -721
  115. package/dist/bundle/chunks/awk2-ID6QVUYU.js +1 -0
  116. package/dist/bundle/chunks/{chmod-MIKE3OIT.js → chmod-SYMGL4JA.js} +1 -1
  117. package/dist/bundle/chunks/chunk-2OZNLYX4.js +9 -0
  118. package/dist/bundle/chunks/{chunk-C6ZZC5FL.js → chunk-3J4BCKUH.js} +99 -99
  119. package/dist/bundle/chunks/chunk-3ZBKQKTX.js +11 -0
  120. package/dist/bundle/chunks/chunk-3ZUFRYJ4.js +1 -0
  121. package/dist/bundle/chunks/chunk-4GTNDTRF.js +7 -0
  122. package/dist/bundle/chunks/chunk-5QVNJEHU.js +8 -0
  123. package/dist/bundle/chunks/chunk-64CW2LGZ.js +6 -0
  124. package/dist/bundle/chunks/chunk-AYQ5FKKK.js +20 -0
  125. package/dist/bundle/chunks/chunk-C764MECG.js +35 -0
  126. package/dist/bundle/chunks/{chunk-XULIVM35.js → chunk-CBAJ47B3.js} +1 -1
  127. package/dist/bundle/chunks/chunk-CCNMISUL.js +1 -0
  128. package/dist/bundle/chunks/chunk-D2FZX7A2.js +10 -0
  129. package/dist/bundle/chunks/chunk-EX62JIX3.js +13 -0
  130. package/dist/bundle/chunks/chunk-FD7SFJNJ.js +4 -0
  131. package/dist/bundle/chunks/chunk-FGALERPA.js +8 -0
  132. package/dist/bundle/chunks/chunk-HJWBQKYG.js +5 -0
  133. package/dist/bundle/chunks/chunk-HOFSUCIB.js +99 -0
  134. package/dist/bundle/chunks/chunk-IP7G3BNA.js +7 -0
  135. package/dist/bundle/chunks/chunk-J642UCRS.js +1 -0
  136. package/dist/bundle/chunks/chunk-L75XCEQX.js +1 -0
  137. package/dist/bundle/chunks/chunk-QI4EPYAT.js +5 -0
  138. package/dist/bundle/chunks/chunk-R5XRHEZH.js +12 -0
  139. package/dist/bundle/chunks/chunk-RH6GWZAJ.js +1 -0
  140. package/dist/bundle/chunks/{chunk-U7QI5ZS5.js → chunk-RVT3MU3A.js} +4 -4
  141. package/dist/bundle/chunks/chunk-SJ5LXPUH.js +1 -0
  142. package/dist/bundle/chunks/{chunk-4VCAQZKQ.js → chunk-TRD56HID.js} +39 -39
  143. package/dist/bundle/chunks/{chunk-5CJQNRNJ.js → chunk-TVHAURH5.js} +13 -13
  144. package/dist/bundle/chunks/chunk-X2AJGDEF.js +1 -0
  145. package/dist/bundle/chunks/chunk-XHM67O4N.js +1 -0
  146. package/dist/bundle/chunks/chunk-XXZ46GOX.js +20 -0
  147. package/dist/bundle/chunks/{chunk-CYTBPLPE.js → chunk-YS3AZT3J.js} +1 -1
  148. package/dist/bundle/chunks/curl-743M564K.js +25 -0
  149. package/dist/bundle/chunks/{expansion-HJ6B4DDG.js → expansion-XG7G47TX.js} +1 -1
  150. package/dist/bundle/chunks/expr-74QHYJL5.js +1 -0
  151. package/dist/bundle/chunks/find-DOIVMX6X.js +1 -0
  152. package/dist/bundle/chunks/flag-coverage-4M54QHNZ.js +1 -0
  153. package/dist/bundle/chunks/{grep-LXKUQUAE.js → grep-3AIAIJVR.js} +1 -1
  154. package/dist/bundle/chunks/jq-5FRYP6YP.js +1 -0
  155. package/dist/bundle/chunks/ln-UJ6YJVBK.js +1 -0
  156. package/dist/bundle/chunks/mkdir-F6XHPXZC.js +1 -0
  157. package/dist/bundle/chunks/python3-WANWDR22.js +16 -0
  158. package/dist/bundle/chunks/{readlink-IEQO24KU.js → readlink-MI4GCHJF.js} +1 -1
  159. package/dist/bundle/chunks/rm-FYNVTQIU.js +1 -0
  160. package/dist/bundle/chunks/sed-TS7M7I25.js +1 -0
  161. package/dist/bundle/chunks/sleep-RRZXXEW2.js +1 -0
  162. package/dist/bundle/chunks/sqlite3-IH5QMEIK.js +1 -0
  163. package/dist/bundle/chunks/stat-BT5A227F.js +1 -0
  164. package/dist/bundle/chunks/tar-JCULQ5J2.js +1 -0
  165. package/dist/bundle/chunks/time-XL42Z4U5.js +1 -0
  166. package/dist/bundle/chunks/timeout-DNGO7OHT.js +1 -0
  167. package/dist/bundle/chunks/tr-GVTWMRZB.js +1 -0
  168. package/dist/bundle/chunks/worker.js +162 -31
  169. package/dist/bundle/chunks/xan-LAW2EMOM.js +1 -0
  170. package/dist/bundle/chunks/yq-MFJEXB7R.js +1 -0
  171. package/dist/bundle/index.cjs +942 -945
  172. package/dist/bundle/index.js +274 -274
  173. package/dist/commands/awk/interpreter/context.d.ts +2 -0
  174. package/dist/commands/awk/interpreter/interpreter.d.ts +2 -0
  175. package/dist/commands/duration.d.ts +5 -0
  176. package/dist/commands/format-mode.d.ts +4 -0
  177. package/dist/commands/query-engine/evaluator.d.ts +3 -0
  178. package/dist/commands/sed/types.d.ts +0 -4
  179. package/dist/commands/tar/archive.d.ts +18 -4
  180. package/dist/fs/in-memory-fs/in-memory-fs.d.ts +0 -3
  181. package/dist/fs/mountable-fs/mountable-fs.d.ts +0 -4
  182. package/dist/fs/overlay-fs/overlay-fs.d.ts +6 -7
  183. package/dist/fs/path-utils.d.ts +46 -0
  184. package/dist/fs/read-write-fs/read-write-fs.d.ts +0 -4
  185. package/dist/fs/real-fs-utils.d.ts +17 -11
  186. package/dist/interpreter/defense-aware-command-context.d.ts +6 -0
  187. package/dist/interpreter/interpreter.d.ts +8 -0
  188. package/dist/interpreter/types.d.ts +5 -0
  189. package/dist/timers.d.ts +2 -14
  190. package/dist/types.d.ts +6 -0
  191. package/package.json +34 -33
  192. package/vendor/cpython-emscripten/python.wasm +0 -0
  193. package/dist/bin/chunks/awk2-ZE5HJBNV.js +0 -2
  194. package/dist/bin/chunks/chunk-253LRF5J.js +0 -11
  195. package/dist/bin/chunks/chunk-2FFXXW3F.js +0 -14
  196. package/dist/bin/chunks/chunk-4E3LY6YK.js +0 -10
  197. package/dist/bin/chunks/chunk-4FNW6LFM.js +0 -5
  198. package/dist/bin/chunks/chunk-4PZYIYYG.js +0 -36
  199. package/dist/bin/chunks/chunk-5VFN7VVJ.js +0 -9
  200. package/dist/bin/chunks/chunk-6L4K3UGO.js +0 -100
  201. package/dist/bin/chunks/chunk-D2GFNFUN.js +0 -7
  202. package/dist/bin/chunks/chunk-DREQRXNN.js +0 -12
  203. package/dist/bin/chunks/chunk-EPIOK4SY.js +0 -6
  204. package/dist/bin/chunks/chunk-GIFF636B.js +0 -2
  205. package/dist/bin/chunks/chunk-IYZRLSTQ.js +0 -2
  206. package/dist/bin/chunks/chunk-JJHAWOIB.js +0 -2
  207. package/dist/bin/chunks/chunk-JNPUO56K.js +0 -10
  208. package/dist/bin/chunks/chunk-KPWFKFSD.js +0 -21
  209. package/dist/bin/chunks/chunk-KWLLB7S3.js +0 -7
  210. package/dist/bin/chunks/chunk-RYXW3SZQ.js +0 -13
  211. package/dist/bin/chunks/chunk-VZKEP45B.js +0 -21
  212. package/dist/bin/chunks/chunk-XAL6VWGA.js +0 -9
  213. package/dist/bin/chunks/chunk-YYQ22ZRL.js +0 -8
  214. package/dist/bin/chunks/curl-RWQO3SBN.js +0 -26
  215. package/dist/bin/chunks/expr-MLHUWFYI.js +0 -2
  216. package/dist/bin/chunks/find-4YAO7JQS.js +0 -2
  217. package/dist/bin/chunks/flag-coverage-23ZUDENJ.js +0 -2
  218. package/dist/bin/chunks/jq-CXSPO2J5.js +0 -2
  219. package/dist/bin/chunks/ln-5TCJXDGY.js +0 -2
  220. package/dist/bin/chunks/mkdir-6OKMS3KO.js +0 -2
  221. package/dist/bin/chunks/python3-74B25WCY.js +0 -17
  222. package/dist/bin/chunks/rm-5QIBTLJG.js +0 -2
  223. package/dist/bin/chunks/sed-DNLJZZXZ.js +0 -2
  224. package/dist/bin/chunks/sleep-GUJH2AMQ.js +0 -2
  225. package/dist/bin/chunks/sqlite3-57UI7HYL.js +0 -2
  226. package/dist/bin/chunks/stat-XH7E4E2C.js +0 -2
  227. package/dist/bin/chunks/tar-VIYVHMER.js +0 -2
  228. package/dist/bin/chunks/time-FAWHHOMA.js +0 -2
  229. package/dist/bin/chunks/timeout-4O4YYRTS.js +0 -2
  230. package/dist/bin/chunks/tr-4V5A3V2C.js +0 -2
  231. package/dist/bin/chunks/xan-7NIVZ3HP.js +0 -2
  232. package/dist/bin/chunks/yq-L5ZSGLLO.js +0 -2
  233. package/dist/bin/shell/chunks/awk2-ZE5HJBNV.js +0 -2
  234. package/dist/bin/shell/chunks/chunk-253LRF5J.js +0 -11
  235. package/dist/bin/shell/chunks/chunk-2FFXXW3F.js +0 -14
  236. package/dist/bin/shell/chunks/chunk-4E3LY6YK.js +0 -10
  237. package/dist/bin/shell/chunks/chunk-4FNW6LFM.js +0 -5
  238. package/dist/bin/shell/chunks/chunk-4PZYIYYG.js +0 -36
  239. package/dist/bin/shell/chunks/chunk-5VFN7VVJ.js +0 -9
  240. package/dist/bin/shell/chunks/chunk-6L4K3UGO.js +0 -100
  241. package/dist/bin/shell/chunks/chunk-D2GFNFUN.js +0 -7
  242. package/dist/bin/shell/chunks/chunk-DREQRXNN.js +0 -12
  243. package/dist/bin/shell/chunks/chunk-EPIOK4SY.js +0 -6
  244. package/dist/bin/shell/chunks/chunk-GIFF636B.js +0 -2
  245. package/dist/bin/shell/chunks/chunk-IYZRLSTQ.js +0 -2
  246. package/dist/bin/shell/chunks/chunk-JJHAWOIB.js +0 -2
  247. package/dist/bin/shell/chunks/chunk-JNPUO56K.js +0 -10
  248. package/dist/bin/shell/chunks/chunk-KPWFKFSD.js +0 -21
  249. package/dist/bin/shell/chunks/chunk-KWLLB7S3.js +0 -7
  250. package/dist/bin/shell/chunks/chunk-RYXW3SZQ.js +0 -13
  251. package/dist/bin/shell/chunks/chunk-VZKEP45B.js +0 -21
  252. package/dist/bin/shell/chunks/chunk-XAL6VWGA.js +0 -9
  253. package/dist/bin/shell/chunks/chunk-YYQ22ZRL.js +0 -8
  254. package/dist/bin/shell/chunks/curl-RWQO3SBN.js +0 -26
  255. package/dist/bin/shell/chunks/expr-MLHUWFYI.js +0 -2
  256. package/dist/bin/shell/chunks/find-4YAO7JQS.js +0 -2
  257. package/dist/bin/shell/chunks/flag-coverage-23ZUDENJ.js +0 -2
  258. package/dist/bin/shell/chunks/jq-CXSPO2J5.js +0 -2
  259. package/dist/bin/shell/chunks/ln-5TCJXDGY.js +0 -2
  260. package/dist/bin/shell/chunks/mkdir-6OKMS3KO.js +0 -2
  261. package/dist/bin/shell/chunks/python3-74B25WCY.js +0 -17
  262. package/dist/bin/shell/chunks/rm-5QIBTLJG.js +0 -2
  263. package/dist/bin/shell/chunks/sed-DNLJZZXZ.js +0 -2
  264. package/dist/bin/shell/chunks/sleep-GUJH2AMQ.js +0 -2
  265. package/dist/bin/shell/chunks/sqlite3-57UI7HYL.js +0 -2
  266. package/dist/bin/shell/chunks/stat-XH7E4E2C.js +0 -2
  267. package/dist/bin/shell/chunks/tar-VIYVHMER.js +0 -2
  268. package/dist/bin/shell/chunks/time-FAWHHOMA.js +0 -2
  269. package/dist/bin/shell/chunks/timeout-4O4YYRTS.js +0 -2
  270. package/dist/bin/shell/chunks/tr-4V5A3V2C.js +0 -2
  271. package/dist/bin/shell/chunks/xan-7NIVZ3HP.js +0 -2
  272. package/dist/bin/shell/chunks/yq-L5ZSGLLO.js +0 -2
  273. package/dist/bundle/chunks/awk2-T6LHPVZE.js +0 -1
  274. package/dist/bundle/chunks/chunk-27LMNKBP.js +0 -7
  275. package/dist/bundle/chunks/chunk-5BFLZVGH.js +0 -20
  276. package/dist/bundle/chunks/chunk-7BQDVPII.js +0 -9
  277. package/dist/bundle/chunks/chunk-7KHLIOOW.js +0 -4
  278. package/dist/bundle/chunks/chunk-AOFQVUAD.js +0 -99
  279. package/dist/bundle/chunks/chunk-BAAVD5NO.js +0 -20
  280. package/dist/bundle/chunks/chunk-BEFDX7IY.js +0 -1
  281. package/dist/bundle/chunks/chunk-GZ2N3SXD.js +0 -8
  282. package/dist/bundle/chunks/chunk-IJXFPKNC.js +0 -1
  283. package/dist/bundle/chunks/chunk-IKZ5LEGB.js +0 -6
  284. package/dist/bundle/chunks/chunk-KPFCTJEX.js +0 -12
  285. package/dist/bundle/chunks/chunk-LN5KAJOV.js +0 -5
  286. package/dist/bundle/chunks/chunk-NBAARP4B.js +0 -1
  287. package/dist/bundle/chunks/chunk-OFJTSXN6.js +0 -8
  288. package/dist/bundle/chunks/chunk-RHOPHAL6.js +0 -35
  289. package/dist/bundle/chunks/chunk-SL4FN3A5.js +0 -9
  290. package/dist/bundle/chunks/chunk-UJIR5V54.js +0 -11
  291. package/dist/bundle/chunks/chunk-XZ3MZS57.js +0 -6
  292. package/dist/bundle/chunks/chunk-YCABLDKV.js +0 -10
  293. package/dist/bundle/chunks/chunk-YIY2RKBW.js +0 -13
  294. package/dist/bundle/chunks/curl-6L7YZUIH.js +0 -25
  295. package/dist/bundle/chunks/expr-3572LAOT.js +0 -1
  296. package/dist/bundle/chunks/find-DQFMWHAC.js +0 -1
  297. package/dist/bundle/chunks/flag-coverage-L3DCLG6V.js +0 -1
  298. package/dist/bundle/chunks/jq-MYSLFARY.js +0 -1
  299. package/dist/bundle/chunks/ln-YAIFIHCT.js +0 -1
  300. package/dist/bundle/chunks/mkdir-QWGXDWUS.js +0 -1
  301. package/dist/bundle/chunks/python3-6BKA3FYA.js +0 -16
  302. package/dist/bundle/chunks/rm-KPTLPKPH.js +0 -1
  303. package/dist/bundle/chunks/sed-3ZCNFRHI.js +0 -1
  304. package/dist/bundle/chunks/sleep-LB7FI6AB.js +0 -1
  305. package/dist/bundle/chunks/sqlite3-FVNA4KNF.js +0 -1
  306. package/dist/bundle/chunks/stat-74KBZFAX.js +0 -1
  307. package/dist/bundle/chunks/tar-E2DVQEWO.js +0 -1
  308. package/dist/bundle/chunks/time-AGNW2ZY6.js +0 -1
  309. package/dist/bundle/chunks/timeout-VN35D5O7.js +0 -1
  310. package/dist/bundle/chunks/tr-2N7Q3KKJ.js +0 -1
  311. package/dist/bundle/chunks/xan-VTO4FP3H.js +0 -1
  312. package/dist/bundle/chunks/yq-JRZFRYSK.js +0 -1
@@ -1,8 +0,0 @@
1
- import{a as d}from"./chunk-HWKDQ44K.js";import{a as g,b as u}from"./chunk-74CEPOFO.js";var S={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},$={format:{short:"c",type:"string"}},O={name:"stat",async execute(e,a){if(u(e))return g(S);let s=d("stat",e,$);if(!s.ok)return s.error;let l=s.result.flags.format??null,c=s.result.positional;if(c.length===0)return{stdout:"",stderr:`stat: missing operand
2
- `,exitCode:1};let o="",p="",f=!1;for(let n of c){let h=a.fs.resolvePath(a.cwd,n);try{let r=await a.fs.stat(h);if(l){let t=l,i=r.mode.toString(8),y=m(r.mode,r.isDirectory);t=t.replace(/%n/g,n),t=t.replace(/%N/g,`'${n}'`),t=t.replace(/%s/g,String(r.size)),t=t.replace(/%F/g,r.isDirectory?"directory":"regular file"),t=t.replace(/%a/g,i),t=t.replace(/%A/g,y),t=t.replace(/%u/g,"1000"),t=t.replace(/%U/g,"user"),t=t.replace(/%g/g,"1000"),t=t.replace(/%G/g,"group"),o+=`${t}
3
- `}else{let t=r.mode.toString(8).padStart(4,"0"),i=m(r.mode,r.isDirectory);o+=` File: ${n}
4
- `,o+=` Size: ${r.size} Blocks: ${Math.ceil(r.size/512)}
5
- `,o+=`Access: (${t}/${i})
6
- `,o+=`Modify: ${r.mtime.toISOString()}
7
- `}}catch{p+=`stat: cannot stat '${n}': No such file or directory
8
- `,f=!0}}return{stdout:o,stderr:p,exitCode:f?1:0}}};function m(e,a){let s=a?"d":"-",l=[e&256?"r":"-",e&128?"w":"-",e&64?"x":"-",e&32?"r":"-",e&16?"w":"-",e&8?"x":"-",e&4?"r":"-",e&2?"w":"-",e&1?"x":"-"];return s+l.join("")}var w={name:"stat",flags:[{flag:"-c",type:"value",valueHint:"format"},{flag:"-L",type:"boolean"}],needsArgs:!0};export{O as a,w as b};
@@ -1,35 +0,0 @@
1
- import{b as p}from"./chunk-7KHLIOOW.js";import{a as j,b as h}from"./chunk-NBAARP4B.js";import{a as S,b as y}from"./chunk-74CEPOFO.js";import{existsSync as g}from"node:fs";import{dirname as W,join as w}from"node:path";import{fileURLToPath as H}from"node:url";import{Worker as J}from"node:worker_threads";import _ from"sql.js";function E(e,r,n){switch(n.mode){case"list":return M(e,r,n);case"csv":return V(e,r,n);case"json":return B(e,r);case"line":return O(e,r,n);case"column":return I(e,r,n);case"table":return N(e,r,n);case"markdown":return P(e,r,n);case"tabs":return R(e,r,n);case"box":return F(e,r,n);case"quote":return Q(e,r,n);case"html":return D(e,r,n);case"ascii":return U(e,r,n)}}function u(e,r){return e==null?r:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function M(e,r,n){let t=[];n.header&&e.length>0&&t.push(e.join(n.separator));for(let a of r)t.push(a.map(i=>u(i,n.nullValue)).join(n.separator));return t.length>0?`${t.join(n.newline)}${n.newline}`:""}function V(e,r,n){let t=[];n.header&&e.length>0&&t.push(e.map(x).join(","));for(let a of r)t.push(a.map(i=>x(u(i,n.nullValue))).join(","));return t.length>0?`${t.join(`
2
- `)}
3
- `:""}function x(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(`
4
- `)?`"${e.replace(/"/g,'""')}"`:e}function T(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function A(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):T(e):JSON.stringify(e)}function B(e,r){return r.length===0?"":`[${r.map(t=>`{${e.map((i,s)=>`${JSON.stringify(i)}:${A(t[s])}`).join(",")}}`).join(`,
5
- `)}]
6
- `}function O(e,r,n){if(e.length===0||r.length===0)return"";let t=Math.max(5,...e.map(i=>i.length)),a=[];for(let i of r)for(let s=0;s<e.length;s++){let o=e[s].padStart(t);a.push(`${o} = ${u(i[s],n.nullValue)}`)}return`${a.join(`
7
- `)}
8
- `}function I(e,r,n){if(e.length===0)return"";let t=e.map(i=>i.length);for(let i of r)for(let s=0;s<i.length;s++){let o=u(i[s],n.nullValue).length;o>t[s]&&(t[s]=o)}let a=[];n.header&&(a.push(e.map((i,s)=>i.padEnd(t[s])).join(" ")),a.push(t.map(i=>"-".repeat(i)).join(" ")));for(let i of r)a.push(i.map((s,o)=>u(s,n.nullValue).padEnd(t[o])).join(" "));return a.length>0?`${a.join(`
9
- `)}
10
- `:""}function N(e,r,n){if(e.length===0)return"";let t=e.map(s=>s.length);for(let s of r)for(let o=0;o<s.length;o++){let f=u(s[o],n.nullValue).length;f>t[o]&&(t[o]=f)}let a=[],i=`+${t.map(s=>"-".repeat(s+2)).join("+")}+`;a.push(i),n.header&&(a.push(`| ${e.map((s,o)=>s.padEnd(t[o])).join(" | ")} |`),a.push(i));for(let s of r)a.push(`| ${s.map((o,f)=>u(o,n.nullValue).padEnd(t[f])).join(" | ")} |`);return a.push(i),`${a.join(`
11
- `)}
12
- `}function P(e,r,n){if(e.length===0)return"";let t=[];n.header&&(t.push(`| ${e.join(" | ")} |`),t.push(`|${e.map(()=>"---").join("|")}|`));for(let a of r)t.push(`| ${a.map(i=>u(i,n.nullValue)).join(" | ")} |`);return t.length>0?`${t.join(`
13
- `)}
14
- `:""}function R(e,r,n){let t=[];n.header&&e.length>0&&t.push(e.join(" "));for(let a of r)t.push(a.map(i=>u(i,n.nullValue)).join(" "));return t.length>0?`${t.join(n.newline)}${n.newline}`:""}function F(e,r,n){if(e.length===0)return"";let t=e.map(i=>i.length);for(let i of r)for(let s=0;s<i.length;s++){let o=u(i[s],n.nullValue).length;o>t[s]&&(t[s]=o)}let a=[];a.push(`\u250C${t.map(i=>"\u2500".repeat(i+2)).join("\u252C")}\u2510`),a.push(`\u2502 ${e.map((i,s)=>i.padEnd(t[s])).join(" \u2502 ")} \u2502`),a.push(`\u251C${t.map(i=>"\u2500".repeat(i+2)).join("\u253C")}\u2524`);for(let i of r)a.push(`\u2502 ${i.map((s,o)=>u(s,n.nullValue).padEnd(t[o])).join(" \u2502 ")} \u2502`);return a.push(`\u2514${t.map(i=>"\u2500".repeat(i+2)).join("\u2534")}\u2518`),`${a.join(`
15
- `)}
16
- `}function Q(e,r,n){let t=[];n.header&&e.length>0&&t.push(e.map(a=>`'${a}'`).join(","));for(let a of r)t.push(a.map(i=>i==null?"NULL":typeof i=="number"?Number.isInteger(i)?String(i):T(i):`'${String(i)}'`).join(","));return t.length>0?`${t.join(n.newline)}${n.newline}`:""}function D(e,r,n){let t=[];n.header&&e.length>0&&(t.push(`<TR>${e.map(a=>`<TH>${q(a)}</TH>`).join("")}`),t.push("</TR>"));for(let a of r)t.push(`<TR>${a.map(i=>`<TD>${q(u(i,n.nullValue))}</TD>`).join("")}`),t.push("</TR>");return t.length>0?`${t.join(`
17
- `)}
18
- `:""}function q(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function U(e,r,n){let i=[];n.header&&e.length>0&&i.push(e.join(""));for(let s of r)i.push(s.map(o=>u(o,n.nullValue)).join(""));return i.length>0?i.join("")+"":""}var z=5e3,X={name:"sqlite3",summary:"SQLite database CLI",usage:"sqlite3 [OPTIONS] DATABASE [SQL]",options:["-list output in list mode (default)","-csv output in CSV mode","-json output in JSON mode","-line output in line mode","-column output in column mode","-table output as ASCII table","-markdown output as markdown table","-tabs output in tab-separated mode","-box output in Unicode box mode","-quote output in SQL quote mode","-html output as HTML table","-ascii output in ASCII mode (control chars)","-header show column headers","-noheader hide column headers","-separator SEP field separator for list mode (default: |)","-newline SEP row separator (default: \\n)","-nullvalue TEXT text for NULL values (default: empty)","-readonly open database read-only (no writeback)","-bail stop on first error","-echo print SQL before execution","-cmd COMMAND run SQL command before main SQL","-version show SQLite version","-- end of options","--help show this help"],examples:['sqlite3 :memory: "CREATE TABLE t(x); INSERT INTO t VALUES(1); SELECT * FROM t"','sqlite3 -json data.db "SELECT * FROM users"','sqlite3 -csv -header data.db "SELECT id, name FROM products"','sqlite3 -box data.db "SELECT * FROM users"']};function Y(e){let r={mode:"list",header:!1,separator:"|",newline:`
19
- `,nullValue:"",readonly:!1,bail:!1,echo:!1,cmd:null},n=null,t=null,a=!1,i=!1;for(let s=0;s<e.length;s++){let o=e[s];if(i){n===null?n=o:t===null&&(t=o);continue}if(o==="--")i=!0;else if(o==="-version")a=!0;else if(o==="-list")r.mode="list";else if(o==="-csv")r.mode="csv";else if(o==="-json")r.mode="json";else if(o==="-line")r.mode="line";else if(o==="-column")r.mode="column";else if(o==="-table")r.mode="table";else if(o==="-markdown")r.mode="markdown";else if(o==="-tabs")r.mode="tabs";else if(o==="-box")r.mode="box";else if(o==="-quote")r.mode="quote";else if(o==="-html")r.mode="html";else if(o==="-ascii")r.mode="ascii";else if(o==="-header")r.header=!0;else if(o==="-noheader")r.header=!1;else if(o==="-readonly")r.readonly=!0;else if(o==="-bail")r.bail=!0;else if(o==="-echo")r.echo=!0;else if(o==="-separator"){if(s+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -separator
20
- `,exitCode:1};r.separator=e[++s]}else if(o==="-newline"){if(s+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -newline
21
- `,exitCode:1};r.newline=e[++s]}else if(o==="-nullvalue"){if(s+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -nullvalue
22
- `,exitCode:1};r.nullValue=e[++s]}else if(o==="-cmd"){if(s+1>=e.length)return{stdout:"",stderr:`sqlite3: Error: missing argument to -cmd
23
- `,exitCode:1};r.cmd=e[++s]}else{if(o.startsWith("-"))return{stdout:"",stderr:`sqlite3: Error: unknown option: ${o.startsWith("--")?o.slice(1):o}
24
- Use -help for a list of options.
25
- `,exitCode:1};n===null?n=o:t===null&&(t=o)}}return{options:r,database:n,sql:t,showVersion:a}}async function v(){let e=await p.runTrustedAsync(()=>_()),r=new e.Database;try{let n=r.exec("SELECT sqlite_version()");return n.length>0&&n[0].values.length>0?String(n[0].values[0][0]):"unknown"}finally{r.close()}}function G(){let e=W(H(import.meta.url)),r=w(e,"../../commands/sqlite3/worker.js");if(g(r))return r;let n=w(e,"worker.js");if(g(n))return n;let t=w(e,"../../../dist/commands/sqlite3/worker.js");if(g(t))return t;throw new Error("sqlite3 worker not found. Run 'pnpm build' to compile the worker.")}var K={createWorker(e,r){return new J(e,{workerData:r})}};function Z(e){if(!e||typeof e!="object")return{success:!1,error:"Malformed worker response"};let r=e;return r.type==="security-violation"?{success:!1,error:`Security violation: ${typeof r.violation?.type=="string"?r.violation.type:"unknown"}`}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?Array.isArray(r.results)?typeof r.hasModifications!="boolean"?{success:!1,error:"Malformed worker response: missing hasModifications flag"}:r.dbBuffer!==null&&r.dbBuffer!==void 0&&!(r.dbBuffer instanceof Uint8Array)?{success:!1,error:"Malformed worker response: invalid dbBuffer"}:{success:!0,results:r.results,hasModifications:r.hasModifications,dbBuffer:r.dbBuffer===void 0?null:r.dbBuffer,defenseStats:r.defenseStats}:{success:!1,error:"Malformed worker response: missing results array"}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}async function ee(e,r){try{let n=G();return await new Promise((t,a)=>{let i=p.runTrusted(()=>K.createWorker(n,e)),s=j(()=>{i.terminate(),t({success:!1,error:`Query timeout: execution exceeded ${r}ms limit`})},r);i.on("message",o=>{h(s),t(Z(o))}),i.on("error",o=>{h(s),a(o)}),i.on("exit",o=>{h(s),o!==0&&t({success:!1,error:`Worker exited with code ${o}`})})})}catch(n){throw new Error(`sqlite3 worker failed to load: ${n.message}`)}}var de={name:"sqlite3",async execute(e,r){if(y(e)||e.includes("-help"))return S(X);let n=Y(e);if("exitCode"in n)return n;let{options:t,database:a,sql:i,showVersion:s}=n;if(s)return{stdout:`${await v()}
26
- `,stderr:"",exitCode:0};if(!a)return{stdout:"",stderr:`sqlite3: missing database argument
27
- `,exitCode:1};let o=i||r.stdin.trim();if(t.cmd&&(o=t.cmd+(o?`; ${o}`:"")),!o)return{stdout:"",stderr:`sqlite3: no SQL provided
28
- `,exitCode:1};let f=a===":memory:",m="",b=null;try{f||(m=r.fs.resolvePath(r.cwd,a),await r.fs.exists(m)&&(b=await r.fs.readFileBuffer(m)))}catch(l){return{stdout:"",stderr:`sqlite3: unable to open database "${a}": ${l.message}
29
- `,exitCode:1}}let C=r.limits?.maxSqliteTimeoutMs??z,k={dbBuffer:b,sql:o,options:{bail:t.bail,echo:t.echo}},d;try{d=await ee(k,C)}catch(l){return{stdout:"",stderr:`sqlite3: worker error: ${l.message}
30
- `,exitCode:1}}if(!d.success)return{stdout:"",stderr:`sqlite3: ${d.error}
31
- `,exitCode:1};let L={mode:t.mode,header:t.header,separator:t.separator,newline:t.newline,nullValue:t.nullValue},c="";t.echo&&(c+=`${o}
32
- `);let $=!1;for(let l of d.results)if(l.type==="error"){if(t.bail)return{stdout:c,stderr:`Error: ${l.error}
33
- `,exitCode:1};c+=`Error: ${l.error}
34
- `,$=!0}else l.columns&&l.rows&&(l.rows.length>0||t.header)&&(c+=E(l.columns,l.rows,L));if(d.hasModifications&&!t.readonly&&!f&&m&&d.dbBuffer)try{await r.fs.writeFile(m,d.dbBuffer)}catch(l){return{stdout:c,stderr:`sqlite3: failed to write database: ${l.message}
35
- `,exitCode:1}}return{stdout:c,stderr:"",exitCode:$&&t.bail?1:0}}},ce={name:"sqlite3",flags:[],needsArgs:!0};export{K as a,de as b,ce as c};
@@ -1,9 +0,0 @@
1
- import{a as m,b as h}from"./chunk-74CEPOFO.js";var g={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"]},p={name:"ln",async execute(n,s){if(h(n))return m(g);let l=!1,a=!1,f=!1,t=0;for(;t<n.length&&n[t].startsWith("-");){let e=n[t];if(e==="-s"||e==="--symbolic")l=!0,t++;else if(e==="-f"||e==="--force")a=!0,t++;else if(e==="-v"||e==="--verbose")f=!0,t++;else if(e==="-n"||e==="--no-dereference")t++;else if(/^-[sfvn]+$/.test(e))e.includes("s")&&(l=!0),e.includes("f")&&(a=!0),e.includes("v")&&(f=!0),t++;else if(e==="--"){t++;break}else return{stdout:"",stderr:`ln: invalid option -- '${e.slice(1)}'
2
- `,exitCode:1}}let d=n.slice(t);if(d.length<2)return{stdout:"",stderr:`ln: missing file operand
3
- `,exitCode:1};let i=d[0],r=d[1],o=s.fs.resolvePath(s.cwd,r);if(await s.fs.exists(o))if(a)try{await s.fs.rm(o,{force:!0})}catch{return{stdout:"",stderr:`ln: cannot remove '${r}': Permission denied
4
- `,exitCode:1}}else return{stdout:"",stderr:`ln: failed to create ${l?"symbolic ":""}link '${r}': File exists
5
- `,exitCode:1};try{if(l)await s.fs.symlink(i,o);else{let e=s.fs.resolvePath(s.cwd,i);if(!await s.fs.exists(e))return{stdout:"",stderr:`ln: failed to access '${i}': No such file or directory
6
- `,exitCode:1};await s.fs.link(e,o)}}catch(e){let u=e;return u.message.includes("EPERM")?{stdout:"",stderr:`ln: '${i}': hard link not allowed for directory
7
- `,exitCode:1}:{stdout:"",stderr:`ln: ${u.message}
8
- `,exitCode:1}}let c="";return f&&(c=`'${r}' -> '${i}'
9
- `),{stdout:c,stderr:"",exitCode:0}}},b={name:"ln",flags:[{flag:"-s",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0,minArgs:2};export{p as a,b};
@@ -1,11 +0,0 @@
1
- import{a as c}from"./chunk-NBAARP4B.js";import{a as h}from"./chunk-IPJHKYVM.js";import{a as g,b as p,c as a}from"./chunk-74CEPOFO.js";var v={name:"timeout",summary:"run a command with a time limit",usage:"timeout [OPTION] DURATION COMMAND [ARG]...",description:`Start COMMAND, and kill it if still running after DURATION.
2
-
3
- DURATION is a number with optional suffix:
4
- s - seconds (default)
5
- m - minutes
6
- h - hours
7
- d - days`,options:["-k, --kill-after=DURATION send KILL signal after DURATION if still running","-s, --signal=SIGNAL specify signal to send (default: TERM)"," --preserve-status exit with same status as COMMAND, even on timeout"," --foreground run command in foreground"," --help display this help and exit"]};function w(r){let i=r.match(/^(\d+\.?\d*)(s|m|h|d)?$/);if(!i)return null;let n=parseFloat(i[1]);switch(i[2]||"s"){case"s":return n*1e3;case"m":return n*60*1e3;case"h":return n*60*60*1e3;case"d":return n*24*60*60*1e3;default:return null}}var y={name:"timeout",async execute(r,i){if(p(r))return g(v);let n=!1,s=0;for(let t=0;t<r.length;t++){let e=r[t];if(e==="--preserve-status")n=!0,s=t+1;else if(e==="--foreground")s=t+1;else if(e==="-k"||e==="--kill-after")t++,s=t+1;else if(e.startsWith("--kill-after="))s=t+1;else if(e==="-s"||e==="--signal")t++,s=t+1;else if(e.startsWith("--signal="))s=t+1;else{if(e.startsWith("--")&&e!=="--")return a("timeout",e);if(e.startsWith("-")&&e.length>1&&e!=="--")if(e.startsWith("-k"))s=t+1;else if(e.startsWith("-s"))s=t+1;else return a("timeout",e);else{s=t;break}}}let o=r.slice(s);if(o.length===0)return{stdout:"",stderr:`timeout: missing operand
8
- `,exitCode:1};let l=o[0],u=w(l);if(u===null)return{stdout:"",stderr:`timeout: invalid time interval '${l}'
9
- `,exitCode:1};let m=o.slice(1);if(m.length===0)return{stdout:"",stderr:`timeout: missing operand
10
- `,exitCode:1};if(!i.exec)return{stdout:"",stderr:`timeout: exec not available
11
- `,exitCode:1};let A=h(m),d=new AbortController,x=new Promise(t=>{c(()=>{d.abort(),t({timedOut:!0})},u)}),O=i.exec(A,{cwd:i.cwd,signal:d.signal,stdin:i.stdin}).then(t=>({timedOut:!1,result:t})),f=await Promise.race([x,O]);return f.timedOut?{stdout:"",stderr:"",exitCode:124}:f.result}},D={name:"timeout",flags:[{flag:"-k",type:"value",valueHint:"string"},{flag:"-s",type:"value",valueHint:"string"},{flag:"--preserve-status",type:"boolean"},{flag:"--foreground",type:"boolean"}],needsArgs:!0,minArgs:2};export{y as a,D as b};
@@ -1,6 +0,0 @@
1
- import{a as d}from"./chunk-HWKDQ44K.js";import{a as l}from"./chunk-44UOCSGV.js";var g={recursive:{short:"p",long:"parents",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},k={name:"mkdir",async execute(f,o){let e=d("mkdir",f,g);if(!e.ok)return e.error;let u=e.result.flags.recursive,m=e.result.flags.verbose,i=e.result.positional;if(i.length===0)return{stdout:"",stderr:`mkdir: missing operand
2
- `,exitCode:1};let a="",t="",c=0;for(let r of i)try{let n=o.fs.resolvePath(o.cwd,r);await o.fs.mkdir(n,{recursive:u}),m&&(a+=`mkdir: created directory '${r}'
3
- `)}catch(n){let s=l(n);s.includes("ENOENT")||s.includes("no such file")?t+=`mkdir: cannot create directory '${r}': No such file or directory
4
- `:s.includes("EEXIST")||s.includes("already exists")?t+=`mkdir: cannot create directory '${r}': File exists
5
- `:t+=`mkdir: cannot create directory '${r}': ${s}
6
- `,c=1}return{stdout:a,stderr:t,exitCode:c}}},v={name:"mkdir",flags:[{flag:"-p",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{k as a,v as b};
@@ -1,10 +0,0 @@
1
- import{a as Y}from"./chunk-IJXFPKNC.js";import{a as ne}from"./chunk-IPJHKYVM.js";import{a as te}from"./chunk-YNYSPYQ5.js";import{a as oe,b as pe,c as ce}from"./chunk-EEXR5ZDP.js";import{a as ie,b as le}from"./chunk-74CEPOFO.js";function N(e,t){switch(e.type){case"name":{let n=e.pattern,r=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(r){let s=r[1],o=t.name;if(e.ignoreCase){if(!o.toLowerCase().endsWith(s.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!o.endsWith(s))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,r=t.relativePath,s=n.split("/");for(let i=0;i<s.length-1;i++){let a=s[i];if(a&&a!=="."&&a!==".."&&!a.includes("*")&&!a.includes("?")&&!a.includes("[")){let p=`/${a}/`;if(e.ignoreCase){if(!r.toLowerCase().includes(p.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.includes(p))return{matches:!1,pruned:!1,printed:!1}}}let o=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(o){let i=o[1];if(e.ignoreCase){if(!r.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!r.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(r,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:te(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let r=(Date.now()-t.mtime)/(1e3*60*60*24),s;return e.comparison==="more"?s=r>e.days:e.comparison==="less"?s=r<e.days:s=Math.floor(r)===e.days,{matches:s,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let r;return e.comparison==="more"?r=t.size>n:e.comparison==="less"?r=t.size<n:e.unit==="b"?r=Math.ceil(t.size/512)===e.value:r=t.size===n,{matches:r,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,r=e.mode&511,s;return e.matchType==="exact"?s=n===r:e.matchType==="all"?s=(n&r)===r:s=(n&r)!==0,{matches:s,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let n=N(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1}}case"and":{let n=N(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1};let r=N(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:n.printed||r.printed}}case"or":{let n=N(e.left,t);if(n.matches)return n;let r=N(e.right,t);return{matches:r.matches,pruned:n.pruned||r.pruned,printed:r.printed}}}}function _(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return _(e.expr);case"and":case"or":return _(e.left)||_(e.right)}}function j(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return j(e.expr);case"and":case"or":return j(e.left)||j(e.right);default:return!1}}function fe(e){let t={terminalDirName:null,requiredExtension:null};if(!e)return t;let n=ve(e);if(Ee(e)&&n.length===1){let o=n[0].split("/").filter(i=>i.length>0);if(o.length>=2)for(let i=o.length-2;i>=0;i--){let a=o[i];if(!a.includes("*")&&!a.includes("?")&&!a.includes("[")&&a!=="."&&a!==".."){let p=o[i+1];if(p&&(p.includes("*")||p.includes("?"))){t.terminalDirName=a;let l=p.match(/^\*(\.[a-zA-Z0-9]+)$/);l&&(t.requiredExtension=l[1])}break}}}return t}function ve(e){let t=[],n=r=>{r.type==="path"?t.push(r.pattern):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right))};return n(e),t}function Ee(e){let t=n=>n.type==="type"&&n.fileType==="f"?!0:n.type==="not"?t(n.expr):n.type==="and"||n.type==="or"?t(n.left)||t(n.right):!1;return t(e)}function ue(e){let t=[],n=r=>{r&&(r.type==="newer"?t.push(r.refPath):r.type==="not"?n(r.expr):(r.type==="and"||r.type==="or")&&(n(r.left),n(r.right)))};return n(e),t}function J(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return J(e.expr);case"and":case"or":return J(e.left)&&J(e.right)}}function H(e,t,n,r,s){switch(e.type){case"name":{let o=e.pattern,i=o.match(/^\*(\.[a-zA-Z0-9]+)$/);if(i){let a=i[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t,o,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let o=e.pattern,i=o.split("/");for(let p=0;p<i.length-1;p++){let l=i[p];if(l&&l!=="."&&l!==".."&&!l.includes("*")&&!l.includes("?")&&!l.includes("[")){let d=`/${l}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(d.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(d))return{matches:!1,pruned:!1,printed:!1}}}let a=o.match(/\*(\.[a-zA-Z0-9]+)$/);if(a){let p=a[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(p.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(p))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(n,o,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let o=e.ignoreCase?"i":"";return{matches:te(e.pattern,o).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:r,pruned:!1,printed:!1}:e.fileType==="d"?{matches:s,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"print":return{matches:!0,pruned:!1,printed:!0};case"not":{let o=H(e.expr,t,n,r,s);return{matches:!o.matches,pruned:o.pruned,printed:!1}}case"and":{let o=H(e.left,t,n,r,s);if(!o.matches)return{matches:!1,pruned:o.pruned,printed:!1};let i=H(e.right,t,n,r,s);return{matches:i.matches,pruned:o.pruned||i.pruned,printed:o.printed||i.printed}}case"or":{let o=H(e.left,t,n,r,s);if(o.matches)return o;let i=H(e.right,t,n,r,s);return{matches:i.matches,pruned:o.pruned||i.pruned,printed:i.printed}}default:return{matches:!1,pruned:!1,printed:!1}}}function V(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return V(e.expr);case"and":case"or":return V(e.left)||V(e.right);default:return!1}}function W(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":case"print":return!0;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return W(e.expr);case"and":case"or":return W(e.left)&&W(e.right)}}function he(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!W(e))return se(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:N(e,n).pruned}}function se(e,t){switch(e.type){case"or":{if(W(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(N(e.left,n).pruned)return{shouldPrune:!0}}return se(e.right,t)}case"and":{if(W(e.left)&&W(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:N(e,n).pruned}}if(W(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return N(e.left,n).matches?se(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function de(e,t){let n=[],r=[],s=t;for(;s<e.length;){let i=e[s];if(i==="("||i==="\\("){n.push({type:"lparen"}),s++;continue}if(i===")"||i==="\\)"){n.push({type:"rparen"}),s++;continue}if(i==="-name"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s]}});else if(i==="-iname"&&s+1<e.length)n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}});else if(i==="-path"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s]}});else if(i==="-ipath"&&s+1<e.length)n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}});else if(i==="-regex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}});else if(i==="-iregex"&&s+1<e.length)n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}});else if(i==="-type"&&s+1<e.length){let a=e[++s];if(a==="f"||a==="d")n.push({type:"expr",expr:{type:"type",fileType:a}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${a}
2
- `,actions:[]}}else if(i==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(i==="-mtime"&&s+1<e.length){let a=e[++s],p="exact",l=a;a.startsWith("+")?(p="more",l=a.slice(1)):a.startsWith("-")&&(p="less",l=a.slice(1));let d=parseInt(l,10);Number.isNaN(d)||n.push({type:"expr",expr:{type:"mtime",days:d,comparison:p}})}else if(i==="-newer"&&s+1<e.length){let a=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:a}})}else if(i==="-size"&&s+1<e.length){let a=e[++s],p="exact",l=a;a.startsWith("+")?(p="more",l=a.slice(1)):a.startsWith("-")&&(p="less",l=a.slice(1));let d=l.match(/^(\d+)([ckMGb])?$/);if(d){let B=parseInt(d[1],10),I=d[2]||"b";n.push({type:"expr",expr:{type:"size",value:B,unit:I,comparison:p}})}}else if(i==="-perm"&&s+1<e.length){let a=e[++s],p="exact",l=a;a.startsWith("-")?(p="all",l=a.slice(1)):a.startsWith("/")&&(p="any",l=a.slice(1));let d=parseInt(l,8);Number.isNaN(d)||n.push({type:"expr",expr:{type:"perm",mode:d,matchType:p}})}else if(i==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(i==="-not"||i==="!")n.push({type:"not"});else if(i==="-o"||i==="-or")n.push({type:"op",op:"or"});else if(i==="-a"||i==="-and")n.push({type:"op",op:"and"});else if(i==="-maxdepth"||i==="-mindepth")s++;else if(i!=="-depth")if(i==="-exec"){let a=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)a.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n",actions:[]};let p=e[s]==="+";r.push({type:"exec",command:a,batchMode:p})}else if(i==="-print")n.push({type:"expr",expr:{type:"print"}}),r.push({type:"print"});else if(i==="-print0")r.push({type:"print0"});else if(i==="-printf"&&s+1<e.length){let a=e[++s];r.push({type:"printf",format:a})}else if(i==="-delete")r.push({type:"delete"});else{if(i.startsWith("-"))return{expr:null,pathIndex:s,error:`find: unknown predicate '${i}'
3
- `,actions:[]};if(n.length===0){s++;continue}break}s++}if(n.length===0)return{expr:null,pathIndex:s,actions:r};let o=Me(n);return o.error?{expr:null,pathIndex:s,error:o.error,actions:r}:{expr:o.expr,pathIndex:s,actions:r}}function Me(e){let t=0;function n(){let a=r();if(!a)return null;for(;t<e.length;){let p=e[t];if(p.type==="op"&&p.op==="or"){t++;let l=r();if(!l)return a;a={type:"or",left:a,right:l}}else break}return a}function r(){let a=s();if(!a)return null;for(;t<e.length;){let p=e[t];if(p.type==="op"&&p.op==="and"){t++;let l=s();if(!l)return a;a={type:"and",left:a,right:l}}else if(p.type==="expr"||p.type==="not"||p.type==="lparen"){let l=s();if(!l)return a;a={type:"and",left:a,right:l}}else break}return a}function s(){if(t<e.length&&e[t].type==="not"){t++;let a=s();return a?{type:"not",expr:a}:null}return o()}function o(){if(t>=e.length)return null;let a=e[t];if(a.type==="lparen"){t++;let p=n();return t<e.length&&e[t].type==="rparen"&&t++,p}return a.type==="expr"?(t++,a.expr):(a.type==="rparen",null)}return{expr:n()}}var me=500;function xe(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function Fe(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}var Ie={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},$e=new Set(["-name","-iname","-path","-ipath","-regex","-iregex","-type","-maxdepth","-mindepth","-mtime","-newer","-size","-perm"]),_e={name:"find",async execute(e,t){if(le(e))return ie(Ie);let n=[],r=null,s=null,o=!1,i=!1;for(let c=0;c<e.length;c++){let f=e[c];if(f==="-maxdepth"&&c+1<e.length)i=!0,r=parseInt(e[++c],10);else if(f==="-mindepth"&&c+1<e.length)i=!0,s=parseInt(e[++c],10);else if(f==="-depth")i=!0,o=!0;else if(f==="-exec")for(i=!0,c++;c<e.length&&e[c]!==";"&&e[c]!=="+";)c++;else!f.startsWith("-")&&f!==";"&&f!=="+"&&f!=="("&&f!==")"&&f!=="\\("&&f!=="\\)"&&f!=="!"?i||n.push(f):$e.has(f)?(i=!0,c++):(f.startsWith("-")||f==="("||f==="\\("||f==="!")&&(i=!0)}n.length===0&&n.push(".");let{expr:a,error:p,actions:l}=de(e,0);if(p)return{stdout:"",stderr:p,exitCode:1};let d=l.some(c=>c.type==="print"),B=l.length===0,I=[],ye=l.some(c=>c.type==="printf"),re=[],q="",G=0,ge=ue(a),U=new Map;for(let c of ge){let f=t.fs.resolvePath(t.cwd,c);try{let h=await t.fs.stat(f);U.set(c,h.mtime?.getTime()??Date.now())}catch{}}let we=l.some(c=>{if(c.type!=="printf")return!1;let f=c.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),De=_(a)||we,Te=j(a),K=fe(a),ae=V(a),Ce=J(a),Pe=typeof t.fs.readdirWithFileTypes=="function";for(let c of n){let z=function(u){let R=s===null||u.depth>=s,P=!1;if(R&&a!==null){let S=Date.now(),y;if(Ce)y=H(a,u.name,u.relativePath,u.isFile,u.isDirectory);else{let m={name:u.name,relativePath:u.relativePath,isFile:u.isFile,isDirectory:u.isDirectory,isEmpty:u.isEmpty,mtime:u.stat?.mtime?.getTime()??Date.now(),size:u.stat?.size??0,mode:u.stat?.mode??420,newerRefTimes:U};y=N(a,m)}R=y.matches,P=d?y.printed:R,h.evalCalls++,h.evalTime+=Date.now()-S}else R&&(P=!0);return P?{print:!0,printfData:ye?{path:u.relativePath,name:u.name,size:u.stat?.size??0,mtime:u.stat?.mtime?.getTime()??Date.now(),mode:u.stat?.mode??420,isDirectory:u.isDirectory,depth:u.depth,startingPoint:c}:null}:{print:!1,printfData:null}};var We=z;c.length>1&&c.endsWith("/")&&(c=c.slice(0,-1));let f=t.fs.resolvePath(t.cwd,c);try{await t.fs.stat(f)}catch{q+=`find: ${c}: No such file or directory
4
- `,G=1;continue}let h=xe(),$=Date.now();async function v(u){let{path:b,depth:R,typeInfo:P}=u;if(h.nodeCount++,R>(r??256))return null;let E,S,y;if(P&&!De)E=P.isFile,S=P.isDirectory;else{try{let L=Date.now();y=await t.fs.stat(b),h.statCalls++,h.statTime+=Date.now()-L}catch{return null}if(!y)return null;E=y.isFile,S=y.isDirectory}let m;b===f?m=c.split("/").pop()||c:m=b.split("/").pop()||"";let g=b===f?c:c==="."?`./${b.slice(f==="/"?f.length:f.length+1)}`:c+b.slice(f.length),T=[],C=null,w=null,D=!1;S&&ae&&!o&&(D=he(a,{name:m,relativePath:g,isFile:E,isDirectory:S}).shouldPrune,D&&h.earlyPrunes++);let x=R>=(r??256),F=K.terminalDirName!==null&&m===K.terminalDirName,Z=!x&&!F&&!D;if(S&&((Z||Te||F)&&!D)){let L=Date.now();if(Pe&&t.fs.readdirWithFileTypes){if(C=await t.fs.readdirWithFileTypes(b),w=C.map(M=>M.name),h.readdirCalls++,h.readdirTime+=Date.now()-L,Z)T=C.map((M,k)=>({path:b==="/"?`/${M.name}`:`${b}/${M.name}`,depth:R+1,typeInfo:{isFile:M.isFile,isDirectory:M.isDirectory},resultIndex:k}));else if(F){let M=K.requiredExtension;T=C.filter(k=>k.isFile&&(!M||k.name.endsWith(M))).map((k,be)=>({path:b==="/"?`/${k.name}`:`${b}/${k.name}`,depth:R+1,typeInfo:{isFile:k.isFile,isDirectory:k.isDirectory},resultIndex:be}))}}else w=await t.fs.readdir(b),h.readdirCalls++,h.readdirTime+=Date.now()-L,Z&&(T=w.map((M,k)=>({path:b==="/"?`/${M}`:`${b}/${M}`,depth:R+1,resultIndex:k})))}let Q=E?(y?.size??0)===0:w!==null&&w.length===0,O=D;if(!o&&a!==null&&!D&&ae){let L=Date.now(),M={name:m,relativePath:g,isFile:E,isDirectory:S,isEmpty:Q,mtime:y?.mtime?.getTime()??Date.now(),size:y?.size??0,mode:y?.mode??420,newerRefTimes:U};O=N(a,M).pruned,h.evalCalls++,h.evalTime+=Date.now()-L}return{relativePath:g,name:m,isFile:E,isDirectory:S,isEmpty:Q,stat:y,depth:R,children:O?[]:T,pruned:O}}async function Se(){let u={paths:[],printfData:[]};if(o){let y=function(m){let g={paths:[],printfData:[]},T=P[m];if(!T)return g;for(let D of T.childIndices){let x=y(D);g.paths.push(...x.paths),g.printfData.push(...x.printfData)}let{print:C,printfData:w}=z(T.node);return C&&(g.paths.push(T.node.relativePath),w&&g.printfData.push(w)),g};var b=y;let P=[],E=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],S=new Map;for(;E.length>0;){let m=Date.now(),g=E.splice(0,me),T=await Promise.all(g.map(C=>v(C.item)));h.batchCount++,h.batchTime+=Date.now()-m;for(let C=0;C<g.length;C++){let w=T[C],D=g[C];if(!w)continue;let x=P.length;if(D.parentIndex>=0){let F=S.get(D.parentIndex)||[];F.push(x),S.set(D.parentIndex,F)}P.push({node:w,parentIndex:D.parentIndex,childIndices:[]});for(let F=0;F<w.children.length;F++)E.push({item:w.children[F],parentIndex:x,childOrderInParent:F})}}for(let[m,g]of S)m>=0&&m<P.length&&(P[m].childIndices=g);if(P.length>0){let m=y(0);u.paths.push(...m.paths),u.printfData.push(...m.printfData)}}else{let m=function(g){let T=P.get(g);T&&(u.paths.push(T.path),T.printfData&&u.printfData.push(T.printfData));let C=y.get(g);if(C)for(let w of C)m(w)};var R=m;let P=new Map,E=0,S=[{item:{path:f,depth:0,resultIndex:0},orderIndex:E++}],y=new Map;for(;S.length>0;){let g=Date.now(),T=S.splice(0,me),C=await Promise.all(T.map(async({item:w,orderIndex:D})=>{let x=await v(w);return x?{node:x,orderIndex:D}:null}));h.batchCount++,h.batchTime+=Date.now()-g;for(let w of C){if(!w)continue;let{node:D,orderIndex:x}=w,{print:F,printfData:Z}=z(D);if(F&&P.set(x,{path:D.relativePath,printfData:Z}),D.children.length>0){let ee=[];for(let Q of D.children){let O=E++;ee.push(O),S.push({item:Q,orderIndex:O})}y.set(x,ee)}}}m(0)}return u}let X=await Se();if(I.push(...X.paths),re.push(...X.printfData),t.trace){let u=Date.now()-$;Fe(t.trace,h,u),t.trace({category:"find",name:"searchPath",durationMs:u,details:{path:c,resultsFound:X.paths.length}})}}let A="";if(l.length>0)for(let c of l)switch(c.type){case"print":A+=I.length>0?`${I.join(`
5
- `)}
6
- `:"";break;case"print0":A+=I.length>0?`${I.join("\0")}\0`:"";break;case"delete":{let f=[...I].sort((h,$)=>$.length-h.length);for(let h of f){let $=t.fs.resolvePath(t.cwd,h);try{await t.fs.rm($,{recursive:!1})}catch(v){let z=v instanceof Error?v.message:String(v);q+=`find: cannot delete '${h}': ${z}
7
- `,G=1}}break}case"printf":for(let f of re)A+=Re(c.format,f);break;case"exec":if(!t.exec)return{stdout:"",stderr:`find: -exec not supported in this context
8
- `,exitCode:1};if(c.batchMode){let f=[];for(let v of c.command)v==="{}"?f.push(...I):f.push(v);let h=ne(f),$=await t.exec(h,{cwd:t.cwd,signal:t.signal});A+=$.stdout,q+=$.stderr,$.exitCode!==0&&(G=$.exitCode)}else for(let f of I){let h=c.command.map(z=>z==="{}"?f:z),$=ne(h),v=await t.exec($,{cwd:t.cwd,signal:t.signal});A+=v.stdout,q+=v.stderr,v.exitCode!==0&&(G=v.exitCode)}break}else B&&(A=I.length>0?`${I.join(`
9
- `)}
10
- `:"");return{stdout:A,stderr:q,exitCode:G}}};function Re(e,t){let n=ce(e),r="",s=0;for(;s<n.length;)if(n[s]==="%"&&s+1<n.length){if(s++,n[s]==="%"){r+="%",s++;continue}let[o,i,a]=pe(n,s);if(s+=a,s>=n.length){r+="%";break}let p=n[s],l;switch(p){case"f":l=t.name,s++;break;case"h":{let d=t.path.lastIndexOf("/");l=d>0?t.path.slice(0,d):".",s++;break}case"p":l=t.path,s++;break;case"P":{let d=t.startingPoint;t.path===d?l="":t.path.startsWith(`${d}/`)?l=t.path.slice(d.length+1):d==="."&&t.path.startsWith("./")?l=t.path.slice(2):l=t.path,s++;break}case"s":l=String(t.size),s++;break;case"d":l=String(t.depth),s++;break;case"m":l=(t.mode&511).toString(8),s++;break;case"M":l=ke(t.mode,t.isDirectory),s++;break;case"t":{let d=new Date(t.mtime);l=Ne(d),s++;break}case"T":{if(s+1<n.length){let d=n[s+1],B=new Date(t.mtime);l=ze(B,d),s+=2}else l="%T",s++;break}default:r+=`%${o!==0||i!==-1?`${o}.${i}`:""}${p}`,s++;continue}r+=oe(l,o,i)}else r+=n[s],s++;return r}function ke(e,t){let n=e&511,r=t?"d":"-";return r+=n&256?"r":"-",r+=n&128?"w":"-",r+=n&64?"x":"-",r+=n&32?"r":"-",r+=n&16?"w":"-",r+=n&8?"x":"-",r+=n&4?"r":"-",r+=n&2?"w":"-",r+=n&1?"x":"-",r}function Ne(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=t[e.getDay()],s=n[e.getMonth()],o=String(e.getDate()).padStart(2," "),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),p=String(e.getSeconds()).padStart(2,"0"),l=e.getFullYear();return`${r} ${s} ${o} ${i}:${a}:${p} ${l}`}function ze(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var je={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0};export{_e as a,je as b};
@@ -1,13 +0,0 @@
1
- import{e as m}from"./chunk-NBAARP4B.js";import{a as p}from"./chunk-IPJHKYVM.js";import{a as c}from"./chunk-OJDRYQWQ.js";var M={name:"time",async execute(r,i){let a="%e %M",o=null,f=!1,u=!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'
2
- `,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'
3
- `,exitCode:1};o=r[t],t++}else if(e==="-a"||e==="--append")f=!0,t++;else if(e==="-v"||e==="--verbose")a=`Command being timed: %C
4
- Elapsed (wall clock) time: %e seconds
5
- Maximum resident set size (kbytes): %M`,t++;else if(e==="-p"||e==="--portability")u=!0,t++;else if(e==="--"){t++;break}else if(e.startsWith("-"))t++;else break}let l=r.slice(t);if(l.length===0)return{stdout:"",stderr:"",exitCode:0};let g=m(),h=p(l),w=l.join(" "),s;try{if(!i.exec)return{stdout:"",stderr:`time: exec not available
6
- `,exitCode:1};s=await i.exec(h,{env:c(i.env),cwd:i.cwd,stdin:i.stdin,signal:i.signal})}catch(e){s={stdout:"",stderr:`time: ${e.message}
7
- `,exitCode:127}}let d=(m()-g)/1e3,n;if(u?n=`real ${d.toFixed(2)}
8
- user 0.00
9
- sys 0.00
10
- `:(n=a.replace(/%e/g,d.toFixed(2)).replace(/%E/g,F(d)).replace(/%M/g,"0").replace(/%S/g,"0.00").replace(/%U/g,"0.00").replace(/%P/g,"0%").replace(/%C/g,w),n.endsWith(`
11
- `)||(n+=`
12
- `)),o)try{let e=i.fs.resolvePath(i.cwd,o);if(f&&await i.fs.exists(e)){let C=await i.fs.readFile(e);await i.fs.writeFile(e,C+n)}else await i.fs.writeFile(e,n)}catch(e){return{stdout:s.stdout,stderr:s.stderr+`time: cannot write to '${o}': ${e.message}
13
- `,exitCode:s.exitCode}}else s={...s,stderr:s.stderr+n};return s}};function F(r){let i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i>0?`${i}:${a.toString().padStart(2,"0")}:${o.toFixed(2).padStart(5,"0")}`:`${a}:${o.toFixed(2).padStart(5,"0")}`}var S={name:"time",flags:[{flag:"-p",type:"boolean"}],needsArgs:!0};export{M as a,S as b};
@@ -1,25 +0,0 @@
1
- import{d as w}from"./chunk-7MKBHGLS.js";import{a as b}from"./chunk-44UOCSGV.js";import{a as T,b as y,c as f}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";function u(s){let t=s.indexOf("=");if(t>=0){let r=s.slice(0,t),e=s.slice(t+1);return r?`${encodeURIComponent(r)}=${encodeURIComponent(e)}`:encodeURIComponent(e)}return encodeURIComponent(s)}function c(s){let t=s.indexOf("=");if(t<0)return null;let r=s.slice(0,t),e=s.slice(t+1),i,o,a=e.match(/;type=([^;]+)$/);a&&(o=a[1],e=e.slice(0,-a[0].length));let n=e.match(/;filename=([^;]+)/);return n&&(i=n[1],e=e.replace(n[0],"")),(e.startsWith("@")||e.startsWith("<"))&&(i=i??e.slice(1).split("/").pop()),{name:r,value:e,filename:i,contentType:o}}function O(s,t){let r=`----CurlFormBoundary${Date.now().toString(36)}`,e=[];for(let i of s){let o=i.value;if(o.startsWith("@")||o.startsWith("<")){let n=o.slice(1);o=t.get(n)??""}let a=`--${r}\r
2
- `;i.filename?(a+=`Content-Disposition: form-data; name="${i.name}"; filename="${i.filename}"\r
3
- `,i.contentType&&(a+=`Content-Type: ${i.contentType}\r
4
- `)):a+=`Content-Disposition: form-data; name="${i.name}"\r
5
- `,a+=`\r
6
- ${o}\r
7
- `,e.push(a)}return e.push(`--${r}--\r
8
- `),{body:e.join(""),boundary:r}}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-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data"," --data-urlencode DATA URL-encode and POST data","-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","-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 E(s){let t={method:"GET",headers:Object.create(null),dataBinary:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1};for(let r=0;r<s.length;r++){let e=s[r];if(e==="-X"||e==="--request")t.method=s[++r]??"GET";else if(e.startsWith("-X"))t.method=e.slice(2);else if(e.startsWith("--request="))t.method=e.slice(10);else if(e==="-H"||e==="--header"){let i=s[++r];if(i){let o=i.indexOf(":");if(o>0){let a=i.slice(0,o).trim(),n=i.slice(o+1).trim();t.headers[a]=n}}}else if(e.startsWith("--header=")){let i=e.slice(9),o=i.indexOf(":");if(o>0){let a=i.slice(0,o).trim(),n=i.slice(o+1).trim();t.headers[a]=n}}else if(e==="-d"||e==="--data"||e==="--data-raw")t.data=s[++r]??"",t.method==="GET"&&(t.method="POST");else if(e.startsWith("-d"))t.data=e.slice(2),t.method==="GET"&&(t.method="POST");else if(e.startsWith("--data="))t.data=e.slice(7),t.method==="GET"&&(t.method="POST");else if(e.startsWith("--data-raw="))t.data=e.slice(11),t.method==="GET"&&(t.method="POST");else if(e==="--data-binary")t.data=s[++r]??"",t.dataBinary=!0,t.method==="GET"&&(t.method="POST");else if(e.startsWith("--data-binary="))t.data=e.slice(14),t.dataBinary=!0,t.method==="GET"&&(t.method="POST");else if(e==="--data-urlencode"){let i=s[++r]??"";t.data=(t.data?`${t.data}&`:"")+u(i),t.method==="GET"&&(t.method="POST")}else if(e.startsWith("--data-urlencode=")){let i=e.slice(17);t.data=(t.data?`${t.data}&`:"")+u(i),t.method==="GET"&&(t.method="POST")}else if(e==="-F"||e==="--form"){let i=s[++r]??"",o=c(i);o&&t.formFields.push(o),t.method==="GET"&&(t.method="POST")}else if(e.startsWith("--form=")){let i=e.slice(7),o=c(i);o&&t.formFields.push(o),t.method==="GET"&&(t.method="POST")}else if(e==="-u"||e==="--user")t.user=s[++r];else if(e.startsWith("-u"))t.user=e.slice(2);else if(e.startsWith("--user="))t.user=e.slice(7);else if(e==="-A"||e==="--user-agent")t.headers["User-Agent"]=s[++r]??"";else if(e.startsWith("-A"))t.headers["User-Agent"]=e.slice(2);else if(e.startsWith("--user-agent="))t.headers["User-Agent"]=e.slice(13);else if(e==="-e"||e==="--referer")t.headers.Referer=s[++r]??"";else if(e.startsWith("-e"))t.headers.Referer=e.slice(2);else if(e.startsWith("--referer="))t.headers.Referer=e.slice(10);else if(e==="-b"||e==="--cookie")t.headers.Cookie=s[++r]??"";else if(e.startsWith("-b"))t.headers.Cookie=e.slice(2);else if(e.startsWith("--cookie="))t.headers.Cookie=e.slice(9);else if(e==="-c"||e==="--cookie-jar")t.cookieJar=s[++r];else if(e.startsWith("--cookie-jar="))t.cookieJar=e.slice(13);else if(e==="-T"||e==="--upload-file")t.uploadFile=s[++r],t.method==="GET"&&(t.method="PUT");else if(e.startsWith("--upload-file="))t.uploadFile=e.slice(14),t.method==="GET"&&(t.method="PUT");else if(e==="-m"||e==="--max-time"){let i=parseFloat(s[++r]??"0");!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(e.startsWith("--max-time=")){let i=parseFloat(e.slice(11));!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(e==="--connect-timeout"){let i=parseFloat(s[++r]??"0");!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(e.startsWith("--connect-timeout=")){let i=parseFloat(e.slice(18));!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(e==="-o"||e==="--output")t.outputFile=s[++r];else if(e.startsWith("--output="))t.outputFile=e.slice(9);else if(e==="-O"||e==="--remote-name")t.useRemoteName=!0;else if(e==="-I"||e==="--head")t.headOnly=!0,t.method="HEAD";else if(e==="-i"||e==="--include")t.includeHeaders=!0;else if(e==="-s"||e==="--silent")t.silent=!0;else if(e==="-S"||e==="--show-error")t.showError=!0;else if(e==="-f"||e==="--fail")t.failSilently=!0;else if(e==="-L"||e==="--location")t.followRedirects=!0;else if(e==="--max-redirs")r++;else if(!e.startsWith("--max-redirs="))if(e==="-w"||e==="--write-out")t.writeOut=s[++r];else if(e.startsWith("--write-out="))t.writeOut=e.slice(12);else if(e==="-v"||e==="--verbose")t.verbose=!0;else{if(e.startsWith("--")&&e!=="--")return f("curl",e);if(e.startsWith("-")&&e!=="-")for(let i of e.slice(1))switch(i){case"s":t.silent=!0;break;case"S":t.showError=!0;break;case"f":t.failSilently=!0;break;case"L":t.followRedirects=!0;break;case"I":t.headOnly=!0,t.method="HEAD";break;case"i":t.includeHeaders=!0;break;case"O":t.useRemoteName=!0;break;case"v":t.verbose=!0;break;default:return f("curl",`-${i}`)}else e.startsWith("-")||(t.url=e)}}return t}function m(s){return Object.entries(s).map(([t,r])=>`${t}: ${r}`).join(`\r
9
- `)}function P(s){try{return new URL(s).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function h(s,t){let r=s;return r=r.replace(/%\{http_code\}/g,String(t.status)),r=r.replace(/%\{content_type\}/g,t.headers["content-type"]||""),r=r.replace(/%\{url_effective\}/g,t.url),r=r.replace(/%\{size_download\}/g,String(t.bodyLength)),r=r.replace(/\\n/g,`
10
- `),r}async function F(s,t){if(s.uploadFile){let r=t.fs.resolvePath(t.cwd,s.uploadFile);return{body:await t.fs.readFile(r)}}if(s.formFields.length>0){let r=new Map;for(let o of s.formFields)if(o.value.startsWith("@")||o.value.startsWith("<")){let a=t.fs.resolvePath(t.cwd,o.value.slice(1));try{let n=await t.fs.readFile(a);r.set(o.value.slice(1),n)}catch{r.set(o.value.slice(1),"")}}let{body:e,boundary:i}=O(s.formFields,r);return{body:e,contentType:`multipart/form-data; boundary=${i}`}}return s.data!==void 0?{body:s.data}:{}}function W(s,t){let r=w(s.headers??{});if(s.user){let e=Buffer.from(s.user).toString("base64");r.Authorization=`Basic ${e}`}return t&&!r["Content-Type"]&&(r["Content-Type"]=t),r}async function $(s,t,r){if(!s.cookieJar)return;let e=t["set-cookie"];if(!e)return;let i=r.fs.resolvePath(r.cwd,s.cookieJar);await r.fs.writeFile(i,e)}function k(s,t,r){let e="";if(s.verbose){e+=`> ${s.method} ${r}
11
- `;for(let[i,o]of Object.entries(s.headers))e+=`> ${i}: ${o}
12
- `;e+=`>
13
- `,e+=`< HTTP/1.1 ${t.status} ${t.statusText}
14
- `;for(let[i,o]of Object.entries(t.headers))e+=`< ${i}: ${o}
15
- `;e+=`<
16
- `}return s.includeHeaders&&!s.verbose&&(e+=`HTTP/1.1 ${t.status} ${t.statusText}\r
17
- `,e+=m(t.headers),e+=`\r
18
- \r
19
- `),s.headOnly?s.includeHeaders||s.verbose||(e+=`HTTP/1.1 ${t.status} ${t.statusText}\r
20
- `,e+=m(t.headers),e+=`\r
21
- `):e+=t.body,s.writeOut&&(e+=h(s.writeOut,{status:t.status,headers:t.headers,url:t.url,bodyLength:t.body.length})),e}var j={name:"curl",async execute(s,t){if(y(s))return T(S);let r=E(s);if("exitCode"in r)return r;let e=r;if(!e.url)return{stdout:"",stderr:`curl: no URL specified
22
- `,exitCode:2};if(!t.fetch)return{stdout:"",stderr:`curl: internal error: fetch not available
23
- `,exitCode:1};let i=e.url;i.match(/^https?:\/\//)||(i=`https://${i}`);try{let{body:o,contentType:a}=await F(e,t),n=W(e,a),l=await t.fetch(i,{method:e.method,headers:Object.keys(n).length>0?n:void 0,body:o,followRedirects:e.followRedirects,timeoutMs:e.timeoutMs});if(await $(e,l.headers,t),e.failSilently&&l.status>=400)return{stdout:"",stderr:e.showError||!e.silent?`curl: (22) The requested URL returned error: ${l.status}
24
- `:"",exitCode:22};let d=k(e,l,i);if(e.outputFile||e.useRemoteName){let p=e.outputFile||P(i),v=t.fs.resolvePath(t.cwd,p);await t.fs.writeFile(v,e.headOnly?"":l.body),e.verbose||(d=""),e.writeOut&&(d=h(e.writeOut,{status:l.status,headers:l.headers,url:l.url,bodyLength:l.body.length}))}return{stdout:d,stderr:"",exitCode:0}}catch(o){let a=b(o),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:!e.silent||e.showError?`curl: (${n}) ${a}
25
- `:"",exitCode:n}}}};export{j as curlCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-U7QI5ZS5.js";import"./chunk-YNYSPYQ5.js";import"./chunk-DXB73IDG.js";export{a as exprCommand,b as flagsForFuzzing};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-YCABLDKV.js";import"./chunk-IJXFPKNC.js";import"./chunk-IPJHKYVM.js";import"./chunk-YNYSPYQ5.js";import"./chunk-EEXR5ZDP.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as findCommand,b as flagsForFuzzing};
@@ -1 +0,0 @@
1
- import{b as yr}from"./chunk-5CJQNRNJ.js";import{b as Ar}from"./chunk-C6ZZC5FL.js";import{b as $r}from"./chunk-XULIVM35.js";import"./chunk-F55TLFGB.js";import"./chunk-SYMJJMQ4.js";import{c as Sr}from"./chunk-RHOPHAL6.js";import{b as wr}from"./chunk-MDLLFABN.js";import{b as xr}from"./chunk-2GOYXRRP.js";import{b as vr}from"./chunk-A65PWWJC.js";import{b as kr}from"./chunk-MHTUABJP.js";import{b as qr}from"./chunk-4HHKTUW3.js";import{b as Cr}from"./chunk-HJQJAYMS.js";import{b as br}from"./chunk-PP6PSHAB.js";import{d as Ir,e as Mr,f as jr}from"./chunk-LTZRCH7N.js";import{b as tr}from"./chunk-UJIR5V54.js";import{b as lr}from"./chunk-YIY2RKBW.js";import{b as ur}from"./chunk-A7A2DBEE.js";import{b as pr}from"./chunk-U7QI5ZS5.js";import{b as er}from"./chunk-APT7OOP2.js";import{b as dr}from"./chunk-XKQRETAK.js";import{b as cr}from"./chunk-5V6VZH6T.js";import"./chunk-EIZGF4BS.js";import{b as hr}from"./chunk-CR5AFCPT.js";import{c as or,d as ar}from"./chunk-R6QSAL5T.js";import{b as sr}from"./chunk-LL3S3NLB.js";import{c as ir,d as gr}from"./chunk-D6CWQ5DW.js";import{b as mr}from"./chunk-KPFCTJEX.js";import"./chunk-LN5KAJOV.js";import"./chunk-7MKBHGLS.js";import{b as Fr}from"./chunk-QJ7O6ZN3.js";import{b as zr}from"./chunk-TLSUDHID.js";import{b as fr}from"./chunk-D7MEQ3VN.js";import{b as nr}from"./chunk-7BQDVPII.js";import{b as R}from"./chunk-ALLTKNUZ.js";import{b as U}from"./chunk-4Q4SM6WR.js";import{b as V}from"./chunk-XVDPCNWR.js";import{b as W}from"./chunk-RPNGRAAP.js";import{c as X,d as Y}from"./chunk-3RA5L262.js";import{c as Z,d as _}from"./chunk-VOBGTVA6.js";import{b as N}from"./chunk-NCNPKYJZ.js";import{b as rr}from"./chunk-ZSJYNBAF.js";import{b as G}from"./chunk-VJFXDYWH.js";import{b as H}from"./chunk-PYSFUGCK.js";import{b as J}from"./chunk-VYOJP4TV.js";import{b as K}from"./chunk-MYE6AGBJ.js";import{b as L}from"./chunk-LWEGUNWT.js";import{b as O}from"./chunk-A7ICOL4V.js";import{b as P}from"./chunk-55VFSPNA.js";import{b as Q}from"./chunk-YCABLDKV.js";import{b as y}from"./chunk-WKFATFPP.js";import{b as A}from"./chunk-Z7JVV2SM.js";import{b as $}from"./chunk-SDNKECQQ.js";import{b as S}from"./chunk-JVPRLUMK.js";import{b as T}from"./chunk-5BFLZVGH.js";import{b as B}from"./chunk-QCDB2VPH.js";import{b as D}from"./chunk-F23WWYKW.js";import{b as E}from"./chunk-D4J545R4.js";import{b as w}from"./chunk-DCAAORBQ.js";import{b as x}from"./chunk-GXVXFKBA.js";import{b as v}from"./chunk-OFJTSXN6.js";import{d as k,e as q,f as C}from"./chunk-CYTBPLPE.js";import"./chunk-IJXFPKNC.js";import{b}from"./chunk-OKEHYWBE.js";import"./chunk-VLGZJRPG.js";import{b as I}from"./chunk-AOFQVUAD.js";import{b as M}from"./chunk-BAAVD5NO.js";import{b as j}from"./chunk-KMEYNNUA.js";import{b as t}from"./chunk-27LMNKBP.js";import{b as l}from"./chunk-NUYSJFDK.js";import{b as u}from"./chunk-A4JSPFCI.js";import{b as p}from"./chunk-SL4FN3A5.js";import{b as e}from"./chunk-GZ2N3SXD.js";import{b as d}from"./chunk-A4HU7SVR.js";import{b as c}from"./chunk-IKZ5LEGB.js";import{b as h}from"./chunk-64BAICW3.js";import"./chunk-HDQ56CKY.js";import"./chunk-7KHLIOOW.js";import"./chunk-NBAARP4B.js";import"./chunk-IPJHKYVM.js";import"./chunk-OJDRYQWQ.js";import"./chunk-YNYSPYQ5.js";import{b as i}from"./chunk-GCTKCWKD.js";import{b as g}from"./chunk-TXBZCHCQ.js";import"./chunk-7L36YK2X.js";import{b as m}from"./chunk-T56QNPHK.js";import"./chunk-EEXR5ZDP.js";import"./chunk-GFQRA5P5.js";import{b as F}from"./chunk-V7TAPXDL.js";import"./chunk-NUFRM6SI.js";import{b as z}from"./chunk-XZ3MZS57.js";import{b as f}from"./chunk-OCS6LSEM.js";import"./chunk-HWKDQ44K.js";import{b as n}from"./chunk-OCLXQMOG.js";import"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.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 +0,0 @@
1
- import{a,b}from"./chunk-KPFCTJEX.js";import"./chunk-LN5KAJOV.js";import"./chunk-7MKBHGLS.js";import"./chunk-OJDRYQWQ.js";import"./chunk-YNYSPYQ5.js";import"./chunk-7L36YK2X.js";import"./chunk-GFQRA5P5.js";import"./chunk-NUFRM6SI.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as jqCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-SL4FN3A5.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as lnCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-XZ3MZS57.js";import"./chunk-HWKDQ44K.js";import"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as mkdirCommand};
@@ -1,16 +0,0 @@
1
- import{a as A}from"./chunk-BEFDX7IY.js";import{b as _}from"./chunk-7KHLIOOW.js";import{a as D,b as x,c as C,d as h}from"./chunk-NBAARP4B.js";import{a as U}from"./chunk-OJDRYQWQ.js";import{a as I,b as P}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";import{fileURLToPath as b}from"node:url";import{Worker as v}from"node:worker_threads";var c={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,WRITE_STDOUT:100,WRITE_STDERR:101,EXIT:102,HTTP_REQUEST:200},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},r={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},p={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:1048576,TOTAL:1052704},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 L(){return new C(p.TOTAL)}var m=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,r.OP_CODE/4)}setOpCode(t){h.store(this.int32View,r.OP_CODE/4,t)}getStatus(){return h.load(this.int32View,r.STATUS/4)}setStatus(t){h.store(this.int32View,r.STATUS/4,t)}getPathLength(){return h.load(this.int32View,r.PATH_LENGTH/4)}setPathLength(t){h.store(this.int32View,r.PATH_LENGTH/4,t)}getDataLength(){return h.load(this.int32View,r.DATA_LENGTH/4)}setDataLength(t){h.store(this.int32View,r.DATA_LENGTH/4,t)}getResultLength(){return h.load(this.int32View,r.RESULT_LENGTH/4)}setResultLength(t){h.store(this.int32View,r.RESULT_LENGTH/4,t)}getErrorCode(){return h.load(this.int32View,r.ERROR_CODE/4)}setErrorCode(t){h.store(this.int32View,r.ERROR_CODE/4,t)}getFlags(){return h.load(this.int32View,r.FLAGS/4)}setFlags(t){h.store(this.int32View,r.FLAGS/4,t)}getMode(){return h.load(this.int32View,r.MODE/4)}setMode(t){h.store(this.int32View,r.MODE/4,t)}getPath(){let t=this.getPathLength(),e=this.uint8View.slice(r.PATH_BUFFER,r.PATH_BUFFER+t);return new TextDecoder().decode(e)}setPath(t){let e=new TextEncoder().encode(t);if(e.length>p.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${p.PATH_BUFFER}`);this.uint8View.set(e,r.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(r.DATA_BUFFER,r.DATA_BUFFER+t)}setData(t){if(t.length>p.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,r.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(r.DATA_BUFFER,r.DATA_BUFFER+t)}setResult(t){if(t.length>p.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,r.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[r.DATA_BUFFER+u.IS_FILE]=t.isFile?1:0,this.uint8View[r.DATA_BUFFER+u.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[r.DATA_BUFFER+u.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(r.DATA_BUFFER+u.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(r.DATA_BUFFER+u.SIZE,e,!0),this.dataView.setFloat64(r.DATA_BUFFER+u.MTIME,t.mtime.getTime(),!0),this.setResultLength(u.TOTAL)}decodeStat(){return{isFile:this.uint8View[r.DATA_BUFFER+u.IS_FILE]===1,isDirectory:this.uint8View[r.DATA_BUFFER+u.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[r.DATA_BUFFER+u.IS_SYMLINK]===1,mode:this.dataView.getInt32(r.DATA_BUFFER+u.MODE,!0),size:this.dataView.getFloat64(r.DATA_BUFFER+u.SIZE,!0),mtime:new Date(this.dataView.getFloat64(r.DATA_BUFFER+u.MTIME,!0))}}waitForReady(t){return h.wait(this.int32View,r.STATUS/4,a.PENDING,t)}waitForReadyAsync(t){return h.waitAsync(this.int32View,r.STATUS/4,a.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let s=this.getStatus();if(s===a.READY)return!0;let o=Date.now()-e;if(o>=t)return!1;let n=t-o,d=h.waitAsync(this.int32View,r.STATUS/4,s,n);if(d.async&&await d.value==="timed-out")return!1}}waitForResult(t){return h.wait(this.int32View,r.STATUS/4,a.READY,t)}notify(){return h.notify(this.int32View,r.STATUS/4)}reset(){this.setOpCode(c.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 g=class{fs;cwd;secureFetch;maxOutputSize;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;constructor(t,e,s,o=void 0,n=0){this.fs=e,this.cwd=s,this.secureFetch=o,this.maxOutputSize=n,this.protocol=new m(t)}async run(t){this.running=!0;let e=Date.now();for(;this.running;){let s=Date.now()-e;if(s>=t){this.output.stderr+=`
2
- python3: execution timeout exceeded
3
- `,this.output.exitCode=124;break}let o=t-s;if(!await this.protocol.waitUntilReady(o)){this.output.stderr+=`
4
- python3: execution timeout exceeded
5
- `,this.output.exitCode=124;break}let d=this.protocol.getOpCode();await this.handleOperation(d),this.protocol.notify()}return this.output}stop(){this.running=!1}async handleOperation(t){try{switch(t){case c.READ_FILE:await this.handleReadFile();break;case c.WRITE_FILE:await this.handleWriteFile();break;case c.STAT:await this.handleStat();break;case c.LSTAT:await this.handleLstat();break;case c.READDIR:await this.handleReaddir();break;case c.MKDIR:await this.handleMkdir();break;case c.RM:await this.handleRm();break;case c.EXISTS:await this.handleExists();break;case c.APPEND_FILE:await this.handleAppendFile();break;case c.SYMLINK:await this.handleSymlink();break;case c.READLINK:await this.handleReadlink();break;case c.CHMOD:await this.handleChmod();break;case c.REALPATH:await this.handleRealpath();break;case c.WRITE_STDOUT:this.handleWriteStdout();break;case c.WRITE_STDERR:this.handleWriteStderr();break;case c.EXIT:this.handleExit();break;case c.HTTP_REQUEST:await this.handleHttpRequest();break;default:this.protocol.setErrorCode(l.IO_ERROR),this.protocol.setStatus(a.ERROR)}}catch(e){this.setErrorFromException(e)}}resolvePath(t){return this.fs.resolvePath(this.cwd,t)}async handleReadFile(){let t=this.resolvePath(this.protocol.getPath());try{let e=await this.fs.readFileBuffer(t);this.protocol.setResult(e),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleWriteFile(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getData();try{await this.fs.writeFile(t,e),this.protocol.setStatus(a.SUCCESS)}catch(s){this.setErrorFromException(s)}}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.protocol.setResultFromString(JSON.stringify(e)),this.protocol.setStatus(a.SUCCESS)}catch(e){this.setErrorFromException(e)}}async handleMkdir(){let t=this.resolvePath(this.protocol.getPath()),s=(this.protocol.getFlags()&R.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(t,{recursive:s}),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}async handleRm(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),s=(e&R.RECURSIVE)!==0,o=(e&R.FORCE)!==0;try{await this.fs.rm(t,{recursive:s,force:o}),this.protocol.setStatus(a.SUCCESS)}catch(n){this.setErrorFromException(n)}}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(s){this.setErrorFromException(s)}}async handleSymlink(){let t=this.protocol.getPath(),e=this.protocol.getDataAsString(),s=this.resolvePath(t);try{await this.fs.symlink(e,s),this.protocol.setStatus(a.SUCCESS)}catch(o){this.setErrorFromException(o)}}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(s){this.setErrorFromException(s)}}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)}}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=`python3: total output size exceeded (>${this.maxOutputSize} bytes), increase executionLimits.maxOutputSize
6
- `,e=t.length>this.maxOutputSize?t.slice(0,this.maxOutputSize):t;if(this.output.stderr.includes("total output size exceeded"))return;let o=this.output.stdout.length+this.output.stderr.length+e.length-this.maxOutputSize;if(o>0)if(this.output.stdout.length>=o)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-o);else{let n=o-this.output.stdout.length;this.output.stdout="",n>=this.output.stderr.length?this.output.stderr="":this.output.stderr=this.output.stderr.slice(0,this.output.stderr.length-n)}this.output.stderr+=e}async handleHttpRequest(){if(!this.secureFetch){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 t=this.protocol.getPath(),e=this.protocol.getDataAsString();try{let s=e?JSON.parse(e):{},o=await this.secureFetch(t,{method:s.method,headers:s.headers,body:s.body}),n=JSON.stringify({status:o.status,statusText:o.statusText,headers:o.headers,body:o.body,url:o.url});this.protocol.setResultFromString(n),this.protocol.setStatus(a.SUCCESS)}catch(s){let o=A(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(l.NETWORK_ERROR),this.protocol.setResultFromString(o),this.protocol.setStatus(a.ERROR)}}setErrorFromException(t){let e=t instanceof Error?t.message:String(t),s=A(e),o=l.IO_ERROR,n=e.toLowerCase();n.includes("no such file")||n.includes("not found")||n.includes("enoent")?o=l.NOT_FOUND:n.includes("is a directory")||n.includes("eisdir")?o=l.IS_DIRECTORY:n.includes("not a directory")||n.includes("enotdir")?o=l.NOT_DIRECTORY:n.includes("already exists")||n.includes("eexist")?o=l.EXISTS:(n.includes("permission")||n.includes("eperm")||n.includes("eacces"))&&(o=l.PERMISSION_DENIED),this.protocol.setErrorCode(o),this.protocol.setResultFromString(s),this.protocol.setStatus(a.ERROR)}};var B=3e4,H={name:"python3",summary:"Execute Python code via CPython Emscripten",usage:"python3 [OPTIONS] [-c CODE | -m MODULE | FILE] [ARGS...]",description:["Execute Python code using CPython compiled to WebAssembly via Emscripten.","","This command runs Python in an isolated environment with access to","the virtual filesystem. Standard library modules are available."],options:["-c CODE Execute CODE as Python script","-m MODULE Run library module as a script","--version Show Python version","--help Show this help"],examples:['python3 -c "print(1 + 2)"','python3 -c "import sys; print(sys.version)"',"python3 script.py","python3 script.py arg1 arg2",`echo 'print("hello")' | python3`],notes:["CPython runs in WebAssembly, so execution may be slower than native Python.","Standard library modules are available (no pip install).","Maximum execution time is 30 seconds by default."]};function W(i){let t={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(i.length===0)return t;let e=i.findIndex(s=>!s.startsWith("-")||s==="-"||s==="--");for(let s=0;s<(e===-1?i.length:e);s++){let o=i[s];if(o==="-c")return s+1>=i.length?{stdout:"",stderr:`python3: option requires an argument -- 'c'
7
- `,exitCode:2}:(t.code=i[s+1],t.scriptArgs=i.slice(s+2),t);if(o==="-m")return s+1>=i.length?{stdout:"",stderr:`python3: option requires an argument -- 'm'
8
- `,exitCode:2}:(t.module=i[s+1],t.scriptArgs=i.slice(s+2),t);if(o==="--version"||o==="-V")return t.showVersion=!0,t;if(o.startsWith("-")&&o!=="-")return{stdout:"",stderr:`python3: unrecognized option '${o}'
9
- `,exitCode:2}}if(e!==-1){let s=i[e];s==="--"?e+1<i.length&&(t.scriptFile=i[e+1],t.scriptArgs=i.slice(e+2)):(t.scriptFile=s,t.scriptArgs=i.slice(e+1))}return t}var O=new WeakMap;function z(i){let t=O.get(i);return t||(t={executionQueue:[],isExecuting:!1},O.set(i,t)),t}function at(){O=new WeakMap}var G=b(new URL("./worker.js",import.meta.url));function $(i){if(!i||typeof i!="object")return{success:!1,error:"Malformed worker response"};let t=i;return t.type==="security-violation"?{success:!1,error:`Security violation: ${typeof t.violation?.type=="string"?t.violation.type:"unknown"}`}:typeof t.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:t.success?{success:!0}:{success:!1,error:typeof t.error=="string"&&t.error.length>0?t.error:"Worker execution failed"}}function f(i){if(i.isExecuting||i.executionQueue.length===0)return;for(;i.executionQueue.length>0&&i.executionQueue[0].canceled;)i.executionQueue.shift();if(i.executionQueue.length===0)return;let t=i.executionQueue.shift();if(!t)return;i.isExecuting=!0;let e=_.runTrusted(()=>new v(G,{workerData:t.input}));t.workerRef&&(t.workerRef.current=e),e.on("message",s=>{t.resolve($(s)),i.isExecuting=!1,e.terminate(),f(i)}),e.on("error",s=>{t.resolve({success:!1,error:s.message}),i.isExecuting=!1,f(i)}),e.on("exit",()=>{i.isExecuting&&(t.resolve({success:!1,error:"Worker exited unexpectedly"}),i.isExecuting=!1,f(i))})}async function Y(i,t,e,s=[]){let o=L(),n=new g(o,t.fs,t.cwd,t.fetch,t.limits?.maxOutputSize??0),d=t.limits?.maxPythonTimeoutMs??B,w=z(t.fs),N={sharedBuffer:o,pythonCode:i,cwd:t.cwd,env:U(t.env),args:s,scriptPath:e},T={current:null},V=new Promise(E=>{let y={input:N,resolve:()=>{},workerRef:T},M=D(()=>{T.current?T.current.terminate():y.canceled=!0,E({success:!1,error:`Execution timeout: exceeded ${d}ms limit`})},d);y.resolve=k=>{x(M),E(k)},w.executionQueue.push(y),f(w)}),[S,F]=await Promise.all([n.run(d).catch(E=>({stdout:"",stderr:`python3: bridge error: ${E.message}
10
- `,exitCode:1})),V.catch(E=>({success:!1,error:E.message}))]);return!F.success&&F.error?{stdout:S.stdout,stderr:`${S.stderr}python3: ${F.error}
11
- `,exitCode:S.exitCode||1}:S}var K={name:"python3",async execute(i,t){if(P(i))return I(H);let e=W(i);if("exitCode"in e)return e;if(e.showVersion)return{stdout:`Python 3.13.2 (Emscripten)
12
- `,stderr:"",exitCode:0};let s,o;if(e.code!==null)s=e.code,o="-c";else if(e.module!==null){if(!/^[a-zA-Z_][a-zA-Z0-9_.]*$/.test(e.module))return{stdout:"",stderr:`python3: No module named '${e.module.slice(0,200)}'
13
- `,exitCode:1};s=`import runpy; runpy.run_module('${e.module}', run_name='__main__')`,o=e.module}else if(e.scriptFile!==null){let n=t.fs.resolvePath(t.cwd,e.scriptFile);if(!await t.fs.exists(n))return{stdout:"",stderr:`python3: can't open file '${e.scriptFile}': [Errno 2] No such file or directory
14
- `,exitCode:2};try{s=await t.fs.readFile(n),o=e.scriptFile}catch(d){return{stdout:"",stderr:`python3: can't open file '${e.scriptFile}': ${d.message}
15
- `,exitCode:2}}}else if(t.stdin.trim())s=t.stdin,o="<stdin>";else return{stdout:"",stderr:`python3: no input provided (use -c CODE, -m MODULE, or provide a script file)
16
- `,exitCode:2};return Y(s,t,o,e.scriptArgs)}},ht={name:"python",async execute(i,t){return K.execute(i,t)}};export{at as _resetExecutionQueue,K as python3Command,ht as pythonCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-27LMNKBP.js";import"./chunk-HWKDQ44K.js";import"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as rmCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-AOFQVUAD.js";import"./chunk-YNYSPYQ5.js";import"./chunk-GFQRA5P5.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as sedCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-7BQDVPII.js";import"./chunk-NBAARP4B.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as sleepCommand};
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-RHOPHAL6.js";import"./chunk-7KHLIOOW.js";import"./chunk-NBAARP4B.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as _internals,c as flagsForFuzzing,b as sqlite3Command};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-OFJTSXN6.js";import"./chunk-HWKDQ44K.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as statCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-5CJQNRNJ.js";import"./chunk-7KHLIOOW.js";import"./chunk-YNYSPYQ5.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as tarCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-YIY2RKBW.js";import"./chunk-NBAARP4B.js";import"./chunk-IPJHKYVM.js";import"./chunk-OJDRYQWQ.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as timeCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-UJIR5V54.js";import"./chunk-NBAARP4B.js";import"./chunk-IPJHKYVM.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as timeoutCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-5BFLZVGH.js";import"./chunk-HWKDQ44K.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as trCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-XULIVM35.js";import"./chunk-F55TLFGB.js";import"./chunk-SYMJJMQ4.js";import"./chunk-LN5KAJOV.js";import"./chunk-7MKBHGLS.js";import"./chunk-OJDRYQWQ.js";import"./chunk-YNYSPYQ5.js";import"./chunk-7L36YK2X.js";import"./chunk-GFQRA5P5.js";import"./chunk-NUFRM6SI.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as xanCommand};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-C6ZZC5FL.js";import"./chunk-SYMJJMQ4.js";import"./chunk-LN5KAJOV.js";import"./chunk-7MKBHGLS.js";import"./chunk-OJDRYQWQ.js";import"./chunk-YNYSPYQ5.js";import"./chunk-GFQRA5P5.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as yqCommand};