fluxflow-cli 4.32.1 → 4.33.0
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 +1 -0
- package/dist/chunks/{ai-IV4VGXUD.js → ai-T3E6XBW3.js} +1 -1
- package/dist/chunks/app-OUE6OIEW.js +313 -0
- package/dist/chunks/chunk-2LJUIPEJ.js +917 -0
- package/dist/chunks/{chunk-53AFLLUU.js → chunk-4MDSKJGX.js} +1 -1
- package/dist/chunks/chunk-PB7NN3GI.js +33 -0
- package/dist/chunks/chunk-UEV335RW.js +4 -0
- package/dist/chunks/{exec_command-AB4DNQYP.js → exec_command-THZ4FE42.js} +1 -1
- package/dist/chunks/{export-KS6YAXR6.js → export-QFE76VEG.js} +1 -1
- package/dist/chunks/infron-DMF34OSO.js +2 -0
- package/dist/chunks/{invoke-UOBZRNEE.js → invoke-6KKJJ5I3.js} +2 -2
- package/dist/chunks/{invokeSync-3Z4QZLSI.js → invokeSync-PNQZBZU2.js} +2 -2
- package/dist/chunks/openrouter-T22AQJY6.js +2 -0
- package/dist/chunks/process-6Y7LS2MS.js +1 -0
- package/dist/chunks/{update_file-VIY6KSMT.js → update_file-BD3AWZNQ.js} +1 -1
- package/dist/cli.js +20 -19
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/app-WVWO7GHJ.js +0 -301
- package/dist/chunks/chunk-QXN5B2BR.js +0 -33
- package/dist/chunks/chunk-RNQ6LVXE.js +0 -893
- package/dist/chunks/infron-RO25LZEE.js +0 -2
- package/dist/chunks/openrouter-M3ZZMDXU.js +0 -2
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{a as b,b as L}from"./chunk-U2NRX2PX.js";import{a as C}from"./chunk-Y5JU726N.js";import{spawn as A}from"child_process";var P=null;try{let f=await import("node-pty");P=f.default||f}catch{}var D=!!P,y=f=>typeof f!="string"?f:f.replace(/(?:\u001b][\s\S]*?(?:\u0007|\u001b\\))|(?:[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])/g,""),E=f=>{if(!f)return"";let p=[[]],n=0,o=0,w=/\x1b\[([0-9;]*?)([a-zA-Z])/g,g=0,h,d=a=>{for(let e=0;e<a.length;e++){let t=a[e];if(t===`
|
|
2
|
-
`)for(n++,o=0;n>=p.length;)p.push([]);else if(t==="\r")o=0;else{for(;n>=p.length;)p.push([]);let s=p[n];for(;o>s.length;)s.push(" ");s[o]=t,o++}}};for(;(h=w.exec(f))!==null;){d(f.substring(g,h.index));let a=h[1],e=h[2],t=a?a.split(";").map(Number):[];if(e==="A"){let s=t[0]||1;n=Math.max(0,n-s)}else if(e==="B"){let s=t[0]||1;for(n=n+s;n>=p.length;)p.push([])}else if(e==="C"){let s=t[0]||1;o=o+s}else if(e==="D"){let s=t[0]||1;o=Math.max(0,o-s)}else if(e==="G"){let s=(t[0]||1)-1;o=Math.max(0,s)}else if(e==="H"||e==="f"){let s=(t[0]||1)-1,r=(t[1]||1)-1;for(n=Math.max(0,s),o=Math.max(0,r);n>=p.length;)p.push([])}else if(e==="K"){let s=t[0]||0;if(n<p.length){let r=p[n];if(s===0)r.length=o;else if(s===1)for(let c=0;c<o&&c<r.length;c++)r[c]=" ";else s===2&&(r.length=0)}}else if(e==="J"){let s=t[0]||0;(s===2||s===3)&&(p.length=0,p.push([]),n=0,o=0)}g=w.lastIndex}d(f.substring(g));let O=p.map(a=>a.join(""));for(;O.length>0&&O[O.length-1]==="";)O.pop();return O.join(`
|
|
3
|
-
`)},x=null,k=!1,_=f=>{try{x&&(k&&typeof x.write=="function"?x.write(f):x.stdin&&x.stdin.writable&&x.stdin.write(f))}catch{}},F=()=>{if(x){try{k&&typeof x.destroy=="function"?x.destroy():typeof x.kill=="function"&&(process.platform==="win32"?A("taskkill",["/pid",x.pid,"/f","/t"]):x.kill("SIGKILL"))}catch{}x=null,k=!1}},T=(f,p=!1)=>{if(process.platform!=="win32")return f;let n=[],o="",w=null,g=!1;for(let e=0;e<f.length;e++){let t=f[e];if(g){o+=t,g=!1;continue}if(t==="\\"){if(!w&&f[e+1]===" "){o+=" ",e++;continue}o+=t,g=!0;continue}w?(t===w&&(w=null),o+=t):t==='"'||t==="'"?(w=t,o+=t):t===";"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push(p?";":"&")):t==="&"&&!o.includes("://")?f[e+1]==="&"?(o.length>0&&(n.push(o),o=""),n.push("&&"),e++):o.endsWith("2>")&&f[e+1]==="1"?(n.push("2>&1"),o="",e++):(o.length>0&&(n.push(o),o=""),n.push("&")):t==="|"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push("|")):(t===">"||t==="<")&&(e===0||/\s|['"]/.test(f[e-1]||""))?(o.length>0&&(n.push(o),o=""),t===">"&&f[e+1]===">"?(n.push(">>"),e++):n.push(t)):/\s/.test(t)?o.length>0&&(n.push(o),o=""):o+=t}o.length>0&&n.push(o);let h=e=>!(!e.includes("/")||/^(https?|file|ftp):\/\//i.test(e)||e.startsWith("@")||e.startsWith("/")&&(e.match(/\//g)||[]).length===1||/\s\/|\/\s/.test(e)||/[\(\)\{\}\;\<\>\=\'\"]/.test(e)),d=[];for(let e=0;e<n.length;e++){let t=n[e];if(t==="mkdir"&&p&&b()){let s=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;c!=="-p"&&c!=="--parents"&&c!=="-v"&&c!=="--verbose"&&s.push(c),r++}if(s.length>0){let c=s.map(i=>{let u=i.replace(/^['"]|['"]$/g,""),l=i;return h(u)&&(l=i.replace(/\//g,"\\")),l});d.push("New-Item","-ItemType","Directory","-Force","-Path",c.join(","))}else d.push("New-Item","-ItemType","Directory","-Force");e=r-1;continue}if(t==="rm"&&p&&b()){let s=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-rf"||l==="-fr"?(r=!0,c=!0):l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:s.push(l),i++}let u=["Remove-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),s.length>0){let l=s.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});u.push("-Path",l.join(","))}d.push(...u),e=i-1;continue}if(t==="cp"&&p&&b()){let s=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:s.push(l),i++}let u=["Copy-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),s.length>0){let l=s.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});if(l.length>1){let m=l.pop();u.push("-Path",l.join(","),"-Destination",m)}else u.push("-Path",l[0])}d.push(...u),e=i-1;continue}if(t==="touch"&&p&&b()){let s=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;s.push(c),r++}if(s.length>0){let i=`(${s.map(u=>{let l=u.replace(/^['"]|['"]$/g,""),m=u;return h(l)&&(m=u.replace(/\//g,"\\")),m}).join(", ")}) | ForEach-Object { if (Test-Path $_) { (Get-Item $_).LastWriteTime = [System.DateTime]::Now } else { $null | Out-File -FilePath $_ } }`;d.push(i)}e=r-1;continue}if(t==="|"&&n[e+1]==="tee"){n[e+2]==="-a"?(d.push(">>"),e+=2):(d.push(">"),e+=1);continue}if(t==="|"&&n[e+1]==="cat"&&n[e+2]===">"){d.push(">"),e+=2;continue}if(t==="|"){let s=n[e+1];if(s){let r=s.replace(/^['"]|['"]$/g,""),c=/\.(txt|md|json|log|csv|html|css|py|js|xml|yaml|yml|pdf|docx|pptx|xlsx)$/i.test(r);if(h(r)&&c){d.push(">");continue}}}d.push(t)}let O=!1,a=d.map(e=>{if(e==="echo")return O=!0,e;[">",">>","<","&","&&","|","||",";"].includes(e)&&(O=!1);let s=/^['"]|['"]$/.test(e),r=e;O&&s&&(r=e.replace(/^['"]|['"]$/g,""));let c=/^['"]|['"]$/.test(r),i=r.replace(/^['"]|['"]$/g,"");h(i)&&(r=r.replace(/\//g,"\\"));let u=r.replace(/^['"]|['"]$/g,"");return u.includes(" ")&&!c&&(r=`"${u}"`),r});if(p){let e="",t=0;for(let s=0;s<a.length;s++){let r=a[s];r==="&&"?(e+="; if ($?) {",t++):r===";"?(e+=" }".repeat(t)+";",t=0):(e&&!e.endsWith(" ")&&!e.endsWith("{")&&(e+=" "),e+=r)}return e+=" }".repeat(t),e}return a.join(" ")},W=async(f,p={})=>{let{command:n}=C(f),{onChunk:o}=p;if(!n)return'ERROR: Missing "command" argument for Run.';let w=process.platform==="win32",g=p.systemSettings||{},h={};return g.networkAccess===!1&&(h.HTTP_PROXY="http://127.0.0.1:9999",h.HTTPS_PROXY="http://127.0.0.1:9999",h.ALL_PROXY="socks5://127.0.0.1:9999",h.http_proxy="http://127.0.0.1:9999",h.https_proxy="http://127.0.0.1:9999",h.all_proxy="socks5://127.0.0.1:9999",h.NO_PROXY="localhost,127.0.0.1"),new Promise(d=>{let O=a=>{let e=a==="pwsh"||a==="powershell",t=T(n,e),s;w?a==="pwsh"?s="pwsh.exe":a==="powershell"?s="powershell.exe":s="cmd.exe":s=process.env.SHELL||"bash";let r=w?e?["-NoProfile","-Command",t]:["/c",t]:["-c",t];if(g.networkAccess===!1&&!w){let c=s,i=[...r];if(process.platform==="linux")s="unshare",r=["-n","-r",c,...i];else if(process.platform==="darwin"){let u=`(version 1)
|
|
4
|
-
(allow default)
|
|
5
|
-
(deny network-outbound)
|
|
6
|
-
(allow network-outbound (remote ip "localhost:*"))
|
|
7
|
-
(allow network-outbound (remote ip "127.0.0.1:*"))
|
|
8
|
-
`;s="sandbox-exec",r=["-p",u,c,...i]}}if(P)try{let c=P.spawn(s,r,{name:"xterm-256color",cols:p.cols||120,rows:p.rows||30,cwd:process.cwd(),env:{...process.env,CI:"false",TERM:"xterm-256color",FORCE_COLOR:"1",...h}});x=c,k=!0;let i="",u=!1;return c.onData(l=>{if(!u){i+=l,o&&o(l);let m=y(i);/(?:Network:\s+use\s+--host\s+to|Network:\s+Type\s+--host\s+to|Local:\s+http:\/\/localhost:\d+|ready in \d+\s*ms|Compiled successfully|Development server is running|Listening on:)/i.test(m)&&(u=!0,setTimeout(()=>d(`Dev server started successfully in background.
|
|
9
|
-
|
|
10
|
-
${m}`),500))}}),c.onExit(({exitCode:l})=>{if(u)return;x=null;let m=E(i||""),R=y(m).replace(/\n{3,}/g,`
|
|
11
|
-
|
|
12
|
-
`)||"Command executed with no output.";d(l!==0?`ERROR: Command [${n}] failed with exit code [${l}].
|
|
13
|
-
|
|
14
|
-
${R}`:`Command [${n}] completed.
|
|
15
|
-
|
|
16
|
-
${R}`)}),!0}catch(c){return w&&(a==="pwsh"||a==="powershell")&&c.code==="ENOENT"?!1:(v(d,t,n,h,o,a,g),!0)}else return v(d,t,n,h,o,a,g),!0};if(w){let a=L();O(a)||(a==="pwsh"&&!O("powershell")||a==="powershell")&&O("cmd")}else O("bash")})},v=(f,p,n,o,w,g="powershell",h={})=>{let d=process.platform==="win32",O=g==="pwsh"||g==="powershell",a;d?g==="pwsh"?a="pwsh.exe":g==="powershell"?a="powershell.exe":a="cmd.exe":a=process.env.SHELL||"bash";let e=d?O?["-NoProfile","-Command",p]:["/c",p]:["-c",p];if(h.networkAccess===!1&&!d){let i=a,u=[...e];if(process.platform==="linux")a="unshare",e=["-n","-r",i,...u];else if(process.platform==="darwin"){let l=`(version 1)
|
|
17
|
-
(allow default)
|
|
18
|
-
(deny network-outbound)
|
|
19
|
-
(allow network-outbound (remote ip "localhost:*"))
|
|
20
|
-
(allow network-outbound (remote ip "127.0.0.1:*"))
|
|
21
|
-
`;a="sandbox-exec",e=["-p",l,i,...u]}}let t=d?A(a,e,{cwd:process.cwd(),env:{...process.env,...o}}):A(a,e,{cwd:process.cwd(),env:{...process.env,CI:"false",TERM:"xterm-256color",FORCE_COLOR:"1",...o}});x=t,k=!1,t.stdin&&t.stdin.on("error",()=>{x=null});let s="",r="",c=!1;t.stdout.on("data",i=>{if(!c){let u=i.toString();s+=u,w&&w(u);let l=y(s);/(?:Network:\s+use\s+--host\s+to|Network:\s+Type\s+--host\s+to|Local:\s+http:\/\/localhost:\d+|ready in \d+\s*ms|Compiled successfully|Development server is running|Listening on:)/i.test(l)&&(c=!0,setTimeout(()=>f(`Dev server started successfully in background.
|
|
22
|
-
|
|
23
|
-
${l}`),500))}}),t.stderr.on("data",i=>{if(!c){let u=i.toString();r+=u,w&&w(u)}}),t.on("close",i=>{if(c)return;x=null;let u=[],l=E(s),m=E(r);l&&u.push(`STDOUT:
|
|
24
|
-
${l}`),m&&u.push(`STDERR:
|
|
25
|
-
${m}`),i!==0&&u.push(`EXIT CODE: ${i}`);let R=u.join(`
|
|
26
|
-
|
|
27
|
-
`)||"Command executed with no output.",$=y(R).replace(/\n{3,}/g,`
|
|
28
|
-
|
|
29
|
-
`);f(i!==0?`ERROR: Command [${n}] failed with exit code [${i}].
|
|
30
|
-
|
|
31
|
-
${$}`:`Command [${n}] completed.
|
|
32
|
-
|
|
33
|
-
${$}`)}),t.on("error",i=>{if(d&&i.code==="ENOENT"){if(g==="pwsh"){let l=T(n,!0);return v(f,l,n,o,w,"powershell",h)}else if(g==="powershell"){let l=T(n,!1);return v(f,l,n,o,w,"cmd",h)}}x=null;let u=i instanceof Error?i.message:String(i);f(`ERROR: Failed to start command [${n}]: ${u}`)})};export{D as a,y as b,E as c,x as d,k as e,_ as f,F as g,T as h,W as i};
|