fluxflow-cli 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ai-KOH73AH5.js → ai-XVH7ZCEN.js} +1 -1
- package/dist/chunks/{app-D4SXAA2A.js → app-NBNACTIU.js} +5 -4
- package/dist/chunks/{chunk-RITEP4UH.js → chunk-WSZQ2ABN.js} +326 -326
- package/dist/cli.js +1 -1
- package/dist/model_config.json +1 -1
- package/dist/package.json +1 -1
- package/model_config.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as l,R as b,S as c,T as d,U as e,V as f,W as g,X as h,Y as i,Z as j,_ as k}from"./chunk-
|
|
1
|
+
import{$ as l,R as b,S as c,T as d,U as e,V as f,W as g,X as h,Y as i,Z as j,_ as k}from"./chunk-WSZQ2ABN.js";import"./chunk-ACHIC75V.js";import{c as a}from"./chunk-TKIVOTJ4.js";import"./chunk-SIINYZWE.js";import"./chunk-I27MASHH.js";import"./chunk-56EJGQU3.js";import"./chunk-GKFFLQSG.js";export{i as compressHistory,b as convertChannelThinkTags,j as deleteChatSummary,k as getAIStream,c as getCleanGroupedLength,f as getGoogleClient,h as initAI,a as isModelMultimodal,e as isTerminationSignaled,g as runJanitorTask,l as runSubagent,d as signalTermination};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as ci}from"./chunk-3JTGIHTN.js";import{A as Bi,B as ir,C as vi,D as Di,E as lr,F as ar,G as wt,H as Vo,I as os,J as ki,K as Ii,L as Ai,M as Li,N as Oi,O as ns,P as jo,Q as dr,T as Ni,W as Fi,X as Ln,Y as Ui,Z as Xi,_ as $i,a as it,b as ht,c as dt,d as wi,e as Zr,f as Rr,g as kn,h as yi,i as xo,j as bi,k as je,l as qe,m as rr,n as In,o as es,p as Si,q as dn,r as Ht,s as Ci,t as An,u as ko,v as cn,w as sr,x as ts,y as Mi,z as Ei}from"./chunk-
|
|
1
|
+
import{e as ci}from"./chunk-3JTGIHTN.js";import{A as Bi,B as ir,C as vi,D as Di,E as lr,F as ar,G as wt,H as Vo,I as os,J as ki,K as Ii,L as Ai,M as Li,N as Oi,O as ns,P as jo,Q as dr,T as Ni,W as Fi,X as Ln,Y as Ui,Z as Xi,_ as $i,a as it,b as ht,c as dt,d as wi,e as Zr,f as Rr,g as kn,h as yi,i as xo,j as bi,k as je,l as qe,m as rr,n as In,o as es,p as Si,q as dn,r as Ht,s as Ci,t as An,u as ko,v as cn,w as sr,x as ts,y as Mi,z as Ei}from"./chunk-WSZQ2ABN.js";import{b as an,c as zr,k as Ti}from"./chunk-ACHIC75V.js";import{a as fi,b as hi,c as xi,e as Do,f as no,g as pi,h as Jr,i as Mt}from"./chunk-TKIVOTJ4.js";import{c as ui,d as mi,e as gi}from"./chunk-SIINYZWE.js";import{a as ln,b as Dn,c as ho,d as nr,e as qr,j as Qr}from"./chunk-I27MASHH.js";import{a as Pi}from"./chunk-56EJGQU3.js";import"./chunk-GKFFLQSG.js";import Es from"os";import e,{useState as q,useEffect as Qe,useRef as Ye,useMemo as hn}from"react";import{Box as c,Text as i,useInput as Cd,useStdout as Md,Static as Ed}from"ink";import Bd from"ink-spinner";import rt from"fs-extra";import Dt from"path";import{exec as yr}from"child_process";import{fileURLToPath as vd}from"url";import Ot,{useState as cr,useEffect as rs,useMemo as On,useCallback as ql,useRef as po}from"react";import{Box as Ql,Text as Rt,useInput as zl}from"ink";function Jl(t,g){return t.replace(/\t/g," ".repeat(g))}function ur(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`)}function Ko(t,g,h){let S=t,T=[...g].sort((s,v)=>s.start-v.start),p=0;for(let s of T){let v=s.start-p,u=ur(s.text).split(`
|
|
4
4
|
`).length,E=s.text.length,M=(u>3?`[Pasted ${u} lines]`:`[Pasted ${E} chars]`).length,X=v+M;if(t<=v)break;if(t<X){S=s.end;break}else{let B=s.text.length-M;S+=B,p+=B}}return Math.min(S,h.length)}function ss(t,g,h,S,T=[]){let p=(t||"").slice(0,g),s=S(p).length,v=S(t||""),u=[...T].sort((O,L)=>L.start-O.start);for(let O of u){let L=S(t.slice(0,O.start)).length,$=S(O.text),ee=L+$.length,ae=ur(O.text).split(`
|
|
@@ -57,7 +57,9 @@ import{e as ci}from"./chunk-3JTGIHTN.js";import{A as Bi,B as ir,C as vi,D as Di,
|
|
|
57
57
|
`,isMeta:!0}]))}catch(a){U(x=>(V(x.length+1),[...x,{id:"kb-error-"+Date.now(),role:"system",text:`\u2726 Failed to update keybindings: ${a.message}.
|
|
58
58
|
\u2800`,isMeta:!0}]))}},[st,Y]=q("chat"),[Je,Fo]=q("Free"),[Ae,Pt]=q({limitMode:"Daily",agentLimit:99999999,tokenLimit:99999999999999,backgroundLimit:999999,searchLimit:100,customModelId:"",customLimit:0,providerBudgets:{}}),[bo,Kt]=q(null),[So,xl]=q("chat"),[Jo,Br]=q("settings"),[Zo,pl]=q([]),[$d,Tl]=q(0),[Bs,Wn]=q(0),[vr,vs]=q({}),[Dr,kr]=q({}),[Hn,uo]=q(0),[ce,Ct]=q({memory:!0,theme:"Dark",compression:0,autoExec:!1,autoDeleteHistory:"7d",autoUpdate:!1,updateManager:"npm",customUpdateCommand:""}),l=hn(()=>je(ce.theme),[ce.theme]),[pn,Ds]=q({name:null,nickname:null,instructions:null}),[Co,Gn]=q({keyType:"Default",quality:"Low-High",apiKey:""}),[mo,Uo]=q({tokens:0}),[ks,Ir]=q(0),Is=Ye(0),Ar=Ye({totalWords:0,startTime:0,wps:0,chunks:[]}),[As,Ls]=q(0),[Os,wl]=q(0),[qt,Ps]=q(0),[yl,Tn]=q(0),wn=Ye(0),[Yn,Ns]=q(0),[Ro,Fs]=q(0),[_d,bl]=q(0),[Wd,Sl]=q(0),[Hd,Cl]=q(0),[Vn,Ml]=q(0),[jn,El]=q(0),[Kn,Bl]=q(0),[Us,vl]=q(0),[yn,Lr]=q(null),[Xo,Or]=q(null),[Pr,Xs]=q(null),[go,Nr]=q("daily"),[Dl,qn]=q(0),bn="flow-playground",[ot,Qn]=q(t.includes("--playground")?bn:ts());Qe(()=>{if(Ho.current)return;let o=qt-wn.current;Tn(o),ot&&Bi(ot,o,mo.tokens).catch(()=>{})},[qt,ot,mo.tokens]),Qe(()=>{st==="apiTier"&&(async()=>{let n=await lr();Lr(n);let a=await ar();Or(a);let x=await os(Ae.resetDay||1);Xs(x)})()},[st,Ae.resetDay]);let[Jt,$s]=q(null),[en,tn]=q(""),[Sn,_s]=q(!1),[Fr,kl]=q([]),[Gd,Yd]=q(0),Ws=Ye(!0),Hs=Ye(!0),Gs=Ye(!0),Ys=Ye(W),Ur=Ye(!1),Xr=Ye(!0);Qe(()=>{y&&(F(!1),U(o=>(V(o.length+1),[...o,{id:Date.now(),role:"system",text:`\u2726 Wildcard Tooling:
|
|
59
59
|
\u2800\u2800\u2514\u2500 Status: Disabled.
|
|
60
|
-
\u2800`,isMeta:!0}])))
|
|
60
|
+
\u2800`,isMeta:!0}]))),process.env.forcedReasoning&&(U(o=>(V(o.length+1),[...o,{id:Date.now(),role:"system",text:`\u2726 Forced Reasoning:
|
|
61
|
+
\u2800\u2800\u2514\u2500 Status: Disabled.
|
|
62
|
+
\u2800`,isMeta:!0}])),process.env.forcedReasoning=!1)},[ne]),Qe(()=>{Ys.current!==W?(Ys.current=W,We(W==="Mistral"?"Fast":W==="DeepSeek"||W==="NVIDIA"||W==="CrofAI"||W==="InferX"?"Standard":"Medium")):(W==="Google"||W==="CrofAI"||W==="InferX"||W==="SenseNova")&&ue==="xHigh"&&(ne&&ne.toLowerCase().startsWith("gemini-3")||W==="CrofAI"||W==="InferX"||W==="SenseNova")&&We("High")},[W,ne,ue]),Qe(()=>{if(!Tt)return;if(Ws.current){Ws.current=!1,setTimeout(()=>{Hs.current=!1,setTimeout(()=>{Gs.current=!1},1e3)},2e3);return}if(Hs.current||Gs.current)return;let o=no(W,Je),n=o;o.includes("gemma")?n="Gemma":o.includes("deepseek")?n="DeepSeek Flash":o.includes("devstral")?n="Devstral":o.includes("mistral")?n="Mistral":o.includes("gemini")&&(n="Gemini Flash"),ie(o),Mt({apiTier:Je,activeModel:o})},[Je,W,Tt]);let Il=hn(()=>{let o=qo();return{isIDE:!["Terminal","Windows Terminal"].includes(o)||!!process.env.VSC_TERMINAL_URL||!!process.env.INTELLIJ_TERMINAL_COMMAND_BLOCKS,get shortcut(){return Sr}}},[]),zn=Ye(null),$r=Ye("");Qe(()=>{zn.current=Jt},[Jt]),Qe(()=>{$r.current=en},[en]);let[Al,Ll]=q(!1),[Mo,on]=q(null),[$o,_r]=q(null),Jn=o=>{on(null),Y("chat")},Vs=o=>{let n=Math.floor(o/3600),a=Math.floor(o%3600/60),x=o%60,m=[];return n>0&&m.push(`${n}h`),(a>0||n>0)&&m.push(`${a}m`),m.push(`${x}s`),m.join(" ")},_o=o=>o<1e3?`${o}ms`:Vs(Math.floor(o/1e3)),[Cn,Wr]=q(null),[Hr,js]=q(""),[Ol,Pl]=q(!1),[Ks,Mn]=q(0),En;Qe(()=>{let o;if(Cn&&ce.loadingPhrases!==!1){let n=()=>{let a=ys[Math.floor(Math.random()*ys.length)];js(a)};Hr||n(),o=setInterval(n,1e4)}else js("");return()=>{clearInterval(o)}},[Cn,ce]);let[Vd,Nl]=q(!0),[nn,Gr]=q(!1),[Zn,qs]=q(!1),[Fl,Ul]=q(!1),[Qs,jd]=q(null),[zs,Bn]=q(0),[Xl,Js]=q([]),Wo=Ye(null),Ho=Ye(!1);Qe(()=>()=>{Wo.current&&clearTimeout(Wo.current)},[]);let Yr=Ye(!1),[Kd,Vr]=q(null),[$l,jr]=q(null),[qd,_l]=q(null);Qe(()=>Bn(0),[v]);let[mt,Wl]=q(()=>{let o={id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0},n=process.cwd()===Es.homedir(),a=(()=>{let m=process.cwd().toLowerCase();if(process.platform==="win32"){let w=process.env.SystemRoot?.toLowerCase()||"c:\\windows",f=process.env.ProgramFiles?.toLowerCase()||"c:\\program files",d=process.env["ProgramFiles(x86)"]?.toLowerCase()||"c:\\program files (x86)";return m.startsWith(w)||m.startsWith(f)||m.startsWith(d)}else return m==="/"||["/bin","/sbin","/etc","/usr","/var","/root"].some(f=>m.startsWith(f))})(),x=[o];return a?x.push({id:"system-warning",role:"system",text:"[CRITICAL SECURITY ALERT] SYSTEM DIRECTORY DETECTED",subText:`You are currently in a PROTECTED SYSTEM DIRECTORY (${process.cwd()}). Operating here is EXTREMELY dangerous as the agent could accidentally corrupt your OS or installed applications. Open FluxFlow in project folder to work safely.`,isHomeWarning:!0}):n&&x.push({id:"home-warning",role:"system",text:"[SECURITY ALERT] HOME DIRECTORY DETECTED",subText:`You are currently in ${Es.homedir()}. Working here is high-risk as the agent may modify system-sensitive configurations. Please open FluxFlow in project folder.`,isHomeWarning:!0}),x}),U=o=>{Wl(n=>{let a=typeof o=="function"?o(n):o;if(a.length>1){let x=a[a.length-1],m=a[a.length-2];if(x?.text?.includes("Request Cancelled")&&m?.text?.includes("Request Cancelled"))return a.slice(0,-1)}return a})},Eo=Ye(null),[Zs,Hl]=q(""),[Rs,ei]=q(!1),ti=Ye(""),oi=Ye(null);Qe(()=>{if(mt.length===0)return;let o=mt[mt.length-1];if(o&&(o.role==="agent"||o.role==="assistant")){let a=(o.text||"").match(/\[ANSWER\]([\s\S]*?)(?:\[\/ANSWER\]|$)/i);if(a){let x=a[1].trim();x&&x!==ti.current&&(Hl(x),ti.current=x,oi.current!==o.id&&ei(!0))}}},[mt]);let[Bo,V]=q(mt.length),[Go,Kr]=q(0),Qd=Ye([]),_t=Ye({completedIndex:0,columns:0,historicalBlocks:[],seenSelections:new Set,chatId:"",clearKey:0,theme:""}),ni=hn(()=>{let o=$.columns||80,n=/Selection: (.*)/,a=[],x=new Set,m=_t.current.columns!==o,w=Bo<_t.current.completedIndex,f=_t.current.chatId!==ot,d=_t.current.clearKey!==Go,b=_t.current.theme!==ce.theme;if(m||w||f||d||b){let oe=mt.slice(0,Bo);for(let Me=0;Me<oe.length;Me++){let Ee=oe[Me];if(Ee.isAskRecord&&Ee.text){let le=Ee.text.match(n);if(le&&le[1].trim()){let Re=le[1].trim();if(x.has(Re))continue;x.add(Re)}}let z=kn(Ee,o);for(let le=0;le<z.completed.length;le++)a.push(z.completed[le]);for(let le=0;le<z.active.length;le++)a.push(z.active[le])}_t.current={completedIndex:Bo,columns:o,historicalBlocks:a,seenSelections:new Set(x),chatId:ot,clearKey:Go,theme:ce.theme}}else if(a=_t.current.historicalBlocks,x=_t.current.seenSelections,Bo>_t.current.completedIndex){a=[...a],x=new Set(x);let oe=mt.slice(_t.current.completedIndex,Bo);for(let Me=0;Me<oe.length;Me++){let Ee=oe[Me];if(Ee.isAskRecord&&Ee.text){let le=Ee.text.match(n);if(le&&le[1].trim()){let Re=le[1].trim();if(x.has(Re))continue;x.add(Re)}}let z=kn(Ee,o);for(let le=0;le<z.completed.length;le++)a.push(z.completed[le]);for(let le=0;le<z.active.length;le++)a.push(z.active[le])}_t.current={completedIndex:Bo,columns:o,historicalBlocks:a,seenSelections:x,chatId:ot,clearKey:Go}}let I=mt.slice(Bo),N=[],Q=[];for(let oe=0;oe<I.length;oe++){let Me=I[oe];if(Me.isAskRecord&&Me.text){let z=Me.text.match(n);if(z&&z[1].trim()){let le=z[1].trim();if(x.has(le))continue}}let Ee=kn(Me,o);for(let z=0;z<Ee.completed.length;z++)N.push(Ee.completed[z]);for(let z=0;z<Ee.active.length;z++)Q.push(Ee.active[z])}if(_.current){let oe=kn(_.current,o);for(let Me=0;Me<oe.completed.length;Me++)N.push(oe.completed[Me]);for(let Me=0;Me<oe.active.length;Me++)Q.push(oe.active[Me])}let me=N.length===0?a:a.concat(N);return me.length>=75e3&&(me=[...me],me.push({key:`memory-warning-block-${me.length}`,msg:{role:"system",text:"\u26A0\uFE0F MEMORY WARNING: CHAT IS GETTING VERY LONG",subText:`This session has reached ${me.length} blocks. To maintain optimal performance and prevent high memory usage, it is highly recommended to save and start a clean chat with /clear.`,isHomeWarning:!0},type:"full-message"})),{completed:me,active:Q}},[mt,Bo,$.columns,Go,ot,Z]),Gl=hn(()=>{if(!Jt||!en)return!1;let o=en.trim();return o.endsWith("?")||o.endsWith(":")||/\[[yYnN/]+\]\s*$/.test(o)||/\([yYnN]\)\s*$/.test(o)},[Jt,en]);Cd((o,n)=>{if(!(o==="\x1B[I"||o==="\x1B[O"||o==="[I"||o==="[O")){if(n.ctrl&&(o.toLowerCase()==="r"||o===""||o==="")){ji();return}if(st==="stats"){if(n.tab&&!n.shift){Nr(a=>a==="modelBreakdown"?"daily":a==="daily"?"monthly":"daily"),qn(0);return}if(n.space||o===" "){Nr(a=>a==="modelBreakdown"?"daily":"modelBreakdown"),qn(0);return}if(n.upArrow){qn(a=>Math.max(0,a-1));return}if(n.downArrow){qn(a=>Math.min(Pe.current,a+1));return}}if(re){let a=qo(),x=fl(a);if(n.upArrow)ke(m=>m>0?m-1:x.length-1);else if(n.downArrow)ke(m=>m<x.length-1?m+1:0);else if(n.return){let m=x[we];if(m.action==="dismiss")Ce(!1);else if(m.url){let w=process.platform==="win32"?`start ${m.url}`:process.platform==="darwin"?`open ${m.url}`:`xdg-open ${m.url}`;yr(w),Ce(!1)}}return}if(n.tab&&Jt){_s(a=>!a);return}if(Sn&&Jt){if(n.return)if(dn)Ht("\r");else{let a=process.platform==="win32";Ht(a?`\r
|
|
61
63
|
`:`
|
|
62
64
|
`),tn(x=>x+`
|
|
63
65
|
`)}else if(n.backspace||n.delete)dn?Ht("\x7F"):(Ht("\b \b"),tn(a=>a.slice(0,-1)));else if(n.upArrow)Ht(n.shift?"\x1B[1;2A":"\x1B[A");else if(n.downArrow)Ht(n.shift?"\x1B[1;2B":"\x1B[B");else if(n.rightArrow)Ht(n.shift?"\x1B[1;2C":"\x1B[C");else if(n.leftArrow)Ht(n.shift?"\x1B[1;2D":"\x1B[D");else if(n.escape)Ht("\x1B");else if(n.ctrl&&o){let a=o.toLowerCase().charCodeAt(0);a>=97&&a<=122?Ht(String.fromCharCode(a-96)):Ht(o)}else o&&(Ht(o),dn||tn(a=>a+o));return}if(st==="providerBudgetSelect"){let a=["Google","DeepSeek","Mistral","NVIDIA","OpenRouter","Ollama","CrofAI","InferX","SenseNova"];if(n.upArrow){Wn(x=>(x-1+a.length)%a.length);return}else if(n.downArrow){Wn(x=>(x+1)%a.length);return}else if(o===" "){let x=a[Bs];vs(m=>({...m,[x]:!m[x]}));return}else if(n.return){let x=a.filter(w=>vr[w]);if(x.length===0)return;let m={...Ae,providerBudgets:{...Ae.providerBudgets||{},__useProvider:!0}};Pt(m),pl(x),Tl(0),Wn(0),Y("providerBudgetFlow");return}else if(n.escape){Y("budgetTypeSelect");return}return}if(st==="providerBudgetFlow"){let a=Zo.length,x=a*2+1;if(n.upArrow){uo(m=>m===x-1?Math.max(0,(a-1)*2):m>=2?m-2:m);return}else if(n.downArrow){uo(m=>m===x-1?m:m+2<x-1?m+2:x-1);return}else if(n.leftArrow){uo(m=>m===x-1?m:m%2===1?m-1:m);return}else if(n.rightArrow||n.tab){uo(m=>m===x-1?m:m%2===0||m+1<x?m+1:m);return}else if(n.return){if(Hn===x-1){let m=Ae.providerBudgets||{},w={__useProvider:!0};for(let b of Zo){let I=Dr[b]||{};w[b]={agentLimit:9999999999,tokenLimit:parseInt(I.tokenLimit,10)||0,monthlyTokenLimit:parseInt(I.monthlyTokenLimit,10)||0}}let f={...Ae,providerBudgets:w};Pt(f),Mt({apiTier:Je,quotas:f}),Y(So==="settings"?"resetMode":"budgetResetMode")}else uo(m=>Math.min(x-1,m+1));return}else if(n.escape){Y("providerBudgetSelect");return}return}if(n.escape){if(Rs){if(ei(!1),mt.length>0){let a=mt[mt.length-1];a&&(oi.current=a.id)}return}if(_e.length>0&&st==="chat"){j(!0);return}if(h){S(!1);return}if(nn||Jt||Mo||$o)Yr.current=!0,Ni(),Ci(),Mo&&(Mo.resolve("deny"),on(null)),$o&&($o.resolve(null),_r(null)),Ul(!1),Qs&&clearTimeout(Qs);else if(st==="revert")Y("chat"),Bn(0);else if(st!=="chat"&&st!=="settings")Y("chat");else{if(!Tt&&at===1){Lt(0),zo("");return}Bn(a=>{let x=a+1;return x===1?(Wo.current&&clearTimeout(Wo.current),Wo.current=setTimeout(()=>Bn(0),2e3)):x===2&&(Wo.current&&clearTimeout(Wo.current),Bn(0),v.length>0?u(""):An.getChatHistory(ot).then(m=>{m.length>0?(Js(m.reverse()),Y("revert")):U(w=>(V(w.length+1),[...w,{id:"revert-empty-"+Date.now(),role:"system",text:`\u2726 Nothing to revert to.
|
|
@@ -114,8 +116,7 @@ ${d}`,color:"magenta"}]}),u("");return}if(!Tt){ri(x),zo("");return}if(x.startsWi
|
|
|
114
116
|
\u2022 Spent (Last 1hr): ${Number((d.totalSpent*1e3).toFixed(0))} credits
|
|
115
117
|
\u2022 Remaining: ${Number((d.remaining*1e3).toFixed(0))} credits
|
|
116
118
|
\u2022 Requests (Last 1hr): ${d.activeCallsCount} requests
|
|
117
|
-
`+(d.nextResetMin>0?`\u2022 Refreshes in: ${d.nextResetMin}m`:""),isMeta:!0}]))}catch{U(b=>(V(b.length+1),[...b,{id:Date.now(),role:"system",text:"[SYSTEM] Failed to load image quota stats.",isMeta:!0}]))}}else if(m[1]?.toLowerCase()==="setup")if(m[2]?.toLowerCase()==="key")if(m[3]){let f=["default","custom"].find(d=>d===m[3].toLowerCase());if(f){let d=f==="default"?"Default":"Custom";Gn(I=>({...I,keyType:d}));let b=qe(2);U(I=>(V(I.length+1),[...I,{id:Date.now(),role:"system",text:`[SYSTEM] Image key strategy set to ${d}`,isMeta:!0}])),d==="Custom"&&(Kt({label:"Enter Pollinations API key (starting with sk_):",note:"Get a key from https://enter.pollinations.ai",key:"imageSettings",subKey:"apiKey",value:Co.apiKey||"",returnView:"chat"}),Y("input"))}else{let d=qe(2);U(b=>(V(b.length+1),[...b,{id:Date.now(),role:"system",text:"[SYSTEM] Invalid key option. Choose: Default or Custom.",isMeta:!0}]))}}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup Key <Default|Custom>",isMeta:!0}]))}else if(m[2]?.toLowerCase()==="quality")if(m[3]){let f=["low","low-high","medium","medium-high","high","ultra","premium"].find(d=>d===m[3].toLowerCase());if(f){let b={low:"Low","low-high":"Low-High",medium:"Medium","medium-high":"Medium-High",high:"High",ultra:"Ultra",premium:"Premium"}[f];Gn(N=>({...N,quality:b}));let I=qe(2);U(N=>(V(N.length+1),[...N,{id:Date.now(),role:"system",text:`[SYSTEM] Image quality set to ${b}`,isMeta:!0}]))}else{let d=qe(2);U(b=>(V(b.length+1),[...b,{id:Date.now(),role:"system",text:"[SYSTEM] Invalid quality level. Choose from: Low, Low-High, Medium, Medium-High, High, Ultra, Premium.",isMeta:!0}]))}}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup Quality <Low|Low-High|Medium|Medium-High|High|Ultra>",isMeta:!0}]))}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup <Key|Quality> ...",isMeta:!0}]))}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup <Key|Quality> ...",isMeta:!0}]))}break}case"/thinking":{let f;if(m[1]){let d=m[1].toLowerCase(),b=m.includes("--bypass"),I=m.includes("--force");f=d.charAt(0).toUpperCase()+d.slice(1),d==="xhigh"&&(f="xHigh");let N="";if(I&&(process.env.NVIDIA_BASE_URL
|
|
118
|
-
\u2800`:N=`\u2800\u2800\u2514\u2500 --force is not supported in this context.
|
|
119
|
+
`+(d.nextResetMin>0?`\u2022 Refreshes in: ${d.nextResetMin}m`:""),isMeta:!0}]))}catch{U(b=>(V(b.length+1),[...b,{id:Date.now(),role:"system",text:"[SYSTEM] Failed to load image quota stats.",isMeta:!0}]))}}else if(m[1]?.toLowerCase()==="setup")if(m[2]?.toLowerCase()==="key")if(m[3]){let f=["default","custom"].find(d=>d===m[3].toLowerCase());if(f){let d=f==="default"?"Default":"Custom";Gn(I=>({...I,keyType:d}));let b=qe(2);U(I=>(V(I.length+1),[...I,{id:Date.now(),role:"system",text:`[SYSTEM] Image key strategy set to ${d}`,isMeta:!0}])),d==="Custom"&&(Kt({label:"Enter Pollinations API key (starting with sk_):",note:"Get a key from https://enter.pollinations.ai",key:"imageSettings",subKey:"apiKey",value:Co.apiKey||"",returnView:"chat"}),Y("input"))}else{let d=qe(2);U(b=>(V(b.length+1),[...b,{id:Date.now(),role:"system",text:"[SYSTEM] Invalid key option. Choose: Default or Custom.",isMeta:!0}]))}}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup Key <Default|Custom>",isMeta:!0}]))}else if(m[2]?.toLowerCase()==="quality")if(m[3]){let f=["low","low-high","medium","medium-high","high","ultra","premium"].find(d=>d===m[3].toLowerCase());if(f){let b={low:"Low","low-high":"Low-High",medium:"Medium","medium-high":"Medium-High",high:"High",ultra:"Ultra",premium:"Premium"}[f];Gn(N=>({...N,quality:b}));let I=qe(2);U(N=>(V(N.length+1),[...N,{id:Date.now(),role:"system",text:`[SYSTEM] Image quality set to ${b}`,isMeta:!0}]))}else{let d=qe(2);U(b=>(V(b.length+1),[...b,{id:Date.now(),role:"system",text:"[SYSTEM] Invalid quality level. Choose from: Low, Low-High, Medium, Medium-High, High, Ultra, Premium.",isMeta:!0}]))}}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup Quality <Low|Low-High|Medium|Medium-High|High|Ultra>",isMeta:!0}]))}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup <Key|Quality> ...",isMeta:!0}]))}else{let f=qe(2);U(d=>(V(d.length+1),[...d,{id:Date.now(),role:"system",text:"[SYSTEM] Usage: /image setup <Key|Quality> ...",isMeta:!0}]))}break}case"/thinking":{let f;if(m[1]){let d=m[1].toLowerCase(),b=m.includes("--bypass"),I=m.includes("--force");f=d.charAt(0).toUpperCase()+d.slice(1),d==="xhigh"&&(f="xHigh");let N="";if(I&&(process.env.NVIDIA_BASE_URL,N=`\u2800\u2800\u2514\u2500 Enabled Forced Reasoning.
|
|
119
120
|
\u2800`,process.env.forcedReasoning="true"),!b&&D==="Flow"&&f==="xHigh")U(Q=>(V(Q.length+1),[...Q,{id:Date.now(),role:"system",text:`\u2726 RESTRICTED
|
|
120
121
|
\u2800\u2800\u2514\u2500"${f}" is restricted in Flow mode. Switch to Flux to enable Higher Thinking Levels.
|
|
121
122
|
\u2800${N}.`,isMeta:!0}]));else{We(f);let Q=qe(1);U(me=>(V(me.length+1),[...me,{id:Date.now(),role:"system",text:`\u2726 ${W}
|