fluxflow-cli 4.39.0 → 4.40.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.
- package/dist/chunks/{ai-Z2RCLVQR.js → ai-ZKC574A7.js} +1 -1
- package/dist/chunks/app-S2QWIJAK.js +324 -0
- package/dist/chunks/{auto_completion-AIWB2XM2.js → auto_completion-NWIEI4SU.js} +2 -2
- package/dist/chunks/{chunk-IXXTQAO2.js → chunk-4DAFC4RK.js} +1 -1
- package/dist/chunks/{chunk-HIP66OBL.js → chunk-4LL36ESE.js} +175 -173
- package/dist/chunks/{chunk-M2LU3TCU.js → chunk-M3NOFDLJ.js} +1 -1
- package/dist/chunks/chunk-RHZU5POT.js +1 -0
- package/dist/chunks/{chunk-MX5Q32YU.js → chunk-VJT4U6KR.js} +1 -1
- package/dist/chunks/{click-O33RKVOZ.js → click-T2BXRY7O.js} +2 -2
- package/dist/chunks/{computer_action-BUZAZ3LJ.js → computer_action-VQBY6TW2.js} +1 -1
- package/dist/chunks/{drag-BZRZLDLG.js → drag-B5ED6RY7.js} +1 -1
- package/dist/chunks/{generate_image-N2SIC5BA.js → generate_image-UHMQ32EH.js} +1 -1
- package/dist/chunks/{invoke-O2YAE4FY.js → invoke-CYDFNNQ4.js} +2 -2
- package/dist/chunks/{invokeSync-URGZXNDC.js → invokeSync-YEOM3MAZ.js} +2 -2
- package/dist/chunks/{key_press-Y7F3VAKL.js → key_press-MMN6Y3WZ.js} +1 -1
- package/dist/chunks/{keyboard_typing-IEVRWQJJ.js → keyboard_typing-2OCGKXE2.js} +1 -1
- package/dist/chunks/{screen_grid-7APUBF2H.js → screen_grid-26MRFY7E.js} +1 -1
- package/dist/chunks/{scroll-FIN5Z7W4.js → scroll-CVJDBGZL.js} +1 -1
- package/dist/chunks/{search_keyword-YLKWY2XH.js → search_keyword-WIVNNMLY.js} +1 -1
- package/dist/chunks/{settings-IGHDSHFT.js → settings-OPQ3GJ62.js} +1 -1
- package/dist/chunks/{update_file-CYGKZXSH.js → update_file-NT666LF5.js} +1 -1
- package/dist/chunks/{usage-IR23BYQX.js → usage-DFN6SYQ3.js} +1 -1
- package/dist/chunks/{usageServer-ZYJCDO27.js → usageServer-JWNNKDR3.js} +1 -1
- package/dist/chunks/{write_file-TZ2Q6CEB.js → write_file-YYKJ3BGD.js} +1 -1
- package/dist/cli.js +5 -6
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/app-IKYO4AHO.js +0 -331
- package/dist/chunks/chunk-EUNKA2MP.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{y as
|
|
1
|
+
import{y as u}from"./chunk-4LL36ESE.js";import"./chunk-HFTI3R3Q.js";import"./chunk-52STSLCN.js";import"./chunk-56EJGQU3.js";import"./chunk-M46I73DX.js";import"./chunk-IUN7DBB4.js";import"./chunk-6H2P5XUL.js";import"./chunk-6EYQQ7GQ.js";import"./chunk-4BLSASW6.js";import"./chunk-Y5JU726N.js";import{b as p}from"./chunk-FXRFFNRK.js";import"./chunk-4DAFC4RK.js";import{b as d}from"./chunk-RHZU5POT.js";import{o as a}from"./chunk-KMOTPBF5.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
|
-
`)},T=async(t={})=>{try{let e=await
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as z}from"./chunk-
|
|
1
|
+
import{b as z}from"./chunk-RHZU5POT.js";import{p as ut}from"./chunk-KMOTPBF5.js";import{a as mt,b as W}from"./chunk-P5HBJA23.js";import{d as J,h as Z,i as M,j as b}from"./chunk-26BQ45XP.js";import S from"fs-extra";import U from"path";import bt from"http";import N from"fs-extra";import et from"path";import{spawn as vt}from"child_process";import{fileURLToPath as Ft}from"url";var $=52991,Rt=15e3,ft=et.join(J,"usage","usage_error.txt"),ht=async(e,t)=>{let o=t?.stack||t?.message||String(t);console.error(`[Usage Daemon Error] [${e}]:`,t);try{await N.ensureDir(et.dirname(ft));let s=`[${new Date().toISOString()}] [Daemon:${e}] ${o}
|
|
2
2
|
-------------------------------------
|
|
3
3
|
|
|
4
4
|
`;await N.appendFile(ft,s,"utf8")}catch{}},B={agent:0,background:0,search:0,toolSuccess:0,toolFailure:0,toolDenied:0,duration:0,tokens:0,cachedTokens:0,candidateTokens:0,linesAdded:0,linesRemoved:0,cost:0,imageCalls:[]},tt=(e,t)=>{if(!e)return{};let o=Object.keys(e),i=new Date(new Date(t).getTime()-720*60*60*1e3),s={};for(let n of o)new Date(n)>=i&&(s[n]=e[n]);return s};async function Ut(){let e=new Date().toISOString().split("T")[0],t=null;try{if(await N.exists(M)){let o=(await N.readFile(M,"utf8")).trim();o.startsWith("{")||o.startsWith("[")?t=JSON.parse(o):t=JSON.parse(W(o))}}catch(o){await ht("loadUsageFromDisk",o)}if(t){let o={...B,...t.stats||{}};Array.isArray(o.imageCalls)||(o.imageCalls=[]);let i=t.history||{},s=tt(i,e);if(t.date===e)return{...t,stats:o,history:s};{let n=t.date,c={...s};return n&&(c[n]=o),{date:e,stats:{...B},history:tt(c,e)}}}return{date:e,stats:{...B},history:{}}}async function Ot(e=$){let t=await Ut(),o=!1,i=!1,s=Date.now(),n=null,c=async()=>{if(t)try{await N.ensureDir(et.dirname(M));let l=new Date().toISOString().split("T")[0];t.history=tt(t.history||{},t.date||l),t.saveId=Math.random().toString(36).substring(2)+Date.now().toString(36);let a=mt(JSON.stringify(t,null,2));await N.writeFile(M,a,"utf8"),i=!1}catch(l){await ht("flushToDisk",l)}},r=async()=>{n&&clearInterval(n),await c(),m.close(()=>{process.exit(0)}),setTimeout(()=>process.exit(0),1e3).unref()};n=setInterval(async()=>{if(o)return;Date.now()-s>Rt&&await r()},5e3),n.unref&&n.unref();let m=bt.createServer(async(l,a)=>{let u=l.url||"";if(l.method==="POST"&&u==="/heartbeat"){o||(s=Date.now()),a.writeHead(200,{"Content-Type":"application/json"}),a.end(JSON.stringify({ok:!0}));return}if((l.method==="GET"||l.method==="POST")&&u==="/finalize"){o=!0,n&&clearInterval(n),await c(),a.writeHead(200,{"Content-Type":"application/json"}),a.end(JSON.stringify({success:!0,message:"Finalized and written to disk"})),setTimeout(()=>{m.close(()=>process.exit(0)),setTimeout(()=>process.exit(0),500).unref()},3e3);return}if(l.method==="POST"&&u==="/flush"){o||(s=Date.now(),await c()),a.writeHead(200,{"Content-Type":"application/json"}),a.end(JSON.stringify({success:!0}));return}if(l.method==="POST"&&u==="/write"){if(o){a.writeHead(403,{"Content-Type":"application/json"}),a.end(JSON.stringify({error:"Daemon finalized. Writes locked."}));return}s=Date.now();let d="";l.on("data",p=>{d+=p}),l.on("end",async()=>{try{let p=JSON.parse(d||"{}"),C=new Date().toISOString().split("T")[0];if(t.date!==C){let y=t.date;y&&(t.history||(t.history={}),t.history[y]={...t.stats}),t.date=C,t.stats={...B}}t.stats||(t.stats={...B});let{key:h,amount:f=1,provider:w,model:T}=p;if(h&&t.stats[h]!==void 0&&(h==="cost"?t.stats.cost=Number(((t.stats.cost||0)+Number(f)).toFixed(6)):typeof t.stats[h]=="number"&&(t.stats[h]+=Math.floor(f))),h==="agent"&&w&&(t.stats.providerRequests||(t.stats.providerRequests={}),t.stats.providerRequests[w]=(t.stats.providerRequests[w]||0)+Math.floor(f)),w&&T&&(h==="tokens"||h==="cachedTokens"||h==="candidateTokens"||h==="ttft"||h==="cost")){t.stats.models||(t.stats.models={}),t.stats.models[w]||(t.stats.models[w]={}),t.stats.models[w][T]||(t.stats.models[w][T]={tokens:0,cachedTokens:0,candidateTokens:0,ttftSum:0,ttftCalls:0,cost:0});let y=t.stats.models[w][T];h==="tokens"&&(y.tokens+=Math.floor(f)),h==="cachedTokens"&&(y.cachedTokens+=Math.floor(f)),h==="candidateTokens"&&(y.candidateTokens+=Math.floor(f)),h==="cost"&&(y.cost=Number(((y.cost||0)+Number(f)).toFixed(6))),h==="ttft"&&(y.ttftSum=(y.ttftSum||0)+Math.floor(f),y.ttftCalls=(y.ttftCalls||0)+1)}i=!0,await c(),a.writeHead(200,{"Content-Type":"application/json"}),a.end(JSON.stringify({success:!0}))}catch(p){a.writeHead(400,{"Content-Type":"application/json"}),a.end(JSON.stringify({error:p.message}))}});return}a.writeHead(404,{"Content-Type":"text/plain"}),a.end("Not Found")});m.listen(e,"127.0.0.1",()=>{s=Date.now()}),m.on("error",l=>{l.code==="EADDRINUSE"&&process.exit(0)})}async function At(e=$){try{if((await fetch(`http://127.0.0.1:${e}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(300)})).ok)return!0}catch{}try{let t=Ft(import.meta.url);vt(process.execPath,[t,"--usage-daemon-worker",`--port=${e}`],{detached:!0,stdio:"ignore",windowsHide:!0}).unref();for(let i=0;i<10;i++){await new Promise(s=>setTimeout(s,100));try{if((await fetch(`http://127.0.0.1:${e}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(300)})).ok)return!0}catch{}}}catch{}return!1}async function st(e,t=$){try{await At(t),await fetch(`http://127.0.0.1:${t}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(1e3)})}catch{}}async function It(e=$){try{await fetch(`http://127.0.0.1:${e}/heartbeat`,{method:"POST",signal:AbortSignal.timeout(600)})}catch{}}async function Et(e=$){try{await fetch(`http://127.0.0.1:${e}/finalize`,{method:"GET",signal:AbortSignal.timeout(1e3)})}catch{}}if(process.argv.includes("--usage-daemon-worker")){let e=process.argv.find(o=>o.startsWith("--port=")),t=e?parseInt(e.split("=")[1],10):$;Ot(t)}var pt=U.join(J,"usage","usage_error.txt"),H=new Map,Nt=(e,t)=>{let o=`${e}:${t}`;if(H.has(o))return H.get(o);try{let i=yt();if(S.existsSync(i)){let n=S.readFileSync(i,"utf8").split(`
|