fluxflow-cli 4.9.0 → 4.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{ai-C6SSGCTT.js → ai-5QIAOHQ7.js} +1 -1
- package/dist/chunks/{app-LFQK2PKQ.js → app-RGBQV6J6.js} +76 -76
- package/dist/chunks/{chunk-BQQGML7T.js → chunk-OZ2EUJLG.js} +1 -1
- package/dist/chunks/{chunk-LD4KZAYI.js → chunk-QQXHAYOT.js} +1 -1
- package/dist/chunks/{chunk-FHI2LU2P.js → chunk-THILP7P5.js} +182 -179
- package/dist/chunks/{chunk-CCXXAPYH.js → chunk-W3TQYL57.js} +1 -1
- package/dist/chunks/{chunk-A4PE46B4.js → chunk-Y3JUWKDQ.js} +1 -1
- package/dist/chunks/{screen_grid-QAZBAXG2.js → screen_grid-2QLQELW7.js} +1 -1
- package/dist/chunks/{settings-KQLTW4BV.js → settings-V4MURDR6.js} +1 -1
- package/dist/chunks/usageServer-BF2USVQQ.js +1 -0
- package/dist/cli.js +2 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/chunks/usageServer-XUF3PHP4.js +0 -1
|
@@ -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-
|
|
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-V4MURDR6.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
1
|
import{e as v,f as g}from"./chunk-SIINYZWE.js";import{a as d,b as n}from"./chunk-4TZKD2XR.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 s=o.providers[r];if(s&&s.models){let i=["Free","Paid"];for(let a of i){let u=s.models[a];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
|
|
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 s=o.providers[r];if(s&&s.models){let i=["Free","Paid"];for(let a of i){let u=s.models[a];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 N=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 s=typeof r.version=="number"&&r.version>o.version,i=typeof r.release=="number"&&r.release>o.release;if(s||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};var 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:""},U=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",Poolside:"Free",ExpLabs:"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,imageHistoryCU:"Standard"},profileData:{name:null,nickname:null,instructions:null},imageSettings:{keyType:"Default",quality:"Low-High",apiKey:""}},b=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:s}=await import("./secrets-2JNLNTQE.js");await s("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-2JNLNTQE.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},I=async t=>{let{FLUXFLOW_DIR:e}=await import("./paths-CHZDSDRF.js"),r=["logs","secret"];for(let s of r){let i=h.join(e,s),a=h.join(t,s);try{await f.exists(i)&&(await f.ensureDir(a),await f.copy(i,a,{overwrite:!0}))}catch(u){console.error(`Migration failed for ${s}:`,u)}}},X=async t=>{try{let e=await b();if(!e.systemSettings.useExternalData&&t.systemSettings?.useExternalData&&t.systemSettings?.externalDataPath&&await I(t.systemSettings.externalDataPath),t.imageSettings&&t.imageSettings.apiKey!==void 0){let{saveSecret:s,removeSecret:i}=await import("./secrets-2JNLNTQE.js"),a=t.imageSettings.apiKey;a?await s("POLLINATIONS_API_KEY",a):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{N as a,K as b,R as c,j as d,q as e,_ as f,U as g,b as h,X as i};
|