just-bash 2.13.1 → 2.14.1
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/README.md +2 -0
- package/dist/AGENTS.md +2 -0
- package/dist/bin/chunks/{chunk-TKTKRRAL.js → chunk-3KAVXQP4.js} +1 -1
- package/dist/bin/chunks/{chunk-OQV5J23L.js → chunk-7G3MC56B.js} +1 -1
- package/dist/bin/chunks/{chunk-YX7OOTPO.js → chunk-AZ3RUDR2.js} +1 -1
- package/dist/bin/chunks/{chunk-UPUMZYZE.js → chunk-CM4532DS.js} +18 -18
- package/dist/bin/{shell/chunks/chunk-R2LDP472.js → chunks/chunk-EPPBDXOG.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-LGF54XJQ.js → chunks/chunk-L2JBII6Z.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-SYL34GE7.js → chunks/chunk-NAX7MTAR.js} +1 -1
- package/dist/bin/chunks/{chunk-EZS766DD.js → chunk-NLBRLRWD.js} +1 -1
- package/dist/bin/chunks/chunk-RLNOQILG.js +2 -0
- package/dist/bin/chunks/{chunk-VVFGRIJZ.js → chunk-RMQC3GS7.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-GR23MPTT.js → chunks/chunk-VHUYNUT7.js} +1 -1
- package/dist/bin/chunks/chunk-VRUXUVWB.js +63 -0
- package/dist/bin/{shell/chunks/chunk-FBJJY4ZV.js → chunks/chunk-WXMBDX4P.js} +1 -1
- package/dist/bin/chunks/expr-4CJYC4LY.js +2 -0
- package/dist/bin/{shell/chunks/flag-coverage-A4G6STMS.js → chunks/flag-coverage-NSXW5TJP.js} +1 -1
- package/dist/bin/{shell/chunks/jq-V7FYGIKO.js → chunks/jq-FIV5Q5T4.js} +1 -1
- package/dist/bin/chunks/{js-exec-JORCTVUT.js → js-exec-BDQGEAU6.js} +8 -8
- package/dist/bin/chunks/{ln-VAOSD4HK.js → ln-EGC4HRXZ.js} +1 -1
- package/dist/bin/chunks/{mkdir-CH7JGW4N.js → mkdir-Z47OISSR.js} +1 -1
- package/dist/bin/chunks/python3-VCIXXAXF.js +12 -0
- package/dist/bin/chunks/{rm-GWYJO4W7.js → rm-L3NZOLLG.js} +1 -1
- package/dist/bin/chunks/{sed-3C6IBX5L.js → sed-HALRQZKY.js} +1 -1
- package/dist/bin/chunks/{sqlite3-TZEE4O7U.js → sqlite3-CVNFMP3Z.js} +1 -1
- package/dist/bin/{shell/chunks/tar-TOWX2TDU.js → chunks/tar-DNUNEW4Z.js} +1 -1
- package/dist/bin/chunks/time-5R4QWCYF.js +2 -0
- package/dist/bin/{shell/chunks/tr-LZF57GYP.js → chunks/tr-4FPGAEVB.js} +1 -1
- package/dist/bin/chunks/worker.js +19 -7
- package/dist/bin/chunks/{yq-JJLSDDST.js → yq-Q47JUWL6.js} +1 -1
- package/dist/bin/just-bash.js +62 -62
- package/dist/bin/shell/chunks/{chunk-TKTKRRAL.js → chunk-3KAVXQP4.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-OQV5J23L.js → chunk-7G3MC56B.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-YX7OOTPO.js → chunk-AZ3RUDR2.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-UPUMZYZE.js → chunk-CM4532DS.js} +18 -18
- package/dist/bin/{chunks/chunk-R2LDP472.js → shell/chunks/chunk-EPPBDXOG.js} +1 -1
- package/dist/bin/{chunks/chunk-LGF54XJQ.js → shell/chunks/chunk-L2JBII6Z.js} +1 -1
- package/dist/bin/{chunks/chunk-SYL34GE7.js → shell/chunks/chunk-NAX7MTAR.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-EZS766DD.js → chunk-NLBRLRWD.js} +1 -1
- package/dist/bin/shell/chunks/chunk-RLNOQILG.js +2 -0
- package/dist/bin/shell/chunks/{chunk-VVFGRIJZ.js → chunk-RMQC3GS7.js} +1 -1
- package/dist/bin/{chunks/chunk-GR23MPTT.js → shell/chunks/chunk-VHUYNUT7.js} +1 -1
- package/dist/bin/shell/chunks/chunk-VRUXUVWB.js +63 -0
- package/dist/bin/{chunks/chunk-FBJJY4ZV.js → shell/chunks/chunk-WXMBDX4P.js} +1 -1
- package/dist/bin/shell/chunks/expr-4CJYC4LY.js +2 -0
- package/dist/bin/{chunks/flag-coverage-A4G6STMS.js → shell/chunks/flag-coverage-NSXW5TJP.js} +1 -1
- package/dist/bin/{chunks/jq-V7FYGIKO.js → shell/chunks/jq-FIV5Q5T4.js} +1 -1
- package/dist/bin/shell/chunks/{js-exec-B6QNYHUL.js → js-exec-HPXZV7UJ.js} +8 -8
- package/dist/bin/shell/chunks/{ln-VAOSD4HK.js → ln-EGC4HRXZ.js} +1 -1
- package/dist/bin/shell/chunks/{mkdir-CH7JGW4N.js → mkdir-Z47OISSR.js} +1 -1
- package/dist/bin/shell/chunks/python3-KFZH67GD.js +12 -0
- package/dist/bin/shell/chunks/{rm-GWYJO4W7.js → rm-L3NZOLLG.js} +1 -1
- package/dist/bin/shell/chunks/{sed-3C6IBX5L.js → sed-HALRQZKY.js} +1 -1
- package/dist/bin/shell/chunks/{sqlite3-TZEE4O7U.js → sqlite3-CVNFMP3Z.js} +1 -1
- package/dist/bin/{chunks/tar-TOWX2TDU.js → shell/chunks/tar-DNUNEW4Z.js} +1 -1
- package/dist/bin/shell/chunks/time-5R4QWCYF.js +2 -0
- package/dist/bin/{chunks/tr-LZF57GYP.js → shell/chunks/tr-4FPGAEVB.js} +1 -1
- package/dist/bin/shell/chunks/{yq-JJLSDDST.js → yq-Q47JUWL6.js} +1 -1
- package/dist/bin/shell/shell.js +62 -62
- package/dist/bundle/browser.js +247 -247
- package/dist/bundle/chunks/chunk-3THT3N7L.js +1 -0
- package/dist/bundle/chunks/{chunk-XXZ46GOX.js → chunk-62RKD26F.js} +1 -1
- package/dist/bundle/chunks/chunk-BRGMQKJV.js +62 -0
- package/dist/bundle/chunks/{chunk-IUWCBQII.js → chunk-HWBSOZZR.js} +18 -18
- package/dist/bundle/chunks/{chunk-64CW2LGZ.js → chunk-MDDMCKUK.js} +1 -1
- package/dist/bundle/chunks/{chunk-IP7G3BNA.js → chunk-MIZPJHVH.js} +1 -1
- package/dist/bundle/chunks/{chunk-V3IEYMEA.js → chunk-OL3S66CO.js} +1 -1
- package/dist/bundle/chunks/{chunk-FGALERPA.js → chunk-PBXLG62G.js} +1 -1
- package/dist/bundle/chunks/{chunk-H2WXJGD7.js → chunk-S4EYC6T6.js} +1 -1
- package/dist/bundle/chunks/{chunk-O2DBFL6Z.js → chunk-XORM457F.js} +1 -1
- package/dist/bundle/chunks/{chunk-RUF7WQ7U.js → chunk-YCFVLTST.js} +1 -1
- package/dist/bundle/chunks/{chunk-RVT3MU3A.js → chunk-YFG2CMIF.js} +1 -1
- package/dist/bundle/chunks/{chunk-F5CMUULS.js → chunk-Z6LRHWXI.js} +1 -1
- package/dist/bundle/chunks/expr-5T3UU5KE.js +1 -0
- package/dist/bundle/chunks/{flag-coverage-G2R7PMYU.js → flag-coverage-QT4N2Z44.js} +1 -1
- package/dist/bundle/chunks/{jq-DIRZBOTX.js → jq-ODXZBPLY.js} +1 -1
- package/dist/bundle/chunks/{js-exec-YJSMH5AG.js → js-exec-4CW5N6RM.js} +8 -8
- package/dist/bundle/chunks/{ln-UJ6YJVBK.js → ln-4TRFBYAT.js} +1 -1
- package/dist/bundle/chunks/{mkdir-F6XHPXZC.js → mkdir-TDEMSB6C.js} +1 -1
- package/dist/bundle/chunks/python3-SG3DOKBZ.js +11 -0
- package/dist/bundle/chunks/{rm-FYNVTQIU.js → rm-RTZG23RL.js} +1 -1
- package/dist/bundle/chunks/{sed-DISNI47D.js → sed-VFTTATXJ.js} +1 -1
- package/dist/bundle/chunks/{sqlite3-7F22DOIP.js → sqlite3-56UMWEY3.js} +1 -1
- package/dist/bundle/chunks/{tar-232RCEFK.js → tar-ANUBEFJY.js} +1 -1
- package/dist/bundle/chunks/time-DEUO3QV2.js +1 -0
- package/dist/bundle/chunks/{tr-GVTWMRZB.js → tr-2HXZRDSW.js} +1 -1
- package/dist/bundle/chunks/worker.js +19 -7
- package/dist/bundle/chunks/{yq-XMVSIL6Z.js → yq-MJMAR36V.js} +1 -1
- package/dist/bundle/index.cjs +805 -805
- package/dist/bundle/index.js +157 -157
- package/dist/commands/tar/bzip2-compress.d.ts +17 -0
- package/dist/fs/sanitize-error.d.ts +9 -6
- package/dist/network/allow-list.d.ts +3 -2
- package/dist/network/types.d.ts +3 -0
- package/package.json +7 -7
- package/dist/bin/chunks/chunk-SYG3IW7P.js +0 -2
- package/dist/bin/chunks/chunk-WS6P4H4S.js +0 -63
- package/dist/bin/chunks/expr-VEFRBJT4.js +0 -2
- package/dist/bin/chunks/python3-PF7AHNQM.js +0 -12
- package/dist/bin/chunks/time-DDS6JJ23.js +0 -2
- package/dist/bin/shell/chunks/chunk-SYG3IW7P.js +0 -2
- package/dist/bin/shell/chunks/chunk-WS6P4H4S.js +0 -63
- package/dist/bin/shell/chunks/expr-VEFRBJT4.js +0 -2
- package/dist/bin/shell/chunks/python3-J7DP4JBQ.js +0 -12
- package/dist/bin/shell/chunks/time-DDS6JJ23.js +0 -2
- package/dist/bundle/chunks/chunk-CCNMISUL.js +0 -1
- package/dist/bundle/chunks/chunk-ZXL7TQLN.js +0 -62
- package/dist/bundle/chunks/expr-74QHYJL5.js +0 -1
- package/dist/bundle/chunks/python3-6HF56IYI.js +0 -11
- package/dist/bundle/chunks/time-YG5BMRIQ.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as _,b as O}from"./chunk-S4EYC6T6.js";import"./chunk-XHM67O4N.js";import"./chunk-CWQS3NFK.js";import{a as v,b as T}from"./chunk-A5O5YHGN.js";import"./chunk-IPJHKYVM.js";import{a as D}from"./chunk-OJDRYQWQ.js";import{c as y}from"./chunk-24IMIIXA.js";import{b as C}from"./chunk-5QMZ5MUS.js";import{a as M,b as c}from"./chunk-3THT3N7L.js";import{a as E}from"./chunk-44UOCSGV.js";import{a as b,b as P}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";import{randomBytes as $}from"node:crypto";import{fileURLToPath as Q}from"node:url";import{Worker as R}from"node:worker_threads";var U=1e4,H=6e4,I={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 L(r){let e={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(r.length===0)return e;let t=r.findIndex(o=>!o.startsWith("-")||o==="-"||o==="--");for(let o=0;o<(t===-1?r.length:t);o++){let s=r[o];if(s==="-c")return o+1>=r.length?{stdout:"",stderr:`python3: option requires an argument -- 'c'
|
|
2
|
+
`,exitCode:2}:(e.code=r[o+1],e.scriptArgs=r.slice(o+2),e);if(s==="-m")return o+1>=r.length?{stdout:"",stderr:`python3: option requires an argument -- 'm'
|
|
3
|
+
`,exitCode:2}:(e.module=r[o+1],e.scriptArgs=r.slice(o+2),e);if(s==="--version"||s==="-V")return e.showVersion=!0,e;if(s.startsWith("-")&&s!=="-")return{stdout:"",stderr:`python3: unrecognized option '${s}'
|
|
4
|
+
`,exitCode:2}}if(t!==-1){let o=r[t];o==="--"?t+1<r.length&&(e.scriptFile=r[t+1],e.scriptArgs=r.slice(t+2)):(e.scriptFile=o,e.scriptArgs=r.slice(t+1))}return e}var k=new WeakMap;function z(r){let e=k.get(r);return e||(e={executionQueue:[],isExecuting:!1},k.set(r,e)),e}function ie(){k=new WeakMap}var N=Q(new URL("./worker.js",import.meta.url));function B(){return $(16).toString("hex")}function V(r,e){if(!r||typeof r!="object")return{success:!1,error:"Malformed worker response"};let t=r;return typeof t.protocolToken!="string"||t.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}: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 a(r){if(r.isExecuting||r.executionQueue.length===0)return;for(;r.executionQueue.length>0&&r.executionQueue[0].canceled;)r.executionQueue.shift();if(r.executionQueue.length===0)return;let e=r.executionQueue.shift();if(!e)return;r.isExecuting=!0;let t;try{t=C.runTrusted(()=>new R(N,{workerData:e.input}))}catch(n){let i=n instanceof Error?n.message:String(n);e.resolve({success:!1,error:c(i)}),r.isExecuting=!1,a(r);return}e.workerRef&&(e.workerRef.current=t);let o=y(e.requireDefenseContext,"python3","worker message callback",n=>{e.resolve(V(n,e.input.protocolToken)),r.isExecuting=!1,t.terminate(),a(r)}),s=y(e.requireDefenseContext,"python3","worker error callback",n=>{let i=c(E(n));e.resolve({success:!1,error:i}),r.isExecuting=!1,a(r)}),p=y(e.requireDefenseContext,"python3","worker exit callback",()=>{r.isExecuting&&(e.resolve({success:!1,error:"Worker exited unexpectedly"}),r.isExecuting=!1,a(r))}),f=n=>{try{o(n)}catch(i){let m=i instanceof Error?i.message:String(i);e.resolve({success:!1,error:c(m)}),r.isExecuting=!1,t.terminate(),a(r)}},l=n=>{try{s(n)}catch(i){let m=i instanceof Error?i.message:String(i);e.resolve({success:!1,error:c(m)}),r.isExecuting=!1,a(r)}},g=()=>{try{p()}catch(n){let i=n instanceof Error?n.message:String(n);e.resolve({success:!1,error:c(i)}),r.isExecuting=!1,a(r)}};t.on("message",f),t.on("error",l),t.on("exit",g)}async function j(r,e,t,o=[]){let s=_(),p=new O(s,e.fs,e.cwd,"python3",e.fetch,e.limits?.maxOutputSize??0),f=e.limits?.maxPythonTimeoutMs??U,l=e.fetch?Math.max(f,H):f,g=z(e.fs),n={protocolToken:B(),sharedBuffer:s,pythonCode:r,cwd:e.cwd,env:D(e.env),args:o,scriptPath:t,timeoutMs:l},i={current:null},m=new Promise(u=>{let d={input:n,resolve:()=>{},workerRef:i,requireDefenseContext:e.requireDefenseContext},A=y(e.requireDefenseContext,"python3","worker timeout callback",()=>{i.current?i.current.terminate():d.canceled=!0,u({success:!1,error:`Execution timeout: exceeded ${l}ms limit`})}),F=v(()=>{try{A()}catch(h){let W=h instanceof Error?h.message:String(h);u({success:!1,error:c(W)})}},l);d.resolve=h=>{T(F),u(h)},g.executionQueue.push(d),a(g)}),[x,w]=await Promise.all([p.run(l).catch(u=>({stdout:"",stderr:`python3: bridge error: ${c(E(u))}
|
|
5
|
+
`,exitCode:1})),m.catch(u=>({success:!1,error:c(E(u))}))]);if(!w.success&&w.error){let u=c(w.error);return{stdout:x.stdout,stderr:`${x.stderr}python3: ${u}
|
|
6
|
+
`,exitCode:x.exitCode||1}}return x}var Y={name:"python3",async execute(r,e){if(P(r))return b(I);let t=L(r);if("exitCode"in t)return t;if(t.showVersion)return{stdout:`Python 3.13.2 (Emscripten)
|
|
7
|
+
`,stderr:"",exitCode:0};let o,s;if(t.code!==null)o=t.code,s="-c";else if(t.module!==null){if(!/^[a-zA-Z_][a-zA-Z0-9_.]*$/.test(t.module))return{stdout:"",stderr:`python3: No module named '${t.module.slice(0,200)}'
|
|
8
|
+
`,exitCode:1};o=`import runpy; runpy.run_module('${t.module}', run_name='__main__')`,s=t.module}else if(t.scriptFile!==null){let p=e.fs.resolvePath(e.cwd,t.scriptFile);if(!await e.fs.exists(p))return{stdout:"",stderr:`python3: can't open file '${t.scriptFile}': [Errno 2] No such file or directory
|
|
9
|
+
`,exitCode:2};try{o=await e.fs.readFile(p),s=t.scriptFile}catch(f){let l=M(f.message);return{stdout:"",stderr:`python3: can't open file '${t.scriptFile}': ${l}
|
|
10
|
+
`,exitCode:2}}}else if(e.stdin.trim())o=e.stdin,s="<stdin>";else return{stdout:"",stderr:`python3: no input provided (use -c CODE, -m MODULE, or provide a script file)
|
|
11
|
+
`,exitCode:2};return j(o,e,s,t.scriptArgs)}},ce={name:"python",async execute(r,e){return Y.execute(r,e)}};export{ie as _resetExecutionQueue,Y as python3Command,ce as pythonCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-MIZPJHVH.js";import"./chunk-3THT3N7L.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 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-OL3S66CO.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YNYSPYQ5.js";import"./chunk-GFQRA5P5.js";import"./chunk-3THT3N7L.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as sedCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-
|
|
1
|
+
import{a,b,c}from"./chunk-HWBSOZZR.js";import"./chunk-A5O5YHGN.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-3THT3N7L.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as _internals,c as flagsForFuzzing,b as sqlite3Command};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-BRGMQKJV.js";import"./chunk-X2AJGDEF.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YNYSPYQ5.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as tarCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-Z6LRHWXI.js";import"./chunk-CWQS3NFK.js";import"./chunk-IPJHKYVM.js";import"./chunk-OJDRYQWQ.js";import"./chunk-3THT3N7L.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as timeCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-62RKD26F.js";import"./chunk-3THT3N7L.js";import"./chunk-HWKDQ44K.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as trCommand};
|
|
@@ -11,17 +11,29 @@ import { dirname } from "node:path";
|
|
|
11
11
|
import { parentPort, workerData } from "node:worker_threads";
|
|
12
12
|
|
|
13
13
|
// src/fs/sanitize-error.ts
|
|
14
|
-
function
|
|
14
|
+
function sanitizeWithUnixPrefixes(message, includeHostRuntimePrefixes, includeFileUrls) {
|
|
15
15
|
if (!message) return message;
|
|
16
16
|
let sanitized = message.replace(/\n\s+at\s.*/g, "");
|
|
17
|
+
if (includeFileUrls) {
|
|
18
|
+
sanitized = sanitized.replace(/\bfile:\/\/\/?[^\s'",)}\]:]+/g, "<path>");
|
|
19
|
+
}
|
|
17
20
|
sanitized = sanitized.replace(
|
|
18
|
-
/(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,
|
|
21
|
+
includeHostRuntimePrefixes ? /(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap|workspace|root|srv|mnt|app))\b[^\s'",)}\]:]*/g : /(?:\/(?:Users|home|private|var|opt|Library|System|usr|etc|tmp|nix|snap))\b[^\s'",)}\]:]*/g,
|
|
19
22
|
"<path>"
|
|
20
23
|
);
|
|
21
24
|
sanitized = sanitized.replace(/node:internal\/[^\s'",)}\]:]+/g, "<internal>");
|
|
22
25
|
sanitized = sanitized.replace(/[A-Z]:\\[^\s'",)}\]:]+/g, "<path>");
|
|
26
|
+
if (includeFileUrls) {
|
|
27
|
+
sanitized = sanitized.replace(/\\\\[^\s\\]+\\[^\s'",)}\]:]+/g, "<path>");
|
|
28
|
+
}
|
|
23
29
|
return sanitized;
|
|
24
30
|
}
|
|
31
|
+
function sanitizeErrorMessage(message) {
|
|
32
|
+
return sanitizeWithUnixPrefixes(message, false, false);
|
|
33
|
+
}
|
|
34
|
+
function sanitizeHostErrorMessage(message) {
|
|
35
|
+
return sanitizeWithUnixPrefixes(message, true, true);
|
|
36
|
+
}
|
|
25
37
|
|
|
26
38
|
// src/security/blocked-globals.ts
|
|
27
39
|
function getBlockedGlobals() {
|
|
@@ -2760,7 +2772,7 @@ function createHTTPFS(backend, FS) {
|
|
|
2760
2772
|
});
|
|
2761
2773
|
lastResponse = encoder.encode(JSON.stringify(result));
|
|
2762
2774
|
} catch (e) {
|
|
2763
|
-
const message =
|
|
2775
|
+
const message = sanitizeHostErrorMessage(e.message);
|
|
2764
2776
|
lastResponse = encoder.encode(JSON.stringify({ error: message }));
|
|
2765
2777
|
}
|
|
2766
2778
|
}
|
|
@@ -2973,7 +2985,7 @@ async function runPython(input) {
|
|
|
2973
2985
|
printErr: onPrintErr
|
|
2974
2986
|
});
|
|
2975
2987
|
} catch (e) {
|
|
2976
|
-
const message =
|
|
2988
|
+
const message = sanitizeHostErrorMessage(e.message);
|
|
2977
2989
|
return {
|
|
2978
2990
|
success: false,
|
|
2979
2991
|
error: `Failed to load CPython: ${message}`
|
|
@@ -2988,7 +3000,7 @@ async function runPython(input) {
|
|
|
2988
3000
|
Module.FS.mkdir("/host");
|
|
2989
3001
|
Module.FS.mount(HOSTFS, { root: "/" }, "/host");
|
|
2990
3002
|
} catch (e) {
|
|
2991
|
-
const message =
|
|
3003
|
+
const message = sanitizeHostErrorMessage(e.message);
|
|
2992
3004
|
return {
|
|
2993
3005
|
success: false,
|
|
2994
3006
|
error: `Failed to mount HOSTFS: ${message}`
|
|
@@ -2999,7 +3011,7 @@ async function runPython(input) {
|
|
|
2999
3011
|
Module.FS.mkdir("/_jb_http");
|
|
3000
3012
|
Module.FS.mount(HTTPFS, { root: "/" }, "/_jb_http");
|
|
3001
3013
|
} catch (e) {
|
|
3002
|
-
const message =
|
|
3014
|
+
const message = sanitizeHostErrorMessage(e.message);
|
|
3003
3015
|
return {
|
|
3004
3016
|
success: false,
|
|
3005
3017
|
error: `Failed to mount HTTPFS: ${message}`
|
|
@@ -3079,7 +3091,7 @@ process.on("uncaughtException", (e) => {
|
|
|
3079
3091
|
if (!activeProtocolToken) {
|
|
3080
3092
|
return;
|
|
3081
3093
|
}
|
|
3082
|
-
const message =
|
|
3094
|
+
const message = sanitizeHostErrorMessage(e.message);
|
|
3083
3095
|
postWorkerMessage(activeProtocolToken, {
|
|
3084
3096
|
success: false,
|
|
3085
3097
|
error: `Worker uncaught exception: ${message}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-XORM457F.js";import"./chunk-SYMJJMQ4.js";import"./chunk-BBXLRYSX.js";import"./chunk-7TSDKFEO.js";import"./chunk-OJDRYQWQ.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YNYSPYQ5.js";import"./chunk-GFQRA5P5.js";import"./chunk-3THT3N7L.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as yqCommand};
|