fluxflow-cli 4.23.2 → 4.23.4
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 +1 -1
- package/dist/chunks/{addMemScore-HPTGXICT.js → addMemScore-COX3MDEK.js} +1 -1
- package/dist/chunks/{ai-4QWVJQQT.js → ai-QZPSCQTC.js} +1 -1
- package/dist/chunks/{app-F2FUSYYF.js → app-VDMSLYCY.js} +2 -2
- package/dist/chunks/{chat-HHMMKXDE.js → chat-J5AAPLPF.js} +1 -1
- package/dist/chunks/{chunk-VWSAPCIS.js → chunk-6KFABN4O.js} +1 -1
- package/dist/chunks/{chunk-74DZYKIT.js → chunk-7UNVYHZ7.js} +1 -1
- package/dist/chunks/{chunk-Y6DZDEJ5.js → chunk-BSUDXEA2.js} +1 -1
- package/dist/chunks/{chunk-ZH24NCF3.js → chunk-D7RU7MKC.js} +21 -29
- package/dist/chunks/{chunk-S25OD4YB.js → chunk-F6DMKN7N.js} +6 -6
- package/dist/chunks/{chunk-YUJMCXJA.js → chunk-IRFTRBG2.js} +1 -1
- package/dist/chunks/chunk-L3W2X74K.js +1 -0
- package/dist/chunks/{chunk-PS3TUC3G.js → chunk-OOTXMJIA.js} +1 -1
- package/dist/chunks/{chunk-ORXN6WUW.js → chunk-P52SKLRJ.js} +1 -1
- package/dist/chunks/{chunk-JWZGZEZA.js → chunk-U6UKO6MO.js} +1 -1
- package/dist/chunks/{chunk-5F3QPKCX.js → chunk-WMRT2YZU.js} +1 -1
- package/dist/chunks/{chunk-XCUZ3OIF.js → chunk-XIH6C5WL.js} +1 -1
- package/dist/chunks/{chunk-NPYHHQDC.js → chunk-Z4HHJIHG.js} +1 -1
- package/dist/chunks/{click-E6NYFK47.js → click-HS7NJR6J.js} +2 -2
- package/dist/chunks/{computer_action-GP5ARBTA.js → computer_action-YCFAAZNA.js} +1 -1
- package/dist/chunks/{drag-3QT4IG5X.js → drag-SBWNKGDV.js} +1 -1
- package/dist/chunks/{emergency_rollback-ZVBFZBFU.js → emergency_rollback-6M5EH75W.js} +1 -1
- package/dist/chunks/{exec_command-2AU2ICOX.js → exec_command-ER3K4TLH.js} +1 -1
- package/dist/chunks/{generate_image-J5SWUTUI.js → generate_image-S6M2GCD7.js} +1 -1
- package/dist/chunks/{invoke-4OQX5TRY.js → invoke-ZGIGNTE6.js} +2 -2
- package/dist/chunks/{invokeSync-YUAXMXVT.js → invokeSync-LXDZKOPO.js} +2 -2
- package/dist/chunks/{key_press-4ZHQKB6I.js → key_press-BT6QQ24M.js} +1 -1
- package/dist/chunks/{keyboard_typing-IOO3FFFJ.js → keyboard_typing-IWKUCQE4.js} +1 -1
- package/dist/chunks/{memory-TVFFXCSD.js → memory-5CNSGF6X.js} +1 -1
- package/dist/chunks/{saveSummary-HFAPNJJH.js → saveSummary-XQ2STWSN.js} +1 -1
- package/dist/chunks/{screen_grid-DR34XH4Z.js → screen_grid-YL4W6LEM.js} +1 -1
- package/dist/chunks/{scroll-HV6GUO5L.js → scroll-TA2JTVSR.js} +1 -1
- package/dist/chunks/{secrets-RFEEPY3S.js → secrets-BJGXCZRP.js} +1 -1
- package/dist/chunks/settings-ZDBO3FHN.js +1 -0
- package/dist/chunks/{todo-7Q2JBEVP.js → todo-C5HHG7TN.js} +1 -1
- package/dist/chunks/{update_file-IW7GUUIG.js → update_file-2YCGNOBP.js} +1 -1
- package/dist/chunks/{usage-5LVLEH5S.js → usage-6BBHZ76S.js} +1 -1
- package/dist/chunks/usageServer-CSS2XQH3.js +1 -0
- package/dist/chunks/{write_docx-IUKMO7XL.js → write_docx-J5OO4ZSE.js} +1 -1
- package/dist/chunks/{write_file-SP26GOE3.js → write_file-MDPZMOG3.js} +3 -3
- package/dist/chunks/{write_pdf-UM6Z2J4K.js → write_pdf-KF7HZODR.js} +1 -1
- package/dist/cli.js +25 -23
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-SIINYZWE.js +0 -1
- package/dist/chunks/settings-6BPZ6DG5.js +0 -1
- package/dist/chunks/usageServer-F2KOFF6O.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-U6UKO6MO.js";import"./chunk-6KFABN4O.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-BSUDXEA2.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-OOTXMJIA.js";import"./chunk-QGPOMXO4.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-IRFTRBG2.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import{c as k}from"./chunk-RI37VZYB.js";import l from"fs";import $ from"path";var G=async(R,x={})=>{let{method:f,tasks:m,markDone:d}=y(R),A=x.chatId||"default";if(!f)return'ERROR: Missing "method" argument for Goal tool (create/append/get).';let u=$.join(k,"plan",A),o=$.join(u,"todo.md"),S=t=>{if(!t||Array.isArray(t))return t;let s=String(t).trim();if(s.startsWith("[")&&s.endsWith("]")){let i=s.match(/"([^"\\]*(?:\\.[^"\\]*)*)"|'([^'\\]*(?:\\.[^'\\]*)*)'/g);return i?i.map(n=>n.slice(1,-1).replace(/\\(.)/g,"$1")):s.slice(1,-1).split(",").map(n=>n.trim()).filter(Boolean)}return t},C=t=>{let s=S(t);return s?(Array.isArray(s)?s:String(s).split(`
|
|
2
2
|
`)).map(n=>{let r=String(n).trim();return r?r.startsWith("- [ ]")||r.startsWith("- [x]")||r.startsWith("- [X]")?r:`- [ ] ${r}`:null}).filter(Boolean).join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`:""},W=(t,s)=>{if(!s)return{content:t,markedCount:0};let i=S(s),n=(Array.isArray(i)?i:[i]).map(p=>String(p).replace(/^- \[[xX ]\]\s*/i,"").trim()).filter(Boolean),r=t.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as h,h as m,i as R}from"./chunk-UDJ2C3N3.js";import{a as F}from"./chunk-
|
|
1
|
+
import{g as h,h as m,i as R}from"./chunk-UDJ2C3N3.js";import{a as F}from"./chunk-IRFTRBG2.js";import{a as $}from"./chunk-Y5JU726N.js";import{a as g}from"./chunk-OOTXMJIA.js";import"./chunk-QGPOMXO4.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.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(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}from"./chunk-7UNVYHZ7.js";import"./chunk-OOTXMJIA.js";import"./chunk-QGPOMXO4.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.js";export{k as addToUsage,q as checkImageQuota,n as checkQuota,m as checkQuotaDetailed,c as forceFlushUsage,t as getAllUsageData,l as getCustomPeriodUsage,g as getDailyUsage,o as getImageQuotaBuckets,p as getImageQuotaLimit,r as getImageQuotaStats,h as getMonthlyUsage,e as getTimedUsage,i as incrementUsage,f as initUsage,s as recordImageGeneration,d as recordTimedUsage,j as runtimeSession,b as sendUsageFinalize,a as sendUsageHeartbeat};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-WMRT2YZU.js";import"./chunk-7UNVYHZ7.js";import"./chunk-OOTXMJIA.js";import"./chunk-QGPOMXO4.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.js";export{b as openUsageDashboard,a as startUsageServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-IRFTRBG2.js";import{a as s}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.js";import c from"fs-extra";import n from"path";import u from"html-to-docx";var w=async m=>{let{path:t,content:r}=s(m);if(!t)return'ERROR: Missing "path" argument for write_docx.';if(!r)return'ERROR: Missing "content" (HTML) for write_docx.';let o=n.resolve(process.cwd(),t);try{await c.ensureDir(n.dirname(o)),await l.recordFileChange(o);let e=n.basename(t),a=r.includes("<html")?r:`
|
|
2
2
|
<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-IRFTRBG2.js";import{a as R}from"./chunk-Y5JU726N.js";import{a as $}from"./chunk-OOTXMJIA.js";import"./chunk-QGPOMXO4.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.js";import r from"fs";import C from"path";var B=async(F,E={})=>{let{path:s,content:o}=R(F);if(!s)return'ERROR: Missing "path" argument for WriteFile.';if(o===void 0)return'ERROR: Missing "content" argument for WriteFile.';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(`
|
|
@@ -17,11 +17,11 @@ ${r.readFileSync(t,"utf8").split(/\r?\n/).map((g,j)=>`${j+1} | ${g}`).join(`
|
|
|
17
17
|
|
|
18
18
|
... [${a-100} lines truncated] ...
|
|
19
19
|
|
|
20
|
-
${f}`}c=null;let{systemSettings:
|
|
20
|
+
${f}`}c=null;let{systemSettings:w}=await $(),u=`SUCCESS: File [${s}] saved.
|
|
21
21
|
- Stats: [${a} lines, ${(S/1024).toFixed(1)} KB]
|
|
22
22
|
${n}- Content Preview:
|
|
23
23
|
|
|
24
|
-
${d}`;if(
|
|
24
|
+
${d}`;if(w?.compressToolResults&&a>60){let e=l.split(/\r?\n/),f=e.slice(0,25).join(`
|
|
25
25
|
`)===i.slice(0,25).join(`
|
|
26
26
|
`),g=e.slice(-25).join(`
|
|
27
27
|
`)===i.slice(-25).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as $}from"./chunk-A73NNVCZ.js";import{a as F}from"./chunk-
|
|
1
|
+
import{a as $}from"./chunk-A73NNVCZ.js";import{a as F}from"./chunk-IRFTRBG2.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import"./chunk-RI37VZYB.js";import I from"puppeteer";import i from"path";import o from"fs-extra";import{PDFDocument as L}from"pdf-lib";var _=async C=>{let{path:l,content:m,orientation:R="portrait",margin:c="0px"}=y(C);if(!l)return'ERROR: Missing "path" argument for write_pdf.';if(!m)return'ERROR: Missing "content" (HTML/CSS) for write_pdf.';let f=i.resolve(process.cwd(),l),u=null;try{await o.ensureDir(i.dirname(f)),await F.recordFileChange(f);let p=$();u=await I.launch({headless:!0,executablePath:p.executablePath||void 0,args:["--no-sandbox","--disable-setuid-sandbox","--disable-gpu","--disable-dev-shm-usage"]});let w=await u.newPage(),a=m,g={},x=async t=>{if(!t||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:"))return null;try{let e=i.resolve(process.cwd(),t);if(await o.pathExists(e)){let s=i.extname(e).toLowerCase().replace(".","")||"png",d=s==="jpg"?"jpeg":s==="svg"?"svg+xml":s,h=await o.readFile(e,"base64");return`data:image/${d};base64,${h}`}}catch{}return null},v=/<link[^>]+href=["']([^"']+)["']/gi,b={},r;for(;(r=v.exec(m))!==null;){let t=r[1],e=r[0];if(t&&e.toLowerCase().includes("stylesheet")&&!t.startsWith("http://")&&!t.startsWith("https://")&&!t.startsWith("data:"))try{let s=i.resolve(process.cwd(),t);if(await o.pathExists(s)){let d=await o.readFile(s,"utf-8");b[e]=`<style>${d}</style>`}}catch{}}for(let[t,e]of Object.entries(b))a=a.split(t).join(e);let P=/<img[^>]+src=["']([^"']+)["']/gi;for(;(r=P.exec(a))!==null;){let t=r[1];if(t&&!g[t]){let e=await x(t);e&&(g[t]=e)}}let A=/url\(\s*['"]?([^'")]+?)['"]?\s*\)/gi;for(;(r=A.exec(a))!==null;){let t=r[1].trim();if(t&&!g[t]){let e=await x(t);e&&(g[t]=e)}}for(let[t,e]of Object.entries(g)){let s=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),d=new RegExp(`(src=["'])(${s})(["'])`,"gi");a=a.replace(d,`$1${e}$3`);let h=new RegExp(`url\\(\\s*(['"]?)(${s})\\1\\s*\\)`,"gi");a=a.replace(h,`url($1${e}$1)`)}let E=`
|
|
2
2
|
<style>
|
|
3
3
|
@page {
|
|
4
4
|
margin: ${c};
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as b}from"./chunks/chunk-RI37VZYB.js";import{spawn as
|
|
3
|
-
[ERROR] Allocation value '${
|
|
4
|
-
`),process.exit(1));var
|
|
5
|
-
[MEMORY] Starting with: '${
|
|
2
|
+
import{a as b}from"./chunks/chunk-RI37VZYB.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"),f=j.join(b,"FLUXFLOW.md");T.existsSync(b)||T.mkdirSync(b,{recursive:!0}),T.existsSync(t)||T.writeFileSync(t,"","utf8"),T.existsSync(f)||T.writeFileSync(f,"","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
|
+
[ERROR] Allocation value '${u} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
|
+
`),process.exit(1));var U=Math.floor(ne*.75),$e=!isNaN(u)&&u>0?Math.min(u,U):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>U?U:u} MB' Allocation${u>U?" (Max allowed: '"+U+" MB')":""}. Please Wait...`),await new Promise(f=>setTimeout(f,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",f=>process.exit(f||0));else{let t=process.argv.slice(2),f=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",K=t.includes("--help")&&!f,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-CSS2XQH3.js"),{url:m}=await o();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
|
-
\u2800\u2800\u2514\u2500 Serving at: ${
|
|
7
|
+
\u2800\u2800\u2514\u2500 Serving at: ${m}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
9
|
-
`),await new Promise(()=>{})}if(
|
|
10
|
-
Usage: fluxflow --export error`),process.exit(1)}if(
|
|
9
|
+
`),await new Promise(()=>{})}if(Q||K||f||Z||ee){let o=await import("fs"),m=await import("path"),{fileURLToPath:r}=await import("url"),d=m.join(m.dirname(r(import.meta.url)),"../package.json"),n=JSON.parse(o.readFileSync(d,"utf8")).version;if(ee){let C=(t[1]||"").toLowerCase();if(C==="error"||C==="logs")try{let{exportErrorLogs:g}=await import("./chunks/export-YTWRQ63I.js"),l=await g();console.log(`[EXPORT LOGS] Exported ${l.entryCount} error log entries (FluxFlow: ${l.fluxflowCount}, Memory: ${l.memoryCount}, Usage: ${l.usageCount}) to "${l.exportFile}"`),process.exit(0)}catch(g){console.error(`[EXPORT ERROR] Failed to export error logs: ${g.message}`),process.exit(1)}else console.error(`[EXPORT ERROR] Invalid export target "${t[1]||""}". --export only supports 'error'.
|
|
10
|
+
Usage: fluxflow --export error`),process.exit(1)}if(Q&&(console.log(`v${n}`),process.exit(0)),K&&(console.log(`FluxFlow CLI Arguments:
|
|
11
11
|
--mode <flux|flow|icu|omni> Set startup mode (Agent / Chat / Computer Use / Sentient being)
|
|
12
12
|
--model <model_name> Set startup AI model
|
|
13
13
|
--key <key@provider> Set API key and provider
|
|
@@ -33,7 +33,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(J&&(console.log(`v${i}`),pro
|
|
|
33
33
|
--export error Export system error logs to fluxflow-error-<timestamp>.txt
|
|
34
34
|
--update check Check for new updates
|
|
35
35
|
--update check latest Show the latest version available on npm
|
|
36
|
-
--update [latest] Update the app to the latest version (latest is default)`),process.exit(0)),
|
|
36
|
+
--update [latest] Update the app to the latest version (latest is default)`),process.exit(0)),f&&(console.log(`FluxFlow Chat /Commands:
|
|
37
37
|
/quit Exit and shutdown Flux
|
|
38
38
|
/help Show help menu
|
|
39
39
|
/clear Clear terminal screen
|
|
@@ -66,28 +66,30 @@ Usage: fluxflow --export error`),process.exit(1)}if(J&&(console.log(`v${i}`),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)),
|
|
70
|
-
${
|
|
69
|
+
/update latest Install latest release`),process.exit(0)),Z){let C=t[1]||"latest";if(C==="check"){let g=t[2]==="latest";try{let h=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;h||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(g?`Latest version: v${h}`:h!==n?`A new version of FluxFlow is available: v${h} (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 h=async()=>{let s=(await import("react")).default,{useState:N}=s,{render:_,Box:y,Text:S}=await import("ink"),D=(await import("ink-select-input")).default,E=(await import("ink-text-input")).default;return new Promise(H=>{let M=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],W=({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"),[V,J]=N(""),P=e=>{e.value==="custom"?F("custom"):B({manager:e.value})},L=e=>{B({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:V,onChange:J,onSubmit:L})),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(D,{items:M,onSelect:P,itemComponent:W,indicatorComponent:()=>null}))},B=k=>{O&&O(),H(k)},{unmount:z}=_(s.createElement(X,null));O=z})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-ZDBO3FHN.js");A=await s(),i=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!i){let s=await h();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:v}=await import("child_process");v(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${c}.\x1B[0m`)}catch(g){console.error("\x1B[31m\u274C Update failed:\x1B[0m",g.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-VDMSLYCY.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
|
+
${a}
|
|
71
71
|
---
|
|
72
72
|
|
|
73
|
-
Summarize as neutral conventional commit message. No markdown, emojis, or fluff`}catch{process.exit(0)}let
|
|
74
|
-
${
|
|
73
|
+
Summarize as neutral conventional commit message. No markdown, emojis, or fluff`}catch{process.exit(0)}let d=t.findIndex(e=>e==="-r"||e==="--run"),x=null,n=null;if(d!==-1&&d+1<t.length){x=t[d+1];try{let{execSync:e}=await import("child_process");n=e(x,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){n=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(n){let{stripAnsi:e}=await import("./chunks/exec_command-ER3K4TLH.js");n=e(n).trim(),r?r=`Stdin Context (${x}):
|
|
74
|
+
${n}
|
|
75
75
|
---
|
|
76
76
|
|
|
77
|
-
${r}`:r=
|
|
78
|
-
${
|
|
77
|
+
${r}`:r=n}if(!I&&!process.stdin.isTTY){let e=[];for await(let w of process.stdin)e.push(w);let a=Buffer.concat(e).toString("utf8").trim();if(a){let{stripAnsi:w}=await import("./chunks/exec_command-ER3K4TLH.js");a=w(a).trim(),r?r=`Stdin Context:
|
|
78
|
+
${a}
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
${r}`:r=
|
|
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-ZDBO3FHN.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-BJGXCZRP.js"),{getDefaultModel:l}=await import("./chunks/model_config-UZLNHYP5.js"),{generateSimpleContent:c}=await import("./chunks/ai-QZPSCQTC.js"),{checkQuotaDetailed:h}=await import("./chunks/usage-6BBHZ76S.js"),i=await C(),$=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),A=I||$.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let w=$.indexOf(a);if(w!==-1&&w+1<$.length)return $[w+1]}return null},v=p(["--provider"])||i.aiProvider||"Google",s=p(["--model"])||i.activeModel||l(v,i.apiTier)||l(v,"paid"),N=p(["--key"])||await g(v);N||(console.error(`[ERROR] No API key resolved for provider "${v}".`),process.exit(1));let _=await h("agent",{aiProvider:v});_.allowed||(console.error(`[ERROR] ${_.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:y="",nickname:S="",instructions:D=""}=i?.profileData??{},E={aiProvider:v,apiKey:N,model:s,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:i.systemSettings||{}},H=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,W=M.getFullYear(),O=M.toLocaleString("en-US",{month:"short"}).toUpperCase(),X=String(M.getDate()).padStart(2,"0"),B=M.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),z=`${W}-${O}-${X}, ${B}`,k=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
82
82
|
Use NO markdown, only plain text
|
|
83
83
|
Additional Context:
|
|
84
|
-
- OS: ${
|
|
85
|
-
- Model: ${
|
|
86
|
-
- Approx time: ${
|
|
84
|
+
- OS: ${H}
|
|
85
|
+
- Model: ${j.basename(E.model).trim().replace(":free","").replace("-free","").replace("/free","").replace("_free","").replace("free_","").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim())}
|
|
86
|
+
- Approx time: ${z}
|
|
87
87
|
- Non interactive CLI, support piped inputs
|
|
88
|
-
- 'fluxflow' TUI has full agentic tools & capabilities
|
|
89
|
-
|
|
90
|
-
${
|
|
91
|
-
`}
|
|
88
|
+
- 'fluxflow' TUI has full agentic tools & capabilities${S.trim().length>0?`
|
|
89
|
+
User Nickname: ${S.trim()}`:""}${D.trim().length>0?`
|
|
90
|
+
User Preferences: ${D.trim()}`:""}`.trim(),{getPromptSessionHistory:F,savePromptSessionHistory:V,clearPromptSessionHistory:J}=await import("./chunks/sessionDaemon-GHQTAGDG.js"),P=[];o&&!I?await J():o||(P=await F());let L=[];if(Array.isArray(P)&&P.length>0)for(let e of P)e.text&&L.push({role:e.role==="model"?"model":"user",parts:[{text:e.text}]});L.push({role:"user",parts:[{text:r}]});try{if(!A){let w="\x1B[36m",fe="\x1B[35m",oe="\x1B[0m",ge=j.basename(E.model).trim().replace(":free","").replace("-free","").replace("/free","").replaceAll("-"," ").replace(/\b\w/g,xe=>xe.toUpperCase().trim());process.stdout.write(`Responding with ${w}${ge}${oe} from ${fe}${E.aiProvider}${oe}:
|
|
91
|
+
`)}let{text:e}=await c(E,s,L,k,E.thinkingLevel),a=(e||"").trim();process.stdout.write(a+`
|
|
92
|
+
${A?"":`
|
|
93
|
+
`}`),a&&await V(r,a)}catch(e){console.error(`[ERROR] Prompt request failed: ${e.message.trim()}
|
|
92
94
|
|
|
93
|
-
`),process.exit(1)}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
|
|
95
|
+
`),process.exit(1)}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 te=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",te),["SIGINT","SIGTERM","SIGHUP"].forEach(o=>{process.once(o,()=>{te(),process.exit(0)})}),t.includes("--playground")){let o=process.cwd();process.argv.push("--original-cwd",o);let{DATA_DIR:m}=await import("./chunks/paths-Y7ACZJAE.js"),r=await import("path"),d=await import("fs-extra"),x=r.default.join(m,"playground");try{d.default.ensureDirSync(x),process.chdir(x)}catch{}}le(ae.createElement(ce,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import c from"fs";import a from"path";import i from"crypto";var y=66,p=!0,d=r=>{let n=Buffer.isBuffer(r)?r:Buffer.from(r),t=Buffer.alloc(n.length);for(let e=0;e<n.length;e++)t[e]=n[e]^y;return t},f="aes-256-cbc",u=i.createHash("sha256").update("fluxflow-cli-sanctuary-key").digest(),h=r=>{if(p)return r;let n=i.randomBytes(16),t=i.createCipheriv(f,u,n),e=t.update(r,"utf8","hex");return e+=t.final("hex"),n.toString("hex")+":"+e},l=r=>{if(p)return r;let n=r.split(":");if(n.length!==2)throw new Error("Invalid AES format");let t=Buffer.from(n[0],"hex"),e=n[1],o=i.createDecipheriv(f,u,t),s=o.update(e,"hex","utf8");return s+=o.final("utf8"),s},m=(r,n={})=>{try{if(!c.existsSync(r))return n;let t=c.readFileSync(r),e=t.toString("utf8").trim();if(e.startsWith("{")||e.startsWith("["))return JSON.parse(e);try{let s=l(e);return JSON.parse(s)}catch{}let o=d(t).toString("utf8");if(o.startsWith("{")||o.startsWith("["))return JSON.parse(o);throw new Error("Unsupported or corrupt encryption format")}catch(t){return console.error(`Vault Read Error [${a.basename(r)}]:`,t.message),n}},x=(r,n)=>{try{let t=a.dirname(r);c.existsSync(t)||c.mkdirSync(t,{recursive:!0});let e=JSON.stringify(n,null,2),o=h(e);c.writeFileSync(r,o,"utf8")}catch(t){console.error(`Vault Write Error [${a.basename(r)}]:`,t.message)}},w=m,A=x;export{h as a,l as b,m as c,x as d,w as e,A as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-PS3TUC3G.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk-5F3QPKCX.js";import"./chunk-74DZYKIT.js";import"./chunk-PS3TUC3G.js";import"./chunk-QGPOMXO4.js";import"./chunk-SIINYZWE.js";import"./chunk-RI37VZYB.js";export{b as openUsageDashboard,a as startUsageServer};
|