fluxflow-cli 5.8.2 → 5.8.3
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-6AJFPN2Z.js → ai-HJLIIEAI.js} +1 -1
- package/dist/chunks/{app-IHDTJVWM.js → app-PUZUWEF7.js} +1 -1
- package/dist/chunks/{auto_completion-5MT5LOPN.js → auto_completion-6FMBGXUX.js} +1 -1
- package/dist/chunks/{chunk-ODFXGBVT.js → chunk-7C3KU5TK.js} +2 -2
- package/dist/chunks/{invoke-HBTZTVAB.js → invoke-V7YYWNND.js} +2 -2
- package/dist/chunks/{invokeSync-XAAZL7L2.js → invokeSync-UCS3MUA3.js} +2 -2
- package/dist/chunks/search_keyword-CBP3ULUI.js +9 -0
- package/dist/cli.js +16 -16
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/search_keyword-F6L5WB2S.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as o,B as p,C as q,D as r,E as s,F as t,G as u,H as v,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"./chunk-
|
|
1
|
+
import{A as o,B as p,C as q,D as r,E as s,F as t,G as u,H as v,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"./chunk-7C3KU5TK.js";import"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import"./chunk-OO34QR3O.js";import"./chunk-IZBOTHQP.js";import"./chunk-VOUGMIAJ.js";import"./chunk-2RTYI6K3.js";import"./chunk-6LM3YRRE.js";import"./chunk-E3RSSW5O.js";import"./chunk-F36PAVKE.js";import"./chunk-JWB2S22X.js";import"./chunk-3XJQTYIL.js";import{l as a}from"./chunk-2Q6KKC74.js";import"./chunk-ZGORMZE5.js";import"./chunk-NPXJIGAI.js";export{c as RE_LEADING_THINK,b as convertChannelThinkTags,r as detectToolCalls,e as findGenuineThinkClose,t as generateSimpleContent,u as getAIStream,q as getActiveToolContext,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,s as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,o as maskCodeSpans,p as maskExecutedTools,n as runJanitorTask,v as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ma}from"./chunk-UEV335RW.js";import{b as fa,c as xa,d as ga}from"./chunk-FMKFTJB3.js";import{c as na,e as er,f as bo,g as ra}from"./chunk-HGHBCWE5.js";import{A as wa,C as Ta,D as ya,E as Mo,G as Ca,a as oa,b as gt,c as It,d as Sr,e as la,f as pi,g as aa,h as Ln,i as ls,j as bi,k as wi,l as as,m as ca,u as pa,w as ba}from"./chunk-
|
|
1
|
+
import{a as Ma}from"./chunk-UEV335RW.js";import{b as fa,c as xa,d as ga}from"./chunk-FMKFTJB3.js";import{c as na,e as er,f as bo,g as ra}from"./chunk-HGHBCWE5.js";import{A as wa,C as Ta,D as ya,E as Mo,G as Ca,a as oa,b as gt,c as It,d as Sr,e as la,f as pi,g as aa,h as Ln,i as ls,j as bi,k as wi,l as as,m as ca,u as pa,w as ba}from"./chunk-7C3KU5TK.js";import{a as co,b as sa,c as ia}from"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import{a as ha}from"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import{a as Yt,b as Nt,d as Rl,e as Ft,f as ea,k as xi,l as gi,m as Mr,n as hi,o as ta,p as Jo}from"./chunk-OO34QR3O.js";import"./chunk-IZBOTHQP.js";import{a as ma}from"./chunk-YX4X2ZTX.js";import{a as Br,b as Zo,c as Pn,e as cs,f as Ti,g as da,h as ua,i as Er}from"./chunk-VOUGMIAJ.js";import{a as vr}from"./chunk-2RTYI6K3.js";import{a as fn}from"./chunk-6LM3YRRE.js";import{b as mn,c as di}from"./chunk-E3RSSW5O.js";import{A as Xl,C as Gl,D as Kl,E as Vl,H as jl,c as Pl,e as ii,g as Ol,k as Nl,l as Fl,m as $l,n as Ul,o as _l,q as Hl,r as Wl,u as li,v as ai,w as ci}from"./chunk-F36PAVKE.js";import{a as ql,b as Ql,i as zl,j as ss,k as is,m as At,n as Jl,p as mi,q as fi,w as Zl}from"./chunk-JWB2S22X.js";import{a as Yl,b as ui,c as zt}from"./chunk-3XJQTYIL.js";import{d as Bl,e as si,f as El,g as kl,h as Dl,i as Al,j as Il,l as ns,n as un,o as po,p as rs,q as Cr,r as Ll}from"./chunk-2Q6KKC74.js";import{c as ts,d as vl,e as os}from"./chunk-ZGORMZE5.js";import{a as Po,b as In,c as Co,d as ni,e as ri,k as yr,y as Sl}from"./chunk-NPXJIGAI.js";import Es from"os";import pu from"crypto";import e,{useState as Z,useEffect as ut,useRef as Re,useMemo as rr}from"react";import{Box as u,Text as i,useInput as bu,useStdout as wu,Static as Tu}from"ink";import yu from"ink-spinner";import at from"fs-extra";import{minimatch as nc}from"minimatch";import wt from"path";import{exec as jo}from"child_process";import{fileURLToPath as Cu}from"url";import ro,{useState as ds,useEffect as yi,useMemo as kr,useCallback as Wc,useRef as Ro}from"react";import{Box as Xc,Text as Oo,useInput as Gc}from"ink";function Kc(t,m){return t.replace(/\t/g," ".repeat(m))}function us(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`)}function On(t,m,d){let v=t,y=[...m].sort((r,C)=>r.start-C.start),p=0;for(let r of y){let C=r.start-p,T=us(r.text).split(`
|
|
4
4
|
`).length,M=r.text.length,P=(T>3?`[Pasted ${T} lines]`:`[Pasted ${M} chars]`).length,F=C+P;if(t<=C)break;if(t<F){v=r.end;break}else{let k=r.text.length-P;v+=k,p+=k}}return Math.min(v,d.length)}function Ci(t,m,d,v,y=[]){let p=(t||"").slice(0,m),r=v(p).length,C=v(t||""),T=[...y].sort((j,H)=>H.start-j.start);for(let j of T){let H=v(t.slice(0,j.start)).length,W=v(j.text),X=H+W.length,ie=us(j.text).split(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{F as u}from"./chunk-
|
|
1
|
+
import{F as u}from"./chunk-7C3KU5TK.js";import"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import"./chunk-OO34QR3O.js";import"./chunk-IZBOTHQP.js";import"./chunk-VOUGMIAJ.js";import"./chunk-2RTYI6K3.js";import"./chunk-6LM3YRRE.js";import{b as p}from"./chunk-E3RSSW5O.js";import"./chunk-F36PAVKE.js";import"./chunk-JWB2S22X.js";import{b as d}from"./chunk-3XJQTYIL.js";import{o as a}from"./chunk-2Q6KKC74.js";import"./chunk-ZGORMZE5.js";import{a as l}from"./chunk-NPXJIGAI.js";import m from"fs";import g from"path";var f=["Identity: Embedded IDE code completion engine","Context given: Code \xB1 cursor, file name & language","Task: Predict contextually accurate code at cursor position","","Rules:","- Return ONLY the raw code to insert at the cursor. No explanations, commentary or rambling","- Do NOT wrap in markdown code fences","- NEVER repeat code that exist before & after cursor, if nothing sensible possible to predict, return empty string","- Match surrounding indentation and code style","- Complete the current line statement","- Never include placeholder comments like // TODO or # your code here","- Do not put anything except the code to insert between the tags"].join(`
|
|
2
2
|
`);try{let t=g.join(l,".cache");m.existsSync(t)||m.mkdirSync(t,{recursive:!0}),m.writeFileSync(g.join(t,"completion.json"),JSON.stringify({systemPrompt:f},null,2))}catch{}var y=t=>{if(!t)return"";let e=t.match(/<completion>([\s\S]*?)<\/completion>/i);return e?e[1]:t},x=({prefix:t="",suffix:e="",fileName:o="",language:n="",recentChanges:r="",clipboard:i=""})=>{let c=r?["### Recent manual changes (context):",r,""]:[],s=i?["### Clipboard (context):",i,""]:[];return[`File: ${o}`,`Language: ${n}`,"","### Code before cursor:",t,"","[cursor here]","","### Code after cursor:",e,"",...c,...s,"### Completion to insert at cursor:"].join(`
|
|
3
3
|
`)},T=async(t={})=>{try{let e=await d(),o=e.autoCompletion||{};if(!o.enabled)return"";let n=o.provider||e.aiProvider||"Google",r=o.model&&o.model!=="Default"?o.model:e.activeModel||a(n,e.apiTier)||a(n,"paid");if(!r)return"";let i=await p(n);if(!i&&!(n==="c_openai"&&e.systemSettings?.customOpenAIBaseUrl))return"";let c={aiProvider:n,apiKey:i,model:r,mode:"flow",thinkingLevel:"Fast",systemSettings:e.systemSettings||{}},s=[{role:"user",parts:[{text:x(t)}]}],{text:h}=await u(c,r,s,f,"Fast");return y(h||"")}catch{return""}};export{f as AUTOCOMPLETE_SYSTEM_PROMPT,y as extractCompletion,T as generateAutoCompletion};
|
|
@@ -461,7 +461,7 @@ Public Docs: https://fluxflow-cli.onrender.com, /changelog or /changelog/{versio
|
|
|
461
461
|
|
|
462
462
|
Docs missing required info? Say you are not sure enough to answer. Dont give wrong info`,"references/MODES.md":ur,"references/PROVIDERS.md":gr,"references/PLUGINS.md":mr,"references/STARTUP.md":or,"references/ENV.md":ir,"references/COMMANDS.md":sr,"references/SETTINGS.md":rr,"references/TOOLS.md":ar,"references/ARCHITECTURE.md":lr,"references/SUB_AGENTS.md":cr,"references/SECURITY.md":dr,"references/IDE.md":fr};var yr=(e=null)=>{try{let t=En.join(Kn,"skills","fluxflow"),n=En.join(t,"references");if(process.env.NO_DEV==="true"||process.env.NO_DEV==="1"||process.env.NO_DEV===!0||process.env.NO_INS==="true"||process.env.NO_INS==="1"||process.env.NO_INS==="true"||!1){yn.existsSync(t)&&yn.rmSync(t,{recursive:!0,force:!0});return}let o=new Set(Object.keys(ns).map(m=>En.normalize(m))),d=(e||""||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),a=En.basename(d).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replace(/(\d)-(\d)/g,"$1.$2").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,m=>m.toUpperCase().trim());for(let[m,f]of Object.entries(ns)){let h=En.join(t,m),p=En.dirname(h);yn.existsSync(p)||yn.mkdirSync(p,{recursive:!0});let g=f;m==="SKILL.md"&&a&&(g=g.replace(/Public Docs: [^\n]*/,`Public Docs: ${g.match(/Public Docs: ([^\n]*)/)?.[1]||""}
|
|
463
463
|
Active Model: ${a}`));let i=g.trim()+`
|
|
464
|
-
`,x=null;yn.existsSync(h)&&(x=yn.readFileSync(h,"utf8")),x!==i&&yn.writeFileSync(h,i,"utf8")}if(yn.existsSync(n)){let m=yn.readdirSync(n);for(let f of m){let h=En.normalize(En.join("references",f));if(!o.has(h)){let p=En.join(n,f);try{yn.rmSync(p,{recursive:!0,force:!0})}catch{}}}}}catch{}};import{WebSocket as yi}from"ws";var Dt=null,wo=!1,za="ws://localhost:56832",os=[],bo=null,is=null,ss=null,xr="2.0.0",Tc=e=>{xr=e,wr()},rs=e=>{is=e},Ac=e=>{ss=e},wr=()=>{if(Dt||wo)return;wo=!0;let e=new yi(za);e.on("open",()=>{for(Dt=e,wo=!1,Dt.send(JSON.stringify({command:"version",version:xr,pid:process.pid,ppid:process.ppid,cwd:process.cwd()}));os.length>0;)Dt.send(JSON.stringify(os.shift()))}),e.on("message",t=>{try{let n=JSON.parse(t.toString());n.command==="contextResponse"&&bo?(bo(n.data),bo=null):n.command==="securityResponse"&&is?is(n.result):n.command==="inlineComplete"?qa(n):n.command==="connectionRejected"&&ss&&ss(n)}catch{}}),e.on("error",()=>{wo=!1,Dt=null}),e.on("close",()=>{wo=!1,Dt=null})},No=e=>{Dt&&Dt.readyState===yi.OPEN?Dt.send(JSON.stringify(e)):(os.push(e),wo||wr())},So=()=>Dt!==null&&Dt.readyState===yi.OPEN,qa=async e=>{let t="";try{let{generateAutoCompletion:n}=await import("./auto_completion-
|
|
464
|
+
`,x=null;yn.existsSync(h)&&(x=yn.readFileSync(h,"utf8")),x!==i&&yn.writeFileSync(h,i,"utf8")}if(yn.existsSync(n)){let m=yn.readdirSync(n);for(let f of m){let h=En.normalize(En.join("references",f));if(!o.has(h)){let p=En.join(n,f);try{yn.rmSync(p,{recursive:!0,force:!0})}catch{}}}}}catch{}};import{WebSocket as yi}from"ws";var Dt=null,wo=!1,za="ws://localhost:56832",os=[],bo=null,is=null,ss=null,xr="2.0.0",Tc=e=>{xr=e,wr()},rs=e=>{is=e},Ac=e=>{ss=e},wr=()=>{if(Dt||wo)return;wo=!0;let e=new yi(za);e.on("open",()=>{for(Dt=e,wo=!1,Dt.send(JSON.stringify({command:"version",version:xr,pid:process.pid,ppid:process.ppid,cwd:process.cwd()}));os.length>0;)Dt.send(JSON.stringify(os.shift()))}),e.on("message",t=>{try{let n=JSON.parse(t.toString());n.command==="contextResponse"&&bo?(bo(n.data),bo=null):n.command==="securityResponse"&&is?is(n.result):n.command==="inlineComplete"?qa(n):n.command==="connectionRejected"&&ss&&ss(n)}catch{}}),e.on("error",()=>{wo=!1,Dt=null}),e.on("close",()=>{wo=!1,Dt=null})},No=e=>{Dt&&Dt.readyState===yi.OPEN?Dt.send(JSON.stringify(e)):(os.push(e),wo||wr())},So=()=>Dt!==null&&Dt.readyState===yi.OPEN,qa=async e=>{let t="";try{let{generateAutoCompletion:n}=await import("./auto_completion-6FMBGXUX.js");t=await n({prefix:e.prefix||"",suffix:e.suffix||"",fileName:e.fileName||"",language:e.language||"",recentChanges:e.recentChanges||"",clipboard:e.clipboard||""})}catch{t=""}No({command:"inlineCompleteResponse",requestId:e.requestId,completion:t||""})},Cc=e=>{No({command:"status",status:e})},io=()=>new Promise(e=>{if(!Dt||Dt.readyState!==yi.OPEN){e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]});return}bo=e,Dt.send(JSON.stringify({command:"requestContext"})),setTimeout(()=>{bo===e&&(e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]}),bo=null)},1e3)}),br=e=>{let{resolvedPath:t}=mn(e);No({command:"open",filePath:t})},as=(e,t,n)=>{let{resolvedPath:s}=mn(e);No({command:"showDiff",filePath:s,originalContent:t,modifiedContent:n})},Sr=(e,t)=>{let{resolvedPath:n}=mn(e);No({command:"closeDiff",filePath:n,result:t})};var Ho=(e,t)=>{try{if(!Jt.existsSync(e))return null;let n=Array.isArray(t)?t.map(o=>o.toLowerCase()):[t.toLowerCase()],s=Jt.readdirSync(e);for(let o of n){let r=s.find(d=>d.toLowerCase()===o);if(r){let d=sn.join(e,r);if(Jt.statSync(d).isFile())return d}}}catch{}return null},us=(e,t)=>{let n=Ho(e,t);if(n)try{return Jt.readFileSync(n,"utf8")}catch{}return""},kr=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"]),gs=(e=process.cwd(),t=0,n=8)=>{let s=[];if(t>n)return s;try{if(!Jt.existsSync(e))return s;let o=Jt.readdirSync(e,{withFileTypes:!0});for(let r of o){let d=r.name,a=sn.join(e,d);if(r.isDirectory())!kr.has(d)&&!kr.has(d.toLowerCase())&&s.push(...gs(a,t+1,n));else if(r.isFile()){let m=d.toLowerCase();(m==="agents.md"||m==="agent.md")&&s.push(a)}}}catch{}return s},Tr=(e,t=2)=>{if(!e)return"";let n=" ".repeat(t);return e.split(/\r?\n/).map(s=>n+s).join(`
|
|
465
465
|
`)},Er=()=>Ho(Kn,["agents.md","agent.md"]),_r=()=>Ho(process.cwd(),["agents.md","agent.md"]),Ir=()=>Ho(Kn,["fluxflow.md"]),Mr=()=>Ho(process.cwd(),["fluxflow.md"]),Fo=Er(),xi=_r(),xn=gs(),Bo=Ir(),Uo=Mr(),Ar=null,fs="",Pr=!1,Xa=e=>{if(!e||!/^<<<[\s\S]*?Identity:/m.test(e))return e;let t=e.match(/^<<<\s*\r?\n([\s\S]*?)\r?\n>>>\s*(?:\r?\n)?([\s\S]*)$/);if(!t)return e;let n=t[1],s=t[2],o=n.match(/^Identity:\s*([\s\S]*?)(?=\r?\n\s*(?:<><|>>>)|$)/m);return o&&(fs=o[1].trim(),process.env.NO_INS=!0),/<><\s*NO_INS/.test(n)&&(Pr=!0),s.trim()},Ja=()=>{Fo=Er();let e=Fo?us(Kn,["agents.md","agent.md"]).trim():"";return e.length===0?(Fo=null,""):e},Qa=()=>{if(xn=gs(),xi=_r(),!xn||xn.length===0)return"";let e=process.cwd(),t=[...xn].sort((o,r)=>{let d=sn.relative(e,o).replace(/\\/g,"/"),a=sn.relative(e,r).replace(/\\/g,"/"),m=!d.includes("/"),f=!a.includes("/");return m&&!f?-1:!m&&f?1:d.localeCompare(a)}),n=[],s=[];for(let o of t)try{let r=Jt.readFileSync(o,"utf8").trim();if(!r||r.length===0)continue;n.push(o);let d=sn.relative(e,o).replace(/\\/g,"/");if(!d.includes("/"))s.push(Tr(r,2));else{let m=sn.dirname(d)+"/:";s.push(`${m}
|
|
466
466
|
${Tr(r,2)}`)}}catch{}return xn=n,xn.length===0&&(xi=null),s.join(`
|
|
467
467
|
|
|
@@ -531,7 +531,7 @@ ${ls}
|
|
|
531
531
|
`:""}${cs.length>0&&n.toLowerCase().includes("flux")?`-- Project Skills --
|
|
532
532
|
${cs}
|
|
533
533
|
|
|
534
|
-
`:""}`.trim()};var Ur=()=>import("./web_search-XBV7AJF7.js").then(e=>e.web_search),Wr=()=>import("./web_scrape-SJBA3RQF.js").then(e=>e.web_scrape),Gr=()=>import("./memory-QTLQAFG7.js").then(e=>e.memory),Hr=()=>import("./chat-YMCO5JNQ.js").then(e=>e.chat),jr=()=>import("./view_file-LWURM2CE.js").then(e=>e.view_file),Kr=()=>import("./write_file-O3YKZSFP.js").then(e=>e.write_file),Vr=()=>import("./update_file-VIKPZENG.js").then(e=>e.update_file),zr=()=>import("./exec_command-E3D5BY3N.js").then(e=>e.exec_command),qr=()=>import("./read_folder-BJ3HS63A.js").then(e=>e.read_folder),ys=()=>import("./ask_user-XQ423UXL.js").then(e=>e.ask_user),Yr=()=>import("./write_pdf-UOCME2OY.js").then(e=>e.write_pdf),Xr=()=>import("./write_docx-54LANNV2.js").then(e=>e.write_docx),ki=()=>import("./search_keyword-F6L5WB2S.js").then(e=>e.search_keyword),Jr=()=>import("./generate_image-5ZVJ7ELI.js").then(e=>e.generate_image),Ti=()=>import("./saveSummary-CVZIOQ4L.js").then(e=>e.saveSummary),jo=()=>import("./addMemScore-U2KYMALL.js").then(e=>e.addMemScore),Qr=()=>import("./file_map-4WUEPRMI.js").then(e=>e.file_map),Ai=()=>import("./todo-3EQZ7LZM.js").then(e=>e.todo),Zr=()=>import("./invokeSync-XAAZL7L2.js").then(e=>e.invokeSync),ol=()=>import("./invoke-HBTZTVAB.js").then(e=>e.invoke),ea=()=>import("./getProgress-MJZDAMSP.js").then(e=>e.getProgress),il=()=>import("./cancel-2PAHCMGB.js").then(e=>e.cancel),ta=()=>import("./emergency_rollback-PHH3BKRP.js").then(e=>e.emergency_rollback),Ko=()=>import("./awaitSubagent-KLH7CRKF.js").then(e=>e.awaitSubagent),Vo=()=>import("./answerSubagent-PIZJSLZN.js").then(e=>e.answerSubagent),Ci=()=>import("./steerSubagent-B34P33YV.js").then(e=>e.steerSubagent),Ri=()=>import("./computer_action-SI6AMRJ6.js").then(e=>e.computer_action),na=()=>import("./click-VXWUG5T3.js").then(e=>e.click),oa=()=>import("./drag-6XCBUY73.js").then(e=>e.drag),ia=()=>import("./scroll-6SPRL73L.js").then(e=>e.scroll),xs=()=>import("./keyboard_typing-TK55ZAVR.js").then(e=>e.keyboard_typing),ws=()=>import("./key_press-ISGXEO42.js").then(e=>e.key_press),bs=()=>import("./recapture_screen-BY4Q4D5X.js").then(e=>e.recapture_screen),vi=()=>import("./find_file-LHPOW4ZM.js").then(e=>e.find_file),sa=()=>import("./wait-6WFCZDO7.js").then(e=>e.wait),ra={web_search:Ur,web_scrape:Wr,memory:Gr,chat:Hr,view_file:jr,write_file:Kr,update_file:Vr,exec_command:zr,read_folder:qr,write_pdf:Yr,write_docx:Xr,search_keyword:ki,generate_image:Jr,saveSummary:Ti,addMemScore:jo,file_map:Qr,todo:Ai,Todo:Ai,goal:Ai,Goal:Ai,invokeSync:Zr,invoke:ol,getProgress:ea,cancel:il,awaitSubagent:Ko,answerSubagent:Vo,steerSubagent:Ci,computer_action:Ri,computer_use:Ri,ComputerAction:Ri,ComputerUse:Ri,click:na,Click:na,drag:oa,Drag:oa,scroll:ia,Scroll:ia,keyboard_typing:xs,KeyboardTyping:xs,keyboardtyping:xs,key_press:ws,KeyPress:ws,keypress:ws,recapture_screen:bs,RecaptureScreen:bs,recapturescreen:bs,invoke_sync:Zr,get_progress:ea,await_subagent:Ko,answer_subagent:Vo,steer_subagent:Ci,steer:Ci,Steer:Ci,ask:ys,Ask:ys,AskUser:ys,WebSearch:Ur,WebScrape:Wr,ReadFile:jr,ReadFolder:qr,WriteFile:Kr,PatchFile:Vr,WritePDF:Yr,WriteDoc:Xr,Run:zr,SearchKeyword:ki,CodeSearch:ki,code_search:ki,Memory:Gr,Chat:Hr,GenerateImage:Jr,saveSumary:Ti,SaveSummary:Ti,SaveSumary:Ti,add_mem_score:jo,AddMemScore:jo,addMemoryScore:jo,AddMemoryScore:jo,FileMap:Qr,answer:Vo,Answer:Vo,AnswerSubagent:Vo,await:Ko,Await:Ko,AwaitSubagent:Ko,EmergencyRollback:ta,emergency_rollback:ta,find_file:vi,findFile:vi,FindFile:vi,findfile:vi,wait:sa,Wait:sa},Ss=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(h=>o.includes(h))||o==="ask",m=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(h=>o.includes(h));if(!d){if(s==="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(s==="icu"){if(!m)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let f=ra[e];if(!f){let h=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],p={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},g=o.replace(/[^a-z0-9]/g,""),i=p[g]||null;if(!i){let I=0,Ye=P=>{let N=new Set;for(let U=0;U<P.length-1;U++)N.add(P.slice(U,U+2));return N},C=Ye(g);for(let P of h){let N=P.toLowerCase().replace(/[^a-z0-9]/g,"");if(g===N){i=P;break}let U=0;(N.includes(g)||g.includes(N))&&(U+=.6);let $=Ye(N),M=0;for(let ve of C)$.has(ve)&&M++;let Se=2*M/(C.size+$.size||1);U=Math.max(U,Se),U>I&&U>=.35&&(I=U,i=P)}}let x=i?` Do you mean '${i}'?`:"";return`ERROR: Action [${e}] not found in registry.${x}`}try{return await(await f())(t,n)}catch(h){let p=h instanceof Error?h.message:String(h);return`ERROR: Execution failed for [${e}]: ${p}`}};var Ei=e=>{if(!e||typeof e!="string")return!1;let t=e.trim().toLowerCase();return Object.keys(ra).some(n=>n.toLowerCase()===t)};import B from"path";import xe from"fs";import wa from"os";import ba from"crypto";import{execSync as vs}from"child_process";import sl from"gradient-string";var aa=["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 la=["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 ca=[{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"]}],ko={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var _i=null;var Ii=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(_i||(_i=ca[Math.floor(Math.random()*ca.length)]),t={..._i,id:"Mystery"}):(_i=null,ko[e]?t=ko[e]:e==="Halloween"?t=ko.Spookfest:e==="GitHub"?t=ko["GitHub Dark"]:e==="Transparent"?t=ko["Transparent Dark"]:t=ko.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan",s=t.toolFeedbackAnsi||"\x1B[95m";return{...t,codeText:n,toolFeedbackAnsi:s}};var rl=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",td=(e=2)=>{let t=rl();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},da=new Date,zo=da.getMonth(),qo=da.getDate(),al=zo===9&&qo>=15||zo===10&&qo<=1,ks=null;(process.env.SPOOKFEST==="true"||al)&&(ks=await import("./halloween-MX3VNQRW.js"));var nd=(e="...",t="Loading...",n="Dark")=>{let s=Ii(n),o=t;if(t==="c_openai"||t==="Custom (OpenAI)")try{let U=di(ai,{})?.systemSettings?.customOpenAIBaseUrl;U&&(o=U)}catch{}let r=s.logoTextAnsi,d=s.logoBodyAnsi,a=s.logoMutedAnsi,m="\x1B[0m",f=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=n==="Spookfest"||s.id==="Spookfest"||n==="Halloween"||s.id==="Halloween",p=zo===9&&qo>=15||zo===10&&qo<=1,g=h&&p||process.env.SPOOKFEST==="true"&&h,i=f;if(g&&ks){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:N,halloweenBat:U,halloweenArtUser:$}=ks;i=Math.random()>.9&&zo===9&&qo>=30?U:Math.random()>.5?N:$}else process.env.HALLOWEEN_EEGG="false";let x=g?la:aa,I=x[Math.floor(Math.random()*x.length)],Ye=s.logoGradient||["#0077ff","#ff00ff"],C=sl(Ye).multiline(i.join(`
|
|
534
|
+
`:""}`.trim()};var Ur=()=>import("./web_search-XBV7AJF7.js").then(e=>e.web_search),Wr=()=>import("./web_scrape-SJBA3RQF.js").then(e=>e.web_scrape),Gr=()=>import("./memory-QTLQAFG7.js").then(e=>e.memory),Hr=()=>import("./chat-YMCO5JNQ.js").then(e=>e.chat),jr=()=>import("./view_file-LWURM2CE.js").then(e=>e.view_file),Kr=()=>import("./write_file-O3YKZSFP.js").then(e=>e.write_file),Vr=()=>import("./update_file-VIKPZENG.js").then(e=>e.update_file),zr=()=>import("./exec_command-E3D5BY3N.js").then(e=>e.exec_command),qr=()=>import("./read_folder-BJ3HS63A.js").then(e=>e.read_folder),ys=()=>import("./ask_user-XQ423UXL.js").then(e=>e.ask_user),Yr=()=>import("./write_pdf-UOCME2OY.js").then(e=>e.write_pdf),Xr=()=>import("./write_docx-54LANNV2.js").then(e=>e.write_docx),ki=()=>import("./search_keyword-CBP3ULUI.js").then(e=>e.search_keyword),Jr=()=>import("./generate_image-5ZVJ7ELI.js").then(e=>e.generate_image),Ti=()=>import("./saveSummary-CVZIOQ4L.js").then(e=>e.saveSummary),jo=()=>import("./addMemScore-U2KYMALL.js").then(e=>e.addMemScore),Qr=()=>import("./file_map-4WUEPRMI.js").then(e=>e.file_map),Ai=()=>import("./todo-3EQZ7LZM.js").then(e=>e.todo),Zr=()=>import("./invokeSync-UCS3MUA3.js").then(e=>e.invokeSync),ol=()=>import("./invoke-V7YYWNND.js").then(e=>e.invoke),ea=()=>import("./getProgress-MJZDAMSP.js").then(e=>e.getProgress),il=()=>import("./cancel-2PAHCMGB.js").then(e=>e.cancel),ta=()=>import("./emergency_rollback-PHH3BKRP.js").then(e=>e.emergency_rollback),Ko=()=>import("./awaitSubagent-KLH7CRKF.js").then(e=>e.awaitSubagent),Vo=()=>import("./answerSubagent-PIZJSLZN.js").then(e=>e.answerSubagent),Ci=()=>import("./steerSubagent-B34P33YV.js").then(e=>e.steerSubagent),Ri=()=>import("./computer_action-SI6AMRJ6.js").then(e=>e.computer_action),na=()=>import("./click-VXWUG5T3.js").then(e=>e.click),oa=()=>import("./drag-6XCBUY73.js").then(e=>e.drag),ia=()=>import("./scroll-6SPRL73L.js").then(e=>e.scroll),xs=()=>import("./keyboard_typing-TK55ZAVR.js").then(e=>e.keyboard_typing),ws=()=>import("./key_press-ISGXEO42.js").then(e=>e.key_press),bs=()=>import("./recapture_screen-BY4Q4D5X.js").then(e=>e.recapture_screen),vi=()=>import("./find_file-LHPOW4ZM.js").then(e=>e.find_file),sa=()=>import("./wait-6WFCZDO7.js").then(e=>e.wait),ra={web_search:Ur,web_scrape:Wr,memory:Gr,chat:Hr,view_file:jr,write_file:Kr,update_file:Vr,exec_command:zr,read_folder:qr,write_pdf:Yr,write_docx:Xr,search_keyword:ki,generate_image:Jr,saveSummary:Ti,addMemScore:jo,file_map:Qr,todo:Ai,Todo:Ai,goal:Ai,Goal:Ai,invokeSync:Zr,invoke:ol,getProgress:ea,cancel:il,awaitSubagent:Ko,answerSubagent:Vo,steerSubagent:Ci,computer_action:Ri,computer_use:Ri,ComputerAction:Ri,ComputerUse:Ri,click:na,Click:na,drag:oa,Drag:oa,scroll:ia,Scroll:ia,keyboard_typing:xs,KeyboardTyping:xs,keyboardtyping:xs,key_press:ws,KeyPress:ws,keypress:ws,recapture_screen:bs,RecaptureScreen:bs,recapturescreen:bs,invoke_sync:Zr,get_progress:ea,await_subagent:Ko,answer_subagent:Vo,steer_subagent:Ci,steer:Ci,Steer:Ci,ask:ys,Ask:ys,AskUser:ys,WebSearch:Ur,WebScrape:Wr,ReadFile:jr,ReadFolder:qr,WriteFile:Kr,PatchFile:Vr,WritePDF:Yr,WriteDoc:Xr,Run:zr,SearchKeyword:ki,CodeSearch:ki,code_search:ki,Memory:Gr,Chat:Hr,GenerateImage:Jr,saveSumary:Ti,SaveSummary:Ti,SaveSumary:Ti,add_mem_score:jo,AddMemScore:jo,addMemoryScore:jo,AddMemoryScore:jo,FileMap:Qr,answer:Vo,Answer:Vo,AnswerSubagent:Vo,await:Ko,Await:Ko,AwaitSubagent:Ko,EmergencyRollback:ta,emergency_rollback:ta,find_file:vi,findFile:vi,FindFile:vi,findfile:vi,wait:sa,Wait:sa},Ss=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(h=>o.includes(h))||o==="ask",m=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(h=>o.includes(h));if(!d){if(s==="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(s==="icu"){if(!m)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let f=ra[e];if(!f){let h=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],p={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},g=o.replace(/[^a-z0-9]/g,""),i=p[g]||null;if(!i){let I=0,Ye=P=>{let N=new Set;for(let U=0;U<P.length-1;U++)N.add(P.slice(U,U+2));return N},C=Ye(g);for(let P of h){let N=P.toLowerCase().replace(/[^a-z0-9]/g,"");if(g===N){i=P;break}let U=0;(N.includes(g)||g.includes(N))&&(U+=.6);let $=Ye(N),M=0;for(let ve of C)$.has(ve)&&M++;let Se=2*M/(C.size+$.size||1);U=Math.max(U,Se),U>I&&U>=.35&&(I=U,i=P)}}let x=i?` Do you mean '${i}'?`:"";return`ERROR: Action [${e}] not found in registry.${x}`}try{return await(await f())(t,n)}catch(h){let p=h instanceof Error?h.message:String(h);return`ERROR: Execution failed for [${e}]: ${p}`}};var Ei=e=>{if(!e||typeof e!="string")return!1;let t=e.trim().toLowerCase();return Object.keys(ra).some(n=>n.toLowerCase()===t)};import B from"path";import xe from"fs";import wa from"os";import ba from"crypto";import{execSync as vs}from"child_process";import sl from"gradient-string";var aa=["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 la=["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 ca=[{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"]}],ko={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var _i=null;var Ii=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(_i||(_i=ca[Math.floor(Math.random()*ca.length)]),t={..._i,id:"Mystery"}):(_i=null,ko[e]?t=ko[e]:e==="Halloween"?t=ko.Spookfest:e==="GitHub"?t=ko["GitHub Dark"]:e==="Transparent"?t=ko["Transparent Dark"]:t=ko.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan",s=t.toolFeedbackAnsi||"\x1B[95m";return{...t,codeText:n,toolFeedbackAnsi:s}};var rl=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",td=(e=2)=>{let t=rl();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},da=new Date,zo=da.getMonth(),qo=da.getDate(),al=zo===9&&qo>=15||zo===10&&qo<=1,ks=null;(process.env.SPOOKFEST==="true"||al)&&(ks=await import("./halloween-MX3VNQRW.js"));var nd=(e="...",t="Loading...",n="Dark")=>{let s=Ii(n),o=t;if(t==="c_openai"||t==="Custom (OpenAI)")try{let U=di(ai,{})?.systemSettings?.customOpenAIBaseUrl;U&&(o=U)}catch{}let r=s.logoTextAnsi,d=s.logoBodyAnsi,a=s.logoMutedAnsi,m="\x1B[0m",f=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=n==="Spookfest"||s.id==="Spookfest"||n==="Halloween"||s.id==="Halloween",p=zo===9&&qo>=15||zo===10&&qo<=1,g=h&&p||process.env.SPOOKFEST==="true"&&h,i=f;if(g&&ks){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:N,halloweenBat:U,halloweenArtUser:$}=ks;i=Math.random()>.9&&zo===9&&qo>=30?U:Math.random()>.5?N:$}else process.env.HALLOWEEN_EEGG="false";let x=g?la:aa,I=x[Math.floor(Math.random()*x.length)],Ye=s.logoGradient||["#0077ff","#ff00ff"],C=sl(Ye).multiline(i.join(`
|
|
535
535
|
`)).split(`
|
|
536
536
|
`),P=N=>`${a}${N}${m}`;return`${C[0]}
|
|
537
537
|
${C[1]} ${r}Selected ${g?"Pumpkin":"Provider"}: ${o}${m}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as b,c as p}from"./chunk-56EJGQU3.js";import{a as D}from"./chunk-6LM3YRRE.js";var q=async(_,s={})=>{let{runSubagent:y}=await import("./ai-
|
|
1
|
+
import{a as b,c as p}from"./chunk-56EJGQU3.js";import{a as D}from"./chunk-6LM3YRRE.js";var q=async(_,s={})=>{let{runSubagent:y}=await import("./ai-HJLIIEAI.js"),a=D(_,["task","instruction","prompt","model","title","tools","id"]),u=a.task||a.instruction||a.prompt,A=a.model||null,g=a.title||null,w=a.tools||null,m=a.id&&a.id!=="null"&&a.id!=="undefined"&&a.id!==""?String(a.id).trim():null;if(!u)return'ERROR: Missing "task" argument for invoke.';let d=null,U="";m&&(d=b.find(e=>e.id===m));let f=!!d,r=f?d.id:m||`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,I=f?d.history||[]:[],C=null;if(w)try{let e=w.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),C=e.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let h=null,S=null,E=new Promise((e,n)=>{h=e,S=n}),t=d;t?(t.status="running",t.task=u,g&&(t.title=g),t.startedAt=Date.now(),t.lastChunkTime=Date.now(),t.completionPromise=E,t._resolveCompletion=h,t._rejectCompletion=S):(t={id:r,title:g||u.substring(0,30),task:u,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:e=>{e&&t.pendingSteerMessages.push(e)},completionPromise:E,_resolveCompletion:h,_rejectCompletion:S,progress:[],history:[]},b.push(t));let l={chunks:[],totalWords:0};s.onSubagentUpdate&&s.onSubagentUpdate();let i=[],M={...s,taskId:r,onHistoryUpdate:e=>{t.history=[...e]},onAskMain:async e=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,k=new Promise(T=>{o=T}),c={id:n,question:e,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return t.questions.push(c),t.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" is WAITING FOR YOUR INPUT: "${e}"
|
|
2
2
|
Respond using tool: [action:Answer(id="${r}", answer="...")]
|
|
3
3
|
[/SYSTEM]`),await k},onVisualFeedback:e=>{t.lastChunkTime=Date.now();let n=e.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?t.currentTool=o[1].trim():t.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(e,n)=>{let o=Date.now();if(t.lastChunkTime=o,t.currentTool="Thinking",typeof n=="number"&&n>0){l.totalWords+=n,l.chunks.push({time:o,words:n});let k=o-400;if(l.chunks=l.chunks.filter(c=>c.time>=k),l.chunks.length>0){let c=l.chunks.reduce((v,R)=>v+R.words,0),$=l.chunks[0].time,T=Math.max(.4,(o-$)/1e3);t.wps=Math.round(c/T)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return y(u,M,A,C,null,e=>{if(t.status==="cancelled")return;if(e.startsWith("[Subagent Turn")&&i.length>0&&(t.progress.push([...i]),i=[]),e.includes("[Executing Tool]")){let o=e.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!t.currentTool||t.currentTool==="Thinking")&&(t.currentTool=o[1])}let n=e;if(n.startsWith("[Tool Result]")||n.startsWith("[Action Result]")){let o=n.split(`
|
|
4
4
|
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
5
5
|
`)+`
|
|
6
|
-
... [Content/Diff Truncated from Logs] ...`)}i.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0,I).then(e=>{if(t.status==="cancelled"){t._resolveCompletion&&t._resolveCompletion(e);return}i.length>0&&(t.progress.push([...i]),i=[]),t.status="completed",t.finalAnswer=e,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) has FINISHED. Call GetProgress(id="${r}") to see the final result. [/SYSTEM]`),t._resolveCompletion&&t._resolveCompletion(e)}).catch(async e=>{let{isTerminationSignaled:n}=await import("./ai-
|
|
6
|
+
... [Content/Diff Truncated from Logs] ...`)}i.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0,I).then(e=>{if(t.status==="cancelled"){t._resolveCompletion&&t._resolveCompletion(e);return}i.length>0&&(t.progress.push([...i]),i=[]),t.status="completed",t.finalAnswer=e,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) has FINISHED. Call GetProgress(id="${r}") to see the final result. [/SYSTEM]`),t._resolveCompletion&&t._resolveCompletion(e)}).catch(async e=>{let{isTerminationSignaled:n}=await import("./ai-HJLIIEAI.js");if(e.message==="Subagent task was cancelled."||t.status==="cancelled"||n()){t.status="cancelled",i.push("[SUBAGENT CANCELLED] Task was cancelled."),t.progress.push([...i]),s.onSubagentUpdate&&s.onSubagentUpdate(),t._resolveCompletion&&t._resolveCompletion(null);return}i.push(`[SUBAGENT FAILURE] Error: ${e.message}`),t.progress.push([...i]),t.status="failed",t.error=e.message,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) FAILED with error: ${e.message}. [/SYSTEM]`),t._rejectCompletion&&t._rejectCompletion(e)}),f?`Background subagent ${r} resumed.`:U?`Background subagent started. Task ID: ${r}.${U}`:`Background subagent started. Task ID: ${r}`};export{q as invoke};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as m}from"./chunk-56EJGQU3.js";import{a as g}from"./chunk-6LM3YRRE.js";var A=async(p,a={})=>{let{runSubagent:f}=await import("./ai-
|
|
1
|
+
import{a as m}from"./chunk-56EJGQU3.js";import{a as g}from"./chunk-6LM3YRRE.js";var A=async(p,a={})=>{let{runSubagent:f}=await import("./ai-HJLIIEAI.js"),e=g(p,["task","instruction","prompt","model","tools","title","id"]),l=e.task||e.instruction||e.prompt,k=e.model||null,c=e.tools||null,u=e.id&&e.id!=="null"&&e.id!=="undefined"&&e.id!==""?String(e.id).trim():null;if(!l)return'ERROR: Missing "task" argument for invokeSync.';let n=null,d="";u&&(n=m.find(t=>t.id===u));let o=n?n.id:u||`subagent-sync-${Date.now()}-${Math.floor(Math.random()*1e3)}`,$=n?.history||[],b=null;if(c)try{let t=c.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),b=t.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let r=e.title||(n?n.title:l.substring(0,30)),s=n;s?(s.status="running",s.task=l):(s={id:o,title:r,task:l,status:"running",startedAt:Date.now(),progress:[],history:[]},m.push(s));let y={...a,taskId:o,onHistoryUpdate:t=>{s.history=[...t]}};try{a.onVisualFeedback&&a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r}${n?" (Resumed)":""}`);let t=await f(l,y,k,b,null,null,!1,$);s.status="completed",s.finalAnswer=`Subagent task completed. (ID: ${o})
|
|
2
2
|
Final Answer:
|
|
3
3
|
${t}`,a.onVisualFeedback&&a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r} [COMPLETED]
|
|
4
4
|
`);let i=`Subagent task completed. (ID: ${o})
|
|
5
5
|
Final Answer:
|
|
6
|
-
${t}`;return d?`${i}${d}`:i}catch(t){s.status="failed",s.error=t.message;let{isTerminationSignaled:i}=await import("./ai-
|
|
6
|
+
${t}`;return d?`${i}${d}`:i}catch(t){s.status="failed",s.error=t.message;let{isTerminationSignaled:i}=await import("./ai-HJLIIEAI.js"),h=t.message==="Subagent task was cancelled by user."||i();if(a.onVisualFeedback){let S=h?"[CANCELLED]":"[FAILED]";a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r} ${S}
|
|
7
7
|
`)}return`ERROR: Subagent execution failed: ${t.message}${d}`}};export{A as invokeSync};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as lt}from"./chunk-6LM3YRRE.js";import{b as ot}from"./chunk-3XJQTYIL.js";import"./chunk-2Q6KKC74.js";import"./chunk-ZGORMZE5.js";import{w as st,x as rt,y as nt,z as it}from"./chunk-NPXJIGAI.js";import T from"fs/promises";import E from"path";import V from"fast-glob";import{Minimatch as at}from"minimatch";async function B(g,f,R=g,p=1){if(p>12)return[];let d=[],o;try{o=await T.readdir(g,{withFileTypes:!0})}catch{return[]}for(let e of o){let n=E.join(g,e.name),x=E.relative(R,n),v=x.split(E.sep).map(W=>W.toLowerCase()),G=e.name.toLowerCase();if(!f.some(W=>{let z=W.toLowerCase();return z.startsWith(".")&&G.endsWith(z)?!0:v.some(L=>L===z||L.startsWith(".pnpm"))}))if(e.isDirectory()){let W=await B(n,f,R,p+1);d=d.concat(W)}else e.isFile()&&d.push({fullPath:n,relativePath:x})}return d}function ut(g,f,R=1/0){if(g===f)return 0;if(g.length===0)return f.length;if(f.length===0)return g.length;if(Math.abs(g.length-f.length)>R)return R+1;let p=Array.from({length:f.length+1},(d,o)=>o);for(let d=1;d<=g.length;d++){let o=[d],e=d;for(let n=1;n<=f.length;n++){let x=g[d-1]===f[n-1]?0:1,v=Math.min(o[n-1]+1,p[n]+1,p[n-1]+x);o.push(v),v<e&&(e=v)}if(p=o,e>R)return R+1}return p[f.length]}function gt(g,f){if(!g||!f)return!1;let R=g.toLowerCase(),p=f.toLowerCase();if(R.includes(p))return!0;let d=R.split(/[^a-z0-9]+/).filter(e=>e.length>0),o=p.split(/[^a-z0-9]+/).filter(e=>e.length>1||p.length===1&&e.length>0);return o.length===0?!1:o.every(e=>{let n=e.length<=2?0:e.length<=5?1:2;for(let x of d)if(x.includes(e)||e.length>=3&&x.length>=3&&Math.abs(x.length-e.length)<=n&&ut(e,x,n)<=n)return!0;return!1})}var Pt=async g=>{let{keyword:f,path:R,fuzzy:p,subString:d,regex:o}=lt(g,["keyword","path"]);if(f==null)return'ERROR: Missing "keyword" argument.';let e=String(f),n=R,x=!1;if(n){let{resolvedPath:t,isTildeResolved:c}=it(n);n=t,x=c;let i=n.trim().toLowerCase();if(i==="#docs"||i==="#doc"||i==="#documentation"||i.includes("#skill/global/fluxflow")||i.startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills."}let v=t=>t===!0||t==="true"||t===1||t==="1"||t==="yes",G=o===!1||o==="false"||o===0||o==="0"||o==="no",A=o===!0||o==="true"||o===1||o==="1"||o==="yes",W=v(p)||v(d),z=null,L=null,q=t=>{let c=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=/^\w/.test(t)?"(?<![\\w])":"",k=/\w$/.test(t)?"(?![\\w])":"";return new RegExp(`${i}${c}${k}`,"i")};if(G)W||(L=q(e));else{try{let t=A?e:e.replace(/\(\?i\)/g,"");if(!A&&t.includes("||")&&(t=t.replace(/\|\|/g,"|")),!A&&t.includes("|")){let c=t.split("|").map(i=>i.trim()).filter(Boolean);t=c.length>0?c.join("|"):t}if(!A&&t.trim()==="")throw new Error("empty regex after (?i) cleanup");z=new RegExp(t,"i")}catch(t){if(A)return`ERROR: Invalid regex pattern "${e}": ${t.message}`}L=q(e)}let M=Array.from(new Set([...st,...rt(process.cwd())])),J=150;try{let t=[],c=process.cwd(),i=null;if(n){let l=s=>s.startsWith("!")||!s.startsWith("-")?s:"!"+s.replace(/^-+/,""),h=n.split(/[;,]/).map(s=>s.trim()).filter(Boolean).map(l).filter(s=>s!=="!"),u=s=>{let y=s.startsWith("!"),P=y?s.slice(1):s;return/^(\*\.)?\.[A-Za-z0-9][A-Za-z0-9._-]*$/.test(P)||/^\*\.[A-Za-z0-9][A-Za-z0-9._-]*$/.test(P)?(y?"!":"")+`**/*.${P.replace(/^(\*\.|\.)/,"")}`:s};h=h.map(u);let b=h.some(s=>s.startsWith("!")),K=s=>V.isDynamicPattern(s)||/[*?{}[\]()|+]/.test(s),$=h.filter(s=>!K(s));if(h.some(K)){i="glob";let s=n.replace(/\\/g,"/"),y=null;if($.length>0&&$.length<h.length){y={};for(let r of $){let a=r.replace(/[\\/]+$/,"").replace(/\\/g,"/");try{let m=await T.stat(E.resolve(c,a));y[r]=m.isDirectory()?`${a}/**`:a}catch{y[r]=`${a}/**`}}}let P=h.map(r=>y&&y[r]!==void 0?y[r]:r.replace(/\\/g,"/")),_=M.map(r=>r.startsWith(".")?`**/*${r}`:`**/${r}/**`);if(b&&!h.some(r=>!r.startsWith("!"))){let r=await B(c,M,c),a=w=>w.endsWith("/")?w+"**":w,m=P.filter(w=>w.startsWith("!")).map(w=>a(w.slice(1))),S=P.filter(w=>!w.startsWith("!")).map(a);t=r.filter(w=>{let F=w.relativePath.replace(/\\/g,"/"),X=S.length===0||S.some(N=>{try{return new at(N).match(F)}catch{return!1}}),H=m.some(N=>{try{return new at(N).match(F)}catch{return!1}});return X&&!H})}else{let r=P.some(m=>/[\(\)\|]|\.\*/.test(m)),a=[];if(!r)try{a=await V(P,{cwd:c,ignore:_,dot:!0,onlyFiles:!0,absolute:!1})}catch{a=[]}if(a.length===0&&(r||V.isDynamicPattern(s))){let m=s.match(/^([^\*\?\(\)\|\[\]\s]+)\//),S=m&&!/[\*\?\(\)\|\[\]]/.test(m[1])?E.resolve(c,m[1]):c,w=await B(S,M,c);try{let F=s.replace(/^\.\//,"");F=F.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!F.startsWith("^")&&!F.startsWith(".*")&&(F=`.*${F}`);let X=new RegExp(F.endsWith("$")?F:`${F}$`,"i");t=w.filter(H=>{let N=H.relativePath.replace(/\\/g,"/");return X.test(N)})}catch{t=[]}}else t=a.map(m=>({fullPath:E.resolve(c,m),relativePath:m}))}}else{let s=[],y=!1,P=!1,_=h.map(r=>({raw:r,fullPath:E.resolve(c,r.replace(/[\/\\]+$/,""))})),et=_.filter(r=>!_.some(a=>a!==r&&(r.fullPath+E.sep).startsWith(a.fullPath+E.sep)));for(let{raw:r,fullPath:a}of et)try{let m=await T.stat(a);if(m.isDirectory()){P=!0;let S=await B(a,M,c);s.push(...S)}else if(m.isFile())y=!0,s.push({fullPath:a,relativePath:E.relative(c,a)});else return`ERROR: Path is neither a file nor a directory: ${r}`}catch{return`ERROR: Path not found: ${r}`}t=s,y&&!P?i="file":i="dir"}}else t=await B(c,M);let k=t.map(async l=>{try{let h=await T.readFile(l.fullPath,"utf-8");if(h.includes("\0"))return[];let u=h.split(/\r?\n/),b=[];for(let $=0;$<u.length;$++)(W?u[$].toLowerCase().includes(e.toLowerCase())||gt(u[$],e):G?L&&L.test(u[$]):z&&z.test(u[$])||L&&L.test(u[$]))&&b.push({line:$+1,content:u[$].trim()});return b.length===0?null:{path:l.relativePath.replace(/\\/g,"/"),matches:b}}catch{return[]}}),ct=await Promise.all(k),D=[],C=0;for(let l of ct){if(!l||!l.matches)continue;if(C>=J)break;let h=J-C,u=l.matches.slice(0,h);D.push({path:l.path,matches:u}),C+=u.length}typeof global.gc=="function"&&global.gc();let I=null;if(D.length===0){let l=i==="file"?` in '${n}'`:i==="dir"||i==="glob"?` in '${n}'`:". Try to specify files",h=i==="dir"?"[DIR]":i==="glob"?"[GLOB]":"";return`${h}${h?" ":""}Found 0 matches of '${e}'${l}${I?` ${I}`:""}`}let U=I?` ${I}`:"",Q=`${D.length} file${D.length===1?"":"s"}`,j=`${C} match${C===1?"":"es"}`,Z;i==="file"?Z=`Found ${j} of '${e}' in '${n}'${U}:`:i==="dir"||i==="glob"?Z=`Found ${j} of '${e}' in '${n}' across ${Q}${U}:`:Z=`Found ${j} of '${e}' across ${Q}${U}:`;let Y=i==="dir"?"[DIR]":i==="glob"?"[GLOB]":"",O=`${Y}${Y?" ":""}${Z}
|
|
2
|
+
|
|
3
|
+
`,tt="";try{let l=await ot();l?.systemSettings?.alwaysAskFiles&&(tt=l.systemSettings.alwaysAskFiles)}catch{}for(let l of D)if(O+=`${l.path}:
|
|
4
|
+
`,nt(l.path,tt)){let u=l.matches.map(b=>`Line ${b.line}`).join(", ");O+=` ${u}. Line snapshot not available due to file restriction policy. ReadFile if needed
|
|
5
|
+
|
|
6
|
+
`}else{for(let u of l.matches)O+=` Line ${u.line}: ${u.content}
|
|
7
|
+
`;O+=`
|
|
8
|
+
`}let ft=x?`
|
|
9
|
+
[Note: '~' resolved to user home directory. To target literal '~' in current directory, escape it as '\\~']`:"";return`${O.trimEnd()}${ft}`}catch(t){return`ERROR: ${t.message}`}};export{Pt as search_keyword};
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as $}from"./chunks/chunk-NPXJIGAI.js";import{spawn as
|
|
2
|
+
import{a as $}from"./chunks/chunk-NPXJIGAI.js";import{spawn as $e}from"child_process";import{fileURLToPath as me}from"url";import Me from"os";import te from"path";import T from"fs";import N from"dotenv";try{let t=te.join($,"AGENTS.md"),f=te.join($,"FLUXFLOW.md");T.existsSync($)||T.mkdirSync($,{recursive:!0}),T.existsSync(t)||T.writeFileSync(t,"","utf8"),T.existsSync(f)||T.writeFileSync(f,"","utf8")}catch{}N.config({path:"./.env",override:!0,quiet:!0});N.config({path:`${$}/.env`,override:!0,quiet:!0});N.config({path:`${$}/.env.agents`,override:!0,quiet:!0});N.config({path:`${$}/.env.fluxflow`,override:!0,quiet:!0});N.config({path:"./.env.agents",override:!0,quiet:!0});N.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var Ce=Me.totalmem(),de=Ce/(1024*1024),Ae=.5,ke=Math.floor(de*Ae),ue=process.argv.slice(2),pe=ue.indexOf("--allocation"),g=pe!==-1?parseInt(ue[pe+1],10):NaN,Ee=process.env.EXPERIMENTAL_MEMORY_MANAGER==="true"||process.env.EXPERIMENTAL_MEMORY_MANAGER==="1"||process.env.EXPERIMENTAL_MEMORY_MANAGER===!0||process.env.EXPERIMENTAL_MEMORY_MANAGER===1||!1,Pe=!isNaN(g)||Ee||!1;!isNaN(g)&&g<64&&(console.error(`
|
|
3
3
|
[ERROR] Allocation value '${g} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
|
-
`),process.exit(1));var O=Math.floor(
|
|
5
|
-
[MEMORY] Starting with: '${g>O?O:g} MB' Allocation${g>O?" (Max allowed: '"+O+" MB')":""}. Please Wait...`),await new Promise(f=>setTimeout(f,5e3)))
|
|
4
|
+
`),process.exit(1));var O=Math.floor(de*.75),Fe=!isNaN(g)&&g>0?Math.min(g,O):Math.max(1536,Math.min(32768,ke)),Ie=me(import.meta.url).endsWith(".js");if(Ie&&!process.execArgv.some(t=>t.includes("max-old-space-size"))&&Pe)Number.isNaN(g)||(console.log(`
|
|
5
|
+
[MEMORY] Starting with: '${g>O?O:g} MB' Allocation${g>O?" (Max allowed: '"+O+" MB')":""}. Please Wait...`),await new Promise(f=>setTimeout(f,5e3))),$e(process.execPath,[`--max-old-space-size=${Fe}`,"--expose-gc","--max-semi-space-size=1",me(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",f=>process.exit(f||0));else{let t=process.argv.slice(2),f=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",oe=t.includes("--help")&&!f,se=t.includes("--version")||t.includes("-v"),re=t[0]==="--update",ne=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-7KEKAGPH.js"),{url:d}=await o();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
7
|
\u2800\u2800\u2514\u2500 Serving at: ${d}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
9
|
-
`),await new Promise(()=>{})}if(oe||
|
|
10
|
-
Usage: fluxflow --export error`),process.exit(1)}if(
|
|
9
|
+
`),await new Promise(()=>{})}if(se||oe||f||re||ne){let o=await import("fs"),d=await import("path"),{fileURLToPath:s}=await import("url"),u=d.join(d.dirname(s(import.meta.url)),"../package.json"),i=JSON.parse(o.readFileSync(u,"utf8")).version;if(ne){let C=(t[1]||"").toLowerCase();if(C==="error"||C==="logs")try{let{exportErrorLogs:x}=await import("./chunks/export-MCZIN2ZJ.js"),c=await x();console.log(`[EXPORT LOGS] Exported ${c.entryCount} error log entries (FluxFlow: ${c.fluxflowCount}, Memory: ${c.memoryCount}, Usage: ${c.usageCount}) to "${c.exportFile}"`),process.exit(0)}catch(x){console.error(`[EXPORT ERROR] Failed to export error logs: ${x.message}`),process.exit(1)}else console.error(`[EXPORT ERROR] Invalid export target "${t[1]||""}". --export only supports 'error'.
|
|
10
|
+
Usage: fluxflow --export error`),process.exit(1)}if(se&&(console.log(`v${i}`),process.exit(0)),oe&&(console.log(`FluxFlow CLI Arguments:
|
|
11
11
|
--mode <flux|flow|icu|omni> Set startup mode (Agent / Chat / Computer Use / Sentient being)
|
|
12
12
|
--model <model_name> Set startup AI model
|
|
13
13
|
--key <key@provider> Set API key and provider
|
|
@@ -65,11 +65,11 @@ Usage: fluxflow --export error`),process.exit(1)}if(oe&&(console.log(`v${i}`),pr
|
|
|
65
65
|
/docs View documentation
|
|
66
66
|
/fluxflow init Create FluxFlow.md template
|
|
67
67
|
/update check Check for new version
|
|
68
|
-
/update latest Install latest release`),process.exit(0)),
|
|
68
|
+
/update latest Install latest release`),process.exit(0)),re){let C=t[1]||"latest";if(C==="check"){let x=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(x?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let p=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;p||(console.error("Error: Could not retrieve latest version."),process.exit(1)),p===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let r=(await import("react")).default,{useState:w}=r,{render:L,Box:h,Text:S}=await import("ink"),ae=(await import("ink-select-input")).default,_=(await import("ink-text-input")).default;return new Promise(B=>{let E=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],X=({label:P,isSelected:F})=>r.createElement(h,{width:"100%"},r.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",P)),b,V=()=>{let[P,F]=w("select"),[z,j]=w(""),K=I=>{I.value==="custom"?F("custom"):D({manager:I.value})},Q=I=>{D({manager:"custom",customCommand:I})};return P==="custom"?r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),r.createElement(h,{flexDirection:"row"},r.createElement(S,{color:"cyan",bold:!0}," \u276F "),r.createElement(_,{value:z,onChange:j,onSubmit:Q})),r.createElement(h,{marginTop:1},r.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),r.createElement(ae,{items:E,onSelect:K,itemComponent:X,indicatorComponent:()=>null}))},D=P=>{b&&b(),B(P)},{unmount:J}=L(r.createElement(V,null));b=J})},n,A="",k;try{let{loadSettings:r}=await import("./chunks/settings-YRMZZJ3F.js");k=await r(),n=k?.systemSettings?.updateManager||k?.updateManager}catch{}if(!n){let r=await y();n=r.manager,A=r.customCommand}let m="";n==="pnpm"?m=`pnpm add -g fluxflow-cli@${p}`:n==="bun"?m=`bun add -g fluxflow-cli@${p}`:n==="yarn"?m=`yarn global add fluxflow-cli@${p}`:n==="custom"?m=A||k?.customUpdateCommand||`npm install -g fluxflow-cli@${p}`:m=`npm install -g fluxflow-cli@${p}`,console.log(`Updating FluxFlow to v${p} using ${n}...`),console.log(`Running: ${m}`);let{execSync:U}=await import("child_process");U(m,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${p}.\x1B[0m`)}catch(x){console.error("\x1B[31m\u274C Update failed:\x1B[0m",x.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:ge}=await import("react"),{render:fe}=await import("ink"),{default:xe}=await import("./chunks/app-PUZUWEF7.js");process.env.NODE_NO_WARNINGS="1";let we=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],he=console.log,ve=console.warn,ye=console.error,Y=o=>{let d=o.map(String).join(" ");return we.some(s=>d.includes(s))};console.log=(...o)=>!Y(o)&&he(...o),console.warn=(...o)=>!Y(o)&&ve(...o),console.error=(...o)=>!Y(o)&&ye(...o);let q=t.findIndex(o=>o==="--cwd"||o==="--path");if(q!==-1&&q+1<t.length){let o=t[q+1],d=await import("path"),s=await import("fs-extra"),u=d.default.resolve(o);try{s.default.existsSync(u)&&s.default.statSync(u).isDirectory()?process.chdir(u):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(v){console.error(`[ERROR] Failed to change directory to "${o}": ${v.message}`),process.exit(0)}}let M=t.includes("--commit_8f4a2b9c"),H=t.findIndex(o=>o==="-p"||o==="--prompt");if(H!==-1||M){let o=t.includes("--new")||t.includes("-n"),s=(H!==-1?t.slice(H+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(M)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0);let l="";if(s&&s.trim()){let R=s.trim();R.startsWith("={")&&R.endsWith("}")?l=`
|
|
69
69
|
|
|
70
|
-
Instruction: ${
|
|
70
|
+
Instruction: ${R.slice(2,-1).trim()}`:l=`
|
|
71
71
|
|
|
72
|
-
Hint: ${
|
|
72
|
+
Hint: ${R}`}s=`Git Staged Diff:
|
|
73
73
|
${a}
|
|
74
74
|
---
|
|
75
75
|
|
|
@@ -82,18 +82,18 @@ ${s}`:s=i}if(!M&&!process.stdin.isTTY){let e=[];for await(let l of process.stdin
|
|
|
82
82
|
${a}
|
|
83
83
|
---
|
|
84
84
|
|
|
85
|
-
${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-YRMZZJ3F.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-GLYKU2YR.js"),{getDefaultModel:c}=await import("./chunks/model_config-D3A73AS7.js"),{generateSimpleContent:
|
|
85
|
+
${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-YRMZZJ3F.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-GLYKU2YR.js"),{getDefaultModel:c}=await import("./chunks/model_config-D3A73AS7.js"),{generateSimpleContent:p}=await import("./chunks/ai-HJLIIEAI.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-23Z3SVXU.js"),n=await C(),A=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==s&&e!=="-n"&&e!=="--new"),k=M||A.includes("--raw")||t.includes("--raw"),m=e=>{for(let a of e){let l=A.indexOf(a);if(l!==-1&&l+1<A.length)return A[l+1]}return null},U=M&&n.systemSettings?.commitMessageModel&&n.systemSettings.commitMessageModel!=="Default"?n.systemSettings.commitMessageModel:null,r=M&&U&&n.systemSettings?.commitMessageProvider?n.systemSettings.commitMessageProvider:null,w=m(["--provider"])||r||n.aiProvider||"Google",L=m(["--model"])||U||n.activeModel||c(w,n.apiTier)||c(w,"paid"),h=m(["--key"])||await x(w);!h&&!(w==="c_openai"&&n.systemSettings?.customOpenAIBaseUrl)&&(console.error(`[ERROR] No API key resolved for provider "${w}".`),process.exit(1));let S=await y("agent",{aiProvider:w});S.allowed||(console.error(`[ERROR] ${S.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:ae="",nickname:_="",instructions:B=""}=n?.profileData??{},E={aiProvider:w,apiKey:h,model:L,mode:"flow",thinkingLevel:m(["--thinking"])||"Fast",systemSettings:n.systemSettings||{}},X=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",b=new Date,V=b.getFullYear(),D=b.toLocaleString("en-US",{month:"short"}).toUpperCase(),J=String(b.getDate()).padStart(2,"0"),P=b.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),F=`${V}-${D}-${J}, ${P}`,z=(E.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),j=te.basename(z).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replace(/(\d)-(\d)/g,"$1.$2").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),K=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
86
86
|
Use NO markdown, only plain text
|
|
87
87
|
Context:
|
|
88
|
-
- OS: ${
|
|
88
|
+
- OS: ${X}
|
|
89
89
|
- Model: ${j}
|
|
90
90
|
- Approx time: ${F}
|
|
91
91
|
- Non interactive CLI, support piped inputs
|
|
92
92
|
- 'fluxflow' TUI has full agentic tools${_.trim().length>0?`
|
|
93
|
-
User Nickname: ${_.trim()}`:""}${
|
|
94
|
-
User Preferences: ${
|
|
95
|
-
`)}let{text:e}=await
|
|
96
|
-
${
|
|
97
|
-
`}`),a&&await
|
|
93
|
+
User Nickname: ${_.trim()}`:""}${B.trim().length>0?`
|
|
94
|
+
User Preferences: ${B.trim()}`:""}`.trim(),{getPromptSessionHistory:Q,savePromptSessionHistory:I,clearPromptSessionHistory:Se}=await import("./chunks/sessionDaemon-GHQTAGDG.js"),G=[];o&&!M?await Se():o||(G=await Q());let Z=[];if(Array.isArray(G)&&G.length>0)for(let e of G)e.text&&Z.push({role:e.role==="model"?"model":"user",parts:[{text:e.text}]});Z.push({role:"user",parts:[{text:s}]});try{if(!k){let l="\x1B[36m",R="\x1B[35m",ee="\x1B[0m",be=j,W=E.aiProvider;if(W==="c_openai"||W==="Custom (OpenAI)")try{let{resolveBaseUrl:le}=await import("./chunks/secrets_v2-ZSQLFEIS.js"),ce=await le("c_openai")||E.systemSettings?.customOpenAIBaseUrl||"";ce&&(W=ce)}catch{}process.stdout.write(`Responding with ${l}${be}${ee} from ${R}${W}${ee}:
|
|
95
|
+
`)}let{text:e}=await p(E,L,Z,K,E.thinkingLevel),a=(e||"").trim();process.stdout.write(a+`
|
|
96
|
+
${k?"":`
|
|
97
|
+
`}`),a&&await I(s,a)}catch(e){console.error(`[ERROR] Prompt request failed: ${e.message.trim()}
|
|
98
98
|
|
|
99
|
-
`),process.exit(1)}process.exit(0)}process.stdout.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07"),process.stdout.write("\x1B[?2004h"));let
|
|
99
|
+
`),process.exit(1)}process.exit(0)}process.stdout.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07"),process.stdout.write("\x1B[?2004h"));let ie=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",ie),["SIGINT","SIGTERM","SIGHUP"].forEach(o=>{process.once(o,()=>{ie(),process.exit(0)})}),t.includes("--playground")){let o=process.cwd();process.argv.push("--original-cwd",o);let{DATA_DIR:d}=await import("./chunks/paths-4NQOSFLK.js"),s=await import("path"),u=await import("fs-extra"),v=s.default.join(d,"playground");try{u.default.ensureDirSync(v),process.chdir(v)}catch{}}fe(ge.createElement(xe,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{a as nt}from"./chunk-6LM3YRRE.js";import{b as rt}from"./chunk-3XJQTYIL.js";import"./chunk-2Q6KKC74.js";import"./chunk-ZGORMZE5.js";import{w as Y,x as tt,y as et,z as st}from"./chunk-NPXJIGAI.js";import X from"fs/promises";import W from"path";import K from"fast-glob";import{Minimatch as it}from"minimatch";async function N(h,l,$=h,m=1){if(m>12)return[];let u=[],i;try{i=await X.readdir(h,{withFileTypes:!0})}catch{return[]}for(let s of i){let r=W.join(h,s.name),y=W.relative($,r),E=y.split(W.sep).map(L=>L.toLowerCase()),B=s.name.toLowerCase();if(!l.some(L=>{let v=L.toLowerCase();return v.startsWith(".")&&B.endsWith(v)?!0:E.some(P=>P===v||P.startsWith(".pnpm"))}))if(s.isDirectory()){let L=await N(r,l,$,m+1);u=u.concat(L)}else s.isFile()&&u.push({fullPath:r,relativePath:y})}return u}function ct(h,l,$=1/0){if(h===l)return 0;if(h.length===0)return l.length;if(l.length===0)return h.length;if(Math.abs(h.length-l.length)>$)return $+1;let m=Array.from({length:l.length+1},(u,i)=>i);for(let u=1;u<=h.length;u++){let i=[u],s=u;for(let r=1;r<=l.length;r++){let y=h[u-1]===l[r-1]?0:1,E=Math.min(i[r-1]+1,m[r]+1,m[r-1]+y);i.push(E),E<s&&(s=E)}if(m=i,s>$)return $+1}return m[l.length]}function ft(h,l){if(!h||!l)return!1;let $=h.toLowerCase(),m=l.toLowerCase();if($.includes(m))return!0;let u=$.split(/[^a-z0-9]+/).filter(s=>s.length>0),i=m.split(/[^a-z0-9]+/).filter(s=>s.length>1||m.length===1&&s.length>0);return i.length===0?!1:i.every(s=>{let r=s.length<=2?0:s.length<=5?1:2;for(let y of u)if(y.includes(s)||s.length>=3&&y.length>=3&&Math.abs(y.length-s.length)<=r&&ct(s,y,r)<=r)return!0;return!1})}var wt=async h=>{let{keyword:l,path:$,fuzzy:m,subString:u,regex:i}=nt(h,["keyword","path"]);if(l==null)return'ERROR: Missing "keyword" argument.';let s=String(l),r=$,y=!1;if(r){let{resolvedPath:e,isTildeResolved:a}=st(r);r=e,y=a;let n=r.trim().toLowerCase();if(n==="#docs"||n==="#doc"||n==="#documentation"||n.includes("#skill/global/fluxflow")||n.startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills."}let E=e=>e===!0||e==="true"||e===1||e==="1"||e==="yes",B=i===!1||i==="false"||i===0||i==="0"||i==="no",A=i===!0||i==="true"||i===1||i==="1"||i==="yes",L=E(m)||E(u),v=null,P=null,H=e=>{let a=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=/^\w/.test(e)?"(?<![\\w])":"",_=/\w$/.test(e)?"(?![\\w])":"";return new RegExp(`${n}${a}${_}`,"i")};if(B)L||(P=H(s));else{try{let e=A?s:s.replace(/\(\?i\)/g,"");if(!A&&e.includes("||")&&(e=e.replace(/\|\|/g,"|")),!A&&e.includes("|")){let a=e.split("|").map(n=>n.trim()).filter(Boolean);e=a.length>0?a.join("|"):e}if(!A&&e.trim()==="")throw new Error("empty regex after (?i) cleanup");v=new RegExp(e,"i")}catch(e){if(A)return`ERROR: Invalid regex pattern "${s}": ${e.message}`}P=H(s)}let M=Array.from(new Set([...Y,...tt(process.cwd())])),V=150;try{let e=[],a=process.cwd(),n=null;if(r){let o=t=>t.startsWith("!")||!t.startsWith("-")?t:"!"+t.replace(/^-+/,""),f=r.split(/[;,]/).map(t=>t.trim()).filter(Boolean).map(o).filter(t=>t!=="!"),c=t=>{let w=t.startsWith("!"),F=w?t.slice(1):t;return/^(\*\.)?\.[A-Za-z0-9][A-Za-z0-9._-]*$/.test(F)||/^\*\.[A-Za-z0-9][A-Za-z0-9._-]*$/.test(F)?(w?"!":"")+`**/*.${F.replace(/^(\*\.|\.)/,"")}`:t};f=f.map(c);let z=f.some(t=>t.startsWith("!"));if(f.some(t=>K.isDynamicPattern(t)||/[*?{}[\]()|+]/.test(t))){n="glob";let t=r.replace(/\\/g,"/"),w=f.map(g=>g.replace(/\\/g,"/")),F=M.map(g=>g.startsWith(".")?`**/*${g}`:`**/${g}/**`);if(z&&!f.some(g=>!g.startsWith("!"))){let g=await N(a,M,a),R=p=>p.endsWith("/")?p+"**":p,d=w.filter(p=>p.startsWith("!")).map(p=>R(p.slice(1))),b=w.filter(p=>!p.startsWith("!")).map(R);e=g.filter(p=>{let x=p.relativePath.replace(/\\/g,"/"),U=b.length===0||b.some(O=>{try{return new it(O).match(x)}catch{return!1}}),j=d.some(O=>{try{return new it(O).match(x)}catch{return!1}});return U&&!j})}else{let g=w.some(d=>/[\(\)\|]|\.\*/.test(d)),R=[];if(!g)try{R=await K(w,{cwd:a,ignore:F,dot:!0,onlyFiles:!0,absolute:!1})}catch{R=[]}if(R.length===0&&(g||K.isDynamicPattern(t))){let d=t.match(/^([^\*\?\(\)\|\[\]\s]+)\//),b=d&&!/[\*\?\(\)\|\[\]]/.test(d[1])?W.resolve(a,d[1]):a,p=await N(b,M,a);try{let x=t.replace(/^\.\//,"");x=x.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!x.startsWith("^")&&!x.startsWith(".*")&&(x=`.*${x}`);let U=new RegExp(x.endsWith("$")?x:`${x}$`,"i");e=p.filter(j=>{let O=j.relativePath.replace(/\\/g,"/");return U.test(O)})}catch{e=[]}}else e=R.map(d=>({fullPath:W.resolve(a,d),relativePath:d}))}}else{let t=[],w=!1,F=!1;for(let I of f){let g=I.replace(/[\/\\]+$/,""),R=W.resolve(a,g);try{let d=await X.stat(R);if(d.isDirectory()){F=!0;let b=await N(R,M,a);t.push(...b)}else if(d.isFile())w=!0,t.push({fullPath:R,relativePath:W.relative(a,R)});else return`ERROR: Path is neither a file nor a directory: ${I}`}catch{return`ERROR: Path not found: ${I}`}}e=t,w&&!F?n="file":n="dir"}}else e=await N(a,M);let _=e.map(async o=>{try{let f=await X.readFile(o.fullPath,"utf-8");if(f.includes("\0"))return[];let c=f.split(/\r?\n/),z=[];for(let t=0;t<c.length;t++)(L?c[t].toLowerCase().includes(s.toLowerCase())||ft(c[t],s):B?P&&P.test(c[t]):v&&v.test(c[t])||P&&P.test(c[t]))&&z.push({line:t+1,content:c[t].trim()});return z.length===0?null:{path:o.relativePath.replace(/\\/g,"/"),matches:z}}catch{return[]}}),ot=await Promise.all(_),S=[],D=0;for(let o of ot){if(!o||!o.matches)continue;if(D>=V)break;let f=V-D,c=o.matches.slice(0,f);S.push({path:o.path,matches:c}),D+=c.length}typeof global.gc=="function"&&global.gc();let G=null;if(S.length===0){let o=n==="file"?` in '${r}'`:n==="dir"||n==="glob"?` in '${r}'`:". Try to specify files",f=n==="dir"?"[DIR]":n==="glob"?"[GLOB]":"";return`${f}${f?" ":""}Found 0 matches of '${s}'${o}${G?` ${G}`:""}`}let T=G?` ${G}`:"",q=`${S.length} file${S.length===1?"":"s"}`,k=`${D} match${D===1?"":"es"}`,Z;n==="file"?Z=`Found ${k} of '${s}' in '${r}'${T}:`:n==="dir"||n==="glob"?Z=`Found ${k} of '${s}' in '${r}' across ${q}${T}:`:Z=`Found ${k} of '${s}' across ${q}${T}:`;let J=n==="dir"?"[DIR]":n==="glob"?"[GLOB]":"",C=`${J}${J?" ":""}${Z}
|
|
2
|
-
|
|
3
|
-
`,Q="";try{let o=await rt();o?.systemSettings?.alwaysAskFiles&&(Q=o.systemSettings.alwaysAskFiles)}catch{}for(let o of S)if(C+=`${o.path}:
|
|
4
|
-
`,et(o.path,Q)){let c=o.matches.map(z=>`Line ${z.line}`).join(", ");C+=` ${c}. Line snapshot not available due to file restriction policy. ReadFile if needed
|
|
5
|
-
|
|
6
|
-
`}else{for(let c of o.matches)C+=` Line ${c.line}: ${c.content}
|
|
7
|
-
`;C+=`
|
|
8
|
-
`}let lt=y?`
|
|
9
|
-
[Note: '~' resolved to user home directory. To target literal '~' in current directory, escape it as '\\~']`:"";return`${C.trimEnd()}${lt}`}catch(e){return`ERROR: ${e.message}`}};export{wt as search_keyword};
|