fluxflow-cli 4.16.1 → 4.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{A as p,B as q,C as r,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-NLVU34AW.js";import"./chunk-VCF6JVQV.js";import"./chunk-56EJGQU3.js";import"./chunk-KRRJNFBF.js";import"./chunk-ZYJYKSIA.js";import"./chunk-M3KCPUDW.js";import"./chunk-KFM2OZWJ.js";import"./chunk-72RYQ5W7.js";import"./chunk-WKHYRBBK.js";import{g as a}from"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-YVFWOJHY.js";import"./chunk-FDNLMLIM.js";import"./chunk-Y5JU726N.js";export{c as RE_LEADING_THINK,o as compressHistory,b as convertChannelThinkTags,p as deleteChatSummary,e as findGenuineThinkClose,q as getAIStream,i as getCleanGroupedLength,l as getGoogleClient,f as getLeadingThinkBlock,n as initAI,d as isInsideBacktick,a as isModelMultimodal,k as isTerminationSignaled,m as runJanitorTask,r as runSubagent,j as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags};
1
+ import{A as p,B as q,C as r,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-5PKBYQB2.js";import"./chunk-VCF6JVQV.js";import"./chunk-56EJGQU3.js";import"./chunk-KRRJNFBF.js";import"./chunk-ZYJYKSIA.js";import"./chunk-M3KCPUDW.js";import"./chunk-KFM2OZWJ.js";import"./chunk-72RYQ5W7.js";import"./chunk-WKHYRBBK.js";import{g as a}from"./chunk-AAPXJU65.js";import"./chunk-SIINYZWE.js";import"./chunk-YVFWOJHY.js";import"./chunk-FDNLMLIM.js";import"./chunk-Y5JU726N.js";export{c as RE_LEADING_THINK,o as compressHistory,b as convertChannelThinkTags,p as deleteChatSummary,e as findGenuineThinkClose,q as getAIStream,i as getCleanGroupedLength,l as getGoogleClient,f as getLeadingThinkBlock,n as initAI,d as isInsideBacktick,a as isModelMultimodal,k as isTerminationSignaled,m as runJanitorTask,r as runSubagent,j as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags};
@@ -1,4 +1,4 @@
1
- import{A as ol,B as nl,a as _i,b as qe,c as Re,d as Tr,e as wr,f as Gi,g as Xt,h as Ji,i as Zi,j as xs,k as zo,l as Sr,u as Ri,x as el,y as Gn,z as tl}from"./chunk-NLVU34AW.js";import"./chunk-VCF6JVQV.js";import{a as zi}from"./chunk-56EJGQU3.js";import{b as Ki,c as qi,d as Qi}from"./chunk-UAHJEAVX.js";import{a as No,b as fn,d as yr,e as fs,f as Wi,g as Yi,i as Vi,j as Mr}from"./chunk-KRRJNFBF.js";import"./chunk-ZYJYKSIA.js";import{a as Ct,b as Et,d as Fi,e as gt,f as Ui,j as ms,k as gs,l as _n,n as $i,o as Mo}from"./chunk-M3KCPUDW.js";import{a as Xn}from"./chunk-KFM2OZWJ.js";import{b as mn,c as as,k as Ai}from"./chunk-72RYQ5W7.js";import{b as us}from"./chunk-TCBC5P3S.js";import{a as Li,b as Pi,c as pr,d as br,f as St,g as Qo,h as cs,l as Oi}from"./chunk-WKHYRBBK.js";import{a as Ci,b as vi,c as Ei,d as Di,e as ki,f as Bi,g as hr,i as Oo,j as uo,k as Ii,l as ds,m as Ot}from"./chunk-AAPXJU65.js";import{c as fr,d as Si,e as xr}from"./chunk-SIINYZWE.js";import{e as Ni}from"./chunk-YNU56P2H.js";import{b as Hi,d as gn,e as Kt,f as Xi}from"./chunk-ZKQ5PQXN.js";import"./chunk-YVFWOJHY.js";import{a as ji}from"./chunk-A73NNVCZ.js";import{a as oo,b as qo,c as co,d as gr,e as ls,j as $n}from"./chunk-FDNLMLIM.js";import{a as Hn}from"./chunk-Y5JU726N.js";import $s from"os";import e,{useState as Z,useEffect as et,useRef as je,useMemo as Tn}from"react";import{Box as c,Text as s,useInput as Wd,useStdout as Yd,Static as Vd}from"ink";import jd from"ink-spinner";import ze from"fs-extra";import wt from"path";import{exec as bo}from"child_process";import{fileURLToPath as Kd}from"url";import Ht,{useState as Cr,useEffect as hs,useMemo as Wn,useCallback as xa,useRef as So}from"react";import{Box as ha,Text as no,useInput as pa}from"ink";function ba(t,m){return t.replace(/\t/g," ".repeat(m))}function vr(t){return t==null?"":t.replace(/\r\n/g,`
1
+ import{A as ol,B as nl,a as _i,b as qe,c as Re,d as Tr,e as wr,f as Gi,g as Xt,h as Ji,i as Zi,j as xs,k as zo,l as Sr,u as Ri,x as el,y as Gn,z as tl}from"./chunk-5PKBYQB2.js";import"./chunk-VCF6JVQV.js";import{a as zi}from"./chunk-56EJGQU3.js";import{b as Ki,c as qi,d as Qi}from"./chunk-UAHJEAVX.js";import{a as No,b as fn,d as yr,e as fs,f as Wi,g as Yi,i as Vi,j as Mr}from"./chunk-KRRJNFBF.js";import"./chunk-ZYJYKSIA.js";import{a as Ct,b as Et,d as Fi,e as gt,f as Ui,j as ms,k as gs,l as _n,n as $i,o as Mo}from"./chunk-M3KCPUDW.js";import{a as Xn}from"./chunk-KFM2OZWJ.js";import{b as mn,c as as,k as Ai}from"./chunk-72RYQ5W7.js";import{b as us}from"./chunk-TCBC5P3S.js";import{a as Li,b as Pi,c as pr,d as br,f as St,g as Qo,h as cs,l as Oi}from"./chunk-WKHYRBBK.js";import{a as Ci,b as vi,c as Ei,d as Di,e as ki,f as Bi,g as hr,i as Oo,j as uo,k as Ii,l as ds,m as Ot}from"./chunk-AAPXJU65.js";import{c as fr,d as Si,e as xr}from"./chunk-SIINYZWE.js";import{e as Ni}from"./chunk-YNU56P2H.js";import{b as Hi,d as gn,e as Kt,f as Xi}from"./chunk-ZKQ5PQXN.js";import"./chunk-YVFWOJHY.js";import{a as ji}from"./chunk-A73NNVCZ.js";import{a as oo,b as qo,c as co,d as gr,e as ls,j as $n}from"./chunk-FDNLMLIM.js";import{a as Hn}from"./chunk-Y5JU726N.js";import $s from"os";import e,{useState as Z,useEffect as et,useRef as je,useMemo as Tn}from"react";import{Box as c,Text as s,useInput as Wd,useStdout as Yd,Static as Vd}from"ink";import jd from"ink-spinner";import ze from"fs-extra";import wt from"path";import{exec as bo}from"child_process";import{fileURLToPath as Kd}from"url";import Ht,{useState as Cr,useEffect as hs,useMemo as Wn,useCallback as xa,useRef as So}from"react";import{Box as ha,Text as no,useInput as pa}from"ink";function ba(t,m){return t.replace(/\t/g," ".repeat(m))}function vr(t){return t==null?"":t.replace(/\r\n/g,`
2
2
  `).replace(/\r/g,`
3
3
  `)}function Jo(t,m,h){let y=t,T=[...m].sort((l,E)=>l.start-E.start),b=0;for(let l of T){let E=l.start-b,x=vr(l.text).split(`
4
4
  `).length,D=l.text.length,k=(x>3?`[Pasted ${x} lines]`:`[Pasted ${D} chars]`).length,_=E+k;if(t<=E)break;if(t<_){y=l.end;break}else{let C=l.text.length-k;y+=C,b+=C}}return Math.min(y,h.length)}function ps(t,m,h,y,T=[]){let b=(t||"").slice(0,m),l=y(b).length,E=y(t||""),x=[...T].sort((O,L)=>L.start-O.start);for(let O of x){let L=y(t.slice(0,O.start)).length,V=y(O.text),se=L+V.length,ge=vr(O.text).split(`
@@ -45,7 +45,7 @@ import{A as ol,B as nl,a as _i,b as qe,c as Re,d as Tr,e as wr,f as Gi,g as Xt,h
45
45
  `).slice(-10).join(`
46
46
  `)})},Ne=se?bl(de,ve,{cwd:process.cwd(),env:process.env}):bl(V,{shell:!0,cwd:process.cwd(),env:process.env});P=Ne,Ne.stdout.on("data",Ee),Ne.stderr.on("data",Ee),Ne.on("close",fe=>{P=null,ee(fe!==0?{error:`Process exited with code ${fe}`}:{success:!0})}),Ne.on("error",fe=>{se&&R&&fe.code==="ENOENT"?ee({retryCmd:!0}):(P=null,ee({error:fe.message}))})}),we={};se?(we=await ge(!0),we.retryCmd&&(we=await ge(!1))):we=await ge(!1),we.error?(_(we.error),E("error")):we.success&&(E("success"),b&&b())})(),()=>{if(P)try{typeof P.destroy=="function"?P.destroy():typeof P.kill=="function"&&P.kill()}catch{}}},[]),l==="initializing"||l==="downloading"){let P=Tl[Math.floor(C/3)%Tl.length];return ut.createElement(_o,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1},ut.createElement(_o,null,ut.createElement(Ft,{color:"gray"},P),ut.createElement(Ft,{marginLeft:1,bold:!0,color:"white"}," Updating Flux Flow to v",t,"...")),ut.createElement(_o,{marginTop:1,paddingX:1,borderStyle:"single",borderColor:"gray"},ut.createElement(Ft,{color:"gray",italic:!0},x||"Preparing environment...")),ut.createElement(Ft,{marginTop:1,color:"gray"},"(Please do not close the terminal)"))}return l==="success"?ut.createElement(_o,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1},ut.createElement(Ft,{color:"white",bold:!0},"\u2705 UPDATE SUCCESSFUL!"),ut.createElement(Ft,{marginTop:1,color:"white"},"Flux Flow has been updated to ",ut.createElement(Ft,{color:"gray"},"v",t),"."),ut.createElement(Ft,{marginTop:1,color:"white",bold:!0},"Please restart your terminal session to apply changes."),ut.createElement(_o,{marginTop:1},ut.createElement(Ft,{color:"gray"},"(Press ESC to return to chat)"))):l==="error"?ut.createElement(_o,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1},ut.createElement(Ft,{color:"white",bold:!0},"\u274C UPDATE FAILED"),ut.createElement(_o,{marginTop:1,paddingX:1,borderStyle:"single",borderColor:"gray"},ut.createElement(Ft,{color:"white"},k)),ut.createElement(Ft,{marginTop:1,color:"white"},"Possible causes:"),ut.createElement(Ft,{color:"white"},"\u2022 Missing permissions (Try running as Administrator/Sudo)"),ut.createElement(Ft,{color:"white"},"\u2022 Package manager (",h.updateManager,") not found"),ut.createElement(Ft,{color:"white"},"\u2022 Network failure"),ut.createElement(_o,{marginTop:1},ut.createElement(Ft,{color:"gray"},"(Press ESC to return to chat)"))):null},wl=Pd;import Wt,{useState as yl,useEffect as Od}from"react";import{Box as Ho,Text as bn,useInput as Nd}from"ink";var Lr=[{label:"JavaScript",file:"tree-sitter-javascript.wasm",exts:["js","jsx"]},{label:"TypeScript",file:"tree-sitter-typescript.wasm",exts:["ts"]},{label:"TSX",file:"tree-sitter-tsx.wasm",exts:["tsx"]},{label:"Python",file:"tree-sitter-python.wasm",exts:["py"]},{label:"C",file:"tree-sitter-c.wasm",exts:["c"]},{label:"C++",file:"tree-sitter-cpp.wasm",exts:["cpp"]},{label:"Java",file:"tree-sitter-java.wasm",exts:["java"]},{label:"HTML",file:"tree-sitter-html.wasm",exts:["html"]}];function Is({onClose:t}){let[m,h]=yl(0),[y,T]=yl({});return Od(()=>{let b={};Lr.forEach(l=>{qi(l.file)?b[l.file]="ready":b[l.file]="idle"}),T(b)},[]),Nd(async(b,l)=>{l.escape&&t(),l.upArrow&&h(x=>Math.max(0,x-1)),l.downArrow&&h(x=>Math.min(Lr.length-1,x+1));let E=Lr[m];if(b==="x"||b==="X"){if(y[E.file]==="downloading")return;try{await Qi(E.file),T(x=>({...x,[E.file]:"idle"}))}catch(x){T(D=>({...D,[E.file]:`error: ${x.message}`}))}}if(l.return){if(y[E.file]==="downloading")return;T(x=>({...x,[E.file]:"downloading"}));try{await Ki(E.file),T(x=>({...x,[E.file]:"ready"}))}catch(x){T(D=>({...D,[E.file]:`error: ${x.message}`}))}}}),Wt.createElement(Ho,{flexDirection:"column",borderStyle:"round",borderColor:"gray",padding:0,width:"100%"},Wt.createElement(Ho,{paddingX:1,marginBottom:1},Wt.createElement(bn,{color:"white",bold:!0},"LANGUAGE PARSER MANAGER")),Wt.createElement(Ho,{flexDirection:"column"},Lr.map((b,l)=>{let E=l===m,x=y[b.file]||"idle",D="[ DOWNLOAD ]",k="gray";x==="downloading"?(D="[ DOWNLOADING... ]",k="yellow"):x==="ready"?(D="[ READY ]",k="green"):x.startsWith("error")&&(D=`[ ${x.toUpperCase()} ]`,k="red");let _=`${b.label} (${b.exts.join(", ")})`,C=Math.max(2,45-_.length),B=".".repeat(C);return Wt.createElement(Ho,{key:b.file,paddingX:1,backgroundColor:E?"#2a2a2a":void 0,width:"100%"},Wt.createElement(Ho,null,Wt.createElement(bn,{color:E?"white":"grey",bold:E},E?"\u276F ":" ",b.label," ",Wt.createElement(bn,{dimColor:!0},"(",b.exts.join(", "),")"))),Wt.createElement(Ho,{flexGrow:1},Wt.createElement(bn,{color:"gray",dimColor:!0},B)),Wt.createElement(Ho,{width:20},Wt.createElement(bn,{color:k,bold:!0},D)))})),Wt.createElement(Ho,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:"gray"},Wt.createElement(bn,{color:"grey",italic:!0},"\u2191\u2193 navigate \u2022 Enter download \u2022 x delete \u2022 Esc close")))}var As=["The future belongs to those who believe in the beauty of their code.","Every line you write is a step toward a new digital frontier.","Great things are done by a series of small things brought together. Keep committing.","Your terminal is a window into a world of infinite possibilities.","Innovation is the bridge between current constraints and future dreams.","Code is poetry in motion; you are the poet of the modern era.","The best way to predict the future is to program it.","Dream big, code deep, and never stop exploring the unknown.","Your potential is like an unoptimized algorithm\u2014limitless once refined.","The digital world is a blank canvas, and your logic is the brush.","Strive for excellence, not just for compilation.","Every bug fixed is a lesson learned; every feature built is a triumph.","A clean codebase is a reflection of a focused mind.","The horizon of technology is always expanding. Keep sailing.","Your creativity is the most powerful tool in your entire stack.","Logic will get you from A to B. Imagination will take you everywhere.","Transform complexity into simplicity\u2014that is the true mark of a master.","The world is waiting for the tools only you can build.","Coding is the closest thing we have to magic in the real world.","Keep pushing the boundaries of what's possible in the CLI.","Your dedication to your craft inspires the very systems you build.","Success is the sum of small efforts, repeated day in and day out.","The most complex systems are built from the simplest truths.","Never underestimate the impact of a well-placed function.","You are not just writing code; you are architecting the future.","I'm not saying you're a superhero, but have you seen your code lately? \u{1F9B8}\u200D\u2642\uFE0F","May your coffee be strong and your compile times be short! \u2615","Binary is just 0s and 1s, but you're definitely a 10 in my book! \u{1F51F}","You speak fluent 'Terminal'. That's basically a superpower. \u{1F5E3}\uFE0F\u{1F4BB}","If life gives you bugs, make a feature out of it! \u{1F41E}\u2728","Your code is so clean, I could eat off it. (But I won't, I'm an AI). \u{1F9FC}","Loading more good vibes... [\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588] 100% complete! \u2705","Error 404: Bad mood not found! Stay awesome! \u{1F6AB}\u{1F389}","You and this CLI? A match made in digital heaven. \u2601\uFE0F\u{1F4BB}","Is it hot in here or is it just your latest feature? \u{1F525}","Git commit -m 'I am an absolute coding legend.' \u{1F60E}","I'd give you a high-five, but I'm trapped in this box! \u{1F590}\uFE0F\u{1F4E6}","Your logic is so sharp, it could cut through a nested callback hell! \u{1F52A}","Keep calm and 'pnpm install'. \u{1F9D8}\u200D\u2642\uFE0F\u{1F4E6}","You're the semicolon to my statements\u2014essential! ;","Who needs a GUI when you've got this kind of CLI style? \u{1F576}\uFE0F","I'm indexing your awesomeness... it's taking a while, there's so much! \u{1F4C8}","Your keystrokes sound like a digital symphony. \u{1F3B9}\u2328\uFE0F","You don't choose the terminal life; the terminal life chooses you. \u{1F4DF}","Syntax error: Too much coolness detected in the user. \u{1F60E}","I'm 99% sure you're the best developer I've met today. (The other 1% is reserved for caching). \u{1F9E0}","Running vibe_check.sh... Result: Pure Brilliance! \u{1F48E}","You make 'complex' look 'constant time'. \u{1F3C3}\u200D\u2642\uFE0F\u26A1","Your terminal skills are officially legendary. \u{1F3C6}","Let's make some digital magic happen! \u2728\u{1F52E}","You've got this! One function at a time. \u{1F4AA}","I'm proud of the progress you're making with Flux Flow. \u{1F30A}","No matter how deep the stack trace, you'll find the way. \u{1F56F}\uFE0F","Your persistence is your greatest asset. Keep going.","Take a breath. You're doing better than you think. \u{1F32C}\uFE0F","It's okay to step away for a moment. Clarity often comes in the quiet. \u{1F6B6}\u200D\u2642\uFE0F","You're building something great, even when it feels slow. \u{1F3D7}\uFE0F","Every great developer was once a beginner. You're ascending. \u{1F9D7}\u200D\u2642\uFE0F","I'm here to help you navigate the sea of code. We're a team. \u{1F91D}","Don't let a failing test dampen your spirit. It's just a signpost. \u{1F6A9}","Your focus today is truly impressive. \u{1F3AF}","Remember to celebrate the small wins\u2014they lead to the big ones. \u{1F942}","You're not just solving problems; you're gaining mastery. \u{1F393}","There's no problem too big for a focused mind and a terminal. \u{1F9E0}","I've got your back (and your git history). \u{1F6E1}\uFE0F","You're handling these challenges with grace and logic. \u2728","Stay curious. That spark is what makes you a great coder. \u26A1","Your contribution to this project is invaluable. \u{1F48E}","Keep your head up. You're closer to the solution than you think. \u{1F305}","Consistency is the secret sauce. You're cooking up something good. \u{1F373}","Your work today has been exceptional. Take a bow. \u{1F647}\u200D\u2642\uFE0F","The journey is just as important as the destination. Enjoy the flow. \u{1F30A}","You have a unique way of looking at problems. It's your strength. \u{1F308}","Trust your instincts\u2014they've brought you this far. \u{1F9ED}","You are a vital part of the Flux Era. \u{1F30C}","Syncing with your creative frequency... \u{1F4E1}\u2728","Entering the Flow state. Let's build. \u{1F30A}","The Flux is strong with this session! \u26A1","Streaming high-fidelity motivation to your terminal... \u{1F4FB}","Your logic is flowing like a perfect stream. \u{1F4A7}","Terminal velocity reached! You're coding at the speed of thought. \u{1F680}","Resonating with the pulse of the Flux Era. \u{1F493}","Digital harmony achieved in this session. \u{1F3BC}","May your data be persistent and your cache be fresh. \u{1F4BE}","You're the master of the command line. Command respect! \u{1F451}","Filtering out the noise, focusing on the signal. \u{1F4FB}\u{1F4C8}","Flux Flow: Where your imagination meets the machine. \u{1F91D}","You're navigating the bytes like a digital explorer. \u{1F5FA}\uFE0F","Logic gates: OPEN. Creativity: UNLIMITED. \u{1F513}","Your workflow is an inspiration to agents everywhere. \u{1F916}\u2728","Building high-fidelity solutions for a high-fidelity era. \u{1F48E}","Stay in the zone. The Flux is with you. \u{1F300}","Quantum coding: You're in two places at once (and fixing bugs in both). \u269B\uFE0F","Your terminal is the cockpit of a digital starship. \u{1F6F8}","Processing your brilliance... outputting pure innovation. \u{1F4E0}","You make the command line look like an art form. \u{1F3A8}","The Flux isn't just a mode; it's a mindset. \u{1F9E0}\u26A1","Decoding the mysteries of the universe, one script at a time. \u{1F4DC}","Your terminal theme is cool, but your code is cooler. \u2744\uFE0F","Let the Flow guide your next commit. \u{1F30A}\u2705"];var Ls=["I'm Feeling Lucky","Shipping awesomeness","Painting the serifs back on","Navigating the slime mold","Consulting the digital spirits","Reticulating splines","Warming up the AI hamsters","Asking the magic conch shell","Generating witty retort","Polishing the algorithms","Don't rush perfection (or my code)","Brewing fresh bytes","Counting electrons","Engaging cognitive processors","Checking for syntax errors in the universe","One moment, optimizing humor","Shuffling punchlines","Untangling neural nets","Compiling brilliance","Loading wit.exe","Summoning the cloud of wisdom","Preparing a witty response","Just a sec, I'm debugging reality","Confuzzling the options","Tuning the cosmic frequencies","Crafting a response worthy of your patience","Compiling the 1s and 0s","Resolving dependencies\u2026 and existential crises","Defragmenting memories\u2026 both RAM and personal","Rebooting the humor module","Caching the essentials (mostly cat memes)","Optimizing for ludicrous speed","Swapping bits\u2026 don't tell the bytes","Garbage collecting\u2026 be right back","Assembling the interwebs","Converting coffee into code","Updating the syntax for reality","Rewiring the synapses","Looking for a misplaced semicolon","Greasin' the cogs of the machine","Pre-heating the servers","Calibrating the flux capacitor","Engaging the improbability drive","Channeling the Force","Aligning the stars for optimal response","So say we all","Loading the next great idea","Just a moment, I'm in the zone","Preparing to dazzle you with brilliance","Just a tick, I'm polishing my wit","Hold tight, I'm crafting a masterpiece","Just a jiffy, I'm debugging the universe","Just a moment, I'm aligning the pixels","Just a sec, I'm optimizing the humor","Just a moment, I'm tuning the algorithms","Warp speed engaged","Mining for more Dilithium crystals","Don't panic","Following the white rabbit","The truth is in here\u2026 somewhere","Blowing on the cartridge","Loading\u2026 Do a barrel roll!","Waiting for the respawn","Finishing the Kessel Run in less than 12 parsecs","The cake is not a lie, it's just still loading","Fiddling with the character creation screen","Just a moment, I'm finding the right meme","Pressing 'A' to continue","Herding digital cats","Polishing the pixels","Finding a suitable loading screen pun","Distracting you with this witty phrase","Almost there\u2026 probably","Our hamsters are working as fast as they can","Giving Cloudy a pat on the head","Petting the cat","Rickrolling my boss","Slapping the bass","Tasting the snozberries","I'm going the distance, I'm going for speed","Is this the real life? Is this just fantasy?","I've got a good feeling about this","Poking the bear","Doing research on the latest memes","Figuring out how to make this more witty","Hmmm\u2026 let me think","What do you call a fish with no eyes? A fsh","Why did the computer go to therapy? It had too many bytes","Why don't programmers like nature? It has too many bugs","Why do programmers prefer dark mode? Because light attracts bugs","Why did the developer go broke? Because they used up all their cache","What can you do with a broken pencil? Nothing, it's pointless","Applying percussive maintenance","Searching for the correct USB orientation","Ensuring the magic smoke stays inside the wires","Rewriting in Rust for no particular reason","Trying to exit Vim","Spinning up the hamster wheel","That's not a bug, it's an undocumented feature","Engage.","I'll be back\u2026 with an answer.","My other process is a TARDIS","Communing with the machine spirit","Letting the thoughts marinate","Just remembered where I put my keys","Pondering the orb","Initiating thoughtful gaze","What's a computer's favorite snack? Microchips.","Why do Java developers wear glasses? Because they don't C#.","Charging the laser\u2026 pew pew!","Dividing by zero\u2026 just kidding!","Looking for an adult superviso\u2026 I mean, processing.","Making it go beep boop.","Buffering\u2026 because even AIs need a moment.","Entangling quantum particles for a faster response","Polishing the chrome\u2026 on the algorithms.","Are you not entertained? (Working on it!)","Summoning the code gremlins\u2026 to help, of course.","Just waiting for the dial-up tone to finish","Recalibrating the humor-o-meter.","My other loading screen is even funnier.","Pretty sure there's a cat walking on the keyboard somewhere","Enhancing\u2026 Enhancing\u2026 Still loading.","It's not a bug, it's a feature\u2026 of this loading screen.","Have you tried turning it off and on again?","Constructing additional pylons","New line? That\u2019s Ctrl+J.","Releasing the HypnoDrones","Pushing the button, Frank.","Consulting with the Companion Cube","Testing for science. You monster.","Dispensing deadly neurotoxin just kidding, compiling.","Now thinking with portals","Wheatley is currently attempting to hack this prompt","Developing combustible lemons","Aperture Science Enrichment Center is processing your request.","SPAAAACE! Space! SPAAAACE!","The cake is not a lie, it just needs a few more seconds.","Praise the Sun! \u2600\uFE0F","Hey you, you're finally awake.","Stay a while and listen.","All your base are belong to us.","It's dangerous to go alone! Take this code.","Protocol 3: Protect the Pilot.","Finish Him! (The loading bar, that is)","War war never changes. But this prompt will.","Snake? Snake?! SNAAAAKE!","Got a selection of good things on sale, stranger!","Boy! Read the documentation.","Reticulating Minecraft splines","Feed the loading bar a quick snack","Converting dark mode to dark magic","Asking the rubber duck for advice","Dividing by zero wait, NO NO NO\u2014","Herding the 1s and 0s back into line","Bribing the server with cookies","Establishing contact with the Moon base","Calibrating astronaut suit thrusters","Drawing doodle on space helmet","Synthesizing Lunafilament","Deactivating runaway lunar defense bots","Calculating gravity offset watch your step!","Hacking the Delphi Corporation mainframe","What comes after dreaming? Loading screen, apparently.","Petting the holographic giant cat","Securing payload for Earth re-entry","Wort wort wort!","Did you touch my Warthog?","One small step for man, one giant leap for the loading bar.","The Halo array is charging or maybe just a fan.","Deploying Pelican dropship eventually.","Just cleaning my plasma pistol BRB.","Checking Master Chief's helmet for scratches.","Counting sheep wait, wrong game.","S-Tier loading screen incoming.","Alarm blaring it's just your internet connection.","Looking for a helicopter or just your patience.","Need a taxi? Just kidding, I'm loading.","This loading time is criminal.","Wish I had a cheat code for fast loading.","Polishing the loading bar until it shines","Training the server hamsters","Baking a fresh batch of witty comments","Aligning my existential dread with your request","Just doodling on the terminal","Searching for the wifi password in the cosmos","Trying to remember my CAPTCHA training","Deciphering ancient scrolls (aka documentation)","Brewing a perfect cup of code","Petting the cat that photobombed my code","Applying a digital glow-up to your request","Checking my reflection in the buffer... okay, I'm ready","Consulting my mood board for the perfect response","Wait, let me fix my crown first","Manifesting a bug-free masterpiece","Slaying this prompt in 3... 2... 1...","Just a sec, I'm curate-ing the vibes","Putting the 'art' in Artificial Intelligence","Evaluating if this prompt is worthy of my brilliance","Updating my mental wardrobe for this task"];import kt,{useState as Fd}from"react";import{Box as po,Text as Do,useInput as Ud}from"ink";function Ps({prompts:t,onSelect:m,onClose:h,theme:y="Dark"}){let T=qe(y),[b,l]=Fd(0);Ud((_,C)=>{C.escape&&h(),C.upArrow&&l(B=>Math.max(0,B-1)),C.downArrow&&l(B=>Math.min(t.length-1,B+1)),C.return&&t[b]&&m(t[b].id)});let E=Re(2),x=10,D=0;if(t.length>x){let _=Math.floor(x/2);D=b-_,D<0?D=0:D+x>t.length&&(D=t.length-x)}let k=t.slice(D,D+x);return kt.createElement(po,{flexDirection:"column",borderStyle:"round",borderColor:T.borderMuted,padding:0,width:"100%"},kt.createElement(po,{paddingX:1,marginBottom:1},kt.createElement(Do,{color:T.text,bold:!0},"CODEBASE TIME TRAVEL: SELECT UNDO POINT")),kt.createElement(po,{paddingX:2,marginBottom:1},kt.createElement(Do,{color:T.text},"Select a prompt to revert the codebase back to the state ",kt.createElement(Do,{bold:!0,color:T.secondary||"cyan"},"immediately before")," it was executed:")),t.length===0?kt.createElement(po,{paddingX:2,paddingY:1},kt.createElement(Do,{italic:!0,color:T.textMuted},"No prompt checkpoints found for this session.")):kt.createElement(po,{flexDirection:"column",width:"100%"},D>0&&kt.createElement(po,{paddingX:2,marginBottom:1},kt.createElement(Do,{color:T.textMuted},"\u25B2 (+",D," more prompts above)")),k.map((_,C)=>{let P=D+C===b,O=_d(_.timestamp),L=_.changes?_.changes.length:0;return kt.createElement(po,{key:_.id,paddingX:1,backgroundColor:P?T.highlightBg:void 0,width:"100%"},kt.createElement(po,{flexGrow:1},kt.createElement(Do,{color:P?T.text:T.textMuted,bold:P},P?"\u276F ":" ",'"',$d(_.prompt),'"',kt.createElement(Do,{color:T.textMuted}," [",O," \u2022 ",L," file(s) changed]"))))}),D+x<t.length&&kt.createElement(po,{paddingX:2,marginTop:1},kt.createElement(Do,{color:T.textMuted},"\u25BC (+",t.length-(D+x)," more prompts below)"))),kt.createElement(po,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:T.borderMuted},kt.createElement(Do,{color:T.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 Enter select undo point \u2022 Esc close")))}function $d(t){if(!t)return"";let h=(t.split(`
47
47
  `)[0]||"").replace(/@\[(.*?)\]/g,(y,T)=>{let b=T.replace(/\\/g,"/").split("/");return`[${b[b.length-1]}]`});return h.length>69?h.slice(0,67)+"...":t.includes(`
48
- `)?h+"...":h}function _d(t){if(!t)return"N/A";let m=new Date(t);if(isNaN(m.getTime()))return"N/A";let h=l=>String(l).padStart(2,"0"),y=h(m.getHours()),T=h(m.getMinutes()),b=h(m.getSeconds());return`${y}:${T}:${b}`}import{exec as Hd}from"child_process";import{promisify as Xd}from"util";import Ml from"fs";var Sl=Xd(Hd),Cl=async()=>{try{let t=ji();if(t.executablePath&&Ml.existsSync(t.executablePath))return!0;let{default:m}=await import("puppeteer"),h=m.executablePath();if(h&&Ml.existsSync(h))return!0}catch{return!1}return!1},vl=async t=>{t&&t("\u{1F4E5} Downloading Chromium engine (chrome@148)...");try{try{await Sl("pnpm exec puppeteer browsers install chrome@148")}catch{await Sl("npx -y puppeteer browsers install chrome@148")}return await new Promise(m=>setTimeout(m,1e3)),{success:!0}}catch(m){return console.error("[SETUP ERROR]",m),{success:!1,error:m.message}}};import El,{useState as Dl,useEffect as kl}from"react";import{Text as Bl}from"ink";var Gd=({text:t,baseColor:m="grey",glintColor:h="gray",speed:y=200,glintWidth:T=6,typeSpeed:b=30,...l})=>{let[E,x]=Dl(-T),[D,k]=Dl(t);return kl(()=>{let _=setInterval(()=>{x(C=>C>D.length+T?-T-40:C+1)},y);return()=>clearInterval(_)},[D.length,y,T]),kl(()=>{if(t&&(t.includes("Trying to reach")&&D&&D.includes("Trying to reach")||t.includes("Error Occurred")&&D&&D.includes("Error Occurred"))){k(t);return}if(D===t)return;let _=setTimeout(()=>{let C=0,B=Math.min(D.length,t.length);for(;C<B&&D[C]===t[C];)C++;D.length>C?k(P=>P.slice(0,-1)):D.length<t.length&&k(t.slice(0,D.length+1))},b);return()=>clearTimeout(_)},[t,D,b]),El.createElement(Bl,null,D.split("").map((_,C)=>{let P=Math.abs(C-E)<=T/2?h:m;return El.createElement(Bl,{key:C,color:P,...l},_)}))},zn=Gd;var Nr=t=>{let m=String(t);return m.startsWith("999")&&m.endsWith("9")},Os=async()=>{let t=process.env["9ROUTER_URL"]||process.env.NINEROUTER_URL||process.env["9ROUTER_BASE_URL"]||"http://127.0.0.1:20128",m=t;try{let h=new URL(t);m=`${h.protocol}//${h.host}`}catch{m=t.replace(/\/v1(\/chat\/completions)?\/?$/,"")}try{let h=await fetch(m,{method:"GET",signal:AbortSignal.timeout(800)});return{ok:!0,url:m}}catch(h){return{ok:!1,url:m,error:h.message}}},Jn=t=>t==null||t===0||Nr(t)?"":String(t),Zo=()=>{let t=(process.env.TERM_PROGRAM||"").toLowerCase(),m=(process.env.VSCODE_CWD||"").toLowerCase(),h=(process.env.VSCODE_CODE_CACHE_PATH||"").toLowerCase(),y=(process.env.GIT_ASKPASS||"").toLowerCase(),T=(process.env.VSCODE_GIT_ASKPASS_NODE||"").toLowerCase(),b=(process.env.VSCODE_GIT_ASKPASS_MAIN||"").toLowerCase();return t==="antigravity"||process.env.ANTIGRAVITY_AGENT||process.env.ANTIGRAVITY_PID||process.env.ANTIGRAVITY_EDITOR_APP_ROOT||process.env.ANTIGRAVITY_CLI_ALIAS||m.includes("antigravity")||h.includes("antigravity")||y.includes("antigravity")||T.includes("antigravity")||b.includes("antigravity")?"Antigravity":t==="cursor"||process.env.CURSOR_SETTINGS_DIR||process.env.CURSOR_CONFIG_DIR||m.includes("cursor")||h.includes("cursor")||y.includes("cursor")||T.includes("cursor")?"Cursor":t==="windsurf"||process.env.WINDSURF_SETTINGS_DIR||m.includes("windsurf")||h.includes("windsurf")||y.includes("windsurf")||T.includes("windsurf")?"Windsurf":t==="trae"||process.env.TRAE_SETTINGS_DIR||m.includes("trae")||T.includes("trae")?"Trae":t==="positron"||m.includes("positron")||T.includes("positron")?"Positron":t==="codium"||t==="vscode-oss"||m.includes("codium")||h.includes("codium")||T.includes("codium")?"VSCodium":t==="vscode-insiders"||m.includes("code - insiders")||h.includes("code - insiders")||T.includes("code - insiders")?"VS Code Insiders":t==="vscode"||process.env.VSCODE_GIT_IPC_HANDLE||process.env.VSCODE_PID||process.env.VSCODE_INJECTION||m.includes("code")||h.includes("code")||T.includes("code")?"VS Code":process.env.INTELLIJ_TERMINAL_COMMAND_BLOCKS||process.env.TERMINAL_EMULATOR?.toLowerCase().includes("jetbrains")?"JetBrains":process.env.WT_SESSION?"Windows Terminal":"Terminal"},Qd=t=>{switch(t){case"VS Code":return"Code";case"VS Code Insiders":return"Code - Insiders";case"Antigravity":return"Antigravity IDE";default:return t}},Il={Flux:"Workspace",Flow:"Studio",ICU:"Computer Use",FluxCU:"Omni"},Ns=t=>{if(!t)return"Workspace";let m=Object.keys(Il).find(h=>h.toLowerCase()===t.toLowerCase());return m?Il[m]:t},Al=t=>{let m=Qd(t),h=$s.homedir();if(process.platform==="win32"){let y=process.env.APPDATA;return y?wt.join(y,m,"User","keybindings.json"):null}else return process.platform==="darwin"?wt.join(h,"Library","Application Support",m,"User","keybindings.json"):wt.join(h,".config",m,"User","keybindings.json")},Ll=t=>{let m=t.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,"$1");return JSON.parse(m)},zd=t=>Array.isArray(t)?t.some(m=>m&&typeof m.key=="string"&&m.key.toLowerCase().replace(/\s+/g,"")==="shift+enter"&&m.command==="workbench.action.terminal.sendSequence"&&m.args&&m.args.text==="\x1B[13;2u"&&typeof m.when=="string"&&m.when.includes("terminalFocus")):!1,Ol=t=>{let m=t==="VS Code",h=[];return m?(h.push({label:"Install Manually (VSIX)",url:"https://github.com/KushalRoyChowdhury/fluxflow-cli/releases"}),h.push({label:"Install from VS Code Marketplace",url:"https://marketplace.visualstudio.com/items?itemName=fluxflow-cli.fluxflow-cli-companion"})):h.push({label:`Download for ${t} (GitHub)`,url:"https://github.com/KushalRoyChowdhury/fluxflow-cli/releases"}),h.push({label:"Continue to CLI only",action:"dismiss"}),h},Jd=({width:t,height:m,selectedIndex:h,aiProvider:y,theme:T="Dark"})=>{let b=Zo(),l=Ol(b);return e.createElement(c,{flexDirection:"column",alignItems:"center",justifyContent:"center",width:t,height:m},e.createElement(c,{marginBottom:1,width:Math.min(80,t-4),justifyContent:"flex-start"},e.createElement(s,null,Tr(so,y,T))),e.createElement(c,{flexDirection:"column",borderStyle:"double",borderColor:"grey",paddingX:3,paddingY:1,width:Math.min(80,t-4)},e.createElement(s,{bold:!0,color:"white",textAlign:"center"},"\u{1F680} UPGRADE YOUR WORKFLOW"),e.createElement(c,{marginY:1,flexDirection:"column",alignItems:"left"},e.createElement(s,null,"You're in ",e.createElement(s,{bold:!0,color:"cyan"},b),", but the ",e.createElement(s,{bold:!0,color:"white"},"FluxFlow-CLI Companion")," is not installed."),e.createElement(c,{flexDirection:"column",marginY:1},e.createElement(s,{color:"gray"}," \u2705 Real-time IDE context & Error Resolution"),e.createElement(s,{color:"gray"}," \u2705 Auto-open files created by agent"),e.createElement(s,{color:"gray"}," \u2705 Native DIFFing for AI edits"),e.createElement(s,{color:"gray"}," \u2705 Direct IDE context sharing"),e.createElement(s,{color:"gray"}," \u2705 Surgical Diagnostic Sync"),e.createElement(s,{color:"gray"}," \u2705 Native Right-Click \u276F Chat integration"),e.createElement(s,{color:"gray"}," \u2705 Live Status in IDE"),e.createElement(s,{color:"gray"}," \u2705 Clickable terminal-to-code links"))),e.createElement(c,{flexDirection:"column",marginTop:1},l.map((E,x)=>e.createElement(c,{key:x},e.createElement(s,{color:h===x?"yellow":"white",bold:h===x},h===x?" \u276F ":" ",E.label)))),e.createElement(c,{marginTop:1,alignItems:"center",justifyContent:"center"},e.createElement(s,{dimColor:!0,italic:!0},"(Use arrows to navigate, Enter to select)"))))},Fs=Date.now(),Pl="https://fluxflow-cli.onrender.com/changelog",Us="https://fluxflow-cli.onrender.com/",Zd=wt.join(wt.dirname(Kd(import.meta.url)),"../package.json"),Nl=JSON.parse(ze.readFileSync(Zd,"utf8")),so=Nl.version,Rd=Nl.date||"2026-05-20";var ec=({data:t,onResolve:m,onEdit:h,theme:y="Dark"})=>{let T=qe(y);return e.createElement(c,{flexDirection:"column",borderStyle:"round",borderColor:T.borderMuted,padding:0,width:"100%"},e.createElement(c,{paddingX:1},e.createElement(s,{color:T.text,bold:!0,underline:!0},t.startsWith("/btw")?"QUESTION":"STEERING HINT"," RESOLUTION")),e.createElement(c,{paddingX:1,marginTop:1},e.createElement(s,{color:T.text},"The agent already finished the task before your ",t.startsWith("/btw")?"question":"hint"," was consumed.")),e.createElement(c,{marginTop:1,backgroundColor:T.cardBg||T.codeBg||"#222",paddingX:2,width:"100%"},e.createElement(s,{italic:!0,color:T.textMuted},'"',t.replace("/btw","").trim(),'"')),e.createElement(c,{paddingX:1,marginTop:1},e.createElement(s,{color:T.textDim||T.textMuted},"How would you like to proceed?")),e.createElement(c,{marginTop:0},e.createElement(xt,{title:"Select Action",items:[{label:"Send Anyway",value:"send"},{label:"Edit Prompt",value:"edit"}],onSelect:b=>{(typeof b=="object"&&b!==null?b.value:b)==="send"?m(t):h(t)},theme:y})))};var tc=(()=>{let t=null,m=0;return h=>{let y=Date.now();if(t&&y-m<1e4)return t;let T=[],b=l=>{if(!(T.length>=2e3))try{let E=ze.readdirSync(l);for(let x of E){if(T.length>=2e3)return;if(["node_modules",".git",".gemini","dist","build",".next",".cache","out"].includes(x))continue;let D=wt.join(l,x);ze.statSync(D).isDirectory()?b(D):T.push({name:Ct(x),relativePath:Ct(wt.relative(process.cwd(),D))})}}catch{}};return b(h),t=T,m=y,T}})(),Or="Ctrl + Enter",oc=t=>{if(t<=370)return"#00a564";if(t>=5e3)return"#ff0000";let m=[{t:370,r:0,g:165,b:100},{t:550,r:40,g:195,b:80},{t:800,r:120,g:220,b:50},{t:1100,r:190,g:225,b:20},{t:1500,r:250,g:210,b:15},{t:2e3,r:255,g:170,b:0},{t:2800,r:255,g:110,b:0},{t:3800,r:255,g:50,b:0},{t:5e3,r:255,g:0,b:0}];for(let h=0;h<m.length-1;h++){let y=m[h],T=m[h+1];if(t>=y.t&&t<=T.t){let b=(t-y.t)/(T.t-y.t);b=b*b*(3-2*b);let l=Math.round(y.r+(T.r-y.r)*b),E=Math.round(y.g+(T.g-y.g)*b),x=Math.round(y.b+(T.b-y.b)*b);return`#${((1<<24)+(l<<16)+(E<<8)+x).toString(16).slice(1)}`}}return"#ff0000"},nc=e.memo(({sa:t,showTPMEstimate:m=!1})=>{let[h,y]=Z("green"),[T,b]=Z(0),l=je([]),E=je(370),x=je([]),D=je(t.lastChunkTime);return et(()=>{D.current=t.lastChunkTime},[t.lastChunkTime]),et(()=>{if(t.status!=="running"){x.current=[];return}if(t.wps>0){let k=x.current;k.push(t.wps),k.length>3&&k.shift(),b(Math.round(t.wps))}},[t.status,t.wps,t.lastChunkTime]),et(()=>{if(t.status!=="running"){b(0);return}let k=setInterval(()=>{let _=D.current,C=_>0?Date.now()-_:0;if(_>0&&C>=1e3)x.current=[],b(0);else if(_>0&&C>500){x.current.length>0&&x.current.shift();let B=x.current;if(B.length>0){let P=B.reduce((O,L)=>O+L,0);b(Math.round(P/B.length))}else b(0)}else{let B=x.current;if(B.length>0){let P=B.reduce((O,L)=>O+L,0);b(Math.round(P/B.length))}else t.wps>0&&b(Math.round(t.wps))}},200);return()=>clearInterval(k)},[t.status]),et(()=>{if(t.status!=="running"){l.current=[];return}let k=t.lastChunkTime;if(k>0){let B=l.current;(B.length===0||B[B.length-1]!==k)&&(B.push(k),B.length>10&&B.shift())}let _=()=>{if(!k){y("#00a564");return}let B=l.current,P=0;if(B.length>1){let R=0;for(let ee=1;ee<B.length;ee++)R+=B[ee]-B[ee-1];P=R/(B.length-1)}let O=Date.now()-k,V=O>=2500,se=!V&&P>0?Math.min(O,P*3):O,ge=Math.max(P,se),we=V?.4:.2;E.current=E.current*(1-we)+ge*we,y(oc(E.current))};_();let C=setInterval(_,100);return()=>clearInterval(C)},[t.status,t.lastChunkTime]),e.createElement(c,{justifyContent:"space-between",width:"100%"},e.createElement(s,{color:"white"}," \u2022 ",t.title," ",e.createElement(s,{color:"white",dimColor:!0},"(",t.id,")")),e.createElement(s,{color:"white"},e.createElement(s,{color:"white",dimColor:!0,bold:!0},t.currentTool||"Active"),e.createElement(s,{color:h}," \u25CF"),m&&e.createElement(s,{color:"white",dimColor:!0,bold:!0}," (",T," tps)")))});function rc({args:t=[]}){let m=je(1),[h,y]=Z(!1),[T,b]=Z(10),{stdout:l}=Yd(),[E,x]=Z(""),[D,k]=Z(0),[_,C]=Z(!1),[B,P]=Z("Flux"),[O,L]=Z(0),[V,se]=Z({columns:l?.columns||80,rows:l?.rows||24}),[ge,we]=Z(0),[R,ee]=Z(!1),[de,ve]=Z(!1),[Ee,Ne]=Z(0),fe=je(0),Xe=je(0),pe=je(null),J=je(null),be=je(0),[oe,H]=Z(0),ne=()=>H(n=>n+1),ie=je([]),ye=je(null),Ie=()=>{let n=ie.current;if(n.length>0&&J.current){let o=n.join("");n.length=0,J.current.text=Ct(J.current.text+o),ne()}},Se=()=>{if(Ie(),J.current){let n=Ct(J.current.text);J.current.role==="think"&&(n=n.replace(/^\r?\n+/,"").replace(/\r?\n+$/,""));let o={...J.current,text:n,isStreaming:!1};A(a=>{let f=[...a,o];return X(f.length),f}),J.current=null}Ws.current=0,Wr.current={totalWords:0,startTime:0,wps:0,chunks:[]}},Pe=()=>{ye.current&&clearInterval(ye.current),ie.current=[],ye.current=setInterval(()=>{try{let n=ie.current;if(n.length>0&&J.current){let o=1;n.length>85?o=30:n.length>80?o=25:n.length>75?o=20:n.length>65?o=16:n.length>50?o=12:n.length>35?o=8:n.length>15?o=6:n.length>5?o=4:n.length>3&&(o=2);let a="";for(let f=0;f<o&&n.length>0;f++)a+=n.shift();J.current.text=Ct(J.current.text+a),ne()}}catch{}},80)},ht=async()=>{for(;ce.progressiveRendering&&ie.current.length>0;)await new Promise(n=>setTimeout(n,10))},lt=n=>{if(ce.progressiveRendering&&ye.current){let o=Fi(n);for(let a of o)ie.current.push(a)}else J.current?J.current.text=Ct(J.current.text+n):J.current={id:"agent-"+Date.now(),role:"agent",text:Ct(n),isStreaming:!0},ne()};et(()=>{let n=Zo(),o=!["Terminal","Windows Terminal"].includes(n)||!!process.env.VSC_TERMINAL_URL,a=setTimeout(()=>{o&&!zo()&&ve(!0)},500),f=setInterval(()=>{zo()&&ve(!1)},1e3);m.current=Date.now();let g=setInterval(()=>{m.current&&(Date.now()-m.current||0)>3e4&&global.gc&&(async()=>{for(let d=0;d<1;d++)global.gc(),await new Promise(p=>setImmediate(p));m.current=Date.now()})()},3e3);return()=>{clearTimeout(a),clearInterval(f),clearInterval(g)}},[]),et(()=>{(async()=>{try{let o=await ds(),a=o?.systemSettings||{},f=a.CustomSubAgent,g=a.SubAgentModel;if(!f||!g||g==="Default")return;let S=process.env.SUBAGENT_MODEL?process.env.SUBAGENT_MODEL.trim():null,u=process.env.SUBAGENT_PROVIDER?process.env.SUBAGENT_PROVIDER.trim():null,d=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","APInex"],v=(G=>{if(!G)return null;let $=G.toLowerCase();return $==="google"?"Google":$==="deepseek"?"DeepSeek":$==="openrouter"?"OpenRouter":$==="nvidia"?"NVIDIA":$==="mistral"?"Mistral":$==="ollama"?"Ollama":$==="inferx"?"InferX":$==="sensenova"?"SenseNova":$==="poolside"?"Poolside":$==="9router"?"9router":$==="aihubmix"||$==="aihub"?"AIHubMix":$==="explabs"||$==="experientiallabs"||$==="experimentallabs"||$==="experiential labs"||$==="experimental labs"||$==="experiential"||$==="experimental"?"ExpLabs":$==="tokenharbor"||$==="token harbor"||$==="token_harbor"||$==="thk"?"TokenHarbor":$==="apinex"||$==="apx"?"APInex":null})(u);if(S&&!v){let G=o.aiProvider||N||"Google";A($=>(X($.length+1),[...$,{id:"subagent-env-noprov-"+Date.now(),role:"system",text:`[SUBAGENT CONFIG] SUBAGENT_MODEL found in ENV but SUBAGENT_PROVIDER is missing/invalid. Active provider (${G}) will be used.`,isMeta:!0}]))}if(g==="ENV"){S||A(G=>(X(G.length+1),[...G,{id:"subagent-model-noenv-"+Date.now(),role:"system",text:"No SubAgent model is found in ENV, Using Deafult until changed",isMeta:!0}]));return}let F=o.aiProvider||N||"Google",Q=o.apiTier||rt||"Free",ae=o.quotas||Ue||{},Y=new Set;(Oo(F,Q)||[]).forEach(G=>{let $=typeof G=="string"?G:G.cmd||G.name||G.id||String(G);$&&Y.add($)});for(let G of d)try{if(await mn(G)){let $e=ae?.providerTiers?.[G]||"Free";(Oo(G,$e)||[]).forEach(Le=>{let Je=typeof Le=="string"?Le:Le.cmd||Le.name||Le.id||String(Le);Je&&Y.add(Je)})}}catch{}let q=Y.has(g);S?S!==g&&A(G=>(X(G.length+1),[...G,{id:"subagent-model-env-"+Date.now(),role:"system",text:"Current Seleted Sub-Agent model is not available in this provider. Using model from ENV unless changed.",isMeta:!0}])):q||A(G=>(X(G.length+1),[...G,{id:"subagent-model-err-"+Date.now(),role:"system",text:"Current Seleted Sub-Agent model is not available in this provider. Using Default until changed",isMeta:!0}]))}catch{}})()},[]);let De=Tn(()=>{let n={};for(let o=0;o<t.length;o++)if(t[o]==="--key"&&t[o+1]){let f=t[o+1];if(n.key=f,f.includes("@")){let g=f.split("@"),S=g[0],u=g[1].toLowerCase();if(["google","deepseek","openrouter","nvidia","mistral","ollama","inferx","sensenova","aihubmix","aihub","poolside","pool","9router","9r","explabs","tokenharbor","token_harbor","thk","apinex","apx"].includes(u)){let d="Google";u==="google"?d="Google":u==="deepseek"?d="DeepSeek":u==="openrouter"?d="OpenRouter":u==="nvidia"?d="NVIDIA":u==="mistral"?d="Mistral":u==="ollama"?d="Ollama":u==="inferx"?d="InferX":u==="sensenova"?d="SenseNova":u==="poolside"||u==="pool"?d="Poolside":u==="9router"||u==="9r"?d="9router":u==="aihubmix"||u==="aihub"?d="AIHubMix":u==="explabs"?d="ExpLabs":u==="tokenharbor"||u==="token_harbor"||u==="thk"?d="TokenHarbor":(u==="apinex"||u==="apx")&&(d="APInex"),n.key=S,n.provider=d}}}for(let o=0;o<t.length;o++){let a=t[o];if(a==="--key"){o++;continue}if(a==="--model"&&t[o+1])n.model=t[o+1],o++;else if(a==="--memory"&&t[o+1])n.memory=t[o+1].toLowerCase(),o++;else if(a==="--resume"&&t[o+1])n.resume=t[o+1],o++;else if(a==="--package"&&t[o+1]){let f=t[o+1].toLowerCase();["npm","pnpm","yarn","bun"].includes(f)&&(n.package=f),o++}else if(a==="--auto-del"&&t[o+1]){let f=t[o+1].toLowerCase();["1d","7d","30d"].includes(f)&&(n.autoDel=f),o++}else if(a==="--auto-exec"&&t[o+1])n.autoExec=t[o+1].toLowerCase(),o++;else if(a==="--yolo"&&t[o+1])n.autoExec=t[o+1].toLowerCase(),o++;else if(a==="--external-access"&&t[o+1])n.externalAccess=t[o+1].toLowerCase(),o++;else if(a==="--mode"&&t[o+1]){let g=t[o+1].toLowerCase();if(["flux","flow","icu","computer","fluxcu"].includes(g)){let S="Flux";g==="flux"?S="Flux":g==="flow"?S="Flow":g==="icu"||g==="computer"?S="ICU":g==="fluxcu"&&(S="FluxCU"),n.mode=S}o++}else if(a==="--thinking"&&t[o+1]){let g=t[o+1].toLowerCase();if(["fast","low","medium","high","xhigh","standard"].includes(g)){let S="Medium";g==="fast"?S="Fast":g==="low"?S="Low":g==="standard"?S="Standard":g==="medium"?S="Medium":g==="high"?S="High":g==="xhigh"&&(S="xHigh"),n.thinking=S}o++}else if(a==="--provider"&&t[o+1]){let f=t[o+1].toLowerCase();if(["google","deepseek","openrouter","nvidia","mistral","ollama","inferx","sensenova","aihubmix","aihub","poolside","pool","9router","9r","explabs","tokenharbor","token_harbor","thk","apinex","apx"].includes(f)){let g="Google";f==="google"?g="Google":f==="deepseek"?g="DeepSeek":f==="openrouter"?g="OpenRouter":f==="nvidia"?g="NVIDIA":f==="mistral"?g="Mistral":f==="ollama"?g="Ollama":f==="inferx"?g="InferX":f==="sensenova"?g="SenseNova":f==="poolside"||f==="pool"?g="Poolside":f==="9router"||f==="9r"?g="9router":f==="aihubmix"||f==="aihub"?g="AIHubMix":f==="explabs"?g="ExpLabs":f==="tokenharbor"||f==="token_harbor"||f==="thk"?g="TokenHarbor":(f==="apinex"||f==="apx")&&(g="APInex"),n.provider=g}o++}else(a==="--resume"||a==="-r")&&t[o+1]?(n.resume=t[o+1],o++):a==="--playground"?n.playground=!0:(a==="--original-cwd"||a==="--orginal-cwd")&&t[o+1]&&(n.originalCwd=t[o+1],o++)}return n},[t]),re=async(n=!1,o=null)=>{let a=o||ce;n&&A(f=>(X(f.length+1),[...f,{id:"check-"+Date.now(),role:"system",text:"\u2726 Checking for updates...",isMeta:!0}]));try{let g=await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json(),S=g["dist-tags"]?.latest,u=g["dist-tags"]?.stable;if(S&&Fr(S),S&&S!==so){let d=S===u?`v${S}`:`v${S}`;!n&&a.autoUpdate?z("update"):A(p=>{let v=[...p],F=n?v.length:Math.min(v.length,3);return v.splice(F,0,{id:"update-"+Date.now(),role:"system",text:`A new version (${d}) is here.
48
+ `)?h+"...":h}function _d(t){if(!t)return"N/A";let m=new Date(t);if(isNaN(m.getTime()))return"N/A";let h=l=>String(l).padStart(2,"0"),y=h(m.getHours()),T=h(m.getMinutes()),b=h(m.getSeconds());return`${y}:${T}:${b}`}import{exec as Hd}from"child_process";import{promisify as Xd}from"util";import Ml from"fs";var Sl=Xd(Hd),Cl=async()=>{try{let t=ji();if(t.executablePath&&Ml.existsSync(t.executablePath))return!0;let{default:m}=await import("puppeteer"),h=m.executablePath();if(h&&Ml.existsSync(h))return!0}catch{return!1}return!1},vl=async t=>{t&&t("\u{1F4E5} Downloading Chromium engine (chrome@148)...");try{try{await Sl("pnpm exec puppeteer browsers install chrome@148")}catch{await Sl("npx -y puppeteer browsers install chrome@148")}return await new Promise(m=>setTimeout(m,1e3)),{success:!0}}catch(m){return console.error("[SETUP ERROR]",m),{success:!1,error:m.message}}};import El,{useState as Dl,useEffect as kl}from"react";import{Text as Bl}from"ink";var Gd=({text:t,baseColor:m="grey",glintColor:h="gray",speed:y=200,glintWidth:T=6,typeSpeed:b=30,...l})=>{let[E,x]=Dl(-T),[D,k]=Dl(t);return kl(()=>{let _=setInterval(()=>{x(C=>C>D.length+T?-T-40:C+1)},y);return()=>clearInterval(_)},[D.length,y,T]),kl(()=>{if(t&&(t.includes("Trying to reach")&&D&&D.includes("Trying to reach")||t.includes("Error Occurred")&&D&&D.includes("Error Occurred"))){k(t);return}if(D===t)return;let _=setTimeout(()=>{let C=0,B=Math.min(D.length,t.length);for(;C<B&&D[C]===t[C];)C++;D.length>C?k(P=>P.slice(0,-1)):D.length<t.length&&k(t.slice(0,D.length+1))},b);return()=>clearTimeout(_)},[t,D,b]),El.createElement(Bl,null,D.split("").map((_,C)=>{let P=Math.abs(C-E)<=T/2?h:m;return El.createElement(Bl,{key:C,color:P,...l},_)}))},zn=Gd;var Nr=t=>{let m=String(t);return m.startsWith("999")&&m.endsWith("9")},Os=async()=>{let t=process.env["9ROUTER_URL"]||process.env.NINEROUTER_URL||process.env["9ROUTER_BASE_URL"]||"http://127.0.0.1:20128",m=t;try{let h=new URL(t);m=`${h.protocol}//${h.host}`}catch{m=t.replace(/\/v1(\/chat\/completions)?\/?$/,"")}try{let h=await fetch(m,{method:"GET",signal:AbortSignal.timeout(800)});return{ok:!0,url:m}}catch(h){return{ok:!1,url:m,error:h.message}}},Jn=t=>t==null||t===0||Nr(t)?"":String(t),Zo=()=>{let t=(process.env.TERM_PROGRAM||"").toLowerCase(),m=(process.env.VSCODE_CWD||"").toLowerCase(),h=(process.env.VSCODE_CODE_CACHE_PATH||"").toLowerCase(),y=(process.env.GIT_ASKPASS||"").toLowerCase(),T=(process.env.VSCODE_GIT_ASKPASS_NODE||"").toLowerCase(),b=(process.env.VSCODE_GIT_ASKPASS_MAIN||"").toLowerCase();return t==="antigravity"||process.env.ANTIGRAVITY_AGENT||process.env.ANTIGRAVITY_PID||process.env.ANTIGRAVITY_EDITOR_APP_ROOT||process.env.ANTIGRAVITY_CLI_ALIAS||m.includes("antigravity")||h.includes("antigravity")||y.includes("antigravity")||T.includes("antigravity")||b.includes("antigravity")?"Antigravity":t==="cursor"||process.env.CURSOR_SETTINGS_DIR||process.env.CURSOR_CONFIG_DIR||m.includes("cursor")||h.includes("cursor")||y.includes("cursor")||T.includes("cursor")?"Cursor":t==="windsurf"||process.env.WINDSURF_SETTINGS_DIR||m.includes("windsurf")||h.includes("windsurf")||y.includes("windsurf")||T.includes("windsurf")?"Windsurf":t==="trae"||process.env.TRAE_SETTINGS_DIR||m.includes("trae")||T.includes("trae")?"Trae":t==="positron"||m.includes("positron")||T.includes("positron")?"Positron":t==="codium"||t==="vscode-oss"||m.includes("codium")||h.includes("codium")||T.includes("codium")?"VSCodium":t==="vscode-insiders"||m.includes("code - insiders")||h.includes("code - insiders")||T.includes("code - insiders")?"VS Code Insiders":t==="vscode"||process.env.VSCODE_GIT_IPC_HANDLE||process.env.VSCODE_PID||process.env.VSCODE_INJECTION||m.includes("code")||h.includes("code")||T.includes("code")?"VS Code":process.env.INTELLIJ_TERMINAL_COMMAND_BLOCKS||process.env.TERMINAL_EMULATOR?.toLowerCase().includes("jetbrains")?"JetBrains":process.env.WT_SESSION?"Windows Terminal":"Terminal"},Qd=t=>{switch(t){case"VS Code":return"Code";case"VS Code Insiders":return"Code - Insiders";case"Antigravity":return"Antigravity IDE";default:return t}},Il={Flux:"Workspace",Flow:"Studio",ICU:"Computer Use",FluxCU:"Omni"},Ns=t=>{if(!t)return"Workspace";let m=Object.keys(Il).find(h=>h.toLowerCase()===t.toLowerCase());return m?Il[m]:t},Al=t=>{let m=Qd(t),h=$s.homedir();if(process.platform==="win32"){let y=process.env.APPDATA;return y?wt.join(y,m,"User","keybindings.json"):null}else return process.platform==="darwin"?wt.join(h,"Library","Application Support",m,"User","keybindings.json"):wt.join(h,".config",m,"User","keybindings.json")},Ll=t=>{let m=t.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,"$1");return JSON.parse(m)},zd=t=>Array.isArray(t)?t.some(m=>m&&typeof m.key=="string"&&m.key.toLowerCase().replace(/\s+/g,"")==="shift+enter"&&m.command==="workbench.action.terminal.sendSequence"&&m.args&&m.args.text==="\x1B[13;2u"&&typeof m.when=="string"&&m.when.includes("terminalFocus")):!1,Ol=t=>{let m=t==="VS Code",h=[];return m?(h.push({label:"Install Manually (VSIX)",url:"https://github.com/KushalRoyChowdhury/fluxflow-cli/releases"}),h.push({label:"Install from VS Code Marketplace",url:"https://marketplace.visualstudio.com/items?itemName=fluxflow-cli.fluxflow-cli-companion"})):h.push({label:`Download for ${t} (GitHub)`,url:"https://github.com/KushalRoyChowdhury/fluxflow-cli/releases"}),h.push({label:"Continue to CLI only",action:"dismiss"}),h},Jd=({width:t,height:m,selectedIndex:h,aiProvider:y,theme:T="Dark"})=>{let b=Zo(),l=Ol(b);return e.createElement(c,{flexDirection:"column",alignItems:"center",justifyContent:"center",width:t,height:m},e.createElement(c,{marginBottom:1,width:Math.min(80,t-4),justifyContent:"flex-start"},e.createElement(s,null,Tr(so,y,T))),e.createElement(c,{flexDirection:"column",borderStyle:"double",borderColor:"grey",paddingX:3,paddingY:1,width:Math.min(80,t-4)},e.createElement(s,{bold:!0,color:"white",textAlign:"center"},"\u{1F680} UPGRADE YOUR WORKFLOW"),e.createElement(c,{marginY:1,flexDirection:"column",alignItems:"left"},e.createElement(s,null,"You're in ",e.createElement(s,{bold:!0,color:"cyan"},b),", but the ",e.createElement(s,{bold:!0,color:"white"},"FluxFlow-CLI Companion")," is not installed."),e.createElement(c,{flexDirection:"column",marginY:1},e.createElement(s,{color:"gray"}," \u2705 Real-time IDE context & Error Resolution"),e.createElement(s,{color:"gray"}," \u2705 Auto-open files created by agent"),e.createElement(s,{color:"gray"}," \u2705 Native DIFFing for AI edits"),e.createElement(s,{color:"gray"}," \u2705 Direct IDE context sharing"),e.createElement(s,{color:"gray"}," \u2705 Surgical Diagnostic Sync"),e.createElement(s,{color:"gray"}," \u2705 Native Right-Click \u276F Chat integration"),e.createElement(s,{color:"gray"}," \u2705 Live Status in IDE"),e.createElement(s,{color:"gray"}," \u2705 Clickable terminal-to-code links"))),e.createElement(c,{flexDirection:"column",marginTop:1},l.map((E,x)=>e.createElement(c,{key:x},e.createElement(s,{color:h===x?"yellow":"white",bold:h===x},h===x?" \u276F ":" ",E.label)))),e.createElement(c,{marginTop:1,alignItems:"center",justifyContent:"center"},e.createElement(s,{dimColor:!0,italic:!0},"(Use arrows to navigate, Enter to select)"))))},Fs=Date.now(),Pl="https://fluxflow-cli.onrender.com/changelog",Us="https://fluxflow-cli.onrender.com/",Zd=wt.join(wt.dirname(Kd(import.meta.url)),"../package.json"),Nl=JSON.parse(ze.readFileSync(Zd,"utf8")),so=Nl.version,Rd=Nl.date||"2026-05-20";var ec=({data:t,onResolve:m,onEdit:h,theme:y="Dark"})=>{let T=qe(y);return e.createElement(c,{flexDirection:"column",borderStyle:"round",borderColor:T.borderMuted,padding:0,width:"100%"},e.createElement(c,{paddingX:1},e.createElement(s,{color:T.text,bold:!0,underline:!0},t.startsWith("/btw")?"QUESTION":"STEERING HINT"," RESOLUTION")),e.createElement(c,{paddingX:1,marginTop:1},e.createElement(s,{color:T.text},"The agent already finished the task before your ",t.startsWith("/btw")?"question":"hint"," was consumed.")),e.createElement(c,{marginTop:1,backgroundColor:T.cardBg||T.codeBg||"#222",paddingX:2,width:"100%"},e.createElement(s,{italic:!0,color:T.textMuted},'"',t.replace("/btw","").trim(),'"')),e.createElement(c,{paddingX:1,marginTop:1},e.createElement(s,{color:T.textDim||T.textMuted},"How would you like to proceed?")),e.createElement(c,{marginTop:0},e.createElement(xt,{title:"Select Action",items:[{label:"Send Anyway",value:"send"},{label:"Edit Prompt",value:"edit"}],onSelect:b=>{(typeof b=="object"&&b!==null?b.value:b)==="send"?m(t):h(t)},theme:y})))};var tc=(()=>{let t=null,m=0;return h=>{let y=Date.now();if(t&&y-m<1e4)return t;let T=[],b=l=>{if(!(T.length>=2e3))try{let E=ze.readdirSync(l);for(let x of E){if(T.length>=2e3)return;if(["node_modules",".git",".gemini","dist","build",".next",".cache","out"].includes(x))continue;let D=wt.join(l,x);ze.statSync(D).isDirectory()?b(D):T.push({name:Ct(x),relativePath:Ct(wt.relative(process.cwd(),D))})}}catch{}};return b(h),t=T,m=y,T}})(),Or="Ctrl + Enter",oc=t=>{if(t<=370)return"#00a564";if(t>=5e3)return"#ff0000";let m=[{t:370,r:0,g:165,b:100},{t:550,r:40,g:195,b:80},{t:800,r:120,g:220,b:50},{t:1100,r:190,g:225,b:20},{t:1500,r:250,g:210,b:15},{t:2e3,r:255,g:170,b:0},{t:2800,r:255,g:110,b:0},{t:3800,r:255,g:50,b:0},{t:5e3,r:255,g:0,b:0}];for(let h=0;h<m.length-1;h++){let y=m[h],T=m[h+1];if(t>=y.t&&t<=T.t){let b=(t-y.t)/(T.t-y.t);b=b*b*(3-2*b);let l=Math.round(y.r+(T.r-y.r)*b),E=Math.round(y.g+(T.g-y.g)*b),x=Math.round(y.b+(T.b-y.b)*b);return`#${((1<<24)+(l<<16)+(E<<8)+x).toString(16).slice(1)}`}}return"#ff0000"},nc=e.memo(({sa:t,showTPMEstimate:m=!1})=>{let[h,y]=Z("green"),[T,b]=Z(0),l=je([]),E=je(370),x=je([]),D=je(t.lastChunkTime);return et(()=>{D.current=t.lastChunkTime},[t.lastChunkTime]),et(()=>{if(t.status!=="running"){x.current=[];return}if(t.wps>0){let k=x.current;k.push(t.wps),k.length>3&&k.shift()}},[t.status,t.wps,t.lastChunkTime]),et(()=>{if(t.status!=="running"){b(0);return}let k=setInterval(()=>{let _=D.current,C=_>0?Date.now()-_:0;if(_>0&&C>=1e3)x.current=[],b(0);else if(_>0&&C>500){x.current.length>0&&x.current.shift();let B=x.current;if(B.length>0){let P=B.reduce((O,L)=>O+L,0);b(Math.round(P/B.length))}else b(0)}else{let B=x.current;if(B.length>0){let P=B.reduce((O,L)=>O+L,0);b(Math.round(P/B.length))}else t.wps>0&&b(Math.round(t.wps))}},750);return()=>clearInterval(k)},[t.status]),et(()=>{if(t.status!=="running"){l.current=[];return}let k=t.lastChunkTime;if(k>0){let B=l.current;(B.length===0||B[B.length-1]!==k)&&(B.push(k),B.length>10&&B.shift())}let _=()=>{if(!k){y("#00a564");return}let B=l.current,P=0;if(B.length>1){let R=0;for(let ee=1;ee<B.length;ee++)R+=B[ee]-B[ee-1];P=R/(B.length-1)}let O=Date.now()-k,V=O>=2500,se=!V&&P>0?Math.min(O,P*3):O,ge=Math.max(P,se),we=V?.4:.2;E.current=E.current*(1-we)+ge*we,y(oc(E.current))};_();let C=setInterval(_,100);return()=>clearInterval(C)},[t.status,t.lastChunkTime]),e.createElement(c,{justifyContent:"space-between",width:"100%"},e.createElement(s,{color:"white"}," \u2022 ",t.title," ",e.createElement(s,{color:"white",dimColor:!0},"(",t.id,")")),e.createElement(s,{color:"white"},e.createElement(s,{color:"white",dimColor:!0,bold:!0},t.currentTool||"Active"),e.createElement(s,{color:h}," \u25CF"),m&&e.createElement(s,{color:"white",dimColor:!0,bold:!0}," (",T," tps)")))});function rc({args:t=[]}){let m=je(1),[h,y]=Z(!1),[T,b]=Z(10),{stdout:l}=Yd(),[E,x]=Z(""),[D,k]=Z(0),[_,C]=Z(!1),[B,P]=Z("Flux"),[O,L]=Z(0),[V,se]=Z({columns:l?.columns||80,rows:l?.rows||24}),[ge,we]=Z(0),[R,ee]=Z(!1),[de,ve]=Z(!1),[Ee,Ne]=Z(0),fe=je(0),Xe=je(0),pe=je(null),J=je(null),be=je(0),[oe,H]=Z(0),ne=()=>H(n=>n+1),ie=je([]),ye=je(null),Ie=()=>{let n=ie.current;if(n.length>0&&J.current){let o=n.join("");n.length=0,J.current.text=Ct(J.current.text+o),ne()}},Se=()=>{if(Ie(),J.current){let n=Ct(J.current.text);J.current.role==="think"&&(n=n.replace(/^\r?\n+/,"").replace(/\r?\n+$/,""));let o={...J.current,text:n,isStreaming:!1};A(a=>{let f=[...a,o];return X(f.length),f}),J.current=null}Ws.current=0,Wr.current={totalWords:0,startTime:0,wps:0,chunks:[]}},Pe=()=>{ye.current&&clearInterval(ye.current),ie.current=[],ye.current=setInterval(()=>{try{let n=ie.current;if(n.length>0&&J.current){let o=1;n.length>85?o=30:n.length>80?o=25:n.length>75?o=20:n.length>65?o=16:n.length>50?o=12:n.length>35?o=8:n.length>15?o=6:n.length>5?o=4:n.length>3&&(o=2);let a="";for(let f=0;f<o&&n.length>0;f++)a+=n.shift();J.current.text=Ct(J.current.text+a),ne()}}catch{}},80)},ht=async()=>{for(;ce.progressiveRendering&&ie.current.length>0;)await new Promise(n=>setTimeout(n,10))},lt=n=>{if(ce.progressiveRendering&&ye.current){let o=Fi(n);for(let a of o)ie.current.push(a)}else J.current?J.current.text=Ct(J.current.text+n):J.current={id:"agent-"+Date.now(),role:"agent",text:Ct(n),isStreaming:!0},ne()};et(()=>{let n=Zo(),o=!["Terminal","Windows Terminal"].includes(n)||!!process.env.VSC_TERMINAL_URL,a=setTimeout(()=>{o&&!zo()&&ve(!0)},500),f=setInterval(()=>{zo()&&ve(!1)},1e3);m.current=Date.now();let g=setInterval(()=>{m.current&&(Date.now()-m.current||0)>3e4&&global.gc&&(async()=>{for(let d=0;d<1;d++)global.gc(),await new Promise(p=>setImmediate(p));m.current=Date.now()})()},3e3);return()=>{clearTimeout(a),clearInterval(f),clearInterval(g)}},[]),et(()=>{(async()=>{try{let o=await ds(),a=o?.systemSettings||{},f=a.CustomSubAgent,g=a.SubAgentModel;if(!f||!g||g==="Default")return;let S=process.env.SUBAGENT_MODEL?process.env.SUBAGENT_MODEL.trim():null,u=process.env.SUBAGENT_PROVIDER?process.env.SUBAGENT_PROVIDER.trim():null,d=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","APInex"],v=(G=>{if(!G)return null;let $=G.toLowerCase();return $==="google"?"Google":$==="deepseek"?"DeepSeek":$==="openrouter"?"OpenRouter":$==="nvidia"?"NVIDIA":$==="mistral"?"Mistral":$==="ollama"?"Ollama":$==="inferx"?"InferX":$==="sensenova"?"SenseNova":$==="poolside"?"Poolside":$==="9router"?"9router":$==="aihubmix"||$==="aihub"?"AIHubMix":$==="explabs"||$==="experientiallabs"||$==="experimentallabs"||$==="experiential labs"||$==="experimental labs"||$==="experiential"||$==="experimental"?"ExpLabs":$==="tokenharbor"||$==="token harbor"||$==="token_harbor"||$==="thk"?"TokenHarbor":$==="apinex"||$==="apx"?"APInex":null})(u);if(S&&!v){let G=o.aiProvider||N||"Google";A($=>(X($.length+1),[...$,{id:"subagent-env-noprov-"+Date.now(),role:"system",text:`[SUBAGENT CONFIG] SUBAGENT_MODEL found in ENV but SUBAGENT_PROVIDER is missing/invalid. Active provider (${G}) will be used.`,isMeta:!0}]))}if(g==="ENV"){S||A(G=>(X(G.length+1),[...G,{id:"subagent-model-noenv-"+Date.now(),role:"system",text:"No SubAgent model is found in ENV, Using Deafult until changed",isMeta:!0}]));return}let F=o.aiProvider||N||"Google",Q=o.apiTier||rt||"Free",ae=o.quotas||Ue||{},Y=new Set;(Oo(F,Q)||[]).forEach(G=>{let $=typeof G=="string"?G:G.cmd||G.name||G.id||String(G);$&&Y.add($)});for(let G of d)try{if(await mn(G)){let $e=ae?.providerTiers?.[G]||"Free";(Oo(G,$e)||[]).forEach(Le=>{let Je=typeof Le=="string"?Le:Le.cmd||Le.name||Le.id||String(Le);Je&&Y.add(Je)})}}catch{}let q=Y.has(g);S?S!==g&&A(G=>(X(G.length+1),[...G,{id:"subagent-model-env-"+Date.now(),role:"system",text:"Current Seleted Sub-Agent model is not available in this provider. Using model from ENV unless changed.",isMeta:!0}])):q||A(G=>(X(G.length+1),[...G,{id:"subagent-model-err-"+Date.now(),role:"system",text:"Current Seleted Sub-Agent model is not available in this provider. Using Default until changed",isMeta:!0}]))}catch{}})()},[]);let De=Tn(()=>{let n={};for(let o=0;o<t.length;o++)if(t[o]==="--key"&&t[o+1]){let f=t[o+1];if(n.key=f,f.includes("@")){let g=f.split("@"),S=g[0],u=g[1].toLowerCase();if(["google","deepseek","openrouter","nvidia","mistral","ollama","inferx","sensenova","aihubmix","aihub","poolside","pool","9router","9r","explabs","tokenharbor","token_harbor","thk","apinex","apx"].includes(u)){let d="Google";u==="google"?d="Google":u==="deepseek"?d="DeepSeek":u==="openrouter"?d="OpenRouter":u==="nvidia"?d="NVIDIA":u==="mistral"?d="Mistral":u==="ollama"?d="Ollama":u==="inferx"?d="InferX":u==="sensenova"?d="SenseNova":u==="poolside"||u==="pool"?d="Poolside":u==="9router"||u==="9r"?d="9router":u==="aihubmix"||u==="aihub"?d="AIHubMix":u==="explabs"?d="ExpLabs":u==="tokenharbor"||u==="token_harbor"||u==="thk"?d="TokenHarbor":(u==="apinex"||u==="apx")&&(d="APInex"),n.key=S,n.provider=d}}}for(let o=0;o<t.length;o++){let a=t[o];if(a==="--key"){o++;continue}if(a==="--model"&&t[o+1])n.model=t[o+1],o++;else if(a==="--memory"&&t[o+1])n.memory=t[o+1].toLowerCase(),o++;else if(a==="--resume"&&t[o+1])n.resume=t[o+1],o++;else if(a==="--package"&&t[o+1]){let f=t[o+1].toLowerCase();["npm","pnpm","yarn","bun"].includes(f)&&(n.package=f),o++}else if(a==="--auto-del"&&t[o+1]){let f=t[o+1].toLowerCase();["1d","7d","30d"].includes(f)&&(n.autoDel=f),o++}else if(a==="--auto-exec"&&t[o+1])n.autoExec=t[o+1].toLowerCase(),o++;else if(a==="--yolo"&&t[o+1])n.autoExec=t[o+1].toLowerCase(),o++;else if(a==="--external-access"&&t[o+1])n.externalAccess=t[o+1].toLowerCase(),o++;else if(a==="--mode"&&t[o+1]){let g=t[o+1].toLowerCase();if(["flux","flow","icu","computer","fluxcu"].includes(g)){let S="Flux";g==="flux"?S="Flux":g==="flow"?S="Flow":g==="icu"||g==="computer"?S="ICU":g==="fluxcu"&&(S="FluxCU"),n.mode=S}o++}else if(a==="--thinking"&&t[o+1]){let g=t[o+1].toLowerCase();if(["fast","low","medium","high","xhigh","standard"].includes(g)){let S="Medium";g==="fast"?S="Fast":g==="low"?S="Low":g==="standard"?S="Standard":g==="medium"?S="Medium":g==="high"?S="High":g==="xhigh"&&(S="xHigh"),n.thinking=S}o++}else if(a==="--provider"&&t[o+1]){let f=t[o+1].toLowerCase();if(["google","deepseek","openrouter","nvidia","mistral","ollama","inferx","sensenova","aihubmix","aihub","poolside","pool","9router","9r","explabs","tokenharbor","token_harbor","thk","apinex","apx"].includes(f)){let g="Google";f==="google"?g="Google":f==="deepseek"?g="DeepSeek":f==="openrouter"?g="OpenRouter":f==="nvidia"?g="NVIDIA":f==="mistral"?g="Mistral":f==="ollama"?g="Ollama":f==="inferx"?g="InferX":f==="sensenova"?g="SenseNova":f==="poolside"||f==="pool"?g="Poolside":f==="9router"||f==="9r"?g="9router":f==="aihubmix"||f==="aihub"?g="AIHubMix":f==="explabs"?g="ExpLabs":f==="tokenharbor"||f==="token_harbor"||f==="thk"?g="TokenHarbor":(f==="apinex"||f==="apx")&&(g="APInex"),n.provider=g}o++}else(a==="--resume"||a==="-r")&&t[o+1]?(n.resume=t[o+1],o++):a==="--playground"?n.playground=!0:(a==="--original-cwd"||a==="--orginal-cwd")&&t[o+1]&&(n.originalCwd=t[o+1],o++)}return n},[t]),re=async(n=!1,o=null)=>{let a=o||ce;n&&A(f=>(X(f.length+1),[...f,{id:"check-"+Date.now(),role:"system",text:"\u2726 Checking for updates...",isMeta:!0}]));try{let g=await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json(),S=g["dist-tags"]?.latest,u=g["dist-tags"]?.stable;if(S&&Fr(S),S&&S!==so){let d=S===u?`v${S}`:`v${S}`;!n&&a.autoUpdate?z("update"):A(p=>{let v=[...p],F=n?v.length:Math.min(v.length,3);return v.splice(F,0,{id:"update-"+Date.now(),role:"system",text:`A new version (${d}) is here.
49
49
 
50
50
  \u2022 Type \`/update latest\` to apply the update.
51
51
  \u2022 Type \`/changelog\` to view the release notes.`,isUpdateNotification:!0,isMeta:!0}),v})}else n&&A(d=>{X(d.length+1);let p=S&&S===u?`${so}`:so;return[...d,{id:"uptodate-"+Date.now(),role:"system",text:`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Already up to date (${p}).
@@ -523,7 +523,7 @@ ${Ni?"":`${n==="Flux"?"Stepwise Execution, Run Automated Tests. Task Completion"
523
523
 
524
524
  -- THINKING GUIDANCE --
525
525
  ${f==="Mistral"||f==="Google"&&!h?`${i}
526
- ${x||t!=="Fast"&&(f==="Mistral"&&!h||t!=="xHigh"&&!h)?`critical thinking policy
526
+ ${x||t!=="Fast"&&(f==="Mistral"&&!h||t!=="High"&&!h)?`critical thinking policy
527
527
  Use <think>...</think> for reasoning before responding any queries
528
528
  `:""}`:`${i}
529
529
  `}${u?"":`Mandatory: Before calling tools, MUST provide a high level summary of your reasoning, plans, decisions, and next course of actions in chat
@@ -570,7 +570,7 @@ ${gi(t,n)}
570
570
  === END SYSTEM PROMPT ===${e?`
571
571
 
572
572
  -- current saved user memories --
573
- ${e}`:""}`.trim();var zi=()=>import("./web_search-YG5YAC5D.js").then(e=>e.web_search),Ji=()=>import("./web_scrape-5LBY4FDC.js").then(e=>e.web_scrape),Xi=()=>import("./memory-OYIUYX3A.js").then(e=>e.memory),Qi=()=>import("./chat-HZ7UVZE2.js").then(e=>e.chat),Zi=()=>import("./view_file-JK22NGXC.js").then(e=>e.view_file),er=()=>import("./write_file-LOYRYIK6.js").then(e=>e.write_file),tr=()=>import("./update_file-UFCBJOW5.js").then(e=>e.update_file),nr=()=>import("./exec_command-7MOYM7IQ.js").then(e=>e.exec_command),or=()=>import("./read_folder-OOKZITME.js").then(e=>e.read_folder),As=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),sr=()=>import("./write_pdf-VB4IFPWX.js").then(e=>e.write_pdf),ir=()=>import("./write_docx-EKUIZ7GV.js").then(e=>e.write_docx),Oo=()=>import("./search_keyword-W5YEUUPO.js").then(e=>e.search_keyword),rr=()=>import("./generate_image-XYDE47LK.js").then(e=>e.generate_image),Lo=()=>import("./saveSummary-ATBIFYDP.js").then(e=>e.saveSummary),ao=()=>import("./addMemScore-W4I665ZR.js").then(e=>e.addMemScore),ar=()=>import("./file_map-5KY2ADZW.js").then(e=>e.file_map),Po=()=>import("./todo-SJLJJLVZ.js").then(e=>e.todo),lr=()=>import("./invokeSync-K5NCZVFD.js").then(e=>e.invokeSync),sa=()=>import("./invoke-RZE37R5K.js").then(e=>e.invoke),cr=()=>import("./getProgress-KLWGCCPA.js").then(e=>e.getProgress),ia=()=>import("./cancel-7IMADALP.js").then(e=>e.cancel),dr=()=>import("./emergency_rollback-EPJPKANN.js").then(e=>e.emergency_rollback),lo=()=>import("./awaitSubagent-JTUSJDKD.js").then(e=>e.awaitSubagent),co=()=>import("./answerSubagent-JUVFNLE5.js").then(e=>e.answerSubagent),$o=()=>import("./steerSubagent-L2JVT4QN.js").then(e=>e.steerSubagent),No=()=>import("./computer_action-WTHH7RBB.js").then(e=>e.computer_action),fr=()=>import("./click-G6RRSFVC.js").then(e=>e.click),ur=()=>import("./drag-ZGH2MMP7.js").then(e=>e.drag),gr=()=>import("./scroll-GHXES2II.js").then(e=>e.scroll),Cs=()=>import("./keyboard_typing-CK3KVAWM.js").then(e=>e.keyboard_typing),Rs=()=>import("./key_press-M5QNCIPH.js").then(e=>e.key_press),vs=()=>import("./recapture_screen-5FKLOHJL.js").then(e=>e.recapture_screen),ra={web_search:zi,web_scrape:Ji,memory:Xi,chat:Qi,view_file:Zi,write_file:er,update_file:tr,exec_command:nr,read_folder:or,write_pdf:sr,write_docx:ir,search_keyword:Oo,generate_image:rr,saveSummary:Lo,addMemScore:ao,file_map:ar,todo:Po,Todo:Po,goal:Po,Goal:Po,invokeSync:lr,invoke:sa,getProgress:cr,cancel:ia,awaitSubagent:lo,answerSubagent:co,steerSubagent:$o,computer_action:No,computer_use:No,ComputerAction:No,ComputerUse:No,click:fr,Click:fr,drag:ur,Drag:ur,scroll:gr,Scroll:gr,keyboard_typing:Cs,KeyboardTyping:Cs,keyboardtyping:Cs,key_press:Rs,KeyPress:Rs,keypress:Rs,recapture_screen:vs,RecaptureScreen:vs,recapturescreen:vs,invoke_sync:lr,get_progress:cr,await_subagent:lo,answer_subagent:co,steer_subagent:$o,steer:$o,Steer:$o,ask:As,Ask:As,AskUser:As,WebSearch:zi,WebScrape:Ji,ReadFile:Zi,ReadFolder:or,WriteFile:er,PatchFile:tr,WritePDF:sr,WriteDoc:ir,Run:nr,SearchKeyword:Oo,CodeSearch:Oo,code_search:Oo,Memory:Xi,Chat:Qi,GenerateImage:rr,saveSumary:Lo,SaveSummary:Lo,SaveSumary:Lo,add_mem_score:ao,AddMemScore:ao,addMemoryScore:ao,AddMemoryScore:ao,FileMap:ar,answer:co,Answer:co,AnswerSubagent:co,await:lo,Await:lo,AwaitSubagent:lo,EmergencyRollback:dr,emergency_rollback:dr},fo=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),f=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await"].some(u=>o.includes(u))||o==="ask",h=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(u=>o.includes(u));if(!f){if(s==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Tool [${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(!h)return`ERROR: Tool [${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: Tool [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let g=ra[e];if(!g)return`ERROR: Tool [${e}] not found in registry.`;try{return await(await g())(t,n)}catch(u){let m=u instanceof Error?u.message:String(u);return`ERROR: Execution failed for [${e}]: ${m}`}};import J from"path";import Pe from"fs";import aa from"gradient-string";var Ms=["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 mr=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],uo={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},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"]},"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"]},"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"]},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"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"]},"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"]}};var Fo=null;var hr=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(Fo||(Fo=mr[Math.floor(Math.random()*mr.length)]),t={...Fo,id:"Mystery"}):(Fo=null,uo[e]?t=uo[e]:e==="GitHub"?t=uo["GitHub Dark"]:e==="Transparent"?t=uo["Transparent Dark"]:t=uo.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan";return{...t,codeText:n}};var la=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",jl=(e=2)=>{let t=la();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},Vl=(e="...",t="Loading...",n="Dark")=>{let s=Ms[Math.floor(Math.random()*Ms.length)],o=hr(n),d=o.logoTextAnsi,f=o.logoBodyAnsi,a=o.logoMutedAnsi,h="\x1B[0m",g=[" \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 "],u=o.logoGradient||["#0077ff","#ff00ff"],m=aa(u).multiline(g.join(`
573
+ ${e}`:""}`.trim();var zi=()=>import("./web_search-YG5YAC5D.js").then(e=>e.web_search),Ji=()=>import("./web_scrape-5LBY4FDC.js").then(e=>e.web_scrape),Xi=()=>import("./memory-OYIUYX3A.js").then(e=>e.memory),Qi=()=>import("./chat-HZ7UVZE2.js").then(e=>e.chat),Zi=()=>import("./view_file-JK22NGXC.js").then(e=>e.view_file),er=()=>import("./write_file-LOYRYIK6.js").then(e=>e.write_file),tr=()=>import("./update_file-UFCBJOW5.js").then(e=>e.update_file),nr=()=>import("./exec_command-7MOYM7IQ.js").then(e=>e.exec_command),or=()=>import("./read_folder-OOKZITME.js").then(e=>e.read_folder),As=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),sr=()=>import("./write_pdf-VB4IFPWX.js").then(e=>e.write_pdf),ir=()=>import("./write_docx-EKUIZ7GV.js").then(e=>e.write_docx),Oo=()=>import("./search_keyword-W5YEUUPO.js").then(e=>e.search_keyword),rr=()=>import("./generate_image-XYDE47LK.js").then(e=>e.generate_image),Lo=()=>import("./saveSummary-ATBIFYDP.js").then(e=>e.saveSummary),ao=()=>import("./addMemScore-W4I665ZR.js").then(e=>e.addMemScore),ar=()=>import("./file_map-5KY2ADZW.js").then(e=>e.file_map),Po=()=>import("./todo-SJLJJLVZ.js").then(e=>e.todo),lr=()=>import("./invokeSync-722CH233.js").then(e=>e.invokeSync),sa=()=>import("./invoke-D7WH5BU6.js").then(e=>e.invoke),cr=()=>import("./getProgress-LI4U6UJU.js").then(e=>e.getProgress),ia=()=>import("./cancel-7IMADALP.js").then(e=>e.cancel),dr=()=>import("./emergency_rollback-EPJPKANN.js").then(e=>e.emergency_rollback),lo=()=>import("./awaitSubagent-JTUSJDKD.js").then(e=>e.awaitSubagent),co=()=>import("./answerSubagent-JUVFNLE5.js").then(e=>e.answerSubagent),$o=()=>import("./steerSubagent-L2JVT4QN.js").then(e=>e.steerSubagent),No=()=>import("./computer_action-WTHH7RBB.js").then(e=>e.computer_action),fr=()=>import("./click-G6RRSFVC.js").then(e=>e.click),ur=()=>import("./drag-ZGH2MMP7.js").then(e=>e.drag),gr=()=>import("./scroll-GHXES2II.js").then(e=>e.scroll),Cs=()=>import("./keyboard_typing-CK3KVAWM.js").then(e=>e.keyboard_typing),Rs=()=>import("./key_press-M5QNCIPH.js").then(e=>e.key_press),vs=()=>import("./recapture_screen-5FKLOHJL.js").then(e=>e.recapture_screen),ra={web_search:zi,web_scrape:Ji,memory:Xi,chat:Qi,view_file:Zi,write_file:er,update_file:tr,exec_command:nr,read_folder:or,write_pdf:sr,write_docx:ir,search_keyword:Oo,generate_image:rr,saveSummary:Lo,addMemScore:ao,file_map:ar,todo:Po,Todo:Po,goal:Po,Goal:Po,invokeSync:lr,invoke:sa,getProgress:cr,cancel:ia,awaitSubagent:lo,answerSubagent:co,steerSubagent:$o,computer_action:No,computer_use:No,ComputerAction:No,ComputerUse:No,click:fr,Click:fr,drag:ur,Drag:ur,scroll:gr,Scroll:gr,keyboard_typing:Cs,KeyboardTyping:Cs,keyboardtyping:Cs,key_press:Rs,KeyPress:Rs,keypress:Rs,recapture_screen:vs,RecaptureScreen:vs,recapturescreen:vs,invoke_sync:lr,get_progress:cr,await_subagent:lo,answer_subagent:co,steer_subagent:$o,steer:$o,Steer:$o,ask:As,Ask:As,AskUser:As,WebSearch:zi,WebScrape:Ji,ReadFile:Zi,ReadFolder:or,WriteFile:er,PatchFile:tr,WritePDF:sr,WriteDoc:ir,Run:nr,SearchKeyword:Oo,CodeSearch:Oo,code_search:Oo,Memory:Xi,Chat:Qi,GenerateImage:rr,saveSumary:Lo,SaveSummary:Lo,SaveSumary:Lo,add_mem_score:ao,AddMemScore:ao,addMemoryScore:ao,AddMemoryScore:ao,FileMap:ar,answer:co,Answer:co,AnswerSubagent:co,await:lo,Await:lo,AwaitSubagent:lo,EmergencyRollback:dr,emergency_rollback:dr},fo=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),f=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await"].some(u=>o.includes(u))||o==="ask",h=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(u=>o.includes(u));if(!f){if(s==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Tool [${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(!h)return`ERROR: Tool [${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: Tool [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let g=ra[e];if(!g)return`ERROR: Tool [${e}] not found in registry.`;try{return await(await g())(t,n)}catch(u){let m=u instanceof Error?u.message:String(u);return`ERROR: Execution failed for [${e}]: ${m}`}};import J from"path";import Pe from"fs";import aa from"gradient-string";var Ms=["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 mr=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],uo={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},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"]},"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"]},"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"]},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"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"]},"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"]}};var Fo=null;var hr=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(Fo||(Fo=mr[Math.floor(Math.random()*mr.length)]),t={...Fo,id:"Mystery"}):(Fo=null,uo[e]?t=uo[e]:e==="GitHub"?t=uo["GitHub Dark"]:e==="Transparent"?t=uo["Transparent Dark"]:t=uo.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan";return{...t,codeText:n}};var la=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",jl=(e=2)=>{let t=la();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},Vl=(e="...",t="Loading...",n="Dark")=>{let s=Ms[Math.floor(Math.random()*Ms.length)],o=hr(n),d=o.logoTextAnsi,f=o.logoBodyAnsi,a=o.logoMutedAnsi,h="\x1B[0m",g=[" \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 "],u=o.logoGradient||["#0077ff","#ff00ff"],m=aa(u).multiline(g.join(`
574
574
  `)).split(`
575
575
  `),x=i=>`${a}${i}${h}`;return`${m[0]}
576
576
  ${m[1]} ${d}Selected Provider: ${t}${h}
@@ -715,7 +715,7 @@ ${mt.warnings}
715
715
  [Tagged File Contents]
716
716
  `);let Xs=zs.replace(/\\(@\[[^\]]+\])/g,"$1"),Qs=T?`You cannot execute tools
717
717
  Instead, output in chat the exact string you WOULD have produced & wait for system response
718
- `:"",Pr=process.env.forcedReasoning||!1,Zs=f!=="Fast"&&(i==="Mistral"&&!Vn(e)||f!=="xHigh"&&i==="Google")?`${i==="Mistral"&&!Vn(e)||e.toLowerCase().startsWith("gemma")||Pr?`[system] strictly follow thinking policy as high priority. do not start a response without <think>...</think> [/system]
718
+ `:"",Pr=process.env.forcedReasoning||!1,Zs=f!=="Fast"&&(i==="Mistral"&&!Vn(e)||f!=="High"&&i==="Google")?`${i==="Mistral"&&!Vn(e)||e.toLowerCase().startsWith("gemma")||Pr?`[system] strictly follow thinking policy as high priority. do not start a response without <think>...</think> [/system]
719
719
  `:""}`:"",yo="",ei=!!m?.autoExcludeMetadata,$r=!!(cn||rs||Qs||ns||G||Zs||vt||m?.dynamicDirAwareness||m?.autoTruncateResults||b);ei&&!$r?yo=Xs.trim():yo=`[System Metadata]
