fluxflow-cli 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{A as r,B as s,C as t,D as u,E as v,k as b,l as c,m as d,n as e,o as f,p as g,q as h,r as i,s as j,t as k,u as l,v as m,w as n,x as o,y as p,z as q}from"./chunk-24LJKH4G.js";import"./chunk-HFTI3R3Q.js";import"./chunk-52STSLCN.js";import"./chunk-56EJGQU3.js";import"./chunk-4BLSASW6.js";import"./chunk-7SGZ66KT.js";import"./chunk-UIL6OCU4.js";import"./chunk-EXT42EJZ.js";import"./chunk-6EYQQ7GQ.js";import"./chunk-Y5JU726N.js";import"./chunk-QESQR5GB.js";import"./chunk-J4J3F6BT.js";import"./chunk-V36DXF56.js";import"./chunk-B4UKMX5E.js";import{l as a}from"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import"./chunk-26BQ45XP.js";export{c as RE_LEADING_THINK,b as convertChannelThinkTags,r as detectToolCalls,e as findGenuineThinkClose,t as generateSimpleContent,u as getAIStream,q as getActiveToolContext,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,s as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,o as maskCodeSpans,p as maskExecutedTools,n as runJanitorTask,v as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
1
+ import{A as r,B as s,C as t,D as u,E as v,k as b,l as c,m as d,n as e,o as f,p as g,q as h,r as i,s as j,t as k,u as l,v as m,w as n,x as o,y as p,z as q}from"./chunk-WS35FH7W.js";import"./chunk-HFTI3R3Q.js";import"./chunk-52STSLCN.js";import"./chunk-56EJGQU3.js";import"./chunk-4BLSASW6.js";import"./chunk-7SGZ66KT.js";import"./chunk-UIL6OCU4.js";import"./chunk-EXT42EJZ.js";import"./chunk-6EYQQ7GQ.js";import"./chunk-Y5JU726N.js";import"./chunk-QESQR5GB.js";import"./chunk-J4J3F6BT.js";import"./chunk-V36DXF56.js";import"./chunk-B4UKMX5E.js";import{l as a}from"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import"./chunk-26BQ45XP.js";export{c as RE_LEADING_THINK,b as convertChannelThinkTags,r as detectToolCalls,e as findGenuineThinkClose,t as generateSimpleContent,u as getAIStream,q as getActiveToolContext,j as getCleanGroupedLength,m as getGoogleClient,f as getLeadingThinkBlock,s as initAI,d as isInsideBacktick,a as isModelMultimodal,l as isTerminationSignaled,o as maskCodeSpans,p as maskExecutedTools,n as runJanitorTask,v as runSubagent,k as signalTermination,g as stripLeadingThinking,h as stripNakedXmlTags,i as stripTrailingFluffAfterTools};
@@ -1,4 +1,4 @@
1
- import{a as ma}from"./chunk-UEV335RW.js";import{b as oa,c as na,d as ra}from"./chunk-IHDJDAG3.js";import{c as jl,e as Zn,f as wo,g as ql}from"./chunk-GM5VNNTU.js";import{A as da,B as yo,D as ua,a as Yl,b as mt,c as Dt,d as Cr,e as ui,f as Jl,g as An,h as ns,i as rs,j as Zl,r as ia,t as la,x as aa,z as ca}from"./chunk-24LJKH4G.js";import{a as lo,b as Ql,c as zl}from"./chunk-HFTI3R3Q.js";import"./chunk-52STSLCN.js";import{a as sa}from"./chunk-56EJGQU3.js";import"./chunk-4BLSASW6.js";import{a as Vt,b as Lt,d as Gl,e as Pt,f as Kl,k as ai,l as ci,m as yr,n as di,o as Vl,p as Qo}from"./chunk-7SGZ66KT.js";import"./chunk-UIL6OCU4.js";import{a as ta}from"./chunk-YX4X2ZTX.js";import{a as Sr,b as zo,c as Ln,e as ss,f as mi,g as Rl,h as ea,i as vr}from"./chunk-EXT42EJZ.js";import{a as Mr}from"./chunk-6EYQQ7GQ.js";import{a as un}from"./chunk-Y5JU726N.js";import{b as dn,c as ri}from"./chunk-QESQR5GB.js";import{A as Ll,C as Pl,D as Ol,E as Nl,H as Fl,c as Ml,e as ei,g as Sl,k as vl,l as Bl,m as El,n as Dl,o as Il,q as kl,r as Al,u as ti,v as oi,w as ni}from"./chunk-J4J3F6BT.js";import{a as Ul,b as _l,i as Hl,j as ts,k as os,m as Et,n as Wl,p as ii,q as li,w as Xl}from"./chunk-V36DXF56.js";import{a as $l,b as si,c as qt}from"./chunk-B4UKMX5E.js";import{d as hl,e as Rs,f as pl,g as bl,h as wl,i as Tl,j as yl,l as es,n as cn,o as bo,p as Tr,q as Cl}from"./chunk-LQM3JK7N.js";import{c as Zr,d as gl,e as Rr}from"./chunk-P5HBJA23.js";import{a as ko,b as kn,c as Fo,d as Js,e as Zs,k as wr,y as fl}from"./chunk-26BQ45XP.js";import Ai from"os";import e,{useState as J,useEffect as ct,useRef as Ze,useMemo as or}from"react";import{Box as u,Text as i,useInput as su,useStdout as iu,Static as lu}from"ink";import au from"ink-spinner";import ft from"fs-extra";import Tt from"path";import{exec as Go}from"child_process";import{fileURLToPath as cu}from"url";import oo,{useState as is,useEffect as xi,useMemo as Br,useCallback as Ic,useRef as Jo}from"react";import{Box as kc,Text as Ao,useInput as Ac}from"ink";function Lc(t,m){return t.replace(/\t/g," ".repeat(m))}function ls(t){return t==null?"":t.replace(/\r\n/g,`
1
+ import{a as ma}from"./chunk-UEV335RW.js";import{b as oa,c as na,d as ra}from"./chunk-IHDJDAG3.js";import{c as jl,e as Zn,f as wo,g as ql}from"./chunk-GM5VNNTU.js";import{A as da,B as yo,D as ua,a as Yl,b as mt,c as Dt,d as Cr,e as ui,f as Jl,g as An,h as ns,i as rs,j as Zl,r as ia,t as la,x as aa,z as ca}from"./chunk-WS35FH7W.js";import{a as lo,b as Ql,c as zl}from"./chunk-HFTI3R3Q.js";import"./chunk-52STSLCN.js";import{a as sa}from"./chunk-56EJGQU3.js";import"./chunk-4BLSASW6.js";import{a as Vt,b as Lt,d as Gl,e as Pt,f as Kl,k as ai,l as ci,m as yr,n as di,o as Vl,p as Qo}from"./chunk-7SGZ66KT.js";import"./chunk-UIL6OCU4.js";import{a as ta}from"./chunk-YX4X2ZTX.js";import{a as Sr,b as zo,c as Ln,e as ss,f as mi,g as Rl,h as ea,i as vr}from"./chunk-EXT42EJZ.js";import{a as Mr}from"./chunk-6EYQQ7GQ.js";import{a as un}from"./chunk-Y5JU726N.js";import{b as dn,c as ri}from"./chunk-QESQR5GB.js";import{A as Ll,C as Pl,D as Ol,E as Nl,H as Fl,c as Ml,e as ei,g as Sl,k as vl,l as Bl,m as El,n as Dl,o as Il,q as kl,r as Al,u as ti,v as oi,w as ni}from"./chunk-J4J3F6BT.js";import{a as Ul,b as _l,i as Hl,j as ts,k as os,m as Et,n as Wl,p as ii,q as li,w as Xl}from"./chunk-V36DXF56.js";import{a as $l,b as si,c as qt}from"./chunk-B4UKMX5E.js";import{d as hl,e as Rs,f as pl,g as bl,h as wl,i as Tl,j as yl,l as es,n as cn,o as bo,p as Tr,q as Cl}from"./chunk-LQM3JK7N.js";import{c as Zr,d as gl,e as Rr}from"./chunk-P5HBJA23.js";import{a as ko,b as kn,c as Fo,d as Js,e as Zs,k as wr,y as fl}from"./chunk-26BQ45XP.js";import Ai from"os";import e,{useState as J,useEffect as ct,useRef as Ze,useMemo as or}from"react";import{Box as u,Text as i,useInput as su,useStdout as iu,Static as lu}from"ink";import au from"ink-spinner";import ft from"fs-extra";import Tt from"path";import{exec as Go}from"child_process";import{fileURLToPath as cu}from"url";import oo,{useState as is,useEffect as xi,useMemo as Br,useCallback as Ic,useRef as Jo}from"react";import{Box as kc,Text as Ao,useInput as Ac}from"ink";function Lc(t,m){return t.replace(/\t/g," ".repeat(m))}function ls(t){return t==null?"":t.replace(/\r\n/g,`
2
2
  `).replace(/\r/g,`
3
3
  `)}function Pn(t,m,c){let S=t,T=[...m].sort((r,C)=>r.start-C.start),p=0;for(let r of T){let C=r.start-p,y=ls(r.text).split(`
4
4
  `).length,M=r.text.length,P=(y>3?`[Pasted ${y} lines]`:`[Pasted ${M} chars]`).length,N=C+P;if(t<=C)break;if(t<N){S=r.end;break}else{let E=r.text.length-P;S+=E,p+=E}}return Math.min(S,c.length)}function fi(t,m,c,S,T=[]){let p=(t||"").slice(0,m),r=S(p).length,C=S(t||""),y=[...T].sort((V,H)=>H.start-V.start);for(let V of y){let H=S(t.slice(0,V.start)).length,X=S(V.text),G=H+X.length,se=ls(V.text).split(`
@@ -102,7 +102,7 @@ Remove-Item -Path '${Aa.replace(/'/g,"''")}' -Recurse -Force -ErrorAction Silent
102
102
  \u2514\u2500\u2800`:""}Initialization complete.${v}
103
103
  \u2800`,isMeta:!0}])}else L(f=>[...f,{role:"system",text:`\u2726 INVALID KEY
104
104
  \u2800\u2800\x1B[2m\u2514\u2500\x1B[22m ${U} API key must start with "${o}" and be at least ${n} characters long.`,isMeta:!0}]),yn("")},Qr=Ze(Ii);ct(()=>{if(Mt==="exit"){(async()=>{let B=Date.now(),o=Math.floor((B-Qr.current)/1e3);o>=1&&(await ii("duration",o),Qr.current+=o*1e3),await _l()})();let a=setTimeout(()=>{process.exit(0)},50);return()=>clearTimeout(a)}},[Mt]),ct(()=>{try{ni(x=>{L(a=>($(a.length+1),[...a,{id:"keynotice-"+Date.now(),role:"system",text:`\u2726 ${x}
105
- \u2800`,isMeta:!0}]))})}catch{}return()=>{try{ni(null)}catch{}}},[]),ct(()=>{let x=setInterval(async()=>{if(!Le){let a=Date.now(),B=Math.floor((a-Qr.current)/1e3);B>=1&&(await ii("duration",B),Qr.current+=B*1e3),Ul()}},5e3);return()=>clearInterval(x)},[Le]);let ul=[{cmd:"/quit",desc:"Exit and shutdown Flux"},{cmd:"/kill",desc:"Kill a process by PID",subs:On.map(x=>{let a;return x.isRoot?a="FluxFlow":x.url&&(x.url.includes(":52991")||x.url.includes(":52145")||x.url.includes(":52140"))?a="Internal":a=x.url||x.name,{cmd:String(x.pid),display:`PID: ${x.pid}`,rightDesc:a,desc:a}})},{cmd:"/help",desc:"Show all available commands"},...Ue.playground?[{cmd:"/move",desc:"Move playground directory to original CWD/playground-export"}]:[],{cmd:"/resume",desc:"Load previous session"},{cmd:"/clear",desc:"Clear terminal screen"},{cmd:"/truncate",desc:"Truncate tool results in chat history"},{cmd:"/revert",desc:"Revert codebase back to a checkpoint"},{cmd:"/gemini",desc:"Get a happy message from Gemini CLI"},{cmd:"/meow",desc:"Cat nonsense, delivered straight to the terminal"},...process.env.HALLOWEEN_EEGG==="true"||process.env.HALLOWEEN_EEGG===!0?[{cmd:"/trick-or-treat",desc:"Halloween surprise: Trick or Treat!"}]:[],{cmd:"/save",desc:"Force save current chat"},{cmd:"/export",desc:"Export current chat or error logs",subs:[{cmd:"chat",desc:"Export current active chat"},{cmd:"logs",desc:"Export error logs"}]},{cmd:"/chats",desc:"List all chat sessions"},{cmd:"/btw",desc:"Ask a question without intefering with ongoing tasks"},{cmd:"/thinking",desc:"Set AI reasoning depth",subs:[{cmd:"Low",display:lo(U,Ye,"Low")!==null?`Low (${lo(U,Ye,"Low")})`:"Low",desc:"Quick Reasoning"},{cmd:"Medium",display:lo(U,Ye,"Medium")!==null?`Medium (${lo(U,Ye,"Medium")})`:"Medium",desc:"Balanced Reasoning"},{cmd:"High",display:lo(U,Ye,"High")!==null?`High (${lo(U,Ye,"High")})`:"High",desc:"Deep Reasoning"},{cmd:"custom",display:lo(U,Ye,"xHigh")!==null?`Custom (${lo(U,Ye,"xHigh")})`:"Custom",desc:"Custom Reasoning Value"}]},{cmd:"/model",desc:"Select Agent Model",subs:G==="ICU"||G.toLowerCase()==="fluxcu"?cn(U,et,le?.customOpenAIBaseUrl).filter(x=>es(x.cmd||x)):cn(U,et,le?.customOpenAIBaseUrl)},{cmd:"/wildcard-tooling",desc:"Use if the model lacks Tooling Capability"},{cmd:"/provider",desc:"Select AI Provider"},{cmd:"/mode",desc:"Switch execution mode",subs:[{cmd:"flux",display:"workspace",desc:"Workspace, files & terminal tools"},{cmd:"flow",display:"studio",desc:"Creative studio, documents, PDF & conversation"},{cmd:"icu",display:"computer use",desc:"Interactive desktop & OS automation"},{cmd:"fluxcu",display:"omni",desc:"Autonomous tools & desktop execution"}]},{cmd:"/display",desc:"Select Active Display (Computer Use)",subs:[{cmd:"primary",desc:"Primary Display (Display 1)"},{cmd:"secondary",desc:"Secondary Display (Display 2)"}]},{cmd:"/settings",desc:"Configure system prefs"},{cmd:"/theme",desc:"Customize UI color theme"},{cmd:"/key",desc:"Manage API keys",subs:[{cmd:"list",desc:"List saved keys"},{cmd:"add",desc:"Add a key"},{cmd:"remove",desc:"Remove a key"},{cmd:"use",desc:"Select active key"},{cmd:"clean",desc:"Remove gaps between slots"}]},{cmd:"/files",desc:"List loaded instruction and skill files"},{cmd:"/memory",desc:"Manage agent memory",subs:[{cmd:"view",desc:"View and manage agent persistent memory"},{cmd:"migrate",desc:"Migrate persistent memories to AGENTS.md"}]},{cmd:"/stats",desc:"Show session usage"},{cmd:"/usage",desc:"Open graphical token usage & analytics dashboard in browser"},{cmd:"/target",desc:"Show current provider and model"},{cmd:"/reset",desc:"Wipe all project data"},{cmd:"/about",desc:"Project info & credits"},{cmd:"/changelog",desc:"View latest updates"},{cmd:"/docs",desc:"View Documentation"},{cmd:"/fluxflow",desc:"Project management",subs:[{cmd:"global",desc:"Opens the Global FluxFlow Directory in File Explorer"},{cmd:"saves",desc:"Opens FluxFlow AppData Directory in File Explorer"}]},{cmd:"/budget",desc:"Set or View budget limits",subs:[{cmd:"view",desc:"View current usage budget bars"},{cmd:"web",desc:"Open graphical usage and budget dashboard in browser"},{cmd:"set",desc:"Configure budgets (Daily/Monthly limits)"},{cmd:"reset",desc:"Reset budgets to default limits"}]},{cmd:"/update",desc:"Check/Install updates",subs:[{cmd:"latest",desc:"Install latest release"},{cmd:"check",desc:"Check for new version"}]}],ml=async(x,a=!1)=>{if(!a&&st.length>0){let n=st[Pe]||st[0],h=x.split(" "),g=h.length===1?n.cmd:h.slice(0,-1).join(" ")+" "+n.cmd;if(g.trim()!==x.trim()){y(g+" "),Ae(0),P(d=>d+1);return}}js.current=!1;let B=x.replace(/\r\n/g,`
105
+ \u2800`,isMeta:!0}]))})}catch{}return()=>{try{ni(null)}catch{}}},[]),ct(()=>{let x=setInterval(async()=>{if(!Le){let a=Date.now(),B=Math.floor((a-Qr.current)/1e3);B>=1&&(await ii("duration",B),Qr.current+=B*1e3),Ul()}},5e3);return()=>clearInterval(x)},[Le]);let ul=[{cmd:"/quit",desc:"Exit and shutdown Flux"},{cmd:"/kill",desc:"Kill a process by PID",subs:On.map(x=>{let a;return x.isRoot?a="FluxFlow":x.url&&(x.url.includes(":52991")||x.url.includes(":52145")||x.url.includes(":52140"))?a="Internal":a=x.url||x.name,{cmd:String(x.pid),display:`PID: ${x.pid}`,rightDesc:a,desc:a}})},{cmd:"/help",desc:"Show all available commands"},...Ue.playground?[{cmd:"/move",desc:"Move playground directory to original CWD/playground-export"}]:[],{cmd:"/resume",desc:"Load previous session"},{cmd:"/clear",desc:"Clear terminal screen"},{cmd:"/truncate",desc:"Truncate tool results in chat history"},{cmd:"/revert",desc:"Revert codebase back to a checkpoint"},{cmd:"/gemini",desc:"Get a happy message from Gemini CLI"},{cmd:"/meow",desc:"Cat nonsense, delivered straight to the terminal"},...process.env.HALLOWEEN_EEGG==="true"||process.env.HALLOWEEN_EEGG===!0?[{cmd:"/trick-or-treat",desc:"Halloween surprise: Trick or Treat!"}]:[],{cmd:"/save",desc:"Force save current chat"},{cmd:"/export",desc:"Export current chat or error logs",subs:[{cmd:"chat",desc:"Export current active chat"},{cmd:"logs",desc:"Export error logs"}]},{cmd:"/chats",desc:"List all chat sessions"},{cmd:"/btw",desc:"Ask a question without intefering with ongoing tasks"},{cmd:"/thinking",desc:"Set AI reasoning depth",subs:[{cmd:"Low",display:lo(U,Ye,"Low")!==null?`Low (${lo(U,Ye,"Low")})`:"Low",desc:"Quick Reasoning"},{cmd:"Medium",display:lo(U,Ye,"Medium")!==null?`Medium (${lo(U,Ye,"Medium")})`:"Medium",desc:"Balanced Reasoning"},{cmd:"High",display:lo(U,Ye,"High")!==null?`High (${lo(U,Ye,"High")})`:"High",desc:"Deep Reasoning"},{cmd:"custom",display:lo(U,Ye,"xHigh")!==null?`Custom (${lo(U,Ye,"xHigh")})`:"Custom",desc:"Custom Reasoning Value"}]},{cmd:"/model",desc:"Select Agent Model",subs:G==="ICU"||G.toLowerCase()==="fluxcu"?cn(U,et,le?.customOpenAIBaseUrl).filter(x=>es(x.cmd||x)):cn(U,et,le?.customOpenAIBaseUrl)},{cmd:"/wildcard-tooling",desc:"Use if the model lacks Tooling Capability"},{cmd:"/provider",desc:"Select AI Provider"},{cmd:"/mode",desc:"Switch execution mode",subs:[{cmd:"flux",display:"workspace",desc:"Workspace, files & terminal tools"},{cmd:"flow",display:"studio",desc:"Creative studio, documents, PDF & conversation"},{cmd:"icu",display:"computer use",desc:"Interactive desktop & OS automation"},{cmd:"fluxcu",display:"omni",desc:"Autonomous tools & desktop execution"}]},{cmd:"/display",desc:"Select Active Display (Computer Use)",subs:[{cmd:"primary",desc:"Primary Display (Display 1)"},{cmd:"secondary",desc:"Secondary Display (Display 2)"}]},{cmd:"/settings",desc:"Configure system prefs"},{cmd:"/theme",desc:"Customize UI color theme"},{cmd:"/key",desc:"Manage API keys",subs:[{cmd:"list",desc:"List saved keys"},{cmd:"add",desc:"Add a key"},{cmd:"remove",desc:"Remove a key"},{cmd:"use",desc:"Select active key"},{cmd:"clean",desc:"Remove gaps between slots"}]},{cmd:"/files",desc:"List loaded instruction and skill files"},{cmd:"/memory",desc:"Manage agent memory",subs:[{cmd:"view",desc:"View and manage agent persistent memory"},{cmd:"migrate",desc:"Migrate persistent memories to AGENTS.md"}]},{cmd:"/stats",desc:"Show session usage"},{cmd:"/usage",desc:"Open graphical token usage & analytics dashboard in browser"},{cmd:"/target",desc:"Show current provider and model"},{cmd:"/reset",desc:"Wipe all project data"},{cmd:"/about",desc:"Project info & credits"},{cmd:"/changelog",desc:"View latest updates"},{cmd:"/docs",desc:"View Documentation"},{cmd:"/fluxflow",desc:"Project management",subs:[{cmd:"global",desc:"Opens the Global FluxFlow Directory in File Explorer"},{cmd:"saves",desc:"Opens FluxFlow AppData Directory in File Explorer"}]},{cmd:"/budget",desc:"Set or View budget limits",subs:[{cmd:"view",desc:"View current usage budget bars"},{cmd:"web",desc:"Open graphical usage and budget dashboard in browser"},{cmd:"set",desc:"Configure budgets (Daily/Monthly limits)"},{cmd:"reset",desc:"Reset budgets to default limits"}]},{cmd:"/update",desc:"Check/Install updates",subs:[{cmd:"latest",desc:"Install latest release"},{cmd:"check",desc:"Check for new version"}]},{cmd:"/skill-creator",desc:'Generate new skills with natural language. /skills-creator "describe" --project/global.'}],ml=async(x,a=!1)=>{if(!a&&st.length>0){let n=st[Pe]||st[0],h=x.split(" "),g=h.length===1?n.cmd:h.slice(0,-1).join(" ")+" "+n.cmd;if(g.trim()!==x.trim()){y(g+" "),Ae(0),P(d=>d+1);return}}js.current=!1;let B=x.replace(/\r\n/g,`
106
106
  `).replace(/\r/g,`
107
107
  `).trimEnd();if(B.endsWith("\\")){y(B.slice(0,-1)+`
108
108
  `);return}let o=B.replace(/\\\s*\n/g,`
@@ -111,7 +111,7 @@ Remove-Item -Path '${Aa.replace(/'/g,"''")}' -Recurse -Force -ErrorAction Silent
111
111
  \u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Inquiry question must be more than 3 characters.
112
112
  \u2800`,isMeta:!0}])),y("");return}}else if(n.startsWith("/")){L(h=>($(h.length+1),[...h,{id:"hint-err-"+Date.now(),role:"system",text:`\u2726 RESTRICTED
113
113
  \u2800\u2800\x1B[2m\u2514\u2500\x1B[22m Steering Hints cannot start with '/'.
114
- \u2800`,isMeta:!0}])),y("");return}qs(n),jo.current=n,y("");return}if(!Je&&!(U==="c_openai"&&le.customOpenAIBaseUrl)){dl(o),yn("");return}if(o.startsWith("/")){y("");let n=o.split(" "),h=n[0]?.toLowerCase();switch(h){case"/quit":{ie("exit");break}case"/resume":{if(n[1]){let g=n[1];(async()=>{let f=await zo(),b=f[g]||Object.values(f).find(v=>v.name.toLowerCase()===g.toLowerCase());if(b){if(r.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY){let te=b?.name||"",W=te&&!te.startsWith("flow-")&&!te.startsWith("Session ")?te:"FluxFlow | Resumed";process.stdout.write(`\x1B]0;${W}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${W}\x07`)}Qo(),Yo.current=!0,jr(g);let v=await vr(g);_n.current=xo-v.total,Wn.current=Bo,Gn.current=Sn,to.current=[],Un(v.total),Hn(0),Mn(0),Xn(0),rn({tokens:v.context}),Yo.current=!1;let D=[...b.messages];D[0]?.text?.includes("\u2591\u2591\u2591\u2588\u2588\u2588")||D.unshift({id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0}),L(D),L(te=>[...te,{id:"sys-"+Date.now(),role:"system",text:`\u2726 SESSION RESUMED
114
+ \u2800`,isMeta:!0}])),y("");return}qs(n),jo.current=n,y("");return}if(!Je&&!(U==="c_openai"&&le.customOpenAIBaseUrl)){dl(o),yn("");return}if(o.startsWith("/")&&!o.startsWith("/skill-creator")){y("");let n=o.split(" "),h=n[0]?.toLowerCase();switch(h){case"/quit":{ie("exit");break}case"/resume":{if(n[1]){let g=n[1];(async()=>{let f=await zo(),b=f[g]||Object.values(f).find(v=>v.name.toLowerCase()===g.toLowerCase());if(b){if(r.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY){let te=b?.name||"",W=te&&!te.startsWith("flow-")&&!te.startsWith("Session ")?te:"FluxFlow | Resumed";process.stdout.write(`\x1B]0;${W}\x07`),process.stdout.write(`\x1B]633;P;TerminalTitle=${W}\x07`)}Qo(),Yo.current=!0,jr(g);let v=await vr(g);_n.current=xo-v.total,Wn.current=Bo,Gn.current=Sn,to.current=[],Un(v.total),Hn(0),Mn(0),Xn(0),rn({tokens:v.context}),Yo.current=!1;let D=[...b.messages];D[0]?.text?.includes("\u2591\u2591\u2591\u2588\u2588\u2588")||D.unshift({id:"logo-"+Date.now(),role:"system",isLogo:!0,isMeta:!0}),L(D),L(te=>[...te,{id:"sys-"+Date.now(),role:"system",text:`\u2726 SESSION RESUMED
115
115
  \u2800\u2800\x1B[2m\u2514\u2500\x1B[22m ${g}.
116
116
  \u2800`,isMeta:!0}]),$(0)}else L(v=>[...v,{id:"err-"+Date.now(),role:"system",text:`\u2726 ERROR: Session [${g}] not found.
117
117
  \u2800`,isMeta:!0}])})()}else ie("resume");break}case"/move":{if(!Ue.playground){L(b=>($(b.length+1),[...b,{id:Date.now(),role:"system",text:`\u2726 RESTRICTED
@@ -1,3 +1,3 @@
1
- import{C as u}from"./chunk-24LJKH4G.js";import"./chunk-HFTI3R3Q.js";import"./chunk-52STSLCN.js";import"./chunk-56EJGQU3.js";import"./chunk-4BLSASW6.js";import"./chunk-7SGZ66KT.js";import"./chunk-UIL6OCU4.js";import"./chunk-EXT42EJZ.js";import"./chunk-6EYQQ7GQ.js";import"./chunk-Y5JU726N.js";import{b as p}from"./chunk-QESQR5GB.js";import"./chunk-J4J3F6BT.js";import"./chunk-V36DXF56.js";import{b as d}from"./chunk-B4UKMX5E.js";import{o as a}from"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import{a as l}from"./chunk-26BQ45XP.js";import m from"fs";import g from"path";var f=["Identity: Embedded IDE code completion engine","Context given: Code \xB1 cursor, file name & language","Task: Predict contextually accurate code at cursor position","","Rules:","- Return ONLY the raw code to insert at the cursor. No explanations, commentary or rambling","- Do NOT wrap in markdown code fences","- NEVER repeat code that exist before & after cursor, if nothing sensible possible to predict, return empty string","- Match surrounding indentation and code style","- Complete the current line statement","- Never include placeholder comments like // TODO or # your code here","- Do not put anything except the code to insert between the tags"].join(`
1
+ import{C as u}from"./chunk-WS35FH7W.js";import"./chunk-HFTI3R3Q.js";import"./chunk-52STSLCN.js";import"./chunk-56EJGQU3.js";import"./chunk-4BLSASW6.js";import"./chunk-7SGZ66KT.js";import"./chunk-UIL6OCU4.js";import"./chunk-EXT42EJZ.js";import"./chunk-6EYQQ7GQ.js";import"./chunk-Y5JU726N.js";import{b as p}from"./chunk-QESQR5GB.js";import"./chunk-J4J3F6BT.js";import"./chunk-V36DXF56.js";import{b as d}from"./chunk-B4UKMX5E.js";import{o as a}from"./chunk-LQM3JK7N.js";import"./chunk-P5HBJA23.js";import{a as l}from"./chunk-26BQ45XP.js";import m from"fs";import g from"path";var f=["Identity: Embedded IDE code completion engine","Context given: Code \xB1 cursor, file name & language","Task: Predict contextually accurate code at cursor position","","Rules:","- Return ONLY the raw code to insert at the cursor. No explanations, commentary or rambling","- Do NOT wrap in markdown code fences","- NEVER repeat code that exist before & after cursor, if nothing sensible possible to predict, return empty string","- Match surrounding indentation and code style","- Complete the current line statement","- Never include placeholder comments like // TODO or # your code here","- Do not put anything except the code to insert between the tags"].join(`
2
2
  `);try{let t=g.join(l,".cache");m.existsSync(t)||m.mkdirSync(t,{recursive:!0}),m.writeFileSync(g.join(t,"completion.json"),JSON.stringify({systemPrompt:f},null,2))}catch{}var y=t=>{if(!t)return"";let e=t.match(/<completion>([\s\S]*?)<\/completion>/i);return e?e[1]:t},x=({prefix:t="",suffix:e="",fileName:o="",language:n="",recentChanges:r="",clipboard:i=""})=>{let c=r?["### Recent manual changes (context):",r,""]:[],s=i?["### Clipboard (context):",i,""]:[];return[`File: ${o}`,`Language: ${n}`,"","### Code before cursor:",t,"","[cursor here]","","### Code after cursor:",e,"",...c,...s,"### Completion to insert at cursor:"].join(`
3
3
  `)},T=async(t={})=>{try{let e=await d(),o=e.autoCompletion||{};if(!o.enabled)return"";let n=o.provider||e.aiProvider||"Google",r=o.model&&o.model!=="Default"?o.model:e.activeModel||a(n,e.apiTier)||a(n,"paid");if(!r)return"";let i=await p(n);if(!i&&!(n==="c_openai"&&e.systemSettings?.customOpenAIBaseUrl))return"";let c={aiProvider:n,apiKey:i,model:r,mode:"flow",thinkingLevel:"Fast",systemSettings:e.systemSettings||{}},s=[{role:"user",parts:[{text:x(t)}]}],{text:h}=await u(c,r,s,f,"Fast");return y(h||"")}catch{return""}};export{f as AUTOCOMPLETE_SYSTEM_PROMPT,y as extractCompletion,T as generateAutoCompletion};