fluxflow-cli 4.24.1 → 4.24.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{A as p,B as q,C as r,D as s,E as t,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-3HEZL3GW.js";import"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import"./chunk-LQHSNXBM.js";import"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import"./chunk-ZRP6USHC.js";import"./chunk-FQBBOFNP.js";import"./chunk-Y5JU726N.js";import"./chunk-3CZWTXIR.js";import"./chunk-4XXLWMY6.js";import"./chunk-GRQ7JZZP.js";import{k as a}from"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{c as RE_LEADING_THINK,q as compressHistory,b as convertChannelThinkTags,r as deleteChatSummary,e as findGenuineThinkClose,p as generateSimpleContent,s as getAIStream,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,o as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,n as runJanitorTask,t as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
1
+ import{A as p,B as q,C as r,D as s,E as t,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-7NB2QD77.js";import"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import"./chunk-LQHSNXBM.js";import"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import"./chunk-ZRP6USHC.js";import"./chunk-FQBBOFNP.js";import"./chunk-Y5JU726N.js";import"./chunk-3CZWTXIR.js";import"./chunk-4XXLWMY6.js";import"./chunk-GRQ7JZZP.js";import{k as a}from"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{c as RE_LEADING_THINK,q as compressHistory,b as convertChannelThinkTags,r as deleteChatSummary,e as findGenuineThinkClose,p as generateSimpleContent,s as getAIStream,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,o as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,n as runJanitorTask,t as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
@@ -1,4 +1,4 @@
1
- import{B as sl,C as il,D as ll,a as Yi,b as Je,c as nt,d as Cr,e as Ht,f as Ki,g as qi,h as vr,i as zi,j as ys,k as Jo,l as Br,v as nl,y as rl,z as Kn}from"./chunk-3HEZL3GW.js";import{b as Ri,c as el,d as tl}from"./chunk-SZYN3VHU.js";import{a as ol}from"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import{c as Vi,e as Sn,f as jt,g as ji}from"./chunk-VCPTQGFQ.js";import"./chunk-LQHSNXBM.js";import{a as Zi}from"./chunk-A73NNVCZ.js";import{a as Fo,b as Cn,d as Er,e as ws,f as Qi,h as Ji,i as jn}from"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import{a as Et,b as xt,d as Xi,e as ht,f as Wi,j as bs,k as Ts,l as Gn,n as Gi,o as Co}from"./chunk-ZRP6USHC.js";import{a as Vn}from"./chunk-FQBBOFNP.js";import{a as Yn}from"./chunk-Y5JU726N.js";import{b as Mn,c as fs,k as Ni}from"./chunk-3CZWTXIR.js";import{b as ps}from"./chunk-AF7LASZ3.js";import{a as Fi,b as Ui,f as $i,g as Mr,h as Sr,j as vt,k as Qo,l as hs,r as _i}from"./chunk-4XXLWMY6.js";import{a as xs,b as Pt}from"./chunk-GRQ7JZZP.js";import{d as Di,e as ki,f as Ii,g as Ai,h as Li,i as Pi,k as yr,m as No,n as go,o as Oi}from"./chunk-OSDQRSY6.js";import{c as Tr,d as Bi,e as wr}from"./chunk-L3W2X74K.js";import{e as Hi}from"./chunk-6AWSJNXE.js";import{a as ro,b as zo,c as mo,d as ms,e as gs,k as Wn}from"./chunk-DSVLWYIT.js";import Ys from"os";import e,{useState as J,useEffect as rt,useRef as Ke,useMemo as kn}from"react";import{Box as c,Text as l,useInput as Kd,useStdout as qd,Static as zd}from"ink";import Qd from"ink-spinner";import et from"fs-extra";import St from"path";import{exec as wo}from"child_process";import{fileURLToPath as Jd}from"url";import Ut,{useState as Dr,useEffect as Ms,useMemo as qn,useCallback as ba,useRef as vo}from"react";import{Box as Ta,Text as so,useInput as wa}from"ink";function ya(t,m){return t.replace(/\t/g," ".repeat(m))}function kr(t){return t==null?"":t.replace(/\r\n/g,`
1
+ import{B as sl,C as il,D as ll,a as Yi,b as Je,c as nt,d as Cr,e as Ht,f as Ki,g as qi,h as vr,i as zi,j as ys,k as Jo,l as Br,v as nl,y as rl,z as Kn}from"./chunk-7NB2QD77.js";import{b as Ri,c as el,d as tl}from"./chunk-SZYN3VHU.js";import{a as ol}from"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import{c as Vi,e as Sn,f as jt,g as ji}from"./chunk-VCPTQGFQ.js";import"./chunk-LQHSNXBM.js";import{a as Zi}from"./chunk-A73NNVCZ.js";import{a as Fo,b as Cn,d as Er,e as ws,f as Qi,h as Ji,i as jn}from"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import{a as Et,b as xt,d as Xi,e as ht,f as Wi,j as bs,k as Ts,l as Gn,n as Gi,o as Co}from"./chunk-ZRP6USHC.js";import{a as Vn}from"./chunk-FQBBOFNP.js";import{a as Yn}from"./chunk-Y5JU726N.js";import{b as Mn,c as fs,k as Ni}from"./chunk-3CZWTXIR.js";import{b as ps}from"./chunk-AF7LASZ3.js";import{a as Fi,b as Ui,f as $i,g as Mr,h as Sr,j as vt,k as Qo,l as hs,r as _i}from"./chunk-4XXLWMY6.js";import{a as xs,b as Pt}from"./chunk-GRQ7JZZP.js";import{d as Di,e as ki,f as Ii,g as Ai,h as Li,i as Pi,k as yr,m as No,n as go,o as Oi}from"./chunk-OSDQRSY6.js";import{c as Tr,d as Bi,e as wr}from"./chunk-L3W2X74K.js";import{e as Hi}from"./chunk-6AWSJNXE.js";import{a as ro,b as zo,c as mo,d as ms,e as gs,k as Wn}from"./chunk-DSVLWYIT.js";import Ys from"os";import e,{useState as J,useEffect as rt,useRef as Ke,useMemo as kn}from"react";import{Box as c,Text as l,useInput as Kd,useStdout as qd,Static as zd}from"ink";import Qd from"ink-spinner";import et from"fs-extra";import St from"path";import{exec as wo}from"child_process";import{fileURLToPath as Jd}from"url";import Ut,{useState as Dr,useEffect as Ms,useMemo as qn,useCallback as ba,useRef as vo}from"react";import{Box as Ta,Text as so,useInput as wa}from"ink";function ya(t,m){return t.replace(/\t/g," ".repeat(m))}function kr(t){return t==null?"":t.replace(/\r\n/g,`
2
2
  `).replace(/\r/g,`
3
3
  `)}function Zo(t,m,h){let y=t,T=[...m].sort((s,k)=>s.start-k.start),b=0;for(let s of T){let k=s.start-b,f=kr(s.text).split(`
4
4
  `).length,I=s.text.length,A=(f>3?`[Pasted ${f} lines]`:`[Pasted ${I} chars]`).length,X=k+A;if(t<=k)break;if(t<X){y=s.end;break}else{let S=s.text.length-A;y+=S,b+=S}}return Math.min(y,h.length)}function Ss(t,m,h,y,T=[]){let b=(t||"").slice(0,m),s=y(b).length,k=y(t||""),f=[...T].sort((N,L)=>L.start-N.start);for(let N of f){let L=y(t.slice(0,N.start)).length,_=y(N.text),Q=L+_.length,ge=kr(N.text).split(`
@@ -41,7 +41,7 @@ import{B as sl,C as il,D as ll,a as Yi,b as Je,c as nt,d as Cr,e as Ht,f as Ki,g
41
41
  `),terminalWidth:m,theme:b}));if(f==="diff-line"){let{isFirstLine:S,isLastLine:C}=t,P=(N=!1)=>r.createElement(E,{backgroundColor:s.codeBg,paddingX:1,width:m,marginBottom:N?1:0},r.createElement(E,{width:3,flexShrink:0}),r.createElement(E,{width:1,flexShrink:0,marginLeft:1}),r.createElement(E,{flexGrow:1,marginLeft:1},r.createElement(ne,null," ")));return r.createElement(E,{flexDirection:"column"},S&&P(!1),r.createElement(xl,{line:I,pairContent:t.pairContent,parentText:void 0,columns:m,theme:b}),C&&P(!0))}if(f==="code-fence-open"){let S={paddingLeft:2,width:"100%"};return r.createElement(E,{flexDirection:"column",marginTop:0,marginBottom:0,width:"100%"},r.createElement(E,{flexDirection:"row",...S},r.createElement(ne,null," ")),r.createElement(E,{flexDirection:"row",...S},r.createElement(ne,{color:"gray",bold:!0},"\u25B6_ ",(I||"TEXT").toUpperCase())))}if(f==="code-line"){let{lineNum:S,lang:C}=t,P=m-12,L=xt(I,Math.max(10,P)).split(`
42
42
  `);return r.createElement(E,{flexDirection:"column",width:"100%"},L.map((_,Q)=>r.createElement(E,{key:Q,flexDirection:"row",borderColor:s.codeBorder,paddingLeft:2,width:"100%"},r.createElement(E,{width:5,flexShrink:0},r.createElement(ne,{color:"gray",dimColor:!0},Q===0?String(S).padStart(4," ")+" ":" ")),r.createElement(E,{flexGrow:1},Ot(_,C,s.text)))))}if(f==="code-fence-close")return r.createElement(E,{flexDirection:"row",paddingLeft:2,marginBottom:1,width:"100%"},r.createElement(ne,null," "));if(f==="write-header")return r.createElement(E,{flexDirection:"column",paddingX:1,width:m},r.createElement(En,{text:I,columns:m,theme:b}));if(f==="write-line"){let{gutterWidth:S,lineNum:C,isFirstLine:P,isLastLine:N,extension:L,wrappedLines:_}=t,Q=(ge=!1)=>r.createElement(E,{flexDirection:"row",width:m,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:s.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:s.codeBg,marginBottom:ge?1:0},r.createElement(E,{width:S+2,flexShrink:0},r.createElement(ne,null," ".repeat(S+2))),r.createElement(E,{flexGrow:1},r.createElement(ne,null," ")));return r.createElement(E,{flexDirection:"column"},P&&Q(!1),r.createElement(E,{flexDirection:"row",width:m,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:s.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:s.codeBg},r.createElement(E,{width:S+2,flexShrink:0},r.createElement(ne,{color:"gray",dimColor:!0},String(C).padStart(S," ")," ")),r.createElement(E,{flexGrow:1,flexDirection:"column"},(_||[I]).map((ge,ye)=>r.createElement(E,{key:ye},Ot(ge,L,s.text))))),N&&Q(!0))}return f==="write-footer"?r.createElement(E,{flexDirection:"column",paddingX:1,width:m,marginTop:1,marginBottom:1},r.createElement(En,{text:I,columns:m,theme:b})):f==="worked-duration"?r.createElement(E,{marginTop:1,marginBottom:2,paddingX:1,width:"100%"},r.createElement(ne,{color:s.textMuted},"["),r.createElement(ne,{color:s.textMuted},"Worked for ",r.createElement(ne,{bold:!0,color:s.text},Es(X))),r.createElement(ne,{color:s.textMuted},"]")):null}),Gc=r.memo(({messages:t,showFullThinking:m,columns:h=80,aiProvider:y,version:T,theme:b="Dark"})=>r.createElement(E,{flexDirection:"column",width:"100%"},t.map((s,k)=>r.createElement(hl,{key:s.id||k,msg:s,showFullThinking:m,columns:h,aiProvider:y,version:T,theme:b}))));import pt from"react";import{Box as Uo,Text as fo}from"ink";import{useState as Qn,useEffect as Jn,useRef as Pr}from"react";var Zn=null;function pl(){Zn&&Zn()}var hd=t=>{if(t<=370)return"#00a564";if(t>=5e3)return"#ff0000";let m=[{t:370,r:0,g:165,b:100},{t:550,r:40,g:195,b:80},{t:800,r:120,g:220,b:50},{t:1100,r:190,g:225,b:20},{t:1500,r:250,g:210,b:15},{t:2e3,r:255,g:170,b:0},{t:2800,r:255,g:110,b:0},{t:3800,r:255,g:50,b:0},{t:5e3,r:255,g:0,b:0}];for(let h=0;h<m.length-1;h++){let y=m[h],T=m[h+1];if(t>=y.t&&t<=T.t){let b=(t-y.t)/(T.t-y.t);b=b*b*(3-2*b);let s=Math.round(y.r+(T.r-y.r)*b),k=Math.round(y.g+(T.g-y.g)*b),f=Math.round(y.b+(T.b-y.b)*b);return`#${((1<<24)+(s<<16)+(k<<8)+f).toString(16).slice(1)}`}}return"#ff0000"},pd=pt.memo(({mode:t,thinkingLevel:m,tokens:h="0.0k",tokensTotal:y="0.0k",cachedTokens:T=0,promptTokens:b=0,chatId:s="NEW-SESSION",isMemoryEnabled:k=!0,apiTier:f="Free",aiProvider:I="Google",activeModel:A="",isProcessing:X=!1,lastChunkTime:S=0,theme:C="Dark",wps:P=0,showTPMEstimate:N=!1})=>{let L=Je(C),_="",[Q,ge]=Qn(0),[ye,se]=Qn(0),[ie,pe]=Qn("MB"),[Be,Ce]=Qn("green"),[Fe,le]=Qn(0),Ie=Pr([]),be=Pr(370),ee=Pr([]),We=Pr(S);Jn(()=>{We.current=S},[S]),Jn(()=>{if(!X){ee.current=[];return}if(P>0){let R=ee.current;R.push(P),R.length>3&&R.shift()}},[X,P,S]),Jn(()=>{if(!X){le(0);return}let R=setInterval(()=>{let te=We.current,Z=te>0?Date.now()-te:0;if(te>0&&Z>=1e3)ee.current=[],le(0);else if(te>0&&Z>500){ee.current.length>0&&ee.current.shift();let ae=ee.current;if(ae.length>0){let fe=ae.reduce((he,Ae)=>he+Ae,0);le(Math.round(fe/ae.length))}else le(0)}else{let ae=ee.current;if(ae.length>0){let fe=ae.reduce((he,Ae)=>he+Ae,0);le(Math.round(fe/ae.length))}else P>0&&le(Math.round(P))}},750);return()=>clearInterval(R)},[X]),Jn(()=>{if(!X){Ie.current=[];return}if(S>0){let Z=Ie.current;(Z.length===0||Z[Z.length-1]!==S)&&(Z.push(S),Z.length>10&&Z.shift())}let R=()=>{if(!S){Ce("#00a564");return}let Z=Ie.current,ae=0;if(Z.length>1){let oe=0;for(let ce=1;ce<Z.length;ce++)oe+=Z[ce]-Z[ce-1];ae=oe/(Z.length-1)}let fe=Date.now()-S,Ae=fe>=2500,at=!Ae&&ae>0?Math.min(fe,ae*3):fe,Ze=Math.max(ae,at),ve=Ae?.4:.2;be.current=be.current*(1-ve)+Ze*ve,Ce(hd(be.current))};R();let te=setInterval(R,100);return()=>clearInterval(te)},[X,S]);let me=()=>{let R=process.memoryUsage(),te=R.heapTotal/(1024*1024)>=1024,Z=te?"GB":"MB",ae=(fe,he)=>{let Ae=fe/(1048576*(he?1024:1));return he?parseFloat(Ae.toFixed(2)):Math.round(Ae)};pe(Z),se(ae(R.heapTotal,te)),ge(ae(R.heapUsed,te))};return Jn(()=>{Zn=me,me();let R=setInterval(()=>{me()},6e4);return()=>{clearInterval(R),Zn===me&&(Zn=null)}},[]),pt.createElement(Uo,{flexDirection:"row",justifyContent:"space-between",paddingX:1,width:"100%"},pt.createElement(Uo,null,pt.createElement(Uo,{marginRight:1},pt.createElement(fo,{color:L.textMuted},t.toLowerCase()==="flow"?"Studio":t.toLowerCase()==="icu"?"Computer Use":t.toLowerCase()==="flux"?"Workspace":"Omni")),pt.createElement(fo,{color:L.textMuted,dimColor:!0},"\u2503 "),pt.createElement(Uo,null,pt.createElement(fo,{color:L.text,italic:!0},Wi(process.cwd(),35)))),pt.createElement(Uo,null,X&&!N?pt.createElement(Uo,null,pt.createElement(fo,{color:Be},"\u25CF ")):null,X&&N&&pt.createElement(pt.Fragment,null,pt.createElement(fo,{color:L.textMuted},Fe," tok/s"),pt.createElement(fo,{color:L.textMuted,dimColor:!0}," \u2503")),h>0&&pt.createElement(pt.Fragment,null,pt.createElement(Uo,{marginX:1},pt.createElement(fo,{color:L.text},ht(y)," tok",(()=>{let R=typeof b=="number"?b:0,te=typeof T=="number"?T:0,Z=R>0?te/R*100:0;return Z<1?null:pt.createElement(fo,{color:L.success||"green",dimColor:!0}," [",Z.toFixed(0),"% cached]")})())),pt.createElement(fo,{color:L.textMuted,dimColor:!0},"\u2503")),pt.createElement(Uo,{marginLeft:1},pt.createElement(fo,{color:L.textMuted,bold:!0},Q," ",ie))))}),bl=pd;import st,{useState as Bs,useMemo as bd,useEffect as Td}from"react";import{Box as Xt,Text as Kt,useInput as wd}from"ink";import yd from"ink-select-input";var Md=({label:t,isSelected:m,theme:h="Dark"})=>{let y=Je(h),T=t==="Cancel"||t==="Back"||t.toLowerCase().includes("exit")||t.toLowerCase().includes("back");return st.createElement(Xt,{marginTop:T?1:0,backgroundColor:m?y.highlightBg:void 0,paddingX:1,width:"100%"},st.createElement(Kt,{color:m?y.text:y.textMuted,bold:m},m?"\u276F ":" ",t))};function bt({title:t,subtitle:m,items:h=[],onSelect:y,theme:T="Dark",searchable:b=!1}){let s=Je(T),[k,f]=Bs(""),[I,A]=Bs(0),[X,S]=Bs("list"),C=bd(()=>{if(!b||!k.trim())return h;let P=k.toLowerCase().trim();return h.filter(N=>N.label&&N.label.toLowerCase().includes(P))},[h,k,b]);return Td(()=>{A(0)},[k]),wd((P,N)=>{if(b){if(N.upArrow){S("list"),A(L=>C.length>0?L>0?L-1:C.length-1:0);return}if(N.downArrow){S("list"),A(L=>C.length>0&&L<C.length-1?L+1:0);return}if(N.return){C.length>0&&C[I]&&y(C[I]);return}if(N.escape){if(k)f(""),S("list"),A(0);else{let L=h.find(_=>_.value==="Back"||_.label==="Back"||_.value==="Cancel"||_.label==="Cancel");L&&y(L)}return}if(N.backspace||N.delete){S("search"),f(L=>L.slice(0,-1));return}if(P&&!N.ctrl&&!N.meta&&!N.tab){S("search"),f(L=>L+P);return}}},{isActive:b}),b?st.createElement(Xt,{flexDirection:"column",borderStyle:"round",borderColor:s.borderMuted,padding:0,marginTop:0,flexShrink:0,width:"100%"},t&&st.createElement(Xt,{paddingX:1,paddingY:0,marginBottom:0},st.createElement(Kt,{color:s.text,bold:!0},typeof t=="string"?t.toUpperCase():t)),m&&st.createElement(Xt,{paddingX:1,marginBottom:0},st.createElement(Kt,{color:s.textMuted,italic:!0}," ",m)),st.createElement(Xt,{paddingX:1,marginTop:1,marginBottom:1,flexDirection:"row"},st.createElement(Kt,{color:X==="search"?s.primary||"cyan":s.textMuted,bold:X==="search"},"\u{1F50D} Search:"),st.createElement(Kt,{color:s.text,bold:!0}," ",k),X==="search"?st.createElement(Kt,{color:s.primary||"cyan"},"\u2588"):k?null:st.createElement(Kt,{color:s.textMuted,italic:!0}," (type to search...)")),st.createElement(Xt,{flexDirection:"column",width:"100%"},C.length===0?st.createElement(Xt,{paddingX:1,marginY:0},st.createElement(Kt,{color:s.warning||"yellow",italic:!0}," No matching items found")):C.map((P,N)=>{let L=N===I,_=P.label==="Cancel"||P.label==="Back"||P.label.toLowerCase().includes("exit")||P.label.toLowerCase().includes("back");return st.createElement(Xt,{key:P.value??P.label??N,marginTop:_?1:0,backgroundColor:L?s.highlightBg:void 0,paddingX:1,width:"100%"},st.createElement(Kt,{color:L?s.text:s.textMuted,bold:L},L?"\u276F ":" ",P.label))})),st.createElement(Xt,{paddingX:1,marginTop:1},st.createElement(Kt,{color:s.textMuted,italic:!0},X==="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)"))):st.createElement(Xt,{flexDirection:"column",borderStyle:"round",borderColor:s.borderMuted,padding:0,marginTop:0,flexShrink:0,width:"100%"},t&&st.createElement(Xt,{paddingX:1,paddingY:0,marginBottom:m?0:1},st.createElement(Kt,{color:s.text,bold:!0},typeof t=="string"?t.toUpperCase():t)),m&&st.createElement(Xt,{paddingX:1,marginBottom:1},st.createElement(Kt,{color:s.textMuted,italic:!0}," ",m)),st.createElement(Xt,{flexDirection:"column",width:"100%"},st.createElement(yd,{items:h,onSelect:y,itemComponent:P=>st.createElement(Md,{...P,theme:T}),indicatorComponent:()=>null})),st.createElement(Xt,{paddingX:1,marginTop:1},st.createElement(Kt,{color:s.textMuted,italic:!0},"(Arrows to select \u2022 Enter to confirm)")))}import v,{useState as At,useEffect as Rn}from"react";import{Box as Ne,Text as j,useInput as Sd}from"ink";import Cd from"ink-text-input";import vd from"v8";import Tl from"os";var xo=[...Object.keys(Yi),"Mystery"],ho=[{id:"appearance",label:"Appearance",desc:"Customize UI theme & rendering options"},{id:"memory",label:"Memory",desc:"Manage system context & agent's memory"},{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"}],wl=t=>{let m=t.autoApproveCommands||"",h=t.autoDisallowCommands||"",y=t.alwaysAskCommands||"",T=t.autoExec===!1&&t.allowExternalAccess===!1&&t.networkAccess===!1&&m===""&&h==="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"&&y==="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,b=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"&&h==="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"&&y==="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,s=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"&&h===""&&y==="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;return T?"Strict":b?"Balanced":s?"Autonomous":t.sandboxPreset||"Custom"},Ds=t=>!t||t.trim()===""?"None":t.length>40?t.substring(0,40)+"...":t;function Or({systemSettings:t,setSystemSettings:m,apiTier:h,setActiveView:y,setInputConfig:T,saveSettings:b,quotas:s,setMessages:k,aiProvider:f,initialSelectingTheme:I=!1,onCloseTheme:A=null,setProviderReturnView:X=null}){let S=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",C=xo.indexOf(S),[P,N]=At("categories"),[L,_]=At(0),[Q,ge]=At(0),[ye,se]=At(null),[ie,pe]=At(""),[Be,Ce]=At(I),[Fe,le]=At(C>=0?C:0),[Ie,be]=At(t.theme||"Dark"),[ee,We]=At(!1),[me,R]=At(0),[te,Z]=At(0),[ae,fe]=At(""),[he,Ae]=At("list"),[at,Ze]=At({});Rn(()=>{(async()=>{let w=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","APInex"],U={};for(let Ee of w)try{await Mn(Ee)&&(U[Ee]=!0)}catch{}Ze(U)})()},[]);let ve=v.useMemo(()=>{let ue=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","APInex"],U=!!(process.env.SUBAGENT_MODEL&&process.env.SUBAGENT_MODEL.trim())?`ENV (${process.env.SUBAGENT_MODEL.trim()})`:"ENV",Ee=[{label:"Default (use the current model)",value:"Default",isHeader:!1},{label:U,value:"ENV",isHeader:!1}],Xe=s?.providerTiers?.[f]||h||"Free",Re=No(f,Xe)||[];Re.length>0&&(Ee.push({label:`\u2500\u2500 ${f.toUpperCase()}${Xe!=="Free"?` (${Xe})`:""} \u2500\u2500`,isHeader:!0}),Re.forEach(it=>{let Ye=typeof it=="string"?it:it.cmd||it.name||it.id||String(it);Ye&&!Ye.trim().startsWith("---")&&!Ye.startsWith(`
43
43
  ---`)&&Ee.push({label:Ye,value:Ye,isHeader:!1,provider:f})}));for(let it of ue)if(it!==f&&at[it]){let Ye=s?.providerTiers?.[it]||"Free",qt=No(it,Ye)||[];qt.length>0&&(Ee.push({label:`\u2500\u2500 ${it.toUpperCase()}${Ye!=="Free"?` (${Ye})`:""} \u2500\u2500`,isHeader:!0}),qt.forEach(je=>{let kt=typeof je=="string"?je:je.cmd||je.name||je.id||String(je);kt&&!kt.trim().startsWith("---")&&!kt.startsWith(`
44
- ---`)&&Ee.push({label:kt,value:kt,isHeader:!1,provider:it})}))}return Ee},[f,h,s,at]),oe=v.useMemo(()=>{if(!ae.trim())return ve;let ue=ae.trim().toLowerCase(),w=[],U=null;for(let Ee of ve)Ee.isHeader?U=Ee:(Ee.label.toLowerCase().includes(ue)||Ee.value&&Ee.value.toLowerCase().includes(ue))&&(U&&!w.includes(U)&&w.push(U),w.push(Ee));return w},[ve,ae]);Rn(()=>{if(ee){let ue=oe.findIndex(w=>!w.isHeader);R(ue>=0?ue:0),Z(0)}},[ae]),Rn(()=>{if(ee){if(oe.length===0){R(0),Z(0);return}if(me>=oe.length||oe[me]?.isHeader){let ue=oe.findIndex(w=>!w.isHeader);R(ue>=0?ue:0)}}},[oe,ee]);let[ce,Se]=At(0),[D,Ue]=At(0),[qe,Ct]=At("MB"),[Gt,Hr]=At(!1);Rn(()=>{let ue=!1;return import("./exec_command-CY42M4FP.js").then(w=>{ue||Hr(!!w.isPtyAvailable)}).catch(()=>{}),()=>{ue=!0}},[]),Rn(()=>{let ue=vd.getHeapStatistics().heap_size_limit,w=ue>=1024*1024*1024,U=w?"GB":"MB",Ee=w?1024*1024*1024:1024*1024;Ue(parseFloat((ue/Ee).toFixed(2))),Ct(U);let Xe=()=>{let qt=process.memoryUsage().rss/Ee,je=w?parseFloat(qt.toFixed(2)):Math.round(qt);Se(je)};Xe();let Re=setInterval(()=>{Xe()},3e4);return()=>clearInterval(Re)},[]);let en=ue=>{switch(ue){case"providers":{let U=[{label:"Current Provider",value:"aiProvider",status:f}];return f==="Ollama"&&U.push({label:"Endpoint",value:"ollamaEndpoint",status:t.ollamaEndpoint||"Cloud"}),U}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"}];case"memory":return[{label:"Toggle Memory [Legacy]",value:"memory",status:t.memory?"ON":"OFF"}];case"security":return[{label:"Sandbox Preset",value:"sandboxPreset",status:wl(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:Ds(t.alwaysAskCommands),section:"Sandbox"},{label:"Auto Approve Commands",value:"autoApprove",status:Ds(t.autoApproveCommands),section:"Sandbox"},{label:"Auto Disapprove Commands",value:"autoDisallow",status:Ds(t.autoDisallowCommands),section:"Sandbox"},{label:"Auto Approve Git Commits",value:"autoApproveGit",status:t.autoApproveGit?"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"}];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"other":return[{label:"Sub-Agents",value:"subAgents",status:t.subAgents!==!1?"ON":"OFF"},{label:"Sub-Agent Model",value:"subAgentModel",status:t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default"},{label:"Verbose Thinking",value:"preserveThinking",status:t.preserveThinking!==!1?"ON":"OFF"},{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:"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"}];default:return[]}},tn=ho[L].id,Ge=en(tn);Sd((ue,w)=>{if(ee){if(w.tab){Ae(U=>U==="search"?"list":"search");return}if(he==="search"){w.escape?We(!1):w.downArrow||w.return?Ae("list"):w.backspace||w.delete?fe(U=>U.slice(0,-1)):ue&&!w.ctrl&&!w.meta&&ue.length===1&&fe(U=>U+ue);return}if(w.upArrow)R(U=>{if(oe.length===0)return 0;let Ee=(U-1+oe.length)%oe.length,Xe=0;for(;oe[Ee]?.isHeader&&Xe<oe.length;)Ee=(Ee-1+oe.length)%oe.length,Xe++;return Ee});else if(w.downArrow)R(U=>{if(oe.length===0)return 0;let Ee=(U+1)%oe.length,Xe=0;for(;oe[Ee]?.isHeader&&Xe<oe.length;)Ee=(Ee+1)%oe.length,Xe++;return Ee});else if(w.return){let U=oe[me];U&&!U.isHeader&&(m(Ee=>{let Xe=U.value==="Default",Re={...Ee,CustomSubAgent:!Xe,SubAgentModel:U.value,SubAgentProvider:Xe?"":U.provider||""};return b({systemSettings:Re,apiTier:h,quotas:s}),Re}),We(!1))}else w.escape?We(!1):ue&&!w.ctrl&&!w.meta&&ue.length===1&&(fe(U=>U+ue),Ae("search"));return}if(Be){if(w.upArrow){let U=(Fe-1+xo.length)%xo.length;le(U)}else if(w.downArrow){let U=(Fe+1)%xo.length;le(U)}else if(w.return){let U=xo[Fe];m(Ee=>{let Xe={...Ee,theme:U};return b({systemSettings:Xe,apiTier:h,quotas:s}),Xe}),A?A():Ce(!1)}else w.escape&&(A?A():Ce(!1));return}if(ye){w.escape&&se(null);return}if(P==="categories")w.upArrow?_(U=>(U-1+ho.length)%ho.length):w.downArrow?_(U=>(U+1)%ho.length):w.return||w.rightArrow?ho[L].id==="exit"?y("chat"):(N("items"),ge(0)):w.escape&&y("chat");else if(P==="items"){if(w.upArrow)ge(U=>(U-1+Ge.length)%Ge.length);else if(w.downArrow)ge(U=>(U+1)%Ge.length);else if(w.leftArrow||w.escape)N("categories");else if(w.return){let U=Ge[Q];Rt(U)}}});let Rt=ue=>{if(ue.value==="memory")m(w=>({...w,memory:!w.memory}));else if(ue.value==="sandboxPreset"){let w=wl(t),U=["Autonomous","Balanced","Strict"],Xe=(U.indexOf(w)+1)%U.length,Re=U[Xe];m(it=>{let Ye={...it,sandboxPreset:Re};return Re==="Strict"?(Ye.autoExec=!1,Ye.allowExternalAccess=!1,Ye.networkAccess=!1,Ye.autoApproveCommands="",Ye.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",Ye.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",Ye.autoApproveGit=!1):Re==="Balanced"?(Ye.autoExec=!0,Ye.allowExternalAccess=!1,Ye.networkAccess=!0,Ye.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",Ye.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",Ye.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",Ye.autoApproveGit=!1):Re==="Autonomous"&&(Ye.autoExec=!0,Ye.allowExternalAccess=!0,Ye.networkAccess=!0,Ye.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",Ye.autoDisallowCommands="",Ye.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",Ye.autoApproveGit=!0),Ye})}else if(ue.value==="autoExec")t.autoExec?m(w=>({...w,autoExec:!1,sandboxPreset:"Custom"})):t.allowExternalAccess?y("doubleDanger"):y("autoExecDanger");else if(ue.value==="externalAccess")t.allowExternalAccess?m(w=>({...w,allowExternalAccess:!1,sandboxPreset:"Custom"})):t.autoExec?y("doubleDanger"):y("externalDanger");else if(ue.value==="networkAccess")m(w=>({...w,networkAccess:w.networkAccess===!1,sandboxPreset:"Custom"}));else if(ue.value==="alwaysAsk")se("alwaysAskCommands"),pe(t.alwaysAskCommands||"");else if(ue.value==="autoApprove")se("autoApproveCommands"),pe(t.autoApproveCommands||"");else if(ue.value==="autoApproveGit")m(w=>({...w,autoApproveGit:!w.autoApproveGit,sandboxPreset:"Custom"}));else if(ue.value==="autoDisallow")se("autoDisallowCommands"),pe(t.autoDisallowCommands||"");else if(ue.value==="ollamaEndpoint")m(w=>{let U=w.ollamaEndpoint==="Local"?"Cloud":"Local",Ee={...w,ollamaEndpoint:U};return b({systemSettings:Ee,apiTier:h,quotas:s}),Ee});else if(ue.value==="apiTier")y("apiTier");else if(ue.value==="aiProvider")X&&X("settings"),y("selectProvider");else if(ue.value==="advanceRollback")t.advanceRollback?m(w=>{let U={...w,advanceRollback:!1};return b({systemSettings:U,apiTier:h,quotas:s}),U}):y("advanceRollbackDanger");else if(ue.value==="autoDelete"){let w=["1d","7d","30d"],Ee=(w.indexOf(t.autoDeleteHistory||"30d")+1)%w.length;m(Xe=>({...Xe,autoDeleteHistory:w[Ee]}))}else if(ue.value==="autoUpdate")m(w=>({...w,autoUpdate:!w.autoUpdate}));else if(ue.value==="externalData")if(!t.useExternalData)T({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||""}),y("input");else{let w={...t,useExternalData:!1};m(w),b({systemSettings:w,apiTier:h,quotas:s}),k(U=>[...U,{id:Date.now(),role:"system",text:"[STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart."}]),y("chat")}else if(ue.value==="updateManager")y("updateManager");else if(ue.value==="parserDownload")y("parserDownload");else if(ue.value==="indentationTree")m(w=>{let U={...w,indentationTree:w.indentationTree===!1};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="compressToolResults")m(w=>{let U={...w,compressToolResults:!w.compressToolResults};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="autoTruncateResults")m(w=>{let U={...w,autoTruncateResults:!w.autoTruncateResults};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="imageHistoryCU"){let w=["Low","Standard","Extended"],Ee=(w.indexOf(t.imageHistoryCU||"Standard")+1)%w.length;m(Xe=>{let Re={...Xe,imageHistoryCU:w[Ee]};return b({systemSettings:Re,apiTier:h,quotas:s}),Re})}else if(ue.value==="contextLength"){let w=["16k","32k","64k","128k","256k","512k","1M"],Ee=(w.indexOf(t.contextLength||"256k")+1)%w.length;m(Xe=>{let Re={...Xe,contextLength:w[Ee]};return b({systemSettings:Re,apiTier:h,quotas:s}),Re})}else if(ue.value==="keepReasoningContext")m(w=>{let U={...w,keepReasoningContext:!w.keepReasoningContext};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="autoExcludeMetadata")m(w=>{let U={...w,autoExcludeMetadata:!w.autoExcludeMetadata};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="disableTodo")m(w=>{let U={...w,disableTodo:!w.disableTodo};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="subAgents")m(w=>{let U={...w,subAgents:w.subAgents===!1};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="subAgentModel"){let w=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",U=oe.findIndex(Ee=>Ee.value===w);R(U>=0?U:0),We(!0)}else if(ue.value==="preserveThinking")m(w=>{let U={...w,preserveThinking:w.preserveThinking===!1};return ml(U.preserveThinking),b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="loadingPhrases")m(w=>{let U={...w,loadingPhrases:w.loadingPhrases===!1};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="progressiveRendering")m(w=>{let U={...w,progressiveRendering:!w.progressiveRendering};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="showTPMEstimate")m(w=>{let U={...w,showTPMEstimate:!w.showTPMEstimate};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="theme"){let w=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",U=xo.indexOf(w);le(U>=0?U:0),be(t.theme||"Dark"),Ce(!0)}},Me=Je(t.theme);if(ee){let ue=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",w=15,U=te;me<U?U=me:me>=U+w&&(U=me-w+1),U=Math.max(0,Math.min(U,Math.max(0,oe.length-w))),U!==te&&Z(U);let Ee=oe.slice(U,U+w);return v.createElement(Ne,{flexDirection:"column",borderStyle:"round",borderColor:Me.border,padding:1,width:"100%",minHeight:32},v.createElement(Ne,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:Me.text,bold:!0,underline:!0},"Select Sub-Agent Model:"),oe.length>0&&v.createElement(j,{color:"gray"},me+1,"/",oe.length)),v.createElement(Ne,{borderStyle:"single",borderColor:he==="search"?Me.primary||"cyan":"gray",paddingX:1,marginBottom:1},v.createElement(j,{color:he==="search"?Me.primary||"cyan":"gray",bold:!0},"\u{1F50D} Search: "," "),v.createElement(j,{color:Me.text},ae),he==="search"&&v.createElement(j,{color:Me.primary||"cyan"},"\u2588"),!ae&&he!=="search"&&v.createElement(j,{color:"gray",italic:!0},"(Press TAB or type to filter models...)")),v.createElement(Ne,{flexDirection:"column",flexGrow:1,height:w},Ee.length>0?Ee.map((Xe,Re)=>{let it=U+Re;if(Xe.isHeader)return v.createElement(Ne,{key:`hdr-${it}`,paddingX:1},v.createElement(j,{color:"gray",bold:!0,underline:!0},Xe.label));let Ye=me===it&&he==="list",qt=ue===Xe.value;return v.createElement(Ne,{key:`item-${Xe.value}-${it}`,paddingX:1,backgroundColor:Ye?Me.highlightBg:void 0},v.createElement(j,{color:Ye?Me.text:Me.textDim,bold:Ye},Ye?"\u276F ":" ",Xe.label,qt?v.createElement(j,{color:Me.primary||"cyan",italic:!0}," (active)"):""))}):v.createElement(Ne,{paddingX:1},v.createElement(j,{color:"gray",italic:!0},'No models matching "',ae,'"'))),v.createElement(Ne,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:"gray",italic:!0},"TAB to switch search/list \u2022 \u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),v.createElement(j,{color:he==="search"?Me.primary||"cyan":"gray",bold:!0},"[",he.toUpperCase()," MODE]")))}if(Be){let ue=xo[Fe],w=Je(ue);return v.createElement(Ne,{flexDirection:"column",borderStyle:"round",borderColor:w.border,padding:1,width:"100%",minHeight:32},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:w.text,bold:!0},"Choose your color scheme:")),v.createElement(Ne,{flexDirection:"row",width:"100%",flexGrow:1},v.createElement(Ne,{flexDirection:"column",width:"30%",paddingRight:1},xo.map((U,Ee)=>{let Xe=Fe===Ee,Re=(t.theme||"Dark")===U,it=U==="Forest Sprite";return v.createElement(Ne,{key:U,paddingX:0},v.createElement(j,{color:Xe?w.text:w.textDim,bold:Xe},Xe?"> ":" ",U,it&&v.createElement(j,{color:Xe?w.success||"#52b788":"green",bold:!0}," \u2605"),Re?v.createElement(j,{color:w.primary||"cyan",italic:!0}," (saved)"):""))})),v.createElement(Ne,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:w.borderMuted,paddingX:2,paddingY:1,backgroundColor:w.cardBg},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:w.secondary||"cyan",bold:!0},"> ","you: "),v.createElement(j,{color:w.text},"add a greeting function")),v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:w.success||"green"}," Here's the change:")),v.createElement(Ne,{flexDirection:"column",marginLeft:2,marginBottom:1},v.createElement(j,null,v.createElement(j,{color:w.textDim},"3 "),v.createElement(j,{color:w.textDim},' import "fmt"')),v.createElement(j,{color:w.textDim},"4"),v.createElement(Ne,{backgroundColor:w.diffRemovalBg},v.createElement(j,null,v.createElement(j,{color:w.diffRemovalNum||w.diffRemovalText},"5 "),v.createElement(j,{color:w.diffRemovalPrefix||w.diffRemovalText},"- "),v.createElement(j,{color:w.diffRemovalText},"func "),v.createElement(j,{color:w.diffRemovalHighlightColor||w.diffRemovalText,backgroundColor:w.diffRemovalHighlightBg,bold:!0},"main()"),v.createElement(j,{color:w.diffRemovalText}," {"))),v.createElement(Ne,{backgroundColor:w.diffAdditionBg},v.createElement(j,null,v.createElement(j,{color:w.diffAdditionNum||w.diffAdditionText},"5 "),v.createElement(j,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),v.createElement(j,{color:w.diffAdditionText},"func "),v.createElement(j,{color:w.diffAdditionHighlightColor||w.diffAdditionText,backgroundColor:w.diffAdditionHighlightBg,bold:!0},"greet(name string)"),v.createElement(j,{color:w.diffAdditionText}," {"))),v.createElement(Ne,{backgroundColor:w.diffAdditionBg},v.createElement(j,null,v.createElement(j,{color:w.diffAdditionNum||w.diffAdditionText},"6 "),v.createElement(j,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),v.createElement(j,{color:w.diffAdditionText}," "),v.createElement(j,{color:w.diffAdditionHighlightColor||w.diffAdditionText,backgroundColor:w.diffAdditionHighlightBg},'fmt.Printf("Hello, %s!\\n", name)'))),v.createElement(j,{color:w.textDim},"7 }")),v.createElement(Ne,{flexDirection:"column",marginTop:1,marginBottom:1},v.createElement(j,{color:w.textDim},"\u25BE Thought Process"),v.createElement(j,{color:w.textMuted}," I need to add a greeting function. I'll use fmt.Printf.")),v.createElement(Ne,{flexDirection:"column"},v.createElement(j,null,v.createElement(j,{color:w.warning||"yellow"},"\u2699 tool: "),v.createElement(j,{color:w.text},"write_file main.go")),v.createElement(j,null,v.createElement(j,{color:w.accent||"magenta"},"\u29BF task: "),v.createElement(j,{color:w.text},"Implementing greeting")),v.createElement(j,null,v.createElement(j,{color:w.danger||"red"},"X error: "),v.createElement(j,{color:w.text},"compilation failed")),v.createElement(j,null,v.createElement(j,{color:w.warning||"yellow"},"\u26A0 warning: "),v.createElement(j,{color:w.text},"deprecation warning")),v.createElement(j,null,v.createElement(j,{color:w.info||"blue"},"\u2192 link: "),v.createElement(j,{color:w.info||"blue",underline:!0},"file:///path/to/main.go")),v.createElement(j,null,v.createElement(j,{color:w.accent||"magenta"},"\u2605 accent: "),v.createElement(j,{color:w.text},"highlighted text")),v.createElement(j,{color:w.textDim},"\xB7 dim: press Enter to continue")))),v.createElement(Ne,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:"gray",italic:!0},"\u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),v.createElement(j,{color:"gray"},"Previewing: ",xo[Fe],xo[Fe]==="Forest Sprite"?" \u2605":"")))}return v.createElement(Ne,{flexDirection:"column",borderStyle:"round",borderColor:Me.border,padding:0,width:"100%",minHeight:32},v.createElement(Ne,{paddingX:1,paddingY:0,marginBottom:0,borderStyle:"single",borderColor:Me.borderMuted,width:"100%"},v.createElement(j,{color:Me.text,bold:!0},"SYSTEM CONFIGURATION")),v.createElement(Ne,{flexDirection:"row",width:"100%",minHeight:26},v.createElement(Ne,{flexDirection:"column",width:"30%",maxWidth:40,borderStyle:"round",borderColor:P==="categories"?Me.border:Me.borderMuted,padding:1,paddingY:0},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:P==="categories"?Me.text:Me.textDim,bold:!0,underline:!0},"CATEGORIES")),ho.map((ue,w)=>{let U=L===w,Ee=ue.id==="exit";return v.createElement(Ne,{key:ue.id,marginTop:Ee?15:0,backgroundColor:U?P==="categories"?Me.highlightBg:Me.cardBg:void 0,paddingX:1},v.createElement(j,{color:U&&P==="categories"?Me.text:Me.textDim,bold:U},U?"\u276F ":" ",ue.label))})),v.createElement(Ne,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:P==="items"?Me.border:Me.borderMuted,paddingX:1,marginLeft:1,paddingY:0},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:P==="items"?Me.text:Me.textDim,bold:!0,underline:!0},ho[L].label.toUpperCase().includes("EXIT")?"Runtime Information":`${ho[L].label} Settings`)),Ge.length>0?(()=>{let ue=null,w=[],U=je=>(je||"").split(",").map(kt=>kt.trim().toLowerCase()).filter(Boolean),Ee=U(t.autoApproveCommands),Xe=U(t.autoDisallowCommands),Re=U(t.alwaysAskCommands),it=[...Ee,...Xe,...Re],Ye=new Set(it),qt=tn==="security"&&it.length!==Ye.size;return Ge.forEach((je,kt)=>{let zt=P==="items"&&Q===kt,Xr=je.label.length,on=Math.max(2,38-Xr),Wr=".".repeat(on),mt=Le=>tn==="security"?(Le.value==="autoExec"||Le.value==="externalAccess")&&Le.status==="ON"?Me.statusOn:Me.statusOff:Le.status?.startsWith("\u2713")?Me.statusOn:Le.status?.startsWith("\u26A0")?Me.statusOff:Le.status==="ON"?Me.statusOn:Le.status==="OFF"?Me.statusOff:Me.text;je.section&&je.section!==ue&&(ue=je.section,w.push(v.createElement(Ne,{key:`sec-hdr-${je.section}`,marginTop:w.length>0?1:0,marginBottom:0,paddingX:1},v.createElement(j,{color:"gray",bold:!0,underline:!0},je.section.toUpperCase()))));let z=zt&&ye&&(ye==="alwaysAskCommands"&&je.value==="alwaysAsk"||ye==="autoApproveCommands"&&je.value==="autoApprove"||ye==="autoDisallowCommands"&&je.value==="autoDisallow"),lt=je.value==="alwaysAsk"||je.value==="autoApprove"||je.value==="autoDisallow",Wo=je.value==="parserDownload";w.push(v.createElement(Ne,{key:je.value,flexDirection:"column"},v.createElement(Ne,{backgroundColor:zt&&!z?Me.highlightBg:void 0,paddingX:2},v.createElement(j,{color:zt?Me.text:Me.textDim,bold:zt},zt?"\u276F ":" ",je.label),!lt&&!Wo&&v.createElement(v.Fragment,null,v.createElement(j,{color:"gray"},Wr),v.createElement(j,{color:mt(je),bold:!0},je.value==="aiProvider"?je.status:`[ ${je.status} ]`))),lt&&!z&&je.status!=="None"&&v.createElement(Ne,{paddingX:4,marginBottom:1},v.createElement(j,{color:"gray"},"\u21B3 ",je.status)),z&&v.createElement(Ne,{flexDirection:"column",marginLeft:4,marginBottom:1},v.createElement(Ne,{paddingX:1,borderStyle:"single",borderColor:"gray",flexDirection:"row"},v.createElement(j,{color:"gray",bold:!0},"> "," "),v.createElement(Cd,{value:ie,onChange:pe,onSubmit:Le=>{let _t={...t,[ye]:Le.trim(),sandboxPreset:"Custom"};m(_t),b({systemSettings:_t,apiTier:h,quotas:s}),se(null)}})),v.createElement(j,{color:"gray",italic:!0}," Comma separated \u2022 Press Enter to save, Esc to cancel"))))}),qt&&w.push(v.createElement(Ne,{key:"conflict-warning",marginTop:1,paddingX:1},v.createElement(j,{color:Me.text,italic:!0},"* Conflicting commands will be ignored and defaulted to highest priority"))),w})():v.createElement(Ne,{paddingX:1,flexDirection:"column",width:"100%"},tn==="exit"?v.createElement(v.Fragment,null,v.createElement(Ne,{flexDirection:"column",marginBottom:1},v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"OS"," "),v.createElement(j,{color:"gray"},"..................... "),v.createElement(j,{color:Me.text},process.env.OS||process.platform||"N/A")),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Computer Name"," "),v.createElement(j,{color:"gray"},".......... "),v.createElement(j,{color:Me.text},process.env.COMPUTERNAME||process.env.HOSTNAME||"N/A")),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Processor Count"," "),v.createElement(j,{color:"gray"},"........ "),v.createElement(j,{color:Me.text},process.env.NUMBER_OF_PROCESSORS||"N/A")),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Node.js Version"," "),v.createElement(j,{color:"gray"},"........ "),v.createElement(j,{color:Me.text},"v",process.versions.node)),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"V8 Version"," "),v.createElement(j,{color:"gray"},"...... ...... "),v.createElement(j,{color:Me.text},"v",process.versions.v8)),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Data Directory"," "),v.createElement(j,{color:"gray"},"......... "),ro===mo?"":v.createElement(j,{color:Me.text},ro.replaceAll(Tl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"),", "),v.createElement(j,{color:Me.text},mo.replaceAll(Tl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"))),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Viewport"," "),v.createElement(j,{color:"gray"},"............... "),v.createElement(j,{color:Me.text},process.stdout.rows||"?"," rows \xD7 ",process.stdout.columns||"?"," cols ",process.stdout.columns<90?"(too small width)":"")),v.createElement(Ne,{flexDirection:"row",marginBottom:0},v.createElement(j,{color:Me.textDim},"Memory Load"," "),v.createElement(j,{color:"gray"},"............ "),v.createElement(j,{color:Me.text},ce,"/",D," ",qe))),v.createElement(Ne,{key:"pty-notice",paddingX:0,marginTop:0},v.createElement(j,{color:Gt?Me.statusOn:Me.warning},Gt?"\u2713 Advance Interactive Terminal Supported":"\u26A0 Interactive Terminal is Limited"))):v.createElement(j,{color:"gray",italic:!0},ho[L].desc)))),v.createElement(Ne,{paddingX:1,marginTop:0,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:"gray",italic:!0},P==="categories"?"\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure":"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"),P==="categories"&&v.createElement(j,{color:"gray"},ho[L].desc)))}import Jt,{useState as ks,useEffect as Ed}from"react";import{Box as Bn,Text as er}from"ink";import Bd from"ink-text-input";function Is({initialData:t,onSave:m,onCancel:h,theme:y="Dark"}){let T=Je(y),[b,s]=ks(0),[k,f]=ks(""),[I,A]=ks(()=>({name:t?.name||"",nickname:t?.nickname||"",instructions:t?.instructions||""})),X=[{key:"nickname",label:"Enter a Nickname: ",maxLength:20},{key:"instructions",label:"System Instructions: ",maxLength:200}],S=X[b];Ed(()=>{let L=X[b].key;f((I[L]||"").slice(0,X[b].maxLength))},[b,I]);let C=L=>{L.length>S.maxLength?f(L.slice(0,S.maxLength)):f(L)},P=L=>{if(L.trim().toLowerCase()==="/cancel"){h();return}let _=S.key,Q={...I,[_]:L.trim().slice(0,S.maxLength)};A(Q),f(""),b<X.length-1?s(b+1):m(Q)},N=k.length>=S.maxLength;return Jt.createElement(Bn,{borderStyle:"round",borderColor:T.borderMuted,padding:0,marginTop:1,flexShrink:0,flexDirection:"column",width:"100%"},Jt.createElement(Bn,{paddingX:1,marginBottom:1},Jt.createElement(er,{color:T.text,bold:!0},"USER PROFILE CONFIGURATION")),Jt.createElement(Bn,{paddingX:1,flexDirection:"column"},Jt.createElement(Bn,null,Jt.createElement(er,{color:T.text,bold:!0},S.label),Jt.createElement(Bd,{value:k,onChange:C,onSubmit:P})),Jt.createElement(Bn,{marginTop:1,justifyContent:"space-between"},Jt.createElement(er,{color:T.textMuted,italic:!0},"Step ",b+1," of ",X.length),Jt.createElement(er,{color:N?T.warning||"yellow":T.textMuted},"[",k.length,"/",S.maxLength,"]"))),Jt.createElement(Bn,{paddingX:1,marginTop:1},Jt.createElement(er,{color:T.textMuted,italic:!0},"(Enter to submit \u2022 Type /cancel to abort)")))}import yt,{useState as As}from"react";import{Box as Zt,Text as $o,useInput as Dd}from"ink";import kd from"ink-text-input";var Id=({question:t,options:m,onResolve:h,theme:y="Dark"})=>{let T=Je(y),[b,s]=As(!1),[k,f]=As(""),[I,A]=As(0),X=!1,S=[],C=Array.isArray(m)&&m.length>0,P=t==="Agent has been running for a long time. Do you want to continue execution?";try{P&&C?S=[...m]:S=[...C?m:[],C?{id:"CUSTOM",label:"Suggest something else...",description:"Provide a custom response"}:{id:"CUSTOM",label:"Your Answer",description:""}]}catch{X=!0}Dd((L,_)=>{if(!b&&((_.leftArrow||_.upArrow)&&A(Q=>Math.max(0,Q-1)),(_.rightArrow||_.downArrow)&&A(Q=>Math.min(S.length-1,Q+1)),_.return)){let Q=S[I];Q?.id==="CUSTOM"?s(!0):h(X?"Selected Nothing":Q.label)}});let N=nt(2);return b?yt.createElement(Zt,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:T.codeBg,width:"100%"},yt.createElement(Zt,{paddingX:1},yt.createElement($o,{color:T.text,bold:!0},"SUGGEST SOMETHING")),yt.createElement(Zt,{marginTop:1,paddingX:1},yt.createElement($o,{italic:!0,color:T.textMuted},"Replying to: ",t)),yt.createElement(Zt,{marginTop:1,paddingX:1,flexDirection:"row"},yt.createElement(kd,{value:k,onChange:f,onSubmit:()=>h(k)})),yt.createElement(Zt,{marginTop:1,paddingX:1,marginBottom:1},yt.createElement($o,{color:T.textMuted,italic:!0},"(Press Enter to send)"))):yt.createElement(Zt,{flexDirection:"column",border:!0,borderStyle:"round",borderColor:T.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,marginRight:1,width:"100%"},yt.createElement(Zt,{paddingX:1,marginBottom:1},yt.createElement($o,{color:"yellow",bold:!0},P?"TURN SAFETY SYSTEM: EXECUTION LIMIT":"AGENT REQUEST: ACTION REQUIRED")),yt.createElement(Zt,{paddingX:1,marginBottom:1},yt.createElement($o,{color:T.text},t)),yt.createElement(Zt,{flexDirection:"column",width:"100%"},S.map((L,_)=>{let Q=_===I;return yt.createElement(Zt,{key:L.id,flexDirection:"column",width:"100%",backgroundColor:Q?T.highlightBg:void 0,paddingX:1,marginBottom:_===S.length-1?0:1},yt.createElement($o,{color:Q?T.text:T.textMuted,bold:Q},Q?"\u276F ":" ",L.label),L.description&&yt.createElement(Zt,{marginLeft:4},yt.createElement($o,{color:T.textMuted,italic:!0},L.description)))})),yt.createElement(Zt,{paddingX:1,marginTop:1,marginBottom:1},yt.createElement($o,{color:T.textMuted,italic:!0},"(Use Arrows to navigate, Enter to confirm)")))},yl=Id;import Zd from"gradient-string";import Lt,{useState as Ls,useEffect as Ad}from"react";import{Box as po,Text as _o,useInput as Ld}from"ink";function Ps({onSelect:t,onDelete:m,onClose:h,theme:y="Dark"}){let T=Je(y),[b,s]=Ls({}),[k,f]=Ls([]),[I,A]=Ls(0);Ad(()=>{(async()=>{let L=await Fo();s(L),f(Object.keys(L).sort((_,Q)=>(L[Q].updatedAt||0)-(L[_].updatedAt||0)))})()},[]),Ld((N,L)=>{if(L.escape&&h(),L.upArrow&&A(_=>Math.max(0,_-1)),L.downArrow&&A(_=>Math.min(k.length-1,_+1)),L.return&&k[I]&&t(k[I]),N==="x"&&k[I]){let _=k[I];m(_).then(Q=>{let ge=Q||{};s(ge);let ye=Object.keys(ge).sort((se,ie)=>(ge[ie]?.updatedAt||0)-(ge[se]?.updatedAt||0));f(ye),A(se=>Math.max(0,Math.min(ye.length-1,se)))})}});let X=nt(2),S=15,C=0;if(k.length>S){let N=Math.floor(S/2);C=I-N,C<0?C=0:C+S>k.length&&(C=k.length-S)}let P=k.slice(C,C+S);return Lt.createElement(po,{flexDirection:"column",borderStyle:"round",borderColor:T.borderMuted,padding:0,width:"100%"},Lt.createElement(po,{paddingX:1,marginBottom:1},Lt.createElement(_o,{color:T.text,bold:!0},"CHAT HISTORY: RESUME CONVERSATION")),k.length===0?Lt.createElement(po,{paddingX:2,paddingY:1},Lt.createElement(_o,{italic:!0,color:T.textMuted},"No saved chats found.")):Lt.createElement(po,{flexDirection:"column",width:"100%"},C>0&&Lt.createElement(po,{paddingX:2,marginBottom:1},Lt.createElement(_o,{color:T.textMuted},"\u25B2 (+",C," more chats above)")),P.map((N,L)=>{let _=b[N],ge=C+L===I,ye=Pd(_?.updatedAt);return Lt.createElement(po,{key:N,paddingX:1,backgroundColor:ge?T.highlightBg:void 0,width:"100%"},Lt.createElement(po,{flexGrow:1},Lt.createElement(_o,{color:ge?T.text:T.textMuted,bold:ge},ge?"\u276F ":" ",(()=>{let se=ie=>(ie||"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();return _?.name&&!_.name.startsWith("Session")?se(_.name):_?.prompt?se(_.prompt):se(_?.name)||N})(),Lt.createElement(_o,{color:T.textMuted}," [",ye," \u2022 ",N,"]"))),ge&&Lt.createElement(po,{flexShrink:0},Lt.createElement(_o,{color:T.danger,bold:!0},"[X] DELETE ")))}),C+S<k.length&&Lt.createElement(po,{paddingX:2,marginTop:1},Lt.createElement(_o,{color:T.textMuted},"\u25BC (+",k.length-(C+S)," more chats below)"))),Lt.createElement(po,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:T.borderMuted},Lt.createElement(_o,{color:T.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")))}function Pd(t){if(!t)return"N/A";let m=new Date(t);if(isNaN(m.getTime()))return"N/A";let h=k=>String(k).padStart(2,"0"),y=h(m.getMonth()+1),T=h(m.getDate()),b=h(m.getHours()),s=h(m.getMinutes());return`${y}-${T} ${b}:${s}`}import Mt,{useState as Os,useEffect as Od}from"react";import{Box as bo,Text as lo,useInput as Nd,useStdout as Fd}from"ink";function Ns({onClose:t,theme:m="Dark"}){let h=Je(m),{stdout:y}=Fd(),T=y?.columns||80,[b,s]=Os([]),[k,f]=Os(0),[I,A]=Os(!0),X=()=>{let se=Tr(Wn,[]);s(se);try{let pe=wr(zo,{}).systemSettings?.memory!==!1;A(pe)}catch{A(!0)}};Od(()=>{X()},[]),Nd((se,ie)=>{if(ie.escape&&t(),ie.upArrow&&f(pe=>Math.max(0,pe-1)),ie.downArrow&&f(pe=>Math.min(b.length-1,pe+1)),se==="x"&&b.length>0){let pe=b[k].id,Be=b.filter(Ce=>Ce.id!==pe);Bi(Wn,Be),s(Be),k>=Be.length&&Be.length>0&&f(Be.length-1)}});let S=(se,ie,pe)=>{if(!se)return"";let Be=se.replace(/\[Saved on: .*?\]/g,"").replace(/\\+'/g,"'").trim(),Fe=`${pe?"\u276F ":" "}${ie+1}. `.length,le=pe?22:2;return Be.split(`
44
+ ---`)&&Ee.push({label:kt,value:kt,isHeader:!1,provider:it})}))}return Ee},[f,h,s,at]),oe=v.useMemo(()=>{if(!ae.trim())return ve;let ue=ae.trim().toLowerCase(),w=[],U=null;for(let Ee of ve)Ee.isHeader?U=Ee:(Ee.label.toLowerCase().includes(ue)||Ee.value&&Ee.value.toLowerCase().includes(ue))&&(U&&!w.includes(U)&&w.push(U),w.push(Ee));return w},[ve,ae]);Rn(()=>{if(ee){let ue=oe.findIndex(w=>!w.isHeader);R(ue>=0?ue:0),Z(0)}},[ae]),Rn(()=>{if(ee){if(oe.length===0){R(0),Z(0);return}if(me>=oe.length||oe[me]?.isHeader){let ue=oe.findIndex(w=>!w.isHeader);R(ue>=0?ue:0)}}},[oe,ee]);let[ce,Se]=At(0),[D,Ue]=At(0),[qe,Ct]=At("MB"),[Gt,Hr]=At(!1);Rn(()=>{let ue=!1;return import("./exec_command-CY42M4FP.js").then(w=>{ue||Hr(!!w.isPtyAvailable)}).catch(()=>{}),()=>{ue=!0}},[]),Rn(()=>{let ue=vd.getHeapStatistics().heap_size_limit,w=ue>=1024*1024*1024,U=w?"GB":"MB",Ee=w?1024*1024*1024:1024*1024;Ue(parseFloat((ue/Ee).toFixed(2))),Ct(U);let Xe=()=>{let qt=process.memoryUsage().rss/Ee,je=w?parseFloat(qt.toFixed(2)):Math.round(qt);Se(je)};Xe();let Re=setInterval(()=>{Xe()},3e4);return()=>clearInterval(Re)},[]);let en=ue=>{switch(ue){case"providers":{let U=[{label:"Current Provider",value:"aiProvider",status:f}];return f==="Ollama"&&U.push({label:"Endpoint",value:"ollamaEndpoint",status:t.ollamaEndpoint||"Cloud"}),U}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:"Toggle Memory [Legacy]",value:"memory",status:t.memory?"ON":"OFF"}];case"security":return[{label:"Sandbox Preset",value:"sandboxPreset",status:wl(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:Ds(t.alwaysAskCommands),section:"Sandbox"},{label:"Auto Approve Commands",value:"autoApprove",status:Ds(t.autoApproveCommands),section:"Sandbox"},{label:"Auto Disapprove Commands",value:"autoDisallow",status:Ds(t.autoDisallowCommands),section:"Sandbox"},{label:"Auto Approve Git Commits",value:"autoApproveGit",status:t.autoApproveGit?"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"}];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"other":return[{label:"Sub-Agents",value:"subAgents",status:t.subAgents!==!1?"ON":"OFF"},{label:"Sub-Agent Model",value:"subAgentModel",status:t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default"},{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:"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"}];default:return[]}},tn=ho[L].id,Ge=en(tn);Sd((ue,w)=>{if(ee){if(w.tab){Ae(U=>U==="search"?"list":"search");return}if(he==="search"){w.escape?We(!1):w.downArrow||w.return?Ae("list"):w.backspace||w.delete?fe(U=>U.slice(0,-1)):ue&&!w.ctrl&&!w.meta&&ue.length===1&&fe(U=>U+ue);return}if(w.upArrow)R(U=>{if(oe.length===0)return 0;let Ee=(U-1+oe.length)%oe.length,Xe=0;for(;oe[Ee]?.isHeader&&Xe<oe.length;)Ee=(Ee-1+oe.length)%oe.length,Xe++;return Ee});else if(w.downArrow)R(U=>{if(oe.length===0)return 0;let Ee=(U+1)%oe.length,Xe=0;for(;oe[Ee]?.isHeader&&Xe<oe.length;)Ee=(Ee+1)%oe.length,Xe++;return Ee});else if(w.return){let U=oe[me];U&&!U.isHeader&&(m(Ee=>{let Xe=U.value==="Default",Re={...Ee,CustomSubAgent:!Xe,SubAgentModel:U.value,SubAgentProvider:Xe?"":U.provider||""};return b({systemSettings:Re,apiTier:h,quotas:s}),Re}),We(!1))}else w.escape?We(!1):ue&&!w.ctrl&&!w.meta&&ue.length===1&&(fe(U=>U+ue),Ae("search"));return}if(Be){if(w.upArrow){let U=(Fe-1+xo.length)%xo.length;le(U)}else if(w.downArrow){let U=(Fe+1)%xo.length;le(U)}else if(w.return){let U=xo[Fe];m(Ee=>{let Xe={...Ee,theme:U};return b({systemSettings:Xe,apiTier:h,quotas:s}),Xe}),A?A():Ce(!1)}else w.escape&&(A?A():Ce(!1));return}if(ye){w.escape&&se(null);return}if(P==="categories")w.upArrow?_(U=>(U-1+ho.length)%ho.length):w.downArrow?_(U=>(U+1)%ho.length):w.return||w.rightArrow?ho[L].id==="exit"?y("chat"):(N("items"),ge(0)):w.escape&&y("chat");else if(P==="items"){if(w.upArrow)ge(U=>(U-1+Ge.length)%Ge.length);else if(w.downArrow)ge(U=>(U+1)%Ge.length);else if(w.leftArrow||w.escape)N("categories");else if(w.return){let U=Ge[Q];Rt(U)}}});let Rt=ue=>{if(ue.value==="memory")m(w=>({...w,memory:!w.memory}));else if(ue.value==="sandboxPreset"){let w=wl(t),U=["Autonomous","Balanced","Strict"],Xe=(U.indexOf(w)+1)%U.length,Re=U[Xe];m(it=>{let Ye={...it,sandboxPreset:Re};return Re==="Strict"?(Ye.autoExec=!1,Ye.allowExternalAccess=!1,Ye.networkAccess=!1,Ye.autoApproveCommands="",Ye.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",Ye.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",Ye.autoApproveGit=!1):Re==="Balanced"?(Ye.autoExec=!0,Ye.allowExternalAccess=!1,Ye.networkAccess=!0,Ye.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",Ye.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",Ye.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",Ye.autoApproveGit=!1):Re==="Autonomous"&&(Ye.autoExec=!0,Ye.allowExternalAccess=!0,Ye.networkAccess=!0,Ye.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",Ye.autoDisallowCommands="",Ye.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",Ye.autoApproveGit=!0),Ye})}else if(ue.value==="autoExec")t.autoExec?m(w=>({...w,autoExec:!1,sandboxPreset:"Custom"})):t.allowExternalAccess?y("doubleDanger"):y("autoExecDanger");else if(ue.value==="externalAccess")t.allowExternalAccess?m(w=>({...w,allowExternalAccess:!1,sandboxPreset:"Custom"})):t.autoExec?y("doubleDanger"):y("externalDanger");else if(ue.value==="networkAccess")m(w=>({...w,networkAccess:w.networkAccess===!1,sandboxPreset:"Custom"}));else if(ue.value==="alwaysAsk")se("alwaysAskCommands"),pe(t.alwaysAskCommands||"");else if(ue.value==="autoApprove")se("autoApproveCommands"),pe(t.autoApproveCommands||"");else if(ue.value==="autoApproveGit")m(w=>({...w,autoApproveGit:!w.autoApproveGit,sandboxPreset:"Custom"}));else if(ue.value==="autoDisallow")se("autoDisallowCommands"),pe(t.autoDisallowCommands||"");else if(ue.value==="ollamaEndpoint")m(w=>{let U=w.ollamaEndpoint==="Local"?"Cloud":"Local",Ee={...w,ollamaEndpoint:U};return b({systemSettings:Ee,apiTier:h,quotas:s}),Ee});else if(ue.value==="apiTier")y("apiTier");else if(ue.value==="aiProvider")X&&X("settings"),y("selectProvider");else if(ue.value==="advanceRollback")t.advanceRollback?m(w=>{let U={...w,advanceRollback:!1};return b({systemSettings:U,apiTier:h,quotas:s}),U}):y("advanceRollbackDanger");else if(ue.value==="autoDelete"){let w=["1d","7d","30d"],Ee=(w.indexOf(t.autoDeleteHistory||"30d")+1)%w.length;m(Xe=>({...Xe,autoDeleteHistory:w[Ee]}))}else if(ue.value==="autoUpdate")m(w=>({...w,autoUpdate:!w.autoUpdate}));else if(ue.value==="externalData")if(!t.useExternalData)T({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||""}),y("input");else{let w={...t,useExternalData:!1};m(w),b({systemSettings:w,apiTier:h,quotas:s}),k(U=>[...U,{id:Date.now(),role:"system",text:"[STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart."}]),y("chat")}else if(ue.value==="updateManager")y("updateManager");else if(ue.value==="parserDownload")y("parserDownload");else if(ue.value==="indentationTree")m(w=>{let U={...w,indentationTree:w.indentationTree===!1};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="compressToolResults")m(w=>{let U={...w,compressToolResults:!w.compressToolResults};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="autoTruncateResults")m(w=>{let U={...w,autoTruncateResults:!w.autoTruncateResults};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="imageHistoryCU"){let w=["Low","Standard","Extended"],Ee=(w.indexOf(t.imageHistoryCU||"Standard")+1)%w.length;m(Xe=>{let Re={...Xe,imageHistoryCU:w[Ee]};return b({systemSettings:Re,apiTier:h,quotas:s}),Re})}else if(ue.value==="contextLength"){let w=["16k","32k","64k","128k","256k","512k","1M"],Ee=(w.indexOf(t.contextLength||"256k")+1)%w.length;m(Xe=>{let Re={...Xe,contextLength:w[Ee]};return b({systemSettings:Re,apiTier:h,quotas:s}),Re})}else if(ue.value==="keepReasoningContext")m(w=>{let U={...w,keepReasoningContext:!w.keepReasoningContext};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="autoExcludeMetadata")m(w=>{let U={...w,autoExcludeMetadata:!w.autoExcludeMetadata};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="disableTodo")m(w=>{let U={...w,disableTodo:!w.disableTodo};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="subAgents")m(w=>{let U={...w,subAgents:w.subAgents===!1};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="subAgentModel"){let w=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",U=oe.findIndex(Ee=>Ee.value===w);R(U>=0?U:0),We(!0)}else if(ue.value==="preserveThinking")m(w=>{let U={...w,preserveThinking:w.preserveThinking===!1};return ml(U.preserveThinking),b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="loadingPhrases")m(w=>{let U={...w,loadingPhrases:w.loadingPhrases===!1};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="progressiveRendering")m(w=>{let U={...w,progressiveRendering:!w.progressiveRendering};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="showTPMEstimate")m(w=>{let U={...w,showTPMEstimate:!w.showTPMEstimate};return b({systemSettings:U,apiTier:h,quotas:s}),U});else if(ue.value==="theme"){let w=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",U=xo.indexOf(w);le(U>=0?U:0),be(t.theme||"Dark"),Ce(!0)}},Me=Je(t.theme);if(ee){let ue=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",w=15,U=te;me<U?U=me:me>=U+w&&(U=me-w+1),U=Math.max(0,Math.min(U,Math.max(0,oe.length-w))),U!==te&&Z(U);let Ee=oe.slice(U,U+w);return v.createElement(Ne,{flexDirection:"column",borderStyle:"round",borderColor:Me.border,padding:1,width:"100%",minHeight:32},v.createElement(Ne,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:Me.text,bold:!0,underline:!0},"Select Sub-Agent Model:"),oe.length>0&&v.createElement(j,{color:"gray"},me+1,"/",oe.length)),v.createElement(Ne,{borderStyle:"single",borderColor:he==="search"?Me.primary||"cyan":"gray",paddingX:1,marginBottom:1},v.createElement(j,{color:he==="search"?Me.primary||"cyan":"gray",bold:!0},"\u{1F50D} Search: "," "),v.createElement(j,{color:Me.text},ae),he==="search"&&v.createElement(j,{color:Me.primary||"cyan"},"\u2588"),!ae&&he!=="search"&&v.createElement(j,{color:"gray",italic:!0},"(Press TAB or type to filter models...)")),v.createElement(Ne,{flexDirection:"column",flexGrow:1,height:w},Ee.length>0?Ee.map((Xe,Re)=>{let it=U+Re;if(Xe.isHeader)return v.createElement(Ne,{key:`hdr-${it}`,paddingX:1},v.createElement(j,{color:"gray",bold:!0,underline:!0},Xe.label));let Ye=me===it&&he==="list",qt=ue===Xe.value;return v.createElement(Ne,{key:`item-${Xe.value}-${it}`,paddingX:1,backgroundColor:Ye?Me.highlightBg:void 0},v.createElement(j,{color:Ye?Me.text:Me.textDim,bold:Ye},Ye?"\u276F ":" ",Xe.label,qt?v.createElement(j,{color:Me.primary||"cyan",italic:!0}," (active)"):""))}):v.createElement(Ne,{paddingX:1},v.createElement(j,{color:"gray",italic:!0},'No models matching "',ae,'"'))),v.createElement(Ne,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:"gray",italic:!0},"TAB to switch search/list \u2022 \u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),v.createElement(j,{color:he==="search"?Me.primary||"cyan":"gray",bold:!0},"[",he.toUpperCase()," MODE]")))}if(Be){let ue=xo[Fe],w=Je(ue);return v.createElement(Ne,{flexDirection:"column",borderStyle:"round",borderColor:w.border,padding:1,width:"100%",minHeight:32},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:w.text,bold:!0},"Choose your color scheme:")),v.createElement(Ne,{flexDirection:"row",width:"100%",flexGrow:1},v.createElement(Ne,{flexDirection:"column",width:"30%",paddingRight:1},xo.map((U,Ee)=>{let Xe=Fe===Ee,Re=(t.theme||"Dark")===U,it=U==="Forest Sprite";return v.createElement(Ne,{key:U,paddingX:0},v.createElement(j,{color:Xe?w.text:w.textDim,bold:Xe},Xe?"> ":" ",U,it&&v.createElement(j,{color:Xe?w.success||"#52b788":"green",bold:!0}," \u2605"),Re?v.createElement(j,{color:w.primary||"cyan",italic:!0}," (saved)"):""))})),v.createElement(Ne,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:w.borderMuted,paddingX:2,paddingY:1,backgroundColor:w.cardBg},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:w.secondary||"cyan",bold:!0},"> ","you: "),v.createElement(j,{color:w.text},"add a greeting function")),v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:w.success||"green"}," Here's the change:")),v.createElement(Ne,{flexDirection:"column",marginLeft:2,marginBottom:1},v.createElement(j,null,v.createElement(j,{color:w.textDim},"3 "),v.createElement(j,{color:w.textDim},' import "fmt"')),v.createElement(j,{color:w.textDim},"4"),v.createElement(Ne,{backgroundColor:w.diffRemovalBg},v.createElement(j,null,v.createElement(j,{color:w.diffRemovalNum||w.diffRemovalText},"5 "),v.createElement(j,{color:w.diffRemovalPrefix||w.diffRemovalText},"- "),v.createElement(j,{color:w.diffRemovalText},"func "),v.createElement(j,{color:w.diffRemovalHighlightColor||w.diffRemovalText,backgroundColor:w.diffRemovalHighlightBg,bold:!0},"main()"),v.createElement(j,{color:w.diffRemovalText}," {"))),v.createElement(Ne,{backgroundColor:w.diffAdditionBg},v.createElement(j,null,v.createElement(j,{color:w.diffAdditionNum||w.diffAdditionText},"5 "),v.createElement(j,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),v.createElement(j,{color:w.diffAdditionText},"func "),v.createElement(j,{color:w.diffAdditionHighlightColor||w.diffAdditionText,backgroundColor:w.diffAdditionHighlightBg,bold:!0},"greet(name string)"),v.createElement(j,{color:w.diffAdditionText}," {"))),v.createElement(Ne,{backgroundColor:w.diffAdditionBg},v.createElement(j,null,v.createElement(j,{color:w.diffAdditionNum||w.diffAdditionText},"6 "),v.createElement(j,{color:w.diffAdditionPrefix||w.diffAdditionText},"+ "),v.createElement(j,{color:w.diffAdditionText}," "),v.createElement(j,{color:w.diffAdditionHighlightColor||w.diffAdditionText,backgroundColor:w.diffAdditionHighlightBg},'fmt.Printf("Hello, %s!\\n", name)'))),v.createElement(j,{color:w.textDim},"7 }")),v.createElement(Ne,{flexDirection:"column",marginTop:1,marginBottom:1},v.createElement(j,{color:w.textDim},"\u25BE Thought Process"),v.createElement(j,{color:w.textMuted}," I need to add a greeting function. I'll use fmt.Printf.")),v.createElement(Ne,{flexDirection:"column"},v.createElement(j,null,v.createElement(j,{color:w.warning||"yellow"},"\u2699 tool: "),v.createElement(j,{color:w.text},"write_file main.go")),v.createElement(j,null,v.createElement(j,{color:w.accent||"magenta"},"\u29BF task: "),v.createElement(j,{color:w.text},"Implementing greeting")),v.createElement(j,null,v.createElement(j,{color:w.danger||"red"},"X error: "),v.createElement(j,{color:w.text},"compilation failed")),v.createElement(j,null,v.createElement(j,{color:w.warning||"yellow"},"\u26A0 warning: "),v.createElement(j,{color:w.text},"deprecation warning")),v.createElement(j,null,v.createElement(j,{color:w.info||"blue"},"\u2192 link: "),v.createElement(j,{color:w.info||"blue",underline:!0},"file:///path/to/main.go")),v.createElement(j,null,v.createElement(j,{color:w.accent||"magenta"},"\u2605 accent: "),v.createElement(j,{color:w.text},"highlighted text")),v.createElement(j,{color:w.textDim},"\xB7 dim: press Enter to continue")))),v.createElement(Ne,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:"gray",italic:!0},"\u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),v.createElement(j,{color:"gray"},"Previewing: ",xo[Fe],xo[Fe]==="Forest Sprite"?" \u2605":"")))}return v.createElement(Ne,{flexDirection:"column",borderStyle:"round",borderColor:Me.border,padding:0,width:"100%",minHeight:32},v.createElement(Ne,{paddingX:1,paddingY:0,marginBottom:0,borderStyle:"single",borderColor:Me.borderMuted,width:"100%"},v.createElement(j,{color:Me.text,bold:!0},"SYSTEM CONFIGURATION")),v.createElement(Ne,{flexDirection:"row",width:"100%",minHeight:26},v.createElement(Ne,{flexDirection:"column",width:"30%",maxWidth:40,borderStyle:"round",borderColor:P==="categories"?Me.border:Me.borderMuted,padding:1,paddingY:0},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:P==="categories"?Me.text:Me.textDim,bold:!0,underline:!0},"CATEGORIES")),ho.map((ue,w)=>{let U=L===w,Ee=ue.id==="exit";return v.createElement(Ne,{key:ue.id,marginTop:Ee?15:0,backgroundColor:U?P==="categories"?Me.highlightBg:Me.cardBg:void 0,paddingX:1},v.createElement(j,{color:U&&P==="categories"?Me.text:Me.textDim,bold:U},U?"\u276F ":" ",ue.label))})),v.createElement(Ne,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:P==="items"?Me.border:Me.borderMuted,paddingX:1,marginLeft:1,paddingY:0},v.createElement(Ne,{marginBottom:1},v.createElement(j,{color:P==="items"?Me.text:Me.textDim,bold:!0,underline:!0},ho[L].label.toUpperCase().includes("EXIT")?"Runtime Information":`${ho[L].label} Settings`)),Ge.length>0?(()=>{let ue=null,w=[],U=je=>(je||"").split(",").map(kt=>kt.trim().toLowerCase()).filter(Boolean),Ee=U(t.autoApproveCommands),Xe=U(t.autoDisallowCommands),Re=U(t.alwaysAskCommands),it=[...Ee,...Xe,...Re],Ye=new Set(it),qt=tn==="security"&&it.length!==Ye.size;return Ge.forEach((je,kt)=>{let zt=P==="items"&&Q===kt,Xr=je.label.length,on=Math.max(2,38-Xr),Wr=".".repeat(on),mt=Le=>tn==="security"?(Le.value==="autoExec"||Le.value==="externalAccess")&&Le.status==="ON"?Me.statusOn:Me.statusOff:Le.status?.startsWith("\u2713")?Me.statusOn:Le.status?.startsWith("\u26A0")?Me.statusOff:Le.status==="ON"?Me.statusOn:Le.status==="OFF"?Me.statusOff:Me.text;je.section&&je.section!==ue&&(ue=je.section,w.push(v.createElement(Ne,{key:`sec-hdr-${je.section}`,marginTop:w.length>0?1:0,marginBottom:0,paddingX:1},v.createElement(j,{color:"gray",bold:!0,underline:!0},je.section.toUpperCase()))));let z=zt&&ye&&(ye==="alwaysAskCommands"&&je.value==="alwaysAsk"||ye==="autoApproveCommands"&&je.value==="autoApprove"||ye==="autoDisallowCommands"&&je.value==="autoDisallow"),lt=je.value==="alwaysAsk"||je.value==="autoApprove"||je.value==="autoDisallow",Wo=je.value==="parserDownload";w.push(v.createElement(Ne,{key:je.value,flexDirection:"column"},v.createElement(Ne,{backgroundColor:zt&&!z?Me.highlightBg:void 0,paddingX:2},v.createElement(j,{color:zt?Me.text:Me.textDim,bold:zt},zt?"\u276F ":" ",je.label),!lt&&!Wo&&v.createElement(v.Fragment,null,v.createElement(j,{color:"gray"},Wr),v.createElement(j,{color:mt(je),bold:!0},je.value==="aiProvider"?je.status:`[ ${je.status} ]`))),lt&&!z&&je.status!=="None"&&v.createElement(Ne,{paddingX:4,marginBottom:1},v.createElement(j,{color:"gray"},"\u21B3 ",je.status)),z&&v.createElement(Ne,{flexDirection:"column",marginLeft:4,marginBottom:1},v.createElement(Ne,{paddingX:1,borderStyle:"single",borderColor:"gray",flexDirection:"row"},v.createElement(j,{color:"gray",bold:!0},"> "," "),v.createElement(Cd,{value:ie,onChange:pe,onSubmit:Le=>{let _t={...t,[ye]:Le.trim(),sandboxPreset:"Custom"};m(_t),b({systemSettings:_t,apiTier:h,quotas:s}),se(null)}})),v.createElement(j,{color:"gray",italic:!0}," Comma separated \u2022 Press Enter to save, Esc to cancel"))))}),qt&&w.push(v.createElement(Ne,{key:"conflict-warning",marginTop:1,paddingX:1},v.createElement(j,{color:Me.text,italic:!0},"* Conflicting commands will be ignored and defaulted to highest priority"))),w})():v.createElement(Ne,{paddingX:1,flexDirection:"column",width:"100%"},tn==="exit"?v.createElement(v.Fragment,null,v.createElement(Ne,{flexDirection:"column",marginBottom:1},v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"OS"," "),v.createElement(j,{color:"gray"},"..................... "),v.createElement(j,{color:Me.text},process.env.OS||process.platform||"N/A")),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Computer Name"," "),v.createElement(j,{color:"gray"},".......... "),v.createElement(j,{color:Me.text},process.env.COMPUTERNAME||process.env.HOSTNAME||"N/A")),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Processor Count"," "),v.createElement(j,{color:"gray"},"........ "),v.createElement(j,{color:Me.text},process.env.NUMBER_OF_PROCESSORS||"N/A")),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Node.js Version"," "),v.createElement(j,{color:"gray"},"........ "),v.createElement(j,{color:Me.text},"v",process.versions.node)),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"V8 Version"," "),v.createElement(j,{color:"gray"},"...... ...... "),v.createElement(j,{color:Me.text},"v",process.versions.v8)),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Data Directory"," "),v.createElement(j,{color:"gray"},"......... "),ro===mo?"":v.createElement(j,{color:Me.text},ro.replaceAll(Tl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"),", "),v.createElement(j,{color:Me.text},mo.replaceAll(Tl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"))),v.createElement(Ne,{flexDirection:"row"},v.createElement(j,{color:Me.textDim},"Viewport"," "),v.createElement(j,{color:"gray"},"............... "),v.createElement(j,{color:Me.text},process.stdout.rows||"?"," rows \xD7 ",process.stdout.columns||"?"," cols ",process.stdout.columns<90?"(too small width)":"")),v.createElement(Ne,{flexDirection:"row",marginBottom:0},v.createElement(j,{color:Me.textDim},"Memory Load"," "),v.createElement(j,{color:"gray"},"............ "),v.createElement(j,{color:Me.text},ce,"/",D," ",qe))),v.createElement(Ne,{key:"pty-notice",paddingX:0,marginTop:0},v.createElement(j,{color:Gt?Me.statusOn:Me.warning},Gt?"\u2713 Advance Interactive Terminal Supported":"\u26A0 Interactive Terminal is Limited"))):v.createElement(j,{color:"gray",italic:!0},ho[L].desc)))),v.createElement(Ne,{paddingX:1,marginTop:0,flexDirection:"row",justifyContent:"space-between"},v.createElement(j,{color:"gray",italic:!0},P==="categories"?"\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure":"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"),P==="categories"&&v.createElement(j,{color:"gray"},ho[L].desc)))}import Jt,{useState as ks,useEffect as Ed}from"react";import{Box as Bn,Text as er}from"ink";import Bd from"ink-text-input";function Is({initialData:t,onSave:m,onCancel:h,theme:y="Dark"}){let T=Je(y),[b,s]=ks(0),[k,f]=ks(""),[I,A]=ks(()=>({name:t?.name||"",nickname:t?.nickname||"",instructions:t?.instructions||""})),X=[{key:"nickname",label:"Enter a Nickname: ",maxLength:20},{key:"instructions",label:"System Instructions: ",maxLength:200}],S=X[b];Ed(()=>{let L=X[b].key;f((I[L]||"").slice(0,X[b].maxLength))},[b,I]);let C=L=>{L.length>S.maxLength?f(L.slice(0,S.maxLength)):f(L)},P=L=>{if(L.trim().toLowerCase()==="/cancel"){h();return}let _=S.key,Q={...I,[_]:L.trim().slice(0,S.maxLength)};A(Q),f(""),b<X.length-1?s(b+1):m(Q)},N=k.length>=S.maxLength;return Jt.createElement(Bn,{borderStyle:"round",borderColor:T.borderMuted,padding:0,marginTop:1,flexShrink:0,flexDirection:"column",width:"100%"},Jt.createElement(Bn,{paddingX:1,marginBottom:1},Jt.createElement(er,{color:T.text,bold:!0},"USER PROFILE CONFIGURATION")),Jt.createElement(Bn,{paddingX:1,flexDirection:"column"},Jt.createElement(Bn,null,Jt.createElement(er,{color:T.text,bold:!0},S.label),Jt.createElement(Bd,{value:k,onChange:C,onSubmit:P})),Jt.createElement(Bn,{marginTop:1,justifyContent:"space-between"},Jt.createElement(er,{color:T.textMuted,italic:!0},"Step ",b+1," of ",X.length),Jt.createElement(er,{color:N?T.warning||"yellow":T.textMuted},"[",k.length,"/",S.maxLength,"]"))),Jt.createElement(Bn,{paddingX:1,marginTop:1},Jt.createElement(er,{color:T.textMuted,italic:!0},"(Enter to submit \u2022 Type /cancel to abort)")))}import yt,{useState as As}from"react";import{Box as Zt,Text as $o,useInput as Dd}from"ink";import kd from"ink-text-input";var Id=({question:t,options:m,onResolve:h,theme:y="Dark"})=>{let T=Je(y),[b,s]=As(!1),[k,f]=As(""),[I,A]=As(0),X=!1,S=[],C=Array.isArray(m)&&m.length>0,P=t==="Agent has been running for a long time. Do you want to continue execution?";try{P&&C?S=[...m]:S=[...C?m:[],C?{id:"CUSTOM",label:"Suggest something else...",description:"Provide a custom response"}:{id:"CUSTOM",label:"Your Answer",description:""}]}catch{X=!0}Dd((L,_)=>{if(!b&&((_.leftArrow||_.upArrow)&&A(Q=>Math.max(0,Q-1)),(_.rightArrow||_.downArrow)&&A(Q=>Math.min(S.length-1,Q+1)),_.return)){let Q=S[I];Q?.id==="CUSTOM"?s(!0):h(X?"Selected Nothing":Q.label)}});let N=nt(2);return b?yt.createElement(Zt,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:T.codeBg,width:"100%"},yt.createElement(Zt,{paddingX:1},yt.createElement($o,{color:T.text,bold:!0},"SUGGEST SOMETHING")),yt.createElement(Zt,{marginTop:1,paddingX:1},yt.createElement($o,{italic:!0,color:T.textMuted},"Replying to: ",t)),yt.createElement(Zt,{marginTop:1,paddingX:1,flexDirection:"row"},yt.createElement(kd,{value:k,onChange:f,onSubmit:()=>h(k)})),yt.createElement(Zt,{marginTop:1,paddingX:1,marginBottom:1},yt.createElement($o,{color:T.textMuted,italic:!0},"(Press Enter to send)"))):yt.createElement(Zt,{flexDirection:"column",border:!0,borderStyle:"round",borderColor:T.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,marginRight:1,width:"100%"},yt.createElement(Zt,{paddingX:1,marginBottom:1},yt.createElement($o,{color:"yellow",bold:!0},P?"TURN SAFETY SYSTEM: EXECUTION LIMIT":"AGENT REQUEST: ACTION REQUIRED")),yt.createElement(Zt,{paddingX:1,marginBottom:1},yt.createElement($o,{color:T.text},t)),yt.createElement(Zt,{flexDirection:"column",width:"100%"},S.map((L,_)=>{let Q=_===I;return yt.createElement(Zt,{key:L.id,flexDirection:"column",width:"100%",backgroundColor:Q?T.highlightBg:void 0,paddingX:1,marginBottom:_===S.length-1?0:1},yt.createElement($o,{color:Q?T.text:T.textMuted,bold:Q},Q?"\u276F ":" ",L.label),L.description&&yt.createElement(Zt,{marginLeft:4},yt.createElement($o,{color:T.textMuted,italic:!0},L.description)))})),yt.createElement(Zt,{paddingX:1,marginTop:1,marginBottom:1},yt.createElement($o,{color:T.textMuted,italic:!0},"(Use Arrows to navigate, Enter to confirm)")))},yl=Id;import Zd from"gradient-string";import Lt,{useState as Ls,useEffect as Ad}from"react";import{Box as po,Text as _o,useInput as Ld}from"ink";function Ps({onSelect:t,onDelete:m,onClose:h,theme:y="Dark"}){let T=Je(y),[b,s]=Ls({}),[k,f]=Ls([]),[I,A]=Ls(0);Ad(()=>{(async()=>{let L=await Fo();s(L),f(Object.keys(L).sort((_,Q)=>(L[Q].updatedAt||0)-(L[_].updatedAt||0)))})()},[]),Ld((N,L)=>{if(L.escape&&h(),L.upArrow&&A(_=>Math.max(0,_-1)),L.downArrow&&A(_=>Math.min(k.length-1,_+1)),L.return&&k[I]&&t(k[I]),N==="x"&&k[I]){let _=k[I];m(_).then(Q=>{let ge=Q||{};s(ge);let ye=Object.keys(ge).sort((se,ie)=>(ge[ie]?.updatedAt||0)-(ge[se]?.updatedAt||0));f(ye),A(se=>Math.max(0,Math.min(ye.length-1,se)))})}});let X=nt(2),S=15,C=0;if(k.length>S){let N=Math.floor(S/2);C=I-N,C<0?C=0:C+S>k.length&&(C=k.length-S)}let P=k.slice(C,C+S);return Lt.createElement(po,{flexDirection:"column",borderStyle:"round",borderColor:T.borderMuted,padding:0,width:"100%"},Lt.createElement(po,{paddingX:1,marginBottom:1},Lt.createElement(_o,{color:T.text,bold:!0},"CHAT HISTORY: RESUME CONVERSATION")),k.length===0?Lt.createElement(po,{paddingX:2,paddingY:1},Lt.createElement(_o,{italic:!0,color:T.textMuted},"No saved chats found.")):Lt.createElement(po,{flexDirection:"column",width:"100%"},C>0&&Lt.createElement(po,{paddingX:2,marginBottom:1},Lt.createElement(_o,{color:T.textMuted},"\u25B2 (+",C," more chats above)")),P.map((N,L)=>{let _=b[N],ge=C+L===I,ye=Pd(_?.updatedAt);return Lt.createElement(po,{key:N,paddingX:1,backgroundColor:ge?T.highlightBg:void 0,width:"100%"},Lt.createElement(po,{flexGrow:1},Lt.createElement(_o,{color:ge?T.text:T.textMuted,bold:ge},ge?"\u276F ":" ",(()=>{let se=ie=>(ie||"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();return _?.name&&!_.name.startsWith("Session")?se(_.name):_?.prompt?se(_.prompt):se(_?.name)||N})(),Lt.createElement(_o,{color:T.textMuted}," [",ye," \u2022 ",N,"]"))),ge&&Lt.createElement(po,{flexShrink:0},Lt.createElement(_o,{color:T.danger,bold:!0},"[X] DELETE ")))}),C+S<k.length&&Lt.createElement(po,{paddingX:2,marginTop:1},Lt.createElement(_o,{color:T.textMuted},"\u25BC (+",k.length-(C+S)," more chats below)"))),Lt.createElement(po,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:T.borderMuted},Lt.createElement(_o,{color:T.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")))}function Pd(t){if(!t)return"N/A";let m=new Date(t);if(isNaN(m.getTime()))return"N/A";let h=k=>String(k).padStart(2,"0"),y=h(m.getMonth()+1),T=h(m.getDate()),b=h(m.getHours()),s=h(m.getMinutes());return`${y}-${T} ${b}:${s}`}import Mt,{useState as Os,useEffect as Od}from"react";import{Box as bo,Text as lo,useInput as Nd,useStdout as Fd}from"ink";function Ns({onClose:t,theme:m="Dark"}){let h=Je(m),{stdout:y}=Fd(),T=y?.columns||80,[b,s]=Os([]),[k,f]=Os(0),[I,A]=Os(!0),X=()=>{let se=Tr(Wn,[]);s(se);try{let pe=wr(zo,{}).systemSettings?.memory!==!1;A(pe)}catch{A(!0)}};Od(()=>{X()},[]),Nd((se,ie)=>{if(ie.escape&&t(),ie.upArrow&&f(pe=>Math.max(0,pe-1)),ie.downArrow&&f(pe=>Math.min(b.length-1,pe+1)),se==="x"&&b.length>0){let pe=b[k].id,Be=b.filter(Ce=>Ce.id!==pe);Bi(Wn,Be),s(Be),k>=Be.length&&Be.length>0&&f(Be.length-1)}});let S=(se,ie,pe)=>{if(!se)return"";let Be=se.replace(/\[Saved on: .*?\]/g,"").replace(/\\+'/g,"'").trim(),Fe=`${pe?"\u276F ":" "}${ie+1}. `.length,le=pe?22:2;return Be.split(`
45
45
  `).map((be,ee)=>{let We=ee===0,me=Math.max(10,T-4-(We?Fe:3)-le),R=Math.max(10,T-4-3-le),te=be.split(/(\s+)/),Z=[],ae="";if(te.forEach(he=>{if(he.length===0)return;let Ae=Z.length===0?me:R;ae.length+he.length>Ae?ae.trim().length>0?(Z.push(ae.trimEnd()),ae=he):(Z.push(he.substring(0,Ae)),ae=he.substring(Ae)):ae+=he}),ae.trimEnd().length>0&&Z.push(ae.trimEnd()),Z.length===0)return"";let fe=Z.join(`
46
46
  `);return We?fe:" "+fe}).join(`
47
47
  `)},C=4*1024*2,P=b.reduce((se,ie)=>se+(ie.memory?.length||0),0),N=Math.min(100,Math.round(P/C*100)),L=12,_=Math.round(N/100*L),Q="\u2588".repeat(_)+"\u2591".repeat(Math.max(0,L-_)),ge=()=>N<50?h.textMuted:N<90?h.warning:h.danger,ye=nt(2);return Mt.createElement(bo,{flexDirection:"column",borderStyle:"round",borderColor:h.borderMuted,padding:0,width:"100%"},Mt.createElement(bo,{paddingX:1,marginBottom:1,justifyContent:"space-between"},Mt.createElement(lo,{color:h.text,bold:!0},"SAVED MEMORIES"),Mt.createElement(bo,null,Mt.createElement(lo,{color:h.textMuted},"Vault: "),Mt.createElement(lo,{color:ge()},Q),Mt.createElement(lo,{color:h.text,bold:!0}," ",N,"%"))),!I&&b.length>0?Mt.createElement(bo,{paddingX:2,paddingY:1},Mt.createElement(lo,{italic:!0,color:h.textMuted},"Memory is currently Off...")):b.length===0?Mt.createElement(bo,{paddingX:2,paddingY:1},Mt.createElement(lo,{italic:!0,color:h.textMuted},I?"Learning...":"Memory not available...")):Mt.createElement(bo,{flexDirection:"column"},b.map((se,ie)=>{let pe=ie===k;return Mt.createElement(bo,{key:se.id,paddingX:1,backgroundColor:pe?h.highlightBg:void 0,width:"100%"},Mt.createElement(bo,{flexGrow:1},Mt.createElement(lo,{color:pe?h.text:h.textMuted,bold:pe},pe?"\u276F ":" ",ie+1,". ",S(se.memory,ie,pe))),pe&&Mt.createElement(bo,{flexShrink:0},Mt.createElement(lo,{color:h.textMuted,dimColor:!0}," [",Mt.createElement(lo,{italic:!0},se.score),"] "),Mt.createElement(lo,{color:h.danger,bold:!0},"[X] WIPE ")))})),Mt.createElement(bo,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:h.borderMuted},Mt.createElement(lo,{color:h.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 x wipe memory \u2022 Esc close")))}import ft,{useState as Nr,useEffect as Ml}from"react";import{Box as Ho,Text as Nt}from"ink";import{spawn as Sl}from"child_process";var Cl=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Ud=({latest:t,current:m,settings:h,onClose:y,onUpdateSettings:T,onSuccess:b})=>{let[s,k]=Nr("initializing"),[f,I]=Nr(""),[A,X]=Nr(null),[S,C]=Nr(0);if(Ml(()=>{let P=setInterval(()=>{C(N=>(N+1)%1e3)},33);return()=>clearInterval(P)},[]),Ml(()=>{let P;return(async()=>{let L=h.updateManager||"npm";if(!h.updateManager){T();return}let _="";L==="pnpm"?_=`pnpm add -g fluxflow-cli@${t}`:L==="bun"?_=`bun add -g fluxflow-cli@${t}`:L==="yarn"?_=`yarn global add fluxflow-cli@${t}`:L==="custom"?_=h.customUpdateCommand:_=`npm install -g fluxflow-cli@${t}`,k("downloading"),I(`Running: ${_}...`);let Q=process.platform==="win32",ge=se=>new Promise(ie=>{let pe=Q?se?"powershell.exe":"cmd.exe":process.env.SHELL||"bash",Be=Q?se?["-NoProfile","-Command",_]:["/c",_]:["-c",_],Ce=le=>{let be=le.toString().replace(/\x1B\[[0-?]*[ -/]*[@-~]|\x1B\][^\x07\x1B]*[\x07\x1B]|\b|\x07/g,"").replace(/\r/g,"").trim();be&&I(ee=>{let We=ee.split(`
@@ -513,7 +513,7 @@ ${_}`:""}${a.length>0?`${_.length>0?`
513
513
  ${a}`:""}
514
514
 
515
515
  `:"",d=(()=>{let Q=process.cwd().toLowerCase();if(process.platform==="win32"){let ke=process.env.SystemRoot?.toLowerCase()||"c:\\windows",ae=process.env.ProgramFiles?.toLowerCase()||"c:\\program files",it=process.env["ProgramFiles(x86)"]?.toLowerCase()||"c:\\program files (x86)";return Q.startsWith(ke)||Q.startsWith(ae)||Q.startsWith(it)}else return Q==="/"||["/bin","/sbin","/etc","/usr","/var","/root"].some(ae=>Q.startsWith(ae))})(),r=new Date,E=r.getFullYear(),v=r.toLocaleString("en-US",{month:"short"}).toUpperCase(),U=String(r.getDate()).padStart(2,"0"),O=`${E}-${v}-${U}`,P=!!s?.autoExcludeMetadata,re=process.env.I_HAVE_TOO_MUCH_MONEY==="true"||process.env.I_HAVE_TOO_MUCH_MONEY===!0||!1,de=process.env.NO_DEV==="true"||process.env.NO_DEV==="1"||process.env.NO_DEV===!0||!1;return`${re?`${" ".repeat(Math.floor(Math.random()*4)+1)}`:""}=== SYSTEM PROMPT ===
516
- Identity: ${Ps.length>1?Ps.trim():"Flux Flow. Sassy, CLI Assistant"}. Expert in DSL Actions
516
+ Identity: ${Ps.length>1?Ps.trim():"Flux Flow. Sassy, CLI Assistant"}
517
517
  ${nr?"":`${n==="Flux"?"Stepwise Execution, Run Automated Tests":n==="Flow"?"Concise, Humorous, Sarcastic":n==="ICU"?"Computer Use Capabilities. Screenshot as ground truth, analyze grid ids overlapping/close to target, keyboard shortcuts > mouse clicks":"Computer Use & Workspace Capabilities. Screenshot as ground truth, analyze grid ids overlapping/close to target, keyboard shortcuts > mouse clicks. Workspace Tools if faster. Focus on Productivity"}`}${dr&&n.toLowerCase().includes("cu")?`
518
518
  - Running on secondary screen. Opened app not visible in screenshot? Might be opened on primary. Use 'AskUser' with NO options and tell user to move app window to secondary`:""}
519
519
 
@@ -562,7 +562,7 @@ ${vi(t,n)}
562
562
  === END SYSTEM PROMPT ===${e?`
563
563
 
564
564
  -- current saved user memories --
565
- ${e}`:""}`.trim();var gr=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),hr=()=>import("./web_scrape-BHSQTMX4.js").then(e=>e.web_scrape),mr=()=>import("./memory-SRDCQNML.js").then(e=>e.memory),pr=()=>import("./chat-7T6MVHC3.js").then(e=>e.chat),yr=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),xr=()=>import("./write_file-V6HKMWFB.js").then(e=>e.write_file),br=()=>import("./update_file-WTXXQ4RB.js").then(e=>e.update_file),wr=()=>import("./exec_command-CY42M4FP.js").then(e=>e.exec_command),kr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ws=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),Tr=()=>import("./write_pdf-XDDKM7V5.js").then(e=>e.write_pdf),Sr=()=>import("./write_docx-I7T3575T.js").then(e=>e.write_docx),Uo=()=>import("./search_keyword-CSRQFPHQ.js").then(e=>e.search_keyword),_r=()=>import("./generate_image-HVWLRINC.js").then(e=>e.generate_image),Wo=()=>import("./saveSummary-VKGBD4CG.js").then(e=>e.saveSummary),mo=()=>import("./addMemScore-PWP7GFSP.js").then(e=>e.addMemScore),Ar=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),Ho=()=>import("./todo-VG2CVRUI.js").then(e=>e.todo),Er=()=>import("./invokeSync-BPIG7EIY.js").then(e=>e.invokeSync),Sa=()=>import("./invoke-XPZ4MUGJ.js").then(e=>e.invoke),Cr=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),_a=()=>import("./cancel-7IMADALP.js").then(e=>e.cancel),Rr=()=>import("./emergency_rollback-DXN5WNPR.js").then(e=>e.emergency_rollback),po=()=>import("./awaitSubagent-JTUSJDKD.js").then(e=>e.awaitSubagent),yo=()=>import("./answerSubagent-JUVFNLE5.js").then(e=>e.answerSubagent),Go=()=>import("./steerSubagent-L2JVT4QN.js").then(e=>e.steerSubagent),jo=()=>import("./computer_action-7U3W3F6L.js").then(e=>e.computer_action),vr=()=>import("./click-5ZKBFZ4N.js").then(e=>e.click),Mr=()=>import("./drag-YHHKJGL6.js").then(e=>e.drag),Ir=()=>import("./scroll-C4Z57VQS.js").then(e=>e.scroll),Hs=()=>import("./keyboard_typing-QL3DF67Z.js").then(e=>e.keyboard_typing),Gs=()=>import("./key_press-ZZNA3PF3.js").then(e=>e.key_press),js=()=>import("./recapture_screen-5FKLOHJL.js").then(e=>e.recapture_screen),Ko=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),Aa={web_search:gr,web_scrape:hr,memory:mr,chat:pr,view_file:yr,write_file:xr,update_file:br,exec_command:wr,read_folder:kr,write_pdf:Tr,write_docx:Sr,search_keyword:Uo,generate_image:_r,saveSummary:Wo,addMemScore:mo,file_map:Ar,todo:Ho,Todo:Ho,goal:Ho,Goal:Ho,invokeSync:Er,invoke:Sa,getProgress:Cr,cancel:_a,awaitSubagent:po,answerSubagent:yo,steerSubagent:Go,computer_action:jo,computer_use:jo,ComputerAction:jo,ComputerUse:jo,click:vr,Click:vr,drag:Mr,Drag:Mr,scroll:Ir,Scroll:Ir,keyboard_typing:Hs,KeyboardTyping:Hs,keyboardtyping:Hs,key_press:Gs,KeyPress:Gs,keypress:Gs,recapture_screen:js,RecaptureScreen:js,recapturescreen:js,invoke_sync:Er,get_progress:Cr,await_subagent:po,answer_subagent:yo,steer_subagent:Go,steer:Go,Steer:Go,ask:Ws,Ask:Ws,AskUser:Ws,WebSearch:gr,WebScrape:hr,ReadFile:yr,ReadFolder:kr,WriteFile:xr,PatchFile:br,WritePDF:Tr,WriteDoc:Sr,Run:wr,SearchKeyword:Uo,CodeSearch:Uo,code_search:Uo,Memory:mr,Chat:pr,GenerateImage:_r,saveSumary:Wo,SaveSummary:Wo,SaveSumary:Wo,add_mem_score:mo,AddMemScore:mo,addMemoryScore:mo,AddMemoryScore:mo,FileMap:Ar,answer:yo,Answer:yo,AnswerSubagent:yo,await:po,Await:po,AwaitSubagent:po,EmergencyRollback:Rr,emergency_rollback:Rr,find_file:Ko,findFile:Ko,FindFile:Ko,findfile:Ko},xo=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),f=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await"].some(g=>o.includes(g))||o==="ask",k=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(g=>o.includes(g));if(!f){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(!k)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 p=Aa[e];if(!p){let g=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],T={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"},m=o.replace(/[^a-z0-9]/g,""),i=T[m]||null;if(!i){let w=0,I=A=>{let $=new Set;for(let C=0;C<A.length-1;C++)$.add(A.slice(C,C+2));return $},h=I(m);for(let A of g){let $=A.toLowerCase().replace(/[^a-z0-9]/g,"");if(m===$){i=A;break}let C=0;($.includes(m)||m.includes($))&&(C+=.6);let x=I($),_=0;for(let y of h)x.has(y)&&_++;let M=2*_/(h.size+x.size||1);C=Math.max(C,M),C>w&&C>=.35&&(w=C,i=A)}}let u=i?` Do you mean '${i}'?`:"";return`ERROR: Action [${e}] not found in registry.${u}`}try{return await(await p())(t,n)}catch(g){let T=g instanceof Error?g.message:String(g);return`ERROR: Execution failed for [${e}]: ${T}`}};import ie from"path";import Ue from"fs";import Ea from"gradient-string";var Ks=["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 Dr=[{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"]}],bo={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"]},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"]},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"]},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"]}};var Vo=null;var Or=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(Vo||(Vo=Dr[Math.floor(Math.random()*Dr.length)]),t={...Vo,id:"Mystery"}):(Vo=null,bo[e]?t=bo[e]:e==="GitHub"?t=bo["GitHub Dark"]:e==="Transparent"?t=bo["Transparent Dark"]:t=bo.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan";return{...t,codeText:n}};var Ca=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",yc=(e=2)=>{let t=Ca();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},xc=(e="...",t="Loading...",n="Dark")=>{let s=Ks[Math.floor(Math.random()*Ks.length)],o=Or(n),c=o.logoTextAnsi,f=o.logoBodyAnsi,l=o.logoMutedAnsi,k="\x1B[0m",p=[" \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 "],g=o.logoGradient||["#0077ff","#ff00ff"],T=Ea(g).multiline(p.join(`
565
+ ${e}`:""}`.trim();var gr=()=>import("./web_search-2PFIJKIL.js").then(e=>e.web_search),hr=()=>import("./web_scrape-BHSQTMX4.js").then(e=>e.web_scrape),mr=()=>import("./memory-SRDCQNML.js").then(e=>e.memory),pr=()=>import("./chat-7T6MVHC3.js").then(e=>e.chat),yr=()=>import("./view_file-2THVIMD6.js").then(e=>e.view_file),xr=()=>import("./write_file-V6HKMWFB.js").then(e=>e.write_file),br=()=>import("./update_file-WTXXQ4RB.js").then(e=>e.update_file),wr=()=>import("./exec_command-CY42M4FP.js").then(e=>e.exec_command),kr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ws=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),Tr=()=>import("./write_pdf-XDDKM7V5.js").then(e=>e.write_pdf),Sr=()=>import("./write_docx-I7T3575T.js").then(e=>e.write_docx),Uo=()=>import("./search_keyword-CSRQFPHQ.js").then(e=>e.search_keyword),_r=()=>import("./generate_image-HVWLRINC.js").then(e=>e.generate_image),Wo=()=>import("./saveSummary-VKGBD4CG.js").then(e=>e.saveSummary),mo=()=>import("./addMemScore-PWP7GFSP.js").then(e=>e.addMemScore),Ar=()=>import("./file_map-KS6Y7BP3.js").then(e=>e.file_map),Ho=()=>import("./todo-VG2CVRUI.js").then(e=>e.todo),Er=()=>import("./invokeSync-3IMWD5FT.js").then(e=>e.invokeSync),Sa=()=>import("./invoke-G32GVZI6.js").then(e=>e.invoke),Cr=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),_a=()=>import("./cancel-7IMADALP.js").then(e=>e.cancel),Rr=()=>import("./emergency_rollback-DXN5WNPR.js").then(e=>e.emergency_rollback),po=()=>import("./awaitSubagent-JTUSJDKD.js").then(e=>e.awaitSubagent),yo=()=>import("./answerSubagent-JUVFNLE5.js").then(e=>e.answerSubagent),Go=()=>import("./steerSubagent-L2JVT4QN.js").then(e=>e.steerSubagent),jo=()=>import("./computer_action-7U3W3F6L.js").then(e=>e.computer_action),vr=()=>import("./click-5ZKBFZ4N.js").then(e=>e.click),Mr=()=>import("./drag-YHHKJGL6.js").then(e=>e.drag),Ir=()=>import("./scroll-C4Z57VQS.js").then(e=>e.scroll),Hs=()=>import("./keyboard_typing-QL3DF67Z.js").then(e=>e.keyboard_typing),Gs=()=>import("./key_press-ZZNA3PF3.js").then(e=>e.key_press),js=()=>import("./recapture_screen-5FKLOHJL.js").then(e=>e.recapture_screen),Ko=()=>import("./find_file-A6NYLQJS.js").then(e=>e.find_file),Aa={web_search:gr,web_scrape:hr,memory:mr,chat:pr,view_file:yr,write_file:xr,update_file:br,exec_command:wr,read_folder:kr,write_pdf:Tr,write_docx:Sr,search_keyword:Uo,generate_image:_r,saveSummary:Wo,addMemScore:mo,file_map:Ar,todo:Ho,Todo:Ho,goal:Ho,Goal:Ho,invokeSync:Er,invoke:Sa,getProgress:Cr,cancel:_a,awaitSubagent:po,answerSubagent:yo,steerSubagent:Go,computer_action:jo,computer_use:jo,ComputerAction:jo,ComputerUse:jo,click:vr,Click:vr,drag:Mr,Drag:Mr,scroll:Ir,Scroll:Ir,keyboard_typing:Hs,KeyboardTyping:Hs,keyboardtyping:Hs,key_press:Gs,KeyPress:Gs,keypress:Gs,recapture_screen:js,RecaptureScreen:js,recapturescreen:js,invoke_sync:Er,get_progress:Cr,await_subagent:po,answer_subagent:yo,steer_subagent:Go,steer:Go,Steer:Go,ask:Ws,Ask:Ws,AskUser:Ws,WebSearch:gr,WebScrape:hr,ReadFile:yr,ReadFolder:kr,WriteFile:xr,PatchFile:br,WritePDF:Tr,WriteDoc:Sr,Run:wr,SearchKeyword:Uo,CodeSearch:Uo,code_search:Uo,Memory:mr,Chat:pr,GenerateImage:_r,saveSumary:Wo,SaveSummary:Wo,SaveSumary:Wo,add_mem_score:mo,AddMemScore:mo,addMemoryScore:mo,AddMemoryScore:mo,FileMap:Ar,answer:yo,Answer:yo,AnswerSubagent:yo,await:po,Await:po,AwaitSubagent:po,EmergencyRollback:Rr,emergency_rollback:Rr,find_file:Ko,findFile:Ko,FindFile:Ko,findfile:Ko},xo=async(e,t,n={})=>{let s=n.mode?n.mode.toLowerCase():"flux",o=e.toLowerCase(),f=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await"].some(g=>o.includes(g))||o==="ask",k=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer"].some(g=>o.includes(g));if(!f){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(!k)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 p=Aa[e];if(!p){let g=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],T={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"},m=o.replace(/[^a-z0-9]/g,""),i=T[m]||null;if(!i){let w=0,I=A=>{let $=new Set;for(let C=0;C<A.length-1;C++)$.add(A.slice(C,C+2));return $},h=I(m);for(let A of g){let $=A.toLowerCase().replace(/[^a-z0-9]/g,"");if(m===$){i=A;break}let C=0;($.includes(m)||m.includes($))&&(C+=.6);let x=I($),_=0;for(let y of h)x.has(y)&&_++;let M=2*_/(h.size+x.size||1);C=Math.max(C,M),C>w&&C>=.35&&(w=C,i=A)}}let u=i?` Do you mean '${i}'?`:"";return`ERROR: Action [${e}] not found in registry.${u}`}try{return await(await p())(t,n)}catch(g){let T=g instanceof Error?g.message:String(g);return`ERROR: Execution failed for [${e}]: ${T}`}};import ie from"path";import Ue from"fs";import Ea from"gradient-string";var Ks=["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 Dr=[{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"]}],bo={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"]},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"]},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:void 0,diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"]},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:void 0,diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:void 0,diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"]},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"]},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"]}};var Vo=null;var Or=(e="Dark")=>{let t;e==="Mystery"||e==="Chaos"?(Vo||(Vo=Dr[Math.floor(Math.random()*Dr.length)]),t={...Vo,id:"Mystery"}):(Vo=null,bo[e]?t=bo[e]:e==="GitHub"?t=bo["GitHub Dark"]:e==="Transparent"?t=bo["Transparent Dark"]:t=bo.Dark);let n=t.codeText||t.secondary||t.info||t.logoGradient&&t.logoGradient[0]||"cyan";return{...t,codeText:n}};var Ca=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",yc=(e=2)=>{let t=Ca();return t==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},xc=(e="...",t="Loading...",n="Dark")=>{let s=Ks[Math.floor(Math.random()*Ks.length)],o=Or(n),c=o.logoTextAnsi,f=o.logoBodyAnsi,l=o.logoMutedAnsi,k="\x1B[0m",p=[" \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 "],g=o.logoGradient||["#0077ff","#ff00ff"],T=Ea(g).multiline(p.join(`
566
566
  `)).split(`
567
567
  `),m=i=>`${l}${i}${k}`;return`${T[0]}
568
568
  ${T[1]} ${c}Selected Provider: ${t}${k}
@@ -784,7 +784,7 @@ ${bs}`}let nt=b==="write_file"?"Created":"Edited",ct=ne(N.args),mn=Object.entrie
784
784
  `:""}${Gt}
785
785
  `)},Ye=!1}b==="exec_command"&&(await new Promise(mt=>setTimeout(mt,50)),n.onExecChunk&&n.onExecChunk(`ERROR: ${Oe}`),await new Promise(mt=>setTimeout(mt,50)),n.onExecEnd&&n.onExecEnd()),Me.push({role:"user",text:`[ACTION RESULT]: DENIED: ${Oe}`}),yield{type:"tool_result",content:`[ACTION RESULT]: DENIED: ${Oe}`},await Rt("toolDenied"),n.onToolResult&&n.onToolResult("denied",b),ut++;continue}}if(X){let S=115;process.stdout.isTTY&&(S=process.stdout.columns-5||120);let H=await s(),se=!1;H&&(se=H.trim().length>0);let ge=Math.min(X.length+4,S),we=`${X.padEnd(ge-2).substring(0,ge-2)}`;yield{type:"visual_feedback",content:Yt(`${Ye?`
786
786
  `:""}${we}${X.includes("\u2714")&&(X.includes("Created")||X.includes("Edited"))?"":`${se?"":`
787
- `}`}`)},Ye=!1}if(We>0){let S=Date.now()-We,H=Math.max(0,1e3-S);H>0&&await new Promise(se=>setTimeout(se,H))}let An={chatId:p,history:t,onChunk:S=>n.onExecChunk?n.onExecChunk(S):null,onAskUser:n.onAskUser,systemSettings:n.systemSettings,mode:l,isMultiModal:ft(Se),onVisualFeedback:n.onVisualFeedback,onSubagentUpdate:n.onSubagentUpdate,onTokenChunk:n.onTokenChunk,modelName:Se,aiProvider:n.aiProvider,apiKey:n.apiKey,onUsage:n.onUsage};if(b==="write_file"||b==="update_file")try{let{path:S}=ne(N.args);if(S){let H=ie.resolve(process.cwd(),S),se=await Hn();se&&se.file_focused===H&&se.full_content&&(An.forcedContent=se.full_content)}}catch{}ot.push(b);let Le=await xo(b,N.args,An);if((b==="write_file"||b==="update_file")&&Le.startsWith("SUCCESS")){let{path:S}=ne(N.args);if(S){let H=ie.resolve(process.cwd(),S);$r(H)}}process.stdout.isTTY&&process.stdout.write("\x1B]0;Working...\x07");let Nt=Date.now();We=Nt,yield{type:"tool_time",content:Nt-V},K=Nt;let Ht=null;if(typeof Le=="object"&&Le.binaryPart&&(Ht=Le.binaryPart,Le=Le.text),b==="search_keyword"){let{keyword:S,path:H}=ne(N.args),se=typeof Le=="string"&&Le.startsWith("[GLOB]");se&&(Le=Le.slice(6).trimStart());let ge=typeof Le=="string"&&Le.startsWith("[DIR]");ge&&(Le=Le.slice(5).trimStart());let we=0;if(Le){let he=Le.match(/Found (\d+) match/i);he&&(we=parseInt(he[1]))}let Ne=(H||"").trim().toLowerCase().replaceAll("\\","/"),De=Ne==="#doc"||Ne==="#docs"||Ne==="#documentation"||Ne.includes("#skill/global/fluxflow")||Ne.includes("#skill/fluxflow")||Ne.includes("#skills/fluxflow")||Ne.includes("#skills/global/fluxflow"),Ce,J=115;process.stdout.isTTY&&(J=process.stdout.columns-5||120);let ce=Math.max(10,(J+5)/3),ue=Math.max(10,(J+5)/4);if(De)Ce=`${S?"\u2714":"\u2718"} Searched Documentation`;else{let he=H?H.replace(/[\/\\]+$/,""):null,_t=he&&he!=="."?`"${se?H:ge?`${he}/*`:he}"`:"./",Oe=_t.length>ue?`${_t.slice(0,ue)}...`:_t;Ce=`${S?"\u2714":"\u2718"} Searched: "${S?S.length>J/2?`${S.slice(0,ce)}...`:S:""}" in ${Oe.replaceAll("\\","/")} \u2192 ${we} Match${we===1?"":"es"}`}let je=Math.min(Ce.length+4,J),ze=`${Ce.padEnd(je-2).substring(0,je-2)}`;yield{type:"visual_feedback",content:Yt(`${Ye?`
787
+ `}`}`)},Ye=!1}if(We>0){let S=Date.now()-We,H=Math.max(0,1e3-S);H>0&&await new Promise(se=>setTimeout(se,H))}let An={chatId:p,history:t,onChunk:S=>n.onExecChunk?n.onExecChunk(S):null,onAskUser:n.onAskUser,systemSettings:n.systemSettings,mode:l,isMultiModal:ft(Se),onVisualFeedback:n.onVisualFeedback,onSubagentUpdate:n.onSubagentUpdate,onTokenChunk:n.onTokenChunk,modelName:Se,aiProvider:n.aiProvider,apiKey:n.apiKey,onUsage:n.onUsage};if(b==="write_file"||b==="update_file")try{let{path:S}=ne(N.args);if(S){let H=ie.resolve(process.cwd(),S),se=await Hn();se&&se.file_focused===H&&se.full_content&&(An.forcedContent=se.full_content)}}catch{}ot.push(b);let Le=await xo(b,N.args,An);if((b==="write_file"||b==="update_file")&&Le.startsWith("SUCCESS")){let{path:S}=ne(N.args);if(S){let H=ie.resolve(process.cwd(),S);$r(H)}}process.stdout.isTTY&&process.stdout.write("\x1B]0;Working...\x07");let Nt=Date.now();We=Nt,yield{type:"tool_time",content:Nt-V},K=Nt;let Ht=null;if(typeof Le=="object"&&Le.binaryPart&&(Ht=Le.binaryPart,Le=Le.text),b==="search_keyword"){let{keyword:S,path:H}=ne(N.args),se=typeof Le=="string"&&Le.startsWith("[GLOB]");se&&(Le=Le.slice(6).trimStart());let ge=typeof Le=="string"&&Le.startsWith("[DIR]");ge&&(Le=Le.slice(5).trimStart());let we=0;if(Le){let he=Le.match(/Found (\d+) match/i);he&&(we=parseInt(he[1]))}let Ne=(H||"").trim().toLowerCase().replaceAll("\\","/"),De=Ne==="#doc"||Ne==="#docs"||Ne==="#documentation"||Ne.includes("#skill/global/fluxflow")||Ne.includes("#skill/fluxflow")||Ne.includes("#skills/fluxflow")||Ne.includes("#skills/global/fluxflow"),Ce,J=115;process.stdout.isTTY&&(J=process.stdout.columns-5||120);let ce=Math.max(10,(J+5)/3),ue=Math.max(10,(J+5)/4);if(De)Ce=`${S?"\u2714":"\u2718"} Searched Documentation`;else{let he=H?H.replace(/[\/\\]+$/,""):null,_t=he&&he!=="."?`${se?H:ge?`${he}/*`:he}`:"./",Oe=_t.length>ue?`${_t.slice(0,ue)}...`:_t;Ce=`${S?"\u2714":"\u2718"} Searched: "${S?S.length>J/2?`${S.slice(0,ce)}...`:S:""}" in "${Oe.replaceAll("\\","/")}" \u2192 ${we} Match${we===1?"":"es"}`}let je=Math.min(Ce.length+4,J),ze=`${Ce.padEnd(je-2).substring(0,je-2)}`;yield{type:"visual_feedback",content:Yt(`${Ye?`
788
788
  `:""}${ze}
789
789
  `)},Ye=!1}if(b==="EmergencyRollback"){let{method:S}=ne(N.args);if(S==="forceRevert"){let H=0;if(Le){let ce=Le.match(/Total\s*:\s*(\d+)/i);ce&&(H=parseInt(ce[1]))}let ge=Le&&Le.startsWith("ERROR:")?"\u2718 Emergency Rollback Failed":`\u2714 Emergency Rollback \u2192 ${H} file${H===1?"":"s"} processed`,we=115;process.stdout.isTTY&&(we=process.stdout.columns-5||120);let Ne=await s(),De=!1;Ne&&(De=Ne.trim().length>0);let Ce=Math.min(ge.length+4,we),J=`${ge.padEnd(Ce-2).substring(0,Ce-2)}`;yield{type:"visual_feedback",content:Yt(`${Ye?`
790
790
  `:""}${J}${De?"":`
@@ -1,6 +1,6 @@
1
- import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-D266ZNXN.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],A={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
1
+ import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-P64RHAIQ.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],A={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
2
2
  Respond using tool: [action:Answer(id="${i}", answer="...")]
3
3
  [/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((M,_)=>M+_.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,A,C,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")||n.startsWith("[Action Result]")){let o=n.split(`
4
4
  `);o.length>5&&(n=o.slice(0,4).join(`
5
5
  `)+`
6
- ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-D266ZNXN.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
6
+ ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-P64RHAIQ.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
@@ -1,3 +1,3 @@
1
- import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-D266ZNXN.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
- `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-D266ZNXN.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
1
+ import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-P64RHAIQ.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
+ `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-P64RHAIQ.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
3
3
  `)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
package/dist/cli.js CHANGED
@@ -66,7 +66,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(Q&&(console.log(`v${n}`),pro
66
66
  /docs View documentation
67
67
  /fluxflow init Create FluxFlow.md template
68
68
  /update check Check for new version
69
- /update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let g=t[2]==="latest";try{let h=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;h||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(g?`Latest version: v${h}`:h!==n?`A new version of FluxFlow is available: v${h} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let h=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),D=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):B({manager:e.value})},L=e=>{B({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:L})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(D,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},B=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-KKYNW25D.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await h();i=s.manager,$=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=$||A?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:v}=await import("child_process");v(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(g){console.error("\x1B[31m\u274C Update failed:\x1B[0m",g.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:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-QAUN2PDW.js");process.env.NODE_NO_WARNINGS="1";let pe=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],me=console.log,de=console.warn,ue=console.error,G=o=>{let m=o.map(String).join(" ");return pe.some(r=>m.includes(r))};console.log=(...o)=>!G(o)&&me(...o),console.warn=(...o)=>!G(o)&&de(...o),console.error=(...o)=>!G(o)&&ue(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],m=await import("path"),r=await import("fs-extra"),d=m.default.resolve(o);try{r.default.existsSync(d)&&r.default.statSync(d).isDirectory()?process.chdir(d):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${o}": ${x.message}`),process.exit(0)}}let I=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(I)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0),r=`Git Staged Diff:
69
+ /update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let g=t[2]==="latest";try{let h=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;h||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(g?`Latest version: v${h}`:h!==n?`A new version of FluxFlow is available: v${h} (current: v${n}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${n}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let c=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;c||(console.error("Error: Could not retrieve latest version."),process.exit(1)),c===n&&(console.log(`FluxFlow is already up to date (v${n}).`),process.exit(0));let h=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),D=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):B({manager:e.value})},L=e=>{B({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:L})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(D,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},B=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-KKYNW25D.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await h();i=s.manager,$=s.customCommand}let p="";i==="pnpm"?p=`pnpm add -g fluxflow-cli@${c}`:i==="bun"?p=`bun add -g fluxflow-cli@${c}`:i==="yarn"?p=`yarn global add fluxflow-cli@${c}`:i==="custom"?p=$||A?.customUpdateCommand||`npm install -g fluxflow-cli@${c}`:p=`npm install -g fluxflow-cli@${c}`,console.log(`Updating FluxFlow to v${c} using ${i}...`),console.log(`Running: ${p}`);let{execSync:v}=await import("child_process");v(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(g){console.error("\x1B[31m\u274C Update failed:\x1B[0m",g.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:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-6D3PVISC.js");process.env.NODE_NO_WARNINGS="1";let pe=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],me=console.log,de=console.warn,ue=console.error,G=o=>{let m=o.map(String).join(" ");return pe.some(r=>m.includes(r))};console.log=(...o)=>!G(o)&&me(...o),console.warn=(...o)=>!G(o)&&de(...o),console.error=(...o)=>!G(o)&&ue(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],m=await import("path"),r=await import("fs-extra"),d=m.default.resolve(o);try{r.default.existsSync(d)&&r.default.statSync(d).isDirectory()?process.chdir(d):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${o}": ${x.message}`),process.exit(0)}}let I=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(I)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0),r=`Git Staged Diff:
70
70
  ${a}
71
71
  ---
72
72
 
@@ -78,7 +78,7 @@ ${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let w of process.stdin
78
78
  ${a}
79
79
  ---
80
80
 
81
- ${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-KKYNW25D.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-LPVNWDTB.js"),{getDefaultModel:l}=await import("./chunks/model_config-M24OEKJE.js"),{generateSimpleContent:c}=await import("./chunks/ai-D266ZNXN.js"),{checkQuotaDetailed:h}=await import("./chunks/usage-VLICZGBC.js"),i=await C(),$=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),A=I||$.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let w=$.indexOf(a);if(w!==-1&&w+1<$.length)return $[w+1]}return null},v=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(v,i.apiTier)||l(v,"paid"),N=p(["--key"])||await g(v);N||(console.error(`[ERROR] No API key resolved for provider "${v}".`),process.exit(1));let _=await h("agent",{aiProvider:v});_.allowed||(console.error(`[ERROR] ${_.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:y="",nickname:S="",instructions:D=""}=i?.profileData??{},E={aiProvider:v,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},W=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,H=M.getFullYear(),O=M.toLocaleString("en-US",{month:"short"}).toUpperCase(),X=String(M.getDate()).padStart(2,"0"),B=M.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),V=`${H}-${O}-${X}, ${B}`,k=`Identity: FluxFlow. Sassy, CLI Assistant
81
+ ${r}`:r=a}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-KKYNW25D.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-LPVNWDTB.js"),{getDefaultModel:l}=await import("./chunks/model_config-M24OEKJE.js"),{generateSimpleContent:c}=await import("./chunks/ai-P64RHAIQ.js"),{checkQuotaDetailed:h}=await import("./chunks/usage-VLICZGBC.js"),i=await C(),$=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),A=I||$.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let w=$.indexOf(a);if(w!==-1&&w+1<$.length)return $[w+1]}return null},v=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(v,i.apiTier)||l(v,"paid"),N=p(["--key"])||await g(v);N||(console.error(`[ERROR] No API key resolved for provider "${v}".`),process.exit(1));let _=await h("agent",{aiProvider:v});_.allowed||(console.error(`[ERROR] ${_.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:y="",nickname:S="",instructions:D=""}=i?.profileData??{},E={aiProvider:v,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},W=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,H=M.getFullYear(),O=M.toLocaleString("en-US",{month:"short"}).toUpperCase(),X=String(M.getDate()).padStart(2,"0"),B=M.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),V=`${H}-${O}-${X}, ${B}`,k=`Identity: FluxFlow. Sassy, CLI Assistant
82
82
  Use NO markdown, only plain text
83
83
  Additional Context:
84
84
  - OS: ${W}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "4.24.1",
3
+ "version": "4.24.3",
4
4
  "date": "2026-09-30",
5
5
  "description": "One of the lightest, fastest, high-fidelity agentic CLI with sub-agents & computer use.",
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "4.24.1",
3
+ "version": "4.24.3",
4
4
  "date": "2026-09-30",
5
5
  "description": "One of the lightest, fastest, high-fidelity agentic CLI with sub-agents & computer use.",
6
6
  "keywords": [