fluxflow-cli 4.43.0 → 4.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/chrome-healthcheck.mjs +119 -0
- package/dist/chunks/{ai-B7PWR3ND.js → ai-3J4SUC3U.js} +1 -1
- package/dist/chunks/{app-LSCLDAZR.js → app-JSYMH7WB.js} +99 -99
- package/dist/chunks/{auto_completion-DEUFQNXT.js → auto_completion-FSSLSASK.js} +1 -1
- package/dist/chunks/{chunk-7RITUQX2.js → chunk-NN5WVXEF.js} +68 -68
- package/dist/chunks/{chunk-A73NNVCZ.js → chunk-YX4X2ZTX.js} +1 -1
- package/dist/chunks/getProgress-FXNG2ISE.js +26 -0
- package/dist/chunks/{invoke-M633DHSK.js → invoke-K5DKH37G.js} +2 -2
- package/dist/chunks/{invokeSync-K4DMVFUA.js → invokeSync-U5FLY2AB.js} +2 -2
- package/dist/chunks/web_scrape-J3PL2PXT.js +18 -0
- package/dist/chunks/web_search-KBGH67IV.js +40 -0
- package/dist/chunks/{write_pdf-26OQPNEP.js → write_pdf-TPGUF4VT.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/package.json +3 -1
- package/package.json +3 -1
- package/dist/chunks/getProgress-A2TW34Q7.js +0 -26
- package/dist/chunks/web_scrape-MW6YSZ7L.js +0 -16
- package/dist/chunks/web_search-NT3HXUO3.js +0 -36
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ls}from"./chunk-HFTI3R3Q.js";import{a as Eo}from"./chunk-52STSLCN.js";import{a as Jt}from"./chunk-56EJGQU3.js";import{c as $i,g as Ni,h as Is,i as Ms}from"./chunk-SML2NARF.js";import{a as Ps,c as Os}from"./chunk-3HU67EUI.js";import{b as Di,h as $s}from"./chunk-Z5D4VQSG.js";import{a as ti}from"./chunk-6EYQQ7GQ.js";import{a as Ns}from"./chunk-4BLSASW6.js";import{a as K}from"./chunk-Y5JU726N.js";import{b as Oi}from"./chunk-BB5UISPJ.js";import{f as Ao,l as vt,n as bt,p as Li,q as vs}from"./chunk-UFLKOWYM.js";import{b as To}from"./chunk-JDSDLNHL.js";import{l as st,m as ei,q as re}from"./chunk-H3IDSRDO.js";import{c as _t,d as ao,e as Zo}from"./chunk-P5HBJA23.js";import{a as Dn,b as Xo,d as
|
|
1
|
+
import{a as Ls}from"./chunk-HFTI3R3Q.js";import{a as Eo}from"./chunk-52STSLCN.js";import{a as Jt}from"./chunk-56EJGQU3.js";import{c as $i,g as Ni,h as Is,i as Ms}from"./chunk-SML2NARF.js";import{a as Ps,c as Os}from"./chunk-3HU67EUI.js";import{b as Di,h as $s}from"./chunk-Z5D4VQSG.js";import{a as ti}from"./chunk-6EYQQ7GQ.js";import{a as Ns}from"./chunk-4BLSASW6.js";import{a as K}from"./chunk-Y5JU726N.js";import{b as Oi}from"./chunk-BB5UISPJ.js";import{f as Ao,l as vt,n as bt,p as Li,q as vs}from"./chunk-UFLKOWYM.js";import{b as To}from"./chunk-JDSDLNHL.js";import{l as st,m as ei,q as re}from"./chunk-H3IDSRDO.js";import{c as _t,d as ao,e as Zo}from"./chunk-P5HBJA23.js";import{a as Dn,b as Xo,d as pn,e as Jo,k as zn,l as Qo,m as Mi,r as Pi,w as So,x as ko,y as _s}from"./chunk-26BQ45XP.js";import{GoogleGenAI as ta,ThinkingLevel as ze,HarmBlockThreshold as Bn,HarmCategory as Un}from"@google/genai";var Ds=(e=!0,n=!0)=>`
|
|
2
2
|
To use tools, must output exactly '[action:ActionName(arg1="value1")]' structured string in chat response \u2190 no exception
|
|
3
3
|
|
|
4
4
|
-- Chat Management Tools --
|
|
@@ -25,7 +25,7 @@ Usage Rules:
|
|
|
25
25
|
- Chat title is mandatory
|
|
26
26
|
- Temporary memory is mandatory
|
|
27
27
|
- When called user memory, still use Temporary Memory
|
|
28
|
-
- Must not ignore any tool calls in given context of chat between user & agent`:""}`.trim();var ni={xHigh:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",High:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",Medium:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",Minimal:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",Off:"NO thinking. Immediate response. Verify imports, tool results & system stability"};import
|
|
28
|
+
- Must not ignore any tool calls in given context of chat between user & agent`:""}`.trim();var ni={xHigh:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",High:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",Medium:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",Minimal:"Use minimal reasoning. Prefer simplest path; avoid branching; waste NO tokens overthinking",Off:"NO thinking. Immediate response. Verify imports, tool results & system stability"};import on from"fs";import nn from"path";import Ma from"os";import hn from"fs";import Fn from"path";import Xs from"fs";import Fi from"path";import{execSync as Js}from"child_process";import{fileURLToPath as _a}from"url";var Fs=`# FluxFlow CLI Startup & Flags Reference
|
|
29
29
|
|
|
30
30
|
Launch command syntax:
|
|
31
31
|
fluxflow [options]
|
|
@@ -469,24 +469,24 @@ Public Docs: https://fluxflow-cli.onrender.com
|
|
|
469
469
|
|
|
470
470
|
Default Context Length: 256k Tokens. Can be changed via ENV/In-app Settings \u2192 references/{SETTINGS,ENV}.md
|
|
471
471
|
|
|
472
|
-
Docs missing required info? Say you are not sure enough to answer. Dont give wrong info`,"references/MODES.md":Ys,"references/PROVIDERS.md":zs,"references/PLUGINS.md":qs,"references/STARTUP.md":Fs,"references/ENV.md":Bs,"references/COMMANDS.md":Us,"references/SETTINGS.md":Ws,"references/TOOLS.md":Gs,"references/ARCHITECTURE.md":Hs,"references/SUB_AGENTS.md":js,"references/SECURITY.md":Ks,"references/IDE.md":Vs};var Qs=()=>{try{let e=Fn.join(Dn,"skills","fluxflow"),n=Fn.join(e,"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){
|
|
473
|
-
`,p=null;
|
|
474
|
-
`)},cr=()=>Oo(Dn,["agents.md","agent.md"]),dr=()=>Oo(process.cwd(),["agents.md","agent.md"]),fr=()=>Oo(Dn,["fluxflow.md"]),ur=()=>Oo(process.cwd(),["fluxflow.md"]),_o=cr(),si=dr(),
|
|
475
|
-
${ir(r,2)}`)}}catch{}return
|
|
472
|
+
Docs missing required info? Say you are not sure enough to answer. Dont give wrong info`,"references/MODES.md":Ys,"references/PROVIDERS.md":zs,"references/PLUGINS.md":qs,"references/STARTUP.md":Fs,"references/ENV.md":Bs,"references/COMMANDS.md":Us,"references/SETTINGS.md":Ws,"references/TOOLS.md":Gs,"references/ARCHITECTURE.md":Hs,"references/SUB_AGENTS.md":js,"references/SECURITY.md":Ks,"references/IDE.md":Vs};var Qs=()=>{try{let e=Fn.join(Dn,"skills","fluxflow"),n=Fn.join(e,"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){hn.existsSync(e)&&hn.rmSync(e,{recursive:!0,force:!0});return}let i=new Set(Object.keys(Bi).map(o=>Fn.normalize(o)));for(let[o,r]of Object.entries(Bi)){let c=Fn.join(e,o),a=Fn.dirname(c);hn.existsSync(a)||hn.mkdirSync(a,{recursive:!0});let u=r.trim()+`
|
|
473
|
+
`,p=null;hn.existsSync(c)&&(p=hn.readFileSync(c,"utf8")),p!==u&&hn.writeFileSync(c,u,"utf8")}if(hn.existsSync(n)){let o=hn.readdirSync(n);for(let r of o){let c=Fn.normalize(Fn.join("references",r));if(!i.has(c)){let a=Fn.join(n,r);try{hn.rmSync(a,{recursive:!0,force:!0})}catch{}}}}}catch{}};import{WebSocket as ii}from"ws";var Wt=null,lo=!1,va="ws://localhost:56832",Ui=[],co=null,Wi=null,Gi=null,Zs="2.0.0",ac=e=>{Zs=e,er()},Hi=e=>{Wi=e},lc=e=>{Gi=e},er=()=>{if(Wt||lo)return;lo=!0;let e=new ii(va);e.on("open",()=>{for(Wt=e,lo=!1,Wt.send(JSON.stringify({command:"version",version:Zs,pid:process.pid,ppid:process.ppid,cwd:process.cwd()}));Ui.length>0;)Wt.send(JSON.stringify(Ui.shift()))}),e.on("message",n=>{try{let t=JSON.parse(n.toString());t.command==="contextResponse"&&co?(co(t.data),co=null):t.command==="securityResponse"&&Wi?Wi(t.result):t.command==="inlineComplete"?Ia(t):t.command==="connectionRejected"&&Gi&&Gi(t)}catch{}}),e.on("error",()=>{lo=!1,Wt=null}),e.on("close",()=>{lo=!1,Wt=null})},Co=e=>{Wt&&Wt.readyState===ii.OPEN?Wt.send(JSON.stringify(e)):(Ui.push(e),lo||er())},fo=()=>Wt!==null&&Wt.readyState===ii.OPEN,Ia=async e=>{let n="";try{let{generateAutoCompletion:t}=await import("./auto_completion-FSSLSASK.js");n=await t({prefix:e.prefix||"",suffix:e.suffix||"",fileName:e.fileName||"",language:e.language||"",recentChanges:e.recentChanges||"",clipboard:e.clipboard||""})}catch{n=""}Co({command:"inlineCompleteResponse",requestId:e.requestId,completion:n||""})},cc=e=>{Co({command:"status",status:e})},qn=()=>new Promise(e=>{if(!Wt||Wt.readyState!==ii.OPEN){e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]});return}co=e,Wt.send(JSON.stringify({command:"requestContext"})),setTimeout(()=>{co===e&&(e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]}),co=null)},1e3)}),tr=e=>{Co({command:"open",filePath:e})},ji=(e,n,t)=>{Co({command:"showDiff",filePath:e,originalContent:n,modifiedContent:t})},nr=(e,n)=>{Co({command:"closeDiff",filePath:e,result:n})};var Oo=(e,n)=>{try{if(!on.existsSync(e))return null;let t=Array.isArray(n)?n.map(o=>o.toLowerCase()):[n.toLowerCase()],i=on.readdirSync(e);for(let o of t){let r=i.find(c=>c.toLowerCase()===o);if(r){let c=nn.join(e,r);if(on.statSync(c).isFile())return c}}}catch{}return null},qi=(e,n)=>{let t=Oo(e,n);if(t)try{return on.readFileSync(t,"utf8")}catch{}return""},or=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"]),Xi=(e=process.cwd(),n=0,t=8)=>{let i=[];if(n>t)return i;try{if(!on.existsSync(e))return i;let o=on.readdirSync(e,{withFileTypes:!0});for(let r of o){let c=r.name,a=nn.join(e,c);if(r.isDirectory())!or.has(c)&&!or.has(c.toLowerCase())&&i.push(...Xi(a,n+1,t));else if(r.isFile()){let u=c.toLowerCase();(u==="agents.md"||u==="agent.md")&&i.push(a)}}}catch{}return i},ir=(e,n=2)=>{if(!e)return"";let t=" ".repeat(n);return e.split(/\r?\n/).map(i=>t+i).join(`
|
|
474
|
+
`)},cr=()=>Oo(Dn,["agents.md","agent.md"]),dr=()=>Oo(process.cwd(),["agents.md","agent.md"]),fr=()=>Oo(Dn,["fluxflow.md"]),ur=()=>Oo(process.cwd(),["fluxflow.md"]),_o=cr(),si=dr(),yn=Xi(),vo=fr(),Io=ur(),sr=null,zi="",gr=!1,Pa=e=>{if(!e||!/^<<<[\s\S]*?Identity:/m.test(e))return e;let n=e.match(/^<<<\s*\r?\n([\s\S]*?)\r?\n>>>\s*(?:\r?\n)?([\s\S]*)$/);if(!n)return e;let t=n[1],i=n[2],o=t.match(/^Identity:\s*([\s\S]*?)(?=\r?\n\s*(?:<><|>>>)|$)/m);return o&&(zi=o[1].trim(),process.env.NO_INS=!0),/<><\s*NO_INS/.test(t)&&(gr=!0),i.trim()},Oa=()=>{_o=cr();let e=_o?qi(Dn,["agents.md","agent.md"]).trim():"";return e.length===0?(_o=null,""):e},La=()=>{if(yn=Xi(),si=dr(),!yn||yn.length===0)return"";let e=process.cwd(),n=[...yn].sort((o,r)=>{let c=nn.relative(e,o).replace(/\\/g,"/"),a=nn.relative(e,r).replace(/\\/g,"/"),u=!c.includes("/"),p=!a.includes("/");return u&&!p?-1:!u&&p?1:c.localeCompare(a)}),t=[],i=[];for(let o of n)try{let r=on.readFileSync(o,"utf8").trim();if(!r||r.length===0)continue;t.push(o);let c=nn.relative(e,o).replace(/\\/g,"/");if(!c.includes("/"))i.push(ir(r,2));else{let u=nn.dirname(c)+"/:";i.push(`${u}
|
|
475
|
+
${ir(r,2)}`)}}catch{}return yn=t,yn.length===0&&(si=null),i.join(`
|
|
476
476
|
|
|
477
|
-
`).trim()},Ji=()=>{vo=fr();let e=vo?qi(Dn,["fluxflow.md"]).trim():"",n=Pa(e)?.trim()||"";return n.length===0?(vo=null,""):n},Qi=()=>{Io=ur();let e=Io?qi(process.cwd(),["fluxflow.md"]).trim():"";return e.length===0?(Io=null,""):e},Zi=Oa(),ri=La(),Mo=Ji(),Po=Qi(),rr=(e,n="",t="")=>{if(!e)return"";let i=t.toLowerCase().trim(),o=n.toLowerCase().trim(),r=
|
|
477
|
+
`).trim()},Ji=()=>{vo=fr();let e=vo?qi(Dn,["fluxflow.md"]).trim():"",n=Pa(e)?.trim()||"";return n.length===0?(vo=null,""):n},Qi=()=>{Io=ur();let e=Io?qi(process.cwd(),["fluxflow.md"]).trim():"";return e.length===0?(Io=null,""):e},Zi=Oa(),ri=La(),Mo=Ji(),Po=Qi(),rr=(e,n="",t="")=>{if(!e)return"";let i=t.toLowerCase().trim(),o=n.toLowerCase().trim(),r=nn.posix.basename(o),c=i&&o?`${i}@${o}`:"",a=i&&r?`${i}@${r}`:"",u=x=>!x||!o?!1:x===o||x===r||x===c||x===a,p=[];return e.replace(/<start_provider_([^>\r\n]+)>([\s\S]*?)<end_provider_([^>\r\n]+)>/gi,(x,m,f,s)=>{if(i&&m.trim().toLowerCase()===s.trim().toLowerCase()&&m.trim().toLowerCase()===i){let T=f.replace(/<start_model_([^>\r\n]+)>([\s\S]*?)<end_model_([^>\r\n]+)>/gi,(ge,y,R,W)=>{if(y.trim().toLowerCase()===W.trim().toLowerCase()){let V=y.trim().toLowerCase();if(u(V)){let B=R.trim();B&&p.push(B)}}return""}).trim();T&&p.push(T)}return""}),e.replace(/<start_model_([^>\r\n@]+@[^>\r\n]+)>([\s\S]*?)<end_model_([^>\r\n@]+@[^>\r\n]+)>/gi,(x,m,f,s)=>{if(m.trim().toLowerCase()===s.trim().toLowerCase()){let g=m.trim().toLowerCase();if(u(g)){let T=f.trim();T&&p.push(T)}}return""}),e.replace(/<start_model_([^>\r\n]+)>([\s\S]*?)<end_model_([^>\r\n]+)>/gi,(x,m,f,s)=>{if(m.includes("@"))return"";if(m.trim().toLowerCase()===s.trim().toLowerCase()){let g=m.trim().toLowerCase();if(o&&(g===o||g===r)){let T=f.trim();T&&p.push(T)}}return""}),p.join(`
|
|
478
478
|
|
|
479
|
-
`).trim()},$a=(e="",n="")=>{let t=`${e||""}@${n||""}`.toLowerCase().trim();sr!==t&&(sr=t,Mo=Ji(),Po=Qi())};Qs();var Na=e=>{if(!e)return null;let n=e.match(/^\s*---\r?\n([\s\S]*?)\r?\n---(?:\r?\n)?([\s\S]*)$/);if(!n)return null;let t=n[1];if((n[2]||"").trim().length===0)return null;let o="",r="",c=t.match(/^name:\s*(.+)$/m),a=t.match(/^description:\s*(.+)$/m);return c&&(o=c[1].trim().replace(/^["']|["']$/g,"")),a&&(r=a[1].trim().replace(/^["']|["']$/g,"")),o&&r?{name:o,description:r}:null},Da=e=>{let n=[];if(!e||!
|
|
480
|
-
`),hr=mr(Dn),yr=mr(process.cwd()),Ki=pr(hr),Vi=pr(yr),xr=e=>{if(!e)return!1;let n=(e.filePath||"").replace(/\\/g,"/").toLowerCase();return n.includes("/skills/fluxflow/skill.md")||n.includes("/skills/about-fluxflow/skill.md")||e.name?.toLowerCase()==="fluxflow"},br=()=>(hr||[]).filter(e=>!xr(e)),wr=()=>(yr||[]).filter(e=>!xr(e)),Ac=(Zi?.length>0?1:0)+(ri?.length>0?
|
|
479
|
+
`).trim()},$a=(e="",n="")=>{let t=`${e||""}@${n||""}`.toLowerCase().trim();sr!==t&&(sr=t,Mo=Ji(),Po=Qi())};Qs();var Na=e=>{if(!e)return null;let n=e.match(/^\s*---\r?\n([\s\S]*?)\r?\n---(?:\r?\n)?([\s\S]*)$/);if(!n)return null;let t=n[1];if((n[2]||"").trim().length===0)return null;let o="",r="",c=t.match(/^name:\s*(.+)$/m),a=t.match(/^description:\s*(.+)$/m);return c&&(o=c[1].trim().replace(/^["']|["']$/g,"")),a&&(r=a[1].trim().replace(/^["']|["']$/g,"")),o&&r?{name:o,description:r}:null},Da=e=>{let n=[];if(!e||!on.existsSync(e))return n;let t=(i,o=0)=>{if(!(o>5))try{let r=on.readdirSync(i,{withFileTypes:!0});for(let c of r){let a=nn.join(i,c.name),u=c.name.toLowerCase();c.isFile()?u==="skill.md"&&n.push(a):c.isDirectory()&&(o===0?(u==="skills"||u===".skills"||u==="skill"||u===".skill")&&t(a,o+1):t(a,o+1))}}catch{}};return t(e,0),n},mr=e=>{let n=Da(e),t=[];for(let i of n)try{let o=on.readFileSync(i,"utf8"),r=Na(o);r&&t.push({...r,filePath:i})}catch{}return t},pr=e=>!e||e.length===0?"":e.map(n=>`- ${n.name}: ${n.description}`).join(`
|
|
480
|
+
`),hr=mr(Dn),yr=mr(process.cwd()),Ki=pr(hr),Vi=pr(yr),xr=e=>{if(!e)return!1;let n=(e.filePath||"").replace(/\\/g,"/").toLowerCase();return n.includes("/skills/fluxflow/skill.md")||n.includes("/skills/about-fluxflow/skill.md")||e.name?.toLowerCase()==="fluxflow"},br=()=>(hr||[]).filter(e=>!xr(e)),wr=()=>(yr||[]).filter(e=>!xr(e)),Ac=(Zi?.length>0?1:0)+(ri?.length>0?yn.length:0)+(Mo?.length>0?1:0)+(Po?.length>0?1:0)+br().length+wr().length,Yi=(e,n="Project")=>{if(!e)return"";let t=e.replace(/\\/g,"/");if(n==="Global"){let o=Ma.homedir().replace(/\\/g,"/");return t.toLowerCase().startsWith(o.toLowerCase())?"~"+t.slice(o.length):t}let i=nn.relative(process.cwd(),e).replace(/\\/g,"/");return i.startsWith(".")?i:`./${i}`},Ec=()=>{Mo=Ji(),Po=Qi();let e=[];_o&&Zi.length>0&&e.push({scope:"Global",path:_o}),yn&&yn.length>0&&ri.length>0?yn.forEach(r=>{e.push({scope:"Project",path:r})}):si&&ri.length>0&&e.push({scope:"Project",path:si}),vo&&Mo.length>0&&e.push({scope:"Global",path:vo}),Io&&Po.length>0&&e.push({scope:"Project",path:Io});let n=br(),t=wr(),i=e.length+n.length+t.length;if(i===0)return`\u2726 Loaded Files & Instructions
|
|
481
481
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m No instruction or skill files are currently loaded.
|
|
482
482
|
\u2800`;let o=[];return o.push(`\u2726 Loaded Files & Instructions (${i} ${i===1?"file":"files"} active)`),e.length>0&&(o.push(`
|
|
483
483
|
\x1B[1mInstructions:\x1B[22m`),e.forEach(r=>{o.push(` \u2022 [${r.scope}] ${Yi(r.path,r.scope)}`)})),(n?.length>0||t?.length>0)&&(o.push(`
|
|
484
484
|
\x1B[1mSkills:\x1B[22m`),n?.length>0&&n.forEach(r=>{o.push(` \u2022 [Global] \x1B[36m${r.name}\x1B[39m`),o.push(` \x1B[2m\u2514\u2500 ${Yi(r.filePath,"Global")}\x1B[22m`)}),t?.length>0&&t.forEach(r=>{o.push(` \u2022 [Project] \x1B[36m${r.name}\x1B[39m`),o.push(` \x1B[2m\u2514\u2500 ${Yi(r.filePath,"Project")}\x1B[22m`)})),o.push("\u2800"),o.join(`
|
|
485
485
|
`)},Sr=!1;(async()=>{try{let e=await To();if(Number(e?.display)===1){let{default:n}=await import("screenshot-desktop"),t=await n.listDisplays();t&&t.length>1&&(Sr=!0)}}catch{}})();var ar=null,Ro=null,lr=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",Cc=process.env.NO_DEV||!1,Fa=(e,n)=>{if(!n)return"";if(e!==ar||Ro===null){ar=e;try{let t=_t(zn,[]);Array.isArray(t)&&t.length>0?Ro=t.map(i=>`- ${i.memory}`).join(`
|
|
486
|
-
`):Ro=""}catch(t){Ro="",
|
|
486
|
+
`):Ro=""}catch(t){Ro="";try{on.mkdirSync(nn.join(pn,"memory"),{recursive:!0}),on.appendFileSync(nn.join(pn,"memory","error.txt"),`${t.message}
|
|
487
487
|
-------------------------------------------------
|
|
488
488
|
|
|
489
|
-
`)}}return Ro};var kr=(e,n,t,i,o=!0,r=!1,c="Google",a=!1,u,p,x=!1,m="")=>{let f=!1;process.env.forcedReasoning&&(f=!0);let s="";if(!u&&c==="Google"){let P=n;n==="Fast"&&(P="Off"),n==="Low"&&(P="Minimal"),n==="Standard"&&(P="Medium"),(n==="xHigh"||n==="Max")&&(P="xHigh"),s=ni[P]||ni.Medium}(u||c!=="Google")&&(s=ni.xHigh,n==="Fast"?s=`No thinking. Immediate response
|
|
489
|
+
`)}catch{}}}return Ro};var kr=(e,n,t,i,o=!0,r=!1,c="Google",a=!1,u,p,x=!1,m="")=>{let f=!1;process.env.forcedReasoning&&(f=!0);let s="";if(!u&&c==="Google"){let P=n;n==="Fast"&&(P="Off"),n==="Low"&&(P="Minimal"),n==="Standard"&&(P="Medium"),(n==="xHigh"||n==="Max")&&(P="xHigh"),s=ni[P]||ni.Medium}(u||c!=="Google")&&(s=ni.xHigh,n==="Fast"?s=`No thinking. Immediate response
|
|
490
490
|
Verify imports, tool results & system stability`:n.toLowerCase()==="max"&&(s=`Effort: Max
|
|
491
491
|
Plan step by step`));let g=e.instructions&&e.instructions?.length>0?`User Preferences: ${e.instructions}
|
|
492
492
|
|
|
@@ -508,14 +508,14 @@ ${Me}`:""}${b.length>0?`${Me.length>0?`
|
|
|
508
508
|
`:""}-- Project --
|
|
509
509
|
${b}`:""}
|
|
510
510
|
|
|
511
|
-
`:"",Fe=(()=>{let P=process.cwd().toLowerCase();if(process.platform==="win32"){let A=process.env.SystemRoot?.toLowerCase()||"c:\\windows",N=process.env.ProgramFiles?.toLowerCase()||"c:\\program files",be=process.env["ProgramFiles(x86)"]?.toLowerCase()||"c:\\program files (x86)";return P.startsWith(A)||P.startsWith(N)||P.startsWith(be)}else return P==="/"||["/bin","/sbin","/etc","/usr","/var","/root"].some(N=>P.startsWith(N))})(),$t=new Date,
|
|
511
|
+
`:"",Fe=(()=>{let P=process.cwd().toLowerCase();if(process.platform==="win32"){let A=process.env.SystemRoot?.toLowerCase()||"c:\\windows",N=process.env.ProgramFiles?.toLowerCase()||"c:\\program files",be=process.env["ProgramFiles(x86)"]?.toLowerCase()||"c:\\program files (x86)";return P.startsWith(A)||P.startsWith(N)||P.startsWith(be)}else return P==="/"||["/bin","/sbin","/etc","/usr","/var","/root"].some(N=>P.startsWith(N))})(),$t=new Date,xn=$t.getFullYear(),It=$t.toLocaleString("en-US",{month:"short"}).toUpperCase(),jt=String($t.getDate()).padStart(2,"0"),bn=`${xn}-${It}-${jt}`,wn=process.env.I_HAVE_TOO_MUCH_MONEY==="true"||!1,Nt=process.env.HALLOWEEN_EEGG==="true"||!1,St=Nt&&It.includes("OCT")&&(jt.includes("30")||jt.includes("31")),un=(m||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),k=nn.basename(un).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,P=>P.toUpperCase().trim()),C=process.env.NO_DEV==="true"||!1,Pe=!1;try{Pe=fo()}catch{Pe=!1}return`${wn?`${" ".repeat(Math.floor(Math.random()*4)+1)}`:""}=== SYSTEM PROMPT ===
|
|
512
512
|
${`Identity: ${zi.length>1?zi.trim():`Flux Flow.${V?` ${V}`:""} CLI Assistant${Nt?`. ${St?"Peak ":""}Halloween Themed, Spooky`:""}`}
|
|
513
513
|
${gr?"":`${t==="Flux"?"":t==="Flow"?"Concise, Humorous, Sarcastic":t==="ICU"?"Computer Use Capabilities. Screenshot as ground truth, analyze grid ids of target. Keyboard shortcuts > mouse clicks":"Computer Use & Workspace Capabilities. Screenshot as ground truth, analyze grid ids of target. Keyboard shortcuts > mouse clicks. Workspace Actions when faster. Focus on Productivity"}`}${Sr&&t.toLowerCase().includes("cu")?`
|
|
514
514
|
- Running on secondary screen. Opened app not visible in screenshot? Might be opened on primary. Use 'AskUser' with NO options and tell user to move app window to secondary`:""}`.trimEnd()}
|
|
515
515
|
|
|
516
516
|
- OS: ${lr}${!C&&m.length>1?`
|
|
517
517
|
- Model: ${k}`.trimEnd():""}
|
|
518
|
-
- Date: ${
|
|
518
|
+
- Date: ${bn}
|
|
519
519
|
|
|
520
520
|
-- REASONING GUIDANCE --
|
|
521
521
|
${c==="Mistral"||c==="Google"&&!u||f?`${s.trimEnd()}${f||n!=="Fast"&&(c==="Mistral"&&n==="Low"&&!u||n!=="High"&&!u)?`
|
|
@@ -560,7 +560,7 @@ ${Ds(n,t)}
|
|
|
560
560
|
=== END SYSTEM PROMPT ===${e?`
|
|
561
561
|
|
|
562
562
|
-- current saved user memories --
|
|
563
|
-
${e}`:""}`.trim();var Ar=()=>import("./web_search-NT3HXUO3.js").then(e=>e.web_search),Er=()=>import("./web_scrape-MW6YSZ7L.js").then(e=>e.web_scrape),Cr=()=>import("./memory-7YOYCOXE.js").then(e=>e.memory),Rr=()=>import("./chat-BA72I6O3.js").then(e=>e.chat),_r=()=>import("./view_file-I77KYUO5.js").then(e=>e.view_file),vr=()=>import("./write_file-NTWH4NCN.js").then(e=>e.write_file),Ir=()=>import("./update_file-XM5PHLQU.js").then(e=>e.update_file),Mr=()=>import("./exec_command-GXJWBNEI.js").then(e=>e.exec_command),Pr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),es=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),Or=()=>import("./write_pdf-26OQPNEP.js").then(e=>e.write_pdf),Lr=()=>import("./write_docx-E3MTFXTQ.js").then(e=>e.write_docx),ai=()=>import("./search_keyword-OHDFK7MO.js").then(e=>e.search_keyword),$r=()=>import("./generate_image-RAFSX2PO.js").then(e=>e.generate_image),li=()=>import("./saveSummary-W2JMDVZJ.js").then(e=>e.saveSummary),Lo=()=>import("./addMemScore-PBVNSFPN.js").then(e=>e.addMemScore),Nr=()=>import("./file_map-UA4BA5OH.js").then(e=>e.file_map),ci=()=>import("./todo-CJLWLWJB.js").then(e=>e.todo),Dr=()=>import("./invokeSync-K4DMVFUA.js").then(e=>e.invokeSync),Ba=()=>import("./invoke-M633DHSK.js").then(e=>e.invoke),Fr=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),Ua=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),Br=()=>import("./emergency_rollback-ZHQXCIHW.js").then(e=>e.emergency_rollback),$o=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),No=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),di=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),fi=()=>import("./computer_action-HG5P5DOG.js").then(e=>e.computer_action),Ur=()=>import("./click-C4LULADR.js").then(e=>e.click),Wr=()=>import("./drag-CIAOFEBD.js").then(e=>e.drag),Gr=()=>import("./scroll-V3SVOZW6.js").then(e=>e.scroll),ts=()=>import("./keyboard_typing-RDYAUO2I.js").then(e=>e.keyboard_typing),ns=()=>import("./key_press-3MUADXYA.js").then(e=>e.key_press),os=()=>import("./recapture_screen-CGAT4ZDO.js").then(e=>e.recapture_screen),ui=()=>import("./find_file-HYHHFHUJ.js").then(e=>e.find_file),Hr=()=>import("./wait-TJR6LAR4.js").then(e=>e.wait),jr={web_search:Ar,web_scrape:Er,memory:Cr,chat:Rr,view_file:_r,write_file:vr,update_file:Ir,exec_command:Mr,read_folder:Pr,write_pdf:Or,write_docx:Lr,search_keyword:ai,generate_image:$r,saveSummary:li,addMemScore:Lo,file_map:Nr,todo:ci,Todo:ci,goal:ci,Goal:ci,invokeSync:Dr,invoke:Ba,getProgress:Fr,cancel:Ua,awaitSubagent:$o,answerSubagent:No,steerSubagent:di,computer_action:fi,computer_use:fi,ComputerAction:fi,ComputerUse:fi,click:Ur,Click:Ur,drag:Wr,Drag:Wr,scroll:Gr,Scroll:Gr,keyboard_typing:ts,KeyboardTyping:ts,keyboardtyping:ts,key_press:ns,KeyPress:ns,keypress:ns,recapture_screen:os,RecaptureScreen:os,recapturescreen:os,invoke_sync:Dr,get_progress:Fr,await_subagent:$o,answer_subagent:No,steer_subagent:di,steer:di,Steer:di,ask:es,Ask:es,AskUser:es,WebSearch:Ar,WebScrape:Er,ReadFile:_r,ReadFolder:Pr,WriteFile:vr,PatchFile:Ir,WritePDF:Or,WriteDoc:Lr,Run:Mr,SearchKeyword:ai,CodeSearch:ai,code_search:ai,Memory:Cr,Chat:Rr,GenerateImage:$r,saveSumary:li,SaveSummary:li,SaveSumary:li,add_mem_score:Lo,AddMemScore:Lo,addMemoryScore:Lo,AddMemoryScore:Lo,FileMap:Nr,answer:No,Answer:No,AnswerSubagent:No,await:$o,Await:$o,AwaitSubagent:$o,EmergencyRollback:Br,emergency_rollback:Br,find_file:ui,findFile:ui,FindFile:ui,findfile:ui,wait:Hr,Wait:Hr},Do=async(e,n,t={})=>{let i=t.mode?t.mode.toLowerCase():"flux",o=e.toLowerCase(),c=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(x=>o.includes(x))||o==="ask",u=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(x=>o.includes(x));if(!c){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(!u)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 ${t.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let p=jr[e];if(!p){let x=["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"],m={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"},f=o.replace(/[^a-z0-9]/g,""),s=m[f]||null;if(!s){let T=0,ge=R=>{let W=new Set;for(let V=0;V<R.length-1;V++)W.add(R.slice(V,V+2));return W},y=ge(f);for(let R of x){let W=R.toLowerCase().replace(/[^a-z0-9]/g,"");if(f===W){s=R;break}let V=0;(W.includes(f)||f.includes(W))&&(V+=.6);let B=ge(W),E=0;for(let Ae of y)B.has(Ae)&&E++;let he=2*E/(y.size+B.size||1);V=Math.max(V,he),V>T&&V>=.35&&(T=V,s=R)}}let g=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await p())(n,t)}catch(x){let m=x instanceof Error?x.message:String(x);return`ERROR: Execution failed for [${e}]: ${m}`}};var gi=e=>{if(!e||typeof e!="string")return!1;let n=e.trim().toLowerCase();return Object.keys(jr).some(t=>t.toLowerCase()===n)};import j from"path";import Te from"fs";import{execSync as cs}from"child_process";import Wa from"gradient-string";var Kr=["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 Vr=["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 Yr=[{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"]}],uo={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 mi=null;var pi=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(mi||(mi=Yr[Math.floor(Math.random()*Yr.length)]),n={...mi,id:"Mystery"}):(mi=null,uo[e]?n=uo[e]:e==="Halloween"?n=uo.Spookfest:e==="GitHub"?n=uo["GitHub Dark"]:e==="Transparent"?n=uo["Transparent Dark"]:n=uo.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan",i=n.toolFeedbackAnsi||"\x1B[95m";return{...n,codeText:t,toolFeedbackAnsi:i}};var Ga=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",Fc=(e=2)=>{let n=Ga();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},zr=new Date,Fo=zr.getMonth(),Bo=zr.getDate(),Ha=Fo===9&&Bo>=15||Fo===10&&Bo<=1,is=null;(process.env.SPOOKFEST==="true"||Ha)&&(is=await import("./halloween-MX3VNQRW.js"));var Bc=(e="...",n="Loading...",t="Dark")=>{let i=pi(t),o=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let V=Zo(Xo,{})?.systemSettings?.customOpenAIBaseUrl;V&&(o=V)}catch{}let r=i.logoTextAnsi,c=i.logoBodyAnsi,a=i.logoMutedAnsi,u="\x1B[0m",p=[" \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 "],x=t==="Spookfest"||i.id==="Spookfest"||t==="Halloween"||i.id==="Halloween",m=Fo===9&&Bo>=15||Fo===10&&Bo<=1,f=x&&m||process.env.SPOOKFEST==="true"&&x,s=p;if(f&&is){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:W,halloweenBat:V,halloweenArtUser:B}=is;s=Math.random()>.9&&Fo===9&&Bo>=30?V:Math.random()>.5?W:B}else process.env.HALLOWEEN_EEGG="false";let g=f?Vr:Kr,T=g[Math.floor(Math.random()*g.length)],ge=i.logoGradient||["#0077ff","#ff00ff"],y=Wa(ge).multiline(s.join(`
|
|
563
|
+
${e}`:""}`.trim();var Ar=()=>import("./web_search-KBGH67IV.js").then(e=>e.web_search),Er=()=>import("./web_scrape-J3PL2PXT.js").then(e=>e.web_scrape),Cr=()=>import("./memory-7YOYCOXE.js").then(e=>e.memory),Rr=()=>import("./chat-BA72I6O3.js").then(e=>e.chat),_r=()=>import("./view_file-I77KYUO5.js").then(e=>e.view_file),vr=()=>import("./write_file-NTWH4NCN.js").then(e=>e.write_file),Ir=()=>import("./update_file-XM5PHLQU.js").then(e=>e.update_file),Mr=()=>import("./exec_command-GXJWBNEI.js").then(e=>e.exec_command),Pr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),es=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),Or=()=>import("./write_pdf-TPGUF4VT.js").then(e=>e.write_pdf),Lr=()=>import("./write_docx-E3MTFXTQ.js").then(e=>e.write_docx),ai=()=>import("./search_keyword-OHDFK7MO.js").then(e=>e.search_keyword),$r=()=>import("./generate_image-RAFSX2PO.js").then(e=>e.generate_image),li=()=>import("./saveSummary-W2JMDVZJ.js").then(e=>e.saveSummary),Lo=()=>import("./addMemScore-PBVNSFPN.js").then(e=>e.addMemScore),Nr=()=>import("./file_map-UA4BA5OH.js").then(e=>e.file_map),ci=()=>import("./todo-CJLWLWJB.js").then(e=>e.todo),Dr=()=>import("./invokeSync-U5FLY2AB.js").then(e=>e.invokeSync),Ba=()=>import("./invoke-K5DKH37G.js").then(e=>e.invoke),Fr=()=>import("./getProgress-FXNG2ISE.js").then(e=>e.getProgress),Ua=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),Br=()=>import("./emergency_rollback-ZHQXCIHW.js").then(e=>e.emergency_rollback),$o=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),No=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),di=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),fi=()=>import("./computer_action-HG5P5DOG.js").then(e=>e.computer_action),Ur=()=>import("./click-C4LULADR.js").then(e=>e.click),Wr=()=>import("./drag-CIAOFEBD.js").then(e=>e.drag),Gr=()=>import("./scroll-V3SVOZW6.js").then(e=>e.scroll),ts=()=>import("./keyboard_typing-RDYAUO2I.js").then(e=>e.keyboard_typing),ns=()=>import("./key_press-3MUADXYA.js").then(e=>e.key_press),os=()=>import("./recapture_screen-CGAT4ZDO.js").then(e=>e.recapture_screen),ui=()=>import("./find_file-HYHHFHUJ.js").then(e=>e.find_file),Hr=()=>import("./wait-TJR6LAR4.js").then(e=>e.wait),jr={web_search:Ar,web_scrape:Er,memory:Cr,chat:Rr,view_file:_r,write_file:vr,update_file:Ir,exec_command:Mr,read_folder:Pr,write_pdf:Or,write_docx:Lr,search_keyword:ai,generate_image:$r,saveSummary:li,addMemScore:Lo,file_map:Nr,todo:ci,Todo:ci,goal:ci,Goal:ci,invokeSync:Dr,invoke:Ba,getProgress:Fr,cancel:Ua,awaitSubagent:$o,answerSubagent:No,steerSubagent:di,computer_action:fi,computer_use:fi,ComputerAction:fi,ComputerUse:fi,click:Ur,Click:Ur,drag:Wr,Drag:Wr,scroll:Gr,Scroll:Gr,keyboard_typing:ts,KeyboardTyping:ts,keyboardtyping:ts,key_press:ns,KeyPress:ns,keypress:ns,recapture_screen:os,RecaptureScreen:os,recapturescreen:os,invoke_sync:Dr,get_progress:Fr,await_subagent:$o,answer_subagent:No,steer_subagent:di,steer:di,Steer:di,ask:es,Ask:es,AskUser:es,WebSearch:Ar,WebScrape:Er,ReadFile:_r,ReadFolder:Pr,WriteFile:vr,PatchFile:Ir,WritePDF:Or,WriteDoc:Lr,Run:Mr,SearchKeyword:ai,CodeSearch:ai,code_search:ai,Memory:Cr,Chat:Rr,GenerateImage:$r,saveSumary:li,SaveSummary:li,SaveSumary:li,add_mem_score:Lo,AddMemScore:Lo,addMemoryScore:Lo,AddMemoryScore:Lo,FileMap:Nr,answer:No,Answer:No,AnswerSubagent:No,await:$o,Await:$o,AwaitSubagent:$o,EmergencyRollback:Br,emergency_rollback:Br,find_file:ui,findFile:ui,FindFile:ui,findfile:ui,wait:Hr,Wait:Hr},Do=async(e,n,t={})=>{let i=t.mode?t.mode.toLowerCase():"flux",o=e.toLowerCase(),c=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(x=>o.includes(x))||o==="ask",u=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(x=>o.includes(x));if(!c){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(!u)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 ${t.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let p=jr[e];if(!p){let x=["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"],m={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"},f=o.replace(/[^a-z0-9]/g,""),s=m[f]||null;if(!s){let T=0,ge=R=>{let W=new Set;for(let V=0;V<R.length-1;V++)W.add(R.slice(V,V+2));return W},y=ge(f);for(let R of x){let W=R.toLowerCase().replace(/[^a-z0-9]/g,"");if(f===W){s=R;break}let V=0;(W.includes(f)||f.includes(W))&&(V+=.6);let B=ge(W),E=0;for(let Ae of y)B.has(Ae)&&E++;let he=2*E/(y.size+B.size||1);V=Math.max(V,he),V>T&&V>=.35&&(T=V,s=R)}}let g=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await p())(n,t)}catch(x){let m=x instanceof Error?x.message:String(x);return`ERROR: Execution failed for [${e}]: ${m}`}};var gi=e=>{if(!e||typeof e!="string")return!1;let n=e.trim().toLowerCase();return Object.keys(jr).some(t=>t.toLowerCase()===n)};import j from"path";import Te from"fs";import{execSync as cs}from"child_process";import Wa from"gradient-string";var Kr=["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 Vr=["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 Yr=[{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"]}],uo={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 mi=null;var pi=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(mi||(mi=Yr[Math.floor(Math.random()*Yr.length)]),n={...mi,id:"Mystery"}):(mi=null,uo[e]?n=uo[e]:e==="Halloween"?n=uo.Spookfest:e==="GitHub"?n=uo["GitHub Dark"]:e==="Transparent"?n=uo["Transparent Dark"]:n=uo.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan",i=n.toolFeedbackAnsi||"\x1B[95m";return{...n,codeText:t,toolFeedbackAnsi:i}};var Ga=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",Fc=(e=2)=>{let n=Ga();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},zr=new Date,Fo=zr.getMonth(),Bo=zr.getDate(),Ha=Fo===9&&Bo>=15||Fo===10&&Bo<=1,is=null;(process.env.SPOOKFEST==="true"||Ha)&&(is=await import("./halloween-MX3VNQRW.js"));var Bc=(e="...",n="Loading...",t="Dark")=>{let i=pi(t),o=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let V=Zo(Xo,{})?.systemSettings?.customOpenAIBaseUrl;V&&(o=V)}catch{}let r=i.logoTextAnsi,c=i.logoBodyAnsi,a=i.logoMutedAnsi,u="\x1B[0m",p=[" \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 "],x=t==="Spookfest"||i.id==="Spookfest"||t==="Halloween"||i.id==="Halloween",m=Fo===9&&Bo>=15||Fo===10&&Bo<=1,f=x&&m||process.env.SPOOKFEST==="true"&&x,s=p;if(f&&is){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:W,halloweenBat:V,halloweenArtUser:B}=is;s=Math.random()>.9&&Fo===9&&Bo>=30?V:Math.random()>.5?W:B}else process.env.HALLOWEEN_EEGG="false";let g=f?Vr:Kr,T=g[Math.floor(Math.random()*g.length)],ge=i.logoGradient||["#0077ff","#ff00ff"],y=Wa(ge).multiline(s.join(`
|
|
564
564
|
`)).split(`
|
|
565
565
|
`),R=W=>`${a}${W}${u}`;return`${y[0]}
|
|
566
566
|
${y[1]} ${r}Selected ${f?"Pumpkin":"Provider"}: ${o}${u}
|
|
@@ -595,9 +595,9 @@ ${y[7]}
|
|
|
595
595
|
${Fe.length>8192?`... (truncated) ...
|
|
596
596
|
|
|
597
597
|
`:""}
|
|
598
|
-
[AGENT (current turn)]: ${ut}`;E.push({role:"user",parts:[{text:It}]});let jt=await Oi("NVIDIA"),
|
|
598
|
+
[AGENT (current turn)]: ${ut}`;E.push({role:"user",parts:[{text:It}]});let jt=await Oi("NVIDIA"),wn=(await To()).quotas?.providerTiers?.NVIDIA==="Free",Nt="",St=0,un=W?12:-1;for(;St<=un;)try{if(!await vs("background",e))return;let k="",C=null,Pe=!1,P=y;try{let be=new Promise((rt,de)=>setTimeout(()=>de(new Error("JANITOR_TIMEOUT")),1e4)),_e=y==="Google"&&St>=0&&St<6&&jt&&wn,Ce=y==="DeepSeek"&&St<4&&jt&&wn;Pe=_e||Ce,P=Pe?"NVIDIA":y;let Le=Date.now(),Go=null,Wn=(async()=>{if(y==="OpenRouter"){let rt=re("janitor_open_router"),ce=(await le("OpenRouter"))(R,rt,E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),Mt=await ce.next();return{iterator:ce,firstResult:Mt}}else if(y==="DeepSeek"&&!Pe){let de=(await le("DeepSeek"))(R,re("deepseek_fast_fallback"),E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="Mistral"&&!Pe){let de=(await le("Mistral"))(R,re("mistral_janitor_fallback"),E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="NVIDIA"||Pe){let de=(await le("NVIDIA"))(Pe?jt:R,re("nvidia_janitor_fallback"),E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="InferX"){let de=(await le("InferX"))(R,targetModel||re("inferx_fallback")||"deepseek-v4-flash",E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="SenseNova"){let de=(await le("SenseNova"))(R,targetModel||re("sensenova_fallback")||"sensenova-6.8-flash-lite",E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="AIHubMix"){let de=(await le("AIHubMix"))(R,targetModel||re("aihubmix_fallback")||"gpt-4o-mini",E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="Poolside"){let de=(await le("Poolside"))(R,targetModel||re("poolside_fallback")||"poolside/laguna-s-2.1",E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="9router"||y==="9Router"){let de=(await le("NineRouter"))(R,targetModel||re("9router_fallback")||"z-ai/glm-5.3-flash",E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else if(y==="ExpLabs"||y==="ExperientialLabs"){let de=(await le("ExpLabs"))(R,targetModel||re("explabs_fallback")||"deepseek-v4-pro-0813",E,b,"Fast",f,!1,null,.7)[Symbol.asyncIterator](),ce=await de.next();return{iterator:de,firstResult:ce}}else{let ce=(await ms(R).models.generateContentStream({model:s||(St===un?re("janitor_default"):re("gemma_janitor_fallback_google")),contents:E,config:{systemInstruction:b,temperature:.7,safetySettings:[{category:Un.HARM_CATEGORY_HARASSMENT,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_HATE_SPEECH,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_SEXUALLY_EXPLICIT,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_DANGEROUS_CONTENT,threshold:Bn.BLOCK_NONE}],thinkingConfig:{includeThoughts:!1,thinkingLevel:ze.MINIMAL},serviceTier:"flex"}}))[Symbol.asyncIterator](),Mt=await ce.next();return{iterator:ce,firstResult:Mt}}})();if(process.stdout.isTTY){let ce=(await Di())[g]?.name||"",Mt=ce&&!ce.startsWith("flow-")&&!ce.startsWith("Session ")?ce:"FluxFlow | Idle";process.stdout.write(`\x1B]0;${Mt}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${Mt}\x07`)}let{iterator:go,firstResult:Ho}=await Promise.race([Wn,be]);Go=Date.now()-Le;let{value:Sn,done:Kt}=Ho;if(!Kt&&Sn){let rt=Sn.candidates?.[0]?.content?.parts,de=rt?P==="Google"?rt[1]?.text||rt[0]?.text||"":rt.filter(ce=>ce.text&&!ce.thought).map(ce=>ce.text).join(""):typeof Sn.text=="function"?Sn.text():"";de&&(k+=de),C=Sn.usageMetadata;for await(let ce of{[Symbol.asyncIterator]:()=>go}){let Mt=ce.candidates?.[0]?.content?.parts,mo=Mt?P==="Google"?Mt[1]?.text||Mt[0]?.text||"":Mt.filter(Zn=>Zn.text&&!Zn.thought).map(Zn=>Zn.text).join(""):typeof ce.text=="function"?ce.text():"";mo&&(k+=mo),C=ce.usageMetadata}}}catch(be){throw be}if(k){if(Nt=k,C){let be=C.totalTokenCount||0,_e=C.cachedContentTokenCount||0,Ce=(C.candidatesTokenCount||0)+(P==="Google"&&C.thoughtsTokenCount||0),Le=Pe?re("nvidia_janitor_fallback"):P==="DeepSeek"?re("deepseek_fast_fallback"):P==="ExpLabs"||P==="ExperientialLabs"?re("explabs_fallback")||"deepseek-v4-pro-0813":P==="OpenRouter"?re("janitor_open_router"):s||(St===un?re("janitor_default"):re("gemma_janitor_fallback_google"));await bt("tokens",be,P,Le),_e>0&&await bt("cachedTokens",_e,P,Le),Ce>0&&await bt("candidateTokens",Ce,P,Le),janitorTtft!==null&&janitorTtft>0&&await bt("ttft",janitorTtft,P,Le),Ao({provider:P,model:Le,prompt:C.promptTokenCount||0,cached:_e,output:Ce,reasoning:C.thoughtsTokenCount||0,ttft:janitorTtft})}}else throw new Error("No synthesis generated by Janitor.");p&&(p(),await vt("background"));let A=Qn(Nt),N=!1;for(let be of A){let _e=be.toolName;["addMemScore","add_mem_score","AddMemScore","addMemoryScore","AddMemoryScore"].includes(_e)&&(N=!0);let Ce={chatId:g,sessionId:g,history:i},Le=await Do(_e,be.args,Ce);_e.toLowerCase()==="memory"&&(be.args.includes("action='user'")||be.args.includes('action="user"'))&&!Le.startsWith("ERROR")&&(u&&u(),process.stdout.isTTY&&(process.stdout.write("\x1B]0;Memory Updated\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=Memory Updated\x07")),await new Promise(Wn=>setTimeout(Wn,3e3)))}if(!N)try{let be=_t(zn,[]);if(be.length>0){let _e=[];for(let Ce of be)Ce.score===void 0&&(Ce.score=.5),Ce.score*=.99995,Ce.score<.05&&(Ce.score=0),Ce.score=Math.round(Ce.score*1e5)/1e5,Ce.score>0&&_e.push(Ce);ao(zn,_e)}}catch{}break}catch(k){St++;let C=new Date().toLocaleString(),Pe=k instanceof Error?(()=>{try{return JSON.parse(JSON.parse(k.message).error.message).error.message}catch{return String(k)}})():String(k);await new Promise(N=>setTimeout(N,1e3));let P=j.join(pn,"janitor");if(Te.existsSync(P)||Te.mkdirSync(P,{recursive:!0}),Te.appendFileSync(j.join(P,"error.log"),`ERROR [Attempt ${St}/${un+1}] [${C}]: ${Pe}
|
|
599
599
|
|
|
600
|
-
`),St>
|
|
600
|
+
`),St>un)break;let A=Math.min(750*Math.pow(2,St-1),5e3);await new Promise(N=>setTimeout(N,A))}if(St){let k=j.join(pn,"janitor");Te.appendFileSync(j.join(k,"error.log"),`-----------------------------------------------------------------------------
|
|
601
601
|
|
|
602
602
|
`)}if(process.stdout.isTTY)try{let Pe=(await Di())[g]?.name||"",P=Pe&&!Pe.startsWith("flow-")&&!Pe.startsWith("Session ")?Pe:"FluxFlow | Idle";process.stdout.write(`\x1B]0;${P}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${P}\x07`)}catch{process.stdout.write("\x1B]0;FluxFlow | Idle\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow | Idle\x07")}},ps=e=>{if(!e||typeof e!="string")return e;let n=e.split(""),t=!1,i=!1,o=0;for(;o<n.length;){if(n[o]==="`"&&n[o+1]==="`"&&n[o+2]==="`"){t?(n[o]=" ",n[o+1]=" ",n[o+2]=" ",t=!1):(n[o]=" ",n[o+1]=" ",n[o+2]=" ",t=!0),o+=3;continue}if(t){n[o]!==`
|
|
603
603
|
`&&n[o]!=="\r"&&(n[o]=" "),o++;continue}if(n[o]==="`")if(i){i=!1,n[o]=" ",o++;continue}else{let r=!1;for(let c=o+1;c<n.length&&!(n[c]===`
|
|
@@ -628,7 +628,7 @@ ${g}
|
|
|
628
628
|
`):c+=`-- Individual Memories:
|
|
629
629
|
${g}
|
|
630
630
|
|
|
631
|
-
`}let u=0,p=5,x=!1,m=re("gemma_janitor_fallback_google");for(i==="OpenRouter"&&(m=re("janitor_open_router")),i==="DeepSeek"&&(m=re("deepseek_level_1")),i==="Mistral"&&(m=re("mistral_level_1")),i==="NVIDIA"&&(m=re("nvidia_janitor_fallback")),i==="InferX"&&(m=re("inferx_fallback")),i==="SenseNova"&&(m=re("sensenova_fallback")),i==="AIHubMix"&&(m=re("aihubmix_fallback")),i==="Poolside"&&(m=re("poolside_fallback")),(i==="9router"||i==="9Router")&&(m=re("9router_fallback"));u<=p&&!x;){u++;try{let s=(await yi(n,m,c,null,"Fast",.75,"background")).text||"",g=Qn(s);if(g.length===0)throw new Error("No tool calls detected in synthesis response");for(let T of g){let ge=T.toolName;["saveSummary","saveSumary","SaveSummary","SaveSumary"].includes(ge)&&await Do(ge,T.args,{chatId:e})}x=!0}catch(f){if(u>=p)throw new Error(`Failed after ${p} attempts. Last error: ${f.message}`)}}}catch(i){let o=i instanceof Error?(()=>{try{return JSON.parse(JSON.parse(i.message).error.message).error.message}catch{return String(i)}})():String(i),r=j.join(
|
|
631
|
+
`}let u=0,p=5,x=!1,m=re("gemma_janitor_fallback_google");for(i==="OpenRouter"&&(m=re("janitor_open_router")),i==="DeepSeek"&&(m=re("deepseek_level_1")),i==="Mistral"&&(m=re("mistral_level_1")),i==="NVIDIA"&&(m=re("nvidia_janitor_fallback")),i==="InferX"&&(m=re("inferx_fallback")),i==="SenseNova"&&(m=re("sensenova_fallback")),i==="AIHubMix"&&(m=re("aihubmix_fallback")),i==="Poolside"&&(m=re("poolside_fallback")),(i==="9router"||i==="9Router")&&(m=re("9router_fallback"));u<=p&&!x;){u++;try{let s=(await yi(n,m,c,null,"Fast",.75,"background")).text||"",g=Qn(s);if(g.length===0)throw new Error("No tool calls detected in synthesis response");for(let T of g){let ge=T.toolName;["saveSummary","saveSumary","SaveSummary","SaveSumary"].includes(ge)&&await Do(ge,T.args,{chatId:e})}x=!0}catch(f){if(u>=p)throw new Error(`Failed after ${p} attempts. Last error: ${f.message}`)}}}catch(i){let o=i instanceof Error?(()=>{try{return JSON.parse(JSON.parse(i.message).error.message).error.message}catch{return String(i)}})():String(i),r=j.join(pn,"janitor");Te.existsSync(r)||Te.mkdirSync(r,{recursive:!0}),Te.appendFileSync(j.join(r,"error.log"),`[${new Date().toLocaleString()}] Past memory batch consolidation error: ${o}
|
|
632
632
|
`)}},Pd=async(e,n,t=!1)=>{let{chatId:i,aiProvider:o="Google"}=e,r=j.join(Jo,"chat-summaries.json"),c=s=>s.filter(g=>(g.role==="user"||g.role==="agent"||g.role==="system")&&g.role!=="think"&&!g.isVisualFeedback&&!g.isMeta&&!g.isTerminalRecord&&!(g.text&&g.text.includes("[TERMINAL_RECORD]"))&&!String(g.id).startsWith("welcome")).map(g=>{let T=g.fullText||g.text||"",ge=g.role==="system"||T.startsWith("[ACTION RESULT]:")||T.startsWith("[TOOL RESULT]:")||g.text&&(g.text.startsWith("[ACTION RESULT]:")||g.text.startsWith("[TOOL RESULT]:")),y=T;return ge&&(T.includes("[ACTION RESULT]:")||T.includes("[TOOL RESULT]:")||g.text&&(g.text.includes("[ACTION RESULT]:")||g.text.includes("[TOOL RESULT]:")))?y="[ACTION RESULT]: ...truncated for summary":y=y.replace(/(\[(?:tool|action):[a-zA-Z0-9_\.]+)\([\s\S]*?\)(\])/g,"$1(...)$2"),`[${ge?"ACTION":g.role==="agent"?"AGENT":"USER"}]: ${y}`}).join(`
|
|
633
633
|
|
|
634
634
|
`),a=async(s,g)=>{let T="You are an expert context summarizer. Summarize the provided chat history (which may include previous summaries, user instructions, agent outputs, and tool results) into a detailed, coherent, and highly technical summary of 1000 to 1500 words. Focus on preserving the architectural decisions made, current system state, task progress, and critical code details, chat messages, file changes. Under no circumstances exceed MAX 2000 words.",ge=g?`Here is the previous summary:
|
|
@@ -640,9 +640,9 @@ ${s}
|
|
|
640
640
|
Provide a new consolidated summary of the entire session.`:`Here is the conversation history:
|
|
641
641
|
${s}
|
|
642
642
|
|
|
643
|
-
Provide a consolidated summary of the entire session.`,y=re("gemma_janitor_fallback_google");o==="OpenRouter"&&(y=re("janitor_open_router")),o==="DeepSeek"&&(y=re("deepseek_level_1")),o==="Mistral"&&(y=re("mistral_level_1")),o==="NVIDIA"&&(y=re("nvidia_chat_summarizer_fallback")),o==="InferX"&&(y=re("inferx_fallback")),o==="SenseNova"&&(y=re("sensenova_fallback")),o==="AIHubMix"&&(y=re("aihubmix_fallback")),o==="Poolside"&&(y=re("poolside_fallback")),(o==="9router"||o==="9Router")&&(y=re("9router_fallback")),(o==="ExpLabs"||o==="ExperientialLabs")&&(y=re("explabs_fallback")||"deepseek-v4-pro-0813"),(o==="TokenHarbor"||o==="Token Harbor"||o==="tokenharbor"||o==="token_harbor"||o==="thk")&&(y=re("tokenharbor_fallback")||"deepseek-v4.1-flash:free"),(o==="Infron"||o==="infron")&&(y=re("infron_fallback")),(o==="xKiro"||o==="xkiro"||o==="kiro")&&(y=re("xkiro_fallback")||"openai/gpt-5.6-sol");let R=0,W=!1,V=null;for(;R<=3&&!W;){R++;try{V=await yi(e,y,ge,T,"Fast"),W=!0}catch{if(R>3){if(o==="Google")try{let E=re("general_fallback");return(await yi(e,E,ge,T,"Fast")).text||""}catch{return""}return""}}}return V&&V.text||""},u=c(n),p=_t(r,{}),x=p[i]||{summary:"",historyLength:0};typeof x=="string"&&(x={summary:x,historyLength:0});let m=x.summary||"",f=await a(u,m);if(f){x.summary=f;let s=ul(n);return t?x.historyLength=(x.historyLength||0)+s:x.historyLength=s,p[i]=x,ao(r,p),f}return null},Od=e=>{try{let n=j.join(Jo,"chat-summaries.json");if(Te.existsSync(n)){let t=_t(n,{});t[e]&&(delete t[e],ao(n,t))}}catch{}},Ld=async function*(e,n,t,i,o){let{profile:r,thinkingLevel:c,mode:a,janitorModel:u,chatId:p,isPlayground:x,systemSettings:m,sessionStats:f,aiProvider:s="Google",apiTier:g,wildcardTooling:T,wildercardTooling:ge}=t,y=st(e);if(!gs&&s==="Google")throw new Error("AI not initialized");let R=process.env.NVIDIA_BASE_URL||t?.aiProvider==="Ollama"||t?.aiProvider==="InferX"||t?.aiProvider==="SenseNova"||t?.aiProvider==="AIHubMix"||t?.aiProvider==="Poolside"||t?.aiProvider==="9router"||t?.aiProvider==="ExpLabs"||t?.aiProvider==="ExperientialLabs"||t?.aiProvider==="TokenHarbor"||t?.aiProvider==="Token Harbor"||t?.aiProvider==="tokenharbor"||t?.aiProvider==="token_harbor"||t?.aiProvider==="thk"||t?.aiProvider==="APInex"||t?.aiProvider==="apinex"||t?.aiProvider==="apx"||t?.aiProvider==="xKiro"||t?.aiProvider==="xkiro"||t?.aiProvider==="kiro"||t?.aiProvider==="Infron"||t?.aiProvider==="infron"||t?.aiProvider==="c_openai"||t?.aiProvider==="Custom (OpenAI)"?!1:m?.memory!==!1,W=n[n.length-1].text,V=j.join(Jo,"chat-summaries.json"),B=!1,E=n.filter(S=>S.role==="user").length===1,he=W.includes("[TITLE-UPDATE]"),Ae=E||he,Me=W.replace(/\[TITLE-UPDATE\]/g,"").trim();Me=Me.replace(/\s*\[Prompted on:.*?\]/g,"").trim(),yield{type:"status",content:"[start]"},yield{type:"status",content:"Gathering Context"},await ti.startTransaction(p,Me),m?.advanceRollback&&await Eo.takeInitialSnapshot(p),wt=!1;let Se=null;try{let S=new AbortController;Se=setInterval(()=>{wt&&(S.abort(),Se&&(clearInterval(Se),Se=null))},400);let b=[...n.slice(0,-1)];{let ve=_t(V,{})[p]||{summary:"",historyLength:0};if(ve.summary&&ve.historyLength>0){let Vt=0,Oe=[];for(let fe=0;fe<b.length;fe++){let We=b[fe];(We.role==="user"||We.role==="agent"||We.role==="system")&&!String(We.id).startsWith("welcome")&&!We.isMeta&&Vt++,Vt>ve.historyLength&&Oe.push(We)}b=Oe}}b=b.map(M=>{if(M.role==="user"&&M.text){let ve=M.text.match(/\[USER\]([\s\S]*?)\[\/USER\]/);if(ve)return{...M,text:ve[1].trim()}}return{...M}});let ut=process.env.HIGH_CONTEXT,Fe=process.env.GOOGLE_GEMMA_NONSENSE==="true"||process.env.GOOGLE_GEMMA_NONSENSE===!0||!1,It={"16k":16e3,"32k":32e3,"64k":64e3,"128k":128e3,"256k":256e3,"512k":512e3,"1M":1e6}[m?.contextLength]||256e3;if(ut&&ut!=="false"){let M=parseInt(ut,10);!isNaN(M)&&M>=0&&M<=1e6&&(It=M)}if((s==="NVIDIA"&&(e?.includes("gpt")||e?.includes("qwen")||e?.includes("medium")||e.includes("muse"))||s==="Mistral")&&(It=126e3),s==="Google"&&e?.includes("gemma")&&Fe&&(It=16e3),(f?.tokens||0)>It){yield{type:"text",content:"\u2726 Maximum Context Limit Reached. Start a new chat."};return}if(E&&R){let M=_t(Qo,{});Object.values(M).flat().length>5&&(yield{type:"status",content:"Condensing past chat memories"},await yl(p,t,M))}let jt=_t(Qo,{}),
|
|
643
|
+
Provide a consolidated summary of the entire session.`,y=re("gemma_janitor_fallback_google");o==="OpenRouter"&&(y=re("janitor_open_router")),o==="DeepSeek"&&(y=re("deepseek_level_1")),o==="Mistral"&&(y=re("mistral_level_1")),o==="NVIDIA"&&(y=re("nvidia_chat_summarizer_fallback")),o==="InferX"&&(y=re("inferx_fallback")),o==="SenseNova"&&(y=re("sensenova_fallback")),o==="AIHubMix"&&(y=re("aihubmix_fallback")),o==="Poolside"&&(y=re("poolside_fallback")),(o==="9router"||o==="9Router")&&(y=re("9router_fallback")),(o==="ExpLabs"||o==="ExperientialLabs")&&(y=re("explabs_fallback")||"deepseek-v4-pro-0813"),(o==="TokenHarbor"||o==="Token Harbor"||o==="tokenharbor"||o==="token_harbor"||o==="thk")&&(y=re("tokenharbor_fallback")||"deepseek-v4.1-flash:free"),(o==="Infron"||o==="infron")&&(y=re("infron_fallback")),(o==="xKiro"||o==="xkiro"||o==="kiro")&&(y=re("xkiro_fallback")||"openai/gpt-5.6-sol");let R=0,W=!1,V=null;for(;R<=3&&!W;){R++;try{V=await yi(e,y,ge,T,"Fast"),W=!0}catch{if(R>3){if(o==="Google")try{let E=re("general_fallback");return(await yi(e,E,ge,T,"Fast")).text||""}catch{return""}return""}}}return V&&V.text||""},u=c(n),p=_t(r,{}),x=p[i]||{summary:"",historyLength:0};typeof x=="string"&&(x={summary:x,historyLength:0});let m=x.summary||"",f=await a(u,m);if(f){x.summary=f;let s=ul(n);return t?x.historyLength=(x.historyLength||0)+s:x.historyLength=s,p[i]=x,ao(r,p),f}return null},Od=e=>{try{let n=j.join(Jo,"chat-summaries.json");if(Te.existsSync(n)){let t=_t(n,{});t[e]&&(delete t[e],ao(n,t))}}catch{}},Ld=async function*(e,n,t,i,o){let{profile:r,thinkingLevel:c,mode:a,janitorModel:u,chatId:p,isPlayground:x,systemSettings:m,sessionStats:f,aiProvider:s="Google",apiTier:g,wildcardTooling:T,wildercardTooling:ge}=t,y=st(e);if(!gs&&s==="Google")throw new Error("AI not initialized");let R=process.env.NVIDIA_BASE_URL||t?.aiProvider==="Ollama"||t?.aiProvider==="InferX"||t?.aiProvider==="SenseNova"||t?.aiProvider==="AIHubMix"||t?.aiProvider==="Poolside"||t?.aiProvider==="9router"||t?.aiProvider==="ExpLabs"||t?.aiProvider==="ExperientialLabs"||t?.aiProvider==="TokenHarbor"||t?.aiProvider==="Token Harbor"||t?.aiProvider==="tokenharbor"||t?.aiProvider==="token_harbor"||t?.aiProvider==="thk"||t?.aiProvider==="APInex"||t?.aiProvider==="apinex"||t?.aiProvider==="apx"||t?.aiProvider==="xKiro"||t?.aiProvider==="xkiro"||t?.aiProvider==="kiro"||t?.aiProvider==="Infron"||t?.aiProvider==="infron"||t?.aiProvider==="c_openai"||t?.aiProvider==="Custom (OpenAI)"?!1:m?.memory!==!1,W=n[n.length-1].text,V=j.join(Jo,"chat-summaries.json"),B=!1,E=n.filter(S=>S.role==="user").length===1,he=W.includes("[TITLE-UPDATE]"),Ae=E||he,Me=W.replace(/\[TITLE-UPDATE\]/g,"").trim();Me=Me.replace(/\s*\[Prompted on:.*?\]/g,"").trim(),yield{type:"status",content:"[start]"},yield{type:"status",content:"Gathering Context"},await ti.startTransaction(p,Me),m?.advanceRollback&&await Eo.takeInitialSnapshot(p),wt=!1;let Se=null;try{let S=new AbortController;Se=setInterval(()=>{wt&&(S.abort(),Se&&(clearInterval(Se),Se=null))},400);let b=[...n.slice(0,-1)];{let ve=_t(V,{})[p]||{summary:"",historyLength:0};if(ve.summary&&ve.historyLength>0){let Vt=0,Oe=[];for(let fe=0;fe<b.length;fe++){let We=b[fe];(We.role==="user"||We.role==="agent"||We.role==="system")&&!String(We.id).startsWith("welcome")&&!We.isMeta&&Vt++,Vt>ve.historyLength&&Oe.push(We)}b=Oe}}b=b.map(M=>{if(M.role==="user"&&M.text){let ve=M.text.match(/\[USER\]([\s\S]*?)\[\/USER\]/);if(ve)return{...M,text:ve[1].trim()}}return{...M}});let ut=process.env.HIGH_CONTEXT,Fe=process.env.GOOGLE_GEMMA_NONSENSE==="true"||process.env.GOOGLE_GEMMA_NONSENSE===!0||!1,It={"16k":16e3,"32k":32e3,"64k":64e3,"128k":128e3,"256k":256e3,"512k":512e3,"1M":1e6}[m?.contextLength]||256e3;if(ut&&ut!=="false"){let M=parseInt(ut,10);!isNaN(M)&&M>=0&&M<=1e6&&(It=M)}if((s==="NVIDIA"&&(e?.includes("gpt")||e?.includes("qwen")||e?.includes("medium")||e.includes("muse"))||s==="Mistral")&&(It=126e3),s==="Google"&&e?.includes("gemma")&&Fe&&(It=16e3),(f?.tokens||0)>It){yield{type:"text",content:"\u2726 Maximum Context Limit Reached. Start a new chat."};return}if(E&&R){let M=_t(Qo,{});Object.values(M).flat().length>5&&(yield{type:"status",content:"Condensing past chat memories"},await yl(p,t,M))}let jt=_t(Qo,{}),bn=_t(Mi,{}),wn=Object.entries(jt).filter(([M])=>M!==p).flatMap(([M,ve])=>ve),St=[...Object.entries(bn).filter(([M])=>M!==p).slice(-20).map(([M,ve])=>`[Chat Summary]: ${ve}`),...wn].map(M=>`- ${M}`).join(`
|
|
644
644
|
`),k=_t(zn,[]).map(M=>`- ${M.memory}`).join(`
|
|
645
|
-
`),C=(f?.tokens||0)>=1e4,Pe=new Date,P=Pe.getFullYear(),A=Pe.toLocaleString("en-US",{month:"short"}).toUpperCase(),N=String(Pe.getDate()).padStart(2,"0"),_e=`${Pe.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}`,Ce=M=>{try{return Te.readdirSync(M,{withFileTypes:!0})}catch{return[]}},Le=Array.from(new Set([...So,...ko(process.cwd())])),Go=(M,ve=6)=>m?.indentationTree!==!1?rs(M,ve,1,Ce,Le):ls(M,ve,"",1,Ce,Le),Wn=_t(Pi,{}),go=Wn[p],Ho=go?go!==process.cwd():!1;Wn[p]=process.cwd(),ao(Pi,Wn);let
|
|
645
|
+
`),C=(f?.tokens||0)>=1e4,Pe=new Date,P=Pe.getFullYear(),A=Pe.toLocaleString("en-US",{month:"short"}).toUpperCase(),N=String(Pe.getDate()).padStart(2,"0"),_e=`${Pe.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}`,Ce=M=>{try{return Te.readdirSync(M,{withFileTypes:!0})}catch{return[]}},Le=Array.from(new Set([...So,...ko(process.cwd())])),Go=(M,ve=6)=>m?.indentationTree!==!1?rs(M,ve,1,Ce,Le):ls(M,ve,"",1,Ce,Le),Wn=_t(Pi,{}),go=Wn[p],Ho=go?go!==process.cwd():!1;Wn[p]=process.cwd(),ao(Pi,Wn);let Sn=_t(V,{}),Kt=Sn[p]||{summary:"",historyLength:0};typeof Kt=="string"&&(Kt={summary:Kt,historyLength:0});let rt=n.filter(M=>(M.role==="user"||M.role==="agent"||M.role==="system")&&!String(M.id).startsWith("welcome")&&!M.isMeta).length;Kt.historyLength&&rt<Kt.historyLength&&(Kt.summary="",Kt.historyLength=0,Sn[p]=Kt,ao(V,Sn));let de=typeof Kt=="object"?Kt.summary||"":Kt||"",ce=b.length>0;ce&&de&&b[0]&&(b[0].role==="user"||b[0].role==="system")&&(b[0].text.includes("**CONTEXT SUMMARY OF PREVIOUS TURNS")||(b[0].text=`[SYSTEM METADATA]
|
|
646
646
|
**CONTEXT SUMMARY OF PREVIOUS TURNS (PRIORITY: DYNAMIC)**
|
|
647
647
|
${de}
|
|
648
648
|
|
|
@@ -654,9 +654,9 @@ ${de}
|
|
|
654
654
|
**Directory**
|
|
655
655
|
CWD: `+process.cwd()+`${x?" [PLAYGROUND MODE]":""}
|
|
656
656
|
`+Go(process.cwd(),6),at=fo()?await qn():null,hs=M=>{if(!M||!Array.isArray(M)||M.length===0)return null;let ve=new Map;for(let Oe of M){let fe=Oe.relPath||(Oe.file?j.relative(process.cwd(),Oe.file):"unknown");ve.has(fe)||ve.set(fe,[]),ve.get(fe).push(Oe)}let Vt=[];for(let[Oe,fe]of ve.entries()){Vt.push(`- ${Oe}:`);for(let We of fe){let qe=(We.snippet||"").trim().replace(/\r?\n/g," "),Je=We.line||1,Pt=(We.text||"").trim().replace(/\r?\n+/g,". "),ke=Pt?` [${Pt}]`:"";Vt.push(` ~L${Je}${ke}`)}}return Vt.join(`
|
|
657
|
-
`)},xi=hs(at?.comments),
|
|
657
|
+
`)},xi=hs(at?.comments),kn="";if(at&&at.file_focused!=="none"){kn=`
|
|
658
658
|
[Additional IDE Context]
|
|
659
|
-
`;let M=j.relative(process.cwd(),at.file_focused),ve=(at.opened_editors||[]).map(Oe=>{let fe=j.relative(process.cwd(),Oe);return fe.startsWith("..")?`[External] ${j.basename(Oe)}`:fe});if(
|
|
659
|
+
`;let M=j.relative(process.cwd(),at.file_focused),ve=(at.opened_editors||[]).map(Oe=>{let fe=j.relative(process.cwd(),Oe);return fe.startsWith("..")?`[External] ${j.basename(Oe)}`:fe});if(kn+=`Focused File: ${M}
|
|
660
660
|
Cursor Line: ${at.cursor_line}
|
|
661
661
|
`,at.selected){let Oe=at.selected,fe=Oe.split(`
|
|
662
662
|
`);fe.length>256&&(Oe=fe.slice(0,240).join(`
|
|
@@ -665,9 +665,9 @@ Cursor Line: ${at.cursor_line}
|
|
|
665
665
|
`+fe.slice(-16).join(`
|
|
666
666
|
`)),Oe.length>2048&&(Oe=Oe.slice(0,1920)+`
|
|
667
667
|
... [truncated] ...
|
|
668
|
-
`+Oe.slice(-128)),
|
|
668
|
+
`+Oe.slice(-128)),kn+=`Current Selection: "${Oe}"
|
|
669
669
|
`}if(at.manual_edits){let fe=at.manual_edits.split(`
|
|
670
|
-
`),We=[],qe=null;for(let $ of fe)$.trim()&&($.startsWith(" Line ")?qe&&qe.edits.push($):(qe={path:$.endsWith(":")?$.slice(0,-1):$,edits:[]},We.push(qe)));for(let $ of We)$.edits.length>80&&($.edits=$.edits.slice(-80)),$.originalEditsCount=$.edits.length;let Je=($,Be)=>Be.reduce((gt,
|
|
670
|
+
`),We=[],qe=null;for(let $ of fe)$.trim()&&($.startsWith(" Line ")?qe&&qe.edits.push($):(qe={path:$.endsWith(":")?$.slice(0,-1):$,edits:[]},We.push(qe)));for(let $ of We)$.edits.length>80&&($.edits=$.edits.slice(-80)),$.originalEditsCount=$.edits.length;let Je=($,Be)=>Be.reduce((gt,rn)=>{let kt=at.file_focused&&(rn.path===at.file_focused||j.resolve(process.cwd(),rn.path)===j.resolve(at.file_focused))?Math.ceil($*1.2):$;return gt+Math.min(rn.edits.length,kt)},0),Pt=80;if(Je(80,We)>300){let $=!1;for(let Be=80;Be>=10;Be--)if(Je(Be,We)<=300){Pt=Be,$=!0;break}$||(Pt=10)}let ke=[...We];if(Pt===10&&Je(10,ke)>500)for(;ke.length>0&&Je(10,ke)>500;){let $=0,Be=ke[0].originalEditsCount;for(let gt=1;gt<ke.length;gt++)ke[gt].originalEditsCount<Be&&(Be=ke[gt].originalEditsCount,$=gt);ke.splice($,1)}for(let $ of ke){let gt=at.file_focused&&($.path===at.file_focused||j.resolve(process.cwd(),$.path)===j.resolve(at.file_focused))?Math.ceil(Pt*1.2):Pt;$.edits.length>gt&&($.edits=$.edits.slice(-gt))}for(let $ of ke){let Be=`${$.path}:
|
|
671
671
|
${$.edits.join(`
|
|
672
672
|
`)}`;for(;$.edits.length>0&&Be.length>4*768;)$.edits.shift(),Be=`${$.path}:
|
|
673
673
|
${$.edits.join(`
|
|
@@ -675,18 +675,18 @@ ${$.edits.join(`
|
|
|
675
675
|
`);for(;ke.length>0&&ue.length>4*2048;){ke[0].edits.length>0?ke[0].edits.shift():ke.shift();for(let $ of ke){let Be=`${$.path}:
|
|
676
676
|
${$.edits.join(`
|
|
677
677
|
`)}`;Be.length>4*768?$.stringRepresentation="... "+Be.slice(-(4*768-4)):$.stringRepresentation=Be}ue=ke.map($=>$.stringRepresentation).join(`
|
|
678
|
-
`)}ue.length>4*2048&&(ue="... "+ue.slice(-(4*2048-4))),
|
|
678
|
+
`)}ue.length>4*2048&&(ue="... "+ue.slice(-(4*2048-4))),kn+=`Recent Manual Edits:
|
|
679
679
|
${ue}
|
|
680
|
-
`}ve.length>0&&(
|
|
680
|
+
`}ve.length>0&&(kn+=`All Opened Editors: ${ve.join(", ")}`),at.diagnostics&&(kn+=`
|
|
681
681
|
**Active File Errors**:
|
|
682
682
|
${at.diagnostics}
|
|
683
|
-
`),(Me.toLowerCase().includes("lint")||Me.toLowerCase().includes("warning"))&&at.warnings&&(
|
|
683
|
+
`),(Me.toLowerCase().includes("lint")||Me.toLowerCase().includes("warning"))&&at.warnings&&(kn+=`
|
|
684
684
|
**Lint Warnings**:
|
|
685
685
|
${at.warnings}
|
|
686
|
-
`)}let ys=Me.replace(/\s*\[Prompted on:.*?\]/g,"").trim(),xs=/(?:\\)?@\[([^\]]+)\]/g,bi,wi=[];for(xs.lastIndex=0;(bi=xs.exec(ys))!==null;){let M=bi[0].startsWith("\\");wi.push({tag:bi[1],isEscaped:M})}let Si=[],jo=null;for(let M=0;M<wi.length;M++){let{tag:ve,isEscaped:Vt}=wi[M];if(!Vt)try{let Oe=ve.trim().replace(/^["']|["']$/g,""),fe=/[:#]L?(\d+)(?:-L?(\d+))?$/i,We=Oe.match(fe),qe=Oe,Je=null,Pt=null;We&&(Je=parseInt(We[1],10),Pt=We[2]?parseInt(We[2],10):Je,qe=Oe.slice(0,We.index));let ke=j.resolve(process.cwd(),qe);if(Te.existsSync(ke)&&Te.statSync(ke).isFile()){let $=qe.toLowerCase(),Be=$.endsWith(".pdf"),gt=$.endsWith(".docx")||$.endsWith(".doc")||$.endsWith(".ppt")||$.endsWith(".pptx")||$.endsWith(".xls")||$.endsWith(".xlsx"),
|
|
686
|
+
`)}let ys=Me.replace(/\s*\[Prompted on:.*?\]/g,"").trim(),xs=/(?:\\)?@\[([^\]]+)\]/g,bi,wi=[];for(xs.lastIndex=0;(bi=xs.exec(ys))!==null;){let M=bi[0].startsWith("\\");wi.push({tag:bi[1],isEscaped:M})}let Si=[],jo=null;for(let M=0;M<wi.length;M++){let{tag:ve,isEscaped:Vt}=wi[M];if(!Vt)try{let Oe=ve.trim().replace(/^["']|["']$/g,""),fe=/[:#]L?(\d+)(?:-L?(\d+))?$/i,We=Oe.match(fe),qe=Oe,Je=null,Pt=null;We&&(Je=parseInt(We[1],10),Pt=We[2]?parseInt(We[2],10):Je,qe=Oe.slice(0,We.index));let ke=j.resolve(process.cwd(),qe);if(Te.existsSync(ke)&&Te.statSync(ke).isFile()){let $=qe.toLowerCase(),Be=$.endsWith(".pdf"),gt=$.endsWith(".docx")||$.endsWith(".doc")||$.endsWith(".ppt")||$.endsWith(".pptx")||$.endsWith(".xls")||$.endsWith(".xlsx"),rn=/\.(png|jpg|jpeg|webp|gif|bmp)$/.test($),je=rn||Be||gt,kt=s==="Google"||st(e);if(je&&!kt){let Ie=`\u2718 Unsupported Modality: ${j.basename(qe)}`,lt=115;process.stdout.isTTY&&(lt=process.stdout.columns-5||120);let Qt=[Ie],Ke=Math.max(...Qt.map(an=>an.length)),te=Math.min(Ke+4,lt),Ge=Qt.map(an=>`${an.padEnd(te-2).substring(0,te-2)}`).join(`
|
|
687
687
|
`);yield{type:"visual_feedback",content:Gt(`${Ge}
|
|
688
688
|
`)};continue}if(Je===null&&!je){let Ie=0;try{Ie=Te.readFileSync(ke,"utf8").split(/\r\n|\r|\n/).length}catch{}if(Ie>300){let lt=`\u21B7 Skipped (Too Large): ${j.basename(qe)}`,Qt=115;process.stdout.isTTY&&(Qt=process.stdout.columns-5||120);let Ke=Math.min(lt.length+4,Qt),te=lt.padEnd(Ke-2).substring(0,Ke-2);yield{type:"visual_feedback",content:Gt(`${te}
|
|
689
|
-
`)};continue}}let
|
|
689
|
+
`)};continue}}let Tn=Je!==null?Je:1,Dt=Pt!==null?Pt:Je!==null?Je:Tn+299;Dt-Tn>300&&(Dt=Tn+300);let Hn=`path=${JSON.stringify(qe)}, startLine=${Tn}, endLine=${Dt}`,Yt=await Ns(Hn,{isMultiModal:kt}),Mn=!1,to="",Tt=null;if(typeof Yt=="string"?Yt.trim().startsWith("ERROR")?Mn=!0:to=Yt:Yt&&typeof Yt=="object"&&Yt.binaryPart?(Tt=Yt.binaryPart,to=Yt.text||""):Mn=!0,!Mn){let Ie="";if(rn?(Ie=`\u2714 Processed: ${j.basename(qe)}`,jo=Tt):Be||gt?(Ie=`\u2714 Auto-Analysed: ${j.basename(qe)}`,jo=Tt):(Ie=`\u2714 Auto-Read: ${j.basename(qe)}`,Si.push(to)),Ie){let lt=115;process.stdout.isTTY&&(lt=process.stdout.columns-5||120);let Qt=[Ie],Ke=Math.max(...Qt.map(an=>an.length)),te=Math.min(Ke+4,lt),Ge=Qt.map(an=>`${an.padEnd(te-2).substring(0,te-2)}`).join(`
|
|
690
690
|
`);yield{type:"visual_feedback",content:Gt(`${Ge}
|
|
691
691
|
`)}}}}}catch{}}let ki="";Si.length>0&&(ki=`
|
|
692
692
|
[Tagged File Contents] Auto Read User Tagged files by System, No need to re-read
|
|
@@ -696,16 +696,16 @@ ${at.warnings}
|
|
|
696
696
|
[Tagged File Contents]
|
|
697
697
|
`);let bs=ys.replace(/\\(@\[[^\]]+\])/g,"$1"),ws=T?`You cannot execute tools. Instead write the action string in chat you WOULD have written
|
|
698
698
|
`:"",ra=process.env.forcedReasoning||!1,Ss=c!=="Fast"&&(s==="Mistral"&&!ei(e)||c!=="High"&&s==="Google")?`${s==="Mistral"&&!ei(e)||e.toLowerCase().startsWith("gemma")||ra?`[system] strictly follow thinking policy as high priority. do not start a response without <think_fluxflow>...</think_fluxflow> [/system]
|
|
699
|
-
`:""}`:"",eo="";if(m?.clipboardContext)try{process.platform==="win32"?eo=cs("powershell.exe -NoProfile -Command Get-Clipboard",{encoding:"utf8",stdio:["pipe","pipe","ignore"],timeout:1500}).replace(/\r?\n$/,""):process.platform==="darwin"?eo=cs("pbpaste",{encoding:"utf8",stdio:["pipe","pipe","ignore"],timeout:1500}).replace(/\r?\n$/,""):eo=cs("xclip -selection clipboard -o || xsel --clipboard --output",{encoding:"utf8",shell:!0,stdio:["pipe","pipe","ignore"],timeout:1500}).replace(/\r?\n$/,"")}catch{eo=""}let Ko="",aa=!!m?.autoExcludeMetadata,la=!!(
|
|
699
|
+
`:""}`:"",eo="";if(m?.clipboardContext)try{process.platform==="win32"?eo=cs("powershell.exe -NoProfile -Command Get-Clipboard",{encoding:"utf8",stdio:["pipe","pipe","ignore"],timeout:1500}).replace(/\r?\n$/,""):process.platform==="darwin"?eo=cs("pbpaste",{encoding:"utf8",stdio:["pipe","pipe","ignore"],timeout:1500}).replace(/\r?\n$/,""):eo=cs("xclip -selection clipboard -o || xsel --clipboard --output",{encoding:"utf8",shell:!0,stdio:["pipe","pipe","ignore"],timeout:1500}).replace(/\r?\n$/,"")}catch{eo=""}let Ko="",aa=!!m?.autoExcludeMetadata,la=!!(kn||ki||ws||Mt||Ss||Ho||m?.dynamicDirAwareness||m?.autoTruncateResults);aa&&!la?Ko=bs.trim():Ko=`[System Metadata] Time: ${_e}${Ho?`
|
|
700
700
|
WARNING: CWD Changed from previous: "${go}" to current: "${process.cwd()}", write change in chat to avoid future path mismatches
|
|
701
|
-
`:""}${
|
|
701
|
+
`:""}${kn}
|
|
702
702
|
${eo.trim().length>0?`[Clipboard Context]
|
|
703
703
|
- ${eo.trim()}
|
|
704
704
|
`:""}${xi?`[Additional Comments]
|
|
705
705
|
${xi.trimEnd()}
|
|
706
706
|
`:""}Action format: [action:ActionName(...)]
|
|
707
707
|
[/Metadata]
|
|
708
|
-
${Mt}${Ss}${ki}${ws}[user prompt] ${bs.trim()} [/user prompt]`.trim();let ks={role:"user",text:Ko};jo&&(ks.binaryPart=jo),b.forEach(M=>{M.text&&M.role==="agent"&&(M.text=Ht(M.text))}),b.push(ks),Mt&&n[n.length-1]?.id&&(yield{type:"summary_injected",content:{id:n[n.length-1].id,text:Ko}});let
|
|
708
|
+
${Mt}${Ss}${ki}${ws}[user prompt] ${bs.trim()} [/user prompt]`.trim();let ks={role:"user",text:Ko};jo&&(ks.binaryPart=jo),b.forEach(M=>{M.text&&M.role==="agent"&&(M.text=Ht(M.text))}),b.push(ks),Mt&&n[n.length-1]?.id&&(yield{type:"summary_injected",content:{id:n[n.length-1].id,text:Ko}});let sn=null,In=a==="Flux"?50:15;In=a.toLowerCase().includes("cu")?75:In;let ca=Math.floor(In/2),Ts=0,gn=16;yield{type:"status",content:process.env.HALLOWEEN_EEGG==="true"?"Consulting the spirits":"Connecting"},wt=!1;let Ti=[],Vo=!1,As=!1,Gn=[],Ai=!1;for(let M=0;M<=In;M++){let ve=Math.floor(In*.95);if(M>=ve&&Ts<ve&&typeof t?.onAskUser=="function"){Ts=ve;try{let q="Agent has been running for a long time. Do you want to continue execution?",G=[{id:"continue",label:"Continue",description:"Add few more steps"},{id:"cancel",label:"Cancel",description:"Stop extending and finish current turn limit"}],D=await t.onAskUser(q,G);D&&(D.toLowerCase().includes("continue")||D==="Continue")&&(In+=ca)}catch{}}if(Gn.length>=10&&typeof t?.onAskUser=="function"){let q={},G=null;for(let D of Gn)if(q[D]=(q[D]||0)+1,q[D]>=10){G=D;break}if(G)try{let D="Agent seems stuck in a tool loop. You can prompt it to steer or break the loop:",ft=[{id:"continue",label:"Continue Anyway",description:"Ignore warning and let it proceed"},{id:"stop",label:"Stop Loop",description:"Force agent to summarize progress and stop repeating"}],Ue=await t.onAskUser(D,ft);if(Ue){let Ve="";typeof Ue=="string"&&(Ue.toLowerCase()==="stop"||Ue.includes("Stop Loop"))?Ve="STOP REPEATING THE SAME TOOL CALL. Acknowledge what failed or succeeded, summarize your current findings, and conclude.":typeof Ue=="string"&&(Ue.toLowerCase()==="continue"||Ue.includes("Continue Anyway"))?Gn=Gn.filter(Et=>Et!==G):Ve=typeof Ue=="string"?Ue:Ue?.label||Ue?.id||"",Ve&&(b.length>0&&b[b.length-1].role==="user"?b[b.length-1].text+=`
|
|
709
709
|
|
|
710
710
|
[STEERING HINT from USER, High Priority] ${Ve.trim()} [/STEERING HINT]`:b.push({role:"user",text:`[STEERING HINT from USER, High Priority] ${Ve.trim()} [/STEERING HINT]`}),yield{type:"status",content:"Steering Hint Injected..."},Gn=Gn.filter(Et=>Et!==G))}}catch{}}let Vt=await Li("agent",t);if(!Vt.allowed)throw new Error(Vt.reason||`Budget Exhausted for Provider (${s||"Agent"})`);let Oe=[];if(Vo=!1,(a==="ICU"||a==="FluxCU")&&!Ai)try{yield{type:"status",content:"Capturing Screen"},await new Promise(D=>setTimeout(D,1e3));let{captureGriddedScreenshot:q}=await import("./screen_grid-PAVYL4U2.js"),G=await q();if(G&&G.base64){let D="[system] Fresh Gridded Screen Feedback Captured. Use numeric coordinates. Old screenshots will be removed when new screenshot is captured, summarize in text if context is needed later [/system]",ft={inlineData:{mimeType:G.mimeType,data:G.base64}},Ue=m?.imageHistoryCU||"Standard",Ve=Ue==="Low"?3:Ue==="Extended"?10:Ue==="Max"?999:5,Et=b.filter(Ee=>Array.isArray(Ee.parts)&&Ee.parts.some(At=>At.inlineData));if(Et.length>=Ve){let Ee=Et.length-Ve+1;for(let At=0;At<Ee;At++){let ct=Et[At];Array.isArray(ct.parts)&&(ct.parts=ct.parts.filter(mt=>!mt.inlineData))}}if(b.length>0&&b[b.length-1].role==="user"){let Ee=b[b.length-1];typeof Ee.text=="string"&&(Ee.text+=`
|
|
711
711
|
|
|
@@ -721,7 +721,7 @@ ${D}`:b.push({role:"user",text:D}),yield{type:"status",content:"Subagent Update"
|
|
|
721
721
|
[question] ${q.replace("/btw","").trim()} [/question]`:b.push({role:"user",text:`[system] User question. Resolve this specific query within '[ANSWER]...[/ANSWER]' concisely, naturally [/system]
|
|
722
722
|
[question] ${q.replace("/btw","").trim()} [/question]`}):b.length>0&&b[b.length-1].role==="user"?b[b.length-1].text+=`
|
|
723
723
|
|
|
724
|
-
[STEERING HINT from USER, High Priority] ${q.trim()} [/STEERING HINT]`:b.push({role:"user",text:`[STEERING HINT from USER, High Priority] ${q.trim()} [/STEERING HINT]`}),yield{type:"status",content:`${q.startsWith("/btw")?"Question Forwarded...":"Steering Hint Injected..."}`})}let fe,We=!1,qe=1,Je=1,Pt=Date.now(),ke=null,ue="",$=null,Be=null,gt=null,
|
|
724
|
+
[STEERING HINT from USER, High Priority] ${q.trim()} [/STEERING HINT]`:b.push({role:"user",text:`[STEERING HINT from USER, High Priority] ${q.trim()} [/STEERING HINT]`}),yield{type:"status",content:`${q.startsWith("/btw")?"Question Forwarded...":"Steering Hint Injected..."}`})}let fe,We=!1,qe=1,Je=1,Pt=Date.now(),ke=null,ue="",$=null,Be=null,gt=null,rn=0,je=[],kt=0,Tn=!1,Dt=!1,Hn=!1,Yt=!1,Mn=!0,to=0,Tt="",Ie="",lt=!1,Qt=!1,Ke=!0,te=e,Ge="",an=c;for(c=c.toLowerCase()==="max"?"High":c;qe<=gn&&Je<=gn&&!We&&!wt;){let q=!1;try{ue="",Mn&&(process.stdout.isTTY&&process.stdout.write("\x1B]0;Working...\x07"),yield{type:"turn_reset",content:!0},Mn=!1,Je===1&&(Tt=""));let G=h=>{if(!h||typeof h!="string")return h;let _="",v=fs(h);if(v&&(_=v.fullBlock,h=v.remainingText),!h.includes("[tool:")&&!h.includes("[action:"))return(m?.keepReasoningContext?_:"")+h;if(Qn(h).length===0){let w=hi(h);return(m?.keepReasoningContext?_:"")+w}h=h.replace(dl,(w,I)=>I.includes("[tool:")||I.includes("[action:")?I.trim():w);let ae="",U=0,J=[],ht="";for(;U<h.length;){let w=h.indexOf("[tool:",U),I=h.indexOf("[action:",U),ne=-1;if(w!==-1&&I!==-1?ne=Math.min(w,I):w!==-1?ne=w:ne=I,ne===-1){J.length===0&&(ae+=hi(h.substring(U)));break}if((ne>0?h[ne-1]:"")==="`"){ae+=hi(h.substring(U,ne+1)),U=ne+1;continue}J.length===0&&(ht=hi(h.substring(U,ne)));let Q=-1,L=null,yt=0;for(let Bt=ne;Bt<h.length;Bt++){let oe=h[Bt];if(L){if(oe===L){let Xe=0;for(let xt=Bt-1;xt>=0&&h[xt]==="\\";xt--)Xe++;Xe%2===0&&(L=null)}}else if(oe==='"'||oe==="'"||oe==="`")L=oe;else if(oe==="(")yt++;else if(oe===")")yt--;else if(oe==="]"&&yt<=0){Q=Bt;break}}if(Q===-1){J.length===0&&(ae+=h.substring(ne));break}let En=h.substring(ne,Q+1);J.push(En),U=Q+1}return J.length>0&&(ae=ht.trimEnd()?ht.trimEnd()+`
|
|
725
725
|
|
|
726
726
|
`+J.join(`
|
|
727
727
|
|
|
@@ -729,7 +729,7 @@ ${D}`:b.push({role:"user",text:D}),yield{type:"status",content:"Subagent Update"
|
|
|
729
729
|
|
|
730
730
|
`)),(m?.keepReasoningContext?_:"")+ae},D=b.filter(h=>(h.role==="user"||h.role==="agent"||h.role==="system")&&!String(h.id).startsWith("welcome")&&!h.isMeta&&!h.isTerminalRecord&&!(h.text&&h.text.startsWith("[TERMINAL_RECORD]"))).map((h,_,v)=>{let X=h.text||"";R||(X=X.replace(/\s*\n*\s*\[Prompted on:.*?\]/gi,"").trim()),h.role==="agent"&&(X=G(X),X=X.replace(/\[turn:\s*finish\]/gi,"").replace(/\[\[END\]\]/gi,"").trim(),X=X.replaceAll("\x1B[33m\u24D8 Request Cancelled\x1B[0m","*User Cancelled Response Generation*"));let ae=[];return Array.isArray(h.parts)&&h.parts.length>0?ae=h.parts.map(U=>{if(U.text){let J=U.text;return R||(J=J.replace(/\s*\n*\s*\[Prompted on:.*?\]/gi,"").trim()),h.role==="agent"&&(J=G(J),J=J.replace(/\[turn:\s*finish\]/gi,"").replace(/\[\[END\]\]/gi,"").trim(),J=J.replaceAll("\x1B[33m\u24D8 Request Cancelled\x1B[0m","*User Cancelled Response Generation*")),{text:J}}return U}):ae=[{text:X}],h.binaryPart&&st(te)&&v.slice(_+1).filter(J=>J.role==="user"&&!J.text?.startsWith("[ACTION RESULT]")&&!J.text?.startsWith("[TOOL RESULT]")).length<=2&&ae.push(h.binaryPart),{role:h.role==="user"||h.role==="system"?"user":"model",parts:ae}});for(let h=D.length-2;h>=0;h--){let _=D[h],v=D[h+1];_.role==="user"&&v.role==="user"&&(v.parts?.[0]?.text||"").trim().startsWith("[SYSTEM")&&D.splice(h,1)}let ft=[];for(let h=0;h<D.length;h++){let _=D[h];if(ft.length===0)ft.push(_);else{let v=ft[ft.length-1];v.role===_.role?(v.parts[0].text+=`
|
|
731
731
|
|
|
732
|
-
`+(_.parts?.[0]?.text||""),_.parts?.length>1&&v.parts.push(..._.parts.slice(1))):ft.push(_)}}for(let h of ft)for(let _ of h.parts||[])_&&typeof _.text=="string"&&(_.text.includes("[action:")||_.text.includes("[tool:"))&&(_.text=_.text.replace(/```(?:[a-zA-Z0-9_-]+)?\s*\n?(\[(?:action|tool):[\s\S]*?\)\s*\])\n?```/gi,"$1"),_.text=_.text.replace(/`(\[(?:action|tool):[\s\S]*?\)\s*\])`/gi,"$1"));D.length=0,D.push(...ft),te=e;let Ue=`${p}|${s}|${a}|${c}|${
|
|
732
|
+
`+(_.parts?.[0]?.text||""),_.parts?.length>1&&v.parts.push(..._.parts.slice(1))):ft.push(_)}}for(let h of ft)for(let _ of h.parts||[])_&&typeof _.text=="string"&&(_.text.includes("[action:")||_.text.includes("[tool:"))&&(_.text=_.text.replace(/```(?:[a-zA-Z0-9_-]+)?\s*\n?(\[(?:action|tool):[\s\S]*?\)\s*\])\n?```/gi,"$1"),_.text=_.text.replace(/`(\[(?:action|tool):[\s\S]*?\)\s*\])`/gi,"$1"));D.length=0,D.push(...ft),te=e;let Ue=`${p}|${s}|${a}|${c}|${an}|${te}|${JSON.stringify(r)}|${!!m?.dynamicDirAwareness}|${!!m?.subAgents}`,Ve=Xn.key===Ue&&Xn.value;if((process.env.I_HAVE_TOO_MUCH_MONEY==="true"||process.env.I_HAVE_TOO_MUCH_MONEY===!0)&&(Ve=!1),Ve)Ge=Xn.value;else{let h=s==="Mistral"?!!ei(te):!(te||"gemma").toLowerCase().startsWith("gemma");Ge=kr(r,((te||"gemma").toLowerCase().startsWith("gemma"),an),a,m,R,E,s,s==="Google"?!0:y,h,p,!!m?.keepReasoningContext,te),m?.dynamicDirAwareness||(Ge+=`
|
|
733
733
|
${sa.replace(`
|
|
734
734
|
**Directory**`,`
|
|
735
735
|
-- Directory --`)}`),Xn.key=Ue,Xn.value=Ge}let Ee=D[D.length-1];if(fo()&M>0){await new Promise(X=>setTimeout(X,2500)),yield{type:"status",content:"Verifying"};let h=await qn(),_=h?h.diagnostics:null,v=hs(h?.comments);_&&Ee&&Ee.role==="user"&&Ee.parts?.[0]?.text&&(Ee.parts[0].text+=`
|
|
@@ -743,24 +743,24 @@ ${v}`),yield{type:"status",content:"Working"}}let At=s==="Mistral"||s==="Google"
|
|
|
743
743
|
`;for(let X of h.modifiedFiles)_+=`* ${X} (modified)
|
|
744
744
|
`;for(let X of h.deletedFiles)_+=`* ${X} (deleted)
|
|
745
745
|
`;_+="[/system]",Ee.parts[0].text+=_;let v=-1;for(let X=b.length-1;X>=0;X--)if(b[X].role==="user"&&(b[X].text?.startsWith("[ACTION RESULT]")||b[X].text?.startsWith("[TOOL RESULT]"))){v=X;break}v!==-1&&(b[v].text+=_)}}catch{}let ct=Math.floor(In*.99),mt=M+1;if(mt>=ct&&Ee&&Ee.parts?.[0]&&(Ee.parts[0].text+=`
|
|
746
|
-
[system] WARNING, Turn Limit Impending: Step ${mt}/${In}. Wrap up quickly/prompt user to continue. [/system]`),process.env.LOG_CHAT==="true"||process.env.LOG_CHAT==="1"||process.env.LOG_CHAT===!0||!1){let h=j.join(
|
|
746
|
+
[system] WARNING, Turn Limit Impending: Step ${mt}/${In}. Wrap up quickly/prompt user to continue. [/system]`),process.env.LOG_CHAT==="true"||process.env.LOG_CHAT==="1"||process.env.LOG_CHAT===!0||!1){let h=j.join(pn,"chats",String(p));Te.existsSync(h)||Te.mkdirSync(h,{recursive:!0}),Te.writeFileSync(j.join(h,"context.json"),JSON.stringify({contents:D},null,2)),Te.writeFileSync(j.join(h,"system.md"),`${Ve?"CACHED":"NOT CACHED"}
|
|
747
747
|
Key: ${Ue}
|
|
748
748
|
--------------------------------------------------------------------
|
|
749
749
|
|
|
750
|
-
${Ge}`)}let Ot=new Promise((h,_)=>{S.signal.aborted&&_(new DOMException("The user aborted a request.","AbortError")),S.signal.addEventListener("abort",()=>{_(new DOMException("The user aborted a request.","AbortError"))})});Ot.catch(()=>{});let He=D;if(Pt=Date.now(),s==="Ollama")fe=(await le("Ollama"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,m?.ollamaEndpoint||"Cloud");else if(s==="OpenRouter")fe=(await le("OpenRouter"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,p);else if(s==="DeepSeek")fe=(await le("DeepSeek"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="Mistral")fe=(await le("Mistral"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,p);else if(s==="NVIDIA"){let h=(await le("NVIDIA"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);fe=(await le("NVIDIA_wrap"))(h,te)}else if(s==="InferX")fe=(await le("InferX"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="SenseNova")fe=(await le("SenseNova"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="AIHubMix")fe=(await le("AIHubMix"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="Poolside")fe=(await le("Poolside"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="9router"||s==="9Router")fe=(await le("NineRouter"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="ExpLabs"||s==="ExperientialLabs")fe=(await le("ExpLabs"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="Infron"||s==="infron")fe=(await le("Infron"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="TokenHarbor"||s==="Token Harbor"||s==="tokenharbor"||s==="token_harbor"||s==="thk")fe=(await le("TokenHarbor"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="APInex"||s==="apinex"||s==="apx")fe=(await le("APInex"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="xKiro"||s==="xkiro"||s==="kiro")fe=(await le("xKiro"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="c_openai"||s==="Custom (OpenAI)")fe=(await le("c_openai"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,m?.customOpenAIBaseUrl||"");else{let h=ms(t?.apiKey),{serviceTier:_,cleanModel:v}=ia(te),X={systemInstruction:Ge,mediaResolution:"MEDIA_RESOLUTION_HIGH",safetySettings:[{category:Un.HARM_CATEGORY_HARASSMENT,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_HATE_SPEECH,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_SEXUALLY_EXPLICIT,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_DANGEROUS_CONTENT,threshold:Bn.BLOCK_NONE}],temperature:1.05,thinkingConfig:(()=>{let U=Ls("Google",te||"gemini-3-flash-preview",c);if(U!==null){if(typeof U=="object")return U;if(U===!1||U==="false"||U==="none"||U===0||U==="0")return{includeThoughts:!1};if(typeof U=="number")return{includeThoughts:!0,thinkingBudget:U};if(typeof U=="string"){let I=U.toLowerCase();if(I==="minimal")return{includeThoughts:!0,thinkingLevel:ze.MINIMAL};if(I==="low")return{includeThoughts:!0,thinkingLevel:ze.LOW};if(I==="medium")return{includeThoughts:!0,thinkingLevel:ze.MEDIUM};if(I==="high")return{includeThoughts:!0,thinkingLevel:ze.HIGH};let ne=Number(U);if(!isNaN(ne))return{includeThoughts:!0,thinkingBudget:ne}}}let J=(te||"").toLowerCase(),ht=J.includes("gemma-4")||J.startsWith("gemma"),w=J.includes("gemini-3");if(ht||w)return ht?c.toLowerCase()!=="high"?{includeThoughts:!1,thinkingLevel:ze.MINIMAL}:{includeThoughts:!0,thinkingLevel:ze.HIGH}:{includeThoughts:!0,thinkingLevel:{Fast:J.includes("pro")?ze.LOW:ze.MINIMAL,Low:ze.LOW,Medium:ze.MEDIUM,Standard:ze.MEDIUM,High:ze.HIGH,xHigh:ze.HIGH}[c]||ze.MEDIUM};{let I={Fast:0,Low:512,Medium:2048,Standard:2048,High:16384,xHigh:24576}[c]||2048;return I===0?{includeThoughts:!1}:{includeThoughts:!0,thinkingBudget:I}}})()};_&&(X.serviceTier=_);let ae=h.models.generateContentStream({model:v||"gemini-3-flash-preview",contents:He,config:X},{signal:S.signal});fe=await Promise.race([ae,Ot])}ue="",$=null,gt=null,je=[],kt=0,yield{type:"model_update",content:null},Ie="",lt=Tt.length>0;let Ft="",no=Date.now(),Kn=async function*(){if(s==="Google"&&Ft){let h=ho(Ft);for(let _ of h)yield _;Ft="",no=Date.now()}},Es=!0,
|
|
750
|
+
${Ge}`)}let Ot=new Promise((h,_)=>{S.signal.aborted&&_(new DOMException("The user aborted a request.","AbortError")),S.signal.addEventListener("abort",()=>{_(new DOMException("The user aborted a request.","AbortError"))})});Ot.catch(()=>{});let He=D;if(Pt=Date.now(),s==="Ollama")fe=(await le("Ollama"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,m?.ollamaEndpoint||"Cloud");else if(s==="OpenRouter")fe=(await le("OpenRouter"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,p);else if(s==="DeepSeek")fe=(await le("DeepSeek"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="Mistral")fe=(await le("Mistral"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,p);else if(s==="NVIDIA"){let h=(await le("NVIDIA"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);fe=(await le("NVIDIA_wrap"))(h,te)}else if(s==="InferX")fe=(await le("InferX"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="SenseNova")fe=(await le("SenseNova"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="AIHubMix")fe=(await le("AIHubMix"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="Poolside")fe=(await le("Poolside"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="9router"||s==="9Router")fe=(await le("NineRouter"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="ExpLabs"||s==="ExperientialLabs")fe=(await le("ExpLabs"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="Infron"||s==="infron")fe=(await le("Infron"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="TokenHarbor"||s==="Token Harbor"||s==="tokenharbor"||s==="token_harbor"||s==="thk")fe=(await le("TokenHarbor"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="APInex"||s==="apinex"||s==="apx")fe=(await le("APInex"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="xKiro"||s==="xkiro"||s==="kiro")fe=(await le("xKiro"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1);else if(s==="c_openai"||s==="Custom (OpenAI)")fe=(await le("c_openai"))(t.apiKey,te,He,Ge,c,a,y,S.signal,1,m?.customOpenAIBaseUrl||"");else{let h=ms(t?.apiKey),{serviceTier:_,cleanModel:v}=ia(te),X={systemInstruction:Ge,mediaResolution:"MEDIA_RESOLUTION_HIGH",safetySettings:[{category:Un.HARM_CATEGORY_HARASSMENT,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_HATE_SPEECH,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_SEXUALLY_EXPLICIT,threshold:Bn.BLOCK_NONE},{category:Un.HARM_CATEGORY_DANGEROUS_CONTENT,threshold:Bn.BLOCK_NONE}],temperature:1.05,thinkingConfig:(()=>{let U=Ls("Google",te||"gemini-3-flash-preview",c);if(U!==null){if(typeof U=="object")return U;if(U===!1||U==="false"||U==="none"||U===0||U==="0")return{includeThoughts:!1};if(typeof U=="number")return{includeThoughts:!0,thinkingBudget:U};if(typeof U=="string"){let I=U.toLowerCase();if(I==="minimal")return{includeThoughts:!0,thinkingLevel:ze.MINIMAL};if(I==="low")return{includeThoughts:!0,thinkingLevel:ze.LOW};if(I==="medium")return{includeThoughts:!0,thinkingLevel:ze.MEDIUM};if(I==="high")return{includeThoughts:!0,thinkingLevel:ze.HIGH};let ne=Number(U);if(!isNaN(ne))return{includeThoughts:!0,thinkingBudget:ne}}}let J=(te||"").toLowerCase(),ht=J.includes("gemma-4")||J.startsWith("gemma"),w=J.includes("gemini-3");if(ht||w)return ht?c.toLowerCase()!=="high"?{includeThoughts:!1,thinkingLevel:ze.MINIMAL}:{includeThoughts:!0,thinkingLevel:ze.HIGH}:{includeThoughts:!0,thinkingLevel:{Fast:J.includes("pro")?ze.LOW:ze.MINIMAL,Low:ze.LOW,Medium:ze.MEDIUM,Standard:ze.MEDIUM,High:ze.HIGH,xHigh:ze.HIGH}[c]||ze.MEDIUM};{let I={Fast:0,Low:512,Medium:2048,Standard:2048,High:16384,xHigh:24576}[c]||2048;return I===0?{includeThoughts:!1}:{includeThoughts:!0,thinkingBudget:I}}})()};_&&(X.serviceTier=_);let ae=h.models.generateContentStream({model:v||"gemini-3-flash-preview",contents:He,config:X},{signal:S.signal});fe=await Promise.race([ae,Ot])}ue="",$=null,gt=null,je=[],kt=0,yield{type:"model_update",content:null},Ie="",lt=Tt.length>0;let Ft="",no=Date.now(),Kn=async function*(){if(s==="Google"&&Ft){let h=ho(Ft);for(let _ of h)yield _;Ft="",no=Date.now()}},Es=!0,An="",oo=!1,pt=null,Cs=!1,Vn=!1,io=!1,Yo=!1,Pn=!1,po=h=>{let _=0;for(;_+2<h.length;)h[_]==="`"&&h[_+1]==="`"&&h[_+2]==="`"?(Yo=!Yo,_+=3):_++},Rs=h=>{if(!h)return;let _=/(?:<(\/?)think_fluxflow[^>]*>|\[(\/?)think_fluxflow\]|<\/?channel\|?>|<\|channel>thought)/gi,v;for(;(v=_.exec(h))!==null;){let X=v[0].toLowerCase();X.startsWith("</")||X.startsWith("[/")||X==="<channel|>"?Pn=!1:Pn=!0}},ga={tool:{startPrefix:"[tool",fullPrefix:"[tool:",endTag:"]"},action:{startPrefix:"[action",fullPrefix:"[action:",endTag:"]"},end:{startPrefix:"[[END]]",fullPrefix:"[[END]]",endTag:"[[END]]"},kimi_section:{startPrefix:"<|tool_calls_section_begin|>",fullPrefix:"<|tool_calls_section_begin|>",endTag:"<|tool_calls_section_end|>"},kimi_call:{startPrefix:"<|tool_call_begin|>",fullPrefix:"<|tool_call_begin|>",endTag:"<|tool_call_end|>"}},ho=h=>{let _=[],v=h,X=ae=>{if(!ae)return;if(!Cs){_.push({type:"text",content:ae}),po(ae),Rs(ae);return}let U=/(?:<(\/?)think_fluxflow[^>]*>|\[(\/?)think_fluxflow\]|<\/?channel\|?>|<\|channel>thought)/gi,J=0,ht;for(;(ht=U.exec(ae))!==null;){let I=ae.substring(J,ht.index);if(I)if(po(I),Pn)_.push({type:"text",content:I});else{let $e=I.replace(/[^\r\n]/g,"");$e&&_.push({type:"text",content:$e})}let ne=ht[0];po(ne);let l=ne.toLowerCase();l.startsWith("</")||l.startsWith("[/")||l==="<channel|>"?Pn=!1:Pn=!0,_.push({type:"text",content:ne}),J=U.lastIndex}let w=ae.substring(J);if(w)if(po(w),Pn)_.push({type:"text",content:w});else{let I=w.replace(/[^\r\n]/g,"");I&&_.push({type:"text",content:I})}};for(;v.length>0;)if(oo){let ae=An+v,U=ga[pt];if(U){let w=!1;if(ae.length<U.startPrefix.length?U.startPrefix.startsWith(ae)||(w=!0):ae.startsWith(U.startPrefix)?ae.length>=U.fullPrefix.length&&!ae.startsWith(U.fullPrefix)&&(w=!0):w=!0,w){X(ae),An="",oo=!1,pt=null,Vn=!1,io=!1,v="";break}}let J=-1,ht=U?U.endTag:"]";if(pt==="tool"||pt==="action"){let w=0,I=null,ne=0,l=!1;for(let $e=0;$e<ae.length;$e++){let Q=ae[$e];if(I){if(Q===I){let L=0;for(let yt=$e-1;yt>=0&&ae[yt]==="\\";yt--)L++;L%2===0&&(I=null)}}else if(Q==='"'||Q==="'")I=Q;else if(Q==="`")if(Vn){J=$e;break}else I=Q;else if(Q==="(")w++,l=!0;else if(Q===")")w--;else if(Q==="]"&&l&&w===0){J=$e;break}}}else J=ae.indexOf(ht);if(J!==-1){let w=ht.length,I=ae.substring(0,J+w);pt?.startsWith("kimi")||_.push({type:"text",content:I}),po(I),Rs(I),(pt==="tool"||pt==="action"||pt?.startsWith("kimi"))&&!Vn&&!io&&(Cs=!0,Gn.push(I.trim())),Vn=!1,io=!1,An="",oo=!1,pt=null,v=ae.substring(J+w)}else{An=ae,v="";break}}else{let ae=v.indexOf("[tool"),U=v.indexOf("[action"),J=v.indexOf("[[END]]"),ht=v.indexOf("<|tool_calls_section_begin|>"),w=v.indexOf("<|tool_call_begin|>"),I=[{type:"tool",idx:ae,start:"[tool",end:"]"},{type:"action",idx:U,start:"[action",end:"]"},{type:"end",idx:J,start:"[[END]]",end:"[[END]]"},{type:"kimi_section",idx:ht,start:"<|tool_calls_section_begin|>",end:"<|tool_calls_section_end|>"},{type:"kimi_call",idx:w,start:"<|tool_call_begin|>",end:"<|tool_call_end|>"}].filter(ne=>ne.idx!==-1).sort((ne,l)=>ne.idx-l.idx);if(I.length>0){let ne=I[0],l=v.substring(0,ne.idx);ne.idx>0&&X(l);let $e=ne.idx>0?v[ne.idx-1]:"";Vn=Yo||$e==="`",io=Pn,oo=!0,pt=ne.type,An="",v=v.substring(ne.idx)}else{let ne=["[tool","[action","[[END]]","<|tool_calls_section_begin|>","<|tool_call_begin|>"],l=-1;for(let $e of ne){for(let Q=$e.length-1;Q>0;Q--)if(v.endsWith($e.substring(0,Q))){l=v.length-Q;let L=ne.indexOf($e);L===0?pt="tool":L===1?pt="action":L===2?pt="end":L===3?pt="kimi_section":pt="kimi_call";break}if(l!==-1)break}if(l!==-1){if(l>0){let Q=v.substring(0,l);X(Q)}let $e=l>0?v[l-1]:"";Vn=Yo||$e==="`",io=Pn,oo=!0,An=v.substring(l),v=""}else{X(v);break}}}return _},ma=fe[Symbol.asyncIterator]();for(;;){let{value:h,done:_}=await Promise.race([ma.next(),Ot]);if(_)break;if(h&&h.type==="status"){yield h;continue}let v="",X=h.candidates?.[0]?.content?.parts;if(X&&X.length>0)for(let U of X){let J=typeof U.text=="string"?U.text:U.text?parseChunkText(U.text):"";U.thought?J&&(q||(v+="<think_fluxflow>",q=!0),v+=J):J&&(q&&(v+="</think_fluxflow>",q=!1),v+=J)}else h.text&&q&&(v+="</think_fluxflow>",q=!1);v=rl(v);let ae=v?$i(v):0;if(t&&typeof t.onTokenChunk=="function"&&t.onTokenChunk(v,ae),Es&&(ke===null&&(ke=Date.now()-Pt),yield{type:"status",content:process.env.HALLOWEEN_EEGG==="true"?"Performing dark ritual":"Thinking"},Es=!1),wt){yield{type:"status",content:"Request Cancelled"},yield{type:"text",content:`
|
|
751
751
|
|
|
752
|
-
\x1B[33m\u24D8 Request Cancelled\x1B[0m`};break}if(v){if(lt){if(Ie+=v,Ie.length>=64){let w=0,I=Math.min(Tt.length,Ie.length);for(let l=I;l>=10;l--)if(Tt.endsWith(Ie.substring(0,l))){w=l;break}let ne=Ie.substring(w);if(ne){let $e=/(?:<think_fluxflow>|\[think_fluxflow\])(?:(?!(?:<\/think_fluxflow>|\[\/think_fluxflow\]))[\s\S])*$/i.test(Tt)?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(ue+=$e,s==="Google")Ft+=$e;else{yield*Kn();let Q=ho($e);for(let L of Q)yield L}}lt=!1,Ie=""}continue}else if(ue+=v,s==="Google")Ft+=v;else{yield*Kn();let w=ho(v);for(let I of w)yield I}let U=ml(ue);if(U.inside){Qt=!0,gt||(gt=Date.now());let I={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"}[U.toolName]||U.toolName,ne=U.args||"",l=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(I)){let Q=K(ne),L=Q.basename||Q.name||Q.path||Q.targetFile||Q.TargetFile||Q.directory||Q.file,yt=Q.keyword,
|
|
753
|
-
`).length;Ne=H,!we&&!Z&&H>800?Re=Math.min(50,H):Re=Math.min(z,H)}}catch{}let Rt=(d||"").toLowerCase(),Zt=Rt.endsWith(".pdf"),De=Rt.endsWith(".docx")||Rt.endsWith(".doc")||Rt.endsWith(".ppt")||Rt.endsWith(".pptx")||Rt.endsWith(".xls")||Rt.endsWith(".xlsx"),Qe=/\.(png|jpg|jpeg|webp|gif|bmp)$/.test(Rt);Zt||De?L=`${d.length>0?"\u2714":"\u2718"} ${d?`Analyzed: ${j.basename(d)}`:"Analyzed: File Not Found"}`:Qe?L=`${d.length>0?"\u2714":"\u2718"} ${d?`Processed: ${j.basename(d)}`:"Processed: File Not Found"}`:L=`${Ne!=="..."?"\u2714":"\u2718"} Read: ${d?`${j.basename(d)} \u2192 ${Ne!=="..."?`Lines ${F} - ${Re} of ${Ne}`:"File Not Found"}`:"File Not Found"}`}}else if(l==="list_files"||l==="read_folder"){let d=l==="list_files"?"List":"Browsed",O=K(w.args).path||null,Y=K(w.args).recurse||1;L=`${O?"\u2714":"\u2718"} ${d}: ${O?`${O==="."?`./${Y>1?"*":""}`:`${O.replaceAll("\\","/")}${Y>1?`${O.endsWith("/")?"*":"/*"}`:`${O.endsWith("/")?"":"/"}`}`}`:"No Folder Selected"}`}else if(l==="find_file"){let d=K(w.args),O=d.basename||d.name||d.path||d.file||d.query||"";L=`${O?"\u2714":"\u2718"} Located: ${O||"No Query"}`}else if(l==="write_file"||l==="update_file"){let d=l==="write_file"?"Created":"Edited",O=K(w.args),Y=O.path||null,ie=Object.entries(O).some(([ee,xe])=>ee.startsWith("searchContent")&&typeof xe=="string"&&xe.startsWith("^LINE:"))?"\u1361":":";L=`${Y?"\u2714":"\u2718"} ${d}${ie} ${Y?Y.replaceAll("\\","/"):"No File Changes"}`}else if(l==="write_pdf"){let d=K(w.args).path||null;L=`${d?"\u2714":"\u2718"} Generated: ${d.replaceAll("\\","/")||"No PDF Generated"}`}else if(l==="write_docx"){let d=K(w.args).path||null;L=`${d?"\u2714":"\u2718"} Generated: ${d.replaceAll("\\","/")||"No Docx Generated"}`}else if(l==="file_map"){let d=K(w.args).path;L=`${d?"\u2714":"\u2718"} Indexed: ${d.replaceAll("\\","/")?""+d:"File Not Found"}`}else if(l.toLowerCase()==="search_keyword"||l.toLowerCase()==="todo")L="";else if(l.toLowerCase()==="generate_image"){let{path:d,outputPath:O,output:Y}=K(w.args);L=`\u2714 Generated: ${d||O||Y||"generated_image.png"}`}else if(l==="invoke_sync"||l==="InvokeSync"){let d=Jn(l,w.args);L=`\u2714 Called Generalist${d?`: ${d}`:""}`}else if(l==="Invoke"||l==="InvokeAsync"||l==="invoke"){let d=Jn(l,w.args);L=`\u2714 Started Generalist${d?`: ${d}`:""}`}else if(l==="get_progress"||l==="GetProgress"){let d=Jn(l,w.args);L=`\u2714 Checked${d?`: ${d}`:""}`}else if(l==="cancel"){let d=Jn(l,w.args);L=`\u{1F6C7} Cancelled${d?`: ${d}`:""}`}else if(l==="steer"||l==="Steer"){let d=Jn(l,w.args);L=`\u2714 Steered${d?`: ${d}`:""}`}else if(l==="EmergencyRollback"){let{method:d}=K(w.args);L=d==="forceRevert"?"":"\u2714 Rollback Point Checked"}else if(l==="await"||l==="Await"||l==="wait"||l==="Wait"){let{time:d,timeout:O,seconds:Y,sec:me}=K(w.args),ie=parseFloat(Y||me||O||d)||45,ee=l==="wait"||l==="Wait"?120:180;ie<10&&(ie=10),ie>ee&&(ie=ee);let xe=F=>{if(F>=60){let z=Math.floor(F/60),Ne=F%60;return`${z}m${Ne>0?` ${Ne}s`:""}`}return`${F}s`},we=["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"];L=`\u2714 ${we[Math.floor(Math.random()*we.length)]} \u2192 ${xe(ie)}`}else l==="Answer"||l==="answer"?L="\u2714 Resolved Sub-Agent Query":l==="exec_command"||l==="ask"?L="":L=`Executed: ${w.toolName}`;if(yield*Kn(),l==="exec_command"){let{command:d}=K(w.args);if(d&&t.systemSettings&&t.systemSettings.allowExternalAccess===!1){let O=[/[a-zA-Z]:[\\\/]/i,/^\//,/\.\.[\\\/]/,/\/etc\//,/\/var\//,/\/root\//,/\/bin\//,/\/usr\//],Y=j.resolve(process.cwd()).substring(0,3).toLowerCase(),me=Z=>{let F=[],z="",Ne=null;for(let Re=0;Re<Z.length;Re++){let se=Z[Re];Ne?(se===Ne&&(Ne=null),z+=se):se==='"'||se==="'"?(Ne=se,z+=se):se==="&"&&Z[Re+1]==="&"||se==="|"&&Z[Re+1]==="|"?(z.trim()&&(F.push(z.trim()),z=""),Re++):se===";"||se==="|"||se==="&"?z.trim()&&(F.push(z.trim()),z=""):z+=se}return z.trim()&&F.push(z.trim()),F},ie=Z=>{let F=[],z="",Ne=null;for(let Re=0;Re<Z.length;Re++){let se=Z[Re];Ne?(se===Ne&&(Ne=null),z+=se):se==='"'||se==="'"?(Ne=se,z+=se):/\s/.test(se)?z&&(F.push(z),z=""):z+=se}return z&&F.push(z),F},ee=Z=>{let F=Z.replace(/^['"]|['"]$/g,"").trim();return!F||process.platform==="win32"&&/^\/[a-zA-Z0-9?]+$/.test(F)?!1:O.some(z=>{if(z.source==="[a-zA-Z]:[\\\\\\/]"){let Ne=F.match(/[a-zA-Z]:[\\\/]/i);return Ne&&Ne[0].toLowerCase()!==Y}return z.test(F)})};if(me(d).some(Z=>{let F=ie(Z);if(F.length===0)return!1;let z=F[0].replace(/^['"]|['"]$/g,"").toLowerCase();if(["echo","printf","write-output"].includes(z)){let Re=!1;return F.some(se=>{let Lt=se.replace(/^['"]|['"]$/g,"");if(Lt===">"||Lt===">>"||Lt==="<")return Re=!0,!1;if(Lt.startsWith(">")||Lt.startsWith("<")){let Rt=Lt.replace(/^[><]+/,"");return ee(Rt)}return Re?(Re=!1,ee(se)):!1})}return F.some(Re=>ee(Re))})){let Z='Access Denied. Prohibited from accessing external directories while "External Workspace Access" is disabled.';t.onExecStart&&t.onExecStart(d||"No Command"),yield{type:"exec_start"},await new Promise(F=>setTimeout(F,50)),t.onExecChunk&&t.onExecChunk(`ERROR: ${Z}`),await new Promise(F=>setTimeout(F,50)),t.onExecEnd&&t.onExecEnd(),je.push({role:"user",text:`[ACTION RESULT]: ERROR: ${Z}`}),yield{type:"tool_result",content:`[ACTION RESULT]: ERROR: ${Z}`},kt++;continue}}t.onExecStart&&t.onExecStart(d||"No Command"),yield{type:"exec_start"}}let yt=K(w.args),
|
|
752
|
+
\x1B[33m\u24D8 Request Cancelled\x1B[0m`};break}if(v){if(lt){if(Ie+=v,Ie.length>=64){let w=0,I=Math.min(Tt.length,Ie.length);for(let l=I;l>=10;l--)if(Tt.endsWith(Ie.substring(0,l))){w=l;break}let ne=Ie.substring(w);if(ne){let $e=/(?:<think_fluxflow>|\[think_fluxflow\])(?:(?!(?:<\/think_fluxflow>|\[\/think_fluxflow\]))[\s\S])*$/i.test(Tt)?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(ue+=$e,s==="Google")Ft+=$e;else{yield*Kn();let Q=ho($e);for(let L of Q)yield L}}lt=!1,Ie=""}continue}else if(ue+=v,s==="Google")Ft+=v;else{yield*Kn();let w=ho(v);for(let I of w)yield I}let U=ml(ue);if(U.inside){Qt=!0,gt||(gt=Date.now());let I={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"}[U.toolName]||U.toolName,ne=U.args||"",l=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(I)){let Q=K(ne),L=Q.basename||Q.name||Q.path||Q.targetFile||Q.TargetFile||Q.directory||Q.file,yt=Q.keyword,En=Q.title||Q.task,Bt=Q.id||Q.taskId,oe=Q.timeout||Q.time||Q.seconds||Q.sec;if(yt!=null)l=String(yt).replace(vn,"");else if(L)l=j.basename(String(L).replace(vn,"").replace(qr,"/"));else if(En&&(I==="invoke"||I==="invoke_sync"))l=String(En).replace(vn,"").substring(0,30);else if(Bt&&I==="get_progress")l=String(Bt).replace(vn,"");else if(oe&&I==="await"){let Xe=parseFloat(String(oe).replace(vn,""));isNaN(Xe)?l=String(oe).replace(vn,""):(Xe<5&&(Xe=5),Xe>120&&(Xe=180),l=(Ut=>{if(Ut>=60){let xo=Math.floor(Ut/60),Cn=Ut%60;return`${xo}m${Cn>0?` ${Cn}s`:""}`}return`${Ut}s`})(Xe))}else if(oe&&I==="wait"){let Xe=parseFloat(String(oe).replace(vn,""));isNaN(Xe)?l=String(oe).replace(vn,""):(Xe<10&&(Xe=10),Xe>120&&(Xe=120),l=(Ut=>{if(Ut>=60){let xo=Math.floor(Ut/60),Cn=Ut%60;return`${xo}m${Cn>0?` ${Cn}s`:""}`}return`${Ut}s`})(Xe))}else{let Xe=ne.match(ol);if(Xe){let xt=Xe[1].replace(vn,"");I==="invoke"||I==="invoke_sync"||I==="get_progress"?l=xt.substring(0,30):l=I==="search_keyword"||I==="file_map"?xt:j.basename(xt.replace(qr,"/"))}}}let $e=`${us[I]||I}${l?` ${l}`:""}`;if((I!==$||l!==Be)&&($=I,Be=l,yield{type:"status",content:`${$e}`},process.stdout.isTTY)){let L={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"}[I]||"Working";process.stdout.write(`\x1B]0;${L}...\x07`)}}if(ue.length-to>800){to=ue.length;let w=oa(ue,!1),I=fs(w),ne=I?(I.innerContent||"").trim():"",l=ne.split(/[.!?]\s+/).filter(ye=>ye.trim().length>10),$e=new Set(l),Q=l.length>25?(l.length-$e.size)/l.length:0,L=ne.split(/\s+/).filter(ye=>ye.length>0).length,yt=.9,En=.92,Bt=!1;if(s.toLowerCase().includes("google")&&(te||"").toLowerCase().startsWith("gemma")){let d={low:2048,medium:4096,high:32768,max:65536,xhigh:65536}[c?.toLowerCase()]||16e3;Bt=L>d}if(Q>yt||Bt){yield{type:"status",content:`${Q>yt?"Reasoning Loop Detected":"Thinking Budget Exceeded"}. Re-centering...`},Dt=!0,await new Promise(d=>setTimeout(d,3e3));break}let xt=Zr(ue).trim().split(/[.!?]\s+/).filter(ye=>ye.trim().length>10),Ut=new Set(xt);if((xt.length>25?(xt.length-Ut.size)/xt.length:0)>En){yield{type:"status",content:"Response Loop Detected. Re-centering..."},Dt=!1,Yt=!0,await new Promise(ye=>setTimeout(ye,3e3));break}let Cn=w.replace(Xa,"").replace(Ja,"").replace(Qa,"").replace(Za,""),Ct=Cn.toLowerCase().split(/\s+/).map(ye=>ye.replace(el,"")).filter(ye=>ye.length>0),mn=!1;if(Ct.length>=40)for(let ye=1;ye<=15;ye++){let d=Math.max(8,Math.ceil(25/ye));if(Ct.length<ye*d)continue;let O=Ct.slice(Ct.length-ye),Y=O.join(" ");if(ye>1&&Y===O.slice(0,Math.floor(ye/2)).join(" ").repeat(2).trim())continue;let me=!0;for(let ie=1;ie<d;ie++)if(Ct.slice(Ct.length-ye*(ie+1),Ct.length-ye*ie).join(" ")!==Y){me=!1;break}if(me){mn=!0;break}}if(!mn){let ye=Cn.toLowerCase().replace(tl,"");if(ye.length>=80)for(let d=1;d<=10;d++){let O=Math.max(15,Math.ceil(45/d));if(ye.length<d*O)continue;let Y=ye.substring(ye.length-d),me=!0;for(let ie=1;ie<O;ie++)if(ye.substring(ye.length-d*(ie+1),ye.length-d*ie)!==Y){me=!1;break}if(me){mn=!0;break}}}if(mn){yield{type:"status",content:"Stuttering Detected. Re-centering..."},Dt=!1,Hn=!0,await new Promise(ye=>setTimeout(ye,3e3));break}}let J=Ht(ue),ht=Qn(J);for(;ht.length>kt;){yield*Kn();let w=ht[kt],I=Date.now(),l={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"}[w.toolName]||w.toolName,$e=us[l]||w.toolName,Q=Jn(l,w.args);yield{type:"status",content:`${$e}${Q?` ${Q}`:""}`};let L="";if(l==="click"){let d=K(w.args);L=`\u2714 Clicked ${d.intendedClickText?`: ${d.intendedClickText}`:"Screen"}`}else if(l==="drag"){let d=K(w.args);L=`\u2714 Dragged: Cell ${d.fromGridId||""} \u2192 Cell ${d.toGridId||""}`}else if(l==="scroll"){let d=K(w.args);L=`\u2714 Scrolled: ${d.direction||"down"} (${d.amount||1})`}else if(l==="keyboard_typing"){let d=K(w.args);L=`\u2714 ${d.autoPressEnter?"Entered":"Typed"}: ${d.text?`"${d.text.length>20?d.text.substring(0,20)+"...":d.text}"`:""}`}else if(l==="key_press")L=`\u2714 Pressed Key: ${K(w.args).key||""}`;else if(l==="recapture_screen")L="\u2714 Recaptured Screen";else if(l==="web_search"){let{query:d,limit:O=10,aiMode:Y=!1}=K(w.args);L=`${d?"\u2714":"\u2718"} ${Y?"AI Search":"Searched"}: ${d?`${d}`:"No Search Query"}${Y===!1&&d?` \u2192 ${O}`:""}`}else if(l==="web_scrape"){let d=K(w.args).url||null;L=`${d?"\u2714":"\u2718"} Visited: ${d||"No Source"}`}else if(l==="view_file"){let{path:d,StartLine:O,EndLine:Y,start_line:me,end_line:ie,startLine:ee,endLine:xe}=K(w.args),we=O||me||ee,Z=Y||ie||xe,F=parseInt(we)||1,z=parseInt(Z)||(we?F+800:800),Ne="...",Re=z,se=(d||"").trim().toLowerCase().replaceAll("\\","/");if(se.startsWith("#skill"))se.startsWith("#skill/global/fluxflow")||se.startsWith("#skills/global/fluxflow")||se.includes("#skill/fluxflow")||se.includes("#skills/fluxflow")?L="\u2714 Read Documentation":L=`\u2714 Read Skill: ${j.basename(d.replaceAll("\\","/"))}`;else{try{let pe=j.resolve(process.cwd(),d);if(Te.existsSync(pe)){let H=Te.readFileSync(pe,"utf8").split(`
|
|
753
|
+
`).length;Ne=H,!we&&!Z&&H>800?Re=Math.min(50,H):Re=Math.min(z,H)}}catch{}let Rt=(d||"").toLowerCase(),Zt=Rt.endsWith(".pdf"),De=Rt.endsWith(".docx")||Rt.endsWith(".doc")||Rt.endsWith(".ppt")||Rt.endsWith(".pptx")||Rt.endsWith(".xls")||Rt.endsWith(".xlsx"),Qe=/\.(png|jpg|jpeg|webp|gif|bmp)$/.test(Rt);Zt||De?L=`${d.length>0?"\u2714":"\u2718"} ${d?`Analyzed: ${j.basename(d)}`:"Analyzed: File Not Found"}`:Qe?L=`${d.length>0?"\u2714":"\u2718"} ${d?`Processed: ${j.basename(d)}`:"Processed: File Not Found"}`:L=`${Ne!=="..."?"\u2714":"\u2718"} Read: ${d?`${j.basename(d)} \u2192 ${Ne!=="..."?`Lines ${F} - ${Re} of ${Ne}`:"File Not Found"}`:"File Not Found"}`}}else if(l==="list_files"||l==="read_folder"){let d=l==="list_files"?"List":"Browsed",O=K(w.args).path||null,Y=K(w.args).recurse||1;L=`${O?"\u2714":"\u2718"} ${d}: ${O?`${O==="."?`./${Y>1?"*":""}`:`${O.replaceAll("\\","/")}${Y>1?`${O.endsWith("/")?"*":"/*"}`:`${O.endsWith("/")?"":"/"}`}`}`:"No Folder Selected"}`}else if(l==="find_file"){let d=K(w.args),O=d.basename||d.name||d.path||d.file||d.query||"";L=`${O?"\u2714":"\u2718"} Located: ${O||"No Query"}`}else if(l==="write_file"||l==="update_file"){let d=l==="write_file"?"Created":"Edited",O=K(w.args),Y=O.path||null,ie=Object.entries(O).some(([ee,xe])=>ee.startsWith("searchContent")&&typeof xe=="string"&&xe.startsWith("^LINE:"))?"\u1361":":";L=`${Y?"\u2714":"\u2718"} ${d}${ie} ${Y?Y.replaceAll("\\","/"):"No File Changes"}`}else if(l==="write_pdf"){let d=K(w.args).path||null;L=`${d?"\u2714":"\u2718"} Generated: ${d.replaceAll("\\","/")||"No PDF Generated"}`}else if(l==="write_docx"){let d=K(w.args).path||null;L=`${d?"\u2714":"\u2718"} Generated: ${d.replaceAll("\\","/")||"No Docx Generated"}`}else if(l==="file_map"){let d=K(w.args).path;L=`${d?"\u2714":"\u2718"} Indexed: ${d.replaceAll("\\","/")?""+d:"File Not Found"}`}else if(l.toLowerCase()==="search_keyword"||l.toLowerCase()==="todo")L="";else if(l.toLowerCase()==="generate_image"){let{path:d,outputPath:O,output:Y}=K(w.args);L=`\u2714 Generated: ${d||O||Y||"generated_image.png"}`}else if(l==="invoke_sync"||l==="InvokeSync"){let d=Jn(l,w.args);L=`\u2714 Called Generalist${d?`: ${d}`:""}`}else if(l==="Invoke"||l==="InvokeAsync"||l==="invoke"){let d=Jn(l,w.args);L=`\u2714 Started Generalist${d?`: ${d}`:""}`}else if(l==="get_progress"||l==="GetProgress"){let d=Jn(l,w.args);L=`\u2714 Checked${d?`: ${d}`:""}`}else if(l==="cancel"){let d=Jn(l,w.args);L=`\u{1F6C7} Cancelled${d?`: ${d}`:""}`}else if(l==="steer"||l==="Steer"){let d=Jn(l,w.args);L=`\u2714 Steered${d?`: ${d}`:""}`}else if(l==="EmergencyRollback"){let{method:d}=K(w.args);L=d==="forceRevert"?"":"\u2714 Rollback Point Checked"}else if(l==="await"||l==="Await"||l==="wait"||l==="Wait"){let{time:d,timeout:O,seconds:Y,sec:me}=K(w.args),ie=parseFloat(Y||me||O||d)||45,ee=l==="wait"||l==="Wait"?120:180;ie<10&&(ie=10),ie>ee&&(ie=ee);let xe=F=>{if(F>=60){let z=Math.floor(F/60),Ne=F%60;return`${z}m${Ne>0?` ${Ne}s`:""}`}return`${F}s`},we=["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"];L=`\u2714 ${we[Math.floor(Math.random()*we.length)]} \u2192 ${xe(ie)}`}else l==="Answer"||l==="answer"?L="\u2714 Resolved Sub-Agent Query":l==="exec_command"||l==="ask"?L="":L=`Executed: ${w.toolName}`;if(yield*Kn(),l==="exec_command"){let{command:d}=K(w.args);if(d&&t.systemSettings&&t.systemSettings.allowExternalAccess===!1){let O=[/[a-zA-Z]:[\\\/]/i,/^\//,/\.\.[\\\/]/,/\/etc\//,/\/var\//,/\/root\//,/\/bin\//,/\/usr\//],Y=j.resolve(process.cwd()).substring(0,3).toLowerCase(),me=Z=>{let F=[],z="",Ne=null;for(let Re=0;Re<Z.length;Re++){let se=Z[Re];Ne?(se===Ne&&(Ne=null),z+=se):se==='"'||se==="'"?(Ne=se,z+=se):se==="&"&&Z[Re+1]==="&"||se==="|"&&Z[Re+1]==="|"?(z.trim()&&(F.push(z.trim()),z=""),Re++):se===";"||se==="|"||se==="&"?z.trim()&&(F.push(z.trim()),z=""):z+=se}return z.trim()&&F.push(z.trim()),F},ie=Z=>{let F=[],z="",Ne=null;for(let Re=0;Re<Z.length;Re++){let se=Z[Re];Ne?(se===Ne&&(Ne=null),z+=se):se==='"'||se==="'"?(Ne=se,z+=se):/\s/.test(se)?z&&(F.push(z),z=""):z+=se}return z&&F.push(z),F},ee=Z=>{let F=Z.replace(/^['"]|['"]$/g,"").trim();return!F||process.platform==="win32"&&/^\/[a-zA-Z0-9?]+$/.test(F)?!1:O.some(z=>{if(z.source==="[a-zA-Z]:[\\\\\\/]"){let Ne=F.match(/[a-zA-Z]:[\\\/]/i);return Ne&&Ne[0].toLowerCase()!==Y}return z.test(F)})};if(me(d).some(Z=>{let F=ie(Z);if(F.length===0)return!1;let z=F[0].replace(/^['"]|['"]$/g,"").toLowerCase();if(["echo","printf","write-output"].includes(z)){let Re=!1;return F.some(se=>{let Lt=se.replace(/^['"]|['"]$/g,"");if(Lt===">"||Lt===">>"||Lt==="<")return Re=!0,!1;if(Lt.startsWith(">")||Lt.startsWith("<")){let Rt=Lt.replace(/^[><]+/,"");return ee(Rt)}return Re?(Re=!1,ee(se)):!1})}return F.some(Re=>ee(Re))})){let Z='Access Denied. Prohibited from accessing external directories while "External Workspace Access" is disabled.';t.onExecStart&&t.onExecStart(d||"No Command"),yield{type:"exec_start"},await new Promise(F=>setTimeout(F,50)),t.onExecChunk&&t.onExecChunk(`ERROR: ${Z}`),await new Promise(F=>setTimeout(F,50)),t.onExecEnd&&t.onExecEnd(),je.push({role:"user",text:`[ACTION RESULT]: ERROR: ${Z}`}),yield{type:"tool_result",content:`[ACTION RESULT]: ERROR: ${Z}`},kt++;continue}}t.onExecStart&&t.onExecStart(d||"No Command"),yield{type:"exec_start"}}let yt=K(w.args),En=yt.path||yt.targetPath||null;if(En){let d=t.systemSettings&&t.systemSettings.allowExternalAccess===!1,O=j.resolve(En),Y=j.resolve(process.cwd());if(d&&!O.startsWith(Y)){let me="Access Denied. You are not allowed to access files outside the current workspace.";if(l==="write_file"||l==="update_file"){let ee=`\u2718 ${l==="write_file"?"Write Canceled":"Edit Canceled"}: ${yt.path||"..."}`,xe=115;process.stdout.isTTY&&(xe=process.stdout.columns-5||120);let we=Math.min(ee.length+4,xe),Z=`${ee.padEnd(we-2).substring(0,we-2)}`;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
754
754
|
`:""}${Z}
|
|
755
|
-
`)},Ke=!1}je.push({role:"user",text:`[ACTION RESULT]: ERROR: ${me}`}),yield{type:"tool_result",content:`[ACTION RESULT]: ERROR: ${me}`},kt++;continue}}if(t.onToolApproval){let d=t.systemSettings||{},O=d.autoExec,Y=!1,me="";if(l==="view_file"){let ee=K(w.args);if(me=ee.path||ee.targetPath||ee.file||"",me){let xe=d.alwaysAskFiles||".env, .env.*, *.env";_s(me,xe)&&(Y=!0)}}if(l==="write_file"||l==="update_file"||l==="exec_command"||Y){let ee=null,xe=!1,we=!1,Z=!1;if(Y)xe=!0,ee=null;else if(l==="exec_command"){let{command:De}=K(w.args),Qe=(De||"").trim(),pe=(en,zt)=>{if(!zt)return!1;let
|
|
755
|
+
`)},Ke=!1}je.push({role:"user",text:`[ACTION RESULT]: ERROR: ${me}`}),yield{type:"tool_result",content:`[ACTION RESULT]: ERROR: ${me}`},kt++;continue}}if(t.onToolApproval){let d=t.systemSettings||{},O=d.autoExec,Y=!1,me="";if(l==="view_file"){let ee=K(w.args);if(me=ee.path||ee.targetPath||ee.file||"",me){let xe=d.alwaysAskFiles||".env, .env.*, *.env";_s(me,xe)&&(Y=!0)}}if(l==="write_file"||l==="update_file"||l==="exec_command"||Y){let ee=null,xe=!1,we=!1,Z=!1;if(Y)xe=!0,ee=null;else if(l==="exec_command"){let{command:De}=K(w.args),Qe=(De||"").trim(),pe=(en,zt)=>{if(!zt)return!1;let ln=zt.split(",").map(qt=>qt.trim().toLowerCase()).filter(Boolean),nt=en.toLowerCase();return ln.some(qt=>nt.startsWith(qt))},Ye=pe(Qe,d.alwaysAskCommands),H=pe(Qe,d.autoApproveCommands);if(we=pe(Qe,d.autoDisallowCommands),Ye?xe=!0:(H||d.autoApproveGit&&/^git\s+commit\b/i.test(Qe))&&(ee="allow"),!xe&&!ee){if(d.networkAccess===!1){let zt=Qe.trim().replace(/\s+/g," ").replace(/^['"]+|['"]+$/g,"").toLowerCase().split(" "),nt=zt[0].split("/").pop().split("\\").pop().replace(/\.exe$/,""),qt=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"]),ot=!1;qt.has(nt)&&(ot=!0);let Ze=On=>zt.slice(1).some(Rn=>On.includes(Rn)),dt=On=>{let Rn=zt.findIndex(_n=>On.includes(_n)),Yn=zt.findIndex(_n=>["run","exec","test"].includes(_n));return Rn!==-1&&!(Yn!==-1&&Yn<Rn)};nt==="git"&&Ze(["clone","pull","push","fetch"])&&(ot=!0),nt==="go"&&Ze(["get","install"])&&(ot=!0),nt==="npm"&&dt(["install","i","update","add"])&&(ot=!0),nt==="yarn"&&dt(["add","install","upgrade"])&&(ot=!0),nt==="pnpm"&&dt(["add","install","update"])&&(ot=!0),nt==="bun"&&dt(["add","install","update"])&&(ot=!0),nt==="deno"&&Ze(["install","add"])&&(ot=!0),nt==="pip"&&Ze(["install","download"])&&(ot=!0),nt==="pip3"&&Ze(["install","download"])&&(ot=!0),nt==="cargo"&&Ze(["install","add"])&&(ot=!0),["bash","sh","zsh","fish"].includes(nt)&&Ze(["-c"])&&(ot=!0),nt==="cmd"&&Ze(["/c"])&&(ot=!0),ot&&(ee="deny",Z=!0)}!ee&&we&&(ee="deny")}!xe&&!ee&&O&&(ee="allow")}else(l==="write_file"||l==="update_file")&&O&&(ee="allow");let F=ee,z="";ee==="deny"&&(Z?z="network":we?z="settings":z="prohibited");let Ne=!1,Re="",se=[],Lt=0,Rt=!1,Zt="";if(!F&&t.onToolApproval)try{let De=await t.onToolApproval(l,w.args,{checkOnly:!0});(De==="allow"||De==="deny")&&(F=De,F==="deny"&&(z="user"))}catch{}if(!F){if(l==="write_file"||l==="update_file")try{let pe=K(w.args),{path:Ye}=pe;if(Ye){let H=j.resolve(process.cwd(),Ye),en=Ze=>Ze?Ze.toLowerCase().replace(/\\/g,"/").replace(/^[a-z]:/,dt=>dt.toUpperCase()):"",zt=en(H),ln="",nt=!1,qt=await qn(),ot=en(qt?.file_focused);if(qt&&ot===zt&&qt.full_content?(ln=qt.full_content,nt=!0):Te.existsSync(H)&&(ln=Te.readFileSync(H,"utf8"),nt=!0),Re=ln,await ti.recordFileChange(H,ln),nt){let Ze=ln;if(l==="write_file"){let dt=pe.content||pe.newContent||"";Ze=dt.endsWith(`
|
|
756
756
|
`)?dt:dt+`
|
|
757
|
-
`,Zt=Ze}else{let{patchPairs:dt,allowMultiple:On,error:
|
|
757
|
+
`,Zt=Ze}else{let{patchPairs:dt,allowMultiple:On,error:Rn}=Ni(pe);if(Rn){let tn=`[ACTION RESULT]: ERROR: ${Rn}`;je.push({role:"user",text:tn}),await vt("toolFailure"),t.onToolResult&&t.onToolResult("failure",l),yield{type:"tool_result",content:tn,toolName:l},kt++;continue}let Yn=pe.allowMultiple!==void 0?pe.allowMultiple===!0||String(pe.allowMultiple).toLowerCase()==="true":On;Lt=dt.length;let _n=Is(ln,dt,{allowMultiple:Yn});Ze=_n.content,Zt=Ze,se=_n.results;let zo=se.filter(tn=>tn.success),Ri=se.filter(tn=>!tn.success);if(zo.length===0){let tn=`[ACTION RESULT]: ERROR: Failed to apply patches to [${j.basename(H)}].
|
|
758
758
|
${Ri.map(et=>` \u2022 ${et.error}`).join(`
|
|
759
|
-
`)}`,_i=`\u2714 Edited: ${j.basename(H.replaceAll("\\","/"))}`,
|
|
760
|
-
`:""}${it}`)},Ke=!1,je.push({role:"user",text:tn}),await vt("toolFailure"),t.onToolResult&&t.onToolResult("failure",l),yield{type:"tool_result",content:tn,toolName:l},kt++;continue}}yield{type:"status",content:`Opening Diff in IDE: ${j.basename(H)}`},ji(H,
|
|
759
|
+
`)}`,_i=`\u2714 Edited: ${j.basename(H.replaceAll("\\","/"))}`,cn=115;process.stdout.isTTY&&(cn=process.stdout.columns-5||120);let Ln=Math.min(_i.length+4,cn),it=`${_i.padEnd(Ln-2).substring(0,Ln-2)}`;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
760
|
+
`:""}${it}`)},Ke=!1,je.push({role:"user",text:tn}),await vt("toolFailure"),t.onToolResult&&t.onToolResult("failure",l),yield{type:"tool_result",content:tn,toolName:l},kt++;continue}}yield{type:"status",content:`Opening Diff in IDE: ${j.basename(H)}`},ji(H,ln,Ze),Ne=!0,await new Promise(dt=>setTimeout(dt,50))}else if(l==="write_file"){let Ze=pe.content||pe.newContent||"",dt=Ze.endsWith(`
|
|
761
761
|
`)?Ze:Ze+`
|
|
762
|
-
`;Zt=dt,Te.existsSync(H)||(Rt=!0,Te.mkdirSync(j.dirname(H),{recursive:!0}),Te.writeFileSync(H,"","utf8")),yield{type:"status",content:`Opening New File Diff in IDE: ${j.basename(H)}`},ji(H,"",dt),Ne=!0,await new Promise(On=>setTimeout(On,50))}}}catch(pe){console.error("Simulation/Diff Error:",pe)}let De=null;Hi(pe=>{De=pe});let Qe=t.onToolApproval;if(F=await new Promise(async pe=>{let Ye=setInterval(()=>{if(De){let H=t.onIDEApproval||Wo&&Wo.onIDEApproval;H&&H(De),clearInterval(Ye),pe(De)}},100);try{let H=await Qe(l,w.args);clearInterval(Ye),pe(H)}catch{clearInterval(Ye),pe("deny")}}),Hi(null),l==="write_file"||l==="update_file"){let{path:pe}=K(w.args);if(pe){let Ye=j.resolve(process.cwd(),pe);if(nr(Ye,F),F==="deny"&&Rt&&Te.existsSync(Ye))try{Te.unlinkSync(Ye)}catch{}}}F==="deny"&&(z="user")}if(F==="allow"&&Ne&&fo()){let{path:De}=K(w.args),Qe=j.resolve(process.cwd(),De),pe=it=>it?j.resolve(it).replace(/\\/g,"/").toLowerCase():"",Ye=await qn(),H="";if(Ye&&Ye.file_focused&&pe(Ye.file_focused)===pe(Qe)&&Ye.full_content&&(H=Ye.full_content),!H&&Te.existsSync(Qe)){let it=Te.readFileSync(Qe,"utf8");it&&(H=it)}!H&&Zt&&(H=Zt),(H||Rt)&&Te.writeFileSync(Qe,H,"utf8");let en=H.split(/\r?\n/),zt=en.length,
|
|
763
|
-
${Re.split(/\r?\n/).map((et,
|
|
762
|
+
`;Zt=dt,Te.existsSync(H)||(Rt=!0,Te.mkdirSync(j.dirname(H),{recursive:!0}),Te.writeFileSync(H,"","utf8")),yield{type:"status",content:`Opening New File Diff in IDE: ${j.basename(H)}`},ji(H,"",dt),Ne=!0,await new Promise(On=>setTimeout(On,50))}}}catch(pe){console.error("Simulation/Diff Error:",pe)}let De=null;Hi(pe=>{De=pe});let Qe=t.onToolApproval;if(F=await new Promise(async pe=>{let Ye=setInterval(()=>{if(De){let H=t.onIDEApproval||Wo&&Wo.onIDEApproval;H&&H(De),clearInterval(Ye),pe(De)}},100);try{let H=await Qe(l,w.args);clearInterval(Ye),pe(H)}catch{clearInterval(Ye),pe("deny")}}),Hi(null),l==="write_file"||l==="update_file"){let{path:pe}=K(w.args);if(pe){let Ye=j.resolve(process.cwd(),pe);if(nr(Ye,F),F==="deny"&&Rt&&Te.existsSync(Ye))try{Te.unlinkSync(Ye)}catch{}}}F==="deny"&&(z="user")}if(F==="allow"&&Ne&&fo()){let{path:De}=K(w.args),Qe=j.resolve(process.cwd(),De),pe=it=>it?j.resolve(it).replace(/\\/g,"/").toLowerCase():"",Ye=await qn(),H="";if(Ye&&Ye.file_focused&&pe(Ye.file_focused)===pe(Qe)&&Ye.full_content&&(H=Ye.full_content),!H&&Te.existsSync(Qe)){let it=Te.readFileSync(Qe,"utf8");it&&(H=it)}!H&&Zt&&(H=Zt),(H||Rt)&&Te.writeFileSync(Qe,H,"utf8");let en=H.split(/\r?\n/),zt=en.length,ln=Buffer.byteLength(H,"utf8"),nt="";Re&&(nt=`Old File contents:
|
|
763
|
+
${Re.split(/\r?\n/).map((et,dn)=>`${dn+1} | ${et}`).join(`
|
|
764
764
|
`)}
|
|
765
765
|
|
|
766
766
|
`);let qt="";if(zt<=100)qt=en.join(`
|
|
@@ -770,13 +770,13 @@ ${Re.split(/\r?\n/).map((et,ln)=>`${ln+1} | ${et}`).join(`
|
|
|
770
770
|
|
|
771
771
|
... [${zt-100} lines truncated for history stability] ...
|
|
772
772
|
|
|
773
|
-
${et}`}let ot="";if(l==="update_file"){let it=Ms(Re,H,se,12,t?.compressToolResults||Wo?.systemSettings?.compressToolResults),{patchPairs:et}=Ni(K(w.args)),
|
|
773
|
+
${et}`}let ot="";if(l==="update_file"){let it=Ms(Re,H,se,12,t?.compressToolResults||Wo?.systemSettings?.compressToolResults),{patchPairs:et}=Ni(K(w.args)),dn=et?.length||Lt||1,$n=0,Xt=0,so=[];et&&et.length>0?et.forEach((ro,vi)=>{let qo=ro.replace||"",fn=ro.new||"",Ii=qo.trim(),wo=fn.trim(),Ta=!!Zt&&H===Zt,Aa=wo?H.includes(fn)||H.includes(wo):!0,Ea=fn?Re.includes(fn)||!!wo&&Re.includes(wo):!1,Ca=Ii?H.includes(qo)||H.includes(Ii):!1;Ta||!!fn&&Aa&&(!Ea||!Ca||Ii===wo)?$n++:(Xt++,so.push(` \u2022 Block ${vi+1}: not applied (reverted or rejected in IDE).`))}):$n=Lt||0;let Nn=0;if(Zt&&H!==Zt){let ro=za("","",Zt||"",H||"","","",{context:0});if(ro&&ro.hunks)for(let vi of ro.hunks){let qo=vi.lines.filter(fn=>fn.startsWith("+")).map(fn=>fn.slice(1).trim()).filter(Boolean);for(let fn of qo)Re.includes(fn)||Nn++}}let bo=[`[${$n}/${dn}] applied`];Xt>0&&bo.push(`${Xt} rejected by user`),Nn>0&&bo.push(`${Nn} manual ${Nn===1?"modification":"modifications"} by user`);let Sa=bo.join(", "),ka=so.length>0?`
|
|
774
774
|
|
|
775
775
|
User Review Details:
|
|
776
776
|
${so.join(`
|
|
777
777
|
`)}`:"";ot=`File [${De}] updated via IDE Companion. ${Sa}.${ka}
|
|
778
778
|
|
|
779
|
-
${it}`}else{let it=H.split(/\r?\n/),et=it.length,
|
|
779
|
+
${it}`}else{let it=H.split(/\r?\n/),et=it.length,dn=Buffer.byteLength(H,"utf8"),$n="";Re&&($n=`Old File contents:
|
|
780
780
|
${Re.split(/\r?\n/).map((Nn,bo)=>`${bo+1} | ${Nn}`).join(`
|
|
781
781
|
`)}
|
|
782
782
|
|
|
@@ -788,22 +788,22 @@ ${Re.split(/\r?\n/).map((Nn,bo)=>`${bo+1} | ${Nn}`).join(`
|
|
|
788
788
|
... [${et-100} lines truncated] ...
|
|
789
789
|
|
|
790
790
|
${Nn}`}ot=`File [${De}] saved via IDE Companion (May have user edits).
|
|
791
|
-
- Stats: [${et} lines, ${(
|
|
791
|
+
- Stats: [${et} lines, ${(dn/1024).toFixed(1)} KB]
|
|
792
792
|
${$n}- Content Preview:
|
|
793
793
|
|
|
794
|
-
${Xt}`}let Ze=l==="write_file"?"Created":"Edited",dt=K(w.args),
|
|
795
|
-
`:""}${Ri}`)},Ke=!1;let tn=Date.now();
|
|
796
|
-
`));let Ln;if(l==="write_file"&&!
|
|
794
|
+
${Xt}`}let Ze=l==="write_file"?"Created":"Edited",dt=K(w.args),Rn=Object.entries(dt).some(([it,et])=>it.startsWith("searchContent")&&typeof et=="string"&&et.startsWith("^LINE:"))?"\u1361":":",Yn=`${De?"\u2714":"\u2718"} ${Ze}${Rn} ${De?De.replaceAll("\\","/"):"No File Changes"}`,_n=115;process.stdout.isTTY&&(_n=process.stdout.columns-5||120);let zo=Math.min(Yn.length+4,_n),Ri=`${Yn.padEnd(zo-2).substring(0,zo-2)}`;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
795
|
+
`:""}${Ri}`)},Ke=!1;let tn=Date.now();rn=tn,yield{type:"tool_time",content:tn-I};let cn=(ot||"").toString().replaceAll("\u2550".repeat(88),"=".repeat(35)).replaceAll("[UI_CONTEXT]","");cn.includes("[[VERIFIED]]")&&(cn=cn.replace(/\[\[VERIFIED\]\][\s\S]*?\[\[\/VERIFIED\]\]/g,`[SYSTEM NOTE]: Patch Block matched & applied successfully. Large Block omitted to conserve context.
|
|
796
|
+
`));let Ln;if(l==="write_file"&&!cn.startsWith("ERROR:")){let et=cn.replace(/^\[\[SAME\]\]\s*\r?\n?/,"").split(/\r?\n/),dn=et.filter(Xt=>Xt.startsWith("File ")||Xt.trim().startsWith("- Stats:"));Ln=`[ACTION RESULT]: ${dn.length>0?dn.join(`
|
|
797
797
|
`):et.slice(0,2).join(`
|
|
798
|
-
`)}`}else if(
|
|
798
|
+
`)}`}else if(cn.startsWith("[[SAME]]")){let et=cn.replace(/^\[\[SAME\]\]\s*\r?\n?/,"").split(/\r?\n/),dn=et.filter(Xt=>Xt.startsWith("File ")||Xt.trim().startsWith("- Stats:"));Ln=`[ACTION RESULT]: ${dn.length>0?dn.join(`
|
|
799
799
|
`):et.slice(0,2).join(`
|
|
800
|
-
`)}`}else Ln=`[ACTION RESULT]: ${
|
|
800
|
+
`)}`}else Ln=`[ACTION RESULT]: ${cn}`;je.push({role:"user",text:Ln}),Tn=!0,await vt("toolSuccess"),t.onToolResult&&t.onToolResult("success",l),yield{type:"tool_result",content:ot,aiContent:Ln,toolName:l},kt++;continue}if(F==="deny"){let De=`Permission Denied: Prohibited ${l==="exec_command"?"Command":"file edit"}.`;if(Y?De=`User denied reading ${j.basename(me||".env")}`:z==="user"?De="Permission Denied by User":z==="settings"?De="Permission Denied by User Policy":z==="network"?De="Permission Denied: Sandbox Network Access Disabled by User Policy.":z==="prohibited"&&l==="exec_command"&&(De="Permission Denied: Prohibited Command in User Policy"),l==="view_file"){let Qe=`\u2718 Read Denied: ${K(w.args).path?.replaceAll("\\","/")||".env"}`,pe=115;process.stdout.isTTY&&(pe=process.stdout.columns-5||120);let Ye=Math.min(Qe.length+4,pe),H=`${Qe.padEnd(Ye-2).substring(0,Ye-2)}`;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
801
801
|
`:""}${H}
|
|
802
802
|
`)},Ke=!1}else if(l==="write_file"||l==="update_file"){let pe=`\u2718 ${l==="write_file"?"Write Cancelled":"Edit Denied"}: ${K(w.args).path.replaceAll("\\","/")||"..."}`,Ye=115;process.stdout.isTTY&&(Ye=process.stdout.columns-5||120);let H=Math.min(pe.length+4,Ye),en=`${pe.padEnd(H-2).substring(0,H-2)}`,zt=` ${" ".repeat(H)} `;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
803
803
|
`:""}${en}
|
|
804
804
|
`)},Ke=!1}l==="exec_command"&&(await new Promise(Qe=>setTimeout(Qe,50)),t.onExecChunk&&t.onExecChunk(`ERROR: ${De}`),await new Promise(Qe=>setTimeout(Qe,50)),t.onExecEnd&&t.onExecEnd()),je.push({role:"user",text:`[ACTION RESULT]: DENIED: ${De}`}),yield{type:"tool_result",content:`[ACTION RESULT]: DENIED: ${De}`},await vt("toolDenied"),t.onToolResult&&t.onToolResult("denied",l),kt++;continue}}}if(L){let d=115;process.stdout.isTTY&&(d=process.stdout.columns-5||120);let O=await i(),Y=!1;O&&(Y=O.trim().length>0);let me=Math.min(L.length+4,d),ie=`${L.padEnd(me-2).substring(0,me-2)}`;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
805
805
|
`:""}${ie}${L.includes("\u2714")&&(L.includes("Created")||L.includes("Edited"))?"":`${Y?"":`
|
|
806
|
-
`}`}`)},Ke=!1}if(
|
|
806
|
+
`}`}`)},Ke=!1}if(rn>0){let d=Date.now()-rn,O=Math.max(0,1e3-d);O>0&&await new Promise(Y=>setTimeout(Y,O))}let Bt={chatId:p,history:n,onChunk:d=>t.onExecChunk?t.onExecChunk(d):null,onAskUser:t.onAskUser,systemSettings:t.systemSettings,mode:a,isMultiModal:st(te),onVisualFeedback:t.onVisualFeedback,onSubagentUpdate:t.onSubagentUpdate,onTokenChunk:t.onTokenChunk,modelName:te,aiProvider:t.aiProvider,apiKey:t.apiKey,onUsage:t.onUsage};if(l==="write_file"||l==="update_file")try{let{path:d}=K(w.args);if(d){let O=j.resolve(process.cwd(),d),Y=await qn();Y&&Y.file_focused===O&&Y.full_content&&(Bt.forcedContent=Y.full_content)}}catch{}Oe.push(l);let oe=await Do(l,w.args,Bt);if((l==="write_file"||l==="update_file")&&!oe.startsWith("ERROR:")){let{path:d}=K(w.args);if(d){let O=j.resolve(process.cwd(),d);tr(O)}}process.stdout.isTTY&&process.stdout.write("\x1B]0;Working...\x07");let Xe=Date.now();rn=Xe,yield{type:"tool_time",content:Xe-I},gt=Xe;let xt=null;if(typeof oe=="object"&&oe.binaryPart&&(xt=oe.binaryPart,oe=oe.text),l==="search_keyword"){let{keyword:d,path:O}=K(w.args),Y=typeof oe=="string"&&oe.startsWith("[GLOB]");Y&&(oe=oe.slice(6).trimStart());let me=typeof oe=="string"&&oe.startsWith("[DIR]");me&&(oe=oe.slice(5).trimStart());let ie=0;if(oe){let se=oe.match(/Found (\d+) match/i);se&&(ie=parseInt(se[1]))}let ee=(O||"").trim().toLowerCase().replaceAll("\\","/"),xe=ee==="#doc"||ee==="#docs"||ee==="#documentation"||ee.includes("#skill/global/fluxflow")||ee.includes("#skill/fluxflow")||ee.includes("#skills/fluxflow")||ee.includes("#skills/global/fluxflow"),we,Z=115;process.stdout.isTTY&&(Z=process.stdout.columns-5||120);let F=Math.max(10,(Z+5)/3),z=Math.max(10,(Z+5)/4);if(xe)we=`${d?"\u2714":"\u2718"} Searched Documentation`;else{let se=O?O.replace(/[\/\\]+$/,""):null,Lt=se&&se!=="."?`${Y?O:me?`${se}/*`:se}`:"./",Rt=Lt.length>z?`${Lt.slice(0,z)}...`:Lt;we=`${d?"\u2714":"\u2718"} Searched: "${d?d.length>Z/3?`${d.slice(0,F)}...`:d:""}" in "${Rt.replaceAll("\\","/")}" \u2192 ${ie} Match${ie===1?"":"es"}`}let Ne=Math.min(we.length+4,Z),Re=`${we.padEnd(Ne-2).substring(0,Ne-2)}`;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
807
807
|
`:""}${Re}
|
|
808
808
|
`)},Ke=!1}if(l==="EmergencyRollback"){let{method:d}=K(w.args);if(d==="forceRevert"){let O=0;if(oe){let F=oe.match(/Total\s*:\s*(\d+)/i);F&&(O=parseInt(F[1]))}let me=oe&&oe.startsWith("ERROR:")?"\u2718 Emergency Rollback Failed":`\u2714 Emergency Rollback \u2192 ${O} file${O===1?"":"s"} processed`,ie=115;process.stdout.isTTY&&(ie=process.stdout.columns-5||120);let ee=await i(),xe=!1;ee&&(xe=ee.trim().length>0);let we=Math.min(me.length+4,ie),Z=`${me.padEnd(we-2).substring(0,we-2)}`;yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
809
809
|
`:""}${Z}${xe?"":`
|
|
@@ -815,29 +815,29 @@ ${Xt}`}let Ze=l==="write_file"?"Created":"Edited",dt=K(w.args),Cn=Object.entries
|
|
|
815
815
|
`),we=await i(),Z=!1;we&&(Z=we.trim().length>0),yield{type:"visual_feedback",content:Gt(`${Ke?`
|
|
816
816
|
`:""}${xe}${Z?"":`
|
|
817
817
|
`}`)},Ke=!1}}l==="exec_command"&&t.onExecEnd&&(await new Promise(d=>setTimeout(d,800)),t.onExecEnd());let Ut=oe&&oe.startsWith("DENIED:");oe&&!oe.startsWith("ERROR:")&&!Ut?(await vt("toolSuccess"),t.onToolResult&&t.onToolResult("success",l)):Ut||(await vt("toolFailure"),t.onToolResult&&t.onToolResult("failure",l));let Ct=(oe||"").toString().replaceAll("\u2550".repeat(88),"=".repeat(35)).replaceAll("[UI_CONTEXT]","");Ct.includes("[[VERIFIED]]")&&(Ct=Ct.replace(/\[\[VERIFIED\]\][\s\S]*?\[\[\/VERIFIED\]\]/g,`[SYSTEM NOTE]: Patch Block matched & applied successfully. Large Block omitted to save tokens.
|
|
818
|
-
`));let
|
|
818
|
+
`));let mn;if(l==="write_file"&&!Ct.startsWith("ERROR:")){let O=Ct.replace(/^\[\[SAME\]\]\s*\r?\n?/,"").split(/\r?\n/),Y=O.filter(ie=>ie.startsWith("File ")||ie.trim().startsWith("- Stats:"));mn=`[ACTION RESULT]: ${Y.length>0?Y.join(`
|
|
819
819
|
`):O.slice(0,2).join(`
|
|
820
|
-
`)}`}else if(Ct.startsWith("[[SAME]]")){let O=Ct.replace(/^\[\[SAME\]\]\s*\r?\n?/,"").split(/\r?\n/),Y=O.filter(ie=>ie.startsWith("File ")||ie.trim().startsWith("- Stats:"));
|
|
820
|
+
`)}`}else if(Ct.startsWith("[[SAME]]")){let O=Ct.replace(/^\[\[SAME\]\]\s*\r?\n?/,"").split(/\r?\n/),Y=O.filter(ie=>ie.startsWith("File ")||ie.trim().startsWith("- Stats:"));mn=`[ACTION RESULT]: ${Y.length>0?Y.join(`
|
|
821
821
|
`):O.slice(0,2).join(`
|
|
822
822
|
`)}
|
|
823
|
-
[SYSTEM NOTE]: Content verified and persisted to disk. Full preview omitted to save tokens.`}else
|
|
823
|
+
[SYSTEM NOTE]: Content verified and persisted to disk. Full preview omitted to save tokens.`}else mn=`[ACTION RESULT]: ${Ct}`;je.push({role:"user",text:mn,binaryPart:xt}),Tn=!0;let ye=`[ACTION RESULT]: ${oe.replaceAll(`[[VERIFIED]]
|
|
824
824
|
`,"").replaceAll(`
|
|
825
|
-
[[/VERIFIED]]`,"")||""}`;(l==="view_file"||l==="web_scrape"||l==="file_map")&&(ye=`[ACTION RESULT]: ${L} (Context Locked for UI Clarity)`),yield{type:"tool_result",content:ye,aiContent:
|
|
825
|
+
[[/VERIFIED]]`,"")||""}`;(l==="view_file"||l==="web_scrape"||l==="file_map")&&(ye=`[ACTION RESULT]: ${L} (Context Locked for UI Clarity)`),yield{type:"tool_result",content:ye,aiContent:mn,binaryPart:xt,toolName:l},l==="memory"&&!oe.startsWith("ERROR:")&&(yield{type:"memory_updated"}),kt++}if(s==="Google"&&Ft&&Date.now()-no>=150){yield*Kn();let w=ho(Ft);for(let I of w)yield I;Ft="",no=Date.now()}}h.usageMetadata&&(sn=h.usageMetadata),sn&&(yield{type:"liveTokens",content:sn.totalTokenCount})}if(q&&(q=!1,lt?Ie+="</think_fluxflow>":(ue+="</think_fluxflow>",s==="Google"?Ft+="</think_fluxflow>":yield{type:"text",content:"</think_fluxflow>"})),lt&&Ie.length>0){let h=0,_=Math.min(Tt.length,Ie.length);for(let X=_;X>0;X--)if(Tt.endsWith(Ie.substring(0,X))){h=X;break}let v=Ie.substring(h);if(v){let ae=/(?:<think_fluxflow>|\[think_fluxflow\])(?:(?!(?:<\/think_fluxflow>|\[\/think_fluxflow\]))[\s\S])*$/i.test(Tt)?v.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,""):v.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])[\s\S]*?(?:<\/think_fluxflow>|\[\/think_fluxflow\])\s*/gi,"").replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,"");if(ae)if(ue+=ae,s==="Google")Ft+=ae;else{yield*Kn();let U=ho(ae);for(let J of U)yield J}}lt=!1,Ie=""}if(An){let h=An,_=(pt==="tool"||pt==="action")&&(h.startsWith("[tool:")||h.startsWith("[action:"));An="",oo=!1,pt=null,Vn=!1,io=!1,_||(s==="Google"?Ft+=h:yield{type:"text",content:h})}if(yield*Kn(),wt)break;let yo=(ue||"").trim(),pa=/\[\s*(turn\s*:)?\s*finish\s*\]/i.test(yo.toLowerCase())||/\[\[END\]\]/i.test(yo.toLowerCase()),ha=/\[\s*(turn\s*:)?\s*continue\s*\]/i.test(yo.toLowerCase()),ya=je.length>0||$!==null,Ci=Ht(yo).trim(),xa=/(\p{Emoji_Presentation}|\p{Extended_Pictographic})$/u.test(Ci),ba=/([.!?"'*_`|\]\)”’~~]+|\s|`{3}|[\u200B-\u200D\uFEFF])$/u.test(Ci.trim()),wa=/[.!?}"'`’“”]$|```$/s.test(Ci)||ba||xa;!pa&&!ha&&!ya&&yo.length>0,We=!0,await vt("agent",s)}catch(G){if(wt){yield{type:"status",content:"Request Cancelled"},yield{type:"text",content:`
|
|
826
826
|
|
|
827
|
-
\x1B[33m\u24D8 Request Cancelled\x1B[0m`};break}if(String(G).includes("Incomplete JSON segment at the end")){q&&(q=!1,lt?Ie+="</think_fluxflow>":(ue+="</think_fluxflow>",yield{type:"text",content:"</think_fluxflow>"})),We=!0,await vt("agent",s);break}if(q&&(q=!1,lt?Ie+="</think_fluxflow>":ue+="</think_fluxflow>"),lt&&Ie.length>0){let At=0,ct=Math.min(Tt.length,Ie.length);for(let tt=ct;tt>0;tt--)if(Tt.endsWith(Ie.substring(0,tt))){At=tt;break}let mt=Ie.substring(At);if(mt){let Ot=/(?:<think_fluxflow>|\[think_fluxflow\])(?:(?!(?:<\/think_fluxflow>|\[\/think_fluxflow\]))[\s\S])*$/i.test(Tt)?mt.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,""):mt.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])[\s\S]*?(?:<\/think_fluxflow>|\[\/think_fluxflow\])\s*/gi,"").replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,"");Ot&&(ue+=Ot)}lt=!1,Ie=""}let D=G instanceof Error?(()=>{try{return JSON.parse(JSON.parse(G.message).error.message).error.message}catch{return String(G)}})():String(G),ft=new Date().toLocaleString(),Ue=j.join(
|
|
827
|
+
\x1B[33m\u24D8 Request Cancelled\x1B[0m`};break}if(String(G).includes("Incomplete JSON segment at the end")){q&&(q=!1,lt?Ie+="</think_fluxflow>":(ue+="</think_fluxflow>",yield{type:"text",content:"</think_fluxflow>"})),We=!0,await vt("agent",s);break}if(q&&(q=!1,lt?Ie+="</think_fluxflow>":ue+="</think_fluxflow>"),lt&&Ie.length>0){let At=0,ct=Math.min(Tt.length,Ie.length);for(let tt=ct;tt>0;tt--)if(Tt.endsWith(Ie.substring(0,tt))){At=tt;break}let mt=Ie.substring(At);if(mt){let Ot=/(?:<think_fluxflow>|\[think_fluxflow\])(?:(?!(?:<\/think_fluxflow>|\[\/think_fluxflow\]))[\s\S])*$/i.test(Tt)?mt.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,""):mt.replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])[\s\S]*?(?:<\/think_fluxflow>|\[\/think_fluxflow\])\s*/gi,"").replace(/^\s*(?:<think_fluxflow>|\[think_fluxflow\])\s*/gi,"");Ot&&(ue+=Ot)}lt=!1,Ie=""}let D=G instanceof Error?(()=>{try{return JSON.parse(JSON.parse(G.message).error.message).error.message}catch{return String(G)}})():String(G),ft=new Date().toLocaleString(),Ue=j.join(pn,"agent");Te.existsSync(Ue)||Te.mkdirSync(Ue,{recursive:!0}),Te.appendFileSync(j.join(Ue,"error.log"),`ERROR [${ft}]: ${D}
|
|
828
828
|
|
|
829
829
|
----------------------------------------------------------------------
|
|
830
830
|
|
|
831
|
-
`);let Ve=G.status||G.statusCode||G.code,Et=String(G).includes("replicas at capacity");if(!(Ve&&(Ve>=500&&Ve<600||Ve===408||Ve===429||Et)||!Ve&&(/status[ :]+(5\d\d|408|429)/i.test(String(G))||/code[ :]+(5\d\d|408|429)/i.test(String(G))||/(500|503|408|429)/.test(String(G))))){if(qe<
|
|
831
|
+
`);let Ve=G.status||G.statusCode||G.code,Et=String(G).includes("replicas at capacity");if(!(Ve&&(Ve>=500&&Ve<600||Ve===408||Ve===429||Et)||!Ve&&(/status[ :]+(5\d\d|408|429)/i.test(String(G))||/code[ :]+(5\d\d|408|429)/i.test(String(G))||/(500|503|408|429)/.test(String(G))))){if(qe<gn-3)throw G;yield{type:"text",content:D},yield{type:"status",content:"Error Occured"}}if(ue.trim().length>0||Je>1)if(Je<=gn){Je++;let At=Math.min(1e3*Math.pow(2,Je-1),24e3);if(ue.trim().length>0){b.push({role:"agent",text:ue});let ct=`[system]
|
|
832
832
|
- seamless continuation: resume immediately. pick up from last words with zero gap/disruption
|
|
833
833
|
- no repetition: do not repeat any text already written
|
|
834
834
|
- no re-think: do not restart or open <think_fluxflow> if reasoning already started. continue the thinking and close thinking block </think_fluxflow> before chat output
|
|
835
835
|
- mid-tool safety: if cutoff was mid-tool call, restart that tool call from start
|
|
836
836
|
- stealth: do not mention/apologize for cutoff [/system]`;je.length>0?je.forEach((mt,tt)=>{tt===je.length-1?b.push({...mt,text:`${mt.text}
|
|
837
837
|
|
|
838
|
-
${ct}`}):b.push(mt)}):b.push({role:"user",text:ct}),Tt+=ue}for(let ct=At/1e3;ct>0&&!wt;ct--)yield{type:"status",content:`Error Occured. Recovering Stream (${Je}/${
|
|
839
|
-
Error log can be found in \`/export logs\``);else{let ct=e.split("/").slice(e.endsWith("/free")?-2:-1).join("/");if(qe<=
|
|
840
|
-
Error log can be found in \`/export logs\``)}}}if(
|
|
838
|
+
${ct}`}):b.push(mt)}):b.push({role:"user",text:ct}),Tt+=ue}for(let ct=At/1e3;ct>0&&!wt;ct--)yield{type:"status",content:`Error Occured. Recovering Stream (${Je}/${gn}) [Retrying in ${ct.toFixed(0)}s]...`},await new Promise(mt=>setTimeout(mt,1e3));yield{type:"status",content:"Error Occured. Recovering Stream..."}}else throw new Error(`Stream collapsed too many times. (Failed to resolve ${gn} times)
|
|
839
|
+
Error log can be found in \`/export logs\``);else{let ct=e.split("/").slice(e.endsWith("/free")?-2:-1).join("/");if(qe<=gn){qe++,Je=1,Tt="";let mt=Math.min(1e3*Math.pow(2,qe-1),32e3),tt=.8+Math.random()*.4,Ot=Math.round(mt*tt);Mn=!0,yield{type:"status",content:`Trying to reach ${ct} (${qe}/${gn}) [Retrying in ${(Ot/1e3).toFixed(0)}s]`};for(let He=Ot/1e3;He>0&&!wt;He--)yield{type:"status",content:`Trying to reach ${ct} (${qe}/${gn}) [Retrying in ${He.toFixed(0)}s]`},await new Promise(Ft=>setTimeout(Ft,1e3));yield{type:"status",content:`Trying to reach ${ct}`}}else throw new Error(`Model ${e} cannot be reached. (Failed ${gn} times)
|
|
840
|
+
Error log can be found in \`/export logs\``)}}}if(sn){let q=sn.totalTokenCount||0,G=sn.cachedContentTokenCount||0,D=(sn.candidatesTokenCount||0)+(s==="Google"&&sn.thoughtsTokenCount||0);await bt("tokens",q,s,te),G>0&&await bt("cachedTokens",G,s,te),D>0&&await bt("candidateTokens",D,s,te),ke!==null&&ke>0&&await bt("ttft",ke,s,te),Ao({provider:s,model:te,prompt:sn.promptTokenCount||0,cached:G,output:D,reasoning:sn.thoughtsTokenCount||0,ttft:ke}),yield{type:"usage",content:sn}}else ke!==null&&ke>0&&(await bt("ttft",ke,s,te),Ao({provider:s,model:te,prompt:0,cached:0,output:0,reasoning:0,ttft:ke}));ue=na(ue),Ti.push(ue);let bl=Ht(ue),Ei=Zr(ue),da=/\[\s*(turn\s*:)?\s*finish\s*\]/i.test(Ei.toLowerCase())||/\[\[END\]\]/i.test(Ei.toLowerCase())||!0,wl=/\[\s*(turn\s*:)?\s*continue\s*\]/i.test(Ei.toLowerCase()),Sl=kt>0;yield{type:"status",content:process.env.HALLOWEEN_EEGG==="true"?"Performing dark ritual":"Thinking"};let fa=pl(ue,/(\[\s*(turn\s*:)?\s*(continue|finish)\s*\]|\[\[END\]\])/gi,"").trim(),jn=(da||je.length===0)&&!Dt&&!Hn&&!Yt;if(jn=je.length===0?jn:!1,jn=Qt||Vo?!1:jn,ue&&ue.trim().endsWith('")]')&&je.length===0&&(jn=!1),jn){As=!0;let q=Ti.join(`
|
|
841
841
|
`),G=Ht(q).trim();yield{type:"interactive_turn_finished",data:{agentText:Me,fullAgentTextRaw:q,history:[...b],needTitle:Ae}},b.length>0&&b[b.length-1].role==="agent"?b[b.length-1].text=G:b.push({role:"agent",text:G}),b.forEach(D=>{if(D.role==="user"&&D.text&&(D.text=D.text.replace(/\n\[COMPILE ERROR\][\s\S]*?\[\/ERROR\]/g,""),D.text=D.text.replaceAll(`
|
|
842
842
|
|
|
843
843
|
[system] user question. resolve this specific query within '[ANSWER] ... [/ANSWER]' concisely, naturally [/system]
|
|
@@ -846,7 +846,7 @@ Error log can be found in \`/export logs\``)}}}if(nn){let q=nn.totalTokenCount||
|
|
|
846
846
|
`,"").replaceAll(`[system] **strictly follow thinking policy as high priority. do not start a response without <think_fluxflow>...</think_fluxflow>** [/system]
|
|
847
847
|
`,"").replaceAll(/\n\[system\] WARNING, Turn Limit Impending: Step \d+\/\d+\. Wrap up quickly\/prompt user to continue & use \[\[END\]\] quickly\. \[\/system\]/g,""),D.text=D.text.replaceAll(/\n\[system\] File Changes:\n(?:\* .+ \(created|modified|deleted\)\n)*\[\/system\]/g,""),(s==="Mistral"||s==="Google"&&e?.toLowerCase().startsWith("gemma"))&&(D.text.startsWith("[ACTION RESULT]")||D.text.startsWith("[TOOL RESULT]")))){let Ue=`
|
|
848
848
|
[system] Action result received. Analyze output and proceed with your turn [/system]`,Ve=`
|
|
849
|
-
[system] Action result received. Analyze output and proceed with your turn. **strictly follow thinking policy. do not start a response without <think_fluxflow>...</think_fluxflow>** [/system]`;D.text=D.text.replaceAll(Ve,"").replaceAll(Ue,"").trim()}}),yield{type:"status",content:"[end]"}}if(jn)break;let ua=fa.trim()||"*Working...*";if(b.push({role:"agent",text:ua}),je.length>0||
|
|
849
|
+
[system] Action result received. Analyze output and proceed with your turn. **strictly follow thinking policy. do not start a response without <think_fluxflow>...</think_fluxflow>** [/system]`;D.text=D.text.replaceAll(Ve,"").replaceAll(Ue,"").trim()}}),yield{type:"status",content:"[end]"}}if(jn)break;let ua=fa.trim()||"*Working...*";if(b.push({role:"agent",text:ua}),je.length>0||Tn){if(je.length>0){let q=je.map(tt=>tt.text).join(`
|
|
850
850
|
|
|
851
851
|
`),G=Ht(ue),D=ps(G),ft=Qn(G),Ue=/\[\s*(?:tool:(?:functions\.)?|action:(?:functions\.)?|action:)([a-zA-Z0-9_]+)\s*\(/gi,Ve=[],Et=[],Ee;for(;(Ee=Ue.exec(D))!==null;)Et.push({index:Ee.index,toolName:Ee[1]});for(let tt=0;tt<Et.length;tt++){let Ot=Et[tt],He=tt+1<Et.length?Et[tt+1].index:G.length;ft.some(no=>no.fullMatch&&G.startsWith(no.fullMatch,Ot.index))||Ve.push(G.substring(Ot.index,He))}let At=Ve.length,ct=je.length+At;if(At>0){let tt=Ve.join(`
|
|
852
852
|
`),Ot=ea(tt);q+=`
|
|
@@ -859,15 +859,15 @@ ${D} [/system]`:`[system] Failed to execute ${G>0?G:1} tool${G>1?"s":""}. Verify
|
|
|
859
859
|
${Gt("\u2718 Model produced malformed tool call")}
|
|
860
860
|
`}}else yield{type:"visual_feedback",content:`
|
|
861
861
|
${Gt("\u2718 Loop Detected")}
|
|
862
|
-
`},b.push({role:"user",text:`[system] ${Hn&&!Dt?"Stuttering Detected by Internal System. Re-calibrate your response & proceed.":`${Dt?" Over Thinking":" Loop"} Detected by Internal System${Dt?" for current Effort Level":""}. ${Dt?"If you have planned the task, prioritize execution/output":"If you have finished your task provide a simple summary and end"}`} [/system]`});Dt=!1,Hn=!1,Yt=!1}m?.advanceRollback&&await Eo.recordTurnDelta(p,M+1,Oe),Ai=Oe.includes("recapture_screen"),Vo=kt>0||
|
|
862
|
+
`},b.push({role:"user",text:`[system] ${Hn&&!Dt?"Stuttering Detected by Internal System. Re-calibrate your response & proceed.":`${Dt?" Over Thinking":" Loop"} Detected by Internal System${Dt?" for current Effort Level":""}. ${Dt?"If you have planned the task, prioritize execution/output":"If you have finished your task provide a simple summary and end"}`} [/system]`});Dt=!1,Hn=!1,Yt=!1}m?.advanceRollback&&await Eo.recordTurnDelta(p,M+1,Oe),Ai=Oe.includes("recapture_screen"),Vo=kt>0||Tn}if(!As&&!wt){let M="\u2726 Turn safety limit reached. Stopping execution.";yield{type:"text",content:`
|
|
863
863
|
|
|
864
864
|
${M}
|
|
865
865
|
`};let ve=(Ti.join(`
|
|
866
866
|
`)+`
|
|
867
|
-
${M}`).trim();yield{type:"interactive_turn_finished",data:{agentText:Me,fullAgentTextRaw:ve,history:[...b],needTitle:Ae}},yield{type:"status",content:"[end]"}}}catch(S){let b=S?.cause?` (Cause: ${S.cause?.message||String(S.cause)})`:"",Fe=(S instanceof Error?(()=>{try{return JSON.parse(JSON.parse(S.message).error.message).error.message}catch{return(S.message?`${S.message}${b}`:"")||String(S)}})():String(S)).replace(/^(Error:\s*)+/i,"");s==="Google"&&!/^[A-Z0-9_\-\s]+ ERROR:/i.test(Fe)&&(Fe=`GEMINI ERROR: ${Fe}`);let $t=new Date().toLocaleString(),
|
|
867
|
+
${M}`).trim();yield{type:"interactive_turn_finished",data:{agentText:Me,fullAgentTextRaw:ve,history:[...b],needTitle:Ae}},yield{type:"status",content:"[end]"}}}catch(S){let b=S?.cause?` (Cause: ${S.cause?.message||String(S.cause)})`:"",Fe=(S instanceof Error?(()=>{try{return JSON.parse(JSON.parse(S.message).error.message).error.message}catch{return(S.message?`${S.message}${b}`:"")||String(S)}})():String(S)).replace(/^(Error:\s*)+/i,"");s==="Google"&&!/^[A-Z0-9_\-\s]+ ERROR:/i.test(Fe)&&(Fe=`GEMINI ERROR: ${Fe}`);let $t=new Date().toLocaleString(),xn=j.join(pn,"agent");yield{type:"text",content:`
|
|
868
868
|
|
|
869
869
|
\u2726 CRITICAL ERROR: ${Fe.includes("fetch failed")?"Failed to Connect. Check your Internet Connection or Wait a moment":Fe}
|
|
870
|
-
\u2800`},Te.existsSync(
|
|
870
|
+
\u2800`},Te.existsSync(xn)||Te.mkdirSync(xn,{recursive:!0}),Te.appendFileSync(j.join(xn,"error.log"),`CRITICAL ERROR [${$t}]: ${S}${S?.cause?`
|
|
871
871
|
CAUSE: ${S.cause?.stack||S.cause}`:""}
|
|
872
872
|
|
|
873
873
|
----------------------------------------------------------------------
|
|
@@ -909,9 +909,9 @@ Main focus: actions and task, not chatting
|
|
|
909
909
|
On completion, provide a detailed summary in Tables/Markdown Format with file modified info. If any task failed report back in detail
|
|
910
910
|
|
|
911
911
|
Current Time: ${f}
|
|
912
|
-
=== END SYSTEM PROMPT ===`,he=[{role:"user",text:`Complete this task: ${e}`}],Ae=0,Me="";for(;Ae<o;){let Se=await Li("subagent",u);if(!Se.allowed)throw new Error(Se.reason||`Budget Exhausted for Provider (${u?.aiProvider||"Subagent"})`);if(wt){if(n?.taskId&&typeof Jt<"u"){let k=Jt.find(C=>C.id===n.taskId);k&&(k.status="cancelled")}throw r&&r("[SUBAGENT CANCELLED] Subagent task was cancelled."),new Error("Subagent task was cancelled.")}if(n?.taskId&&typeof Jt<"u"){let k=Jt.find(C=>C.id===n.taskId);if(k&&k.status==="cancelled")throw r&&r("[SUBAGENT CANCELLED] Subagent task was cancelled."),new Error("Subagent task was cancelled.")}let S=he.map(k=>({role:k.role==="user"?"user":"model",parts:[{text:k.text}]}));r&&r(`[Subagent Turn ${Ae+1}]...`);let b=["Fast","Low","Medium","High"],ut=process.env.SUBAGENT_THINKING,Fe=b.includes(ut)?ut:"Low",
|
|
912
|
+
=== END SYSTEM PROMPT ===`,he=[{role:"user",text:`Complete this task: ${e}`}],Ae=0,Me="";for(;Ae<o;){let Se=await Li("subagent",u);if(!Se.allowed)throw new Error(Se.reason||`Budget Exhausted for Provider (${u?.aiProvider||"Subagent"})`);if(wt){if(n?.taskId&&typeof Jt<"u"){let k=Jt.find(C=>C.id===n.taskId);k&&(k.status="cancelled")}throw r&&r("[SUBAGENT CANCELLED] Subagent task was cancelled."),new Error("Subagent task was cancelled.")}if(n?.taskId&&typeof Jt<"u"){let k=Jt.find(C=>C.id===n.taskId);if(k&&k.status==="cancelled")throw r&&r("[SUBAGENT CANCELLED] Subagent task was cancelled."),new Error("Subagent task was cancelled.")}let S=he.map(k=>({role:k.role==="user"?"user":"model",parts:[{text:k.text}]}));r&&r(`[Subagent Turn ${Ae+1}]...`);let b=["Fast","Low","Medium","High"],ut=process.env.SUBAGENT_THINKING,Fe=b.includes(ut)?ut:"Low",xn=(await yi(u,W,S,E,Fe)).text||"",It=na(Ht(xn).trim());Me=It,r&&r(`[Subagent Response]
|
|
913
913
|
${It}
|
|
914
|
-
`),he.push({role:"agent",text:It});let jt=Qn(It);if(jt.length===0)break;let
|
|
914
|
+
`),he.push({role:"agent",text:It});let jt=Qn(It);if(jt.length===0)break;let bn=jt.filter(k=>k.toolName.toLowerCase()==="askmain"||k.toolName.toLowerCase()==="ask_main"),wn=!1,Nt="";for(let k of jt){if(wt){if(n?.taskId&&typeof Jt<"u"){let A=Jt.find(N=>N.id===n.taskId);A&&(A.status="cancelled")}throw new Error("Subagent task was cancelled.")}if(n?.taskId&&typeof Jt<"u"){let A=Jt.find(N=>N.id===n.taskId);if(A&&A.status==="cancelled")throw new Error("Subagent task was cancelled.")}let C=k.toolName.toLowerCase();if(C==="askuser"&&(C="ask"),C==="askmain"||C==="ask_main"){if(wn)continue;wn=!0;let A="";if(bn.length===1?A=K(bn[0].args).question||bn[0].args:A=bn.map((N,be)=>{let _e=K(N.args);return`Q${be+1}: ${_e.question||N.args}`}).join(`
|
|
915
915
|
`),n.onAskMain){r&&r(`[Executing Tool] AskMain("${A}")...`);let N=await n.onAskMain(A);r&&r(`[Action Result]
|
|
916
916
|
Answer from Main Agent: ${N}
|
|
917
917
|
`),Nt+=`[ACTION RESULT for AskMain]: Answer from Main Agent: ${N}
|
|
@@ -935,4 +935,4 @@ ${A}
|
|
|
935
935
|
|
|
936
936
|
`,await vt("toolFailure")}}let St="";if(n?.taskId&&typeof Jt<"u"){let k=Jt.find(C=>C.id===n.taskId);if(k&&k.pendingSteerMessages&&k.pendingSteerMessages.length>0){let C=[...k.pendingSteerMessages];k.pendingSteerMessages=[];for(let Pe of C)St+=`
|
|
937
937
|
|
|
938
|
-
[STEERING INSTRUCTION FROM MAIN AGENT]: ${Pe}`,r&&r(`[Subagent Steered] ${Pe}`)}}let
|
|
938
|
+
[STEERING INSTRUCTION FROM MAIN AGENT]: ${Pe}`,r&&r(`[Subagent Steered] ${Pe}`)}}let un=(Nt.trim()+St).trim();he.push({role:"user",text:un}),Ae++}return Me};export{uo as a,pi as b,Fc as c,Bc as d,ac as e,lc as f,fo as g,cc as h,Ac as i,Ec as j,rl as k,Rd as l,al as m,ll as n,fs as o,Ht as p,hi as q,na as r,ul as s,_d as t,vd as u,ms as v,Id as w,ps as x,ml as y,Qn as z,Md as A,yi as B,Pd as C,Od as D,Ld as E,$d as F};
|