fluxflow-cli 4.23.4 → 4.24.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 +2 -2
- package/dist/chunks/{addMemScore-COX3MDEK.js → addMemScore-PWP7GFSP.js} +1 -1
- package/dist/chunks/{ai-QZPSCQTC.js → ai-NFNMNHUW.js} +1 -1
- package/dist/chunks/{app-VDMSLYCY.js → app-KJGLCANP.js} +142 -142
- package/dist/chunks/{chat-J5AAPLPF.js → chat-7T6MVHC3.js} +1 -1
- package/dist/chunks/{chunk-BSUDXEA2.js → chunk-3CZWTXIR.js} +1 -1
- package/dist/chunks/{chunk-XIH6C5WL.js → chunk-3LTI7Z7N.js} +1 -1
- package/dist/chunks/{chunk-7UNVYHZ7.js → chunk-4XXLWMY6.js} +1 -1
- package/dist/chunks/{chunk-COUKJJ4O.js → chunk-6AWSJNXE.js} +14 -14
- package/dist/chunks/{chunk-P52SKLRJ.js → chunk-7SFAWGE2.js} +1 -1
- package/dist/chunks/{chunk-WMRT2YZU.js → chunk-AF7LASZ3.js} +1 -1
- package/dist/chunks/chunk-DSVLWYIT.js +2 -0
- package/dist/chunks/{chunk-IRFTRBG2.js → chunk-FQBBOFNP.js} +1 -1
- package/dist/chunks/{chunk-OOTXMJIA.js → chunk-GRQ7JZZP.js} +1 -1
- package/dist/chunks/{chunk-U6UKO6MO.js → chunk-JCT3YL5A.js} +1 -1
- package/dist/chunks/chunk-JQ5Y2VZD.js +914 -0
- package/dist/chunks/{chunk-6KFABN4O.js → chunk-KNCL7AK2.js} +1 -1
- package/dist/chunks/{chunk-QGPOMXO4.js → chunk-OSDQRSY6.js} +1 -1
- package/dist/chunks/{chunk-F6DMKN7N.js → chunk-PQRLA35M.js} +15 -15
- package/dist/chunks/{chunk-2KD7V3OK.js → chunk-RZTZPIC5.js} +1 -1
- package/dist/chunks/{chunk-RLT6EHPQ.js → chunk-SZYN3VHU.js} +1 -1
- package/dist/chunks/{chunk-Z4HHJIHG.js → chunk-VYTQ6J56.js} +1 -1
- package/dist/chunks/{chunk-UDJ2C3N3.js → chunk-ZRP6USHC.js} +28 -28
- package/dist/chunks/{click-HS7NJR6J.js → click-5ZKBFZ4N.js} +2 -2
- package/dist/chunks/{computer_action-YCFAAZNA.js → computer_action-7U3W3F6L.js} +1 -1
- package/dist/chunks/{drag-SBWNKGDV.js → drag-YHHKJGL6.js} +1 -1
- package/dist/chunks/{emergency_rollback-6M5EH75W.js → emergency_rollback-DXN5WNPR.js} +1 -1
- package/dist/chunks/{exec_command-ER3K4TLH.js → exec_command-GVLMN5KT.js} +1 -1
- package/dist/chunks/export-DEFENSGY.js +1 -0
- package/dist/chunks/{file_map-XK7BFZFI.js → file_map-KS6Y7BP3.js} +1 -1
- package/dist/chunks/find_file-A6NYLQJS.js +4 -0
- package/dist/chunks/{generate_image-S6M2GCD7.js → generate_image-HVWLRINC.js} +1 -1
- package/dist/chunks/{getProgress-VG2IBPZU.js → getProgress-A2TW34Q7.js} +2 -2
- package/dist/chunks/{invoke-ZGIGNTE6.js → invoke-A65SLWMF.js} +4 -4
- package/dist/chunks/{invokeSync-LXDZKOPO.js → invokeSync-KP33D2NU.js} +2 -2
- package/dist/chunks/{key_press-BT6QQ24M.js → key_press-ZZNA3PF3.js} +1 -1
- package/dist/chunks/{keyboard_typing-IWKUCQE4.js → keyboard_typing-QL3DF67Z.js} +1 -1
- package/dist/chunks/{memory-5CNSGF6X.js → memory-SRDCQNML.js} +1 -1
- package/dist/chunks/{model_config-UZLNHYP5.js → model_config-M24OEKJE.js} +1 -1
- package/dist/chunks/paths-2EXHWUSL.js +1 -0
- package/dist/chunks/{read_folder-OOKZITME.js → read_folder-EI2CNHNS.js} +5 -5
- package/dist/chunks/{saveSummary-XQ2STWSN.js → saveSummary-VKGBD4CG.js} +1 -1
- package/dist/chunks/{screen_grid-YL4W6LEM.js → screen_grid-GBIGOR5Q.js} +1 -1
- package/dist/chunks/{scroll-TA2JTVSR.js → scroll-C4Z57VQS.js} +1 -1
- package/dist/chunks/search_keyword-CSRQFPHQ.js +6 -0
- package/dist/chunks/{secrets-BJGXCZRP.js → secrets-LPVNWDTB.js} +1 -1
- package/dist/chunks/settings-KKYNW25D.js +1 -0
- package/dist/chunks/{todo-C5HHG7TN.js → todo-VG2CVRUI.js} +1 -1
- package/dist/chunks/{update_file-2YCGNOBP.js → update_file-WTXXQ4RB.js} +1 -1
- package/dist/chunks/{usage-6BBHZ76S.js → usage-VLICZGBC.js} +1 -1
- package/dist/chunks/usageServer-HY4ME2BW.js +1 -0
- package/dist/chunks/view_file-2THVIMD6.js +1 -0
- package/dist/chunks/{web_scrape-LAQI7CVA.js → web_scrape-BHSQTMX4.js} +1 -1
- package/dist/chunks/{web_search-D2GOWARI.js → web_search-2PFIJKIL.js} +1 -1
- package/dist/chunks/{write_docx-J5OO4ZSE.js → write_docx-I7T3575T.js} +1 -1
- package/dist/chunks/{write_file-MDPZMOG3.js → write_file-V6HKMWFB.js} +1 -1
- package/dist/chunks/{write_pdf-KF7HZODR.js → write_pdf-XDDKM7V5.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-D7RU7MKC.js +0 -922
- package/dist/chunks/chunk-RI37VZYB.js +0 -1
- package/dist/chunks/export-YTWRQ63I.js +0 -1
- package/dist/chunks/paths-Y7ACZJAE.js +0 -1
- package/dist/chunks/search_keyword-EAMQWPPI.js +0 -8
- package/dist/chunks/settings-ZDBO3FHN.js +0 -1
- package/dist/chunks/usageServer-CSS2XQH3.js +0 -1
- package/dist/chunks/view_file-4UCCUBFK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,d as m}from"./chunk-L3W2X74K.js";import{k as a,l as S}from"./chunk-
|
|
1
|
+
import{c as E,d as m}from"./chunk-L3W2X74K.js";import{k as a,l as S}from"./chunk-DSVLWYIT.js";var O=4*(1024*2),D=async($,M={})=>{let s=t=>{let e=new RegExp(`${t}\\s*[:=]\\s*(["'])(.*?)\\1(?=\\s*[,)]|\\s+\\w+\\s*[:=]|$)`,"s"),n=$.match(e);if(n)return n[2].trim();let o=new RegExp(`${t}\\s*[:=]\\s*([^,\\s)]+)`,"s"),r=$.match(o);return r?r[1].trim():null},R=s("action"),u=s("method"),c=s("content"),y=s("content-new"),w=s("content-old"),p=s("id"),d=s("chat-id")||M.chatId||M.sessionId||"default-session";if(R==="temp"){if(!c)return"ERROR: Missing 'content' for temp memory.";let t=E(S,{});t[d]||(t[d]=[]),t[d].push(c),m(S,t);let e=t[d].reduce((n,o)=>n+o.length,0);return`SUCCESS: Temporary context saved for session [${d}]. (Size: ${e} chars)`}if(R==="user"){let t=E(a,[]).map(e=>(e.score===void 0&&(e.score=.5),e));if(u==="add"){if(!c)return"ERROR: Missing 'content' for memory addition.";let e=new Date,n=`${e.getDate()}/${e.getMonth()+1}/${e.getFullYear()}`,o=c.includes("[Saved on:")?c:`${c.trim()} [Saved on: ${n}]`,r=O,i=t.reduce((g,I)=>g+(I.memory?.length||0),0);for(;t.length>0&&i+o.length>r;){let g=t.shift();i-=g.memory?.length||0}let l=s("score"),f=l?parseFloat(l):.5,h={id:`mem-${Date.now().toString(36)}`,memory:o,score:Math.min(2,isNaN(f)?.5:f)};return t.push(h),m(a,t),`SUCCESS: Memory added with ID [${h.id}] and score [${h.score}]. (Vault Size: ${i+o.length} chars)`}if(u==="update"){let e=p||w,n=y||c;if(!e||!n)return"ERROR: Missing 'id' or content for update.";let o=t.findIndex(f=>f.id===e);if(o===-1)return`ERROR: Memory ID [${e}] not found.`;let r=new Date,i=`${r.getDate()}/${r.getMonth()+1}/${r.getFullYear()}`,l=n.includes("[Saved on:")?n:`${n.trim()} [Saved on: ${i}]`;return t[o].memory=l,m(a,t),`SUCCESS: Memory [${e}] updated.`}if(u==="delete"){let e=p||c;if(!e)return"ERROR: Missing 'id' for deletion.";let n=t.length,o=t.filter(r=>r.id!==e);return o.length===n?`ERROR: Memory ID [${e}] not found.`:(m(a,o),`SUCCESS: Memory [${e}] deleted.`)}return`ERROR: Invalid method [${u}] for user memory. Use 'add', 'update', or 'delete'.`}return`ERROR: Unknown action [${R}] for memory tool.`};export{D as memory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-OSDQRSY6.js";import"./chunk-DSVLWYIT.js";export{a as DEFAULT_MODEL_CONFIG,n as getDefaultModel,o as getFallbackValue,b as getModelConfig,m as getModels,l as hasModelReasoning,k as isModelMultimodal,g as removeModelFromProvider,h as renameModelInProvider,c as saveModelConfigToDisk,d as saveModelToProvider,i as setCustomMultimodal,f as setDefaultModelForProvider,e as setModelMultimodalInProvider,j as setOllamaMultimodal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"./chunk-DSVLWYIT.js";export{q as ACTIVE_TX_FILE,n as BACKUPS_DIR,s as CONTEXT_FILE,u as CU_CACHE_DIR,c as DATA_DIR,w as DEFAULT_EXCLUDES,a as FLUXFLOW_DIR,g as HISTORY_DIR,f as HISTORY_FILE,p as LEDGER_ADVANCE_FILE,o as LEDGER_FILE,d as LOGS_DIR,k as MEMORIES_FILE,t as PARSER_DIR,r as PATHS_FILE,e as SECRET_DIR,b as SETTINGS_FILE,m as TEMP_MEM_CHAT_FILE,l as TEMP_MEM_FILE,v as THINKING_CONFIG_FILE,i as USAGE_FILE,h as USAGE_FILE_OLD,j as USAGE_FILE_TIMED,x as getGitignoreExcludes};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{a as T}from"./chunk-Y5JU726N.js";import m from"fs";import R from"path";var A=new Set([".git","node_modules",".gemini","dist","build",".next","out",".cache","bin","obj","vendor","venv",".idea",".gradle",".terraform","target","coverage",".vscode",".svn",".hg",".fslckout",".github",".gitlab",".circleci",".gitea",".gitee",".lerna",".changeset",".nx",".npm",".yarn",".pnpm-store",".expo",".nuxt",".svelte-kit",".docusaurus",".turbo",".vercel","bower_components",".netlify",".vuepress",".quasar",".output",".angular","jspm_packages",".parcel-cache",".rollup.cache",".rspack",".vitepress","__pycache__",".pytest_cache",".mypy_cache",".tox",".poetry","env","vhdl",".ipynb_checkpoints",".jupyter",".conda",".pdm-build",".bundle",".yardoc",".metadata","App_Data","ClientBin",".cargo",".rustc_info",".go","Godeps","_vendor",".rake_tasks","CMakefiles",".wakatime",".dart_tool",".fvm",".cocoapods","Pods",".pub-cache",".symlinks","DerivedData",".xcworkspace",".serverless",".aws",".gcloud",".azure",".kube",".vagrant",".docker","postgres-data","redis-data","mongo-data",".Spotlight-V100",".Trashes","$RECYCLE.BIN","System Volume Information",".DocumentRevisions-V100",".fseventsd","AppData","Application Data","Local","LocalLow","Roaming","$WinREAgent","$WINDOWS.~BT","$WINDOWS.~WS","scw","System32","SysWOW64",".AppleDouble",".AppleDB",".AppleDesktop","_CodeSignature",".cmio",".LSOverride",".localized",".TemporaryItems",".Trash",".Trash-0",".Trash-1000",".gvfs",".local",".config",".dbus",".fontconfig",".snap",".var",".lost+found","lost+found",".thumb",".thumbnails","EFI","boot","grub","logs","log",".nyc_output",".sonar",".ruff_cache",".VSCodeCounter",".skills","skills"]),
|
|
1
|
+
import{a as T}from"./chunk-Y5JU726N.js";import m from"fs";import R from"path";var A=new Set([".git","node_modules",".gemini","dist","build",".next","out",".cache","bin","obj","vendor","venv",".idea",".gradle",".terraform","target","coverage",".vscode",".svn",".hg",".fslckout",".github",".gitlab",".circleci",".gitea",".gitee",".lerna",".changeset",".nx",".npm",".yarn",".pnpm-store",".expo",".nuxt",".svelte-kit",".docusaurus",".turbo",".vercel","bower_components",".netlify",".vuepress",".quasar",".output",".angular","jspm_packages",".parcel-cache",".rollup.cache",".rspack",".vitepress","__pycache__",".pytest_cache",".mypy_cache",".tox",".poetry","env","vhdl",".ipynb_checkpoints",".jupyter",".conda",".pdm-build",".bundle",".yardoc",".metadata","App_Data","ClientBin",".cargo",".rustc_info",".go","Godeps","_vendor",".rake_tasks","CMakefiles",".wakatime",".dart_tool",".fvm",".cocoapods","Pods",".pub-cache",".symlinks","DerivedData",".xcworkspace",".serverless",".aws",".gcloud",".azure",".kube",".vagrant",".docker","postgres-data","redis-data","mongo-data",".Spotlight-V100",".Trashes","$RECYCLE.BIN","System Volume Information",".DocumentRevisions-V100",".fseventsd","AppData","Application Data","Local","LocalLow","Roaming","$WinREAgent","$WINDOWS.~BT","$WINDOWS.~WS","scw","System32","SysWOW64",".AppleDouble",".AppleDB",".AppleDesktop","_CodeSignature",".cmio",".LSOverride",".localized",".TemporaryItems",".Trash",".Trash-0",".Trash-1000",".gvfs",".local",".config",".dbus",".fontconfig",".snap",".var",".lost+found","lost+found",".thumb",".thumbnails","EFI","boot","grub","logs","log",".nyc_output",".sonar",".ruff_cache",".VSCodeCounter",".skills","skills"]),C=i=>A.has(i)||i.startsWith(".pnpm"),I=i=>{try{let n=String(i.getMonth()+1).padStart(2,"0"),a=String(i.getDate()).padStart(2,"0"),o=String(i.getHours()).padStart(2,"0"),s=String(i.getMinutes()).padStart(2,"0");return`${n}-${a} ${o}:${s}`}catch{return"N/A"}},M=async i=>{let n=T(i),a=n.path||null;if(!a)return"ERROR: No directory path provided.";if(a.trim().toLowerCase().startsWith("#skills"))return"ERROR: '#skill' is reserved VFS namespace, not folder. Use 'ReadFile' to read specific skills.";let o=1;if(n.recurse!==void 0&&n.recurse!==null)if(typeof n.recurse=="number")o=n.recurse;else if(typeof n.recurse=="boolean")o=n.recurse?2:1;else{let s=parseInt(String(n.recurse).trim(),10);o=isNaN(s)?1:s}o=Math.max(1,Math.min(3,o));try{let s=R.resolve(process.cwd(),a);if(!m.existsSync(s))return`ERROR: Path [${a}] does not exist.`;if(!m.statSync(s).isDirectory())return`ERROR: Path [${a}] is a file, not a directory. Use ReadFile instead.`;if(o===1){let p=m.readdirSync(s),l=p.length,u=150,g=p.slice(0,u),d=[];for(let r of g){let $=R.join(s,r),e={name:r,type:"unknown",size:"N/A",mtime:"N/A"};try{let t=m.statSync($);e={name:r,type:t.isDirectory()?"directory":"file",size:(t.size/1024).toFixed(1)+"KB",mtime:I(t.mtime)}}catch{e.type="inaccessible"}d.push(e)}let y=d.map(r=>r.type==="directory"?`${r.name}/`:`${r.name} (${r.size}, ${r.mtime})`).join(`
|
|
2
2
|
`),c=`
|
|
3
3
|
|
|
4
4
|
(Total items in folder: ${l})`;return l>u&&(c=`
|
|
5
5
|
|
|
6
|
-
TRUNCATED: Showing first ${u} of ${l} items.`),p.length=0,g.length=0,d.length=0,`Detailed folder stats for [${
|
|
6
|
+
TRUNCATED: Showing first ${u} of ${l} items.`),p.length=0,g.length=0,d.length=0,`Detailed folder stats for [${a}]:
|
|
7
7
|
|
|
8
|
-
${y}${c}`}let b=0,v=0,f=0,h=500,S=!1,
|
|
8
|
+
${y}${c}`}let b=0,v=0,f=0,h=500,S=!1,_=(p,l,u=1)=>{if(l>o||S)return[];let g=[];try{g=m.readdirSync(p)}catch{return[`${" ".repeat(u-1)}[Inaccessible Directory]`]}let d=[],y=[];for(let e of g){let t=R.join(p,e),D=!1;try{D=m.statSync(t).isDirectory()}catch{}D?d.push({name:e,fullPath:t}):y.push({name:e,fullPath:t})}d.sort((e,t)=>e.name.localeCompare(t.name)),y.sort((e,t)=>e.name.localeCompare(t.name));let c=[],r=" ".repeat(u-1);for(let e of d){if(f>=h){S=!0,c.push(`${r}[Truncated - Maximum item limit reached (${h})]`);break}if(f++,b++,c.push(`${r}${e.name}/`),l<o&&!C(e.name)){let t=_(e.fullPath,l+1,u+1);c.push(...t)}}let $=[];for(let e of y){if(f>=h){S=!0,c.push(`${r}[Truncated - Maximum item limit reached (${h})]`);break}f++,v++;let t="N/A";try{t=(m.statSync(e.fullPath).size/1024).toFixed(1)+"KB"}catch{}$.push(`${e.name} (${t})`)}return $.length>0&&c.push(`${r}${$.join("; ")}`),c},E=_(s,1,1).join(`
|
|
9
9
|
`),x=`
|
|
10
10
|
|
|
11
11
|
(Total items scanned: ${f}, Directories: ${b}, Files: ${v})`;return S&&(x=`
|
|
12
12
|
|
|
13
|
-
TRUNCATED: Scan capped at ${h} items. (Directories: ${b}, Files: ${v})`),`Detailed directory tree for [${
|
|
13
|
+
TRUNCATED: Scan capped at ${h} items. (Directories: ${b}, Files: ${v})`),`Detailed directory tree for [${a}] (recursive depth: ${o}):
|
|
14
14
|
|
|
15
|
-
${E}${x}`}catch(s){let
|
|
15
|
+
${E}${x}`}catch(s){let k=s instanceof Error?s.message:String(s);return`ERROR: Failed to read folder [${a}]: ${k}`}};export{M as read_folder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as n}from"./chunk-L3W2X74K.js";import{l as s,m as o}from"./chunk-
|
|
1
|
+
import{c as a,d as n}from"./chunk-L3W2X74K.js";import{l as s,m as o}from"./chunk-DSVLWYIT.js";var g=async(u,E={})=>{let m=r=>{let t=new RegExp(`${r}\\s*[:=]\\s*(["'])(.*?)\\1(?=\\s*[,)]|\\s+\\w+\\s*[:=]|$)`,"s"),i=u.match(t);return i?i[2].trim():null},e=m("id"),c=m("summary");if(!e||!c)return"ERROR: Missing 'id' or 'summary' for saveSummary tool.";try{let r=a(s,{}),t=a(o,{});return t[e]=c,delete r[e],n(o,t),n(s,r),`SUCCESS: Saved summary and purged raw memories for chat [${e}].`}catch(r){let t=r instanceof Error?r.message:String(r);return`ERROR: Failed to save summary for chat [${e}]: ${t}`}};export{g as saveSummary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-KNCL7AK2.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-JCT3YL5A.js";import"./chunk-KNCL7AK2.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};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as V}from"./chunk-Y5JU726N.js";import{w as j,x as H}from"./chunk-DSVLWYIT.js";import K from"fs/promises";import z from"path";import Z from"fast-glob";import{Minimatch as q}from"minimatch";async function O(a,s,e=a,g=1){if(g>12)return[];let c=[],r;try{r=await K.readdir(a,{withFileTypes:!0})}catch{return[]}for(let t of r){let i=z.join(a,t.name),m=z.relative(e,i),F=m.split(z.sep).map($=>$.toLowerCase()),M=t.name.toLowerCase();if(!s.some($=>{let L=$.toLowerCase();return L.startsWith(".")&&M.endsWith(L)?!0:F.some(W=>W===L||W.startsWith(".pnpm"))}))if(t.isDirectory()){let $=await O(i,s,e,g+1);c=c.concat($)}else t.isFile()&&c.push({fullPath:i,relativePath:m})}return c}function Y(a,s,e=1/0){if(a===s)return 0;if(a.length===0)return s.length;if(s.length===0)return a.length;if(Math.abs(a.length-s.length)>e)return e+1;let g=Array.from({length:s.length+1},(c,r)=>r);for(let c=1;c<=a.length;c++){let r=[c],t=c;for(let i=1;i<=s.length;i++){let m=a[c-1]===s[i-1]?0:1,F=Math.min(r[i-1]+1,g[i]+1,g[i-1]+m);r.push(F),F<t&&(t=F)}if(g=r,t>e)return e+1}return g[s.length]}function tt(a,s){if(!a||!s)return!1;let e=a.toLowerCase(),g=s.toLowerCase();if(e.includes(g))return!0;let c=e.split(/[^a-z0-9]+/).filter(t=>t.length>0),r=g.split(/[^a-z0-9]+/).filter(t=>t.length>1||g.length===1&&t.length>0);return r.length===0?!1:r.every(t=>{let i=t.length<=2?0:t.length<=5?1:2;for(let m of c)if(m.includes(t)||t.length>=3&&m.length>=3&&Math.abs(m.length-t.length)<=i&&Y(t,m,i)<=i)return!0;return!1})}var at=async a=>{let{keyword:s,path:e,fuzzy:g,subString:c,regex:r}=V(a);if(s==null)return'ERROR: Missing "keyword" argument.';let t=String(s);if(e&&(e.trim().toLowerCase()==="#docs"||e.trim().toLowerCase()==="#doc"||e.trim().toLowerCase()==="#documentation"||e.trim().toLowerCase().includes("#skill/global/fluxflow"))||e.trim().toLowerCase().startsWith("#skill"))return"ERROR: Cannot search in reserved VFS '#skill' namespace. Use 'ReadFile' to read specific skills.";let i=l=>l===!0||l==="true"||l===1||l==="1"||l==="yes",m=r===!1||r==="false"||r===0||r==="0"||r==="no",F=r===!0||r==="true"||r===1||r==="1"||r==="yes",M=i(g)||i(c),A=null,$=null;if(m)M||($=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i"));else{try{A=new RegExp(t,"i")}catch(l){if(F)return`ERROR: Invalid regex pattern "${t}": ${l.message}`}$=new RegExp(`(?<![\\w])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w])`,"i")}let L=Array.from(new Set([...j,...H(process.cwd())])),W=150;try{let l=[],x=process.cwd(),h=null;if(e){let n=e.split(";").map(o=>o.trim()).filter(Boolean),w=n.some(o=>o.startsWith("!"));if(n.some(o=>Z.isDynamicPattern(o)||/[*?{}[\]()|+]/.test(o))){h="glob";let o=e.replace(/\\/g,"/"),E=n.map(u=>u.replace(/\\/g,"/")),f=L.map(u=>u.startsWith(".")?`**/*${u}`:`**/${u}/**`);if(w&&!n.some(u=>!u.startsWith("!"))){let u=await O(x,L,x),y=p=>p.endsWith("/")?p+"**":p,d=E.filter(p=>p.startsWith("!")).map(p=>y(p.slice(1))),C=E.filter(p=>!p.startsWith("!")).map(y);l=u.filter(p=>{let R=p.relativePath.replace(/\\/g,"/"),_=C.length===0||C.some(b=>{try{return new q(b).match(R)}catch{return!1}}),k=d.some(b=>{try{return new q(b).match(R)}catch{return!1}});return _&&!k})}else{let u=E.some(d=>/[\(\)\|]|\.\*/.test(d)),y=[];if(!u)try{y=await Z(E,{cwd:x,ignore:f,dot:!0,onlyFiles:!0,absolute:!1})}catch{y=[]}if(y.length===0&&(u||Z.isDynamicPattern(o))){let d=o.match(/^([^\*\?\(\)\|\[\]\s]+)\//),C=d&&!/[\*\?\(\)\|\[\]]/.test(d[1])?z.resolve(x,d[1]):x,p=await O(C,L,x);try{let R=o.replace(/^\.\//,"");R=R.replace(/\.\*\/(\\.|[^\/])/g,".*$1"),!R.startsWith("^")&&!R.startsWith(".*")&&(R=`.*${R}`);let _=new RegExp(R.endsWith("$")?R:`${R}$`,"i");l=p.filter(k=>{let b=k.relativePath.replace(/\\/g,"/");return _.test(b)})}catch{l=[]}}else l=y.map(d=>({fullPath:z.resolve(x,d),relativePath:d}))}}else{let o=[],E=!1,f=!1;for(let S of n){let u=S.replace(/[\/\\]+$/,""),y=z.resolve(x,u);try{let d=await K.stat(y);if(d.isDirectory()){f=!0;let C=await O(y,L,x);o.push(...C)}else if(d.isFile())E=!0,o.push({fullPath:y,relativePath:z.relative(x,y)});else return`ERROR: Path is neither a file nor a directory: ${S}`}catch{return`ERROR: Path not found: ${S}`}}l=o,E&&!f?h="file":h="dir"}}else l=await O(x,L);let J=l.map(async n=>{try{let w=await K.readFile(n.fullPath,"utf-8");if(w.includes("\0"))return[];let P=w.split(/\r?\n/),o=[];for(let f=0;f<P.length;f++)(M?P[f].toLowerCase().includes(t.toLowerCase())||tt(P[f],t):m?$&&$.test(P[f]):A&&A.test(P[f])||$&&$.test(P[f]))&&o.push({line:f+1,content:P[f].trim()});return o.length===0?null:{path:n.relativePath.replace(/\\/g,"/"),matches:o}}catch{return[]}}),Q=await Promise.all(J),v=[],D=0;for(let n of Q){if(!n||!n.matches)continue;if(D>=W)break;let w=W-D,P=n.matches.slice(0,w);v.push({path:n.path,matches:P}),D+=P.length}typeof global.gc=="function"&&global.gc();let G=M?"(fuzzy mode)":F?"(regex mode)":m?"(keyword mode)":"(standard mode)";if(v.length===0){let n=h==="file"?` in '${e}'`:h==="dir"||h==="glob"?` in '${e}'`:". Try to specify files",w=h==="dir"?"[DIR]":h==="glob"?"[GLOB]":"";return`${w}${w?" ":""}Found 0 matches of '${t}'${n}${G?` ${G}`:""}`}let N=G?` ${G}`:"",T=`${v.length} file${v.length===1?"":"s"}`,U=`${D} match${D===1?"":"es"}`,I;h==="file"?I=`Found ${U} of '${t}' in '${e}'${N}:`:h==="dir"||h==="glob"?I=`Found ${U} of '${t}' in '${e}' across ${T}${N}:`:I=`Found ${U} of '${t}' across ${T}${N}:`;let X=h==="dir"?"[DIR]":h==="glob"?"[GLOB]":"",B=`${X}${X?" ":""}${I}
|
|
2
|
+
|
|
3
|
+
`;for(let n of v){B+=`${n.path}
|
|
4
|
+
`;for(let w of n.matches)B+=` ${w.line}: ${w.content}
|
|
5
|
+
`;B+=`
|
|
6
|
+
`}return B.trimEnd()}catch(l){return`ERROR: ${l.message}`}};export{at as search_keyword};
|
|
@@ -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-3CZWTXIR.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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-FQBBOFNP.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import{c as k}from"./chunk-DSVLWYIT.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-
|
|
1
|
+
import{g as h,h as m,i as R}from"./chunk-ZRP6USHC.js";import{a as F}from"./chunk-FQBBOFNP.js";import{a as $}from"./chunk-Y5JU726N.js";import{a as g}from"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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-4XXLWMY6.js";import"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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-AF7LASZ3.js";import"./chunk-4XXLWMY6.js";import"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.js";export{b as openUsageDashboard,a as startUsageServer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-RZTZPIC5.js";import"./chunk-Y5JU726N.js";import"./chunk-DSVLWYIT.js";export{a as view_file};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-A73NNVCZ.js";import"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-A73NNVCZ.js";import"./chunk-DSVLWYIT.js";import R from"puppeteer";import v from"turndown";import{gfm as M}from"turndown-plugin-gfm";var L=async t=>{let i=t;if(typeof t=="object"&&t!==null)i=t.url||t.targetUrl||t.href||"";else if(typeof t=="string"){let r=t.match(/url\s*=\s*["'](.*)["']/);i=r?r[1]:t}let c=typeof i=="string"?i.trim():"";if(!c)return"ERROR: No target URL provided.";let s=3,f=null;for(let r=1;r<=s;r++){let a=null;try{let m=y();a=await R.launch({headless:!0,executablePath:m.executablePath||void 0,args:["--no-sandbox","--disable-setuid-sandbox","--disable-gpu","--disable-dev-shm-usage"]});let o=await a.newPage();await o.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.7778.178 Safari/537.36"),await o.setViewport({width:1920,height:1440});let d=r===1?Math.random()*1e3+500:Math.random()*2e3+1e3;await new Promise(l=>setTimeout(l,d)),await o.goto(c,{waitUntil:"networkidle2",timeout:18e4}),await new Promise(l=>setTimeout(l,1e3));let w=await o.evaluate(()=>{document.querySelectorAll("script, style, noscript, svg, canvas, iframe, ad, .ads, link, meta, img").forEach(e=>e.remove());let N=document.createNodeIterator(document.body,NodeFilter.SHOW_COMMENT),b;for(;b=N.nextNode();)b.remove();for(document.querySelectorAll("*").forEach(e=>{let n=e.attributes;for(let u=n.length-1;u>=0;u--){let p=n[u].name;p!=="href"&&p!=="src"&&e.removeAttribute(p)}});document.querySelector("div, span");)document.querySelectorAll("div, span").forEach(e=>{e.parentNode&&e.replaceWith(...e.childNodes)});document.querySelectorAll("br").forEach(e=>{e.replaceWith(document.createTextNode(`
|
|
2
2
|
|
|
3
3
|
`))});let E=()=>{let e=!1;document.querySelectorAll("*").forEach(n=>{n.childNodes.length===0&&!n.innerText.trim()&&(n.remove(),e=!0)}),e&&E()};return E(),document.body.innerHTML});if(!w)throw new Error("EMPTY_RENDER_RESULT");let S=w.replace(/<br\s*\/?>/gi,`
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunk-A73NNVCZ.js";import{a as k}from"./chunk-Y5JU726N.js";import{d as M}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-A73NNVCZ.js";import{a as k}from"./chunk-Y5JU726N.js";import{d as M}from"./chunk-DSVLWYIT.js";import v from"puppeteer";import _ from"fs";import q from"path";var V=async F=>{let{query:f,limit:j=5,aiMode:L=!1}=k(F);if(!f)return'ERROR: Missing "query" argument for WebSearch.';let S=3,y=null;if(L){let u=`Query: ${f}
|
|
2
2
|
|
|
3
3
|
RESPONSE RULES:
|
|
4
4
|
- ANSWER CONCISELY (TL;DR style) WITH REQUIRED DETAILS UNDER 300 WORDS.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-FQBBOFNP.js";import{a as s}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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-FQBBOFNP.js";import{a as R}from"./chunk-Y5JU726N.js";import{a as $}from"./chunk-GRQ7JZZP.js";import"./chunk-OSDQRSY6.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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(`
|
|
@@ -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-FQBBOFNP.js";import{a as y}from"./chunk-Y5JU726N.js";import"./chunk-L3W2X74K.js";import"./chunk-DSVLWYIT.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,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as b}from"./chunks/chunk-
|
|
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"),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
3
|
[ERROR] Allocation value '${u} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
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-
|
|
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-HY4ME2BW.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.
|
|
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-
|
|
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-DEFENSGY.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
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
|
|
@@ -66,30 +66,30 @@ 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 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(
|
|
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(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"):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:z,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:H,indicatorComponent:()=>null}))},B=k=>{O&&O(),W(k)},{unmount:V}=_(s.createElement(X,null));O=V})},i,$="",A;try{let{loadSettings:s}=await import("./chunks/settings-KKYNW25D.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-KJGLCANP.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
|
|
|
73
|
-
|
|
73
|
+
Write as conventional, title + bullet description style commit message. No markdown, emojis, 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-GVLMN5KT.js");n=e(n).trim(),r?r=`Stdin Context (${x}):
|
|
74
74
|
${n}
|
|
75
75
|
---
|
|
76
76
|
|
|
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-
|
|
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-GVLMN5KT.js");a=w(a).trim(),r?r=`Stdin Context:
|
|
78
78
|
${a}
|
|
79
79
|
---
|
|
80
80
|
|
|
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-
|
|
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-KKYNW25D.js"),{getProviderAPIKey:g}=await import("./chunks/secrets-LPVNWDTB.js"),{getDefaultModel:l}=await import("./chunks/model_config-M24OEKJE.js"),{generateSimpleContent:c}=await import("./chunks/ai-NFNMNHUW.js"),{checkQuotaDetailed:h}=await import("./chunks/usage-VLICZGBC.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||{}},W=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",M=new Date,H=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}),V=`${H}-${O}-${X}, ${B}`,k=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
82
82
|
Use NO markdown, only plain text
|
|
83
83
|
Additional Context:
|
|
84
|
-
- OS: ${
|
|
84
|
+
- OS: ${W}
|
|
85
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: ${
|
|
86
|
+
- Approx time: ${V}
|
|
87
87
|
- Non interactive CLI, support piped inputs
|
|
88
88
|
- 'fluxflow' TUI has full agentic tools & capabilities${S.trim().length>0?`
|
|
89
89
|
User Nickname: ${S.trim()}`:""}${D.trim().length>0?`
|
|
90
|
-
User Preferences: ${D.trim()}`:""}`.trim(),{getPromptSessionHistory:F,savePromptSessionHistory:
|
|
90
|
+
User Preferences: ${D.trim()}`:""}`.trim(),{getPromptSessionHistory:F,savePromptSessionHistory:z,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
91
|
`)}let{text:e}=await c(E,s,L,k,E.thinkingLevel),a=(e||"").trim();process.stdout.write(a+`
|
|
92
92
|
${A?"":`
|
|
93
|
-
`}`),a&&await
|
|
93
|
+
`}`),a&&await z(r,a)}catch(e){console.error(`[ERROR] Prompt request failed: ${e.message.trim()}
|
|
94
94
|
|
|
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-
|
|
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-2EXHWUSL.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