fluxflow-cli 4.4.4 → 4.4.5

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.
@@ -2,4 +2,4 @@ import{screen as j}from"@nut-tree-fork/nut-js";import B from"screenshot-desktop"
2
2
  <rect x="${w+1}" y="${m+1}" width="${v-2}" height="${y-2}" fill="rgba(0, 255, 255, 0.015)" stroke="rgba(255, 255, 0, 0.3)" stroke-width="1.1" rx="2"/>
3
3
  `;let M;if(s.isCustomY)M=r;else{let g=r+(s.yOffset!==void 0?s.yOffset:3);M=Math.max(m+11,Math.min(m+y+3,g))}u+=`
4
4
  <text x="${e}" y="${M}" font-family="'Segoe UI', Roboto, sans-serif" font-size="14" font-weight="600" fill="#FFFF00" stroke="#000000" stroke-width="2" paint-order="stroke fill" stroke-linejoin="round" opacity="0.8" text-anchor="middle">${G}</text>
5
- `}return`<svg width="${o}" height="${t}" xmlns="http://www.w3.org/2000/svg">${u}</svg>`}var J=1,V=o=>new Promise(t=>setTimeout(t,o));async function Q(){try{let{loadSettings:o}=await import("./settings-NKBYU2YV.js"),t=await o();return Number(t.display||0)}catch{return 0}}async function st(){let o=await Q();try{let t=await B.listDisplays();if(t&&t.length>0)return{format:"png",screen:(t[o]||t[0]).id}}catch{}return{format:"png"}}async function rt(){let o=0,t=await st();for(;o<2;){let C=await B(t);await V(500);let a=await B(t);if(C.equals(a))return a;o++,o<2&&await V(3e3)}return await V(3e3),await B(t)}async function ht(){try{let o=await rt(),t=await et(o),C=ot(l.TARGET_WIDTH,l.TARGET_HEIGHT,l.COLS,l.ROWS,t),a=await K(o).resize(l.TARGET_WIDTH,l.TARGET_HEIGHT,{fit:"fill"}).composite([{input:Buffer.from(C),top:0,left:0}]).png({quality:100}).toBuffer();if(process.env.SHOW_DEBUG_GRID)try{let s=Z.resolve(process.cwd(),"screenshots");await P.ensureDir(s);let G=Z.join(s,`${J}.png`);await P.writeFile(G,a),J++}catch{}let x=a.toString("base64"),c=t.length,d=o,u=a;return d=null,u=null,{base64:x,mimeType:"image/png",width:l.TARGET_WIDTH,height:l.TARGET_HEIGHT,detectedCount:c}}catch(o){return console.error("Failed to capture gridded screenshot:",o),null}}function nt(o){if(o==null)return null;let t=null;if(typeof o=="number")t=o;else if(typeof o=="string"){let w=o.trim();if(/^\d+$/.test(w))t=parseInt(w,10);else{let m=w.match(/^([A-Z])([0-9]{1,2})$/i);if(m){let v=m[1].toUpperCase().charCodeAt(0)-65,y=parseInt(m[2],10)-1;t=v*l.COLS+y+1}}}if(t===null||isNaN(t))return null;if(U&&U.length>0){let w=U.find(m=>m.cellNum===t);if(w)return{x:w.cx,y:w.cy,colIdx:Math.floor((t-1)%l.COLS),rowIdx:Math.floor((t-1)/l.COLS),cellNum:t}}let C=l.COLS*l.ROWS;if(t<1||t>C)return null;let a=t-1,x=Math.floor(a/l.COLS),c=a%l.COLS,d=l.TARGET_WIDTH/l.COLS,u=l.TARGET_HEIGHT/l.ROWS,s=Math.floor(c*d+d/2),G=Math.floor(x*u+u/2);return{x:s,y:G,colIdx:c,rowIdx:x,cellNum:t}}async function ut(o,t,C){let a=null;if(typeof o=="number"||typeof o=="string"?a=nt(o):o&&typeof o.x=="number"&&typeof o.y=="number"&&(a=o),!a)return null;let x=t,c=C,d=0,u=0,s=await Q();try{let y=await B.listDisplays();if(y&&y.length>0){let e=y[s]||y[0];e.width&&e.height&&(x=e.width,c=e.height),e.left!==void 0&&(d=e.left),e.top!==void 0&&(u=e.top)}}catch{}if(!x||!c)try{x=await j.width(),c=await j.height()}catch{x=1920,c=1080}let G=x/l.TARGET_WIDTH,w=c/l.TARGET_HEIGHT,m=Math.round(a.x*G)+d,v=Math.round(a.y*w)+u;return{x:m,y:v,screenW:x,screenH:c,offsetX:d,offsetY:u}}export{l as a,Q as b,ht as c,nt as d,ut as e};
5
+ `}return`<svg width="${o}" height="${t}" xmlns="http://www.w3.org/2000/svg">${u}</svg>`}var J=1,V=o=>new Promise(t=>setTimeout(t,o));async function Q(){try{let{loadSettings:o}=await import("./settings-TAIBP5U4.js"),t=await o();return Number(t.display||0)}catch{return 0}}async function st(){let o=await Q();try{let t=await B.listDisplays();if(t&&t.length>0)return{format:"png",screen:(t[o]||t[0]).id}}catch{}return{format:"png"}}async function rt(){let o=0,t=await st();for(;o<2;){let C=await B(t);await V(500);let a=await B(t);if(C.equals(a))return a;o++,o<2&&await V(3e3)}return await V(3e3),await B(t)}async function ht(){try{let o=await rt(),t=await et(o),C=ot(l.TARGET_WIDTH,l.TARGET_HEIGHT,l.COLS,l.ROWS,t),a=await K(o).resize(l.TARGET_WIDTH,l.TARGET_HEIGHT,{fit:"fill"}).composite([{input:Buffer.from(C),top:0,left:0}]).png({quality:100}).toBuffer();if(process.env.SHOW_DEBUG_GRID)try{let s=Z.resolve(process.cwd(),"screenshots");await P.ensureDir(s);let G=Z.join(s,`${J}.png`);await P.writeFile(G,a),J++}catch{}let x=a.toString("base64"),c=t.length,d=o,u=a;return d=null,u=null,{base64:x,mimeType:"image/png",width:l.TARGET_WIDTH,height:l.TARGET_HEIGHT,detectedCount:c}}catch(o){return console.error("Failed to capture gridded screenshot:",o),null}}function nt(o){if(o==null)return null;let t=null;if(typeof o=="number")t=o;else if(typeof o=="string"){let w=o.trim();if(/^\d+$/.test(w))t=parseInt(w,10);else{let m=w.match(/^([A-Z])([0-9]{1,2})$/i);if(m){let v=m[1].toUpperCase().charCodeAt(0)-65,y=parseInt(m[2],10)-1;t=v*l.COLS+y+1}}}if(t===null||isNaN(t))return null;if(U&&U.length>0){let w=U.find(m=>m.cellNum===t);if(w)return{x:w.cx,y:w.cy,colIdx:Math.floor((t-1)%l.COLS),rowIdx:Math.floor((t-1)/l.COLS),cellNum:t}}let C=l.COLS*l.ROWS;if(t<1||t>C)return null;let a=t-1,x=Math.floor(a/l.COLS),c=a%l.COLS,d=l.TARGET_WIDTH/l.COLS,u=l.TARGET_HEIGHT/l.ROWS,s=Math.floor(c*d+d/2),G=Math.floor(x*u+u/2);return{x:s,y:G,colIdx:c,rowIdx:x,cellNum:t}}async function ut(o,t,C){let a=null;if(typeof o=="number"||typeof o=="string"?a=nt(o):o&&typeof o.x=="number"&&typeof o.y=="number"&&(a=o),!a)return null;let x=t,c=C,d=0,u=0,s=await Q();try{let y=await B.listDisplays();if(y&&y.length>0){let e=y[s]||y[0];e.width&&e.height&&(x=e.width,c=e.height),e.left!==void 0&&(d=e.left),e.top!==void 0&&(u=e.top)}}catch{}if(!x||!c)try{x=await j.width(),c=await j.height()}catch{x=1920,c=1080}let G=x/l.TARGET_WIDTH,w=c/l.TARGET_HEIGHT,m=Math.round(a.x*G)+d,v=Math.round(a.y*w)+u;return{x:m,y:v,screenW:x,screenH:c,offsetX:d,offsetY:u}}export{l as a,Q as b,ht as c,nt as d,ut as e};
@@ -1,3 +1,3 @@
1
- import{e as v,f as g}from"./chunk-SIINYZWE.js";import{a as d,b as n}from"./chunk-I27MASHH.js";import m from"fs-extra";import h from"path";import l from"fs";import p from"path";import{fileURLToPath as k}from"url";var A=k(import.meta.url),x=p.dirname(A),y="",E=[p.join(x,"../../model_config.json"),p.join(x,"../model_config.json")];for(let t of E)try{if(l.existsSync(t)){y=t;break}}catch{}var S=p.join(d,"model_config.json"),o=null;if(l.existsSync(S))try{let t=l.readFileSync(S,"utf-8"),e=JSON.parse(t);e&&e.providers&&e.fallbacks&&e.release&&(o=e)}catch{}if(!o&&y)try{let t=l.readFileSync(y,"utf-8"),e=JSON.parse(t);e&&e.providers&&e.fallbacks&&e.release&&(o=e)}catch{}o||(console.error(`
1
+ import{e as v,f as g}from"./chunk-SIINYZWE.js";import{a as d,b as n}from"./chunk-I27MASHH.js";import f from"fs-extra";import h from"path";import l from"fs";import p from"path";import{fileURLToPath as k}from"url";var A=k(import.meta.url),x=p.dirname(A),y="",E=[p.join(x,"../../model_config.json"),p.join(x,"../model_config.json")];for(let t of E)try{if(l.existsSync(t)){y=t;break}}catch{}var S=p.join(d,"model_config.json"),o=null;if(l.existsSync(S))try{let t=l.readFileSync(S,"utf-8"),e=JSON.parse(t);e&&e.providers&&e.fallbacks&&e.release&&(o=e)}catch{}if(!o&&y)try{let t=l.readFileSync(y,"utf-8"),e=JSON.parse(t);e&&e.providers&&e.fallbacks&&e.release&&(o=e)}catch{}o||(console.error(`
2
2
  [Error] Unable to load model configuration. Please re-install the package from your package manager.
3
- `),process.exit(1));var F=new Set,L=new Set,T=()=>{let t=new Set,e=new Set;if(o.providers)for(let r of Object.keys(o.providers)){let a=o.providers[r];if(a&&a.models){let s=["Free","Paid"];for(let i of s){let u=a.models[i];if(Array.isArray(u)){for(let f of u)if(f&&f.cmd){let w=f.cmd.trim().toLowerCase();f.multimodal===!0&&t.add(w),f.hasReasoning===!0&&e.add(w)}}}}}if(Array.isArray(o.multimodal_models))for(let r of o.multimodal_models)r&&typeof r=="string"&&t.add(r.trim().toLowerCase());F=t,L=e};T();var C=async()=>((async()=>{try{let e=await fetch("https://raw.githubusercontent.com/KushalRoyChowdhury/fluxflow-cli/main/model_config.json",{signal:AbortSignal.timeout(2e3)});if(e.ok){let r=await e.json();if(r&&r.providers&&r.fallbacks&&r.release){let a=typeof r.version=="number"&&r.version>o.version,s=typeof r.release=="number"&&r.release>o.release;if(a||s){o=r,T();try{l.existsSync(d)||l.mkdirSync(d,{recursive:!0}),l.writeFileSync(S,JSON.stringify(r,null,2),"utf-8")}catch{}}}}}catch{}})(),!0),D=!1,K=t=>{D=!!t},R=t=>{if(!t)return!1;let e=t.trim().toLowerCase();return!!(D||F.has(e)||e.startsWith("gemini-")||e.startsWith("gemma-"))},j=t=>{if(!t)return!1;let e=t.trim().toLowerCase();return L.has(e)},q=(t,e)=>{let r=o.providers[t];return r?r.models[e==="Free"?"Free":"Paid"]||[]:[]},_=(t,e)=>{let r=o.providers[t];return r?e==="Free"?r.default_free:r.default_paid:""},G=t=>o.fallbacks[t];var c={mode:"Flux",display:0,thinkingLevel:"Medium",aiProvider:"Google",activeModel:_("Google","Free")||"gemma-4-31b-it",showFullThinking:!0,apiTier:"Free",quotas:{agentLimit:999999,backgroundLimit:999999,searchLimit:100,customModelId:"",customLimit:0,providerTiers:{Google:"Free",DeepSeek:"Free",NVIDIA:"Free",OpenRouter:"Free",InferX:"Free",SenseNova:"Free"}},systemSettings:{memory:!1,theme:"Dark",compression:0,autoExec:!1,allowExternalAccess:!1,advanceRollback:!1,autoDeleteHistory:"7d",useExternalData:!1,externalDataPath:"",preserveThinking:!0,loadingPhrases:!1,progressiveRendering:!0,showTPMEstimate:!1,subAgents:!0,CustomSubAgent:!1,SubAgentModel:"Default",SubAgentProvider:"",dynamicDirAwareness:!1,indentationTree:!0,ollamaEndpoint:"Cloud",compressToolResults:!1,autoTruncateResults:!1},profileData:{name:null,nickname:null,instructions:null},imageSettings:{keyType:"Default",quality:"Low-High",apiKey:""}},I=async()=>{let t={...c};try{if(await m.exists(n)){let e=v(n);if(e.imageSettings&&e.imageSettings.apiKey)try{let r=e.imageSettings.apiKey,{saveSecret:a}=await import("./secrets-BTHIU63L.js");await a("POLLINATIONS_API_KEY",r),e.imageSettings.apiKey="",g(n,e)}catch{}t={...c,...e,quotas:{...c.quotas,...e.quotas,providerTiers:{...c.quotas.providerTiers,...e.quotas?.providerTiers||{}}},systemSettings:{...c.systemSettings,...e.systemSettings},profileData:{...c.profileData,...e.profileData},imageSettings:{...c.imageSettings,...e.imageSettings}}}}catch(e){console.error("Failed to load settings:",e)}try{let{getSecret:e}=await import("./secrets-BTHIU63L.js"),r=await e("POLLINATIONS_API_KEY");r&&(t.imageSettings.apiKey=r)}catch{}if(t.showFullThinking===!1){t.showFullThinking=!0;try{g(n,t)}catch{}}return t},b=async t=>{let{FLUXFLOW_DIR:e}=await import("./paths-R3DD7CRF.js"),r=["logs","secret"];for(let a of r){let s=h.join(e,a),i=h.join(t,a);try{await m.exists(s)&&(await m.ensureDir(i),await m.copy(s,i,{overwrite:!0}))}catch(u){console.error(`Migration failed for ${a}:`,u)}}},H=async t=>{try{let e=await I();if(!e.systemSettings.useExternalData&&t.systemSettings?.useExternalData&&t.systemSettings?.externalDataPath&&await b(t.systemSettings.externalDataPath),t.imageSettings&&t.imageSettings.apiKey!==void 0){let{saveSecret:a,removeSecret:s}=await import("./secrets-BTHIU63L.js"),i=t.imageSettings.apiKey;i?await a("POLLINATIONS_API_KEY",i):await s("POLLINATIONS_API_KEY")}let r={...e,...t};return r.imageSettings&&(r.imageSettings={...r.imageSettings,apiKey:""}),await m.ensureDir(h.dirname(n)),g(n,r),!0}catch(e){return console.error("Failed to save settings:",e),!1}};export{C as a,K as b,R as c,j as d,q as e,_ as f,G as g,I as h,H as i};
3
+ `),process.exit(1));var F=new Set,L=new Set,T=()=>{let t=new Set,e=new Set;if(o.providers)for(let r of Object.keys(o.providers)){let a=o.providers[r];if(a&&a.models){let i=["Free","Paid"];for(let s of i){let u=a.models[s];if(Array.isArray(u)){for(let m of u)if(m&&m.cmd){let w=m.cmd.trim().toLowerCase();m.multimodal===!0&&t.add(w),m.hasReasoning===!0&&e.add(w)}}}}}if(Array.isArray(o.multimodal_models))for(let r of o.multimodal_models)r&&typeof r=="string"&&t.add(r.trim().toLowerCase());F=t,L=e};T();var C=async()=>((async()=>{try{let e=await fetch("https://raw.githubusercontent.com/KushalRoyChowdhury/fluxflow-cli/main/model_config.json",{signal:AbortSignal.timeout(2e3)});if(e.ok){let r=await e.json();if(r&&r.providers&&r.fallbacks&&r.release){let a=typeof r.version=="number"&&r.version>o.version,i=typeof r.release=="number"&&r.release>o.release;if(a||i){o=r,T();try{l.existsSync(d)||l.mkdirSync(d,{recursive:!0}),l.writeFileSync(S,JSON.stringify(r,null,2),"utf-8")}catch{}}}}}catch{}})(),!0),D=!1,K=t=>{D=!!t},R=t=>{if(!t)return!1;let e=t.trim().toLowerCase();return!!(D||F.has(e)||e.startsWith("gemini-")||e.startsWith("gemma-"))},j=t=>{if(!t)return!1;let e=t.trim().toLowerCase();return L.has(e)},q=(t,e)=>{let r=o.providers[t];return r?r.models[e==="Free"?"Free":"Paid"]||[]:[]},_=(t,e)=>{let r=o.providers[t];return r?e==="Free"?r.default_free:r.default_paid:""},G=t=>o.fallbacks[t];var c={mode:"Flux",display:0,thinkingLevel:"Medium",aiProvider:"Google",activeModel:_("Google","Free")||"gemma-4-31b-it",showFullThinking:!0,apiTier:"Free",quotas:{agentLimit:999999,backgroundLimit:999999,searchLimit:100,customModelId:"",customLimit:0,providerTiers:{Google:"Free",DeepSeek:"Free",NVIDIA:"Free",OpenRouter:"Free",InferX:"Free",SenseNova:"Free"}},systemSettings:{memory:!1,theme:"Dark",compression:0,autoExec:!0,allowExternalAccess:!1,advanceRollback:!1,autoDeleteHistory:"7d",useExternalData:!1,externalDataPath:"",preserveThinking:!0,loadingPhrases:!0,progressiveRendering:!0,showTPMEstimate:!0,subAgents:!1,CustomSubAgent:!1,SubAgentModel:"Default",SubAgentProvider:"",dynamicDirAwareness:!1,indentationTree:!0,ollamaEndpoint:"Cloud",compressToolResults:!1,autoTruncateResults:!1},profileData:{name:null,nickname:null,instructions:null},imageSettings:{keyType:"Default",quality:"Low-High",apiKey:""}},I=async()=>{let t={...c};try{if(await f.exists(n)){let e=v(n);if(e.imageSettings&&e.imageSettings.apiKey)try{let r=e.imageSettings.apiKey,{saveSecret:a}=await import("./secrets-BTHIU63L.js");await a("POLLINATIONS_API_KEY",r),e.imageSettings.apiKey="",g(n,e)}catch{}t={...c,...e,quotas:{...c.quotas,...e.quotas,providerTiers:{...c.quotas.providerTiers,...e.quotas?.providerTiers||{}}},systemSettings:{...c.systemSettings,...e.systemSettings},profileData:{...c.profileData,...e.profileData},imageSettings:{...c.imageSettings,...e.imageSettings}}}}catch(e){console.error("Failed to load settings:",e)}try{let{getSecret:e}=await import("./secrets-BTHIU63L.js"),r=await e("POLLINATIONS_API_KEY");r&&(t.imageSettings.apiKey=r)}catch{}if(t.showFullThinking===!1){t.showFullThinking=!0;try{g(n,t)}catch{}}return t},b=async t=>{let{FLUXFLOW_DIR:e}=await import("./paths-R3DD7CRF.js"),r=["logs","secret"];for(let a of r){let i=h.join(e,a),s=h.join(t,a);try{await f.exists(i)&&(await f.ensureDir(s),await f.copy(i,s,{overwrite:!0}))}catch(u){console.error(`Migration failed for ${a}:`,u)}}},H=async t=>{try{let e=await I();if(!e.systemSettings.useExternalData&&t.systemSettings?.useExternalData&&t.systemSettings?.externalDataPath&&await b(t.systemSettings.externalDataPath),t.imageSettings&&t.imageSettings.apiKey!==void 0){let{saveSecret:a,removeSecret:i}=await import("./secrets-BTHIU63L.js"),s=t.imageSettings.apiKey;s?await a("POLLINATIONS_API_KEY",s):await i("POLLINATIONS_API_KEY")}let r={...e,...t};return r.imageSettings&&(r.imageSettings={...r.imageSettings,apiKey:""}),await f.ensureDir(h.dirname(n)),g(n,r),!0}catch(e){return console.error("Failed to save settings:",e),!1}};export{C as a,K as b,R as c,j as d,q as e,_ as f,G as g,I as h,H as i};
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"./chunk-GKFFLQSG.js";export{a as GRID_CONFIG,c as captureGriddedScreenshot,b as getActiveDisplay,e as gridToNativeCoordinates,d as parseGridCodeTo720p};
1
+ import{a,b,c,d,e}from"./chunk-LXTXILI5.js";export{a as GRID_CONFIG,c as captureGriddedScreenshot,b as getActiveDisplay,e as gridToNativeCoordinates,d as parseGridCodeTo720p};
@@ -1 +1 @@
1
- import{h as a,i as b}from"./chunk-TKIVOTJ4.js";import"./chunk-SIINYZWE.js";import"./chunk-I27MASHH.js";export{a as loadSettings,b as saveSettings};
1
+ import{h as a,i as b}from"./chunk-N5EE3XWJ.js";import"./chunk-SIINYZWE.js";import"./chunk-I27MASHH.js";export{a as loadSettings,b as saveSettings};
package/dist/cli.js CHANGED
@@ -57,4 +57,4 @@ Usage: fluxflow --export error`),process.exit(1)}if(T&&(console.log(`v${u}`),pro
57
57
  /docs View documentation
58
58
  /fluxflow init Create FluxFlow.md template
59
59
  /update check Check for new version
60
- /update latest Install latest release`),process.exit(0)),R){let h=t[1]||"latest";if(h==="check"){let i=t[2]==="latest";try{let f=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;f||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(i?`Latest version: v${f}`:f!==u?`A new version of FluxFlow is available: v${f} (current: v${u}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${u}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(h==="latest"){console.log("Checking latest version and settings...");try{let r=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;r||(console.error("Error: Could not retrieve latest version."),process.exit(1)),r===u&&(console.log(`FluxFlow is already up to date (v${u}).`),process.exit(0));let f=async()=>{let o=(await import("react")).default,{useState:$}=o,{render:q,Box:g,Text:w}=await import("ink"),z=(await import("ink-select-input")).default,J=(await import("ink-text-input")).default;return new Promise(K=>{let Q=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],Z=({label:v,isSelected:b})=>o.createElement(g,{width:"100%"},o.createElement(w,{bold:b},"\u2514\u2500 ",b?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",v)),A,ee=()=>{let[v,b]=$("select"),[te,se]=$(""),re=E=>{E.value==="custom"?b("custom"):B({manager:E.value})},ae=E=>{B({manager:"custom",customCommand:E})};return v==="custom"?o.createElement(g,{flexDirection:"column",marginY:1},o.createElement(g,{marginBottom:1},o.createElement(w,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),o.createElement(g,{flexDirection:"row"},o.createElement(w,{color:"cyan",bold:!0}," \u276F "),o.createElement(J,{value:te,onChange:se,onSubmit:ae})),o.createElement(g,{marginTop:1},o.createElement(w,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):o.createElement(g,{flexDirection:"column",marginY:1},o.createElement(g,{marginBottom:1},o.createElement(w,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),o.createElement(z,{items:Q,onSelect:re,itemComponent:Z,indicatorComponent:()=>null}))},B=v=>{A&&A(),K(v)},{unmount:oe}=q(o.createElement(ee,null));A=oe})},c,N="",M;try{let{loadSettings:o}=await import("./chunks/settings-NKBYU2YV.js");M=await o(),c=M?.systemSettings?.updateManager||M?.updateManager}catch{}if(!c){let o=await f();c=o.manager,N=o.customCommand}let d="";c==="pnpm"?d=`pnpm add -g fluxflow-cli@${r}`:c==="bun"?d=`bun add -g fluxflow-cli@${r}`:c==="yarn"?d=`yarn global add fluxflow-cli@${r}`:c==="custom"?d=N||M?.customUpdateCommand||`npm install -g fluxflow-cli@${r}`:d=`npm install -g fluxflow-cli@${r}`,console.log(`Updating FluxFlow to v${r} using ${c}...`),console.log(`Running: ${d}`);let{execSync:X}=await import("child_process");X(d,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${r}.\x1B[0m`)}catch(i){console.error("\x1B[31m\u274C Update failed:\x1B[0m",i.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:U}=await import("react"),{render:j}=await import("ink"),{default:Y}=await import("./chunks/app-JU4DHKRO.js");process.env.NODE_NO_WARNINGS="1";let G=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],H=console.log,W=console.warn,V=console.error,S=e=>{let a=e.map(String).join(" ");return G.some(n=>a.includes(n))};console.log=(...e)=>!S(e)&&H(...e),console.warn=(...e)=>!S(e)&&W(...e),console.error=(...e)=>!S(e)&&V(...e);let C=t.findIndex(e=>e==="--cwd"||e==="--path");if(C!==-1&&C+1<t.length){let e=t[C+1],a=await import("path"),n=await import("fs-extra"),p=a.default.resolve(e);try{n.default.existsSync(p)&&n.default.statSync(p).isDirectory()?process.chdir(p):(console.error(`[ERROR] Directory not found: "${e}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${e}": ${x.message}`),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 I=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",I),["SIGINT","SIGTERM","SIGHUP"].forEach(e=>{process.once(e,()=>{I(),process.exit(0)})}),t.includes("--playground")){let e=process.cwd();process.argv.push("--original-cwd",e);let{DATA_DIR:a}=await import("./chunks/paths-R3DD7CRF.js"),n=await import("path"),p=await import("fs-extra"),x=n.default.join(a,"playground");try{p.default.ensureDirSync(x),process.chdir(x)}catch{}}j(U.createElement(Y,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
60
+ /update latest Install latest release`),process.exit(0)),R){let h=t[1]||"latest";if(h==="check"){let i=t[2]==="latest";try{let f=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;f||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(i?`Latest version: v${f}`:f!==u?`A new version of FluxFlow is available: v${f} (current: v${u}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${u}).`)}catch(l){console.error("Error checking for updates:",l.message),process.exit(1)}process.exit(0)}else if(h==="latest"){console.log("Checking latest version and settings...");try{let r=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;r||(console.error("Error: Could not retrieve latest version."),process.exit(1)),r===u&&(console.log(`FluxFlow is already up to date (v${u}).`),process.exit(0));let f=async()=>{let o=(await import("react")).default,{useState:$}=o,{render:q,Box:g,Text:w}=await import("ink"),z=(await import("ink-select-input")).default,J=(await import("ink-text-input")).default;return new Promise(K=>{let Q=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],Z=({label:v,isSelected:b})=>o.createElement(g,{width:"100%"},o.createElement(w,{bold:b},"\u2514\u2500 ",b?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",v)),A,ee=()=>{let[v,b]=$("select"),[te,se]=$(""),re=E=>{E.value==="custom"?b("custom"):B({manager:E.value})},ae=E=>{B({manager:"custom",customCommand:E})};return v==="custom"?o.createElement(g,{flexDirection:"column",marginY:1},o.createElement(g,{marginBottom:1},o.createElement(w,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),o.createElement(g,{flexDirection:"row"},o.createElement(w,{color:"cyan",bold:!0}," \u276F "),o.createElement(J,{value:te,onChange:se,onSubmit:ae})),o.createElement(g,{marginTop:1},o.createElement(w,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):o.createElement(g,{flexDirection:"column",marginY:1},o.createElement(g,{marginBottom:1},o.createElement(w,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),o.createElement(z,{items:Q,onSelect:re,itemComponent:Z,indicatorComponent:()=>null}))},B=v=>{A&&A(),K(v)},{unmount:oe}=q(o.createElement(ee,null));A=oe})},c,N="",M;try{let{loadSettings:o}=await import("./chunks/settings-TAIBP5U4.js");M=await o(),c=M?.systemSettings?.updateManager||M?.updateManager}catch{}if(!c){let o=await f();c=o.manager,N=o.customCommand}let d="";c==="pnpm"?d=`pnpm add -g fluxflow-cli@${r}`:c==="bun"?d=`bun add -g fluxflow-cli@${r}`:c==="yarn"?d=`yarn global add fluxflow-cli@${r}`:c==="custom"?d=N||M?.customUpdateCommand||`npm install -g fluxflow-cli@${r}`:d=`npm install -g fluxflow-cli@${r}`,console.log(`Updating FluxFlow to v${r} using ${c}...`),console.log(`Running: ${d}`);let{execSync:X}=await import("child_process");X(d,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${r}.\x1B[0m`)}catch(i){console.error("\x1B[31m\u274C Update failed:\x1B[0m",i.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:U}=await import("react"),{render:j}=await import("ink"),{default:Y}=await import("./chunks/app-EDFWPGE6.js");process.env.NODE_NO_WARNINGS="1";let G=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],H=console.log,W=console.warn,V=console.error,S=e=>{let a=e.map(String).join(" ");return G.some(n=>a.includes(n))};console.log=(...e)=>!S(e)&&H(...e),console.warn=(...e)=>!S(e)&&W(...e),console.error=(...e)=>!S(e)&&V(...e);let C=t.findIndex(e=>e==="--cwd"||e==="--path");if(C!==-1&&C+1<t.length){let e=t[C+1],a=await import("path"),n=await import("fs-extra"),p=a.default.resolve(e);try{n.default.existsSync(p)&&n.default.statSync(p).isDirectory()?process.chdir(p):(console.error(`[ERROR] Directory not found: "${e}"`),process.exit(0))}catch(x){console.error(`[ERROR] Failed to change directory to "${e}": ${x.message}`),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 I=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",I),["SIGINT","SIGTERM","SIGHUP"].forEach(e=>{process.once(e,()=>{I(),process.exit(0)})}),t.includes("--playground")){let e=process.cwd();process.argv.push("--original-cwd",e);let{DATA_DIR:a}=await import("./chunks/paths-R3DD7CRF.js"),n=await import("path"),p=await import("fs-extra"),x=n.default.join(a,"playground");try{p.default.ensureDirSync(x),process.chdir(x)}catch{}}j(U.createElement(Y,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "4.4.4",
4
- "date": "2026-08-24",
3
+ "version": "4.4.5",
4
+ "date": "2026-08-25",
5
5
  "description": "A High-Fidelity Agentic CLI with Sub-Agents for the Flux Era. Now has Computer Use.",
6
6
  "keywords": [
7
7
  "ai",
@@ -32,7 +32,8 @@
32
32
  "cat.txt",
33
33
  ".puppeteerrc.cjs",
34
34
  "flux-flow.cjs",
35
- "model_config.json"
35
+ "model_config.json",
36
+ "surprise.js"
36
37
  ],
37
38
  "type": "module",
38
39
  "bin": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "4.4.4",
4
- "date": "2026-08-24",
3
+ "version": "4.4.5",
4
+ "date": "2026-08-25",
5
5
  "description": "A High-Fidelity Agentic CLI with Sub-Agents for the Flux Era. Now has Computer Use.",
6
6
  "keywords": [
7
7
  "ai",
@@ -32,7 +32,8 @@
32
32
  "cat.txt",
33
33
  ".puppeteerrc.cjs",
34
34
  "flux-flow.cjs",
35
- "model_config.json"
35
+ "model_config.json",
36
+ "surprise.js"
36
37
  ],
37
38
  "type": "module",
38
39
  "bin": {
package/surprise.js ADDED
@@ -0,0 +1,140 @@
1
+ // 🎆 surprise.js — A tiny fireworks show for your terminal
2
+ // Run: node surprise.js (auto-exits after ~14s, or Ctrl+C anytime)
3
+ // Zero dependencies. Pure ANSI chaos.
4
+
5
+ const W = process.stdout.columns || 100;
6
+ const H = Math.min(process.stdout.rows || 30, 40);
7
+ const DURATION_MS = 14000;
8
+
9
+ const COLORS = [196, 202, 208, 214, 220, 226, 118, 46, 51, 87, 123, 159, 213, 207, 201];
10
+ const SPARK_CHARS = ['*', '+', '·', '✦', '˙', '.'];
11
+
12
+ let rockets = [];
13
+ let sparks = [];
14
+ let running = true;
15
+
16
+ const rand = (min, max) => min + Math.random() * (max - min);
17
+ const pick = (arr) => arr[Math.floor(Math.random() * arr.length)];
18
+
19
+ function launchRocket() {
20
+ rockets.push({
21
+ x: rand(5, W - 5),
22
+ y: H - 2,
23
+ vy: -rand(0.9, 1.6),
24
+ targetY: rand(3, H * 0.35),
25
+ color: pick(COLORS),
26
+ trail: true,
27
+ });
28
+ }
29
+
30
+ function explode(x, y) {
31
+ const count = Math.floor(rand(30, 70));
32
+ const baseColor = pick(COLORS);
33
+ const shape = pick(['burst', 'ring', 'willow']);
34
+ for (let i = 0; i < count; i++) {
35
+ let vx, vy;
36
+ if (shape === 'ring') {
37
+ const angle = (i / count) * Math.PI * 2;
38
+ const speed = rand(0.8, 1.1);
39
+ vx = Math.cos(angle) * speed;
40
+ vy = Math.sin(angle) * speed * 0.55; // squashed ring
41
+ } else {
42
+ const angle = rand(0, Math.PI * 2);
43
+ const speed = shape === 'willow' ? rand(0.2, 0.7) : rand(0.4, 1.4);
44
+ vx = Math.cos(angle) * speed;
45
+ vy = Math.sin(angle) * speed * 0.6;
46
+ }
47
+ sparks.push({
48
+ x, y, vx, vy,
49
+ life: shape === 'willow' ? rand(60, 110) : rand(25, 55),
50
+ maxLife: 0,
51
+ color: Math.random() < 0.75 ? baseColor : pick(COLORS),
52
+ gravity: shape === 'willow' ? 0.02 : 0.045,
53
+ char: pick(SPARK_CHARS),
54
+ });
55
+ sparks[sparks.length - 1].maxLife = sparks[sparks.length - 1].life;
56
+ }
57
+ }
58
+
59
+ function step() {
60
+ // rockets
61
+ for (const r of rockets) {
62
+ r.y += r.vy;
63
+ if (r.y <= r.targetY || r.vy >= -0.2) {
64
+ r.dead = true;
65
+ explode(r.x, r.y);
66
+ }
67
+ }
68
+ rockets = rockets.filter((r) => !r.dead);
69
+
70
+ // sparks
71
+ for (const s of sparks) {
72
+ s.x += s.vx;
73
+ s.y += s.vy;
74
+ s.vy += s.gravity;
75
+ s.vx *= 0.985;
76
+ s.life--;
77
+ }
78
+ sparks = sparks.filter((s) => s.life > 0 && s.x > 0 && s.x < W && s.y > 0 && s.y < H);
79
+ }
80
+
81
+ function render() {
82
+ const buf = Array.from({ length: H }, () => new Array(W).fill(null));
83
+
84
+ for (const r of rockets) {
85
+ const cx = Math.round(r.x), cy = Math.round(r.y);
86
+ if (cy >= 0 && cy < H && cx >= 0 && cx < W)
87
+ buf[cy][cx] = { ch: '|', color: 250 };
88
+ // faint trail
89
+ const ty = cy + 1;
90
+ if (ty < H && Math.random() < 0.6 && buf[ty][cx] === null)
91
+ buf[ty][cx] = { ch: '.', color: 240 };
92
+ }
93
+
94
+ for (const s of sparks) {
95
+ const cx = Math.round(s.x), cy = Math.round(s.y);
96
+ if (cy >= 0 && cy < H && cx >= 0 && cx < W) {
97
+ const ratio = s.life / s.maxLife;
98
+ const ch = ratio > 0.66 ? s.char : ratio > 0.33 ? '+' : '.';
99
+ buf[cy][cx] = { ch, color: s.color };
100
+ }
101
+ }
102
+
103
+ let out = '\x1b[H';
104
+ for (let y = 0; y < H; y++) {
105
+ for (let x = 0; x < W; x++) {
106
+ const cell = buf[y][x];
107
+ out += cell ? `\x1b[38;5;${cell.color}m${cell.ch}` : ' ';
108
+ }
109
+ out += '\x1b[0m\n';
110
+ }
111
+ process.stdout.write(out);
112
+ }
113
+
114
+ function cleanup(msg) {
115
+ running = false;
116
+ process.stdout.write(`\x1b[?25h\x1b[0m\n${msg}\n`);
117
+ process.exit(0);
118
+ }
119
+
120
+ // ── Showtime ──────────────────────────────────────────────
121
+ process.stdout.write('\x1b[2J\x1b[?25l'); // clear screen, hide cursor
122
+ process.on('SIGINT', () =>
123
+ cleanup('\n🎆 Show cut short! The sky will miss you.')
124
+ );
125
+
126
+ const QUOTES = [
127
+ '🎆 Boom. You just watched math become art.',
128
+ '✨ Physics called — it wants its gravity back.',
129
+ '🎇 That was 100% JavaScript. No pixels were harmed.',
130
+ '🌟 Thanks for watching! Tip your local terminal.',
131
+ ];
132
+
133
+ setTimeout(() => cleanup('\n' + pick(QUOTES)), DURATION_MS).unref();
134
+
135
+ setInterval(() => {
136
+ if (!running) return;
137
+ if (Math.random() < 0.35 && rockets.length < 4) launchRocket();
138
+ step();
139
+ render();
140
+ }, 33); // ~30fps
@@ -1 +0,0 @@
1
- import{$ as l,R as b,S as c,T as d,U as e,V as f,W as g,X as h,Y as i,Z as j,_ as k}from"./chunk-4DTVMZ35.js";import"./chunk-ACHIC75V.js";import{c as a}from"./chunk-TKIVOTJ4.js";import"./chunk-SIINYZWE.js";import"./chunk-I27MASHH.js";import"./chunk-56EJGQU3.js";import"./chunk-GKFFLQSG.js";export{i as compressHistory,b as convertChannelThinkTags,j as deleteChatSummary,k as getAIStream,c as getCleanGroupedLength,f as getGoogleClient,h as initAI,a as isModelMultimodal,e as isTerminationSignaled,g as runJanitorTask,l as runSubagent,d as signalTermination};