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.
- package/dist/bin/chunks/awk2-4MK3F3NZ.js +2 -0
- package/dist/bin/chunks/{chmod-4O2C4V42.js → chmod-N5CQATDW.js} +1 -1
- package/dist/bin/chunks/chunk-2HDH5VPF.js +12 -0
- package/dist/bin/chunks/chunk-5ATRLST6.js +100 -0
- package/dist/bin/chunks/{chunk-3NVWSLHI.js → chunk-6W7JTG6A.js} +99 -99
- package/dist/bin/chunks/chunk-7ADG3DNO.js +8 -0
- package/dist/bin/chunks/chunk-DERQIX2O.js +36 -0
- package/dist/bin/{shell/chunks/chunk-7SWOLTCR.js → chunks/chunk-EMSJEY2U.js} +1 -1
- package/dist/bin/chunks/{chunk-2SIXTZCJ.js → chunk-EZS766DD.js} +4 -4
- package/dist/bin/chunks/chunk-LWKIHJ5L.js +13 -0
- package/dist/bin/chunks/chunk-MY5PY2PL.js +2 -0
- package/dist/bin/chunks/{chunk-OKL2SPHK.js → chunk-O5B6WWQQ.js} +39 -39
- package/dist/bin/chunks/chunk-OQV5J23L.js +7 -0
- package/dist/bin/chunks/chunk-Q5MYEU7X.js +5 -0
- package/dist/bin/chunks/chunk-QZNF3Y3J.js +2 -0
- package/dist/bin/chunks/chunk-R2LDP472.js +8 -0
- package/dist/bin/chunks/chunk-RDGXTKIB.js +21 -0
- package/dist/bin/chunks/chunk-RS2PRILS.js +10 -0
- package/dist/bin/chunks/chunk-STOAUD75.js +11 -0
- package/dist/bin/chunks/chunk-SXB55JOI.js +2 -0
- package/dist/bin/chunks/chunk-SYG3IW7P.js +2 -0
- package/dist/bin/chunks/chunk-SYL34GE7.js +21 -0
- package/dist/bin/chunks/chunk-UT6LUTWP.js +2 -0
- package/dist/bin/chunks/chunk-VIYJJTN2.js +14 -0
- package/dist/bin/chunks/chunk-W752QGNZ.js +6 -0
- package/dist/bin/chunks/{chunk-435ZOZCY.js → chunk-WWVVJW3F.js} +13 -13
- package/dist/bin/{shell/chunks/chunk-GA6KXSOC.js → chunks/chunk-YFPDB4PH.js} +1 -1
- package/dist/bin/chunks/chunk-YMMJLYIX.js +2 -0
- package/dist/bin/chunks/chunk-YTIURC67.js +2 -0
- package/dist/bin/chunks/chunk-YWZOGBFE.js +9 -0
- package/dist/bin/chunks/chunk-YX7OOTPO.js +9 -0
- package/dist/bin/chunks/chunk-ZRRNCS7N.js +2 -0
- package/dist/bin/chunks/chunk-ZSVBYEY4.js +6 -0
- package/dist/bin/chunks/curl-GIQ5S66Y.js +26 -0
- package/dist/bin/{shell/chunks/expansion-TCB3WZP5.js → chunks/expansion-JBCP2CHQ.js} +1 -1
- package/dist/bin/chunks/expr-VEFRBJT4.js +2 -0
- package/dist/bin/chunks/find-MTLF23HX.js +2 -0
- package/dist/bin/chunks/flag-coverage-NDF6MQAO.js +2 -0
- package/dist/bin/{shell/chunks/grep-F3GT2VPG.js → chunks/grep-OZJTRD4D.js} +1 -1
- package/dist/bin/chunks/jq-F7FJ46VM.js +2 -0
- package/dist/bin/chunks/ln-VAOSD4HK.js +2 -0
- package/dist/bin/chunks/mkdir-CH7JGW4N.js +2 -0
- package/dist/bin/chunks/python3-QBGIYRFR.js +17 -0
- package/dist/bin/{shell/chunks/readlink-YNOUXNUY.js → chunks/readlink-BD5VFOC5.js} +1 -1
- package/dist/bin/chunks/rm-GWYJO4W7.js +2 -0
- package/dist/bin/chunks/sed-ENUQOCBB.js +2 -0
- package/dist/bin/chunks/sleep-5T34UFNF.js +2 -0
- package/dist/bin/chunks/sqlite3-4SBQACEE.js +2 -0
- package/dist/bin/chunks/stat-XS2LXYS2.js +2 -0
- package/dist/bin/chunks/tar-3UIZ4IRM.js +2 -0
- package/dist/bin/chunks/time-GZSHCM77.js +2 -0
- package/dist/bin/chunks/timeout-7ECKKPNP.js +2 -0
- package/dist/bin/chunks/tr-LZF57GYP.js +2 -0
- package/dist/bin/chunks/worker.js +162 -31
- package/dist/bin/chunks/xan-5QTBTP4U.js +2 -0
- package/dist/bin/chunks/yq-O5RSLLA3.js +2 -0
- package/dist/bin/just-bash.js +281 -281
- package/dist/bin/shell/chunks/awk2-4MK3F3NZ.js +2 -0
- package/dist/bin/shell/chunks/{chmod-4O2C4V42.js → chmod-N5CQATDW.js} +1 -1
- package/dist/bin/shell/chunks/chunk-2HDH5VPF.js +12 -0
- package/dist/bin/shell/chunks/chunk-5ATRLST6.js +100 -0
- package/dist/bin/shell/chunks/{chunk-3NVWSLHI.js → chunk-6W7JTG6A.js} +99 -99
- package/dist/bin/shell/chunks/chunk-7ADG3DNO.js +8 -0
- package/dist/bin/shell/chunks/chunk-D64U2VGQ.js +2 -0
- package/dist/bin/shell/chunks/chunk-DERQIX2O.js +36 -0
- package/dist/bin/{chunks/chunk-7SWOLTCR.js → shell/chunks/chunk-EMSJEY2U.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-2SIXTZCJ.js → chunk-EZS766DD.js} +4 -4
- package/dist/bin/shell/chunks/chunk-LWKIHJ5L.js +13 -0
- package/dist/bin/shell/chunks/{chunk-OKL2SPHK.js → chunk-O5B6WWQQ.js} +39 -39
- package/dist/bin/shell/chunks/chunk-OQV5J23L.js +7 -0
- package/dist/bin/shell/chunks/chunk-Q5MYEU7X.js +5 -0
- package/dist/bin/shell/chunks/chunk-QZNF3Y3J.js +2 -0
- package/dist/bin/shell/chunks/chunk-R2LDP472.js +8 -0
- package/dist/bin/shell/chunks/chunk-RDGXTKIB.js +21 -0
- package/dist/bin/shell/chunks/chunk-RS2PRILS.js +10 -0
- package/dist/bin/shell/chunks/chunk-STOAUD75.js +11 -0
- package/dist/bin/shell/chunks/chunk-SXB55JOI.js +2 -0
- package/dist/bin/shell/chunks/chunk-SYG3IW7P.js +2 -0
- package/dist/bin/shell/chunks/chunk-SYL34GE7.js +21 -0
- package/dist/bin/shell/chunks/chunk-UT6LUTWP.js +2 -0
- package/dist/bin/shell/chunks/chunk-VIYJJTN2.js +14 -0
- package/dist/bin/shell/chunks/chunk-W752QGNZ.js +6 -0
- package/dist/bin/shell/chunks/{chunk-435ZOZCY.js → chunk-WWVVJW3F.js} +13 -13
- package/dist/bin/{chunks/chunk-GA6KXSOC.js → shell/chunks/chunk-YFPDB4PH.js} +1 -1
- package/dist/bin/shell/chunks/chunk-YMMJLYIX.js +2 -0
- package/dist/bin/shell/chunks/chunk-YTIURC67.js +2 -0
- package/dist/bin/shell/chunks/chunk-YWZOGBFE.js +9 -0
- package/dist/bin/shell/chunks/chunk-YX7OOTPO.js +9 -0
- package/dist/bin/shell/chunks/chunk-ZRRNCS7N.js +2 -0
- package/dist/bin/shell/chunks/chunk-ZSVBYEY4.js +6 -0
- package/dist/bin/shell/chunks/curl-GIQ5S66Y.js +26 -0
- package/dist/bin/{chunks/expansion-TCB3WZP5.js → shell/chunks/expansion-JBCP2CHQ.js} +1 -1
- package/dist/bin/shell/chunks/expr-VEFRBJT4.js +2 -0
- package/dist/bin/shell/chunks/find-MTLF23HX.js +2 -0
- package/dist/bin/shell/chunks/flag-coverage-NDF6MQAO.js +2 -0
- package/dist/bin/{chunks/grep-F3GT2VPG.js → shell/chunks/grep-OZJTRD4D.js} +1 -1
- package/dist/bin/shell/chunks/jq-F7FJ46VM.js +2 -0
- package/dist/bin/shell/chunks/ln-VAOSD4HK.js +2 -0
- package/dist/bin/shell/chunks/mkdir-CH7JGW4N.js +2 -0
- package/dist/bin/shell/chunks/python3-XN7O5X3A.js +17 -0
- package/dist/bin/{chunks/readlink-YNOUXNUY.js → shell/chunks/readlink-BD5VFOC5.js} +1 -1
- package/dist/bin/shell/chunks/rm-GWYJO4W7.js +2 -0
- package/dist/bin/shell/chunks/sed-ENUQOCBB.js +2 -0
- package/dist/bin/shell/chunks/sleep-5T34UFNF.js +2 -0
- package/dist/bin/shell/chunks/sqlite3-4SBQACEE.js +2 -0
- package/dist/bin/shell/chunks/stat-XS2LXYS2.js +2 -0
- package/dist/bin/shell/chunks/tar-3UIZ4IRM.js +2 -0
- package/dist/bin/shell/chunks/time-GZSHCM77.js +2 -0
- package/dist/bin/shell/chunks/timeout-7ECKKPNP.js +2 -0
- package/dist/bin/shell/chunks/tr-LZF57GYP.js +2 -0
- package/dist/bin/shell/chunks/xan-5QTBTP4U.js +2 -0
- package/dist/bin/shell/chunks/yq-O5RSLLA3.js +2 -0
- package/dist/bin/shell/shell.js +241 -241
- package/dist/bundle/browser.js +718 -721
- package/dist/bundle/chunks/awk2-ID6QVUYU.js +1 -0
- package/dist/bundle/chunks/{chmod-MIKE3OIT.js → chmod-SYMGL4JA.js} +1 -1
- package/dist/bundle/chunks/chunk-2OZNLYX4.js +9 -0
- package/dist/bundle/chunks/{chunk-C6ZZC5FL.js → chunk-3J4BCKUH.js} +99 -99
- package/dist/bundle/chunks/chunk-3ZBKQKTX.js +11 -0
- package/dist/bundle/chunks/chunk-3ZUFRYJ4.js +1 -0
- package/dist/bundle/chunks/chunk-4GTNDTRF.js +7 -0
- package/dist/bundle/chunks/chunk-5QVNJEHU.js +8 -0
- package/dist/bundle/chunks/chunk-64CW2LGZ.js +6 -0
- package/dist/bundle/chunks/chunk-AYQ5FKKK.js +20 -0
- package/dist/bundle/chunks/chunk-C764MECG.js +35 -0
- package/dist/bundle/chunks/{chunk-XULIVM35.js → chunk-CBAJ47B3.js} +1 -1
- package/dist/bundle/chunks/chunk-CCNMISUL.js +1 -0
- package/dist/bundle/chunks/chunk-D2FZX7A2.js +10 -0
- package/dist/bundle/chunks/chunk-EX62JIX3.js +13 -0
- package/dist/bundle/chunks/chunk-FD7SFJNJ.js +4 -0
- package/dist/bundle/chunks/chunk-FGALERPA.js +8 -0
- package/dist/bundle/chunks/chunk-HJWBQKYG.js +5 -0
- package/dist/bundle/chunks/chunk-HOFSUCIB.js +99 -0
- package/dist/bundle/chunks/chunk-IP7G3BNA.js +7 -0
- package/dist/bundle/chunks/chunk-J642UCRS.js +1 -0
- package/dist/bundle/chunks/chunk-L75XCEQX.js +1 -0
- package/dist/bundle/chunks/chunk-QI4EPYAT.js +5 -0
- package/dist/bundle/chunks/chunk-R5XRHEZH.js +12 -0
- package/dist/bundle/chunks/chunk-RH6GWZAJ.js +1 -0
- package/dist/bundle/chunks/{chunk-U7QI5ZS5.js → chunk-RVT3MU3A.js} +4 -4
- package/dist/bundle/chunks/chunk-SJ5LXPUH.js +1 -0
- package/dist/bundle/chunks/{chunk-4VCAQZKQ.js → chunk-TRD56HID.js} +39 -39
- package/dist/bundle/chunks/{chunk-5CJQNRNJ.js → chunk-TVHAURH5.js} +13 -13
- package/dist/bundle/chunks/chunk-X2AJGDEF.js +1 -0
- package/dist/bundle/chunks/chunk-XHM67O4N.js +1 -0
- package/dist/bundle/chunks/chunk-XXZ46GOX.js +20 -0
- package/dist/bundle/chunks/{chunk-CYTBPLPE.js → chunk-YS3AZT3J.js} +1 -1
- package/dist/bundle/chunks/curl-743M564K.js +25 -0
- package/dist/bundle/chunks/{expansion-HJ6B4DDG.js → expansion-XG7G47TX.js} +1 -1
- package/dist/bundle/chunks/expr-74QHYJL5.js +1 -0
- package/dist/bundle/chunks/find-DOIVMX6X.js +1 -0
- package/dist/bundle/chunks/flag-coverage-4M54QHNZ.js +1 -0
- package/dist/bundle/chunks/{grep-LXKUQUAE.js → grep-3AIAIJVR.js} +1 -1
- package/dist/bundle/chunks/jq-5FRYP6YP.js +1 -0
- package/dist/bundle/chunks/ln-UJ6YJVBK.js +1 -0
- package/dist/bundle/chunks/mkdir-F6XHPXZC.js +1 -0
- package/dist/bundle/chunks/python3-WANWDR22.js +16 -0
- package/dist/bundle/chunks/{readlink-IEQO24KU.js → readlink-MI4GCHJF.js} +1 -1
- package/dist/bundle/chunks/rm-FYNVTQIU.js +1 -0
- package/dist/bundle/chunks/sed-TS7M7I25.js +1 -0
- package/dist/bundle/chunks/sleep-RRZXXEW2.js +1 -0
- package/dist/bundle/chunks/sqlite3-IH5QMEIK.js +1 -0
- package/dist/bundle/chunks/stat-BT5A227F.js +1 -0
- package/dist/bundle/chunks/tar-JCULQ5J2.js +1 -0
- package/dist/bundle/chunks/time-XL42Z4U5.js +1 -0
- package/dist/bundle/chunks/timeout-DNGO7OHT.js +1 -0
- package/dist/bundle/chunks/tr-GVTWMRZB.js +1 -0
- package/dist/bundle/chunks/worker.js +162 -31
- package/dist/bundle/chunks/xan-LAW2EMOM.js +1 -0
- package/dist/bundle/chunks/yq-MFJEXB7R.js +1 -0
- package/dist/bundle/index.cjs +942 -945
- package/dist/bundle/index.js +274 -274
- package/dist/commands/awk/interpreter/context.d.ts +2 -0
- package/dist/commands/awk/interpreter/interpreter.d.ts +2 -0
- package/dist/commands/duration.d.ts +5 -0
- package/dist/commands/format-mode.d.ts +4 -0
- package/dist/commands/query-engine/evaluator.d.ts +3 -0
- package/dist/commands/sed/types.d.ts +0 -4
- package/dist/commands/tar/archive.d.ts +18 -4
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +0 -3
- package/dist/fs/mountable-fs/mountable-fs.d.ts +0 -4
- package/dist/fs/overlay-fs/overlay-fs.d.ts +6 -7
- package/dist/fs/path-utils.d.ts +46 -0
- package/dist/fs/read-write-fs/read-write-fs.d.ts +0 -4
- package/dist/fs/real-fs-utils.d.ts +17 -11
- package/dist/interpreter/defense-aware-command-context.d.ts +6 -0
- package/dist/interpreter/interpreter.d.ts +8 -0
- package/dist/interpreter/types.d.ts +5 -0
- package/dist/timers.d.ts +2 -14
- package/dist/types.d.ts +6 -0
- package/package.json +34 -33
- package/vendor/cpython-emscripten/python.wasm +0 -0
- package/dist/bin/chunks/awk2-ZE5HJBNV.js +0 -2
- package/dist/bin/chunks/chunk-253LRF5J.js +0 -11
- package/dist/bin/chunks/chunk-2FFXXW3F.js +0 -14
- package/dist/bin/chunks/chunk-4E3LY6YK.js +0 -10
- package/dist/bin/chunks/chunk-4FNW6LFM.js +0 -5
- package/dist/bin/chunks/chunk-4PZYIYYG.js +0 -36
- package/dist/bin/chunks/chunk-5VFN7VVJ.js +0 -9
- package/dist/bin/chunks/chunk-6L4K3UGO.js +0 -100
- package/dist/bin/chunks/chunk-D2GFNFUN.js +0 -7
- package/dist/bin/chunks/chunk-DREQRXNN.js +0 -12
- package/dist/bin/chunks/chunk-EPIOK4SY.js +0 -6
- package/dist/bin/chunks/chunk-GIFF636B.js +0 -2
- package/dist/bin/chunks/chunk-IYZRLSTQ.js +0 -2
- package/dist/bin/chunks/chunk-JJHAWOIB.js +0 -2
- package/dist/bin/chunks/chunk-JNPUO56K.js +0 -10
- package/dist/bin/chunks/chunk-KPWFKFSD.js +0 -21
- package/dist/bin/chunks/chunk-KWLLB7S3.js +0 -7
- package/dist/bin/chunks/chunk-RYXW3SZQ.js +0 -13
- package/dist/bin/chunks/chunk-VZKEP45B.js +0 -21
- package/dist/bin/chunks/chunk-XAL6VWGA.js +0 -9
- package/dist/bin/chunks/chunk-YYQ22ZRL.js +0 -8
- package/dist/bin/chunks/curl-RWQO3SBN.js +0 -26
- package/dist/bin/chunks/expr-MLHUWFYI.js +0 -2
- package/dist/bin/chunks/find-4YAO7JQS.js +0 -2
- package/dist/bin/chunks/flag-coverage-23ZUDENJ.js +0 -2
- package/dist/bin/chunks/jq-CXSPO2J5.js +0 -2
- package/dist/bin/chunks/ln-5TCJXDGY.js +0 -2
- package/dist/bin/chunks/mkdir-6OKMS3KO.js +0 -2
- package/dist/bin/chunks/python3-74B25WCY.js +0 -17
- package/dist/bin/chunks/rm-5QIBTLJG.js +0 -2
- package/dist/bin/chunks/sed-DNLJZZXZ.js +0 -2
- package/dist/bin/chunks/sleep-GUJH2AMQ.js +0 -2
- package/dist/bin/chunks/sqlite3-57UI7HYL.js +0 -2
- package/dist/bin/chunks/stat-XH7E4E2C.js +0 -2
- package/dist/bin/chunks/tar-VIYVHMER.js +0 -2
- package/dist/bin/chunks/time-FAWHHOMA.js +0 -2
- package/dist/bin/chunks/timeout-4O4YYRTS.js +0 -2
- package/dist/bin/chunks/tr-4V5A3V2C.js +0 -2
- package/dist/bin/chunks/xan-7NIVZ3HP.js +0 -2
- package/dist/bin/chunks/yq-L5ZSGLLO.js +0 -2
- package/dist/bin/shell/chunks/awk2-ZE5HJBNV.js +0 -2
- package/dist/bin/shell/chunks/chunk-253LRF5J.js +0 -11
- package/dist/bin/shell/chunks/chunk-2FFXXW3F.js +0 -14
- package/dist/bin/shell/chunks/chunk-4E3LY6YK.js +0 -10
- package/dist/bin/shell/chunks/chunk-4FNW6LFM.js +0 -5
- package/dist/bin/shell/chunks/chunk-4PZYIYYG.js +0 -36
- package/dist/bin/shell/chunks/chunk-5VFN7VVJ.js +0 -9
- package/dist/bin/shell/chunks/chunk-6L4K3UGO.js +0 -100
- package/dist/bin/shell/chunks/chunk-D2GFNFUN.js +0 -7
- package/dist/bin/shell/chunks/chunk-DREQRXNN.js +0 -12
- package/dist/bin/shell/chunks/chunk-EPIOK4SY.js +0 -6
- package/dist/bin/shell/chunks/chunk-GIFF636B.js +0 -2
- package/dist/bin/shell/chunks/chunk-IYZRLSTQ.js +0 -2
- package/dist/bin/shell/chunks/chunk-JJHAWOIB.js +0 -2
- package/dist/bin/shell/chunks/chunk-JNPUO56K.js +0 -10
- package/dist/bin/shell/chunks/chunk-KPWFKFSD.js +0 -21
- package/dist/bin/shell/chunks/chunk-KWLLB7S3.js +0 -7
- package/dist/bin/shell/chunks/chunk-RYXW3SZQ.js +0 -13
- package/dist/bin/shell/chunks/chunk-VZKEP45B.js +0 -21
- package/dist/bin/shell/chunks/chunk-XAL6VWGA.js +0 -9
- package/dist/bin/shell/chunks/chunk-YYQ22ZRL.js +0 -8
- package/dist/bin/shell/chunks/curl-RWQO3SBN.js +0 -26
- package/dist/bin/shell/chunks/expr-MLHUWFYI.js +0 -2
- package/dist/bin/shell/chunks/find-4YAO7JQS.js +0 -2
- package/dist/bin/shell/chunks/flag-coverage-23ZUDENJ.js +0 -2
- package/dist/bin/shell/chunks/jq-CXSPO2J5.js +0 -2
- package/dist/bin/shell/chunks/ln-5TCJXDGY.js +0 -2
- package/dist/bin/shell/chunks/mkdir-6OKMS3KO.js +0 -2
- package/dist/bin/shell/chunks/python3-74B25WCY.js +0 -17
- package/dist/bin/shell/chunks/rm-5QIBTLJG.js +0 -2
- package/dist/bin/shell/chunks/sed-DNLJZZXZ.js +0 -2
- package/dist/bin/shell/chunks/sleep-GUJH2AMQ.js +0 -2
- package/dist/bin/shell/chunks/sqlite3-57UI7HYL.js +0 -2
- package/dist/bin/shell/chunks/stat-XH7E4E2C.js +0 -2
- package/dist/bin/shell/chunks/tar-VIYVHMER.js +0 -2
- package/dist/bin/shell/chunks/time-FAWHHOMA.js +0 -2
- package/dist/bin/shell/chunks/timeout-4O4YYRTS.js +0 -2
- package/dist/bin/shell/chunks/tr-4V5A3V2C.js +0 -2
- package/dist/bin/shell/chunks/xan-7NIVZ3HP.js +0 -2
- package/dist/bin/shell/chunks/yq-L5ZSGLLO.js +0 -2
- package/dist/bundle/chunks/awk2-T6LHPVZE.js +0 -1
- package/dist/bundle/chunks/chunk-27LMNKBP.js +0 -7
- package/dist/bundle/chunks/chunk-5BFLZVGH.js +0 -20
- package/dist/bundle/chunks/chunk-7BQDVPII.js +0 -9
- package/dist/bundle/chunks/chunk-7KHLIOOW.js +0 -4
- package/dist/bundle/chunks/chunk-AOFQVUAD.js +0 -99
- package/dist/bundle/chunks/chunk-BAAVD5NO.js +0 -20
- package/dist/bundle/chunks/chunk-BEFDX7IY.js +0 -1
- package/dist/bundle/chunks/chunk-GZ2N3SXD.js +0 -8
- package/dist/bundle/chunks/chunk-IJXFPKNC.js +0 -1
- package/dist/bundle/chunks/chunk-IKZ5LEGB.js +0 -6
- package/dist/bundle/chunks/chunk-KPFCTJEX.js +0 -12
- package/dist/bundle/chunks/chunk-LN5KAJOV.js +0 -5
- package/dist/bundle/chunks/chunk-NBAARP4B.js +0 -1
- package/dist/bundle/chunks/chunk-OFJTSXN6.js +0 -8
- package/dist/bundle/chunks/chunk-RHOPHAL6.js +0 -35
- package/dist/bundle/chunks/chunk-SL4FN3A5.js +0 -9
- package/dist/bundle/chunks/chunk-UJIR5V54.js +0 -11
- package/dist/bundle/chunks/chunk-XZ3MZS57.js +0 -6
- package/dist/bundle/chunks/chunk-YCABLDKV.js +0 -10
- package/dist/bundle/chunks/chunk-YIY2RKBW.js +0 -13
- package/dist/bundle/chunks/curl-6L7YZUIH.js +0 -25
- package/dist/bundle/chunks/expr-3572LAOT.js +0 -1
- package/dist/bundle/chunks/find-DQFMWHAC.js +0 -1
- package/dist/bundle/chunks/flag-coverage-L3DCLG6V.js +0 -1
- package/dist/bundle/chunks/jq-MYSLFARY.js +0 -1
- package/dist/bundle/chunks/ln-YAIFIHCT.js +0 -1
- package/dist/bundle/chunks/mkdir-QWGXDWUS.js +0 -1
- package/dist/bundle/chunks/python3-6BKA3FYA.js +0 -16
- package/dist/bundle/chunks/rm-KPTLPKPH.js +0 -1
- package/dist/bundle/chunks/sed-3ZCNFRHI.js +0 -1
- package/dist/bundle/chunks/sleep-LB7FI6AB.js +0 -1
- package/dist/bundle/chunks/sqlite3-FVNA4KNF.js +0 -1
- package/dist/bundle/chunks/stat-74KBZFAX.js +0 -1
- package/dist/bundle/chunks/tar-E2DVQEWO.js +0 -1
- package/dist/bundle/chunks/time-AGNW2ZY6.js +0 -1
- package/dist/bundle/chunks/timeout-VN35D5O7.js +0 -1
- package/dist/bundle/chunks/tr-2N7Q3KKJ.js +0 -1
- package/dist/bundle/chunks/xan-VTO4FP3H.js +0 -1
- package/dist/bundle/chunks/yq-JRZFRYSK.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a,b}from"./chunk-LWKIHJ5L.js";import"./chunk-W752QGNZ.js";import"./chunk-UYBH3FNE.js";import"./chunk-4PRVMER6.js";import"./chunk-ZRRNCS7N.js";import"./chunk-Q5MYEU7X.js";import"./chunk-SE4C7FJY.js";import"./chunk-5WFYIUU2.js";import"./chunk-6KZRLMG3.js";import"./chunk-OBH7XN5N.js";import"./chunk-SYG3IW7P.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as jqCommand};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./chunk-MY5PY2PL.js";import{a as M,b as c}from"./chunk-QZNF3Y3J.js";import{a as P,b as U}from"./chunk-UT6LUTWP.js";import{a as k}from"./chunk-4PRVMER6.js";import{c as F}from"./chunk-ZRRNCS7N.js";import{b as I}from"./chunk-Q5MYEU7X.js";import{a as l}from"./chunk-SYG3IW7P.js";import{a as L,b as N}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";import{fileURLToPath as H}from"node:url";import{Worker as W}from"node:worker_threads";var u={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},E={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},i={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},w={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:1048576,TOTAL:1052704},y={NONE:0,RECURSIVE:1,FORCE:2,MKDIR_RECURSIVE:1},p={IS_FILE:0,IS_DIRECTORY:1,IS_SYMLINK:2,MODE:4,SIZE:8,MTIME:16,TOTAL:24};function V(){return new M(w.TOTAL)}var A=class{int32View;uint8View;dataView;constructor(t){this.int32View=new Int32Array(t),this.uint8View=new Uint8Array(t),this.dataView=new DataView(t)}getOpCode(){return c.load(this.int32View,i.OP_CODE/4)}setOpCode(t){c.store(this.int32View,i.OP_CODE/4,t)}getStatus(){return c.load(this.int32View,i.STATUS/4)}setStatus(t){c.store(this.int32View,i.STATUS/4,t)}getPathLength(){return c.load(this.int32View,i.PATH_LENGTH/4)}setPathLength(t){c.store(this.int32View,i.PATH_LENGTH/4,t)}getDataLength(){return c.load(this.int32View,i.DATA_LENGTH/4)}setDataLength(t){c.store(this.int32View,i.DATA_LENGTH/4,t)}getResultLength(){return c.load(this.int32View,i.RESULT_LENGTH/4)}setResultLength(t){c.store(this.int32View,i.RESULT_LENGTH/4,t)}getErrorCode(){return c.load(this.int32View,i.ERROR_CODE/4)}setErrorCode(t){c.store(this.int32View,i.ERROR_CODE/4,t)}getFlags(){return c.load(this.int32View,i.FLAGS/4)}setFlags(t){c.store(this.int32View,i.FLAGS/4,t)}getMode(){return c.load(this.int32View,i.MODE/4)}setMode(t){c.store(this.int32View,i.MODE/4,t)}getPath(){let t=this.getPathLength(),e=this.uint8View.slice(i.PATH_BUFFER,i.PATH_BUFFER+t);return new TextDecoder().decode(e)}setPath(t){let e=new TextEncoder().encode(t);if(e.length>w.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${w.PATH_BUFFER}`);this.uint8View.set(e,i.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(i.DATA_BUFFER,i.DATA_BUFFER+t)}setData(t){if(t.length>w.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${w.DATA_BUFFER}`);this.uint8View.set(t,i.DATA_BUFFER),this.setDataLength(t.length)}getDataAsString(){let t=this.getData();return new TextDecoder().decode(t)}setDataFromString(t){let e=new TextEncoder().encode(t);this.setData(e)}getResult(){let t=this.getResultLength();return this.uint8View.slice(i.DATA_BUFFER,i.DATA_BUFFER+t)}setResult(t){if(t.length>w.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${w.DATA_BUFFER}`);this.uint8View.set(t,i.DATA_BUFFER),this.setResultLength(t.length)}getResultAsString(){let t=this.getResult();return new TextDecoder().decode(t)}setResultFromString(t){let e=new TextEncoder().encode(t);this.setResult(e)}encodeStat(t){this.uint8View[i.DATA_BUFFER+p.IS_FILE]=t.isFile?1:0,this.uint8View[i.DATA_BUFFER+p.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[i.DATA_BUFFER+p.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(i.DATA_BUFFER+p.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(i.DATA_BUFFER+p.SIZE,e,!0),this.dataView.setFloat64(i.DATA_BUFFER+p.MTIME,t.mtime.getTime(),!0),this.setResultLength(p.TOTAL)}decodeStat(){return{isFile:this.uint8View[i.DATA_BUFFER+p.IS_FILE]===1,isDirectory:this.uint8View[i.DATA_BUFFER+p.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[i.DATA_BUFFER+p.IS_SYMLINK]===1,mode:this.dataView.getInt32(i.DATA_BUFFER+p.MODE,!0),size:this.dataView.getFloat64(i.DATA_BUFFER+p.SIZE,!0),mtime:new Date(this.dataView.getFloat64(i.DATA_BUFFER+p.MTIME,!0))}}waitForReady(t){return c.wait(this.int32View,i.STATUS/4,a.PENDING,t)}waitForReadyAsync(t){return c.waitAsync(this.int32View,i.STATUS/4,a.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let s=this.getStatus();if(s===a.READY)return!0;let r=Date.now()-e;if(r>=t)return!1;let n=t-r,m=c.waitAsync(this.int32View,i.STATUS/4,s,n);if(m.async&&await m.value==="timed-out")return!1}}waitForResult(t){return c.wait(this.int32View,i.STATUS/4,a.READY,t)}notify(){return c.notify(this.int32View,i.STATUS/4)}reset(){this.setOpCode(u.NOOP),this.setStatus(a.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(E.NONE),this.setFlags(y.NONE),this.setMode(0)}};var D=class{fs;cwd;secureFetch;maxOutputSize;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;constructor(t,e,s,r=void 0,n=0){this.fs=e,this.cwd=s,this.secureFetch=r,this.maxOutputSize=n,this.protocol=new A(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+=`
|
|
3
|
+
python3: execution timeout exceeded
|
|
4
|
+
`,this.output.exitCode=124;break}let r=t-s;if(!await this.protocol.waitUntilReady(r)){this.output.stderr+=`
|
|
5
|
+
python3: execution timeout exceeded
|
|
6
|
+
`,this.output.exitCode=124;break}let m=this.protocol.getOpCode();await this.handleOperation(m),this.protocol.notify()}return this.output}stop(){this.running=!1}async handleOperation(t){try{switch(t){case u.READ_FILE:await this.handleReadFile();break;case u.WRITE_FILE:await this.handleWriteFile();break;case u.STAT:await this.handleStat();break;case u.LSTAT:await this.handleLstat();break;case u.READDIR:await this.handleReaddir();break;case u.MKDIR:await this.handleMkdir();break;case u.RM:await this.handleRm();break;case u.EXISTS:await this.handleExists();break;case u.APPEND_FILE:await this.handleAppendFile();break;case u.SYMLINK:await this.handleSymlink();break;case u.READLINK:await this.handleReadlink();break;case u.CHMOD:await this.handleChmod();break;case u.REALPATH:await this.handleRealpath();break;case u.WRITE_STDOUT:this.handleWriteStdout();break;case u.WRITE_STDERR:this.handleWriteStderr();break;case u.EXIT:this.handleExit();break;case u.HTTP_REQUEST:await this.handleHttpRequest();break;default:this.protocol.setErrorCode(E.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()&y.MKDIR_RECURSIVE)!==0;try{await this.fs.mkdir(t,{recursive:s}),this.protocol.setStatus(a.SUCCESS)}catch(r){this.setErrorFromException(r)}}async handleRm(){let t=this.resolvePath(this.protocol.getPath()),e=this.protocol.getFlags(),s=(e&y.RECURSIVE)!==0,r=(e&y.FORCE)!==0;try{await this.fs.rm(t,{recursive:s,force:r}),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(r){this.setErrorFromException(r)}}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(E.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(E.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
|
|
7
|
+
`,e=t.length>this.maxOutputSize?t.slice(0,this.maxOutputSize):t;if(this.output.stderr.includes("total output size exceeded"))return;let r=this.output.stdout.length+this.output.stderr.length+e.length-this.maxOutputSize;if(r>0)if(this.output.stdout.length>=r)this.output.stdout=this.output.stdout.slice(0,this.output.stdout.length-r);else{let n=r-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(E.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):{},r=await this.secureFetch(t,{method:s.method,headers:s.headers,body:s.body}),n=JSON.stringify({status:r.status,statusText:r.statusText,headers:r.headers,body:r.body,url:r.url});this.protocol.setResultFromString(n),this.protocol.setStatus(a.SUCCESS)}catch(s){let r=l(s instanceof Error?s.message:String(s));this.protocol.setErrorCode(E.NETWORK_ERROR),this.protocol.setResultFromString(r),this.protocol.setStatus(a.ERROR)}}setErrorFromException(t){let e=t instanceof Error?t.message:String(t),s=l(e),r=E.IO_ERROR,n=e.toLowerCase();n.includes("no such file")||n.includes("not found")||n.includes("enoent")?r=E.NOT_FOUND:n.includes("is a directory")||n.includes("eisdir")?r=E.IS_DIRECTORY:n.includes("not a directory")||n.includes("enotdir")?r=E.NOT_DIRECTORY:n.includes("already exists")||n.includes("eexist")?r=E.EXISTS:(n.includes("permission")||n.includes("eperm")||n.includes("eacces"))&&(r=E.PERMISSION_DENIED),this.protocol.setErrorCode(r),this.protocol.setResultFromString(s),this.protocol.setStatus(a.ERROR)}};var z=3e4,G={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 $(o){let t={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(o.length===0)return t;let e=o.findIndex(s=>!s.startsWith("-")||s==="-"||s==="--");for(let s=0;s<(e===-1?o.length:e);s++){let r=o[s];if(r==="-c")return s+1>=o.length?{stdout:"",stderr:`python3: option requires an argument -- 'c'
|
|
8
|
+
`,exitCode:2}:(t.code=o[s+1],t.scriptArgs=o.slice(s+2),t);if(r==="-m")return s+1>=o.length?{stdout:"",stderr:`python3: option requires an argument -- 'm'
|
|
9
|
+
`,exitCode:2}:(t.module=o[s+1],t.scriptArgs=o.slice(s+2),t);if(r==="--version"||r==="-V")return t.showVersion=!0,t;if(r.startsWith("-")&&r!=="-")return{stdout:"",stderr:`python3: unrecognized option '${r}'
|
|
10
|
+
`,exitCode:2}}if(e!==-1){let s=o[e];s==="--"?e+1<o.length&&(t.scriptFile=o[e+1],t.scriptArgs=o.slice(e+2)):(t.scriptFile=s,t.scriptArgs=o.slice(e+1))}return t}var _=new WeakMap;function Y(o){let t=_.get(o);return t||(t={executionQueue:[],isExecuting:!1},_.set(o,t)),t}function pt(){_=new WeakMap}var K=H(new URL("./worker.js",import.meta.url));function Q(o){if(!o||typeof o!="object")return{success:!1,error:"Malformed worker response"};let t=o;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 S(o){if(o.isExecuting||o.executionQueue.length===0)return;for(;o.executionQueue.length>0&&o.executionQueue[0].canceled;)o.executionQueue.shift();if(o.executionQueue.length===0)return;let t=o.executionQueue.shift();if(!t)return;o.isExecuting=!0;let e;try{e=I.runTrusted(()=>new W(K,{workerData:t.input}))}catch(h){let d=h instanceof Error?h.message:String(h);t.resolve({success:!1,error:l(d)}),o.isExecuting=!1,S(o);return}t.workerRef&&(t.workerRef.current=e);let s=F(t.requireDefenseContext,"python3","worker message callback",h=>{t.resolve(Q(h)),o.isExecuting=!1,e.terminate(),S(o)}),r=F(t.requireDefenseContext,"python3","worker error callback",h=>{t.resolve({success:!1,error:l(h.message)}),o.isExecuting=!1,S(o)}),n=F(t.requireDefenseContext,"python3","worker exit callback",()=>{o.isExecuting&&(t.resolve({success:!1,error:"Worker exited unexpectedly"}),o.isExecuting=!1,S(o))}),m=h=>{try{s(h)}catch(d){let g=d instanceof Error?d.message:String(d);t.resolve({success:!1,error:l(g)}),o.isExecuting=!1,e.terminate(),S(o)}},f=h=>{try{r(h)}catch(d){let g=d instanceof Error?d.message:String(d);t.resolve({success:!1,error:l(g)}),o.isExecuting=!1,S(o)}},x=()=>{try{n()}catch(h){let d=h instanceof Error?h.message:String(h);t.resolve({success:!1,error:l(d)}),o.isExecuting=!1,S(o)}};e.on("message",m),e.on("error",f),e.on("exit",x)}async function X(o,t,e,s=[]){let r=V(),n=new D(r,t.fs,t.cwd,t.fetch,t.limits?.maxOutputSize??0),m=t.limits?.maxPythonTimeoutMs??z,f=Y(t.fs),x={sharedBuffer:r,pythonCode:o,cwd:t.cwd,env:k(t.env),args:s,scriptPath:e},h={current:null},d=new Promise(R=>{let C={input:x,resolve:()=>{},workerRef:h,requireDefenseContext:t.requireDefenseContext},b=F(t.requireDefenseContext,"python3","worker timeout callback",()=>{h.current?h.current.terminate():C.canceled=!0,R({success:!1,error:`Execution timeout: exceeded ${m}ms limit`})}),v=P(()=>{try{b()}catch(T){let B=T instanceof Error?T.message:String(T);R({success:!1,error:l(B)})}},m);C.resolve=T=>{U(v),R(T)},f.executionQueue.push(C),S(f)}),[g,O]=await Promise.all([n.run(m).catch(R=>({stdout:"",stderr:`python3: bridge error: ${l(R.message)}
|
|
11
|
+
`,exitCode:1})),d.catch(R=>({success:!1,error:l(R.message)}))]);if(!O.success&&O.error){let R=l(O.error);return{stdout:g.stdout,stderr:`${g.stderr}python3: ${R}
|
|
12
|
+
`,exitCode:g.exitCode||1}}return g}var Z={name:"python3",async execute(o,t){if(N(o))return L(G);let e=$(o);if("exitCode"in e)return e;if(e.showVersion)return{stdout:`Python 3.13.2 (Emscripten)
|
|
13
|
+
`,stderr:"",exitCode:0};let s,r;if(e.code!==null)s=e.code,r="-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)}'
|
|
14
|
+
`,exitCode:1};s=`import runpy; runpy.run_module('${e.module}', run_name='__main__')`,r=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
|
|
15
|
+
`,exitCode:2};try{s=await t.fs.readFile(n),r=e.scriptFile}catch(m){let f=l(m.message);return{stdout:"",stderr:`python3: can't open file '${e.scriptFile}': ${f}
|
|
16
|
+
`,exitCode:2}}}else if(t.stdin.trim())s=t.stdin,r="<stdin>";else return{stdout:"",stderr:`python3: no input provided (use -c CODE, -m MODULE, or provide a script file)
|
|
17
|
+
`,exitCode:2};return X(s,t,r,e.scriptArgs)}},Et={name:"python",async execute(o,t){return Z.execute(o,t)}};export{pt as _resetExecutionQueue,Z as python3Command,Et as pythonCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-ZSVBYEY4.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as readlinkCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a,b}from"./chunk-5ATRLST6.js";import"./chunk-ZRRNCS7N.js";import"./chunk-Q5MYEU7X.js";import"./chunk-SE4C7FJY.js";import"./chunk-6KZRLMG3.js";import"./chunk-SYG3IW7P.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as sedCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a,b,c}from"./chunk-DERQIX2O.js";import"./chunk-UT6LUTWP.js";import"./chunk-ZRRNCS7N.js";import"./chunk-Q5MYEU7X.js";import"./chunk-SYG3IW7P.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{a as _internals,c as flagsForFuzzing,b as sqlite3Command};
|
|
@@ -10,6 +10,19 @@ import { createRequire } from "node:module";
|
|
|
10
10
|
import { dirname } from "node:path";
|
|
11
11
|
import { parentPort, workerData } from "node:worker_threads";
|
|
12
12
|
|
|
13
|
+
// src/fs/sanitize-error.ts
|
|
14
|
+
function sanitizeErrorMessage(message) {
|
|
15
|
+
if (!message) return message;
|
|
16
|
+
let sanitized = message.replace(/\n\s+at\s.*/g, "");
|
|
17
|
+
sanitized = sanitized.replace(
|
|
18
|
+
/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,
|
|
19
|
+
"<path>"
|
|
20
|
+
);
|
|
21
|
+
sanitized = sanitized.replace(/node:internal\/[^\s'",)}\]:]+/g, "<internal>");
|
|
22
|
+
sanitized = sanitized.replace(/[A-Z]:\\[^\s'",)}\]:]+/g, "<path>");
|
|
23
|
+
return sanitized;
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
// src/security/blocked-globals.ts
|
|
14
27
|
function getBlockedGlobals() {
|
|
15
28
|
const globals = [
|
|
@@ -177,7 +190,14 @@ function getBlockedGlobals() {
|
|
|
177
190
|
// in defense-in-depth-box.ts and worker-defense-in-depth.ts
|
|
178
191
|
// Note: process.connected is a boolean primitive, handled specially
|
|
179
192
|
// in defense-in-depth-box.ts and worker-defense-in-depth.ts
|
|
180
|
-
// Working directory manipulation
|
|
193
|
+
// Working directory access/manipulation
|
|
194
|
+
{
|
|
195
|
+
prop: "cwd",
|
|
196
|
+
target: process,
|
|
197
|
+
violationType: "process_chdir",
|
|
198
|
+
strategy: "throw",
|
|
199
|
+
reason: "process.cwd could disclose real host working directory path"
|
|
200
|
+
},
|
|
181
201
|
{
|
|
182
202
|
prop: "chdir",
|
|
183
203
|
target: process,
|
|
@@ -241,6 +261,13 @@ function getBlockedGlobals() {
|
|
|
241
261
|
reason: "FinalizationRegistry could be used to leak references outside sandbox"
|
|
242
262
|
},
|
|
243
263
|
// Introspection/interception vectors (freeze instead of throw)
|
|
264
|
+
// SECURITY RATIONALE: Reflect is frozen (not blocked) because:
|
|
265
|
+
// 1. Defense infrastructure uses Reflect.apply/get/set/construct internally
|
|
266
|
+
// 2. Frozen Reflect cannot be mutated but remains fully functional
|
|
267
|
+
// 3. Reflect.construct(Function, ['code']) IS safe because globalThis.Function
|
|
268
|
+
// is replaced with a blocking proxy — Reflect.construct receives the proxy
|
|
269
|
+
// 4. Security depends on NEVER leaking original Function/eval references.
|
|
270
|
+
// If an unpatched Function ref leaked, Reflect.construct would bypass defense.
|
|
244
271
|
{
|
|
245
272
|
prop: "Reflect",
|
|
246
273
|
target: globalThis,
|
|
@@ -697,6 +724,64 @@ var WorkerDefenseInDepth = class {
|
|
|
697
724
|
} finally {
|
|
698
725
|
self.inTrap = false;
|
|
699
726
|
}
|
|
727
|
+
},
|
|
728
|
+
deleteProperty(target, prop) {
|
|
729
|
+
if (self.inTrap) {
|
|
730
|
+
return Reflect.deleteProperty(target, prop);
|
|
731
|
+
}
|
|
732
|
+
self.inTrap = true;
|
|
733
|
+
try {
|
|
734
|
+
const fullPath = `${path}.${String(prop)}`;
|
|
735
|
+
const message = `${fullPath} deletion is blocked in worker context`;
|
|
736
|
+
const violation = self.recordViolation(
|
|
737
|
+
violationType,
|
|
738
|
+
fullPath,
|
|
739
|
+
message
|
|
740
|
+
);
|
|
741
|
+
if (!auditMode) {
|
|
742
|
+
throw new WorkerSecurityViolationError(message, violation);
|
|
743
|
+
}
|
|
744
|
+
return Reflect.deleteProperty(target, prop);
|
|
745
|
+
} finally {
|
|
746
|
+
self.inTrap = false;
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
setPrototypeOf(target, proto) {
|
|
750
|
+
if (self.inTrap) {
|
|
751
|
+
return Reflect.setPrototypeOf(target, proto);
|
|
752
|
+
}
|
|
753
|
+
self.inTrap = true;
|
|
754
|
+
try {
|
|
755
|
+
const message = `${path} setPrototypeOf is blocked in worker context`;
|
|
756
|
+
const violation = self.recordViolation(violationType, path, message);
|
|
757
|
+
if (!auditMode) {
|
|
758
|
+
throw new WorkerSecurityViolationError(message, violation);
|
|
759
|
+
}
|
|
760
|
+
return Reflect.setPrototypeOf(target, proto);
|
|
761
|
+
} finally {
|
|
762
|
+
self.inTrap = false;
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
defineProperty(target, prop, descriptor) {
|
|
766
|
+
if (self.inTrap) {
|
|
767
|
+
return Reflect.defineProperty(target, prop, descriptor);
|
|
768
|
+
}
|
|
769
|
+
self.inTrap = true;
|
|
770
|
+
try {
|
|
771
|
+
const fullPath = `${path}.${String(prop)}`;
|
|
772
|
+
const message = `${fullPath} defineProperty is blocked in worker context`;
|
|
773
|
+
const violation = self.recordViolation(
|
|
774
|
+
violationType,
|
|
775
|
+
fullPath,
|
|
776
|
+
message
|
|
777
|
+
);
|
|
778
|
+
if (!auditMode) {
|
|
779
|
+
throw new WorkerSecurityViolationError(message, violation);
|
|
780
|
+
}
|
|
781
|
+
return Reflect.defineProperty(target, prop, descriptor);
|
|
782
|
+
} finally {
|
|
783
|
+
self.inTrap = false;
|
|
784
|
+
}
|
|
700
785
|
}
|
|
701
786
|
});
|
|
702
787
|
}
|
|
@@ -1253,9 +1338,23 @@ var WorkerDefenseInDepth = class {
|
|
|
1253
1338
|
}
|
|
1254
1339
|
};
|
|
1255
1340
|
|
|
1256
|
-
// src/
|
|
1257
|
-
|
|
1258
|
-
|
|
1341
|
+
// src/security/wasm-callback.ts
|
|
1342
|
+
function sanitizeUnknownError(error) {
|
|
1343
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1344
|
+
return sanitizeErrorMessage(message);
|
|
1345
|
+
}
|
|
1346
|
+
function wrapWasmCallback(component, phase, callback) {
|
|
1347
|
+
return (...args) => {
|
|
1348
|
+
try {
|
|
1349
|
+
return callback(...args);
|
|
1350
|
+
} catch (error) {
|
|
1351
|
+
const message = sanitizeUnknownError(error);
|
|
1352
|
+
throw new Error(`${component} ${phase} callback failed: ${message}`);
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
// src/security/trusted-globals.ts
|
|
1259
1358
|
var _SharedArrayBuffer = globalThis.SharedArrayBuffer;
|
|
1260
1359
|
var _Atomics = globalThis.Atomics;
|
|
1261
1360
|
var _performanceNow = performance.now.bind(performance);
|
|
@@ -2413,9 +2512,8 @@ function createHTTPFS(backend, FS) {
|
|
|
2413
2512
|
});
|
|
2414
2513
|
lastResponse = encoder.encode(JSON.stringify(result));
|
|
2415
2514
|
} catch (e) {
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
);
|
|
2515
|
+
const message = sanitizeErrorMessage(e.message);
|
|
2516
|
+
lastResponse = encoder.encode(JSON.stringify({ error: message }));
|
|
2419
2517
|
}
|
|
2420
2518
|
}
|
|
2421
2519
|
delete stream.hostContent;
|
|
@@ -2543,6 +2641,16 @@ sys.modules['jb_http'] = jb_http
|
|
|
2543
2641
|
`;
|
|
2544
2642
|
}
|
|
2545
2643
|
var cachedStdlibZip = new Uint8Array(readFileSync(stdlibZipPath));
|
|
2644
|
+
function postWorkerMessage(message) {
|
|
2645
|
+
try {
|
|
2646
|
+
parentPort?.postMessage(message);
|
|
2647
|
+
} catch (error) {
|
|
2648
|
+
console.debug(
|
|
2649
|
+
"[python3-worker] failed to post worker message:",
|
|
2650
|
+
sanitizeUnknownError(error)
|
|
2651
|
+
);
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2546
2654
|
async function runPython(input) {
|
|
2547
2655
|
const backend = new SyncFsBackend(input.sharedBuffer);
|
|
2548
2656
|
const createPythonModule = require2(`${cpythonDir}/python.cjs`);
|
|
@@ -2551,17 +2659,20 @@ async function runPython(input) {
|
|
|
2551
2659
|
const pendingStderr = [];
|
|
2552
2660
|
let Module;
|
|
2553
2661
|
try {
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
preRun
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2662
|
+
const onPreRun = wrapWasmCallback(
|
|
2663
|
+
"python3-worker",
|
|
2664
|
+
"preRun",
|
|
2665
|
+
(mod) => {
|
|
2666
|
+
mod.FS.mkdirTree("/lib");
|
|
2667
|
+
mod.FS.writeFile("/lib/python313.zip", cachedStdlibZip);
|
|
2668
|
+
mod.ENV.PYTHONHOME = "/";
|
|
2669
|
+
mod.ENV.PYTHONPATH = "/lib/python313.zip";
|
|
2670
|
+
}
|
|
2671
|
+
);
|
|
2672
|
+
const onPrint = wrapWasmCallback(
|
|
2673
|
+
"python3-worker",
|
|
2674
|
+
"print",
|
|
2675
|
+
(text) => {
|
|
2565
2676
|
if (moduleReady) {
|
|
2566
2677
|
backend.writeStdout(`${text}
|
|
2567
2678
|
`);
|
|
@@ -2569,8 +2680,12 @@ async function runPython(input) {
|
|
|
2569
2680
|
pendingStdout.push(`${text}
|
|
2570
2681
|
`);
|
|
2571
2682
|
}
|
|
2572
|
-
}
|
|
2573
|
-
|
|
2683
|
+
}
|
|
2684
|
+
);
|
|
2685
|
+
const onPrintErr = wrapWasmCallback(
|
|
2686
|
+
"python3-worker",
|
|
2687
|
+
"printErr",
|
|
2688
|
+
(text) => {
|
|
2574
2689
|
if (typeof text === "string" && (text.includes("Could not find platform") || text.includes("LLVM Profile Error"))) {
|
|
2575
2690
|
return;
|
|
2576
2691
|
}
|
|
@@ -2582,11 +2697,18 @@ async function runPython(input) {
|
|
|
2582
2697
|
`);
|
|
2583
2698
|
}
|
|
2584
2699
|
}
|
|
2700
|
+
);
|
|
2701
|
+
Module = await createPythonModule({
|
|
2702
|
+
noInitialRun: true,
|
|
2703
|
+
preRun: [onPreRun],
|
|
2704
|
+
print: onPrint,
|
|
2705
|
+
printErr: onPrintErr
|
|
2585
2706
|
});
|
|
2586
2707
|
} catch (e) {
|
|
2708
|
+
const message = sanitizeErrorMessage(e.message);
|
|
2587
2709
|
return {
|
|
2588
2710
|
success: false,
|
|
2589
|
-
error: `Failed to load CPython: ${
|
|
2711
|
+
error: `Failed to load CPython: ${message}`
|
|
2590
2712
|
};
|
|
2591
2713
|
}
|
|
2592
2714
|
activateDefense();
|
|
@@ -2598,9 +2720,10 @@ async function runPython(input) {
|
|
|
2598
2720
|
Module.FS.mkdir("/host");
|
|
2599
2721
|
Module.FS.mount(HOSTFS, { root: "/" }, "/host");
|
|
2600
2722
|
} catch (e) {
|
|
2723
|
+
const message = sanitizeErrorMessage(e.message);
|
|
2601
2724
|
return {
|
|
2602
2725
|
success: false,
|
|
2603
|
-
error: `Failed to mount HOSTFS: ${
|
|
2726
|
+
error: `Failed to mount HOSTFS: ${message}`
|
|
2604
2727
|
};
|
|
2605
2728
|
}
|
|
2606
2729
|
const HTTPFS = createHTTPFS(backend, Module.FS);
|
|
@@ -2608,9 +2731,10 @@ async function runPython(input) {
|
|
|
2608
2731
|
Module.FS.mkdir("/_jb_http");
|
|
2609
2732
|
Module.FS.mount(HTTPFS, { root: "/" }, "/_jb_http");
|
|
2610
2733
|
} catch (e) {
|
|
2734
|
+
const message = sanitizeErrorMessage(e.message);
|
|
2611
2735
|
return {
|
|
2612
2736
|
success: false,
|
|
2613
|
-
error: `Failed to mount HTTPFS: ${
|
|
2737
|
+
error: `Failed to mount HTTPFS: ${message}`
|
|
2614
2738
|
};
|
|
2615
2739
|
}
|
|
2616
2740
|
const setupCode = generateSetupCode(input);
|
|
@@ -2660,6 +2784,13 @@ function activateDefense() {
|
|
|
2660
2784
|
writable: true,
|
|
2661
2785
|
configurable: true
|
|
2662
2786
|
});
|
|
2787
|
+
const onViolation = wrapWasmCallback(
|
|
2788
|
+
"python3-worker",
|
|
2789
|
+
"onViolation",
|
|
2790
|
+
(v) => {
|
|
2791
|
+
postWorkerMessage({ type: "security-violation", violation: v });
|
|
2792
|
+
}
|
|
2793
|
+
);
|
|
2663
2794
|
defense = new WorkerDefenseInDepth({
|
|
2664
2795
|
excludeViolationTypes: [
|
|
2665
2796
|
// SharedArrayBuffer/Atomics: Used by sync-fs-backend.ts for synchronous
|
|
@@ -2670,26 +2801,26 @@ function activateDefense() {
|
|
|
2670
2801
|
// stub. Defense doesn't need to block it — it's already degraded.
|
|
2671
2802
|
"performance_timing"
|
|
2672
2803
|
],
|
|
2673
|
-
onViolation
|
|
2674
|
-
parentPort?.postMessage({ type: "security-violation", violation: v });
|
|
2675
|
-
}
|
|
2804
|
+
onViolation
|
|
2676
2805
|
});
|
|
2677
2806
|
}
|
|
2678
2807
|
process.on("uncaughtException", (e) => {
|
|
2679
|
-
|
|
2808
|
+
const message = sanitizeErrorMessage(e.message);
|
|
2809
|
+
postWorkerMessage({
|
|
2680
2810
|
success: false,
|
|
2681
|
-
error: `Worker uncaught exception: ${
|
|
2811
|
+
error: `Worker uncaught exception: ${message}`
|
|
2682
2812
|
});
|
|
2683
2813
|
});
|
|
2684
2814
|
if (parentPort) {
|
|
2685
2815
|
if (workerData) {
|
|
2686
2816
|
runPython(workerData).then((result) => {
|
|
2687
2817
|
result.defenseStats = defense?.getStats();
|
|
2688
|
-
|
|
2818
|
+
postWorkerMessage(result);
|
|
2689
2819
|
}).catch((e) => {
|
|
2690
|
-
|
|
2820
|
+
const message = sanitizeUnknownError(e);
|
|
2821
|
+
postWorkerMessage({
|
|
2691
2822
|
success: false,
|
|
2692
|
-
error:
|
|
2823
|
+
error: message,
|
|
2693
2824
|
defenseStats: defense?.getStats()
|
|
2694
2825
|
});
|
|
2695
2826
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a,b}from"./chunk-EMSJEY2U.js";import"./chunk-GZHFXDDO.js";import"./chunk-QSDVMMYI.js";import"./chunk-W752QGNZ.js";import"./chunk-UYBH3FNE.js";import"./chunk-4PRVMER6.js";import"./chunk-ZRRNCS7N.js";import"./chunk-Q5MYEU7X.js";import"./chunk-SE4C7FJY.js";import"./chunk-5WFYIUU2.js";import"./chunk-6KZRLMG3.js";import"./chunk-OBH7XN5N.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as xanCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a,b}from"./chunk-6W7JTG6A.js";import"./chunk-QSDVMMYI.js";import"./chunk-W752QGNZ.js";import"./chunk-UYBH3FNE.js";import"./chunk-4PRVMER6.js";import"./chunk-ZRRNCS7N.js";import"./chunk-Q5MYEU7X.js";import"./chunk-SE4C7FJY.js";import"./chunk-6KZRLMG3.js";import"./chunk-SYG3IW7P.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as yqCommand};
|