just-bash 2.14.1 → 2.14.3
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/CHANGELOG.md +7 -0
- package/dist/bin/chunks/{awk2-VTJMI54B.js → awk2-DB6QZAC5.js} +1 -1
- package/dist/bin/chunks/{chunk-HJEHIH4P.js → chunk-22NDZXS5.js} +1 -1
- package/dist/bin/chunks/{chunk-L2JBII6Z.js → chunk-2HVFB2TU.js} +72 -72
- package/dist/bin/{shell/chunks/chunk-SDLWFYVT.js → chunks/chunk-A5UGPLEI.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-ZO5PSLKR.js → chunks/chunk-ARI4VLCN.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-NLBRLRWD.js → chunks/chunk-BGGF3ELU.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-VHUYNUT7.js → chunks/chunk-DU4S5MUI.js} +1 -1
- package/dist/bin/chunks/{chunk-SXB55JOI.js → chunk-EONWONZV.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-SE4C7FJY.js → chunks/chunk-JDNI5HBX.js} +13 -13
- package/dist/bin/chunks/chunk-KCMUAACL.js +19 -0
- package/dist/bin/{shell/chunks/chunk-XKPFI566.js → chunks/chunk-L6XUBS6H.js} +17 -17
- package/dist/bin/{shell/chunks/chunk-B3RU2PUI.js → chunks/chunk-LTL632J4.js} +2 -2
- package/dist/bin/chunks/chunk-NTW6IA45.js +2 -0
- package/dist/bin/{shell/chunks/chunk-A3HQTYHR.js → chunks/chunk-OXHVTSNH.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-RMQC3GS7.js → chunks/chunk-PNI5NMXP.js} +1 -1
- package/dist/bin/chunks/chunk-PXVBSPBE.js +2 -0
- package/dist/bin/{shell/chunks/chunk-YFPDB4PH.js → chunks/chunk-RA3TG4UK.js} +1 -1
- package/dist/bin/chunks/{chunk-GZHFXDDO.js → chunk-RBQGQWGV.js} +1 -1
- package/dist/bin/chunks/{chunk-THNL3XFF.js → chunk-S3QAKT3R.js} +1 -1
- package/dist/bin/chunks/{chunk-G43H2WGH.js → chunk-TTNNO45C.js} +1 -1
- package/dist/bin/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/bin/chunks/chunk-WLBA7L7U.js +23 -0
- package/dist/bin/{shell/chunks/chunk-3KAVXQP4.js → chunks/chunk-XXCTETRW.js} +2 -2
- package/dist/bin/chunks/chunk-ZUDPEMHG.js +63 -0
- package/dist/bin/chunks/{curl-SRTMGOVV.js → curl-2DCNBIKJ.js} +8 -8
- package/dist/bin/chunks/{diff-LE7GMFZD.js → diff-5NUI5BHG.js} +1 -1
- package/dist/bin/{shell/chunks/expansion-2RO5M3QC.js → chunks/expansion-QUT3FT7V.js} +1 -1
- package/dist/bin/{shell/chunks/expr-4CJYC4LY.js → chunks/expr-G4EF4POQ.js} +1 -1
- package/dist/bin/{shell/chunks/file-D5YKS5NV.js → chunks/file-MMSHRWCJ.js} +1 -1
- package/dist/bin/chunks/find-7CVMEZBO.js +2 -0
- package/dist/bin/{shell/chunks/flag-coverage-NSXW5TJP.js → chunks/flag-coverage-QMWFYZRC.js} +1 -1
- package/dist/bin/chunks/{grep-OZJTRD4D.js → grep-7BJ7HFBM.js} +1 -1
- package/dist/bin/chunks/{html-to-markdown-WVZA3MCP.js → html-to-markdown-V6PK6S5U.js} +1 -1
- package/dist/bin/{shell/chunks/jq-FIV5Q5T4.js → chunks/jq-DVZM2CEN.js} +1 -1
- package/dist/bin/chunks/{js-exec-BDQGEAU6.js → js-exec-RWEELTC2.js} +4 -4
- package/dist/bin/chunks/js-exec-worker.js +14 -3
- package/dist/bin/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
- package/dist/bin/chunks/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
- package/dist/bin/chunks/{python3-VCIXXAXF.js → python3-JUJKPBFB.js} +1 -1
- package/dist/bin/chunks/rg-DK6FRF6Q.js +2 -0
- package/dist/bin/chunks/{sed-HALRQZKY.js → sed-WWXBUNG3.js} +1 -1
- package/dist/bin/chunks/tar-GTGFEWDS.js +2 -0
- package/dist/bin/chunks/worker.js +21 -2
- package/dist/bin/chunks/{xan-MOZFJGMY.js → xan-3G6YA5O6.js} +1 -1
- package/dist/bin/chunks/xan-view-6J5MMMQB.js +2 -0
- package/dist/bin/chunks/{yq-Q47JUWL6.js → yq-CWUVVSHY.js} +1 -1
- package/dist/bin/just-bash.js +262 -262
- package/dist/bin/shell/chunks/{awk2-VTJMI54B.js → awk2-DB6QZAC5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-HJEHIH4P.js → chunk-22NDZXS5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-L2JBII6Z.js → chunk-2HVFB2TU.js} +72 -72
- package/dist/bin/{chunks/chunk-SDLWFYVT.js → shell/chunks/chunk-A5UGPLEI.js} +1 -1
- package/dist/bin/{chunks/chunk-ZO5PSLKR.js → shell/chunks/chunk-ARI4VLCN.js} +1 -1
- package/dist/bin/{chunks/chunk-NLBRLRWD.js → shell/chunks/chunk-BGGF3ELU.js} +1 -1
- package/dist/bin/{chunks/chunk-VHUYNUT7.js → shell/chunks/chunk-DU4S5MUI.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-SXB55JOI.js → chunk-EONWONZV.js} +1 -1
- package/dist/bin/shell/chunks/chunk-HC7WB764.js +2 -0
- package/dist/bin/{chunks/chunk-SE4C7FJY.js → shell/chunks/chunk-JDNI5HBX.js} +13 -13
- package/dist/bin/shell/chunks/chunk-KCMUAACL.js +19 -0
- package/dist/bin/{chunks/chunk-XKPFI566.js → shell/chunks/chunk-L6XUBS6H.js} +17 -17
- package/dist/bin/{chunks/chunk-B3RU2PUI.js → shell/chunks/chunk-LTL632J4.js} +2 -2
- package/dist/bin/shell/chunks/chunk-NTW6IA45.js +2 -0
- package/dist/bin/{chunks/chunk-A3HQTYHR.js → shell/chunks/chunk-OXHVTSNH.js} +1 -1
- package/dist/bin/{chunks/chunk-RMQC3GS7.js → shell/chunks/chunk-PNI5NMXP.js} +1 -1
- package/dist/bin/{chunks/chunk-YFPDB4PH.js → shell/chunks/chunk-RA3TG4UK.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-GZHFXDDO.js → chunk-RBQGQWGV.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-THNL3XFF.js → chunk-S3QAKT3R.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-G43H2WGH.js → chunk-TTNNO45C.js} +1 -1
- package/dist/bin/shell/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/bin/shell/chunks/chunk-WLBA7L7U.js +23 -0
- package/dist/bin/{chunks/chunk-3KAVXQP4.js → shell/chunks/chunk-XXCTETRW.js} +2 -2
- package/dist/bin/shell/chunks/chunk-ZUDPEMHG.js +63 -0
- package/dist/bin/shell/chunks/{curl-SRTMGOVV.js → curl-2DCNBIKJ.js} +8 -8
- package/dist/bin/shell/chunks/{diff-LE7GMFZD.js → diff-5NUI5BHG.js} +1 -1
- package/dist/bin/{chunks/expansion-2RO5M3QC.js → shell/chunks/expansion-QUT3FT7V.js} +1 -1
- package/dist/bin/{chunks/expr-4CJYC4LY.js → shell/chunks/expr-G4EF4POQ.js} +1 -1
- package/dist/bin/{chunks/file-D5YKS5NV.js → shell/chunks/file-MMSHRWCJ.js} +1 -1
- package/dist/bin/shell/chunks/find-7CVMEZBO.js +2 -0
- package/dist/bin/{chunks/flag-coverage-NSXW5TJP.js → shell/chunks/flag-coverage-QMWFYZRC.js} +1 -1
- package/dist/bin/shell/chunks/{grep-OZJTRD4D.js → grep-7BJ7HFBM.js} +1 -1
- package/dist/bin/shell/chunks/{html-to-markdown-WVZA3MCP.js → html-to-markdown-V6PK6S5U.js} +1 -1
- package/dist/bin/{chunks/jq-FIV5Q5T4.js → shell/chunks/jq-DVZM2CEN.js} +1 -1
- package/dist/bin/shell/chunks/{js-exec-HPXZV7UJ.js → js-exec-AKWY6BP5.js} +4 -4
- package/dist/bin/shell/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
- package/dist/bin/shell/chunks/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
- package/dist/bin/shell/chunks/{python3-KFZH67GD.js → python3-RRCCYJKA.js} +1 -1
- package/dist/bin/shell/chunks/rg-DK6FRF6Q.js +2 -0
- package/dist/bin/shell/chunks/{sed-HALRQZKY.js → sed-WWXBUNG3.js} +1 -1
- package/dist/bin/shell/chunks/tar-GTGFEWDS.js +2 -0
- package/dist/bin/shell/chunks/{xan-MOZFJGMY.js → xan-3G6YA5O6.js} +1 -1
- package/dist/bin/shell/chunks/xan-view-6J5MMMQB.js +2 -0
- package/dist/bin/shell/chunks/{yq-Q47JUWL6.js → yq-CWUVVSHY.js} +1 -1
- package/dist/bin/shell/shell.js +94 -94
- package/dist/browser.d.ts +1 -0
- package/dist/bundle/browser.js +587 -587
- package/dist/bundle/chunks/{awk2-POPGKRAI.js → awk2-RRKCSTJR.js} +1 -1
- package/dist/bundle/chunks/{chunk-FEIOJCZD.js → chunk-43RSSTFA.js} +1 -1
- package/dist/bundle/chunks/{chunk-YFG2CMIF.js → chunk-5PYKJV42.js} +1 -1
- package/dist/bundle/chunks/{chunk-XORM457F.js → chunk-75FNCC7W.js} +72 -72
- package/dist/bundle/chunks/{chunk-YS3AZT3J.js → chunk-B53Y5JFV.js} +1 -1
- package/dist/bundle/chunks/{chunk-J642UCRS.js → chunk-BAQA74XA.js} +1 -1
- package/dist/bundle/chunks/{chunk-F55TLFGB.js → chunk-DBKNVD4L.js} +1 -1
- package/dist/bundle/chunks/{chunk-LPQPILI2.js → chunk-GJTDUJ5Q.js} +1 -1
- package/dist/bundle/chunks/chunk-HL6NGDO2.js +22 -0
- package/dist/bundle/chunks/{chunk-OARHFVLG.js → chunk-HP7NBOKN.js} +1 -1
- package/dist/bundle/chunks/{chunk-S4EYC6T6.js → chunk-I57KEIP3.js} +2 -2
- package/dist/bundle/chunks/chunk-KX3P26DQ.js +1 -0
- package/dist/bundle/chunks/{chunk-BBXLRYSX.js → chunk-NRZWEENR.js} +1 -1
- package/dist/bundle/chunks/{chunk-VLGZJRPG.js → chunk-PYDZ2LCK.js} +1 -1
- package/dist/bundle/chunks/chunk-R6VWJ2ZL.js +1 -0
- package/dist/bundle/chunks/{chunk-UNYNJIFU.js → chunk-RAFHQYLP.js} +2 -2
- package/dist/bundle/chunks/{chunk-YCFVLTST.js → chunk-RQ254MFG.js} +1 -1
- package/dist/bundle/chunks/{chunk-NYQYO467.js → chunk-U6NMAV24.js} +1 -1
- package/dist/bundle/chunks/{chunk-OL3S66CO.js → chunk-VBEY5J6R.js} +1 -1
- package/dist/bundle/chunks/chunk-XIZSGUXJ.js +62 -0
- package/dist/bundle/chunks/{chunk-YNYSPYQ5.js → chunk-YSHZL3MF.js} +13 -13
- package/dist/bundle/chunks/{curl-COE4TZE6.js → curl-47BFPSFW.js} +8 -8
- package/dist/bundle/chunks/{expansion-ENLSRCXJ.js → expansion-UGGADTZC.js} +1 -1
- package/dist/bundle/chunks/{expr-5T3UU5KE.js → expr-DNFUYZGY.js} +1 -1
- package/dist/bundle/chunks/{file-ZIGAJ4YS.js → file-IGDTDPLG.js} +1 -1
- package/dist/bundle/chunks/find-KNMMLVJD.js +1 -0
- package/dist/bundle/chunks/{flag-coverage-QT4N2Z44.js → flag-coverage-XLSDDMFQ.js} +1 -1
- package/dist/bundle/chunks/{grep-3AIAIJVR.js → grep-2UMHPO7Y.js} +1 -1
- package/dist/bundle/chunks/{jq-ODXZBPLY.js → jq-LCDWFF5Y.js} +1 -1
- package/dist/bundle/chunks/{js-exec-4CW5N6RM.js → js-exec-VXN6TZ7U.js} +4 -4
- package/dist/bundle/chunks/js-exec-worker.js +14 -3
- package/dist/bundle/chunks/{python3-SG3DOKBZ.js → python3-BFV3N3GY.js} +1 -1
- package/dist/bundle/chunks/rg-KYSTAD4Q.js +1 -0
- package/dist/bundle/chunks/{sed-VFTTATXJ.js → sed-OFX3F4FE.js} +1 -1
- package/dist/bundle/chunks/tar-LYLTEJV3.js +1 -0
- package/dist/bundle/chunks/worker.js +21 -2
- package/dist/bundle/chunks/{xan-BXDXYEIB.js → xan-EY6QWK2V.js} +1 -1
- package/dist/bundle/chunks/xan-view-OW2TB7Z3.js +1 -0
- package/dist/bundle/chunks/{yq-MJMAR36V.js → yq-M7NFNNED.js} +1 -1
- package/dist/bundle/index.cjs +773 -773
- package/dist/bundle/index.js +166 -166
- package/dist/commands/js-exec/{worker.d.ts → js-exec-worker.d.ts} +2 -2
- package/dist/commands/worker-bridge/sync-backend.d.ts +1 -0
- package/dist/network/types.d.ts +2 -1
- package/package.json +7 -9
- package/dist/bin/chunks/chunk-MXVNCVD6.js +0 -30
- package/dist/bin/chunks/chunk-MY5PY2PL.js +0 -2
- package/dist/bin/chunks/chunk-N5OTVT4F.js +0 -23
- package/dist/bin/chunks/chunk-P6GNZPVW.js +0 -19
- package/dist/bin/chunks/chunk-VRUXUVWB.js +0 -63
- package/dist/bin/chunks/find-GAYRV4IF.js +0 -2
- package/dist/bin/chunks/rg-C6KMBFNG.js +0 -2
- package/dist/bin/chunks/tar-DNUNEW4Z.js +0 -2
- package/dist/bin/chunks/xan-view-5SZBYPLG.js +0 -2
- package/dist/bin/shell/chunks/chunk-D64U2VGQ.js +0 -2
- package/dist/bin/shell/chunks/chunk-MXVNCVD6.js +0 -30
- package/dist/bin/shell/chunks/chunk-N5OTVT4F.js +0 -23
- package/dist/bin/shell/chunks/chunk-P6GNZPVW.js +0 -19
- package/dist/bin/shell/chunks/chunk-VRUXUVWB.js +0 -63
- package/dist/bin/shell/chunks/find-GAYRV4IF.js +0 -2
- package/dist/bin/shell/chunks/rg-C6KMBFNG.js +0 -2
- package/dist/bin/shell/chunks/tar-DNUNEW4Z.js +0 -2
- package/dist/bin/shell/chunks/xan-view-5SZBYPLG.js +0 -2
- package/dist/bundle/chunks/chunk-BRGMQKJV.js +0 -62
- package/dist/bundle/chunks/chunk-CR5AFCPT.js +0 -22
- package/dist/bundle/chunks/chunk-XHM67O4N.js +0 -1
- package/dist/bundle/chunks/find-TPUOAIUQ.js +0 -1
- package/dist/bundle/chunks/rg-FOQSCCX3.js +0 -1
- package/dist/bundle/chunks/tar-ANUBEFJY.js +0 -1
- package/dist/bundle/chunks/xan-view-ECQUO7AJ.js +0 -1
- /package/dist/bin/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
- /package/dist/bin/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
- /package/dist/bin/shell/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
- /package/dist/bin/shell/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
- /package/dist/bundle/chunks/{chunk-SYMJJMQ4.js → chunk-PXTK5WE2.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{d}from"./chunk-CWQS3NFK.js";import{a as
|
|
1
|
+
import{b as v}from"./chunk-R6VWJ2ZL.js";import{d}from"./chunk-CWQS3NFK.js";import{a as w}from"./chunk-44UOCSGV.js";import{a as T,b,c as f}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";function c(s){let t=s.indexOf("=");if(t>=0){let a=s.slice(0,t),r=s.slice(t+1);return a?`${encodeURIComponent(a)}=${encodeURIComponent(r)}`:encodeURIComponent(r)}return encodeURIComponent(s)}function m(s){let t=s.indexOf("=");if(t<0)return null;let a=s.slice(0,t),r=s.slice(t+1),e,i,o=r.match(/;type=([^;]+)$/);o&&(i=o[1],r=r.slice(0,-o[0].length));let n=r.match(/;filename=([^;]+)/);return n&&(e=n[1],r=r.replace(n[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(e=e??r.slice(1).split("/").pop()),{name:a,value:r,filename:e,contentType:i}}function F(s,t){let a=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let e of s){let i=e.value;if(i.startsWith("@")||i.startsWith("<")){let n=i.slice(1);i=t.get(n)??""}let o=`--${a}\r
|
|
2
2
|
`;e.filename?(o+=`Content-Disposition: form-data; name="${e.name}"; filename="${e.filename}"\r
|
|
3
3
|
`,e.contentType&&(o+=`Content-Type: ${e.contentType}\r
|
|
4
4
|
`)):o+=`Content-Disposition: form-data; name="${e.name}"\r
|
|
5
5
|
`,o+=`\r
|
|
6
6
|
${i}\r
|
|
7
7
|
`,r.push(o)}return r.push(`--${a}--\r
|
|
8
|
-
`),{body:r.join(""),boundary:a}}var
|
|
9
|
-
`)}function
|
|
10
|
-
`),a}async function
|
|
8
|
+
`),{body:r.join(""),boundary:a}}var O={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data"," --data-urlencode DATA URL-encode and POST data","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]};function W(s){let t={method:"GET",headers:new d,dataBinary:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1},a=!1;for(let r=0;r<s.length;r++){let e=s[r];if(e==="-X"||e==="--request")t.method=s[++r]??"GET";else if(e.startsWith("-X"))t.method=e.slice(2);else if(e.startsWith("--request="))t.method=e.slice(10);else if(e==="-H"||e==="--header"){let i=s[++r];if(i){let o=i.indexOf(":");if(o>0){let n=i.slice(0,o).trim(),l=i.slice(o+1).trim();t.headers.append(n,l)}}}else if(e.startsWith("--header=")){let i=e.slice(9),o=i.indexOf(":");if(o>0){let n=i.slice(0,o).trim(),l=i.slice(o+1).trim();t.headers.append(n,l)}}else if(e==="-d"||e==="--data"||e==="--data-raw")t.data=s[++r]??"",a=!0;else if(e.startsWith("-d"))t.data=e.slice(2),a=!0;else if(e.startsWith("--data="))t.data=e.slice(7),a=!0;else if(e.startsWith("--data-raw="))t.data=e.slice(11),a=!0;else if(e==="--data-binary")t.data=s[++r]??"",t.dataBinary=!0,a=!0;else if(e.startsWith("--data-binary="))t.data=e.slice(14),t.dataBinary=!0,a=!0;else if(e==="--data-urlencode"){let i=s[++r]??"";t.data=(t.data?`${t.data}&`:"")+c(i),a=!0}else if(e.startsWith("--data-urlencode=")){let i=e.slice(17);t.data=(t.data?`${t.data}&`:"")+c(i),a=!0}else if(e==="-F"||e==="--form"){let i=s[++r]??"",o=m(i);o&&t.formFields.push(o),a=!0}else if(e.startsWith("--form=")){let i=e.slice(7),o=m(i);o&&t.formFields.push(o),a=!0}else if(e==="-u"||e==="--user")t.user=s[++r];else if(e.startsWith("-u"))t.user=e.slice(2);else if(e.startsWith("--user="))t.user=e.slice(7);else if(e==="-A"||e==="--user-agent")t.headers.set("User-Agent",s[++r]??"");else if(e.startsWith("-A"))t.headers.set("User-Agent",e.slice(2));else if(e.startsWith("--user-agent="))t.headers.set("User-Agent",e.slice(13));else if(e==="-e"||e==="--referer")t.headers.set("Referer",s[++r]??"");else if(e.startsWith("-e"))t.headers.set("Referer",e.slice(2));else if(e.startsWith("--referer="))t.headers.set("Referer",e.slice(10));else if(e==="-b"||e==="--cookie")t.headers.set("Cookie",s[++r]??"");else if(e.startsWith("-b"))t.headers.set("Cookie",e.slice(2));else if(e.startsWith("--cookie="))t.headers.set("Cookie",e.slice(9));else if(e==="-c"||e==="--cookie-jar")t.cookieJar=s[++r];else if(e.startsWith("--cookie-jar="))t.cookieJar=e.slice(13);else if(e==="-T"||e==="--upload-file")t.uploadFile=s[++r],t.method==="GET"&&(t.method="PUT");else if(e.startsWith("--upload-file="))t.uploadFile=e.slice(14),t.method==="GET"&&(t.method="PUT");else if(e==="-m"||e==="--max-time"){let i=parseFloat(s[++r]??"0");!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(e.startsWith("--max-time=")){let i=parseFloat(e.slice(11));!Number.isNaN(i)&&i>0&&(t.timeoutMs=i*1e3)}else if(e==="--connect-timeout"){let i=parseFloat(s[++r]??"0");!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(e.startsWith("--connect-timeout=")){let i=parseFloat(e.slice(18));!Number.isNaN(i)&&i>0&&t.timeoutMs===void 0&&(t.timeoutMs=i*1e3)}else if(e==="-o"||e==="--output")t.outputFile=s[++r];else if(e.startsWith("--output="))t.outputFile=e.slice(9);else if(e==="-O"||e==="--remote-name")t.useRemoteName=!0;else if(e==="-I"||e==="--head")t.headOnly=!0,t.method="HEAD";else if(e==="-i"||e==="--include")t.includeHeaders=!0;else if(e==="-s"||e==="--silent")t.silent=!0;else if(e==="-S"||e==="--show-error")t.showError=!0;else if(e==="-f"||e==="--fail")t.failSilently=!0;else if(e==="-L"||e==="--location")t.followRedirects=!0;else if(e==="--max-redirs")r++;else if(!e.startsWith("--max-redirs="))if(e==="-w"||e==="--write-out")t.writeOut=s[++r];else if(e.startsWith("--write-out="))t.writeOut=e.slice(12);else if(e==="-v"||e==="--verbose")t.verbose=!0;else{if(e.startsWith("--")&&e!=="--")return f("curl",e);if(e.startsWith("-")&&e!=="-")for(let i of e.slice(1))switch(i){case"s":t.silent=!0;break;case"S":t.showError=!0;break;case"f":t.failSilently=!0;break;case"L":t.followRedirects=!0;break;case"I":t.headOnly=!0,t.method="HEAD";break;case"i":t.includeHeaders=!0;break;case"O":t.useRemoteName=!0;break;case"v":t.verbose=!0;break;default:return f("curl",`-${i}`)}else e.startsWith("-")||(t.url=e)}}return a&&t.method==="GET"&&(t.method="POST"),t}function h(s){return Object.entries(s).map(([t,a])=>`${t}: ${a}`).join(`\r
|
|
9
|
+
`)}function S(s){try{return new URL(s).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function p(s,t){let a=s;return a=a.replace(/%\{http_code\}/g,String(t.status)),a=a.replace(/%\{content_type\}/g,t.headers["content-type"]||""),a=a.replace(/%\{url_effective\}/g,t.url),a=a.replace(/%\{size_download\}/g,String(t.bodyLength)),a=a.replace(/\\n/g,`
|
|
10
|
+
`),a}async function E(s,t){if(s.uploadFile){let a=t.fs.resolvePath(t.cwd,s.uploadFile);return{body:await t.fs.readFile(a)}}if(s.formFields.length>0){let a=new Map;for(let i of s.formFields)if(i.value.startsWith("@")||i.value.startsWith("<")){let o=t.fs.resolvePath(t.cwd,i.value.slice(1));try{let n=await t.fs.readFile(o);a.set(i.value.slice(1),n)}catch{a.set(i.value.slice(1),"")}}let{body:r,boundary:e}=F(s.formFields,a);return{body:r,contentType:`multipart/form-data; boundary=${e}`}}return s.data!==void 0?{body:s.data}:{}}function P(s,t){let a=new d(s.headers);if(s.user){let r=Buffer.from(s.user).toString("base64");a.set("Authorization",`Basic ${r}`)}return t&&!a.has("Content-Type")&&a.set("Content-Type",t),a}async function H(s,t,a){if(!s.cookieJar)return;let r=t["set-cookie"];if(!r)return;let e=a.fs.resolvePath(a.cwd,s.cookieJar);await a.fs.writeFile(e,r)}function R(s){return v(s,"binary")}function k(s,t,a){let r="";if(s.verbose){r+=`> ${s.method} ${a}
|
|
11
11
|
`;for(let[e,i]of s.headers)r+=`> ${e}: ${i}
|
|
12
12
|
`;r+=`>
|
|
13
13
|
`,r+=`< HTTP/1.1 ${t.status} ${t.statusText}
|
|
@@ -18,8 +18,8 @@ ${i}\r
|
|
|
18
18
|
\r
|
|
19
19
|
`),s.headOnly?s.includeHeaders||s.verbose||(r+=`HTTP/1.1 ${t.status} ${t.statusText}\r
|
|
20
20
|
`,r+=h(t.headers),r+=`\r
|
|
21
|
-
`):r+=t.body,s.writeOut&&(r+=p(s.writeOut,{status:t.status,headers:t.headers,url:t.url,bodyLength:t.body.
|
|
21
|
+
`):r+=R(t.body),s.writeOut&&(r+=p(s.writeOut,{status:t.status,headers:t.headers,url:t.url,bodyLength:t.body.byteLength})),r}var J={name:"curl",async execute(s,t){if(b(s))return T(O);let a=W(s);if("exitCode"in a)return a;let r=a;if(!r.url)return{stdout:"",stderr:`curl: no URL specified
|
|
22
22
|
`,exitCode:2};if(!t.fetch)return{stdout:"",stderr:`curl: internal error: fetch not available
|
|
23
|
-
`,exitCode:1};let e=r.url;e.match(/^https?:\/\//)||(e=`https://${e}`);try{let{body:i,contentType:o}=await
|
|
24
|
-
`:"",exitCode:22};let u=
|
|
25
|
-
`:"",exitCode:n}}}};export{
|
|
23
|
+
`,exitCode:1};let e=r.url;e.match(/^https?:\/\//)||(e=`https://${e}`);try{let{body:i,contentType:o}=await E(r,t),n=P(r,o),l=await t.fetch(e,{method:r.method,headers:n,body:i,followRedirects:r.followRedirects,timeoutMs:r.timeoutMs});if(await H(r,l.headers,t),r.failSilently&&l.status>=400)return{stdout:"",stderr:r.showError||!r.silent?`curl: (22) The requested URL returned error: ${l.status}
|
|
24
|
+
`:"",exitCode:22};let u=k(r,l,e);if(r.outputFile||r.useRemoteName){let y=r.outputFile||S(e),$=t.fs.resolvePath(t.cwd,y);await t.fs.writeFile($,r.headOnly?"":l.body),r.verbose||(u=""),r.writeOut&&(u=p(r.writeOut,{status:l.status,headers:l.headers,url:l.url,bodyLength:l.body.byteLength}))}return{stdout:u,stderr:"",exitCode:0}}catch(i){let o=w(i),n=1;return o.includes("Network access denied")?n=7:o.includes("HTTP method")&&o.includes("not allowed")?n=3:o.includes("Redirect target not in allow-list")||o.includes("Too many redirects")?n=47:o.includes("aborted")&&(n=28),{stdout:"",stderr:!r.silent||r.showError?`curl: (${n}) ${o}
|
|
25
|
+
`:"",exitCode:n}}}};export{J as curlCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-43RSSTFA.js";import"./chunk-YSHZL3MF.js";import"./chunk-GFQRA5P5.js";import"./chunk-NUFRM6SI.js";import"./chunk-DXB73IDG.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 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-5PYKJV42.js";import"./chunk-YSHZL3MF.js";import"./chunk-3THT3N7L.js";import"./chunk-DXB73IDG.js";export{a as exprCommand,b as flagsForFuzzing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-HL6NGDO2.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as fileCommand,b as flagsForFuzzing};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-GJTDUJ5Q.js";import"./chunk-X2AJGDEF.js";import"./chunk-BAQA74XA.js";import"./chunk-IPJHKYVM.js";import"./chunk-YSHZL3MF.js";import"./chunk-EEXR5ZDP.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{a as findCommand,b as flagsForFuzzing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as yr}from"./chunk-
|
|
1
|
+
import{b as yr}from"./chunk-XIZSGUXJ.js";import{b as Ar}from"./chunk-75FNCC7W.js";import{b as $r}from"./chunk-RAFHQYLP.js";import"./chunk-DBKNVD4L.js";import"./chunk-PXTK5WE2.js";import{c as Sr}from"./chunk-HWBSOZZR.js";import{b as wr}from"./chunk-MDLLFABN.js";import{b as xr}from"./chunk-MLXIYONF.js";import{b as vr}from"./chunk-A65PWWJC.js";import{b as kr}from"./chunk-MHTUABJP.js";import{b as qr}from"./chunk-4HHKTUW3.js";import{b as Cr}from"./chunk-HJQJAYMS.js";import{b as br}from"./chunk-PP6PSHAB.js";import{d as Ir,e as Mr,f as jr}from"./chunk-LTZRCH7N.js";import{b as tr}from"./chunk-YTNYSM6T.js";import{b as lr}from"./chunk-Z6LRHWXI.js";import{b as ur}from"./chunk-A7A2DBEE.js";import{b as pr}from"./chunk-5PYKJV42.js";import{b as er}from"./chunk-APT7OOP2.js";import{b as dr}from"./chunk-XKQRETAK.js";import{b as cr}from"./chunk-5V6VZH6T.js";import"./chunk-EIZGF4BS.js";import{b as hr}from"./chunk-HL6NGDO2.js";import{c as or,d as ar}from"./chunk-R6QSAL5T.js";import{b as sr}from"./chunk-LL3S3NLB.js";import{c as ir,d as gr}from"./chunk-D6CWQ5DW.js";import{b as mr}from"./chunk-RQ254MFG.js";import"./chunk-NRZWEENR.js";import{b as Fr}from"./chunk-QJ7O6ZN3.js";import{b as zr}from"./chunk-TLSUDHID.js";import{b as fr}from"./chunk-D7MEQ3VN.js";import{b as nr}from"./chunk-GOV5EKKI.js";import"./chunk-3ZUFRYJ4.js";import{b as R}from"./chunk-ALLTKNUZ.js";import{b as U}from"./chunk-4Q4SM6WR.js";import{b as V}from"./chunk-XVDPCNWR.js";import{b as W}from"./chunk-RPNGRAAP.js";import{c as X,d as Y}from"./chunk-NAERJDUW.js";import{c as Z,d as _}from"./chunk-VOBGTVA6.js";import{b as N}from"./chunk-NCNPKYJZ.js";import{b as rr}from"./chunk-TOMNU26N.js";import{b as G}from"./chunk-VJFXDYWH.js";import{b as H}from"./chunk-PYSFUGCK.js";import{b as J}from"./chunk-VYOJP4TV.js";import{b as K}from"./chunk-MYE6AGBJ.js";import{b as L}from"./chunk-LWEGUNWT.js";import{b as O}from"./chunk-A7ICOL4V.js";import{b as P}from"./chunk-55VFSPNA.js";import{b as Q}from"./chunk-GJTDUJ5Q.js";import{b as y}from"./chunk-WKFATFPP.js";import{b as A}from"./chunk-Z7JVV2SM.js";import{b as $}from"./chunk-SDNKECQQ.js";import{b as S}from"./chunk-JVPRLUMK.js";import{b as T}from"./chunk-62RKD26F.js";import{b as B}from"./chunk-QCDB2VPH.js";import{b as D}from"./chunk-F23WWYKW.js";import{b as E}from"./chunk-D4J545R4.js";import{b as w}from"./chunk-DCAAORBQ.js";import{b as x}from"./chunk-GXVXFKBA.js";import{b as v}from"./chunk-5QVNJEHU.js";import"./chunk-X2AJGDEF.js";import{d as k,e as q,f as C}from"./chunk-B53Y5JFV.js";import"./chunk-BAQA74XA.js";import{b}from"./chunk-U6NMAV24.js";import"./chunk-7TSDKFEO.js";import"./chunk-PYDZ2LCK.js";import{b as I}from"./chunk-VBEY5J6R.js";import{b as M}from"./chunk-HP7NBOKN.js";import{b as j}from"./chunk-KMEYNNUA.js";import{b as t}from"./chunk-MIZPJHVH.js";import{b as l}from"./chunk-NUYSJFDK.js";import{b as u}from"./chunk-A4JSPFCI.js";import{b as p}from"./chunk-PBXLG62G.js";import{b as e}from"./chunk-4GTNDTRF.js";import{b as d}from"./chunk-A4HU7SVR.js";import{b as c}from"./chunk-HJWBQKYG.js";import{b as h}from"./chunk-64BAICW3.js";import"./chunk-HDQ56CKY.js";import"./chunk-CWQS3NFK.js";import"./chunk-A5O5YHGN.js";import"./chunk-IPJHKYVM.js";import"./chunk-OJDRYQWQ.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YSHZL3MF.js";import{b as i}from"./chunk-GCTKCWKD.js";import{b as g}from"./chunk-TXBZCHCQ.js";import"./chunk-7L36YK2X.js";import{b as m}from"./chunk-T56QNPHK.js";import"./chunk-EEXR5ZDP.js";import"./chunk-GFQRA5P5.js";import{b as F}from"./chunk-V7TAPXDL.js";import"./chunk-NUFRM6SI.js";import{b as z}from"./chunk-MDDMCKUK.js";import"./chunk-3THT3N7L.js";import{b as f}from"./chunk-OCS6LSEM.js";import"./chunk-HWKDQ44K.js";import{b as n}from"./chunk-OCLXQMOG.js";import"./chunk-44UOCSGV.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-B53Y5JFV.js";import"./chunk-BAQA74XA.js";import"./chunk-PYDZ2LCK.js";import"./chunk-YSHZL3MF.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{c as egrepCommand,f as egrepFlagsForFuzzing,b as fgrepCommand,e as fgrepFlagsForFuzzing,d as flagsForFuzzing,a as grepCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-RQ254MFG.js";import"./chunk-NRZWEENR.js";import"./chunk-7TSDKFEO.js";import"./chunk-OJDRYQWQ.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YSHZL3MF.js";import"./chunk-7L36YK2X.js";import"./chunk-GFQRA5P5.js";import"./chunk-NUFRM6SI.js";import"./chunk-3THT3N7L.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as jqCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as A,b as P}from"./chunk-
|
|
1
|
+
import{a as A,b as P}from"./chunk-I57KEIP3.js";import"./chunk-KX3P26DQ.js";import"./chunk-R6VWJ2ZL.js";import"./chunk-CWQS3NFK.js";import{a as k,b as T}from"./chunk-A5O5YHGN.js";import"./chunk-IPJHKYVM.js";import{a as W}from"./chunk-OJDRYQWQ.js";import{b as C}from"./chunk-5QMZ5MUS.js";import{a as M,b as y}from"./chunk-3THT3N7L.js";import{a as v}from"./chunk-44UOCSGV.js";import{b as F}from"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";import{AsyncLocalStorage as U}from"node:async_hooks";import{randomBytes as I}from"node:crypto";import{fileURLToPath as J}from"node:url";import{Worker as D}from"node:worker_threads";var N=1e4,H=6e4,B=new U,_=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
|
|
2
2
|
|
|
3
3
|
Usage: js-exec [OPTIONS] [-c CODE | FILE] [ARGS...]
|
|
4
4
|
|
|
@@ -85,9 +85,9 @@ Limits:
|
|
|
85
85
|
Engine: QuickJS (compiled to WebAssembly)
|
|
86
86
|
`;function z(t){let e={code:null,scriptFile:null,showVersion:!1,scriptArgs:[],isModule:!1,stripTypes:!1};if(t.length===0)return e;for(let r=0;r<t.length;r++){let s=t[r];if(s==="-m"||s==="--module"){e.isModule=!0;continue}if(s==="--strip-types"){e.stripTypes=!0;continue}if(s==="-c")return r+1>=t.length?{stdout:"",stderr:`js-exec: option requires an argument -- 'c'
|
|
87
87
|
`,exitCode:2}:(e.code=t[r+1],e.scriptArgs=t.slice(r+2),e);if(s==="--version"||s==="-V")return e.showVersion=!0,e;if(s.startsWith("-")&&s!=="-"&&s!=="--")return{stdout:"",stderr:`js-exec: unrecognized option '${s}'
|
|
88
|
-
`,exitCode:2};if(s==="--")return r+1<t.length&&(e.scriptFile=t[r+1],e.scriptArgs=t.slice(r+2)),e;if(!s.startsWith("-"))return e.scriptFile=s,e.scriptArgs=t.slice(r+1),e}return e}var i=null,w=null,c=[],o=null,$=J(new URL("./worker.js",import.meta.url));function p(){for(;c.length>0&&c[0].canceled;)c.shift();if(o||c.length===0)return;let t=c.shift();if(!t)return;o=t,Q().postMessage(o.input)}function V(t,e){if(!t||typeof t!="object")return{success:!1,error:"Malformed worker response"};let r=t;return typeof r.protocolToken!="string"||r.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?{success:!0}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}function Q(){if(w&&(T(w),w=null),i)return i;let t=C.runTrusted(()=>new D($));return i=t,t.on("message",e=>{if(i===t){if(o){let r=V(e,o.input.protocolToken);o.resolve(r),o=null}c.length>0?p():G()}}),t.on("error",e=>{if(i===t){if(o){let r=
|
|
89
|
-
`,exitCode:1}:X(t,e,r,s,n,u,a)}async function X(t,e,r,s=[],n,u,a){let m=A(),d=e.exec,g=d?(l,
|
|
90
|
-
`,exitCode:
|
|
88
|
+
`,exitCode:2};if(s==="--")return r+1<t.length&&(e.scriptFile=t[r+1],e.scriptArgs=t.slice(r+2)),e;if(!s.startsWith("-"))return e.scriptFile=s,e.scriptArgs=t.slice(r+1),e}return e}var i=null,w=null,c=[],o=null,$=J(new URL("./js-exec-worker.js",import.meta.url));function p(){for(;c.length>0&&c[0].canceled;)c.shift();if(o||c.length===0)return;let t=c.shift();if(!t)return;o=t,Q().postMessage(o.input)}function V(t,e){if(!t||typeof t!="object")return{success:!1,error:"Malformed worker response"};let r=t;return typeof r.protocolToken!="string"||r.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?{success:!0}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}function Q(){if(w&&(T(w),w=null),i)return i;let t=C.runTrusted(()=>new D($));return i=t,t.on("message",e=>{if(i===t){if(o){let r=V(e,o.input.protocolToken);o.resolve(r),o=null}c.length>0?p():G()}}),t.on("error",e=>{if(i===t){if(o){let r=y(v(e));o.resolve({success:!1,error:r}),o=null}for(let r of c)r.resolve({success:!1,error:"Worker crashed"});c.length=0,i=null}}),t.on("exit",()=>{i===t&&(i=null,o&&(o.resolve({success:!1,error:"Worker exited unexpectedly"}),o=null),c.length>0&&p())}),t}function G(){w=k(()=>{i&&!o&&c.length===0&&(i.terminate(),i=null)},5e3)}async function K(t,e,r,s=[],n,u,a){return B.getStore()?{stdout:"",stderr:`js-exec: recursive invocation is not supported
|
|
89
|
+
`,exitCode:1}:X(t,e,r,s,n,u,a)}async function X(t,e,r,s=[],n,u,a){let m=A(),d=e.exec,g=d?(l,b)=>B.run(!0,()=>d(l,b)):void 0,q=new P(m,e.fs,e.cwd,"js-exec",e.fetch,e.limits?.maxOutputSize??0,g),E=e.limits?.maxJsTimeoutMs??N,h=e.fetch?Math.max(E,H):E,O={protocolToken:I(16).toString("hex"),sharedBuffer:m,jsCode:t,cwd:e.cwd,env:W(e.env),args:s,scriptPath:r,bootstrapCode:n,isModule:u,stripTypes:a,timeoutMs:h},j,L=new Promise(l=>{j=l}),f={input:O,resolve:()=>{}},R=k(()=>{if(o===f){let l=i;l&&(i=null,l.terminate()),o=null,p()}else f.canceled=!0,o||p();f.resolve({success:!1,error:`Execution timeout: exceeded ${h}ms limit`})},h);f.resolve=l=>{T(R),j(l)},c.push(f),p();let[x,S]=await Promise.all([q.run(h),L.catch(l=>({success:!1,error:y(v(l))}))]);return!S.success&&S.error?{stdout:x.stdout,stderr:`${x.stderr}js-exec: ${y(S.error)}
|
|
90
|
+
`,exitCode:x.exitCode||1}:x}var de={name:"js-exec",async execute(t,e){if(F(t))return{stdout:_,stderr:"",exitCode:0};let r=z(t);if("exitCode"in r)return r;if(r.showVersion)return{stdout:`QuickJS (quickjs-emscripten)
|
|
91
91
|
`,stderr:"",exitCode:0};let s,n;if(r.code!==null)s=r.code,n="-c";else if(r.scriptFile!==null){let d=e.fs.resolvePath(e.cwd,r.scriptFile);if(!await e.fs.exists(d))return{stdout:"",stderr:`js-exec: can't open file '${r.scriptFile}': No such file or directory
|
|
92
92
|
`,exitCode:2};try{s=await e.fs.readFile(d),n=d}catch(g){return{stdout:"",stderr:`js-exec: can't open file '${r.scriptFile}': ${M(g.message)}
|
|
93
93
|
`,exitCode:2}}}else if(e.stdin.trim())s=e.stdin,n="<stdin>";else return{stdout:"",stderr:`js-exec: no input provided (use -c CODE or provide a script file)
|
|
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// src/commands/js-exec/worker.ts
|
|
8
|
+
// src/commands/js-exec/js-exec-worker.ts
|
|
9
9
|
import { stripTypeScriptTypes } from "node:module";
|
|
10
10
|
import { parentPort } from "node:worker_threads";
|
|
11
11
|
import {
|
|
@@ -499,6 +499,7 @@ var WorkerSecurityViolationError = class extends Error {
|
|
|
499
499
|
this.violation = violation;
|
|
500
500
|
this.name = "WorkerSecurityViolationError";
|
|
501
501
|
}
|
|
502
|
+
violation;
|
|
502
503
|
};
|
|
503
504
|
var MAX_STORED_VIOLATIONS = 1e3;
|
|
504
505
|
function generateExecutionId() {
|
|
@@ -1975,7 +1976,17 @@ var SyncBackend = class {
|
|
|
1975
1976
|
throw new Error(result.error || "HTTP request failed");
|
|
1976
1977
|
}
|
|
1977
1978
|
const responseJson = new TextDecoder().decode(result.result);
|
|
1978
|
-
|
|
1979
|
+
const parsed = JSON.parse(responseJson);
|
|
1980
|
+
const bodyBase64 = parsed.bodyBase64 ?? "";
|
|
1981
|
+
const body = atob(bodyBase64);
|
|
1982
|
+
return {
|
|
1983
|
+
status: parsed.status,
|
|
1984
|
+
statusText: parsed.statusText,
|
|
1985
|
+
headers: parsed.headers,
|
|
1986
|
+
url: parsed.url,
|
|
1987
|
+
body,
|
|
1988
|
+
bodyBase64
|
|
1989
|
+
};
|
|
1979
1990
|
}
|
|
1980
1991
|
/**
|
|
1981
1992
|
* Execute a shell command through the main thread's exec function.
|
|
@@ -3187,7 +3198,7 @@ var PATH_MODULE_SOURCE = `
|
|
|
3187
3198
|
})();
|
|
3188
3199
|
`;
|
|
3189
3200
|
|
|
3190
|
-
// src/commands/js-exec/worker.ts
|
|
3201
|
+
// src/commands/js-exec/js-exec-worker.ts
|
|
3191
3202
|
var quickjsModule = null;
|
|
3192
3203
|
var quickjsLoading = null;
|
|
3193
3204
|
async function getQuickJSModule() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _,b as O}from"./chunk-
|
|
1
|
+
import{a as _,b as O}from"./chunk-I57KEIP3.js";import"./chunk-KX3P26DQ.js";import"./chunk-R6VWJ2ZL.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
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
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
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))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-U6NMAV24.js";import"./chunk-7TSDKFEO.js";import"./chunk-PYDZ2LCK.js";import"./chunk-IPJHKYVM.js";import"./chunk-YSHZL3MF.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as rgCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-VBEY5J6R.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YSHZL3MF.js";import"./chunk-GFQRA5P5.js";import"./chunk-3THT3N7L.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as sedCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-XIZSGUXJ.js";import"./chunk-X2AJGDEF.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YSHZL3MF.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as tarCommand};
|
|
@@ -522,6 +522,7 @@ var WorkerSecurityViolationError = class extends Error {
|
|
|
522
522
|
this.violation = violation;
|
|
523
523
|
this.name = "WorkerSecurityViolationError";
|
|
524
524
|
}
|
|
525
|
+
violation;
|
|
525
526
|
};
|
|
526
527
|
var MAX_STORED_VIOLATIONS = 1e3;
|
|
527
528
|
function generateExecutionId() {
|
|
@@ -2014,7 +2015,17 @@ var SyncBackend = class {
|
|
|
2014
2015
|
throw new Error(result.error || "HTTP request failed");
|
|
2015
2016
|
}
|
|
2016
2017
|
const responseJson = new TextDecoder().decode(result.result);
|
|
2017
|
-
|
|
2018
|
+
const parsed = JSON.parse(responseJson);
|
|
2019
|
+
const bodyBase64 = parsed.bodyBase64 ?? "";
|
|
2020
|
+
const body = atob(bodyBase64);
|
|
2021
|
+
return {
|
|
2022
|
+
status: parsed.status,
|
|
2023
|
+
statusText: parsed.statusText,
|
|
2024
|
+
headers: parsed.headers,
|
|
2025
|
+
url: parsed.url,
|
|
2026
|
+
body,
|
|
2027
|
+
bodyBase64
|
|
2028
|
+
};
|
|
2018
2029
|
}
|
|
2019
2030
|
/**
|
|
2020
2031
|
* Execute a shell command through the main thread's exec function.
|
|
@@ -2822,6 +2833,8 @@ function generateHttpBridgeCode() {
|
|
|
2822
2833
|
# Write request JSON to /_jb_http/request (custom FS triggers HTTP via SharedArrayBuffer)
|
|
2823
2834
|
# Then read response JSON from same path.
|
|
2824
2835
|
|
|
2836
|
+
import base64 as _base64
|
|
2837
|
+
|
|
2825
2838
|
class _JbHttpResponse:
|
|
2826
2839
|
"""HTTP response object similar to requests.Response"""
|
|
2827
2840
|
def __init__(self, data):
|
|
@@ -2829,9 +2842,15 @@ class _JbHttpResponse:
|
|
|
2829
2842
|
self.reason = data.get('statusText', '')
|
|
2830
2843
|
# @banned-pattern-ignore: Python code, not JavaScript
|
|
2831
2844
|
self.headers = data.get('headers', {})
|
|
2832
|
-
self.text = data.get('body', '')
|
|
2833
2845
|
self.url = data.get('url', '')
|
|
2834
2846
|
self._error = data.get('error')
|
|
2847
|
+
b64 = data.get('bodyBase64')
|
|
2848
|
+
if b64 is not None:
|
|
2849
|
+
self.content = _base64.b64decode(b64)
|
|
2850
|
+
self.text = self.content.decode('utf-8', errors='replace')
|
|
2851
|
+
else:
|
|
2852
|
+
self.content = b''
|
|
2853
|
+
self.text = data.get('body', '')
|
|
2835
2854
|
|
|
2836
2855
|
@property
|
|
2837
2856
|
def ok(self):
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-RAFHQYLP.js";import"./chunk-DBKNVD4L.js";import"./chunk-PXTK5WE2.js";import"./chunk-NRZWEENR.js";import"./chunk-7TSDKFEO.js";import"./chunk-OJDRYQWQ.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YSHZL3MF.js";import"./chunk-7L36YK2X.js";import"./chunk-GFQRA5P5.js";import"./chunk-NUFRM6SI.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as xanCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a,h as b}from"./chunk-DBKNVD4L.js";import"./chunk-PXTK5WE2.js";import"./chunk-DXB73IDG.js";export{a as cmdFlatten,b as cmdView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-75FNCC7W.js";import"./chunk-PXTK5WE2.js";import"./chunk-NRZWEENR.js";import"./chunk-7TSDKFEO.js";import"./chunk-OJDRYQWQ.js";import"./chunk-24IMIIXA.js";import"./chunk-5QMZ5MUS.js";import"./chunk-YSHZL3MF.js";import"./chunk-GFQRA5P5.js";import"./chunk-3THT3N7L.js";import"./chunk-74CEPOFO.js";import"./chunk-DXB73IDG.js";export{b as flagsForFuzzing,a as yqCommand};
|