fluxflow-cli 4.13.0 → 4.14.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/README.md +3 -0
- package/dist/chunks/{ai-6JVYA4PV.js → ai-HNN3MALK.js} +1 -1
- package/dist/chunks/app-ILOY6KF3.js +270 -0
- package/dist/chunks/chunk-2T5DRAKV.js +1 -0
- package/dist/chunks/chunk-74ELCQC2.js +912 -0
- package/dist/chunks/{chunk-E5LLK7O5.js → chunk-GIHKBLZL.js} +1 -1
- package/dist/chunks/{chunk-7JAWJV4U.js → chunk-HK42GQOK.js} +1 -1
- package/dist/chunks/{chunk-TYOB727A.js → chunk-MGOYH2GI.js} +1 -1
- package/dist/chunks/{chunk-EVDO64BW.js → chunk-QFQDJ2UU.js} +1 -1
- package/dist/chunks/{chunk-YS35YSMW.js → chunk-WLKCYZXG.js} +1 -1
- package/dist/chunks/{click-C6J7T7RF.js → click-TZZXO2WS.js} +2 -2
- package/dist/chunks/{computer_action-CJJTZQEI.js → computer_action-HLDFQW2N.js} +1 -1
- package/dist/chunks/{drag-Y7BI43K7.js → drag-X4EOVHGY.js} +1 -1
- package/dist/chunks/{generate_image-35IDBNYW.js → generate_image-X6KFW2B7.js} +1 -1
- package/dist/chunks/{invoke-4CCGIIYJ.js → invoke-JHL6QAGZ.js} +2 -2
- package/dist/chunks/{invokeSync-GGK2NNZK.js → invokeSync-5U2K27GY.js} +2 -2
- package/dist/chunks/{key_press-FQYXXELE.js → key_press-2OYFGVDO.js} +1 -1
- package/dist/chunks/{keyboard_typing-QYBCROI7.js → keyboard_typing-F7LZPK2R.js} +1 -1
- package/dist/chunks/{screen_grid-7QKZEE5T.js → screen_grid-WCLGUDIT.js} +1 -1
- package/dist/chunks/{scroll-NWD7AZH4.js → scroll-FJCGC26Y.js} +1 -1
- package/dist/chunks/{secrets-ZJQ4S4BU.js → secrets-CN3TKRTO.js} +1 -1
- package/dist/chunks/{settings-RQ72HWCU.js → settings-52EZL64F.js} +1 -1
- package/dist/chunks/{update_file-B64P2EXN.js → update_file-AEHGEWP5.js} +1 -1
- package/dist/chunks/usageServer-XH7QZPOB.js +1 -0
- package/dist/chunks/{write_file-THIYPKV2.js → write_file-L6RVJOKF.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/app-FSHFZE7H.js +0 -259
- package/dist/chunks/chunk-IIU3IJAG.js +0 -882
- package/dist/chunks/chunk-K676BNH2.js +0 -1
- package/dist/chunks/usageServer-V3C5UWIH.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $}from"./chunk-KFM2OZWJ.js";import{k as S,l as C,m as B}from"./chunk-
|
|
1
|
+
import{a as $}from"./chunk-KFM2OZWJ.js";import{k as S,l as C,m as B}from"./chunk-HK42GQOK.js";import{l as I}from"./chunk-WLKCYZXG.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";import{a as T}from"./chunk-Y5JU726N.js";import b from"fs-extra";import E from"path";var F=(a,y={})=>{try{if(a.length<8||a[0]!==137||a[1]!==80||a[2]!==78||a[3]!==71)return a;let s=[],c=[];for(let r=0;r<256;r++){let e=r;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;c[r]=e}let l=r=>{let e=4294967295;for(let n=0;n<r.length;n++)e=c[(e^r[n])&255]^e>>>8;return(e^4294967295)>>>0},f=(r,e)=>{let n=Buffer.from(r,"ascii"),i=Buffer.from(e,"utf-8"),u=n.length+1+i.length,o=Buffer.alloc(8+u+4);o.writeUInt32BE(u,0),o.write("tEXt",4,"ascii"),n.copy(o,8),o[8+n.length]=0,i.copy(o,8+n.length+1);let w=l(o.subarray(4,8+u));return o.writeUInt32BE(w,8+u),o};for(let[r,e]of Object.entries(y))e!=null&&s.push(f(r,String(e)));if(s.length===0)return a;if(a.subarray(12,16).toString("ascii")==="IHDR"){let e=a.subarray(0,33),n=a.subarray(33);return Buffer.concat([e,...s,n])}return a}catch{return a}},N=async(a,y={})=>{let s=T(a),c=s.prompt||s.text,l=s.path||s.outputPath||s.output||"generated_image.png",f=s.ratio;if(!c)return'ERROR: Missing "prompt" argument for generate_image.';let r=["nsfw","naked","nudity","nude","porn","sex","xxx","erotic","gore","bloody","violence","abuse","suicide","murder","hentai","pedophile","rape"],e=c.toLowerCase();if(r.some(i=>e.includes(i)))return"ERROR: Prompt blocked by system safety filter (inappropriate or unsafe content detected).";try{let i=await I();if(!await S(i))return`ERROR: Insufficient Quota for selected quality. Either tell user reduce quality or wait for next refresh cycle (${(await C()).nextResetMin||60}m).`;let o=i.imageSettings||{keyType:"Default",quality:"Low-High",apiKey:""},w=o.keyType==="Custom"&&o.apiKey?o.apiKey:FALLBACK_IMAGE_KEY,x={Low:"flux","Low-High":"zimage",Medium:"gptimage","Medium-High":"gptimage",High:"qwen-image",Ultra:"gptimage-large",Premium:"nanobanana-pro"}[o.quality]||"zimage",g=1024,m=1024;if(f){let t=f.replace(/\s+/g,"");t==="16:9"?(g=1024,m=576):t==="9:16"?(g=576,m=1024):t==="4:3"?(g=1024,m=768):t==="3:4"?(g=768,m=1024):t==="1:1"&&(g=1024,m=1024)}let M=Math.floor(Math.random()*1e7),k=`https://gen.pollinations.ai/image/${encodeURIComponent(c)}?model=${x}&width=${g}&height=${m}&seed=${M}&enhance=true&reasoning=high&quality=high&negative=${encodeURIComponent("deformed, distorted, disfigured, poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated hands and fingers, blurry, low quality, low resolution, extra fingers, censored, watermarks, signatures")}`,d=await fetch(k,{method:"GET",headers:{Authorization:`Bearer ${w}`}});if(!d.ok){let t=d.status,h="";try{h=await d.text()}catch{}return t===402||h.includes("Insufficient balance")||h.includes("PAYMENT_REQUIRED")?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed with status [${t}]: ${h||"Unknown API Error"}`}if((d.headers.get("content-type")||"").includes("application/json")){let t=await d.json();return t.status===402||t.error&&t.error.code==="PAYMENT_REQUIRED"?"ERROR: Image Generation Currently unavailable. Try again later.":`ERROR: Image Generation failed: ${t.error?.message||JSON.stringify(t)}`}let O=await d.arrayBuffer(),p=Buffer.from(O),P={Title:c,Description:"Generated via FluxFlow CLI",Software:"FluxFlow CLI",Author:"FluxFlow","Creation Time":new Date().toISOString(),Prompt:c,Model:`Fluxflow:${x}`,Ratio:f||"1:1",Seed:String(M)};p=F(p,P);let R=E.resolve(process.cwd(),l);await b.ensureDir(E.dirname(R)),await $.recordFileChange(R),await b.writeFile(R,p),await B(i);let v=E.extname(l).toLowerCase(),L={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp"}[v]||"image/png";return y.isMultiModal!==!1?{text:`SUCCESS: Image successfully generated from prompt [${c}] and saved to [${l}]. Output attached to multimodal part`,binaryPart:{inlineData:{data:p.toString("base64"),mimeType:L}}}:`SUCCESS: Image successfully generated from prompt [${c}] and saved to [${l}].`}catch(i){return`ERROR: Failed during image generation: ${i instanceof Error?i.message:String(i)}`}};export{N as generate_image};
|
|
@@ -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-HNN3MALK.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],M={...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: [tool:functions.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((_,A)=>_+A.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g*10)/10}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,M,C,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")){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-HNN3MALK.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-
|
|
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-HNN3MALK.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-HNN3MALK.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
1
|
+
import{b as e}from"./chunk-MGOYH2GI.js";import"./chunk-QFQDJ2UU.js";import{a as i}from"./chunk-Y5JU726N.js";var k=async(s,c={})=>{let t=i(s),a=t.key||t.keys||t.input||t.shortcut;if(!a)return'ERROR: Missing required "key" parameter for KeyPress tool.';let r=String(a).trim().toLowerCase();if(r==="clearinput"||r==="clear_input"||r==="clear")return await e("clear_input");if(r==="back"||r==="browser_back"||r==="browserBack")return await e("browser_back");if(r.includes(";")||r.includes("+")){let o=r.split(/[;+]/).map(n=>n.trim()).filter(Boolean);return await e("key_combination",o)}return await e("key_press",r)};export{k as key_press};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-MGOYH2GI.js";import"./chunk-QFQDJ2UU.js";import{a as r}from"./chunk-Y5JU726N.js";var p=async(o,u={})=>{let t=r(o),e=t.text||t.input||t.value||"",s=t.autoPressEnter===!0||t.autoPressEnter==="true"||t.enter===!0||t.enter==="true";return e==null?'ERROR: Missing required "text" parameter for KeyboardTyping tool.':await n("type",String(e),{autoPressEnter:s})};export{p as keyboard_typing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-QFQDJ2UU.js";export{a as GRID_CONFIG,c as captureGriddedScreenshot,b as getActiveDisplay,e as gridToNativeCoordinates,d as parseGridCodeTo720p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-MGOYH2GI.js";import"./chunk-QFQDJ2UU.js";import{a as t}from"./chunk-Y5JU726N.js";var m=async(n,i={})=>{let o=t(n),e=(o.direction||"down").toLowerCase(),c=o.amount?parseInt(o.amount,10):6,s=o.gridId||o.grid||o.coordinate||o.target||o.id||null;return await r("scroll",s,{direction:e,amount:c})};export{m as scroll};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-2T5DRAKV.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";export{a as getAPIKey,b as getProviderAPIKey,f as getSearchSecrets,d as getSecret,k as removeAPIKey,j as removeSecret,g as saveAPIKey,c as saveProviderAPIKey,i as saveSearchId,h as saveSearchKey,e as saveSecret};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as a,m as b}from"./chunk-
|
|
1
|
+
import{l as a,m as b}from"./chunk-WLKCYZXG.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as h,f as m,g as R}from"./chunk-2PMRX4CK.js";import{a as F}from"./chunk-KFM2OZWJ.js";import{l as g}from"./chunk-
|
|
1
|
+
import{e as h,f as m,g as R}from"./chunk-2PMRX4CK.js";import{a as F}from"./chunk-KFM2OZWJ.js";import{l as g}from"./chunk-WLKCYZXG.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";import{a as $}from"./chunk-Y5JU726N.js";import c from"fs";import M from"path";var v=async(w,S={})=>{let n=$(w),t=n.path;if(!t)return'ERROR: Missing "path" argument for PatchFile.';let{patchPairs:o,allowMultiple:C,error:p}=h(n);if(p)return`ERROR: ${p}`;if(o.length===0)return"ERROR: No valid replacement pairs found. Use searchContent1, newContent1, etc.";let E=n.allowMultiple!==void 0?n.allowMultiple===!0||String(n.allowMultiple).toLowerCase()==="true":C,i=M.resolve(process.cwd(),t);try{if(!c.existsSync(i))return`ERROR: File [${t}] does not exist. Use WriteFile instead.`;let e=S.forcedContent||c.readFileSync(i,"utf8");e.startsWith("\uFEFF")&&(e=e.slice(1));let s=e.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`),{content:u,results:l}=m(s,o,{allowMultiple:E}),a=l.filter(r=>!r.success),f=l.filter(r=>r.success);if(f.length===0)return`ERROR: Patch Failed to apply to [${t}].
|
|
4
4
|
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-GIHKBLZL.js";import"./chunk-HK42GQOK.js";import"./chunk-WLKCYZXG.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";export{b as openUsageDashboard,a as startUsageServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-KFM2OZWJ.js";import{l as $}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-KFM2OZWJ.js";import{l as $}from"./chunk-WLKCYZXG.js";import"./chunk-SIINYZWE.js";import"./chunk-FDNLMLIM.js";import{a as R}from"./chunk-Y5JU726N.js";import r from"fs";import C from"path";var B=async(w,E={})=>{let{path:s,content:o}=R(w);if(!s)return'ERROR: Missing "path" argument for write_file.';if(o===void 0)return'ERROR: Missing "content" argument for write_file.';o=o.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let t=C.resolve(process.cwd(),s),m=C.dirname(t);try{await y.recordFileChange(t);let n="";if(r.existsSync(t))try{n=`Old File contents:
|
|
4
4
|
${r.readFileSync(t,"utf8").split(/\r?\n/).map((g,j)=>`${j+1} | ${g}`).join(`
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import{a as m}from"./chunks/chunk-FDNLMLIM.js";import{spawn as ce}from"child_process";import{fileURLToPath as D}from"url";import ue from"os";import B from"path";import S from"fs";import h from"dotenv";try{let e=B.join(m,"AGENTS.md"),n=B.join(m,"FLUXFLOW.md");!S.existsSync(e)&&!S.existsSync(n)&&(S.existsSync(m)||S.mkdirSync(m,{recursive:!0}),S.writeFileSync(e,"","utf8"))}catch{}h.config({path:"./.env",override:!0,quiet:!0});h.config({path:`${m}/.env`,override:!0,quiet:!0});h.config({path:`${m}/.env.agents`,override:!0,quiet:!0});h.config({path:`${m}/.env.fluxflow`,override:!0,quiet:!0});h.config({path:"./.env.agents",override:!0,quiet:!0});h.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var me=ue.totalmem(),j=me/(1024*1024),pe=.5,de=Math.floor(j*pe),G=process.argv.slice(2),U=G.indexOf("--allocation"),s=U!==-1?parseInt(G[U+1],10):NaN,ge=process.env.EXPERIMENTAL_MEMORY_MANAGER==="true"||process.env.EXPERIMENTAL_MEMORY_MANAGER==="1"||process.env.EXPERIMENTAL_MEMORY_MANAGER===!0||process.env.EXPERIMENTAL_MEMORY_MANAGER===1||!1,fe=!isNaN(s)||ge||!1;!isNaN(s)&&s<64&&(console.error(`
|
|
3
3
|
[ERROR] Allocation value '${s} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
4
|
`),process.exit(1));var M=Math.floor(j*.75),xe=!isNaN(s)&&s>0?Math.min(s,M):Math.max(1536,Math.min(32768,de)),he=D(import.meta.url).endsWith(".js");if(he&&!process.execArgv.some(e=>e.includes("max-old-space-size"))&&fe)Number.isNaN(s)||(console.log(`
|
|
5
|
-
[MEMORY] Starting with: '${s>M?M:s} MB' Allocation${s>M?" (Max allowed: '"+M+" MB')":""}. Please Wait...`),await new Promise(n=>setTimeout(n,5e3))),ce(process.execPath,[`--max-old-space-size=${xe}`,"--expose-gc","--max-semi-space-size=1",D(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",n=>process.exit(n||0));else{let e=process.argv.slice(2),n=e.includes("--help")&&e[e.indexOf("--help")+1]==="commands",P=e.includes("--help")&&!n,N=e.includes("--version")||e.includes("-v"),R=e[0]==="--update",I=e[0]==="--export";if(e[0]==="--usage"||e.includes("--usage")||e[0]==="--budget"||e.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-
|
|
5
|
+
[MEMORY] Starting with: '${s>M?M:s} MB' Allocation${s>M?" (Max allowed: '"+M+" MB')":""}. Please Wait...`),await new Promise(n=>setTimeout(n,5e3))),ce(process.execPath,[`--max-old-space-size=${xe}`,"--expose-gc","--max-semi-space-size=1",D(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",n=>process.exit(n||0));else{let e=process.argv.slice(2),n=e.includes("--help")&&e[e.indexOf("--help")+1]==="commands",P=e.includes("--help")&&!n,N=e.includes("--version")||e.includes("-v"),R=e[0]==="--update",I=e[0]==="--export";if(e[0]==="--usage"||e.includes("--usage")||e[0]==="--budget"||e.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-XH7QZPOB.js"),{url:r}=await o();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
7
|
\u2800\u2800\u2514\u2500 Serving at: ${r}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
@@ -63,4 +63,4 @@ Usage: fluxflow --export error`),process.exit(1)}if(N&&(console.log(`v${d}`),pro
|
|
|
63
63
|
/docs View documentation
|
|
64
64
|
/fluxflow init Create FluxFlow.md template
|
|
65
65
|
/update check Check for new version
|
|
66
|
-
/update latest Install latest release`),process.exit(0)),R){let v=e[1]||"latest";if(v==="check"){let l=e[2]==="latest";try{let x=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;x||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(l?`Latest version: v${x}`:x!==d?`A new version of FluxFlow is available: v${x} (current: v${d}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${d}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(v==="latest"){console.log("Checking latest version and settings...");try{let a=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;a||(console.error("Error: Could not retrieve latest version."),process.exit(1)),a===d&&(console.log(`FluxFlow is already up to date (v${d}).`),process.exit(0));let x=async()=>{let t=(await import("react")).default,{useState:L}=t,{render:K,Box:f,Text:y}=await import("ink"),Q=(await import("ink-select-input")).default,Z=(await import("ink-text-input")).default;return new Promise(ee=>{let oe=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],te=({label:b,isSelected:C})=>t.createElement(f,{width:"100%"},t.createElement(y,{bold:C},"\u2514\u2500 ",C?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",b)),T,se=()=>{let[b,C]=L("select"),[ae,ne]=L(""),ie=F=>{F.value==="custom"?C("custom"):_({manager:F.value})},le=F=>{_({manager:"custom",customCommand:F})};return b==="custom"?t.createElement(f,{flexDirection:"column",marginY:1},t.createElement(f,{marginBottom:1},t.createElement(y,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),t.createElement(f,{flexDirection:"row"},t.createElement(y,{color:"cyan",bold:!0}," \u276F "),t.createElement(Z,{value:ae,onChange:ne,onSubmit:le})),t.createElement(f,{marginTop:1},t.createElement(y,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):t.createElement(f,{flexDirection:"column",marginY:1},t.createElement(f,{marginBottom:1},t.createElement(y,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),t.createElement(Q,{items:oe,onSelect:ie,itemComponent:te,indicatorComponent:()=>null}))},_=b=>{T&&T(),ee(b)},{unmount:re}=K(t.createElement(se,null));T=re})},u,O="",E;try{let{loadSettings:t}=await import("./chunks/settings-
|
|
66
|
+
/update latest Install latest release`),process.exit(0)),R){let v=e[1]||"latest";if(v==="check"){let l=e[2]==="latest";try{let x=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;x||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(l?`Latest version: v${x}`:x!==d?`A new version of FluxFlow is available: v${x} (current: v${d}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${d}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(v==="latest"){console.log("Checking latest version and settings...");try{let a=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;a||(console.error("Error: Could not retrieve latest version."),process.exit(1)),a===d&&(console.log(`FluxFlow is already up to date (v${d}).`),process.exit(0));let x=async()=>{let t=(await import("react")).default,{useState:L}=t,{render:K,Box:f,Text:y}=await import("ink"),Q=(await import("ink-select-input")).default,Z=(await import("ink-text-input")).default;return new Promise(ee=>{let oe=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],te=({label:b,isSelected:C})=>t.createElement(f,{width:"100%"},t.createElement(y,{bold:C},"\u2514\u2500 ",C?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",b)),T,se=()=>{let[b,C]=L("select"),[ae,ne]=L(""),ie=F=>{F.value==="custom"?C("custom"):_({manager:F.value})},le=F=>{_({manager:"custom",customCommand:F})};return b==="custom"?t.createElement(f,{flexDirection:"column",marginY:1},t.createElement(f,{marginBottom:1},t.createElement(y,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),t.createElement(f,{flexDirection:"row"},t.createElement(y,{color:"cyan",bold:!0}," \u276F "),t.createElement(Z,{value:ae,onChange:ne,onSubmit:le})),t.createElement(f,{marginTop:1},t.createElement(y,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):t.createElement(f,{flexDirection:"column",marginY:1},t.createElement(f,{marginBottom:1},t.createElement(y,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),t.createElement(Q,{items:oe,onSelect:ie,itemComponent:te,indicatorComponent:()=>null}))},_=b=>{T&&T(),ee(b)},{unmount:re}=K(t.createElement(se,null));T=re})},u,O="",E;try{let{loadSettings:t}=await import("./chunks/settings-52EZL64F.js");E=await t(),u=E?.systemSettings?.updateManager||E?.updateManager}catch{}if(!u){let t=await x();u=t.manager,O=t.customCommand}let g="";u==="pnpm"?g=`pnpm add -g fluxflow-cli@${a}`:u==="bun"?g=`bun add -g fluxflow-cli@${a}`:u==="yarn"?g=`yarn global add fluxflow-cli@${a}`:u==="custom"?g=O||E?.customUpdateCommand||`npm install -g fluxflow-cli@${a}`:g=`npm install -g fluxflow-cli@${a}`,console.log(`Updating FluxFlow to v${a} using ${u}...`),console.log(`Running: ${g}`);let{execSync:J}=await import("child_process");J(g,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${a}.\x1B[0m`)}catch(l){console.error("\x1B[31m\u274C Update failed:\x1B[0m",l.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:Y}=await import("react"),{render:W}=await import("ink"),{default:q}=await import("./chunks/app-ILOY6KF3.js");process.env.NODE_NO_WARNINGS="1";let X=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],H=console.log,V=console.warn,z=console.error,k=o=>{let r=o.map(String).join(" ");return X.some(i=>r.includes(i))};console.log=(...o)=>!k(o)&&H(...o),console.warn=(...o)=>!k(o)&&V(...o),console.error=(...o)=>!k(o)&&z(...o);let A=e.findIndex(o=>o==="--cwd"||o==="--path");if(A!==-1&&A+1<e.length){let o=e[A+1],r=await import("path"),i=await import("fs-extra"),p=r.default.resolve(o);try{i.default.existsSync(p)&&i.default.statSync(p).isDirectory()?process.chdir(p):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(w){console.error(`[ERROR] Failed to change directory to "${o}": ${w.message}`),process.exit(0)}}process.stdout.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07"),process.stdout.write("\x1B[?2004h"));let $=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",$),["SIGINT","SIGTERM","SIGHUP"].forEach(o=>{process.once(o,()=>{$(),process.exit(0)})}),e.includes("--playground")){let o=process.cwd();process.argv.push("--original-cwd",o);let{DATA_DIR:r}=await import("./chunks/paths-PM7MFWJK.js"),i=await import("path"),p=await import("fs-extra"),w=i.default.join(r,"playground");try{p.default.ensureDirSync(w),process.chdir(w)}catch{}}W(Y.createElement(q,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED