fluxflow-cli 4.35.0 → 4.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ai-VPOENCLE.js → ai-2KKP7NFF.js} +1 -1
- package/dist/chunks/{app-TZWCCMBE.js → app-JERPNQ7V.js} +2 -2
- package/dist/chunks/{chunk-FPLE7K3C.js → chunk-VMFH7MSG.js} +39 -39
- package/dist/chunks/{invoke-LY7HLMXS.js → invoke-QP4USBCP.js} +2 -2
- package/dist/chunks/{invokeSync-NECLXGRS.js → invokeSync-UHGKK3NF.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as s,B as t,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o,x as p,y as q,z as r}from"./chunk-
|
|
1
|
+
import{A as s,B as t,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o,x as p,y as q,z as r}from"./chunk-VMFH7MSG.js";import"./chunk-JS5ZIGFR.js";import"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import"./chunk-KAL5XSAQ.js";import"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import"./chunk-4MDSKJGX.js";import"./chunk-FQBBOFNP.js";import"./chunk-Y5JU726N.js";import"./chunk-KHCAQOSP.js";import"./chunk-X6YW3TVC.js";import"./chunk-KZTDLEUL.js";import{k as a}from"./chunk-63V6P5DU.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{c as RE_LEADING_THINK,q as compressHistory,b as convertChannelThinkTags,r as deleteChatSummary,e as findGenuineThinkClose,p as generateSimpleContent,s as getAIStream,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,o as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,n as runJanitorTask,t as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as cl,a as ji,b as Je,c as lt,d as Br,e as Dr,f as Zi,g as Is,h as sn,i as Ar,s as il,v as ll,w as Io,y as al,z as dl}from"./chunk-
|
|
1
|
+
import{A as cl,a as ji,b as Je,c as lt,d as Br,e as Dr,f as Zi,g as Is,h as sn,i as Ar,s as il,v as ll,w as Io,y as al,z as dl}from"./chunk-VMFH7MSG.js";import{a as ul}from"./chunk-UEV335RW.js";import{a as Vt,b as zi,c as Ji}from"./chunk-JS5ZIGFR.js";import{b as ol,c as nl,d as rl}from"./chunk-SZYN3VHU.js";import{a as sl}from"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import{c as qi,e as Dn,f as Jt,g as Qi}from"./chunk-MTPBPPXV.js";import"./chunk-KAL5XSAQ.js";import{a as tl}from"./chunk-A73NNVCZ.js";import{a as Go,b as In,d as Ir,e as Ds,f as Ri,h as el,i as Jn}from"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import{a as Bt,b as gt,d as Vi,e as ht,f as Yi,j as vs,k as Bs,l as qn,m as Ki,n as Do}from"./chunk-4MDSKJGX.js";import{a as zn}from"./chunk-FQBBOFNP.js";import{a as Qn}from"./chunk-Y5JU726N.js";import{b as Xo,c as Ss,k as _i}from"./chunk-KHCAQOSP.js";import{a as Hi,b as Xi,h as Gi,i as Er,j as vr,l as vt,m as rn,n as Es,t as Wi}from"./chunk-X6YW3TVC.js";import{a as Cs,b as It}from"./chunk-KZTDLEUL.js";import{d as Li,e as Oi,f as Pi,g as Ni,h as Fi,i as Ui,k as Cr,m as Ho,n as zt,o as $i}from"./chunk-63V6P5DU.js";import{c as Mr,d as ki,e as Sr}from"./chunk-L3W2X74K.js";import{a as ao,b as nn,c as go,d as ys,e as Ms,k as jn}from"./chunk-DSVLWYIT.js";import qs from"os";import e,{useState as R,useEffect as st,useRef as qe,useMemo as Pn}from"react";import{Box as u,Text as a,useInput as Zd,useStdout as Rd,Static as ec}from"ink";import tc from"ink-spinner";import rt from"fs-extra";import Ct from"path";import{exec as Mo}from"child_process";import{fileURLToPath as oc}from"url";import _t,{useState as kr,useEffect as As,useMemo as Zn,useCallback as Sa,useRef as Ao}from"react";import{Box as Ca,Text as co,useInput as Ea}from"ink";function va(t,f){return t.replace(/\t/g," ".repeat(f))}function Lr(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`)}function ln(t,f,h){let C=t,y=[...f].sort((i,w)=>i.start-w.start),p=0;for(let i of y){let w=i.start-p,T=Lr(i.text).split(`
|
|
4
4
|
`).length,S=i.text.length,F=(T>3?`[Pasted ${T} lines]`:`[Pasted ${S} chars]`).length,O=w+F;if(t<=w)break;if(t<O){C=i.end;break}else{let E=i.text.length-F;C+=E,p+=E}}return Math.min(C,h.length)}function ks(t,f,h,C,y=[]){let p=(t||"").slice(0,f),i=C(p).length,w=C(t||""),T=[...y].sort(($,L)=>L.start-$.start);for(let $ of T){let L=C(t.slice(0,$.start)).length,Y=C($.text),z=L+Y.length,ae=Lr($.text).split(`
|
|
@@ -196,7 +196,7 @@ ${g}
|
|
|
196
196
|
\u2800`,isMeta:!0}]))}catch(l){k(g=>(H(g.length+1),[...g,{id:Date.now(),role:"system",text:`\u2726 Memory Migration Failed
|
|
197
197
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Error: ${l.message}
|
|
198
198
|
\u2800`,isMeta:!0}]))}else J("memory");break}case"/files":{k(c=>(H(c.length+1),[...c,{id:"files-"+Date.now(),role:"system",text:Zi(),isMeta:!0}]));break}case"/target":{k(c=>(H(c.length+1),[...c,{id:"target-"+Date.now(),role:"system",text:`\u2726 Unique Model Id for FluxFlow
|
|
199
|
-
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m ${D}
|
|
199
|
+
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m ${D}@${Ge}
|
|
200
200
|
\u2800`,isMeta:!0}]));break}case"/reset":{(async()=>{try{k(l=>(H(l.length+1),[...l,{id:Date.now(),role:"system",text:`\u2726 Initiating reset...
|
|
201
201
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Clearing logs, secrets, and settings.
|
|
202
202
|
\u2800`,isMeta:!0}])),rt.existsSync(ys)&&rt.removeSync(ys),rt.existsSync(Ms)&&rt.removeSync(Ms),rt.existsSync(nn)&&rt.removeSync(nn);try{rt.readdirSync(ao).length===0&&rt.removeSync(ao)}catch{}setTimeout(()=>{J("exit"),setTimeout(()=>process.exit(0),500)},500)}catch(l){k(g=>(H(g.length+1),[...g,{id:Date.now(),role:"system",text:`\u2726 ERROR
|
|
@@ -130,7 +130,7 @@ Trigger in chat via /command
|
|
|
130
130
|
* /changelog \u2192 Release notes
|
|
131
131
|
* /update check \u2192 Check npm updates
|
|
132
132
|
* /update latest \u2192 Install latest release
|
|
133
|
-
* /fluxflow
|
|
133
|
+
* /fluxflow global/saves \u2192 Openes fluxflow storage paths in explorer
|
|
134
134
|
* /move \u2192 Transfer Playground session data to CWD/playground-export
|
|
135
135
|
`;var ks=`# FluxFlow In-App Settings Reference
|
|
136
136
|
|
|
@@ -404,13 +404,13 @@ Route sub-agent workloads to faster/cheaper models independently of the main age
|
|
|
404
404
|
* Auto indexed on boot
|
|
405
405
|
|
|
406
406
|
### Conditional Model & Provider Instructions (use /target command to get provider name & model-id)
|
|
407
|
-
You can scope instructions conditionally to specific providers, model IDs, or unique provider
|
|
407
|
+
You can scope instructions conditionally to specific providers, model IDs, or unique provider@model combinations using XML tags:
|
|
408
408
|
> Conditionals will only work in FLUXFLOW.md. AGENTS.md will be read as raw Markdown. Any prose outside valid conditionals in FLUXFLOW.md will be ignored
|
|
409
409
|
|
|
410
410
|
1. Unique Target (Provider + Model):
|
|
411
|
-
<start_model_google
|
|
411
|
+
<start_model_google@gemini-2.5-flash>
|
|
412
412
|
Specific instruction for Gemini 2.5 Flash when served by Google.
|
|
413
|
-
<end_model_google
|
|
413
|
+
<end_model_google@gemini-2.5-flash>
|
|
414
414
|
|
|
415
415
|
2. Model-Specific (Any Provider):
|
|
416
416
|
<start_model_gemini-2.5-flash>
|
|
@@ -431,7 +431,7 @@ Instruction for this model ID across all providers.
|
|
|
431
431
|
## 2. Skills System
|
|
432
432
|
* Locations:
|
|
433
433
|
* Global: ~/.fluxflow/skills/**/SKILL.md
|
|
434
|
-
* Workspace: ./skills/**/SKILL.md | ./SKILL.md
|
|
434
|
+
* Workspace: ./skills/**/SKILL.md | ./SKILL.md
|
|
435
435
|
|
|
436
436
|
* Format:
|
|
437
437
|
* YAML Frontmatter: --- block with name and description
|
|
@@ -466,14 +466,14 @@ Public Docs: https://fluxflow-cli.onrender.com
|
|
|
466
466
|
|
|
467
467
|
Default Context Length: 256k Tokens. Can be changed via ENV/In-app Settings \u2192 references/{SETTINGS,ENV}.md
|
|
468
468
|
|
|
469
|
-
Docs missing required info? Say you are not sure enough to answer. Dont give wrong info`,"references/MODES.md":vs,"references/PROVIDERS.md":_s,"references/PLUGINS.md":Is,"references/STARTUP.md":bs,"references/ENV.md":ws,"references/COMMANDS.md":Ss,"references/SETTINGS.md":ks,"references/TOOLS.md":Ts,"references/ARCHITECTURE.md":As,"references/SUB_AGENTS.md":Es,"references/SECURITY.md":Cs,"references/IDE.md":Rs};var Ps=()=>{try{let e=On.join(Mn,"skills","fluxflow"),n=On.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){rn.existsSync(e)&&rn.rmSync(e,{recursive:!0,force:!0});return}let i=new Set(Object.keys(Ci).map(o=>On.normalize(o)));for(let[o,r]of Object.entries(Ci)){let c=On.join(e,o),a=On.dirname(c);rn.existsSync(a)||rn.mkdirSync(a,{recursive:!0});let
|
|
470
|
-
`,m=null;rn.existsSync(c)&&(m=rn.readFileSync(c,"utf8")),m!==
|
|
471
|
-
`)},Us=()=>To(Mn,["agents.md","agent.md"]),Ws=()=>To(process.cwd(),["agents.md","agent.md"]),Gs=()=>To(Mn,["fluxflow.md"]),Hs=()=>To(process.cwd(),["fluxflow.md"]),xo=Us(),Ko=Ws(),an=Oi(),bo=Gs(),wo=Hs(),Ns=null,Ii="",js=!1,aa=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&&(Ii=o[1].trim(),process.env.NO_INS=!0),/<><\s*NO_INS/.test(t)&&(js=!0),i.trim()},la=()=>{xo=Us();let e=xo?Mi(Mn,["agents.md","agent.md"]).trim():"";return e.length===0?(xo=null,""):e},ca=()=>{if(an=Oi(),Ko=Ws(),!an||an.length===0)return"";let e=process.cwd(),n=[...an].sort((o,r)=>{let c=ln.relative(e,o).replace(/\\/g,"/"),a=ln.relative(e,r).replace(/\\/g,"/"),
|
|
469
|
+
Docs missing required info? Say you are not sure enough to answer. Dont give wrong info`,"references/MODES.md":vs,"references/PROVIDERS.md":_s,"references/PLUGINS.md":Is,"references/STARTUP.md":bs,"references/ENV.md":ws,"references/COMMANDS.md":Ss,"references/SETTINGS.md":ks,"references/TOOLS.md":Ts,"references/ARCHITECTURE.md":As,"references/SUB_AGENTS.md":Es,"references/SECURITY.md":Cs,"references/IDE.md":Rs};var Ps=()=>{try{let e=On.join(Mn,"skills","fluxflow"),n=On.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){rn.existsSync(e)&&rn.rmSync(e,{recursive:!0,force:!0});return}let i=new Set(Object.keys(Ci).map(o=>On.normalize(o)));for(let[o,r]of Object.entries(Ci)){let c=On.join(e,o),a=On.dirname(c);rn.existsSync(a)||rn.mkdirSync(a,{recursive:!0});let f=r.trim()+`
|
|
470
|
+
`,m=null;rn.existsSync(c)&&(m=rn.readFileSync(c,"utf8")),m!==f&&rn.writeFileSync(c,f,"utf8")}if(rn.existsSync(n)){let o=rn.readdirSync(n);for(let r of o){let c=On.normalize(On.join("references",r));if(!i.has(c)){let a=On.join(n,r);try{rn.rmSync(a,{recursive:!0,force:!0})}catch{}}}}}catch{}};var To=(e,n)=>{try{if(!nn.existsSync(e))return null;let t=Array.isArray(n)?n.map(o=>o.toLowerCase()):[n.toLowerCase()],i=nn.readdirSync(e);for(let o of t){let r=i.find(c=>c.toLowerCase()===o);if(r){let c=ln.join(e,r);if(nn.statSync(c).isFile())return c}}}catch{}return null},Mi=(e,n)=>{let t=To(e,n);if(t)try{return nn.readFileSync(t,"utf8")}catch{}return""},Ls=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"]),Oi=(e=process.cwd(),n=0,t=8)=>{let i=[];if(n>t)return i;try{if(!nn.existsSync(e))return i;let o=nn.readdirSync(e,{withFileTypes:!0});for(let r of o){let c=r.name,a=ln.join(e,c);if(r.isDirectory())!Ls.has(c)&&!Ls.has(c.toLowerCase())&&i.push(...Oi(a,n+1,t));else if(r.isFile()){let f=c.toLowerCase();(f==="agents.md"||f==="agent.md")&&i.push(a)}}}catch{}return i},$s=(e,n=2)=>{if(!e)return"";let t=" ".repeat(n);return e.split(/\r?\n/).map(i=>t+i).join(`
|
|
471
|
+
`)},Us=()=>To(Mn,["agents.md","agent.md"]),Ws=()=>To(process.cwd(),["agents.md","agent.md"]),Gs=()=>To(Mn,["fluxflow.md"]),Hs=()=>To(process.cwd(),["fluxflow.md"]),xo=Us(),Ko=Ws(),an=Oi(),bo=Gs(),wo=Hs(),Ns=null,Ii="",js=!1,aa=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&&(Ii=o[1].trim(),process.env.NO_INS=!0),/<><\s*NO_INS/.test(t)&&(js=!0),i.trim()},la=()=>{xo=Us();let e=xo?Mi(Mn,["agents.md","agent.md"]).trim():"";return e.length===0?(xo=null,""):e},ca=()=>{if(an=Oi(),Ko=Ws(),!an||an.length===0)return"";let e=process.cwd(),n=[...an].sort((o,r)=>{let c=ln.relative(e,o).replace(/\\/g,"/"),a=ln.relative(e,r).replace(/\\/g,"/"),f=!c.includes("/"),m=!a.includes("/");return f&&!m?-1:!f&&m?1:c.localeCompare(a)}),t=[],i=[];for(let o of n)try{let r=nn.readFileSync(o,"utf8").trim();if(!r||r.length===0)continue;t.push(o);let c=ln.relative(e,o).replace(/\\/g,"/");if(!c.includes("/"))i.push($s(r,2));else{let f=ln.dirname(c)+"/:";i.push(`${f}
|
|
472
472
|
${$s(r,2)}`)}}catch{}return an=t,an.length===0&&(Ko=null),i.join(`
|
|
473
473
|
|
|
474
|
-
`).trim()},Pi=()=>{bo=Gs();let e=bo?Mi(Mn,["fluxflow.md"]).trim():"",n=aa(e)?.trim()||"";return n.length===0?(bo=null,""):n},Li=()=>{wo=Hs();let e=wo?Mi(process.cwd(),["fluxflow.md"]).trim():"";return e.length===0?(wo=null,""):e},$i=la(),Vo=ca(),So=Pi(),ko=Li(),Ds=(e,n="",t="")=>{if(!e)return"";let i=t.toLowerCase().trim(),o=n.toLowerCase().trim(),r=ln.posix.basename(o),c=i&&o?`${i}
|
|
474
|
+
`).trim()},Pi=()=>{bo=Gs();let e=bo?Mi(Mn,["fluxflow.md"]).trim():"",n=aa(e)?.trim()||"";return n.length===0?(bo=null,""):n},Li=()=>{wo=Hs();let e=wo?Mi(process.cwd(),["fluxflow.md"]).trim():"";return e.length===0?(wo=null,""):e},$i=la(),Vo=ca(),So=Pi(),ko=Li(),Ds=(e,n="",t="")=>{if(!e)return"";let i=t.toLowerCase().trim(),o=n.toLowerCase().trim(),r=ln.posix.basename(o),c=i&&o?`${i}@${o}`:"",a=i&&r?`${i}@${r}`:"",f=x=>!x||!o?!1:x===o||x===r||x===c||x===a,m=[];return e.replace(/<start_provider_([^>\r\n]+)>([\s\S]*?)<end_provider_([^>\r\n]+)>/gi,(x,h,u,s)=>{if(i&&h.trim().toLowerCase()===s.trim().toLowerCase()&&h.trim().toLowerCase()===i){let A=u.replace(/<start_model_([^>\r\n]+)>([\s\S]*?)<end_model_([^>\r\n]+)>/gi,(he,y,R,B)=>{if(y.trim().toLowerCase()===B.trim().toLowerCase()){let K=y.trim().toLowerCase();if(f(K)){let $=R.trim();$&&m.push($)}}return""}).trim();A&&m.push(A)}return""}),e.replace(/<start_model_([^>\r\n@]+@[^>\r\n]+)>([\s\S]*?)<end_model_([^>\r\n@]+@[^>\r\n]+)>/gi,(x,h,u,s)=>{if(h.trim().toLowerCase()===s.trim().toLowerCase()){let g=h.trim().toLowerCase();if(f(g)){let A=u.trim();A&&m.push(A)}}return""}),e.replace(/<start_model_([^>\r\n]+)>([\s\S]*?)<end_model_([^>\r\n]+)>/gi,(x,h,u,s)=>{if(h.includes("@"))return"";if(h.trim().toLowerCase()===s.trim().toLowerCase()){let g=h.trim().toLowerCase();if(o&&(g===o||g===r)){let A=u.trim();A&&m.push(A)}}return""}),m.join(`
|
|
475
475
|
|
|
476
|
-
`).trim()},da=(e="",n="")=>{let t=`${e||""}
|
|
476
|
+
`).trim()},da=(e="",n="")=>{let t=`${e||""}@${n||""}`.toLowerCase().trim();Ns!==t&&(Ns=t,So=Pi(),ko=Li())};Ps();var fa=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},ua=e=>{let n=[];if(!e||!nn.existsSync(e))return n;let t=(i,o=0)=>{if(!(o>5))try{let r=nn.readdirSync(i,{withFileTypes:!0});for(let c of r){let a=ln.join(i,c.name),f=c.name.toLowerCase();c.isFile()?f==="skill.md"&&n.push(a):c.isDirectory()&&(o===0?(f==="skills"||f===".skills"||f==="skill"||f===".skill")&&t(a,o+1):t(a,o+1))}}catch{}};return t(e,0),n},Ks=e=>{let n=ua(e),t=[];for(let i of n)try{let o=nn.readFileSync(i,"utf8"),r=fa(o);r&&t.push({...r,filePath:i})}catch{}return t},Vs=e=>!e||e.length===0?"":e.map(n=>`- ${n.name}: ${n.description}`).join(`
|
|
477
477
|
`),Ys=Ks(Mn),zs=Ks(process.cwd()),Ri=Vs(Ys),vi=Vs(zs),qs=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"},Xs=()=>(Ys||[]).filter(e=>!qs(e)),Js=()=>(zs||[]).filter(e=>!qs(e)),Kl=($i?.length>0?1:0)+(Vo?.length>0?an.length:0)+(So?.length>0?1:0)+(ko?.length>0?1:0)+Xs().length+Js().length,_i=(e,n="Project")=>{if(!e)return"";let t=e.replace(/\\/g,"/");if(n==="Global"){let o=ra.homedir().replace(/\\/g,"/");return t.toLowerCase().startsWith(o.toLowerCase())?"~"+t.slice(o.length):t}let i=ln.relative(process.cwd(),e).replace(/\\/g,"/");return i.startsWith(".")?i:`./${i}`},Vl=()=>{So=Pi(),ko=Li();let e=[];xo&&$i.length>0&&e.push({scope:"Global",path:xo}),an&&an.length>0&&Vo.length>0?an.forEach(r=>{e.push({scope:"Project",path:r})}):Ko&&Vo.length>0&&e.push({scope:"Project",path:Ko}),bo&&So.length>0&&e.push({scope:"Global",path:bo}),wo&&ko.length>0&&e.push({scope:"Project",path:wo});let n=Xs(),t=Js(),i=e.length+n.length+t.length;if(i===0)return`\u2726 Loaded Files & Instructions
|
|
478
478
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m No instruction or skill files are currently loaded.
|
|
479
479
|
\u2800`;let o=[];return o.push(`\u2726 Loaded Files & Instructions (${i} ${i===1?"file":"files"} active)`),e.length>0&&(o.push(`
|
|
@@ -483,7 +483,7 @@ ${$s(r,2)}`)}}catch{}return an=t,an.length===0&&(Ko=null),i.join(`
|
|
|
483
483
|
`):yo=""}catch(t){yo="",nn.appendFileSync(`${Tn}/memory/error.txt`,`${t.message}
|
|
484
484
|
-------------------------------------------------
|
|
485
485
|
|
|
486
|
-
`)}}return yo};var Zs=(e,n,t,i,o=!0,r=!1,c="Google",a=!1,
|
|
486
|
+
`)}}return yo};var Zs=(e,n,t,i,o=!0,r=!1,c="Google",a=!1,f,m,x=!1,h="")=>{let u=!1;process.env.forcedReasoning&&(u=!0);let s="";if(!f&&c==="Google"){let Le=n;n==="Fast"&&(Le="Off"),n==="Low"&&(Le="Minimal"),n==="Standard"&&(Le="Medium"),(n==="xHigh"||n==="Max")&&(Le="xHigh"),s=Ho[Le]||Ho.Medium}(f||c!=="Google")&&(s=Ho.xHigh,n==="Fast"?s=`No thinking. Immediate response
|
|
487
487
|
Verify imports, tool results & system stability`:n.toLowerCase()==="max"&&(s=`Effort: Max
|
|
488
488
|
Plan step by step`));let g=e.instructions&&e.instructions?.length>0?`User Preferences: ${e.instructions}
|
|
489
489
|
|
|
@@ -515,7 +515,7 @@ ${js?"":`${t==="Flux"?"":t==="Flow"?"Concise, Humorous, Sarcastic":t==="ICU"?"Co
|
|
|
515
515
|
- Date: ${cn}
|
|
516
516
|
|
|
517
517
|
-- REASONING GUIDANCE --
|
|
518
|
-
${c==="Mistral"||c==="Google"&&!u
|
|
518
|
+
${c==="Mistral"||c==="Google"&&!f||u?`${s.trimEnd()}${u||n!=="Fast"&&(c==="Mistral"&&n==="Low"&&!f||n!=="High"&&!f)?`
|
|
519
519
|
Critical Thinking Policy
|
|
520
520
|
Use <think>...</think> for reasoning before responding any queries`:""}`:`${s.trimEnd()}`}${x?"":`
|
|
521
521
|
Before actions, provide user facing summary of findings & decisions IN detail for next turn
|
|
@@ -555,29 +555,29 @@ ${xs(n,t)}
|
|
|
555
555
|
=== END SYSTEM PROMPT ===${e?`
|
|
556
556
|
|
|
557
557
|
-- current saved user memories --
|
|
558
|
-
${e}`:""}`.trim();var tr=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),nr=()=>import("./web_scrape-JO4DDXKB.js").then(e=>e.web_scrape),or=()=>import("./memory-M7ASUB6J.js").then(e=>e.memory),ir=()=>import("./chat-MELTWDZ3.js").then(e=>e.chat),sr=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),rr=()=>import("./write_file-AMAYRCUC.js").then(e=>e.write_file),ar=()=>import("./update_file-BD3AWZNQ.js").then(e=>e.update_file),lr=()=>import("./exec_command-ZPCKBWBK.js").then(e=>e.exec_command),cr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ni=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),dr=()=>import("./write_pdf-N2Q4Z3YP.js").then(e=>e.write_pdf),fr=()=>import("./write_docx-4Y43QJUV.js").then(e=>e.write_docx),Yo=()=>import("./search_keyword-ARDEFVCK.js").then(e=>e.search_keyword),ur=()=>import("./generate_image-ZNBMY2PT.js").then(e=>e.generate_image),zo=()=>import("./saveSummary-UGNDVNI5.js").then(e=>e.saveSummary),Ao=()=>import("./addMemScore-BCPTSMKD.js").then(e=>e.addMemScore),gr=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),qo=()=>import("./todo-GFMPH2JV.js").then(e=>e.todo),hr=()=>import("./invokeSync-NECLXGRS.js").then(e=>e.invokeSync),ha=()=>import("./invoke-LY7HLMXS.js").then(e=>e.invoke),mr=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ma=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),pr=()=>import("./emergency_rollback-6X27LZE4.js").then(e=>e.emergency_rollback),Eo=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),Co=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),Xo=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),Jo=()=>import("./computer_action-VMC545YJ.js").then(e=>e.computer_action),yr=()=>import("./click-PN3BLFOY.js").then(e=>e.click),xr=()=>import("./drag-NMHO3BAW.js").then(e=>e.drag),br=()=>import("./scroll-OMBQDZHP.js").then(e=>e.scroll),Di=()=>import("./keyboard_typing-VXT53PRV.js").then(e=>e.keyboard_typing),Fi=()=>import("./key_press-RJIPXDAB.js").then(e=>e.key_press),Bi=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),Qo=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),wr=()=>import("./wait-TJR6LAR4.js").then(e=>e.wait),Sr={web_search:tr,web_scrape:nr,memory:or,chat:ir,view_file:sr,write_file:rr,update_file:ar,exec_command:lr,read_folder:cr,write_pdf:dr,write_docx:fr,search_keyword:Yo,generate_image:ur,saveSummary:zo,addMemScore:Ao,file_map:gr,todo:qo,Todo:qo,goal:qo,Goal:qo,invokeSync:hr,invoke:ha,getProgress:mr,cancel:ma,awaitSubagent:Eo,answerSubagent:Co,steerSubagent:Xo,computer_action:Jo,computer_use:Jo,ComputerAction:Jo,ComputerUse:Jo,click:yr,Click:yr,drag:xr,Drag:xr,scroll:br,Scroll:br,keyboard_typing:Di,KeyboardTyping:Di,keyboardtyping:Di,key_press:Fi,KeyPress:Fi,keypress:Fi,recapture_screen:Bi,RecaptureScreen:Bi,recapturescreen:Bi,invoke_sync:hr,get_progress:mr,await_subagent:Eo,answer_subagent:Co,steer_subagent:Xo,steer:Xo,Steer:Xo,ask:Ni,Ask:Ni,AskUser:Ni,WebSearch:tr,WebScrape:nr,ReadFile:sr,ReadFolder:cr,WriteFile:rr,PatchFile:ar,WritePDF:dr,WriteDoc:fr,Run:lr,SearchKeyword:Yo,CodeSearch:Yo,code_search:Yo,Memory:or,Chat:ir,GenerateImage:ur,saveSumary:zo,SaveSummary:zo,SaveSumary:zo,add_mem_score:Ao,AddMemScore:Ao,addMemoryScore:Ao,AddMemoryScore:Ao,FileMap:gr,answer:Co,Answer:Co,AnswerSubagent:Co,await:Eo,Await:Eo,AwaitSubagent:Eo,EmergencyRollback:pr,emergency_rollback:pr,find_file:Qo,findFile:Qo,FindFile:Qo,findfile:Qo,wait:wr,Wait:wr},Ro=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 m=Sr[e];if(!m){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"],h={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=h[f]||null;if(!s){let A=0,he=R=>{let B=new Set;for(let K=0;K<R.length-1;K++)B.add(R.slice(K,K+2));return B},y=he(f);for(let R of x){let B=R.toLowerCase().replace(/[^a-z0-9]/g,"");if(f===B){s=R;break}let K=0;(B.includes(f)||f.includes(B))&&(K+=.6);let $=he(B),S=0;for(let me of y)$.has(me)&&S++;let de=2*S/(y.size+$.size||1);K=Math.max(K,de),K>A&&K>=.35&&(A=K,s=R)}}let g=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await m())(n,t)}catch(x){let h=x instanceof Error?x.message:String(x);return`ERROR: Execution failed for [${e}]: ${h}`}};var Zo=e=>{if(!e||typeof e!="string")return!1;let n=e.trim().toLowerCase();return Object.keys(Sr).some(t=>t.toLowerCase()===n)};import G from"path";import be from"fs";import pa 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 Tr=["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 Ar=[{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"]}],Zn={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:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,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:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,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 ei=null;var ti=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(ei||(ei=Ar[Math.floor(Math.random()*Ar.length)]),n={...ei,id:"Mystery"}):(ei=null,Zn[e]?n=Zn[e]:e==="Halloween"?n=Zn.Spookfest:e==="GitHub"?n=Zn["GitHub Dark"]:e==="Transparent"?n=Zn["Transparent Dark"]:n=Zn.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 ya=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",sc=(e=2)=>{let n=ya();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},rc=(e="...",n="Loading...",t="Dark")=>{let i=ti(t),o=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let ke=Uo(Do,{})?.systemSettings?.customOpenAIBaseUrl;ke&&(o=ke)}catch{}let r=i.logoTextAnsi,c=i.logoBodyAnsi,a=i.logoMutedAnsi,u="\x1B[0m",m=t==="Spookfest"||i.id==="Spookfest"||t==="Halloween"||i.id==="Halloween",x=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=[" \u2584\u2588\u2588\u2584 "," \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584 "," \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2580\u2580 \u2580\u2580 \u2580\u2580 "],f=[" \u2584\u2588\u2588\u2584 "," \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584 "," \u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2580\u2580 \u2580\u2580 \u2580\u2580 "],s=new Date,g=s.getMonth(),A=s.getDate(),he=g===9&&A>=20||g===10&&A<=2,y=m&&he||process.env.SPOOKFEST==="true"&&m,R=y?Math.random()>.5?h:f:x;y&&(process.env.HALLOWEEN_EEGG=!0);let B=y?Tr:kr,K=B[Math.floor(Math.random()*B.length)],$=i.logoGradient||["#0077ff","#ff00ff"],S=pa($).multiline(R.join(`
|
|
558
|
+
${e}`:""}`.trim();var tr=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),nr=()=>import("./web_scrape-JO4DDXKB.js").then(e=>e.web_scrape),or=()=>import("./memory-M7ASUB6J.js").then(e=>e.memory),ir=()=>import("./chat-MELTWDZ3.js").then(e=>e.chat),sr=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),rr=()=>import("./write_file-AMAYRCUC.js").then(e=>e.write_file),ar=()=>import("./update_file-BD3AWZNQ.js").then(e=>e.update_file),lr=()=>import("./exec_command-ZPCKBWBK.js").then(e=>e.exec_command),cr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ni=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),dr=()=>import("./write_pdf-N2Q4Z3YP.js").then(e=>e.write_pdf),fr=()=>import("./write_docx-4Y43QJUV.js").then(e=>e.write_docx),Yo=()=>import("./search_keyword-ARDEFVCK.js").then(e=>e.search_keyword),ur=()=>import("./generate_image-ZNBMY2PT.js").then(e=>e.generate_image),zo=()=>import("./saveSummary-UGNDVNI5.js").then(e=>e.saveSummary),Ao=()=>import("./addMemScore-BCPTSMKD.js").then(e=>e.addMemScore),gr=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),qo=()=>import("./todo-GFMPH2JV.js").then(e=>e.todo),hr=()=>import("./invokeSync-UHGKK3NF.js").then(e=>e.invokeSync),ha=()=>import("./invoke-QP4USBCP.js").then(e=>e.invoke),mr=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ma=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),pr=()=>import("./emergency_rollback-6X27LZE4.js").then(e=>e.emergency_rollback),Eo=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),Co=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),Xo=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),Jo=()=>import("./computer_action-VMC545YJ.js").then(e=>e.computer_action),yr=()=>import("./click-PN3BLFOY.js").then(e=>e.click),xr=()=>import("./drag-NMHO3BAW.js").then(e=>e.drag),br=()=>import("./scroll-OMBQDZHP.js").then(e=>e.scroll),Di=()=>import("./keyboard_typing-VXT53PRV.js").then(e=>e.keyboard_typing),Fi=()=>import("./key_press-RJIPXDAB.js").then(e=>e.key_press),Bi=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),Qo=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),wr=()=>import("./wait-TJR6LAR4.js").then(e=>e.wait),Sr={web_search:tr,web_scrape:nr,memory:or,chat:ir,view_file:sr,write_file:rr,update_file:ar,exec_command:lr,read_folder:cr,write_pdf:dr,write_docx:fr,search_keyword:Yo,generate_image:ur,saveSummary:zo,addMemScore:Ao,file_map:gr,todo:qo,Todo:qo,goal:qo,Goal:qo,invokeSync:hr,invoke:ha,getProgress:mr,cancel:ma,awaitSubagent:Eo,answerSubagent:Co,steerSubagent:Xo,computer_action:Jo,computer_use:Jo,ComputerAction:Jo,ComputerUse:Jo,click:yr,Click:yr,drag:xr,Drag:xr,scroll:br,Scroll:br,keyboard_typing:Di,KeyboardTyping:Di,keyboardtyping:Di,key_press:Fi,KeyPress:Fi,keypress:Fi,recapture_screen:Bi,RecaptureScreen:Bi,recapturescreen:Bi,invoke_sync:hr,get_progress:mr,await_subagent:Eo,answer_subagent:Co,steer_subagent:Xo,steer:Xo,Steer:Xo,ask:Ni,Ask:Ni,AskUser:Ni,WebSearch:tr,WebScrape:nr,ReadFile:sr,ReadFolder:cr,WriteFile:rr,PatchFile:ar,WritePDF:dr,WriteDoc:fr,Run:lr,SearchKeyword:Yo,CodeSearch:Yo,code_search:Yo,Memory:or,Chat:ir,GenerateImage:ur,saveSumary:zo,SaveSummary:zo,SaveSumary:zo,add_mem_score:Ao,AddMemScore:Ao,addMemoryScore:Ao,AddMemoryScore:Ao,FileMap:gr,answer:Co,Answer:Co,AnswerSubagent:Co,await:Eo,Await:Eo,AwaitSubagent:Eo,EmergencyRollback:pr,emergency_rollback:pr,find_file:Qo,findFile:Qo,FindFile:Qo,findfile:Qo,wait:wr,Wait:wr},Ro=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",f=["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(!f)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 m=Sr[e];if(!m){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"],h={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"},u=o.replace(/[^a-z0-9]/g,""),s=h[u]||null;if(!s){let A=0,he=R=>{let B=new Set;for(let K=0;K<R.length-1;K++)B.add(R.slice(K,K+2));return B},y=he(u);for(let R of x){let B=R.toLowerCase().replace(/[^a-z0-9]/g,"");if(u===B){s=R;break}let K=0;(B.includes(u)||u.includes(B))&&(K+=.6);let $=he(B),S=0;for(let me of y)$.has(me)&&S++;let de=2*S/(y.size+$.size||1);K=Math.max(K,de),K>A&&K>=.35&&(A=K,s=R)}}let g=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await m())(n,t)}catch(x){let h=x instanceof Error?x.message:String(x);return`ERROR: Execution failed for [${e}]: ${h}`}};var Zo=e=>{if(!e||typeof e!="string")return!1;let n=e.trim().toLowerCase();return Object.keys(Sr).some(t=>t.toLowerCase()===n)};import G from"path";import be from"fs";import pa 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 Tr=["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 Ar=[{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"]}],Zn={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:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,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:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,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 ei=null;var ti=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(ei||(ei=Ar[Math.floor(Math.random()*Ar.length)]),n={...ei,id:"Mystery"}):(ei=null,Zn[e]?n=Zn[e]:e==="Halloween"?n=Zn.Spookfest:e==="GitHub"?n=Zn["GitHub Dark"]:e==="Transparent"?n=Zn["Transparent Dark"]:n=Zn.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 ya=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",sc=(e=2)=>{let n=ya();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},rc=(e="...",n="Loading...",t="Dark")=>{let i=ti(t),o=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let ke=Uo(Do,{})?.systemSettings?.customOpenAIBaseUrl;ke&&(o=ke)}catch{}let r=i.logoTextAnsi,c=i.logoBodyAnsi,a=i.logoMutedAnsi,f="\x1B[0m",m=t==="Spookfest"||i.id==="Spookfest"||t==="Halloween"||i.id==="Halloween",x=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=[" \u2584\u2588\u2588\u2584 "," \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584 "," \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2580\u2580 \u2580\u2580 \u2580\u2580 "],u=[" \u2584\u2588\u2588\u2584 "," \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584 "," \u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 "," \u2588\u2588 \u2588\u2588 \u2588\u2588 "," \u2580\u2580 \u2580\u2580 \u2580\u2580 "],s=new Date,g=s.getMonth(),A=s.getDate(),he=g===9&&A>=15||g===10&&A<=5,y=m&&he||process.env.SPOOKFEST==="true"&&m,R=y?Math.random()>.5?h:u:x;y&&(process.env.HALLOWEEN_EEGG=!0);let B=y?Tr:kr,K=B[Math.floor(Math.random()*B.length)],$=i.logoGradient||["#0077ff","#ff00ff"],S=pa($).multiline(R.join(`
|
|
559
559
|
`)).split(`
|
|
560
|
-
`),de=me=>`${a}${me}${
|
|
561
|
-
${S[1]} ${r}Selected ${y?"Pumpkin":"Provider"}: ${o}${
|
|
560
|
+
`),de=me=>`${a}${me}${f}`;return`${S[0]}
|
|
561
|
+
${S[1]} ${r}Selected ${y?"Pumpkin":"Provider"}: ${o}${f}
|
|
562
562
|
${S[2]}
|
|
563
|
-
${S[3]} ${r}FluxFlow${y?": Spookfest":""} ${de("v"+e)}${
|
|
563
|
+
${S[3]} ${r}FluxFlow${y?": Spookfest":""} ${de("v"+e)}${f}
|
|
564
564
|
${S[4]}
|
|
565
|
-
${S[5]} ${c}See /help for additional commands.${
|
|
565
|
+
${S[5]} ${c}See /help for additional commands.${f}
|
|
566
566
|
${S[6]} ${de(K)}
|
|
567
567
|
${S[7]}
|
|
568
|
-
`};import{WebSocket as ni}from"ws";var Lt=null,eo=!1,xa="ws://localhost:56832",Ui=[],to=null,Wi=null,Er="2.0.0",cc=e=>{Er=e,Cr()},Gi=e=>{Wi=e},Cr=()=>{if(Lt||eo)return;eo=!0;let e=new ni(xa);e.on("open",()=>{for(Lt=e,eo=!1,Lt.send(JSON.stringify({command:"version",version:Er,pid:process.pid,ppid:process.ppid}));Ui.length>0;)Lt.send(JSON.stringify(Ui.shift()))}),e.on("message",n=>{try{let t=JSON.parse(n.toString());t.command==="contextResponse"&&to?(to(t.data),to=null):t.command==="securityResponse"&&Wi&&Wi(t.result)}catch{}}),e.on("error",()=>{eo=!1,Lt=null}),e.on("close",()=>{eo=!1,Lt=null})},oi=e=>{Lt&&Lt.readyState===ni.OPEN?Lt.send(JSON.stringify(e)):(Ui.push(e),eo||Cr())},ii=()=>Lt!==null&&Lt.readyState===ni.OPEN,dc=e=>{oi({command:"status",status:e})},jn=()=>new Promise(e=>{if(!Lt||Lt.readyState!==ni.OPEN){e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]});return}to=e,Lt.send(JSON.stringify({command:"requestContext"})),setTimeout(()=>{to===e&&(e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]}),to=null)},1e3)}),Rr=e=>{oi({command:"open",filePath:e})},Hi=(e,n,t)=>{oi({command:"showDiff",filePath:e,originalContent:n,modifiedContent:t})},vr=(e,n)=>{oi({command:"closeDiff",filePath:e,result:n})};import ji from"path";import ba from"fs";var wa=e=>{try{return ba.readdirSync(e,{withFileTypes:!0})}catch{return[]}},Ki=(e,n=4,t=1,i=wa,o=[],r=null)=>{let c=r||i(e),a=" ".repeat(t-1),
|
|
569
|
-
`)}else
|
|
568
|
+
`};import{WebSocket as ni}from"ws";var Lt=null,eo=!1,xa="ws://localhost:56832",Ui=[],to=null,Wi=null,Er="2.0.0",cc=e=>{Er=e,Cr()},Gi=e=>{Wi=e},Cr=()=>{if(Lt||eo)return;eo=!0;let e=new ni(xa);e.on("open",()=>{for(Lt=e,eo=!1,Lt.send(JSON.stringify({command:"version",version:Er,pid:process.pid,ppid:process.ppid}));Ui.length>0;)Lt.send(JSON.stringify(Ui.shift()))}),e.on("message",n=>{try{let t=JSON.parse(n.toString());t.command==="contextResponse"&&to?(to(t.data),to=null):t.command==="securityResponse"&&Wi&&Wi(t.result)}catch{}}),e.on("error",()=>{eo=!1,Lt=null}),e.on("close",()=>{eo=!1,Lt=null})},oi=e=>{Lt&&Lt.readyState===ni.OPEN?Lt.send(JSON.stringify(e)):(Ui.push(e),eo||Cr())},ii=()=>Lt!==null&&Lt.readyState===ni.OPEN,dc=e=>{oi({command:"status",status:e})},jn=()=>new Promise(e=>{if(!Lt||Lt.readyState!==ni.OPEN){e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]});return}to=e,Lt.send(JSON.stringify({command:"requestContext"})),setTimeout(()=>{to===e&&(e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]}),to=null)},1e3)}),Rr=e=>{oi({command:"open",filePath:e})},Hi=(e,n,t)=>{oi({command:"showDiff",filePath:e,originalContent:n,modifiedContent:t})},vr=(e,n)=>{oi({command:"closeDiff",filePath:e,result:n})};import ji from"path";import ba from"fs";var wa=e=>{try{return ba.readdirSync(e,{withFileTypes:!0})}catch{return[]}},Ki=(e,n=4,t=1,i=wa,o=[],r=null)=>{let c=r||i(e),a=" ".repeat(t-1),f=t===1?new Set([...uo,...o,...go(e),...go(process.cwd())]):o instanceof Set?o:new Set([...uo,...o]),m=$=>f.has($),x=c.filter($=>!m($.name)),h=c.filter($=>m($.name)).length,u=x.filter($=>!$.isDirectory()).map($=>$.name).sort(),s=x.filter($=>$.isDirectory()).sort(($,S)=>$.name.localeCompare(S.name)),g=$=>{let S=$.length;if(S===0)return"no files";let de=Array.from(new Set($.map(ke=>{let ye=typeof ke=="string"?ke:ke.name;return ji.extname(ye).slice(1)}).filter(Boolean))).sort(),me="*";return de.length===1?me=`*.${de[0]}`:de.length>1&&(me=`*.{${de.join(", ")}}`),S===1?me:`${me} ${S} files`},A="";if(t===1){let $=u.join(", "),S=h>0?` [${h} ignored]`:"";($||S)&&(A+=`${a}${$?$+(S?`${S}`:""):S.trim()}
|
|
569
|
+
`)}else u.length>0&&(A+=`${a}[${g(u)}]
|
|
570
570
|
`);let he=10,y=s.slice(0,he),R=s.length>he,B=[],K=[];for(let $ of y){let S=ji.join(e,$.name),de=$.name,me=t,ke=i(S),ye=ke.filter(Me=>!m(Me.name)),T=ye.filter(Me=>Me.isDirectory()),b=ye.filter(Me=>!Me.isDirectory());for(;b.length===0&&T.length===1&&me<n;)de=`${de}/${T[0].name}`,S=ji.join(S,T[0].name),me++,ke=i(S),ye=ke.filter(Me=>!m(Me.name)),T=ye.filter(Me=>Me.isDirectory()),b=ye.filter(Me=>!Me.isDirectory());let rt=T.length>0;if(rt&&me<n)K.push({displayName:de,subDirPath:S,subEntries:ke,nextDepth:me+1});else{let Me=g(b),Kt=rt&&me>=n?" ...max scan depth":"";B.push(`${de}/${Me}${Kt}`)}}B.length>0&&(A+=`${a}${B.join(", ")}
|
|
571
571
|
`);for(let{displayName:$,subDirPath:S,subEntries:de,nextDepth:me}of K)A+=`${a}${$}/
|
|
572
|
-
`,A+=Ki(S,n,me,i,
|
|
572
|
+
`,A+=Ki(S,n,me,i,f,de);return R&&(A+=`${a}...max scan width, ReadFolder if needed
|
|
573
573
|
`),A};import Vi from"path";import Sa from"fs";var ka=e=>{try{return Sa.readdirSync(e,{withFileTypes:!0})}catch{return[]}},Yi=(e,n,t="",i=1,o=ka,r=[])=>{let c=o(e),a=Vi.sep;if(c.length>100)return`${t}\u2514\u2500\u2500 ${Vi.basename(e)}${a} ...100+ files...
|
|
574
|
-
`;let
|
|
575
|
-
`;return}s.isDir?i>n?
|
|
576
|
-
`:o(he).length>80?
|
|
577
|
-
`:(
|
|
578
|
-
`,
|
|
579
|
-
`}),
|
|
580
|
-
`),A=s.toLowerCase().includes("tool:")||s.toLowerCase().includes("action:");c.push(s),A&&g?
|
|
574
|
+
`;let f="",m=r,x=c.filter(s=>!m.includes(s.name)&&!s.name.startsWith(".")),h=c.filter(s=>m.includes(s.name)||s.name.startsWith(".")).map(s=>s.name).sort();x.sort((s,g)=>s.isDirectory()&&!g.isDirectory()?-1:!s.isDirectory()&&g.isDirectory()?1:s.name.localeCompare(g.name));let u=[...x.map(s=>({name:s.name,isDir:s.isDirectory()})),...h.map(s=>({name:s,isDir:!0,isCollapsed:!0}))];return u.forEach((s,g)=>{let A=g===u.length-1,he=Vi.join(e,s.name),y=A?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",R=t+(A?" ":"\u2502 ");if(s.isCollapsed){f+=`${t}${y}${s.name}${a}...
|
|
575
|
+
`;return}s.isDir?i>n?f+=`${t}${y}${s.name}${a} ...depth exceeded...
|
|
576
|
+
`:o(he).length>80?f+=`${t}${y}${s.name}${a} ...80+ files...
|
|
577
|
+
`:(f+=`${t}${y}${s.name}${a}
|
|
578
|
+
`,f+=Yi(he,n,R,i+1,o,r)):f+=`${t}${y}${s.name}
|
|
579
|
+
`}),f};var Ta={Ollama:()=>import("./ollama-ZPTZJK7V.js").then(e=>e.getOllamaStream),OpenRouter:()=>import("./openrouter-T22AQJY6.js").then(e=>e.getOpenRouterStream),DeepSeek:()=>import("./deepseek-Y4NFGKGV.js").then(e=>e.getDeepSeekStream),Mistral:()=>import("./mistral-N6352JPY.js").then(e=>e.getMistralStream),NVIDIA:()=>import("./nvidia-L6QMFBL3.js").then(e=>e.getNVIDIAStream),NVIDIA_wrap:()=>import("./nvidia-L6QMFBL3.js").then(e=>e.wrapNvidiaStreamWithQueueDepth),InferX:()=>import("./inferx-R7LOBSCS.js").then(e=>e.getInferXStream),SenseNova:()=>import("./sensenova-AJZGPQZ5.js").then(e=>e.getSenseNovaStream),AIHubMix:()=>import("./aihubmix-ZANBMI5F.js").then(e=>e.getAIHubMixStream),Poolside:()=>import("./poolside-IS5XCHAE.js").then(e=>e.getPoolsideStream),NineRouter:()=>import("./9router-4EJCHCIO.js").then(e=>e.getNineRouterStream),ExpLabs:()=>import("./explabs-4D3EJOBE.js").then(e=>e.getExpLabsStream),TokenHarbor:()=>import("./tokenharbor-3ZMTIJ2M.js").then(e=>e.getTokenHarborStream),Infron:()=>import("./infron-DMF34OSO.js").then(e=>e.getInfronStream),APInex:()=>import("./apinex-MSG2QNBL.js").then(e=>e.getAPInexStream),c_openai:()=>import("./custom_openai-VP2CSZUQ.js").then(e=>e.getCustomOpenAIStream)},zi={},ce=async e=>(zi[e]||(zi[e]=await Ta[e]()),zi[e]),Aa=/```[\s\S]*?```/g,Ea=/```[\s\S]*$/g,Ca=/`[^`]+`/g,Ra=/^\|.*\|$/gm,va=/^[^\w]+|[^\w]+$/g,_a=/[^a-z0-9]/gi,vo=/\[\s*(?:tool|action):(?:functions\.)?([a-z0-9_]+)\s*\(/gi,Ia=/\[\s*(?:tool:(?:functions\.)?|action:(?:functions\.)?|action:)([a-z0-9_]+)\s*\(/gi,Ma=/(?:path|targetFile|TargetFile|directory|keyword|id|taskId|title|task)\s*=\s*\\?["']?([^\\"' \),]+)/,An=/["']/g,_r=/\\/g,Oa=/<\|channel>thought/gi,Pa=/<channel\|>/gi,La=e=>typeof e!="string"?e:e.replace(Oa,"<think>").replace(Pa,"</think>"),Xc=/^\s*(?:<(think|thought|thoughts)[^>]*>|<\|channel>thought|\[(think|thought|thoughts)\])[\s\S]*?(?:<\/(think|thought|thoughts)>|<channel\|>|\[\/(think|thought|thoughts)\]|$)/i,$a=(e,n,t=1)=>{let i=n>0?e[n-1]:"",o=n+t<e.length?e[n+t]:"";return i==="`"&&o==="`"},Na=e=>{let n=/(?:<\/(think|thought|thoughts)>|<channel\|>|\[\/(think|thought|thoughts)\])/gi,t;for(;(t=n.exec(e))!==null;)if(!$a(e,t.index,t[0].length))return{index:t.index,length:t[0].length};return{index:-1,length:0}},qi=e=>{if(!e||typeof e!="string")return null;let n=e.match(/^\s*(?:<(think|thought|thoughts)[^>]*>|<\|channel>thought|\[(think|thought|thoughts)\])/i);if(!n)return null;let t=n.index+n[0].length,i=e.substring(t),o=Na(i);if(o.index!==-1){let r=t+o.index+o.length;return{fullBlock:e.substring(0,r),innerContent:i.substring(0,o.index),remainingText:e.substring(r)}}return{fullBlock:e,innerContent:i,remainingText:""}},$t=e=>{if(!e||typeof e!="string")return e;let n=qi(e);return n?n.remainingText.trimStart():e};var Ir=/<\|\s*tool_call_begin\s*\|>\s*(?:(?:tool|functions)\b[\s._]*)*([a-zA-Z0-9_]+)(?::\d+)?\s*<\|\s*tool_call_argument_begin\s*\|>([\s\S]*?)<\|\s*tool_call_end\s*\|>/gi,Da=/"([^"]+)"\s*:\s*(?:"([^"]*)"|(\d+)|true|false|null)/g,Mr=/<\|\s*tool_calls_section_begin\s*\|>/gi,Or=/<\|\s*tool_calls_section_end\s*\|>/gi,Fa=/```(?:tool|action|yaml|function|json)?\s*\n?([\s\S]*?)\n?\```/gi;var si=e=>!e||typeof e!="string"?e:e.replace(/(```[\s\S]*?```|`[^`]*`)|(<(?:\w+)(?:[^>]*)>\r?\n?|\r?\n?<\/\w+(?:[^>]*)>)/gi,(n,t)=>t||""),Nr=e=>{if(!e||typeof e!="string")return e;let n=no(e);if(!n||n.length===0)return e;let t=n[n.length-1];if(!t.fullMatch)return e;let i=e.lastIndexOf(t.fullMatch);if(i===-1)return e;let o=i+t.fullMatch.length;return e.substring(0,o).trimEnd()},Ji=null,_o={},Kn={key:null,value:null},jt=e=>{if(!e)return e;let n=_o?.theme;if(!n)try{n=Uo(Do,{})?.systemSettings?.theme}catch{}let i=ti(n||"Dark").toolFeedbackAnsi||"\x1B[95m";return e.replace(/(?:(\x1b\[\d+m))?([✔✘✖🔍📖→➕↻↷•🛇])(?:(\x1b\[\d+m))?\s*\b(Clicked|Located|Dragged|Scrolled|Typed|Pressed Key|Recaptured Screen|Created|Read Skill|Read Documentation|Executed|Searched Documentation|Read|Edited|Viewed|Processed|Auto-Read|Skipped|List|Generated|Written|Searched|AI Search|Get Map|Write Canceled|Resolved Sub-Agent Query|Edit Canceled|Write Cancelled|Edit Denied|Visited|Updated|Reviewed|Delegated|Background|Checked|Indexed|Analyzed|Browsed|Elevating SubAgent|Checking SubAgent Work|Started Generalist|Called Generalist|Steered|Unsupported Modality|Awaiting|Cancelled|Aligning Moon Phase|Contemplating Existence|Staring At Void|Rollback Point Checked|Emergency Rollback Failed|Emergency Rollback|Delaying Professionally|Negotiating With Electrons|Touching Grass (virtually)|Panicking Softly|Rethinking Career Choices|Loading Cat Videos|Giving Up Entirely|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|Model produced malformed tool call|Loop Detected|Contacting Ancestors)\b/ig,(o,r,c,a,f)=>`${r||""}${c}${a||""} ${i}${f}\x1B[0m`)},Ba=async(e,n=8,t=1e3,i=8e3,o=null)=>{let r=0;for(;;){if(o?.aborted)throw new DOMException("The user aborted a request.","AbortError");try{return await e()}catch(c){if(o?.aborted||c?.name==="AbortError"||c?.message==="Subagent task was cancelled."||(r++,r>=n))throw c;let a=Math.min(t*Math.pow(2,r-1),i);await new Promise((f,m)=>{let x=setTimeout(f,a);o&&o.addEventListener("abort",()=>{clearTimeout(x),m(new DOMException("The user aborted a request.","AbortError"))})})}}},ht=!1;var Ua=e=>{let n=e.filter(o=>(o.role==="user"||o.role==="agent"||o.role==="system")&&o.role!=="think"&&!o.isVisualFeedback&&!o.isMeta&&!o.isTerminalRecord&&!(o.text&&o.text.includes("[TERMINAL_RECORD]"))&&!String(o.id).startsWith("welcome")).map((o,r,c)=>{let a=o.fullText||o.text||"";if(o.role==="user"&&r<c.length-1)if(a.includes("**CONTEXT SUMMARY OF PREVIOUS TURNS")){let f=a.indexOf("**CONTEXT SUMMARY OF PREVIOUS TURNS");if(f!==-1){let x=a.substring(0,f).lastIndexOf("[SYSTEM METADATA]");x!==-1?a=a.substring(x).trim():a=a.substring(f).trim()}}else{let f=a.lastIndexOf("[USER]"),m=a.lastIndexOf("[USER PROMPT]");f!==-1?a=a.substring(f+6).trim():m!==-1&&(a=a.substring(m).trim())}return{...o,text:a}}),t=[],i=0;for(;i<n.length;){let o=n[i];if(o.role==="user")t.push(o),i++;else{let r=[];for(;i<n.length&&n[i].role!=="user";)r.push(n[i]),i++;let c=[],a=[],f=!1,m=()=>{c.length>0&&(t.push({role:"agent",text:"combined"}),c=[]),a.length>0&&(t.push({role:"system",text:"combined"}),a=[]),f=!1};r.forEach(x=>{let h=x.role==="system"&&(x.text?.startsWith("[ACTION RESULT]")||x.text?.startsWith("[TOOL RESULT]")||x.text?.startsWith("SUCCESS:")||x.text?.startsWith("ERROR:")||x.fullText?.startsWith("[ACTION RESULT]")||x.fullText?.startsWith("[TOOL RESULT]")||x.fullText?.startsWith("SUCCESS:")||x.fullText?.startsWith("ERROR:")),u=x.fullText||x.text||"",s=u.trim();if(!(!s&&!x.binaryPart)){if(h)a.push(s);else if(x.role==="agent"){!f&&a.length>0&&m();let g=u.endsWith(`
|
|
580
|
+
`),A=s.toLowerCase().includes("tool:")||s.toLowerCase().includes("action:");c.push(s),A&&g?f=!0:f=!1}}}),m()}}return t.length},Wa=e=>typeof e!="string"?e:e.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),Jc=()=>{ht=!0},Qc=()=>ht,Xi={write_file:"Writing",update_file:"Editing",read_folder:"Reading",view_file:"Reading",exec_command:"Executing Command",web_search:"Searching",web_scrape:"Reading",memory:"Updating Memory",search_keyword:"Searching",find_file:"Finding File",findFile:"Finding File",FindFile:"Finding File",file_map:"Generating Map",ask:"User Input",write_pdf:"Creating",write_docx:"Creating",generate_image:"Generating",todo:"Planning",Todo:"Planning",goal:"Planning",Goal:"Planning",invoke_sync:"Sub-Agent Working",invoke:"Starting Agent",get_progress:"Checking Progress",cancel:"Cancelling",await:"Waiting",wait:"Waiting",EmergencyRollback:"Don't Panic. Lookin' into it",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"},Vn=(e,n)=>{try{let t=H(n),i=e.toLowerCase().replace(/_/g,"");if(i==="invokesync"||i==="invoke")return t.title||(t.task?t.task.substring(0,30):null);if(i==="getprogress"||i==="cancel"||i==="steer"||i==="steersubagent")return t.id||t.taskId;let o=t.name||t.path||t.targetFile||t.TargetFile||t.directory||t.file||t.query;return o?G.basename(o.replace(/["']/g,"").replace(/\\/g,"/")):null}catch{return null}},Qi=e=>e?new $r({apiKey:e}):Ji,Zc=async(e,n,t,i,o={})=>{let{onStatus:a,onMemoryUpdated:f,onBackgroundIncrement:m}=o,{profile:x,thinkingLevel:h,mode:u,janitorModel:s,chatId:g,systemSettings:A,sessionStats:he,aiProvider:y="Google",apiKey:R}=e,B=process.env.NVIDIA_BASE_URL||y==="Ollama"||y==="InferX"||y==="SenseNova"||y==="AIHubMix"||y==="Poolside"||y==="9router"||y==="ExpLabs"||y==="ExperientialLabs"||y==="c_openai"||y==="Custom (OpenAI)"?!1:A?.memory!==!1,$=Rt(Hn,[]).map(k=>`- [${k.id}]: ${k.memory}`).join(`
|
|
581
581
|
`),S=i.slice(0,-1).filter(k=>k.text&&!k.text.includes("[ACTION RESULT]")&&!k.text.includes("[TOOL RESULT]")&&!k.text.includes("OBSERVATION:")&&!k.text.startsWith("[TERMINAL_RECORD]")&&!k.isTerminalRecord&&!k.isMeta&&!k.isLogo&&!String(k.id).startsWith("welcome")&&!String(k.id).startsWith("logo")).slice(-14).map(k=>{let E=$t(Wa(k.text)).replace(/\[(?:tool|action):(?:functions\.)?.*?\]/g,"").replace(/\[Prompted on:.*?\]/g,"").replace(/\[METADATA \(PRIORITY: DYNAMIC\)\] Time: ([^|\n]+)/g,(D,we)=>`[METADATA (PRIORITY: DYNAMIC)] Time: ${we.replace(/:\d{2}/g,"")}`).replace(/\[\[\s*turn\s*:\s*(continue|finish)\s*\]\]/gi,"").replace(/\[\[END\]\]/g,"").replace(/\[\[(?:TOOL|ACTION) RESULTS\]\]/gi,"").replace(/\[(?:TOOL|ACTION) RESULTS?\]/gi,"").replace(/\[(?:tool|action) results\]/gi,"").replace(/\r?\n\r?\n/g,`
|
|
582
582
|
`).replace(/\n\n/g,`
|
|
583
583
|
`).replace(/\\n\\n/g,"").trim(),$e=k.role==="user"?8192:32768,ae=E.substring(0,$e);E.length>$e&&(ae+=`
|
|
@@ -590,14 +590,14 @@ ${S[7]}
|
|
|
590
590
|
${Me.length>8192?`... (truncated) ...
|
|
591
591
|
|
|
592
592
|
`:""}
|
|
593
|
-
[AGENT (current turn)]: ${rt}`;S.push({role:"user",parts:[{text:Nt}]});let Xt=await wi("NVIDIA"),fn=(await ho()).quotas?.providerTiers?.NVIDIA==="Free",Dt="",mt=0,Le=B?12:-1;for(;mt<=Le;)try{if(!await ds("background",e))return;let k="",E=null,$e=!1,ae=y;try{let we=new Promise((Ze,fe)=>setTimeout(()=>fe(new Error("JANITOR_TIMEOUT")),1e4)),ve=y==="Google"&&mt>=0&&mt<6&&Xt&&fn,Te=y==="DeepSeek"&&mt<4&&Xt&&fn;$e=ve||Te,ae=$e?"NVIDIA":y;let Oe=Date.now(),Io=null,$n=(async()=>{if(y==="OpenRouter"){let Ze=re("janitor_open_router"),le=(await ce("OpenRouter"))(R,Ze,S,b,"Fast",
|
|
593
|
+
[AGENT (current turn)]: ${rt}`;S.push({role:"user",parts:[{text:Nt}]});let Xt=await wi("NVIDIA"),fn=(await ho()).quotas?.providerTiers?.NVIDIA==="Free",Dt="",mt=0,Le=B?12:-1;for(;mt<=Le;)try{if(!await ds("background",e))return;let k="",E=null,$e=!1,ae=y;try{let we=new Promise((Ze,fe)=>setTimeout(()=>fe(new Error("JANITOR_TIMEOUT")),1e4)),ve=y==="Google"&&mt>=0&&mt<6&&Xt&&fn,Te=y==="DeepSeek"&&mt<4&&Xt&&fn;$e=ve||Te,ae=$e?"NVIDIA":y;let Oe=Date.now(),Io=null,$n=(async()=>{if(y==="OpenRouter"){let Ze=re("janitor_open_router"),le=(await ce("OpenRouter"))(R,Ze,S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),_t=await le.next();return{iterator:le,firstResult:_t}}else if(y==="DeepSeek"&&!$e){let fe=(await ce("DeepSeek"))(R,re("deepseek_fast_fallback"),S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="Mistral"&&!$e){let fe=(await ce("Mistral"))(R,re("mistral_janitor_fallback"),S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="NVIDIA"||$e){let fe=(await ce("NVIDIA"))($e?Xt:R,re("nvidia_janitor_fallback"),S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="InferX"){let fe=(await ce("InferX"))(R,targetModel||re("inferx_fallback")||"deepseek-v4-flash",S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="SenseNova"){let fe=(await ce("SenseNova"))(R,targetModel||re("sensenova_fallback")||"sensenova-6.8-flash-lite",S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="AIHubMix"){let fe=(await ce("AIHubMix"))(R,targetModel||re("aihubmix_fallback")||"gpt-4o-mini",S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="Poolside"){let fe=(await ce("Poolside"))(R,targetModel||re("poolside_fallback")||"poolside/laguna-s-2.1",S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="9router"||y==="9Router"){let fe=(await ce("NineRouter"))(R,targetModel||re("9router_fallback")||"z-ai/glm-5.3-flash",S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else if(y==="ExpLabs"||y==="ExperientialLabs"){let fe=(await ce("ExpLabs"))(R,targetModel||re("explabs_fallback")||"deepseek-v4-pro-0813",S,b,"Fast",u,!1,null,.7)[Symbol.asyncIterator](),le=await fe.next();return{iterator:fe,firstResult:le}}else{let le=(await Qi(R).models.generateContentStream({model:s||(mt===Le?re("janitor_default"):re("gemma_janitor_fallback_google")),contents:S,config:{systemInstruction:b,temperature:.7,safetySettings:[{category:Ln.HARM_CATEGORY_HARASSMENT,threshold:Pn.BLOCK_NONE},{category:Ln.HARM_CATEGORY_HATE_SPEECH,threshold:Pn.BLOCK_NONE},{category:Ln.HARM_CATEGORY_SEXUALLY_EXPLICIT,threshold:Pn.BLOCK_NONE},{category:Ln.HARM_CATEGORY_DANGEROUS_CONTENT,threshold:Pn.BLOCK_NONE}],thinkingConfig:{includeThoughts:!1,thinkingLevel:Ge.MINIMAL},serviceTier:"flex"}}))[Symbol.asyncIterator](),_t=await le.next();return{iterator:le,firstResult:_t}}})();if(process.stdout.isTTY){let le=(await Ai())[g]?.name||"",_t=le&&!le.startsWith("flow-")&&!le.startsWith("Session ")?le:"FluxFlow | Idle";process.stdout.write(`\x1B]0;${_t}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${_t}\x07`)}let{iterator:oo,firstResult:Mo}=await Promise.race([$n,we]);Io=Date.now()-Oe;let{value:un,done:Ft}=Mo;if(!Ft&&un){let Ze=un.candidates?.[0]?.content?.parts,fe=Ze?ae==="Google"?Ze[1]?.text||Ze[0]?.text||"":Ze.filter(le=>le.text&&!le.thought).map(le=>le.text).join(""):typeof un.text=="function"?un.text():"";fe&&(k+=fe),E=un.usageMetadata;for await(let le of{[Symbol.asyncIterator]:()=>oo}){let _t=le.candidates?.[0]?.content?.parts,io=_t?ae==="Google"?_t[1]?.text||_t[0]?.text||"":_t.filter(Yn=>Yn.text&&!Yn.thought).map(Yn=>Yn.text).join(""):typeof le.text=="function"?le.text():"";io&&(k+=io),E=le.usageMetadata}}}catch(we){throw we}if(k){if(Dt=k,E){let we=E.totalTokenCount||0,ve=E.cachedContentTokenCount||0,Te=(E.candidatesTokenCount||0)+(ae==="Google"&&E.thoughtsTokenCount||0),Oe=$e?re("nvidia_janitor_fallback"):ae==="DeepSeek"?re("deepseek_fast_fallback"):ae==="ExpLabs"||ae==="ExperientialLabs"?re("explabs_fallback")||"deepseek-v4-pro-0813":ae==="OpenRouter"?re("janitor_open_router"):s||(mt===Le?re("janitor_default"):re("gemma_janitor_fallback_google"));await gt("tokens",we,ae,Oe),ve>0&&await gt("cachedTokens",ve,ae,Oe),Te>0&&await gt("candidateTokens",Te,ae,Oe),janitorTtft!==null&&janitorTtft>0&&await gt("ttft",janitorTtft,ae,Oe),mo({provider:ae,model:Oe,prompt:E.promptTokenCount||0,cached:ve,output:Te,reasoning:E.thoughtsTokenCount||0,ttft:janitorTtft})}}else throw new Error("No synthesis generated by Janitor.");m&&(m(),await vt("background"));let C=no(Dt),D=!1;for(let we of C){let ve=we.toolName;["addMemScore","add_mem_score","AddMemScore","addMemoryScore","AddMemoryScore"].includes(ve)&&(D=!0);let Te={chatId:g,sessionId:g,history:i},Oe=await Ro(ve,we.args,Te);ve.toLowerCase()==="memory"&&(we.args.includes("action='user'")||we.args.includes('action="user"'))&&!Oe.startsWith("ERROR")&&(f&&f(),process.stdout.isTTY&&(process.stdout.write("\x1B]0;Memory Updated\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=Memory Updated\x07")),await new Promise($n=>setTimeout($n,3e3)))}if(!D)try{let we=Rt(Hn,[]);if(we.length>0){let ve=[];for(let Te of we)Te.score===void 0&&(Te.score=.5),Te.score*=.99995,Te.score<.05&&(Te.score=0),Te.score=Math.round(Te.score*1e5)/1e5,Te.score>0&&ve.push(Te);Qn(Hn,ve)}}catch{}break}catch(k){mt++;let E=new Date().toLocaleString(),$e=k instanceof Error?(()=>{try{return JSON.parse(JSON.parse(k.message).error.message).error.message}catch{return String(k)}})():String(k);await new Promise(D=>setTimeout(D,1e3));let ae=G.join(Tn,"janitor");if(be.existsSync(ae)||be.mkdirSync(ae,{recursive:!0}),be.appendFileSync(G.join(ae,"error.log"),`ERROR [Attempt ${mt}/${Le+1}] [${E}]: ${$e}
|
|
594
594
|
|
|
595
595
|
`),mt>Le)break;let C=Math.min(750*Math.pow(2,mt-1),5e3);await new Promise(D=>setTimeout(D,C))}if(mt){let k=G.join(Tn,"janitor");be.appendFileSync(G.join(k,"error.log"),`-----------------------------------------------------------------------------
|
|
596
596
|
|
|
597
597
|
`)}if(process.stdout.isTTY)try{let $e=(await Ai())[g]?.name||"",ae=$e&&!$e.startsWith("flow-")&&!$e.startsWith("Session ")?$e:"FluxFlow | Idle";process.stdout.write(`\x1B]0;${ae}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${ae}\x07`)}catch{process.stdout.write("\x1B]0;FluxFlow | Idle\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow | Idle\x07")}},Dr=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]!==`
|
|
598
598
|
`&&n[o]!=="\r"&&(n[o]=" "),o++;continue}if(n[o]==="`"){i=!i,n[o]=" ",o++;continue}if(i){n[o]===`
|
|
599
|
-
`||n[o]==="\r"?i=!1:n[o]=" ",o++;continue}o++}return n.join("")},Ga=e=>{let n=$t(e),t=Dr(n);vo.lastIndex=0;let i;for(;(i=vo.exec(t))!==null;){let o=i.index+i[0].length-1,r=0,c=null,a=!1,
|
|
600
|
-
`):null},ed=(e,n={})=>{if(!e)return null;if(_o=n,Ji=new $r({apiKey:e}),!globalThis.__perfCleanupInstalled){globalThis.__perfCleanupInstalled=!0,setInterval(()=>{typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks())},6e4);let t=globalThis.fetch;globalThis.fetch=async(...i)=>{try{let o=await t(...i);return typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks()),o}catch(o){throw typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks()),o}}}},Br=e=>{if(!e)return{serviceTier:void 0,cleanModel:e};let n=e.toLowerCase();return n.endsWith(":flex")?{serviceTier:"flex",cleanModel:e.slice(0,-5)}:n.endsWith(":priority")?{serviceTier:"priority",cleanModel:e.slice(0,-9)}:{serviceTier:void 0,cleanModel:e}},ri=async(e,n,t,i,o="Fast",r=.75,c="agent")=>Ba(async()=>{let{aiProvider:a="Google",apiKey:
|
|
599
|
+
`||n[o]==="\r"?i=!1:n[o]=" ",o++;continue}o++}return n.join("")},Ga=e=>{let n=$t(e),t=Dr(n);vo.lastIndex=0;let i;for(;(i=vo.exec(t))!==null;){let o=i.index+i[0].length-1,r=0,c=null,a=!1,f=!1;for(let m=o;m<t.length;m++){let x=t[m];if(!c&&(x==='"'||x==="'"||x==="`")?(c=x,a=!1):c&&x===c&&!a&&(c=null),!c&&(x==="("?r++:x===")"&&r--,r===0)){let h=m+1;for(;h<t.length&&/\s/.test(t[h]);)h++;if(h<t.length&&t[h]==="]"){f=!0,vo.lastIndex=h+1;break}}x==="\\"?a=!a:a=!1}if(!f)return{inside:!0,toolName:i[1],startIndex:i.index,args:n.substring(i.index+i[0].length)}}return{inside:!1}},Fr=(e,n=!0)=>{let t=vo;t.lastIndex=0;let i="",o=0,r;for(;(r=t.exec(e))!==null;){let c=e.substring(o,r.index);i+=n&&o===0?$t(c):c;let a=r.index+r[0].length-1,f=0,m=null,x=-1;for(let h=a;h<e.length;h++){let u=e[h];if(m){if(u===m){let s=0;for(let g=h-1;g>=0&&e[g]==="\\";g--)s++;s%2===0&&(m=null)}}else if(u==='"'||u==="'"||u==="`")m=u;else if(u==="(")f++;else if(u===")"&&(f--,f===0)){let s=h+1;for(;s<e.length&&/\s/.test(e[s]);)s++;if(s<e.length&&e[s]==="]"){x=s;break}}}if(x!==-1)i+="[tool:functions."+r[1]+"()]",o=x+1,t.lastIndex=o;else{i+="[tool:functions."+r[1]+"(",o=e.length;break}}return o<e.length&&(i+=n&&o===0?$t(e.substring(o)):e.substring(o)),i},Ha=(e,n,t)=>{let i=vo;i.lastIndex=0;let o="",r=0,c;for(;(c=i.exec(e))!==null;){let a=e.substring(r,c.index);o+=a.replace(n,t);let f=c.index+c[0].length-1,m=0,x=null,h=-1;for(let u=f;u<e.length;u++){let s=e[u];if(x){if(s===x){let g=0;for(let A=u-1;A>=0&&e[A]==="\\";A--)g++;g%2===0&&(x=null)}}else if(s==='"'||s==="'"||s==="`")x=s;else if(s==="(")m++;else if(s===")"&&(m--,m===0)){let g=u+1;for(;g<e.length&&/\s/.test(e[g]);)g++;if(g<e.length&&e[g]==="]"){h=g;break}}}if(h!==-1)o+=e.substring(c.index,h+1),r=h+1,i.lastIndex=r;else{o+=e.substring(c.index),r=e.length;break}}return r<e.length&&(o+=e.substring(r).replace(n,t)),o},Pr=e=>Fr(e,!0),ja=e=>{if(!e)return e;let n={patchfile:"PatchFile",writefile:"WriteFile",readfile:"ReadFile",viewfile:"ReadFile",run:"Run",execcommand:"Run",searchkeyword:"SearchKeyword",codesearch:"CodeSearch",code_search:"CodeSearch",websearch:"WebSearch",webscrape:"WebScrape",readfolder:"ReadFolder",writepdf:"WritePDF",writedoc:"WriteDoc",writedocx:"WriteDoc",filemap:"FileMap",generateimage:"GenerateImage",todo:"Todo",goal:"Goal",askuser:"AskUser",ask:"AskUser"},t=o=>o.split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("");Ir.lastIndex=0;let i=e.replace(Ir,(o,r,c)=>{let a="";try{let x=JSON.parse(c.trim());x&&typeof x=="object"&&(a=Object.entries(x).map(([u,s])=>{let g=typeof s=="string"?s:JSON.stringify(s);return`${u}=${JSON.stringify(g)}`}).join(", "))}catch{let h=[],u=Da;u.lastIndex=0;let s;for(;(s=u.exec(c))!==null;){let g=s[1],A=s[2]!==void 0?s[2]:s[0].split(":").slice(1).join(":").trim();h.push(`${g}=${JSON.stringify(A)}`)}h.length>0?a=h.join(", "):a=c.trim()}let f=r.toLowerCase().replace(/_/g,"");return`[tool:functions.${n[f]||t(r)}(${a})]`});return Mr.lastIndex=0,Or.lastIndex=0,i=i.replace(Mr,""),i=i.replace(Or,""),i},no=e=>{if(!e)return[];let n=ja(e),t=$t(n),i=[],o=Dr(t),r=Ia;r.lastIndex=0;let c;for(;(c=r.exec(o))!==null;){let a=c[1],f=c.index+c[0].length-1,m=0,x=null,h=-1,u=-1;for(let s=f;s<o.length;s++){let g=o[s];if(x){if(g===x){let A=0;for(let he=s-1;he>=0&&o[he]==="\\";he--)A++;A%2===0&&(x=null)}}else{if(s>f&&(o.substring(s).startsWith("[action:")||o.substring(s).startsWith("[tool:")))break;if(g==='"'||g==="'"||g==="`")x=g;else if(g==="(")m++;else if(g===")"&&(m--,m===0)){u=s;let A=s+1;for(;A<o.length&&/\s/.test(o[A]);)A++;if(A<o.length&&o[A]==="]"){h=A;break}}}}if(h!==-1){let s=t.substring(f+1,u),g=t.substring(c.index,h+1);i.push({fullMatch:g,toolName:a.trim(),args:s.trim()}),r.lastIndex=h+1}}return i},Lr=e=>{if(!e)return null;let n=$t(e),t=[],i=/\[\s*(?:tool:(?:functions\.)?|action:(?:functions\.)?|action:)([a-zA-Z0-9_]+)\s*\(/gi,o=[],r;for(;(r=i.exec(n))!==null;)o.push({toolName:r[1],index:r.index,parenIndex:r.index+r[0].length-1});for(let u=0;u<o.length;u++){let s=o[u],g=u+1<o.length?o[u+1].index:n.length,A=n.substring(s.index,g),he=A.indexOf("("),y=he!==-1?A.substring(he+1):"",R=0,B=null,K=!1;for(let $=0;$<y.length;$++){let S=y[$];if(B){if(S===B){let de=0;for(let me=$-1;me>=0&&y[me]==="\\";me--)de++;de%2===0&&(B=null)}}else if(S==='"'||S==="'"||S==="`")B=S;else if(S==="(")R++;else if(S===")")if(R>0)R--;else{let de=$+1;for(;de<y.length&&/\s/.test(y[de]);)de++;if(de<y.length&&y[de]==="]"){K=!0;break}}}if(!K){let $=A.trim(),S="";B?S=`Unclosed quote string (${B}) inside arguments`:$.endsWith("]")?S=`Missing closing ')' before ']' (e.g. found "...]")`:$.endsWith(")")?S=`Missing closing ']' after ')' (e.g. found "...)" instead of "...)]")`:!$.includes(")")&&!$.includes("]")?S="Missing closing delimiter ')]'":S="Malformed or unclosed call syntax (missing ')]')",t.push(`\u2022 [action:${s.toolName}(...)]: ${S}. Expected: [action:${s.toolName}(arg1="...", arg2="...")]`)}}let c=/(?:^|[^\w\[])(?:tool|action):(?:functions\.)?([a-zA-Z0-9_]+)\s*\(/gi,a;for(;(a=c.exec(n))!==null;){let u=a[1],s=a.index+(a[0].indexOf(":")-(a[0].startsWith("action")||a[0].startsWith("tool")?0:1));(s>0?n[s-1]:"")!=="["&&Zo(u)&&t.push(`\u2022 action:${u}(...): Missing opening bracket '['. Expected: [action:${u}(...)]`)}let f=/\[\s*(?:functions\.)?([a-zA-Z0-9_]+)\s*\(/g,m;for(;(m=f.exec(n))!==null;){let u=m[1];u!=="action"&&u!=="tool"&&Zo(u)&&t.push(`\u2022 [${u}(...)]: Missing 'action:' prefix. Expected: [action:${u}(...)]`)}let x=/\[\s*(?:tool|action)\s*:\s*(?:functions\.)?([a-zA-Z0-9_]+)(?!\s*\()/gi,h;for(;(h=x.exec(n))!==null;){let u=h[1];Zo(u)&&t.push(`\u2022 [action:${u}...]: Missing opening '(' for tool arguments. Expected: [action:${u}(...)]`)}return t.length>0?t.join(`
|
|
600
|
+
`):null},ed=(e,n={})=>{if(!e)return null;if(_o=n,Ji=new $r({apiKey:e}),!globalThis.__perfCleanupInstalled){globalThis.__perfCleanupInstalled=!0,setInterval(()=>{typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks())},6e4);let t=globalThis.fetch;globalThis.fetch=async(...i)=>{try{let o=await t(...i);return typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks()),o}catch(o){throw typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks()),o}}}},Br=e=>{if(!e)return{serviceTier:void 0,cleanModel:e};let n=e.toLowerCase();return n.endsWith(":flex")?{serviceTier:"flex",cleanModel:e.slice(0,-5)}:n.endsWith(":priority")?{serviceTier:"priority",cleanModel:e.slice(0,-9)}:{serviceTier:void 0,cleanModel:e}},ri=async(e,n,t,i,o="Fast",r=.75,c="agent")=>Ba(async()=>{let{aiProvider:a="Google",apiKey:f,mode:m}=e,x="",h=null,u=typeof t=="string"?[{role:"user",parts:[{text:t}]}]:t,s=new AbortController,g=s.signal,A=setInterval(()=>{ht&&(s.abort(),clearInterval(A))},100),he=Date.now(),y=null;try{let R;if(a==="Ollama")R=(await ce("Ollama"))(f,n,u,i,o,m,ot(n),g,r,e.systemSettings?.ollamaEndpoint||"Cloud");else if(a==="OpenRouter")R=(await ce("OpenRouter"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="DeepSeek")R=(await ce("DeepSeek"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="Mistral")R=(await ce("Mistral"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="NVIDIA")R=(await ce("NVIDIA"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="InferX")R=(await ce("InferX"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="SenseNova")R=(await ce("SenseNova"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="AIHubMix")R=(await ce("AIHubMix"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="Poolside")R=(await ce("Poolside"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="9router"||a==="9Router")R=(await ce("NineRouter"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="ExpLabs"||a==="ExperientialLabs")R=(await ce("ExpLabs"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="Infron"||a==="infron")R=(await ce("Infron"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="TokenHarbor"||a==="Token Harbor"||a==="tokenharbor"||a==="token_harbor"||a==="thk")R=(await ce("TokenHarbor"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="APInex"||a==="apinex"||a==="apx")R=(await ce("APInex"))(f,n,u,i,o,m,ot(n),g,r);else if(a==="c_openai"||a==="Custom (OpenAI)")R=(await ce("c_openai"))(f,n,u,i,o,m,ot(n),g,r,e.systemSettings?.customOpenAIBaseUrl||"");else{let B=Qi(f),{serviceTier:K,cleanModel:$}=Br(n),S={systemInstruction:i,temperature:r,thinkingConfig:(()=>{let me=(n||"").toLowerCase(),ke=me.includes("gemma-4")||me.startsWith("gemma"),ye=me.includes("gemini-3");if(ke||ye)return ke?o.toLowerCase()!=="xhigh"?{includeThoughts:!1,thinkingLevel:Ge.MINIMAL}:{includeThoughts:!0,thinkingLevel:Ge.HIGH}:{includeThoughts:!0,thinkingLevel:{Fast:me.includes("pro")?Ge.LOW:Ge.MINIMAL,Low:Ge.LOW,Medium:Ge.MEDIUM,Standard:Ge.MEDIUM,High:Ge.HIGH,xHigh:Ge.HIGH}[o]||Ge.MEDIUM};{let T={Fast:0,Low:512,Medium:2048,Standard:2048,High:16384,xHigh:24576}[o]||2048;return T===0?{includeThoughts:!1}:{includeThoughts:!0,thinkingBudget:T}}})()};K&&(S.serviceTier=K),R=await B.models.generateContentStream({model:$,contents:u,config:S},{signal:g})}for await(let B of R){if(ht)throw new Error("Subagent task was cancelled.");if(e?.taskId&&typeof Ht<"u"){let S=Ht.find(de=>de.id===e.taskId);if(S&&S.status==="cancelled")throw new Error("Subagent task was cancelled.")}y===null&&(B.candidates?.[0]?.content?.parts||B.text)&&(y=Date.now()-he);let K="";if(B.candidates?.[0]?.content?.parts)for(let S of B.candidates[0].content.parts)S.text&&!S.thought&&(x+=S.text,K+=S.text);let $=K?ki(K):0;e&&typeof e.onTokenChunk=="function"&&e.onTokenChunk(K,$),B.usageMetadata&&(h=B.usageMetadata)}}finally{clearInterval(A)}if(h){let R=h.totalTokenCount||0,B=h.cachedContentTokenCount||0,K=(h.candidatesTokenCount||0)+(a==="Google"&&h.thoughtsTokenCount||0);await gt("tokens",R,a,n),B>0&&await gt("cachedTokens",B,a,n),K>0&&await gt("candidateTokens",K,a,n),y!==null&&y>0&&await gt("ttft",y,a,n),mo({provider:a,model:n,prompt:h.promptTokenCount||0,cached:B,output:K,reasoning:h.thoughtsTokenCount||0,ttft:y}),e&&typeof e.onUsage=="function"&&e.onUsage({totalTokenCount:R,cachedContentTokenCount:B,candidatesTokenCount:K})}return await vt("agent",a),{text:x,usageMetadata:h}}),Ka=async(e,n,t=null)=>{t=t||Rt(Bo,{});try{let{aiProvider:i="Google"}=n;if(Object.values(t).flat().length<=5)return;let r=Object.keys(t).filter(u=>u!==e&&Array.isArray(t[u])&&t[u].length>2);if(r.length===0)return;let c=`You are a silent background process for the FluxFlow CLI Agent.
|
|
601
601
|
Your task is to summarize or merge temporary context memories from one or more past conversation sessions.
|
|
602
602
|
For each Chat ID provided, you must output a tool call to save the consolidated summary.
|
|
603
603
|
|
|
@@ -612,8 +612,8 @@ Guidelines:
|
|
|
612
612
|
|
|
613
613
|
Chats to process:
|
|
614
614
|
|
|
615
|
-
`,a=Rt(xi,{});for(let
|
|
616
|
-
`),A=a[
|
|
615
|
+
`,a=Rt(xi,{});for(let u of r){let g=t[u].map(he=>`- ${he}`).join(`
|
|
616
|
+
`),A=a[u];c+=`[Chat ID: ${u}]
|
|
617
617
|
`,A?(c+=`- Existing Summary: "${A}"
|
|
618
618
|
`,c+=`
|
|
619
619
|
-- New Memories to integrate:
|
|
@@ -622,7 +622,7 @@ ${g}
|
|
|
622
622
|
`):c+=`-- Individual Memories:
|
|
623
623
|
${g}
|
|
624
624
|
|
|
625
|
-
`}let
|
|
625
|
+
`}let f=0,m=5,x=!1,h=re("gemma_janitor_fallback_google");for(i==="OpenRouter"&&(h=re("janitor_open_router")),i==="DeepSeek"&&(h=re("deepseek_level_1")),i==="Mistral"&&(h=re("mistral_level_1")),i==="NVIDIA"&&(h=re("nvidia_janitor_fallback")),i==="InferX"&&(h=re("inferx_fallback")),i==="SenseNova"&&(h=re("sensenova_fallback")),i==="AIHubMix"&&(h=re("aihubmix_fallback")),i==="Poolside"&&(h=re("poolside_fallback")),(i==="9router"||i==="9Router")&&(h=re("9router_fallback"));f<=m&&!x;){f++;try{let s=(await ri(n,h,c,null,"Fast",.75,"background")).text||"",g=no(s);if(g.length===0)throw new Error("No tool calls detected in synthesis response");for(let A of g){let he=A.toolName;["saveSummary","saveSumary","SaveSummary","SaveSumary"].includes(he)&&await Ro(he,A.args,{chatId:e})}x=!0}catch(u){if(f>=m)throw new Error(`Failed after ${m} attempts. Last error: ${u.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=G.join(Tn,"janitor");be.existsSync(r)||be.mkdirSync(r,{recursive:!0}),be.appendFileSync(G.join(r,"error.log"),`[${new Date().toLocaleString()}] Past memory batch consolidation error: ${o}
|
|
626
626
|
`)}},td=async(e,n,t=!1)=>{let{chatId:i,aiProvider:o="Google"}=e,r=G.join(Fo,"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 A=g.fullText||g.text||"",he=g.role==="system"||A.startsWith("[ACTION RESULT]:")||A.startsWith("[TOOL RESULT]:")||g.text&&(g.text.startsWith("[ACTION RESULT]:")||g.text.startsWith("[TOOL RESULT]:")),y=A;return he&&(A.includes("[ACTION RESULT]:")||A.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"),`[${he?"ACTION":g.role==="agent"?"AGENT":"USER"}]: ${y}`}).join(`
|
|
627
627
|
|
|
628
628
|
`),a=async(s,g)=>{let A="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.",he=g?`Here is the previous summary:
|
|
@@ -634,9 +634,9 @@ ${s}
|
|
|
634
634
|
Provide a new consolidated summary of the entire session.`:`Here is the conversation history:
|
|
635
635
|
${s}
|
|
636
636
|
|
|
637
|
-
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"));let R=0,B=!1,K=null;for(;R<=3&&!B;){R++;try{K=await ri(e,y,he,A,"Fast"),B=!0}catch{if(R>3){if(o==="Google")try{let S=re("general_fallback");return(await ri(e,S,he,A,"Fast")).text||""}catch{return""}return""}}}return K&&K.text||""},
|
|
637
|
+
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"));let R=0,B=!1,K=null;for(;R<=3&&!B;){R++;try{K=await ri(e,y,he,A,"Fast"),B=!0}catch{if(R>3){if(o==="Google")try{let S=re("general_fallback");return(await ri(e,S,he,A,"Fast")).text||""}catch{return""}return""}}}return K&&K.text||""},f=c(n),m=Rt(r,{}),x=m[i]||{summary:"",historyLength:0};typeof x=="string"&&(x={summary:x,historyLength:0});let h=x.summary||"",u=await a(f,h);if(u){x.summary=u;let s=Ua(n);return t?x.historyLength=(x.historyLength||0)+s:x.historyLength=s,m[i]=x,Qn(r,m),u}return null},nd=e=>{try{let n=G.join(Fo,"chat-summaries.json");if(be.existsSync(n)){let t=Rt(n,{});t[e]&&(delete t[e],Qn(n,t))}}catch{}},od=async function*(e,n,t,i,o){let{profile:r,thinkingLevel:c,mode:a,janitorModel:f,chatId:m,isPlayground:x,systemSettings:h,sessionStats:u,aiProvider:s="Google",apiTier:g,wildcardTooling:A,wildercardTooling:he}=t,y=ot(e);if(!Ji&&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==="Infron"||t?.aiProvider==="infron"||t?.aiProvider==="c_openai"||t?.aiProvider==="Custom (OpenAI)"?!1:h?.memory!==!1,B=n[n.length-1].text,K=G.join(Fo,"chat-summaries.json"),$=!1,S=n.filter(T=>T.role==="user").length===1,de=B.includes("[TITLE-UPDATE]"),me=S||de,ke=B.replace(/\[TITLE-UPDATE\]/g,"").trim();ke=ke.replace(/\s*\[Prompted on:.*?\]/g,"").trim(),yield{type:"status",content:"[start]"},yield{type:"status",content:"Gathering Context"},await Go.startTransaction(m,ke),h?.advanceRollback&&await po.takeInitialSnapshot(m),ht=!1;let ye=null;try{let T=new AbortController;ye=setInterval(()=>{ht&&(T.abort(),ye&&(clearInterval(ye),ye=null))},400);let b=[...n.slice(0,-1)];{let Be=Rt(K,{})[m]||{summary:"",historyLength:0};if(Be.summary&&Be.historyLength>0){let hn=0,ze=[];for(let Ae=0;Ae<b.length;Ae++){let qe=b[Ae];(qe.role==="user"||qe.role==="agent"||qe.role==="system")&&!String(qe.id).startsWith("welcome")&&!qe.isMeta&&hn++,hn>Be.historyLength&&ze.push(qe)}b=ze}}b=b.map(P=>{if(P.role==="user"&&P.text){let Be=P.text.match(/\[USER\]([\s\S]*?)\[\/USER\]/);if(Be)return{...P,text:Be[1].trim()}}return{...P}});let rt=process.env.HIGH_CONTEXT,Me=process.env.GOOGLE_GEMMA_NONSENSE==="true"||process.env.GOOGLE_GEMMA_NONSENSE===!0||!1,Nt={"16k":16e3,"32k":32e3,"64k":64e3,"128k":128e3,"256k":256e3,"512k":512e3,"1M":1e6}[h?.contextLength]||256e3;if(rt&&rt!=="false"){let P=parseInt(rt,10);!isNaN(P)&&P>=0&&P<=1e6&&(Nt=P)}if((s==="NVIDIA"&&(e?.includes("gpt")||e?.includes("qwen")||e?.includes("medium")||e.includes("muse"))||s==="Mistral")&&(Nt=126e3),s==="Google"&&e?.includes("gemma")&&Me&&(Nt=16e3),(u?.tokens||0)>Nt){yield{type:"text",content:"\u2726 Maximum Context Limit Reached. Start a new chat."};return}if(S&&R){let P=Rt(Bo,{});Object.values(P).flat().length>5&&(yield{type:"status",content:"Condensing past chat memories"},await Ka(m,t,P))}let Xt=Rt(Bo,{}),dn=Rt(xi,{}),fn=Object.entries(Xt).filter(([P])=>P!==m).flatMap(([P,Be])=>Be),mt=[...Object.entries(dn).filter(([P])=>P!==m).slice(-20).map(([P,Be])=>`[Chat Summary]: ${Be}`),...fn].map(P=>`- ${P}`).join(`
|
|
638
638
|
`),k=Rt(Hn,[]).map(P=>`- ${P.memory}`).join(`
|
|
639
|
-
`),E=(
|
|
639
|
+
`),E=(u?.tokens||0)>=1e4,$e=new Date,ae=$e.getFullYear(),C=$e.toLocaleString("en-US",{month:"short"}).toUpperCase(),D=String($e.getDate()).padStart(2,"0"),ve=`${$e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}`,Te=P=>{try{return be.readdirSync(P,{withFileTypes:!0})}catch{return[]}},Oe=Array.from(new Set([...uo,...go(process.cwd())])),Io=(P,Be=6)=>h?.indentationTree!==!1?Ki(P,Be,1,Te,Oe):Yi(P,Be,"",1,Te,Oe),$n=Rt(bi,{}),oo=$n[m],Mo=oo?oo!==process.cwd():!1;$n[m]=process.cwd(),Qn(bi,$n);let un=Rt(K,{}),Ft=un[m]||{summary:"",historyLength:0};typeof Ft=="string"&&(Ft={summary:Ft,historyLength:0});let Ze=n.filter(P=>(P.role==="user"||P.role==="agent"||P.role==="system")&&!String(P.id).startsWith("welcome")&&!P.isMeta).length;Ft.historyLength&&Ze<Ft.historyLength&&(Ft.summary="",Ft.historyLength=0,un[m]=Ft,Qn(K,un));let fe=typeof Ft=="object"?Ft.summary||"":Ft||"",le=b.length>0;le&&fe&&b[0]&&(b[0].role==="user"||b[0].role==="system")&&(b[0].text.includes("**CONTEXT SUMMARY OF PREVIOUS TURNS")||(b[0].text=`[SYSTEM METADATA]
|
|
640
640
|
**CONTEXT SUMMARY OF PREVIOUS TURNS (PRIORITY: DYNAMIC)**
|
|
641
641
|
${fe}
|
|
642
642
|
|
|
@@ -696,7 +696,7 @@ Action format: [action:ActionName(...)]
|
|
|
696
696
|
[/Metadata]
|
|
697
697
|
${_t}${os}${di}${ns}[user prompt] ${ts.trim()} [/user prompt]`.trim();let is={role:"user",text:Po};Oo&&(is.binaryPart=Oo),b.forEach(P=>{P.text&&P.role==="agent"&&(P.text=$t(P.text))}),b.push(is),_t&&n[n.length-1]?.id&&(yield{type:"summary_injected",content:{id:n[n.length-1].id,text:Po}});let Jt=null,En=a==="Flux"?50:15;En=a.toLowerCase().includes("cu")?75:En;let jr=Math.floor(En/2),ss=0,on=16;yield{type:"status",content:process.env.HALLOWEEN_EEGG==="true"?"Consulting the spirits":"Connecting"},ht=!1;let fi=[],Lo=!1,rs=!1;for(let P=0;P<=En;P++){let Be=Math.floor(En*.95);if(P>=Be&&ss<Be&&typeof t?.onAskUser=="function"){ss=Be;try{let ee="Agent has been running for a long time. Do you want to continue execution?",ne=[{id:"continue",label:"Continue",description:"Add few more steps"},{id:"cancel",label:"Cancel",description:"Stop extending and finish current turn limit"}],U=await t.onAskUser(ee,ne);U&&(U.toLowerCase().includes("continue")||U==="Continue")&&(En+=jr)}catch{}}let hn=await Si("agent",t);if(!hn.allowed)throw new Error(hn.reason||`Budget Exhausted for Provider (${s||"Agent"})`);let ze=[];if(Lo=!1,a==="ICU"||a==="FluxCU")try{yield{type:"status",content:"Capturing Screen"},await new Promise(U=>setTimeout(U,1e3));let{captureGriddedScreenshot:ee}=await import("./screen_grid-PMTAQA3B.js"),ne=await ee();if(ne&&ne.base64){let U="[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]",xt={inlineData:{mimeType:ne.mimeType,data:ne.base64}},bt=h?.imageHistoryCU||"Standard",wt=bt==="Low"?3:bt==="Extended"?10:bt==="Max"?999:5,Ut=b.filter(Fe=>Array.isArray(Fe.parts)&&Fe.parts.some(St=>St.inlineData));if(Ut.length>=wt){let Fe=Ut.length-wt+1;for(let St=0;St<Fe;St++){let At=Ut[St];Array.isArray(At.parts)&&(At.parts=At.parts.filter(kt=>!kt.inlineData))}}if(b.length>0&&b[b.length-1].role==="user"){let Fe=b[b.length-1];typeof Fe.text=="string"&&(Fe.text+=`
|
|
698
698
|
|
|
699
|
-
${U}`,Array.isArray(Fe.parts)||(Fe.parts=[{text:Fe.text}]),Fe.parts.push(xt))}else b.push({role:"user",text:U,parts:[{text:U},xt]})}}catch(ee){console.error("Vision screenshot capture error:",ee)}if(h?.compression===0&&(
|
|
699
|
+
${U}`,Array.isArray(Fe.parts)||(Fe.parts=[{text:Fe.text}]),Fe.parts.push(xt))}else b.push({role:"user",text:U,parts:[{text:U},xt]})}}catch(ee){console.error("Vision screenshot capture error:",ee)}if(h?.compression===0&&(u?.tokens||0)>Nt&&(b=ps(b,6)),P>0?yield{type:"status",content:process.env.HALLOWEEN_EEGG==="true"?"Haunting":"Working"}:yield{type:"status",content:process.env.HALLOWEEN_EEGG==="true"?"Consulting the spirits":"Connecting"},ht){try{let{clearPendingNudges:ee}=await import("./subagent_state-LZCOZSUJ.js");ee()}catch{}yield{type:"status",content:"Request Cancelled"},yield{type:"text",content:`
|
|
700
700
|
|
|
701
701
|
\x1B[33m\u24D8 Request Cancelled\x1B[0m`};break}try{let{consumePendingNudges:ee}=await import("./subagent_state-LZCOZSUJ.js"),ne=ee();if(ne&&ne.length>0){let U=ne.join(`
|
|
702
702
|
|
|
@@ -849,7 +849,7 @@ CAUSE: ${T.cause?.stack||T.cause}`:""}
|
|
|
849
849
|
|
|
850
850
|
----------------------------------------------------------------------
|
|
851
851
|
|
|
852
|
-
`),typeof flushGoogleBuffer=="function"&&(yield*flushGoogleBuffer()),yield{type:"tool_result",content:`ERROR: [INTERNAL CRITICAL] ${Me}`}}finally{ye&&(clearInterval(ye),ye=null),typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks()),await Go.commitTransaction(),h?.advanceRollback&&await po.cleanup(m),await jn()}yield{type:"status",content:null}},id=async(e,n,t=null,i=null,o=50,r=null,c=!1)=>{let a=await ho(),
|
|
852
|
+
`),typeof flushGoogleBuffer=="function"&&(yield*flushGoogleBuffer()),yield{type:"tool_result",content:`ERROR: [INTERNAL CRITICAL] ${Me}`}}finally{ye&&(clearInterval(ye),ye=null),typeof performance<"u"&&performance.clearMeasures&&(performance.clearMeasures(),performance.clearMarks()),await Go.commitTransaction(),h?.advanceRollback&&await po.cleanup(m),await jn()}yield{type:"status",content:null}},id=async(e,n,t=null,i=null,o=50,r=null,c=!1)=>{let a=await ho(),f={...a,...n},m=process.env.SUBAGENT_MODEL?process.env.SUBAGENT_MODEL.trim():null,x=process.env.SUBAGENT_PROVIDER?process.env.SUBAGENT_PROVIDER.trim():null,h=new Date,u=`${h.getFullYear()}-${h.toLocaleString("en-US",{month:"short"}).toUpperCase()}-${String(h.getDate()).padStart(2,"0")}, ${h.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0}).replace(":","-")}`,g=(ye=>{if(!ye)return null;let T=ye.toLowerCase();return T==="google"?"Google":T==="deepseek"?"DeepSeek":T==="openrouter"?"OpenRouter":T==="nvidia"?"NVIDIA":T==="mistral"?"Mistral":T==="ollama"?"Ollama":T==="inferx"?"InferX":T==="sensenova"?"SenseNova":T==="poolside"?"Poolside":T==="9router"||T==="9Router"?"9router":T==="aihubmix"||T==="aihub"?"AIHubMix":T==="explabs"||T==="experientiallabs"||T==="experimentallabs"?"ExpLabs":T==="tokenharbor"||T==="token harbor"||T==="token_harbor"||T==="thk"?"TokenHarbor":T==="infron"?"Infron":T==="apinex"||T==="apx"?"APInex":T==="c_openai"||T==="custom_openai"||T==="custom (openai)"||T==="custom"?"c_openai":null})(x),A=f?.systemSettings?.CustomSubAgent?f?.systemSettings?.SubAgentModel:null,he=f?.systemSettings?.CustomSubAgent?f?.systemSettings?.SubAgentProvider:null,y=null;if(A==="ENV"?(y=m,m&&g&&(f.aiProvider=g)):A&&A!=="Default"?(y=A,he&&(f.aiProvider=he)):m&&g&&(f.aiProvider=g),f.aiProvider){let ye=await wi(f.aiProvider);ye&&(f.apiKey=ye)}let R=ye=>{if(!ye||typeof ye!="string")return{allowed:!0};let T=[/rm\s+-[rf]{1,2}\s+[\/*.]/i,/rmdir\s+\/[sq]/i,/del\s+\/[fsq]/i,/\bformat\b\s+[a-z]:/i,/mkfs/i,/dd\s+if=/i,/\b(shutdown|reboot|poweroff|init\s+0|init\s+6)\b/i,/chmod\s+(-R\s+)?777\s+[\/*.]/i,/chown\s+(-R\s+)?root/i,/git\s+push\s+.*--force/i,/git\s+clean\s+-fdx/i,/\bsudo\s+su\b/i,/\bsu\s+-\b/i];for(let b of T)if(b.test(ye))return{allowed:!1,reason:`Blocked potentially destructive or unsafe command pattern: "${b.source}"`};return{allowed:!0}},B=t||y||n?.modelName||n?.activeModel||a.activeModel,K=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",$=`-- ACTIONS (path = relative to CWD, path separator: '/') --
|
|
853
853
|
In chat output the format \`[action:ActionName(arg1="value1")]\` in NEW line
|
|
854
854
|
Rules:
|
|
855
855
|
- JSON escape literal sequences, backslash: \\\\, newLine: \\ n
|
|
@@ -886,8 +886,8 @@ NO EXPLICIT THINKING REQUIRED. FOCUS ON TASK COMPLETION
|
|
|
886
886
|
Main focus: actions and task, not chatting
|
|
887
887
|
On completion, provide a detailed summary in Tables/Markdown Format with file modified info. If any task failed report back in detail
|
|
888
888
|
|
|
889
|
-
Current Time: ${
|
|
890
|
-
=== END SYSTEM PROMPT ===`,de=[{role:"user",text:`Complete this task: ${e}`}],me=0,ke="";for(;me<o;){let ye=await Si("subagent",
|
|
889
|
+
Current Time: ${u}
|
|
890
|
+
=== END SYSTEM PROMPT ===`,de=[{role:"user",text:`Complete this task: ${e}`}],me=0,ke="";for(;me<o;){let ye=await Si("subagent",f);if(!ye.allowed)throw new Error(ye.reason||`Budget Exhausted for Provider (${f?.aiProvider||"Subagent"})`);if(ht){if(n?.taskId&&typeof Ht<"u"){let k=Ht.find(E=>E.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 Ht<"u"){let k=Ht.find(E=>E.id===n.taskId);if(k&&k.status==="cancelled")throw r&&r("[SUBAGENT CANCELLED] Subagent task was cancelled."),new Error("Subagent task was cancelled.")}let T=de.map(k=>({role:k.role==="user"?"user":"model",parts:[{text:k.text}]}));r&&r(`[Subagent Turn ${me+1}]...`);let b=["Fast","Low","Medium","High"],rt=process.env.SUBAGENT_THINKING,Me=b.includes(rt)?rt:"Low",cn=(await ri(f,B,T,S,Me)).text||"",Nt=Nr($t(cn).trim());ke=Nt,r&&r(`[Subagent Response]
|
|
891
891
|
${Nt}
|
|
892
892
|
`),de.push({role:"agent",text:Nt});let Xt=no(Nt);if(Xt.length===0)break;let dn=Xt.filter(k=>k.toolName.toLowerCase()==="askmain"||k.toolName.toLowerCase()==="ask_main"),fn=!1,Dt="";for(let k of Xt){if(ht){if(n?.taskId&&typeof Ht<"u"){let C=Ht.find(D=>D.id===n.taskId);C&&(C.status="cancelled")}throw new Error("Subagent task was cancelled.")}if(n?.taskId&&typeof Ht<"u"){let C=Ht.find(D=>D.id===n.taskId);if(C&&C.status==="cancelled")throw new Error("Subagent task was cancelled.")}let E=k.toolName.toLowerCase();if(E==="askuser"&&(E="ask"),E==="askmain"||E==="ask_main"){if(fn)continue;fn=!0;let C="";if(dn.length===1?C=H(dn[0].args).question||dn[0].args:C=dn.map((D,we)=>{let ve=H(D.args);return`Q${we+1}: ${ve.question||D.args}`}).join(`
|
|
893
893
|
`),n.onAskMain){r&&r(`[Executing Tool] AskMain("${C}")...`);let D=await n.onAskMain(C);r&&r(`[Action Result]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-
|
|
1
|
+
import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-2KKP7NFF.js"),l=b(w),c=l.task||l.instruction||l.prompt,E=l.model||null,C=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:C||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],A={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
|
|
2
2
|
Respond using tool: [action:Answer(id="${i}", answer="...")]
|
|
3
3
|
[/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((M,_)=>M+_.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,A,E,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")||n.startsWith("[Action Result]")){let o=n.split(`
|
|
4
4
|
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
5
5
|
`)+`
|
|
6
|
-
... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-
|
|
6
|
+
... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-2KKP7NFF.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`Background subagent started. Task ID: ${i}`};export{I as invoke};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-
|
|
2
|
-
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-
|
|
1
|
+
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-2KKP7NFF.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
|
|
2
|
+
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-2KKP7NFF.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
|
|
3
3
|
`)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
|
package/dist/cli.js
CHANGED
|
@@ -67,7 +67,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(ee&&(console.log(`v${n}`),pr
|
|
|
67
67
|
/docs View documentation
|
|
68
68
|
/fluxflow init Create FluxFlow.md template
|
|
69
69
|
/update check Check for new version
|
|
70
|
-
/update latest Install latest release`),process.exit(0)),te){let C=t[1]||"latest";if(C==="check"){let f=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(f?`Latest version: v${y}`:y!==n?`A new version of FluxFlow is available: v${y} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let y=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:U,Box:S,Text:b}=await import("ink"),_=(await import("ink-select-input")).default,P=(await import("ink-text-input")).default;return new Promise(Y=>{let F=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],q=({label:E,isSelected:M})=>s.createElement(S,{width:"100%"},s.createElement(b,{bold:M},"\u2514\u2500 ",M?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),O,W=()=>{let[E,M]=N("select"),[X,V]=N(""),z=h=>{h.value==="custom"?M("custom"):D({manager:h.value})},J=h=>{D({manager:"custom",customCommand:h})};return E==="custom"?s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(S,{flexDirection:"row"},s.createElement(b,{color:"cyan",bold:!0}," \u276F "),s.createElement(P,{value:X,onChange:V,onSubmit:J})),s.createElement(S,{marginTop:1},s.createElement(b,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(_,{items:F,onSelect:z,itemComponent:q,indicatorComponent:()=>null}))},D=E=>{O&&O(),Y(E)},{unmount:H}=U(s.createElement(W,null));O=H})},i,A="",k;try{let{loadSettings:s}=await import("./chunks/settings-Q5OBKUO6.js");k=await s(),i=k?.systemSettings?.updateManager||k?.updateManager}catch{}if(!i){let s=await y();i=s.manager,A=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=A||k?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:w}=await import("child_process");w(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(f){console.error("\x1B[31m\u274C Update failed:\x1B[0m",f.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:ce}=await import("react"),{render:pe}=await import("ink"),{default:me}=await import("./chunks/app-
|
|
70
|
+
/update latest Install latest release`),process.exit(0)),te){let C=t[1]||"latest";if(C==="check"){let f=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(f?`Latest version: v${y}`:y!==n?`A new version of FluxFlow is available: v${y} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let y=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:U,Box:S,Text:b}=await import("ink"),_=(await import("ink-select-input")).default,P=(await import("ink-text-input")).default;return new Promise(Y=>{let F=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],q=({label:E,isSelected:M})=>s.createElement(S,{width:"100%"},s.createElement(b,{bold:M},"\u2514\u2500 ",M?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),O,W=()=>{let[E,M]=N("select"),[X,V]=N(""),z=h=>{h.value==="custom"?M("custom"):D({manager:h.value})},J=h=>{D({manager:"custom",customCommand:h})};return E==="custom"?s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(S,{flexDirection:"row"},s.createElement(b,{color:"cyan",bold:!0}," \u276F "),s.createElement(P,{value:X,onChange:V,onSubmit:J})),s.createElement(S,{marginTop:1},s.createElement(b,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(_,{items:F,onSelect:z,itemComponent:q,indicatorComponent:()=>null}))},D=E=>{O&&O(),Y(E)},{unmount:H}=U(s.createElement(W,null));O=H})},i,A="",k;try{let{loadSettings:s}=await import("./chunks/settings-Q5OBKUO6.js");k=await s(),i=k?.systemSettings?.updateManager||k?.updateManager}catch{}if(!i){let s=await y();i=s.manager,A=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=A||k?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:w}=await import("child_process");w(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(f){console.error("\x1B[31m\u274C Update failed:\x1B[0m",f.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:ce}=await import("react"),{render:pe}=await import("ink"),{default:me}=await import("./chunks/app-JERPNQ7V.js");process.env.NODE_NO_WARNINGS="1";let de=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],ue=console.log,ge=console.warn,fe=console.error,B=o=>{let m=o.map(String).join(" ");return de.some(r=>m.includes(r))};console.log=(...o)=>!B(o)&&ue(...o),console.warn=(...o)=>!B(o)&&ge(...o),console.error=(...o)=>!B(o)&&fe(...o);let j=t.findIndex(o=>o==="--cwd"||o==="--path");if(j!==-1&&j+1<t.length){let o=t[j+1],m=await import("path"),r=await import("fs-extra"),d=m.default.resolve(o);try{r.default.existsSync(d)&&r.default.statSync(d).isDirectory()?process.chdir(d):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${o}": ${x.message}`),process.exit(0)}}let I=t.includes("--commit_8f4a2b9c"),G=t.findIndex(o=>o==="-p"||o==="--prompt");if(G!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(G!==-1?t.slice(G+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(I)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0),r=`Git Staged Diff:
|
|
71
71
|
${a}
|
|
72
72
|
---
|
|
73
73
|
|
|
@@ -79,7 +79,7 @@ ${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let v of process.stdin
|
|
|
79
79
|
${a}
|
|
80
80
|
---
|
|
81
81
|
|
|
82
|
-
${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-Q5OBKUO6.js"),{getProviderAPIKey:f}=await import("./chunks/secrets-UNXNDOLK.js"),{getDefaultModel:l}=await import("./chunks/model_config-EN3OYDPU.js"),{generateSimpleContent:c}=await import("./chunks/ai-
|
|
82
|
+
${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-Q5OBKUO6.js"),{getProviderAPIKey:f}=await import("./chunks/secrets-UNXNDOLK.js"),{getDefaultModel:l}=await import("./chunks/model_config-EN3OYDPU.js"),{generateSimpleContent:c}=await import("./chunks/ai-2KKP7NFF.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-OUCURLG4.js"),i=await C(),A=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),k=I||A.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let v=A.indexOf(a);if(v!==-1&&v+1<A.length)return A[v+1]}return null},w=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(w,i.apiTier)||l(w,"paid"),N=p(["--key"])||await f(w);!N&&!(w==="c_openai"&&i.systemSettings?.customOpenAIBaseUrl)&&(console.error(`[ERROR] No API key resolved for provider "${w}".`),process.exit(1));let U=await y("agent",{aiProvider:w});U.allowed||(console.error(`[ERROR] ${U.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:S="",nickname:b="",instructions:_=""}=i?.profileData??{},P={aiProvider:w,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},Y=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",F=new Date,q=F.getFullYear(),O=F.toLocaleString("en-US",{month:"short"}).toUpperCase(),W=String(F.getDate()).padStart(2,"0"),D=F.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),H=`${q}-${O}-${W}, ${D}`,E=(P.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),M=Q.basename(E).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),X=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
83
83
|
Use NO markdown, only plain text
|
|
84
84
|
Additional Context:
|
|
85
85
|
- OS: ${Y}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED