fluxflow-cli 4.37.2 → 4.37.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ai-Y4PSJN4G.js → ai-JI4UX2WD.js} +1 -1
- package/dist/chunks/{app-JOSLEEMJ.js → app-3NZMHG65.js} +2 -2
- package/dist/chunks/{chunk-XDIU4OX7.js → chunk-M4GC3CRN.js} +3 -3
- package/dist/chunks/{chunk-LTX2IUDV.js → chunk-MQCO3GXM.js} +1 -1
- package/dist/chunks/{chunk-JTTVSAKS.js → chunk-ODBYCQHC.js} +1 -1
- package/dist/chunks/{exec_command-KLASTN6U.js → exec_command-A5JWE55Q.js} +1 -1
- package/dist/chunks/{invoke-P3ZC5CJV.js → invoke-7JAD5QTF.js} +2 -2
- package/dist/chunks/{invokeSync-E4SXIRIH.js → invokeSync-WUKJNYGQ.js} +2 -2
- package/dist/chunks/search_keyword-SD6Q3UZE.js +8 -0
- package/dist/cli.js +4 -4
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/search_keyword-G3PCZR3C.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as s,B as t,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o,x as p,y as q,z as r}from"./chunk-
|
|
1
|
+
import{A as s,B as t,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j,s as k,t as l,u as m,v as n,w as o,x as p,y as q,z as r}from"./chunk-M4GC3CRN.js";import"./chunk-FAEB3V5R.js";import"./chunk-QOT4BYHM.js";import"./chunk-56EJGQU3.js";import"./chunk-2VV5ZE53.js";import"./chunk-MQCO3GXM.js";import"./chunk-HOZQBBAO.js";import"./chunk-T4ZG2WCV.js";import"./chunk-3JI2CRXK.js";import"./chunk-Y5JU726N.js";import"./chunk-ET66XVIM.js";import"./chunk-K4AZXTU6.js";import"./chunk-FSE4BZZZ.js";import{l as a}from"./chunk-PRTGV2R4.js";import"./chunk-L3W2X74K.js";import"./chunk-M2ULCOL3.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{A as xl,a as zi,b as lt,c as ft,d as Or,e as Pr,f as tl,g as Ls,h as mn,i as Fr,s as dl,v as cl,w as $o,y as ul,z as ml}from"./chunk-
|
|
1
|
+
import{A as xl,a as zi,b as lt,c as ft,d as Or,e as Pr,f as tl,g as Ls,h as mn,i as Fr,s as dl,v as cl,w as $o,y as ul,z as ml}from"./chunk-M4GC3CRN.js";import{a as fl}from"./chunk-UEV335RW.js";import{a as qt,b as Ri,c as el}from"./chunk-FAEB3V5R.js";import"./chunk-QOT4BYHM.js";import{b as sl,c as il,d as ll}from"./chunk-BTMPM5BT.js";import{a as al}from"./chunk-56EJGQU3.js";import{a as Pt,b as Ct,d as Ki,e as Mt,f as qi,j as Is,k as ks,l as nr,m as Qi,n as Fo}from"./chunk-2VV5ZE53.js";import{c as Ji,e as Pn,f as to,g as Zi}from"./chunk-ODBYCQHC.js";import"./chunk-MQCO3GXM.js";import{a as rl}from"./chunk-A73NNVCZ.js";import{a as Qo,b as Nn,d as Nr,e as As,f as ol,h as nl,i as ir}from"./chunk-HOZQBBAO.js";import"./chunk-T4ZG2WCV.js";import{a as sr}from"./chunk-3JI2CRXK.js";import{a as rr}from"./chunk-Y5JU726N.js";import{b as qo,c as Bs,k as Gi}from"./chunk-ET66XVIM.js";import{a as Wi,b as Vi,i as Yi,j as Ar,k as Lr,m as wt,n as un,o as Ds,u as ji}from"./chunk-K4AZXTU6.js";import{a as vs,b as Nt}from"./chunk-FSE4BZZZ.js";import{d as Ni,e as Es,f as Fi,g as $i,h as Ui,i as _i,j as Hi,l as kr,n as Ko,o as eo,p as or,q as Xi}from"./chunk-PRTGV2R4.js";import{c as Dr,d as Pi,e as Ir}from"./chunk-L3W2X74K.js";import{a as go,b as cn,c as Co,d as Ms,e as Ss,k as tr,y as Oi}from"./chunk-M2ULCOL3.js";import zs from"os";import e,{useState as R,useEffect as xt,useRef as rt,useMemo as Hn}from"react";import{Box as u,Text as i,useInput as rc,useStdout as sc,Static as ic}from"ink";import lc from"ink-spinner";import mt from"fs-extra";import At from"path";import{exec as Io}from"child_process";import{fileURLToPath as ac}from"url";import Wt,{useState as $r,useEffect as Os,useMemo as lr,useCallback as Ia,useRef as Uo}from"react";import{Box as ka,Text as ho,useInput as Aa}from"ink";function La(t,f){return t.replace(/\t/g," ".repeat(f))}function Ur(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`)}function xn(t,f,g){let S=t,w=[...f].sort((a,T)=>a.start-T.start),p=0;for(let a of w){let T=a.start-p,b=Ur(a.text).split(`
|
|
4
4
|
`).length,M=a.text.length,N=(b>3?`[Pasted ${b} lines]`:`[Pasted ${M} chars]`).length,O=T+N;if(t<=T)break;if(t<O){S=a.end;break}else{let E=a.text.length-N;S+=E,p+=E}}return Math.min(S,g.length)}function Ps(t,f,g,S,w=[]){let p=(t||"").slice(0,f),a=S(p).length,T=S(t||""),b=[...w].sort(($,L)=>L.start-$.start);for(let $ of b){let L=S(t.slice(0,$.start)).length,Y=S($.text),K=L+Y.length,ce=Ur($.text).split(`
|
|
@@ -41,7 +41,7 @@ import{A as xl,a as zi,b as lt,c as ft,d as Or,e as Pr,f as tl,g as Ls,h as mn,i
|
|
|
41
41
|
`),terminalWidth:f,theme:p}));if(b==="diff-line"){let{isFirstLine:E,isLastLine:D}=t,F=($=!1)=>s.createElement(I,{backgroundColor:a.codeBg,paddingX:1,width:f,marginBottom:$?1:0},s.createElement(I,{width:3,flexShrink:0}),s.createElement(I,{width:1,flexShrink:0,marginLeft:1}),s.createElement(I,{flexGrow:1,marginLeft:1},s.createElement(se,null," ")));return s.createElement(I,{flexDirection:"column"},E&&F(!1),s.createElement(Cl,{line:M,pairContent:t.pairContent,parentText:void 0,columns:f,theme:p}),D&&F(!0))}if(b==="code-fence-open"){let E={paddingLeft:2,width:"100%"};return s.createElement(I,{flexDirection:"column",marginTop:0,marginBottom:0,width:"100%"},s.createElement(I,{flexDirection:"row",...E},s.createElement(se,null," ")),s.createElement(I,{flexDirection:"row",...E},s.createElement(se,{color:"gray",bold:!0},"\u25B6_ ",(M||"TEXT").toUpperCase())))}if(b==="code-line"){let{lineNum:E,lang:D}=t,F=f-12,$=(M||"").replaceAll(" "," "),Y=Ct($,Math.max(10,F)).split(`
|
|
42
42
|
`);return s.createElement(I,{flexDirection:"column",width:"100%"},Y.map((K,ce)=>s.createElement(I,{key:ce,flexDirection:"row",borderColor:a.codeBorder,paddingLeft:2,width:"100%"},s.createElement(I,{width:5,flexShrink:0},s.createElement(se,{color:"gray",dimColor:!0},ce===0?String(E).padStart(4," ")+" ":" ")),s.createElement(I,{flexGrow:1},bt(K,D,a.text)))))}if(b==="code-fence-close")return s.createElement(I,{flexDirection:"row",paddingLeft:2,marginBottom:1,width:"100%"},s.createElement(se,null," "));if(b==="write-header")return s.createElement(I,{flexDirection:"column",paddingX:1,width:f},s.createElement($n,{text:M,columns:f,theme:p}));if(b==="write-line"){let{gutterWidth:E,lineNum:D,isFirstLine:F,isLastLine:$,extension:L,wrappedLines:Y}=t,K=(ce=!1)=>s.createElement(I,{flexDirection:"row",width:f,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:a.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:a.codeBg,marginBottom:ce?1:0},s.createElement(I,{width:E+2,flexShrink:0},s.createElement(se,null," ".repeat(E+2))),s.createElement(I,{flexGrow:1},s.createElement(se,null," ")));return s.createElement(I,{flexDirection:"column"},F&&K(!1),s.createElement(I,{flexDirection:"row",width:f,borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,borderColor:a.codeBorder,paddingLeft:2,paddingRight:0,backgroundColor:a.codeBg},s.createElement(I,{width:E+2,flexShrink:0},s.createElement(se,{color:"gray",dimColor:!0},String(D).padStart(E," ")," ")),s.createElement(I,{flexGrow:1,flexDirection:"column"},(Y||[M]).map((ce,ue)=>s.createElement(I,{key:ue},bt((ce||"").replaceAll(" "," "),L,a.text))))),$&&K(!0))}return b==="write-footer"?s.createElement(I,{flexDirection:"column",paddingX:1,width:f,marginTop:1,marginBottom:1},s.createElement($n,{text:M,columns:f,theme:p})):b==="worked-duration"?s.createElement(I,{marginTop:1,marginBottom:2,paddingX:1,width:"100%"},s.createElement(se,{color:a.textMuted},"["),s.createElement(se,{color:a.textMuted},"Worked for ",s.createElement(se,{bold:!0,color:a.text},Xr(O))),s.createElement(se,{color:a.textMuted},"]")):null}),eu=s.memo(({messages:t,showFullThinking:f,columns:g=80,aiProvider:S,version:w,theme:p="Dark"})=>s.createElement(I,{flexDirection:"column",width:"100%"},t.map((a,T)=>s.createElement(Ml,{key:a.id||T,msg:a,showFullThinking:f,columns:g,aiProvider:S,version:w,theme:p}))));import St from"react";import{Box as zo,Text as Mo}from"ink";import{useState as dr,useEffect as cr,useRef as Wr}from"react";var ur=null;function Sl(){ur&&ur()}var vd=t=>{if(t<=370)return"#00a564";if(t>=5e3)return"#ff0000";let f=[{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 g=0;g<f.length-1;g++){let S=f[g],w=f[g+1];if(t>=S.t&&t<=w.t){let p=(t-S.t)/(w.t-S.t);p=p*p*(3-2*p);let a=Math.round(S.r+(w.r-S.r)*p),T=Math.round(S.g+(w.g-S.g)*p),b=Math.round(S.b+(w.b-S.b)*p);return`#${((1<<24)+(a<<16)+(T<<8)+b).toString(16).slice(1)}`}}return"#ff0000"},Dd=St.memo(({mode:t,thinkingLevel:f,tokens:g="0.0k",tokensTotal:S="0.0k",cachedTokens:w=0,promptTokens:p=0,chatId:a="NEW-SESSION",isMemoryEnabled:T=!0,apiTier:b="Free",aiProvider:M="Google",activeModel:N="",isProcessing:O=!1,lastChunkTime:E=0,theme:D="Dark",wps:F=0,showTPMEstimate:$=!1})=>{let L=lt(D),Y="",[K,ce]=dr(0),[ue,z]=dr(0),[oe,xe]=dr("MB"),[Ee,_e]=dr("green"),[We,pe]=dr(0),we=Wr([]),ye=Wr(370),ae=Wr([]),Ke=Wr(E);cr(()=>{Ke.current=E},[E]),cr(()=>{if(!O){ae.current=[];return}if(F>0){let j=ae.current;j.push(F),j.length>3&&j.shift()}},[O,F,E]),cr(()=>{if(!O){pe(0);return}let j=setInterval(()=>{let ne=Ke.current,ee=ne>0?Date.now()-ne:0;if(ne>0&&ee>=1e3)ae.current=[],pe(0);else if(ne>0&&ee>500){ae.current.length>0&&ae.current.shift();let de=ae.current;if(de.length>0){let Se=de.reduce((Me,Le)=>Me+Le,0);pe(Math.round(Se/de.length))}else pe(0)}else{let de=ae.current;if(de.length>0){let Se=de.reduce((Me,Le)=>Me+Le,0);pe(Math.round(Se/de.length))}else F>0&&pe(Math.round(F))}},750);return()=>clearInterval(j)},[O]),cr(()=>{if(!O){we.current=[];return}if(E>0){let ee=we.current;(ee.length===0||ee[ee.length-1]!==E)&&(ee.push(E),ee.length>10&&ee.shift())}let j=()=>{if(!E){_e("#00a564");return}let ee=we.current,de=0;if(ee.length>1){let le=0;for(let ge=1;ge<ee.length;ge++)le+=ee[ge]-ee[ge-1];de=le/(ee.length-1)}let Se=Date.now()-E,Le=Se>=2500,ot=!Le&&de>0?Math.min(Se,de*3):Se,dt=Math.max(de,ot),Ie=Le?.4:.2;ye.current=ye.current*(1-Ie)+dt*Ie,_e(vd(ye.current))};j();let ne=setInterval(j,100);return()=>clearInterval(ne)},[O,E]);let He=()=>{let j=process.memoryUsage(),ne=j.heapTotal/(1024*1024)>=1024,ee=ne?"GB":"MB",de=(Se,Me)=>{let Le=Se/(1048576*(Me?1024:1));return Me?parseFloat(Le.toFixed(2)):Math.round(Le)};xe(ee),z(de(j.heapTotal,ne)),ce(de(j.heapUsed,ne))};return cr(()=>{ur=He,He();let j=setInterval(()=>{He()},6e4);return()=>{clearInterval(j),ur===He&&(ur=null)}},[]),St.createElement(zo,{flexDirection:"row",justifyContent:"space-between",paddingX:1,width:"100%"},St.createElement(zo,null,St.createElement(zo,{marginRight:1},St.createElement(Mo,{color:L.textMuted},t.toLowerCase()==="flow"?"Studio":t.toLowerCase()==="icu"?"Computer Use":t.toLowerCase()==="flux"?"Workspace":"Omni")),St.createElement(Mo,{color:L.textMuted,dimColor:!0},"\u2503 "),St.createElement(zo,null,St.createElement(Mo,{color:L.text,italic:!0},qi(process.cwd(),35)))),St.createElement(zo,null,O&&!$?St.createElement(zo,null,St.createElement(Mo,{color:Ee},"\u25CF ")):null,O&&$&&St.createElement(St.Fragment,null,St.createElement(Mo,{color:L.textMuted},"~",We," tok/s"),St.createElement(Mo,{color:L.textMuted,dimColor:!0}," \u2503")),g>0&&St.createElement(St.Fragment,null,St.createElement(zo,{marginX:1},St.createElement(Mo,{color:L.text},Mt(S)," tok",(()=>{let j=typeof p=="number"?p:0,ne=typeof w=="number"?w:0,ee=j>0?ne/j*100:0;return ee<1?null:St.createElement(Mo,{color:L.success||"green",dimColor:!0}," [",ee.toFixed(0),"% cached]")})())),St.createElement(Mo,{color:L.textMuted,dimColor:!0},"\u2503")),St.createElement(zo,{marginLeft:1},St.createElement(Mo,{color:L.textMuted,bold:!0},K," ",oe))))}),El=Dd;import ct,{useState as Vr,useMemo as Id,useEffect as Bl}from"react";import{Box as Yt,Text as jt,useInput as kd}from"ink";import Ad from"ink-select-input";var Ld=({label:t,isSelected:f,theme:g="Dark"})=>{let S=lt(g),w=t==="Cancel"||t==="Back"||t.toLowerCase().includes("exit")||t.toLowerCase().includes("back");return ct.createElement(Yt,{marginTop:w?1:0,backgroundColor:f?S.highlightBg:void 0,paddingX:1,width:"100%"},ct.createElement(jt,{color:f?S.text:S.textMuted,bold:f},f?"\u276F ":" ",t))},Od=8;function Et({title:t,subtitle:f,items:g=[],onSelect:S,theme:w="Dark",searchable:p=!1,maxVisible:a=Od}){let T=lt(w),[b,M]=Vr(""),[N,O]=Vr(0),[E,D]=Vr("list"),F=Id(()=>{if(!p||!b.trim())return g;let ue=b.toLowerCase().trim();return g.filter(z=>z.label&&z.label.toLowerCase().includes(ue))},[g,b,p]);Bl(()=>{O(0)},[b]);let[$,L]=Vr(0);Bl(()=>{L(ue=>F.length<=a?0:N<ue?N:N>=ue+a?N-a+1:ue)},[N,F.length,a]),kd((ue,z)=>{if(p){if(z.upArrow){D("list"),O(oe=>F.length===0?0:oe>0?oe-1:F.length-1);return}if(z.downArrow){D("list"),O(oe=>F.length===0?0:oe<F.length-1?oe+1:0);return}if(z.return){F.length>0&&F[N]&&S(F[N]);return}if(z.escape){if(b)M(""),D("list"),O(0);else{let oe=g.find(xe=>xe.value==="Back"||xe.label==="Back"||xe.value==="Cancel"||xe.label==="Cancel");oe&&S(oe)}return}if(z.backspace||z.delete){D("search"),M(oe=>oe.slice(0,-1));return}if(ue&&!z.ctrl&&!z.meta&&!z.tab){D("search"),M(oe=>oe+ue);return}}},{isActive:p});let Y=F.length,K=$;Y<=a?K=0:K=Math.max(0,Math.min($,Y-a));let ce=F.slice(K,K+a);return p?ct.createElement(Yt,{flexDirection:"column",borderStyle:"round",borderColor:T.borderMuted,padding:0,marginTop:0,flexShrink:0,width:"100%"},ct.createElement(Yt,{paddingX:1,paddingY:0,marginBottom:0,flexDirection:"row",justifyContent:"space-between"},t?ct.createElement(jt,{color:T.text,bold:!0},typeof t=="string"?t.toUpperCase():t):ct.createElement(Yt,null),Y>0&&ct.createElement(jt,{color:T.textMuted},N+1,"/",Y)),f&&ct.createElement(Yt,{paddingX:1,marginBottom:0},ct.createElement(jt,{color:T.textMuted,italic:!0}," ",f)),ct.createElement(Yt,{paddingX:1,marginTop:1,marginBottom:1,flexDirection:"row"},ct.createElement(jt,{color:E==="search"?T.primary||"cyan":T.textMuted,bold:E==="search"},"\u{1F50D} Search:"),ct.createElement(jt,{color:T.text,bold:!0}," ",b),E==="search"?ct.createElement(jt,{color:T.primary||"cyan"},"\u2588"):b?null:ct.createElement(jt,{color:T.textMuted,italic:!0}," (type to search...)")),ct.createElement(Yt,{flexDirection:"column",width:"100%"},F.length===0?ct.createElement(Yt,{paddingX:1,marginY:0},ct.createElement(jt,{color:T.warning||"yellow",italic:!0}," No matching items found")):ce.map((ue,z)=>{let oe=K+z,xe=oe===N,Ee=ue.label==="Cancel"||ue.label==="Back"||ue.label.toLowerCase().includes("exit")||ue.label.toLowerCase().includes("back");return ct.createElement(Yt,{key:ue.value??ue.label??oe,marginTop:Ee?1:0,backgroundColor:xe?T.highlightBg:void 0,paddingX:1,width:"100%"},ct.createElement(jt,{color:xe?T.text:T.textMuted,bold:xe},xe?"\u276F ":" ",ue.label))})),ct.createElement(Yt,{paddingX:1,marginTop:1},ct.createElement(jt,{color:T.textMuted,italic:!0},E==="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)"))):ct.createElement(Yt,{flexDirection:"column",borderStyle:"round",borderColor:T.borderMuted,padding:0,marginTop:0,flexShrink:0,width:"100%"},t&&ct.createElement(Yt,{paddingX:1,paddingY:0,marginBottom:f?0:1,flexDirection:"row",justifyContent:"space-between"},ct.createElement(jt,{color:T.text,bold:!0},typeof t=="string"?t.toUpperCase():t),g.length>a&&ct.createElement(jt,{color:T.textMuted,italic:!0},g.length," options")),f&&ct.createElement(Yt,{paddingX:1,marginBottom:1},ct.createElement(jt,{color:T.textMuted,italic:!0}," ",f)),ct.createElement(Yt,{flexDirection:"column",width:"100%"},ct.createElement(Ad,{items:g,onSelect:S,limit:a,itemComponent:ue=>ct.createElement(Ld,{...ue,theme:w}),indicatorComponent:()=>null})),ct.createElement(Yt,{paddingX:1,marginTop:1},ct.createElement(jt,{color:T.textMuted,italic:!0},"(Arrows to select \u2022 Enter to confirm)")))}import A,{useState as Ut,useEffect as mr}from"react";import{Box as Ue,Text as Z,useInput as Pd}from"ink";import Nd from"ink-text-input";import Fd from"v8";import vl from"os";var So=[...Object.keys(zi),"Mystery"],Eo=[{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"}],Dl=t=>{let f=t.autoApproveCommands||"",g=t.autoDisallowCommands||"",S=t.alwaysAskCommands||"",w=t.autoExec===!1&&t.allowExternalAccess===!1&&t.networkAccess===!1&&f===""&&g==="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"&&S==="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,p=t.autoExec===!0&&t.allowExternalAccess===!1&&t.networkAccess!==!1&&f==="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"&&g==="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"&&S==="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,a=t.autoExec===!0&&t.allowExternalAccess===!0&&t.networkAccess!==!1&&f==="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"&&g===""&&S==="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 w?"Strict":p?"Balanced":a?"Autonomous":t.sandboxPreset||"Custom"},Yr=t=>!t||t.trim()===""?"None":t.length>40?t.substring(0,40)+"...":t;function jr({systemSettings:t,setSystemSettings:f,apiTier:g,setActiveView:S,setInputConfig:w,saveSettings:p,quotas:a,setMessages:T,aiProvider:b,initialSelectingTheme:M=!1,onCloseTheme:N=null,setProviderReturnView:O=null}){let E=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",D=So.indexOf(E),[F,$]=Ut("categories"),[L,Y]=Ut(0),[K,ce]=Ut(0),[ue,z]=Ut(null),[oe,xe]=Ut(""),[Ee,_e]=Ut(M),[We,pe]=Ut(D>=0?D:0),[we,ye]=Ut(t.theme||"Dark"),[ae,Ke]=Ut(!1),[He,j]=Ut(0),[ne,ee]=Ut(0),[de,Se]=Ut(""),[Me,Le]=Ut("list"),[ot,dt]=Ut({});mr(()=>{(async()=>{let C=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","Infron","APInex","c_openai"],P={};for(let ke of C)try{await qo(ke)&&(P[ke]=!0)}catch{}dt(P)})()},[]);let Ie=A.useMemo(()=>{let he=["Google","DeepSeek","OpenRouter","NVIDIA","Mistral","Ollama","InferX","SenseNova","AIHubMix","Poolside","9router","ExpLabs","TokenHarbor","Infron","APInex","c_openai"],P=!!(process.env.SUBAGENT_MODEL&&process.env.SUBAGENT_MODEL.trim())?`ENV (${process.env.SUBAGENT_MODEL.trim()})`:"ENV",ke=[{label:"Default (use the current model)",value:"Default",isHeader:!1},{label:P,value:"ENV",isHeader:!1}],Ve=a?.providerTiers?.[b]||g||"Free",ut=Ko(b,Ve)||[];ut.length>0&&(ke.push({label:`\u2500\u2500 ${b.toUpperCase()}${Ve!=="Free"?` (${Ve})`:""} \u2500\u2500`,isHeader:!0}),ut.forEach(gt=>{let ze=typeof gt=="string"?gt:gt.cmd||gt.name||gt.id||String(gt);ze&&!ze.trim().startsWith("---")&&!ze.startsWith(`
|
|
43
43
|
---`)&&ke.push({label:ze,value:ze,isHeader:!1,provider:b})}));for(let gt of he)if(gt!==b&&ot[gt]){let ze=a?.providerTiers?.[gt]||"Free",oo=Ko(gt,ze)||[];oo.length>0&&(ke.push({label:`\u2500\u2500 ${gt.toUpperCase()}${ze!=="Free"?` (${ze})`:""} \u2500\u2500`,isHeader:!0}),oo.forEach(Re=>{let $t=typeof Re=="string"?Re:Re.cmd||Re.name||Re.id||String(Re);$t&&!$t.trim().startsWith("---")&&!$t.startsWith(`
|
|
44
|
-
---`)&&ke.push({label:$t,value:$t,isHeader:!1,provider:gt})}))}return ke},[b,g,a,ot]),le=A.useMemo(()=>{if(!de.trim())return Ie;let he=de.trim().toLowerCase(),C=[],P=null;for(let ke of Ie)ke.isHeader?P=ke:(ke.label.toLowerCase().includes(he)||ke.value&&ke.value.toLowerCase().includes(he))&&(P&&!C.includes(P)&&C.push(P),C.push(ke));return C},[Ie,de]);mr(()=>{if(ae){let he=le.findIndex(C=>!C.isHeader);j(he>=0?he:0),ee(0)}},[de]),mr(()=>{if(ae){if(le.length===0){j(0),ee(0);return}if(He>=le.length||le[He]?.isHeader){let he=le.findIndex(C=>!C.isHeader);j(he>=0?he:0)}}},[le,ae]);let[ge,Oe]=Ut(0),[v,Ne]=Ut(0),[st,Lt]=Ut("MB"),[zt,Rr]=Ut(!1);mr(()=>{let he=!1;return import("./exec_command-KLASTN6U.js").then(C=>{he||Rr(!!C.isPtyAvailable)}).catch(()=>{}),()=>{he=!0}},[]),mr(()=>{let he=Fd.getHeapStatistics().heap_size_limit,C=he>=1024*1024*1024,P=C?"GB":"MB",ke=C?1024*1024*1024:1024*1024;Ne(parseFloat((he/ke).toFixed(2))),Lt(P);let Ve=()=>{let oo=process.memoryUsage().rss/ke,Re=C?parseFloat(oo.toFixed(2)):Math.round(oo);Oe(Re)};Ve();let ut=setInterval(()=>{Ve()},3e4);return()=>clearInterval(ut)},[]);let tn=he=>{switch(he){case"providers":{let P=[{label:"Current Provider",value:"aiProvider",status:b==="c_openai"?"Custom (OpenAI)":b}];return b==="Ollama"&&P.push({label:"Endpoint",value:"ollamaEndpoint",status:t.ollamaEndpoint||"Cloud"}),(b==="c_openai"||b==="Custom (OpenAI)")&&(P.push({label:"Base URL",value:"customOpenAIBaseUrl",status:t.customOpenAIBaseUrl||"Not Configured"}),P.push({label:"API Key (if needed)",value:"customOpenAIKey",status:ot.c_openai?"Set":"None"})),P}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:Dl(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:Yr(t.alwaysAskCommands),section:"Sandbox"},{label:"Always Ask Files/Paths",value:"alwaysAskFiles",status:Yr(t.alwaysAskFiles||".env, .env.*, *.env"),section:"Sandbox"},{label:"Auto Approve Commands",value:"autoApprove",status:Yr(t.autoApproveCommands),section:"Sandbox"},{label:"Auto Disapprove Commands",value:"autoDisallow",status:Yr(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[]}},gn=Eo[L].id,qe=tn(gn);Pd((he,C)=>{if(ae){if(C.tab){Le(P=>P==="search"?"list":"search");return}if(Me==="search"){C.escape?Ke(!1):C.downArrow||C.return?Le("list"):C.backspace||C.delete?Se(P=>P.slice(0,-1)):he&&!C.ctrl&&!C.meta&&he.length===1&&Se(P=>P+he);return}if(C.upArrow)j(P=>{if(le.length===0)return 0;let ke=(P-1+le.length)%le.length,Ve=0;for(;le[ke]?.isHeader&&Ve<le.length;)ke=(ke-1+le.length)%le.length,Ve++;return ke});else if(C.downArrow)j(P=>{if(le.length===0)return 0;let ke=(P+1)%le.length,Ve=0;for(;le[ke]?.isHeader&&Ve<le.length;)ke=(ke+1)%le.length,Ve++;return ke});else if(C.return){let P=le[He];P&&!P.isHeader&&(f(ke=>{let Ve=P.value==="Default",ut={...ke,CustomSubAgent:!Ve,SubAgentModel:P.value,SubAgentProvider:Ve?"":P.provider||""};return p({systemSettings:ut,apiTier:g,quotas:a}),ut}),Ke(!1))}else C.escape?Ke(!1):he&&!C.ctrl&&!C.meta&&he.length===1&&(Se(P=>P+he),Le("search"));return}if(Ee){if(C.upArrow){let P=(We-1+So.length)%So.length;pe(P)}else if(C.downArrow){let P=(We+1)%So.length;pe(P)}else if(C.return){let P=So[We];f(ke=>{let Ve={...ke,theme:P};return p({systemSettings:Ve,apiTier:g,quotas:a}),Ve}),N?N():_e(!1)}else C.escape&&(N?N():_e(!1));return}if(ue){C.escape&&z(null);return}if(F==="categories")C.upArrow?Y(P=>(P-1+Eo.length)%Eo.length):C.downArrow?Y(P=>(P+1)%Eo.length):C.return||C.rightArrow?Eo[L].id==="exit"?S("chat"):($("items"),ce(0)):C.escape&&S("chat");else if(F==="items"){if(C.upArrow)ce(P=>(P-1+qe.length)%qe.length);else if(C.downArrow)ce(P=>(P+1)%qe.length);else if(C.leftArrow||C.escape)$("categories");else if(C.return){let P=qe[K];Kt(P)}}});let Kt=he=>{if(he.value==="memory")f(C=>({...C,memory:!C.memory}));else if(he.value==="sandboxPreset"){let C=Dl(t),P=["Autonomous","Balanced","Strict"],Ve=(P.indexOf(C)+1)%P.length,ut=P[Ve];f(gt=>{let ze={...gt,sandboxPreset:ut};return ut==="Strict"?(ze.autoExec=!1,ze.allowExternalAccess=!1,ze.networkAccess=!1,ze.autoApproveCommands="",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, shutdown, reboot, init 0, init 6, Stop-Process, Stop-Service, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, netsh advfirewall, iptables -F, ufw disable, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1):ut==="Balanced"?(ze.autoExec=!0,ze.allowExternalAccess=!1,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, Stop-Process, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, shutdown, reboot, init 0, init 6, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1):ut==="Autonomous"&&(ze.autoExec=!0,ze.allowExternalAccess=!0,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="",ze.alwaysAskCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.autoApproveGit=!0),ze})}else if(he.value==="autoExec")t.autoExec?f(C=>({...C,autoExec:!1,sandboxPreset:"Custom"})):t.allowExternalAccess?S("doubleDanger"):S("autoExecDanger");else if(he.value==="externalAccess")t.allowExternalAccess?f(C=>({...C,allowExternalAccess:!1,sandboxPreset:"Custom"})):t.autoExec?S("doubleDanger"):S("externalDanger");else if(he.value==="networkAccess")f(C=>({...C,networkAccess:C.networkAccess===!1,sandboxPreset:"Custom"}));else if(he.value==="alwaysAsk")z("alwaysAskCommands"),xe(t.alwaysAskCommands||"");else if(he.value==="alwaysAskFiles")z("alwaysAskFiles"),xe(t.alwaysAskFiles||".env, .env.*, *.env");else if(he.value==="autoApprove")z("autoApproveCommands"),xe(t.autoApproveCommands||"");else if(he.value==="autoApproveGit")f(C=>({...C,autoApproveGit:!C.autoApproveGit,sandboxPreset:"Custom"}));else if(he.value==="customOpenAIBaseUrl")z("customOpenAIBaseUrl"),xe(t.customOpenAIBaseUrl||"");else if(he.value==="customOpenAIKey")z("customOpenAIKey"),xe("");else if(he.value==="ollamaEndpoint")f(C=>{let P=C.ollamaEndpoint==="Local"?"Cloud":"Local",ke={...C,ollamaEndpoint:P};return p({systemSettings:ke,apiTier:g,quotas:a}),ke});else if(he.value==="apiTier")S("apiTier");else if(he.value==="aiProvider")O&&O("settings"),S("selectProvider");else if(he.value==="advanceRollback")t.advanceRollback?f(C=>{let P={...C,advanceRollback:!1};return p({systemSettings:P,apiTier:g,quotas:a}),P}):S("advanceRollbackDanger");else if(he.value==="autoDelete"){let C=["1d","7d","30d"],ke=(C.indexOf(t.autoDeleteHistory||"30d")+1)%C.length;f(Ve=>({...Ve,autoDeleteHistory:C[ke]}))}else if(he.value==="autoUpdate")f(C=>({...C,autoUpdate:!C.autoUpdate}));else if(he.value==="externalData")if(!t.useExternalData)w({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||""}),S("input");else{let C={...t,useExternalData:!1};f(C),p({systemSettings:C,apiTier:g,quotas:a}),T(P=>[...P,{id:Date.now(),role:"system",text:"[STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart."}]),S("chat")}else if(he.value==="updateManager")S("updateManager");else if(he.value==="parserDownload")S("parserDownload");else if(he.value==="indentationTree")f(C=>{let P={...C,indentationTree:C.indentationTree===!1};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="compressToolResults")f(C=>{let P={...C,compressToolResults:!C.compressToolResults};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="autoTruncateResults")f(C=>{let P={...C,autoTruncateResults:!C.autoTruncateResults};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="imageHistoryCU"){let C=["Low","Standard","Extended","Max"],ke=(C.indexOf(t.imageHistoryCU||"Standard")+1)%C.length;f(Ve=>{let ut={...Ve,imageHistoryCU:C[ke]};return p({systemSettings:ut,apiTier:g,quotas:a}),ut})}else if(he.value==="contextLength"){let C=["16k","32k","64k","128k","256k","512k","1M"],ke=(C.indexOf(t.contextLength||"256k")+1)%C.length;f(Ve=>{let ut={...Ve,contextLength:C[ke]};return p({systemSettings:ut,apiTier:g,quotas:a}),ut})}else if(he.value==="keepReasoningContext")f(C=>{let P={...C,keepReasoningContext:!C.keepReasoningContext};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="autoExcludeMetadata")f(C=>{let P={...C,autoExcludeMetadata:!C.autoExcludeMetadata};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="disableTodo")f(C=>{let P={...C,disableTodo:!C.disableTodo};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="subAgents")f(C=>{let P={...C,subAgents:C.subAgents===!1};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="subAgentModel"){let C=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",P=le.findIndex(ke=>ke.value===C);j(P>=0?P:0),Ke(!0)}else if(he.value==="preserveThinking")f(C=>{let P={...C,preserveThinking:C.preserveThinking===!1};return Tl(P.preserveThinking),p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="loadingPhrases")f(C=>{let P={...C,loadingPhrases:C.loadingPhrases===!1};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="progressiveRendering")f(C=>{let P={...C,progressiveRendering:!C.progressiveRendering};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="showTPMEstimate")f(C=>{let P={...C,showTPMEstimate:!C.showTPMEstimate};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="theme"){let C=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",P=So.indexOf(C);pe(P>=0?P:0),ye(t.theme||"Dark"),_e(!0)}},Be=lt(t.theme);if(ae){let he=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",C=15,P=ne;He<P?P=He:He>=P+C&&(P=He-C+1),P=Math.max(0,Math.min(P,Math.max(0,le.length-C))),P!==ne&&ee(P);let ke=le.slice(P,P+C);return A.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:1,width:"100%",minHeight:32},A.createElement(Ue,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:Be.text,bold:!0,underline:!0},"Select Sub-Agent Model:"),le.length>0&&A.createElement(Z,{color:"gray"},He+1,"/",le.length)),A.createElement(Ue,{borderStyle:"single",borderColor:Me==="search"?Be.primary||"cyan":"gray",paddingX:1,marginBottom:1},A.createElement(Z,{color:Me==="search"?Be.primary||"cyan":"gray",bold:!0},"\u{1F50D} Search: "," "),A.createElement(Z,{color:Be.text},de),Me==="search"&&A.createElement(Z,{color:Be.primary||"cyan"},"\u2588"),!de&&Me!=="search"&&A.createElement(Z,{color:"gray",italic:!0},"(Press TAB or type to filter models...)")),A.createElement(Ue,{flexDirection:"column",flexGrow:1,height:C},ke.length>0?ke.map((Ve,ut)=>{let gt=P+ut;if(Ve.isHeader)return A.createElement(Ue,{key:`hdr-${gt}`,paddingX:1},A.createElement(Z,{color:"gray",bold:!0,underline:!0},Ve.label));let ze=He===gt&&Me==="list",oo=he===Ve.value;return A.createElement(Ue,{key:`item-${Ve.value}-${gt}`,paddingX:1,backgroundColor:ze?Be.highlightBg:void 0},A.createElement(Z,{color:ze?Be.text:Be.textDim,bold:ze},ze?"\u276F ":" ",Ve.label,oo?A.createElement(Z,{color:Be.primary||"cyan",italic:!0}," (active)"):""))}):A.createElement(Ue,{paddingX:1},A.createElement(Z,{color:"gray",italic:!0},'No models matching "',de,'"'))),A.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:"gray",italic:!0},"TAB to switch search/list \u2022 \u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),A.createElement(Z,{color:Me==="search"?Be.primary||"cyan":"gray",bold:!0},"[",Me.toUpperCase()," MODE]")))}if(Ee){let he=So[We],C=lt(he);return A.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:C.border,padding:1,width:"100%",minHeight:32},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:C.text,bold:!0},"Choose your color scheme:")),A.createElement(Ue,{flexDirection:"row",width:"100%",flexGrow:1},A.createElement(Ue,{flexDirection:"column",width:"30%",paddingRight:1},So.map((P,ke)=>{let Ve=We===ke,ut=(t.theme||"Dark")===P,gt=P==="Forest Sprite"||P==="Spookfest";return A.createElement(Ue,{key:P,paddingX:0},A.createElement(Z,{color:Ve?C.text:C.textDim,bold:Ve},Ve?"> ":" ",P,gt&&A.createElement(Z,{color:Ve?C.success||"#52b788":"green",bold:!0}," \u2605"),ut?A.createElement(Z,{color:C.primary||"cyan",italic:!0}," (saved)"):""))})),A.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:C.borderMuted,paddingX:2,paddingY:1,backgroundColor:C.cardBg},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:C.secondary||"cyan",bold:!0},"> ","you: "),A.createElement(Z,{color:C.text},"add a greeting function")),A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:C.success||"green"}," Here's the change:")),A.createElement(Ue,{flexDirection:"column",marginLeft:2,marginBottom:1},A.createElement(Z,null,A.createElement(Z,{color:C.textDim},"3 "),bt(' import "fmt"',".go",void 0)),A.createElement(Z,{color:C.textDim},"4"),A.createElement(Ue,{backgroundColor:C.diffRemovalBg},A.createElement(Z,null,A.createElement(Z,{color:C.diffRemovalNum||C.diffRemovalText},"5 "),A.createElement(Z,{color:C.diffRemovalPrefix||C.diffRemovalText},"- "),bt("func ",".go",void 0),bt("main()",".go",void 0,C.diffRemovalHighlightBg),bt(" {",".go",void 0))),A.createElement(Ue,{backgroundColor:C.diffAdditionBg},A.createElement(Z,null,A.createElement(Z,{color:C.diffAdditionNum||C.diffAdditionText},"5 "),A.createElement(Z,{color:C.diffAdditionPrefix||C.diffAdditionText},"+ "),bt("func ",".go",void 0),bt("greet(name string)",".go",void 0,C.diffAdditionHighlightBg),bt(" {",".go",void 0))),A.createElement(Ue,{backgroundColor:C.diffAdditionBg},A.createElement(Z,null,A.createElement(Z,{color:C.diffAdditionNum||C.diffAdditionText},"6 "),A.createElement(Z,{color:C.diffAdditionPrefix||C.diffAdditionText},"+ "),A.createElement(Z,null," "),bt('fmt.Printf("Hello, %s!\\n", name)',".go",void 0,C.diffAdditionHighlightBg))),A.createElement(Z,null,"7 }")),A.createElement(Ue,{flexDirection:"column",marginTop:1,marginBottom:1},A.createElement(Z,{color:C.textDim},"\u25BE Thought Process"),A.createElement(Z,{color:C.textMuted}," I need to add a greeting function. I'll use fmt.Printf.")),A.createElement(Ue,{flexDirection:"column"},A.createElement(Z,null,A.createElement(Z,{color:C.warning||"yellow"},"\u2699 tool: "),A.createElement(Z,{color:C.text},"write_file main.go")),A.createElement(Z,null,A.createElement(Z,{color:C.accent||"magenta"},"\u29BF task: "),A.createElement(Z,{color:C.text},"Implementing greeting")),A.createElement(Z,null,A.createElement(Z,{color:C.danger||"red"},"X error: "),A.createElement(Z,{color:C.text},"compilation failed")),A.createElement(Z,null,A.createElement(Z,{color:C.warning||"yellow"},"\u26A0 warning: "),A.createElement(Z,{color:C.text},"deprecation warning")),A.createElement(Z,null,A.createElement(Z,{color:C.info||"blue"},"\u2192 link: "),A.createElement(Z,{color:C.info||"blue",underline:!0},"file:///path/to/main.go")),A.createElement(Z,null,A.createElement(Z,{color:C.accent||"magenta"},"\u2605 accent: "),A.createElement(Z,{color:C.text},"highlighted text")),A.createElement(Z,{color:C.textDim},"\xB7 dim: press Enter to continue")))),A.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:"gray",italic:!0},"\u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),A.createElement(Z,{color:"gray"},"Previewing: ",So[We],So[We]==="Forest Sprite"?" \u2605":"")))}return A.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:0,width:"100%",minHeight:32},A.createElement(Ue,{paddingX:1,paddingY:0,marginBottom:0,borderStyle:"single",borderColor:Be.borderMuted,width:"100%"},A.createElement(Z,{color:Be.text,bold:!0},"SYSTEM CONFIGURATION")),A.createElement(Ue,{flexDirection:"row",width:"100%",minHeight:26},A.createElement(Ue,{flexDirection:"column",width:"30%",maxWidth:40,borderStyle:"round",borderColor:F==="categories"?Be.border:Be.borderMuted,padding:1,paddingY:0},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:F==="categories"?Be.text:Be.textDim,bold:!0,underline:!0},"CATEGORIES")),Eo.map((he,C)=>{let P=L===C,ke=he.id==="exit";return A.createElement(Ue,{key:he.id,marginTop:ke?15:0,backgroundColor:P?F==="categories"?Be.highlightBg:Be.cardBg:void 0,paddingX:1},A.createElement(Z,{color:P&&F==="categories"?Be.text:Be.textDim,bold:P},P?"\u276F ":" ",he.label))})),A.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:F==="items"?Be.border:Be.borderMuted,paddingX:1,marginLeft:1,paddingY:0},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:F==="items"?Be.text:Be.textDim,bold:!0,underline:!0},Eo[L].label.toUpperCase().includes("EXIT")?"Runtime Information":`${Eo[L].label} Settings`)),qe.length>0?(()=>{let he=null,C=[],P=Re=>(Re||"").split(",").map($t=>$t.trim().toLowerCase()).filter(Boolean),ke=P(t.autoApproveCommands),Ve=P(t.autoDisallowCommands),ut=P(t.alwaysAskCommands),gt=[...ke,...Ve,...ut],ze=new Set(gt),oo=gn==="security"&>.length!==ze.size;return qe.forEach((Re,$t)=>{let Ht=F==="items"&&K===$t,es=Re.label.length,on=Math.max(2,38-es),ts=".".repeat(on),Tt=Gt=>gn==="security"?(Gt.value==="autoExec"||Gt.value==="externalAccess")&&Gt.status==="ON"?Be.statusOn:Be.statusOff:Gt.status?.startsWith("\u2713")?Be.statusOn:Gt.status?.startsWith("\u26A0")?Be.statusOff:Gt.status==="ON"?Be.statusOn:Gt.status==="OFF"?Be.statusOff:Be.text;Re.section&&Re.section!==he&&(he=Re.section,C.push(A.createElement(Ue,{key:`sec-hdr-${Re.section}`,marginTop:C.length>0?1:0,marginBottom:0,paddingX:1},A.createElement(Z,{color:"gray",bold:!0,underline:!0},Re.section.toUpperCase()))));let Q=Ht&&ue&&(ue==="alwaysAskCommands"&&Re.value==="alwaysAsk"||ue==="alwaysAskFiles"&&Re.value==="alwaysAskFiles"||ue==="autoApproveCommands"&&Re.value==="autoApprove"||ue==="autoDisallowCommands"&&Re.value==="autoDisallow"||ue==="customOpenAIBaseUrl"&&Re.value==="customOpenAIBaseUrl"||ue==="customOpenAIKey"&&Re.value==="customOpenAIKey"),Wn=Re.value==="alwaysAsk"||Re.value==="alwaysAskFiles"||Re.value==="autoApprove"||Re.value==="autoDisallow",os=Re.value==="parserDownload";C.push(A.createElement(Ue,{key:Re.value,flexDirection:"column"},A.createElement(Ue,{backgroundColor:Ht&&!Q?Be.highlightBg:void 0,paddingX:2},A.createElement(Z,{color:Ht?Be.text:Be.textDim,bold:Ht},Ht?"\u276F ":" ",Re.label),!Wn&&!os&&A.createElement(A.Fragment,null,A.createElement(Z,{color:"gray"},ts),A.createElement(Z,{color:Tt(Re),bold:!0},Re.value==="aiProvider"?Re.status:`[ ${Re.status} ]`))),Wn&&!Q&&Re.status!=="None"&&A.createElement(Ue,{paddingX:4,marginBottom:1},A.createElement(Z,{color:"gray"},"\u21B3 ",Re.status)),Q&&A.createElement(Ue,{flexDirection:"column",marginLeft:4,marginBottom:1},A.createElement(Ue,{paddingX:1,borderStyle:"single",borderColor:"gray",flexDirection:"row"},A.createElement(Z,{color:"gray",bold:!0},"> "," "),A.createElement(Nd,{value:oe,onChange:xe,onSubmit:async Gt=>{if(ue==="customOpenAIBaseUrl"){let at=Gt.trim().replace(/\/+$/,""),no={...t,customOpenAIBaseUrl:at};f(no),p({systemSettings:no,apiTier:g,quotas:a})}else if(ue==="customOpenAIKey"){let{saveProviderAPIKey:at}=await import("./secrets-GHW6AWRR.js");await at("c_openai",Gt.trim()),dt(no=>({...no,c_openai:!!Gt.trim()}))}else{let at={...t,[ue]:Gt.trim(),sandboxPreset:"Custom"};f(at),p({systemSettings:at,apiTier:g,quotas:a})}z(null)}})),A.createElement(Z,{color:"gray",italic:!0}," ",ue==="customOpenAIBaseUrl"?"Enter Base URL (.../v1) \u2022 Press Enter to save, Esc to cancel \u2022 Restart Required":ue==="customOpenAIKey"?"Enter API Key \u2022 Press Enter to save, Esc to cancel \u2022 Restart Required":"Comma separated \u2022 Press Enter to save, Esc to cancel"))))}),oo&&C.push(A.createElement(Ue,{key:"conflict-warning",marginTop:1,paddingX:1},A.createElement(Z,{color:Be.text,italic:!0},"* Conflicting commands will be ignored and defaulted to highest priority"))),C})():A.createElement(Ue,{paddingX:1,flexDirection:"column",width:"100%"},gn==="exit"?A.createElement(A.Fragment,null,A.createElement(Ue,{flexDirection:"column",marginBottom:1},A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"OS"," "),A.createElement(Z,{color:"gray"},"..................... "),A.createElement(Z,{color:Be.text},process.env.OS||process.platform||"N/A")),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Computer Name"," "),A.createElement(Z,{color:"gray"},".......... "),A.createElement(Z,{color:Be.text},process.env.COMPUTERNAME||process.env.HOSTNAME||"N/A")),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Processor Count"," "),A.createElement(Z,{color:"gray"},"........ "),A.createElement(Z,{color:Be.text},process.env.NUMBER_OF_PROCESSORS||"N/A")),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Node.js Version"," "),A.createElement(Z,{color:"gray"},"........ "),A.createElement(Z,{color:Be.text},"v",process.versions.node)),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"V8 Version"," "),A.createElement(Z,{color:"gray"},"...... ...... "),A.createElement(Z,{color:Be.text},"v",process.versions.v8)),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Data Directory"," "),A.createElement(Z,{color:"gray"},"......... "),go===Co?"":A.createElement(Z,{color:Be.text},go.replaceAll(vl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"),", "),A.createElement(Z,{color:Be.text},Co.replaceAll(vl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"))),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Viewport"," "),A.createElement(Z,{color:"gray"},"............... "),A.createElement(Z,{color:Be.text},process.stdout.rows||"?"," rows \xD7 ",process.stdout.columns||"?"," cols ",process.stdout.columns<90?"(too small width)":"")),A.createElement(Ue,{flexDirection:"row",marginBottom:0},A.createElement(Z,{color:Be.textDim},"Memory Load"," "),A.createElement(Z,{color:"gray"},"............ "),A.createElement(Z,{color:Be.text},ge,"/",v," ",st))),A.createElement(Ue,{key:"pty-notice",paddingX:0,marginTop:0},A.createElement(Z,{color:zt?Be.statusOn:Be.warning},zt?"\u2713 Advance Interactive Terminal Supported":"\u26A0 Interactive Terminal is Limited"))):A.createElement(Z,{color:"gray",italic:!0},Eo[L].desc)))),A.createElement(Ue,{paddingX:1,marginTop:0,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:"gray",italic:!0},F==="categories"?"\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure":"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"),F==="categories"&&A.createElement(Z,{color:"gray"},Eo[L].desc)))}import io,{useState as $s,useEffect as $d}from"react";import{Box as Un,Text as xr}from"ink";import Ud from"ink-text-input";function Us({initialData:t,onSave:f,onCancel:g,theme:S="Dark"}){let w=lt(S),[p,a]=$s(0),[T,b]=$s(""),[M,N]=$s(()=>({name:t?.name||"",nickname:t?.nickname||"",instructions:t?.instructions||""})),O=[{key:"nickname",label:"Enter a Nickname: ",maxLength:20},{key:"instructions",label:"System Instructions: ",maxLength:200}],E=O[p];$d(()=>{let L=O[p].key;b((M[L]||"").slice(0,O[p].maxLength))},[p,M]);let D=L=>{L.length>E.maxLength?b(L.slice(0,E.maxLength)):b(L)},F=L=>{if(L.trim().toLowerCase()==="/cancel"){g();return}let Y=E.key,K={...M,[Y]:L.trim().slice(0,E.maxLength)};N(K),b(""),p<O.length-1?a(p+1):f(K)},$=T.length>=E.maxLength;return io.createElement(Un,{borderStyle:"round",borderColor:w.borderMuted,padding:0,marginTop:1,flexShrink:0,flexDirection:"column",width:"100%"},io.createElement(Un,{paddingX:1,marginBottom:1},io.createElement(xr,{color:w.text,bold:!0},"USER PROFILE CONFIGURATION")),io.createElement(Un,{paddingX:1,flexDirection:"column"},io.createElement(Un,null,io.createElement(xr,{color:w.text,bold:!0},E.label),io.createElement(Ud,{value:T,onChange:D,onSubmit:F})),io.createElement(Un,{marginTop:1,justifyContent:"space-between"},io.createElement(xr,{color:w.textMuted,italic:!0},"Step ",p+1," of ",O.length),io.createElement(xr,{color:$?w.warning||"yellow":w.textMuted},"[",T.length,"/",E.maxLength,"]"))),io.createElement(Un,{paddingX:1,marginTop:1},io.createElement(xr,{color:w.textMuted,italic:!0},"(Enter to submit \u2022 Type /cancel to abort)")))}import It,{useState as _s}from"react";import{Box as lo,Text as Jo,useInput as _d}from"ink";import Hd from"ink-text-input";var Xd=({question:t,options:f,onResolve:g,theme:S="Dark"})=>{let w=lt(S),[p,a]=_s(!1),[T,b]=_s(""),[M,N]=_s(0),O=!1,E=[],D=Array.isArray(f)&&f.length>0,F=t==="Agent has been running for a long time. Do you want to continue execution?";try{F&&D?E=[...f]:E=[...D?f:[],D?{id:"CUSTOM",label:"Suggest something else...",description:"Provide a custom response"}:{id:"CUSTOM",label:"Your Answer",description:""}]}catch{O=!0}_d((L,Y)=>{if(!p&&((Y.leftArrow||Y.upArrow)&&N(K=>Math.max(0,K-1)),(Y.rightArrow||Y.downArrow)&&N(K=>Math.min(E.length-1,K+1)),Y.return)){let K=E[M];K?.id==="CUSTOM"?a(!0):g(O?"Selected Nothing":K.label)}});let $=ft(2);return p?It.createElement(lo,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:w.codeBg,width:"100%"},It.createElement(lo,{paddingX:1},It.createElement(Jo,{color:w.text,bold:!0},"SUGGEST SOMETHING")),It.createElement(lo,{marginTop:1,paddingX:1},It.createElement(Jo,{italic:!0,color:w.textMuted},"Replying to: ",t)),It.createElement(lo,{marginTop:1,paddingX:1,flexDirection:"row"},It.createElement(Hd,{value:T,onChange:b,onSubmit:()=>g(T)})),It.createElement(lo,{marginTop:1,paddingX:1,marginBottom:1},It.createElement(Jo,{color:w.textMuted,italic:!0},"(Press Enter to send)"))):It.createElement(lo,{flexDirection:"column",border:!0,borderStyle:"round",borderColor:w.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,marginRight:1,width:"100%"},It.createElement(lo,{paddingX:1,marginBottom:1},It.createElement(Jo,{color:"yellow",bold:!0},F?"TURN SAFETY SYSTEM: EXECUTION LIMIT":"AGENT REQUEST: ACTION REQUIRED")),It.createElement(lo,{paddingX:1,marginBottom:1},It.createElement(Jo,{color:w.text},t)),It.createElement(lo,{flexDirection:"column",width:"100%"},E.map((L,Y)=>{let K=Y===M;return It.createElement(lo,{key:L.id,flexDirection:"column",width:"100%",backgroundColor:K?w.highlightBg:void 0,paddingX:1,marginBottom:Y===E.length-1?0:1},It.createElement(Jo,{color:K?w.text:w.textMuted,bold:K},K?"\u276F ":" ",L.label),L.description&&It.createElement(lo,{marginLeft:4},It.createElement(Jo,{color:w.textMuted,italic:!0},L.description)))})),It.createElement(lo,{paddingX:1,marginTop:1,marginBottom:1},It.createElement(Jo,{color:w.textMuted,italic:!0},"(Use Arrows to navigate, Enter to confirm)")))},Il=Xd;import dc from"gradient-string";import _t,{useState as Hs,useEffect as Gd}from"react";import{Box as Bo,Text as Zo,useInput as Wd}from"ink";function Xs({onSelect:t,onDelete:f,onClose:g,theme:S="Dark"}){let w=lt(S),[p,a]=Hs({}),[T,b]=Hs([]),[M,N]=Hs(0);Gd(()=>{(async()=>{let L=await Qo();a(L),b(Object.keys(L).sort((Y,K)=>(L[K].updatedAt||0)-(L[Y].updatedAt||0)))})()},[]),Wd(($,L)=>{if(L.escape&&g(),L.upArrow&&N(Y=>Math.max(0,Y-1)),L.downArrow&&N(Y=>Math.min(T.length-1,Y+1)),L.return&&T[M]&&t(T[M]),$==="x"&&T[M]){let Y=T[M];f(Y).then(K=>{let ce=K||{};a(ce);let ue=Object.keys(ce).sort((z,oe)=>(ce[oe]?.updatedAt||0)-(ce[z]?.updatedAt||0));b(ue),N(z=>Math.max(0,Math.min(ue.length-1,z)))})}});let O=ft(2),E=15,D=0;if(T.length>E){let $=Math.floor(E/2);D=M-$,D<0?D=0:D+E>T.length&&(D=T.length-E)}let F=T.slice(D,D+E);return _t.createElement(Bo,{flexDirection:"column",borderStyle:"round",borderColor:w.borderMuted,padding:0,width:"100%"},_t.createElement(Bo,{paddingX:1,marginBottom:1},_t.createElement(Zo,{color:w.text,bold:!0},"CHAT HISTORY: RESUME CONVERSATION")),T.length===0?_t.createElement(Bo,{paddingX:2,paddingY:1},_t.createElement(Zo,{italic:!0,color:w.textMuted},"No saved chats found.")):_t.createElement(Bo,{flexDirection:"column",width:"100%"},D>0&&_t.createElement(Bo,{paddingX:2,marginBottom:1},_t.createElement(Zo,{color:w.textMuted},"\u25B2 (+",D," more chats above)")),F.map(($,L)=>{let Y=p[$],ce=D+L===M,ue=Vd(Y?.updatedAt);return _t.createElement(Bo,{key:$,paddingX:1,backgroundColor:ce?w.highlightBg:void 0,width:"100%"},_t.createElement(Bo,{flexGrow:1},_t.createElement(Zo,{color:ce?w.text:w.textMuted,bold:ce},ce?"\u276F ":" ",(()=>{let z=oe=>(oe||"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();return Y?.name&&!Y.name.startsWith("Session")?z(Y.name):Y?.prompt?z(Y.prompt):z(Y?.name)||$})(),_t.createElement(Zo,{color:w.textMuted}," [",ue," \u2022 ",$,"]"))),ce&&_t.createElement(Bo,{flexShrink:0},_t.createElement(Zo,{color:w.danger,bold:!0},"[X] DELETE ")))}),D+E<T.length&&_t.createElement(Bo,{paddingX:2,marginTop:1},_t.createElement(Zo,{color:w.textMuted},"\u25BC (+",T.length-(D+E)," more chats below)"))),_t.createElement(Bo,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:w.borderMuted},_t.createElement(Zo,{color:w.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")))}function Vd(t){if(!t)return"N/A";let f=new Date(t);if(isNaN(f.getTime()))return"N/A";let g=T=>String(T).padStart(2,"0"),S=g(f.getMonth()+1),w=g(f.getDate()),p=g(f.getHours()),a=g(f.getMinutes());return`${S}-${w} ${p}:${a}`}import kt,{useState as Gs,useEffect as Yd}from"react";import{Box as vo,Text as bo,useInput as jd,useStdout as Kd}from"ink";function Ws({onClose:t,theme:f="Dark"}){let g=lt(f),{stdout:S}=Kd(),w=S?.columns||80,[p,a]=Gs([]),[T,b]=Gs(0),[M,N]=Gs(!0),O=()=>{let z=Dr(tr,[]);a(z);try{let xe=Ir(cn,{}).systemSettings?.memory!==!1;N(xe)}catch{N(!0)}};Yd(()=>{O()},[]),jd((z,oe)=>{if(oe.escape&&t(),oe.upArrow&&b(xe=>Math.max(0,xe-1)),oe.downArrow&&b(xe=>Math.min(p.length-1,xe+1)),z==="x"&&p.length>0){let xe=p[T].id,Ee=p.filter(_e=>_e.id!==xe);Pi(tr,Ee),a(Ee),T>=Ee.length&&Ee.length>0&&b(Ee.length-1)}});let E=(z,oe,xe)=>{if(!z)return"";let Ee=z.replace(/\[Saved on: .*?\]/g,"").replace(/\\+'/g,"'").trim(),We=`${xe?"\u276F ":" "}${oe+1}. `.length,pe=xe?22:2;return Ee.split(`
|
|
44
|
+
---`)&&ke.push({label:$t,value:$t,isHeader:!1,provider:gt})}))}return ke},[b,g,a,ot]),le=A.useMemo(()=>{if(!de.trim())return Ie;let he=de.trim().toLowerCase(),C=[],P=null;for(let ke of Ie)ke.isHeader?P=ke:(ke.label.toLowerCase().includes(he)||ke.value&&ke.value.toLowerCase().includes(he))&&(P&&!C.includes(P)&&C.push(P),C.push(ke));return C},[Ie,de]);mr(()=>{if(ae){let he=le.findIndex(C=>!C.isHeader);j(he>=0?he:0),ee(0)}},[de]),mr(()=>{if(ae){if(le.length===0){j(0),ee(0);return}if(He>=le.length||le[He]?.isHeader){let he=le.findIndex(C=>!C.isHeader);j(he>=0?he:0)}}},[le,ae]);let[ge,Oe]=Ut(0),[v,Ne]=Ut(0),[st,Lt]=Ut("MB"),[zt,Rr]=Ut(!1);mr(()=>{let he=!1;return import("./exec_command-A5JWE55Q.js").then(C=>{he||Rr(!!C.isPtyAvailable)}).catch(()=>{}),()=>{he=!0}},[]),mr(()=>{let he=Fd.getHeapStatistics().heap_size_limit,C=he>=1024*1024*1024,P=C?"GB":"MB",ke=C?1024*1024*1024:1024*1024;Ne(parseFloat((he/ke).toFixed(2))),Lt(P);let Ve=()=>{let oo=process.memoryUsage().rss/ke,Re=C?parseFloat(oo.toFixed(2)):Math.round(oo);Oe(Re)};Ve();let ut=setInterval(()=>{Ve()},3e4);return()=>clearInterval(ut)},[]);let tn=he=>{switch(he){case"providers":{let P=[{label:"Current Provider",value:"aiProvider",status:b==="c_openai"?"Custom (OpenAI)":b}];return b==="Ollama"&&P.push({label:"Endpoint",value:"ollamaEndpoint",status:t.ollamaEndpoint||"Cloud"}),(b==="c_openai"||b==="Custom (OpenAI)")&&(P.push({label:"Base URL",value:"customOpenAIBaseUrl",status:t.customOpenAIBaseUrl||"Not Configured"}),P.push({label:"API Key (if needed)",value:"customOpenAIKey",status:ot.c_openai?"Set":"None"})),P}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:Dl(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:Yr(t.alwaysAskCommands),section:"Sandbox"},{label:"Always Ask Files/Paths",value:"alwaysAskFiles",status:Yr(t.alwaysAskFiles||".env, .env.*, *.env"),section:"Sandbox"},{label:"Auto Approve Commands",value:"autoApprove",status:Yr(t.autoApproveCommands),section:"Sandbox"},{label:"Auto Disapprove Commands",value:"autoDisallow",status:Yr(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[]}},gn=Eo[L].id,qe=tn(gn);Pd((he,C)=>{if(ae){if(C.tab){Le(P=>P==="search"?"list":"search");return}if(Me==="search"){C.escape?Ke(!1):C.downArrow||C.return?Le("list"):C.backspace||C.delete?Se(P=>P.slice(0,-1)):he&&!C.ctrl&&!C.meta&&he.length===1&&Se(P=>P+he);return}if(C.upArrow)j(P=>{if(le.length===0)return 0;let ke=(P-1+le.length)%le.length,Ve=0;for(;le[ke]?.isHeader&&Ve<le.length;)ke=(ke-1+le.length)%le.length,Ve++;return ke});else if(C.downArrow)j(P=>{if(le.length===0)return 0;let ke=(P+1)%le.length,Ve=0;for(;le[ke]?.isHeader&&Ve<le.length;)ke=(ke+1)%le.length,Ve++;return ke});else if(C.return){let P=le[He];P&&!P.isHeader&&(f(ke=>{let Ve=P.value==="Default",ut={...ke,CustomSubAgent:!Ve,SubAgentModel:P.value,SubAgentProvider:Ve?"":P.provider||""};return p({systemSettings:ut,apiTier:g,quotas:a}),ut}),Ke(!1))}else C.escape?Ke(!1):he&&!C.ctrl&&!C.meta&&he.length===1&&(Se(P=>P+he),Le("search"));return}if(Ee){if(C.upArrow){let P=(We-1+So.length)%So.length;pe(P)}else if(C.downArrow){let P=(We+1)%So.length;pe(P)}else if(C.return){let P=So[We];f(ke=>{let Ve={...ke,theme:P};return p({systemSettings:Ve,apiTier:g,quotas:a}),Ve}),N?N():_e(!1)}else C.escape&&(N?N():_e(!1));return}if(ue){C.escape&&z(null);return}if(F==="categories")C.upArrow?Y(P=>(P-1+Eo.length)%Eo.length):C.downArrow?Y(P=>(P+1)%Eo.length):C.return||C.rightArrow?Eo[L].id==="exit"?S("chat"):($("items"),ce(0)):C.escape&&S("chat");else if(F==="items"){if(C.upArrow)ce(P=>(P-1+qe.length)%qe.length);else if(C.downArrow)ce(P=>(P+1)%qe.length);else if(C.leftArrow||C.escape)$("categories");else if(C.return){let P=qe[K];Kt(P)}}});let Kt=he=>{if(he.value==="memory")f(C=>({...C,memory:!C.memory}));else if(he.value==="sandboxPreset"){let C=Dl(t),P=["Autonomous","Balanced","Strict"],Ve=(P.indexOf(C)+1)%P.length,ut=P[Ve];f(gt=>{let ze={...gt,sandboxPreset:ut};return ut==="Strict"?(ze.autoExec=!1,ze.allowExternalAccess=!1,ze.networkAccess=!1,ze.autoApproveCommands="",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, shutdown, reboot, init 0, init 6, Stop-Process, Stop-Service, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, netsh advfirewall, iptables -F, ufw disable, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1):ut==="Balanced"?(ze.autoExec=!0,ze.allowExternalAccess=!1,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.alwaysAskCommands="killall, pkill, taskkill, Stop-Process, mv /*, move c:\\*, chmod 000, chmod -R 777, chown, icacls, shutdown, reboot, init 0, init 6, git reset --hard, git clean -fd, npm r, npm uninstall",ze.autoApproveGit=!1):ut==="Autonomous"&&(ze.autoExec=!0,ze.allowExternalAccess=!0,ze.networkAccess=!0,ze.autoApproveCommands="ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, git branch, git show, help, mkdir, touch, md, whoami, hostname, ps, Get-Process, date, time",ze.autoDisallowCommands="",ze.alwaysAskCommands="rm -rf, rm -f, del /f, del /q, rd /s, rmdir /s, format, mkfs, dd if=/dev, shred, srm, Remove-Item -Recurse -Force, Initialize-Disk, Clear-Disk, format c:, flashrom, nvram -c",ze.autoApproveGit=!0),ze})}else if(he.value==="autoExec")t.autoExec?f(C=>({...C,autoExec:!1,sandboxPreset:"Custom"})):t.allowExternalAccess?S("doubleDanger"):S("autoExecDanger");else if(he.value==="externalAccess")t.allowExternalAccess?f(C=>({...C,allowExternalAccess:!1,sandboxPreset:"Custom"})):t.autoExec?S("doubleDanger"):S("externalDanger");else if(he.value==="networkAccess")f(C=>({...C,networkAccess:C.networkAccess===!1,sandboxPreset:"Custom"}));else if(he.value==="alwaysAsk")z("alwaysAskCommands"),xe(t.alwaysAskCommands||"");else if(he.value==="alwaysAskFiles")z("alwaysAskFiles"),xe(t.alwaysAskFiles||".env, .env.*, *.env");else if(he.value==="autoApprove")z("autoApproveCommands"),xe(t.autoApproveCommands||"");else if(he.value==="autoApproveGit")f(C=>({...C,autoApproveGit:!C.autoApproveGit,sandboxPreset:"Custom"}));else if(he.value==="customOpenAIBaseUrl")z("customOpenAIBaseUrl"),xe(t.customOpenAIBaseUrl||"");else if(he.value==="customOpenAIKey")z("customOpenAIKey"),xe("");else if(he.value==="ollamaEndpoint")f(C=>{let P=C.ollamaEndpoint==="Local"?"Cloud":"Local",ke={...C,ollamaEndpoint:P};return p({systemSettings:ke,apiTier:g,quotas:a}),ke});else if(he.value==="apiTier")S("apiTier");else if(he.value==="aiProvider")O&&O("settings"),S("selectProvider");else if(he.value==="advanceRollback")t.advanceRollback?f(C=>{let P={...C,advanceRollback:!1};return p({systemSettings:P,apiTier:g,quotas:a}),P}):S("advanceRollbackDanger");else if(he.value==="autoDelete"){let C=["1d","7d","30d"],ke=(C.indexOf(t.autoDeleteHistory||"30d")+1)%C.length;f(Ve=>({...Ve,autoDeleteHistory:C[ke]}))}else if(he.value==="autoUpdate")f(C=>({...C,autoUpdate:!C.autoUpdate}));else if(he.value==="externalData")if(!t.useExternalData)w({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||""}),S("input");else{let C={...t,useExternalData:!1};f(C),p({systemSettings:C,apiTier:g,quotas:a}),T(P=>[...P,{id:Date.now(),role:"system",text:"[STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart."}]),S("chat")}else if(he.value==="updateManager")S("updateManager");else if(he.value==="parserDownload")S("parserDownload");else if(he.value==="indentationTree")f(C=>{let P={...C,indentationTree:C.indentationTree===!1};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="compressToolResults")f(C=>{let P={...C,compressToolResults:!C.compressToolResults};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="autoTruncateResults")f(C=>{let P={...C,autoTruncateResults:!C.autoTruncateResults};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="imageHistoryCU"){let C=["Low","Standard","Extended","Max"],ke=(C.indexOf(t.imageHistoryCU||"Standard")+1)%C.length;f(Ve=>{let ut={...Ve,imageHistoryCU:C[ke]};return p({systemSettings:ut,apiTier:g,quotas:a}),ut})}else if(he.value==="contextLength"){let C=["16k","32k","64k","128k","256k","512k","1M"],ke=(C.indexOf(t.contextLength||"256k")+1)%C.length;f(Ve=>{let ut={...Ve,contextLength:C[ke]};return p({systemSettings:ut,apiTier:g,quotas:a}),ut})}else if(he.value==="keepReasoningContext")f(C=>{let P={...C,keepReasoningContext:!C.keepReasoningContext};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="autoExcludeMetadata")f(C=>{let P={...C,autoExcludeMetadata:!C.autoExcludeMetadata};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="disableTodo")f(C=>{let P={...C,disableTodo:!C.disableTodo};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="subAgents")f(C=>{let P={...C,subAgents:C.subAgents===!1};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="subAgentModel"){let C=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",P=le.findIndex(ke=>ke.value===C);j(P>=0?P:0),Ke(!0)}else if(he.value==="preserveThinking")f(C=>{let P={...C,preserveThinking:C.preserveThinking===!1};return Tl(P.preserveThinking),p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="loadingPhrases")f(C=>{let P={...C,loadingPhrases:C.loadingPhrases===!1};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="progressiveRendering")f(C=>{let P={...C,progressiveRendering:!C.progressiveRendering};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="showTPMEstimate")f(C=>{let P={...C,showTPMEstimate:!C.showTPMEstimate};return p({systemSettings:P,apiTier:g,quotas:a}),P});else if(he.value==="theme"){let C=t.theme==="Chaos"||t.theme==="Mystery"?"Mystery":t.theme||"Dark",P=So.indexOf(C);pe(P>=0?P:0),ye(t.theme||"Dark"),_e(!0)}},Be=lt(t.theme);if(ae){let he=t.CustomSubAgent&&t.SubAgentModel?t.SubAgentModel:"Default",C=15,P=ne;He<P?P=He:He>=P+C&&(P=He-C+1),P=Math.max(0,Math.min(P,Math.max(0,le.length-C))),P!==ne&&ee(P);let ke=le.slice(P,P+C);return A.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:1,width:"100%",minHeight:32},A.createElement(Ue,{marginBottom:1,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:Be.text,bold:!0,underline:!0},"Select Sub-Agent Model:"),le.length>0&&A.createElement(Z,{color:"gray"},He+1,"/",le.length)),A.createElement(Ue,{borderStyle:"single",borderColor:Me==="search"?Be.primary||"cyan":"gray",paddingX:1,marginBottom:1},A.createElement(Z,{color:Me==="search"?Be.primary||"cyan":"gray",bold:!0},"\u{1F50D} Search: "," "),A.createElement(Z,{color:Be.text},de),Me==="search"&&A.createElement(Z,{color:Be.primary||"cyan"},"\u2588"),!de&&Me!=="search"&&A.createElement(Z,{color:"gray",italic:!0},"(Press TAB or type to filter models...)")),A.createElement(Ue,{flexDirection:"column",flexGrow:1,height:C},ke.length>0?ke.map((Ve,ut)=>{let gt=P+ut;if(Ve.isHeader)return A.createElement(Ue,{key:`hdr-${gt}`,paddingX:1},A.createElement(Z,{color:"gray",bold:!0,underline:!0},Ve.label));let ze=He===gt&&Me==="list",oo=he===Ve.value;return A.createElement(Ue,{key:`item-${Ve.value}-${gt}`,paddingX:1,backgroundColor:ze?Be.highlightBg:void 0},A.createElement(Z,{color:ze?Be.text:Be.textDim,bold:ze},ze?"\u276F ":" ",Ve.label,oo?A.createElement(Z,{color:Be.primary||"cyan",italic:!0}," (active)"):""))}):A.createElement(Ue,{paddingX:1},A.createElement(Z,{color:"gray",italic:!0},'No models matching "',de,'"'))),A.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:"gray",italic:!0},"TAB to switch search/list \u2022 \u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),A.createElement(Z,{color:Me==="search"?Be.primary||"cyan":"gray",bold:!0},"[",Me.toUpperCase()," MODE]")))}if(Ee){let he=So[We],C=lt(he);return A.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:C.border,padding:1,width:"100%",minHeight:32},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:C.text,bold:!0},"Choose your color scheme:")),A.createElement(Ue,{flexDirection:"row",width:"100%",flexGrow:1},A.createElement(Ue,{flexDirection:"column",width:"30%",paddingRight:1},So.map((P,ke)=>{let Ve=We===ke,ut=(t.theme||"Dark")===P,gt=P==="Forest Sprite"||P==="Spookfest";return A.createElement(Ue,{key:P,paddingX:0},A.createElement(Z,{color:Ve?C.text:C.textDim,bold:Ve},Ve?"> ":" ",P,gt&&A.createElement(Z,{color:Ve?C.success||"#52b788":"green",bold:!0}," \u2605"),ut?A.createElement(Z,{color:C.primary||"cyan",italic:!0}," (saved)"):""))})),A.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:C.borderMuted,paddingX:2,paddingY:1,backgroundColor:C.cardBg},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:C.secondary||"cyan",bold:!0},"> ","you: "),A.createElement(Z,{color:C.text},"add a greeting function")),A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:C.success||"green"}," Here's the change:")),A.createElement(Ue,{flexDirection:"column",marginLeft:2,marginBottom:1},A.createElement(Z,null,A.createElement(Z,{color:C.textDim},"3 "),bt(' import "fmt"',".go",void 0)),A.createElement(Z,{color:C.textDim},"4"),A.createElement(Ue,{backgroundColor:C.diffRemovalBg},A.createElement(Z,null,A.createElement(Z,{color:C.diffRemovalNum||C.diffRemovalText},"5 "),A.createElement(Z,{color:C.diffRemovalPrefix||C.diffRemovalText},"- "),bt("func ",".go",void 0),bt("main()",".go",void 0,C.diffRemovalHighlightBg),bt(" {",".go",void 0))),A.createElement(Ue,{backgroundColor:C.diffAdditionBg},A.createElement(Z,null,A.createElement(Z,{color:C.diffAdditionNum||C.diffAdditionText},"5 "),A.createElement(Z,{color:C.diffAdditionPrefix||C.diffAdditionText},"+ "),bt("func ",".go",void 0),bt("greet(name string)",".go",void 0,C.diffAdditionHighlightBg),bt(" {",".go",void 0))),A.createElement(Ue,{backgroundColor:C.diffAdditionBg},A.createElement(Z,null,A.createElement(Z,{color:C.diffAdditionNum||C.diffAdditionText},"6 "),A.createElement(Z,{color:C.diffAdditionPrefix||C.diffAdditionText},"+ "),A.createElement(Z,null," "),bt('fmt.Printf("Hello, %s!\\n", name)',".go",void 0,C.diffAdditionHighlightBg))),A.createElement(Z,null,"7 }")),A.createElement(Ue,{flexDirection:"column",marginTop:1,marginBottom:1},A.createElement(Z,{color:C.textDim},"\u25BE Thought Process"),A.createElement(Z,{color:C.textMuted}," I need to add a greeting function. I'll use fmt.Printf.")),A.createElement(Ue,{flexDirection:"column"},A.createElement(Z,null,A.createElement(Z,{color:C.warning||"yellow"},"\u2699 tool: "),A.createElement(Z,{color:C.text},"write_file main.go")),A.createElement(Z,null,A.createElement(Z,{color:C.accent||"magenta"},"\u29BF task: "),A.createElement(Z,{color:C.text},"Implementing greeting")),A.createElement(Z,null,A.createElement(Z,{color:C.danger||"red"},"X error: "),A.createElement(Z,{color:C.text},"compilation failed")),A.createElement(Z,null,A.createElement(Z,{color:C.warning||"yellow"},"\u26A0 warning: "),A.createElement(Z,{color:C.text},"deprecation warning")),A.createElement(Z,null,A.createElement(Z,{color:C.info||"blue"},"\u2192 link: "),A.createElement(Z,{color:C.info||"blue",underline:!0},"file:///path/to/main.go")),A.createElement(Z,null,A.createElement(Z,{color:C.accent||"magenta"},"\u2605 accent: "),A.createElement(Z,{color:C.text},"highlighted text")),A.createElement(Z,{color:C.textDim},"\xB7 dim: press Enter to continue")))),A.createElement(Ue,{paddingX:1,marginTop:1,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:"gray",italic:!0},"\u25B2\u25BC Navigate \u2022 ENTER to Select \u2022 ESC to Cancel"),A.createElement(Z,{color:"gray"},"Previewing: ",So[We],So[We]==="Forest Sprite"?" \u2605":"")))}return A.createElement(Ue,{flexDirection:"column",borderStyle:"round",borderColor:Be.border,padding:0,width:"100%",minHeight:32},A.createElement(Ue,{paddingX:1,paddingY:0,marginBottom:0,borderStyle:"single",borderColor:Be.borderMuted,width:"100%"},A.createElement(Z,{color:Be.text,bold:!0},"SYSTEM CONFIGURATION")),A.createElement(Ue,{flexDirection:"row",width:"100%",minHeight:26},A.createElement(Ue,{flexDirection:"column",width:"30%",maxWidth:40,borderStyle:"round",borderColor:F==="categories"?Be.border:Be.borderMuted,padding:1,paddingY:0},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:F==="categories"?Be.text:Be.textDim,bold:!0,underline:!0},"CATEGORIES")),Eo.map((he,C)=>{let P=L===C,ke=he.id==="exit";return A.createElement(Ue,{key:he.id,marginTop:ke?15:0,backgroundColor:P?F==="categories"?Be.highlightBg:Be.cardBg:void 0,paddingX:1},A.createElement(Z,{color:P&&F==="categories"?Be.text:Be.textDim,bold:P},P?"\u276F ":" ",he.label))})),A.createElement(Ue,{flexDirection:"column",flexGrow:1,borderStyle:"round",borderColor:F==="items"?Be.border:Be.borderMuted,paddingX:1,marginLeft:1,paddingY:0},A.createElement(Ue,{marginBottom:1},A.createElement(Z,{color:F==="items"?Be.text:Be.textDim,bold:!0,underline:!0},Eo[L].label.toUpperCase().includes("EXIT")?"Runtime Information":`${Eo[L].label} Settings`)),qe.length>0?(()=>{let he=null,C=[],P=Re=>(Re||"").split(",").map($t=>$t.trim().toLowerCase()).filter(Boolean),ke=P(t.autoApproveCommands),Ve=P(t.autoDisallowCommands),ut=P(t.alwaysAskCommands),gt=[...ke,...Ve,...ut],ze=new Set(gt),oo=gn==="security"&>.length!==ze.size;return qe.forEach((Re,$t)=>{let Ht=F==="items"&&K===$t,es=Re.label.length,on=Math.max(2,38-es),ts=".".repeat(on),Tt=Gt=>gn==="security"?(Gt.value==="autoExec"||Gt.value==="externalAccess")&&Gt.status==="ON"?Be.statusOn:Be.statusOff:Gt.status?.startsWith("\u2713")?Be.statusOn:Gt.status?.startsWith("\u26A0")?Be.statusOff:Gt.status==="ON"?Be.statusOn:Gt.status==="OFF"?Be.statusOff:Be.text;Re.section&&Re.section!==he&&(he=Re.section,C.push(A.createElement(Ue,{key:`sec-hdr-${Re.section}`,marginTop:C.length>0?1:0,marginBottom:0,paddingX:1},A.createElement(Z,{color:"gray",bold:!0,underline:!0},Re.section.toUpperCase()))));let Q=Ht&&ue&&(ue==="alwaysAskCommands"&&Re.value==="alwaysAsk"||ue==="alwaysAskFiles"&&Re.value==="alwaysAskFiles"||ue==="autoApproveCommands"&&Re.value==="autoApprove"||ue==="autoDisallowCommands"&&Re.value==="autoDisallow"||ue==="customOpenAIBaseUrl"&&Re.value==="customOpenAIBaseUrl"||ue==="customOpenAIKey"&&Re.value==="customOpenAIKey"),Wn=Re.value==="alwaysAsk"||Re.value==="alwaysAskFiles"||Re.value==="autoApprove"||Re.value==="autoDisallow",os=Re.value==="parserDownload";C.push(A.createElement(Ue,{key:Re.value,flexDirection:"column"},A.createElement(Ue,{backgroundColor:Ht&&!Q?Be.highlightBg:void 0,paddingX:2},A.createElement(Z,{color:Ht?Be.text:Be.textDim,bold:Ht},Ht?"\u276F ":" ",Re.label),!Wn&&!os&&A.createElement(A.Fragment,null,A.createElement(Z,{color:"gray"},ts),A.createElement(Z,{color:Tt(Re),bold:!0},Re.value==="aiProvider"?Re.status:`[ ${Re.status} ]`))),Wn&&!Q&&Re.status!=="None"&&A.createElement(Ue,{paddingX:4,marginBottom:1},A.createElement(Z,{color:"gray"},"\u21B3 ",Re.status)),Q&&A.createElement(Ue,{flexDirection:"column",marginLeft:4,marginBottom:1},A.createElement(Ue,{paddingX:1,borderStyle:"single",borderColor:"gray",flexDirection:"row"},A.createElement(Z,{color:"gray",bold:!0},"> "," "),A.createElement(Nd,{value:oe,onChange:xe,onSubmit:async Gt=>{if(ue==="customOpenAIBaseUrl"){let at=Gt.trim().replace(/\/+$/,""),no={...t,customOpenAIBaseUrl:at};f(no),p({systemSettings:no,apiTier:g,quotas:a})}else if(ue==="customOpenAIKey"){let{saveProviderAPIKey:at}=await import("./secrets-GHW6AWRR.js");await at("c_openai",Gt.trim()),dt(no=>({...no,c_openai:!!Gt.trim()}))}else{let at={...t,[ue]:Gt.trim(),sandboxPreset:"Custom"};f(at),p({systemSettings:at,apiTier:g,quotas:a})}z(null)}})),A.createElement(Z,{color:"gray",italic:!0}," ",ue==="customOpenAIBaseUrl"?"Enter Base URL (.../v1) \u2022 Press Enter to save, Esc to cancel \u2022 Restart Required":ue==="customOpenAIKey"?"Enter API Key \u2022 Press Enter to save, Esc to cancel \u2022 Restart Required":"Comma separated \u2022 Press Enter to save, Esc to cancel"))))}),oo&&C.push(A.createElement(Ue,{key:"conflict-warning",marginTop:1,paddingX:1},A.createElement(Z,{color:Be.text,italic:!0},"* Conflicting commands will be ignored and defaulted to highest priority"))),C})():A.createElement(Ue,{paddingX:1,flexDirection:"column",width:"100%"},gn==="exit"?A.createElement(A.Fragment,null,A.createElement(Ue,{flexDirection:"column",marginBottom:1},A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"OS"," "),A.createElement(Z,{color:"gray"},"..................... "),A.createElement(Z,{color:Be.text},process.env.OS||process.platform||"N/A")),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Computer Name"," "),A.createElement(Z,{color:"gray"},".......... "),A.createElement(Z,{color:Be.text},process.env.COMPUTERNAME||process.env.HOSTNAME||"N/A")),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Processor Count"," "),A.createElement(Z,{color:"gray"},"........ "),A.createElement(Z,{color:Be.text},process.env.NUMBER_OF_PROCESSORS||"N/A")),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Node.js Version"," "),A.createElement(Z,{color:"gray"},"........ "),A.createElement(Z,{color:Be.text},"v",process.versions.node)),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"V8 Version"," "),A.createElement(Z,{color:"gray"},"...... ...... "),A.createElement(Z,{color:Be.text},"v",process.versions.v8)),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Data Directory"," "),A.createElement(Z,{color:"gray"},"......... "),go===Co?"":A.createElement(Z,{color:Be.text},go.replaceAll(vl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"),", "),A.createElement(Z,{color:Be.text},Co.replaceAll(vl.homedir(),"~").replaceAll("\\\\","/").replaceAll("\\","/"))),A.createElement(Ue,{flexDirection:"row"},A.createElement(Z,{color:Be.textDim},"Viewport"," "),A.createElement(Z,{color:"gray"},"............... "),A.createElement(Z,{color:Be.text},process.stdout.rows||"?"," rows \xD7 ",process.stdout.columns||"?"," cols ",process.stdout.columns<90?"(too small width)":"")),A.createElement(Ue,{flexDirection:"row",marginBottom:0},A.createElement(Z,{color:Be.textDim},"Memory Load"," "),A.createElement(Z,{color:"gray"},"............ "),A.createElement(Z,{color:Be.text},ge,"/",v," ",st))),A.createElement(Ue,{key:"pty-notice",paddingX:0,marginTop:0},A.createElement(Z,{color:zt?Be.statusOn:Be.warning},zt?"\u2713 Advance Interactive Terminal Supported":"\u26A0 Interactive Terminal is Limited"))):A.createElement(Z,{color:"gray",italic:!0},Eo[L].desc)))),A.createElement(Ue,{paddingX:1,marginTop:0,flexDirection:"row",justifyContent:"space-between"},A.createElement(Z,{color:"gray",italic:!0},F==="categories"?"\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure":"\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"),F==="categories"&&A.createElement(Z,{color:"gray"},Eo[L].desc)))}import io,{useState as $s,useEffect as $d}from"react";import{Box as Un,Text as xr}from"ink";import Ud from"ink-text-input";function Us({initialData:t,onSave:f,onCancel:g,theme:S="Dark"}){let w=lt(S),[p,a]=$s(0),[T,b]=$s(""),[M,N]=$s(()=>({name:t?.name||"",nickname:t?.nickname||"",instructions:t?.instructions||""})),O=[{key:"nickname",label:"Enter a Nickname: ",maxLength:20},{key:"instructions",label:"System Instructions: ",maxLength:200}],E=O[p];$d(()=>{let L=O[p].key;b((M[L]||"").slice(0,O[p].maxLength))},[p,M]);let D=L=>{L.length>E.maxLength?b(L.slice(0,E.maxLength)):b(L)},F=L=>{if(L.trim().toLowerCase()==="/cancel"){g();return}let Y=E.key,K={...M,[Y]:L.trim().slice(0,E.maxLength)};N(K),b(""),p<O.length-1?a(p+1):f(K)},$=T.length>=E.maxLength;return io.createElement(Un,{borderStyle:"round",borderColor:w.borderMuted,padding:0,marginTop:1,flexShrink:0,flexDirection:"column",width:"100%"},io.createElement(Un,{paddingX:1,marginBottom:1},io.createElement(xr,{color:w.text,bold:!0},"USER PROFILE CONFIGURATION")),io.createElement(Un,{paddingX:1,flexDirection:"column"},io.createElement(Un,null,io.createElement(xr,{color:w.text,bold:!0},E.label),io.createElement(Ud,{value:T,onChange:D,onSubmit:F})),io.createElement(Un,{marginTop:1,justifyContent:"space-between"},io.createElement(xr,{color:w.textMuted,italic:!0},"Step ",p+1," of ",O.length),io.createElement(xr,{color:$?w.warning||"yellow":w.textMuted},"[",T.length,"/",E.maxLength,"]"))),io.createElement(Un,{paddingX:1,marginTop:1},io.createElement(xr,{color:w.textMuted,italic:!0},"(Enter to submit \u2022 Type /cancel to abort)")))}import It,{useState as _s}from"react";import{Box as lo,Text as Jo,useInput as _d}from"ink";import Hd from"ink-text-input";var Xd=({question:t,options:f,onResolve:g,theme:S="Dark"})=>{let w=lt(S),[p,a]=_s(!1),[T,b]=_s(""),[M,N]=_s(0),O=!1,E=[],D=Array.isArray(f)&&f.length>0,F=t==="Agent has been running for a long time. Do you want to continue execution?";try{F&&D?E=[...f]:E=[...D?f:[],D?{id:"CUSTOM",label:"Suggest something else...",description:"Provide a custom response"}:{id:"CUSTOM",label:"Your Answer",description:""}]}catch{O=!0}_d((L,Y)=>{if(!p&&((Y.leftArrow||Y.upArrow)&&N(K=>Math.max(0,K-1)),(Y.rightArrow||Y.downArrow)&&N(K=>Math.min(E.length-1,K+1)),Y.return)){let K=E[M];K?.id==="CUSTOM"?a(!0):g(O?"Selected Nothing":K.label)}});let $=ft(2);return p?It.createElement(lo,{flexDirection:"column",borderStyle:"single",borderLeft:!1,borderRight:!1,borderTop:!1,borderBottom:!1,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,backgroundColor:w.codeBg,width:"100%"},It.createElement(lo,{paddingX:1},It.createElement(Jo,{color:w.text,bold:!0},"SUGGEST SOMETHING")),It.createElement(lo,{marginTop:1,paddingX:1},It.createElement(Jo,{italic:!0,color:w.textMuted},"Replying to: ",t)),It.createElement(lo,{marginTop:1,paddingX:1,flexDirection:"row"},It.createElement(Hd,{value:T,onChange:b,onSubmit:()=>g(T)})),It.createElement(lo,{marginTop:1,paddingX:1,marginBottom:1},It.createElement(Jo,{color:w.textMuted,italic:!0},"(Press Enter to send)"))):It.createElement(lo,{flexDirection:"column",border:!0,borderStyle:"round",borderColor:w.codeBorder,paddingLeft:2,paddingRight:0,paddingTop:1,paddingBottom:1,marginY:1,marginRight:1,width:"100%"},It.createElement(lo,{paddingX:1,marginBottom:1},It.createElement(Jo,{color:"yellow",bold:!0},F?"TURN SAFETY SYSTEM: EXECUTION LIMIT":"AGENT REQUEST: ACTION REQUIRED")),It.createElement(lo,{paddingX:1,marginBottom:1},It.createElement(Jo,{color:w.text},t)),It.createElement(lo,{flexDirection:"column",width:"100%"},E.map((L,Y)=>{let K=Y===M;return It.createElement(lo,{key:L.id,flexDirection:"column",width:"100%",backgroundColor:K?w.highlightBg:void 0,paddingX:1,marginBottom:Y===E.length-1?0:1},It.createElement(Jo,{color:K?w.text:w.textMuted,bold:K},K?"\u276F ":" ",L.label),L.description&&It.createElement(lo,{marginLeft:4},It.createElement(Jo,{color:w.textMuted,italic:!0},L.description)))})),It.createElement(lo,{paddingX:1,marginTop:1,marginBottom:1},It.createElement(Jo,{color:w.textMuted,italic:!0},"(Use Arrows to navigate, Enter to confirm)")))},Il=Xd;import dc from"gradient-string";import _t,{useState as Hs,useEffect as Gd}from"react";import{Box as Bo,Text as Zo,useInput as Wd}from"ink";function Xs({onSelect:t,onDelete:f,onClose:g,theme:S="Dark"}){let w=lt(S),[p,a]=Hs({}),[T,b]=Hs([]),[M,N]=Hs(0);Gd(()=>{(async()=>{let L=await Qo();a(L),b(Object.keys(L).sort((Y,K)=>(L[K].updatedAt||0)-(L[Y].updatedAt||0)))})()},[]),Wd(($,L)=>{if(L.escape&&g(),L.upArrow&&N(Y=>Math.max(0,Y-1)),L.downArrow&&N(Y=>Math.min(T.length-1,Y+1)),L.return&&T[M]&&t(T[M]),$==="x"&&T[M]){let Y=T[M];f(Y).then(K=>{let ce=K||{};a(ce);let ue=Object.keys(ce).sort((z,oe)=>(ce[oe]?.updatedAt||0)-(ce[z]?.updatedAt||0));b(ue),N(z=>Math.max(0,Math.min(ue.length-1,z)))})}});let O=ft(2),E=15,D=0;if(T.length>E){let $=Math.floor(E/2);D=M-$,D<0?D=0:D+E>T.length&&(D=T.length-E)}let F=T.slice(D,D+E);return _t.createElement(Bo,{flexDirection:"column",borderStyle:"round",borderColor:w.borderMuted,padding:0,width:"100%"},_t.createElement(Bo,{paddingX:1,marginBottom:1},_t.createElement(Zo,{color:w.text,bold:!0},"CHAT HISTORY: RESUME CONVERSATION")),T.length===0?_t.createElement(Bo,{paddingX:2,paddingY:1},_t.createElement(Zo,{italic:!0,color:w.textMuted},"No saved chats found.")):_t.createElement(Bo,{flexDirection:"column",width:"100%"},D>0&&_t.createElement(Bo,{paddingX:2,marginBottom:1},_t.createElement(Zo,{color:w.textMuted},"\u25B2 (+",D," more chats above)")),F.map(($,L)=>{let Y=p[$],ce=D+L===M,ue=Vd(Y?.updatedAt);return _t.createElement(Bo,{key:$,paddingX:1,backgroundColor:ce?w.highlightBg:void 0,width:"100%"},_t.createElement(Bo,{flexGrow:1},_t.createElement(Zo,{color:ce?w.text:w.textMuted,bold:ce},ce?"\u276F ":" ",(()=>{let z=oe=>(oe||"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();return Y?.name&&!Y.name.startsWith("Session")?z(Y.name):Y?.prompt?z(Y.prompt):z(Y?.name)||$})(),_t.createElement(Zo,{color:w.textMuted}," [",ue," \u2022 ",$,"]"))),ce&&_t.createElement(Bo,{flexShrink:0},_t.createElement(Zo,{color:w.danger,bold:!0},"[X] DELETE ")))}),D+E<T.length&&_t.createElement(Bo,{paddingX:2,marginTop:1},_t.createElement(Zo,{color:w.textMuted},"\u25BC (+",T.length-(D+E)," more chats below)"))),_t.createElement(Bo,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:w.borderMuted},_t.createElement(Zo,{color:w.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")))}function Vd(t){if(!t)return"N/A";let f=new Date(t);if(isNaN(f.getTime()))return"N/A";let g=T=>String(T).padStart(2,"0"),S=g(f.getMonth()+1),w=g(f.getDate()),p=g(f.getHours()),a=g(f.getMinutes());return`${S}-${w} ${p}:${a}`}import kt,{useState as Gs,useEffect as Yd}from"react";import{Box as vo,Text as bo,useInput as jd,useStdout as Kd}from"ink";function Ws({onClose:t,theme:f="Dark"}){let g=lt(f),{stdout:S}=Kd(),w=S?.columns||80,[p,a]=Gs([]),[T,b]=Gs(0),[M,N]=Gs(!0),O=()=>{let z=Dr(tr,[]);a(z);try{let xe=Ir(cn,{}).systemSettings?.memory!==!1;N(xe)}catch{N(!0)}};Yd(()=>{O()},[]),jd((z,oe)=>{if(oe.escape&&t(),oe.upArrow&&b(xe=>Math.max(0,xe-1)),oe.downArrow&&b(xe=>Math.min(p.length-1,xe+1)),z==="x"&&p.length>0){let xe=p[T].id,Ee=p.filter(_e=>_e.id!==xe);Pi(tr,Ee),a(Ee),T>=Ee.length&&Ee.length>0&&b(Ee.length-1)}});let E=(z,oe,xe)=>{if(!z)return"";let Ee=z.replace(/\[Saved on: .*?\]/g,"").replace(/\\+'/g,"'").trim(),We=`${xe?"\u276F ":" "}${oe+1}. `.length,pe=xe?22:2;return Ee.split(`
|
|
45
45
|
`).map((ye,ae)=>{let Ke=ae===0,He=Math.max(10,w-4-(Ke?We:3)-pe),j=Math.max(10,w-4-3-pe),ne=ye.split(/(\s+)/),ee=[],de="";if(ne.forEach(Me=>{if(Me.length===0)return;let Le=ee.length===0?He:j;de.length+Me.length>Le?de.trim().length>0?(ee.push(de.trimEnd()),de=Me):(ee.push(Me.substring(0,Le)),de=Me.substring(Le)):de+=Me}),de.trimEnd().length>0&&ee.push(de.trimEnd()),ee.length===0)return"";let Se=ee.join(`
|
|
46
46
|
`);return Ke?Se:" "+Se}).join(`
|
|
47
47
|
`)},D=4*1024*2,F=p.reduce((z,oe)=>z+(oe.memory?.length||0),0),$=Math.min(100,Math.round(F/D*100)),L=12,Y=Math.round($/100*L),K="\u2588".repeat(Y)+"\u2591".repeat(Math.max(0,L-Y)),ce=()=>$<50?g.textMuted:$<90?g.warning:g.danger,ue=ft(2);return kt.createElement(vo,{flexDirection:"column",borderStyle:"round",borderColor:g.borderMuted,padding:0,width:"100%"},kt.createElement(vo,{paddingX:1,marginBottom:1,justifyContent:"space-between"},kt.createElement(bo,{color:g.text,bold:!0},"SAVED MEMORIES"),kt.createElement(vo,null,kt.createElement(bo,{color:g.textMuted},"Vault: "),kt.createElement(bo,{color:ce()},K),kt.createElement(bo,{color:g.text,bold:!0}," ",$,"%"))),!M&&p.length>0?kt.createElement(vo,{paddingX:2,paddingY:1},kt.createElement(bo,{italic:!0,color:g.textMuted},"Memory is currently Off...")):p.length===0?kt.createElement(vo,{paddingX:2,paddingY:1},kt.createElement(bo,{italic:!0,color:g.textMuted},M?"Learning...":"Memory not available...")):kt.createElement(vo,{flexDirection:"column"},p.map((z,oe)=>{let xe=oe===T;return kt.createElement(vo,{key:z.id,paddingX:1,backgroundColor:xe?g.highlightBg:void 0,width:"100%"},kt.createElement(vo,{flexGrow:1},kt.createElement(bo,{color:xe?g.text:g.textMuted,bold:xe},xe?"\u276F ":" ",oe+1,". ",E(z.memory,oe,xe))),xe&&kt.createElement(vo,{flexShrink:0},kt.createElement(bo,{color:g.textMuted,dimColor:!0}," [",kt.createElement(bo,{italic:!0},z.score),"] "),kt.createElement(bo,{color:g.danger,bold:!0},"[X] WIPE ")))})),kt.createElement(vo,{marginTop:1,paddingX:1,borderStyle:"single",borderLeft:!1,borderRight:!1,borderBottom:!1,borderColor:g.borderMuted},kt.createElement(bo,{color:g.textMuted,italic:!0},"\u2191\u2193 navigate \u2022 x wipe memory \u2022 Esc close")))}import yt,{useState as Kr,useEffect as kl}from"react";import{Box as Ro,Text as Xt}from"ink";import{spawn as Al}from"child_process";var Ll=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],qd=({latest:t,current:f,settings:g,theme:S="Dark",onClose:w,onUpdateSettings:p,onSuccess:a})=>{let T=lt(S),[b,M]=Kr("initializing"),[N,O]=Kr(""),[E,D]=Kr(null),[F,$]=Kr(0);if(kl(()=>{let L=setInterval(()=>{$(Y=>(Y+1)%1e3)},33);return()=>clearInterval(L)},[]),kl(()=>{let L;return(async()=>{let K=g?.updateManager||"npm";if(!g?.updateManager){p();return}let ce="";K==="pnpm"?ce=`pnpm add -g fluxflow-cli@${t}`:K==="bun"?ce=`bun add -g fluxflow-cli@${t}`:K==="yarn"?ce=`yarn global add fluxflow-cli@${t}`:K==="custom"?ce=g.customUpdateCommand:ce=`npm install -g fluxflow-cli@${t}`,M("downloading"),O(`Running: ${ce}...`);let ue=process.platform==="win32",z=xe=>new Promise(Ee=>{let _e=ue?xe?"powershell.exe":"cmd.exe":process.env.SHELL||"bash",We=ue?xe?["-NoProfile","-Command",ce]:["/c",ce]:["-c",ce],pe=ye=>{let Ke=ye.toString().replace(/\x1B\[[0-?]*[ -/]*[@-~]|\x1B\][^\x07\x1B]*[\x07\x1B]|\b|\x07/g,"").replace(/\r/g,"").trim();Ke&&O(He=>{let j=He.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Ss}from"./chunk-FAEB3V5R.js";import{a as bo}from"./chunk-QOT4BYHM.js";import{a as Kt}from"./chunk-56EJGQU3.js";import{c as Ci,g as Ri,h as ys,i as bs}from"./chunk-2VV5ZE53.js";import{a as xs,c as ws}from"./chunk-
|
|
1
|
+
import{a as Ss}from"./chunk-FAEB3V5R.js";import{a as bo}from"./chunk-QOT4BYHM.js";import{a as Kt}from"./chunk-56EJGQU3.js";import{c as Ci,g as Ri,h as ys,i as bs}from"./chunk-2VV5ZE53.js";import{a as xs,c as ws}from"./chunk-MQCO3GXM.js";import{a as vi,g as ks}from"./chunk-HOZQBBAO.js";import{a as Ts}from"./chunk-T4ZG2WCV.js";import{a as Vo}from"./chunk-3JI2CRXK.js";import{a as G}from"./chunk-Y5JU726N.js";import{b as Ai}from"./chunk-ET66XVIM.js";import{f as yo,l as Rt,n as ut,p as Ei,q as ps}from"./chunk-K4AZXTU6.js";import{a as po}from"./chunk-FSE4BZZZ.js";import{l as it,m as Ko,q as se}from"./chunk-PRTGV2R4.js";import{c as Ct,d as eo,e as jo}from"./chunk-L3W2X74K.js";import{a as On,b as Wo,d as An,e as Go,k as Kn,l as Ho,m as ki,r as Ti,w as ho,x as mo,y as ms}from"./chunk-M2ULCOL3.js";import{GoogleGenAI as Gr,ThinkingLevel as He,HarmBlockThreshold as Ln,HarmCategory as $n}from"@google/genai";var As=(e=!0,n=!0)=>`
|
|
2
2
|
To use tools, must output exactly '[action:ActionName(arg1="value1")]' structured string in chat response \u2190 no exception
|
|
3
3
|
|
|
4
4
|
-- Chat Management Tools --
|
|
@@ -556,7 +556,7 @@ ${As(n,t)}
|
|
|
556
556
|
=== END SYSTEM PROMPT ===${e?`
|
|
557
557
|
|
|
558
558
|
-- current saved user memories --
|
|
559
|
-
${e}`:""}`.trim();var ar=()=>import("./web_search-HACFAHXR.js").then(e=>e.web_search),lr=()=>import("./web_scrape-KBKSNVBI.js").then(e=>e.web_scrape),cr=()=>import("./memory-4DXO4K5C.js").then(e=>e.memory),dr=()=>import("./chat-RLEHK3MX.js").then(e=>e.chat),fr=()=>import("./view_file-TZD6DAER.js").then(e=>e.view_file),ur=()=>import("./write_file-2ZFCDYSW.js").then(e=>e.write_file),gr=()=>import("./update_file-OQMKLO6R.js").then(e=>e.update_file),hr=()=>import("./exec_command-KLASTN6U.js").then(e=>e.exec_command),mr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ui=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),pr=()=>import("./write_pdf-E5HQYOTR.js").then(e=>e.write_pdf),yr=()=>import("./write_docx-M5RMUI4W.js").then(e=>e.write_docx),Jo=()=>import("./search_keyword-G3PCZR3C.js").then(e=>e.search_keyword),br=()=>import("./generate_image-75IV5P3L.js").then(e=>e.generate_image),Qo=()=>import("./saveSummary-ZSJ2UKLG.js").then(e=>e.saveSummary),Co=()=>import("./addMemScore-76XLEW3K.js").then(e=>e.addMemScore),xr=()=>import("./file_map-T5FHB3F6.js").then(e=>e.file_map),Zo=()=>import("./todo-KQCKHQBJ.js").then(e=>e.todo),wr=()=>import("./invokeSync-E4SXIRIH.js").then(e=>e.invokeSync),Sa=()=>import("./invoke-P3ZC5CJV.js").then(e=>e.invoke),Sr=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ka=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),kr=()=>import("./emergency_rollback-NXD2JKBG.js").then(e=>e.emergency_rollback),Ro=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),vo=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),ei=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),ti=()=>import("./computer_action-2RYMIFAM.js").then(e=>e.computer_action),Tr=()=>import("./click-B4ZRHV4Z.js").then(e=>e.click),Ar=()=>import("./drag-RNGTIO2V.js").then(e=>e.drag),Er=()=>import("./scroll-YSFTTROP.js").then(e=>e.scroll),Wi=()=>import("./keyboard_typing-PCW3ISET.js").then(e=>e.keyboard_typing),Gi=()=>import("./key_press-3VU6SHNQ.js").then(e=>e.key_press),Hi=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),ni=()=>import("./find_file-LZR7NET3.js").then(e=>e.find_file),Cr=()=>import("./wait-TJR6LAR4.js").then(e=>e.wait),Rr={web_search:ar,web_scrape:lr,memory:cr,chat:dr,view_file:fr,write_file:ur,update_file:gr,exec_command:hr,read_folder:mr,write_pdf:pr,write_docx:yr,search_keyword:Jo,generate_image:br,saveSummary:Qo,addMemScore:Co,file_map:xr,todo:Zo,Todo:Zo,goal:Zo,Goal:Zo,invokeSync:wr,invoke:Sa,getProgress:Sr,cancel:ka,awaitSubagent:Ro,answerSubagent:vo,steerSubagent:ei,computer_action:ti,computer_use:ti,ComputerAction:ti,ComputerUse:ti,click:Tr,Click:Tr,drag:Ar,Drag:Ar,scroll:Er,Scroll:Er,keyboard_typing:Wi,KeyboardTyping:Wi,keyboardtyping:Wi,key_press:Gi,KeyPress:Gi,keypress:Gi,recapture_screen:Hi,RecaptureScreen:Hi,recapturescreen:Hi,invoke_sync:wr,get_progress:Sr,await_subagent:Ro,answer_subagent:vo,steer_subagent:ei,steer:ei,Steer:ei,ask:Ui,Ask:Ui,AskUser:Ui,WebSearch:ar,WebScrape:lr,ReadFile:fr,ReadFolder:mr,WriteFile:ur,PatchFile:gr,WritePDF:pr,WriteDoc:yr,Run:hr,SearchKeyword:Jo,CodeSearch:Jo,code_search:Jo,Memory:cr,Chat:dr,GenerateImage:br,saveSumary:Qo,SaveSummary:Qo,SaveSumary:Qo,add_mem_score:Co,AddMemScore:Co,addMemoryScore:Co,AddMemoryScore:Co,FileMap:xr,answer:vo,Answer:vo,AnswerSubagent:vo,await:Ro,Await:Ro,AwaitSubagent:Ro,EmergencyRollback:kr,emergency_rollback:kr,find_file:ni,findFile:ni,FindFile:ni,findfile:ni,wait:Cr,Wait:Cr},_o=async(e,n,t={})=>{let i=t.mode?t.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(b=>o.includes(b))||o==="ask",u=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(b=>o.includes(b));if(!d){if(i==="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(i==="icu"){if(!u)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 ${t.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let m=Rr[e];if(!m){let b=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],h={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"},f=o.replace(/[^a-z0-9]/g,""),s=h[f]||null;if(!s){let T=0,ue=R=>{let F=new Set;for(let H=0;H<R.length-1;H++)F.add(R.slice(H,H+2));return F},y=ue(f);for(let R of b){let F=R.toLowerCase().replace(/[^a-z0-9]/g,"");if(f===F){s=R;break}let H=0;(F.includes(f)||f.includes(F))&&(H+=.6);let $=ue(F),A=0;for(let Se of y)$.has(Se)&&A++;let he=2*A/(y.size+$.size||1);H=Math.max(H,he),H>T&&H>=.35&&(T=H,s=R)}}let g=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await m())(n,t)}catch(b){let h=b instanceof Error?b.message:String(b);return`ERROR: Execution failed for [${e}]: ${h}`}};var oi=e=>{if(!e||typeof e!="string")return!1;let n=e.trim().toLowerCase();return Object.keys(Rr).some(t=>t.toLowerCase()===n)};import U from"path";import we from"fs";import Ta from"gradient-string";var vr=["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 _r=["Beware the phantom processes.","A ghost in the shell has taken the wheel.","Blowing on the haunted cartridge...","Seven minutes in Raccoon City.","Wind's howling... in the terminal fans.","Slender Man was spotted in line 404.","The cake is a lie. The curse is real.","Don't look behind the server rack.","Exorcising memory leaks at 3 AM.","Pyramid Head reorganized your commit history.","It's dangerous to go alone! Take this flashlight.","YOU DIED. Respawning terminal session...","The Necronomicon evaluated to true.","Something wicked this way compiles.","Haunting your localhost with good vibes.","A full moon has risen over Git main.","Double, double toil and trouble; code fire burn.","Clickers heard in the directory tree.","Checking camera 2B for rogue animatronics.","The call is coming from inside the container.","Isaac Clarke is stomping on stubborn bugs.","Luigi vacuumed the ghosts out of RAM.","Trick or treat, give me clean code to greet.","Whispering incantations to the garbage collector.","Klaatu barada necktie... close enough.","Resurrecting deprecated APIs from the crypt.","The headless horseman forgot the return statement.","Castlevania whip cracking against network latency.","Slime mold crawling through the motherboard.","Carving a pixelated pumpkin into terminal history.","Burying undefined pointers in the pet sematary.","Spilling pumpkin spice on the CPU.","A vampire bat is draining system battery life.","Don't fall asleep at the keyboard tonight.","Silent Hill sirens sounding in the console.","Poltergeists rearranging terminal tabs.","Lighting the Black Flame Candle for autoExec.","Dusting cobwebs off legacy dependencies.","Here's Johnny! ...just checking build health.","Blood, sweat, and zero warnings.","The spirit box whispers: 'GIT PUSH FORCE'.","They're heeeere... in the stack trace.","It's alive! IT'S ALIVEEEE!","No merge conflicts in the graveyard.","Frankenstein's monster patched this logic.","Surviving Five Nights at Flux Flow.","Doom Slayer loading buckshot into cache.","The grim reaper spared your unused imports.","Candy corn lodged in mechanical switches.","May your latency be low and your crypt be quiet."];var Ir=[{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"]}],to={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var ii=null;var si=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(ii||(ii=Ir[Math.floor(Math.random()*Ir.length)]),n={...ii,id:"Mystery"}):(ii=null,to[e]?n=to[e]:e==="Halloween"?n=to.Spookfest:e==="GitHub"?n=to["GitHub Dark"]:e==="Transparent"?n=to["Transparent Dark"]:n=to.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan",i=n.toolFeedbackAnsi||"\x1B[95m";return{...n,codeText:t,toolFeedbackAnsi:i}};var Aa=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",gc=(e=2)=>{let n=Aa();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},Mr=new Date,Io=Mr.getMonth(),Mo=Mr.getDate(),Ea=Io===9&&Mo>=15||Io===10&&Mo<=1,ji=null;(process.env.SPOOKFEST==="true"||Ea)&&(ji=await import("./halloween-MX3VNQRW.js"));var hc=(e="...",n="Loading...",t="Dark")=>{let i=si(t),o=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let H=jo(Wo,{})?.systemSettings?.customOpenAIBaseUrl;H&&(o=H)}catch{}let r=i.logoTextAnsi,d=i.logoBodyAnsi,a=i.logoMutedAnsi,u="\x1B[0m",m=[" \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 "],b=t==="Spookfest"||i.id==="Spookfest"||t==="Halloween"||i.id==="Halloween",h=Io===9&&Mo>=15||Io===10&&Mo<=1,f=b&&h||process.env.SPOOKFEST==="true"&&b,s=m;if(f&&ji){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:F,halloweenBat:H,halloweenArtUser:$}=ji;s=Math.random()>.9&&Io===9&&Mo>=30?H:Math.random()>.5?F:$}else process.env.HALLOWEEN_EEGG="false";let g=f?_r:vr,T=g[Math.floor(Math.random()*g.length)],ue=i.logoGradient||["#0077ff","#ff00ff"],y=Ta(ue).multiline(s.join(`
|
|
559
|
+
${e}`:""}`.trim();var ar=()=>import("./web_search-HACFAHXR.js").then(e=>e.web_search),lr=()=>import("./web_scrape-KBKSNVBI.js").then(e=>e.web_scrape),cr=()=>import("./memory-4DXO4K5C.js").then(e=>e.memory),dr=()=>import("./chat-RLEHK3MX.js").then(e=>e.chat),fr=()=>import("./view_file-TZD6DAER.js").then(e=>e.view_file),ur=()=>import("./write_file-2ZFCDYSW.js").then(e=>e.write_file),gr=()=>import("./update_file-OQMKLO6R.js").then(e=>e.update_file),hr=()=>import("./exec_command-A5JWE55Q.js").then(e=>e.exec_command),mr=()=>import("./read_folder-EI2CNHNS.js").then(e=>e.read_folder),Ui=()=>import("./ask_user-K2DLZF6H.js").then(e=>e.ask_user),pr=()=>import("./write_pdf-E5HQYOTR.js").then(e=>e.write_pdf),yr=()=>import("./write_docx-M5RMUI4W.js").then(e=>e.write_docx),Jo=()=>import("./search_keyword-SD6Q3UZE.js").then(e=>e.search_keyword),br=()=>import("./generate_image-75IV5P3L.js").then(e=>e.generate_image),Qo=()=>import("./saveSummary-ZSJ2UKLG.js").then(e=>e.saveSummary),Co=()=>import("./addMemScore-76XLEW3K.js").then(e=>e.addMemScore),xr=()=>import("./file_map-T5FHB3F6.js").then(e=>e.file_map),Zo=()=>import("./todo-KQCKHQBJ.js").then(e=>e.todo),wr=()=>import("./invokeSync-WUKJNYGQ.js").then(e=>e.invokeSync),Sa=()=>import("./invoke-7JAD5QTF.js").then(e=>e.invoke),Sr=()=>import("./getProgress-A2TW34Q7.js").then(e=>e.getProgress),ka=()=>import("./cancel-F3ZOEBKW.js").then(e=>e.cancel),kr=()=>import("./emergency_rollback-NXD2JKBG.js").then(e=>e.emergency_rollback),Ro=()=>import("./awaitSubagent-JKQ2EHVY.js").then(e=>e.awaitSubagent),vo=()=>import("./answerSubagent-BPNNJXPC.js").then(e=>e.answerSubagent),ei=()=>import("./steerSubagent-UETXH2CB.js").then(e=>e.steerSubagent),ti=()=>import("./computer_action-2RYMIFAM.js").then(e=>e.computer_action),Tr=()=>import("./click-B4ZRHV4Z.js").then(e=>e.click),Ar=()=>import("./drag-RNGTIO2V.js").then(e=>e.drag),Er=()=>import("./scroll-YSFTTROP.js").then(e=>e.scroll),Wi=()=>import("./keyboard_typing-PCW3ISET.js").then(e=>e.keyboard_typing),Gi=()=>import("./key_press-3VU6SHNQ.js").then(e=>e.key_press),Hi=()=>import("./recapture_screen-PPT2E3CK.js").then(e=>e.recapture_screen),ni=()=>import("./find_file-LZR7NET3.js").then(e=>e.find_file),Cr=()=>import("./wait-TJR6LAR4.js").then(e=>e.wait),Rr={web_search:ar,web_scrape:lr,memory:cr,chat:dr,view_file:fr,write_file:ur,update_file:gr,exec_command:hr,read_folder:mr,write_pdf:pr,write_docx:yr,search_keyword:Jo,generate_image:br,saveSummary:Qo,addMemScore:Co,file_map:xr,todo:Zo,Todo:Zo,goal:Zo,Goal:Zo,invokeSync:wr,invoke:Sa,getProgress:Sr,cancel:ka,awaitSubagent:Ro,answerSubagent:vo,steerSubagent:ei,computer_action:ti,computer_use:ti,ComputerAction:ti,ComputerUse:ti,click:Tr,Click:Tr,drag:Ar,Drag:Ar,scroll:Er,Scroll:Er,keyboard_typing:Wi,KeyboardTyping:Wi,keyboardtyping:Wi,key_press:Gi,KeyPress:Gi,keypress:Gi,recapture_screen:Hi,RecaptureScreen:Hi,recapturescreen:Hi,invoke_sync:wr,get_progress:Sr,await_subagent:Ro,answer_subagent:vo,steer_subagent:ei,steer:ei,Steer:ei,ask:Ui,Ask:Ui,AskUser:Ui,WebSearch:ar,WebScrape:lr,ReadFile:fr,ReadFolder:mr,WriteFile:ur,PatchFile:gr,WritePDF:pr,WriteDoc:yr,Run:hr,SearchKeyword:Jo,CodeSearch:Jo,code_search:Jo,Memory:cr,Chat:dr,GenerateImage:br,saveSumary:Qo,SaveSummary:Qo,SaveSumary:Qo,add_mem_score:Co,AddMemScore:Co,addMemoryScore:Co,AddMemoryScore:Co,FileMap:xr,answer:vo,Answer:vo,AnswerSubagent:vo,await:Ro,Await:Ro,AwaitSubagent:Ro,EmergencyRollback:kr,emergency_rollback:kr,find_file:ni,findFile:ni,FindFile:ni,findfile:ni,wait:Cr,Wait:Cr},_o=async(e,n,t={})=>{let i=t.mode?t.mode.toLowerCase():"flux",o=e.toLowerCase(),d=["memory","chat","savesummary","addmemscore","add_mem_score","ask","web_search","web_scrape","await","wait"].some(b=>o.includes(b))||o==="ask",u=["click","drag","scroll","keyboardtyping","keyboard_typing","keypress","key_press","recapturescreen","recapture_screen","computer","wait"].some(b=>o.includes(b));if(!d){if(i==="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(i==="icu"){if(!u)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 ${t.mode||"Flux"} mode. Tell user to switch (\`/mode flow\`) for document generation.`}let m=Rr[e];if(!m){let b=["ReadFile","ReadFolder","FindFile","PatchFile","WriteFile","CodeSearch","Run","Goal","AskUser","WebSearch","WebScrape","WritePDF","WriteDoc","Click","Drag","Scroll","KeyboardTyping","KeyPress","RecaptureScreen","Wait","Invoke","InvokeSync","Await","GetProgress","Steer","Cancel","EmergencyRollback","Chat","Memory"],h={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"},f=o.replace(/[^a-z0-9]/g,""),s=h[f]||null;if(!s){let T=0,ue=R=>{let F=new Set;for(let H=0;H<R.length-1;H++)F.add(R.slice(H,H+2));return F},y=ue(f);for(let R of b){let F=R.toLowerCase().replace(/[^a-z0-9]/g,"");if(f===F){s=R;break}let H=0;(F.includes(f)||f.includes(F))&&(H+=.6);let $=ue(F),A=0;for(let Se of y)$.has(Se)&&A++;let he=2*A/(y.size+$.size||1);H=Math.max(H,he),H>T&&H>=.35&&(T=H,s=R)}}let g=s?` Do you mean '${s}'?`:"";return`ERROR: Action [${e}] not found in registry.${g}`}try{return await(await m())(n,t)}catch(b){let h=b instanceof Error?b.message:String(b);return`ERROR: Execution failed for [${e}]: ${h}`}};var oi=e=>{if(!e||typeof e!="string")return!1;let n=e.trim().toLowerCase();return Object.keys(Rr).some(t=>t.toLowerCase()===n)};import U from"path";import we from"fs";import Ta from"gradient-string";var vr=["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 _r=["Beware the phantom processes.","A ghost in the shell has taken the wheel.","Blowing on the haunted cartridge...","Seven minutes in Raccoon City.","Wind's howling... in the terminal fans.","Slender Man was spotted in line 404.","The cake is a lie. The curse is real.","Don't look behind the server rack.","Exorcising memory leaks at 3 AM.","Pyramid Head reorganized your commit history.","It's dangerous to go alone! Take this flashlight.","YOU DIED. Respawning terminal session...","The Necronomicon evaluated to true.","Something wicked this way compiles.","Haunting your localhost with good vibes.","A full moon has risen over Git main.","Double, double toil and trouble; code fire burn.","Clickers heard in the directory tree.","Checking camera 2B for rogue animatronics.","The call is coming from inside the container.","Isaac Clarke is stomping on stubborn bugs.","Luigi vacuumed the ghosts out of RAM.","Trick or treat, give me clean code to greet.","Whispering incantations to the garbage collector.","Klaatu barada necktie... close enough.","Resurrecting deprecated APIs from the crypt.","The headless horseman forgot the return statement.","Castlevania whip cracking against network latency.","Slime mold crawling through the motherboard.","Carving a pixelated pumpkin into terminal history.","Burying undefined pointers in the pet sematary.","Spilling pumpkin spice on the CPU.","A vampire bat is draining system battery life.","Don't fall asleep at the keyboard tonight.","Silent Hill sirens sounding in the console.","Poltergeists rearranging terminal tabs.","Lighting the Black Flame Candle for autoExec.","Dusting cobwebs off legacy dependencies.","Here's Johnny! ...just checking build health.","Blood, sweat, and zero warnings.","The spirit box whispers: 'GIT PUSH FORCE'.","They're heeeere... in the stack trace.","It's alive! IT'S ALIVEEEE!","No merge conflicts in the graveyard.","Frankenstein's monster patched this logic.","Surviving Five Nights at Flux Flow.","Doom Slayer loading buckshot into cache.","The grim reaper spared your unused imports.","Candy corn lodged in mechanical switches.","May your latency be low and your crypt be quiet."];var Ir=[{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"]}],to={Dark:{id:"Dark",name:"Dark (Default)",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",textExclusive:"#B5B8D9",textMutedExclusive:"#D4DEE7",border:"white",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#1e1e1e",highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:"#1a1a1a",codeBorder:"#444444",userMsgBg:"#444444",userMsgBorder:"#444444",userMsgText:"white",diffRemovalBg:"#250808",diffAdditionBg:"#072410",diffRemovalText:"#885555",diffAdditionText:"#558866",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#5a1818",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#185a25",diffRemovalNum:"#d96868",diffAdditionNum:"#68d98c",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},Light:{id:"Light",name:"Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"black",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:"#e5e5e5",highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:"#e8e8e8",codeBorder:"#b0b0b0",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:"#fce8e8",diffAdditionBg:"#e6f9e6",diffRemovalText:"#661111",diffAdditionText:"#115511",diffRemovalHighlightColor:"#440000",diffRemovalHighlightBg:"#f8b4b4",diffAdditionHighlightColor:"#003300",diffAdditionHighlightBg:"#a6ebad",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Dark":{id:"GitHub Dark",name:"GitHub Dark",text:"#c9d1d9",textMuted:"#8b949e",textDim:"#6e7681",textInverted:"#0d1117",border:"#30363d",borderMuted:"#30363d",borderDim:"#21262d",bg:void 0,cardBg:"#161b22",highlightBg:"#21262d",activeBg:"#30363d",inputBg:"#21262d",inputBorder:"#21262d",inputText:"#c9d1d9",inputPlaceholder:"#8b949e",inputPrompt:"#58a6ff",codeBg:"#0d1117",codeBorder:"#30363d",userMsgBg:"#21262d",userMsgBorder:"#21262d",userMsgText:"#c9d1d9",diffRemovalBg:"#3c1e1e",diffAdditionBg:"#11381e",diffRemovalText:"#f85149",diffAdditionText:"#3fb950",diffRemovalHighlightColor:"#ff7b72",diffRemovalHighlightBg:"#701c1c",diffAdditionHighlightColor:"#56d364",diffAdditionHighlightBg:"#116329",diffRemovalNum:"#f85149",diffAdditionNum:"#3fb950",diffRemovalPrefix:"#f85149",diffAdditionPrefix:"#3fb950",primary:"#c9d1d9",secondary:"#58a6ff",accent:"#bc8cff",success:"#3fb950",warning:"#d29922",danger:"#f85149",info:"#58a6ff",statusOn:"#58a6ff",statusOff:"#8b949e",logoTextAnsi:"\x1B[1;36m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#2ea043","#56d364"],toolFeedbackAnsi:"\x1B[95m"},"GitHub Light":{id:"GitHub Light",name:"GitHub Light",text:"#24292f",textMuted:"#57606a",textDim:"#6e7781",textInverted:"#ffffff",border:"#d0d7de",borderMuted:"#d0d7de",borderDim:"#e1e4e8",bg:void 0,cardBg:"#f6f8fa",highlightBg:"#eaeef2",activeBg:"#d0d7de",inputBg:"#eaeef2",inputBorder:"#eaeef2",inputText:"#24292f",inputPlaceholder:"#57606a",inputPrompt:"#0969da",codeBg:"#ffffff",codeBorder:"#d0d7de",userMsgBg:"#eaeef2",userMsgBorder:"#eaeef2",userMsgText:"#24292f",diffRemovalBg:"#ffebe9",diffAdditionBg:"#e6ffec",diffRemovalText:"#cf222e",diffAdditionText:"#1a7f37",diffRemovalHighlightColor:"#82071e",diffRemovalHighlightBg:"#ffc1c0",diffAdditionHighlightColor:"#116329",diffAdditionHighlightBg:"#acf2bd",diffRemovalNum:"#cf222e",diffAdditionNum:"#1a7f37",diffRemovalPrefix:"#cf222e",diffAdditionPrefix:"#1a7f37",primary:"#24292f",secondary:"#0969da",accent:"#8250df",success:"#1a7f37",warning:"#9a6700",danger:"#cf222e",info:"#0969da",statusOn:"#0969da",statusOff:"#57606a",logoTextAnsi:"\x1B[1;34m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#1a7f37","#2da44e"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Dark":{id:"Transparent Dark",name:"Transparent Dark",text:"white",textMuted:"gray",textDim:"grey",textInverted:"black",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#2a2a2a",activeBg:"#3a3a3a",inputBg:"#555555",inputBorder:"#555555",inputText:"white",inputPlaceholder:"#cccccc",inputPrompt:"white",codeBg:void 0,codeBorder:"gray",userMsgBg:"#555555",userMsgBorder:"#555555",userMsgText:"white",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#ff6666",diffAdditionText:"#66ff66",diffRemovalHighlightColor:"#ff3333",diffRemovalHighlightBg:"#3a1414",diffAdditionHighlightColor:"#33ff66",diffAdditionHighlightBg:"#143a14",diffRemovalNum:"#ff6666",diffAdditionNum:"#66ff66",diffRemovalPrefix:"#ff4d4d",diffAdditionPrefix:"#4dff88",primary:"white",secondary:"cyan",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"white",statusOff:"gray",logoTextAnsi:"\x1B[1;37m",logoBodyAnsi:"\x1B[37m",logoMutedAnsi:"\x1B[90m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Transparent Light":{id:"Transparent Light",name:"Transparent Light",text:"black",textMuted:"gray",textDim:"grey",textInverted:"white",border:"gray",borderMuted:"gray",borderDim:"grey",bg:void 0,cardBg:void 0,highlightBg:"#d4d4d4",activeBg:"#c0c0c0",inputBg:"#d0d0d0",inputBorder:"#d0d0d0",inputText:"black",inputPlaceholder:"#555555",inputPrompt:"black",codeBg:void 0,codeBorder:"gray",userMsgBg:"#d0d0d0",userMsgBorder:"#d0d0d0",userMsgText:"black",diffRemovalBg:void 0,diffAdditionBg:void 0,diffRemovalText:"#c02020",diffAdditionText:"#188028",diffRemovalHighlightColor:"#800000",diffRemovalHighlightBg:"#f5d0d0",diffAdditionHighlightColor:"#004000",diffAdditionHighlightBg:"#cceccc",diffRemovalNum:"#c02020",diffAdditionNum:"#188028",diffRemovalPrefix:"#d01010",diffAdditionPrefix:"#109020",primary:"black",secondary:"blue",accent:"magenta",success:"green",warning:"yellow",danger:"red",info:"blue",statusOn:"black",statusOff:"gray",logoTextAnsi:"\x1B[1;30m",logoBodyAnsi:"\x1B[30m",logoMutedAnsi:"\x1B[38;5;244m",logoGradient:["#0077ff","#ff00ff"],toolFeedbackAnsi:"\x1B[95m"},"Synthwave 84":{id:"Synthwave 84",name:"Synthwave 84",text:"#fdfdfd",textMuted:"#a08eb7",textDim:"#705c8a",textInverted:"#1a1025",textExclusive:"#e3dcf0",textMutedExclusive:"#b9abc9",border:"#fc28a8",borderMuted:"#a21568",borderDim:"#5c0a3a",bg:void 0,cardBg:"#261b38",highlightBg:"#35254d",activeBg:"#4c3570",inputBg:"#35254d",inputBorder:"#35254d",inputText:"#fdfdfd",inputPlaceholder:"#a08eb7",inputPrompt:"#03e8fc",codeBg:"#1e142b",codeBorder:"#a21568",userMsgBg:"#35254d",userMsgBorder:"#35254d",userMsgText:"#fdfdfd",diffRemovalBg:"#471434",diffAdditionBg:"#144743",diffRemovalText:"#ff4081",diffAdditionText:"#00e5ff",diffRemovalHighlightColor:"#ff79a1",diffRemovalHighlightBg:"#6b1e4e",diffAdditionHighlightColor:"#66f5ff",diffAdditionHighlightBg:"#1e6b65",diffRemovalNum:"#ff4081",diffAdditionNum:"#00e5ff",diffRemovalPrefix:"#ff79a1",diffAdditionPrefix:"#66f5ff",primary:"#fdfdfd",secondary:"#03e8fc",accent:"#fc28a8",success:"#00e5ff",warning:"#ffc107",danger:"#ff4081",info:"#b388ff",statusOn:"#03e8fc",statusOff:"#a08eb7",logoTextAnsi:"\x1B[1;35m",logoBodyAnsi:"\x1B[35m",logoMutedAnsi:"\x1B[90m",logoGradient:["#fc28a8","#03e8fc"],toolFeedbackAnsi:"\x1B[38;2;3;232;252m"},"Forest Sprite":{id:"Forest Sprite",name:"Forest Sprite",text:"#d6e6d1",textMuted:"#95b38d",textDim:"#628059",textInverted:"#161c14",textExclusive:"#eaf2e8",textMutedExclusive:"#a9c7a2",border:"#74a862",borderMuted:"#477038",borderDim:"#2b4720",bg:void 0,cardBg:"#1f291c",highlightBg:"#2a3826",activeBg:"#3a4d35",inputBg:"#2a3826",inputBorder:"#2a3826",inputText:"#d6e6d1",inputPlaceholder:"#95b38d",inputPrompt:"#8feb73",codeBg:"#161e14",codeBorder:"#477038",userMsgBg:"#2a3826",userMsgBorder:"#2a3826",userMsgText:"#d6e6d1",diffRemovalBg:"#3b231c",diffAdditionBg:"#203b1c",diffRemovalText:"#db6242",diffAdditionText:"#59cc3f",diffRemovalHighlightColor:"#f0896c",diffRemovalHighlightBg:"#5c362a",diffAdditionHighlightColor:"#80e368",diffAdditionHighlightBg:"#305929",diffRemovalNum:"#db6242",diffAdditionNum:"#59cc3f",diffRemovalPrefix:"#f0896c",diffAdditionPrefix:"#80e368",primary:"#d6e6d1",secondary:"#8feb73",accent:"#e69835",success:"#59cc3f",warning:"#e69835",danger:"#db6242",info:"#73b4eb",statusOn:"#8feb73",statusOff:"#95b38d",logoTextAnsi:"\x1B[1;32m",logoBodyAnsi:"\x1B[32m",logoMutedAnsi:"\x1B[90m",logoGradient:["#8feb73","#e69835"],toolFeedbackAnsi:"\x1B[38;2;143;235;115m"},Spookfest:{id:"Spookfest",name:"Spookfest \u{1F383}",text:"#ffeedd",textMuted:"#e09858",textDim:"#a6622b",textInverted:"#0d0702",textExclusive:"#fff3e6",textMutedExclusive:"#d4a276",border:"#ff7518",borderMuted:"#994409",borderDim:"#592502",bg:void 0,cardBg:"#1a0c02",highlightBg:"#2a1403",activeBg:"#3d1d05",inputBg:"#261203",inputBorder:"#261203",inputText:"#ffeedd",inputPlaceholder:"#a6622b",inputPrompt:"#ff7518",codeBg:"#120701",codeBorder:"#592502",userMsgBg:"#261203",userMsgBorder:"#261203",userMsgText:"#ffeedd",diffRemovalBg:"#3d0a0a",diffAdditionBg:"#1a330a",diffRemovalText:"#ff5555",diffAdditionText:"#73e639",diffRemovalHighlightColor:"#ff2222",diffRemovalHighlightBg:"#590e0e",diffAdditionHighlightColor:"#88ff3b",diffAdditionHighlightBg:"#244d0a",diffRemovalNum:"#ff5555",diffAdditionNum:"#73e639",diffRemovalPrefix:"#ff3333",diffAdditionPrefix:"#88ff3b",primary:"#ff7518",secondary:"#a855f7",accent:"#22c55e",success:"#22c55e",warning:"#f59e0b",danger:"#ef4444",info:"#a855f7",statusOn:"#ff7518",statusOff:"#703a08",logoTextAnsi:"\x1B[1;38;2;255;117;24m",logoBodyAnsi:"\x1B[38;2;255;140;26m",logoMutedAnsi:"\x1B[38;2;168;85;247m",logoGradient:["#ff7518","#a855f7"],toolFeedbackAnsi:"\x1B[38;2;255;117;24m"}};var ii=null;var si=(e="Dark")=>{let n;e==="Mystery"||e==="Chaos"?(ii||(ii=Ir[Math.floor(Math.random()*Ir.length)]),n={...ii,id:"Mystery"}):(ii=null,to[e]?n=to[e]:e==="Halloween"?n=to.Spookfest:e==="GitHub"?n=to["GitHub Dark"]:e==="Transparent"?n=to["Transparent Dark"]:n=to.Dark);let t=n.codeText||n.secondary||n.info||n.logoGradient&&n.logoGradient[0]||"cyan",i=n.toolFeedbackAnsi||"\x1B[95m";return{...n,codeText:t,toolFeedbackAnsi:i}};var Aa=()=>process.env.TERM_PROGRAM==="vscode"?"vscode":process.env.WT_SESSION?"wt":"default",gc=(e=2)=>{let n=Aa();return n==="wt"?" ".repeat(Math.max(1,e-1)):" ".repeat(e)},Mr=new Date,Io=Mr.getMonth(),Mo=Mr.getDate(),Ea=Io===9&&Mo>=15||Io===10&&Mo<=1,ji=null;(process.env.SPOOKFEST==="true"||Ea)&&(ji=await import("./halloween-MX3VNQRW.js"));var hc=(e="...",n="Loading...",t="Dark")=>{let i=si(t),o=n;if(n==="c_openai"||n==="Custom (OpenAI)")try{let H=jo(Wo,{})?.systemSettings?.customOpenAIBaseUrl;H&&(o=H)}catch{}let r=i.logoTextAnsi,d=i.logoBodyAnsi,a=i.logoMutedAnsi,u="\x1B[0m",m=[" \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 "],b=t==="Spookfest"||i.id==="Spookfest"||t==="Halloween"||i.id==="Halloween",h=Io===9&&Mo>=15||Io===10&&Mo<=1,f=b&&h||process.env.SPOOKFEST==="true"&&b,s=m;if(f&&ji){process.env.HALLOWEEN_EEGG="true";let{halloweenArtSide:F,halloweenBat:H,halloweenArtUser:$}=ji;s=Math.random()>.9&&Io===9&&Mo>=30?H:Math.random()>.5?F:$}else process.env.HALLOWEEN_EEGG="false";let g=f?_r:vr,T=g[Math.floor(Math.random()*g.length)],ue=i.logoGradient||["#0077ff","#ff00ff"],y=Ta(ue).multiline(s.join(`
|
|
560
560
|
`)).split(`
|
|
561
561
|
`),R=F=>`${a}${F}${u}`;return`${y[0]}
|
|
562
562
|
${y[1]} ${r}Selected ${f?"Pumpkin":"Provider"}: ${o}${u}
|
|
@@ -871,7 +871,7 @@ ${d?"- AskMain(question=string). Communicate with PARENT/MAIN AGENT. When clarif
|
|
|
871
871
|
- WebScrape(url=string). Proactive use for specific webpage/docs
|
|
872
872
|
|
|
873
873
|
**Workspace**
|
|
874
|
-
- CodeSearch(keyword=string, path?="
|
|
874
|
+
- CodeSearch(keyword=string, path?="file/glob, inclusion !exclusion ;-separated", regex?=bool:auto)
|
|
875
875
|
- ReadFolder(path=string, recurse?=int[1..3]). Minimize recursion
|
|
876
876
|
- FindFile(basename=string). Find file path. Extention optional
|
|
877
877
|
- ReadFile(path=string, startLine?=int, endLine?=int)
|
|
@@ -10,7 +10,7 @@ import{execSync as o}from"child_process";var t=null,m=()=>{if(process.platform!=
|
|
|
10
10
|
- ReadFolder(path=string, recurse?=int[1..3])
|
|
11
11
|
- PatchFile(path=string, allowMultiple?=bool, searchContent1="string match OR ^LINE:start..end$", newContent1=string, ...MAX15). Small searchString. Line Anchor: ^LINE:...$ syntax, must for large blocks & escape sequences
|
|
12
12
|
- WriteFile(path=string, content=string). Creates/Overwrites. File Exist? PatchFile > WriteFile
|
|
13
|
-
- CodeSearch(keyword=string, path?="
|
|
13
|
+
- CodeSearch(keyword=string, path?="file/glob, inclusion !exclusion ;-separated", regex?=bool:auto)
|
|
14
14
|
- Run(command=string). Runs ${l==="Windows"?a()?"powershell":"windows CMD":"bash"} command. Destructive command \u2192 Ask user${f?"":`
|
|
15
15
|
- Goal(method="create/append/get", tasks=string[], markDone=string[]). If long multi-task: create Goals before starting. get + markDone marks complete`}
|
|
16
16
|
${n?`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as b,b as C}from"./chunk-
|
|
1
|
+
import{a as b,b as C}from"./chunk-MQCO3GXM.js";import{a as S}from"./chunk-Y5JU726N.js";import{spawn as A}from"child_process";var P=null;try{let f=await import("node-pty");P=f.default||f}catch{}var I=!!P,y=f=>typeof f!="string"?f:f.replace(/(?:\u001b][\s\S]*?(?:\u0007|\u001b\\))|(?:[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])/g,""),E=f=>{if(!f)return"";let p=[[]],n=0,o=0,w=/\x1b\[([0-9;]*?)([a-zA-Z])/g,g=0,h,d=a=>{for(let e=0;e<a.length;e++){let t=a[e];if(t===`
|
|
2
2
|
`)for(n++,o=0;n>=p.length;)p.push([]);else if(t==="\r")o=0;else{for(;n>=p.length;)p.push([]);let s=p[n];for(;o>s.length;)s.push(" ");s[o]=t,o++}}};for(;(h=w.exec(f))!==null;){d(f.substring(g,h.index));let a=h[1],e=h[2],t=a?a.split(";").map(Number):[];if(e==="A"){let s=t[0]||1;n=Math.max(0,n-s)}else if(e==="B"){let s=t[0]||1;for(n=n+s;n>=p.length;)p.push([])}else if(e==="C"){let s=t[0]||1;o=o+s}else if(e==="D"){let s=t[0]||1;o=Math.max(0,o-s)}else if(e==="G"){let s=(t[0]||1)-1;o=Math.max(0,s)}else if(e==="H"||e==="f"){let s=(t[0]||1)-1,r=(t[1]||1)-1;for(n=Math.max(0,s),o=Math.max(0,r);n>=p.length;)p.push([])}else if(e==="K"){let s=t[0]||0;if(n<p.length){let r=p[n];if(s===0)r.length=o;else if(s===1)for(let c=0;c<o&&c<r.length;c++)r[c]=" ";else s===2&&(r.length=0)}}else if(e==="J"){let s=t[0]||0;(s===2||s===3)&&(p.length=0,p.push([]),n=0,o=0)}g=w.lastIndex}d(f.substring(g));let O=p.map(a=>a.join(""));for(;O.length>0&&O[O.length-1]==="";)O.pop();return O.join(`
|
|
3
3
|
`)},x=null,k=!1,_=f=>{try{x&&(k&&typeof x.write=="function"?x.write(f):x.stdin&&x.stdin.writable&&x.stdin.write(f))}catch{}},W=()=>{if(x){try{k&&typeof x.destroy=="function"?x.destroy():typeof x.kill=="function"&&(process.platform==="win32"?A("taskkill",["/pid",x.pid,"/f","/t"]):x.kill("SIGKILL"))}catch{}x=null,k=!1}},T=(f,p=!1)=>{if(process.platform!=="win32"||process.env.ADJUST_WINDOWS_COMMAND!=="true")return f;let n=[],o="",w=null,g=!1;for(let e=0;e<f.length;e++){let t=f[e];if(g){o+=t,g=!1;continue}if(t==="\\"){if(!w&&f[e+1]===" "){o+=" ",e++;continue}o+=t,g=!0;continue}w?(t===w&&(w=null),o+=t):t==='"'||t==="'"?(w=t,o+=t):t===";"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push(p?";":"&")):t==="&"&&!o.includes("://")?f[e+1]==="&"?(o.length>0&&(n.push(o),o=""),n.push("&&"),e++):o.endsWith("2>")&&f[e+1]==="1"?(n.push("2>&1"),o="",e++):(o.length>0&&(n.push(o),o=""),n.push("&")):t==="|"&&!o.includes("://")?(o.length>0&&(n.push(o),o=""),n.push("|")):(t===">"||t==="<")&&(e===0||/\s|['"]/.test(f[e-1]||""))?(o.length>0&&(n.push(o),o=""),t===">"&&f[e+1]===">"?(n.push(">>"),e++):n.push(t)):/\s/.test(t)?o.length>0&&(n.push(o),o=""):o+=t}o.length>0&&n.push(o);let h=e=>!(!e.includes("/")||/^(https?|file|ftp):\/\//i.test(e)||e.startsWith("@")||e.startsWith("/")&&(e.match(/\//g)||[]).length===1||/\s\/|\/\s/.test(e)||/[\(\)\{\}\;\<\>\=\'\"]/.test(e)),d=[];for(let e=0;e<n.length;e++){let t=n[e];if(t==="mkdir"&&p&&b()){let s=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;c!=="-p"&&c!=="--parents"&&c!=="-v"&&c!=="--verbose"&&s.push(c),r++}if(s.length>0){let c=s.map(i=>{let u=i.replace(/^['"]|['"]$/g,""),l=i;return h(u)&&(l=i.replace(/\//g,"\\")),l});d.push("New-Item","-ItemType","Directory","-Force","-Path",c.join(","))}else d.push("New-Item","-ItemType","Directory","-Force");e=r-1;continue}if(t==="rm"&&p&&b()){let s=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-rf"||l==="-fr"?(r=!0,c=!0):l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:s.push(l),i++}let u=["Remove-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),s.length>0){let l=s.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});u.push("-Path",l.join(","))}d.push(...u),e=i-1;continue}if(t==="cp"&&p&&b()){let s=[],r=!1,c=!1,i=e+1;for(;i<n.length;){let l=n[i];if([">",">>","<","&","&&","|","||",";"].includes(l))break;l==="-r"||l==="-R"||l==="--recursive"?r=!0:l==="-f"||l==="--force"?c=!0:s.push(l),i++}let u=["Copy-Item"];if(r&&u.push("-Recurse"),c&&u.push("-Force"),s.length>0){let l=s.map(m=>{let R=m.replace(/^['"]|['"]$/g,""),$=m;return h(R)&&($=m.replace(/\//g,"\\")),$});if(l.length>1){let m=l.pop();u.push("-Path",l.join(","),"-Destination",m)}else u.push("-Path",l[0])}d.push(...u),e=i-1;continue}if(t==="touch"&&p&&b()){let s=[],r=e+1;for(;r<n.length;){let c=n[r];if([">",">>","<","&","&&","|","||",";"].includes(c))break;s.push(c),r++}if(s.length>0){let i=`(${s.map(u=>{let l=u.replace(/^['"]|['"]$/g,""),m=u;return h(l)&&(m=u.replace(/\//g,"\\")),m}).join(", ")}) | ForEach-Object { if (Test-Path $_) { (Get-Item $_).LastWriteTime = [System.DateTime]::Now } else { $null | Out-File -FilePath $_ } }`;d.push(i)}e=r-1;continue}if(t==="|"&&n[e+1]==="tee"){n[e+2]==="-a"?(d.push(">>"),e+=2):(d.push(">"),e+=1);continue}if(t==="|"&&n[e+1]==="cat"&&n[e+2]===">"){d.push(">"),e+=2;continue}if(t==="|"){let s=n[e+1];if(s){let r=s.replace(/^['"]|['"]$/g,""),c=/\.(txt|md|json|log|csv|html|css|py|js|xml|yaml|yml|pdf|docx|pptx|xlsx)$/i.test(r);if(h(r)&&c){d.push(">");continue}}}d.push(t)}let O=!1,a=d.map(e=>{if(e==="echo")return O=!0,e;[">",">>","<","&","&&","|","||",";"].includes(e)&&(O=!1);let s=/^['"]|['"]$/.test(e),r=e;O&&s&&(r=e.replace(/^['"]|['"]$/g,""));let c=/^['"]|['"]$/.test(r),i=r.replace(/^['"]|['"]$/g,"");h(i)&&(r=r.replace(/\//g,"\\"));let u=r.replace(/^['"]|['"]$/g,"");return u.includes(" ")&&!c&&(r=`"${u}"`),r});if(p){let e="",t=0;for(let s=0;s<a.length;s++){let r=a[s];r==="&&"?(e+="; if ($?) {",t++):r===";"?(e+=" }".repeat(t)+";",t=0):(e&&!e.endsWith(" ")&&!e.endsWith("{")&&(e+=" "),e+=r)}return e+=" }".repeat(t),e}return a.join(" ")},M=async(f,p={})=>{let{command:n}=S(f),{onChunk:o}=p;if(!n)return'ERROR: Missing "command" argument for Run.';let w=process.platform==="win32",g=p.systemSettings||{},h={};return g.networkAccess===!1&&(h.HTTP_PROXY="http://127.0.0.1:9999",h.HTTPS_PROXY="http://127.0.0.1:9999",h.ALL_PROXY="socks5://127.0.0.1:9999",h.http_proxy="http://127.0.0.1:9999",h.https_proxy="http://127.0.0.1:9999",h.all_proxy="socks5://127.0.0.1:9999",h.NO_PROXY="localhost,127.0.0.1"),new Promise(d=>{let O=a=>{let e=a==="pwsh"||a==="powershell",t=T(n,e),s;w?a==="pwsh"?s="pwsh.exe":a==="powershell"?s="powershell.exe":s="cmd.exe":s=process.env.SHELL||"bash";let r=w?e?["-NoProfile","-Command",t]:["/c",t]:["-c",t];if(g.networkAccess===!1&&!w){let c=s,i=[...r];if(process.platform==="linux")s="unshare",r=["-n","-r",c,...i];else if(process.platform==="darwin"){let u=`(version 1)
|
|
4
4
|
(allow default)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"./chunk-ODBYCQHC.js";import"./chunk-MQCO3GXM.js";import"./chunk-Y5JU726N.js";export{d as activeChildProcess,h as adjustWindowsCommand,c as cleanTerminalOutput,i as exec_command,e as isActiveCommandPty,a as isPtyAvailable,b as stripAnsi,g as terminateActiveCommand,f as writeToActiveCommand};
|
|
@@ -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-
|
|
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-JI4UX2WD.js"),l=b(w),c=l.task||l.instruction||l.prompt,E=l.model||null,C=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:C||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,E,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-
|
|
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-JI4UX2WD.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)}),`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-
|
|
2
|
-
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-
|
|
1
|
+
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-JI4UX2WD.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-JI4UX2WD.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};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as Y}from"./chunk-Y5JU726N.js";import{a as Q}from"./chunk-FSE4BZZZ.js";import"./chunk-PRTGV2R4.js";import"./chunk-L3W2X74K.js";import{w as V,x as q,y as J}from"./chunk-M2ULCOL3.js";import K from"fs/promises";import E from"path";import j from"fast-glob";import{Minimatch as tt}from"minimatch";async function A(f,o,n=f,p=1){if(p>12)return[];let h=[],s;try{s=await K.readdir(f,{withFileTypes:!0})}catch{return[]}for(let t of s){let a=E.join(f,t.name),y=E.relative(n,a),L=y.split(E.sep).map(w=>w.toLowerCase()),O=t.name.toLowerCase();if(!o.some(w=>{let F=w.toLowerCase();return F.startsWith(".")&&O.endsWith(F)?!0:L.some(M=>M===F||M.startsWith(".pnpm"))}))if(t.isDirectory()){let w=await A(a,o,n,p+1);h=h.concat(w)}else t.isFile()&&h.push({fullPath:a,relativePath:y})}return h}function rt(f,o,n=1/0){if(f===o)return 0;if(f.length===0)return o.length;if(o.length===0)return f.length;if(Math.abs(f.length-o.length)>n)return n+1;let p=Array.from({length:o.length+1},(h,s)=>s);for(let h=1;h<=f.length;h++){let s=[h],t=h;for(let a=1;a<=o.length;a++){let y=f[h-1]===o[a-1]?0:1,L=Math.min(s[a-1]+1,p[a]+1,p[a-1]+y);s.push(L),L<t&&(t=L)}if(p=s,t>n)return n+1}return p[o.length]}function nt(f,o){if(!f||!o)return!1;let n=f.toLowerCase(),p=o.toLowerCase();if(n.includes(p))return!0;let h=n.split(/[^a-z0-9]+/).filter(t=>t.length>0),s=p.split(/[^a-z0-9]+/).filter(t=>t.length>1||p.length===1&&t.length>0);return s.length===0?!1:s.every(t=>{let a=t.length<=2?0:t.length<=5?1:2;for(let y of h)if(y.includes(t)||t.length>=3&&y.length>=3&&Math.abs(y.length-t.length)<=a&&rt(t,y,a)<=a)return!0;return!1})}var gt=async f=>{let{keyword:o,path:n,fuzzy:p,subString:h,regex:s}=Y(f);if(o==null)return'ERROR: Missing "keyword" argument.';let t=String(o);if(n){let e=n.trim().toLowerCase();if(e==="#docs"||e==="#doc"||e==="#documentation"||e.includes("#skill/global/fluxflow")||e.startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills."}let a=e=>e===!0||e==="true"||e===1||e==="1"||e==="yes",y=s===!1||s==="false"||s===0||s==="0"||s==="no",L=s===!0||s==="true"||s===1||s==="1"||s==="yes",O=a(p)||a(h),G=null,w=null;if(y)O||(w=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{G=new RegExp(t,"i")}catch(e){if(L)return`ERROR: Invalid regex pattern "${t}": ${e.message}`}w=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let F=Array.from(new Set([...V,...q(process.cwd())])),M=150;try{let e=[],P=process.cwd(),u=null;if(n){let i=r=>r.startsWith("!")||!r.startsWith("-")?r:"!"+r.replace(/^-+/,""),g=n.split(";").map(r=>r.trim()).filter(Boolean).map(i).filter(r=>r!=="!"),c=g.some(r=>r.startsWith("!"));if(g.some(r=>j.isDynamicPattern(r)||/[*?{}[\]()|+]/.test(r))){u="glob";let r=n.replace(/\\/g,"/"),l=g.map(m=>m.replace(/\\/g,"/")),z=F.map(m=>m.startsWith(".")?`**/*${m}`:`**/${m}/**`);if(c&&!g.some(m=>!m.startsWith("!"))){let m=await A(P,F,P),R=$=>$.endsWith("/")?$+"**":$,d=l.filter($=>$.startsWith("!")).map($=>R($.slice(1))),v=l.filter($=>!$.startsWith("!")).map(R);e=m.filter($=>{let x=$.relativePath.replace(/\\/g,"/"),_=v.length===0||v.some(b=>{try{return new tt(b).match(x)}catch{return!1}}),Z=d.some(b=>{try{return new tt(b).match(x)}catch{return!1}});return _&&!Z})}else{let m=l.some(d=>/[\(\)\|]|\.\*/.test(d)),R=[];if(!m)try{R=await j(l,{cwd:P,ignore:z,dot:!0,onlyFiles:!0,absolute:!1})}catch{R=[]}if(R.length===0&&(m||j.isDynamicPattern(r))){let d=r.match(/^([^\*\?\(\)\|\[\]\s]+)\//),v=d&&!/[\*\?\(\)\|\[\]]/.test(d[1])?E.resolve(P,d[1]):P,$=await A(v,F,P);try{let x=r.replace(/^\.\//,"");x=x.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!x.startsWith("^")&&!x.startsWith(".*")&&(x=`.*${x}`);let _=new RegExp(x.endsWith("$")?x:`${x}$`,"i");e=$.filter(Z=>{let b=Z.relativePath.replace(/\\/g,"/");return _.test(b)})}catch{e=[]}}else e=R.map(d=>({fullPath:E.resolve(P,d),relativePath:d}))}}else{let r=[],l=!1,z=!1;for(let k of g){let m=k.replace(/[\/\\]+$/,""),R=E.resolve(P,m);try{let d=await K.stat(R);if(d.isDirectory()){z=!0;let v=await A(R,F,P);r.push(...v)}else if(d.isFile())l=!0,r.push({fullPath:R,relativePath:E.relative(P,R)});else return`ERROR: Path is neither a file nor a directory: ${k}`}catch{return`ERROR: Path not found: ${k}`}}e=r,l&&!z?u="file":u="dir"}}else e=await A(P,F);let et=e.map(async i=>{try{let g=await K.readFile(i.fullPath,"utf-8");if(g.includes("\0"))return[];let c=g.split(/\r?\n/),W=[];for(let l=0;l<c.length;l++)(O?c[l].toLowerCase().includes(t.toLowerCase())||nt(c[l],t):y?w&&w.test(c[l]):G&&G.test(c[l])||w&&w.test(c[l]))&&W.push({line:l+1,content:c[l].trim()});return W.length===0?null:{path:i.relativePath.replace(/\\/g,"/"),matches:W}}catch{return[]}}),st=await Promise.all(et),S=[],D=0;for(let i of st){if(!i||!i.matches)continue;if(D>=M)break;let g=M-D,c=i.matches.slice(0,g);S.push({path:i.path,matches:c}),D+=c.length}typeof global.gc=="function"&&global.gc();let I=null;if(S.length===0){let i=u==="file"?` in '${n}'`:u==="dir"||u==="glob"?` in '${n}'`:". Try to specify files",g=u==="dir"?"[DIR]":u==="glob"?"[GLOB]":"";return`${g}${g?" ":""}Found 0 matches of '${t}'${i}${I?` ${I}`:""}`}let B=I?` ${I}`:"",T=`${S.length} file${S.length===1?"":"s"}`,U=`${D} match${D===1?"":"es"}`,N;u==="file"?N=`Found ${U} of '${t}' in '${n}'${B}:`:u==="dir"||u==="glob"?N=`Found ${U} of '${t}' in '${n}' across ${T}${B}:`:N=`Found ${U} of '${t}' across ${T}${B}:`;let X=u==="dir"?"[DIR]":u==="glob"?"[GLOB]":"",C=`${X}${X?" ":""}${N}
|
|
2
|
+
|
|
3
|
+
`,H="";try{let i=await Q();i?.systemSettings?.alwaysAskFiles&&(H=i.systemSettings.alwaysAskFiles)}catch{}for(let i of S)if(C+=`${i.path}:
|
|
4
|
+
`,J(i.path,H)){let c=i.matches.map(W=>`Line ${W.line}`).join(", ");C+=` ${c}. Line snapshot not available due to file restriction policy. ReadFile if needed
|
|
5
|
+
|
|
6
|
+
`}else{for(let c of i.matches)C+=` Line ${c.line}: ${c.content}
|
|
7
|
+
`;C+=`
|
|
8
|
+
`}return C.trimEnd()}catch(e){return`ERROR: ${e.message}`}};export{gt as search_keyword};
|
package/dist/cli.js
CHANGED
|
@@ -67,19 +67,19 @@ Usage: fluxflow --export error`),process.exit(1)}if(ee&&(console.log(`v${n}`),pr
|
|
|
67
67
|
/docs View documentation
|
|
68
68
|
/fluxflow init Create FluxFlow.md template
|
|
69
69
|
/update check Check for new version
|
|
70
|
-
/update latest Install latest release`),process.exit(0)),te){let C=t[1]||"latest";if(C==="check"){let f=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(f?`Latest version: v${y}`:y!==n?`A new version of FluxFlow is available: v${y} (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 y=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:U,Box:S,Text:b}=await import("ink"),_=(await import("ink-select-input")).default,P=(await import("ink-text-input")).default;return new Promise(Y=>{let F=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],q=({label:E,isSelected:M})=>s.createElement(S,{width:"100%"},s.createElement(b,{bold:M},"\u2514\u2500 ",M?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),O,W=()=>{let[E,M]=N("select"),[X,V]=N(""),z=h=>{h.value==="custom"?M("custom"):D({manager:h.value})},J=h=>{D({manager:"custom",customCommand:h})};return E==="custom"?s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(S,{flexDirection:"row"},s.createElement(b,{color:"cyan",bold:!0}," \u276F "),s.createElement(P,{value:X,onChange:V,onSubmit:J})),s.createElement(S,{marginTop:1},s.createElement(b,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(_,{items:F,onSelect:z,itemComponent:q,indicatorComponent:()=>null}))},D=E=>{O&&O(),Y(E)},{unmount:H}=U(s.createElement(W,null));O=H})},i,A="",k;try{let{loadSettings:s}=await import("./chunks/settings-5R5ADGXX.js");k=await s(),i=k?.systemSettings?.updateManager||k?.updateManager}catch{}if(!i){let s=await y();i=s.manager,A=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||k?.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:w}=await import("child_process");w(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(f){console.error("\x1B[31m\u274C Update failed:\x1B[0m",f.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:ce}=await import("react"),{render:pe}=await import("ink"),{default:me}=await import("./chunks/app-
|
|
70
|
+
/update latest Install latest release`),process.exit(0)),te){let C=t[1]||"latest";if(C==="check"){let f=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(f?`Latest version: v${y}`:y!==n?`A new version of FluxFlow is available: v${y} (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 y=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:U,Box:S,Text:b}=await import("ink"),_=(await import("ink-select-input")).default,P=(await import("ink-text-input")).default;return new Promise(Y=>{let F=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],q=({label:E,isSelected:M})=>s.createElement(S,{width:"100%"},s.createElement(b,{bold:M},"\u2514\u2500 ",M?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),O,W=()=>{let[E,M]=N("select"),[X,V]=N(""),z=h=>{h.value==="custom"?M("custom"):D({manager:h.value})},J=h=>{D({manager:"custom",customCommand:h})};return E==="custom"?s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(S,{flexDirection:"row"},s.createElement(b,{color:"cyan",bold:!0}," \u276F "),s.createElement(P,{value:X,onChange:V,onSubmit:J})),s.createElement(S,{marginTop:1},s.createElement(b,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(S,{flexDirection:"column",marginY:1},s.createElement(S,{marginBottom:1},s.createElement(b,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(_,{items:F,onSelect:z,itemComponent:q,indicatorComponent:()=>null}))},D=E=>{O&&O(),Y(E)},{unmount:H}=U(s.createElement(W,null));O=H})},i,A="",k;try{let{loadSettings:s}=await import("./chunks/settings-5R5ADGXX.js");k=await s(),i=k?.systemSettings?.updateManager||k?.updateManager}catch{}if(!i){let s=await y();i=s.manager,A=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||k?.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:w}=await import("child_process");w(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(f){console.error("\x1B[31m\u274C Update failed:\x1B[0m",f.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:ce}=await import("react"),{render:pe}=await import("ink"),{default:me}=await import("./chunks/app-3NZMHG65.js");process.env.NODE_NO_WARNINGS="1";let de=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],ue=console.log,ge=console.warn,fe=console.error,B=o=>{let m=o.map(String).join(" ");return de.some(r=>m.includes(r))};console.log=(...o)=>!B(o)&&ue(...o),console.warn=(...o)=>!B(o)&&ge(...o),console.error=(...o)=>!B(o)&&fe(...o);let j=t.findIndex(o=>o==="--cwd"||o==="--path");if(j!==-1&&j+1<t.length){let o=t[j+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"),G=t.findIndex(o=>o==="-p"||o==="--prompt");if(G!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(G!==-1?t.slice(G+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:
|
|
71
71
|
${a}
|
|
72
72
|
---
|
|
73
73
|
|
|
74
|
-
Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff`}catch{process.exit(0)}let d=t.findIndex(e=>e==="-r"||e==="--run"),x=null,n=null;if(d!==-1&&d+1<t.length){x=t[d+1];try{let{execSync:e}=await import("child_process");n=e(x,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){n=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(n){let{stripAnsi:e}=await import("./chunks/exec_command-
|
|
74
|
+
Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff`}catch{process.exit(0)}let d=t.findIndex(e=>e==="-r"||e==="--run"),x=null,n=null;if(d!==-1&&d+1<t.length){x=t[d+1];try{let{execSync:e}=await import("child_process");n=e(x,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){n=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(n){let{stripAnsi:e}=await import("./chunks/exec_command-A5JWE55Q.js");n=e(n).trim(),r?r=`Stdin Context (${x}):
|
|
75
75
|
${n}
|
|
76
76
|
---
|
|
77
77
|
|
|
78
|
-
${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let v of process.stdin)e.push(v);let a=Buffer.concat(e).toString("utf8").trim();if(a){let{stripAnsi:v}=await import("./chunks/exec_command-
|
|
78
|
+
${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let v of process.stdin)e.push(v);let a=Buffer.concat(e).toString("utf8").trim();if(a){let{stripAnsi:v}=await import("./chunks/exec_command-A5JWE55Q.js");a=v(a).trim(),r?r=`Stdin Context:
|
|
79
79
|
${a}
|
|
80
80
|
---
|
|
81
81
|
|
|
82
|
-
${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-5R5ADGXX.js"),{getProviderAPIKey:f}=await import("./chunks/secrets-GHW6AWRR.js"),{getDefaultModel:l}=await import("./chunks/model_config-VYWFV55M.js"),{generateSimpleContent:c}=await import("./chunks/ai-
|
|
82
|
+
${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-5R5ADGXX.js"),{getProviderAPIKey:f}=await import("./chunks/secrets-GHW6AWRR.js"),{getDefaultModel:l}=await import("./chunks/model_config-VYWFV55M.js"),{generateSimpleContent:c}=await import("./chunks/ai-JI4UX2WD.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-2WRVNL44.js"),i=await C(),A=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),k=I||A.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let v=A.indexOf(a);if(v!==-1&&v+1<A.length)return A[v+1]}return null},w=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(w,i.apiTier)||l(w,"paid"),N=p(["--key"])||await f(w);!N&&!(w==="c_openai"&&i.systemSettings?.customOpenAIBaseUrl)&&(console.error(`[ERROR] No API key resolved for provider "${w}".`),process.exit(1));let U=await y("agent",{aiProvider:w});U.allowed||(console.error(`[ERROR] ${U.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:S="",nickname:b="",instructions:_=""}=i?.profileData??{},P={aiProvider:w,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},Y=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",F=new Date,q=F.getFullYear(),O=F.toLocaleString("en-US",{month:"short"}).toUpperCase(),W=String(F.getDate()).padStart(2,"0"),D=F.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),H=`${q}-${O}-${W}, ${D}`,E=(P.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),M=Q.basename(E).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),X=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
83
83
|
Use NO markdown, only plain text
|
|
84
84
|
Additional Context:
|
|
85
85
|
- OS: ${Y}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-Y5JU726N.js";import{a as J}from"./chunk-FSE4BZZZ.js";import"./chunk-PRTGV2R4.js";import"./chunk-L3W2X74K.js";import{w as H,x as V,y as q}from"./chunk-M2ULCOL3.js";import j from"fs/promises";import v from"path";import Z from"fast-glob";import{Minimatch as Y}from"minimatch";async function A(c,o,r=c,m=1){if(m>12)return[];let f=[],n;try{n=await j.readdir(c,{withFileTypes:!0})}catch{return[]}for(let t of n){let l=v.join(c,t.name),$=v.relative(r,l),E=$.split(v.sep).map(y=>y.toLowerCase()),O=t.name.toLowerCase();if(!o.some(y=>{let F=y.toLowerCase();return F.startsWith(".")&&O.endsWith(F)?!0:E.some(M=>M===F||M.startsWith(".pnpm"))}))if(t.isDirectory()){let y=await A(l,o,r,m+1);f=f.concat(y)}else t.isFile()&&f.push({fullPath:l,relativePath:$})}return f}function st(c,o,r=1/0){if(c===o)return 0;if(c.length===0)return o.length;if(o.length===0)return c.length;if(Math.abs(c.length-o.length)>r)return r+1;let m=Array.from({length:o.length+1},(f,n)=>n);for(let f=1;f<=c.length;f++){let n=[f],t=f;for(let l=1;l<=o.length;l++){let $=c[f-1]===o[l-1]?0:1,E=Math.min(n[l-1]+1,m[l]+1,m[l-1]+$);n.push(E),E<t&&(t=E)}if(m=n,t>r)return r+1}return m[o.length]}function nt(c,o){if(!c||!o)return!1;let r=c.toLowerCase(),m=o.toLowerCase();if(r.includes(m))return!0;let f=r.split(/[^a-z0-9]+/).filter(t=>t.length>0),n=m.split(/[^a-z0-9]+/).filter(t=>t.length>1||m.length===1&&t.length>0);return n.length===0?!1:n.every(t=>{let l=t.length<=2?0:t.length<=5?1:2;for(let $ of f)if($.includes(t)||t.length>=3&&$.length>=3&&Math.abs($.length-t.length)<=l&&st(t,$,l)<=l)return!0;return!1})}var ut=async c=>{let{keyword:o,path:r,fuzzy:m,subString:f,regex:n}=Q(c);if(o==null)return'ERROR: Missing "keyword" argument.';let t=String(o);if(r){let s=r.trim().toLowerCase();if(s==="#docs"||s==="#doc"||s==="#documentation"||s.includes("#skill/global/fluxflow")||s.startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills."}let l=s=>s===!0||s==="true"||s===1||s==="1"||s==="yes",$=n===!1||n==="false"||n===0||n==="0"||n==="no",E=n===!0||n==="true"||n===1||n==="1"||n==="yes",O=l(m)||l(f),G=null,y=null;if($)O||(y=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{G=new RegExp(t,"i")}catch(s){if(E)return`ERROR: Invalid regex pattern "${t}": ${s.message}`}y=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let F=Array.from(new Set([...H,...V(process.cwd())])),M=150;try{let s=[],x=process.cwd(),u=null;if(r){let e=r.split(";").map(i=>i.trim()).filter(Boolean),P=e.some(i=>i.startsWith("!"));if(e.some(i=>Z.isDynamicPattern(i)||/[*?{}[\]()|+]/.test(i))){u="glob";let i=r.replace(/\\/g,"/"),L=e.map(g=>g.replace(/\\/g,"/")),h=F.map(g=>g.startsWith(".")?`**/*${g}`:`**/${g}/**`);if(P&&!e.some(g=>!g.startsWith("!"))){let g=await A(x,F,x),w=d=>d.endsWith("/")?d+"**":d,p=L.filter(d=>d.startsWith("!")).map(d=>w(d.slice(1))),z=L.filter(d=>!d.startsWith("!")).map(w);s=g.filter(d=>{let R=d.relativePath.replace(/\\/g,"/"),U=z.length===0||z.some(b=>{try{return new Y(b).match(R)}catch{return!1}}),_=p.some(b=>{try{return new Y(b).match(R)}catch{return!1}});return U&&!_})}else{let g=L.some(p=>/[\(\)\|]|\.\*/.test(p)),w=[];if(!g)try{w=await Z(L,{cwd:x,ignore:h,dot:!0,onlyFiles:!0,absolute:!1})}catch{w=[]}if(w.length===0&&(g||Z.isDynamicPattern(i))){let p=i.match(/^([^\*\?\(\)\|\[\]\s]+)\//),z=p&&!/[\*\?\(\)\|\[\]]/.test(p[1])?v.resolve(x,p[1]):x,d=await A(z,F,x);try{let R=i.replace(/^\.\//,"");R=R.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!R.startsWith("^")&&!R.startsWith(".*")&&(R=`.*${R}`);let U=new RegExp(R.endsWith("$")?R:`${R}$`,"i");s=d.filter(_=>{let b=_.relativePath.replace(/\\/g,"/");return U.test(b)})}catch{s=[]}}else s=w.map(p=>({fullPath:v.resolve(x,p),relativePath:p}))}}else{let i=[],L=!1,h=!1;for(let C of e){let g=C.replace(/[\/\\]+$/,""),w=v.resolve(x,g);try{let p=await j.stat(w);if(p.isDirectory()){h=!0;let z=await A(w,F,x);i.push(...z)}else if(p.isFile())L=!0,i.push({fullPath:w,relativePath:v.relative(x,w)});else return`ERROR: Path is neither a file nor a directory: ${C}`}catch{return`ERROR: Path not found: ${C}`}}s=i,L&&!h?u="file":u="dir"}}else s=await A(x,F);let tt=s.map(async e=>{try{let P=await j.readFile(e.fullPath,"utf-8");if(P.includes("\0"))return[];let a=P.split(/\r?\n/),i=[];for(let h=0;h<a.length;h++)(O?a[h].toLowerCase().includes(t.toLowerCase())||nt(a[h],t):$?y&&y.test(a[h]):G&&G.test(a[h])||y&&y.test(a[h]))&&i.push({line:h+1,content:a[h].trim()});return i.length===0?null:{path:e.relativePath.replace(/\\/g,"/"),matches:i}}catch{return[]}}),et=await Promise.all(tt),W=[],S=0;for(let e of et){if(!e||!e.matches)continue;if(S>=M)break;let P=M-S,a=e.matches.slice(0,P);W.push({path:e.path,matches:a}),S+=a.length}typeof global.gc=="function"&&global.gc();let I=null;if(W.length===0){let e=u==="file"?` in '${r}'`:u==="dir"||u==="glob"?` in '${r}'`:". Try to specify files",P=u==="dir"?"[DIR]":u==="glob"?"[GLOB]":"";return`${P}${P?" ":""}Found 0 matches of '${t}'${e}${I?` ${I}`:""}`}let k=I?` ${I}`:"",K=`${W.length} file${W.length===1?"":"s"}`,B=`${S} match${S===1?"":"es"}`,N;u==="file"?N=`Found ${B} of '${t}' in '${r}'${k}:`:u==="dir"||u==="glob"?N=`Found ${B} of '${t}' in '${r}' across ${K}${k}:`:N=`Found ${B} of '${t}' across ${K}${k}:`;let T=u==="dir"?"[DIR]":u==="glob"?"[GLOB]":"",D=`${T}${T?" ":""}${N}
|
|
2
|
-
|
|
3
|
-
`,X="";try{let e=await J();e?.systemSettings?.alwaysAskFiles&&(X=e.systemSettings.alwaysAskFiles)}catch{}for(let e of W)if(D+=`${e.path}:
|
|
4
|
-
`,q(e.path,X)){let a=e.matches.map(i=>`Line ${i.line}`).join(", ");D+=` ${a}. Line snapshot not available due to file restriction policy. ReadFile if needed
|
|
5
|
-
|
|
6
|
-
`}else{for(let a of e.matches)D+=` Line ${a.line}: ${a.content}
|
|
7
|
-
`;D+=`
|
|
8
|
-
`}return D.trimEnd()}catch(s){return`ERROR: ${s.message}`}};export{ut as search_keyword};
|