fluxflow-cli 5.2.1 → 5.3.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.
@@ -1,6 +1,6 @@
1
- import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-BINPY3GV.js"),l=b(w),c=l.task||l.instruction||l.prompt,E=l.model||null,C=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:C||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],A={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
1
+ import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-2LTBT3VL.js"),l=b(w),c=l.task||l.instruction||l.prompt,E=l.model||null,C=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:C||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],A={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
2
2
  Respond using tool: [action:Answer(id="${i}", answer="...")]
3
3
  [/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((M,_)=>M+_.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,A,E,f,null,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")||n.startsWith("[Action Result]")){let o=n.split(`
4
4
  `);o.length>5&&(n=o.slice(0,4).join(`
5
5
  `)+`
6
- ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-BINPY3GV.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`Background subagent started. Task ID: ${i}`};export{I as invoke};
6
+ ... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-2LTBT3VL.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`Background subagent started. Task ID: ${i}`};export{I as invoke};
@@ -1,3 +1,3 @@
1
- import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-BINPY3GV.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,null);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
- `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-BINPY3GV.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
1
+ import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-2LTBT3VL.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,null);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
2
+ `),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-2LTBT3VL.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
3
3
  `)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
@@ -0,0 +1,3 @@
1
+ import{a as L}from"./chunk-XPIXBWTZ.js";import{n as A}from"./chunk-7CCULUZN.js";import"./chunk-NTZSL2UT.js";import"./chunk-YFIWMGCS.js";import{Ollama as b}from"ollama";var _=new Map;async function D(a,e,n){let o=`${e}::${n}`;if(_.has(o))return _.get(o);try{let u=(await a.show({model:n}))?.thinking||null;return _.set(o,u),u}catch{return _.set(o,null),null}}function E(a,e){let n=a?.values,o=Array.isArray(n)&&n.some(d=>typeof d=="boolean"),m=Array.isArray(n)&&n.some(d=>typeof d=="string");if(o)switch(e){case"Fast":return!1;case"Low":case"Medium":case"Standard":case"High":case"xHigh":return!0;default:return!0}if(m)switch(e){case"Fast":return n.includes("low")?"low":!1;case"Low":return"low";case"Medium":case"Standard":return"medium";case"High":case"xHigh":return"high";default:return"medium"}let u={Fast:!1,Low:"low",Medium:"medium",Standard:"medium",High:"high",xHigh:"high"};return u[e]!==void 0?u[e]:!0}var $=async function*(a,e,n,o,m,u,d,x,O=1,H="Cloud"){let s=[];o&&s.push({role:"system",content:o});for(let t of n){let r=t.role==="user"?"user":"assistant",c="",w=[];if(Array.isArray(t.parts)){c=t.parts.map(l=>l.text||"").filter(Boolean).join(`
2
+ `);for(let l of t.parts){let k=l.inlineData||l.inline_data;k&&k.data&&w.push(k.data)}}else c=t.text||"";if(c||w.length>0){let l={role:r,content:c};w.length>0&&(l.images=w),s.push(l)}}let C=a===A||H==="Local"||!a||a==="LOCAL",y=C?process.env.OLLAMA_HOST||"http://127.0.0.1:11434":process.env.OLLAMA_HOST||"https://ollama.com",M={host:y};!C&&a&&(M.headers={Authorization:"Bearer "+a});let T=new b(M),i=[],g=null,v=Date.now(),h=!1,f=L("Ollama",e,m),p;if(f!==null)p=f==="false"||f===!1?!1:f==="true"||f===!0?!0:f;else{let t=await D(T,y,e);p=E(t,m)}if(p&&e&&e.toLowerCase().includes("gemma4")){let t=s.findIndex(r=>r.role==="system");t!==-1?s[t].content.includes("<|think|>")||(s[t].content=`<|think|>
3
+ ${s[t].content}`):s.unshift({role:"system",content:"<|think|>"})}let S={model:e,messages:s,stream:!0,think:p,keep_alive:"10m",tools:[],tool_choice:"none",options:{temperature:O}},N=await T.chat(S);for await(let t of N){if(x?.aborted)throw new DOMException("The user aborted a request.","AbortError");if(t.message?.thinking&&(i.push({text:t.message.thinking,thought:!0}),h=!0),t.message?.content&&(i.push({text:t.message.content}),h=!0),t.done){let r=t.prompt_eval_cached_count||0;if(!r&&t.prompt_eval_count){let c=t.prompt_eval_duration||0;c>0&&c<5e7&&(r=t.prompt_eval_count)}g={totalTokenCount:(t.prompt_eval_count||0)+(t.eval_count||0),promptTokenCount:t.prompt_eval_count||0,candidatesTokenCount:t.eval_count||0,cachedContentTokenCount:r,thoughtsTokenCount:0},h=!0}(t.done||Date.now()-v>=150&&h)&&(yield{candidates:i.length>0?[{content:{parts:[...i]}}]:[],usageMetadata:g},i=[],v=Date.now(),h=!1)}h&&(i.length>0||g)&&(yield{candidates:i.length>0?[{content:{parts:[...i]}}]:[],usageMetadata:g})};export{$ as getOllamaStream};
package/dist/cli.js CHANGED
@@ -65,7 +65,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(oe&&(console.log(`v${i}`),pr
65
65
  /docs View documentation
66
66
  /fluxflow init Create FluxFlow.md template
67
67
  /update check Check for new version
68
- /update latest Install latest release`),process.exit(0)),se){let C=t[1]||"latest";if(C==="check"){let x=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(x?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let m=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;m||(console.error("Error: Could not retrieve latest version."),process.exit(1)),m===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let r=(await import("react")).default,{useState:w}=r,{render:U,Box:h,Text:S}=await import("ink"),ie=(await import("ink-select-input")).default,_=(await import("ink-text-input")).default;return new Promise(D=>{let P=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:E,isSelected:F})=>r.createElement(h,{width:"100%"},r.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),b,X=()=>{let[E,F]=w("select"),[J,j]=w(""),z=R=>{R.value==="custom"?F("custom"):B({manager:R.value})},K=R=>{B({manager:"custom",customCommand:R})};return E==="custom"?r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),r.createElement(h,{flexDirection:"row"},r.createElement(S,{color:"cyan",bold:!0}," \u276F "),r.createElement(_,{value:J,onChange:j,onSubmit:K})),r.createElement(h,{marginTop:1},r.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),r.createElement(ie,{items:P,onSelect:z,itemComponent:H,indicatorComponent:()=>null}))},B=E=>{b&&b(),D(E)},{unmount:V}=U(r.createElement(X,null));b=V})},n,k="",A;try{let{loadSettings:r}=await import("./chunks/settings-IZC7UDNU.js");A=await r(),n=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!n){let r=await y();n=r.manager,k=r.customCommand}let p="";n==="pnpm"?p=`pnpm add -g fluxflow-cli@${m}`:n==="bun"?p=`bun add -g fluxflow-cli@${m}`:n==="yarn"?p=`yarn global add fluxflow-cli@${m}`:n==="custom"?p=k||A?.customUpdateCommand||`npm install -g fluxflow-cli@${m}`:p=`npm install -g fluxflow-cli@${m}`,console.log(`Updating FluxFlow to v${m} using ${n}...`),console.log(`Running: ${p}`);let{execSync:L}=await import("child_process");L(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${m}.\x1B[0m`)}catch(x){console.error("\x1B[31m\u274C Update failed:\x1B[0m",x.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:pe}=await import("react"),{render:de}=await import("ink"),{default:ue}=await import("./chunks/app-DRT7CX3P.js");process.env.NODE_NO_WARNINGS="1";let ge=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],fe=console.log,xe=console.warn,we=console.error,W=o=>{let d=o.map(String).join(" ");return ge.some(s=>d.includes(s))};console.log=(...o)=>!W(o)&&fe(...o),console.warn=(...o)=>!W(o)&&xe(...o),console.error=(...o)=>!W(o)&&we(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],d=await import("path"),s=await import("fs-extra"),u=d.default.resolve(o);try{s.default.existsSync(u)&&s.default.statSync(u).isDirectory()?process.chdir(u):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(v){console.error(`[ERROR] Failed to change directory to "${o}": ${v.message}`),process.exit(0)}}let M=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||M){let o=t.includes("--new")||t.includes("-n"),s=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(M)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0);let l="";if(s&&s.trim()){let I=s.trim();I.startsWith("={")&&I.endsWith("}")?l=`
68
+ /update latest Install latest release`),process.exit(0)),se){let C=t[1]||"latest";if(C==="check"){let x=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(x?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let m=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;m||(console.error("Error: Could not retrieve latest version."),process.exit(1)),m===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let r=(await import("react")).default,{useState:w}=r,{render:U,Box:h,Text:S}=await import("ink"),ie=(await import("ink-select-input")).default,_=(await import("ink-text-input")).default;return new Promise(D=>{let P=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],H=({label:E,isSelected:F})=>r.createElement(h,{width:"100%"},r.createElement(S,{bold:F},"\u2514\u2500 ",F?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",E)),b,X=()=>{let[E,F]=w("select"),[J,j]=w(""),z=R=>{R.value==="custom"?F("custom"):B({manager:R.value})},K=R=>{B({manager:"custom",customCommand:R})};return E==="custom"?r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),r.createElement(h,{flexDirection:"row"},r.createElement(S,{color:"cyan",bold:!0}," \u276F "),r.createElement(_,{value:J,onChange:j,onSubmit:K})),r.createElement(h,{marginTop:1},r.createElement(S,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):r.createElement(h,{flexDirection:"column",marginY:1},r.createElement(h,{marginBottom:1},r.createElement(S,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),r.createElement(ie,{items:P,onSelect:z,itemComponent:H,indicatorComponent:()=>null}))},B=E=>{b&&b(),D(E)},{unmount:V}=U(r.createElement(X,null));b=V})},n,k="",A;try{let{loadSettings:r}=await import("./chunks/settings-IZC7UDNU.js");A=await r(),n=A?.systemSettings?.updateManager||A?.updateManager}catch{}if(!n){let r=await y();n=r.manager,k=r.customCommand}let p="";n==="pnpm"?p=`pnpm add -g fluxflow-cli@${m}`:n==="bun"?p=`bun add -g fluxflow-cli@${m}`:n==="yarn"?p=`yarn global add fluxflow-cli@${m}`:n==="custom"?p=k||A?.customUpdateCommand||`npm install -g fluxflow-cli@${m}`:p=`npm install -g fluxflow-cli@${m}`,console.log(`Updating FluxFlow to v${m} using ${n}...`),console.log(`Running: ${p}`);let{execSync:L}=await import("child_process");L(p,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${m}.\x1B[0m`)}catch(x){console.error("\x1B[31m\u274C Update failed:\x1B[0m",x.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:pe}=await import("react"),{render:de}=await import("ink"),{default:ue}=await import("./chunks/app-37HBAYJY.js");process.env.NODE_NO_WARNINGS="1";let ge=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],fe=console.log,xe=console.warn,we=console.error,W=o=>{let d=o.map(String).join(" ");return ge.some(s=>d.includes(s))};console.log=(...o)=>!W(o)&&fe(...o),console.warn=(...o)=>!W(o)&&xe(...o),console.error=(...o)=>!W(o)&&we(...o);let Y=t.findIndex(o=>o==="--cwd"||o==="--path");if(Y!==-1&&Y+1<t.length){let o=t[Y+1],d=await import("path"),s=await import("fs-extra"),u=d.default.resolve(o);try{s.default.existsSync(u)&&s.default.statSync(u).isDirectory()?process.chdir(u):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(v){console.error(`[ERROR] Failed to change directory to "${o}": ${v.message}`),process.exit(0)}}let M=t.includes("--commit_8f4a2b9c"),q=t.findIndex(o=>o==="-p"||o==="--prompt");if(q!==-1||M){let o=t.includes("--new")||t.includes("-n"),s=(q!==-1?t.slice(q+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(M)try{let{execSync:e}=await import("child_process"),a=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();a||process.exit(0);let l="";if(s&&s.trim()){let I=s.trim();I.startsWith("={")&&I.endsWith("}")?l=`
69
69
 
70
70
  Instruction: ${I.slice(2,-1).trim()}`:l=`
71
71
 
@@ -73,7 +73,8 @@ Hint: ${I}`}s=`Git Staged Diff:
73
73
  ${a}
74
74
  ---
75
75
 
76
- Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff${l}`}catch{process.exit(0)}let u=t.findIndex(e=>e==="-r"||e==="--run"),v=null,i=null;if(u!==-1&&u+1<t.length){v=t[u+1];try{let{execSync:e}=await import("child_process");i=e(v,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){i=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(i){let{stripAnsi:e}=await import("./chunks/exec_command-SQB5LU5X.js");i=e(i).trim(),s?s=`Stdin Context (${v}):
76
+ Write as conventional, title + bullet description style commit message. No markdown, emojis, fluff
77
+ Commit types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert${l}`}catch{process.exit(0)}let u=t.findIndex(e=>e==="-r"||e==="--run"),v=null,i=null;if(u!==-1&&u+1<t.length){v=t[u+1];try{let{execSync:e}=await import("child_process");i=e(v,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){i=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(i){let{stripAnsi:e}=await import("./chunks/exec_command-SQB5LU5X.js");i=e(i).trim(),s?s=`Stdin Context (${v}):
77
78
  ${i}
78
79
  ---
79
80
 
@@ -81,7 +82,7 @@ ${s}`:s=i}if(!M&&!process.stdin.isTTY){let e=[];for await(let l of process.stdin
81
82
  ${a}
82
83
  ---
83
84
 
84
- ${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-IZC7UDNU.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-LHP6ATGQ.js"),{getDefaultModel:c}=await import("./chunks/model_config-IVWGOIBK.js"),{generateSimpleContent:m}=await import("./chunks/ai-BINPY3GV.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-G7HRNQNU.js"),n=await C(),k=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==s&&e!=="-n"&&e!=="--new"),A=M||k.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let l=k.indexOf(a);if(l!==-1&&l+1<k.length)return k[l+1]}return null},L=M&&n.systemSettings?.commitMessageModel&&n.systemSettings.commitMessageModel!=="Default"?n.systemSettings.commitMessageModel:null,r=M&&L&&n.systemSettings?.commitMessageProvider?n.systemSettings.commitMessageProvider:null,w=p(["--provider"])||r||n.aiProvider||"Google",U=p(["--model"])||L||n.activeModel||c(w,n.apiTier)||c(w,"paid"),h=p(["--key"])||await x(w);!h&&!(w==="c_openai"&&n.systemSettings?.customOpenAIBaseUrl)&&(console.error(`[ERROR] No API key resolved for provider "${w}".`),process.exit(1));let S=await y("agent",{aiProvider:w});S.allowed||(console.error(`[ERROR] ${S.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:ie="",nickname:_="",instructions:D=""}=n?.profileData??{},P={aiProvider:w,apiKey:h,model:U,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:n.systemSettings||{}},H=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",b=new Date,X=b.getFullYear(),B=b.toLocaleString("en-US",{month:"short"}).toUpperCase(),V=String(b.getDate()).padStart(2,"0"),E=b.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),F=`${X}-${B}-${V}, ${E}`,J=(P.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),j=ee.basename(J).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),z=`Identity: FluxFlow. Sassy, CLI Assistant
85
+ ${s}`:s=a}}s||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-IZC7UDNU.js"),{getProviderAPIKey:x}=await import("./chunks/secrets-LHP6ATGQ.js"),{getDefaultModel:c}=await import("./chunks/model_config-IVWGOIBK.js"),{generateSimpleContent:m}=await import("./chunks/ai-2LTBT3VL.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-G7HRNQNU.js"),n=await C(),k=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==s&&e!=="-n"&&e!=="--new"),A=M||k.includes("--raw")||t.includes("--raw"),p=e=>{for(let a of e){let l=k.indexOf(a);if(l!==-1&&l+1<k.length)return k[l+1]}return null},L=M&&n.systemSettings?.commitMessageModel&&n.systemSettings.commitMessageModel!=="Default"?n.systemSettings.commitMessageModel:null,r=M&&L&&n.systemSettings?.commitMessageProvider?n.systemSettings.commitMessageProvider:null,w=p(["--provider"])||r||n.aiProvider||"Google",U=p(["--model"])||L||n.activeModel||c(w,n.apiTier)||c(w,"paid"),h=p(["--key"])||await x(w);!h&&!(w==="c_openai"&&n.systemSettings?.customOpenAIBaseUrl)&&(console.error(`[ERROR] No API key resolved for provider "${w}".`),process.exit(1));let S=await y("agent",{aiProvider:w});S.allowed||(console.error(`[ERROR] ${S.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let{name:ie="",nickname:_="",instructions:D=""}=n?.profileData??{},P={aiProvider:w,apiKey:h,model:U,mode:"flow",thinkingLevel:p(["--thinking"])||"Fast",systemSettings:n.systemSettings||{}},H=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",b=new Date,X=b.getFullYear(),B=b.toLocaleString("en-US",{month:"short"}).toUpperCase(),V=String(b.getDate()).padStart(2,"0"),E=b.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),F=`${X}-${B}-${V}, ${E}`,J=(P.model||"").replace(/^.*::/,"").split(":")[0].replace(/\/free$/,"").trim(),j=ee.basename(J).replace(/-free$/,"").replace(/_free$/,"").replace(/^free_/,"").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim()),z=`Identity: FluxFlow. Sassy, CLI Assistant
85
86
  Use NO markdown, only plain text
86
87
  Context:
87
88
  - OS: ${H}
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "5.2.1",
4
- "date": "2026-11-08",
3
+ "version": "5.3.0",
4
+ "date": "2026-11-09",
5
5
  "description": "One of the lightest, fastest, high-fidelity agentic CLI with sub-agents & advance computer use.",
6
6
  "keywords": [
7
7
  "ai",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "5.2.1",
4
- "date": "2026-11-08",
3
+ "version": "5.3.0",
4
+ "date": "2026-11-09",
5
5
  "description": "One of the lightest, fastest, high-fidelity agentic CLI with sub-agents & advance computer use.",
6
6
  "keywords": [
7
7
  "ai",
@@ -1,2 +0,0 @@
1
- import{a as T}from"./chunk-XPIXBWTZ.js";import{n as O}from"./chunk-7CCULUZN.js";import"./chunk-NTZSL2UT.js";import"./chunk-YFIWMGCS.js";import{Ollama as D}from"ollama";var B=async function*(l,p,w,d,u,S,b,L,M=1,v="Cloud"){let m=[];d&&m.push({role:"system",content:d});for(let t of w){let r=t.role==="user"?"user":"assistant",o="",c=[];if(Array.isArray(t.parts)){o=t.parts.map(a=>a.text||"").filter(Boolean).join(`
2
- `);for(let a of t.parts){let h=a.inlineData||a.inline_data;h&&h.data&&c.push(h.data)}}else o=t.text||"";if(o||c.length>0){let a={role:r,content:o};c.length>0&&(a.images=c),m.push(a)}}let f=l===O||v==="Local"||!l||l==="LOCAL",g={host:f?process.env.OLLAMA_HOST||"http://127.0.0.1:11434":process.env.OLLAMA_HOST||"https://ollama.com"};!f&&l&&(g.headers={Authorization:"Bearer "+l});let C=new D(g),e=[],i=null,_=Date.now(),n=!1,s=T("Ollama",p,u),k={Fast:!1,Low:"low",Medium:"medium",Standard:"medium",High:"high",xHigh:"high"},A=s!==null?s==="false"||s===!1?!1:s==="true"||s===!0?!0:s:k[u]!==void 0?k[u]:!0,x={model:p,messages:m,stream:!0,think:A,keep_alive:"10m",tools:[],tool_choice:"none",options:{temperature:M}},N=await C.chat(x);for await(let t of N){if(L?.aborted)throw new DOMException("The user aborted a request.","AbortError");if(t.message?.thinking&&(e.push({text:t.message.thinking,thought:!0}),n=!0),t.message?.content&&(e.push({text:t.message.content}),n=!0),t.done){let r=t.prompt_cached_count||0;if(!r&&t.prompt_eval_count){let o=t.prompt_eval_duration||0;o>0&&o<5e7&&(r=t.prompt_eval_count)}i={totalTokenCount:(t.prompt_eval_count||0)+(t.eval_count||0),promptTokenCount:t.prompt_eval_count||0,candidatesTokenCount:t.eval_count||0,cachedContentTokenCount:r,thoughtsTokenCount:0},n=!0}(t.done||Date.now()-_>=150&&n)&&(yield{candidates:e.length>0?[{content:{parts:[...e]}}]:[],usageMetadata:i},e=[],_=Date.now(),n=!1)}n&&(e.length>0||i)&&(yield{candidates:e.length>0?[{content:{parts:[...e]}}]:[],usageMetadata:i})};export{B as getOllamaStream};