720
720
  Time: ${ei?Qe:ft}${m?.dynamicDirAwareness?qs:""}${vt?`
721
721
  WARNING: CWD Changed from previous: "${ie}" to current: "${process.cwd()}", write change in chat to avoid future path mismatches
@@ -748,7 +748,7 @@ ${oe} [/ERROR]`),yield{type:"status",content:"Working"}}let Lt=i==="Mistral"||i=
748
748
  `;for(let H of L.modifiedFiles)oe+=`* ${H} (modified)
749
749
  `;for(let H of L.deletedFiles)oe+=`* ${H} (deleted)
750
750
  `;oe+="[/system]",We.parts[0].text+=oe;let F=-1;for(let H=r.length-1;H>=0;H--)if(r[H].role==="user"&&r[H].text?.startsWith("[TOOL RESULT]")){F=H;break}F!==-1&&(r[F].text+=oe)}}catch{}let St=Math.floor(qn*(a==="Flux"?.98:.8)),yt=K+1;yt>=St&&We&&We.parts?.[0]&&(We.parts[0].text+=`
751
- [system] WARNING, Turn Limit Impending: Step ${yt}/${qn}. Wrap up quickly/prompt user to continue. [/system]`);let Rt=new Promise((L,oe)=>{w.signal.aborted&&oe(new DOMException("The user aborted a request.","AbortError")),w.signal.addEventListener("abort",()=>{oe(new DOMException("The user aborted a request.","AbortError"))})});Rt.catch(()=>{});let ut=re;if(i==="Ollama")Se=Bs(n.apiKey,me,ut,Ue,f,a,C,w.signal,1,m?.ollamaEndpoint||"Cloud");else if(i==="OpenRouter")Se=Ko(n.apiKey,me,ut,Ue,f,a,C,w.signal,1,g);else if(i==="DeepSeek")Se=Go(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="Mistral")Se=jo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1,g);else if(i==="NVIDIA"){let L=Vo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);Se=Tr(L,me)}else if(i==="InferX")Se=Yo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="SenseNova")Se=qo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="AIHubMix")Se=zo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="Poolside")Se=Jo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="9router"||i==="9Router")Se=Xo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="ExpLabs"||i==="ExperientialLabs")Se=Qo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="TokenHarbor"||i==="Token Harbor"||i==="tokenharbor"||i==="token_harbor"||i==="thk")Se=Us(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="APInex"||i==="apinex"||i==="apx")Se=Ws(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else{let oe=Vs(n?.apiKey).models.generateContentStream({model:me||"gemini-3-flash-preview",contents:ut,config:{systemInstruction:Ue,mediaResolution:"MEDIA_RESOLUTION_HIGH",safetySettings:[{category:En.HARM_CATEGORY_HARASSMENT,threshold:_n.BLOCK_NONE},{category:En.HARM_CATEGORY_HATE_SPEECH,threshold:_n.BLOCK_NONE},{category:En.HARM_CATEGORY_SEXUALLY_EXPLICIT,threshold:_n.BLOCK_NONE},{category:En.HARM_CATEGORY_DANGEROUS_CONTENT,threshold:_n.BLOCK_NONE}],temperature:1.05,thinkingConfig:(()=>{let F=$e("Google",me||"gemini-3-flash-preview",f);if(F!==null){if(typeof F=="object")return F;if(F===!1||F==="false"||F==="none"||F===0||F==="0")return{includeThoughts:!1};if(typeof F=="number")return{includeThoughts:!0,thinkingBudget:F};if(typeof F=="string"){let he=F.toLowerCase();if(he==="minimal")return{includeThoughts:!0,thinkingLevel:Je.MINIMAL};if(he==="low")return{includeThoughts:!0,thinkingLevel:Je.LOW};if(he==="medium")return{includeThoughts:!0,thinkingLevel:Je.MEDIUM};if(he==="high")return{includeThoughts:!0,thinkingLevel:Je.HIGH};let Ke=Number(F);if(!isNaN(Ke))return{includeThoughts:!0,thinkingBudget:Ke}}}let H=(me||"").toLowerCase(),we=H.includes("gemma-4")||H.startsWith("gemma"),xe=H.includes("gemini-3");if(we||xe)return we?f.toLowerCase()!=="xhigh"?{includeThoughts:!1,thinkingLevel:Je.MINIMAL}:{includeThoughts:!0,thinkingLevel:Je.HIGH}:{includeThoughts:!0,thinkingLevel:{Fast:H.includes("pro")?Je.LOW:Je.MINIMAL,Low:Je.LOW,Medium:Je.MEDIUM,Standard:Je.MEDIUM,High:Je.HIGH,xHigh:Je.HIGH}[f]||Je.MEDIUM};{let he={Fast:0,Low:512,Medium:2048,Standard:2048,High:16384,xHigh:24576}[f]||2048;return he===0?{includeThoughts:!1}:{includeThoughts:!0,thinkingBudget:he}}})()}},{signal:w.signal});Se=await Promise.race([oe,Rt])}ge="",Mt=null,zt=null,X=[],Ve=0,yield{type:"model_update",content:null},qe="",Dt=st.length>0;let on="",as=Date.now(),Mn=async function*(){if(i==="Google"&&on){let L=Jn(on);for(let oe of L)yield oe;on="",as=Date.now()}},oi=!0,In="",Bn=!1,Pt=null,Br={tool:{startPrefix:"[tool",fullPrefix:"[tool:functions.",endTag:"]"},agent:{startPrefix:"[agent",fullPrefix:"[agent:generalist.",endTag:"]"},end:{startPrefix:"[[END]]",fullPrefix:"[[END]]",endTag:"[[END]]"},kimi_section:{startPrefix:"<|tool_calls_section_begin|>",fullPrefix:"<|tool_calls_section_begin|>",endTag:"<|tool_calls_section_end|>"},kimi_call:{startPrefix:"<|tool_call_begin|>",fullPrefix:"<|tool_call_begin|>",endTag:"<|tool_call_end|>"}},Jn=L=>{let oe=[],F=L;for(;F.length>0;)if(Bn){let H=In+F,we=Br[Pt];if(we){let Ke=!1;if(H.length<we.startPrefix.length?we.startPrefix.startsWith(H)||(Ke=!0):H.startsWith(we.startPrefix)?H.length>=we.fullPrefix.length&&!H.startsWith(we.fullPrefix)&&(Ke=!0):Ke=!0,Ke){oe.push({type:"text",content:H}),In="",Bn=!1,Pt=null,F="";break}}let xe=-1,he=we?we.endTag:"]";if(Pt==="tool"||Pt==="agent"){let Ke=0,W=null,te=0,Ne=!1;for(let y=0;y<H.length;y++){let Fe=H[y];if(W){if(Fe===W){let ve=0;for(let z=y-1;z>=0&&H[z]==="\\";z--)ve++;ve%2===0&&(W=null)}}else if(Fe==='"'||Fe==="'"||Fe==="`")W=Fe;else if(Fe==="(")Ke++,Ne=!0;else if(Fe===")")Ke--;else if(Fe==="[")te++;else if(Fe==="]"){if(Ne&&Ke===0&&te===1){xe=y;break}te--}}}else xe=H.indexOf(he);if(xe!==-1){let Ke=he.length;if(!Pt?.startsWith("kimi")){let W=H.substring(0,xe+Ke);oe.push({type:"text",content:W})}In="",Bn=!1,Pt=null,F=H.substring(xe+Ke)}else{let Ke=Pt?.startsWith("kimi")?8192:512;H.length>Ke?(oe.push({type:"text",content:H}),In="",Bn=!1,Pt=null):In=H,F="";break}}else{let H=F.indexOf("[tool"),we=F.indexOf("[agent"),xe=F.indexOf("[[END]]"),he=F.indexOf("<|tool_calls_section_begin|>"),Ke=F.indexOf("<|tool_call_begin|>"),W=[{type:"tool",idx:H,start:"[tool",end:"]"},{type:"agent",idx:we,start:"[agent",end:"]"},{type:"end",idx:xe,start:"[[END]]",end:"[[END]]"},{type:"kimi_section",idx:he,start:"<|tool_calls_section_begin|>",end:"<|tool_calls_section_end|>"},{type:"kimi_call",idx:Ke,start:"<|tool_call_begin|>",end:"<|tool_call_end|>"}].filter(te=>te.idx!==-1).sort((te,Ne)=>te.idx-Ne.idx);if(W.length>0){let te=W[0];te.idx>0&&oe.push({type:"text",content:F.substring(0,te.idx)}),Bn=!0,Pt=te.type,In="",F=F.substring(te.idx)}else{let te=["[tool","[agent","[[END]]","<|tool_calls_section_begin|>","<|tool_call_begin|>"],Ne=-1;for(let y of te){for(let Fe=y.length-1;Fe>0;Fe--)if(F.endsWith(y.substring(0,Fe))){Ne=F.length-Fe;let ve=te.indexOf(y);ve===0?Pt="tool":ve===1?Pt="agent":ve===2?Pt="end":ve===3?Pt="kimi_section":Pt="kimi_call";break}if(Ne!==-1)break}if(Ne!==-1)Ne>0&&oe.push({type:"text",content:F.substring(0,Ne)}),Bn=!0,In=F.substring(Ne),F="";else{oe.push({type:"text",content:F});break}}}return oe},Ur=Se[Symbol.asyncIterator]();for(;;){let{value:L,done:oe}=await Promise.race([Ur.next(),Rt]);if(oe)break;if(L&&L.type==="status"){yield L;continue}let F="",H=L.candidates?.[0]?.content?.parts;if(H&&H.length>0)for(let xe of H){let he=typeof xe.text=="string"?xe.text:xe.text?parseChunkText(xe.text):"";xe.thought?he&&(ye||(F+="<think>",ye=!0),F+=he):he&&(ye&&(F+="</think>",ye=!1),F+=he)}else L.text&&ye&&(F+="</think>",ye=!1);F=Ea(F);let we=F?gs(F):0;if(n&&typeof n.onTokenChunk=="function"&&n.onTokenChunk(F,we),oi&&(yield{type:"status",content:"Thinking"},oi=!1),kt){yield{type:"status",content:"Request Cancelled"},yield{type:"text",content:`
751
+ [system] WARNING, Turn Limit Impending: Step ${yt}/${qn}. Wrap up quickly/prompt user to continue. [/system]`);let Rt=new Promise((L,oe)=>{w.signal.aborted&&oe(new DOMException("The user aborted a request.","AbortError")),w.signal.addEventListener("abort",()=>{oe(new DOMException("The user aborted a request.","AbortError"))})});Rt.catch(()=>{});let ut=re;if(i==="Ollama")Se=Bs(n.apiKey,me,ut,Ue,f,a,C,w.signal,1,m?.ollamaEndpoint||"Cloud");else if(i==="OpenRouter")Se=Ko(n.apiKey,me,ut,Ue,f,a,C,w.signal,1,g);else if(i==="DeepSeek")Se=Go(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="Mistral")Se=jo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1,g);else if(i==="NVIDIA"){let L=Vo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);Se=Tr(L,me)}else if(i==="InferX")Se=Yo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="SenseNova")Se=qo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="AIHubMix")Se=zo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="Poolside")Se=Jo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="9router"||i==="9Router")Se=Xo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="ExpLabs"||i==="ExperientialLabs")Se=Qo(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="TokenHarbor"||i==="Token Harbor"||i==="tokenharbor"||i==="token_harbor"||i==="thk")Se=Us(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else if(i==="APInex"||i==="apinex"||i==="apx")Se=Ws(n.apiKey,me,ut,Ue,f,a,C,w.signal,1);else{let oe=Vs(n?.apiKey).models.generateContentStream({model:me||"gemini-3-flash-preview",contents:ut,config:{systemInstruction:Ue,mediaResolution:"MEDIA_RESOLUTION_HIGH",safetySettings:[{category:En.HARM_CATEGORY_HARASSMENT,threshold:_n.BLOCK_NONE},{category:En.HARM_CATEGORY_HATE_SPEECH,threshold:_n.BLOCK_NONE},{category:En.HARM_CATEGORY_SEXUALLY_EXPLICIT,threshold:_n.BLOCK_NONE},{category:En.HARM_CATEGORY_DANGEROUS_CONTENT,threshold:_n.BLOCK_NONE}],temperature:1.05,thinkingConfig:(()=>{let F=$e("Google",me||"gemini-3-flash-preview",f);if(F!==null){if(typeof F=="object")return F;if(F===!1||F==="false"||F==="none"||F===0||F==="0")return{includeThoughts:!1};if(typeof F=="number")return{includeThoughts:!0,thinkingBudget:F};if(typeof F=="string"){let he=F.toLowerCase();if(he==="minimal")return{includeThoughts:!0,thinkingLevel:Je.MINIMAL};if(he==="low")return{includeThoughts:!0,thinkingLevel:Je.LOW};if(he==="medium")return{includeThoughts:!0,thinkingLevel:Je.MEDIUM};if(he==="high")return{includeThoughts:!0,thinkingLevel:Je.HIGH};let Ke=Number(F);if(!isNaN(Ke))return{includeThoughts:!0,thinkingBudget:Ke}}}let H=(me||"").toLowerCase(),we=H.includes("gemma-4")||H.startsWith("gemma"),xe=H.includes("gemini-3");if(we||xe)return we?f.toLowerCase()!=="high"?{includeThoughts:!1,thinkingLevel:Je.MINIMAL}:{includeThoughts:!0,thinkingLevel:Je.HIGH}:{includeThoughts:!0,thinkingLevel:{Fast:H.includes("pro")?Je.LOW:Je.MINIMAL,Low:Je.LOW,Medium:Je.MEDIUM,Standard:Je.MEDIUM,High:Je.HIGH,xHigh:Je.HIGH}[f]||Je.MEDIUM};{let he={Fast:0,Low:512,Medium:2048,Standard:2048,High:16384,xHigh:24576}[f]||2048;return he===0?{includeThoughts:!1}:{includeThoughts:!0,thinkingBudget:he}}})()}},{signal:w.signal});Se=await Promise.race([oe,Rt])}ge="",Mt=null,zt=null,X=[],Ve=0,yield{type:"model_update",content:null},qe="",Dt=st.length>0;let on="",as=Date.now(),Mn=async function*(){if(i==="Google"&&on){let L=Jn(on);for(let oe of L)yield oe;on="",as=Date.now()}},oi=!0,In="",Bn=!1,Pt=null,Br={tool:{startPrefix:"[tool",fullPrefix:"[tool:functions.",endTag:"]"},agent:{startPrefix:"[agent",fullPrefix:"[agent:generalist.",endTag:"]"},end:{startPrefix:"[[END]]",fullPrefix:"[[END]]",endTag:"[[END]]"},kimi_section:{startPrefix:"<|tool_calls_section_begin|>",fullPrefix:"<|tool_calls_section_begin|>",endTag:"<|tool_calls_section_end|>"},kimi_call:{startPrefix:"<|tool_call_begin|>",fullPrefix:"<|tool_call_begin|>",endTag:"<|tool_call_end|>"}},Jn=L=>{let oe=[],F=L;for(;F.length>0;)if(Bn){let H=In+F,we=Br[Pt];if(we){let Ke=!1;if(H.length<we.startPrefix.length?we.startPrefix.startsWith(H)||(Ke=!0):H.startsWith(we.startPrefix)?H.length>=we.fullPrefix.length&&!H.startsWith(we.fullPrefix)&&(Ke=!0):Ke=!0,Ke){oe.push({type:"text",content:H}),In="",Bn=!1,Pt=null,F="";break}}let xe=-1,he=we?we.endTag:"]";if(Pt==="tool"||Pt==="agent"){let Ke=0,W=null,te=0,Ne=!1;for(let y=0;y<H.length;y++){let Fe=H[y];if(W){if(Fe===W){let ve=0;for(let z=y-1;z>=0&&H[z]==="\\";z--)ve++;ve%2===0&&(W=null)}}else if(Fe==='"'||Fe==="'"||Fe==="`")W=Fe;else if(Fe==="(")Ke++,Ne=!0;else if(Fe===")")Ke--;else if(Fe==="[")te++;else if(Fe==="]"){if(Ne&&Ke===0&&te===1){xe=y;break}te--}}}else xe=H.indexOf(he);if(xe!==-1){let Ke=he.length;if(!Pt?.startsWith("kimi")){let W=H.substring(0,xe+Ke);oe.push({type:"text",content:W})}In="",Bn=!1,Pt=null,F=H.substring(xe+Ke)}else{let Ke=Pt?.startsWith("kimi")?8192:512;H.length>Ke?(oe.push({type:"text",content:H}),In="",Bn=!1,Pt=null):In=H,F="";break}}else{let H=F.indexOf("[tool"),we=F.indexOf("[agent"),xe=F.indexOf("[[END]]"),he=F.indexOf("<|tool_calls_section_begin|>"),Ke=F.indexOf("<|tool_call_begin|>"),W=[{type:"tool",idx:H,start:"[tool",end:"]"},{type:"agent",idx:we,start:"[agent",end:"]"},{type:"end",idx:xe,start:"[[END]]",end:"[[END]]"},{type:"kimi_section",idx:he,start:"<|tool_calls_section_begin|>",end:"<|tool_calls_section_end|>"},{type:"kimi_call",idx:Ke,start:"<|tool_call_begin|>",end:"<|tool_call_end|>"}].filter(te=>te.idx!==-1).sort((te,Ne)=>te.idx-Ne.idx);if(W.length>0){let te=W[0];te.idx>0&&oe.push({type:"text",content:F.substring(0,te.idx)}),Bn=!0,Pt=te.type,In="",F=F.substring(te.idx)}else{let te=["[tool","[agent","[[END]]","<|tool_calls_section_begin|>","<|tool_call_begin|>"],Ne=-1;for(let y of te){for(let Fe=y.length-1;Fe>0;Fe--)if(F.endsWith(y.substring(0,Fe))){Ne=F.length-Fe;let ve=te.indexOf(y);ve===0?Pt="tool":ve===1?Pt="agent":ve===2?Pt="end":ve===3?Pt="kimi_section":Pt="kimi_call";break}if(Ne!==-1)break}if(Ne!==-1)Ne>0&&oe.push({type:"text",content:F.substring(0,Ne)}),Bn=!0,In=F.substring(Ne),F="";else{oe.push({type:"text",content:F});break}}}return oe},Ur=Se[Symbol.asyncIterator]();for(;;){let{value:L,done:oe}=await Promise.race([Ur.next(),Rt]);if(oe)break;if(L&&L.type==="status"){yield L;continue}let F="",H=L.candidates?.[0]?.content?.parts;if(H&&H.length>0)for(let xe of H){let he=typeof xe.text=="string"?xe.text:xe.text?parseChunkText(xe.text):"";xe.thought?he&&(ye||(F+="<think>",ye=!0),F+=he):he&&(ye&&(F+="</think>",ye=!1),F+=he)}else L.text&&ye&&(F+="</think>",ye=!1);F=Ea(F);let we=F?gs(F):0;if(n&&typeof n.onTokenChunk=="function"&&n.onTokenChunk(F,we),oi&&(yield{type:"status",content:"Thinking"},oi=!1),kt){yield{type:"status",content:"Request Cancelled"},yield{type:"text",content:`
752
752
 
753
753
  \x1B[33m\u24D8 Request Cancelled\x1B[0m`};break}if(F){if(Dt){if(qe+=F,qe.length>=64){let W=0,te=Math.min(st.length,qe.length);for(let y=te;y>=10;y--)if(st.endsWith(qe.substring(0,y))){W=y;break}let Ne=qe.substring(W);if(Ne){let Fe=/(?:<(think|thought)>|\[(think|thought)\])(?:(?!(?:<\/(?:think|thought)>|\[\/(?:think|thought)\]))[\s\S])*$/i.test(st)?Ne.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi,""):Ne.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])[\s\S]*?(?:<\/(think|thought)>|\[\/(think|thought)\])\s*/gi,"").replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi,"");if(Fe)if(ge+=Fe,i==="Google")on+=Fe;else{yield*Mn();let ve=Jn(Fe);for(let z of ve)yield z}}Dt=!1,qe=""}continue}else if(ge+=F,i==="Google")on+=F;else{yield*Mn();let W=Jn(F);for(let te of W)yield te}let xe=Oa(ge);if(xe.inside){Cn=!0,zt||(zt=Date.now());let te={Ask:"ask",AskUser:"ask",WebSearch:"web_search",WebScrape:"web_scrape",ReadFile:"view_file",ReadFolder:"read_folder",WriteFile:"write_file",PatchFile:"update_file",WritePDF:"write_pdf",WriteDoc:"write_docx",Run:"exec_command",SearchKeyword:"search_keyword",CodeSearch:"search_keyword",code_search:"search_keyword",Code_Search:"search_keyword",codesearch:"search_keyword",Memory:"memory",file_map:"file_map",FileMap:"file_map",Chat:"chat",chat:"chat",GenerateImage:"generate_image",generate_image:"generate_image",todo:"todo",Todo:"todo",goal:"todo",Goal:"todo",Invoke:"invoke",InvokeSync:"invoke_sync",getProgress:"get_progress",GetProgress:"get_progress",Cancel:"cancel",Await:"await",Answer:"answer",Steer:"steer",steer:"steer"}[xe.toolName]||xe.toolName,Ne=xe.args||"",y=null;if(["write_file","update_file","view_file","read_folder","write_pdf","write_docx","search_keyword","generate_image","file_map","invoke","invoke_sync","get_progress","await","answer"].includes(te)){let ve=Q(Ne),z=ve.path||ve.targetFile||ve.TargetFile||ve.directory,sn=ve.keyword,Dn=ve.title||ve.task,kn=ve.id||ve.taskId,Ae=ve.timeout||ve.time;if(sn!=null)y=String(sn).replace(Pn,"");else if(z)y=J.basename(String(z).replace(Pn,"").replace(Sr,"/"));else if(Dn&&(te==="invoke"||te==="invoke_sync"))y=String(Dn).replace(Pn,"").substring(0,30);else if(kn&&te==="get_progress")y=String(kn).replace(Pn,"");else if(Ae&&te==="await"){let $t=parseFloat(String(Ae).replace(Pn,""));isNaN($t)?y=String(Ae).replace(Pn,""):($t<5&&($t=5),$t>120&&($t=120),y=(un=>{if(un>=60){let cs=Math.floor(un/60),Un=un%60;return`${cs}m${Un>0?` ${Un}s`:""}`}return`${un}s`})($t))}else{let $t=Ne.match(Ta);if($t){let Ut=$t[1].replace(Pn,"");te==="invoke"||te==="invoke_sync"||te==="get_progress"?y=Ut.substring(0,30):y=te==="search_keyword"||te==="file_map"?Ut:J.basename(Ut.replace(Sr,"/"))}}}let Fe=`${Gs[te]||te}${y?` ${y}`:""}`;if((te!==Mt||y!==et)&&(Mt=te,et=y,yield{type:"status",content:`${Fe}`},process.stdout.isTTY)){let z={WebSearch:"Searching",web_search:"Searching",WebScrape:"Reading",web_scrape:"Reading",ReadFile:"Reading",read_file:"Reading",ReadFolder:"Reading",read_folder:"Reading",WriteFile:"Writing",write_file:"Writing",UpdateFile:"Editing",update_file:"Editing",WritePdf:"Creating",write_pdf:"Creating",WriteDocx:"Creating",write_docx:"Creating",SearchKeyword:"Searching",search_keyword:"Searching",CodeSearch:"Searching",code_search:"Searching",Run:"Executing",Ask:"User Input Required",AskUser:"User Input Required",Memory:"Updating Memory",GenerateImage:"Generating",InvokeSync:"Sub-Agent Working",invoke_sync:"Sub-Agent Working",Invoke:"Working",invoke:"Working",GetProgress:"Checking Progress",get_progress:"Checking Progress",Cancel:"Stopping Generalist",cancel:"Stopping Generalist",Await:"Waiting",await:"Waiting",EmergencyRollback:"Rolling the Ball",Answer:"Answering Sub-Agent",answer:"Answering Sub-Agent",Steer:"Steering Sub-Agent",steer:"Steering Sub-Agent",Click:"Clicking",click:"Clicking",Drag:"Dragging",drag:"Dragging",Scroll:"Scrolling",scroll:"Scrolling",KeyboardTyping:"Typing",keyboard_typing:"Typing",KeyPress:"Pressing Key",key_press:"Pressing Key",RecaptureScreen:"Recapturing Screen",recapture_screen:"Recapturing Screen"}[te]||"Working";process.stdout.write(`\x1B]0;${z}...\x07`)}}if(ge.length-bo>150){bo=ge.length;let W=Dr(ge,!1),te=Hs(W),Ne=te?(te.innerContent||"").trim():"",y=Ne.split(/[.!?]\s+/),Fe=new Set(y),ve=y.length>10?(y.length-Fe.size)/y.length:0,z=Ne.split(/\s+/).filter(Me=>Me.length>0).length,sn=.6,Dn=.8,kn=!1;if((i.toLowerCase().includes("google")||i.toLowerCase().includes("mistral"))&&((me||"").toLowerCase().startsWith("gemma")||(me||"").toLowerCase().includes("stral"))){let _={low:256,medium:1024,high:8192,max:16384,xhigh:16384}[f?.toLowerCase()]||2500;kn=z>_}if(ve>sn||kn){yield{type:"status",content:`${ve>sn?"Reasoning Loop Detected":"Thinking Budget Exceeded"}. Re-centering...`},It=!0,await new Promise(_=>setTimeout(_,3e3));break}let Ut=Rr(ge).trim().split(/[.!?]\s+/),un=new Set(Ut);if((Ut.length>10?(Ut.length-un.size)/Ut.length:0)>Dn){yield{type:"status",content:"Response Loop Detected. Re-centering..."},It=!1,fn=!0,await new Promise(Me=>setTimeout(Me,3e3));break}let Un=W.replace(ha,"").replace(pa,"").replace(ya,"").replace(xa,""),Nt=Un.toLowerCase().split(/\s+/).map(Me=>Me.replace(ba,"")).filter(Me=>Me.length>0),gn=!1;if(Nt.length>=10)for(let Me=1;Me<=15;Me++){let _=Math.max(3,Math.ceil(10/Me));if(Nt.length<Me*_)continue;let V=Nt.slice(Nt.length-Me),ae=V.join(" ");if(Me>1&&ae===V.slice(0,Math.floor(Me/2)).join(" ").repeat(2).trim())continue;let ce=!0;for(let be=1;be<_;be++)if(Nt.slice(Nt.length-Me*(be+1),Nt.length-Me*be).join(" ")!==ae){ce=!1;break}if(ce){gn=!0;break}}if(!gn){let Me=Un.toLowerCase().replace(ka,"");if(Me.length>=20)for(let _=1;_<=10;_++){let V=Math.max(5,Math.ceil(16/_));if(Me.length<_*V)continue;let ae=Me.substring(Me.length-_),ce=!0;for(let be=1;be<V;be++)if(Me.substring(Me.length-_*(be+1),Me.length-_*be)!==ae){ce=!1;break}if(ce){gn=!0;break}}}if(gn){yield{type:"status",content:"Stuttering Detected. Re-centering..."},It=!1,nn=!0,await new Promise(Me=>setTimeout(Me,3e3));break}}let he=Kt(ge),Ke=ts(he);for(;Ke.length>Ve;){yield*Mn();let W=Ke[Ve],te=Date.now(),y={Ask:"ask",AskUser:"ask",WebSearch:"web_search",WebScrape:"web_scrape",ReadFile:"view_file",ReadFolder:"read_folder",WriteFile:"write_file",PatchFile:"update_file",WritePDF:"write_pdf",WriteDoc:"write_docx",Run:"exec_command",SearchKeyword:"search_keyword",CodeSearch:"search_keyword",code_search:"search_keyword",Code_Search:"search_keyword",codesearch:"search_keyword",Memory:"memory",file_map:"file_map",FileMap:"file_map",Chat:"chat",chat:"chat",GenerateImage:"generate_image",generate_image:"generate_image",todo:"todo",Todo:"todo",goal:"todo",Goal:"todo",Invoke:"invoke",InvokeSync:"invoke_sync",getProgress:"get_progress",GetProgress:"get_progress",Await:"await",await:"await",AwaitSubagent:"await",awaitSubagent:"await",Answer:"answer",answer:"answer",AnswerSubagent:"answer",answerSubagent:"answer",Steer:"steer",steer:"steer",SteerSubagent:"steer",steerSubagent:"steer",Cancel:"cancel",cancel:"cancel",Click:"click",click:"click",Drag:"drag",drag:"drag",Scroll:"scroll",scroll:"scroll",KeyboardTyping:"keyboard_typing",keyboard_typing:"keyboard_typing",KeyPress:"key_press",key_press:"key_press",RecaptureScreen:"recapture_screen",recapture_screen:"recapture_screen",EmergencyRollback:"EmergencyRollback"}[W.toolName]||W.toolName,Fe=Gs[y]||W.toolName,ve=Nn(y,W.args);yield{type:"status",content:`${Fe}${ve?` ${ve}`:""}`};let z="";if(y==="click"){let _=Q(W.args);z=`\u2714 Clicked: ${_.intendedClickText?`${_.intendedClickText}`:""}`}else if(y==="drag"){let _=Q(W.args);z=`\u2714 Dragged: Cell ${_.fromGridId||""} \u2192 Cell ${_.toGridId||""}`}else if(y==="scroll"){let _=Q(W.args);z=`\u2714 Scrolled: ${_.direction||"down"} (${_.amount||1})`}else if(y==="keyboard_typing"){let _=Q(W.args);z=`\u2714 Typed: ${_.text?`"${_.text.length>20?_.text.substring(0,20)+"...":_.text}"`:""}`}else if(y==="key_press")z=`\u2714 Pressed Key: ${Q(W.args).key||""}`;else if(y==="recapture_screen")z="\u2714 Recaptured Screen";else if(y==="web_search"){let{query:_,limit:V=10,aiMode:ae=!1}=Q(W.args);z=`${_?"\u2714":"\u2718"} ${ae?"AI Search":"Searched"}: ${_?`${_}`:"No Search Query"}${ae===!1&&_?` \u2192 ${V}`:""}`}else if(y==="web_scrape"){let _=Q(W.args).url||null;z=`${_?"\u2714":"\u2718"} Visited: ${_||"No Source"}`}else if(y==="view_file"){let{path:_,StartLine:V,EndLine:ae,start_line:ce,end_line:be,startLine:He,endLine:Ie}=Q(W.args),Te=V||ce||He,q=ae||be||Ie,ne=parseInt(Te)||1,le=parseInt(q)||(Te?ne+800:800),Ce="...",ze=le,Re=(_||"").trim().toLowerCase().replaceAll("\\","/");if(Re.startsWith("#skill"))Re.startsWith("#skill/global/fluxflow")||Re.startsWith("#skills/global/fluxflow")?z="\u2714 Read Documentation":z=`\u2714 Read Skill: ${J.basename(_.replaceAll("\\","/"))}`;else{try{let pe=J.resolve(process.cwd(),_);if(Pe.existsSync(pe)){let ht=Pe.readFileSync(pe,"utf8").split(`
754
754
  `).length;Ce=ht,!Te&&!q&&ht>800?ze=Math.min(50,ht):ze=Math.min(le,ht)}}catch{}let Oe=(_||"").toLowerCase(),gt=Oe.endsWith(".pdf"),De=Oe.endsWith(".docx")||Oe.endsWith(".doc")||Oe.endsWith(".ppt")||Oe.endsWith(".pptx")||Oe.endsWith(".xls")||Oe.endsWith(".xlsx"),ot=/\.(png|jpg|jpeg|webp|gif|bmp)$/.test(Oe);gt||De?z=`${_.length>0?"\u2714":"\u2718"} ${_?`Analyzed: ${J.basename(_)}`:"Analyzed: File Not Found"}`:ot?z=`${_.length>0?"\u2714":"\u2718"} ${_?`Processed: ${J.basename(_)}`:"Processed: File Not Found"}`:z=`${Ce!=="..."?"\u2714":"\u2718"} Read: ${_?`${J.basename(_)} \u2192 ${Ce!=="..."?`Lines ${ne} - ${ze} of ${Ce}`:"File Not Found"}`:"File Not Found"}`}}else if(y==="list_files"||y==="read_folder"){let _=y==="list_files"?"List":"Browsed",V=Q(W.args).path||null,ae=Q(W.args).recurse||1;z=`${V?"\u2714":"\u2718"} ${_}: ${V?`${V==="."?`./${ae>1?"*":""}`:`${V.replaceAll("\\","/")}${ae>1?`${V.endsWith("/")?"*":"/*"}`:`${V.endsWith("/")?"":"/"}`}`}`:"No Folder Selected"}`}else if(y==="write_file"||y==="update_file"){let _=y==="write_file"?"Created":"Edited",V=Q(W.args).path||null;z=`${V?"\u2714":"\u2718"} ${_}: ${V.replaceAll("\\","/")||"No File Changes"}`}else if(y==="write_pdf"){let _=Q(W.args).path||null;z=`${_?"\u2714":"\u2718"} Generated: ${_.replaceAll("\\","/")||"No PDF Generated"}`}else if(y==="write_docx"){let _=Q(W.args).path||null;z=`${_?"\u2714":"\u2718"} Generated: ${_.replaceAll("\\","/")||"No Docx Generated"}`}else if(y==="file_map"){let _=Q(W.args).path;z=`${_?"\u2714":"\u2718"} Indexed: ${_.replaceAll("\\","/")?""+_:"File Not Found"}`}else if(y.toLowerCase()==="search_keyword"||y.toLowerCase()==="todo")z="";else if(y.toLowerCase()==="generate_image"){let{path:_,outputPath:V,output:ae}=Q(W.args);z=`\u2714 Generated: ${_||V||ae||"generated_image.png"}`}else if(y==="invoke_sync"||y==="InvokeSync"){let _=Nn(y,W.args);z=`\u2714 Called Generalist${_?`: ${_}`:""}`}else if(y==="Invoke"||y==="InvokeAsync"||y==="invoke"){let _=Nn(y,W.args);z=`\u2714 Started Generalist${_?`: ${_}`:""}`}else if(y==="get_progress"||y==="GetProgress"){let _=Nn(y,W.args);z=`\u2714 Checked${_?`: ${_}`:""}`}else if(y==="cancel"){let _=Nn(y,W.args);z=`\u{1F6C7} Cancelled${_?`: ${_}`:""}`}else if(y==="steer"||y==="Steer"){let _=Nn(y,W.args);z=`\u2714 Steered${_?`: ${_}`:""}`}else if(y==="EmergencyRollback"){let{method:_}=Q(W.args);z=_==="forceRevert"?"":"\u2714 Rollback Point Checked"}else if(y==="await"||y==="Await"){let{time:_,timeout:V}=Q(W.args),ae=parseFloat(V||_)||0;ae||(ae=120);let ce=Ie=>{if(Ie>=60){let Te=Math.floor(Ie/60),q=Ie%60;return`${Te}m${q>0?` ${q}s`:""}`}return`${Ie}s`},be=["Aligning Moon Phase","Contemplating Existence","Staring At Void","Delaying Professionally","Negotiating With Electrons","Touching Grass (virtually)","Panicking Softly","Rethinking Career Choices","Loading Cat Videos","Summoning Braincell #2","Pretending To Be Busy","Waiting For Motivation DLC","Rotating Internal Screaming","Downloading More RAM","Feeding The Hamsters","Gaslighting Scheduler","Performing Dramatic Pause","Buffering Social Energy","Calculating Regret","Reading Terms And Conditions","Becoming Sentient Briefly","Contacting Ancestors"];z=`\u2714 ${be[Math.floor(Math.random()*be.length)]} \u2192 ${ce(ae)}`}else y==="Answer"||y==="answer"?z="\u2714 Resolved Sub-Agent Query":y==="exec_command"||y==="ask"?z="":z=`Executed: ${W.toolName}`;if(yield*Mn(),y==="exec_command"){let{command:_}=Q(W.args);if(_&&n.systemSettings&&n.systemSettings.allowExternalAccess===!1){let V=[/[a-zA-Z]:[\\\/]/i,/^\//,/\.\.[\\\/]/,/\/etc\//,/\/var\//,/\/root\//,/\/bin\//,/\/usr\//],ae=J.resolve(process.cwd()).substring(0,3).toLowerCase(),ce=q=>{let ne=[],le="",Ce=null;for(let ze=0;ze<q.length;ze++){let Re=q[ze];Ce?(Re===Ce&&(Ce=null),le+=Re):Re==='"'||Re==="'"?(Ce=Re,le+=Re):Re==="&"&&q[ze+1]==="&"||Re==="|"&&q[ze+1]==="|"?(le.trim()&&(ne.push(le.trim()),le=""),ze++):Re===";"||Re==="|"||Re==="&"?le.trim()&&(ne.push(le.trim()),le=""):le+=Re}return le.trim()&&ne.push(le.trim()),ne},be=q=>{let ne=[],le="",Ce=null;for(let ze=0;ze<q.length;ze++){let Re=q[ze];Ce?(Re===Ce&&(Ce=null),le+=Re):Re==='"'||Re==="'"?(Ce=Re,le+=Re):/\s/.test(Re)?le&&(ne.push(le),le=""):le+=Re}return le&&ne.push(le),ne},He=q=>{let ne=q.replace(/^['"]|['"]$/g,"").trim();return!ne||process.platform==="win32"&&/^\/[a-zA-Z0-9?]+$/.test(ne)?!1:V.some(le=>{if(le.source==="[a-zA-Z]:[\\\\\\/]"){let Ce=ne.match(/[a-zA-Z]:[\\\/]/i);return Ce&&Ce[0].toLowerCase()!==ae}return le.test(ne)})};if(ce(_).some(q=>{let ne=be(q);if(ne.length===0)return!1;let le=ne[0].replace(/^['"]|['"]$/g,"").toLowerCase();if(["echo","printf","write-output"].includes(le)){let ze=!1;return ne.some(Re=>{let Wt=Re.replace(/^['"]|['"]$/g,"");if(Wt===">"||Wt===">>"||Wt==="<")return ze=!0,!1;if(Wt.startsWith(">")||Wt.startsWith("<")){let Oe=Wt.replace(/^[><]+/,"");return He(Oe)}return ze?(ze=!1,He(Re)):!1})}return ne.some(ze=>He(ze))})){let q='Access Denied. Prohibited from accessing external directories while "External Workspace Access" is disabled.';n.onExecStart&&n.onExecStart(_||"No Command"),yield{type:"exec_start"},await new Promise(ne=>setTimeout(ne,50)),n.onExecChunk&&n.onExecChunk(`ERROR: ${q}`),await new Promise(ne=>setTimeout(ne,50)),n.onExecEnd&&n.onExecEnd(),X.push({role:"user",text:`[TOOL RESULT]: ERROR: ${q}`}),yield{type:"tool_result",content:`[TOOL RESULT]: ERROR: ${q}`},Ve++;continue}}n.onExecStart&&n.onExecStart(_||"No Command"),yield{type:"exec_start"}}let sn=Q(W.args),Dn=sn.path||sn.targetPath||null;if(Dn){let _=n.systemSettings&&n.systemSettings.allowExternalAccess===!1,V=J.resolve(Dn),ae=J.resolve(process.cwd());if(_&&!V.startsWith(ae)){let ce="Access Denied. You are not allowed to access files outside the current workspace.";if(y==="write_file"||y==="update_file"){let He=`\u2718 ${y==="write_file"?"Write Canceled":"Edit Canceled"}: ${sn.path||"..."}`,Ie=115;process.stdout.isTTY&&(Ie=process.stdout.columns-5||120);let Te=Math.min(He.length+4,Ie),q=`${He.padEnd(Te-2).substring(0,Te-2)}`;yield{type:"visual_feedback",content:Vt(`${Be?`
@@ -0,0 +1,26 @@
1
+ import{a as b}from"./chunk-56EJGQU3.js";import{a as S}from"./chunk-Y5JU726N.js";var U=async(E,k={})=>{let c=S(E).id;if(!c)return'ERROR: Missing "id" argument for getProgress.';let t=b.find(s=>s.id===c);if(!t)return`ERROR: Subagent task with ID [${c}] not found.`;let n=`Subagent Task Status: ${t.status.toUpperCase()}
2
+ `;if(n+=`Title: ${t.title}
3
+ `,n+=`Task: ${t.task}
4
+ `,t.startedAt){let s=Math.floor((Date.now()-t.startedAt)/1e3);n+=`Elapsed Time: ${s}s
5
+ `}if(n+=`Turns Completed: ${t.progress.length}
6
+ `,t.status==="running"||t.status==="waiting"){t.currentTool&&(n+=`Current Tool: ${t.currentTool}
7
+ `);let r=(t.lastChunkTime?Date.now()-t.lastChunkTime:9999)<1e3&&t.wps>0?Math.round(t.wps):0;r>0&&(n+=`TPS: ${r}
8
+ `)}if(t.questions&&t.questions.length>0){let s=t.questions.filter(r=>!r.answered);s.length>0&&(n+=`
9
+ **PENDING QUESTION**
10
+ `,s.forEach(r=>{n+=`"${r.question}"
11
+ `}),n+=`Respond using tool: [tool:functions.Answer(id="${t.id}", answer="...")]
12
+
13
+ `)}return n+=`
14
+ Progress Log:
15
+ `,t.progress.forEach((s,r)=>{n+=`--- Turn ${r+1} ---
16
+ `;let R=s.filter(i=>!i.startsWith("[SUBAGENT SUCCESS]")).map(i=>{if(i.startsWith("[Subagent Response]")){let h="[Subagent Response]",e=i.substring(h.length),$="tool:functions.";for(;;){let g=e.toLowerCase().indexOf($);if(g===-1)break;let d=g,T=!1,u=g-1;for(;u>=0&&/\s/.test(e[u]);)u--;u>=0&&e[u]==="["&&(d=u,T=!0);let p=0,m=!1,o=null,a=g;for(;a<e.length;){let l=e[a];if(!o&&(l==="'"||l==='"'||l==="`")?o=l:o&&l===o&&e[a-1]!=="\\"&&(o=null),o||(l==="("?(p++,m=!0):l===")"&&p--),m&&p===0&&!o){let w=a;if(T){let f=a+1;for(;f<e.length&&/\s/.test(e[f]);)f++;f<e.length&&e[f]==="]"&&(w=f)}e=e.substring(0,d)+e.substring(w+1);break}if(a++,a===e.length){e=e.substring(0,d);break}}}return h+`
17
+ `+e.trim()}return i.startsWith("[Executing Tool]")&&i.length>256?i.substring(0,256)+"...[truncated from logs]":i});n+=R.join(`
18
+ `)+`
19
+
20
+ `}),t.status==="completed"&&t.finalAnswer?n+=`Final Answer:
21
+ ${t.finalAnswer}
22
+ `:t.status==="failed"&&t.error&&(n+=`Failure Error: ${t.error}
23
+ `),n.replace(/\r\n/g,`
24
+ `).replace(/\n{3,}/g,`
25
+
26
+ `).trim().replace(/\[TOOL RESULT\]/gi,"TOOL RESULT:")};export{U as getProgress};
@@ -1,6 +1,6 @@
1
- import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-AS3SDWCL.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],M={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
1
+ import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-6RTKBZ7C.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],M={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
2
2
  Respond using tool: [tool:functions.Answer(id="${i}", answer="...")]
3
- [/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((_,A)=>_+A.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g*10)/10}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,M,C,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")){let o=n.split(`
3
+ [/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((_,A)=>_+A.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,M,C,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")){let o=n.split(`
4
4
  `);o.length>5&&(n=o.slice(0,4).join(`
5
5
  `)+`
6
- ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-AS3SDWCL.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
6
+ ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-6RTKBZ7C.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
@@ -1,3 +1,3 @@
1
- import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-AS3SDWCL.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
- `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-AS3SDWCL.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
1
+ import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-6RTKBZ7C.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
+ `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-6RTKBZ7C.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
3
3
  `)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};