just-bash 2.12.1 → 2.12.2
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/chunk-2FFXXW3F.js +14 -0
- package/dist/bin/chunks/chunk-435ZOZCY.js +63 -0
- package/dist/bin/chunks/chunk-4FNW6LFM.js +5 -0
- package/dist/bin/chunks/chunk-4PZYIYYG.js +36 -0
- package/dist/bin/chunks/{chunk-JWVOLGWZ.js → chunk-DREQRXNN.js} +1 -1
- package/dist/bin/chunks/chunk-IYZRLSTQ.js +2 -0
- package/dist/bin/chunks/chunk-JJHAWOIB.js +2 -0
- package/dist/bin/chunks/{chunk-F37UEO7A.js → chunk-JNPUO56K.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-DAGNL3F2.js → chunks/chunk-MZKPWGID.js} +24 -24
- package/dist/bin/chunks/{chunk-45MJQ2LX.js → chunk-OKL2SPHK.js} +32 -32
- package/dist/bin/chunks/{expansion-QVHAYGVZ.js → expansion-TCB3WZP5.js} +1 -1
- package/dist/bin/chunks/{flag-coverage-F4EAJUHL.js → flag-coverage-LQ37DA4R.js} +1 -1
- package/dist/bin/{shell/chunks/gzip-EENEW6WQ.js → chunks/gzip-RQ5RIFJV.js} +1 -1
- package/dist/bin/chunks/python3-74B25WCY.js +17 -0
- package/dist/bin/{shell/chunks/sleep-RA6DYTJX.js → chunks/sleep-GUJH2AMQ.js} +1 -1
- package/dist/bin/chunks/sqlite3-57UI7HYL.js +2 -0
- package/dist/bin/{shell/chunks/tar-GP2CCB47.js → chunks/tar-VIYVHMER.js} +1 -1
- package/dist/bin/chunks/time-FAWHHOMA.js +2 -0
- package/dist/bin/chunks/timeout-4O4YYRTS.js +2 -0
- package/dist/bin/chunks/worker.js +154 -4
- package/dist/bin/just-bash.js +255 -255
- package/dist/bin/shell/chunks/chunk-2FFXXW3F.js +14 -0
- package/dist/bin/shell/chunks/chunk-435ZOZCY.js +63 -0
- package/dist/bin/shell/chunks/chunk-4FNW6LFM.js +5 -0
- package/dist/bin/shell/chunks/chunk-4PZYIYYG.js +36 -0
- package/dist/bin/shell/chunks/{chunk-JWVOLGWZ.js → chunk-DREQRXNN.js} +1 -1
- package/dist/bin/shell/chunks/chunk-IYZRLSTQ.js +2 -0
- package/dist/bin/shell/chunks/chunk-JJHAWOIB.js +2 -0
- package/dist/bin/shell/chunks/{chunk-F37UEO7A.js → chunk-JNPUO56K.js} +1 -1
- package/dist/bin/{chunks/chunk-DAGNL3F2.js → shell/chunks/chunk-MZKPWGID.js} +24 -24
- package/dist/bin/shell/chunks/{chunk-45MJQ2LX.js → chunk-OKL2SPHK.js} +32 -32
- package/dist/bin/shell/chunks/{expansion-QVHAYGVZ.js → expansion-TCB3WZP5.js} +1 -1
- package/dist/bin/shell/chunks/{flag-coverage-F4EAJUHL.js → flag-coverage-LQ37DA4R.js} +1 -1
- package/dist/bin/{chunks/gzip-EENEW6WQ.js → shell/chunks/gzip-RQ5RIFJV.js} +1 -1
- package/dist/bin/shell/chunks/python3-74B25WCY.js +17 -0
- package/dist/bin/{chunks/sleep-RA6DYTJX.js → shell/chunks/sleep-GUJH2AMQ.js} +1 -1
- package/dist/bin/shell/chunks/sqlite3-57UI7HYL.js +2 -0
- package/dist/bin/{chunks/tar-GP2CCB47.js → shell/chunks/tar-VIYVHMER.js} +1 -1
- package/dist/bin/shell/chunks/time-FAWHHOMA.js +2 -0
- package/dist/bin/shell/chunks/timeout-4O4YYRTS.js +2 -0
- package/dist/bin/shell/shell.js +252 -252
- package/dist/bundle/browser.js +739 -738
- package/dist/bundle/chunks/{chunk-WCVBECE6.js → chunk-4VCAQZKQ.js} +32 -32
- package/dist/bundle/chunks/chunk-5CJQNRNJ.js +62 -0
- package/dist/bundle/chunks/{chunk-VFBZTF5G.js → chunk-7BQDVPII.js} +1 -1
- package/dist/bundle/chunks/chunk-7KHLIOOW.js +4 -0
- package/dist/bundle/chunks/chunk-BEFDX7IY.js +1 -0
- package/dist/bundle/chunks/{chunk-DZ33S2U7.js → chunk-FO655G4V.js} +24 -24
- package/dist/bundle/chunks/chunk-NBAARP4B.js +1 -0
- package/dist/bundle/chunks/{chunk-HBB2R24Y.js → chunk-OKEHYWBE.js} +1 -1
- package/dist/bundle/chunks/chunk-RHOPHAL6.js +35 -0
- package/dist/bundle/chunks/{chunk-DKOIE53N.js → chunk-UJIR5V54.js} +1 -1
- package/dist/bundle/chunks/chunk-YIY2RKBW.js +13 -0
- package/dist/bundle/chunks/{expansion-NCEBD7KB.js → expansion-HJ6B4DDG.js} +1 -1
- package/dist/bundle/chunks/{flag-coverage-U322DJFL.js → flag-coverage-MPLWXQQK.js} +1 -1
- package/dist/bundle/chunks/{gzip-UTSGNF5Z.js → gzip-Y4N2UKE7.js} +1 -1
- package/dist/bundle/chunks/python3-6BKA3FYA.js +16 -0
- package/dist/bundle/chunks/rg-RAICUFGG.js +1 -0
- package/dist/bundle/chunks/{sleep-RKLUWJ7F.js → sleep-LB7FI6AB.js} +1 -1
- package/dist/bundle/chunks/sqlite3-FVNA4KNF.js +1 -0
- package/dist/bundle/chunks/{tar-H6XTXOAP.js → tar-E2DVQEWO.js} +1 -1
- package/dist/bundle/chunks/time-AGNW2ZY6.js +1 -0
- package/dist/bundle/chunks/timeout-VN35D5O7.js +1 -0
- package/dist/bundle/chunks/worker.js +154 -4
- package/dist/bundle/index.cjs +775 -773
- package/dist/bundle/index.js +263 -263
- package/dist/commands/python3/fs-bridge-handler.d.ts +5 -1
- package/dist/commands/tar/tar-options.d.ts +1 -0
- package/dist/interpreter/helpers/result.d.ts +6 -0
- package/dist/limits.d.ts +2 -0
- package/dist/network/types.d.ts +1 -1
- package/dist/sandbox/Command.d.ts +8 -1
- package/dist/sandbox/Sandbox.d.ts +1 -0
- package/dist/timers.d.ts +1 -0
- package/dist/types.d.ts +7 -0
- package/package.json +1 -1
- package/dist/bin/chunks/chunk-4QM2TCNV.js +0 -2
- package/dist/bin/chunks/chunk-C7TH4MVZ.js +0 -14
- package/dist/bin/chunks/chunk-H7Y3TH22.js +0 -36
- package/dist/bin/chunks/chunk-KTFEQPO7.js +0 -4
- package/dist/bin/chunks/chunk-QC46PWBQ.js +0 -63
- package/dist/bin/chunks/chunk-WIWKAGK6.js +0 -2
- package/dist/bin/chunks/python3-XRP5IZRL.js +0 -16
- package/dist/bin/chunks/sqlite3-ZUGDKEIT.js +0 -2
- package/dist/bin/chunks/time-E5YULACD.js +0 -2
- package/dist/bin/chunks/timeout-TCIINQNA.js +0 -2
- package/dist/bin/shell/chunks/chunk-4QM2TCNV.js +0 -2
- package/dist/bin/shell/chunks/chunk-C7TH4MVZ.js +0 -14
- package/dist/bin/shell/chunks/chunk-H7Y3TH22.js +0 -36
- package/dist/bin/shell/chunks/chunk-KTFEQPO7.js +0 -4
- package/dist/bin/shell/chunks/chunk-QC46PWBQ.js +0 -63
- package/dist/bin/shell/chunks/chunk-WIWKAGK6.js +0 -2
- package/dist/bin/shell/chunks/python3-XRP5IZRL.js +0 -16
- package/dist/bin/shell/chunks/sqlite3-ZUGDKEIT.js +0 -2
- package/dist/bin/shell/chunks/time-E5YULACD.js +0 -2
- package/dist/bin/shell/chunks/timeout-TCIINQNA.js +0 -2
- package/dist/bundle/chunks/chunk-BNVESM72.js +0 -35
- package/dist/bundle/chunks/chunk-FPGA7RT4.js +0 -62
- package/dist/bundle/chunks/chunk-JOVMV4XV.js +0 -13
- package/dist/bundle/chunks/chunk-LEOLL6PF.js +0 -1
- package/dist/bundle/chunks/chunk-R7KYILVY.js +0 -3
- package/dist/bundle/chunks/chunk-YYAPW4OA.js +0 -1
- package/dist/bundle/chunks/python3-E7VF6UYO.js +0 -15
- package/dist/bundle/chunks/rg-DMOXE47H.js +0 -1
- package/dist/bundle/chunks/sqlite3-ZGX3YFJB.js +0 -1
- package/dist/bundle/chunks/time-ZEEYNXNZ.js +0 -1
- package/dist/bundle/chunks/timeout-LYYTWG45.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{A as c,B as d,C as e,I as f,J as g,K as h,L as i,M as j,N as k,O as l,y as a,z as b}from"./chunk-
|
|
2
|
+
import{A as c,B as d,C as e,I as f,J as g,K as h,L as i,M as j,N as k,O as l,y as a,z as b}from"./chunk-OKL2SPHK.js";import"./chunk-SE4C7FJY.js";import"./chunk-6KZRLMG3.js";import"./chunk-OBH7XN5N.js";import"./chunk-KGOUQS5A.js";export{d as escapeGlobChars,e as escapeRegexChars,l as expandRedirectTarget,g as expandWord,i as expandWordForPattern,h as expandWordForRegex,j as expandWordWithGlob,a as getArrayElements,c as getVariable,k as hasQuotedMultiValueAt,b as isArray,f as isWordFullyQuoted};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as yr}from"./chunk-
|
|
2
|
+
import{b as yr}from"./chunk-435ZOZCY.js";import{b as Ar}from"./chunk-3NVWSLHI.js";import{b as $r}from"./chunk-7SWOLTCR.js";import"./chunk-GZHFXDDO.js";import"./chunk-QSDVMMYI.js";import{c as Sr}from"./chunk-4PZYIYYG.js";import{b as wr}from"./chunk-XKPFI566.js";import{b as xr}from"./chunk-2BC3N3L2.js";import{b as vr}from"./chunk-IDGH4PGU.js";import{b as kr}from"./chunk-F3LGZXLQ.js";import{b as qr}from"./chunk-BYDV4VEF.js";import{b as Cr}from"./chunk-JLX6YWGA.js";import{b as br}from"./chunk-FLPVVSN5.js";import{d as Ir,e as Mr,f as jr}from"./chunk-MZKPWGID.js";import{b as tr}from"./chunk-DREQRXNN.js";import{b as lr}from"./chunk-2FFXXW3F.js";import{b as ur}from"./chunk-THALLNXT.js";import{b as pr}from"./chunk-2SIXTZCJ.js";import{b as er}from"./chunk-3Y32LPNT.js";import{b as dr}from"./chunk-7BORMNPQ.js";import{b as cr}from"./chunk-N43DJTSI.js";import"./chunk-OBI37ZY4.js";import{b as hr}from"./chunk-N5OTVT4F.js";import{c as or,d as ar}from"./chunk-MAVV76T4.js";import{b as sr}from"./chunk-JTF74J6E.js";import{c as ir,d as gr}from"./chunk-GO6FXSC4.js";import{b as mr}from"./chunk-RYXW3SZQ.js";import"./chunk-EPIOK4SY.js";import"./chunk-UYBH3FNE.js";import{b as Fr}from"./chunk-BARKRZDC.js";import{b as zr}from"./chunk-P6GNZPVW.js";import{b as fr}from"./chunk-LOJMXC4F.js";import{b as nr}from"./chunk-JNPUO56K.js";import{b as R}from"./chunk-PQNTKMH3.js";import{b as U}from"./chunk-PPBQJBC2.js";import{b as V}from"./chunk-NSUMEERA.js";import{b as W}from"./chunk-XY5HGZW5.js";import{c as X,d as Y}from"./chunk-N4EU64Y4.js";import{c as Z,d as _}from"./chunk-3MBAUIBB.js";import{b as N}from"./chunk-RT7TRQVZ.js";import{b as rr}from"./chunk-47HZU3SY.js";import{b as G}from"./chunk-RJSAGJQJ.js";import{b as H}from"./chunk-YEKSVVRC.js";import{b as J}from"./chunk-26NO42TF.js";import{b as K}from"./chunk-LGJM5YFT.js";import{b as L}from"./chunk-LMK6G2HH.js";import{b as O}from"./chunk-ZKC5HQYO.js";import{b as P}from"./chunk-ROJPSS6N.js";import{b as Q}from"./chunk-253LRF5J.js";import{b as y}from"./chunk-NEQEZ32M.js";import{b as A}from"./chunk-ZA4HUKJ3.js";import{b as $}from"./chunk-5U7Q4GUC.js";import{b as S}from"./chunk-JQBC3FXE.js";import{b as T}from"./chunk-KPWFKFSD.js";import{b as B}from"./chunk-5G2VOPPJ.js";import{b as D}from"./chunk-SGA7Y45Z.js";import{b as E}from"./chunk-EUXCM6C4.js";import{b as w}from"./chunk-YLE2OYY6.js";import{b as x}from"./chunk-S7OHMN3F.js";import{b as v}from"./chunk-XAL6VWGA.js";import{d as k,e as q,f as C}from"./chunk-GA6KXSOC.js";import"./chunk-GIFF636B.js";import{b}from"./chunk-35JD7YEM.js";import"./chunk-4OALHZXB.js";import"./chunk-G43H2WGH.js";import{b as I}from"./chunk-6L4K3UGO.js";import{b as M}from"./chunk-VZKEP45B.js";import{b as j}from"./chunk-THLAHQXV.js";import{b as t}from"./chunk-YYQ22ZRL.js";import{b as l}from"./chunk-PS4LOXE5.js";import{b as u}from"./chunk-VNER2XXL.js";import{b as p}from"./chunk-4E3LY6YK.js";import{b as e}from"./chunk-5VFN7VVJ.js";import{b as d}from"./chunk-TEFXEYX3.js";import{b as c}from"./chunk-D2GFNFUN.js";import{b as h}from"./chunk-SXRVLCZ4.js";import"./chunk-FSZWFMB4.js";import"./chunk-4FNW6LFM.js";import"./chunk-JJHAWOIB.js";import"./chunk-4PRVMER6.js";import"./chunk-SE4C7FJY.js";import{b as i}from"./chunk-LJKIWB5F.js";import{b as g}from"./chunk-K47SEEPI.js";import"./chunk-5WFYIUU2.js";import{b as m}from"./chunk-ND23BJUM.js";import"./chunk-D5WP4CKS.js";import"./chunk-6KZRLMG3.js";import{b as F}from"./chunk-MXVNCVD6.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-KWLLB7S3.js";import{b as f}from"./chunk-EJQKHROT.js";import"./chunk-JBABAK44.js";import{b as n}from"./chunk-ITA43A73.js";import"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.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,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-MZKPWGID.js";import"./chunk-JBABAK44.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{d as flagsForFuzzing,b as gunzipCommand,e as gunzipFlagsForFuzzing,a as gzipCommand,c as zcatCommand,f as zcatFlagsForFuzzing};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as A}from"./chunk-IYZRLSTQ.js";import{b as _}from"./chunk-4FNW6LFM.js";import{a as D,b as x,c as C,d as h}from"./chunk-JJHAWOIB.js";import{a as U}from"./chunk-4PRVMER6.js";import{a as I,b as P}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.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+=`
|
|
3
|
+
python3: execution timeout exceeded
|
|
4
|
+
`,this.output.exitCode=124;break}let o=t-s;if(!await this.protocol.waitUntilReady(o)){this.output.stderr+=`
|
|
5
|
+
python3: execution timeout exceeded
|
|
6
|
+
`,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
|
|
7
|
+
`,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'
|
|
8
|
+
`,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'
|
|
9
|
+
`,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}'
|
|
10
|
+
`,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}
|
|
11
|
+
`,exitCode:1})),V.catch(E=>({success:!1,error:E.message}))]);return!F.success&&F.error?{stdout:S.stdout,stderr:`${S.stderr}python3: ${F.error}
|
|
12
|
+
`,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)
|
|
13
|
+
`,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)}'
|
|
14
|
+
`,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
|
|
15
|
+
`,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}
|
|
16
|
+
`,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)
|
|
17
|
+
`,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,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-JNPUO56K.js";import"./chunk-JJHAWOIB.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as sleepCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-435ZOZCY.js";import"./chunk-4FNW6LFM.js";import"./chunk-SE4C7FJY.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as tarCommand};
|
|
@@ -277,9 +277,80 @@ function getBlockedGlobals() {
|
|
|
277
277
|
violationType: "atomics",
|
|
278
278
|
strategy: "throw",
|
|
279
279
|
reason: "Atomics could enable side-channel communication or timing attacks"
|
|
280
|
-
}
|
|
280
|
+
},
|
|
281
281
|
// Note: Error.prepareStackTrace is handled specially in defense-in-depth-box.ts
|
|
282
282
|
// because we only want to block SETTING it, not reading (V8 reads it internally)
|
|
283
|
+
// Timing side-channel: performance.now() provides sub-millisecond resolution
|
|
284
|
+
// Note: Date.now() is intentionally NOT blocked — it's used for $SECONDS,
|
|
285
|
+
// date command, and has only ~1ms resolution (vs process.hrtime at ns).
|
|
286
|
+
{
|
|
287
|
+
prop: "performance",
|
|
288
|
+
target: globalThis,
|
|
289
|
+
violationType: "performance_timing",
|
|
290
|
+
strategy: "throw",
|
|
291
|
+
reason: "performance.now() provides sub-millisecond timing for side-channel attacks"
|
|
292
|
+
},
|
|
293
|
+
// Block direct access to process.stdout and process.stderr to prevent
|
|
294
|
+
// writing to the host's actual stdout/stderr, bypassing the interpreter's
|
|
295
|
+
// output accumulation.
|
|
296
|
+
{
|
|
297
|
+
prop: "stdout",
|
|
298
|
+
target: process,
|
|
299
|
+
violationType: "process_stdout",
|
|
300
|
+
strategy: "throw",
|
|
301
|
+
reason: "process.stdout could bypass interpreter output to write to host stdout"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
prop: "stderr",
|
|
305
|
+
target: process,
|
|
306
|
+
violationType: "process_stderr",
|
|
307
|
+
strategy: "throw",
|
|
308
|
+
reason: "process.stderr could bypass interpreter output to write to host stderr"
|
|
309
|
+
},
|
|
310
|
+
// Prototype pollution vectors
|
|
311
|
+
{
|
|
312
|
+
prop: "__defineGetter__",
|
|
313
|
+
target: Object.prototype,
|
|
314
|
+
violationType: "prototype_mutation",
|
|
315
|
+
strategy: "throw",
|
|
316
|
+
reason: "__defineGetter__ allows prototype pollution via getter injection"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
prop: "__defineSetter__",
|
|
320
|
+
target: Object.prototype,
|
|
321
|
+
violationType: "prototype_mutation",
|
|
322
|
+
strategy: "throw",
|
|
323
|
+
reason: "__defineSetter__ allows prototype pollution via setter injection"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
prop: "__lookupGetter__",
|
|
327
|
+
target: Object.prototype,
|
|
328
|
+
violationType: "prototype_mutation",
|
|
329
|
+
strategy: "throw",
|
|
330
|
+
reason: "__lookupGetter__ enables introspection for prototype pollution attacks"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
prop: "__lookupSetter__",
|
|
334
|
+
target: Object.prototype,
|
|
335
|
+
violationType: "prototype_mutation",
|
|
336
|
+
strategy: "throw",
|
|
337
|
+
reason: "__lookupSetter__ enables introspection for prototype pollution attacks"
|
|
338
|
+
},
|
|
339
|
+
// Freeze JSON and Math to prevent mutation of built-in utility objects
|
|
340
|
+
{
|
|
341
|
+
prop: "JSON",
|
|
342
|
+
target: globalThis,
|
|
343
|
+
violationType: "json_mutation",
|
|
344
|
+
strategy: "freeze",
|
|
345
|
+
reason: "Freeze JSON to prevent mutation of parsing/serialization"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
prop: "Math",
|
|
349
|
+
target: globalThis,
|
|
350
|
+
violationType: "math_mutation",
|
|
351
|
+
strategy: "freeze",
|
|
352
|
+
reason: "Freeze Math to prevent mutation of math utilities"
|
|
353
|
+
}
|
|
283
354
|
];
|
|
284
355
|
try {
|
|
285
356
|
const AsyncFunction = Object.getPrototypeOf(async () => {
|
|
@@ -650,6 +721,9 @@ var WorkerDefenseInDepth = class {
|
|
|
650
721
|
if (!excludeTypes.has("module_load")) {
|
|
651
722
|
this.protectModuleLoad();
|
|
652
723
|
}
|
|
724
|
+
if (!excludeTypes.has("module_resolve_filename")) {
|
|
725
|
+
this.protectModuleResolveFilename();
|
|
726
|
+
}
|
|
653
727
|
if (!excludeTypes.has("process_main_module")) {
|
|
654
728
|
this.protectProcessMainModule();
|
|
655
729
|
}
|
|
@@ -1065,6 +1139,65 @@ var WorkerDefenseInDepth = class {
|
|
|
1065
1139
|
} catch {
|
|
1066
1140
|
}
|
|
1067
1141
|
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Protect Module._resolveFilename from being called in worker context.
|
|
1144
|
+
*
|
|
1145
|
+
* Module._resolveFilename is called for both require() and import() resolution.
|
|
1146
|
+
* Blocking it catches file-based import() specifiers.
|
|
1147
|
+
*
|
|
1148
|
+
* data: and blob: URLs are handled by ESM loader hooks registered
|
|
1149
|
+
* in the main thread (DefenseInDepthBox.protectDynamicImport).
|
|
1150
|
+
*/
|
|
1151
|
+
protectModuleResolveFilename() {
|
|
1152
|
+
const self = this;
|
|
1153
|
+
const auditMode = this.config.auditMode;
|
|
1154
|
+
try {
|
|
1155
|
+
let ModuleClass = null;
|
|
1156
|
+
if (typeof process !== "undefined") {
|
|
1157
|
+
const mainModule = process.mainModule;
|
|
1158
|
+
if (mainModule && typeof mainModule === "object") {
|
|
1159
|
+
ModuleClass = mainModule.constructor;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
if (!ModuleClass && typeof __require !== "undefined" && typeof __require.main !== "undefined") {
|
|
1163
|
+
ModuleClass = __require.main.constructor;
|
|
1164
|
+
}
|
|
1165
|
+
if (!ModuleClass || typeof ModuleClass._resolveFilename !== "function") {
|
|
1166
|
+
return;
|
|
1167
|
+
}
|
|
1168
|
+
const original = ModuleClass._resolveFilename;
|
|
1169
|
+
const descriptor = Object.getOwnPropertyDescriptor(
|
|
1170
|
+
ModuleClass,
|
|
1171
|
+
"_resolveFilename"
|
|
1172
|
+
);
|
|
1173
|
+
this.originalDescriptors.push({
|
|
1174
|
+
target: ModuleClass,
|
|
1175
|
+
prop: "_resolveFilename",
|
|
1176
|
+
descriptor
|
|
1177
|
+
});
|
|
1178
|
+
const path = "Module._resolveFilename";
|
|
1179
|
+
const proxy = new this.originalProxy(original, {
|
|
1180
|
+
apply(_target, _thisArg, _args) {
|
|
1181
|
+
const message = `${path} is blocked in worker context`;
|
|
1182
|
+
const violation = self.recordViolation(
|
|
1183
|
+
"module_resolve_filename",
|
|
1184
|
+
path,
|
|
1185
|
+
message
|
|
1186
|
+
);
|
|
1187
|
+
if (!auditMode) {
|
|
1188
|
+
throw new WorkerSecurityViolationError(message, violation);
|
|
1189
|
+
}
|
|
1190
|
+
return Reflect.apply(_target, _thisArg, _args);
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
Object.defineProperty(ModuleClass, "_resolveFilename", {
|
|
1194
|
+
value: proxy,
|
|
1195
|
+
writable: true,
|
|
1196
|
+
configurable: true
|
|
1197
|
+
});
|
|
1198
|
+
} catch {
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1068
1201
|
/**
|
|
1069
1202
|
* Apply a single patch to a blocked global.
|
|
1070
1203
|
*/
|
|
@@ -1125,6 +1258,7 @@ var _setTimeout = globalThis.setTimeout;
|
|
|
1125
1258
|
var _clearTimeout = globalThis.clearTimeout;
|
|
1126
1259
|
var _SharedArrayBuffer = globalThis.SharedArrayBuffer;
|
|
1127
1260
|
var _Atomics = globalThis.Atomics;
|
|
1261
|
+
var _performanceNow = performance.now.bind(performance);
|
|
1128
1262
|
|
|
1129
1263
|
// src/commands/python3/protocol.ts
|
|
1130
1264
|
var OpCode = {
|
|
@@ -1548,11 +1682,17 @@ var SyncFsBackend = class {
|
|
|
1548
1682
|
}
|
|
1549
1683
|
writeStdout(data) {
|
|
1550
1684
|
const encoded = new TextEncoder().encode(data);
|
|
1551
|
-
this.execSync(OpCode.WRITE_STDOUT, "", encoded);
|
|
1685
|
+
const result = this.execSync(OpCode.WRITE_STDOUT, "", encoded);
|
|
1686
|
+
if (!result.success) {
|
|
1687
|
+
throw new Error(result.error || "Failed to write stdout");
|
|
1688
|
+
}
|
|
1552
1689
|
}
|
|
1553
1690
|
writeStderr(data) {
|
|
1554
1691
|
const encoded = new TextEncoder().encode(data);
|
|
1555
|
-
this.execSync(OpCode.WRITE_STDERR, "", encoded);
|
|
1692
|
+
const result = this.execSync(OpCode.WRITE_STDERR, "", encoded);
|
|
1693
|
+
if (!result.success) {
|
|
1694
|
+
throw new Error(result.error || "Failed to write stderr");
|
|
1695
|
+
}
|
|
1556
1696
|
}
|
|
1557
1697
|
exit(code) {
|
|
1558
1698
|
this.execSync(OpCode.EXIT, "", void 0, code);
|
|
@@ -2513,12 +2653,22 @@ sys.exit(_jb_exit_code)
|
|
|
2513
2653
|
var defense = null;
|
|
2514
2654
|
function activateDefense() {
|
|
2515
2655
|
if (defense) return;
|
|
2656
|
+
const _DateNow = Date.now;
|
|
2657
|
+
const degraded = { now: () => _DateNow(), timeOrigin: _DateNow() };
|
|
2658
|
+
Object.defineProperty(globalThis, "performance", {
|
|
2659
|
+
value: degraded,
|
|
2660
|
+
writable: true,
|
|
2661
|
+
configurable: true
|
|
2662
|
+
});
|
|
2516
2663
|
defense = new WorkerDefenseInDepth({
|
|
2517
2664
|
excludeViolationTypes: [
|
|
2518
2665
|
// SharedArrayBuffer/Atomics: Used by sync-fs-backend.ts for synchronous
|
|
2519
2666
|
// filesystem communication between the WASM thread and the main thread.
|
|
2520
2667
|
"shared_array_buffer",
|
|
2521
|
-
"atomics"
|
|
2668
|
+
"atomics",
|
|
2669
|
+
// performance: Excluded because we replaced it above with a ms-precision
|
|
2670
|
+
// stub. Defense doesn't need to block it — it's already degraded.
|
|
2671
|
+
"performance_timing"
|
|
2522
2672
|
],
|
|
2523
2673
|
onViolation: (v) => {
|
|
2524
2674
|
parentPort?.postMessage({ type: "security-violation", violation: v });
|