fluxflow-cli 4.17.1 → 4.18.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/dist/chunks/ai-6LGLTTCE.js +1 -0
- package/dist/chunks/{app-QTWX774S.js → app-UMXRKFDU.js} +2 -2
- package/dist/chunks/{chat-HZ7UVZE2.js → chat-C4CKZM5D.js} +1 -1
- package/dist/chunks/{chunk-AZGFDR6K.js → chunk-4CQOGQFQ.js} +1 -1
- package/dist/chunks/{chunk-WKHYRBBK.js → chunk-6NCN7IZN.js} +1 -1
- package/dist/chunks/chunk-7QASAAHS.js +33 -0
- package/dist/chunks/{chunk-47AJJOP3.js → chunk-BCS6MMDL.js} +8 -7
- package/dist/chunks/{chunk-EP3WAFTJ.js → chunk-E3E5H3M4.js} +1 -1
- package/dist/chunks/{chunk-X3ZZM2GL.js → chunk-MAZITQH6.js} +1 -1
- package/dist/chunks/{chunk-ZWNKNXAI.js → chunk-TCYHPPPS.js} +1 -1
- package/dist/chunks/chunk-UGLNJ52L.js +1 -0
- package/dist/chunks/chunk-XFL3A2CT.js +1 -0
- package/dist/chunks/{click-G6RRSFVC.js → click-KI2HDWSU.js} +2 -2
- package/dist/chunks/{computer_action-WTHH7RBB.js → computer_action-DTZFD3WC.js} +1 -1
- package/dist/chunks/{drag-ZGH2MMP7.js → drag-I5U53ZJG.js} +1 -1
- package/dist/chunks/{emergency_rollback-EPJPKANN.js → emergency_rollback-JTQSRHQZ.js} +1 -1
- package/dist/chunks/{exec_command-255QUWWX.js → exec_command-DDBOSWMU.js} +1 -1
- package/dist/chunks/{file_map-5KY2ADZW.js → file_map-LMYY76M4.js} +1 -1
- package/dist/chunks/generate_image-OZQE4ON3.js +1 -0
- package/dist/chunks/{invoke-GJ72T6SR.js → invoke-WRVCOTXT.js} +2 -2
- package/dist/chunks/{invokeSync-KGIQEPIQ.js → invokeSync-KD765JM2.js} +2 -2
- package/dist/chunks/{key_press-M5QNCIPH.js → key_press-26ZNSFNA.js} +1 -1
- package/dist/chunks/{keyboard_typing-CK3KVAWM.js → keyboard_typing-KFGOX3QX.js} +1 -1
- package/dist/chunks/model_config-KOPB5T4R.js +1 -0
- package/dist/chunks/{screen_grid-TDQC6CV5.js → screen_grid-MAW64GKY.js} +1 -1
- package/dist/chunks/{scroll-GHXES2II.js → scroll-YN67VAJ7.js} +1 -1
- package/dist/chunks/{search_keyword-W5YEUUPO.js → search_keyword-4NOEU57F.js} +1 -1
- package/dist/chunks/settings-FZNBYJ3N.js +1 -0
- package/dist/chunks/{todo-SJLJJLVZ.js → todo-6ZB5YFX6.js} +1 -1
- package/dist/chunks/update_file-ACEMMAAQ.js +13 -0
- package/dist/chunks/usage-2UML4SGM.js +1 -0
- package/dist/chunks/usageServer-TWVV3FOE.js +1 -0
- package/dist/chunks/view_file-MGLL22AR.js +1 -0
- package/dist/chunks/{web_search-2Q2BWH6G.js → web_search-7GI77X3E.js} +1 -1
- package/dist/chunks/{write_docx-EKUIZ7GV.js → write_docx-ZTLEYYGI.js} +1 -1
- package/dist/chunks/{write_file-LOYRYIK6.js → write_file-QDLI2RK5.js} +1 -1
- package/dist/chunks/{write_pdf-VB4IFPWX.js → write_pdf-ZM6DG4DO.js} +1 -1
- package/dist/cli.js +22 -9
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/ai-OUU7AEB6.js +0 -1
- package/dist/chunks/ai-X7EEY6S3.js +0 -1
- package/dist/chunks/app-ZHDEY5VH.js +0 -285
- package/dist/chunks/chunk-AAPXJU65.js +0 -1
- package/dist/chunks/chunk-DRD5PTCI.js +0 -929
- package/dist/chunks/chunk-JRQMA5CG.js +0 -33
- package/dist/chunks/generate_image-XYDE47LK.js +0 -1
- package/dist/chunks/invoke-PZPQJRG7.js +0 -6
- package/dist/chunks/invokeSync-KKA5TJM6.js +0 -3
- package/dist/chunks/settings-2IFZMDUD.js +0 -1
- package/dist/chunks/update_file-SOXC3PMR.js +0 -13
- package/dist/chunks/usageServer-M7OKG6CP.js +0 -1
- package/dist/chunks/view_file-WUHFS5L7.js +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{a as b,b as T}from"./chunk-HYGK7YDY.js";import{a as A}from"./chunk-Y5JU726N.js";import{spawn as C}from"child_process";var P=null;try{let f=await import("node-pty");P=f.default||f}catch{}var _=!!P,S=f=>typeof f!="string"?f:f.replace(/[\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=u=>{for(let e=0;e<u.length;e++){let s=u[e];if(s===`
|
|
2
|
-
`)for(n++,o=0;n>=p.length;)p.push([]);else if(s==="\r")o=0;else{for(;n>=p.length;)p.push([]);let t=p[n];for(;o>t.length;)t.push(" ");t[o]=s,o++}}};for(;(h=w.exec(f))!==null;){d(f.substring(g,h.index));let u=h[1],e=h[2],s=u?u.split(";").map(Number):[];if(e==="A"){let t=s[0]||1;n=Math.max(0,n-t)}else if(e==="B"){let t=s[0]||1;for(n=n+t;n>=p.length;)p.push([])}else if(e==="C"){let t=s[0]||1;o=o+t}else if(e==="D"){let t=s[0]||1;o=Math.max(0,o-t)}else if(e==="G"){let t=(s[0]||1)-1;o=Math.max(0,t)}else if(e==="H"||e==="f"){let t=(s[0]||1)-1,r=(s[1]||1)-1;for(n=Math.max(0,t),o=Math.max(0,r);n>=p.length;)p.push([])}else if(e==="K"){let t=s[0]||0;if(n<p.length){let r=p[n];if(t===0)r.length=o;else if(t===1)for(let c=0;c<o&&c<r.length;c++)r[c]=" ";else t===2&&(r.length=0)}}else if(e==="J"){let t=s[0]||0;(t===2||t===3)&&(p.length=0,p.push([]),n=0,o=0)}g=w.lastIndex}d(f.substring(g));let O=p.map(u=>u.join(""));for(;O.length>0&&O[O.length-1]==="";)O.pop();return O.join(`
|
|
3
|
-
`)},x=null,k=!1,D=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"?C("taskkill",["/pid",x.pid,"/f","/t"]):x.kill("SIGKILL"))}catch{}x=null,k=!1}},v=(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 s=f[e];if(g){o+=s,g=!1;continue}if(s==="\\"){if(f[e+1]===" "){o+=" ",e++;continue}o+=s,g=!0;continue}w?(s===w&&(w=null),o+=s):s==='"'||s==="'"?(w=s,o+=s):s===";"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push(p?";":"&")):s==="&"&&!o.includes("://")?f[e+1]==="&"?(o.length>0&&(n.push(o),o=""),n.push("&&"),e++):(o.length>0&&(n.push(o),o=""),n.push("&")):s==="|"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push("|")):/\s/.test(s)?o.length>0&&(n.push(o),o=""):o+=s}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 s=n[e];if(s==="mkdir"&&p&&b()){let t=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;c!=="-p"&&c!=="--parents"&&c!=="-v"&&c!=="--verbose"&&t.push(c),r++}if(t.length>0){let c=t.map(i=>{let a=i.replace(/^['"]|['"]$/g,""),l=i;return h(a)&&(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(s==="rm"&&p&&b()){let t=[],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:t.push(l),i++}let a=["Remove-Item"];if(r&&a.push("-Recurse"),c&&a.push("-Force"),t.length>0){let l=t.map(m=>{let $=m.replace(/^['"]|['"]$/g,""),R=m;return h($)&&(R=m.replace(/\//g,"\\")),R});a.push("-Path",l.join(","))}d.push(...a),e=i-1;continue}if(s==="cp"&&p&&b()){let t=[],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:t.push(l),i++}let a=["Copy-Item"];if(r&&a.push("-Recurse"),c&&a.push("-Force"),t.length>0){let l=t.map(m=>{let $=m.replace(/^['"]|['"]$/g,""),R=m;return h($)&&(R=m.replace(/\//g,"\\")),R});if(l.length>1){let m=l.pop();a.push("-Path",l.join(","),"-Destination",m)}else a.push("-Path",l[0])}d.push(...a),e=i-1;continue}if(s==="touch"&&p&&b()){let t=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;t.push(c),r++}if(t.length>0){let i=`(${t.map(a=>{let l=a.replace(/^['"]|['"]$/g,""),m=a;return h(l)&&(m=a.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(s==="|"&&n[e+1]==="tee"){n[e+2]==="-a"?(d.push(">>"),e+=2):(d.push(">"),e+=1);continue}if(s==="|"&&n[e+1]==="cat"&&n[e+2]===">"){d.push(">"),e+=2;continue}if(s==="|"){let t=n[e+1];if(t){let r=t.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(s)}let O=!1,u=d.map(e=>{if(e==="echo")return O=!0,e;[">",">>","<","&","&&","|","||",";"].includes(e)&&(O=!1);let t=/^['"]|['"]$/.test(e),r=e;O&&t&&(r=e.replace(/^['"]|['"]$/g,""));let c=/^['"]|['"]$/.test(r),i=r.replace(/^['"]|['"]$/g,"");h(i)&&(r=r.replace(/\//g,"\\"));let a=r.replace(/^['"]|['"]$/g,"");return a.includes(" ")&&!c&&(r=`"${a}"`),r});if(p){let e="",s=0;for(let t=0;t<u.length;t++){let r=u[t];r==="&&"?(e+="; if ($?) {",s++):r===";"?(e+=" }".repeat(s)+";",s=0):(e&&!e.endsWith(" ")&&!e.endsWith("{")&&(e+=" "),e+=r)}return e+=" }".repeat(s),e}return u.join(" ")},M=async(f,p={})=>{let{command:n}=A(f),{onChunk:o}=p;if(!n)return'ERROR: Missing "command" argument for exec_command.';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=u=>{let e=u==="pwsh"||u==="powershell",s=v(n,e),t;w?u==="pwsh"?t="pwsh.exe":u==="powershell"?t="powershell.exe":t="cmd.exe":t=process.env.SHELL||"bash";let r=w?e?["-NoProfile","-Command",s]:["/c",s]:["-c",s];if(g.networkAccess===!1&&!w){let c=t,i=[...r];if(process.platform==="linux")t="unshare",r=["-n","-r",c,...i];else if(process.platform==="darwin"){let a=`(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
|
-
`;t="sandbox-exec",r=["-p",a,c,...i]}}if(P)try{let c=P.spawn(t,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="",a=!1;return c.onData(l=>{if(!a){i+=l,o&&o(l);let m=S(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)&&(a=!0,setTimeout(()=>d(`SUCCESS: Dev server started successfully in background.
|
|
9
|
-
|
|
10
|
-
${m}`),500))}}),c.onExit(({exitCode:l})=>{if(a)return;x=null;let m=E(i||""),$=S(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
|
-
${$}`:`SUCCESS: Command [${n}] completed.
|
|
15
|
-
|
|
16
|
-
${$}`)}),!0}catch(c){return w&&(u==="pwsh"||u==="powershell")&&c.code==="ENOENT"?!1:(y(d,s,n,h,o,u,g),!0)}else return y(d,s,n,h,o,u,g),!0};if(w){let u=T();O(u)||(u==="pwsh"&&!O("powershell")||u==="powershell")&&O("cmd")}else O("bash")})},y=(f,p,n,o,w,g="powershell",h={})=>{let d=process.platform==="win32",O=g==="pwsh"||g==="powershell",u;d?g==="pwsh"?u="pwsh.exe":g==="powershell"?u="powershell.exe":u="cmd.exe":u=process.env.SHELL||"bash";let e=d?O?["-NoProfile","-Command",p]:["/c",p]:["-c",p];if(h.networkAccess===!1&&!d){let i=u,a=[...e];if(process.platform==="linux")u="unshare",e=["-n","-r",i,...a];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
|
-
`;u="sandbox-exec",e=["-p",l,i,...a]}}let s=d?C(u,e,{cwd:process.cwd(),env:{...process.env,...o}}):C(u,e,{cwd:process.cwd(),env:{...process.env,CI:"false",TERM:"xterm-256color",FORCE_COLOR:"1",...o}});x=s,k=!1,s.stdin&&s.stdin.on("error",()=>{x=null});let t="",r="",c=!1;s.stdout.on("data",i=>{if(!c){let a=i.toString();t+=a,w&&w(a);let l=S(t);/(?: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(`SUCCESS: Dev server started successfully in background.
|
|
22
|
-
|
|
23
|
-
${l}`),500))}}),s.stderr.on("data",i=>{if(!c){let a=i.toString();r+=a,w&&w(a)}}),s.on("close",i=>{if(c)return;x=null;let a=[],l=E(t),m=E(r);l&&a.push(`STDOUT:
|
|
24
|
-
${l}`),m&&a.push(`STDERR:
|
|
25
|
-
${m}`),i!==0&&a.push(`EXIT CODE: ${i}`);let $=a.join(`
|
|
26
|
-
|
|
27
|
-
`)||"Command executed with no output.",R=S($).replace(/\n{3,}/g,`
|
|
28
|
-
|
|
29
|
-
`);f(i!==0?`ERROR: Command [${n}] failed with exit code [${i}].
|
|
30
|
-
|
|
31
|
-
${R}`:`SUCCESS: Command [${n}] completed.
|
|
32
|
-
|
|
33
|
-
${R}`)}),s.on("error",i=>{if(d&&i.code==="ENOENT"){if(g==="pwsh"){let l=v(n,!0);return y(f,l,n,o,w,"powershell",h)}else if(g==="powershell"){let l=v(n,!1);return y(f,l,n,o,w,"cmd",h)}}x=null;let a=i instanceof Error?i.message:String(i);f(`ERROR: Failed to start command [${n}]: ${a}`)})};export{_ as a,E as b,x as c,k as d,D as e,F as f,v as g,M as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as $}from"./chunk-KFM2OZWJ.js";import{k as S,l as C,m as B}from"./chunk-WKHYRBBK.js";import{l as I}from"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";import{a as T}from"./chunk-Y5JU726N.js";import b from"fs-extra";import E from"path";var F=(a,y={})=>{try{if(a.length<8||a[0]!==137||a[1]!==80||a[2]!==78||a[3]!==71)return a;let s=[],c=[];for(let r=0;r<256;r++){let e=r;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;c[r]=e}let l=r=>{let e=4294967295;for(let n=0;n<r.length;n++)e=c[(e^r[n])&255]^e>>>8;return(e^4294967295)>>>0},f=(r,e)=>{let n=Buffer.from(r,"ascii"),i=Buffer.from(e,"utf-8"),u=n.length+1+i.length,o=Buffer.alloc(8+u+4);o.writeUInt32BE(u,0),o.write("tEXt",4,"ascii"),n.copy(o,8),o[8+n.length]=0,i.copy(o,8+n.length+1);let w=l(o.subarray(4,8+u));return o.writeUInt32BE(w,8+u),o};for(let[r,e]of Object.entries(y))e!=null&&s.push(f(r,String(e)));if(s.length===0)return a;if(a.subarray(12,16).toString("ascii")==="IHDR"){let e=a.subarray(0,33),n=a.subarray(33);return Buffer.concat([e,...s,n])}return a}catch{return a}},N=async(a,y={})=>{let s=T(a),c=s.prompt||s.text,l=s.path||s.outputPath||s.output||"generated_image.png",f=s.ratio;if(!c)return'ERROR: Missing "prompt" argument for generate_image.';let r=["nsfw","naked","nudity","nude","porn","sex","xxx","erotic","gore","bloody","violence","abuse","suicide","murder","hentai","pedophile","rape"],e=c.toLowerCase();if(r.some(i=>e.includes(i)))return"ERROR: Prompt blocked by system safety filter (inappropriate or unsafe content detected).";try{let i=await I();if(!await S(i))return`ERROR: Insufficient Quota for selected quality. Either tell user reduce quality or wait for next refresh cycle (${(await C()).nextResetMin||60}m).`;let o=i.imageSettings||{keyType:"Default",quality:"Low-High",apiKey:""},w=o.keyType==="Custom"&&o.apiKey?o.apiKey:FALLBACK_IMAGE_KEY,x={Low:"flux","Low-High":"zimage",Medium:"gptimage","Medium-High":"gptimage",High:"qwen-image",Ultra:"gptimage-large",Premium:"nanobanana-pro"}[o.quality]||"zimage",g=1024,m=1024;if(f){let t=f.replace(/\s+/g,"");t==="16:9"?(g=1024,m=576):t==="9:16"?(g=576,m=1024):t==="4:3"?(g=1024,m=768):t==="3:4"?(g=768,m=1024):t==="1:1"&&(g=1024,m=1024)}let M=Math.floor(Math.random()*1e7),k=`https://gen.pollinations.ai/image/${encodeURIComponent(c)}?model=${x}&width=${g}&height=${m}&seed=${M}&enhance=true&reasoning=high&quality=high&negative=${encodeURIComponent("deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated hands and fingers, blurry, low quality, low resolution, extra fingers, censored, watermarks, signatures")}`,d=await fetch(k,{method:"GET",headers:{Authorization:`Bearer ${w}`}});if(!d.ok){let t=d.status,h="";try{h=await d.text()}catch{}return t===402||h.includes("Insufficient balance")||h.includes("PAYMENT_REQUIRED")?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed with status [${t}]: ${h||"Unknown API Error"}`}if((d.headers.get("content-type")||"").includes("application/json")){let t=await d.json();return t.status===402||t.error&&t.error.code==="PAYMENT_REQUIRED"?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed: ${t.error?.message||JSON.stringify(t)}`}let O=await d.arrayBuffer(),p=Buffer.from(O),P={Title:c,Description:"Generated via FluxFlow CLI",Software:"FluxFlow CLI",Author:"FluxFlow","Creation Time":new Date().toISOString(),Prompt:c,Model:`Fluxflow:${x}`,Ratio:f||"1:1",Seed:String(M)};p=F(p,P);let R=E.resolve(process.cwd(),l);await b.ensureDir(E.dirname(R)),await $.recordFileChange(R),await b.writeFile(R,p),await B(i);let v=E.extname(l).toLowerCase(),L={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"}[v]||"image/png";return y.isMultiModal!==!1?{text:`SUCCESS: Image successfully generated from prompt [${c}] and saved to [${l}]. Output attached to multimodal part`,binaryPart:{inlineData:{data:p.toString("base64"),mimeType:L}}}:`SUCCESS: Image successfully generated from prompt [${c}] and saved to [${l}].`}catch(i){return`ERROR: Failed during image generation: ${i instanceof Error?i.message:String(i)}`}};export{N as generate_image};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-X7EEY6S3.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],M={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
|
|
2
|
-
Respond using tool: [tool:functions.Answer(id="${i}", answer="...")]
|
|
3
|
-
[/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((_,A)=>_+A.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,M,C,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")){let o=n.split(`
|
|
4
|
-
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
5
|
-
`)+`
|
|
6
|
-
... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-X7EEY6S3.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-X7EEY6S3.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
|
|
2
|
-
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-X7EEY6S3.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
|
|
3
|
-
`)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as a,m as b}from"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{g as h,h as m,i as R}from"./chunk-ZSVBC2ZI.js";import{a as F}from"./chunk-KFM2OZWJ.js";import{l as g}from"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";import{a as $}from"./chunk-Y5JU726N.js";import c from"fs";import M from"path";var v=async(w,S={})=>{let n=$(w),t=n.path;if(!t)return'ERROR: Missing "path" argument for PatchFile.';let{patchPairs:o,allowMultiple:C,error:p}=h(n);if(p)return`ERROR: ${p}`;if(o.length===0)return"ERROR: No valid replacement pairs found. Use searchContent1, newContent1, etc.";let E=n.allowMultiple!==void 0?n.allowMultiple===!0||String(n.allowMultiple).toLowerCase()==="true":C,i=M.resolve(process.cwd(),t);try{if(!c.existsSync(i))return`ERROR: File [${t}] does not exist. Use WriteFile instead.`;let e=S.forcedContent||c.readFileSync(i,"utf8");e.startsWith("\uFEFF")&&(e=e.slice(1));let s=e.replace(/\r\n/g,`
|
|
2
|
-
`).replace(/\r/g,`
|
|
3
|
-
`),{content:u,results:l}=m(s,o,{allowMultiple:E}),a=l.filter(r=>!r.success),f=l.filter(r=>r.success);if(f.length===0)return`ERROR: Patch Failed to apply to [${t}].
|
|
4
|
-
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
5
|
-
`)}`;await F.recordFileChange(i,s),c.writeFileSync(i,u,"utf8");let{systemSettings:y}=await g(),d=R(s,u,l,12,y?.compressToolResults);return a.length>0?`SUCCESS: File [${t}] updated with some blocks failed. [${f.length}/${o.length}] blocks applied.
|
|
6
|
-
|
|
7
|
-
Failures:
|
|
8
|
-
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
9
|
-
`)}
|
|
10
|
-
|
|
11
|
-
${d}`:`SUCCESS: File [${t}] updated. [${l.length}/${o.length}] blocks applied.
|
|
12
|
-
|
|
13
|
-
${d}`}catch(e){let s=e instanceof Error?e.message:String(e);return`ERROR: Failed to update file [${t}]: ${s}`}};export{v as update_file};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-AZGFDR6K.js";import"./chunk-WKHYRBBK.js";import"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";export{b as openUsageDashboard,a as startUsageServer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-X3ZZM2GL.js";import"./chunk-FDNLMLIM.js";import"./chunk-Y5JU726N.js";export{a as view_file};
|