fluxflow-cli 4.16.1 → 4.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 +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-FZHHMJZI.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-JABAGBQ6.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}).