fluxflow-cli 4.39.0 → 4.40.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-Z2RCLVQR.js → ai-7QKBUDTZ.js} +1 -1
- package/dist/chunks/app-UJZARXCV.js +324 -0
- package/dist/chunks/{auto_completion-AIWB2XM2.js → auto_completion-RBEVTROV.js} +2 -2
- package/dist/chunks/{chunk-M2LU3TCU.js → chunk-APL7DQ7S.js} +1 -1
- package/dist/chunks/chunk-JTITXS7B.js +1 -0
- package/dist/chunks/{chunk-MX5Q32YU.js → chunk-OLQYLDNC.js} +1 -1
- package/dist/chunks/{chunk-HIP66OBL.js → chunk-UYWKQZ3D.js} +175 -173
- package/dist/chunks/{chunk-IXXTQAO2.js → chunk-WWRLNBDT.js} +1 -1
- package/dist/chunks/{click-O33RKVOZ.js → click-DL6M37AS.js} +2 -2
- package/dist/chunks/{computer_action-BUZAZ3LJ.js → computer_action-EMOKDYYR.js} +1 -1
- package/dist/chunks/{drag-BZRZLDLG.js → drag-WOY67DNR.js} +1 -1
- package/dist/chunks/{generate_image-N2SIC5BA.js → generate_image-NZGID2Y2.js} +1 -1
- package/dist/chunks/{invoke-O2YAE4FY.js → invoke-ABHHLDTD.js} +2 -2
- package/dist/chunks/{invokeSync-URGZXNDC.js → invokeSync-RNFLZCPV.js} +2 -2
- package/dist/chunks/{key_press-Y7F3VAKL.js → key_press-A7AVAUQA.js} +1 -1
- package/dist/chunks/{keyboard_typing-IEVRWQJJ.js → keyboard_typing-COAVEOJM.js} +1 -1
- package/dist/chunks/{screen_grid-7APUBF2H.js → screen_grid-DMDO5YC3.js} +1 -1
- package/dist/chunks/{scroll-FIN5Z7W4.js → scroll-OFESVZ7L.js} +1 -1
- package/dist/chunks/{search_keyword-YLKWY2XH.js → search_keyword-IXMFP35K.js} +1 -1
- package/dist/chunks/{settings-IGHDSHFT.js → settings-4VMHJDHK.js} +1 -1
- package/dist/chunks/{update_file-CYGKZXSH.js → update_file-3WHORCBX.js} +1 -1
- package/dist/chunks/{usage-IR23BYQX.js → usage-FDNLBYGE.js} +1 -1
- package/dist/chunks/{usageServer-ZYJCDO27.js → usageServer-FRXNO6LD.js} +1 -1
- package/dist/chunks/{write_file-TZ2Q6CEB.js → write_file-LNHCLACS.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
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import{a as $}from"./chunks/chunk-26BQ45XP.js";import{spawn as he}from"child_process";import{fileURLToPath as ie}from"url";import ve from"os";import Q from"path";import R from"fs";import T from"dotenv";try{let t=Q.join($,"AGENTS.md"),g=Q.join($,"FLUXFLOW.md");R.existsSync($)||R.mkdirSync($,{recursive:!0}),R.existsSync(t)||R.writeFileSync(t,"","utf8"),R.existsSync(g)||R.writeFileSync(g,"","utf8")}catch{}T.config({path:"./.env",override:!0,quiet:!0});T.config({path:`${$}/.env`,override:!0,quiet:!0});T.config({path:`${$}/.env.agents`,override:!0,quiet:!0});T.config({path:`${$}/.env.fluxflow`,override:!0,quiet:!0});T.config({path:"./.env.agents",override:!0,quiet:!0});T.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var ye=ve.totalmem(),ae=ye/(1024*1024),Se=.5,be=Math.floor(ae*Se),le=process.argv.slice(2),ne=le.indexOf("--allocation"),u=ne!==-1?parseInt(le[ne+1],10):NaN,$e=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,Ce=!isNaN(u)||$e||!1;!isNaN(u)&&u<64&&(console.error(`
|
|
3
3
|
[ERROR] Allocation value '${u} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
4
|
`),process.exit(1));var L=Math.floor(ae*.75),ke=!isNaN(u)&&u>0?Math.min(u,L):Math.max(1536,Math.min(32768,be)),Ae=ie(import.meta.url).endsWith(".js");if(Ae&&!process.execArgv.some(t=>t.includes("max-old-space-size"))&&Ce)Number.isNaN(u)||(console.log(`
|
|
5
|
-
[MEMORY] Starting with: '${u>L?L:u} MB' Allocation${u>L?" (Max allowed: '"+L+" MB')":""}. Please Wait...`),await new Promise(g=>setTimeout(g,5e3))),he(process.execPath,[`--max-old-space-size=${ke}`,"--expose-gc","--max-semi-space-size=1",ie(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",g=>process.exit(g||0));else{let t=process.argv.slice(2),g=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",Z=t.includes("--help")&&!g,ee=t.includes("--version")||t.includes("-v"),te=t[0]==="--update",oe=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-
|
|
5
|
+
[MEMORY] Starting with: '${u>L?L:u} MB' Allocation${u>L?" (Max allowed: '"+L+" MB')":""}. Please Wait...`),await new Promise(g=>setTimeout(g,5e3))),he(process.execPath,[`--max-old-space-size=${ke}`,"--expose-gc","--max-semi-space-size=1",ie(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",g=>process.exit(g||0));else{let t=process.argv.slice(2),g=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",Z=t.includes("--help")&&!g,ee=t.includes("--version")||t.includes("-v"),te=t[0]==="--update",oe=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-FRXNO6LD.js"),{url:m}=await o();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
7
|
\u2800\u2800\u2514\u2500 Serving at: ${m}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
@@ -57,7 +57,6 @@ Usage: fluxflow --export error`),process.exit(1)}if(ee&&(console.log(`v${n}`),pr
|
|
|
57
57
|
/settings Configure system preferences
|
|
58
58
|
/theme Customize UI color theme
|
|
59
59
|
/key Manage API keys
|
|
60
|
-
/profile Edit developer persona
|
|
61
60
|
/memory <view|migrate> Manage agent memory or migrate to AGENTS.md
|
|
62
61
|
/stats Show session usage
|
|
63
62
|
/usage Open graphical token analytics dashboard in browser
|
|
@@ -67,7 +66,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(ee&&(console.log(`v${n}`),pr
|
|
|
67
66
|
/docs View documentation
|
|
68
67
|
/fluxflow init Create FluxFlow.md template
|
|
69
68
|
/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:
|
|
69
|
+
/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:M,isSelected:E})=>s.createElement(S,{width:"100%"},s.createElement(b,{bold:E},"\u2514\u2500 ",E?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",M)),O,W=()=>{let[M,E]=N("select"),[X,V]=N(""),z=h=>{h.value==="custom"?E("custom"):D({manager:h.value})},J=h=>{D({manager:"custom",customCommand:h})};return M==="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=M=>{O&&O(),Y(M)},{unmount:H}=U(s.createElement(W,null));O=H})},i,k="",A;try{let{loadSettings:s}=await import("./chunks/settings-4VMHJDHK.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await y();i=s.manager,k=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=k||A?.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-UJZARXCV.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
70
|
${a}
|
|
72
71
|
---
|
|
73
72
|
|
|
@@ -79,16 +78,16 @@ ${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let v of process.stdin
|
|
|
79
78
|
${a}
|
|
80
79
|
---
|
|
81
80
|
|
|
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-
|
|
81
|
+
${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-4VMHJDHK.js"),{getProviderAPIKey:f}=await import("./chunks/secrets-5TCTEPEV.js"),{getDefaultModel:l}=await import("./chunks/model_config-32SB7PTZ.js"),{generateSimpleContent:c}=await import("./chunks/ai-7QKBUDTZ.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-FDNLBYGE.js"),i=await C(),k=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),A=I||k.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let v=k.indexOf(a);if(v!==-1&&v+1<k.length)return k[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}`,M=(P.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),E=Q.basename(M).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),X=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
83
82
|
Use NO markdown, only plain text
|
|
84
83
|
Context:
|
|
85
84
|
- OS: ${Y}
|
|
86
|
-
- Model: ${
|
|
85
|
+
- Model: ${E}
|
|
87
86
|
- Approx time: ${H}
|
|
88
87
|
- Non interactive CLI, support piped inputs
|
|
89
88
|
- 'fluxflow' TUI has full agentic tools${b.trim().length>0?`
|
|
90
89
|
User Nickname: ${b.trim()}`:""}${_.trim().length>0?`
|
|
91
|
-
User Preferences: ${_.trim()}`:""}`.trim(),{getPromptSessionHistory:V,savePromptSessionHistory:z,clearPromptSessionHistory:J}=await import("./chunks/sessionDaemon-GHQTAGDG.js"),h=[];o&&!I?await J():o||(h=await V());let K=[];if(Array.isArray(h)&&h.length>0)for(let e of h)e.text&&K.push({role:e.role==="model"?"model":"user",parts:[{text:e.text}]});K.push({role:"user",parts:[{text:r}]});try{if(!A){let v="\x1B[36m",xe="\x1B[35m",re="\x1B[0m",we=
|
|
90
|
+
User Preferences: ${_.trim()}`:""}`.trim(),{getPromptSessionHistory:V,savePromptSessionHistory:z,clearPromptSessionHistory:J}=await import("./chunks/sessionDaemon-GHQTAGDG.js"),h=[];o&&!I?await J():o||(h=await V());let K=[];if(Array.isArray(h)&&h.length>0)for(let e of h)e.text&&K.push({role:e.role==="model"?"model":"user",parts:[{text:e.text}]});K.push({role:"user",parts:[{text:r}]});try{if(!A){let v="\x1B[36m",xe="\x1B[35m",re="\x1B[0m",we=E;process.stdout.write(`Responding with ${v}${we}${re} from ${xe}${P.aiProvider}${re}:
|
|
92
91
|
`)}let{text:e}=await c(P,s,K,X,P.thinkingLevel),a=(e||"").trim();process.stdout.write(a+`
|
|
93
92
|
${A?"":`
|
|
94
93
|
`}`),a&&await z(r,a)}catch(e){console.error(`[ERROR] Prompt request failed: ${e.message.trim()}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED