fluxflow-cli 4.30.1 → 4.30.2
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,4 +1,4 @@
|
|
|
1
|
-
import{A as ll,a as Yi,b as Ze,c as rt,d as Cr,e as vr,f as zi,g as Ss,h as nn,i as Br,s as nl,v as rl,w as Do,y as sl,z as il}from"./chunk-LGI76ZQV.js";import{a as Yt,b as Ki,c as qi}from"./chunk-JS5ZIGFR.js";import{b as Ri,c as el,d as tl}from"./chunk-SZYN3VHU.js";import{a as ol}from"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import{c as Vi,e as En,f as Zt,g as ji}from"./chunk-QXN5B2BR.js";import"./chunk-U2NRX2PX.js";import{a as Zi}from"./chunk-A73NNVCZ.js";import{a as Wo,b as Bn,d as Er,e as Ms,f as Qi,h as Ji,i as qn}from"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import{a as Bt,b as xt,d as Wi,e as ht,f as Xi,j as ws,k as ys,l as Vn,n as Gi,o as Io}from"./chunk-53AFLLUU.js";import{a as Kn}from"./chunk-FQBBOFNP.js";import{a as jn}from"./chunk-Y5JU726N.js";import{b as Ho,c as hs,k as Ni}from"./chunk-KHCAQOSP.js";import{b as Ts}from"./chunk-
|
|
1
|
+
import{A as ll,a as Yi,b as Ze,c as rt,d as Cr,e as vr,f as zi,g as Ss,h as nn,i as Br,s as nl,v as rl,w as Do,y as sl,z as il}from"./chunk-LGI76ZQV.js";import{a as Yt,b as Ki,c as qi}from"./chunk-JS5ZIGFR.js";import{b as Ri,c as el,d as tl}from"./chunk-SZYN3VHU.js";import{a as ol}from"./chunk-56EJGQU3.js";import"./chunk-7SFAWGE2.js";import{c as Vi,e as En,f as Zt,g as ji}from"./chunk-QXN5B2BR.js";import"./chunk-U2NRX2PX.js";import{a as Zi}from"./chunk-A73NNVCZ.js";import{a as Wo,b as Bn,d as Er,e as Ms,f as Qi,h as Ji,i as qn}from"./chunk-VYTQ6J56.js";import"./chunk-RZTZPIC5.js";import{a as Bt,b as xt,d as Wi,e as ht,f as Xi,j as ws,k as ys,l as Vn,n as Gi,o as Io}from"./chunk-53AFLLUU.js";import{a as Kn}from"./chunk-FQBBOFNP.js";import{a as jn}from"./chunk-Y5JU726N.js";import{b as Ho,c as hs,k as Ni}from"./chunk-KHCAQOSP.js";import{b as Ts}from"./chunk-GNYMTG45.js";import{a as Fi,b as Ui,f as $i,g as Mr,h as Sr,j as Et,k as on,l as bs,r as _i}from"./chunk-QJZ24WJZ.js";import{a as ps,b as Dt}from"./chunk-RVCMZTHS.js";import{d as Ii,e as Di,f as ki,g as Ai,h as Li,i as Oi,k as yr,m as _o,n as Jt,o as Pi}from"./chunk-63V6P5DU.js";import{c as Tr,d as Bi,e as wr}from"./chunk-L3W2X74K.js";import{e as Hi}from"./chunk-NYIPDIEQ.js";import{a as lo,b as tn,c as fo,d as fs,e as xs,k as Yn}from"./chunk-DSVLWYIT.js";import Ys from"os";import e,{useState as R,useEffect as st,useRef as Ke,useMemo as Ln}from"react";import{Box as u,Text as l,useInput as qd,useStdout as zd,Static as Qd}from"ink";import Jd from"ink-spinner";import ot from"fs-extra";import Ct from"path";import{exec as yo}from"child_process";import{fileURLToPath as Zd}from"url";import _t,{useState as Ir,useEffect as Cs,useMemo as zn,useCallback as Ta,useRef as ko}from"react";import{Box as wa,Text as ao,useInput as ya}from"ink";function Ma(t,f){return t.replace(/\t/g," ".repeat(f))}function Dr(t){return t==null?"":t.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`)}function rn(t,f,x){let M=t,T=[...f].sort((s,v)=>s.start-v.start),b=0;for(let s of T){let v=s.start-b,m=Dr(s.text).split(`
|
|
4
4
|
`).length,A=s.text.length,k=(m>3?`[Pasted ${m} lines]`:`[Pasted ${A} chars]`).length,_=v+k;if(t<=v)break;if(t<_){M=s.end;break}else{let S=s.text.length-k;M+=S,b+=S}}return Math.min(M,x.length)}function vs(t,f,x,M,T=[]){let b=(t||"").slice(0,f),s=M(b).length,v=M(t||""),m=[...T].sort(($,F)=>F.start-$.start);for(let $ of m){let F=M(t.slice(0,$.start)).length,H=M($.text),K=F+H.length,xe=Dr($.text).split(`
|
|
@@ -1789,7 +1789,7 @@ import{e as f,t as g}from"./chunk-QJZ24WJZ.js";import{c as v}from"./chunk-DSVLWY
|
|
|
1789
1789
|
if (tableMode === 'daily') {
|
|
1790
1790
|
if (paginationContainer) paginationContainer.style.display = 'none';
|
|
1791
1791
|
titleEl.textContent = 'Daily Detailed Token Records';
|
|
1792
|
-
subtitleEl.textContent = 'Itemized log of daily
|
|
1792
|
+
subtitleEl.textContent = 'Itemized log of daily stats';
|
|
1793
1793
|
searchInput.placeholder = 'Filter by date...';
|
|
1794
1794
|
|
|
1795
1795
|
thead.innerHTML = \`
|
|
@@ -1860,7 +1860,7 @@ import{e as f,t as g}from"./chunk-QJZ24WJZ.js";import{c as v}from"./chunk-DSVLWY
|
|
|
1860
1860
|
} else if (tableMode === 'models') {
|
|
1861
1861
|
if (paginationContainer) paginationContainer.style.display = 'none';
|
|
1862
1862
|
titleEl.textContent = 'Model/Provider Token Statistics';
|
|
1863
|
-
subtitleEl.textContent = '
|
|
1863
|
+
subtitleEl.textContent = 'Stats per model';
|
|
1864
1864
|
searchInput.placeholder = 'Filter by model or provider...';
|
|
1865
1865
|
|
|
1866
1866
|
thead.innerHTML = \`
|
|
@@ -1981,7 +1981,7 @@ import{e as f,t as g}from"./chunk-QJZ24WJZ.js";import{c as v}from"./chunk-DSVLWY
|
|
|
1981
1981
|
} else if (tableMode === 'providers') {
|
|
1982
1982
|
if (paginationContainer) paginationContainer.style.display = 'none';
|
|
1983
1983
|
titleEl.textContent = 'Provider Statistics';
|
|
1984
|
-
subtitleEl.textContent = '
|
|
1984
|
+
subtitleEl.textContent = 'Stats per provider';
|
|
1985
1985
|
searchInput.placeholder = 'Filter by provider...';
|
|
1986
1986
|
|
|
1987
1987
|
thead.innerHTML = '<tr>' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-GNYMTG45.js";import"./chunk-QJZ24WJZ.js";import"./chunk-RVCMZTHS.js";import"./chunk-63V6P5DU.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{b as openUsageDashboard,a as startUsageServer};
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import{a as b}from"./chunks/chunk-DSVLWYIT.js";import{spawn as we}from"child_process";import{fileURLToPath as re}from"url";import he from"os";import j from"path";import T from"fs";import R from"dotenv";try{let t=j.join(b,"AGENTS.md"),g=j.join(b,"FLUXFLOW.md");T.existsSync(b)||T.mkdirSync(b,{recursive:!0}),T.existsSync(t)||T.writeFileSync(t,"","utf8"),T.existsSync(g)||T.writeFileSync(g,"","utf8")}catch{}R.config({path:"./.env",override:!0,quiet:!0});R.config({path:`${b}/.env`,override:!0,quiet:!0});R.config({path:`${b}/.env.agents`,override:!0,quiet:!0});R.config({path:`${b}/.env.fluxflow`,override:!0,quiet:!0});R.config({path:"./.env.agents",override:!0,quiet:!0});R.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var ve=he.totalmem(),ne=ve/(1024*1024),ye=.5,Se=Math.floor(ne*ye),ie=process.argv.slice(2),se=ie.indexOf("--allocation"),u=se!==-1?parseInt(ie[se+1],10):NaN,be=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)||be||!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(ne*.75),$e=!isNaN(u)&&u>0?Math.min(u,L):Math.max(1536,Math.min(32768,Se)),Ae=re(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))),we(process.execPath,[`--max-old-space-size=${$e}`,"--expose-gc","--max-semi-space-size=1",re(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",K=t.includes("--help")&&!g,Q=t.includes("--version")||t.includes("-v"),Z=t[0]==="--update",ee=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))),we(process.execPath,[`--max-old-space-size=${$e}`,"--expose-gc","--max-semi-space-size=1",re(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",K=t.includes("--help")&&!g,Q=t.includes("--version")||t.includes("-v"),Z=t[0]==="--update",ee=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-FPGU2LDO.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.
|
|
@@ -66,7 +66,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(Q&&(console.log(`v${n}`),pro
|
|
|
66
66
|
/docs View documentation
|
|
67
67
|
/fluxflow init Create FluxFlow.md template
|
|
68
68
|
/update check Check for new version
|
|
69
|
-
/update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let f=t[2]==="latest";try{let v=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;v||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(f?`Latest version: v${v}`:v!==n?`A new version of FluxFlow is available: v${v} (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 v=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),B=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):D({manager:e.value})},U=e=>{D({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:U})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(B,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},D=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-EMTQHDIH.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await v();i=s.manager,$=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=$||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:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-
|
|
69
|
+
/update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let f=t[2]==="latest";try{let v=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;v||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(f?`Latest version: v${v}`:v!==n?`A new version of FluxFlow is available: v${v} (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 v=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),B=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(W=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:k,isSelected:F})=>s.createElement(y,{width:"100%"},s.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",k)),O,X=()=>{let[k,F]=N("select"),[z,J]=N(""),P=e=>{e.value==="custom"?F("custom"):D({manager:e.value})},U=e=>{D({manager:"custom",customCommand:e})};return k==="custom"?s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(y,{flexDirection:"row"},s.createElement(S,{color:"cyan",bold:!0}," \u276F "),s.createElement(E,{value:z,onChange:J,onSubmit:U})),s.createElement(y,{marginTop:1},s.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(y,{flexDirection:"column",marginY:1},s.createElement(y,{marginBottom:1},s.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(B,{items:M,onSelect:P,itemComponent:H,indicatorComponent:()=>null}))},D=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-EMTQHDIH.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await v();i=s.manager,$=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=$||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:ae}=await import("react"),{render:le}=await import("ink"),{default:ce}=await import("./chunks/app-6FKKEDWQ.js");process.env.NODE_NO_WARNINGS="1";let pe=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],me=console.log,de=console.warn,ue=console.error,G=o=>{let m=o.map(String).join(" ");return pe.some(r=>m.includes(r))};console.log=(...o)=>!G(o)&&me(...o),console.warn=(...o)=>!G(o)&&de(...o),console.error=(...o)=>!G(o)&&ue(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+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"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||I){let o=t.includes("--new")||t.includes("-n"),r=(q!==-1?t.slice(q+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:
|
|
70
70
|
${a}
|
|
71
71
|
---
|
|
72
72
|
|
package/dist/package.json
CHANGED