fluxflow-cli 4.40.0 → 4.41.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/dist/assets/logo.ico +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/chunks/ai-BZA7TWT3.js +1 -0
- package/dist/chunks/app-TTT2UBEU.js +331 -0
- package/dist/chunks/{auto_completion-NWIEI4SU.js → auto_completion-KOKDZVBJ.js} +1 -1
- package/dist/chunks/{chat-C7HYXKVZ.js → chat-E7KU2LZM.js} +1 -1
- package/dist/chunks/{chunk-M3NOFDLJ.js → chunk-3XOMPSDB.js} +1 -1
- package/dist/chunks/{chunk-IUN7DBB4.js → chunk-CTKW7YYV.js} +2 -3
- package/dist/chunks/{chunk-SDPX2VPK.js → chunk-CTNSVXOH.js} +1 -1
- package/dist/chunks/{chunk-4LL36ESE.js → chunk-NEOXX2J6.js} +168 -166
- package/dist/chunks/{chunk-VJT4U6KR.js → chunk-UIFI2JRY.js} +1 -1
- package/dist/chunks/chunk-WTMVNZDA.js +1 -0
- package/dist/chunks/{chunk-4DAFC4RK.js → chunk-XDCDANJJ.js} +1 -1
- package/dist/chunks/chunk-Y73PU7CC.js +1 -0
- package/dist/chunks/{click-T2BXRY7O.js → click-5WEIMJHK.js} +2 -2
- package/dist/chunks/{computer_action-VQBY6TW2.js → computer_action-FVC3EXVR.js} +1 -1
- package/dist/chunks/{drag-B5ED6RY7.js → drag-YOWUC5B7.js} +1 -1
- package/dist/chunks/{exec_command-WB2PILWK.js → exec_command-7AO6AUGQ.js} +1 -1
- package/dist/chunks/{generate_image-UHMQ32EH.js → generate_image-52GQGN2Q.js} +1 -1
- package/dist/chunks/{invoke-CYDFNNQ4.js → invoke-44R4K62P.js} +2 -2
- package/dist/chunks/{invokeSync-YEOM3MAZ.js → invokeSync-ZKNYPA5T.js} +2 -2
- package/dist/chunks/{key_press-MMN6Y3WZ.js → key_press-I4KBUAHP.js} +1 -1
- package/dist/chunks/{keyboard_typing-2OCGKXE2.js → keyboard_typing-TSJ4CP4R.js} +1 -1
- package/dist/chunks/nvidia-PSGYXYNK.js +2 -0
- package/dist/chunks/{screen_grid-26MRFY7E.js → screen_grid-EXWAAOMK.js} +1 -1
- package/dist/chunks/{scroll-CVJDBGZL.js → scroll-OHT6HAHC.js} +1 -1
- package/dist/chunks/{search_keyword-WIVNNMLY.js → search_keyword-I5QJUL77.js} +1 -1
- package/dist/chunks/{settings-OPQ3GJ62.js → settings-MGEVTCE4.js} +1 -1
- package/dist/chunks/{update_file-NT666LF5.js → update_file-DG3QLIHE.js} +1 -1
- package/dist/chunks/{usage-DFN6SYQ3.js → usage-MRIV7SXL.js} +1 -1
- package/dist/chunks/{usageServer-JWNNKDR3.js → usageServer-NH3CL6IF.js} +1 -1
- package/dist/chunks/{write_file-YYKJ3BGD.js → write_file-CIOAYT4P.js} +1 -1
- package/dist/cli.js +5 -5
- package/dist/package.json +4 -3
- package/package.json +4 -3
- package/dist/chunks/ai-ZKC574A7.js +0 -1
- package/dist/chunks/app-S2QWIJAK.js +0 -324
- package/dist/chunks/chunk-6H2P5XUL.js +0 -1
- package/dist/chunks/chunk-RHZU5POT.js +0 -1
- package/dist/chunks/nvidia-BN4YCFGY.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-6EYQQ7GQ.js";import{c as d,d as l}from"./chunk-P5HBJA23.js";import{f as h,g as m,l as C,m as M,s as f}from"./chunk-26BQ45XP.js";import u from"fs-extra";import j from"path";import{nanoid as L}from"nanoid";var D=Promise.resolve(),A=t=>{let r=D.then(async()=>{try{return await t()}catch(e){throw console.error("Lock Operation Failed:",e),e}});return D=r.catch(()=>{}),r},T=async()=>{await u.ensureDir(m);let t={};if(await u.pathExists(h))try{t=d(h,{})}catch{t={}}for(let r in t){let e=j.join(m,`${r}.json`);Object.defineProperty(t[r],"messages",{get:()=>{if(u.existsSync(e))try{return d(e,[])}catch{return[]}return[]},set:n=>{try{l(e,n)}catch{}},enumerable:!1,configurable:!0})}return t},B=async(t,r,e)=>A(async()=>{await u.ensureDir(m);let n=await T(),s=n[t],i=(e||[]).filter(a=>!a.isUpdateNotification&&(!a.isMeta||a.text&&a.text.includes("Request Cancelled"))),o=a=>{if(!a)return;let I=typeof a=="string"?a:a.text||a.content||"";if(!I||typeof I!="string")return;let w=I.replace(/\s*\n+\s*\[Prompted on:.*?\]/g,"").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi,"").trim();if(!w)return;let O=w.split(/\s+/),E;return O.length>7?E=O.slice(0,7).join(" ")+"...":w.length>45?E=w.substring(0,45).trimEnd()+"...":E=w,E},c,y=i.filter(a=>a.role==="user"),p=y[0],g=y[y.length-1],x=o(g),H=o(p);s&&s.prompt?Math.random()<.3&&x?c=x:c=s.prompt:c=H||x;let S=r||(s?s.name:`Session ${t.slice(-6)}`),F=j.join(m,`${t}.json`);l(F,i),n[t]={name:S,prompt:c||void 0,updatedAt:Date.now()};let k={};for(let a in n)k[a]={name:n[a].name,prompt:n[a].prompt||void 0,updatedAt:n[a].updatedAt};l(h,k)}),J=async(t,r)=>A(async()=>{let e=await T();e[t]?(e[t].name=r,e[t].updatedAt=Date.now()):e[t]={name:r,updatedAt:Date.now()};let n={};for(let s in e)n[s]={name:e[s].name,prompt:e[s].prompt||void 0,updatedAt:e[s].updatedAt};l(h,n)}),N=async t=>A(async()=>{let r=await T();delete r[t];let e={};for(let o in r)e[o]={name:r[o].name,prompt:r[o].prompt||void 0,updatedAt:r[o].updatedAt};if(l(h,e),await u.pathExists(f))try{let o=d(f,[]);if(Array.isArray(o)){let c=o.filter(y=>Object.keys(y)[0]!==String(t));l(f,c)}}catch{}let n=d(C,{});n[t]&&(delete n[t],l(C,n));let s=d(M,{});s[t]&&(delete s[t],l(M,s)),await b.deleteChatBackups(t);let i=j.join(m,`${t}.json`);if(await u.pathExists(i))try{await u.remove(i)}catch{}return r}),Y=()=>`flow-${L(6)}`,q=async t=>{if(!t||t==="Never")return;let r=parseInt(t);if(isNaN(r))return;let e=await T(),n=Date.now(),s=r*24*60*60*1e3,i=0;for(let o in e){let c=e[o];c.updatedAt&&n-c.updatedAt>s&&(await N(o),i++)}return i},G=(t,r=4)=>{if(t.length<=1)return t;let e=t[0],n=t.slice(1),s=r*2,i=n.slice(s);return[e,...i]};var K=async(t,r,e)=>A(async()=>{let n=d(f,[]);Array.isArray(n)||(n=[]);let s=r||0,i=e||0,o={total:s,context:i},c=n.findIndex(p=>Object.keys(p)[0]===String(t));s===0&&i===0?c!==-1&&n.splice(c,1):c!==-1?n[c]={[String(t)]:o}:n.push({[String(t)]:o});let y=n.filter(p=>{if(!p||typeof p!="object")return!1;let g=Object.keys(p)[0];if(!g)return!1;let x=p[g];return x&&((x.total||0)>0||(x.context||0)>0)});l(f,y)}),Q=async t=>{try{if(!await u.pathExists(f))return{total:0,context:0};let r=d(f,[]);if(!Array.isArray(r))return{total:0,context:0};let e=r.find(n=>Object.keys(n)[0]===String(t));return e?{total:0,context:0,...e[String(t)]}:{total:0,context:0}}catch{return{total:0,context:0}}};export{T as a,B as b,J as c,N as d,Y as e,q as f,G as g,K as h,Q as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as m,f as c}from"./chunk-P5HBJA23.js";import{b as s}from"./chunk-26BQ45XP.js";import r from"fs-extra";import p from"path";var o={mode:"Flux",display:0,thinkingLevel:"Medium",aiProvider:"",activeModel:"",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",TokenHarbor:"Free",Infron:"Free",APInex:"Free",c_openai:"Free"}},systemSettings:{customOpenAIBaseUrl:"",memory:!1,theme:"Dark",compression:0,autoExec:!0,allowExternalAccess:!1,advanceRollback:!1,autoDeleteHistory:"7d",useExternalData:!1,externalDataPath:"",preserveThinking:!0,loadingPhrases:!1,progressiveRendering:!0,showTPMEstimate:!0,subAgents:!1,CustomSubAgent:!1,SubAgentModel:"Default",SubAgentProvider:"",dynamicDirAwareness:!1,indentationTree:!0,ollamaEndpoint:"Cloud",compressToolResults:!1,autoTruncateResults:!0,imageHistoryCU:"Standard",contextLength:"256k",keepReasoningContext:!1,autoExcludeMetadata:!1,disableTodo:!1,clipboardContext:!1,alwaysAskFiles:".env, .env.*, *.env"},profileData:{preset:"Default",name:null,nickname:null,instructions:null},imageSettings:{keyType:"Default",quality:"Low-High",apiKey:""},autoCompletion:{enabled:!1,model:"Default",provider:"",baseUrl:""}},x={Mistral:"https://api.mistral.ai/v1/chat/completions",DeepSeek:"https://api.deepseek.com/chat/completions",OpenRouter:"https://openrouter.ai/api/v1/chat/completions",NVIDIA:"https://integrate.api.nvidia.com/v1",Ollama:"https://ollama.com/v1",InferX:"https://model.inferx.net/endpoints/v1/chat/completions",SenseNova:"https://token.sensenova.ai/v1/chat/completions",Poolside:"https://inference.poolside.ai/v1/chat/completions",ExpLabs:"https://api.experientiallabs.ai/v1/chat/completions",TokenHarbor:"https://tokenharbor.ai/v1/chat/completions",Infron:"https://llm.onerouter.pro/v1/chat/completions",APInex:"https://api.apinex.bond/v1/chat/completions",AIHubMix:"https://aihubmix.com/v1/chat/completions",Google:"https://generativelanguage.googleapis.com/v1beta/openai/chat/completions"},g=async()=>{let t={...o};try{if(await r.exists(s)){let e=m(s);if(e.imageSettings&&e.imageSettings.apiKey)try{let a=e.imageSettings.apiKey,{saveSecret:i}=await import("./secrets-5TCTEPEV.js");await i("POLLINATIONS_API_KEY",a),e.imageSettings.apiKey="",c(s,e)}catch{}t={...o,...e,quotas:{...o.quotas,...e.quotas,providerTiers:{...o.quotas.providerTiers,...e.quotas?.providerTiers||{}}},systemSettings:{...o.systemSettings,...e.systemSettings},profileData:{...o.profileData,...e.profileData},imageSettings:{...o.imageSettings,...e.imageSettings},autoCompletion:{...o.autoCompletion,...e.autoCompletion}}}}catch(e){console.error("Failed to load settings:",e)}try{let{getSecret:e}=await import("./secrets-5TCTEPEV.js"),a=await e("POLLINATIONS_API_KEY");a&&(t.imageSettings.apiKey=a)}catch{}if(t.showFullThinking===!1){t.showFullThinking=!0;try{c(s,t)}catch{}}return t},d=async t=>{let{FLUXFLOW_DIR:e}=await import("./paths-RQRI2XRY.js"),a=["logs","secret"];for(let i of a){let l=p.join(e,i),n=p.join(t,i);try{await r.exists(l)&&(await r.ensureDir(n),await r.copy(l,n,{overwrite:!0}))}catch(u){console.error(`Migration failed for ${i}:`,u)}}},D=async t=>{try{let e=await g();if(!e.systemSettings.useExternalData&&t.systemSettings?.useExternalData&&t.systemSettings?.externalDataPath&&await d(t.systemSettings.externalDataPath),t.imageSettings&&t.imageSettings.apiKey!==void 0){let{saveSecret:i,removeSecret:l}=await import("./secrets-5TCTEPEV.js"),n=t.imageSettings.apiKey;n?await i("POLLINATIONS_API_KEY",n):await l("POLLINATIONS_API_KEY")}let a={...e,...t};a.systemSettings&&(a.systemSettings.dynamicDirAwareness=!1),a.imageSettings&&(a.imageSettings={...a.imageSettings,apiKey:""}),await r.ensureDir(p.dirname(s)),c(s,a);try{let{invalidateCachedBaseUrl:i}=await import("./usage-DFN6SYQ3.js");i()}catch{}return!0}catch(e){return console.error("Failed to save settings:",e),!1}};export{x as a,g as b,D as c};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as j}from"./chunk-PTFCY2D5.js";import{a as W}from"./chunk-HFTI3R3Q.js";import{l as K}from"./chunk-KMOTPBF5.js";import"./chunk-26BQ45XP.js";var ue=async function*(M,e,k,c,g,D,w=!1,I,H=1){let A=[];c&&A.push({role:"system",content:c}),k.forEach(i=>{let N=i.role==="model"?"assistant":"user",d=[];Array.isArray(i.parts)&&i.parts.forEach(u=>{if(u.text)d.push({type:"text",text:u.text});else if(u.inlineData&&w){let r=u.inlineData.mimeType,f=u.inlineData.data;r.startsWith("image/")&&K(e)&&d.push({type:"image_url",image_url:{url:`data:${r};base64,${f}`}})}}),A.push({role:N,content:d.length===1&&d[0].type==="text"?d[0].text:d})});let T=W("NVIDIA",e,g),t=T!==null?T:{Fast:"Fast",Low:"Fast",Medium:"Standard",Standard:"Standard",High:"High",xHigh:"High"}[g]||"High",o=t!=="Fast"&&t!=="none"&&t!=="disabled"&&t!==!1,s=e.includes("kimi"),n=e.includes("gemma"),h=e.includes("deepseek"),y=e.includes("glm"),z=e.includes("mistral"),P=e.includes("minimax"),J=e.includes("gpt"),Y=e.includes("qwen"),Q=e.includes("nemotron"),X=e.includes("llama-3"),Z=e.includes("seed"),B=e.includes("poolside"),C=e.includes("thinkingmachines")||e.includes("muse"),ee=X,te={Fast:"low",Low:"low",Medium:"medium",Standard:"medium",High:"high",xHigh:"high"},se={Fast:"64",Low:"64",Medium:"4096",Standard:"4096",High:"16384",xHigh:"16384"},ne={Fast:"none",Low:"minimal",Medium:"medium",Standard:"medium",High:"max",xHigh:"max"},U=P||h||B||C?16384:32768;U=process.env.NVIDIA_BASE_URL?1024:U;let a={model:e,messages:A,max_tokens:U,stream:!0,stream_options:{include_usage:!0},temperature:H,tools:[],tool_choice:"none",...J&&{thinking:te[g]||"high"}};if(!(process.env.NVIDIA_BASE_URL||ee))if(s)a.chat_template_kwargs={thinking:o};else if(n)a.chat_template_kwargs={enable_thinking:o};else if(h)if(o){let i=t==="High"?"max":"high";a.chat_template_kwargs={thinking:!0,reasoning_effort:i}}else a.chat_template_kwargs={thinking:!1};else y?a.chat_template_kwargs={enable_thinking:o,clear_thinking:!o}:z?a.reasoning_effort=o?"high":"none":P&&e.includes("minimax-m3")?a.chat_template_kwargs={thinking_mode:o?"enabled":"disabled"}:Y?a.chat_template_kwargs={enable_thinking:o}:Q?t==="High"?a.chat_template_kwargs={enable_thinking:!0}:t==="Standard"?a.chat_template_kwargs={enable_thinking:!0,medium_effort:!0}:a.chat_template_kwargs={enable_thinking:!1}:Z?o&&(a.extra_body={thinking_budget:parseInt(se[t]??"4096")}):B?a.chat_template_kwargs={enable_thinking:o}:C&&(a.reasoning_effort=ne[t]||"medium");let V=0,G=6,$=!1,R=(process.env.NVIDIA_BASE_URL||"https://integrate.api.nvidia.com/v1").trim(),v=R.replace(/\/+$/,"");if(!v.endsWith("/v1")&&!v.endsWith("/v1/chat/completions"))throw new Error(`Invalid NVIDIA Base URL: "${R}". Endpoint URL MUST end with /v1 (e.g. https://integrate.api.nvidia.com/v1 or http://.../v1).`);let ae=v.endsWith("/chat/completions")?v:`${v}/chat/completions`,ie=process.env.NVIDIA_API_KEY&&process.env.NVIDIA_BASE_URL?process.env.NVIDIA_API_KEY:M;for(;V<G;){V++;try{let i=await j(ae,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ie}`},body:JSON.stringify(a),signal:I});if(!i.ok){let x=await i.text().catch(()=>""),S=i.statusText;try{let m=JSON.parse(x);S=m.error?.message||m.message||JSON.stringify(m.detail||m)}catch{x&&(S=x)}let b=new Error(`NVIDIA API Error (${i.status}): ${S}`);throw b.status=i.status,b}let N=i.body.getReader(),d=new TextDecoder,u="",r=[],f=null,q=Date.now(),_=!1;for(;;){let{done:x,value:S}=await N.read();if(x){_&&(r.length>0||f)&&(yield{candidates:r.length>0?[{content:{parts:r}}]:[],usageMetadata:f},$=!0);break}u+=d.decode(S,{stream:!0});let b=u.split(`
|
|
2
|
-
`);u=b.pop();let m=!1;for(let oe of b){let E=oe.trim();if(E){if(E==="data: [DONE]"){m=!0;break}if(E.startsWith("data: ")){let p;try{p=JSON.parse(E.substring(6))}catch{continue}if(p.error)throw new Error(`NVIDIA Stream Error: ${p.error.message||JSON.stringify(p.error)}`);try{let l=p.usage;l&&(f={totalTokenCount:l.total_tokens||l.prompt_tokens+l.completion_tokens,promptTokenCount:l.prompt_tokens||0,candidatesTokenCount:l.completion_tokens||0,cachedContentTokenCount:l.prompt_tokens_details?.cached_tokens||0,thoughtsTokenCount:(l.completion_tokens_details?.reasoning_tokens||0)+(l.completion_tokens_details?.thoughts_tokens||0)},_=!0);let F=p.choices?.[0]?.delta?.reasoning||p.choices?.[0]?.delta?.reasoning_content||"",O=p.choices?.[0]?.delta?.content||"";F&&(r.push({text:F,thought:!0}),_=!0),O&&(r.push({text:O}),_=!0)}catch{}}}}if((m||Date.now()-q>=350)&&_&&(yield{candidates:r.length>0?[{content:{parts:[...r]}}]:[],usageMetadata:f},$=!0,r=[],q=Date.now(),_=!1),m)break}break}catch(i){if($||V>=G)throw i;await new Promise(N=>setTimeout(N,3500))}}},he=async function*(M,e){let k=[],c=null,g=!1,D=null,w=s=>{if(k.push(s),c){let n=c;c=null,n()}},I=e.split("/").pop(),H=Array.from(new Set([I,I.replace(/\./g,"-"),I.replace(/\./g,"_")])),T=["https://buildapi.ngc.nvidia.com/v2/predict/queues/models/qc69jvmznzxy","https://api.ngc.nvidia.com/v2/predict/queues/models/qc69jvmznzxy"].flatMap(s=>H.map(n=>`${s}/${n}`)),L=!1,t=null,o=async()=>{try{let n=await(await Promise.any(T.map(async h=>{let y=await fetch(h);if(!y.ok)throw new Error(`HTTP ${y.status}`);return y}))).json();if(n&&n.queues&&n.queues[0]&&typeof n.queues[0].queueDepth=="number"){let h=n.queues[0].queueDepth;L||w({value:{type:"status",content:`Queue ${h||1}`},done:!1})}}catch{}};process.env.NVIDIA_BASE_URL||(o(),t=setInterval(o,5e3)),(async()=>{try{let s=M[Symbol.asyncIterator]();for(;;){let{value:n,done:h}=await s.next();if(h)break;L=!0,t&&(clearInterval(t),t=null),w({value:n,done:!1})}g=!0,w(null)}catch(s){if(D=s,t&&(clearInterval(t),t=null),c){let n=c;c=null,n()}}})();try{for(;;){if(D)throw D;if(k.length>0){let s=k.shift();if(s===null&&g)break;yield s.value}else{if(g)break;await new Promise(s=>{c=s})}}}finally{t&&(clearInterval(t),t=null)}};export{ue as getNVIDIAStream,he as wrapNvidiaStreamWithQueueDepth};
|