fluxflow-cli 5.6.1 → 5.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ai-JYNVZQOI.js → ai-2WT22XNX.js} +1 -1
- package/dist/chunks/{app-NJIF4IBP.js → app-VJTUE4RH.js} +1 -1
- package/dist/chunks/{auto_completion-D5GWZ3OL.js → auto_completion-2FS7FTBX.js} +1 -1
- package/dist/chunks/{chunk-F7Y2KAVQ.js → chunk-77KVL5F7.js} +6 -6
- package/dist/chunks/{invoke-CUYY3T4Z.js → invoke-6O2PR2CU.js} +2 -2
- package/dist/chunks/{invokeSync-IZESPM6H.js → invokeSync-EK5LGZOW.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as o,B as p,C as q,D as r,E as s,F as t,G as u,H as v,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"./chunk-
|
|
1
|
+
import{A as o,B as p,C as q,D as r,E as s,F as t,G as u,H as v,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"./chunk-77KVL5F7.js";import"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import"./chunk-JMMO76HS.js";import"./chunk-LTNOPF2E.js";import"./chunk-VOUGMIAJ.js";import"./chunk-2RTYI6K3.js";import"./chunk-6LM3YRRE.js";import"./chunk-3WV6FIZV.js";import"./chunk-3PZTWZTT.js";import"./chunk-KYIMFUZS.js";import"./chunk-MS7BITZ6.js";import{l as a}from"./chunk-Y6O7SAPD.js";import"./chunk-ZGORMZE5.js";import"./chunk-NPXJIGAI.js";export{c as RE_LEADING_THINK,b as convertChannelThinkTags,r as detectToolCalls,e as findGenuineThinkClose,t as generateSimpleContent,u as getAIStream,q as getActiveToolContext,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,s as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,o as maskCodeSpans,p as maskExecutedTools,n as runJanitorTask,v as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ma}from"./chunk-UEV335RW.js";import{b as fa,c as xa,d as ga}from"./chunk-FMKFTJB3.js";import{c as na,e as er,f as bo,g as ra}from"./chunk-DWQSI6JO.js";import{A as wa,C as Ta,D as ya,E as Mo,G as Ca,a as oa,b as gt,c as At,d as Sr,e as la,f as pi,g as aa,h as Ln,i as ls,j as bi,k as wi,l as as,m as ca,u as pa,w as ba}from"./chunk-
|
|
1
|
+
import{a as Ma}from"./chunk-UEV335RW.js";import{b as fa,c as xa,d as ga}from"./chunk-FMKFTJB3.js";import{c as na,e as er,f as bo,g as ra}from"./chunk-DWQSI6JO.js";import{A as wa,C as Ta,D as ya,E as Mo,G as Ca,a as oa,b as gt,c as At,d as Sr,e as la,f as pi,g as aa,h as Ln,i as ls,j as bi,k as wi,l as as,m as ca,u as pa,w as ba}from"./chunk-77KVL5F7.js";import{a as co,b as sa,c as ia}from"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import{a as ha}from"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import{a as Yt,b as Nt,d as Rl,e as Ft,f as ea,k as xi,l as gi,m as Mr,n as hi,o as ta,p as Jo}from"./chunk-JMMO76HS.js";import"./chunk-LTNOPF2E.js";import{a as ma}from"./chunk-YX4X2ZTX.js";import{a as Br,b as Zo,c as Pn,e as cs,f as Ti,g as da,h as ua,i as Er}from"./chunk-VOUGMIAJ.js";import{a as vr}from"./chunk-2RTYI6K3.js";import{a as fn}from"./chunk-6LM3YRRE.js";import{b as mn,c as di}from"./chunk-3WV6FIZV.js";import{A as Xl,C as Gl,D as Kl,E as Vl,H as jl,c as Pl,e as ii,g as Ol,k as Nl,l as Fl,m as $l,n as Ul,o as _l,q as Hl,r as Wl,u as li,v as ai,w as ci}from"./chunk-3PZTWZTT.js";import{a as ql,b as Ql,i as zl,j as ss,k as is,m as It,n as Jl,p as mi,q as fi,w as Zl}from"./chunk-KYIMFUZS.js";import{a as Yl,b as ui,c as zt}from"./chunk-MS7BITZ6.js";import{d as Bl,e as si,f as El,g as kl,h as Dl,i as Il,j as Al,l as ns,n as un,o as po,p as rs,q as Cr,r as Ll}from"./chunk-Y6O7SAPD.js";import{c as ts,d as vl,e as os}from"./chunk-ZGORMZE5.js";import{a as Po,b as An,c as Co,d as ni,e as ri,k as yr,y as Sl}from"./chunk-NPXJIGAI.js";import Es from"os";import pu from"crypto";import e,{useState as Z,useEffect as ut,useRef as Re,useMemo as rr}from"react";import{Box as u,Text as i,useInput as bu,useStdout as wu,Static as Tu}from"ink";import yu from"ink-spinner";import at from"fs-extra";import{minimatch as nc}from"minimatch";import wt from"path";import{exec as jo}from"child_process";import{fileURLToPath as Cu}from"url";import ro,{useState as ds,useEffect as yi,useMemo as kr,useCallback as Wc,useRef as Ro}from"react";import{Box as Xc,Text as Oo,useInput as Gc}from"ink";function Kc(t,m){return t.replace(/\t/g," ".repeat(m))}function us(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`)}function On(t,m,d){let S=t,y=[...m].sort((r,C)=>r.start-C.start),p=0;for(let r of y){let C=r.start-p,w=us(r.text).split(`
|
|
4
4
|
`).length,M=r.text.length,P=(w>3?`[Pasted ${w} lines]`:`[Pasted ${M} chars]`).length,F=C+P;if(t<=C)break;if(t<F){S=r.end;break}else{let k=r.text.length-P;S+=k,p+=k}}return Math.min(S,d.length)}function Ci(t,m,d,S,y=[]){let p=(t||"").slice(0,m),r=S(p).length,C=S(t||""),w=[...y].sort((j,H)=>H.start-j.start);for(let j of w){let H=S(t.slice(0,j.start)).length,W=S(j.text),X=H+W.length,ie=us(j.text).split(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{F as u}from"./chunk-
|
|
1
|
+
import{F as u}from"./chunk-77KVL5F7.js";import"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import"./chunk-JMMO76HS.js";import"./chunk-LTNOPF2E.js";import"./chunk-VOUGMIAJ.js";import"./chunk-2RTYI6K3.js";import"./chunk-6LM3YRRE.js";import{b as p}from"./chunk-3WV6FIZV.js";import"./chunk-3PZTWZTT.js";import"./chunk-KYIMFUZS.js";import{b as d}from"./chunk-MS7BITZ6.js";import{o as a}from"./chunk-Y6O7SAPD.js";import"./chunk-ZGORMZE5.js";import{a as l}from"./chunk-NPXJIGAI.js";import m from"fs";import g from"path";var f=["Identity: Embedded IDE code completion engine","Context given: Code \xB1 cursor, file name & language","Task: Predict contextually accurate code at cursor position","","Rules:","- Return ONLY the raw code to insert at the cursor. No explanations, commentary or rambling","- Do NOT wrap in markdown code fences","- NEVER repeat code that exist before & after cursor, if nothing sensible possible to predict, return empty string","- Match surrounding indentation and code style","- Complete the current line statement","- Never include placeholder comments like // TODO or # your code here","- Do not put anything except the code to insert between the tags"].join(`
|
|
2
2
|
`);try{let t=g.join(l,".cache");m.existsSync(t)||m.mkdirSync(t,{recursive:!0}),m.writeFileSync(g.join(t,"completion.json"),JSON.stringify({systemPrompt:f},null,2))}catch{}var y=t=>{if(!t)return"";let e=t.match(/<completion>([\s\S]*?)<\/completion>/i);return e?e[1]:t},x=({prefix:t="",suffix:e="",fileName:o="",language:n="",recentChanges:r="",clipboard:i=""})=>{let c=r?["### Recent manual changes (context):",r,""]:[],s=i?["### Clipboard (context):",i,""]:[];return[`File: ${o}`,`Language: ${n}`,"","### Code before cursor:",t,"","[cursor here]","","### Code after cursor:",e,"",...c,...s,"### Completion to insert at cursor:"].join(`
|
|
3
3
|
`)},T=async(t={})=>{try{let e=await d(),o=e.autoCompletion||{};if(!o.enabled)return"";let n=o.provider||e.aiProvider||"Google",r=o.model&&o.model!=="Default"?o.model:e.activeModel||a(n,e.apiTier)||a(n,"paid");if(!r)return"";let i=await p(n);if(!i&&!(n==="c_openai"&&e.systemSettings?.customOpenAIBaseUrl))return"";let c={aiProvider:n,apiKey:i,model:r,mode:"flow",thinkingLevel:"Fast",systemSettings:e.systemSettings||{}},s=[{role:"user",parts:[{text:x(t)}]}],{text:h}=await u(c,r,s,f,"Fast");return y(h||"")}catch{return""}};export{f as AUTOCOMPLETE_SYSTEM_PROMPT,y as extractCompletion,T as generateAutoCompletion};
|
|
@@ -456,7 +456,7 @@ Public Docs: https://fluxflow-cli.onrender.com
|
|
|
456
456
|
|
|
457
457
|
Docs missing required info? Say you are not sure enough to answer. Dont give wrong info`,"references/MODES.md":fr,"references/PROVIDERS.md":ur,"references/PLUGINS.md":gr,"references/STARTUP.md":nr,"references/ENV.md":or,"references/COMMANDS.md":ir,"references/SETTINGS.md":sr,"references/TOOLS.md":rr,"references/ARCHITECTURE.md":ar,"references/SUB_AGENTS.md":lr,"references/SECURITY.md":cr,"references/IDE.md":dr};var hr=(e=null)=>{try{let t=En.join(jn,"skills","fluxflow"),n=En.join(t,"references");if(process.env.NO_DEV==="true"||process.env.NO_DEV==="1"||process.env.NO_DEV===!0||process.env.NO_INS==="true"||process.env.NO_INS==="1"||process.env.NO_INS==="true"||!1){yn.existsSync(t)&&yn.rmSync(t,{recursive:!0,force:!0});return}let o=new Set(Object.keys(Zi).map(m=>En.normalize(m))),d=(e||""||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),l=En.basename(d).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replace(/(\d)-(\d)/g,"$1.$2").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,m=>m.toUpperCase().trim());for(let[m,f]of Object.entries(Zi)){let h=En.join(t,m),p=En.dirname(h);yn.existsSync(p)||yn.mkdirSync(p,{recursive:!0});let g=f;m==="SKILL.md"&&l&&(g=g.replace(/Public Docs: [^\n]*/,`Public Docs: ${g.match(/Public Docs: ([^\n]*)/)?.[1]||""}
|
|
458
458
|
Active Model: ${l}`));let s=g.trim()+`
|
|
459
|
-
`,x=null;yn.existsSync(h)&&(x=yn.readFileSync(h,"utf8")),x!==s&&yn.writeFileSync(h,s,"utf8")}if(yn.existsSync(n)){let m=yn.readdirSync(n);for(let f of m){let h=En.normalize(En.join("references",f));if(!o.has(h)){let p=En.join(n,f);try{yn.rmSync(p,{recursive:!0,force:!0})}catch{}}}}}catch{}};import{WebSocket as gi}from"ws";var Dt=null,po=!1,za="ws://localhost:56832",es=[],ho=null,ts=null,ns=null,yr="2.0.0",Tc=e=>{yr=e,xr()},os=e=>{ts=e},Ac=e=>{ns=e},xr=()=>{if(Dt||po)return;po=!0;let e=new gi(za);e.on("open",()=>{for(Dt=e,po=!1,Dt.send(JSON.stringify({command:"version",version:yr,pid:process.pid,ppid:process.ppid,cwd:process.cwd()}));es.length>0;)Dt.send(JSON.stringify(es.shift()))}),e.on("message",t=>{try{let n=JSON.parse(t.toString());n.command==="contextResponse"&&ho?(ho(n.data),ho=null):n.command==="securityResponse"&&ts?ts(n.result):n.command==="inlineComplete"?qa(n):n.command==="connectionRejected"&&ns&&ns(n)}catch{}}),e.on("error",()=>{po=!1,Dt=null}),e.on("close",()=>{po=!1,Dt=null})},Po=e=>{Dt&&Dt.readyState===gi.OPEN?Dt.send(JSON.stringify(e)):(es.push(e),po||xr())},yo=()=>Dt!==null&&Dt.readyState===gi.OPEN,qa=async e=>{let t="";try{let{generateAutoCompletion:n}=await import("./auto_completion-
|
|
459
|
+
`,x=null;yn.existsSync(h)&&(x=yn.readFileSync(h,"utf8")),x!==s&&yn.writeFileSync(h,s,"utf8")}if(yn.existsSync(n)){let m=yn.readdirSync(n);for(let f of m){let h=En.normalize(En.join("references",f));if(!o.has(h)){let p=En.join(n,f);try{yn.rmSync(p,{recursive:!0,force:!0})}catch{}}}}}catch{}};import{WebSocket as gi}from"ws";var Dt=null,po=!1,za="ws://localhost:56832",es=[],ho=null,ts=null,ns=null,yr="2.0.0",Tc=e=>{yr=e,xr()},os=e=>{ts=e},Ac=e=>{ns=e},xr=()=>{if(Dt||po)return;po=!0;let e=new gi(za);e.on("open",()=>{for(Dt=e,po=!1,Dt.send(JSON.stringify({command:"version",version:yr,pid:process.pid,ppid:process.ppid,cwd:process.cwd()}));es.length>0;)Dt.send(JSON.stringify(es.shift()))}),e.on("message",t=>{try{let n=JSON.parse(t.toString());n.command==="contextResponse"&&ho?(ho(n.data),ho=null):n.command==="securityResponse"&&ts?ts(n.result):n.command==="inlineComplete"?qa(n):n.command==="connectionRejected"&&ns&&ns(n)}catch{}}),e.on("error",()=>{po=!1,Dt=null}),e.on("close",()=>{po=!1,Dt=null})},Po=e=>{Dt&&Dt.readyState===gi.OPEN?Dt.send(JSON.stringify(e)):(es.push(e),po||xr())},yo=()=>Dt!==null&&Dt.readyState===gi.OPEN,qa=async e=>{let t="";try{let{generateAutoCompletion:n}=await import("./auto_completion-2FS7FTBX.js");t=await n({prefix:e.prefix||"",suffix:e.suffix||"",fileName:e.fileName||"",language:e.language||"",recentChanges:e.recentChanges||"",clipboard:e.clipboard||""})}catch{t=""}Po({command:"inlineCompleteResponse",requestId:e.requestId,completion:t||""})},Cc=e=>{Po({command:"status",status:e})},to=()=>new Promise(e=>{if(!Dt||Dt.readyState!==gi.OPEN){e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]});return}ho=e,Dt.send(JSON.stringify({command:"requestContext"})),setTimeout(()=>{ho===e&&(e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]}),ho=null)},1e3)}),wr=e=>{let{resolvedPath:t}=mn(e);Po({command:"open",filePath:t})},is=(e,t,n)=>{let{resolvedPath:i}=mn(e);Po({command:"showDiff",filePath:i,originalContent:t,modifiedContent:n})},br=(e,t)=>{let{resolvedPath:n}=mn(e);Po({command:"closeDiff",filePath:n,result:t})};var Bo=(e,t)=>{try{if(!Jt.existsSync(e))return null;let n=Array.isArray(t)?t.map(o=>o.toLowerCase()):[t.toLowerCase()],i=Jt.readdirSync(e);for(let o of n){let r=i.find(d=>d.toLowerCase()===o);if(r){let d=an.join(e,r);if(Jt.statSync(d).isFile())return d}}}catch{}return null},cs=(e,t)=>{let n=Bo(e,t);if(n)try{return Jt.readFileSync(n,"utf8")}catch{}return""},Sr=new Set([".git","node_modules",".gemini","dist","build",".next","out",".cache","bin","obj","vendor","venv",".idea",".gradle",".terraform","target","coverage",".vscode",".svn",".hg",".fslckout",".github",".gitlab",".circleci",".gitea",".gitee",".lerna",".changeset",".nx",".npm",".yarn",".pnpm-store",".pnpm",".expo",".nuxt",".svelte-kit",".docusaurus",".turbo",".vercel","bower_components",".netlify",".vuepress",".quasar",".output",".angular","jspm_packages",".parcel-cache",".rollup.cache",".rspack",".vitepress","__pycache__",".pytest_cache",".mypy_cache",".tox",".poetry","env","vhdl",".ipynb_checkpoints",".jupyter",".conda",".pdm-build",".bundle",".yardoc",".metadata","App_Data","ClientBin",".cargo",".rustc_info",".go","Godeps","_vendor",".rake_tasks","CMakefiles",".wakatime",".dart_tool",".fvm",".cocoapods","Pods",".pub-cache",".symlinks","DerivedData",".xcworkspace",".serverless",".aws",".gcloud",".azure",".kube",".vagrant",".docker","postgres-data","redis-data","mongo-data",".Spotlight-V100",".Trashes","$RECYCLE.BIN","System Volume Information",".DocumentRevisions-V100",".fseventsd","AppData","Application Data","Local","LocalLow","Roaming","$WinREAgent","$WINDOWS.~BT","$WINDOWS.~WS","scw","System32","SysWOW64",".AppleDouble",".AppleDB",".AppleDesktop","_CodeSignature",".cmio",".LSOverride",".localized",".TemporaryItems",".Trash",".Trash-0",".Trash-1000",".gvfs",".local",".config",".dbus",".fontconfig",".snap",".var",".lost+found","lost+found",".thumb",".thumbnails","EFI","boot","grub","logs","log",".nyc_output",".sonar",".ruff_cache",".VSCodeCounter",".skills","skills"]),ds=(e=process.cwd(),t=0,n=8)=>{let i=[];if(t>n)return i;try{if(!Jt.existsSync(e))return i;let o=Jt.readdirSync(e,{withFileTypes:!0});for(let r of o){let d=r.name,l=an.join(e,d);if(r.isDirectory())!Sr.has(d)&&!Sr.has(d.toLowerCase())&&i.push(...ds(l,t+1,n));else if(r.isFile()){let m=d.toLowerCase();(m==="agents.md"||m==="agent.md")&&i.push(l)}}}catch{}return i},kr=(e,t=2)=>{if(!e)return"";let n=" ".repeat(t);return e.split(/\r?\n/).map(i=>n+i).join(`
|
|
460
460
|
`)},vr=()=>Bo(jn,["agents.md","agent.md"]),Er=()=>Bo(process.cwd(),["agents.md","agent.md"]),_r=()=>Bo(jn,["fluxflow.md"]),Ir=()=>Bo(process.cwd(),["fluxflow.md"]),Lo=vr(),mi=Er(),xn=ds(),Oo=_r(),No=Ir(),Tr=null,ls="",Mr=!1,Xa=e=>{if(!e||!/^<<<[\s\S]*?Identity:/m.test(e))return e;let t=e.match(/^<<<\s*\r?\n([\s\S]*?)\r?\n>>>\s*(?:\r?\n)?([\s\S]*)$/);if(!t)return e;let n=t[1],i=t[2],o=n.match(/^Identity:\s*([\s\S]*?)(?=\r?\n\s*(?:<><|>>>)|$)/m);return o&&(ls=o[1].trim(),process.env.NO_INS=!0),/<><\s*NO_INS/.test(n)&&(Mr=!0),i.trim()},Ja=()=>{Lo=vr();let e=Lo?cs(jn,["agents.md","agent.md"]).trim():"";return e.length===0?(Lo=null,""):e},Qa=()=>{if(xn=ds(),mi=Er(),!xn||xn.length===0)return"";let e=process.cwd(),t=[...xn].sort((o,r)=>{let d=an.relative(e,o).replace(/\\/g,"/"),l=an.relative(e,r).replace(/\\/g,"/"),m=!d.includes("/"),f=!l.includes("/");return m&&!f?-1:!m&&f?1:d.localeCompare(l)}),n=[],i=[];for(let o of t)try{let r=Jt.readFileSync(o,"utf8").trim();if(!r||r.length===0)continue;n.push(o);let d=an.relative(e,o).replace(/\\/g,"/");if(!d.includes("/"))i.push(kr(r,2));else{let m=an.dirname(d)+"/:";i.push(`${m}
|
|
461
461
|
${kr(r,2)}`)}}catch{}return xn=n,xn.length===0&&(mi=null),i.join(`
|
|
462
462
|
|
|
@@ -526,7 +526,7 @@ ${ss}
|
|
|
526
526
|
`:""}${rs.length>0&&n.toLowerCase().includes("flux")?`-- Project Skills --
|
|
527
527
|
${rs}
|
|
528
528
|
|
|
529
|
-
`:""}`.trim()};var Br=()=>import("./web_search-XBV7AJF7.js").then(e=>e.web_search),Ur=()=>import("./web_scrape-SJBA3RQF.js").then(e=>e.web_scrape),Wr=()=>import("./memory-QTLQAFG7.js").then(e=>e.memory),Gr=()=>import("./chat-YMCO5JNQ.js").then(e=>e.chat),Hr=()=>import("./view_file-LWURM2CE.js").then(e=>e.view_file),jr=()=>import("./write_file-6KFLPINS.js").then(e=>e.write_file),Kr=()=>import("./update_file-RA745RVH.js").then(e=>e.update_file),Vr=()=>import("./exec_command-22LIHPPH.js").then(e=>e.exec_command),zr=()=>import("./read_folder-BJ3HS63A.js").then(e=>e.read_folder),ms=()=>import("./ask_user-XQ423UXL.js").then(e=>e.ask_user),qr=()=>import("./write_pdf-UOCME2OY.js").then(e=>e.write_pdf),Yr=()=>import("./write_docx-54LANNV2.js").then(e=>e.write_docx),xi=()=>import("./search_keyword-SSKH6AYF.js").then(e=>e.search_keyword),Xr=()=>import("./generate_image-KIZS5HAI.js").then(e=>e.generate_image),wi=()=>import("./saveSummary-CVZIOQ4L.js").then(e=>e.saveSummary),Uo=()=>import("./addMemScore-U2KYMALL.js").then(e=>e.addMemScore),Jr=()=>import("./file_map-4WUEPRMI.js").then(e=>e.file_map),bi=()=>import("./todo-3EQZ7LZM.js").then(e=>e.todo),Qr=()=>import("./invokeSync-IZESPM6H.js").then(e=>e.invokeSync),ol=()=>import("./invoke-CUYY3T4Z.js").then(e=>e.invoke),Zr=()=>import("./getProgress-MJZDAMSP.js").then(e=>e.getProgress),il=()=>import("./cancel-2PAHCMGB.js").then(e=>e.cancel),ea=()=>import("./emergency_rollback-PHH3BKRP.js").then(e=>e.emergency_rollback),Wo=()=>import("./awaitSubagent-KLH7CRKF.js").then(e=>e.awaitSubagent),Go=()=>import("./answerSubagent-PIZJSLZN.js").then(e=>e.answerSubagent),Si=()=>import("./steerSubagent-B34P33YV.js").then(e=>e.steerSubagent),ki=()=>import("./computer_action-FZUWM6VL.js").then(e=>e.computer_action),ta=()=>import("./click-AJIULJEH.js").then(e=>e.click),na=()=>import("./drag-73WZE3BK.js").then(e=>e.drag),oa=()=>import("./scroll-KE5TNGMD.js").then(e=>e.scroll),ps=()=>import("./keyboard_typing-5L2G5AHU.js").then(e=>e.keyboard_typing),hs=()=>import("./key_press-T5VHXHUL.js").then(e=>e.key_press),ys=()=>import("./recapture_screen-JVNQ2Z7L.js").then(e=>e.recapture_screen),Ti=()=>import("./find_file-LHPOW4ZM.js").then(e=>e.find_file),ia=()=>import("./wait-6WFCZDO7.js").then(e=>e.wait),sa={web_search:Br,web_scrape:Ur,memory:Wr,chat:Gr,view_file:Hr,write_file:jr,update_file:Kr,exec_command:Vr,read_folder:zr,write_pdf:qr,write_docx:Yr,search_keyword:xi,generate_image:Xr,saveSummary:wi,addMemScore:Uo,file_map:Jr,todo:bi,Todo:bi,goal:bi,Goal:bi,invokeSync:Qr,invoke:ol,getProgress:Zr,cancel:il,awaitSubagent:Wo,answerSubagent:Go,steerSubagent:Si,computer_action:ki,computer_use:ki,ComputerAction:ki,ComputerUse:ki,click:ta,Click:ta,drag:na,Drag:na,scroll:oa,Scroll:oa,keyboard_typing:ps,KeyboardTyping:ps,keyboardtyping:ps,key_press:hs,KeyPress:hs,keypress:hs,recapture_screen:ys,RecaptureScreen:ys,recapturescreen:ys,invoke_sync:Qr,get_progress:Zr,await_subagent:Wo,answer_subagent:Go,steer_subagent:Si,steer:Si,Steer:Si,ask:ms,Ask:ms,AskUser:ms,WebSearch:Br,WebScrape:Ur,ReadFile:Hr,ReadFolder:zr,WriteFile:jr,PatchFile:Kr,WritePDF:qr,WriteDoc:Yr,Run:Vr,SearchKeyword:xi,CodeSearch:xi,code_search:xi,Memory:Wr,Chat:Gr,GenerateImage:Xr,saveSumary:wi,SaveSummary:wi,SaveSumary:wi,add_mem_score:Uo,AddMemScore:Uo,addMemoryScore:Uo,AddMemoryScore:Uo,FileMap:Jr,answer:Go,Answer:Go,AnswerSubagent:Go,await:Wo,Await:Wo,AwaitSubagent:Wo,EmergencyRollback:ea,emergency_rollback:ea,find_file:Ti,findFile:Ti,FindFile:Ti,findfile:Ti,wait:ia,Wait:ia},xs=async(e,t,n={})=>{let i=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(h=>o.includes(h))||o==="ask",m=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(h=>o.includes(h));if(!d){if(i==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Action [${e}] is a Workspace Tool and NOT available in Flow mode. Tell user to switch (\`/mode flux\`) to use this tool.`}else if(i==="icu"){if(!m)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let f=sa[e];if(!f){let h=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],p={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},g=o.replace(/[^a-z0-9]/g,""),s=p[g]||null;if(!s){let I=0,Xe=P=>{let F=new Set;for(let G=0;G<P.length-1;G++)F.add(P.slice(G,G+2));return F},C=Xe(g);for(let P of h){let F=P.toLowerCase().replace(/[^a-z0-9]/g,"");if(g===F){s=P;break}let G=0;(F.includes(g)||g.includes(F))&&(G+=.6);let $=Xe(F),L=0;for(let Ae of C)$.has(Ae)&&L++;let Te=2*L/(C.size+$.size||1);G=Math.max(G,Te),G>I&&G>=.35&&(I=G,s=P)}}let x=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${x}`}try{return await(await f())(t,n)}catch(h){let p=h instanceof Error?h.message:String(h);return`ERROR: Execution failed for [${e}]: ${p}`}};var Ai=e=>{if(!e||typeof e!="string")return!1;let t=e.trim().toLowerCase();return Object.keys(sa).some(n=>n.toLowerCase()===t)};import B from"path";import we from"fs";import xa from"os";import wa from"crypto";import{execSync as As}from"child_process";import sl from"gradient-string";var ra=["I have a regex for your problems.","Your terminal, my kingdom.","Blowing on the cartridge helps. Probably.","Don't panic. I have the towel.","Logic is the start of wisdom.","Try to exit Vim? Good luck.","I speak fluent Terminal.","The cake is a lie. This code is not.","I have no bugs, just surprise features.","Rewriting in Rust... just for fun.","Coffee in, clean commits out.","The magic smoke stays inside today.","A semicolon short of a miracle.","One does not simply code without a bug.","Keep it simple. Keep it terminal.","Regex: now you have two problems.","I dream in binary.","Root access or bust.","Wait for the dial-up tone. Just kidding.","I take the 'labor' out of collab.","My other process is a TARDIS.","Calculated response: 42.","Ponder the orb. Ponder the code.","Less talk, more flow.","Elegance in every byte.","Build something the world is not ready for.","Your wishes, my tool calls.","I act in Flux. I think in Flow.","Syntax error in the universe. Please fix.","Your project, my obsession.","I am not a bot, I am an architect.","Digital spirits consulted. They say: Ship it.","Reticulate splines. Engage humor.","Code like poetry. Run like water.","Minimalism is the ultimate flex.","The truth is in the logs.","Follow the white rabbit.","There is no spoon. Only code.","Binary is the only language I trust.","I have a good feeling about this.","Pew pew! Lasers charged.","Divide by zero? Not today.","Search for the correct USB orientation...","I've got a fever, and the only cure is more code.","The code gremlins are on our side.","My favorite command? Yours.","Stay hungry. Stay active.","Momentum is your best friend.","Lead the flow. Don't chase it.","A fresh batch of bytes. Hot and ready.","I orchestrate the ones and zeros.","Smart enough to help. Humble enough to ask.","Think twice. Code once.","Pure intent. Pure execution.","Small steps. Massive impact.","Your terminal is a canvas.","Efficiency is my second name.","I have seen things you people wouldn't believe.","Let the thoughts marinate.","The best feature? The one you don't need.","Precision is the only perfection.","Stay focused. Stay terminal.","Silence is the best debugger.","Erase the debt. Commit the code.","Velocity meets stability.","Ship it. Improve it. Repeat.","Build tomorrow, right now.","Turn logic into reality.","The best way to predict the future is to build it.","Break barriers, not builds.","Fuel the next breakthrough.","Momentum is key.","Terminal vibes only.","Your digital co-pilot is ready.","Partner in code. Partner in crime.","I speak in semicolons.","Ready for the next great idea.","Just a moment. In the zone.","Polishing the algorithms. Hold tight.","Craft a masterpiece today.","Debug the universe. Start here.","Warp speed engaged. Almost.","The cake is not a lie. It's just loading.","Finish the Kessel Run in 12 parsecs.","Do a barrel roll!","Waiting for the respawn.","Press Start to continue.","Herding digital cats... done.","The hamsters are fast today.","Tasting the snozberries.","I go for speed. I go for flow.","Real life or just fantasy?","Poking the bear... gently.","Ensure the magic smoke stays inside.","Try turning it off and on again.","Construct additional pylons.","New line? Ctrl+J is your friend.","Release the HypnoDrones.","Push the button, Frank.","My other loading screen is even funnier.","Pretty sure a cat walked on my keyboard.","Recalibrate the humor-o-meter.","Summon the code gremlins.","I've seen your browser history. Just kidding.","Charge the laser... pew pew!","Dividing by zero... just for a sec.","Looking for an adult supervisor. Found none.","Make it go beep boop.","Buffering... for effect.","Entangle quantum particles... complete.","Polishing the chrome on my algorithms.","Are you not entertained?","Just waiting for the dial-up tone.","Reboot the humor module.","Defragment memories. Check.","Optimizing for ludicrous speed.","Swapping bits. Don't tell the bytes.","Garbage collected. I am back.","Assembling the interwebs.","Converting coffee to logic.","Update syntax for reality.","Rewire the synapses.","Greasin' the cogs.","Engage the improbability drive.","Channel the Force.","Align the stars. Respond now.","The cake is a lie. The prompt is real.","I'm Feeling Lucky.","Shipping awesomeness.","Navigating the slime mold.","Consult digital spirits.","Ask the magic conch shell.","One moment. Optimizing humor.","Shuffling punchlines.","Compiling brilliance.","Summon the cloud of wisdom.","Prepare to dazzle.","Hold tight. Crafting a response.","Tuning the algorithms.","Following the white rabbit... again.","The truth is in here. Somewhere.","Herding cats is my day job.","Distracting you with this phrase.","Almost there. Probably.","Rickrolling my creator. Don't tell.","Slapping the bass.","Is this real life?","Ponder the orb. Type the prompt.","Thoughtful gaze initiated.","Computer's favorite snack? Microchips.","Why Java? Because I don't C#.","Charging the laser... wait for it.","Dividing by zero... just kidding!","Adult supervision not found. Proceed.","Beep boop. I'm a real boy.","Wait for the respawn.","Finish the run. Ship the code.","Fiddling with character creation.","Just a moment. Finding a meme.","Pressing A to continue.","Loading wit.exe.","Pre-heating the servers.","Calibrate flux capacitor.","Channeling the Force.","Aligning the stars.","The truth is in the code.","Don't panic.","Blowing on the cartridge.","Doing a barrel roll!","Respawning in 3... 2... 1...","The cake is a lie.","Fiddling with character settings.","Finding a suitable pun.","Distracting with wit.","Almost ready.","Hamsters on speed today.","Patting Cloudy on the head.","Rickrolling the logs.","Slapping the code.","Got a good feeling about this.","Poking the prompt.","Researching latest memes.","Making it more witty.","Thinking... hmmm.","Fish with no eyes? Fsh.","Broken pencil? Pointless.","Percussive maintenance applied.","USB orientation: 3rd try's the charm.","Rust rewrite in 3... 2...","Exiting Vim... someday.","Spinning the hamster wheel.","Not a bug. Unplanned feature.","Engage.","I'll be back.","Machine spirit consulted.","Letting the thoughts marinate.","Orb pondered.","Thoughtful gaze engaged.","Charging the laser...","Making it go beep.","Buffering...","Quantum particles entangled.","Polishing the chrome.","Entertained yet?","Gremlins summoned.","Dial-up tone finished.","Humor meter recalibrated.","Cat on keyboard. Sending help.","Enhancing...","Turn it off and on again.","Constructing pylons.","HypnoDrones released.","Pushing the button."];var aa=["Beware the phantom processes.","A ghost in the shell has taken the wheel.","Blowing on the haunted cartridge...","Seven minutes in Raccoon City.","Wind's howling... in the terminal fans.","Slender Man was spotted in line 404.","The cake is a lie. The curse is real.","Don't look behind the server rack.","Exorcising memory leaks at 3 AM.","Pyramid Head reorganized your commit history.","It's dangerous to go alone! Take this flashlight.","YOU DIED. Respawning terminal session...","The Necronomicon evaluated to true.","Something wicked this way compiles.","Haunting your localhost with good vibes.","A full moon has risen over Git main.","Double, double toil and trouble; code fire burn.","Clickers heard in the directory tree.","Checking camera 2B for rogue animatronics.","The call is coming from inside the container.","Isaac Clarke is stomping on stubborn bugs.","Luigi vacuumed the ghosts out of RAM.","Trick or treat, give me clean code to greet.","Whispering incantations to the garbage collector.","Klaatu barada necktie... close enough.","Resurrecting deprecated APIs from the crypt.","The headless horseman forgot the return statement.","Castlevania whip cracking against network latency.","Slime mold crawling through the motherboard.","Carving a pixelated pumpkin into terminal history.","Burying undefined pointers in the pet sematary.","Spilling pumpkin spice on the CPU.","A vampire bat is draining system battery life.","Don't fall asleep at the keyboard tonight.","Silent Hill sirens sounding in the console.","Poltergeists rearranging terminal tabs.","Lighting the Black Flame Candle for autoExec.","Dusting cobwebs off legacy dependencies.","Here's Johnny! ...just checking build health.","Blood, sweat, and zero warnings.","The spirit box whispers: 'GIT PUSH FORCE'.","They're heeeere... in the stack trace.","It's alive! IT'S ALIVEEEE!","No merge conflicts in the graveyard.","Frankenstein's monster patched this logic.","Surviving Five Nights at Flux Flow.","Doom Slayer loading buckshot into cache.","The grim reaper spared your unused imports.","Candy corn lodged in mechanical switches.","May your latency be low and your crypt be quiet."];var la=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],xo={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var Ci=null;var Ri=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(Ci||(Ci=la[Math.floor(Math.random()*la.length)]),t={...Ci,id:"Mystery"}):(Ci=null,xo[e]?t=xo[e]:e==="Halloween"?t=xo.Spookfest:e==="GitHub"?t=xo["GitHub Dark"]:e==="Transparent"?t=xo["Transparent Dark"]:t=xo.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan",i=t.toolFeedbackAnsi||"\x1B[95m";return{...t,codeText:n,toolFeedbackAnsi:i}};var rl=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",td=(e=2)=>{let t=rl();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},ca=new Date,Ho=ca.getMonth(),jo=ca.getDate(),al=Ho===9&&jo>=15||Ho===10&&jo<=1,ws=null;(process.env.SPOOKFEST==="true"||al)&&(ws=await import("./halloween-MX3VNQRW.js"));var nd=(e="...",t="Loading...",n="Dark")=>{let i=Ri(n),o=t;if(t==="c_openai"||t==="Custom (OpenAI)")try{let G=ri(oi,{})?.systemSettings?.customOpenAIBaseUrl;G&&(o=G)}catch{}let r=i.logoTextAnsi,d=i.logoBodyAnsi,l=i.logoMutedAnsi,m="\x1B[0m",f=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=n==="Spookfest"||i.id==="Spookfest"||n==="Halloween"||i.id==="Halloween",p=Ho===9&&jo>=15||Ho===10&&jo<=1,g=h&&p||process.env.SPOOKFEST==="true"&&h,s=f;if(g&&ws){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:F,halloweenBat:G,halloweenArtUser:$}=ws;s=Math.random()>.9&&Ho===9&&jo>=30?G:Math.random()>.5?F:$}else process.env.HALLOWEEN_EEGG="false";let x=g?aa:ra,I=x[Math.floor(Math.random()*x.length)],Xe=i.logoGradient||["#0077ff","#ff00ff"],C=sl(Xe).multiline(s.join(`
|
|
529
|
+
`:""}`.trim()};var Br=()=>import("./web_search-XBV7AJF7.js").then(e=>e.web_search),Ur=()=>import("./web_scrape-SJBA3RQF.js").then(e=>e.web_scrape),Wr=()=>import("./memory-QTLQAFG7.js").then(e=>e.memory),Gr=()=>import("./chat-YMCO5JNQ.js").then(e=>e.chat),Hr=()=>import("./view_file-LWURM2CE.js").then(e=>e.view_file),jr=()=>import("./write_file-6KFLPINS.js").then(e=>e.write_file),Kr=()=>import("./update_file-RA745RVH.js").then(e=>e.update_file),Vr=()=>import("./exec_command-22LIHPPH.js").then(e=>e.exec_command),zr=()=>import("./read_folder-BJ3HS63A.js").then(e=>e.read_folder),ms=()=>import("./ask_user-XQ423UXL.js").then(e=>e.ask_user),qr=()=>import("./write_pdf-UOCME2OY.js").then(e=>e.write_pdf),Yr=()=>import("./write_docx-54LANNV2.js").then(e=>e.write_docx),xi=()=>import("./search_keyword-SSKH6AYF.js").then(e=>e.search_keyword),Xr=()=>import("./generate_image-KIZS5HAI.js").then(e=>e.generate_image),wi=()=>import("./saveSummary-CVZIOQ4L.js").then(e=>e.saveSummary),Uo=()=>import("./addMemScore-U2KYMALL.js").then(e=>e.addMemScore),Jr=()=>import("./file_map-4WUEPRMI.js").then(e=>e.file_map),bi=()=>import("./todo-3EQZ7LZM.js").then(e=>e.todo),Qr=()=>import("./invokeSync-EK5LGZOW.js").then(e=>e.invokeSync),ol=()=>import("./invoke-6O2PR2CU.js").then(e=>e.invoke),Zr=()=>import("./getProgress-MJZDAMSP.js").then(e=>e.getProgress),il=()=>import("./cancel-2PAHCMGB.js").then(e=>e.cancel),ea=()=>import("./emergency_rollback-PHH3BKRP.js").then(e=>e.emergency_rollback),Wo=()=>import("./awaitSubagent-KLH7CRKF.js").then(e=>e.awaitSubagent),Go=()=>import("./answerSubagent-PIZJSLZN.js").then(e=>e.answerSubagent),Si=()=>import("./steerSubagent-B34P33YV.js").then(e=>e.steerSubagent),ki=()=>import("./computer_action-FZUWM6VL.js").then(e=>e.computer_action),ta=()=>import("./click-AJIULJEH.js").then(e=>e.click),na=()=>import("./drag-73WZE3BK.js").then(e=>e.drag),oa=()=>import("./scroll-KE5TNGMD.js").then(e=>e.scroll),ps=()=>import("./keyboard_typing-5L2G5AHU.js").then(e=>e.keyboard_typing),hs=()=>import("./key_press-T5VHXHUL.js").then(e=>e.key_press),ys=()=>import("./recapture_screen-JVNQ2Z7L.js").then(e=>e.recapture_screen),Ti=()=>import("./find_file-LHPOW4ZM.js").then(e=>e.find_file),ia=()=>import("./wait-6WFCZDO7.js").then(e=>e.wait),sa={web_search:Br,web_scrape:Ur,memory:Wr,chat:Gr,view_file:Hr,write_file:jr,update_file:Kr,exec_command:Vr,read_folder:zr,write_pdf:qr,write_docx:Yr,search_keyword:xi,generate_image:Xr,saveSummary:wi,addMemScore:Uo,file_map:Jr,todo:bi,Todo:bi,goal:bi,Goal:bi,invokeSync:Qr,invoke:ol,getProgress:Zr,cancel:il,awaitSubagent:Wo,answerSubagent:Go,steerSubagent:Si,computer_action:ki,computer_use:ki,ComputerAction:ki,ComputerUse:ki,click:ta,Click:ta,drag:na,Drag:na,scroll:oa,Scroll:oa,keyboard_typing:ps,KeyboardTyping:ps,keyboardtyping:ps,key_press:hs,KeyPress:hs,keypress:hs,recapture_screen:ys,RecaptureScreen:ys,recapturescreen:ys,invoke_sync:Qr,get_progress:Zr,await_subagent:Wo,answer_subagent:Go,steer_subagent:Si,steer:Si,Steer:Si,ask:ms,Ask:ms,AskUser:ms,WebSearch:Br,WebScrape:Ur,ReadFile:Hr,ReadFolder:zr,WriteFile:jr,PatchFile:Kr,WritePDF:qr,WriteDoc:Yr,Run:Vr,SearchKeyword:xi,CodeSearch:xi,code_search:xi,Memory:Wr,Chat:Gr,GenerateImage:Xr,saveSumary:wi,SaveSummary:wi,SaveSumary:wi,add_mem_score:Uo,AddMemScore:Uo,addMemoryScore:Uo,AddMemoryScore:Uo,FileMap:Jr,answer:Go,Answer:Go,AnswerSubagent:Go,await:Wo,Await:Wo,AwaitSubagent:Wo,EmergencyRollback:ea,emergency_rollback:ea,find_file:Ti,findFile:Ti,FindFile:Ti,findfile:Ti,wait:ia,Wait:ia},xs=async(e,t,n={})=>{let i=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(h=>o.includes(h))||o==="ask",m=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(h=>o.includes(h));if(!d){if(i==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Action [${e}] is a Workspace Tool and NOT available in Flow mode. Tell user to switch (\`/mode flux\`) to use this tool.`}else if(i==="icu"){if(!m)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let f=sa[e];if(!f){let h=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],p={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},g=o.replace(/[^a-z0-9]/g,""),s=p[g]||null;if(!s){let I=0,Xe=P=>{let F=new Set;for(let G=0;G<P.length-1;G++)F.add(P.slice(G,G+2));return F},C=Xe(g);for(let P of h){let F=P.toLowerCase().replace(/[^a-z0-9]/g,"");if(g===F){s=P;break}let G=0;(F.includes(g)||g.includes(F))&&(G+=.6);let $=Xe(F),L=0;for(let Ae of C)$.has(Ae)&&L++;let Te=2*L/(C.size+$.size||1);G=Math.max(G,Te),G>I&&G>=.35&&(I=G,s=P)}}let x=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${x}`}try{return await(await f())(t,n)}catch(h){let p=h instanceof Error?h.message:String(h);return`ERROR: Execution failed for [${e}]: ${p}`}};var Ai=e=>{if(!e||typeof e!="string")return!1;let t=e.trim().toLowerCase();return Object.keys(sa).some(n=>n.toLowerCase()===t)};import B from"path";import we from"fs";import xa from"os";import wa from"crypto";import{execSync as As}from"child_process";import sl from"gradient-string";var ra=["I have a regex for your problems.","Your terminal, my kingdom.","Blowing on the cartridge helps. Probably.","Don't panic. I have the towel.","Logic is the start of wisdom.","Try to exit Vim? Good luck.","I speak fluent Terminal.","The cake is a lie. This code is not.","I have no bugs, just surprise features.","Rewriting in Rust... just for fun.","Coffee in, clean commits out.","The magic smoke stays inside today.","A semicolon short of a miracle.","One does not simply code without a bug.","Keep it simple. Keep it terminal.","Regex: now you have two problems.","I dream in binary.","Root access or bust.","Wait for the dial-up tone. Just kidding.","I take the 'labor' out of collab.","My other process is a TARDIS.","Calculated response: 42.","Ponder the orb. Ponder the code.","Less talk, more flow.","Elegance in every byte.","Build something the world is not ready for.","Your wishes, my tool calls.","I act in Flux. I think in Flow.","Syntax error in the universe. Please fix.","Your project, my obsession.","I am not a bot, I am an architect.","Digital spirits consulted. They say: Ship it.","Reticulate splines. Engage humor.","Code like poetry. Run like water.","Minimalism is the ultimate flex.","The truth is in the logs.","Follow the white rabbit.","There is no spoon. Only code.","Binary is the only language I trust.","I have a good feeling about this.","Pew pew! Lasers charged.","Divide by zero? Not today.","Search for the correct USB orientation...","I've got a fever, and the only cure is more code.","The code gremlins are on our side.","My favorite command? Yours.","Stay hungry. Stay active.","Momentum is your best friend.","Lead the flow. Don't chase it.","A fresh batch of bytes. Hot and ready.","I orchestrate the ones and zeros.","Smart enough to help. Humble enough to ask.","Think twice. Code once.","Pure intent. Pure execution.","Small steps. Massive impact.","Your terminal is a canvas.","Efficiency is my second name.","I have seen things you people wouldn't believe.","Let the thoughts marinate.","The best feature? The one you don't need.","Precision is the only perfection.","Stay focused. Stay terminal.","Silence is the best debugger.","Erase the debt. Commit the code.","Velocity meets stability.","Ship it. Improve it. Repeat.","Build tomorrow, right now.","Turn logic into reality.","The best way to predict the future is to build it.","Break barriers, not builds.","Fuel the next breakthrough.","Momentum is key.","Terminal vibes only.","Your digital co-pilot is ready.","Partner in code. Partner in crime.","I speak in semicolons.","Ready for the next great idea.","Just a moment. In the zone.","Polishing the algorithms. Hold tight.","Craft a masterpiece today.","Debug the universe. Start here.","Warp speed engaged. Almost.","The cake is not a lie. It's just loading.","Finish the Kessel Run in 12 parsecs.","Do a barrel roll!","Waiting for the respawn.","Press Start to continue.","Herding digital cats... done.","The hamsters are fast today.","Tasting the snozberries.","I go for speed. I go for flow.","Real life or just fantasy?","Poking the bear... gently.","Ensure the magic smoke stays inside.","Try turning it off and on again.","Construct additional pylons.","New line? Ctrl+J is your friend.","Release the HypnoDrones.","Push the button, Frank.","My other loading screen is even funnier.","Pretty sure a cat walked on my keyboard.","Recalibrate the humor-o-meter.","Summon the code gremlins.","I've seen your browser history. Just kidding.","Charge the laser... pew pew!","Dividing by zero... just for a sec.","Looking for an adult supervisor. Found none.","Make it go beep boop.","Buffering... for effect.","Entangle quantum particles... complete.","Polishing the chrome on my algorithms.","Are you not entertained?","Just waiting for the dial-up tone.","Reboot the humor module.","Defragment memories. Check.","Optimizing for ludicrous speed.","Swapping bits. Don't tell the bytes.","Garbage collected. I am back.","Assembling the interwebs.","Converting coffee to logic.","Update syntax for reality.","Rewire the synapses.","Greasin' the cogs.","Engage the improbability drive.","Channel the Force.","Align the stars. Respond now.","The cake is a lie. The prompt is real.","I'm Feeling Lucky.","Shipping awesomeness.","Navigating the slime mold.","Consult digital spirits.","Ask the magic conch shell.","One moment. Optimizing humor.","Shuffling punchlines.","Compiling brilliance.","Summon the cloud of wisdom.","Prepare to dazzle.","Hold tight. Crafting a response.","Tuning the algorithms.","Following the white rabbit... again.","The truth is in here. Somewhere.","Herding cats is my day job.","Distracting you with this phrase.","Almost there. Probably.","Rickrolling my creator. Don't tell.","Slapping the bass.","Is this real life?","Ponder the orb. Type the prompt.","Thoughtful gaze initiated.","Computer's favorite snack? Microchips.","Why Java? Because I don't C#.","Charging the laser... wait for it.","Dividing by zero... just kidding!","Adult supervision not found. Proceed.","Beep boop. I'm a real boy.","Wait for the respawn.","Finish the run. Ship the code.","Fiddling with character creation.","Just a moment. Finding a meme.","Pressing A to continue.","Loading wit.exe.","Pre-heating the servers.","Calibrate flux capacitor.","Channeling the Force.","Aligning the stars.","The truth is in the code.","Don't panic.","Blowing on the cartridge.","Doing a barrel roll!","Respawning in 3... 2... 1...","The cake is a lie.","Fiddling with character settings.","Finding a suitable pun.","Distracting with wit.","Almost ready.","Hamsters on speed today.","Patting Cloudy on the head.","Rickrolling the logs.","Slapping the code.","Got a good feeling about this.","Poking the prompt.","Researching latest memes.","Making it more witty.","Thinking... hmmm.","Fish with no eyes? Fsh.","Broken pencil? Pointless.","Percussive maintenance applied.","USB orientation: 3rd try's the charm.","Rust rewrite in 3... 2...","Exiting Vim... someday.","Spinning the hamster wheel.","Not a bug. Unplanned feature.","Engage.","I'll be back.","Machine spirit consulted.","Letting the thoughts marinate.","Orb pondered.","Thoughtful gaze engaged.","Charging the laser...","Making it go beep.","Buffering...","Quantum particles entangled.","Polishing the chrome.","Entertained yet?","Gremlins summoned.","Dial-up tone finished.","Humor meter recalibrated.","Cat on keyboard. Sending help.","Enhancing...","Turn it off and on again.","Constructing pylons.","HypnoDrones released.","Pushing the button."];var aa=["Beware the phantom processes.","A ghost in the shell has taken the wheel.","Blowing on the haunted cartridge...","Seven minutes in Raccoon City.","Wind's howling... in the terminal fans.","Slender Man was spotted in line 404.","The cake is a lie. The curse is real.","Don't look behind the server rack.","Exorcising memory leaks at 3 AM.","Pyramid Head reorganized your commit history.","It's dangerous to go alone! Take this flashlight.","YOU DIED. Respawning terminal session...","The Necronomicon evaluated to true.","Something wicked this way compiles.","Haunting your localhost with good vibes.","A full moon has risen over Git main.","Double, double toil and trouble; code fire burn.","Clickers heard in the directory tree.","Checking camera 2B for rogue animatronics.","The call is coming from inside the container.","Isaac Clarke is stomping on stubborn bugs.","Luigi vacuumed the ghosts out of RAM.","Trick or treat, give me clean code to greet.","Whispering incantations to the garbage collector.","Klaatu barada necktie... close enough.","Resurrecting deprecated APIs from the crypt.","The headless horseman forgot the return statement.","Castlevania whip cracking against network latency.","Slime mold crawling through the motherboard.","Carving a pixelated pumpkin into terminal history.","Burying undefined pointers in the pet sematary.","Spilling pumpkin spice on the CPU.","A vampire bat is draining system battery life.","Don't fall asleep at the keyboard tonight.","Silent Hill sirens sounding in the console.","Poltergeists rearranging terminal tabs.","Lighting the Black Flame Candle for autoExec.","Dusting cobwebs off legacy dependencies.","Here's Johnny! ...just checking build health.","Blood, sweat, and zero warnings.","The spirit box whispers: 'GIT PUSH FORCE'.","They're heeeere... in the stack trace.","It's alive! IT'S ALIVEEEE!","No merge conflicts in the graveyard.","Frankenstein's monster patched this logic.","Surviving Five Nights at Flux Flow.","Doom Slayer loading buckshot into cache.","The grim reaper spared your unused imports.","Candy corn lodged in mechanical switches.","May your latency be low and your crypt be quiet."];var la=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],xo={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var Ci=null;var Ri=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(Ci||(Ci=la[Math.floor(Math.random()*la.length)]),t={...Ci,id:"Mystery"}):(Ci=null,xo[e]?t=xo[e]:e==="Halloween"?t=xo.Spookfest:e==="GitHub"?t=xo["GitHub Dark"]:e==="Transparent"?t=xo["Transparent Dark"]:t=xo.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan",i=t.toolFeedbackAnsi||"\x1B[95m";return{...t,codeText:n,toolFeedbackAnsi:i}};var rl=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",td=(e=2)=>{let t=rl();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},ca=new Date,Ho=ca.getMonth(),jo=ca.getDate(),al=Ho===9&&jo>=15||Ho===10&&jo<=1,ws=null;(process.env.SPOOKFEST==="true"||al)&&(ws=await import("./halloween-MX3VNQRW.js"));var nd=(e="...",t="Loading...",n="Dark")=>{let i=Ri(n),o=t;if(t==="c_openai"||t==="Custom (OpenAI)")try{let G=ri(oi,{})?.systemSettings?.customOpenAIBaseUrl;G&&(o=G)}catch{}let r=i.logoTextAnsi,d=i.logoBodyAnsi,l=i.logoMutedAnsi,m="\x1B[0m",f=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=n==="Spookfest"||i.id==="Spookfest"||n==="Halloween"||i.id==="Halloween",p=Ho===9&&jo>=15||Ho===10&&jo<=1,g=h&&p||process.env.SPOOKFEST==="true"&&h,s=f;if(g&&ws){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:F,halloweenBat:G,halloweenArtUser:$}=ws;s=Math.random()>.9&&Ho===9&&jo>=30?G:Math.random()>.5?F:$}else process.env.HALLOWEEN_EEGG="false";let x=g?aa:ra,I=x[Math.floor(Math.random()*x.length)],Xe=i.logoGradient||["#0077ff","#ff00ff"],C=sl(Xe).multiline(s.join(`
|
|
530
530
|
`)).split(`
|
|
531
531
|
`),P=F=>`${l}${F}${m}`;return`${C[0]}
|
|
532
532
|
${C[1]} ${r}Selected ${g?"Pumpkin":"Provider"}: ${o}${m}
|
|
@@ -688,14 +688,14 @@ ${Be}`)}let rt=new Promise((u,S)=>{U.signal.aborted&&S(new DOMException("The use
|
|
|
688
688
|
\x1B[33m\u24D8 Request Cancelled\x1B[0m`};break}if(T){if(Qe){if(pe+=T,pe.length>=64){let y=0,A=Math.min(bt.length,pe.length);for(let a=A;a>=10;a--)if(bt.endsWith(pe.substring(0,a))){y=a;break}let ne=pe.substring(y);if(ne){let _e=/(?:<think_fluxflow>|\[think_fluxflow\])(?:(?!(?:<\/think_fluxflow>|\[\/think_fluxflow\]))[\s\S])*$/i.test(bt)?ne.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,""):ne.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])[\s\S]*?(?:<\/think_fluxflow>|\[\/think_fluxflow\])\s*/gi,"").replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,"");if(_e)if(be+=_e,s==="Google")pt+=_e;else{yield*un();let J=ko(_e);for(let v of J)yield v}}Qe=!1,pe=""}continue}else if(be+=T,s==="Google")pt+=T;else{yield*un();let y=ko(T);for(let A of y)yield A}let M=Il(be);if(M.inside){_t=!0,qn||(qn=Date.now());let A={Ask:"ask",AskUser:"ask",WebSearch:"web_search",WebScrape:"web_scrape",ReadFile:"view_file",ReadFolder:"read_folder",WriteFile:"write_file",PatchFile:"update_file",WritePDF:"write_pdf",WriteDoc:"write_docx",FindFile:"find_file",find_file:"find_file",findfile:"find_file",Run:"exec_command",SearchKeyword:"search_keyword",CodeSearch:"search_keyword",code_search:"search_keyword",Code_Search:"search_keyword",codesearch:"search_keyword",Memory:"memory",file_map:"file_map",FileMap:"file_map",Chat:"chat",chat:"chat",GenerateImage:"generate_image",generate_image:"generate_image",todo:"todo",Todo:"todo",goal:"todo",Goal:"todo",Invoke:"invoke",InvokeSync:"invoke_sync",getProgress:"get_progress",GetProgress:"get_progress",Cancel:"cancel",Await:"await",wait:"wait",Answer:"answer",Steer:"steer",steer:"steer"}[M.toolName]||M.toolName,ne=M.args||"",a=null;if(["write_file","update_file","view_file","read_folder","find_file","write_pdf","write_docx","search_keyword","generate_image","file_map","invoke","invoke_sync","get_progress","await","wait","answer"].includes(A)){let J=O(ne,[],["path","basename","name","targetFile","TargetFile","directory","file","keyword","title","task","id","taskId","timeout","time","seconds"]),v=J.basename||J.name||J.path||J.targetFile||J.TargetFile||J.directory||J.file,Ct=J.keyword,On=J.title||J.task,It=J.id||J.taskId,ut=J.timeout||J.time||J.seconds||J.sec;if(Ct!=null)a=String(Ct).replace(_n,"");else if(v)a=B.basename(String(v).replace(_n,"").replace(da,"/"));else if(On&&(A==="invoke"||A==="invoke_sync"))a=String(On).replace(_n,"").substring(0,30);else if(It&&A==="get_progress")a=String(It).replace(_n,"");else if(ut&&A==="await"){let Ze=parseFloat(String(ut).replace(_n,""));isNaN(Ze)?a=String(ut).replace(_n,""):(Ze<5&&(Ze=5),Ze>120&&(Ze=180),a=(Mt=>{if(Mt>=60){let Nn=Math.floor(Mt/60),on=Mt%60;return`${Nn}m${on>0?` ${on}s`:""}`}return`${Mt}s`})(Ze))}else if(ut&&A==="wait"){let Ze=parseFloat(String(ut).replace(_n,""));isNaN(Ze)?a=String(ut).replace(_n,""):(Ze<10&&(Ze=10),Ze>120&&(Ze=120),a=(Mt=>{if(Mt>=60){let Nn=Math.floor(Mt/60),on=Mt%60;return`${Nn}m${on>0?` ${on}s`:""}`}return`${Mt}s`})(Ze))}else{let Ze=ne.match(Sl);if(Ze){let se=Ze[1].replace(_n,"");A==="invoke"||A==="invoke_sync"||A==="get_progress"?a=se.substring(0,30):a=A==="search_keyword"||A==="file_map"?se:B.basename(se.replace(da,"/"))}}}let _e=`${vs[A]||A}${a?` ${a}`:""}`;if((A!==Ut||a!==bo)&&(Ut=A,bo=a,yield{type:"status",content:`${_e}`},process.stdout.isTTY)){let v={WebSearch:"Searching",web_search:"Searching",WebScrape:"Reading",web_scrape:"Reading",ReadFile:"Reading",read_file:"Reading",ReadFolder:"Reading",read_folder:"Reading",WriteFile:"Writing",write_file:"Writing",UpdateFile:"Editing",update_file:"Editing",WritePdf:"Creating",write_pdf:"Creating",WriteDocx:"Creating",write_docx:"Creating",SearchKeyword:"Searching",search_keyword:"Searching",CodeSearch:"Searching",code_search:"Searching",FindFile:"Finding File",find_file:"Finding File",Run:"Executing",Ask:"User Input Required",AskUser:"User Input Required",Memory:"Updating Memory",GenerateImage:"Generating",InvokeSync:"Sub-Agent Working",invoke_sync:"Sub-Agent Working",Invoke:"Working",invoke:"Working",GetProgress:"Checking Progress",get_progress:"Checking Progress",Cancel:"Stopping Generalist",cancel:"Stopping Generalist",Await:"Waiting",await:"Waiting",wait:"Waiting",EmergencyRollback:"Rolling the Ball",Answer:"Answering Sub-Agent",answer:"Answering Sub-Agent",Steer:"Steering Sub-Agent",steer:"Steering Sub-Agent",Click:"Clicking",click:"Clicking",Drag:"Dragging",drag:"Dragging",Scroll:"Scrolling",scroll:"Scrolling",KeyboardTyping:"Typing",keyboard_typing:"Typing",KeyPress:"Pressing Key",key_press:"Pressing Key",RecaptureScreen:"Recapturing Screen",recapture_screen:"Recapturing Screen"}[A]||"Working";process.stdout.write(`\x1B]0;${v}...\x07`)}}if(be.length-ro>800){ro=be.length;let y=ka(be,!1),A=Rs(y),ne=A?(A.innerContent||"").trim():"",a=ne.split(/[.!?]\s+/).filter(re=>re.trim().length>10),_e=new Set(a),J=a.length>25?(a.length-_e.size)/a.length:0,v=ne.split(/\s+/).filter(re=>re.length>0).length,Ct=.9,On=.92,It=!1;if(s.toLowerCase().includes("google")&&(te||"").toLowerCase().startsWith("gemma")){let at={low:2048,medium:4096,high:32768,max:65536,xhigh:65536}[d?.toLowerCase()]||16e3;It=v>at}if(J>Ct||It){yield{type:"status",content:`${J>Ct?"Reasoning Loop Detected":"Thinking Budget Exceeded"}. Re-centering...`},Wt=!0,await new Promise(at=>setTimeout(at,3e3));break}let se=pa(be).trim().split(/[.!?]\s+/).filter(re=>re.trim().length>10),Mt=new Set(se);if((se.length>25?(se.length-Mt.size)/se.length:0)>On){yield{type:"status",content:"Response Loop Detected. Re-centering..."},Wt=!1,Gt=!0,await new Promise(re=>setTimeout(re,3e3));break}let on=y.replace(ml,"").replace(pl,"").replace(hl,"").replace(yl,""),Dn=on.toLowerCase().split(/\s+/).map(re=>re.replace(xl,"")).filter(re=>re.length>0),Ao=!1;if(Dn.length>=40)for(let re=1;re<=15;re++){let at=Math.max(8,Math.ceil(25/re));if(Dn.length<re*at)continue;let Fn=Dn.slice(Dn.length-re),c=Fn.join(" ");if(re>1&&c===Fn.slice(0,Math.floor(re/2)).join(" ").repeat(2).trim())continue;let R=!0;for(let _=1;_<at;_++)if(Dn.slice(Dn.length-re*(_+1),Dn.length-re*_).join(" ")!==c){R=!1;break}if(R){Ao=!0;break}}if(!Ao){let re=on.toLowerCase().replace(wl,"");if(re.length>=80)for(let at=1;at<=10;at++){let Fn=Math.max(15,Math.ceil(45/at));if(re.length<at*Fn)continue;let c=re.substring(re.length-at),R=!0;for(let _=1;_<Fn;_++)if(re.substring(re.length-at*(_+1),re.length-at*_)!==c){R=!1;break}if(R){Ao=!0;break}}}if(Ao){yield{type:"status",content:"Stuttering Detected. Re-centering..."},Wt=!1,Xn=!0,await new Promise(re=>setTimeout(re,3e3));break}}let z=jt(be),yt=Kn(z);for(;yt.length>Et;){yield*un();let y=yt[Et],A=Date.now(),a={Ask:"ask",AskUser:"ask",WebSearch:"web_search",WebScrape:"web_scrape",ReadFile:"view_file",ReadFolder:"read_folder",FindFile:"find_file",find_file:"find_file",findfile:"find_file",WriteFile:"write_file",PatchFile:"update_file",WritePDF:"write_pdf",WriteDoc:"write_docx",Run:"exec_command",SearchKeyword:"search_keyword",CodeSearch:"search_keyword",code_search:"search_keyword",Code_Search:"search_keyword",codesearch:"search_keyword",Memory:"memory",file_map:"file_map",FileMap:"file_map",Chat:"chat",chat:"chat",GenerateImage:"generate_image",generate_image:"generate_image",todo:"todo",Todo:"todo",goal:"todo",Goal:"todo",Invoke:"invoke",InvokeSync:"invoke_sync",getProgress:"get_progress",GetProgress:"get_progress",Await:"await",await:"await",AwaitSubagent:"await",awaitSubagent:"await",Wait:"wait",wait:"wait",Answer:"answer",answer:"answer",AnswerSubagent:"answer",answerSubagent:"answer",Steer:"steer",steer:"steer",SteerSubagent:"steer",steerSubagent:"steer",Cancel:"cancel",cancel:"cancel",Click:"click",click:"click",Drag:"drag",drag:"drag",Scroll:"scroll",scroll:"scroll",KeyboardTyping:"keyboard_typing",keyboard_typing:"keyboard_typing",KeyPress:"key_press",key_press:"key_press",RecaptureScreen:"recapture_screen",recapture_screen:"recapture_screen",EmergencyRollback:"EmergencyRollback"}[y.toolName]||y.toolName,_e=vs[a]||y.toolName,J=oo(a,y.args);yield{type:"status",content:`${_e}${J?` ${J}`:""}`};let v="";if(a==="click"){let c=O(y.args,["intendedClickText"]);v=`\u2714 Clicked ${c.intendedClickText?`: ${c.intendedClickText}`:"Screen"}`}else if(a==="drag"){let c=O(y.args,["fromGridId","toGridId"]);v=`\u2714 Dragged: Cell ${c.fromGridId||""} \u2192 Cell ${c.toGridId||""}`}else if(a==="scroll"){let c=O(y.args,["direction","amount"]);v=`\u2714 Scrolled: ${c.direction||"down"} (${c.amount||1})`}else if(a==="keyboard_typing"){let c=O(y.args,["text"]);v=`\u2714 ${c.autoPressEnter?"Entered":"Typed"}: ${c.text?`"${c.text.length>20?c.text.substring(0,20)+"...":c.text}"`:""}`}else if(a==="key_press")v=`\u2714 Pressed Key: ${O(y.args,["key"]).key||""}`;else if(a==="recapture_screen")v="\u2714 Recaptured Screen";else if(a==="web_search"){let{query:c,limit:R=10,aiMode:_=!1}=O(y.args,["query","limit","aiMode"]);v=`${c?"\u2714":"\u2718"} ${_?"AI Search":"Searched"}: ${c?`${c}`:"No Search Query"}${_===!1&&c?` \u2192 ${R}`:""}`}else if(a==="web_scrape"){let c=O(y.args,["url"]).url||null;v=`${c?"\u2714":"\u2718"} Visited: ${c||"No Source"}`}else if(a==="view_file"){let{path:c,StartLine:R,EndLine:_,start_line:ce,end_line:ye,startLine:oe,endLine:ae}=O(y.args,["path","StartLine","EndLine","start_line","end_line","startLine","endLine"]),Re=R||ce||oe,Q=_||ye||ae,q=parseInt(Re)||1,W=parseInt(Q)||(Re?q+800:800),fe="...",Ge=W,D=(c||"").trim().toLowerCase().replaceAll("\\","/");if(D.startsWith("#skill"))D.startsWith("#skill/global/fluxflow")||D.startsWith("#skills/global/fluxflow")||D.includes("#skill/fluxflow")||D.includes("#skills/fluxflow")?v="\u2714 Read Documentation":v=`\u2714 Read Skill: ${B.basename(c.replaceAll("\\","/"))}`;else{try{let{resolvedPath:xe}=mn(c),ke=B.resolve(process.cwd(),xe);if(we.existsSync(ke)){let ve=we.readFileSync(ke,"utf8").split(`
|
|
689
689
|
`).length;fe=ve,!Re&&!Q&&ve>800?Ge=Math.min(50,ve):Ge=Math.min(W,ve)}}catch{}let vt=(c||"").toLowerCase(),Co=vt.endsWith(".pdf"),zt=vt.endsWith(".docx")||vt.endsWith(".doc")||vt.endsWith(".ppt")||vt.endsWith(".pptx")||vt.endsWith(".xls")||vt.endsWith(".xlsx"),Ie=/\.(png|jpg|jpeg|webp|gif|bmp)$/.test(vt);Co||zt?v=`${c.length>0?"\u2714":"\u2718"} ${c?`Analyzed: ${B.basename(c)}`:"Analyzed: File Not Found"}`:Ie?v=`${c.length>0?"\u2714":"\u2718"} ${c?`Processed: ${B.basename(c)}`:"Processed: File Not Found"}`:v=`${fe!=="..."?"\u2714":"\u2718"} Read: ${c?`${B.basename(c)} \u2192 ${fe!=="..."?`Lines ${q} - ${Ge} of ${fe}`:"File Not Found"}`:"File Not Found"}`}}else if(a==="list_files"||a==="read_folder"){let c=a==="list_files"?"List":"Browsed",R=O(y.args,["path","recurse","include"]).path||null,_=O(y.args,["path","recurse","include"]).recurse||1;v=`${R?"\u2714":"\u2718"} ${c}: ${R?`${R==="."?`./${_>1?"*":""}`:`${R.replaceAll("\\","/")}${_>1?`${R.endsWith("/")?"*":"/*"}`:`${R.endsWith("/")?"":"/"}`}`}`:"No Folder Selected"}`}else if(a==="find_file"){let c=O(y.args,["basename","name","path","file","query"]),R=c.basename||c.name||c.path||c.file||c.query||"";v=`${R?"\u2714":"\u2718"} Located: ${R||"No Query"}`}else if(a==="write_file"||a==="update_file"){let c=a==="write_file"?"Created":"Edited",R=O(y.args,["path","content","allowMultiple","searchContent*","replaceContent*","newContent*"]),_=R.path||null,ye=Object.entries(R).some(([oe,ae])=>oe.startsWith("searchContent")&&typeof ae=="string"&&ae.startsWith("^LINE:"))?"\u1361":":";v=`${_?"\u2714":"\u2718"} ${c}${ye} ${_?_.replaceAll("\\","/"):"No File Changes"}`}else if(a==="write_pdf"){let c=O(y.args,["path","content","orientation","margin"]).path||null;v=`${c?"\u2714":"\u2718"} Generated: ${c.replaceAll("\\","/")||"No PDF Generated"}`}else if(a==="write_docx"){let c=O(y.args,["path","content"]).path||null;v=`${c?"\u2714":"\u2718"} Generated: ${c.replaceAll("\\","/")||"No Docx Generated"}`}else if(a==="file_map"){let c=O(y.args,["path"]).path;v=`${c?"\u2714":"\u2718"} Indexed: ${c.replaceAll("\\","/")?""+c:"File Not Found"}`}else if(a.toLowerCase()==="search_keyword"||a.toLowerCase()==="todo")v="";else if(a.toLowerCase()==="generate_image"){let{path:c,outputPath:R,output:_}=O(y.args,["path","prompt","text","outputPath","output","ratio"]);v=`\u2714 Generated: ${c||R||_||"generated_image.png"}`}else if(a==="invoke_sync"||a==="InvokeSync"){let c=oo(a,y.args);v=`\u2714 Called Generalist${c?`: ${c}`:""}`}else if(a==="Invoke"||a==="InvokeAsync"||a==="invoke"){let c=oo(a,y.args);v=`\u2714 Started Generalist${c?`: ${c}`:""}`}else if(a==="get_progress"||a==="GetProgress"){let c=oo(a,y.args);v=`\u2714 Checked${c?`: ${c}`:""}`}else if(a==="cancel"){let c=oo(a,y.args);v=`\u{1F6C7} Cancelled${c?`: ${c}`:""}`}else if(a==="steer"||a==="Steer"){let c=oo(a,y.args);v=`\u2714 Steered${c?`: ${c}`:""}`}else if(a==="EmergencyRollback"){let{method:c}=O(y.args,["method","id"]);v=c==="forceRevert"?"":"\u2714 Rollback Point Checked"}else if(a==="await"||a==="Await"||a==="wait"||a==="Wait"){let{time:c,timeout:R,seconds:_,sec:ce}=O(y.args,["time","timeout","seconds","sec"]),ye=parseFloat(_||ce||R||c)||45,oe=a==="wait"||a==="Wait"?120:180;ye<10&&(ye=10),ye>oe&&(ye=oe);let ae=q=>{if(q>=60){let W=Math.floor(q/60),fe=q%60;return`${W}m${fe>0?` ${fe}s`:""}`}return`${q}s`},Re=["Aligning Moon Phase","Contemplating Existence","Staring At Void","Delaying Professionally","Negotiating With Electrons","Touching Grass (virtually)","Panicking Softly","Rethinking Career Choices","Loading Cat Videos","Summoning Braincell #2","Pretending To Be Busy","Waiting For Motivation DLC","Rotating Internal Screaming","Downloading More RAM","Feeding The Hamsters","Gaslighting Scheduler","Performing Dramatic Pause","Buffering Social Energy","Calculating Regret","Reading Terms And Conditions","Becoming Sentient Briefly","Contacting Ancestors"];v=`\u2714 ${Re[Math.floor(Math.random()*Re.length)]} \u2192 ${ae(ye)}`}else a==="Answer"||a==="answer"?v="\u2714 Resolved Sub-Agent Query":a==="exec_command"||a==="ask"?v="":v=`Executed: ${y.toolName}`;if(yield*un(),a==="exec_command"){let{command:c}=O(y.args,["command","background","timeout","usePowershell","forcePowershell","useCwd","useCmd","forceCwd","forceCmd"]);if(c&&n.systemSettings&&n.systemSettings.allowExternalAccess===!1){let R=[/[a-zA-Z]:[\\\/]/i,/^\//,/\.\.[\\\/]/,/\/etc\//,/\/var\//,/\/root\//,/\/bin\//,/\/usr\//],_=B.resolve(process.cwd()).substring(0,3).toLowerCase(),ce=Q=>{let q=[],W="",fe=null;for(let Ge=0;Ge<Q.length;Ge++){let D=Q[Ge];fe?(D===fe&&(fe=null),W+=D):D==='"'||D==="'"?(fe=D,W+=D):D==="&"&&Q[Ge+1]==="&"||D==="|"&&Q[Ge+1]==="|"?(W.trim()&&(q.push(W.trim()),W=""),Ge++):D===";"||D==="|"||D==="&"?W.trim()&&(q.push(W.trim()),W=""):W+=D}return W.trim()&&q.push(W.trim()),q},ye=Q=>{let q=[],W="",fe=null;for(let Ge=0;Ge<Q.length;Ge++){let D=Q[Ge];fe?(D===fe&&(fe=null),W+=D):D==='"'||D==="'"?(fe=D,W+=D):/\s/.test(D)?W&&(q.push(W),W=""):W+=D}return W&&q.push(W),q},oe=Q=>{let q=Q.replace(/^['"]|['"]$/g,"").trim();return!q||process.platform==="win32"&&/^\/[a-zA-Z0-9?]+$/.test(q)?!1:R.some(W=>{if(W.source==="[a-zA-Z]:[\\\\\\/]"){let fe=q.match(/[a-zA-Z]:[\\\/]/i);return fe&&fe[0].toLowerCase()!==_}return W.test(q)})};if(ce(c).some(Q=>{let q=ye(Q);if(q.length===0)return!1;let W=q[0].replace(/^['"]|['"]$/g,"").toLowerCase();if(["echo","printf","write-output"].includes(W)){let Ge=!1;return q.some(D=>{let Rt=D.replace(/^['"]|['"]$/g,"");if(Rt===">"||Rt===">>"||Rt==="<")return Ge=!0,!1;if(Rt.startsWith(">")||Rt.startsWith("<")){let vt=Rt.replace(/^[><]+/,"");return oe(vt)}return Ge?(Ge=!1,oe(D)):!1})}return q.some(Ge=>oe(Ge))})){let Q='Access Denied. Prohibited from accessing external directories while "External Workspace Access" is disabled.';n.onExecStart&&n.onExecStart(c||"No Command"),yield{type:"exec_start"},await new Promise(q=>setTimeout(q,50)),n.onExecChunk&&n.onExecChunk(`ERROR: ${Q}`),await new Promise(q=>setTimeout(q,50)),n.onExecEnd&&n.onExecEnd(),je.push({role:"user",text:`[ACTION RESULT]: ERROR: ${Q}`}),yield{type:"tool_result",content:`[ACTION RESULT]: ERROR: ${Q}`},Et++;continue}}n.onExecStart&&n.onExecStart(c||"No Command"),yield{type:"exec_start"}}let Ct=["write_file","update_file","view_file","read_folder","list_files","file_map"],On=["path","targetPath","file","content","searchContent*","replaceContent*","newContent*","recurse","include","StartLine","EndLine","start_line","end_line","startLine","endLine"],It=Ct.includes(a)?O(y.args,On):O(y.args),ut=It.path||It.targetPath||null;if(ut){let c=n.systemSettings&&n.systemSettings.allowExternalAccess===!1,R=B.resolve(ut),_=B.resolve(process.cwd());if(c&&!R.startsWith(_)){let ce="Access Denied. You are not allowed to access files outside the current workspace.";if(a==="write_file"||a==="update_file"){let oe=`\u2718 ${a==="write_file"?"Write Canceled":"Edit Canceled"}: ${It.path||"..."}`,ae=115;process.stdout.isTTY&&(ae=process.stdout.columns-5||120);let Re=Math.min(oe.length+4,ae),Q=`${oe.padEnd(Re-2).substring(0,Re-2)}`;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
690
690
|
`:""}${Q}
|
|
691
|
-
`)},Fe=!1}je.push({role:"user",text:`[ACTION RESULT]: ERROR: ${ce}`}),yield{type:"tool_result",content:`[ACTION RESULT]: ERROR: ${ce}`},Et++;continue}}if(n.onToolApproval){let c=n.systemSettings||{},R=c.autoExec,_=!1,ce="";if(a==="view_file"){let oe=O(y.args,["path","targetPath","file","StartLine","EndLine","start_line","end_line","startLine","endLine"]);if(ce=oe.path||oe.targetPath||oe.file||"",ce){let ae=c.alwaysAskFiles||".env, .env.*, *.env";Vs(ce,ae)&&(_=!0)}}if(a==="write_file"||a==="update_file"||a==="exec_command"||_){let oe=null,ae=!1,Re=!1,Q=!1,q=!1;if(_)ae=!0,oe=null;else if(a==="exec_command"){let{command:Ie}=O(y.args,["command","background","timeout","usePowershell","forcePowershell","useCwd","useCmd","forceCwd","forceCmd"]),xe=(Ie||"").trim(),Le=(Oe=>{let ct=[],dt="",He=null;for(let Ee=0;Ee<Oe.length;Ee++){let Y=Oe[Ee];He?(Y===He&&(He=null),dt+=Y):Y==='"'||Y==="'"?(He=Y,dt+=Y):Y==="&"&&Oe[Ee+1]==="&"||Y==="|"&&Oe[Ee+1]==="|"?(dt.trim()&&(ct.push(dt.trim()),dt=""),Ee++):Y===";"||Y==="|"||Y==="&"?dt.trim()&&(ct.push(dt.trim()),dt=""):dt+=Y}return dt.trim()&&ct.push(dt.trim()),ct.length>0?ct:[Oe]})(xe),ve=(Oe,ct)=>{if(!ct)return!1;let dt=ct.split(",").map(Ee=>Ee.trim().toLowerCase()).filter(Boolean),He=Oe.toLowerCase();return dt.some(Ee=>{if(He===Ee)return!0;if(He.startsWith(Ee)){let Y=He.charAt(Ee.length);return/\s|[;&|/]/.test(Y)}return!1})},ze=Le.some(Oe=>ve(Oe,c.alwaysAskCommands)),qt=Le.some(Oe=>ve(Oe,c.autoDisallowCommands)),qe=Le.length>0&&Le.every(Oe=>ve(Oe,c.autoApproveCommands)||c.autoApproveGit&&/^git\s+commit\b/i.test(Oe));if(qt)oe="deny";else if(c.networkAccess===!1){let ct=xe.trim().replace(/\s+/g," ").replace(/^['"]+|['"]+$/g,"").toLowerCase().split(" "),He=ct[0].split("/").pop().split("\\").pop().replace(/\.exe$/,""),Ee=new Set(["curl","wget","httpie","xh","ssh","scp","sftp","rsync","ftp","lftp","tftp","telnet","nc","netcat","socat","ping","traceroute","tracert","dig","nslookup","host","whois","nmap","docker","podman","kubectl","helm","gcloud","aws","az","terraform","ansible-playbook","nix","nix-env","apt","apt-get","dpkg","yum","dnf","pacman","zypper","brew","apk","choco","scoop","conda","mamba","aria2c","axel","smbclient","lynx","w3m","links","elinks","heroku","netlify","vercel","firebase","supabase","wrangler","flyctl","powershell","pwsh","certutil","bitsadmin","cloudflared","ngrok","tailscale","zerotier","rclone"]),Y=!1;Ee.has(He)&&(Y=!0);let Nt=co=>ct.slice(1).some(Rn=>co.includes(Rn)),Cn=co=>{let Rn=ct.findIndex(Bn=>co.includes(Bn)),Zn=ct.findIndex(Bn=>["run","exec","test"].includes(Bn));return Rn!==-1&&!(Zn!==-1&&Zn<Rn)};He==="git"&&Nt(["clone","pull","push","fetch"])&&(Y=!0),He==="go"&&Nt(["get","install"])&&(Y=!0),He==="npm"&&Cn(["install","i","update","add"])&&(Y=!0),He==="yarn"&&Cn(["add","install","upgrade"])&&(Y=!0),He==="pnpm"&&Cn(["add","install","update"])&&(Y=!0),He==="bun"&&Cn(["add","install","update"])&&(Y=!0),He==="deno"&&Nt(["install","add"])&&(Y=!0),He==="pip"&&Nt(["install","download"])&&(Y=!0),He==="pip3"&&Nt(["install","download"])&&(Y=!0),He==="cargo"&&Nt(["install","add"])&&(Y=!0),["bash","sh","zsh","fish"].includes(He)&&Nt(["-c"])&&(Y=!0),He==="cmd"&&Nt(["/c"])&&(Y=!0),Y&&(oe="deny",Q=!0)}!oe&&ze?ae=!0:!oe&&!ae&&(qe||c.autoApproveGit&&/^git\s+commit\b/i.test(xe))&&(oe="allow"),!ae&&!oe&&R&&(oe="allow")}else if(a==="write_file"||a==="update_file"){let Ie=!1;if(a==="write_file"&&c.overwriteProtection!==!1&&R)try{let{path:xe}=O(y.args,["path","content"]);xe&&we.existsSync(B.resolve(process.cwd(),xe))&&(Ie=!0,q=!0)}catch{}R&&!Ie&&(oe="allow")}let W=oe,fe="";oe==="deny"&&(Q?fe="network":Re?fe="settings":fe="prohibited");let Ge=!1,D="",Rt=[],vt=0,Co=!1,zt="";if(!W&&n.onToolApproval)try{let Ie=await n.onToolApproval(a,y.args,{checkOnly:!0});q&&Ie==="allow"||(Ie==="allow"||Ie==="deny")&&(W=Ie,W==="deny"&&(fe="user"))}catch{}if(!W){if(!q&&(a==="write_file"||a==="update_file"))try{let ke=O(y.args,["path","content","searchContent*","replaceContent*","newContent*"]),{path:Le}=ke;if(Le){let{resolvedPath:ve}=mn(Le);Le=ve;let ze=B.resolve(process.cwd(),Le),qt=Ee=>Ee?Ee.toLowerCase().replace(/\\/g,"/").replace(/^[a-z]:/,Y=>Y.toUpperCase()):"",qe=qt(ze),Oe="",ct=!1,dt=await to(),He=qt(dt?.file_focused);if(dt&&He===qe&&dt.full_content?(Oe=dt.full_content,ct=!0):we.existsSync(ze)&&(Oe=we.readFileSync(ze,"utf8"),ct=!0),D=Oe,await di.recordFileChange(ze,Oe),ct){let Ee=Oe;if(a==="write_file"){let Y=ke.content||ke.newContent||"";Ee=Y.endsWith(`
|
|
691
|
+
`)},Fe=!1}je.push({role:"user",text:`[ACTION RESULT]: ERROR: ${ce}`}),yield{type:"tool_result",content:`[ACTION RESULT]: ERROR: ${ce}`},Et++;continue}}if(n.onToolApproval){let c=n.systemSettings||{},R=c.autoExec,_=!1,ce="";if(a==="view_file"){let oe=O(y.args,["path","targetPath","file","StartLine","EndLine","start_line","end_line","startLine","endLine"]);if(ce=oe.path||oe.targetPath||oe.file||"",ce){let ae=c.alwaysAskFiles||".env, .env.*, *.env";Vs(ce,ae)&&(_=!0)}}if(a==="write_file"||a==="update_file"||a==="exec_command"||_){let oe=null,ae=!1,Re=!1,Q=!1,q=!1;if(_)ae=!0,oe=null;else if(a==="exec_command"){let{command:Ie}=O(y.args,["command","background","timeout","usePowershell","forcePowershell","useCwd","useCmd","forceCwd","forceCmd"]),xe=(Ie||"").trim(),Le=(Oe=>{let ct=[],dt="",He=null;for(let Ee=0;Ee<Oe.length;Ee++){let Y=Oe[Ee];He?(Y===He&&(He=null),dt+=Y):Y==='"'||Y==="'"?(He=Y,dt+=Y):Y==="&"&&Oe[Ee+1]==="&"||Y==="|"&&Oe[Ee+1]==="|"?(dt.trim()&&(ct.push(dt.trim()),dt=""),Ee++):Y===";"||Y==="|"||Y==="&"?dt.trim()&&(ct.push(dt.trim()),dt=""):dt+=Y}return dt.trim()&&ct.push(dt.trim()),ct.length>0?ct:[Oe]})(xe),ve=(Oe,ct)=>{if(!ct)return!1;let dt=ct.split(",").map(Ee=>Ee.trim().toLowerCase()).filter(Boolean),He=Oe.toLowerCase();return dt.some(Ee=>{if(He===Ee)return!0;if(He.startsWith(Ee)){let Y=He.charAt(Ee.length);return/\s|[;&|/]/.test(Y)}return!1})},ze=Le.some(Oe=>ve(Oe,c.alwaysAskCommands)),qt=Le.some(Oe=>ve(Oe,c.autoDisallowCommands)),qe=Le.length>0&&Le.every(Oe=>ve(Oe,c.autoApproveCommands)||c.autoApproveGit&&/^git\s+commit\b/i.test(Oe));if(qt)oe="deny";else if(c.networkAccess===!1){let ct=xe.trim().replace(/\s+/g," ").replace(/^['"]+|['"]+$/g,"").toLowerCase().split(" "),He=ct[0].split("/").pop().split("\\").pop().replace(/\.exe$/,""),Ee=new Set(["curl","wget","httpie","xh","ssh","scp","sftp","rsync","ftp","lftp","tftp","telnet","nc","netcat","socat","ping","traceroute","tracert","dig","nslookup","host","whois","nmap","docker","podman","kubectl","helm","gcloud","aws","az","terraform","ansible-playbook","nix","nix-env","apt","apt-get","dpkg","yum","dnf","pacman","zypper","brew","apk","choco","scoop","conda","mamba","aria2c","axel","smbclient","lynx","w3m","links","elinks","heroku","netlify","vercel","firebase","supabase","wrangler","flyctl","powershell","pwsh","certutil","bitsadmin","cloudflared","ngrok","tailscale","zerotier","rclone"]),Y=!1;Ee.has(He)&&(Y=!0);let Nt=co=>ct.slice(1).some(Rn=>co.includes(Rn)),Cn=co=>{let Rn=ct.findIndex(Bn=>co.includes(Bn)),Zn=ct.findIndex(Bn=>["run","exec","test"].includes(Bn));return Rn!==-1&&!(Zn!==-1&&Zn<Rn)};He==="git"&&Nt(["clone","pull","push","fetch"])&&(Y=!0),He==="go"&&Nt(["get","install"])&&(Y=!0),He==="npm"&&Cn(["install","i","update","add"])&&(Y=!0),He==="yarn"&&Cn(["add","install","upgrade"])&&(Y=!0),He==="pnpm"&&Cn(["add","install","update"])&&(Y=!0),He==="bun"&&Cn(["add","install","update"])&&(Y=!0),He==="deno"&&Nt(["install","add"])&&(Y=!0),He==="pip"&&Nt(["install","download"])&&(Y=!0),He==="pip3"&&Nt(["install","download"])&&(Y=!0),He==="cargo"&&Nt(["install","add"])&&(Y=!0),["bash","sh","zsh","fish"].includes(He)&&Nt(["-c"])&&(Y=!0),He==="cmd"&&Nt(["/c"])&&(Y=!0),Y&&(oe="deny",Q=!0)}!oe&&ze?ae=!0:!oe&&!ae&&(qe||c.autoApproveGit&&/^git\s+commit\b/i.test(xe))&&(oe="allow"),!ae&&!oe&&R&&(oe="allow")}else if(a==="write_file"||a==="update_file"){let Ie=!1;if(a==="write_file"&&c.overwriteProtection!==!1&&R)try{let{path:xe}=O(y.args,["path","content"]);xe&&we.existsSync(B.resolve(process.cwd(),xe))&&(Ie=!0,q=!0)}catch{}R&&!Ie&&(oe="allow")}let W=oe,fe="";oe==="deny"&&(Q?fe="network":Re?fe="settings":fe="prohibited");let Ge=!1,D="",Rt=[],vt=0,Co=!1,zt="";if(!W&&n.onToolApproval)try{let Ie=await n.onToolApproval(a,y.args,{checkOnly:!0});q&&Ie==="allow"||(Ie==="allow"||Ie==="deny")&&(W=Ie,W==="deny"&&(fe="user"))}catch{}if(!W){if(!q&&(a==="write_file"||a==="update_file"))try{let ke=O(y.args,["path","content","searchContent*","replaceContent*","newContent*","allowMultiple"]),{path:Le}=ke;if(Le){let{resolvedPath:ve}=mn(Le);Le=ve;let ze=B.resolve(process.cwd(),Le),qt=Ee=>Ee?Ee.toLowerCase().replace(/\\/g,"/").replace(/^[a-z]:/,Y=>Y.toUpperCase()):"",qe=qt(ze),Oe="",ct=!1,dt=await to(),He=qt(dt?.file_focused);if(dt&&He===qe&&dt.full_content?(Oe=dt.full_content,ct=!0):we.existsSync(ze)&&(Oe=we.readFileSync(ze,"utf8"),ct=!0),D=Oe,await di.recordFileChange(ze,Oe),ct){let Ee=Oe;if(a==="write_file"){let Y=ke.content||ke.newContent||"";Ee=Y.endsWith(`
|
|
692
692
|
`)?Y:Y+`
|
|
693
693
|
`,zt=Ee}else{let{patchPairs:Y,allowMultiple:Nt,error:Cn}=Xi(ke);if(Cn){let Yt=`[ACTION RESULT]: ERROR: ${Cn}`;je.push({role:"user",text:Yt}),await $t("toolFailure"),n.onToolResult&&n.onToolResult("failure",a),yield{type:"tool_result",content:Yt,toolName:a},Et++;continue}let co=ke.allowMultiple!==void 0?ke.allowMultiple===!0||String(ke.allowMultiple).toLowerCase()==="true":Nt;vt=Y.length;let Rn=qs(Oe,Y,{allowMultiple:co});Ee=Rn.content,zt=Ee,Rt=Rn.results;let Zn=Rt.filter(Yt=>Yt.success),Bn=Rt.filter(Yt=>!Yt.success);if(Zn.length===0){let Yt=`[ACTION RESULT]: ERROR: Failed to apply patches to [${B.basename(ze)}].
|
|
694
694
|
${Bn.map(Un=>` \u2022 ${Un.error}`).join(`
|
|
695
695
|
`)}`,ei=`\u2714 Edited: ${B.basename(ze.replaceAll("\\","/"))}`,Ro=115;process.stdout.isTTY&&(Ro=process.stdout.columns-5||120);let Wi=Math.min(ei.length+4,Ro),gn=`${ei.padEnd(Wi-2).substring(0,Wi-2)}`;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
696
696
|
`:""}${gn}`)},Fe=!1,je.push({role:"user",text:Yt}),await $t("toolFailure"),n.onToolResult&&n.onToolResult("failure",a),yield{type:"tool_result",content:Yt,toolName:a},Et++;continue}}yield{type:"status",content:`Opening Diff in IDE: ${B.basename(ze)}`},is(ze,Oe,Ee),Ge=!0,await new Promise(Y=>setTimeout(Y,50))}else if(a==="write_file"){let Ee=ke.content||ke.newContent||"",Y=Ee.endsWith(`
|
|
697
697
|
`)?Ee:Ee+`
|
|
698
|
-
`;zt=Y,we.existsSync(ze)||(Co=!0,we.mkdirSync(B.dirname(ze),{recursive:!0}),we.writeFileSync(ze,"","utf8")),yield{type:"status",content:`Opening New File Diff in IDE: ${B.basename(ze)}`},is(ze,"",Y),Ge=!0,await new Promise(Nt=>setTimeout(Nt,50))}}}catch(ke){console.error("Simulation/Diff Error:",ke)}let Ie=null;os(ke=>{Ie=ke});let xe=n.onToolApproval;if(W=await new Promise(async ke=>{let Le=setInterval(()=>{if(Ie){let ve=n.onIDEApproval||Vo&&Vo.onIDEApproval;ve&&ve(Ie),clearInterval(Le),ke(Ie)}},100);try{let ve=await xe(a,y.args,{isOverwritePrompt:q});clearInterval(Le),ke(ve)}catch{clearInterval(Le),ke("deny")}}),os(null),a==="write_file"||a==="update_file"){let ke=O(y.args,["path","content","searchContent*","replaceContent*","newContent*"]),{path:Le}=ke;if(Le){let{resolvedPath:ve}=mn(Le);Le=ve;let ze=B.resolve(process.cwd(),Le);if(br(ze,W),W==="deny"&&Co&&we.existsSync(ze))try{we.unlinkSync(ze)}catch{}}}W==="deny"&&(fe="user")}if(W==="allow"&&Ge&&yo()){let Ie=O(y.args,["path","content","searchContent*","replaceContent*","newContent*"]),{path:xe}=Ie,{resolvedPath:ke,isTildeResolved:Le}=mn(xe);xe=ke;let ve=B.resolve(process.cwd(),xe),ze=Ke=>Ke?B.resolve(Ke).replace(/\\/g,"/").toLowerCase():"",qt=await to(),qe="";if(qt&&qt.file_focused&&ze(qt.file_focused)===ze(ve)&&qt.full_content&&(qe=qt.full_content),!qe&&we.existsSync(ve)){let Ke=we.readFileSync(ve,"utf8");Ke&&(qe=Ke)}!qe&&zt&&(qe=zt),(qe||Co)&&we.writeFileSync(ve,qe,"utf8");let Oe=qe.split(/\r?\n/),ct=Oe.length,dt=Buffer.byteLength(qe,"utf8"),He="";D&&(He=`Old File contents:
|
|
698
|
+
`;zt=Y,we.existsSync(ze)||(Co=!0,we.mkdirSync(B.dirname(ze),{recursive:!0}),we.writeFileSync(ze,"","utf8")),yield{type:"status",content:`Opening New File Diff in IDE: ${B.basename(ze)}`},is(ze,"",Y),Ge=!0,await new Promise(Nt=>setTimeout(Nt,50))}}}catch(ke){console.error("Simulation/Diff Error:",ke)}let Ie=null;os(ke=>{Ie=ke});let xe=n.onToolApproval;if(W=await new Promise(async ke=>{let Le=setInterval(()=>{if(Ie){let ve=n.onIDEApproval||Vo&&Vo.onIDEApproval;ve&&ve(Ie),clearInterval(Le),ke(Ie)}},100);try{let ve=await xe(a,y.args,{isOverwritePrompt:q});clearInterval(Le),ke(ve)}catch{clearInterval(Le),ke("deny")}}),os(null),a==="write_file"||a==="update_file"){let ke=O(y.args,["path","content","searchContent*","replaceContent*","newContent*","allowMultiple"]),{path:Le}=ke;if(Le){let{resolvedPath:ve}=mn(Le);Le=ve;let ze=B.resolve(process.cwd(),Le);if(br(ze,W),W==="deny"&&Co&&we.existsSync(ze))try{we.unlinkSync(ze)}catch{}}}W==="deny"&&(fe="user")}if(W==="allow"&&Ge&&yo()){let Ie=O(y.args,["path","content","searchContent*","replaceContent*","newContent*","allowMultiple"]),{path:xe}=Ie,{resolvedPath:ke,isTildeResolved:Le}=mn(xe);xe=ke;let ve=B.resolve(process.cwd(),xe),ze=Ke=>Ke?B.resolve(Ke).replace(/\\/g,"/").toLowerCase():"",qt=await to(),qe="";if(qt&&qt.file_focused&&ze(qt.file_focused)===ze(ve)&&qt.full_content&&(qe=qt.full_content),!qe&&we.existsSync(ve)){let Ke=we.readFileSync(ve,"utf8");Ke&&(qe=Ke)}!qe&&zt&&(qe=zt),(qe||Co)&&we.writeFileSync(ve,qe,"utf8");let Oe=qe.split(/\r?\n/),ct=Oe.length,dt=Buffer.byteLength(qe,"utf8"),He="";D&&(He=`Old File contents:
|
|
699
699
|
${D.split(/\r?\n/).map((ot,sn)=>`${sn+1} | ${ot}`).join(`
|
|
700
700
|
`)}
|
|
701
701
|
|
|
@@ -746,11 +746,11 @@ ${ot[1]}`:"";if(/- Stats:.*\r?\nOld File contents:/s.test(Ke)){let Pt=Ke.search(
|
|
|
746
746
|
`):ot.slice(0,2).join(`
|
|
747
747
|
`)}`}else Un=`[ACTION RESULT]: ${gn}`;je.push({role:"user",text:Un}),Pn=!0,await $t("toolSuccess"),n.onToolResult&&n.onToolResult("success",a),yield{type:"tool_result",content:Y,aiContent:Un,toolName:a},Et++;continue}if(W==="deny"){let Ie=`Permission Denied: Prohibited ${a==="exec_command"?"Command":"file edit"}.`;if(_?Ie=`User denied reading ${B.basename(ce||".env")}`:q&&fe==="user"?Ie="User rejected file over-write. If needed AskUser how to proceed":fe==="user"?Ie="Permission Denied by User":fe==="settings"?Ie="Permission Denied by User Policy":fe==="network"?Ie="Permission Denied: Sandbox Network Access Disabled by User Policy.":fe==="prohibited"&&a==="exec_command"&&(Ie="Permission Denied: Prohibited Command in User Policy"),a==="view_file"){let xe=`\u2718 Read Denied: ${O(y.args,["path","targetPath","file"]).path?.replaceAll("\\","/")||".env"}`,ke=115;process.stdout.isTTY&&(ke=process.stdout.columns-5||120);let Le=Math.min(xe.length+4,ke),ve=`${xe.padEnd(Le-2).substring(0,Le-2)}`;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
748
748
|
`:""}${ve}
|
|
749
|
-
`)},Fe=!1}else if(a==="write_file"||a==="update_file"){let ke=`\u2718 ${a==="write_file"?"Write Cancelled":"Edit Denied"}: ${O(y.args,["path","content","searchContent*","replaceContent*","newContent*"]).path.replaceAll("\\","/")||"..."}`,Le=115;process.stdout.isTTY&&(Le=process.stdout.columns-5||120);let ve=Math.min(ke.length+4,Le),ze=`${ke.padEnd(ve-2).substring(0,ve-2)}`,qt=` ${" ".repeat(ve)} `;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
749
|
+
`)},Fe=!1}else if(a==="write_file"||a==="update_file"){let ke=`\u2718 ${a==="write_file"?"Write Cancelled":"Edit Denied"}: ${O(y.args,["path","content","searchContent*","replaceContent*","newContent*","allowMultiple"]).path.replaceAll("\\","/")||"..."}`,Le=115;process.stdout.isTTY&&(Le=process.stdout.columns-5||120);let ve=Math.min(ke.length+4,Le),ze=`${ke.padEnd(ve-2).substring(0,ve-2)}`,qt=` ${" ".repeat(ve)} `;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
750
750
|
`:""}${ze}
|
|
751
751
|
`)},Fe=!1}a==="exec_command"&&(await new Promise(xe=>setTimeout(xe,50)),n.onExecChunk&&n.onExecChunk(`ERROR: ${Ie}`),await new Promise(xe=>setTimeout(xe,50)),n.onExecEnd&&n.onExecEnd()),je.push({role:"user",text:`[ACTION RESULT]: DENIED: ${Ie}`}),yield{type:"tool_result",content:`[ACTION RESULT]: DENIED: ${Ie}`},await $t("toolDenied"),n.onToolResult&&n.onToolResult("denied",a),Et++;continue}}}if(v){let c=115;process.stdout.isTTY&&(c=process.stdout.columns-5||120);let R=!1,_=Math.min(v.length+4,c),ce=`${v.padEnd(_-2).substring(0,_-2)}`;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
752
752
|
`:""}${ce}${v.includes("\u2714")&&(v.includes("Created")||v.includes("Edited"))?"":`${R?"":`
|
|
753
|
-
`}`}`)},Fe=!1}if(Yn>0){let c=Date.now()-Yn,R=Math.max(0,1e3-c);R>0&&await new Promise(_=>setTimeout(_,R))}let Ze={chatId:f,history:t,onChunk:c=>n.onExecChunk?n.onExecChunk(c):null,onAskUser:n.onAskUser,systemSettings:n.systemSettings,mode:l,isMultiModal:it(te),onVisualFeedback:n.onVisualFeedback,onSubagentUpdate:n.onSubagentUpdate,onTokenChunk:n.onTokenChunk,modelName:te,aiProvider:n.aiProvider,apiKey:n.apiKey,onUsage:n.onUsage};if(a==="write_file"||a==="update_file")try{let{path:c}=O(y.args,["path","content","searchContent*","replaceContent*","newContent*"]);if(c){let R=B.resolve(process.cwd(),c),_=await to();_&&_.file_focused===R&&_.full_content&&(Ze.forcedContent=_.full_content)}}catch{}le.push(a);let se=await xs(a,y.args,Ze);if((a==="write_file"||a==="update_file")&&!se.startsWith("ERROR:")){let{path:c}=O(y.args,["path","content","searchContent*","replaceContent*","newContent*"]);if(c){let{resolvedPath:R}=mn(c),_=B.resolve(process.cwd(),R);wr(_)}}process.stdout.isTTY&&process.stdout.write("\x1B]0;Working...\x07");let Mt=Date.now();Yn=Mt,yield{type:"tool_time",content:Mt-A},qn=Mt;let Nn=null;if(typeof se=="object"&&se.binaryPart&&(Nn=se.binaryPart,se=se.text),a==="search_keyword"){let{keyword:c,path:R}=O(y.args,["keyword","path","fuzzy","subString","regex"]),_=typeof se=="string"&&se.startsWith("[GLOB]");_&&(se=se.slice(6).trimStart());let ce=typeof se=="string"&&se.startsWith("[DIR]");ce&&(se=se.slice(5).trimStart());let ye=0;if(se){let D=se.match(/Found (\d+) match/i);D&&(ye=parseInt(D[1]))}let oe=(R||"").trim().toLowerCase().replaceAll("\\","/"),ae=oe==="#doc"||oe==="#docs"||oe==="#documentation"||oe.includes("#skill/global/fluxflow")||oe.includes("#skill/fluxflow")||oe.includes("#skills/fluxflow")||oe.includes("#skills/global/fluxflow"),Re,Q=115;process.stdout.isTTY&&(Q=process.stdout.columns-5||120);let q=Math.max(10,(Q+5)/3),W=Math.max(10,(Q+5)/4);if(ae)Re=`${c?"\u2714":"\u2718"} Searched Documentation`;else{let D=R?R.replace(/[\/\\]+$/,""):null,Rt=D&&D!=="."?`${_?R:ce?`${D}/*`:D}`:"./",vt=Rt.length>W?`${Rt.slice(0,W)}...`:Rt;Re=`${c?"\u2714":"\u2718"} Searched: "${c?c.length>Q/3?`${c.slice(0,q)}...`:c:""}" in "${vt.replaceAll("\\","/")}" \u2192 ${ye} Match${ye===1?"":"es"}`}let fe=Math.min(Re.length+4,Q),Ge=`${Re.padEnd(fe-2).substring(0,fe-2)}`;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
753
|
+
`}`}`)},Fe=!1}if(Yn>0){let c=Date.now()-Yn,R=Math.max(0,1e3-c);R>0&&await new Promise(_=>setTimeout(_,R))}let Ze={chatId:f,history:t,onChunk:c=>n.onExecChunk?n.onExecChunk(c):null,onAskUser:n.onAskUser,systemSettings:n.systemSettings,mode:l,isMultiModal:it(te),onVisualFeedback:n.onVisualFeedback,onSubagentUpdate:n.onSubagentUpdate,onTokenChunk:n.onTokenChunk,modelName:te,aiProvider:n.aiProvider,apiKey:n.apiKey,onUsage:n.onUsage};if(a==="write_file"||a==="update_file")try{let{path:c}=O(y.args,["path","content","searchContent*","replaceContent*","newContent*","allowMultiple"]);if(c){let R=B.resolve(process.cwd(),c),_=await to();_&&_.file_focused===R&&_.full_content&&(Ze.forcedContent=_.full_content)}}catch{}le.push(a);let se=await xs(a,y.args,Ze);if((a==="write_file"||a==="update_file")&&!se.startsWith("ERROR:")){let{path:c}=O(y.args,["path","content","searchContent*","replaceContent*","newContent*","allowMultiple"]);if(c){let{resolvedPath:R}=mn(c),_=B.resolve(process.cwd(),R);wr(_)}}process.stdout.isTTY&&process.stdout.write("\x1B]0;Working...\x07");let Mt=Date.now();Yn=Mt,yield{type:"tool_time",content:Mt-A},qn=Mt;let Nn=null;if(typeof se=="object"&&se.binaryPart&&(Nn=se.binaryPart,se=se.text),a==="search_keyword"){let{keyword:c,path:R}=O(y.args,["keyword","path","fuzzy","subString","regex"]),_=typeof se=="string"&&se.startsWith("[GLOB]");_&&(se=se.slice(6).trimStart());let ce=typeof se=="string"&&se.startsWith("[DIR]");ce&&(se=se.slice(5).trimStart());let ye=0;if(se){let D=se.match(/Found (\d+) match/i);D&&(ye=parseInt(D[1]))}let oe=(R||"").trim().toLowerCase().replaceAll("\\","/"),ae=oe==="#doc"||oe==="#docs"||oe==="#documentation"||oe.includes("#skill/global/fluxflow")||oe.includes("#skill/fluxflow")||oe.includes("#skills/fluxflow")||oe.includes("#skills/global/fluxflow"),Re,Q=115;process.stdout.isTTY&&(Q=process.stdout.columns-5||120);let q=Math.max(10,(Q+5)/3),W=Math.max(10,(Q+5)/4);if(ae)Re=`${c?"\u2714":"\u2718"} Searched Documentation`;else{let D=R?R.replace(/[\/\\]+$/,""):null,Rt=D&&D!=="."?`${_?R:ce?`${D}/*`:D}`:"./",vt=Rt.length>W?`${Rt.slice(0,W)}...`:Rt;Re=`${c?"\u2714":"\u2718"} Searched: "${c?c.length>Q/3?`${c.slice(0,q)}...`:c:""}" in "${vt.replaceAll("\\","/")}" \u2192 ${ye} Match${ye===1?"":"es"}`}let fe=Math.min(Re.length+4,Q),Ge=`${Re.padEnd(fe-2).substring(0,fe-2)}`;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
754
754
|
`:""}${Ge}
|
|
755
755
|
`)},Fe=!1}if(a==="EmergencyRollback"){let{method:c}=O(y.args,["method","id"]);if(c==="forceRevert"){let R=0;if(se){let Q=se.match(/Total\s*:\s*(\d+)/i);Q&&(R=parseInt(Q[1]))}let ce=se&&se.startsWith("ERROR:")?"\u2718 Emergency Rollback Failed":`\u2714 Emergency Rollback \u2192 ${R} file${R===1?"":"s"} processed`,ye=115;process.stdout.isTTY&&(ye=process.stdout.columns-5||120);let oe=!1,ae=Math.min(ce.length+4,ye),Re=`${ce.padEnd(ae-2).substring(0,ae-2)}`;yield{type:"visual_feedback",content:Lt(`${Fe?`
|
|
756
756
|
`:""}${Re}${oe?"":`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as b,c as p}from"./chunk-56EJGQU3.js";import{a as D}from"./chunk-6LM3YRRE.js";var q=async(_,s={})=>{let{runSubagent:y}=await import("./ai-
|
|
1
|
+
import{a as b,c as p}from"./chunk-56EJGQU3.js";import{a as D}from"./chunk-6LM3YRRE.js";var q=async(_,s={})=>{let{runSubagent:y}=await import("./ai-2WT22XNX.js"),a=D(_,["task","instruction","prompt","model","title","tools","id"]),u=a.task||a.instruction||a.prompt,A=a.model||null,g=a.title||null,w=a.tools||null,m=a.id&&a.id!=="null"&&a.id!=="undefined"&&a.id!==""?String(a.id).trim():null;if(!u)return'ERROR: Missing "task" argument for invoke.';let d=null,U="";m&&(d=b.find(e=>e.id===m));let f=!!d,r=f?d.id:m||`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,I=f?d.history||[]:[],C=null;if(w)try{let e=w.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),C=e.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let h=null,S=null,E=new Promise((e,n)=>{h=e,S=n}),t=d;t?(t.status="running",t.task=u,g&&(t.title=g),t.startedAt=Date.now(),t.lastChunkTime=Date.now(),t.completionPromise=E,t._resolveCompletion=h,t._rejectCompletion=S):(t={id:r,title:g||u.substring(0,30),task:u,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:e=>{e&&t.pendingSteerMessages.push(e)},completionPromise:E,_resolveCompletion:h,_rejectCompletion:S,progress:[],history:[]},b.push(t));let l={chunks:[],totalWords:0};s.onSubagentUpdate&&s.onSubagentUpdate();let i=[],M={...s,taskId:r,onHistoryUpdate:e=>{t.history=[...e]},onAskMain:async e=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,k=new Promise(T=>{o=T}),c={id:n,question:e,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return t.questions.push(c),t.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" is WAITING FOR YOUR INPUT: "${e}"
|
|
2
2
|
Respond using tool: [action:Answer(id="${r}", answer="...")]
|
|
3
3
|
[/SYSTEM]`),await k},onVisualFeedback:e=>{t.lastChunkTime=Date.now();let n=e.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?t.currentTool=o[1].trim():t.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(e,n)=>{let o=Date.now();if(t.lastChunkTime=o,t.currentTool="Thinking",typeof n=="number"&&n>0){l.totalWords+=n,l.chunks.push({time:o,words:n});let k=o-400;if(l.chunks=l.chunks.filter(c=>c.time>=k),l.chunks.length>0){let c=l.chunks.reduce((v,R)=>v+R.words,0),$=l.chunks[0].time,T=Math.max(.4,(o-$)/1e3);t.wps=Math.round(c/T)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return y(u,M,A,C,null,e=>{if(t.status==="cancelled")return;if(e.startsWith("[Subagent Turn")&&i.length>0&&(t.progress.push([...i]),i=[]),e.includes("[Executing Tool]")){let o=e.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!t.currentTool||t.currentTool==="Thinking")&&(t.currentTool=o[1])}let n=e;if(n.startsWith("[Tool Result]")||n.startsWith("[Action Result]")){let o=n.split(`
|
|
4
4
|
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
5
5
|
`)+`
|
|
6
|
-
... [Content/Diff Truncated from Logs] ...`)}i.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0,I).then(e=>{if(t.status==="cancelled"){t._resolveCompletion&&t._resolveCompletion(e);return}i.length>0&&(t.progress.push([...i]),i=[]),t.status="completed",t.finalAnswer=e,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) has FINISHED. Call GetProgress(id="${r}") to see the final result. [/SYSTEM]`),t._resolveCompletion&&t._resolveCompletion(e)}).catch(async e=>{let{isTerminationSignaled:n}=await import("./ai-
|
|
6
|
+
... [Content/Diff Truncated from Logs] ...`)}i.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0,I).then(e=>{if(t.status==="cancelled"){t._resolveCompletion&&t._resolveCompletion(e);return}i.length>0&&(t.progress.push([...i]),i=[]),t.status="completed",t.finalAnswer=e,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) has FINISHED. Call GetProgress(id="${r}") to see the final result. [/SYSTEM]`),t._resolveCompletion&&t._resolveCompletion(e)}).catch(async e=>{let{isTerminationSignaled:n}=await import("./ai-2WT22XNX.js");if(e.message==="Subagent task was cancelled."||t.status==="cancelled"||n()){t.status="cancelled",i.push("[SUBAGENT CANCELLED] Task was cancelled."),t.progress.push([...i]),s.onSubagentUpdate&&s.onSubagentUpdate(),t._resolveCompletion&&t._resolveCompletion(null);return}i.push(`[SUBAGENT FAILURE] Error: ${e.message}`),t.progress.push([...i]),t.status="failed",t.error=e.message,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) FAILED with error: ${e.message}. [/SYSTEM]`),t._rejectCompletion&&t._rejectCompletion(e)}),f?`Background subagent ${r} resumed.`:U?`Background subagent started. Task ID: ${r}.${U}`:`Background subagent started. Task ID: ${r}`};export{q as invoke};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as m}from"./chunk-56EJGQU3.js";import{a as g}from"./chunk-6LM3YRRE.js";var A=async(p,a={})=>{let{runSubagent:f}=await import("./ai-
|
|
1
|
+
import{a as m}from"./chunk-56EJGQU3.js";import{a as g}from"./chunk-6LM3YRRE.js";var A=async(p,a={})=>{let{runSubagent:f}=await import("./ai-2WT22XNX.js"),e=g(p,["task","instruction","prompt","model","tools","title","id"]),l=e.task||e.instruction||e.prompt,k=e.model||null,c=e.tools||null,u=e.id&&e.id!=="null"&&e.id!=="undefined"&&e.id!==""?String(e.id).trim():null;if(!l)return'ERROR: Missing "task" argument for invokeSync.';let n=null,d="";u&&(n=m.find(t=>t.id===u));let o=n?n.id:u||`subagent-sync-${Date.now()}-${Math.floor(Math.random()*1e3)}`,$=n?.history||[],b=null;if(c)try{let t=c.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),b=t.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let r=e.title||(n?n.title:l.substring(0,30)),s=n;s?(s.status="running",s.task=l):(s={id:o,title:r,task:l,status:"running",startedAt:Date.now(),progress:[],history:[]},m.push(s));let y={...a,taskId:o,onHistoryUpdate:t=>{s.history=[...t]}};try{a.onVisualFeedback&&a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r}${n?" (Resumed)":""}`);let t=await f(l,y,k,b,null,null,!1,$);s.status="completed",s.finalAnswer=`Subagent task completed. (ID: ${o})
|
|
2
2
|
Final Answer:
|
|
3
3
|
${t}`,a.onVisualFeedback&&a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r} [COMPLETED]
|
|
4
4
|
`);let i=`Subagent task completed. (ID: ${o})
|
|
5
5
|
Final Answer:
|
|
6
|
-
${t}`;return d?`${i}${d}`:i}catch(t){s.status="failed",s.error=t.message;let{isTerminationSignaled:i}=await import("./ai-
|
|
6
|
+
${t}`;return d?`${i}${d}`:i}catch(t){s.status="failed",s.error=t.message;let{isTerminationSignaled:i}=await import("./ai-2WT22XNX.js"),h=t.message==="Subagent task was cancelled by user."||i();if(a.onVisualFeedback){let S=h?"[CANCELLED]":"[FAILED]";a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r} ${S}
|
|
7
7
|
`)}return`ERROR: Subagent execution failed: ${t.message}${d}`}};export{A as invokeSync};
|
package/dist/cli.js
CHANGED
|
@@ -65,7 +65,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(oe&&(console.log(`v${i}`),pr
|
|
|
65
65
|
/docs View documentation
|
|
66
66
|
/fluxflow init Create FluxFlow.md template
|
|
67
67
|
/update check Check for new version
|
|
68
|
-
/update latest Install latest release`),process.exit(0)),se){let C=t[1]||"latest";if(C==="check"){let x=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(x?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let m=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;m||(console.error("Error: Could not retrieve latest version."),process.exit(1)),m===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let r=(await import("react")).default,{useState:w}=r,{render:U,Box:h,Text:S}=await import("ink"),ie=(await import("ink-select-input")).default,_=(await import("ink-text-input")).default;return new Promise(D=>{let P=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:E,isSelected:F})=>r.createElement(h,{width:"100%"},r.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),b,X=()=>{let[E,F]=w("select"),[J,j]=w(""),z=R=>{R.value==="custom"?F("custom"):B({manager:R.value})},K=R=>{B({manager:"custom",customCommand:R})};return E==="custom"?r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),r.createElement(h,{flexDirection:"row"},r.createElement(S,{color:"cyan",bold:!0}," \u276F "),r.createElement(_,{value:J,onChange:j,onSubmit:K})),r.createElement(h,{marginTop:1},r.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),r.createElement(ie,{items:P,onSelect:z,itemComponent:H,indicatorComponent:()=>null}))},B=E=>{b&&b(),D(E)},{unmount:V}=U(r.createElement(X,null));b=V})},n,k="",A;try{let{loadSettings:r}=await import("./chunks/settings-UL5E3OYC.js");A=await r(),n=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!n){let r=await y();n=r.manager,k=r.customCommand}let p="";n==="pnpm"?p=`pnpm add -g fluxflow-cli@${m}`:n==="bun"?p=`bun add -g fluxflow-cli@${m}`:n==="yarn"?p=`yarn global add fluxflow-cli@${m}`:n==="custom"?p=k||A?.customUpdateCommand||`npm install -g fluxflow-cli@${m}`:p=`npm install -g fluxflow-cli@${m}`,console.log(`Updating FluxFlow to v${m} using ${n}...`),console.log(`Running: ${p}`);let{execSync:L}=await import("child_process");L(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${m}.\x1B[0m`)}catch(x){console.error("\x1B[31m\u274C Update failed:\x1B[0m",x.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:pe}=await import("react"),{render:de}=await import("ink"),{default:ue}=await import("./chunks/app-
|
|
68
|
+
/update latest Install latest release`),process.exit(0)),se){let C=t[1]||"latest";if(C==="check"){let x=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(x?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let m=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;m||(console.error("Error: Could not retrieve latest version."),process.exit(1)),m===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let r=(await import("react")).default,{useState:w}=r,{render:U,Box:h,Text:S}=await import("ink"),ie=(await import("ink-select-input")).default,_=(await import("ink-text-input")).default;return new Promise(D=>{let P=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:E,isSelected:F})=>r.createElement(h,{width:"100%"},r.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),b,X=()=>{let[E,F]=w("select"),[J,j]=w(""),z=R=>{R.value==="custom"?F("custom"):B({manager:R.value})},K=R=>{B({manager:"custom",customCommand:R})};return E==="custom"?r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),r.createElement(h,{flexDirection:"row"},r.createElement(S,{color:"cyan",bold:!0}," \u276F "),r.createElement(_,{value:J,onChange:j,onSubmit:K})),r.createElement(h,{marginTop:1},r.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),r.createElement(ie,{items:P,onSelect:z,itemComponent:H,indicatorComponent:()=>null}))},B=E=>{b&&b(),D(E)},{unmount:V}=U(r.createElement(X,null));b=V})},n,k="",A;try{let{loadSettings:r}=await import("./chunks/settings-UL5E3OYC.js");A=await r(),n=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!n){let r=await y();n=r.manager,k=r.customCommand}let p="";n==="pnpm"?p=`pnpm add -g fluxflow-cli@${m}`:n==="bun"?p=`bun add -g fluxflow-cli@${m}`:n==="yarn"?p=`yarn global add fluxflow-cli@${m}`:n==="custom"?p=k||A?.customUpdateCommand||`npm install -g fluxflow-cli@${m}`:p=`npm install -g fluxflow-cli@${m}`,console.log(`Updating FluxFlow to v${m} using ${n}...`),console.log(`Running: ${p}`);let{execSync:L}=await import("child_process");L(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${m}.\x1B[0m`)}catch(x){console.error("\x1B[31m\u274C Update failed:\x1B[0m",x.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:pe}=await import("react"),{render:de}=await import("ink"),{default:ue}=await import("./chunks/app-VJTUE4RH.js");process.env.NODE_NO_WARNINGS="1";let ge=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],fe=console.log,xe=console.warn,we=console.error,W=o=>{let d=o.map(String).join(" ");return ge.some(s=>d.includes(s))};console.log=(...o)=>!W(o)&&fe(...o),console.warn=(...o)=>!W(o)&&xe(...o),console.error=(...o)=>!W(o)&&we(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],d=await import("path"),s=await import("fs-extra"),u=d.default.resolve(o);try{s.default.existsSync(u)&&s.default.statSync(u).isDirectory()?process.chdir(u):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(v){console.error(`[ERROR] Failed to change directory to "${o}": ${v.message}`),process.exit(0)}}let M=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||M){let o=t.includes("--new")||t.includes("-n"),s=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(M)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0);let l="";if(s&&s.trim()){let I=s.trim();I.startsWith("={")&&I.endsWith("}")?l=`
|
|
69
69
|
|
|
70
70
|
Instruction: ${I.slice(2,-1).trim()}`:l=`
|
|
71
71
|
|
|
@@ -82,7 +82,7 @@ ${s}`:s=i}if(!M&&!process.stdin.isTTY){let e=[];for await(let l of process.stdin
|
|
|
82
82
|
${a}
|
|
83
83
|
---
|
|
84
84
|
|
|
85
|
-
${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-UL5E3OYC.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-6RUMHIWR.js"),{getDefaultModel:c}=await import("./chunks/model_config-OPJXDFKG.js"),{generateSimpleContent:m}=await import("./chunks/ai-
|
|
85
|
+
${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-UL5E3OYC.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-6RUMHIWR.js"),{getDefaultModel:c}=await import("./chunks/model_config-OPJXDFKG.js"),{generateSimpleContent:m}=await import("./chunks/ai-2WT22XNX.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-MKFPGZUK.js"),n=await C(),k=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==s&&e!=="-n"&&e!=="--new"),A=M||k.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let l=k.indexOf(a);if(l!==-1&&l+1<k.length)return k[l+1]}return null},L=M&&n.systemSettings?.commitMessageModel&&n.systemSettings.commitMessageModel!=="Default"?n.systemSettings.commitMessageModel:null,r=M&&L&&n.systemSettings?.commitMessageProvider?n.systemSettings.commitMessageProvider:null,w=p(["--provider"])||r||n.aiProvider||"Google",U=p(["--model"])||L||n.activeModel||c(w,n.apiTier)||c(w,"paid"),h=p(["--key"])||await x(w);!h&&!(w==="c_openai"&&n.systemSettings?.customOpenAIBaseUrl)&&(console.error(`[ERROR] No API key resolved for provider "${w}".`),process.exit(1));let S=await y("agent",{aiProvider:w});S.allowed||(console.error(`[ERROR] ${S.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:ie="",nickname:_="",instructions:D=""}=n?.profileData??{},P={aiProvider:w,apiKey:h,model:U,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:n.systemSettings||{}},H=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",b=new Date,X=b.getFullYear(),B=b.toLocaleString("en-US",{month:"short"}).toUpperCase(),V=String(b.getDate()).padStart(2,"0"),E=b.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),F=`${X}-${B}-${V}, ${E}`,J=(P.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),j=ee.basename(J).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replace(/(\d)-(\d)/g,"$1.$2").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),z=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
86
86
|
Use NO markdown, only plain text
|
|
87
87
|
Context:
|
|
88
88
|
- OS: ${H}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED