fluxflow-cli 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ai-6F3WLAXU.js → ai-6AJFPN2Z.js} +1 -1
- package/dist/chunks/{app-RDB7EBDV.js → app-AFKEWVKT.js} +25 -5
- package/dist/chunks/{auto_completion-LLOLRQTZ.js → auto_completion-5MT5LOPN.js} +1 -1
- package/dist/chunks/{chunk-63PXA3SA.js → chunk-ODFXGBVT.js} +3 -3
- package/dist/chunks/{invoke-QOBG7JPO.js → invoke-HBTZTVAB.js} +2 -2
- package/dist/chunks/{invokeSync-UZHY6U2N.js → invokeSync-XAAZL7L2.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as o,B as p,C as q,D as r,E as s,F as t,G as u,H as v,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"./chunk-
|
|
1
|
+
import{A as o,B as p,C as q,D as r,E as s,F as t,G as u,H as v,n as b,o as c,p as d,q as e,r as f,s as g,t as h,u as i,v as j,w as k,x as l,y as m,z as n}from"./chunk-ODFXGBVT.js";import"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import"./chunk-OO34QR3O.js";import"./chunk-IZBOTHQP.js";import"./chunk-VOUGMIAJ.js";import"./chunk-2RTYI6K3.js";import"./chunk-6LM3YRRE.js";import"./chunk-E3RSSW5O.js";import"./chunk-F36PAVKE.js";import"./chunk-JWB2S22X.js";import"./chunk-3XJQTYIL.js";import{l as a}from"./chunk-2Q6KKC74.js";import"./chunk-ZGORMZE5.js";import"./chunk-NPXJIGAI.js";export{c as RE_LEADING_THINK,b as convertChannelThinkTags,r as detectToolCalls,e as findGenuineThinkClose,t as generateSimpleContent,u as getAIStream,q as getActiveToolContext,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,s as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,o as maskCodeSpans,p as maskExecutedTools,n as runJanitorTask,v as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ma}from"./chunk-UEV335RW.js";import{b as fa,c as xa,d as ga}from"./chunk-FMKFTJB3.js";import{c as na,e as er,f as bo,g as ra}from"./chunk-HGHBCWE5.js";import{A as wa,C as Ta,D as ya,E as Mo,G as Ca,a as oa,b as gt,c as It,d as Sr,e as la,f as pi,g as aa,h as Ln,i as ls,j as bi,k as wi,l as as,m as ca,u as pa,w as ba}from"./chunk-
|
|
1
|
+
import{a as Ma}from"./chunk-UEV335RW.js";import{b as fa,c as xa,d as ga}from"./chunk-FMKFTJB3.js";import{c as na,e as er,f as bo,g as ra}from"./chunk-HGHBCWE5.js";import{A as wa,C as Ta,D as ya,E as Mo,G as Ca,a as oa,b as gt,c as It,d as Sr,e as la,f as pi,g as aa,h as Ln,i as ls,j as bi,k as wi,l as as,m as ca,u as pa,w as ba}from"./chunk-ODFXGBVT.js";import{a as co,b as sa,c as ia}from"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import{a as ha}from"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import{a as Yt,b as Nt,d as Rl,e as Ft,f as ea,k as xi,l as gi,m as Mr,n as hi,o as ta,p as Jo}from"./chunk-OO34QR3O.js";import"./chunk-IZBOTHQP.js";import{a as ma}from"./chunk-YX4X2ZTX.js";import{a as Br,b as Zo,c as Pn,e as cs,f as Ti,g as da,h as ua,i as Er}from"./chunk-VOUGMIAJ.js";import{a as vr}from"./chunk-2RTYI6K3.js";import{a as fn}from"./chunk-6LM3YRRE.js";import{b as mn,c as di}from"./chunk-E3RSSW5O.js";import{A as Xl,C as Gl,D as Kl,E as Vl,H as jl,c as Pl,e as ii,g as Ol,k as Nl,l as Fl,m as $l,n as Ul,o as _l,q as Hl,r as Wl,u as li,v as ai,w as ci}from"./chunk-F36PAVKE.js";import{a as ql,b as Ql,i as zl,j as ss,k as is,m as At,n as Jl,p as mi,q as fi,w as Zl}from"./chunk-JWB2S22X.js";import{a as Yl,b as ui,c as zt}from"./chunk-3XJQTYIL.js";import{d as Bl,e as si,f as El,g as kl,h as Dl,i as Al,j as Il,l as ns,n as un,o as po,p as rs,q as Cr,r as Ll}from"./chunk-2Q6KKC74.js";import{c as ts,d as vl,e as os}from"./chunk-ZGORMZE5.js";import{a as Po,b as In,c as Co,d as ni,e as ri,k as yr,y as Sl}from"./chunk-NPXJIGAI.js";import Es from"os";import pu from"crypto";import e,{useState as Z,useEffect as ut,useRef as Re,useMemo as rr}from"react";import{Box as u,Text as i,useInput as bu,useStdout as wu,Static as Tu}from"ink";import yu from"ink-spinner";import at from"fs-extra";import{minimatch as nc}from"minimatch";import wt from"path";import{exec as jo}from"child_process";import{fileURLToPath as Cu}from"url";import ro,{useState as ds,useEffect as yi,useMemo as kr,useCallback as Wc,useRef as Ro}from"react";import{Box as Xc,Text as Oo,useInput as Gc}from"ink";function Kc(t,m){return t.replace(/\t/g," ".repeat(m))}function us(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`)}function On(t,m,d){let v=t,y=[...m].sort((r,C)=>r.start-C.start),p=0;for(let r of y){let C=r.start-p,T=us(r.text).split(`
|
|
4
4
|
`).length,M=r.text.length,P=(T>3?`[Pasted ${T} lines]`:`[Pasted ${M} chars]`).length,F=C+P;if(t<=C)break;if(t<F){v=r.end;break}else{let k=r.text.length-P;v+=k,p+=k}}return Math.min(v,d.length)}function Ci(t,m,d,v,y=[]){let p=(t||"").slice(0,m),r=v(p).length,C=v(t||""),T=[...y].sort((j,H)=>H.start-j.start);for(let j of T){let H=v(t.slice(0,j.start)).length,W=v(j.text),X=H+W.length,ie=us(j.text).split(`
|
|
@@ -41,7 +41,24 @@ import{a as Ma}from"./chunk-UEV335RW.js";import{b as fa,c as xa,d as ga}from"./c
|
|
|
41
41
|
`),terminalWidth:m,theme:p}));if(T==="diff-line"){let{isFirstLine:k,isLastLine:O}=t,K=(j=!1)=>l.createElement(D,{backgroundColor:r.codeBg,paddingX:1,width:m,marginBottom:j?1:0},l.createElement(D,{width:3,flexShrink:0}),l.createElement(D,{width:1,flexShrink:0,marginLeft:1}),l.createElement(D,{flexGrow:1,marginLeft:1},l.createElement(de,null," ")));return l.createElement(D,{flexDirection:"column"},k&&K(!1),l.createElement(Ia,{line:M,pairContent:t.pairContent,parentText:void 0,columns:m,theme:p}),O&&K(!0))}if(T==="code-fence-open"){let k={paddingLeft:2,width:"100%"};return l.createElement(D,{flexDirection:"column",marginTop:0,marginBottom:0,width:"100%"},l.createElement(D,{flexDirection:"row",...k},l.createElement(de,null," ")),l.createElement(D,{flexDirection:"row",...k},l.createElement(de,{color:"gray",bold:!0},"\u25B6_ ",(M||"TEXT").toUpperCase())))}if(T==="code-line"){let{lineNum:k,lang:O}=t,K=m-12,j=(M||"").replaceAll(" "," "),W=Nt(j,Math.max(10,K)).split(`
|
|
42
42
|
`);return l.createElement(D,{flexDirection:"column",width:"100%"},W.map((X,ie)=>l.createElement(D,{key:ie,flexDirection:"row",borderColor:r.codeBorder,paddingLeft:2,width:"100%"},l.createElement(D,{width:5,flexShrink:0},l.createElement(de,{color:"gray",dimColor:!0},ie===0?String(k).padStart(4," ")+" ":" ")),l.createElement(D,{flexGrow:1},kt(X,O,r.text)))))}if(T==="code-fence-close")return l.createElement(D,{flexDirection:"row",paddingLeft:2,marginBottom:1,width:"100%"},l.createElement(de,null," "));if(T==="write-header")return l.createElement(D,{flexDirection:"column",paddingX:1,width:m},l.createElement(or,{text:M,columns:m,theme:p}));if(T==="write-line"){let{gutterWidth:k,lineNum:O,isFirstLine:K,isLastLine:j,extension:H,wrappedLines:W}=t,X=(ie=!1)=>l.createElement(D,{flexDirection:"row",width:m,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:r.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:r.codeBg,marginBottom:ie?1:0},l.createElement(D,{width:k+2,flexShrink:0},l.createElement(de,null," ".repeat(k+2))),l.createElement(D,{flexGrow:1},l.createElement(de,null," ")));return l.createElement(D,{flexDirection:"column"},K&&X(!1),l.createElement(D,{flexDirection:"row",width:m,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:r.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:r.codeBg},l.createElement(D,{width:k+2,flexShrink:0},l.createElement(de,{color:"gray",dimColor:!0},String(O).padStart(k," ")," ")),l.createElement(D,{flexGrow:1,flexDirection:"column"},(W||[M]).map((ie,ue)=>l.createElement(D,{key:ue},kt((ie||"").replaceAll(" "," "),H,r.text))))),j&&X(!0))}return T==="write-footer"?l.createElement(D,{flexDirection:"column",paddingX:1,width:m,marginTop:1,marginBottom:1},l.createElement(or,{text:M,columns:m,theme:p})):T==="worked-duration"?l.createElement(D,{marginTop:1,marginBottom:2,paddingX:1,width:"100%"},l.createElement(de,{color:r.textMuted},"["),l.createElement(de,{color:r.textMuted},"Worked for ",l.createElement(de,{bold:!0,color:r.text},xs(F))),l.createElement(de,{color:r.textMuted},"]")):null}),wm=l.memo(({messages:t,showFullThinking:m,columns:d=80,aiProvider:v,version:y,theme:p="Dark"})=>l.createElement(D,{flexDirection:"column",width:"100%"},t.map((r,C)=>l.createElement(La,{key:r.id||C,msg:r,showFullThinking:m,columns:d,aiProvider:v,version:y,theme:p}))));import $t from"react";import{Box as xn,Text as Ho}from"ink";import{useState as Ar,useEffect as Ir,useRef as hs}from"react";var Lr=null;function Pa(){Lr&&Lr()}var _d=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 d=0;d<m.length-1;d++){let v=m[d],y=m[d+1];if(t>=v.t&&t<=y.t){let p=(t-v.t)/(y.t-v.t);p=p*p*(3-2*p);let r=Math.round(v.r+(y.r-v.r)*p),C=Math.round(v.g+(y.g-v.g)*p),T=Math.round(v.b+(y.b-v.b)*p);return`#${((1<<24)+(r<<16)+(C<<8)+T).toString(16).slice(1)}`}}return"#ff0000"},Hd=$t.memo(({mode:t,thinkingLevel:m,tokens:d="0.0k",tokensTotal:v="0.0k",cachedTokens:y=0,promptTokens:p=0,chatCacheTokenLatest:r=0,cacheCalculateMode:C="Session",chatId:T="NEW-SESSION",isMemoryEnabled:M=!0,apiTier:P="Free",aiProvider:F="Google",activeModel:k="",isProcessing:O=!1,lastChunkTime:K=0,theme:j="Dark",wps:H=0,showTPMEstimate:W=!1})=>{let X=gt(j),ie="",[ue,te]=Ar(0),[_,be]=Ar(0),[Pe,Ie]=Ar("MB"),[tt,Se]=Ar("green"),[xe,Me]=Ar(0),Bt=hs([]),Xe=hs(370),Oe=hs([]),ye=hs(K);Ir(()=>{ye.current=K},[K]),Ir(()=>{if(!O){Oe.current=[];return}if(H>0){let fe=Oe.current;fe.push(H),fe.length>3&&fe.shift()}},[O,H,K]),Ir(()=>{if(!O){Me(0);return}let fe=setInterval(()=>{let we=ye.current,oe=we>0?Date.now()-we:0;if(we>0&&oe>=1e3)Oe.current=[],Me(0);else if(we>0&&oe>500){Oe.current.length>0&&Oe.current.shift();let ge=Oe.current;if(ge.length>0){let Y=ge.reduce((Ge,Fe)=>Ge+Fe,0);Me(Math.round(Y/ge.length))}else Me(0)}else{let ge=Oe.current;if(ge.length>0){let Y=ge.reduce((Ge,Fe)=>Ge+Fe,0);Me(Math.round(Y/ge.length))}else H>0&&Me(Math.round(H))}},750);return()=>clearInterval(fe)},[O]),Ir(()=>{if(!O){Bt.current=[];return}if(K>0){let oe=Bt.current;(oe.length===0||oe[oe.length-1]!==K)&&(oe.push(K),oe.length>10&&oe.shift())}let fe=()=>{if(!K){Se("#00a564");return}let oe=Bt.current,ge=0;if(oe.length>1){let rt=0;for(let Qe=1;Qe<oe.length;Qe++)rt+=oe[Qe]-oe[Qe-1];ge=rt/(oe.length-1)}let Y=Date.now()-K,Fe=Y>=2500,yt=!Fe&&ge>0?Math.min(Y,ge*3):Y,it=Math.max(ge,yt),Tt=Fe?.4:.2;Xe.current=Xe.current*(1-Tt)+it*Tt,Se(_d(Xe.current))};fe();let we=setInterval(fe,100);return()=>clearInterval(we)},[O,K]);let R=()=>{let fe=process.memoryUsage(),we=fe.heapTotal/(1024*1024)>=1024,oe=we?"GB":"MB",ge=(Y,Ge)=>{let Fe=Y/(1048576*(Ge?1024:1));return Ge?parseFloat(Fe.toFixed(2)):Math.round(Fe)};Ie(oe),be(ge(fe.heapTotal,we)),te(ge(fe.heapUsed,we))};return Ir(()=>{Lr=R,R();let fe=setInterval(()=>{R()},6e4);return()=>{clearInterval(fe),Lr===R&&(Lr=null)}},[]),$t.createElement(xn,{flexDirection:"row",justifyContent:"space-between",paddingX:1,width:"100%"},$t.createElement(xn,null,t.toLowerCase()!=="flux"&&$t.createElement(xn,{marginRight:1},$t.createElement(Ho,{color:X.textMuted},t.toLowerCase()==="flow"?"Studio":t.toLowerCase()==="icu"?"Computer Use":t.toLowerCase()==="flux"?"Workspace":"Omni")),t.toLowerCase()!=="flux"&&$t.createElement(Ho,{color:X.textMuted,dimColor:!0},"\u2503 "),$t.createElement(xn,null,$t.createElement(Ho,{color:X.text,italic:!0},ea(process.cwd(),35)))),$t.createElement(xn,null,O&&!W?$t.createElement(xn,null,$t.createElement(Ho,{color:tt},"\u25CF ")):null,O&&W&&$t.createElement($t.Fragment,null,$t.createElement(Ho,{color:X.textMuted},"~",xe," tok/s"),$t.createElement(Ho,{color:X.textMuted,dimColor:!0}," \u2503")),d>0&&$t.createElement($t.Fragment,null,$t.createElement(xn,{marginX:1},$t.createElement(Ho,{color:X.text},Ft(v)," tok",(()=>{let fe=0;if(C==="Current")fe=typeof r=="number"?r:0;else{let we=typeof p=="number"?p:0,oe=typeof y=="number"?y:0;fe=we>0?oe/we*100:0}return fe<1?null:$t.createElement(Ho,{color:X.success||"green",dimColor:!0}," [",fe.toFixed(0),"% cached]")})())),$t.createElement(Ho,{color:X.textMuted,dimColor:!0},"\u2503")),$t.createElement(xn,{marginLeft:1},$t.createElement(Ho,{color:X.textMuted,bold:!0},ue," ",Pe))))}),Oa=Hd;import ht,{useState as ps,useMemo as Wd,useEffect as Na}from"react";import{Box as io,Text as lo,useInput as Xd}from"ink";import Gd from"ink-select-input";var Kd=({label:t,isSelected:m,theme:d="Dark"})=>{let v=gt(d),y=t==="Cancel"||t==="Back"||t.toLowerCase().includes("exit")||t.toLowerCase().includes("back");return ht.createElement(io,{marginTop:y?1:0,backgroundColor:m?v.highlightBg:void 0,paddingX:1,width:"100%"},ht.createElement(lo,{color:m?v.text:v.textMuted,bold:m},m?"\u276F ":" ",t))},Vd=8;function Ht({title:t,subtitle:m,items:d=[],onSelect:v,theme:y="Dark",searchable:p=!1,maxVisible:r=Vd}){let C=gt(y),[T,M]=ps(""),[P,F]=ps(0),[k,O]=ps("list"),K=Wd(()=>{if(!p||!T.trim())return d;let ue=T.toLowerCase().trim();return d.filter(te=>te.label&&te.label.toLowerCase().includes(ue))},[d,T,p]);Na(()=>{F(0)},[T]);let[j,H]=ps(0);Na(()=>{H(ue=>K.length<=r?0:P<ue?P:P>=ue+r?P-r+1:ue)},[P,K.length,r]),Xd((ue,te)=>{if(p){if(te.upArrow){O("list"),F(_=>K.length===0?0:_>0?_-1:K.length-1);return}if(te.downArrow){O("list"),F(_=>K.length===0?0:_<K.length-1?_+1:0);return}if(te.return){K.length>0&&K[P]&&v(K[P]);return}if(te.escape){if(T)M(""),O("list"),F(0);else{let _=d.find(be=>be.value==="Back"||be.label==="Back"||be.value==="Cancel"||be.label==="Cancel");_&&v(_)}return}if(te.backspace||te.delete){O("search"),M(_=>_.slice(0,-1));return}if(ue&&!te.ctrl&&!te.meta&&!te.tab){O("search"),M(_=>_+ue);return}}},{isActive:p});let W=K.length,X=j;W<=r?X=0:X=Math.max(0,Math.min(j,W-r));let ie=K.slice(X,X+r);return p?ht.createElement(io,{flexDirection:"column",borderStyle:"round",borderColor:C.borderMuted,padding:0,marginTop:0,flexShrink:0,width:"100%"},ht.createElement(io,{paddingX:1,paddingY:0,marginBottom:0,flexDirection:"row",justifyContent:"space-between"},t?ht.createElement(lo,{color:C.text,bold:!0},typeof t=="string"?t.toUpperCase():t):ht.createElement(io,null),W>0&&ht.createElement(lo,{color:C.textMuted},P+1,"/",W)),m&&ht.createElement(io,{paddingX:1,marginBottom:0},ht.createElement(lo,{color:C.textMuted,italic:!0}," ",m)),ht.createElement(io,{paddingX:1,marginTop:1,marginBottom:1,flexDirection:"row"},ht.createElement(lo,{color:k==="search"?C.primary||"cyan":C.textMuted,bold:k==="search"},"\u{1F50D} Search:"),ht.createElement(lo,{color:C.text,bold:!0}," ",T),k==="search"?ht.createElement(lo,{color:C.primary||"cyan"},"\u2588"):T?null:ht.createElement(lo,{color:C.textMuted,italic:!0}," (type to search...)")),ht.createElement(io,{flexDirection:"column",width:"100%"},K.length===0?ht.createElement(io,{paddingX:1,marginY:0},ht.createElement(lo,{color:C.warning||"yellow",italic:!0}," No matching items found")):ie.map((ue,te)=>{let _=X+te,be=_===P,Pe=ue.label==="Cancel"||ue.label==="Back"||ue.label.toLowerCase().includes("exit")||ue.label.toLowerCase().includes("back");return ht.createElement(io,{key:ue.value??ue.label??_,marginTop:Pe?1:0,backgroundColor:be?C.highlightBg:void 0,paddingX:1,width:"100%"},ht.createElement(lo,{color:be?C.text:C.textMuted,bold:be},be?"\u276F ":" ",ue.label))})),ht.createElement(io,{paddingX:1,marginTop:1},ht.createElement(lo,{color:C.textMuted,italic:!0},k==="search"?"(Type letters to search \u2022 Arrows for list mode \u2022 Enter to select)":"(Arrows to navigate \u2022 Type letters to search \u2022 Enter to select)"))):ht.createElement(io,{flexDirection:"column",borderStyle:"round",borderColor:C.borderMuted,padding:0,marginTop:0,flexShrink:0,width:"100%"},t&&ht.createElement(io,{paddingX:1,paddingY:0,marginBottom:m?0:1,flexDirection:"row",justifyContent:"space-between"},ht.createElement(lo,{color:C.text,bold:!0},typeof t=="string"?t.toUpperCase():t),d.length>r&&ht.createElement(lo,{color:C.textMuted,italic:!0},d.length," options")),m&&ht.createElement(io,{paddingX:1,marginBottom:1},ht.createElement(lo,{color:C.textMuted,italic:!0}," ",m)),ht.createElement(io,{flexDirection:"column",width:"100%"},ht.createElement(Gd,{items:d,onSelect:v,limit:r,itemComponent:ue=>ht.createElement(Kd,{...ue,theme:y}),indicatorComponent:()=>null})),ht.createElement(io,{paddingX:1,marginTop:1},ht.createElement(lo,{color:C.textMuted,italic:!0},"(Arrows to select \u2022 Enter to confirm)")))}import I,{useState as qt,useEffect as Pr}from"react";import{Box as Ue,Text as ne,useInput as jd}from"ink";import Yd from"ink-text-input";import qd from"v8";import Fa from"os";var Wo=[...Object.keys(oa),"Mystery"],Xo=[{id:"appearance",label:"Appearance",desc:"Customize UI theme & rendering options"},{id:"memory",label:"Personalization",desc:"Manage system context & agent's memory"},{id:"secondaryModels",label:"Secondary Models",desc:"Sub-agents & auto-completion models"},{id:"other",label:"Miscellaneous",desc:"Miscellaneous preferences"},{id:"providers",label:"Providers",desc:"Configure AI models"},{id:"security",label:"Security",desc:"Configure permissions & data safety"},{id:"updater",label:"Updater",desc:"Manage application updates"},{id:"exit",label:"Exit Settings",desc:"Return to chat view"}],$a=t=>{let m=t.autoApproveCommands||"",d=t.autoDisallowCommands||"",v=t.alwaysAskCommands||"",y=t.autoExec===!1&&t.allowExternalAccess===!1&&t.networkAccess===!1&&m===""&&d==="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c"&&v==="killall, pkill, taskkill, shutdown, reboot, init 0, init 6, Stop-Process, Stop-Service, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, netsh advfirewall, iptables -F, ufw disable, git reset --hard, git clean -fd, npm r, npm uninstall"&&t.autoApproveGit===!1&&t.overwriteProtection!==!1,p=t.autoExec===!0&&t.allowExternalAccess===!1&&t.networkAccess!==!1&&m==="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time, mkdir"&&d==="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c"&&v==="killall, pkill, taskkill, Stop-Process, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, shutdown, reboot, init 0, init 6, git reset --hard, git clean -fd, npm r, npm uninstall"&&t.autoApproveGit===!1&&t.overwriteProtection!==!1,r=t.autoExec===!0&&t.allowExternalAccess===!0&&t.networkAccess!==!1&&m==="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time, mkdir"&&d===""&&v==="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c"&&t.autoApproveGit===!0&&t.overwriteProtection===!1;return y?"Strict":p?"Balanced":r?"Autonomous":t.sandboxPreset||"Custom"},Or=t=>!t||t.trim()===""?"None":t.length>40?t.substring(0,40)+"...":t;function bs({systemSettings:t,setSystemSettings:m,apiTier:d,setActiveView:v,setInputConfig:y,saveSettings:p,quotas:r,setMessages:C,aiProvider:T,autoCompletion:M,setAutoCompletion:P,profileData:F,setProfileData:k,initialSelectingTheme:O=!1,onCloseTheme:K=null,setProviderReturnView:j=null,setApiKey:H=null,initAI:W=null}){let X=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",ie=Wo.indexOf(X),[ue,te]=qt("categories"),[_,be]=qt(0),[Pe,Ie]=qt(0),[tt,Se]=qt("Sandbox"),[xe,Me]=qt(null),[Bt,Xe]=qt(""),[Oe,ye]=qt(O),[R,fe]=qt(ie>=0?ie:0),[we,oe]=qt(t.theme||"Dark"),[ge,Y]=qt(!1),[Ge,Fe]=qt("subAgent"),[yt,it]=qt(0),[Tt,rt]=qt(0),[Qe,ce]=qt(""),[Ee,mt]=qt("list"),[ft,He]=qt({});Pr(()=>{(async()=>{let w=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","Infron","Numes","APInex","xKiro","CoArena","c_openai"],A={};for(let Te of w)try{await mn(Te,{silent:!0})&&(A[Te]=!0)}catch{}He(A)})()},[]);let Dt=I.useMemo(()=>{let ae=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","Infron","Numes","APInex","xKiro","CoArena","c_openai"],A=!!(process.env.SUBAGENT_MODEL&&process.env.SUBAGENT_MODEL.trim())?`ENV (${process.env.SUBAGENT_MODEL.trim()})`:"ENV",Te=[{label:"Default (use the current model)",value:"Default",isHeader:!1},{label:A,value:"ENV",isHeader:!1}],Le=r?.providerTiers?.[T]||d||"Free",nt=un(T,Le,t?.customOpenAIBaseUrl)||[];nt.length>0&&(Te.push({label:`\u2500\u2500 ${T.toUpperCase()}${Le!=="Free"?` (${Le})`:""} \u2500\u2500`,isHeader:!0}),nt.forEach(ct=>{let ze=typeof ct=="string"?ct:ct.cmd||ct.name||ct.id||String(ct);ze&&!ze.trim().startsWith("---")&&!ze.startsWith(`
|
|
43
43
|
---`)&&Te.push({label:ze,value:ze,isHeader:!1,provider:T})}));for(let ct of ae)if(ct!==T&&ft[ct]){let ze=r?.providerTiers?.[ct]||"Free",mo=un(ct,ze)||[];mo.length>0&&(Te.push({label:`\u2500\u2500 ${ct.toUpperCase()}${ze!=="Free"?` (${ze})`:""} \u2500\u2500`,isHeader:!0}),mo.forEach(Je=>{let Ut=typeof Je=="string"?Je:Je.cmd||Je.name||Je.id||String(Je);Ut&&!Ut.trim().startsWith("---")&&!Ut.startsWith(`
|
|
44
|
-
---`)&&Te.push({label:Ut,value:Ut,isHeader:!1,provider:ct})}))}return Te},[T,d,r,ft]),je=I.useMemo(()=>{if(!Qe.trim())return Dt;let ae=Qe.trim().toLowerCase(),w=[],A=null;for(let Te of Dt)Te.isHeader?A=Te:(Te.label.toLowerCase().includes(ae)||Te.value&&Te.value.toLowerCase().includes(ae))&&(A&&!w.includes(A)&&w.push(A),w.push(Te));return w},[Dt,Qe]);Pr(()=>{if(ge){let ae=je.findIndex(w=>!w.isHeader);it(ae>=0?ae:0),rt(0)}},[Qe]),Pr(()=>{if(ge){if(je.length===0){it(0),rt(0);return}if(yt>=je.length||je[yt]?.isHeader){let ae=je.findIndex(w=>!w.isHeader);it(ae>=0?ae:0)}}},[je,ge]);let[wo,$]=qt(0),[rn,lr]=qt(0),[Ur,Tn]=qt("MB"),[_r,yn]=qt(!1);Pr(()=>{let ae=!1;return import("./exec_command-E3D5BY3N.js").then(w=>{ae||yn(!!w.isPtyAvailable)}).catch(()=>{}),()=>{ae=!0}},[]),Pr(()=>{let ae=qd.getHeapStatistics().heap_size_limit,w=ae>=1024*1024*1024,A=w?"GB":"MB",Te=w?1024*1024*1024:1024*1024;lr(parseFloat((ae/Te).toFixed(2))),Tn(A);let Le=()=>{let mo=process.memoryUsage().rss/Te,Je=w?parseFloat(mo.toFixed(2)):Math.round(mo);$(Je)};Le();let nt=setInterval(()=>{Le()},3e4);return()=>clearInterval(nt)},[]);let ks=ae=>{switch(ae){case"providers":{let w=[{label:"Current Provider",value:"aiProvider",status:T==="c_openai"?"Custom (OpenAI)":T}];return T==="Ollama"&&w.push({label:"Endpoint",value:"ollamaEndpoint",status:t.ollamaEndpoint||"Cloud"}),(T==="c_openai"||T==="Custom (OpenAI)")&&(w.push({label:"Base URL",value:"customOpenAIBaseUrl",status:t.customOpenAIBaseUrl||"Not Configured"}),w.push({label:"API Key (if needed)",value:"customOpenAIKey",status:ft.c_openai?"Set":"None"})),w}case"appearance":return[{label:"Theme",value:"theme",status:t.theme||"Dark"},{label:"Loading Phrases",value:"loadingPhrases",status:t.loadingPhrases!==!1?"ON":"OFF"},{label:"Progressive Rendering [EXPERIMENTAL]",value:"progressiveRendering",status:t.progressiveRendering?"ON":"OFF"},{label:"Show TPM Estimate",value:"showTPMEstimate",status:t.showTPMEstimate?"ON":"OFF"},{label:"Verbose Thinking",value:"preserveThinking",status:t.preserveThinking!==!1?"ON":"OFF"}];case"memory":return[{label:"Base Personality",value:"profilePreset",status:F?.preset||"Default"},{label:"Nickname",value:"profileNickname",status:F?.nickname||"None"},{label:"Custom Instructions",value:"profileInstructions",status:Or(F?.instructions)}];case"security":return[{label:"Sandbox Preset",value:"sandboxPreset",status:$a(t),section:"Sandbox"},{label:"YOLO Mode",value:"autoExec",status:t.autoExec?"ON":"OFF",section:"Sandbox"},{label:"External Workspace Access",value:"externalAccess",status:t.allowExternalAccess?"ON":"OFF",section:"Sandbox"},{label:"Network Access (Terminal)",value:"networkAccess",status:t.networkAccess!==!1?"ON":"OFF",section:"Sandbox"},{label:"Always Ask Commands",value:"alwaysAsk",status:Or(t.alwaysAskCommands),section:"Sandbox"},{label:"Always Ask Files/Paths",value:"alwaysAskFiles",status:Or(t.alwaysAskFiles||".env, .env.*, *.env"),section:"Sandbox"},{label:"Auto Approve Commands",value:"autoApprove",status:Or(t.autoApproveCommands),section:"Sandbox"},{label:"Auto Disapprove Commands",value:"autoDisallow",status:Or(t.autoDisallowCommands),section:"Sandbox"},{label:"Auto Approve Git Commits",value:"autoApproveGit",status:t.autoApproveGit?"ON":"OFF",section:"Sandbox"},{label:"Overwrite Protection",value:"overwriteProtection",status:t.overwriteProtection!==!1?"ON":"OFF",section:"Sandbox"},{label:"Advanced Recovery [EXPERIMENTAL]",value:"advanceRollback",status:t.advanceRollback?"ON":"OFF",section:"Other"},{label:"Auto-Delete History",value:"autoDelete",status:t.autoDeleteHistory||"30d",section:"Other"},{label:"Save AppData Externally",value:"externalData",status:t.useExternalData?"ON":"OFF",section:"Other"},{label:"Agent Clipboard Context",value:"clipboardContext",status:t.clipboardContext?"ON":"OFF",section:"Other"},{label:"Loop Limits",value:"loopLimits",status:t.loopLimits||"Default",section:"Other"}].filter(Te=>Te.section.toLowerCase()===tt.toLowerCase());case"updater":return[{label:"Auto-Update",value:"autoUpdate",status:t.autoUpdate?"ON":"OFF"},{label:"Preferred Package Manager",value:"updateManager",status:(t.updateManager||"npm")==="custom"?"Custom":(t.updateManager||"npm").toUpperCase()}];case"secondaryModels":return[{label:"Sub-Agents",value:"subAgents",status:t.subAgents!==!1?"ON":"OFF"},{label:"SubAgent Wildcard Tooling",value:"subAgentWildcardTooling",status:t.subAgentWildcardTooling?"ON":"OFF"},{label:"Sub-Agent Model",value:"subAgentModel",status:t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default"},{label:"Enable Auto-Completion",value:"autoCompletionEnabled",status:M?.enabled?"ON":"OFF"},{label:"Auto-Completion Model",value:"autoCompletionModel",status:M?.model&&M.model!=="Default"?M.model:"Default"},{label:"Commit Message Model",value:"commitMessageModel",status:t.commitMessageModel&&t.commitMessageModel!=="Default"?t.commitMessageModel:"Default"}];case"other":return[{label:"Directory Tree Design",value:"indentationTree",status:t.indentationTree!==!1?"Modern":"Legacy"},{label:"Compact Large Tool Results",value:"compressToolResults",status:t.compressToolResults?"ON":"OFF"},{label:"Auto Truncate Results",value:"autoTruncateResults",status:t.autoTruncateResults?"ON":"OFF"},{label:"Agent Finish Notification",value:"agentFinishSound",status:t.agentFinishSound?"ON":"OFF"},{label:"Image History for CU",value:"imageHistoryCU",status:t.imageHistoryCU||"Standard"},{label:"Context Length",value:"contextLength",status:t.contextLength||"256k"},{label:"Keep Reasoning Context",value:"keepReasoningContext",status:t.keepReasoningContext?"ON":"OFF"},{label:"Auto Exclude Metadata",value:"autoExcludeMetadata",status:t.autoExcludeMetadata?"ON":"OFF"},{label:"Disable Todo",value:"disableTodo",status:t.disableTodo?"ON":"OFF"},...process.platform==="win32"?[{label:"Prefer Bash",value:"preferBash",status:t.preferBash!==!1?"ON":"OFF"}]:[],{label:"Cache Calculate Mode",value:"cacheCalculateMode",status:t.cacheCalculateMode||"Session"}];default:return[]}},Ke=Xo[_].id,Qt=ks(Ke);jd((ae,w)=>{if(ge){if(w.tab){mt(A=>A==="search"?"list":"search");return}if(Ee==="search"){w.escape?Y(!1):w.downArrow||w.return?mt("list"):w.backspace||w.delete?ce(A=>A.slice(0,-1)):ae&&!w.ctrl&&!w.meta&&ae.length===1&&ce(A=>A+ae);return}if(w.upArrow)it(A=>{if(je.length===0)return 0;let Te=(A-1+je.length)%je.length,Le=0;for(;je[Te]?.isHeader&&Le<je.length;)Te=(Te-1+je.length)%je.length,Le++;return Te});else if(w.downArrow)it(A=>{if(je.length===0)return 0;let Te=(A+1)%je.length,Le=0;for(;je[Te]?.isHeader&&Le<je.length;)Te=(Te+1)%je.length,Le++;return Te});else if(w.return){let A=je[yt];if(A&&!A.isHeader){let Te=A.value==="Default";Ge==="autoCompletion"?P(Le=>{let nt=Te?"":A.provider||"",ct={...Le,model:A.value,provider:nt,baseUrl:Te?"":Yl[nt]||""};return p({autoCompletion:ct,apiTier:d,quotas:r}),ct}):m(Ge==="commitMessage"?Le=>{let nt={...Le,commitMessageModel:Te?"Default":A.value,commitMessageProvider:Te?"":A.provider||""};return p({systemSettings:nt,apiTier:d,quotas:r}),nt}:Le=>{let nt={...Le,CustomSubAgent:!Te,SubAgentModel:A.value,SubAgentProvider:Te?"":A.provider||""};return p({systemSettings:nt,apiTier:d,quotas:r}),nt}),Y(!1)}}else w.escape?Y(!1):ae&&!w.ctrl&&!w.meta&&ae.length===1&&(ce(A=>A+ae),mt("search"));return}if(Oe){if(w.upArrow){let A=(R-1+Wo.length)%Wo.length;fe(A)}else if(w.downArrow){let A=(R+1)%Wo.length;fe(A)}else if(w.return){let A=Wo[R];m(Te=>{let Le={...Te,theme:A};return p({systemSettings:Le,apiTier:d,quotas:r}),Le}),K?K():ye(!1)}else w.escape&&(K?K():ye(!1));return}if(xe){w.escape&&Me(null);return}if(ue==="categories")w.upArrow?be(A=>(A-1+Xo.length)%Xo.length):w.downArrow?be(A=>(A+1)%Xo.length):w.return||w.rightArrow?Xo[_].id==="exit"?v("chat"):(te("items"),Ie(0)):w.escape&&v("chat");else if(ue==="items"){if(Ke==="security"&&(w.tab||ae===" ")){Se(A=>A==="Sandbox"?"Other":"Sandbox"),Ie(0);return}if(w.upArrow)Ie(A=>(A-1+Qt.length)%Qt.length);else if(w.downArrow)Ie(A=>(A+1)%Qt.length);else if(w.leftArrow)Ke==="security"&&tt==="Other"?(Se("Sandbox"),Ie(0)):te("categories");else if(w.rightArrow&&Ke==="security"&&tt==="Sandbox")Se("Other"),Ie(0);else if(w.escape)te("categories");else if(w.return){let A=Qt[Pe];Hr(A)}}});let Hr=ae=>{if(ae.value==="profilePreset"){let w=["Default","Sassy","Friendly","Playful","Efficient","Professional"],A=F?.preset||"Default",Le=(w.indexOf(A)+1)%w.length,nt=w[Le>=0?Le:0],ct={...F||{},preset:nt};k&&k(ct),p({profileData:ct,systemSettings:t,apiTier:d,quotas:r})}else if(ae.value==="profileNickname")Me("profileNickname"),Xe(F?.nickname||"");else if(ae.value==="profileInstructions")Me("profileInstructions"),Xe(F?.instructions||"");else if(ae.value==="memory")m(w=>({...w,memory:!w.memory}));else if(ae.value==="sandboxPreset"){let w=$a(t),A=["Autonomous","Balanced","Strict"],Le=(A.indexOf(w)+1)%A.length,nt=A[Le];m(ct=>{let ze={...ct,sandboxPreset:nt};return nt==="Strict"?(ze.autoExec=!1,ze.allowExternalAccess=!1,ze.networkAccess=!1,ze.autoApproveCommands="",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, shutdown, reboot, init 0, init 6, Stop-Process, Stop-Service, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, netsh advfirewall, iptables -F, ufw disable, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1,ze.overwriteProtection=!0):nt==="Balanced"?(ze.autoExec=!0,ze.allowExternalAccess=!1,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, Stop-Process, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, shutdown, reboot, init 0, init 6, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1,ze.overwriteProtection=!0):nt==="Autonomous"&&(ze.autoExec=!0,ze.allowExternalAccess=!0,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="",ze.alwaysAskCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.autoApproveGit=!0,ze.overwriteProtection=!1),ze})}else if(ae.value==="autoExec")t.autoExec?m(w=>({...w,autoExec:!1,sandboxPreset:"Custom"})):t.allowExternalAccess?v("doubleDanger"):v("autoExecDanger");else if(ae.value==="externalAccess")t.allowExternalAccess?m(w=>({...w,allowExternalAccess:!1,sandboxPreset:"Custom"})):t.autoExec?v("doubleDanger"):v("externalDanger");else if(ae.value==="networkAccess")m(w=>({...w,networkAccess:w.networkAccess===!1,sandboxPreset:"Custom"}));else if(ae.value==="alwaysAsk")Me("alwaysAskCommands"),Xe(t.alwaysAskCommands||"");else if(ae.value==="alwaysAskFiles")Me("alwaysAskFiles"),Xe(t.alwaysAskFiles||".env, .env.*, *.env");else if(ae.value==="autoApprove")Me("autoApproveCommands"),Xe(t.autoApproveCommands||"");else if(ae.value==="autoDisallow")Me("autoDisallowCommands"),Xe(t.autoDisallowCommands||"");else if(ae.value==="autoApproveGit")m(w=>({...w,autoApproveGit:!w.autoApproveGit,sandboxPreset:"Custom"}));else if(ae.value==="overwriteProtection")m(w=>({...w,overwriteProtection:w.overwriteProtection===!1,sandboxPreset:"Custom"}));else if(ae.value==="customOpenAIBaseUrl")Me("customOpenAIBaseUrl"),Xe(t.customOpenAIBaseUrl||"");else if(ae.value==="customOpenAIKey")Me("customOpenAIKey"),Xe("");else if(ae.value==="ollamaEndpoint")m(w=>{let A=w.ollamaEndpoint==="Local"?"Cloud":"Local",Te={...w,ollamaEndpoint:A};return p({systemSettings:Te,apiTier:d,quotas:r}),Te});else if(ae.value==="apiTier")v("apiTier");else if(ae.value==="aiProvider")j&&j("settings"),v("selectProvider");else if(ae.value==="advanceRollback")t.advanceRollback?m(w=>{let A={...w,advanceRollback:!1};return p({systemSettings:A,apiTier:d,quotas:r}),A}):v("advanceRollbackDanger");else if(ae.value==="autoDelete"){let w=["1d","7d","30d"],Te=(w.indexOf(t.autoDeleteHistory||"30d")+1)%w.length;m(Le=>({...Le,autoDeleteHistory:w[Te]}))}else if(ae.value==="autoUpdate")m(w=>({...w,autoUpdate:!w.autoUpdate}));else if(ae.value==="externalData")if(!t.useExternalData)y({label:"Enter absolute path for External AppData:",note:"All history, logs and secrets will be stored here. ~/.fluxflow/settings.json stays as anchor.",key:"externalDataPath",value:t.externalDataPath||""}),v("input");else{let w={...t,useExternalData:!1};m(w),p({systemSettings:w,apiTier:d,quotas:r}),C(A=>[...A,{id:Date.now(),role:"system",text:"[STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart."}]),v("chat")}else if(ae.value==="updateManager")v("updateManager");else if(ae.value==="parserDownload")v("parserDownload");else if(ae.value==="indentationTree")m(w=>{let A={...w,indentationTree:w.indentationTree===!1};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="compressToolResults")m(w=>{let A={...w,compressToolResults:!w.compressToolResults};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="autoTruncateResults")m(w=>{let A={...w,autoTruncateResults:!w.autoTruncateResults};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="agentFinishSound")m(w=>{let A={...w,agentFinishSound:!w.agentFinishSound};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="loopLimits"){let w=["Default","Extended","ENV"],Te=(w.indexOf(t.loopLimits||"Default")+1)%w.length;m(Le=>{let nt={...Le,loopLimits:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="imageHistoryCU"){let w=["Low","Standard","Extended","Max"],Te=(w.indexOf(t.imageHistoryCU||"Standard")+1)%w.length;m(Le=>{let nt={...Le,imageHistoryCU:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="contextLength"){let w=["16k","32k","64k","128k","256k","512k","1M"],Te=(w.indexOf(t.contextLength||"256k")+1)%w.length;m(Le=>{let nt={...Le,contextLength:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="keepReasoningContext")m(w=>{let A={...w,keepReasoningContext:!w.keepReasoningContext};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="autoExcludeMetadata")m(w=>{let A={...w,autoExcludeMetadata:!w.autoExcludeMetadata};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="disableTodo")m(w=>{let A={...w,disableTodo:!w.disableTodo};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="preferBash")m(w=>{let A=w.preferBash!==!1,Te={...w,preferBash:!A};return p({systemSettings:Te,apiTier:d,quotas:r}),Te});else if(ae.value==="cacheCalculateMode"){let w=["Session","Current"],Te=(w.indexOf(t.cacheCalculateMode||"Session")+1)%w.length;m(Le=>{let nt={...Le,cacheCalculateMode:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="subAgents")m(w=>{let A={...w,subAgents:w.subAgents===!1};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="subAgentWildcardTooling")m(w=>{let A={...w,subAgentWildcardTooling:!w.subAgentWildcardTooling};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="subAgentModel"){let w=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",A=je.findIndex(Te=>Te.value===w);it(A>=0?A:0),Fe("subAgent"),Y(!0)}else if(ae.value==="autoCompletionEnabled")P(w=>{let A={...w,enabled:!w.enabled};return p({autoCompletion:A,apiTier:d,quotas:r}),A});else if(ae.value==="clipboardContext")m(w=>{let A={...w,clipboardContext:!w.clipboardContext};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="autoCompletionModel"){let w=M?.model||"Default",A=je.findIndex(Te=>Te.value===w);it(A>=0?A:0),Fe("autoCompletion"),Y(!0)}else if(ae.value==="commitMessageModel"){let w=t.commitMessageModel||"Default",A=je.findIndex(Te=>Te.value===w);it(A>=0?A:0),Fe("commitMessage"),Y(!0)}else if(ae.value==="preserveThinking")m(w=>{let A={...w,preserveThinking:w.preserveThinking===!1};return ka(A.preserveThinking),p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="loadingPhrases")m(w=>{let A={...w,loadingPhrases:w.loadingPhrases===!1};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="progressiveRendering")m(w=>{let A={...w,progressiveRendering:!w.progressiveRendering};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="showTPMEstimate")m(w=>{let A={...w,showTPMEstimate:!w.showTPMEstimate};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="theme"){let w=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",A=Wo.indexOf(w);fe(A>=0?A:0),oe(t.theme||"Dark"),ye(!0)}},Be=gt(t.theme);if(ge){let ae=Ge==="autoCompletion"?M?.model||"Default":Ge==="commitMessage"?t.commitMessageModel||"Default":t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",w=15,A=Tt;yt<A?A=yt:yt>=A+w&&(A=yt-w+1),A=Math.max(0,Math.min(A,Math.max(0,je.length-w))),A!==Tt&&rt(A);let Te=je.slice(A,A+w);return I.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:1,width:"100%",minHeight:32},I.createElement(Ue,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:Be.text,bold:!0,underline:!0},Ge==="autoCompletion"?"Select Auto-Completion Model:":Ge==="commitMessage"?"Select Commit Message Model:":"Select Sub-Agent Model:"),je.length>0&&I.createElement(ne,{color:"gray"},yt+1,"/",je.length)),I.createElement(Ue,{borderStyle:"single",borderColor:Ee==="search"?Be.primary||"cyan":"gray",paddingX:1,marginBottom:1},I.createElement(ne,{color:Ee==="search"?Be.primary||"cyan":"gray",bold:!0},"\u{1F50D} Search: "," "),I.createElement(ne,{color:Be.text},Qe),Ee==="search"&&I.createElement(ne,{color:Be.primary||"cyan"},"\u2588"),!Qe&&Ee!=="search"&&I.createElement(ne,{color:"gray",italic:!0},"(Press TAB or type to filter models...)")),I.createElement(Ue,{flexDirection:"column",flexGrow:1,height:w},Te.length>0?Te.map((Le,nt)=>{let ct=A+nt;if(Le.isHeader)return I.createElement(Ue,{key:`hdr-${ct}`,paddingX:1},I.createElement(ne,{color:"gray",bold:!0,underline:!0},Le.label));let ze=yt===ct&&Ee==="list",mo=ae===Le.value;return I.createElement(Ue,{key:`item-${Le.value}-${ct}`,paddingX:1,backgroundColor:ze?Be.highlightBg:void 0},I.createElement(ne,{color:ze?Be.text:Be.textDim,bold:ze},ze?"\u276F ":" ",Le.label,mo?I.createElement(ne,{color:Be.primary||"cyan",italic:!0}," (active)"):""))}):I.createElement(Ue,{paddingX:1},I.createElement(ne,{color:"gray",italic:!0},'No models matching "',Qe,'"'))),I.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:"gray",italic:!0},"TAB to switch search/list \u2022 \u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),I.createElement(ne,{color:Ee==="search"?Be.primary||"cyan":"gray",bold:!0},"[",Ee.toUpperCase()," MODE]")))}if(Oe){let ae=Wo[R],w=gt(ae);return I.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:w.border,padding:1,width:"100%",minHeight:32},I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:w.text,bold:!0},"Choose your color scheme:")),I.createElement(Ue,{flexDirection:"row",width:"100%",flexGrow:1},I.createElement(Ue,{flexDirection:"column",width:"30%",paddingRight:1},Wo.map((A,Te)=>{let Le=R===Te,nt=(t.theme||"Dark")===A,ct=A==="Forest Sprite"||A==="Spookfest";return I.createElement(Ue,{key:A,paddingX:0},I.createElement(ne,{color:Le?w.text:w.textDim,bold:Le},Le?"> ":" ",A,ct&&I.createElement(ne,{color:Le?w.success||"#52b788":"green",bold:!0}," \u2605"),nt?I.createElement(ne,{color:w.primary||"cyan",italic:!0}," (saved)"):""))})),I.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:w.borderMuted,paddingX:2,paddingY:1,backgroundColor:w.cardBg},I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:w.secondary||"cyan",bold:!0},"> ","you: "),I.createElement(ne,{color:w.text},"add a greeting function")),I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:w.success||"green"}," Here's the change:")),I.createElement(Ue,{flexDirection:"column",marginLeft:2,marginBottom:1},I.createElement(ne,null,I.createElement(ne,{color:w.textDim},"3 "),kt(' import "fmt"',".go",void 0)),I.createElement(ne,{color:w.textDim},"4"),I.createElement(Ue,{backgroundColor:w.diffRemovalBg},I.createElement(ne,null,I.createElement(ne,{color:w.diffRemovalNum||w.diffRemovalText},"5 "),I.createElement(ne,{color:w.diffRemovalPrefix||w.diffRemovalText},"- "),kt("func ",".go",void 0),kt("main()",".go",void 0,w.diffRemovalHighlightBg),kt(" {",".go",void 0))),I.createElement(Ue,{backgroundColor:w.diffAdditionBg},I.createElement(ne,null,I.createElement(ne,{color:w.diffAdditionNum||w.diffAdditionText},"5 "),I.createElement(ne,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),kt("func ",".go",void 0),kt("greet(name string)",".go",void 0,w.diffAdditionHighlightBg),kt(" {",".go",void 0))),I.createElement(Ue,{backgroundColor:w.diffAdditionBg},I.createElement(ne,null,I.createElement(ne,{color:w.diffAdditionNum||w.diffAdditionText},"6 "),I.createElement(ne,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),I.createElement(ne,null," "),kt('fmt.Printf("Hello, %s!\\n", name)',".go",void 0,w.diffAdditionHighlightBg))),I.createElement(ne,null,"7 }")),I.createElement(Ue,{flexDirection:"column",marginTop:1,marginBottom:1},I.createElement(ne,{color:w.textDim},"\u25BE Thought Process"),I.createElement(ne,{color:w.textMuted}," I need to add a greeting function. I'll use fmt.Printf.")),I.createElement(Ue,{flexDirection:"column"},I.createElement(ne,null,I.createElement(ne,{color:w.warning||"yellow"},"\u2699 tool: "),I.createElement(ne,{color:w.text},"write_file main.go")),I.createElement(ne,null,I.createElement(ne,{color:w.accent||"magenta"},"\u29BF task: "),I.createElement(ne,{color:w.text},"Implementing greeting")),I.createElement(ne,null,I.createElement(ne,{color:w.danger||"red"},"X error: "),I.createElement(ne,{color:w.text},"compilation failed")),I.createElement(ne,null,I.createElement(ne,{color:w.warning||"yellow"},"\u26A0 warning: "),I.createElement(ne,{color:w.text},"deprecation warning")),I.createElement(ne,null,I.createElement(ne,{color:w.info||"blue"},"\u2192 link: "),I.createElement(ne,{color:w.info||"blue",underline:!0},"file:///path/to/main.go")),I.createElement(ne,null,I.createElement(ne,{color:w.accent||"magenta"},"\u2605 accent: "),I.createElement(ne,{color:w.text},"highlighted text")),I.createElement(ne,{color:w.textDim},"\xB7 dim: press Enter to continue")))),I.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:"gray",italic:!0},"\u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),I.createElement(ne,{color:"gray"},"Previewing: ",Wo[R],Wo[R]==="Forest Sprite"?" \u2605":"")))}return I.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:0,width:"100%",minHeight:26},I.createElement(Ue,{paddingX:1,paddingY:0,marginBottom:0,borderStyle:"single",borderColor:Be.borderMuted,width:"100%"},I.createElement(ne,{color:Be.text,bold:!0},"SYSTEM CONFIGURATION")),I.createElement(Ue,{flexDirection:"row",width:"100%",minHeight:20},I.createElement(Ue,{flexDirection:"column",width:"30%",maxWidth:40,borderStyle:"round",borderColor:ue==="categories"?Be.border:Be.borderMuted,padding:1,paddingY:0},I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:ue==="categories"?Be.text:Be.textDim,bold:!0,underline:!0},"CATEGORIES")),Xo.map((ae,w)=>{let A=_===w,Te=ae.id==="exit";return I.createElement(Ue,{key:ae.id,marginTop:Te?9:0,backgroundColor:A?ue==="categories"?Be.highlightBg:Be.cardBg:void 0,paddingX:1},I.createElement(ne,{color:A&&ue==="categories"?Be.text:Be.textDim,bold:A},A?"\u276F ":" ",ae.label))})),I.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:ue==="items"?Be.border:Be.borderMuted,paddingX:1,marginLeft:1,paddingY:0},I.createElement(Ue,{marginBottom:1,flexDirection:"row",justifyContent:"space-between",alignItems:"center"},I.createElement(ne,{color:ue==="items"?Be.text:Be.textDim,bold:!0,underline:!0},Xo[_].label.toUpperCase().includes("EXIT")?"Runtime Information":`${Xo[_].label} Settings`),Ke==="security"&&I.createElement(Ue,{flexDirection:"row"},I.createElement(Ue,{paddingX:1,backgroundColor:tt==="Sandbox"?ue==="items"?Be.highlightBg:Be.cardBg:void 0},I.createElement(ne,{bold:tt==="Sandbox",color:tt==="Sandbox"?Be.primary||"cyan":Be.textDim},"[ Sandbox ]")),I.createElement(Ue,{paddingX:1,backgroundColor:tt==="Other"?ue==="items"?Be.highlightBg:Be.cardBg:void 0},I.createElement(ne,{bold:tt==="Other",color:tt==="Other"?Be.primary||"cyan":Be.textDim},"[ Others ]")))),Qt.length>0?(()=>{let ae=null,w=[],A=Je=>(Je||"").split(",").map(Ut=>Ut.trim().toLowerCase()).filter(Boolean),Te=A(t.autoApproveCommands),Le=A(t.autoDisallowCommands),nt=A(t.alwaysAskCommands),ct=[...Te,...Le,...nt],ze=new Set(ct),mo=Ke==="security"&&ct.length!==ze.size;return Qt.forEach((Je,Ut)=>{let Cn=ue==="items"&&Pe===Ut,Mn=Je.label.length,Ds=Math.max(2,38-Mn),Et=".".repeat(Ds),le=ot=>Ke==="security"?(ot.value==="autoExec"||ot.value==="externalAccess")&&ot.status==="ON"?Be.statusOn:Be.statusOff:ot.status?.startsWith("\u2713")?Be.statusOn:ot.status?.startsWith("\u26A0")?Be.statusOff:ot.status==="ON"?Be.statusOn:ot.status==="OFF"?Be.statusOff:Be.text;Je.section&&Je.section!==ae&&Ke!=="security"&&(ae=Je.section,w.push(I.createElement(Ue,{key:`sec-hdr-${Je.section}`,marginTop:w.length>0?1:0,marginBottom:0,paddingX:1},I.createElement(ne,{color:"gray",bold:!0,underline:!0},Je.section.toUpperCase()))));let Nn=Cn&&xe&&(xe==="alwaysAskCommands"&&Je.value==="alwaysAsk"||xe==="alwaysAskFiles"&&Je.value==="alwaysAskFiles"||xe==="autoApproveCommands"&&Je.value==="autoApprove"||xe==="autoDisallowCommands"&&Je.value==="autoDisallow"||xe==="customOpenAIBaseUrl"&&Je.value==="customOpenAIBaseUrl"||xe==="customOpenAIKey"&&Je.value==="customOpenAIKey"||xe==="profileNickname"&&Je.value==="profileNickname"||xe==="profileInstructions"&&Je.value==="profileInstructions"),Wr=Je.value==="alwaysAsk"||Je.value==="alwaysAskFiles"||Je.value==="autoApprove"||Je.value==="autoDisallow"||Je.value==="profileInstructions",Xr=Je.value==="parserDownload";w.push(I.createElement(Ue,{key:Je.value,flexDirection:"column"},I.createElement(Ue,{backgroundColor:Cn&&!Nn?Be.highlightBg:void 0,paddingX:2},I.createElement(ne,{color:Cn?Be.text:Be.textDim,bold:Cn},Cn?"\u276F ":" ",Je.label),!Wr&&!Xr&&I.createElement(I.Fragment,null,I.createElement(ne,{color:"gray"},Et),I.createElement(ne,{color:le(Je),bold:!0},Je.value==="aiProvider"?Je.status:`[ ${Je.status} ]`))),Wr&&!Nn&&Je.status!=="None"&&I.createElement(Ue,{paddingX:4,marginBottom:1},I.createElement(ne,{color:"gray"},"\u21B3 ",Je.status)),Nn&&I.createElement(Ue,{flexDirection:"column",marginLeft:4,marginBottom:1},I.createElement(Ue,{paddingX:1,borderStyle:"single",borderColor:"gray",flexDirection:"row"},I.createElement(ne,{color:"gray",bold:!0},"> "," "),I.createElement(Yd,{value:Bt,onChange:ot=>{let Pt=xe==="profileNickname"?20:xe==="profileInstructions"?250:1/0;Xe(ot.slice(0,Pt))},onSubmit:async ot=>{if(xe==="customOpenAIBaseUrl"){let Pt=ot.trim().replace(/\/+$/,""),De={...t,customOpenAIBaseUrl:Pt};m(De),p({systemSettings:De,apiTier:d,quotas:r})}else if(xe==="customOpenAIKey"){let Pt=ot.trim(),{replaceActiveProviderKey:De}=await import("./secrets-GLYKU2YR.js"),ao=await De("c_openai",Pt);Pt&&(!ao||ao.ok!==!1)&&(He($o=>({...$o,c_openai:!0})),T==="c_openai"&&(H&&H(Pt),W&&W(Pt,{aiProvider:"c_openai"})))}else if(xe==="profileNickname"){let Pt=ot.trim().slice(0,20),De={...F||{},nickname:Pt};k&&k(De),p({profileData:De,systemSettings:t,apiTier:d,quotas:r})}else if(xe==="profileInstructions"){let Pt=ot.trim().slice(0,250),De={...F||{},instructions:Pt};k&&k(De),p({profileData:De,systemSettings:t,apiTier:d,quotas:r})}else{let Pt={...t,[xe]:ot.trim(),sandboxPreset:"Custom"};m(Pt),p({systemSettings:Pt,apiTier:d,quotas:r})}Me(null)}})),I.createElement(ne,{color:"gray",italic:!0}," ",xe==="customOpenAIBaseUrl"?"Enter Base URL (.../v1) \u2022 Press Enter to save, Esc to cancel":xe==="customOpenAIKey"?"Enter API Key \u2022 Press Enter to save, Esc to cancel":xe==="profileNickname"?`Enter Nickname (${Bt.length}/20) \u2022 Press Enter to save, Esc to cancel`:xe==="profileInstructions"?`Enter Custom Instructions (${Bt.length}/250) \u2022 Press Enter to save, Esc to cancel`:"Comma separated \u2022 Press Enter to save, Esc to cancel"))))}),mo&&w.push(I.createElement(Ue,{key:"conflict-warning",marginTop:1,paddingX:1},I.createElement(ne,{color:Be.text,italic:!0},"* Conflicting commands will be ignored and defaulted to highest priority"))),w})():I.createElement(Ue,{paddingX:1,flexDirection:"column",width:"100%"},Ke==="exit"?I.createElement(I.Fragment,null,I.createElement(Ue,{flexDirection:"column",marginBottom:1},I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"OS"," "),I.createElement(ne,{color:"gray"},"..................... "),I.createElement(ne,{color:Be.text},process.env.OS||process.platform||"N/A")),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Computer Name"," "),I.createElement(ne,{color:"gray"},".......... "),I.createElement(ne,{color:Be.text},process.env.COMPUTERNAME||process.env.HOSTNAME||"N/A")),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Processor Count"," "),I.createElement(ne,{color:"gray"},"........ "),I.createElement(ne,{color:Be.text},process.env.NUMBER_OF_PROCESSORS||"N/A")),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Node.js Version"," "),I.createElement(ne,{color:"gray"},"........ "),I.createElement(ne,{color:Be.text},"v",process.versions.node)),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"V8 Version"," "),I.createElement(ne,{color:"gray"},"...... ...... "),I.createElement(ne,{color:Be.text},"v",process.versions.v8)),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Data Directory"," "),I.createElement(ne,{color:"gray"},"......... "),Po===Co?"":I.createElement(ne,{color:Be.text},Po.replaceAll(Fa.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"),", "),I.createElement(ne,{color:Be.text},Co.replaceAll(Fa.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"))),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Viewport"," "),I.createElement(ne,{color:"gray"},"............... "),I.createElement(ne,{color:Be.text},process.stdout.rows||"?"," rows \xD7 ",process.stdout.columns||"?"," cols ",process.stdout.columns<90?"(too small width)":"")),I.createElement(Ue,{flexDirection:"row",marginBottom:0},I.createElement(ne,{color:Be.textDim},"Memory Load"," "),I.createElement(ne,{color:"gray"},"............ "),I.createElement(ne,{color:Be.text},wo,"/",rn," ",Ur))),I.createElement(Ue,{key:"pty-notice",paddingX:0,marginTop:0},I.createElement(ne,{color:_r?Be.statusOn:Be.warning},_r?"\u2713 Advance Interactive Terminal Supported":"\u26A0 Interactive Terminal is Limited"))):I.createElement(ne,{color:"gray",italic:!0},Xo[_].desc)))),I.createElement(Ue,{paddingX:1,marginTop:0,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:"gray",italic:!0},ue==="categories"?"\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure":Ke==="security"?"\u25B2\u25BC Select Option \u2022 TAB/\u25C4\u25BA Switch Tab \u2022 Enter to Edit/Toggle \u2022 ESC to go back":"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"),ue==="categories"&&I.createElement(ne,{color:"gray"},Xo[_].desc)))}import Kt,{useState as vi}from"react";import{Box as So,Text as gn,useInput as Qd}from"ink";import zd from"ink-text-input";var Jd=({question:t,options:m,onResolve:d,theme:v="Dark"})=>{let y=gt(v),[p,r]=vi(!1),[C,T]=vi(""),[M,P]=vi(0),F=!1,k=[],O=Array.isArray(m)&&m.length>0,K=t==="Agent has been running for a long time. Do you want to continue execution?";try{K&&O?k=[...m]:k=[...O?m:[],O?{id:"CUSTOM",label:"Suggest something else...",description:"Provide a custom response"}:{id:"CUSTOM",label:"Your Answer",description:""}]}catch{F=!0}Qd((H,W)=>{if(!p&&((W.leftArrow||W.upArrow)&&P(X=>Math.max(0,X-1)),(W.rightArrow||W.downArrow)&&P(X=>Math.min(k.length-1,X+1)),W.return)){let X=k[M];X?.id==="CUSTOM"?r(!0):d(F?"Selected Nothing":X.label)}});let j=It(2);return p?Kt.createElement(So,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:y.codeBg,width:"100%"},Kt.createElement(So,{paddingX:1},Kt.createElement(gn,{color:y.text,bold:!0},"SUGGEST SOMETHING")),Kt.createElement(So,{marginTop:1,paddingX:1},Kt.createElement(gn,{italic:!0,color:y.textMuted},"Replying to: ",t)),Kt.createElement(So,{marginTop:1,paddingX:1,flexDirection:"row"},Kt.createElement(zd,{value:C,onChange:T,onSubmit:()=>d(C)})),Kt.createElement(So,{marginTop:1,paddingX:1,marginBottom:1},Kt.createElement(gn,{color:y.textMuted,italic:!0},"(Press Enter to send)"))):Kt.createElement(So,{flexDirection:"column",border:!0,borderStyle:"round",borderColor:y.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,marginRight:1,width:"100%"},Kt.createElement(So,{paddingX:1,marginBottom:1},Kt.createElement(gn,{color:"yellow",bold:!0},K?"TURN SAFETY SYSTEM: EXECUTION LIMIT":"AGENT REQUEST: ACTION REQUIRED")),Kt.createElement(So,{paddingX:1,marginBottom:1},Kt.createElement(gn,{color:y.text},t)),Kt.createElement(So,{flexDirection:"column",width:"100%"},k.map((H,W)=>{let X=W===M;return Kt.createElement(So,{key:H.id,flexDirection:"column",width:"100%",backgroundColor:X?y.highlightBg:void 0,paddingX:1,marginBottom:W===k.length-1?0:1},Kt.createElement(gn,{color:X?y.text:y.textMuted,bold:X},X?"\u276F ":" ",H.label),H.description&&Kt.createElement(So,{marginLeft:4},Kt.createElement(gn,{color:y.textMuted,italic:!0},H.description)))})),Kt.createElement(So,{paddingX:1,marginTop:1,marginBottom:1},Kt.createElement(gn,{color:y.textMuted,italic:!0},"(Use Arrows to navigate, Enter to confirm)")))},Ua=Jd;import Mu from"gradient-string";var Zd=t=>{let m=String(t||"").trim().split(/\s+/).filter(Boolean),d={sub:null,args:[],provider:null,providerBare:!1,index:null,url:null,temp:!1,all:!1,unmask:!1,nullMode:!1},v=[];for(let y=0;y<m.length;y++){let p=m[y];if(p==="--provider"){let r=m[y+1];r&&!r.startsWith("--")?(d.provider=r,y++):d.providerBare=!0}else if(p==="--index"){let r=m[y+1];r&&/^\d+$/.test(r)&&(d.index=parseInt(r,10)-1,y++)}else if(p==="--url"){let r=m[y+1];r&&!r.startsWith("--")&&(d.url=r,y++)}else p==="--temp"?d.temp=!0:p==="--null"?d.nullMode=!0:p==="--all"?d.all=!0:p==="--unmask"||p==="--reveal"?d.unmask=!0:p==="--mask"?d.unmask=!1:v.push(p)}return d.sub=v.length?v[0].toLowerCase():null,d.args=v.slice(1),d},_a=["\u2726 API KEY MANAGEMENT","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key list [--provider <name>] [--unmask]","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key add <key> [--index <n>] [--provider <name>] [--url <endpoint>]","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key remove [<index>|<key>|--all] [--provider <name>]","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key use <index>|<key> | /key use <key> --temp","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key use --null (no key sent; c_openai / Ollama only)","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key clean [--provider <name>]","\u2800"],Ha=async(t,m={})=>{let d=Zd(t),v=m.currentProvider||"Google",y=[],p=(T={})=>({lines:y,...T}),r=v;if(d.provider){let T=Pl(d.provider);if(!T)return{lines:[`\u2726 Unknown provider: ${d.provider}`]};r=T}let C=d.sub;if(!C)return{lines:_a};if(C==="list"){if(d.providerBare){let M=Nl();y.push("\u2726 SAVED API KEYS");for(let P of M)y.push(`- ${P.provider} (${P.hasKeys?P.count:"No Saved Keys"})`);return y.push("\u2800"),p()}let T=await jl(r,{unmask:d.unmask});return y.push(`\u2726 ${Ol(r.replace("c_openai","Custom Endpoints"))} API KEYS`),y.push(...T),y.push("\u2800"),p()}if(C==="add"||C==="new"){let T=d.args.join(" ").trim();if(!T)return p({promptNewKey:!0});let M=await Xl(r,T,{index:d.index!==null?d.index:void 0,baseUrl:d.url!==null?d.url:void 0});return M.ok?(await Fl(r)===null&&await $l(r,M.index),y.push(`\u2726 Key added to ${r.replace("c_openai","Custom Endpoints")} slot ${M.index+1}.`),d.url!==null&&ii(r)&&y.push(`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Using URL: ${d.url}`),p()):M.full?{lines:[`\u2726 ${M.error}`,"\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Use /key add <key> --index <n> to overwrite a slot."]}:{lines:[`\u2726 Failed to add key: ${M.error}`]}}if(C==="remove"){let T;if(d.all)T=void 0;else if(d.args.length){let P=d.args.join(" ");T=/^\d+$/.test(P)?parseInt(P,10)-1:P}let M=await Gl(r,T,{all:d.all});return M.ok?M.all?(y.push(`\u2726 Cleared all keys for ${r.replace("c_openai","Custom Endpoints")}.`),p({promptNewKey:!0})):(y.push(`\u2726 Removed key from ${r.replace("c_openai","Custom Endpoints")} slot ${M.removedIndex+1}.`),M.needsNewKey?(y.push(`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m No keys remain for ${r}. Please enter a new key.`),p({promptNewKey:!0})):p()):{lines:[`\u2726 ${M.error}`]}}if(C==="use"){let T=d.args.join(" ").trim();if(d.nullMode){if(!_l(r))return{lines:["\u2726 --null is only supported for Custom Endpoints and Ollama."]};await Hl(r,!0),ai(r);let F=r.replace("c_openai","Custom Endpoints");return y.push(`\u2726 ${F} now using NO API key (persisted).`),y.push("\u2800\u2800\u2514\u2500 Saved key slots were kept, they are just ignored."),r==="c_openai"&&y.push("\u2800\u2800\u2514\u2500 No Authorization header will be sent. Base URL is unchanged."),p({switchedKey:Ul})}if(!T)return{lines:["\u2726 Usage: /key use <index> | <key> [--temp] | /key use --null"]};if(d.temp)return Wl(r,T),y.push(`\u2726 Temporary key set for ${r.replace("c_openai","Custom Endpoints")} (session only).`),ii(r)&&y.push("\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Will use the current Custom base URL."),p({switchedKey:T});let M=/^\d+$/.test(T)?parseInt(T,10)-1:T,P=await Kl(r,M);return P.ok?(ai(r),y.push(`\u2726 ${r.replace("c_openai","Custom Endpoints")} now using slot ${P.index+1}.`),P.switchedBaseUrl&&y.push(`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Switched Base URL to: ${P.switchedBaseUrl}`),p({switchedBaseUrl:P.switchedBaseUrl,switchedKey:P.key})):{lines:[`\u2726 ${P.error}`]}}if(C==="clean"){let T=d.provider?r:null,M=await Vl(T);return y.push(T?`\u2726 Compacted ${T.replace("c_openai","Custom Endpoints")} key slots.`:`\u2726 Compacted all key stores (${M.touched} provider(s) touched).`),p()}return{lines:[`\u2726 Unknown subcommand: ${C}`,..._a]}};import Ga from"node-notifier";import tn from"path";import Wa from"fs";import{execSync as Rd}from"child_process";import{fileURLToPath as eu}from"url";var ws=tn.dirname(eu(import.meta.url)),Nr=t=>{let m=[tn.resolve(ws,"../assets",t),tn.resolve(ws,"../../assets",t),tn.resolve(ws,"../../src/assets",t),tn.resolve(process.cwd(),"src/assets",t),tn.resolve(process.cwd(),"dist/assets",t)];for(let d of m)if(Wa.existsSync(d))return d;return m[0]},Xa=tn.join(process.env.APPDATA,"Microsoft","Windows","Start Menu","Programs","FluxFlow"),sf=tn.join(Xa,"FluxFlow.lnk"),lf=tn.resolve(ws,"../../node_modules/node-notifier/vendor/snoreToast/snoretoast-x64.exe"),Bi=()=>{if(process.platform==="win32")try{let t=Nr("logo.png"),m=Nr("logo.ico"),v=`
|
|
44
|
+
---`)&&Te.push({label:Ut,value:Ut,isHeader:!1,provider:ct})}))}return Te},[T,d,r,ft]),je=I.useMemo(()=>{if(!Qe.trim())return Dt;let ae=Qe.trim().toLowerCase(),w=[],A=null;for(let Te of Dt)Te.isHeader?A=Te:(Te.label.toLowerCase().includes(ae)||Te.value&&Te.value.toLowerCase().includes(ae))&&(A&&!w.includes(A)&&w.push(A),w.push(Te));return w},[Dt,Qe]);Pr(()=>{if(ge){let ae=je.findIndex(w=>!w.isHeader);it(ae>=0?ae:0),rt(0)}},[Qe]),Pr(()=>{if(ge){if(je.length===0){it(0),rt(0);return}if(yt>=je.length||je[yt]?.isHeader){let ae=je.findIndex(w=>!w.isHeader);it(ae>=0?ae:0)}}},[je,ge]);let[wo,$]=qt(0),[rn,lr]=qt(0),[Ur,Tn]=qt("MB"),[_r,yn]=qt(!1);Pr(()=>{let ae=!1;return import("./exec_command-E3D5BY3N.js").then(w=>{ae||yn(!!w.isPtyAvailable)}).catch(()=>{}),()=>{ae=!0}},[]),Pr(()=>{let ae=qd.getHeapStatistics().heap_size_limit,w=ae>=1024*1024*1024,A=w?"GB":"MB",Te=w?1024*1024*1024:1024*1024;lr(parseFloat((ae/Te).toFixed(2))),Tn(A);let Le=()=>{let mo=process.memoryUsage().rss/Te,Je=w?parseFloat(mo.toFixed(2)):Math.round(mo);$(Je)};Le();let nt=setInterval(()=>{Le()},3e4);return()=>clearInterval(nt)},[]);let ks=ae=>{switch(ae){case"providers":{let w=[{label:"Current Provider",value:"aiProvider",status:T==="c_openai"?"Custom (OpenAI)":T}];return T==="Ollama"&&w.push({label:"Endpoint",value:"ollamaEndpoint",status:t.ollamaEndpoint||"Cloud"}),(T==="c_openai"||T==="Custom (OpenAI)")&&(w.push({label:"Base URL",value:"customOpenAIBaseUrl",status:t.customOpenAIBaseUrl||"Not Configured"}),w.push({label:"API Key (if needed)",value:"customOpenAIKey",status:ft.c_openai?"Set":"None"})),w}case"appearance":return[{label:"Theme",value:"theme",status:t.theme||"Dark"},{label:"Loading Phrases",value:"loadingPhrases",status:t.loadingPhrases!==!1?"ON":"OFF"},{label:"Progressive Rendering [EXPERIMENTAL]",value:"progressiveRendering",status:t.progressiveRendering?"ON":"OFF"},{label:"Show TPM Estimate",value:"showTPMEstimate",status:t.showTPMEstimate?"ON":"OFF"},{label:"Verbose Thinking",value:"preserveThinking",status:t.preserveThinking!==!1?"ON":"OFF"}];case"memory":return[{label:"Base Personality",value:"profilePreset",status:F?.preset||"Default"},{label:"Nickname",value:"profileNickname",status:F?.nickname||"None"},{label:"Custom Instructions",value:"profileInstructions",status:Or(F?.instructions)}];case"security":return[{label:"Sandbox Preset",value:"sandboxPreset",status:$a(t),section:"Sandbox"},{label:"YOLO Mode",value:"autoExec",status:t.autoExec?"ON":"OFF",section:"Sandbox"},{label:"External Workspace Access",value:"externalAccess",status:t.allowExternalAccess?"ON":"OFF",section:"Sandbox"},{label:"Network Access (Terminal)",value:"networkAccess",status:t.networkAccess!==!1?"ON":"OFF",section:"Sandbox"},{label:"Always Ask Commands",value:"alwaysAsk",status:Or(t.alwaysAskCommands),section:"Sandbox"},{label:"Always Ask Files/Paths",value:"alwaysAskFiles",status:Or(t.alwaysAskFiles||".env, .env.*, *.env"),section:"Sandbox"},{label:"Auto Approve Commands",value:"autoApprove",status:Or(t.autoApproveCommands),section:"Sandbox"},{label:"Auto Disapprove Commands",value:"autoDisallow",status:Or(t.autoDisallowCommands),section:"Sandbox"},{label:"Auto Approve Git Commits",value:"autoApproveGit",status:t.autoApproveGit?"ON":"OFF",section:"Sandbox"},{label:"Overwrite Protection",value:"overwriteProtection",status:t.overwriteProtection!==!1?"ON":"OFF",section:"Sandbox"},{label:"Advanced Recovery [EXPERIMENTAL]",value:"advanceRollback",status:t.advanceRollback?"ON":"OFF",section:"Other"},{label:"Auto-Delete History",value:"autoDelete",status:t.autoDeleteHistory||"30d",section:"Other"},{label:"Save AppData Externally",value:"externalData",status:t.useExternalData?"ON":"OFF",section:"Other"},{label:"Agent Clipboard Context",value:"clipboardContext",status:t.clipboardContext?"ON":"OFF",section:"Other"},{label:"Loop Limits",value:"loopLimits",status:t.loopLimits||"Default",section:"Other"}].filter(Te=>Te.section.toLowerCase()===tt.toLowerCase());case"updater":return[{label:"Auto-Update",value:"autoUpdate",status:t.autoUpdate?"ON":"OFF"},{label:"Preferred Package Manager",value:"updateManager",status:(t.updateManager||"npm")==="custom"?"Custom":(t.updateManager||"npm").toUpperCase()}];case"secondaryModels":return[{label:"Sub-Agents",value:"subAgents",status:t.subAgents!==!1?"ON":"OFF"},{label:"SubAgent Wildcard Tooling",value:"subAgentWildcardTooling",status:t.subAgentWildcardTooling?"ON":"OFF"},{label:"Sub-Agent Model",value:"subAgentModel",status:t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default"},{label:"Enable Auto-Completion",value:"autoCompletionEnabled",status:M?.enabled?"ON":"OFF"},{label:"Auto-Completion Model",value:"autoCompletionModel",status:M?.model&&M.model!=="Default"?M.model:"Default"},{label:"Commit Message Model",value:"commitMessageModel",status:t.commitMessageModel&&t.commitMessageModel!=="Default"?t.commitMessageModel:"Default"}];case"other":return[{label:"Directory Tree Design",value:"indentationTree",status:t.indentationTree!==!1?"Modern":"Legacy"},{label:"Compact Large Tool Results",value:"compressToolResults",status:t.compressToolResults?"ON":"OFF"},{label:"Auto Truncate Results",value:"autoTruncateResults",status:t.autoTruncateResults?"ON":"OFF"},{label:"Agent Finish Notification",value:"agentFinishSound",status:t.agentFinishSound?"ON":"OFF"},{label:"Image History for CU",value:"imageHistoryCU",status:t.imageHistoryCU||"Standard"},{label:"Context Length",value:"contextLength",status:t.contextLength||"256k"},{label:"Keep Reasoning Context",value:"keepReasoningContext",status:t.keepReasoningContext?"ON":"OFF"},{label:"Auto Exclude Metadata",value:"autoExcludeMetadata",status:t.autoExcludeMetadata?"ON":"OFF"},{label:"Disable Todo",value:"disableTodo",status:t.disableTodo?"ON":"OFF"},...process.platform==="win32"?[{label:"Prefer Bash",value:"preferBash",status:t.preferBash!==!1?"ON":"OFF"}]:[],{label:"Cache Calculate Mode",value:"cacheCalculateMode",status:t.cacheCalculateMode||"Session"}];default:return[]}},Ke=Xo[_].id,Qt=ks(Ke);jd((ae,w)=>{if(ge){if(w.tab){mt(A=>A==="search"?"list":"search");return}if(Ee==="search"){w.escape?Y(!1):w.downArrow||w.return?mt("list"):w.backspace||w.delete?ce(A=>A.slice(0,-1)):ae&&!w.ctrl&&!w.meta&&ae.length===1&&ce(A=>A+ae);return}if(w.upArrow)it(A=>{if(je.length===0)return 0;let Te=(A-1+je.length)%je.length,Le=0;for(;je[Te]?.isHeader&&Le<je.length;)Te=(Te-1+je.length)%je.length,Le++;return Te});else if(w.downArrow)it(A=>{if(je.length===0)return 0;let Te=(A+1)%je.length,Le=0;for(;je[Te]?.isHeader&&Le<je.length;)Te=(Te+1)%je.length,Le++;return Te});else if(w.return){let A=je[yt];if(A&&!A.isHeader){let Te=A.value==="Default";Ge==="autoCompletion"?P(Le=>{let nt=Te?"":A.provider||"",ct={...Le,model:A.value,provider:nt,baseUrl:Te?"":Yl[nt]||""};return p({autoCompletion:ct,apiTier:d,quotas:r}),ct}):m(Ge==="commitMessage"?Le=>{let nt={...Le,commitMessageModel:Te?"Default":A.value,commitMessageProvider:Te?"":A.provider||""};return p({systemSettings:nt,apiTier:d,quotas:r}),nt}:Le=>{let nt={...Le,CustomSubAgent:!Te,SubAgentModel:A.value,SubAgentProvider:Te?"":A.provider||""};return p({systemSettings:nt,apiTier:d,quotas:r}),nt}),Y(!1)}}else w.escape?Y(!1):ae&&!w.ctrl&&!w.meta&&ae.length===1&&(ce(A=>A+ae),mt("search"));return}if(Oe){if(w.upArrow){let A=(R-1+Wo.length)%Wo.length;fe(A)}else if(w.downArrow){let A=(R+1)%Wo.length;fe(A)}else if(w.return){let A=Wo[R];m(Te=>{let Le={...Te,theme:A};return p({systemSettings:Le,apiTier:d,quotas:r}),Le}),K?K():ye(!1)}else w.escape&&(K?K():ye(!1));return}if(xe){w.escape&&Me(null);return}if(ue==="categories")w.upArrow?be(A=>(A-1+Xo.length)%Xo.length):w.downArrow?be(A=>(A+1)%Xo.length):w.return||w.rightArrow?Xo[_].id==="exit"?v("chat"):(te("items"),Ie(0)):w.escape&&v("chat");else if(ue==="items"){if(Ke==="security"&&(w.tab||ae===" ")){Se(A=>A==="Sandbox"?"Other":"Sandbox"),Ie(0);return}if(w.upArrow)Ie(A=>(A-1+Qt.length)%Qt.length);else if(w.downArrow)Ie(A=>(A+1)%Qt.length);else if(w.leftArrow)Ke==="security"&&tt==="Other"?(Se("Sandbox"),Ie(0)):te("categories");else if(w.rightArrow&&Ke==="security"&&tt==="Sandbox")Se("Other"),Ie(0);else if(w.escape)te("categories");else if(w.return){let A=Qt[Pe];Hr(A)}}});let Hr=ae=>{if(ae.value==="profilePreset"){let w=["Default","Sassy","Friendly","Playful","Efficient","Professional"],A=F?.preset||"Default",Le=(w.indexOf(A)+1)%w.length,nt=w[Le>=0?Le:0],ct={...F||{},preset:nt};k&&k(ct),p({profileData:ct,systemSettings:t,apiTier:d,quotas:r})}else if(ae.value==="profileNickname")Me("profileNickname"),Xe(F?.nickname||"");else if(ae.value==="profileInstructions")Me("profileInstructions"),Xe(F?.instructions||"");else if(ae.value==="memory")m(w=>({...w,memory:!w.memory}));else if(ae.value==="sandboxPreset"){let w=$a(t),A=["Autonomous","Balanced","Strict"],Le=(A.indexOf(w)+1)%A.length,nt=A[Le];m(ct=>{let ze={...ct,sandboxPreset:nt};return nt==="Strict"?(ze.autoExec=!1,ze.allowExternalAccess=!1,ze.networkAccess=!1,ze.autoApproveCommands="",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, shutdown, reboot, init 0, init 6, Stop-Process, Stop-Service, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, netsh advfirewall, iptables -F, ufw disable, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1,ze.overwriteProtection=!0):nt==="Balanced"?(ze.autoExec=!0,ze.allowExternalAccess=!1,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, Stop-Process, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, shutdown, reboot, init 0, init 6, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1,ze.overwriteProtection=!0):nt==="Autonomous"&&(ze.autoExec=!0,ze.allowExternalAccess=!0,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="",ze.alwaysAskCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.autoApproveGit=!0,ze.overwriteProtection=!1),ze})}else if(ae.value==="autoExec")t.autoExec?m(w=>({...w,autoExec:!1,sandboxPreset:"Custom"})):t.allowExternalAccess?v("doubleDanger"):v("autoExecDanger");else if(ae.value==="externalAccess")t.allowExternalAccess?m(w=>({...w,allowExternalAccess:!1,sandboxPreset:"Custom"})):t.autoExec?v("doubleDanger"):v("externalDanger");else if(ae.value==="networkAccess")m(w=>({...w,networkAccess:w.networkAccess===!1,sandboxPreset:"Custom"}));else if(ae.value==="alwaysAsk")Me("alwaysAskCommands"),Xe(t.alwaysAskCommands||"");else if(ae.value==="alwaysAskFiles")Me("alwaysAskFiles"),Xe(t.alwaysAskFiles||".env, .env.*, *.env");else if(ae.value==="autoApprove")Me("autoApproveCommands"),Xe(t.autoApproveCommands||"");else if(ae.value==="autoDisallow")Me("autoDisallowCommands"),Xe(t.autoDisallowCommands||"");else if(ae.value==="autoApproveGit")m(w=>({...w,autoApproveGit:!w.autoApproveGit,sandboxPreset:"Custom"}));else if(ae.value==="overwriteProtection")m(w=>({...w,overwriteProtection:w.overwriteProtection===!1,sandboxPreset:"Custom"}));else if(ae.value==="customOpenAIBaseUrl")Me("customOpenAIBaseUrl"),Xe(t.customOpenAIBaseUrl||"");else if(ae.value==="customOpenAIKey")Me("customOpenAIKey"),Xe("");else if(ae.value==="ollamaEndpoint")m(w=>{let A=w.ollamaEndpoint==="Local"?"Cloud":"Local",Te={...w,ollamaEndpoint:A};return p({systemSettings:Te,apiTier:d,quotas:r}),Te});else if(ae.value==="apiTier")v("apiTier");else if(ae.value==="aiProvider")j&&j("settings"),v("selectProvider");else if(ae.value==="advanceRollback")t.advanceRollback?m(w=>{let A={...w,advanceRollback:!1};return p({systemSettings:A,apiTier:d,quotas:r}),A}):v("advanceRollbackDanger");else if(ae.value==="autoDelete"){let w=["1d","7d","30d"],Te=(w.indexOf(t.autoDeleteHistory||"30d")+1)%w.length;m(Le=>({...Le,autoDeleteHistory:w[Te]}))}else if(ae.value==="autoUpdate")m(w=>({...w,autoUpdate:!w.autoUpdate}));else if(ae.value==="externalData")if(!t.useExternalData)y({label:"Enter absolute path for External AppData:",note:"All history, logs and secrets will be stored here. ~/.fluxflow/settings.json stays as anchor.",key:"externalDataPath",value:t.externalDataPath||""}),v("input");else{let w={...t,useExternalData:!1};m(w),p({systemSettings:w,apiTier:d,quotas:r}),C(A=>[...A,{id:Date.now(),role:"system",text:"[STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart."}]),v("chat")}else if(ae.value==="updateManager")v("updateManager");else if(ae.value==="parserDownload")v("parserDownload");else if(ae.value==="indentationTree")m(w=>{let A={...w,indentationTree:w.indentationTree===!1};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="compressToolResults")m(w=>{let A={...w,compressToolResults:!w.compressToolResults};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="autoTruncateResults")m(w=>{let A={...w,autoTruncateResults:!w.autoTruncateResults};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="agentFinishSound")m(w=>{let A={...w,agentFinishSound:!w.agentFinishSound};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="loopLimits"){let w=["Default","Extended","ENV"],Te=(w.indexOf(t.loopLimits||"Default")+1)%w.length;m(Le=>{let nt={...Le,loopLimits:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="imageHistoryCU"){let w=["Low","Standard","Extended","Max"],Te=(w.indexOf(t.imageHistoryCU||"Standard")+1)%w.length;m(Le=>{let nt={...Le,imageHistoryCU:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="contextLength"){let w=["16k","32k","64k","128k","256k","512k","1M"],Te=(w.indexOf(t.contextLength||"256k")+1)%w.length;m(Le=>{let nt={...Le,contextLength:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="keepReasoningContext")m(w=>{let A={...w,keepReasoningContext:!w.keepReasoningContext};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="autoExcludeMetadata")m(w=>{let A={...w,autoExcludeMetadata:!w.autoExcludeMetadata};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="disableTodo")m(w=>{let A={...w,disableTodo:!w.disableTodo};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="preferBash")m(w=>{let A=w.preferBash!==!1,Te={...w,preferBash:!A};return p({systemSettings:Te,apiTier:d,quotas:r}),Te});else if(ae.value==="cacheCalculateMode"){let w=["Session","Current"],Te=(w.indexOf(t.cacheCalculateMode||"Session")+1)%w.length;m(Le=>{let nt={...Le,cacheCalculateMode:w[Te]};return p({systemSettings:nt,apiTier:d,quotas:r}),nt})}else if(ae.value==="subAgents")m(w=>{let A={...w,subAgents:w.subAgents===!1};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="subAgentWildcardTooling")m(w=>{let A={...w,subAgentWildcardTooling:!w.subAgentWildcardTooling};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="subAgentModel"){let w=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",A=je.findIndex(Te=>Te.value===w);it(A>=0?A:0),Fe("subAgent"),Y(!0)}else if(ae.value==="autoCompletionEnabled")P(w=>{let A={...w,enabled:!w.enabled};return p({autoCompletion:A,apiTier:d,quotas:r}),A});else if(ae.value==="clipboardContext")m(w=>{let A={...w,clipboardContext:!w.clipboardContext};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="autoCompletionModel"){let w=M?.model||"Default",A=je.findIndex(Te=>Te.value===w);it(A>=0?A:0),Fe("autoCompletion"),Y(!0)}else if(ae.value==="commitMessageModel"){let w=t.commitMessageModel||"Default",A=je.findIndex(Te=>Te.value===w);it(A>=0?A:0),Fe("commitMessage"),Y(!0)}else if(ae.value==="preserveThinking")m(w=>{let A={...w,preserveThinking:w.preserveThinking===!1};return ka(A.preserveThinking),p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="loadingPhrases")m(w=>{let A={...w,loadingPhrases:w.loadingPhrases===!1};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="progressiveRendering")m(w=>{let A={...w,progressiveRendering:!w.progressiveRendering};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="showTPMEstimate")m(w=>{let A={...w,showTPMEstimate:!w.showTPMEstimate};return p({systemSettings:A,apiTier:d,quotas:r}),A});else if(ae.value==="theme"){let w=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",A=Wo.indexOf(w);fe(A>=0?A:0),oe(t.theme||"Dark"),ye(!0)}},Be=gt(t.theme);if(ge){let ae=Ge==="autoCompletion"?M?.model||"Default":Ge==="commitMessage"?t.commitMessageModel||"Default":t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",w=15,A=Tt;yt<A?A=yt:yt>=A+w&&(A=yt-w+1),A=Math.max(0,Math.min(A,Math.max(0,je.length-w))),A!==Tt&&rt(A);let Te=je.slice(A,A+w);return I.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:1,width:"100%",minHeight:32},I.createElement(Ue,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:Be.text,bold:!0,underline:!0},Ge==="autoCompletion"?"Select Auto-Completion Model:":Ge==="commitMessage"?"Select Commit Message Model:":"Select Sub-Agent Model:"),je.length>0&&I.createElement(ne,{color:"gray"},yt+1,"/",je.length)),I.createElement(Ue,{borderStyle:"single",borderColor:Ee==="search"?Be.primary||"cyan":"gray",paddingX:1,marginBottom:1},I.createElement(ne,{color:Ee==="search"?Be.primary||"cyan":"gray",bold:!0},"\u{1F50D} Search: "," "),I.createElement(ne,{color:Be.text},Qe),Ee==="search"&&I.createElement(ne,{color:Be.primary||"cyan"},"\u2588"),!Qe&&Ee!=="search"&&I.createElement(ne,{color:"gray",italic:!0},"(Press TAB or type to filter models...)")),I.createElement(Ue,{flexDirection:"column",flexGrow:1,height:w},Te.length>0?Te.map((Le,nt)=>{let ct=A+nt;if(Le.isHeader)return I.createElement(Ue,{key:`hdr-${ct}`,paddingX:1},I.createElement(ne,{color:"gray",bold:!0,underline:!0},Le.label));let ze=yt===ct&&Ee==="list",mo=ae===Le.value;return I.createElement(Ue,{key:`item-${Le.value}-${ct}`,paddingX:1,backgroundColor:ze?Be.highlightBg:void 0},I.createElement(ne,{color:ze?Be.text:Be.textDim,bold:ze},ze?"\u276F ":" ",Le.label,mo?I.createElement(ne,{color:Be.primary||"cyan",italic:!0}," (active)"):""))}):I.createElement(Ue,{paddingX:1},I.createElement(ne,{color:"gray",italic:!0},'No models matching "',Qe,'"'))),I.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:"gray",italic:!0},"TAB to switch search/list \u2022 \u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),I.createElement(ne,{color:Ee==="search"?Be.primary||"cyan":"gray",bold:!0},"[",Ee.toUpperCase()," MODE]")))}if(Oe){let ae=Wo[R],w=gt(ae);return I.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:w.border,padding:1,width:"100%",minHeight:32},I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:w.text,bold:!0},"Choose your color scheme:")),I.createElement(Ue,{flexDirection:"row",width:"100%",flexGrow:1},I.createElement(Ue,{flexDirection:"column",width:"30%",paddingRight:1},Wo.map((A,Te)=>{let Le=R===Te,nt=(t.theme||"Dark")===A,ct=A==="Forest Sprite"||A==="Spookfest";return I.createElement(Ue,{key:A,paddingX:0},I.createElement(ne,{color:Le?w.text:w.textDim,bold:Le},Le?"> ":" ",A,ct&&I.createElement(ne,{color:Le?w.success||"#52b788":"green",bold:!0}," \u2605"),nt?I.createElement(ne,{color:w.primary||"cyan",italic:!0}," (saved)"):""))})),I.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:w.borderMuted,paddingX:2,paddingY:1,backgroundColor:w.cardBg},I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:w.secondary||"cyan",bold:!0},"> ","you: "),I.createElement(ne,{color:w.text},"add a greeting function")),I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:w.success||"green"}," Here's the change:")),I.createElement(Ue,{flexDirection:"column",marginLeft:2,marginBottom:1},I.createElement(ne,null,I.createElement(ne,{color:w.textDim},"3 "),kt(' import "fmt"',".go",void 0)),I.createElement(ne,{color:w.textDim},"4"),I.createElement(Ue,{backgroundColor:w.diffRemovalBg},I.createElement(ne,null,I.createElement(ne,{color:w.diffRemovalNum||w.diffRemovalText},"5 "),I.createElement(ne,{color:w.diffRemovalPrefix||w.diffRemovalText},"- "),kt("func ",".go",void 0),kt("main()",".go",void 0,w.diffRemovalHighlightBg),kt(" {",".go",void 0))),I.createElement(Ue,{backgroundColor:w.diffAdditionBg},I.createElement(ne,null,I.createElement(ne,{color:w.diffAdditionNum||w.diffAdditionText},"5 "),I.createElement(ne,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),kt("func ",".go",void 0),kt("greet(name string)",".go",void 0,w.diffAdditionHighlightBg),kt(" {",".go",void 0))),I.createElement(Ue,{backgroundColor:w.diffAdditionBg},I.createElement(ne,null,I.createElement(ne,{color:w.diffAdditionNum||w.diffAdditionText},"6 "),I.createElement(ne,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),I.createElement(ne,null," "),kt('fmt.Printf("Hello, %s!\\n", name)',".go",void 0,w.diffAdditionHighlightBg))),I.createElement(ne,null,"7 }")),I.createElement(Ue,{flexDirection:"column",marginTop:1,marginBottom:1},I.createElement(ne,{color:w.textDim},"\u25BE Thought Process"),I.createElement(ne,{color:w.textMuted}," I need to add a greeting function. I'll use fmt.Printf.")),I.createElement(Ue,{flexDirection:"column"},I.createElement(ne,null,I.createElement(ne,{color:w.warning||"yellow"},"\u2699 tool: "),I.createElement(ne,{color:w.text},"write_file main.go")),I.createElement(ne,null,I.createElement(ne,{color:w.accent||"magenta"},"\u29BF task: "),I.createElement(ne,{color:w.text},"Implementing greeting")),I.createElement(ne,null,I.createElement(ne,{color:w.danger||"red"},"X error: "),I.createElement(ne,{color:w.text},"compilation failed")),I.createElement(ne,null,I.createElement(ne,{color:w.warning||"yellow"},"\u26A0 warning: "),I.createElement(ne,{color:w.text},"deprecation warning")),I.createElement(ne,null,I.createElement(ne,{color:w.info||"blue"},"\u2192 link: "),I.createElement(ne,{color:w.info||"blue",underline:!0},"file:///path/to/main.go")),I.createElement(ne,null,I.createElement(ne,{color:w.accent||"magenta"},"\u2605 accent: "),I.createElement(ne,{color:w.text},"highlighted text")),I.createElement(ne,{color:w.textDim},"\xB7 dim: press Enter to continue")))),I.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:"gray",italic:!0},"\u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),I.createElement(ne,{color:"gray"},"Previewing: ",Wo[R],Wo[R]==="Forest Sprite"?" \u2605":"")))}return I.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:0,width:"100%",minHeight:26},I.createElement(Ue,{paddingX:1,paddingY:0,marginBottom:0,borderStyle:"single",borderColor:Be.borderMuted,width:"100%"},I.createElement(ne,{color:Be.text,bold:!0},"SYSTEM CONFIGURATION")),I.createElement(Ue,{flexDirection:"row",width:"100%",minHeight:20},I.createElement(Ue,{flexDirection:"column",width:"30%",maxWidth:40,borderStyle:"round",borderColor:ue==="categories"?Be.border:Be.borderMuted,padding:1,paddingY:0},I.createElement(Ue,{marginBottom:1},I.createElement(ne,{color:ue==="categories"?Be.text:Be.textDim,bold:!0,underline:!0},"CATEGORIES")),Xo.map((ae,w)=>{let A=_===w,Te=ae.id==="exit";return I.createElement(Ue,{key:ae.id,marginTop:Te?9:0,backgroundColor:A?ue==="categories"?Be.highlightBg:Be.cardBg:void 0,paddingX:1},I.createElement(ne,{color:A&&ue==="categories"?Be.text:Be.textDim,bold:A},A?"\u276F ":" ",ae.label))})),I.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:ue==="items"?Be.border:Be.borderMuted,paddingX:1,marginLeft:1,paddingY:0},I.createElement(Ue,{marginBottom:1,flexDirection:"row",justifyContent:"space-between",alignItems:"center"},I.createElement(ne,{color:ue==="items"?Be.text:Be.textDim,bold:!0,underline:!0},Xo[_].label.toUpperCase().includes("EXIT")?"Runtime Information":`${Xo[_].label} Settings`),Ke==="security"&&I.createElement(Ue,{flexDirection:"row"},I.createElement(Ue,{paddingX:1,backgroundColor:tt==="Sandbox"?ue==="items"?Be.highlightBg:Be.cardBg:void 0},I.createElement(ne,{bold:tt==="Sandbox",color:tt==="Sandbox"?Be.primary||"cyan":Be.textDim},"[ Sandbox ]")),I.createElement(Ue,{paddingX:1,backgroundColor:tt==="Other"?ue==="items"?Be.highlightBg:Be.cardBg:void 0},I.createElement(ne,{bold:tt==="Other",color:tt==="Other"?Be.primary||"cyan":Be.textDim},"[ Others ]")))),Qt.length>0?(()=>{let ae=null,w=[],A=Je=>(Je||"").split(",").map(Ut=>Ut.trim().toLowerCase()).filter(Boolean),Te=A(t.autoApproveCommands),Le=A(t.autoDisallowCommands),nt=A(t.alwaysAskCommands),ct=[...Te,...Le,...nt],ze=new Set(ct),mo=Ke==="security"&&ct.length!==ze.size;return Qt.forEach((Je,Ut)=>{let Cn=ue==="items"&&Pe===Ut,Mn=Je.label.length,Ds=Math.max(2,38-Mn),Et=".".repeat(Ds),le=ot=>Ke==="security"?(ot.value==="autoExec"||ot.value==="externalAccess")&&ot.status==="ON"?Be.statusOn:Be.statusOff:ot.status?.startsWith("\u2713")?Be.statusOn:ot.status?.startsWith("\u26A0")?Be.statusOff:ot.status==="ON"?Be.statusOn:ot.status==="OFF"?Be.statusOff:Be.text;Je.section&&Je.section!==ae&&Ke!=="security"&&(ae=Je.section,w.push(I.createElement(Ue,{key:`sec-hdr-${Je.section}`,marginTop:w.length>0?1:0,marginBottom:0,paddingX:1},I.createElement(ne,{color:"gray",bold:!0,underline:!0},Je.section.toUpperCase()))));let Nn=Cn&&xe&&(xe==="alwaysAskCommands"&&Je.value==="alwaysAsk"||xe==="alwaysAskFiles"&&Je.value==="alwaysAskFiles"||xe==="autoApproveCommands"&&Je.value==="autoApprove"||xe==="autoDisallowCommands"&&Je.value==="autoDisallow"||xe==="customOpenAIBaseUrl"&&Je.value==="customOpenAIBaseUrl"||xe==="customOpenAIKey"&&Je.value==="customOpenAIKey"||xe==="profileNickname"&&Je.value==="profileNickname"||xe==="profileInstructions"&&Je.value==="profileInstructions"),Wr=Je.value==="alwaysAsk"||Je.value==="alwaysAskFiles"||Je.value==="autoApprove"||Je.value==="autoDisallow"||Je.value==="profileInstructions",Xr=Je.value==="parserDownload";w.push(I.createElement(Ue,{key:Je.value,flexDirection:"column"},I.createElement(Ue,{backgroundColor:Cn&&!Nn?Be.highlightBg:void 0,paddingX:2},I.createElement(ne,{color:Cn?Be.text:Be.textDim,bold:Cn},Cn?"\u276F ":" ",Je.label),!Wr&&!Xr&&I.createElement(I.Fragment,null,I.createElement(ne,{color:"gray"},Et),I.createElement(ne,{color:le(Je),bold:!0},Je.value==="aiProvider"?Je.status:`[ ${Je.status} ]`))),Wr&&!Nn&&Je.status!=="None"&&I.createElement(Ue,{paddingX:4,marginBottom:1},I.createElement(ne,{color:"gray"},"\u21B3 ",Je.status)),Nn&&I.createElement(Ue,{flexDirection:"column",marginLeft:4,marginBottom:1},I.createElement(Ue,{paddingX:1,borderStyle:"single",borderColor:"gray",flexDirection:"row"},I.createElement(ne,{color:"gray",bold:!0},"> "," "),I.createElement(Yd,{value:Bt,onChange:ot=>{let Pt=xe==="profileNickname"?20:xe==="profileInstructions"?250:1/0;Xe(ot.slice(0,Pt))},onSubmit:async ot=>{if(xe==="customOpenAIBaseUrl"){let Pt=ot.trim().replace(/\/+$/,""),De={...t,customOpenAIBaseUrl:Pt};m(De),p({systemSettings:De,apiTier:d,quotas:r})}else if(xe==="customOpenAIKey"){let Pt=ot.trim(),{replaceActiveProviderKey:De}=await import("./secrets-GLYKU2YR.js"),ao=await De("c_openai",Pt);Pt&&(!ao||ao.ok!==!1)&&(He($o=>({...$o,c_openai:!0})),T==="c_openai"&&(H&&H(Pt),W&&W(Pt,{aiProvider:"c_openai"})))}else if(xe==="profileNickname"){let Pt=ot.trim().slice(0,20),De={...F||{},nickname:Pt};k&&k(De),p({profileData:De,systemSettings:t,apiTier:d,quotas:r})}else if(xe==="profileInstructions"){let Pt=ot.trim().slice(0,250),De={...F||{},instructions:Pt};k&&k(De),p({profileData:De,systemSettings:t,apiTier:d,quotas:r})}else{let Pt={...t,[xe]:ot.trim(),sandboxPreset:"Custom"};m(Pt),p({systemSettings:Pt,apiTier:d,quotas:r})}Me(null)}})),I.createElement(ne,{color:"gray",italic:!0}," ",xe==="customOpenAIBaseUrl"?"Enter Base URL (.../v1) \u2022 Press Enter to save, Esc to cancel":xe==="customOpenAIKey"?"Enter API Key \u2022 Press Enter to save, Esc to cancel":xe==="profileNickname"?`Enter Nickname (${Bt.length}/20) \u2022 Press Enter to save, Esc to cancel`:xe==="profileInstructions"?`Enter Custom Instructions (${Bt.length}/250) \u2022 Press Enter to save, Esc to cancel`:"Comma separated \u2022 Press Enter to save, Esc to cancel"))))}),mo&&w.push(I.createElement(Ue,{key:"conflict-warning",marginTop:1,paddingX:1},I.createElement(ne,{color:Be.text,italic:!0},"* Conflicting commands will be ignored and defaulted to highest priority"))),w})():I.createElement(Ue,{paddingX:1,flexDirection:"column",width:"100%"},Ke==="exit"?I.createElement(I.Fragment,null,I.createElement(Ue,{flexDirection:"column",marginBottom:1},I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"OS"," "),I.createElement(ne,{color:"gray"},"..................... "),I.createElement(ne,{color:Be.text},process.env.OS||process.platform||"N/A")),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Computer Name"," "),I.createElement(ne,{color:"gray"},".......... "),I.createElement(ne,{color:Be.text},process.env.COMPUTERNAME||process.env.HOSTNAME||"N/A")),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Processor Count"," "),I.createElement(ne,{color:"gray"},"........ "),I.createElement(ne,{color:Be.text},process.env.NUMBER_OF_PROCESSORS||"N/A")),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Node.js Version"," "),I.createElement(ne,{color:"gray"},"........ "),I.createElement(ne,{color:Be.text},"v",process.versions.node)),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"V8 Version"," "),I.createElement(ne,{color:"gray"},"...... ...... "),I.createElement(ne,{color:Be.text},"v",process.versions.v8)),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Data Directory"," "),I.createElement(ne,{color:"gray"},"......... "),Po===Co?"":I.createElement(ne,{color:Be.text},Po.replaceAll(Fa.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"),", "),I.createElement(ne,{color:Be.text},Co.replaceAll(Fa.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"))),I.createElement(Ue,{flexDirection:"row"},I.createElement(ne,{color:Be.textDim},"Viewport"," "),I.createElement(ne,{color:"gray"},"............... "),I.createElement(ne,{color:Be.text},process.stdout.rows||"?"," rows \xD7 ",process.stdout.columns||"?"," cols ",process.stdout.columns<90?"(too small width)":"")),I.createElement(Ue,{flexDirection:"row",marginBottom:0},I.createElement(ne,{color:Be.textDim},"Memory Load"," "),I.createElement(ne,{color:"gray"},"............ "),I.createElement(ne,{color:Be.text},wo,"/",rn," ",Ur))),I.createElement(Ue,{key:"pty-notice",paddingX:0,marginTop:0},I.createElement(ne,{color:_r?Be.statusOn:Be.warning},_r?"\u2713 Advance Interactive Terminal Supported":"\u26A0 Interactive Terminal is Limited"))):I.createElement(ne,{color:"gray",italic:!0},Xo[_].desc)))),I.createElement(Ue,{paddingX:1,marginTop:0,flexDirection:"row",justifyContent:"space-between"},I.createElement(ne,{color:"gray",italic:!0},ue==="categories"?"\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure":Ke==="security"?"\u25B2\u25BC Select Option \u2022 TAB/\u25C4\u25BA Switch Tab \u2022 Enter to Edit/Toggle \u2022 ESC to go back":"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"),ue==="categories"&&I.createElement(ne,{color:"gray"},Xo[_].desc)))}import Kt,{useState as vi}from"react";import{Box as So,Text as gn,useInput as Qd}from"ink";import zd from"ink-text-input";var Jd=({question:t,options:m,onResolve:d,theme:v="Dark"})=>{let y=gt(v),[p,r]=vi(!1),[C,T]=vi(""),[M,P]=vi(0),F=!1,k=[],O=Array.isArray(m)&&m.length>0,K=t==="Agent has been running for a long time. Do you want to continue execution?";try{K&&O?k=[...m]:k=[...O?m:[],O?{id:"CUSTOM",label:"Suggest something else...",description:"Provide a custom response"}:{id:"CUSTOM",label:"Your Answer",description:""}]}catch{F=!0}Qd((H,W)=>{if(!p&&((W.leftArrow||W.upArrow)&&P(X=>Math.max(0,X-1)),(W.rightArrow||W.downArrow)&&P(X=>Math.min(k.length-1,X+1)),W.return)){let X=k[M];X?.id==="CUSTOM"?r(!0):d(F?"Selected Nothing":X.label)}});let j=It(2);return p?Kt.createElement(So,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:y.codeBg,width:"100%"},Kt.createElement(So,{paddingX:1},Kt.createElement(gn,{color:y.text,bold:!0},"SUGGEST SOMETHING")),Kt.createElement(So,{marginTop:1,paddingX:1},Kt.createElement(gn,{italic:!0,color:y.textMuted},"Replying to: ",t)),Kt.createElement(So,{marginTop:1,paddingX:1,flexDirection:"row"},Kt.createElement(zd,{value:C,onChange:T,onSubmit:()=>d(C)})),Kt.createElement(So,{marginTop:1,paddingX:1,marginBottom:1},Kt.createElement(gn,{color:y.textMuted,italic:!0},"(Press Enter to send)"))):Kt.createElement(So,{flexDirection:"column",border:!0,borderStyle:"round",borderColor:y.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,marginRight:1,width:"100%"},Kt.createElement(So,{paddingX:1,marginBottom:1},Kt.createElement(gn,{color:"yellow",bold:!0},K?"TURN SAFETY SYSTEM: EXECUTION LIMIT":"AGENT REQUEST: ACTION REQUIRED")),Kt.createElement(So,{paddingX:1,marginBottom:1},Kt.createElement(gn,{color:y.text},t)),Kt.createElement(So,{flexDirection:"column",width:"100%"},k.map((H,W)=>{let X=W===M;return Kt.createElement(So,{key:H.id,flexDirection:"column",width:"100%",backgroundColor:X?y.highlightBg:void 0,paddingX:1,marginBottom:W===k.length-1?0:1},Kt.createElement(gn,{color:X?y.text:y.textMuted,bold:X},X?"\u276F ":" ",H.label),H.description&&Kt.createElement(So,{marginLeft:4},Kt.createElement(gn,{color:y.textMuted,italic:!0},H.description)))})),Kt.createElement(So,{paddingX:1,marginTop:1,marginBottom:1},Kt.createElement(gn,{color:y.textMuted,italic:!0},"(Use Arrows to navigate, Enter to confirm)")))},Ua=Jd;import Mu from"gradient-string";var Zd=t=>{let m=String(t||"").trim().split(/\s+/).filter(Boolean),d={sub:null,args:[],provider:null,providerBare:!1,index:null,url:null,temp:!1,all:!1,unmask:!1,nullMode:!1},v=[];for(let y=0;y<m.length;y++){let p=m[y];if(p==="--provider"){let r=m[y+1];r&&!r.startsWith("--")?(d.provider=r,y++):d.providerBare=!0}else if(p==="--index"){let r=m[y+1];r&&/^\d+$/.test(r)&&(d.index=parseInt(r,10)-1,y++)}else if(p==="--url"){let r=m[y+1];r&&!r.startsWith("--")&&(d.url=r,y++)}else p==="--temp"?d.temp=!0:p==="--null"?d.nullMode=!0:p==="--all"?d.all=!0:p==="--unmask"||p==="--reveal"?d.unmask=!0:p==="--mask"?d.unmask=!1:v.push(p)}return d.sub=v.length?v[0].toLowerCase():null,d.args=v.slice(1),d},_a=["\u2726 API KEY MANAGEMENT","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key list [--provider <name>] [--unmask]","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key add <key> [--index <n>] [--provider <name>] [--url <endpoint>]","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key remove [<index>|<key>|--all] [--provider <name>]","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key use <index>|<key> | /key use <key> --temp","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key use --null (no key sent; c_openai / Ollama only)","\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m /key clean [--provider <name>]","\u2800"],Ha=async(t,m={})=>{let d=Zd(t),v=m.currentProvider||"Google",y=[],p=(T={})=>({lines:y,...T}),r=v;if(d.provider){let T=Pl(d.provider);if(!T)return{lines:[`\u2726 Unknown provider: ${d.provider}
|
|
45
|
+
\u2800`]};r=T}let C=d.sub;if(!C)return{lines:_a};if(C==="list"){if(d.providerBare){let M=Nl();y.push("\u2726 SAVED API KEYS");for(let P of M)y.push(`- ${P.provider} (${P.hasKeys?P.count:"No Saved Keys"})`);return y.push("\u2800"),p()}let T=await jl(r,{unmask:d.unmask});return y.push(`\u2726 ${Ol(r.replace("c_openai","Custom Endpoints"))} API KEYS`),y.push(...T),y.push("\u2800"),p()}if(C==="add"||C==="new"){let T=d.args.join(" ").trim();if(!T)return p({promptNewKey:!0});let M=await Xl(r,T,{index:d.index!==null?d.index:void 0,baseUrl:d.url!==null?d.url:void 0});return M.ok?(await Fl(r)===null&&await $l(r,M.index),y.push(`\u2726 Key added to ${r.replace("c_openai","Custom Endpoints")} slot ${M.index+1}.
|
|
46
|
+
\u2800`),d.url!==null&&ii(r)&&y.push(`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Using URL: ${d.url}`),p()):M.full?{lines:[`\u2726 ${M.error}`,`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Use /key add <key> --index <n> to overwrite a slot.
|
|
47
|
+
\u2800`]}:{lines:[`\u2726 Failed to add key: ${M.error}
|
|
48
|
+
\u2800`]}}if(C==="remove"){let T;if(d.all)T=void 0;else if(d.args.length){let P=d.args.join(" ");T=/^\d+$/.test(P)?parseInt(P,10)-1:P}let M=await Gl(r,T,{all:d.all});return M.ok?M.all?(y.push(`\u2726 Cleared all keys for ${r.replace("c_openai","Custom Endpoints")}.
|
|
49
|
+
\u2800`),p({promptNewKey:!0})):(y.push(`\u2726 Removed key from ${r.replace("c_openai","Custom Endpoints")} slot ${M.removedIndex+1}.
|
|
50
|
+
\u2800`),M.needsNewKey?(y.push(`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m No keys remain for ${r}. Please enter a new key.
|
|
51
|
+
\u2800`),p({promptNewKey:!0})):p()):{lines:[`\u2726 ${M.error}
|
|
52
|
+
\u2800`]}}if(C==="use"){let T=d.args.join(" ").trim();if(d.nullMode){if(!_l(r))return{lines:[`\u2726 --null is only supported for Custom Endpoints and Ollama.
|
|
53
|
+
\u2800`]};await Hl(r,!0),ai(r);let F=r.replace("c_openai","Custom Endpoints");return y.push(`\u2726 ${F} now using NO API key (persisted).`),y.push(`\u2800\u2800\u2514\u2500 Saved key slots were kept, they are just ignored.
|
|
54
|
+
\u2800`),r==="c_openai"&&y.push(`\u2800\u2800\u2514\u2500 No Authorization header will be sent. Base URL is unchanged.
|
|
55
|
+
\u2800`),p({switchedKey:Ul})}if(!T)return{lines:[`\u2726 Usage: /key use <index> | <key> [--temp] | /key use --null
|
|
56
|
+
\u2800`]};if(d.temp)return Wl(r,T),y.push(`\u2726 Temporary key set for ${r.replace("c_openai","Custom Endpoints")} (session only).
|
|
57
|
+
\u2800`),ii(r)&&y.push("\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Will use the current Custom base URL."),p({switchedKey:T});let M=/^\d+$/.test(T)?parseInt(T,10)-1:T,P=await Kl(r,M);return P.ok?(ai(r),y.push(`\u2726 ${r.replace("c_openai","Custom Endpoints")} now using slot ${P.index+1}.
|
|
58
|
+
\u2800`),P.switchedBaseUrl&&y.push(`\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Switched Base URL to: ${P.switchedBaseUrl}
|
|
59
|
+
\u2800`),p({switchedBaseUrl:P.switchedBaseUrl,switchedKey:P.key})):{lines:[`\u2726 ${P.error}`]}}if(C==="clean"){let T=d.provider?r:null,M=await Vl(T);return y.push(T?`\u2726 Compacted ${T.replace("c_openai","Custom Endpoints")} key slots.
|
|
60
|
+
\u2800`:`\u2726 Compacted all key stores (${M.touched} provider(s) touched).
|
|
61
|
+
\u2800`),p()}return{lines:[`\u2726 Unknown subcommand: ${C}`,..._a]}};import Ga from"node-notifier";import tn from"path";import Wa from"fs";import{execSync as Rd}from"child_process";import{fileURLToPath as eu}from"url";var ws=tn.dirname(eu(import.meta.url)),Nr=t=>{let m=[tn.resolve(ws,"../assets",t),tn.resolve(ws,"../../assets",t),tn.resolve(ws,"../../src/assets",t),tn.resolve(process.cwd(),"src/assets",t),tn.resolve(process.cwd(),"dist/assets",t)];for(let d of m)if(Wa.existsSync(d))return d;return m[0]},Xa=tn.join(process.env.APPDATA,"Microsoft","Windows","Start Menu","Programs","FluxFlow"),sf=tn.join(Xa,"FluxFlow.lnk"),lf=tn.resolve(ws,"../../node_modules/node-notifier/vendor/snoreToast/snoretoast-x64.exe"),Bi=()=>{if(process.platform==="win32")try{let t=Nr("logo.png"),m=Nr("logo.ico"),v=`
|
|
45
62
|
$key = 'HKCU:\\Software\\Classes\\AppUserModelId\\FluxFlow'
|
|
46
63
|
New-Item -Path $key -Force | Out-Null
|
|
47
64
|
Set-ItemProperty -Path $key -Name 'DisplayName' -Value 'FluxFlow'
|
|
@@ -294,7 +311,8 @@ ${We}`,color:"cyan",isSteeringHint:!0,hintType:Ae?"QUESTION":"STEERING HINT",hin
|
|
|
294
311
|
`).trim();let Io=0,_o=0,Lo=Xt.matchAll(/@@\s*([^@]+?)\s*@@/g);for(let oi of Lo){let Rn=oi[1],Cl=Rn.match(/\+(\d+)/),Ml=Rn.match(/-(\d+)/);Cl&&(Io+=parseInt(Cl[1],10)),Ml&&(_o+=parseInt(Ml[1],10))}let dt=[];Io>0&&dt.push(`+${Io}`),_o>0&&dt.push(`-${_o}`);let vt=dt.length>0?` Total ${dt.join(" ")} changes.`:"",xt=wt.join(Co,"DiffBackups");at.ensureDirSync(xt);let ho=String(Date.now()).slice(-5),yo=pu.randomBytes(2).toString("hex"),pt=`${Ot}-diff-${ho}-${yo}.txt`,Zn=wt.join(xt,pt);at.writeFileSync(Zn,eo,"utf8");let yl=`${Co.replaceAll("\\","/").replace(Es.homedir().replaceAll("\\","/"),"~")}/DiffBackups/${pt}`,es=to?` ${to} blocks.`:"";return{...Ae,fullText:`[ACTION RESULT]: Diff result ${Ot} saved in '${yl}'.${es}${vt}`}}catch{}}return{...Ae,fullText:"[ACTION RESULT]: ...Old result truncated to save tokens"}});return Pn(Ct,null,me),U(me.length),me}),process.stdout.isTTY&&(async()=>{try{process.stdout.write("\x1B]0;FluxFlow | Idle\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow | Idle\x07")}catch{process.stdout.write("\x1B]0;FluxFlow | Idle\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow | Idle\x07")}})();continue}if(N.type==="visual_feedback"){Qe(),ce(),L(Q=>{let me=[...Q,{id:"feedback-"+Date.now()+"-"+Math.random().toString(36).substring(2,9),role:"system",text:Yt(N.content),isVisualFeedback:!0}];return U(me.length),me});continue}if(N.type==="exec_start"){Qe(),ce();continue}if(N.type==="liveTokens"){ln({tokens:N.content});continue}if(N.type==="usage"){let Q=N.content.totalTokenCount||0,me=N.content.cachedContentTokenCount||0,Ae=N.content.candidatesTokenCount||0,We=Math.max(0,Q-Ae);if(ln({tokens:Q}),ji(Ne=>Ne+Q),We>0&&Yi(Ne=>Ne+We),me>0&&qi(Ne=>Ne+me),Ae>0&&Qi(Ne=>Ne+Ae),We>0||me>0){no.current.push({input:We,cached:me}),no.current.length>3&&no.current.shift();let Ne=no.current.reduce((Xt,Ot)=>Xt+Ot.input,0),Mt=no.current.reduce((Xt,Ot)=>Xt+Ot.cached,0),to=Ne>0?Mt/Ne*100:0;vn(to)}Ki(Ne=>Ne+1);continue}if(N.type==="tool_time"){Mc(Q=>Q+N.content);continue}if(N.type==="tool_result"){ce(),$e=null,_e=null,z=!1,ke=!1,Ze=!1,lt=!1,Wt=!1,se=0,he=null,L(Q=>{let me=[...Q,{id:"tool-"+Date.now()+"-"+Math.random().toString(36).substring(2,7),role:"system",text:Yt(N.content),fullText:Yt(N.aiContent),binaryPart:N.binaryPart,toolName:N.toolName}];return U(me.length),me}),Y.current&&(_e=Y.current.id,Ze=!0);continue}let pe=N.content;if(N.type==="text"&&pe.includes("Request Cancelled")){if(global.gc){for(let Q=0;Q<3;Q++)global.gc(),await new Promise(me=>setImmediate(me));m.current=Date.now()}continue}let Ce=pe.toLowerCase();if(pe.includes("```")&&(ke=!ke),(Ce.includes("tool:")||Ce.includes("action:"))&&(Ze=!0,se=0,he=null,(pe.includes("[tool:")||pe.includes("[action:"))&&(se=0)),Ze){for(let Q=0;Q<pe.length;Q++){let me=pe[Q];!he&&(me==="'"||me==='"'||me==="`")?he=me:he&&me===he&&pe[Q-1]!=="\\"&&(he=null),he||(me==="("||me==="["?se++:(me===")"||me==="]")&&se--)}se<=0&&!he&&(Ze=!1)}let ve=/^\s*(?:<think_fluxflow[^>]*>|<\|channel>thought|\[think_fluxflow\])/i,et=(Q,me,Ae=1)=>{let We=me>0?Q[me-1]:"",Ne=me+Ae<Q.length?Q[me+Ae]:"";return We==="`"&&Ne==="`"},Ve=Q=>{let me=/(?:<\/think_fluxflow>|<channel\|>|\[\/think_fluxflow\])/gi,Ae;for(;(Ae=me.exec(Q))!==null;)if(!et(Q,Ae.index,Ae[0].length))return{index:Ae.index,length:Ae[0].length};return{index:-1,length:0}},St=Y.current?.role==="agent"&&Y.current.text||"",bt=!Wt&&St.trim().length===0;if(!z&&bt&&(ve.test(pe)||ve.test(St+pe))){let Q=ve.test(pe)?pe:St+pe,me=Q.match(ve),Ae=me.index,We=me[0].length,Ne=Q.substring(Ae+We);Qe(),Y.current=null,z=!0,Wt=!0,$e="think-"+Date.now(),Y.current={id:$e,role:"think",text:"",isStreaming:!0,startTime:Date.now()};let Mt=Ve(Ne);if(Mt.index!==-1){let Xt=Ne.substring(0,Mt.index).replace(/^\r?\n+/,"").replace(/\r?\n+$/,""),Ot=Ne.substring(Mt.index+Mt.length);Y.current.text=Yt(Xt);let eo=Y.current.startTime||Date.now();Y.current.duration=Date.now()-eo,ce(),z=!1,_e="agent-"+Date.now(),Y.current={id:_e,role:"agent",text:"",isStreaming:!0},Ot&&ft(Ot)}else{let to=Ne.replace(/^\r?\n+/,"");to&&ft(to)}continue}if(!z&&!Wt&&pe.trim().length>0&&(Wt=!0),z&&Y.current?.role==="think"){Qe();let me=(Y.current.text||"")+pe,Ae=Ve(me);if(Ae.index!==-1){let We=me.substring(0,Ae.index),Ne=me.substring(Ae.index+Ae.length);Y.current.text=Yt(We);let Mt=Y.current.startTime||Date.now();Y.current.duration=Date.now()-Mt,ce(),z=!1,_e="agent-"+Date.now(),Y.current={id:_e,role:"agent",text:"",isStreaming:!0},Ne&&ft(Ne)}else ft(pe);continue}else if(!z){let Q=pe.toLowerCase();!lt&&(Q.includes("tool:")||Q.includes("action:"))&&(lt=!0),!Y.current||Y.current.role!=="agent"?(_e="agent-"+Date.now(),Y.current={id:_e,role:"agent",text:Yt(pe),isStreaming:!0},it()):ft(pe)}}let Ye=Date.now();Cc(N=>N+(Ye-B))}catch(G){L(ee=>(U(ee.length+1),[...ee,{id:"error-"+Date.now(),role:"system",text:`\u274C ERROR: ${G.message}`}]))}finally{let G=Date.now()-B;if(Y.current&&(Y.current.workedDuration=G),rt.current&&(await mt(),clearInterval(rt.current),rt.current=null),Js(!1),Qs(null),hr(0),clearInterval(pr),ce(),Zs.current&&g(),Jo(),global.gc)try{for(let ee=0;ee<3;ee++)global.gc(),await new Promise(J=>setImmediate(J));m.current=Date.now()}catch{}if(b||process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow | Idle\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow | Idle\x07")),zo.current){ei(zo.current),Rs(null);let ee=zo.current;zo.current=null,L(J=>{let V=[...J],q=V.reverse().find(z=>z.text?.includes("[STEERING HINT: QUEUED]")||z.text?.includes("[QUESTION: QUEUED]"));return q&&(q.text.includes("[STEERING HINT: QUEUED]")?q.text=q.text.replace("[STEERING HINT: QUEUED]","[STEERING HINT: FINISHED_TURN]"):q.text.includes("[QUESTION: QUEUED]")&&(q.text=q.text.replace("[QUESTION: QUEUED]","[QUESTION: FINISHED_TURN]"))),V.reverse()}),le("resolution")}L(ee=>{let J=Date.now()-B,V=!1,q=[...ee].reverse().map(_e=>{let ke=_e.isStreaming?{..._e,isStreaming:!1}:_e;return ke.text&&(ke.text=(" "+ke.text).slice(1)),!V&&ke.role==="agent"&&(V=!0,ke={...ke,workedDuration:J}),ke}).reverse();if(!q.some(_e=>_e.role==="agent"&&_e.text?.trim().length>0)){let _e=[...q].reverse().find(ke=>ke.role==="think"&&ke.text?.trim().length>0);_e&&q.push({id:"agent-fallback-"+Date.now(),role:"agent",text:_e.text,isStreaming:!1,workedDuration:J})}let $e=q.filter(_e=>!String(_e.id).startsWith("welcome")&&(!_e.isMeta||_e.text&&_e.text.includes("Request Cancelled")));return Pn(Ct,null,$e),U(q.length),q})}})()}T(""),W(!1)}},st=rr(()=>{if(C.startsWith("/skill edit ")&&!tt){let n=C.split(" "),h=n[n.length-1];if(h&&h.startsWith("--")){let f=h.slice(2).toLowerCase(),c=[...wi||[],...bi||[]],g=new Set,b=[];for(let S of c){let G=(S?.filePath||"").replace(/\\/g,"/").toLowerCase(),ee=G.includes("/skills/fluxflow/skill.md")||G.includes("/skills/about-fluxflow/skill.md")||S?.name?.toLowerCase()==="fluxflow";S&&S.name&&!ee&&!g.has(S.name.toLowerCase())&&(g.add(S.name.toLowerCase()),b.push(S))}return b.filter(S=>S.name.toLowerCase().includes(f)).map(S=>({cmd:`--${S.name}`,desc:S.description||"Skill"}))}}if(C.startsWith("/")&&!tt){let n=C.split(" "),h=n[n.length-1].toLowerCase();if(n.length===1){let c=h.startsWith("/")?h.slice(1):h;return bl.filter(g=>(g.cmd.startsWith("/")?g.cmd.slice(1):g.cmd).toLowerCase().includes(c))}let f=bl;for(let c=0;c<n.length-1;c++){let g=n[c].toLowerCase(),b=f.find(B=>B.cmd.toLowerCase()===g);if(b&&b.subs)f=b.subs;else return[]}return f.filter(c=>c.cmd.toLowerCase().includes(h))}let x=C.split(" "),a=x[x.length-1],E=a&&a.startsWith("\\@");if((a&&a.startsWith("@")||E)&&!tt){let n=a.indexOf("#"),h=n!==-1,f=E?2:1,c=h?a.substring(f,n).toLowerCase():a.slice(f).toLowerCase(),g=h?a.substring(n):"";return Iu(process.cwd()).filter(S=>S.name.toLowerCase().includes(c)).map(S=>{let G=S.relativePath.replace(/\\/g,"/"),ee=G.startsWith(".")?G:"./"+G;return{cmd:(E?"\\@":"@")+"["+ee+g+"]",desc:S.relativePath}})}return[]},[C,tt]);ut(()=>{let x=0;for(;x<st.length;){let a=st[x],E=a?.cmd||a||"";if(typeof E=="string"&&E.trimStart().startsWith("---"))x++;else break}Ie(x<st.length?x:0)},[st]);let[Zr,Rr]=Z(0),Tl=Re(0);ut(()=>{let x=Tl.current>0,a=st.length>0;if(Tl.current=st.length,!a){Rr(0);return}if(!x){Rr(1);return}Rr(st.length)},[st]),ut(()=>{if(Zr>0&&Zr<st.length){let x=setTimeout(()=>{Rr(a=>Math.min(a+1,st.length))},1);return()=>clearTimeout(x)}},[Zr,st.length]),ut(()=>{if(Et!=="providerBudgetSelect")return;let x=["Google","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama","InferX","SenseNova","AIHubMix","Poolside","ExpLabs","TokenHarbor","Infron","Numes","APInex","xKiro","CoArena"],a=De.providerBudgets||{},E=x.reduce((o,n)=>(o[n]=!!(a[n]&&(a[n].agentLimit||a[n].tokenLimit||a[n].monthlyTokenLimit||a[n].dailyCostLimit||a[n].monthlyCostLimit)),o),{});Hi(E),Gr(0)},[Et]),ut(()=>{if(Et!=="providerBudgetFlow")return;let x={},a=De.providerBudgets||{};for(let E of Fn){let o=a[E]||{};x[E]={agentLimit:nn(o.agentLimit),tokenLimit:nn(o.tokenLimit),monthlyTokenLimit:nn(o.monthlyTokenLimit),dailyCostLimit:nn(o.dailyCostLimit),monthlyCostLimit:nn(o.monthlyCostLimit)}}cr(x),Eo(0)},[Et,Fn]);let Qu=({label:x,isSelected:a})=>{let E=x==="Cancel"||x==="Back"||x.toLowerCase().includes("exit")||x.toLowerCase().includes("back");return e.createElement(u,{marginTop:E?1:0,backgroundColor:a?"#2a2a2a":void 0,paddingX:1,width:"100%"},e.createElement(i,{color:a?"white":"gray",bold:a},a?"\u276F ":" ",x))},To=(x,a,E,o=10,n=2,h=9)=>{let f=vo(E),c=!f&&E>0?Math.min(100,a/E*100):0,g=Math.round(c),b=Math.round(g/100*o),B="\u2588".repeat(b)+"\u2591".repeat(Math.max(0,o-b)),S=s.success||"green";g>=40&&g<=80?S=s.warning||"yellow":g>80&&(S=s.danger||"red");let G=x.toLowerCase().includes("cost")||x.toLowerCase().includes("spend"),ee=!G&&(x.toLowerCase().includes("token")||x.toLowerCase().includes("daily")||x.toLowerCase().includes("monthly")),J=f?"\u221E":G?`$${Number(E).toFixed(2)}`:ee?Ft(E):E,V=Number(a)||0,q=G?`$${V.toFixed(V<.01&&V>0?4:2)}`:ee?Ft(a):a,z;return f||c===0?z="0%":c>0&&c<1?z="<1%":z=`${g}%`,e.createElement(u,{flexDirection:"row",paddingLeft:n,key:x},e.createElement(u,{width:h},e.createElement(i,{color:s.textMuted},x,": ")),e.createElement(i,{color:S},B),e.createElement(i,{color:s.textMuted}," ",z," (",q,"/",J,")"))},Hc=()=>{switch(Et){case"settings":return e.createElement(bs,{systemSettings:re,setSystemSettings:_t,apiTier:ot,setActiveView:le,setInputConfig:fo,saveSettings:zt,quotas:De,setMessages:L,aiProvider:$,autoCompletion:dr,setAutoCompletion:Ps,profileData:Un,setProfileData:Ls,setProviderReturnView:As,setApiKey:Ut,initAI:Mo});case"theme":return e.createElement(bs,{systemSettings:re,setSystemSettings:_t,apiTier:ot,setActiveView:le,setInputConfig:fo,saveSettings:zt,quotas:De,setMessages:L,aiProvider:$,autoCompletion:dr,setAutoCompletion:Ps,profileData:Un,setProfileData:Ls,initialSelectingTheme:!0,onCloseTheme:()=>le("chat"),setProviderReturnView:As,setApiKey:Ut,initAI:Mo});case"selectProvider":return e.createElement(Ht,{title:"SELECT AI PROVIDER",searchable:!0,items:[{label:"Google",value:"Google"},{label:"Nvidia",value:"NVIDIA"},{label:"DeepSeek",value:"DeepSeek"},{label:"InferX",value:"InferX"},{label:"SenseNova",value:"SenseNova"},{label:"Experiential Labs",value:"ExpLabs"},{label:"Token Harbor",value:"TokenHarbor"},{label:"Infron",value:"Infron"},{label:"Numes",value:"Numes"},{label:"APInex",value:"APInex"},{label:"xKiro",value:"xKiro"},{label:"CoArena",value:"CoArena"},{label:"Ollama",value:"Ollama"},...process.env.ENABLE_9ROUTER==="true"||process.env.ENABLE_9ROUTER===!0?[{label:"9router [Local Proxy]",value:"9router"}]:[],{label:"AIHubMix [Experimental]",value:"AIHubMix"},{label:"Mistral [Experimental]",value:"Mistral"},{label:"OpenRouter [Experimental]",value:"OpenRouter"},{label:"Custom [OpenAI Chat Completion]",value:"c_openai"},{label:"Back",value:sn}],theme:re.theme,onSelect:async o=>{if(o.value===sn||o.value==="settings"||o.value==="Back"){le(sn);return}let n=o.value,h=await mn(n),f="";if(n==="9router"){let c=await Ni();c.ok||(f=`
|
|
295
312
|
|
|
296
313
|
\x1B[33m\u2726 WARNING: 9router does not appear to be running on ${c.url}.\x1B[39m
|
|
297
|
-
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m To start 9router: \x1B[36mnpx 9router\x1B[39m or \x1B[36mnpm i -g 9router && 9router\x1B[39m
|
|
314
|
+
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m To start 9router: \x1B[36mnpx 9router\x1B[39m or \x1B[36mnpm i -g 9router && 9router\x1B[39m
|
|
315
|
+
\u2800`)}if(n==="c_openai"){if(!re.customOpenAIBaseUrl){fo({label:"Enter Custom OpenAI Base URL (.../v1):",key:"customOpenAIBaseUrl",value:"",returnView:sn}),le("input");return}let c=h||"";try{li()}catch{}rn(n),Ut(c),Mo(c,{aiProvider:n,onIDEApproval:Uo});let g=(De.providerTiers||{})[n]||"Free",b=po(n,g)||"";Qt(b),Pt(g),_t(B=>({...B,memory:!1})),zt({aiProvider:n,activeModel:b,apiTier:g,quotas:De,systemSettings:{...re,memory:!1}}),L(B=>[...B,{role:"system",text:`\u2726 Switched to Custom (OpenAI)!${b?`
|
|
298
316
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Model: ${b}.`:""}${rs(n,b)}
|
|
299
317
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Endpoint: ${re.customOpenAIBaseUrl}${re.memory?`
|
|
300
318
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Memory is not available with Custom (OpenAI).`:""}
|
|
@@ -309,7 +327,8 @@ ${We}`,color:"cyan",isSteeringHint:!0,hintType:Ae?"QUESTION":"STEERING HINT",hin
|
|
|
309
327
|
\u2800`,isMeta:!0}])}else if(n==="imageSettings"){let B=o.trim();if(B.startsWith("sk_")){let S={...qo,apiKey:B};Kr(S),b.imageSettings=S,L(G=>(U(G.length+1),[...G,{id:Date.now(),role:"system",text:"[IMAGE KEY] Custom API key saved successfully.",isMeta:!0}]))}}else if(n==="providerKey"){let B=o.trim(),S=$o.provider;(S==="Ollama"||S==="9router")&&(B==="LOCAL"||B==="")&&(B="LOCAL",S==="Ollama"&&(_t(V=>({...V,ollamaEndpoint:"Local"})),b.systemSettings={...re,ollamaEndpoint:"Local"}));let G="";if(S==="9router"){let V=await Ni();V.ok||(G=`
|
|
310
328
|
|
|
311
329
|
\x1B[33m\u2726 WARNING: 9router does not appear to be running on ${V.url}.\x1B[39m
|
|
312
|
-
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m To start 9router: \x1B[36mnpx 9router\x1B[39m or \x1B[36mnpm i -g 9router && 9router\x1B[39m
|
|
330
|
+
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m To start 9router: \x1B[36mnpx 9router\x1B[39m or \x1B[36mnpm i -g 9router && 9router\x1B[39m
|
|
331
|
+
\u2800`)}await di(S,B),rn(S),Ut(B),Mo(B,{aiProvider:S,onIDEApproval:Uo});let ee=(De.providerTiers||{})[S]||"Free",J=po(S,ee);Qt(J),Pt(ee),b.aiProvider=S,b.activeModel=J,b.apiTier=ee,(S==="NVIDIA"&&process.env.NVIDIA_BASE_URL||S==="Ollama"||S==="CrofAI"||S==="InferX"||S==="SenseNova"||S==="AIHubMix"||S==="Poolside"||S==="9router"||S==="ExpLabs"||S==="TokenHarbor"||S==="Infron"||S==="Numes"||S==="APInex"||S==="xKiro"||S==="CoArena")&&(_t(V=>({...V,memory:!1})),b.systemSettings={...re,memory:!1}),L(V=>(U(V.length+1),[...V,{id:Date.now(),role:"system",text:`\u2726 ${S} API Key saved successfully! ${J?`
|
|
313
332
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Model: ${J}`:""}${S==="Ollama"&&B==="LOCAL"?`
|
|
314
333
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Ollama Endpoint automatically switched to Local`:""}${S==="Ollama"||S==="CrofAI"||S==="InferX"||S==="SenseNova"||S==="AIHubMix"||S==="Poolside"||S==="9router"||S==="ExpLabs"||S==="TokenHarbor"||S==="Infron"||S==="Numes"||S==="APInex"||S==="xKiro"||S==="CoArena"?`
|
|
315
334
|
\u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Memory is not available with ${S}`:""}${S==="NVIDIA"&&process.env.NVIDIA_BASE_URL?`
|
|
@@ -329,7 +348,8 @@ ${We}`,color:"cyan",isSteeringHint:!0,hintType:Ae?"QUESTION":"STEERING HINT",hin
|
|
|
329
348
|
`,"To support multi-line inputs with ",e.createElement(i,{bold:!0,color:"white"},"Shift + Enter")," for newline, a terminal sequence keybinding needs to be added to your IDE configuration.",`
|
|
330
349
|
|
|
331
350
|
`,"Would you like FluxFlow to automatically add this to your ",wn()," keybindings?"),e.createElement(u,{marginTop:1},e.createElement(Ht,{title:"Add Keybinding?",items:[{label:"Yes, configure automatically",value:"yes"},{label:"No, skip",value:"no"}],onSelect:async o=>{o.value==="yes"?await Ds(wn()):Bs="\\ + Enter",le("chat")},theme:re.theme})));case"memory":return e.createElement(u,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(Li,{onClose:()=>le("chat"),theme:re.theme}));case"parserDownload":return e.createElement(u,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(Pi,{onClose:()=>le("settings")}));case"resolution":return e.createElement(u,{width:"100%",alignItems:"center",justifyContent:"center"},e.createElement(Au,{data:Nc,theme:re.theme,onResolve:o=>{ei(null),le("chat"),setTimeout(()=>{wl(o,!0)},500)},onEdit:o=>{ei(null),le("chat"),T(o)}}));case"approval":let x=!!Rt?.isOverwrite,a=fn(Rt?.args||"{}"),E=a.path||a.targetPath||a.file||"";return x?e.createElement(u,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1,width:"100%"},e.createElement(i,{color:"white",bold:!0,underline:!0},"OVERWRITE PROTECTION"),e.createElement(i,{marginTop:1},"Agent wants to rewrite ",e.createElement(i,{color:"cyan",bold:!0},E||"file"),". This will overwrite the existing file content completely."),e.createElement(u,{marginTop:1},e.createElement(Ht,{title:"Action Required",items:[{label:"Accept",value:"allow"},{label:"Deny",value:"deny"}],onSelect:o=>{let n=o.value==="deny"?"deny":"allow";Rt.resolve(n),an(null),le("chat")},theme:re.theme}))):e.createElement(u,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1,width:"100%"},e.createElement(i,{color:"white",bold:!0,underline:!0},Rt?.tool==="view_file"?"FILE READ PERMISSION":"FILE WRITE PERMISSION"),e.createElement(i,{marginTop:1},"The agent is attempting to ",Rt?.tool==="view_file"?"read":"modify",": ",e.createElement(i,{color:"cyan"},fn(Rt?.args||"{}").path||"Unknown File")),Rt?.tool==="view_file"?null:Ln()?e.createElement(u,{marginTop:1,paddingX:1},e.createElement(i,{color:"cyan",italic:!0},"FluxFlow Companion is active. Review the changes in your editor.")):e.createElement(u,{marginTop:1,borderStyle:"single",borderColor:"#333",paddingX:1,flexDirection:"column"},e.createElement(i,{color:"gray"},"--- PROPOSED CONTENT ---"),(()=>{let o=fn(Rt?.args||"{}"),n=[],h=new Set;if(Object.keys(o).forEach(g=>{let b=g.match(/^(searchContent|replaceContent|newContent|content_to_replace|content_to_add|TargetContent|ReplacementContent|replacementContent)(\d+)?$/);if(b){let B=b[2]?parseInt(b[2]):1;h.add(B)}}),Array.from(h).sort((g,b)=>g-b).forEach(g=>{let b,B;g===1?(b=o.searchContent1??o.searchContent??o.replaceContent1??o.content_to_replace1??o.replaceContent??o.content_to_replace??o.TargetContent??null,B=o.newContent1??o.content_to_add1??o.newContent??o.content_to_add??o.ReplacementContent??o.replacementContent??null):(b=o[`searchContent${g}`]??o[`replaceContent${g}`]??o[`content_to_replace${g}`]??null,B=o[`newContent${g}`]??o[`content_to_add${g}`]??null),(b!==null||B!==null)&&n.push({replace:b,new:B})}),n.length>0)return e.createElement(u,{flexDirection:"column",marginTop:1},n.map((g,b)=>{let B=g.replace!==null,S=g.new!==null;return e.createElement(u,{key:b,flexDirection:"column",marginTop:b>0?1:0},n.length>1&&e.createElement(i,{color:"gray"},"Block ",b+1,":"),B&&e.createElement(u,null,e.createElement(i,{color:"red",wrap:"anywhere",bold:!0},"- ",g.replace)),S&&e.createElement(u,{marginTop:0},e.createElement(i,{color:"green",wrap:"anywhere",bold:!0},"+ ",g.new.replace(/\[\/n\]?/g,"\\n"))))}));let c=o.content||o.ReplacementContent||o.content_to_add||o.replacementContent||o.newContent||null;return e.createElement(i,{color:"white",wrap:"anywhere"},(c?c.replace(/\[\/n\]?/g,"\\n"):null)||"Updating file content...")})()),e.createElement(u,{marginTop:1},(()=>{let o=Rt?.tool,n=fn(Rt?.args||"{}"),h=n.path||n.targetPath||n.file||"",f=h?wt.extname(h).toLowerCase():"",c=h?wt.basename(h):"this file",g="Accept for this session";return o==="write_file"&&f?g=`Accept for this session (*${f})`:o==="update_file"&&c&&(g=`Accept for this session (${c})`),e.createElement(Ht,{title:"Action Required",items:[{label:"Accept this time",value:"allow"},...o==="view_file"?[]:[{label:g,value:"always"}],{label:"Don't accept",value:"deny"}],onSelect:b=>{b.value==="always"&&(o==="write_file"?f?Ys.current.add(f):js(!0):o==="update_file"&&h?nl.current.add(wt.resolve(h).toLowerCase()):js(!0));let B=b.value==="deny"?"deny":"allow";Rt.resolve(B),an(null),le("chat")},theme:re.theme})})()));case"mode":return e.createElement(Ht,{title:"SELECT EXECUTION MODE",items:[{label:`Flux (Dev Toolset Mode) ${X==="Flux"?"\u25CF":""}`,value:"Flux"},{label:`Flow (Chat / Conversation Mode) ${X==="Flow"?"\u25CF":""}`,value:"Flow"},{label:`ICU (Interactive Computer Use) ${X==="ICU"?"\u25CF":""}`,value:"ICU"},{label:`FluxCU (Autonomous Flux Computer Use) ${X==="FluxCU"?"\u25CF":""}`,value:"FluxCU"},{label:"Back",value:"chat"}],theme:re.theme,onSelect:o=>{if(o.value==="chat"||o.value==="Back"){le("chat");return}let n=o.value;ie(n),L(h=>(U(h.length+1),[...h,{id:Date.now(),role:"system",text:`\u2726 Mode switched to ${Fi(n)}
|
|
332
|
-
\u2800`,isMeta:!0}])),le("chat")},onClose:()=>le("chat")});case"display":return e.createElement(Ht,{title:"SELECT ACTIVE DISPLAY FOR COMPUTER USE",items:[{label:`Primary Display (Display 1) ${ue===0?"\u25CF":""}`,value:0},{label:`Secondary Display (Display 2) ${ue===1?"\u25CF":""}`,value:1},{label:"Back",value:"chat"}],theme:re.theme,onSelect:o=>{if(o.value==="chat"||o.value==="Back"){le("chat");return}let n=Number(o.value);te(n),zt({display:n}).catch(()=>{});let h=n===0?"Primary (Display 1)":"Secondary (Display 2)";L(f=>(U(f.length+1),[...f,{id:Date.now(),role:"system",text:`\u2726 Active Computer Use display set to: ${h}
|
|
351
|
+
\u2800`,isMeta:!0}])),le("chat")},onClose:()=>le("chat")});case"display":return e.createElement(Ht,{title:"SELECT ACTIVE DISPLAY FOR COMPUTER USE",items:[{label:`Primary Display (Display 1) ${ue===0?"\u25CF":""}`,value:0},{label:`Secondary Display (Display 2) ${ue===1?"\u25CF":""}`,value:1},{label:"Back",value:"chat"}],theme:re.theme,onSelect:o=>{if(o.value==="chat"||o.value==="Back"){le("chat");return}let n=Number(o.value);te(n),zt({display:n}).catch(()=>{});let h=n===0?"Primary (Display 1)":"Secondary (Display 2)";L(f=>(U(f.length+1),[...f,{id:Date.now(),role:"system",text:`\u2726 Active Computer Use display set to: ${h}
|
|
352
|
+
\u2800`,isMeta:!0}])),le("chat")},onClose:()=>le("chat")});case"updateManager":return e.createElement(Ht,{title:"Select Preferred Update Manager",subtitle:"NOTE: If you are unsure about these, go with NPM",items:[{label:"NPM (Standard)",value:"npm"},{label:"PNPM (Recommended)",value:"pnpm"},{label:"BUN (Ultra Fast)",value:"bun"},{label:"YARN (Classic)",value:"yarn"},{label:"Custom Command",value:"custom"},{label:"Back",value:"settings"}],onSelect:o=>{if(o.value==="settings"||o.value==="Back"){le("settings");return}o.value==="custom"?(fo({label:"Enter Custom Update Command (Global install recommended):",key:"customUpdateCommand",value:re.customUpdateCommand,next:n=>(_t(h=>({...h,updateManager:"custom",customUpdateCommand:n})),null)}),le("input")):(_t(n=>({...n,updateManager:o.value})),le("settings"))},theme:re.theme});case"update":return e.createElement(Ya,{latest:Tn,current:Bo,settings:re,theme:re.theme,onClose:()=>le("chat"),onSuccess:()=>{L(o=>(U(o.length+1),[...o,{id:"update-success-"+Date.now(),role:"system",text:`**[UPDATE COMPLETED]** Flux Flow successfully updated to v${Tn}.
|
|
333
353
|
**Restart to see changes.**`,isMeta:!0}])),le("chat")},onUpdateSettings:o=>{le("updateManager")}});case"terminalApproval":return e.createElement(u,{flexDirection:"column",borderStyle:"round",borderColor:"white",paddingX:2,paddingY:1,width:"100%"},e.createElement(i,{color:"white",bold:!0,underline:!0},"TERMINAL COMMAND OVERSIGHT"),e.createElement(u,{marginTop:1},e.createElement(i,null,"Agent requested to run: ",e.createElement(i,{color:"yellow",bold:!0},fn(Rt?.args||"{}").command||"Unknown Command"))),e.createElement(u,{marginTop:1},(()=>{let n=(fn(Rt?.args||"{}").command||"").trim();return e.createElement(Ht,{title:"Risk Assessment Required",items:[{label:"Run",value:"allow"},{label:"Accept for this session",value:"always"},{label:"Deny",value:"deny"}],onSelect:h=>{h.value==="always"&&n&&rl.current.add(n);let f=h.value==="deny"?"deny":"allow";Rt.resolve(f),an(null),le("chat")},theme:re.theme})})()));default:return e.createElement(u,{flexDirection:"column",marginTop:1,flexShrink:0,width:"100%"},ml&&ul&&e.createElement(u,{flexDirection:"column",borderStyle:"round",borderColor:s.borderMuted,paddingX:2,paddingY:1,width:"100%",marginBottom:1},e.createElement(u,{justifyContent:"space-between",width:"100%"},e.createElement(i,{color:s.text,bold:!0,underline:!0},"INQUIRY RESPONSE"),e.createElement(i,{color:s.textMuted},"[ ESC to Close ]")),e.createElement(u,{marginTop:1,width:"100%"},e.createElement(fs,{text:ul,columns:_.columns-6,theme:re.theme}))),Us.filter(o=>o.status==="running").length>0&&e.createElement(u,{flexDirection:"column",borderStyle:"round",borderColor:s.borderMuted,paddingX:2,paddingY:0,width:"100%",marginBottom:1},e.createElement(u,{justifyContent:"space-between",width:"100%"},e.createElement(i,{color:s.text,bold:!0},"ACTIVE SUBAGENTS")),e.createElement(u,{flexDirection:"column",marginTop:1,width:"100%"},Us.filter(o=>o.status==="running").map(o=>e.createElement(Pu,{key:o.id,sa:o,showTPMEstimate:re.showTPMEstimate})))),Tr&&e.createElement(u,{flexDirection:"column",borderStyle:"round",borderColor:s.borderMuted,paddingX:2,paddingY:0,width:"100%",marginBottom:0},e.createElement(u,{justifyContent:"space-between",width:"100%"},e.createElement(u,{flexDirection:"row",gap:1},e.createElement(i,{color:s.warning||"yellow",bold:!0},"\u2726 ",Tr.startsWith("/btw")?"Question Queued":"Steering Hint Queued"))),e.createElement(u,{marginTop:0,paddingLeft:2},e.createElement(i,{color:s.text,bold:!0},"\u2514\u2500 ",Tr.startsWith("/btw")?Tr.replace(/^\/btw\s*/,""):Tr))),e.createElement(u,{paddingX:1,marginBottom:0,justifyContent:"space-between",width:"100%"},e.createElement(u,null,cn?e.createElement(u,{gap:1},e.createElement(yu,null),e.createElement($r,{text:cn.trim().length>40&&!cn.toLowerCase().includes("trying")?`${cn.trim().slice(0,40)}...`:cn.trim(),baseColor:s.textExclusive||s.text,glintColor:s.textMutedExclusive||s.textMuted,speed:60,italic:!0,glintWidth:2,typeSpeed:10}),e.createElement(i,{color:s.textMuted},ll>0?`(${ll.toFixed(0)}s)`:"")):e.createElement(i,{color:s.textMuted,italic:!0},C.length>0&&cl?"Press ESC again to clear input":Dc?"Press CTRL + O to expand":process.env.HALLOWEEN_EEGG==="true"?"Listening for shadows...":"Waiting for input...")),e.createElement(u,null,(()=>{let o=cn?.toLowerCase()??"";return Jn&&Date.now()-Wi>15e3&&Us.length===0&&(o.includes("connecting")||o.includes("consulting")||o.includes("working")||o.includes("haunting")||o.includes("queue"))?e.createElement(u,null,e.createElement($r,{text:"Waiting for API Response",baseColor:s.text,glintColor:s.textMuted,glintWidth:4,speed:100}),e.createElement(i,{color:s.textMuted,dimColor:!0}," \u2503 ")):zs?e.createElement(u,null,e.createElement($r,{text:zs,baseColor:s.text,glintColor:s.textMuted,italic:!0,speed:85,typeSpeed:15}),e.createElement(i,{color:s.textMuted,dimColor:!0}," \u2503 ")):null})(),e.createElement($r,{text:wt.basename(Ke)||(Ke.length>1?Ke:"Use '/model model-id' to select model"),baseColor:s.text,glintColor:s.textMuted,glintWidth:3,speed:80}),e.createElement(i,{color:s.textMuted},Ke.length>0?je.toLocaleLowerCase().includes("xhigh")?"":` (${je})`:""),as>0&&e.createElement(i,{color:s.textMuted}," [",as," ",as===1?"file":"files","]"))),e.createElement(u,{flexDirection:"column",width:"100%"},e.createElement(u,{width:"100%",height:1,overflow:"hidden"},e.createElement(i,{color:s.inputBorder},"\u2500".repeat(Math.max(1,_.columns)))),e.createElement(u,{paddingX:1,paddingY:0,width:"100%",flexDirection:"column"},e.createElement(u,{flexDirection:"column",width:"100%"},e.createElement(u,{flexDirection:"row",width:"100%",paddingY:0},e.createElement(u,{flexShrink:0,width:4},e.createElement(i,{color:s.inputPrompt,bold:!0},Jn||br?"\u2726 ":" \u276F ")),e.createElement(u,{flexGrow:1},e.createElement(u,{flexGrow:1,position:"relative"},C===""&&e.createElement(u,{position:"absolute",paddingLeft:0},Ao&&!gr?e.createElement(i,{color:"yellow"},_c?" Terminal is waiting for user input. Press TAB to interact":" Press TAB to interact with terminal..."):Ao&&gr?e.createElement(i,{color:"yellow",bold:!0}," [ TERMINAL FOCUSED ] Type to interact, press TAB to exit..."):cl===1?e.createElement(i,{color:s.inputPrompt,bold:!0}," Press ESC again to ",C.length>0?"clear input":"revert codebase to checkpoint","..."):e.createElement(i,{color:s.inputPlaceholder},Lc?" Press ESC again to cancel the request.":br?" Compacting session history, please wait...":Jn?" Enter a prompt to steer the agent.":jt.filter(o=>o.role==="user").length===0?` Send message, @file or /cmd (${kc.shortcut} for newline)`:" Ask Follow-ups")),e.createElement(Sa,{key:`input-${M}`,onPasteStateChange:Ac,focus:!gr&&!br,showCursor:ct&&!br,cursorColor:s.inputText,lastFocusEventTime:mo.current,value:C,textStyle:{bold:!0,color:s.inputText},columns:_.columns,onChange:o=>{let n=o.replace(/\r\n/g,`
|
|
334
354
|
`).replace(/\r/g,`
|
|
335
355
|
`).replace(/\\\s*\n/g,`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{F as u}from"./chunk-
|
|
1
|
+
import{F as u}from"./chunk-ODFXGBVT.js";import"./chunk-UM5SNZ6X.js";import"./chunk-NJTM7OYZ.js";import"./chunk-56EJGQU3.js";import"./chunk-4CWGKQHX.js";import"./chunk-OO34QR3O.js";import"./chunk-IZBOTHQP.js";import"./chunk-VOUGMIAJ.js";import"./chunk-2RTYI6K3.js";import"./chunk-6LM3YRRE.js";import{b as p}from"./chunk-E3RSSW5O.js";import"./chunk-F36PAVKE.js";import"./chunk-JWB2S22X.js";import{b as d}from"./chunk-3XJQTYIL.js";import{o as a}from"./chunk-2Q6KKC74.js";import"./chunk-ZGORMZE5.js";import{a as l}from"./chunk-NPXJIGAI.js";import m from"fs";import g from"path";var f=["Identity: Embedded IDE code completion engine","Context given: Code \xB1 cursor, file name & language","Task: Predict contextually accurate code at cursor position","","Rules:","- Return ONLY the raw code to insert at the cursor. No explanations, commentary or rambling","- Do NOT wrap in markdown code fences","- NEVER repeat code that exist before & after cursor, if nothing sensible possible to predict, return empty string","- Match surrounding indentation and code style","- Complete the current line statement","- Never include placeholder comments like // TODO or # your code here","- Do not put anything except the code to insert between the tags"].join(`
|
|
2
2
|
`);try{let t=g.join(l,".cache");m.existsSync(t)||m.mkdirSync(t,{recursive:!0}),m.writeFileSync(g.join(t,"completion.json"),JSON.stringify({systemPrompt:f},null,2))}catch{}var y=t=>{if(!t)return"";let e=t.match(/<completion>([\s\S]*?)<\/completion>/i);return e?e[1]:t},x=({prefix:t="",suffix:e="",fileName:o="",language:n="",recentChanges:r="",clipboard:i=""})=>{let c=r?["### Recent manual changes (context):",r,""]:[],s=i?["### Clipboard (context):",i,""]:[];return[`File: ${o}`,`Language: ${n}`,"","### Code before cursor:",t,"","[cursor here]","","### Code after cursor:",e,"",...c,...s,"### Completion to insert at cursor:"].join(`
|
|
3
3
|
`)},T=async(t={})=>{try{let e=await d(),o=e.autoCompletion||{};if(!o.enabled)return"";let n=o.provider||e.aiProvider||"Google",r=o.model&&o.model!=="Default"?o.model:e.activeModel||a(n,e.apiTier)||a(n,"paid");if(!r)return"";let i=await p(n);if(!i&&!(n==="c_openai"&&e.systemSettings?.customOpenAIBaseUrl))return"";let c={aiProvider:n,apiKey:i,model:r,mode:"flow",thinkingLevel:"Fast",systemSettings:e.systemSettings||{}},s=[{role:"user",parts:[{text:x(t)}]}],{text:h}=await u(c,r,s,f,"Fast");return y(h||"")}catch{return""}};export{f as AUTOCOMPLETE_SYSTEM_PROMPT,y as extractCompletion,T as generateAutoCompletion};
|
|
@@ -443,7 +443,7 @@ description: System Generated Documentation. Read this if asked anything regardi
|
|
|
443
443
|
Open Source Terminal AI Assistant
|
|
444
444
|
App Version: ${hi}. Check Updates: fluxflow --update check. Update: fluxflow --update
|
|
445
445
|
GitHub: https://github.com/KushalRoyChowdhury/fluxflow-cli
|
|
446
|
-
Public Docs: https://fluxflow-cli.onrender.com
|
|
446
|
+
Public Docs: https://fluxflow-cli.onrender.com, /changelog or /changelog/{version} endpoints for release notes
|
|
447
447
|
|
|
448
448
|
## Supported Features & Documentation References
|
|
449
449
|
* Operating Modes (Flux, Flow, CU, FluxCU) \u2192 references/MODES.md
|
|
@@ -461,7 +461,7 @@ Public Docs: https://fluxflow-cli.onrender.com
|
|
|
461
461
|
|
|
462
462
|
Docs missing required info? Say you are not sure enough to answer. Dont give wrong info`,"references/MODES.md":ur,"references/PROVIDERS.md":gr,"references/PLUGINS.md":mr,"references/STARTUP.md":or,"references/ENV.md":ir,"references/COMMANDS.md":sr,"references/SETTINGS.md":rr,"references/TOOLS.md":ar,"references/ARCHITECTURE.md":lr,"references/SUB_AGENTS.md":cr,"references/SECURITY.md":dr,"references/IDE.md":fr};var yr=(e=null)=>{try{let t=En.join(Kn,"skills","fluxflow"),n=En.join(t,"references");if(process.env.NO_DEV==="true"||process.env.NO_DEV==="1"||process.env.NO_DEV===!0||process.env.NO_INS==="true"||process.env.NO_INS==="1"||process.env.NO_INS==="true"||!1){yn.existsSync(t)&&yn.rmSync(t,{recursive:!0,force:!0});return}let o=new Set(Object.keys(ns).map(m=>En.normalize(m))),d=(e||""||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),a=En.basename(d).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replace(/(\d)-(\d)/g,"$1.$2").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,m=>m.toUpperCase().trim());for(let[m,f]of Object.entries(ns)){let h=En.join(t,m),p=En.dirname(h);yn.existsSync(p)||yn.mkdirSync(p,{recursive:!0});let g=f;m==="SKILL.md"&&a&&(g=g.replace(/Public Docs: [^\n]*/,`Public Docs: ${g.match(/Public Docs: ([^\n]*)/)?.[1]||""}
|
|
463
463
|
Active Model: ${a}`));let i=g.trim()+`
|
|
464
|
-
`,x=null;yn.existsSync(h)&&(x=yn.readFileSync(h,"utf8")),x!==i&&yn.writeFileSync(h,i,"utf8")}if(yn.existsSync(n)){let m=yn.readdirSync(n);for(let f of m){let h=En.normalize(En.join("references",f));if(!o.has(h)){let p=En.join(n,f);try{yn.rmSync(p,{recursive:!0,force:!0})}catch{}}}}}catch{}};import{WebSocket as yi}from"ws";var Dt=null,wo=!1,za="ws://localhost:56832",os=[],bo=null,is=null,ss=null,xr="2.0.0",Tc=e=>{xr=e,wr()},rs=e=>{is=e},Ac=e=>{ss=e},wr=()=>{if(Dt||wo)return;wo=!0;let e=new yi(za);e.on("open",()=>{for(Dt=e,wo=!1,Dt.send(JSON.stringify({command:"version",version:xr,pid:process.pid,ppid:process.ppid,cwd:process.cwd()}));os.length>0;)Dt.send(JSON.stringify(os.shift()))}),e.on("message",t=>{try{let n=JSON.parse(t.toString());n.command==="contextResponse"&&bo?(bo(n.data),bo=null):n.command==="securityResponse"&&is?is(n.result):n.command==="inlineComplete"?qa(n):n.command==="connectionRejected"&&ss&&ss(n)}catch{}}),e.on("error",()=>{wo=!1,Dt=null}),e.on("close",()=>{wo=!1,Dt=null})},No=e=>{Dt&&Dt.readyState===yi.OPEN?Dt.send(JSON.stringify(e)):(os.push(e),wo||wr())},So=()=>Dt!==null&&Dt.readyState===yi.OPEN,qa=async e=>{let t="";try{let{generateAutoCompletion:n}=await import("./auto_completion-
|
|
464
|
+
`,x=null;yn.existsSync(h)&&(x=yn.readFileSync(h,"utf8")),x!==i&&yn.writeFileSync(h,i,"utf8")}if(yn.existsSync(n)){let m=yn.readdirSync(n);for(let f of m){let h=En.normalize(En.join("references",f));if(!o.has(h)){let p=En.join(n,f);try{yn.rmSync(p,{recursive:!0,force:!0})}catch{}}}}}catch{}};import{WebSocket as yi}from"ws";var Dt=null,wo=!1,za="ws://localhost:56832",os=[],bo=null,is=null,ss=null,xr="2.0.0",Tc=e=>{xr=e,wr()},rs=e=>{is=e},Ac=e=>{ss=e},wr=()=>{if(Dt||wo)return;wo=!0;let e=new yi(za);e.on("open",()=>{for(Dt=e,wo=!1,Dt.send(JSON.stringify({command:"version",version:xr,pid:process.pid,ppid:process.ppid,cwd:process.cwd()}));os.length>0;)Dt.send(JSON.stringify(os.shift()))}),e.on("message",t=>{try{let n=JSON.parse(t.toString());n.command==="contextResponse"&&bo?(bo(n.data),bo=null):n.command==="securityResponse"&&is?is(n.result):n.command==="inlineComplete"?qa(n):n.command==="connectionRejected"&&ss&&ss(n)}catch{}}),e.on("error",()=>{wo=!1,Dt=null}),e.on("close",()=>{wo=!1,Dt=null})},No=e=>{Dt&&Dt.readyState===yi.OPEN?Dt.send(JSON.stringify(e)):(os.push(e),wo||wr())},So=()=>Dt!==null&&Dt.readyState===yi.OPEN,qa=async e=>{let t="";try{let{generateAutoCompletion:n}=await import("./auto_completion-5MT5LOPN.js");t=await n({prefix:e.prefix||"",suffix:e.suffix||"",fileName:e.fileName||"",language:e.language||"",recentChanges:e.recentChanges||"",clipboard:e.clipboard||""})}catch{t=""}No({command:"inlineCompleteResponse",requestId:e.requestId,completion:t||""})},Cc=e=>{No({command:"status",status:e})},io=()=>new Promise(e=>{if(!Dt||Dt.readyState!==yi.OPEN){e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]});return}bo=e,Dt.send(JSON.stringify({command:"requestContext"})),setTimeout(()=>{bo===e&&(e({cursor_line:0,selected:0,manual_edits:"",file_focused:"none",opened_editors:[]}),bo=null)},1e3)}),br=e=>{let{resolvedPath:t}=mn(e);No({command:"open",filePath:t})},as=(e,t,n)=>{let{resolvedPath:s}=mn(e);No({command:"showDiff",filePath:s,originalContent:t,modifiedContent:n})},Sr=(e,t)=>{let{resolvedPath:n}=mn(e);No({command:"closeDiff",filePath:n,result:t})};var Ho=(e,t)=>{try{if(!Jt.existsSync(e))return null;let n=Array.isArray(t)?t.map(o=>o.toLowerCase()):[t.toLowerCase()],s=Jt.readdirSync(e);for(let o of n){let r=s.find(d=>d.toLowerCase()===o);if(r){let d=sn.join(e,r);if(Jt.statSync(d).isFile())return d}}}catch{}return null},us=(e,t)=>{let n=Ho(e,t);if(n)try{return Jt.readFileSync(n,"utf8")}catch{}return""},kr=new Set([".git","node_modules",".gemini","dist","build",".next","out",".cache","bin","obj","vendor","venv",".idea",".gradle",".terraform","target","coverage",".vscode",".svn",".hg",".fslckout",".github",".gitlab",".circleci",".gitea",".gitee",".lerna",".changeset",".nx",".npm",".yarn",".pnpm-store",".pnpm",".expo",".nuxt",".svelte-kit",".docusaurus",".turbo",".vercel","bower_components",".netlify",".vuepress",".quasar",".output",".angular","jspm_packages",".parcel-cache",".rollup.cache",".rspack",".vitepress","__pycache__",".pytest_cache",".mypy_cache",".tox",".poetry","env","vhdl",".ipynb_checkpoints",".jupyter",".conda",".pdm-build",".bundle",".yardoc",".metadata","App_Data","ClientBin",".cargo",".rustc_info",".go","Godeps","_vendor",".rake_tasks","CMakefiles",".wakatime",".dart_tool",".fvm",".cocoapods","Pods",".pub-cache",".symlinks","DerivedData",".xcworkspace",".serverless",".aws",".gcloud",".azure",".kube",".vagrant",".docker","postgres-data","redis-data","mongo-data",".Spotlight-V100",".Trashes","$RECYCLE.BIN","System Volume Information",".DocumentRevisions-V100",".fseventsd","AppData","Application Data","Local","LocalLow","Roaming","$WinREAgent","$WINDOWS.~BT","$WINDOWS.~WS","scw","System32","SysWOW64",".AppleDouble",".AppleDB",".AppleDesktop","_CodeSignature",".cmio",".LSOverride",".localized",".TemporaryItems",".Trash",".Trash-0",".Trash-1000",".gvfs",".local",".config",".dbus",".fontconfig",".snap",".var",".lost+found","lost+found",".thumb",".thumbnails","EFI","boot","grub","logs","log",".nyc_output",".sonar",".ruff_cache",".VSCodeCounter",".skills","skills"]),gs=(e=process.cwd(),t=0,n=8)=>{let s=[];if(t>n)return s;try{if(!Jt.existsSync(e))return s;let o=Jt.readdirSync(e,{withFileTypes:!0});for(let r of o){let d=r.name,a=sn.join(e,d);if(r.isDirectory())!kr.has(d)&&!kr.has(d.toLowerCase())&&s.push(...gs(a,t+1,n));else if(r.isFile()){let m=d.toLowerCase();(m==="agents.md"||m==="agent.md")&&s.push(a)}}}catch{}return s},Tr=(e,t=2)=>{if(!e)return"";let n=" ".repeat(t);return e.split(/\r?\n/).map(s=>n+s).join(`
|
|
465
465
|
`)},Er=()=>Ho(Kn,["agents.md","agent.md"]),_r=()=>Ho(process.cwd(),["agents.md","agent.md"]),Ir=()=>Ho(Kn,["fluxflow.md"]),Mr=()=>Ho(process.cwd(),["fluxflow.md"]),Fo=Er(),xi=_r(),xn=gs(),Bo=Ir(),Uo=Mr(),Ar=null,fs="",Pr=!1,Xa=e=>{if(!e||!/^<<<[\s\S]*?Identity:/m.test(e))return e;let t=e.match(/^<<<\s*\r?\n([\s\S]*?)\r?\n>>>\s*(?:\r?\n)?([\s\S]*)$/);if(!t)return e;let n=t[1],s=t[2],o=n.match(/^Identity:\s*([\s\S]*?)(?=\r?\n\s*(?:<><|>>>)|$)/m);return o&&(fs=o[1].trim(),process.env.NO_INS=!0),/<><\s*NO_INS/.test(n)&&(Pr=!0),s.trim()},Ja=()=>{Fo=Er();let e=Fo?us(Kn,["agents.md","agent.md"]).trim():"";return e.length===0?(Fo=null,""):e},Qa=()=>{if(xn=gs(),xi=_r(),!xn||xn.length===0)return"";let e=process.cwd(),t=[...xn].sort((o,r)=>{let d=sn.relative(e,o).replace(/\\/g,"/"),a=sn.relative(e,r).replace(/\\/g,"/"),m=!d.includes("/"),f=!a.includes("/");return m&&!f?-1:!m&&f?1:d.localeCompare(a)}),n=[],s=[];for(let o of t)try{let r=Jt.readFileSync(o,"utf8").trim();if(!r||r.length===0)continue;n.push(o);let d=sn.relative(e,o).replace(/\\/g,"/");if(!d.includes("/"))s.push(Tr(r,2));else{let m=sn.dirname(d)+"/:";s.push(`${m}
|
|
466
466
|
${Tr(r,2)}`)}}catch{}return xn=n,xn.length===0&&(xi=null),s.join(`
|
|
467
467
|
|
|
@@ -531,7 +531,7 @@ ${ls}
|
|
|
531
531
|
`:""}${cs.length>0&&n.toLowerCase().includes("flux")?`-- Project Skills --
|
|
532
532
|
${cs}
|
|
533
533
|
|
|
534
|
-
`:""}`.trim()};var Ur=()=>import("./web_search-XBV7AJF7.js").then(e=>e.web_search),Wr=()=>import("./web_scrape-SJBA3RQF.js").then(e=>e.web_scrape),Gr=()=>import("./memory-QTLQAFG7.js").then(e=>e.memory),Hr=()=>import("./chat-YMCO5JNQ.js").then(e=>e.chat),jr=()=>import("./view_file-LWURM2CE.js").then(e=>e.view_file),Kr=()=>import("./write_file-O3YKZSFP.js").then(e=>e.write_file),Vr=()=>import("./update_file-VIKPZENG.js").then(e=>e.update_file),zr=()=>import("./exec_command-E3D5BY3N.js").then(e=>e.exec_command),qr=()=>import("./read_folder-BJ3HS63A.js").then(e=>e.read_folder),ys=()=>import("./ask_user-XQ423UXL.js").then(e=>e.ask_user),Yr=()=>import("./write_pdf-UOCME2OY.js").then(e=>e.write_pdf),Xr=()=>import("./write_docx-54LANNV2.js").then(e=>e.write_docx),ki=()=>import("./search_keyword-F6L5WB2S.js").then(e=>e.search_keyword),Jr=()=>import("./generate_image-5ZVJ7ELI.js").then(e=>e.generate_image),Ti=()=>import("./saveSummary-CVZIOQ4L.js").then(e=>e.saveSummary),jo=()=>import("./addMemScore-U2KYMALL.js").then(e=>e.addMemScore),Qr=()=>import("./file_map-4WUEPRMI.js").then(e=>e.file_map),Ai=()=>import("./todo-3EQZ7LZM.js").then(e=>e.todo),Zr=()=>import("./invokeSync-UZHY6U2N.js").then(e=>e.invokeSync),ol=()=>import("./invoke-QOBG7JPO.js").then(e=>e.invoke),ea=()=>import("./getProgress-MJZDAMSP.js").then(e=>e.getProgress),il=()=>import("./cancel-2PAHCMGB.js").then(e=>e.cancel),ta=()=>import("./emergency_rollback-PHH3BKRP.js").then(e=>e.emergency_rollback),Ko=()=>import("./awaitSubagent-KLH7CRKF.js").then(e=>e.awaitSubagent),Vo=()=>import("./answerSubagent-PIZJSLZN.js").then(e=>e.answerSubagent),Ci=()=>import("./steerSubagent-B34P33YV.js").then(e=>e.steerSubagent),Ri=()=>import("./computer_action-SI6AMRJ6.js").then(e=>e.computer_action),na=()=>import("./click-VXWUG5T3.js").then(e=>e.click),oa=()=>import("./drag-6XCBUY73.js").then(e=>e.drag),ia=()=>import("./scroll-6SPRL73L.js").then(e=>e.scroll),xs=()=>import("./keyboard_typing-TK55ZAVR.js").then(e=>e.keyboard_typing),ws=()=>import("./key_press-ISGXEO42.js").then(e=>e.key_press),bs=()=>import("./recapture_screen-BY4Q4D5X.js").then(e=>e.recapture_screen),vi=()=>import("./find_file-LHPOW4ZM.js").then(e=>e.find_file),sa=()=>import("./wait-6WFCZDO7.js").then(e=>e.wait),ra={web_search:Ur,web_scrape:Wr,memory:Gr,chat:Hr,view_file:jr,write_file:Kr,update_file:Vr,exec_command:zr,read_folder:qr,write_pdf:Yr,write_docx:Xr,search_keyword:ki,generate_image:Jr,saveSummary:Ti,addMemScore:jo,file_map:Qr,todo:Ai,Todo:Ai,goal:Ai,Goal:Ai,invokeSync:Zr,invoke:ol,getProgress:ea,cancel:il,awaitSubagent:Ko,answerSubagent:Vo,steerSubagent:Ci,computer_action:Ri,computer_use:Ri,ComputerAction:Ri,ComputerUse:Ri,click:na,Click:na,drag:oa,Drag:oa,scroll:ia,Scroll:ia,keyboard_typing:xs,KeyboardTyping:xs,keyboardtyping:xs,key_press:ws,KeyPress:ws,keypress:ws,recapture_screen:bs,RecaptureScreen:bs,recapturescreen:bs,invoke_sync:Zr,get_progress:ea,await_subagent:Ko,answer_subagent:Vo,steer_subagent:Ci,steer:Ci,Steer:Ci,ask:ys,Ask:ys,AskUser:ys,WebSearch:Ur,WebScrape:Wr,ReadFile:jr,ReadFolder:qr,WriteFile:Kr,PatchFile:Vr,WritePDF:Yr,WriteDoc:Xr,Run:zr,SearchKeyword:ki,CodeSearch:ki,code_search:ki,Memory:Gr,Chat:Hr,GenerateImage:Jr,saveSumary:Ti,SaveSummary:Ti,SaveSumary:Ti,add_mem_score:jo,AddMemScore:jo,addMemoryScore:jo,AddMemoryScore:jo,FileMap:Qr,answer:Vo,Answer:Vo,AnswerSubagent:Vo,await:Ko,Await:Ko,AwaitSubagent:Ko,EmergencyRollback:ta,emergency_rollback:ta,find_file:vi,findFile:vi,FindFile:vi,findfile:vi,wait:sa,Wait:sa},Ss=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(h=>o.includes(h))||o==="ask",m=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(h=>o.includes(h));if(!d){if(s==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Action [${e}] is a Workspace Tool and NOT available in Flow mode. Tell user to switch (\`/mode flux\`) to use this tool.`}else if(s==="icu"){if(!m)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let f=ra[e];if(!f){let h=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],p={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},g=o.replace(/[^a-z0-9]/g,""),i=p[g]||null;if(!i){let I=0,Ye=P=>{let N=new Set;for(let U=0;U<P.length-1;U++)N.add(P.slice(U,U+2));return N},C=Ye(g);for(let P of h){let N=P.toLowerCase().replace(/[^a-z0-9]/g,"");if(g===N){i=P;break}let U=0;(N.includes(g)||g.includes(N))&&(U+=.6);let $=Ye(N),M=0;for(let ve of C)$.has(ve)&&M++;let Se=2*M/(C.size+$.size||1);U=Math.max(U,Se),U>I&&U>=.35&&(I=U,i=P)}}let x=i?` Do you mean '${i}'?`:"";return`ERROR: Action [${e}] not found in registry.${x}`}try{return await(await f())(t,n)}catch(h){let p=h instanceof Error?h.message:String(h);return`ERROR: Execution failed for [${e}]: ${p}`}};var Ei=e=>{if(!e||typeof e!="string")return!1;let t=e.trim().toLowerCase();return Object.keys(ra).some(n=>n.toLowerCase()===t)};import B from"path";import xe from"fs";import wa from"os";import ba from"crypto";import{execSync as vs}from"child_process";import sl from"gradient-string";var aa=["I have a regex for your problems.","Your terminal, my kingdom.","Blowing on the cartridge helps. Probably.","Don't panic. I have the towel.","Logic is the start of wisdom.","Try to exit Vim? Good luck.","I speak fluent Terminal.","The cake is a lie. This code is not.","I have no bugs, just surprise features.","Rewriting in Rust... just for fun.","Coffee in, clean commits out.","The magic smoke stays inside today.","A semicolon short of a miracle.","One does not simply code without a bug.","Keep it simple. Keep it terminal.","Regex: now you have two problems.","I dream in binary.","Root access or bust.","Wait for the dial-up tone. Just kidding.","I take the 'labor' out of collab.","My other process is a TARDIS.","Calculated response: 42.","Ponder the orb. Ponder the code.","Less talk, more flow.","Elegance in every byte.","Build something the world is not ready for.","Your wishes, my tool calls.","I act in Flux. I think in Flow.","Syntax error in the universe. Please fix.","Your project, my obsession.","I am not a bot, I am an architect.","Digital spirits consulted. They say: Ship it.","Reticulate splines. Engage humor.","Code like poetry. Run like water.","Minimalism is the ultimate flex.","The truth is in the logs.","Follow the white rabbit.","There is no spoon. Only code.","Binary is the only language I trust.","I have a good feeling about this.","Pew pew! Lasers charged.","Divide by zero? Not today.","Search for the correct USB orientation...","I've got a fever, and the only cure is more code.","The code gremlins are on our side.","My favorite command? Yours.","Stay hungry. Stay active.","Momentum is your best friend.","Lead the flow. Don't chase it.","A fresh batch of bytes. Hot and ready.","I orchestrate the ones and zeros.","Smart enough to help. Humble enough to ask.","Think twice. Code once.","Pure intent. Pure execution.","Small steps. Massive impact.","Your terminal is a canvas.","Efficiency is my second name.","I have seen things you people wouldn't believe.","Let the thoughts marinate.","The best feature? The one you don't need.","Precision is the only perfection.","Stay focused. Stay terminal.","Silence is the best debugger.","Erase the debt. Commit the code.","Velocity meets stability.","Ship it. Improve it. Repeat.","Build tomorrow, right now.","Turn logic into reality.","The best way to predict the future is to build it.","Break barriers, not builds.","Fuel the next breakthrough.","Momentum is key.","Terminal vibes only.","Your digital co-pilot is ready.","Partner in code. Partner in crime.","I speak in semicolons.","Ready for the next great idea.","Just a moment. In the zone.","Polishing the algorithms. Hold tight.","Craft a masterpiece today.","Debug the universe. Start here.","Warp speed engaged. Almost.","The cake is not a lie. It's just loading.","Finish the Kessel Run in 12 parsecs.","Do a barrel roll!","Waiting for the respawn.","Press Start to continue.","Herding digital cats... done.","The hamsters are fast today.","Tasting the snozberries.","I go for speed. I go for flow.","Real life or just fantasy?","Poking the bear... gently.","Ensure the magic smoke stays inside.","Try turning it off and on again.","Construct additional pylons.","New line? Ctrl+J is your friend.","Release the HypnoDrones.","Push the button, Frank.","My other loading screen is even funnier.","Pretty sure a cat walked on my keyboard.","Recalibrate the humor-o-meter.","Summon the code gremlins.","I've seen your browser history. Just kidding.","Charge the laser... pew pew!","Dividing by zero... just for a sec.","Looking for an adult supervisor. Found none.","Make it go beep boop.","Buffering... for effect.","Entangle quantum particles... complete.","Polishing the chrome on my algorithms.","Are you not entertained?","Just waiting for the dial-up tone.","Reboot the humor module.","Defragment memories. Check.","Optimizing for ludicrous speed.","Swapping bits. Don't tell the bytes.","Garbage collected. I am back.","Assembling the interwebs.","Converting coffee to logic.","Update syntax for reality.","Rewire the synapses.","Greasin' the cogs.","Engage the improbability drive.","Channel the Force.","Align the stars. Respond now.","The cake is a lie. The prompt is real.","I'm Feeling Lucky.","Shipping awesomeness.","Navigating the slime mold.","Consult digital spirits.","Ask the magic conch shell.","One moment. Optimizing humor.","Shuffling punchlines.","Compiling brilliance.","Summon the cloud of wisdom.","Prepare to dazzle.","Hold tight. Crafting a response.","Tuning the algorithms.","Following the white rabbit... again.","The truth is in here. Somewhere.","Herding cats is my day job.","Distracting you with this phrase.","Almost there. Probably.","Rickrolling my creator. Don't tell.","Slapping the bass.","Is this real life?","Ponder the orb. Type the prompt.","Thoughtful gaze initiated.","Computer's favorite snack? Microchips.","Why Java? Because I don't C#.","Charging the laser... wait for it.","Dividing by zero... just kidding!","Adult supervision not found. Proceed.","Beep boop. I'm a real boy.","Wait for the respawn.","Finish the run. Ship the code.","Fiddling with character creation.","Just a moment. Finding a meme.","Pressing A to continue.","Loading wit.exe.","Pre-heating the servers.","Calibrate flux capacitor.","Channeling the Force.","Aligning the stars.","The truth is in the code.","Don't panic.","Blowing on the cartridge.","Doing a barrel roll!","Respawning in 3... 2... 1...","The cake is a lie.","Fiddling with character settings.","Finding a suitable pun.","Distracting with wit.","Almost ready.","Hamsters on speed today.","Patting Cloudy on the head.","Rickrolling the logs.","Slapping the code.","Got a good feeling about this.","Poking the prompt.","Researching latest memes.","Making it more witty.","Thinking... hmmm.","Fish with no eyes? Fsh.","Broken pencil? Pointless.","Percussive maintenance applied.","USB orientation: 3rd try's the charm.","Rust rewrite in 3... 2...","Exiting Vim... someday.","Spinning the hamster wheel.","Not a bug. Unplanned feature.","Engage.","I'll be back.","Machine spirit consulted.","Letting the thoughts marinate.","Orb pondered.","Thoughtful gaze engaged.","Charging the laser...","Making it go beep.","Buffering...","Quantum particles entangled.","Polishing the chrome.","Entertained yet?","Gremlins summoned.","Dial-up tone finished.","Humor meter recalibrated.","Cat on keyboard. Sending help.","Enhancing...","Turn it off and on again.","Constructing pylons.","HypnoDrones released.","Pushing the button."];var la=["Beware the phantom processes.","A ghost in the shell has taken the wheel.","Blowing on the haunted cartridge...","Seven minutes in Raccoon City.","Wind's howling... in the terminal fans.","Slender Man was spotted in line 404.","The cake is a lie. The curse is real.","Don't look behind the server rack.","Exorcising memory leaks at 3 AM.","Pyramid Head reorganized your commit history.","It's dangerous to go alone! Take this flashlight.","YOU DIED. Respawning terminal session...","The Necronomicon evaluated to true.","Something wicked this way compiles.","Haunting your localhost with good vibes.","A full moon has risen over Git main.","Double, double toil and trouble; code fire burn.","Clickers heard in the directory tree.","Checking camera 2B for rogue animatronics.","The call is coming from inside the container.","Isaac Clarke is stomping on stubborn bugs.","Luigi vacuumed the ghosts out of RAM.","Trick or treat, give me clean code to greet.","Whispering incantations to the garbage collector.","Klaatu barada necktie... close enough.","Resurrecting deprecated APIs from the crypt.","The headless horseman forgot the return statement.","Castlevania whip cracking against network latency.","Slime mold crawling through the motherboard.","Carving a pixelated pumpkin into terminal history.","Burying undefined pointers in the pet sematary.","Spilling pumpkin spice on the CPU.","A vampire bat is draining system battery life.","Don't fall asleep at the keyboard tonight.","Silent Hill sirens sounding in the console.","Poltergeists rearranging terminal tabs.","Lighting the Black Flame Candle for autoExec.","Dusting cobwebs off legacy dependencies.","Here's Johnny! ...just checking build health.","Blood, sweat, and zero warnings.","The spirit box whispers: 'GIT PUSH FORCE'.","They're heeeere... in the stack trace.","It's alive! IT'S ALIVEEEE!","No merge conflicts in the graveyard.","Frankenstein's monster patched this logic.","Surviving Five Nights at Flux Flow.","Doom Slayer loading buckshot into cache.","The grim reaper spared your unused imports.","Candy corn lodged in mechanical switches.","May your latency be low and your crypt be quiet."];var ca=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],ko={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var _i=null;var Ii=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(_i||(_i=ca[Math.floor(Math.random()*ca.length)]),t={..._i,id:"Mystery"}):(_i=null,ko[e]?t=ko[e]:e==="Halloween"?t=ko.Spookfest:e==="GitHub"?t=ko["GitHub Dark"]:e==="Transparent"?t=ko["Transparent Dark"]:t=ko.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan",s=t.toolFeedbackAnsi||"\x1B[95m";return{...t,codeText:n,toolFeedbackAnsi:s}};var rl=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",td=(e=2)=>{let t=rl();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},da=new Date,zo=da.getMonth(),qo=da.getDate(),al=zo===9&&qo>=15||zo===10&&qo<=1,ks=null;(process.env.SPOOKFEST==="true"||al)&&(ks=await import("./halloween-MX3VNQRW.js"));var nd=(e="...",t="Loading...",n="Dark")=>{let s=Ii(n),o=t;if(t==="c_openai"||t==="Custom (OpenAI)")try{let U=di(ai,{})?.systemSettings?.customOpenAIBaseUrl;U&&(o=U)}catch{}let r=s.logoTextAnsi,d=s.logoBodyAnsi,a=s.logoMutedAnsi,m="\x1B[0m",f=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=n==="Spookfest"||s.id==="Spookfest"||n==="Halloween"||s.id==="Halloween",p=zo===9&&qo>=15||zo===10&&qo<=1,g=h&&p||process.env.SPOOKFEST==="true"&&h,i=f;if(g&&ks){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:N,halloweenBat:U,halloweenArtUser:$}=ks;i=Math.random()>.9&&zo===9&&qo>=30?U:Math.random()>.5?N:$}else process.env.HALLOWEEN_EEGG="false";let x=g?la:aa,I=x[Math.floor(Math.random()*x.length)],Ye=s.logoGradient||["#0077ff","#ff00ff"],C=sl(Ye).multiline(i.join(`
|
|
534
|
+
`:""}`.trim()};var Ur=()=>import("./web_search-XBV7AJF7.js").then(e=>e.web_search),Wr=()=>import("./web_scrape-SJBA3RQF.js").then(e=>e.web_scrape),Gr=()=>import("./memory-QTLQAFG7.js").then(e=>e.memory),Hr=()=>import("./chat-YMCO5JNQ.js").then(e=>e.chat),jr=()=>import("./view_file-LWURM2CE.js").then(e=>e.view_file),Kr=()=>import("./write_file-O3YKZSFP.js").then(e=>e.write_file),Vr=()=>import("./update_file-VIKPZENG.js").then(e=>e.update_file),zr=()=>import("./exec_command-E3D5BY3N.js").then(e=>e.exec_command),qr=()=>import("./read_folder-BJ3HS63A.js").then(e=>e.read_folder),ys=()=>import("./ask_user-XQ423UXL.js").then(e=>e.ask_user),Yr=()=>import("./write_pdf-UOCME2OY.js").then(e=>e.write_pdf),Xr=()=>import("./write_docx-54LANNV2.js").then(e=>e.write_docx),ki=()=>import("./search_keyword-F6L5WB2S.js").then(e=>e.search_keyword),Jr=()=>import("./generate_image-5ZVJ7ELI.js").then(e=>e.generate_image),Ti=()=>import("./saveSummary-CVZIOQ4L.js").then(e=>e.saveSummary),jo=()=>import("./addMemScore-U2KYMALL.js").then(e=>e.addMemScore),Qr=()=>import("./file_map-4WUEPRMI.js").then(e=>e.file_map),Ai=()=>import("./todo-3EQZ7LZM.js").then(e=>e.todo),Zr=()=>import("./invokeSync-XAAZL7L2.js").then(e=>e.invokeSync),ol=()=>import("./invoke-HBTZTVAB.js").then(e=>e.invoke),ea=()=>import("./getProgress-MJZDAMSP.js").then(e=>e.getProgress),il=()=>import("./cancel-2PAHCMGB.js").then(e=>e.cancel),ta=()=>import("./emergency_rollback-PHH3BKRP.js").then(e=>e.emergency_rollback),Ko=()=>import("./awaitSubagent-KLH7CRKF.js").then(e=>e.awaitSubagent),Vo=()=>import("./answerSubagent-PIZJSLZN.js").then(e=>e.answerSubagent),Ci=()=>import("./steerSubagent-B34P33YV.js").then(e=>e.steerSubagent),Ri=()=>import("./computer_action-SI6AMRJ6.js").then(e=>e.computer_action),na=()=>import("./click-VXWUG5T3.js").then(e=>e.click),oa=()=>import("./drag-6XCBUY73.js").then(e=>e.drag),ia=()=>import("./scroll-6SPRL73L.js").then(e=>e.scroll),xs=()=>import("./keyboard_typing-TK55ZAVR.js").then(e=>e.keyboard_typing),ws=()=>import("./key_press-ISGXEO42.js").then(e=>e.key_press),bs=()=>import("./recapture_screen-BY4Q4D5X.js").then(e=>e.recapture_screen),vi=()=>import("./find_file-LHPOW4ZM.js").then(e=>e.find_file),sa=()=>import("./wait-6WFCZDO7.js").then(e=>e.wait),ra={web_search:Ur,web_scrape:Wr,memory:Gr,chat:Hr,view_file:jr,write_file:Kr,update_file:Vr,exec_command:zr,read_folder:qr,write_pdf:Yr,write_docx:Xr,search_keyword:ki,generate_image:Jr,saveSummary:Ti,addMemScore:jo,file_map:Qr,todo:Ai,Todo:Ai,goal:Ai,Goal:Ai,invokeSync:Zr,invoke:ol,getProgress:ea,cancel:il,awaitSubagent:Ko,answerSubagent:Vo,steerSubagent:Ci,computer_action:Ri,computer_use:Ri,ComputerAction:Ri,ComputerUse:Ri,click:na,Click:na,drag:oa,Drag:oa,scroll:ia,Scroll:ia,keyboard_typing:xs,KeyboardTyping:xs,keyboardtyping:xs,key_press:ws,KeyPress:ws,keypress:ws,recapture_screen:bs,RecaptureScreen:bs,recapturescreen:bs,invoke_sync:Zr,get_progress:ea,await_subagent:Ko,answer_subagent:Vo,steer_subagent:Ci,steer:Ci,Steer:Ci,ask:ys,Ask:ys,AskUser:ys,WebSearch:Ur,WebScrape:Wr,ReadFile:jr,ReadFolder:qr,WriteFile:Kr,PatchFile:Vr,WritePDF:Yr,WriteDoc:Xr,Run:zr,SearchKeyword:ki,CodeSearch:ki,code_search:ki,Memory:Gr,Chat:Hr,GenerateImage:Jr,saveSumary:Ti,SaveSummary:Ti,SaveSumary:Ti,add_mem_score:jo,AddMemScore:jo,addMemoryScore:jo,AddMemoryScore:jo,FileMap:Qr,answer:Vo,Answer:Vo,AnswerSubagent:Vo,await:Ko,Await:Ko,AwaitSubagent:Ko,EmergencyRollback:ta,emergency_rollback:ta,find_file:vi,findFile:vi,FindFile:vi,findfile:vi,wait:sa,Wait:sa},Ss=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(h=>o.includes(h))||o==="ask",m=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(h=>o.includes(h));if(!d){if(s==="flow"){if(!(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image")))return`ERROR: Action [${e}] is a Workspace Tool and NOT available in Flow mode. Tell user to switch (\`/mode flux\`) to use this tool.`}else if(s==="icu"){if(!m)return`ERROR: Action [${e}] is not available in Computer Use mode. ICU mode only supports Computer Use tools (Click, Drag, Scroll, KeyboardTyping, KeyPress, RecaptureScreen).`}else if(o.includes("write_pdf")||o.includes("write_docx")||o.includes("generate_image"))return`ERROR: Action [${e}] is not available in ${n.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let f=ra[e];if(!f){let h=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],p={read:"ReadFile",view:"ReadFile",viewfile:"ReadFile",write:"WriteFile",edit:"PatchFile",patch:"PatchFile",update:"PatchFile",updatefile:"PatchFile",exec:"Run",command:"Run",bash:"Run",shell:"Run",powershell:"Run",search:"CodeSearch",grep:"CodeSearch",find:"FindFile",findfile:"FindFile",searchkeyword:"CodeSearch",folder:"ReadFolder",ls:"ReadFolder",dir:"ReadFolder",list:"ReadFolder",ask:"AskUser",question:"AskUser",pdf:"WritePDF",docx:"WriteDoc",doc:"WriteDoc",word:"WriteDoc",screenshot:"RecaptureScreen",screen:"RecaptureScreen",recapture:"RecaptureScreen",type:"KeyboardTyping",typing:"KeyboardTyping",keyboard:"KeyboardTyping",press:"KeyPress",key:"KeyPress",todo:"Goal",task:"Goal",subagent:"Invoke",agent:"Invoke"},g=o.replace(/[^a-z0-9]/g,""),i=p[g]||null;if(!i){let I=0,Ye=P=>{let N=new Set;for(let U=0;U<P.length-1;U++)N.add(P.slice(U,U+2));return N},C=Ye(g);for(let P of h){let N=P.toLowerCase().replace(/[^a-z0-9]/g,"");if(g===N){i=P;break}let U=0;(N.includes(g)||g.includes(N))&&(U+=.6);let $=Ye(N),M=0;for(let ve of C)$.has(ve)&&M++;let Se=2*M/(C.size+$.size||1);U=Math.max(U,Se),U>I&&U>=.35&&(I=U,i=P)}}let x=i?` Do you mean '${i}'?`:"";return`ERROR: Action [${e}] not found in registry.${x}`}try{return await(await f())(t,n)}catch(h){let p=h instanceof Error?h.message:String(h);return`ERROR: Execution failed for [${e}]: ${p}`}};var Ei=e=>{if(!e||typeof e!="string")return!1;let t=e.trim().toLowerCase();return Object.keys(ra).some(n=>n.toLowerCase()===t)};import B from"path";import xe from"fs";import wa from"os";import ba from"crypto";import{execSync as vs}from"child_process";import sl from"gradient-string";var aa=["I have a regex for your problems.","Your terminal, my kingdom.","Blowing on the cartridge helps. Probably.","Don't panic. I have the towel.","Logic is the start of wisdom.","Try to exit Vim? Good luck.","I speak fluent Terminal.","The cake is a lie. This code is not.","I have no bugs, just surprise features.","Rewriting in Rust... just for fun.","Coffee in, clean commits out.","The magic smoke stays inside today.","A semicolon short of a miracle.","One does not simply code without a bug.","Keep it simple. Keep it terminal.","Regex: now you have two problems.","I dream in binary.","Root access or bust.","Wait for the dial-up tone. Just kidding.","I take the 'labor' out of collab.","My other process is a TARDIS.","Calculated response: 42.","Ponder the orb. Ponder the code.","Less talk, more flow.","Elegance in every byte.","Build something the world is not ready for.","Your wishes, my tool calls.","I act in Flux. I think in Flow.","Syntax error in the universe. Please fix.","Your project, my obsession.","I am not a bot, I am an architect.","Digital spirits consulted. They say: Ship it.","Reticulate splines. Engage humor.","Code like poetry. Run like water.","Minimalism is the ultimate flex.","The truth is in the logs.","Follow the white rabbit.","There is no spoon. Only code.","Binary is the only language I trust.","I have a good feeling about this.","Pew pew! Lasers charged.","Divide by zero? Not today.","Search for the correct USB orientation...","I've got a fever, and the only cure is more code.","The code gremlins are on our side.","My favorite command? Yours.","Stay hungry. Stay active.","Momentum is your best friend.","Lead the flow. Don't chase it.","A fresh batch of bytes. Hot and ready.","I orchestrate the ones and zeros.","Smart enough to help. Humble enough to ask.","Think twice. Code once.","Pure intent. Pure execution.","Small steps. Massive impact.","Your terminal is a canvas.","Efficiency is my second name.","I have seen things you people wouldn't believe.","Let the thoughts marinate.","The best feature? The one you don't need.","Precision is the only perfection.","Stay focused. Stay terminal.","Silence is the best debugger.","Erase the debt. Commit the code.","Velocity meets stability.","Ship it. Improve it. Repeat.","Build tomorrow, right now.","Turn logic into reality.","The best way to predict the future is to build it.","Break barriers, not builds.","Fuel the next breakthrough.","Momentum is key.","Terminal vibes only.","Your digital co-pilot is ready.","Partner in code. Partner in crime.","I speak in semicolons.","Ready for the next great idea.","Just a moment. In the zone.","Polishing the algorithms. Hold tight.","Craft a masterpiece today.","Debug the universe. Start here.","Warp speed engaged. Almost.","The cake is not a lie. It's just loading.","Finish the Kessel Run in 12 parsecs.","Do a barrel roll!","Waiting for the respawn.","Press Start to continue.","Herding digital cats... done.","The hamsters are fast today.","Tasting the snozberries.","I go for speed. I go for flow.","Real life or just fantasy?","Poking the bear... gently.","Ensure the magic smoke stays inside.","Try turning it off and on again.","Construct additional pylons.","New line? Ctrl+J is your friend.","Release the HypnoDrones.","Push the button, Frank.","My other loading screen is even funnier.","Pretty sure a cat walked on my keyboard.","Recalibrate the humor-o-meter.","Summon the code gremlins.","I've seen your browser history. Just kidding.","Charge the laser... pew pew!","Dividing by zero... just for a sec.","Looking for an adult supervisor. Found none.","Make it go beep boop.","Buffering... for effect.","Entangle quantum particles... complete.","Polishing the chrome on my algorithms.","Are you not entertained?","Just waiting for the dial-up tone.","Reboot the humor module.","Defragment memories. Check.","Optimizing for ludicrous speed.","Swapping bits. Don't tell the bytes.","Garbage collected. I am back.","Assembling the interwebs.","Converting coffee to logic.","Update syntax for reality.","Rewire the synapses.","Greasin' the cogs.","Engage the improbability drive.","Channel the Force.","Align the stars. Respond now.","The cake is a lie. The prompt is real.","I'm Feeling Lucky.","Shipping awesomeness.","Navigating the slime mold.","Consult digital spirits.","Ask the magic conch shell.","One moment. Optimizing humor.","Shuffling punchlines.","Compiling brilliance.","Summon the cloud of wisdom.","Prepare to dazzle.","Hold tight. Crafting a response.","Tuning the algorithms.","Following the white rabbit... again.","The truth is in here. Somewhere.","Herding cats is my day job.","Distracting you with this phrase.","Almost there. Probably.","Rickrolling my creator. Don't tell.","Slapping the bass.","Is this real life?","Ponder the orb. Type the prompt.","Thoughtful gaze initiated.","Computer's favorite snack? Microchips.","Why Java? Because I don't C#.","Charging the laser... wait for it.","Dividing by zero... just kidding!","Adult supervision not found. Proceed.","Beep boop. I'm a real boy.","Wait for the respawn.","Finish the run. Ship the code.","Fiddling with character creation.","Just a moment. Finding a meme.","Pressing A to continue.","Loading wit.exe.","Pre-heating the servers.","Calibrate flux capacitor.","Channeling the Force.","Aligning the stars.","The truth is in the code.","Don't panic.","Blowing on the cartridge.","Doing a barrel roll!","Respawning in 3... 2... 1...","The cake is a lie.","Fiddling with character settings.","Finding a suitable pun.","Distracting with wit.","Almost ready.","Hamsters on speed today.","Patting Cloudy on the head.","Rickrolling the logs.","Slapping the code.","Got a good feeling about this.","Poking the prompt.","Researching latest memes.","Making it more witty.","Thinking... hmmm.","Fish with no eyes? Fsh.","Broken pencil? Pointless.","Percussive maintenance applied.","USB orientation: 3rd try's the charm.","Rust rewrite in 3... 2...","Exiting Vim... someday.","Spinning the hamster wheel.","Not a bug. Unplanned feature.","Engage.","I'll be back.","Machine spirit consulted.","Letting the thoughts marinate.","Orb pondered.","Thoughtful gaze engaged.","Charging the laser...","Making it go beep.","Buffering...","Quantum particles entangled.","Polishing the chrome.","Entertained yet?","Gremlins summoned.","Dial-up tone finished.","Humor meter recalibrated.","Cat on keyboard. Sending help.","Enhancing...","Turn it off and on again.","Constructing pylons.","HypnoDrones released.","Pushing the button."];var la=["Beware the phantom processes.","A ghost in the shell has taken the wheel.","Blowing on the haunted cartridge...","Seven minutes in Raccoon City.","Wind's howling... in the terminal fans.","Slender Man was spotted in line 404.","The cake is a lie. The curse is real.","Don't look behind the server rack.","Exorcising memory leaks at 3 AM.","Pyramid Head reorganized your commit history.","It's dangerous to go alone! Take this flashlight.","YOU DIED. Respawning terminal session...","The Necronomicon evaluated to true.","Something wicked this way compiles.","Haunting your localhost with good vibes.","A full moon has risen over Git main.","Double, double toil and trouble; code fire burn.","Clickers heard in the directory tree.","Checking camera 2B for rogue animatronics.","The call is coming from inside the container.","Isaac Clarke is stomping on stubborn bugs.","Luigi vacuumed the ghosts out of RAM.","Trick or treat, give me clean code to greet.","Whispering incantations to the garbage collector.","Klaatu barada necktie... close enough.","Resurrecting deprecated APIs from the crypt.","The headless horseman forgot the return statement.","Castlevania whip cracking against network latency.","Slime mold crawling through the motherboard.","Carving a pixelated pumpkin into terminal history.","Burying undefined pointers in the pet sematary.","Spilling pumpkin spice on the CPU.","A vampire bat is draining system battery life.","Don't fall asleep at the keyboard tonight.","Silent Hill sirens sounding in the console.","Poltergeists rearranging terminal tabs.","Lighting the Black Flame Candle for autoExec.","Dusting cobwebs off legacy dependencies.","Here's Johnny! ...just checking build health.","Blood, sweat, and zero warnings.","The spirit box whispers: 'GIT PUSH FORCE'.","They're heeeere... in the stack trace.","It's alive! IT'S ALIVEEEE!","No merge conflicts in the graveyard.","Frankenstein's monster patched this logic.","Surviving Five Nights at Flux Flow.","Doom Slayer loading buckshot into cache.","The grim reaper spared your unused imports.","Candy corn lodged in mechanical switches.","May your latency be low and your crypt be quiet."];var ca=[{name:"Cyan Cyberpunk",text:"cyan",textMuted:"#4da6b8",textDim:"#2d6d7a",textInverted:"black",border:"cyan",borderMuted:"#1a5966",borderDim:"#0f3840",bg:void 0,cardBg:"#061e24",highlightBg:"#092b33",activeBg:"#0e3e4a",inputBg:"#092b33",inputBorder:"#092b33",inputText:"cyan",inputPlaceholder:"#2d6d7a",inputPrompt:"cyan",codeBg:"#020d10",codeBorder:"#1a5966",userMsgBg:"#092b33",userMsgBorder:"#092b33",userMsgText:"cyan",diffRemovalBg:"#3a0c1a",diffAdditionBg:"#0c3a32",diffRemovalText:"#ff4d88",diffAdditionText:"#00ffaa",diffRemovalHighlightColor:"#ff1a66",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#00ffcc",diffAdditionHighlightBg:"#00593b",diffRemovalNum:"#ff4d88",diffAdditionNum:"#00ffaa",diffRemovalPrefix:"#ff1a66",diffAdditionPrefix:"#00ffcc",primary:"cyan",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"cyan",statusOff:"#2d6d7a",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[36m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ffff","#0088ff"]},{name:"Magenta Vaporwave",text:"magenta",textMuted:"#c451d6",textDim:"#7d2b8a",textInverted:"black",border:"magenta",borderMuted:"#5e1b69",borderDim:"#3b0f42",bg:void 0,cardBg:"#240729",highlightBg:"#310938",activeBg:"#470e52",inputBg:"#310938",inputBorder:"#310938",inputText:"magenta",inputPlaceholder:"#7d2b8a",inputPrompt:"magenta",codeBg:"#100312",codeBorder:"#5e1b69",userMsgBg:"#310938",userMsgBorder:"#310938",userMsgText:"magenta",diffRemovalBg:"#3a0c20",diffAdditionBg:"#200c3a",diffRemovalText:"#ff4d94",diffAdditionText:"#aa4dff",diffRemovalHighlightColor:"#ff1a75",diffRemovalHighlightBg:"#59002b",diffAdditionHighlightColor:"#bb66ff",diffAdditionHighlightBg:"#3b0059",diffRemovalNum:"#ff4d94",diffAdditionNum:"#aa4dff",diffRemovalPrefix:"#ff1a75",diffAdditionPrefix:"#bb66ff",primary:"magenta",secondary:"cyan",accent:"purple",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"magenta",statusOff:"#7d2b8a",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff00ff","#8800ff"]},{name:"Glitch Matrix",text:"#00ff41",textMuted:"#00b32d",textDim:"#00661a",textInverted:"black",border:"#00ff41",borderMuted:"#008020",borderDim:"#004d13",bg:void 0,cardBg:"#0d1f0d",highlightBg:"#122912",activeBg:"#1c3e1c",inputBg:"#122912",inputBorder:"#122912",inputText:"#00ff41",inputPlaceholder:"#00b32d",inputPrompt:"#ffff00",codeBg:"#040a04",codeBorder:"#008020",userMsgBg:"#122912",userMsgBorder:"#122912",userMsgText:"#00ff41",diffRemovalBg:"#3a001a",diffAdditionBg:"#003a10",diffRemovalText:"#ff0055",diffAdditionText:"#00ff66",diffRemovalHighlightColor:"#ff0033",diffRemovalHighlightBg:"#59001b",diffAdditionHighlightColor:"#33ff88",diffAdditionHighlightBg:"#005918",diffRemovalNum:"#ff0055",diffAdditionNum:"#00ff66",diffRemovalPrefix:"#ff0033",diffAdditionPrefix:"#33ff88",primary:"#00ff41",secondary:"yellow",accent:"cyan",success:"#00ff41",warning:"yellow",danger:"red",info:"cyan",statusOn:"#00ff41",statusOff:"#00661a",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#00ff41","#ffff00"]},{name:"Warm Sunset",text:"#ffaa55",textMuted:"#cc8844",textDim:"#885522",textInverted:"black",border:"#ff9933",borderMuted:"#aa6622",borderDim:"#663311",bg:void 0,cardBg:"#24180f",highlightBg:"#2e1e12",activeBg:"#422c1b",inputBg:"#2e1e12",inputBorder:"#2e1e12",inputText:"#ffaa55",inputPlaceholder:"#885522",inputPrompt:"#ff7733",codeBg:"#120c08",codeBorder:"#aa6622",userMsgBg:"#2e1e12",userMsgBorder:"#2e1e12",userMsgText:"#ffaa55",diffRemovalBg:"#3d120c",diffAdditionBg:"#3a2e0c",diffRemovalText:"#ff5544",diffAdditionText:"#ffcc33",diffRemovalHighlightColor:"#ff3322",diffRemovalHighlightBg:"#591108",diffAdditionHighlightColor:"#ffee44",diffAdditionHighlightBg:"#594400",diffRemovalNum:"#ff5544",diffAdditionNum:"#ffcc33",diffRemovalPrefix:"#ff3322",diffAdditionPrefix:"#ffee44",primary:"#ffaa55",secondary:"#ff7733",accent:"magenta",success:"#ffcc33",warning:"#ff7733",danger:"#ff3322",info:"#ffaa55",statusOn:"#ffaa55",statusOff:"#885522",logoTextAnsi:"\x1B[1;33m",logoBodyAnsi:"\x1B[33m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ff9933","#ff0055"]},{name:"Sakura Blossom",text:"#ffc0e0",textMuted:"#d98cb3",textDim:"#804d66",textInverted:"black",border:"#ff99cc",borderMuted:"#aa4d7a",borderDim:"#662647",bg:void 0,cardBg:"#291320",highlightBg:"#331826",activeBg:"#472235",inputBg:"#331826",inputBorder:"#331826",inputText:"#ffc0e0",inputPlaceholder:"#804d66",inputPrompt:"#ff99cc",codeBg:"#140a10",codeBorder:"#aa4d7a",userMsgBg:"#331826",userMsgBorder:"#331826",userMsgText:"#ffc0e0",diffRemovalBg:"#3e0c1b",diffAdditionBg:"#1b3e2b",diffRemovalText:"#ff6699",diffAdditionText:"#66ffb3",diffRemovalHighlightColor:"#ff3377",diffRemovalHighlightBg:"#590022",diffAdditionHighlightColor:"#33ff99",diffAdditionHighlightBg:"#00592e",diffRemovalNum:"#ff6699",diffAdditionNum:"#66ffb3",diffRemovalPrefix:"#ff3377",diffAdditionPrefix:"#33ff99",primary:"#ffc0e0",secondary:"#ff99cc",accent:"magenta",success:"#66ffb3",warning:"yellow",danger:"#ff3377",info:"#ff99cc",statusOn:"#ffc0e0",statusOff:"#804d66",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ffb3d9","#ff3399"]},{name:"Radioactive Slime",text:"#ccff00",textMuted:"#99cc00",textDim:"#669900",textInverted:"#0a0f00",border:"#ccff00",borderMuted:"#99cc00",borderDim:"#669900",bg:void 0,cardBg:"#0f1400",highlightBg:"#1a2400",activeBg:"#2a3b00",inputBg:"#1a2400",inputBorder:"#1a2400",inputText:"#ccff00",inputPlaceholder:"#669900",inputPrompt:"#cc00ff",codeBg:"#050a00",codeBorder:"#99cc00",userMsgBg:"#1a2400",userMsgBorder:"#1a2400",userMsgText:"#ccff00",diffRemovalBg:"#2a0033",diffAdditionBg:"#0f3300",diffRemovalText:"#ff00cc",diffAdditionText:"#00ff33",diffRemovalHighlightColor:"#ff33cc",diffRemovalHighlightBg:"#4d0066",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#1a6600",diffRemovalNum:"#ff00cc",diffAdditionNum:"#00ff33",diffRemovalPrefix:"#ff33cc",diffAdditionPrefix:"#33ff66",primary:"#ccff00",secondary:"#cc00ff",accent:"#ff00cc",success:"#00ff33",warning:"#ffcc00",danger:"#ff0033",info:"#00ccff",statusOn:"#ccff00",statusOff:"#669900",logoTextAnsi:"\x1B[1;38;5;190m",logoBodyAnsi:"\x1B[38;5;190m",logoMutedAnsi:"\x1B[90m",logoGradient:["#ccff00","#cc00ff"]},{name:"Cosmic Void",text:"#f0f8ff",textMuted:"#a6aeb5",textDim:"#5e656e",textInverted:"#010103",border:"#f0f8ff",borderMuted:"#a6aeb5",borderDim:"#5e656e",bg:void 0,cardBg:"#05030d",highlightBg:"#0b081a",activeBg:"#171133",inputBg:"#0b081a",inputBorder:"#0b081a",inputText:"#f0f8ff",inputPlaceholder:"#5e656e",inputPrompt:"#ff007f",codeBg:"#020108",codeBorder:"#a6aeb5",userMsgBg:"#0b081a",userMsgBorder:"#0b081a",userMsgText:"#f0f8ff",diffRemovalBg:"#2e0a29",diffAdditionBg:"#091c33",diffRemovalText:"#ff33a6",diffAdditionText:"#33d6ff",diffRemovalHighlightColor:"#ff66c2",diffRemovalHighlightBg:"#5c1452",diffAdditionHighlightColor:"#66e0ff",diffAdditionHighlightBg:"#123866",diffRemovalNum:"#ff33a6",diffAdditionNum:"#33d6ff",diffRemovalPrefix:"#ff66c2",diffAdditionPrefix:"#66e0ff",primary:"#f0f8ff",secondary:"#ff007f",accent:"#9d00ff",success:"#33d6ff",warning:"#ffcc00",danger:"#ff0040",info:"#9d00ff",statusOn:"#f0f8ff",statusOff:"#5e656e",logoTextAnsi:"\x1B[1;38;5;231m",logoBodyAnsi:"\x1B[38;5;231m",logoMutedAnsi:"\x1B[38;5;240m",logoGradient:["#ffffff","#9d00ff"]},{name:"Magma Eruption",text:"#ff4d00",textMuted:"#cc3d00",textDim:"#802600",textInverted:"#0d0300",border:"#ff4d00",borderMuted:"#cc3d00",borderDim:"#802600",bg:void 0,cardBg:"#1a0600",highlightBg:"#260a00",activeBg:"#401100",inputBg:"#260a00",inputBorder:"#260a00",inputText:"#ff4d00",inputPlaceholder:"#802600",inputPrompt:"#ffcc00",codeBg:"#080200",codeBorder:"#cc3d00",userMsgBg:"#260a00",userMsgBorder:"#260a00",userMsgText:"#ff4d00",diffRemovalBg:"#2e0a0a",diffAdditionBg:"#1f1400",diffRemovalText:"#ff3333",diffAdditionText:"#ffaa00",diffRemovalHighlightColor:"#ff6666",diffRemovalHighlightBg:"#5c1414",diffAdditionHighlightColor:"#ffcc33",diffAdditionHighlightBg:"#3d2900",diffRemovalNum:"#ff3333",diffAdditionNum:"#ffaa00",diffRemovalPrefix:"#ff6666",diffAdditionPrefix:"#ffcc33",primary:"#ff4d00",secondary:"#ffcc00",accent:"#ff0040",success:"#ffaa00",warning:"#ffff00",danger:"#ff0000",info:"#ff8800",statusOn:"#ff4d00",statusOff:"#802600",logoTextAnsi:"\x1B[1;38;5;202m",logoBodyAnsi:"\x1B[38;5;202m",logoMutedAnsi:"\x1B[38;5;236m",logoGradient:["#ff4d00","#ff0000"]}],ko={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var _i=null;var Ii=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(_i||(_i=ca[Math.floor(Math.random()*ca.length)]),t={..._i,id:"Mystery"}):(_i=null,ko[e]?t=ko[e]:e==="Halloween"?t=ko.Spookfest:e==="GitHub"?t=ko["GitHub Dark"]:e==="Transparent"?t=ko["Transparent Dark"]:t=ko.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan",s=t.toolFeedbackAnsi||"\x1B[95m";return{...t,codeText:n,toolFeedbackAnsi:s}};var rl=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",td=(e=2)=>{let t=rl();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},da=new Date,zo=da.getMonth(),qo=da.getDate(),al=zo===9&&qo>=15||zo===10&&qo<=1,ks=null;(process.env.SPOOKFEST==="true"||al)&&(ks=await import("./halloween-MX3VNQRW.js"));var nd=(e="...",t="Loading...",n="Dark")=>{let s=Ii(n),o=t;if(t==="c_openai"||t==="Custom (OpenAI)")try{let U=di(ai,{})?.systemSettings?.customOpenAIBaseUrl;U&&(o=U)}catch{}let r=s.logoTextAnsi,d=s.logoBodyAnsi,a=s.logoMutedAnsi,m="\x1B[0m",f=[" \u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2591\u2591\u2591\u2588\u2588\u2588 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2588\u2588\u2588\u2591 "," \u2591\u2591\u2591 "],h=n==="Spookfest"||s.id==="Spookfest"||n==="Halloween"||s.id==="Halloween",p=zo===9&&qo>=15||zo===10&&qo<=1,g=h&&p||process.env.SPOOKFEST==="true"&&h,i=f;if(g&&ks){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:N,halloweenBat:U,halloweenArtUser:$}=ks;i=Math.random()>.9&&zo===9&&qo>=30?U:Math.random()>.5?N:$}else process.env.HALLOWEEN_EEGG="false";let x=g?la:aa,I=x[Math.floor(Math.random()*x.length)],Ye=s.logoGradient||["#0077ff","#ff00ff"],C=sl(Ye).multiline(i.join(`
|
|
535
535
|
`)).split(`
|
|
536
536
|
`),P=N=>`${a}${N}${m}`;return`${C[0]}
|
|
537
537
|
${C[1]} ${r}Selected ${g?"Pumpkin":"Provider"}: ${o}${m}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as b,c as p}from"./chunk-56EJGQU3.js";import{a as D}from"./chunk-6LM3YRRE.js";var q=async(_,s={})=>{let{runSubagent:y}=await import("./ai-
|
|
1
|
+
import{a as b,c as p}from"./chunk-56EJGQU3.js";import{a as D}from"./chunk-6LM3YRRE.js";var q=async(_,s={})=>{let{runSubagent:y}=await import("./ai-6AJFPN2Z.js"),a=D(_,["task","instruction","prompt","model","title","tools","id"]),u=a.task||a.instruction||a.prompt,A=a.model||null,g=a.title||null,w=a.tools||null,m=a.id&&a.id!=="null"&&a.id!=="undefined"&&a.id!==""?String(a.id).trim():null;if(!u)return'ERROR: Missing "task" argument for invoke.';let d=null,U="";m&&(d=b.find(e=>e.id===m));let f=!!d,r=f?d.id:m||`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,I=f?d.history||[]:[],C=null;if(w)try{let e=w.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),C=e.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let h=null,S=null,E=new Promise((e,n)=>{h=e,S=n}),t=d;t?(t.status="running",t.task=u,g&&(t.title=g),t.startedAt=Date.now(),t.lastChunkTime=Date.now(),t.completionPromise=E,t._resolveCompletion=h,t._rejectCompletion=S):(t={id:r,title:g||u.substring(0,30),task:u,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:e=>{e&&t.pendingSteerMessages.push(e)},completionPromise:E,_resolveCompletion:h,_rejectCompletion:S,progress:[],history:[]},b.push(t));let l={chunks:[],totalWords:0};s.onSubagentUpdate&&s.onSubagentUpdate();let i=[],M={...s,taskId:r,onHistoryUpdate:e=>{t.history=[...e]},onAskMain:async e=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,k=new Promise(T=>{o=T}),c={id:n,question:e,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return t.questions.push(c),t.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" is WAITING FOR YOUR INPUT: "${e}"
|
|
2
2
|
Respond using tool: [action:Answer(id="${r}", answer="...")]
|
|
3
3
|
[/SYSTEM]`),await k},onVisualFeedback:e=>{t.lastChunkTime=Date.now();let n=e.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?t.currentTool=o[1].trim():t.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(e,n)=>{let o=Date.now();if(t.lastChunkTime=o,t.currentTool="Thinking",typeof n=="number"&&n>0){l.totalWords+=n,l.chunks.push({time:o,words:n});let k=o-400;if(l.chunks=l.chunks.filter(c=>c.time>=k),l.chunks.length>0){let c=l.chunks.reduce((v,R)=>v+R.words,0),$=l.chunks[0].time,T=Math.max(.4,(o-$)/1e3);t.wps=Math.round(c/T)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return y(u,M,A,C,null,e=>{if(t.status==="cancelled")return;if(e.startsWith("[Subagent Turn")&&i.length>0&&(t.progress.push([...i]),i=[]),e.includes("[Executing Tool]")){let o=e.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!t.currentTool||t.currentTool==="Thinking")&&(t.currentTool=o[1])}let n=e;if(n.startsWith("[Tool Result]")||n.startsWith("[Action Result]")){let o=n.split(`
|
|
4
4
|
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
5
5
|
`)+`
|
|
6
|
-
... [Content/Diff Truncated from Logs] ...`)}i.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0,I).then(e=>{if(t.status==="cancelled"){t._resolveCompletion&&t._resolveCompletion(e);return}i.length>0&&(t.progress.push([...i]),i=[]),t.status="completed",t.finalAnswer=e,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) has FINISHED. Call GetProgress(id="${r}") to see the final result. [/SYSTEM]`),t._resolveCompletion&&t._resolveCompletion(e)}).catch(async e=>{let{isTerminationSignaled:n}=await import("./ai-
|
|
6
|
+
... [Content/Diff Truncated from Logs] ...`)}i.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0,I).then(e=>{if(t.status==="cancelled"){t._resolveCompletion&&t._resolveCompletion(e);return}i.length>0&&(t.progress.push([...i]),i=[]),t.status="completed",t.finalAnswer=e,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) has FINISHED. Call GetProgress(id="${r}") to see the final result. [/SYSTEM]`),t._resolveCompletion&&t._resolveCompletion(e)}).catch(async e=>{let{isTerminationSignaled:n}=await import("./ai-6AJFPN2Z.js");if(e.message==="Subagent task was cancelled."||t.status==="cancelled"||n()){t.status="cancelled",i.push("[SUBAGENT CANCELLED] Task was cancelled."),t.progress.push([...i]),s.onSubagentUpdate&&s.onSubagentUpdate(),t._resolveCompletion&&t._resolveCompletion(null);return}i.push(`[SUBAGENT FAILURE] Error: ${e.message}`),t.progress.push([...i]),t.status="failed",t.error=e.message,s.onSubagentUpdate&&s.onSubagentUpdate(),p(`[SYSTEM] Background subagent "${t.title}" (id: ${r}) FAILED with error: ${e.message}. [/SYSTEM]`),t._rejectCompletion&&t._rejectCompletion(e)}),f?`Background subagent ${r} resumed.`:U?`Background subagent started. Task ID: ${r}.${U}`:`Background subagent started. Task ID: ${r}`};export{q as invoke};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as m}from"./chunk-56EJGQU3.js";import{a as g}from"./chunk-6LM3YRRE.js";var A=async(p,a={})=>{let{runSubagent:f}=await import("./ai-
|
|
1
|
+
import{a as m}from"./chunk-56EJGQU3.js";import{a as g}from"./chunk-6LM3YRRE.js";var A=async(p,a={})=>{let{runSubagent:f}=await import("./ai-6AJFPN2Z.js"),e=g(p,["task","instruction","prompt","model","tools","title","id"]),l=e.task||e.instruction||e.prompt,k=e.model||null,c=e.tools||null,u=e.id&&e.id!=="null"&&e.id!=="undefined"&&e.id!==""?String(e.id).trim():null;if(!l)return'ERROR: Missing "task" argument for invokeSync.';let n=null,d="";u&&(n=m.find(t=>t.id===u));let o=n?n.id:u||`subagent-sync-${Date.now()}-${Math.floor(Math.random()*1e3)}`,$=n?.history||[],b=null;if(c)try{let t=c.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),b=t.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let r=e.title||(n?n.title:l.substring(0,30)),s=n;s?(s.status="running",s.task=l):(s={id:o,title:r,task:l,status:"running",startedAt:Date.now(),progress:[],history:[]},m.push(s));let y={...a,taskId:o,onHistoryUpdate:t=>{s.history=[...t]}};try{a.onVisualFeedback&&a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r}${n?" (Resumed)":""}`);let t=await f(l,y,k,b,null,null,!1,$);s.status="completed",s.finalAnswer=`Subagent task completed. (ID: ${o})
|
|
2
2
|
Final Answer:
|
|
3
3
|
${t}`,a.onVisualFeedback&&a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r} [COMPLETED]
|
|
4
4
|
`);let i=`Subagent task completed. (ID: ${o})
|
|
5
5
|
Final Answer:
|
|
6
|
-
${t}`;return d?`${i}${d}`:i}catch(t){s.status="failed",s.error=t.message;let{isTerminationSignaled:i}=await import("./ai-
|
|
6
|
+
${t}`;return d?`${i}${d}`:i}catch(t){s.status="failed",s.error=t.message;let{isTerminationSignaled:i}=await import("./ai-6AJFPN2Z.js"),h=t.message==="Subagent task was cancelled by user."||i();if(a.onVisualFeedback){let S=h?"[CANCELLED]":"[FAILED]";a.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${r} ${S}
|
|
7
7
|
`)}return`ERROR: Subagent execution failed: ${t.message}${d}`}};export{A as invokeSync};
|
package/dist/cli.js
CHANGED
|
@@ -65,7 +65,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(oe&&(console.log(`v${i}`),pr
|
|
|
65
65
|
/docs View documentation
|
|
66
66
|
/fluxflow init Create FluxFlow.md template
|
|
67
67
|
/update check Check for new version
|
|
68
|
-
/update latest Install latest release`),process.exit(0)),se){let C=t[1]||"latest";if(C==="check"){let x=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(x?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let m=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;m||(console.error("Error: Could not retrieve latest version."),process.exit(1)),m===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let r=(await import("react")).default,{useState:w}=r,{render:U,Box:h,Text:S}=await import("ink"),ie=(await import("ink-select-input")).default,_=(await import("ink-text-input")).default;return new Promise(D=>{let P=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:E,isSelected:F})=>r.createElement(h,{width:"100%"},r.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),b,X=()=>{let[E,F]=w("select"),[J,j]=w(""),z=R=>{R.value==="custom"?F("custom"):B({manager:R.value})},K=R=>{B({manager:"custom",customCommand:R})};return E==="custom"?r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),r.createElement(h,{flexDirection:"row"},r.createElement(S,{color:"cyan",bold:!0}," \u276F "),r.createElement(_,{value:J,onChange:j,onSubmit:K})),r.createElement(h,{marginTop:1},r.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),r.createElement(ie,{items:P,onSelect:z,itemComponent:H,indicatorComponent:()=>null}))},B=E=>{b&&b(),D(E)},{unmount:V}=U(r.createElement(X,null));b=V})},n,k="",A;try{let{loadSettings:r}=await import("./chunks/settings-YRMZZJ3F.js");A=await r(),n=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!n){let r=await y();n=r.manager,k=r.customCommand}let p="";n==="pnpm"?p=`pnpm add -g fluxflow-cli@${m}`:n==="bun"?p=`bun add -g fluxflow-cli@${m}`:n==="yarn"?p=`yarn global add fluxflow-cli@${m}`:n==="custom"?p=k||A?.customUpdateCommand||`npm install -g fluxflow-cli@${m}`:p=`npm install -g fluxflow-cli@${m}`,console.log(`Updating FluxFlow to v${m} using ${n}...`),console.log(`Running: ${p}`);let{execSync:L}=await import("child_process");L(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${m}.\x1B[0m`)}catch(x){console.error("\x1B[31m\u274C Update failed:\x1B[0m",x.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:pe}=await import("react"),{render:de}=await import("ink"),{default:ue}=await import("./chunks/app-
|
|
68
|
+
/update latest Install latest release`),process.exit(0)),se){let C=t[1]||"latest";if(C==="check"){let x=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(x?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let m=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;m||(console.error("Error: Could not retrieve latest version."),process.exit(1)),m===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let r=(await import("react")).default,{useState:w}=r,{render:U,Box:h,Text:S}=await import("ink"),ie=(await import("ink-select-input")).default,_=(await import("ink-text-input")).default;return new Promise(D=>{let P=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:E,isSelected:F})=>r.createElement(h,{width:"100%"},r.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),b,X=()=>{let[E,F]=w("select"),[J,j]=w(""),z=R=>{R.value==="custom"?F("custom"):B({manager:R.value})},K=R=>{B({manager:"custom",customCommand:R})};return E==="custom"?r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),r.createElement(h,{flexDirection:"row"},r.createElement(S,{color:"cyan",bold:!0}," \u276F "),r.createElement(_,{value:J,onChange:j,onSubmit:K})),r.createElement(h,{marginTop:1},r.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),r.createElement(ie,{items:P,onSelect:z,itemComponent:H,indicatorComponent:()=>null}))},B=E=>{b&&b(),D(E)},{unmount:V}=U(r.createElement(X,null));b=V})},n,k="",A;try{let{loadSettings:r}=await import("./chunks/settings-YRMZZJ3F.js");A=await r(),n=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!n){let r=await y();n=r.manager,k=r.customCommand}let p="";n==="pnpm"?p=`pnpm add -g fluxflow-cli@${m}`:n==="bun"?p=`bun add -g fluxflow-cli@${m}`:n==="yarn"?p=`yarn global add fluxflow-cli@${m}`:n==="custom"?p=k||A?.customUpdateCommand||`npm install -g fluxflow-cli@${m}`:p=`npm install -g fluxflow-cli@${m}`,console.log(`Updating FluxFlow to v${m} using ${n}...`),console.log(`Running: ${p}`);let{execSync:L}=await import("child_process");L(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${m}.\x1B[0m`)}catch(x){console.error("\x1B[31m\u274C Update failed:\x1B[0m",x.message),process.exit(1)}process.exit(0)}else console.error("Unknown update command. Available options: --update, --update check, --update check latest, --update latest"),process.exit(1)}}let{default:pe}=await import("react"),{render:de}=await import("ink"),{default:ue}=await import("./chunks/app-AFKEWVKT.js");process.env.NODE_NO_WARNINGS="1";let ge=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],fe=console.log,xe=console.warn,we=console.error,W=o=>{let d=o.map(String).join(" ");return ge.some(s=>d.includes(s))};console.log=(...o)=>!W(o)&&fe(...o),console.warn=(...o)=>!W(o)&&xe(...o),console.error=(...o)=>!W(o)&&we(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],d=await import("path"),s=await import("fs-extra"),u=d.default.resolve(o);try{s.default.existsSync(u)&&s.default.statSync(u).isDirectory()?process.chdir(u):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(v){console.error(`[ERROR] Failed to change directory to "${o}": ${v.message}`),process.exit(0)}}let M=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||M){let o=t.includes("--new")||t.includes("-n"),s=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(M)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0);let l="";if(s&&s.trim()){let I=s.trim();I.startsWith("={")&&I.endsWith("}")?l=`
|
|
69
69
|
|
|
70
70
|
Instruction: ${I.slice(2,-1).trim()}`:l=`
|
|
71
71
|
|
|
@@ -82,7 +82,7 @@ ${s}`:s=i}if(!M&&!process.stdin.isTTY){let e=[];for await(let l of process.stdin
|
|
|
82
82
|
${a}
|
|
83
83
|
---
|
|
84
84
|
|
|
85
|
-
${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-YRMZZJ3F.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-GLYKU2YR.js"),{getDefaultModel:c}=await import("./chunks/model_config-D3A73AS7.js"),{generateSimpleContent:m}=await import("./chunks/ai-
|
|
85
|
+
${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-YRMZZJ3F.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-GLYKU2YR.js"),{getDefaultModel:c}=await import("./chunks/model_config-D3A73AS7.js"),{generateSimpleContent:m}=await import("./chunks/ai-6AJFPN2Z.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-23Z3SVXU.js"),n=await C(),k=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==s&&e!=="-n"&&e!=="--new"),A=M||k.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let l=k.indexOf(a);if(l!==-1&&l+1<k.length)return k[l+1]}return null},L=M&&n.systemSettings?.commitMessageModel&&n.systemSettings.commitMessageModel!=="Default"?n.systemSettings.commitMessageModel:null,r=M&&L&&n.systemSettings?.commitMessageProvider?n.systemSettings.commitMessageProvider:null,w=p(["--provider"])||r||n.aiProvider||"Google",U=p(["--model"])||L||n.activeModel||c(w,n.apiTier)||c(w,"paid"),h=p(["--key"])||await x(w);!h&&!(w==="c_openai"&&n.systemSettings?.customOpenAIBaseUrl)&&(console.error(`[ERROR] No API key resolved for provider "${w}".`),process.exit(1));let S=await y("agent",{aiProvider:w});S.allowed||(console.error(`[ERROR] ${S.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:ie="",nickname:_="",instructions:D=""}=n?.profileData??{},P={aiProvider:w,apiKey:h,model:U,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:n.systemSettings||{}},H=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",b=new Date,X=b.getFullYear(),B=b.toLocaleString("en-US",{month:"short"}).toUpperCase(),V=String(b.getDate()).padStart(2,"0"),E=b.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),F=`${X}-${B}-${V}, ${E}`,J=(P.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),j=ee.basename(J).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replace(/(\d)-(\d)/g,"$1.$2").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),z=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
86
86
|
Use NO markdown, only plain text
|
|
87
87
|
Context:
|
|
88
88
|
- OS: ${H}
|
package/dist/package.json
CHANGED