fluxflow-cli 4.45.0 → 4.46.1

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.
Files changed (43) hide show
  1. package/dist/chunks/{ai-5NWQNNMC.js → ai-R4AFCRMI.js} +1 -1
  2. package/dist/chunks/{app-KYCCN4ZF.js → app-U4VC6DO6.js} +120 -120
  3. package/dist/chunks/{auto_completion-MS7UGN4H.js → auto_completion-TLHA4FJW.js} +1 -1
  4. package/dist/chunks/{chunk-YSMPGXV3.js → chunk-45DLFA4C.js} +1 -1
  5. package/dist/chunks/{chunk-TPUNXYGC.js → chunk-ER3SNTS7.js} +1 -1
  6. package/dist/chunks/{chunk-TQOQHYJ6.js → chunk-GM5VNNTU.js} +1 -1
  7. package/dist/chunks/{chunk-5UIG3YUH.js → chunk-MS33ZWST.js} +1 -1
  8. package/dist/chunks/{chunk-EIJ6AAGK.js → chunk-OSSZ4LIE.js} +1 -1
  9. package/dist/chunks/chunk-U2GX6WT2.js +1 -0
  10. package/dist/chunks/{chunk-KYQFLMZE.js → chunk-UIL6OCU4.js} +3 -3
  11. package/dist/chunks/chunk-XDY4KWTM.js +1 -0
  12. package/dist/chunks/{chunk-OECY2H5A.js → chunk-YREUMK7Y.js} +13 -13
  13. package/dist/chunks/{click-TFBIMVSS.js → click-R35XTYKT.js} +2 -2
  14. package/dist/chunks/{computer_action-DM2RWE3G.js → computer_action-WNXZNAIZ.js} +1 -1
  15. package/dist/chunks/custom_openai-YS5EV6DG.js +3 -0
  16. package/dist/chunks/{drag-VXALN3P3.js → drag-IB5WSI6F.js} +1 -1
  17. package/dist/chunks/{exec_command-BDFXJQZJ.js → exec_command-6V5SM6WI.js} +1 -1
  18. package/dist/chunks/{generate_image-ABIDYET4.js → generate_image-VW5VG6VI.js} +1 -1
  19. package/dist/chunks/{invoke-7HHBCMTV.js → invoke-EI6WHT2A.js} +2 -2
  20. package/dist/chunks/{invokeSync-AULNCDC5.js → invokeSync-FK4TTKCM.js} +2 -2
  21. package/dist/chunks/{key_press-YIUO27XG.js → key_press-XDYBP7DW.js} +1 -1
  22. package/dist/chunks/{keyboard_typing-Q5CUT6YK.js → keyboard_typing-YHYH7O66.js} +1 -1
  23. package/dist/chunks/ollama-QB7WX7VD.js +2 -0
  24. package/dist/chunks/{recapture_screen-ILVFVUJF.js → recapture_screen-F6ZPZU56.js} +1 -1
  25. package/dist/chunks/{screen_grid-MSVBHIGV.js → screen_grid-IWNA3DA2.js} +1 -1
  26. package/dist/chunks/{scroll-5XSQ6ZBZ.js → scroll-GIP2J2QN.js} +1 -1
  27. package/dist/chunks/{search_keyword-VY5KXDOB.js → search_keyword-O52M65TB.js} +1 -1
  28. package/dist/chunks/secrets-YIWFP4S2.js +1 -0
  29. package/dist/chunks/secrets_v2-TEUFHDI7.js +1 -0
  30. package/dist/chunks/{settings-XLD5ZEHD.js → settings-HSQ2K6DN.js} +1 -1
  31. package/dist/chunks/{update_file-VOCN7OPY.js → update_file-KOHLNWAN.js} +1 -1
  32. package/dist/chunks/{usage-TNW22X3Y.js → usage-6V4XZT3Q.js} +1 -1
  33. package/dist/chunks/{usageServer-TAVWXYT6.js → usageServer-4XHUFY7X.js} +1 -1
  34. package/dist/chunks/{write_file-R6BAMSDH.js → write_file-D7QA2LB2.js} +5 -5
  35. package/dist/cli.js +5 -5
  36. package/dist/package.json +2 -2
  37. package/package.json +2 -2
  38. package/dist/chunks/chunk-UXLD7KTZ.js +0 -1
  39. package/dist/chunks/chunk-YEVCTH3B.js +0 -1
  40. package/dist/chunks/custom_openai-XMDYE7NM.js +0 -3
  41. package/dist/chunks/ollama-4PI2BDMM.js +0 -2
  42. package/dist/chunks/secrets-HXB3H4UI.js +0 -1
  43. package/dist/chunks/secrets_v2-AEJNZCOS.js +0 -1
@@ -1 +0,0 @@
1
- import{c as N,d as L}from"./chunk-P5HBJA23.js";import{e as E}from"./chunk-26BQ45XP.js";import b from"fs-extra";import D from"path";var R=D.join(E,"secrets_v2.json"),y=10,j=new Set(["9router","c_openai"]),H=new Set(["c_openai"]),w=[{canonical:"Google",secret:["GOOGLE_API_KEY","API_KEY"],aliases:["gemini"]},{canonical:"DeepSeek",secret:["DEEPSEEK_API_KEY"],aliases:["deepseek-ai","deepseekai"]},{canonical:"OpenRouter",secret:["OPENROUTER_API_KEY"],aliases:["open router","open_router"]},{canonical:"NVIDIA",secret:["NVIDIA_API_KEY"],aliases:["nvidia nim"]},{canonical:"Mistral",secret:["MISTRAL_API_KEY"],aliases:[]},{canonical:"Ollama",secret:["OLLAMA_API_KEY"],aliases:[]},{canonical:"InferX",secret:["INFERX_API_KEY"],aliases:["infer x","inferx"]},{canonical:"SenseNova",secret:["SENSENOVA_API_KEY"],aliases:["sensenova","sense nova"]},{canonical:"AIHubMix",secret:["AIHUBMIX_API_KEY"],aliases:["aihubmix","ai hub mix"]},{canonical:"Poolside",secret:["POOLSIDE_API_KEY"],aliases:[]},{canonical:"9router",secret:["9ROUTER_API_KEY"],aliases:["9router","9-router","nine router"]},{canonical:"ExpLabs",secret:["EXPLABS_API_KEY","EXPERIENTIALLABS_API_KEY"],aliases:["explabs","experientiallabs","experimentallabs","experiential labs"]},{canonical:"TokenHarbor",secret:["TOKENHARBOR_API_KEY","TOKEN_HARBOR_API_KEY"],aliases:["tokenharbor","token harbor","token_harbor","thk"]},{canonical:"Infron",secret:["INFRON_API_KEY"],aliases:["infron"]},{canonical:"APInex",secret:["APINEX_API_KEY"],aliases:["apinex","apx"]},{canonical:"xKiro",secret:["XKIRO_API_KEY"],aliases:["xkiro","kiro"]},{canonical:"c_openai",secret:["CUSTOM_OPENAI_API_KEY","C_OPENAI_API_KEY"],aliases:["custom","custom (openai)","custom openai"]}],O=new Map;for(let e of w){O.set(e.canonical.toLowerCase(),e.canonical);for(let t of e.aliases)O.set(t.toLowerCase(),e.canonical)}var m=e=>!e||typeof e!="string"?null:O.get(e.trim().toLowerCase())||null,V=()=>w.map(e=>e.canonical),S=e=>H.has(e),ee=e=>j.has(e);var te=e=>{let t=m(e)||e;return t==="c_openai"?"custom":t},Y=()=>new Array(y).fill(null),f=e=>e?typeof e=="string"?e.trim().length>0:typeof e=="object"?!!(e.key&&String(e.key).trim()):!1:!1,I=e=>e?typeof e=="string"?e:typeof e=="object"&&e.key?e.key:null:null,A=e=>{let t=Y();if(Array.isArray(e))for(let s=0;s<y&&s<e.length;s++)t[s]=e[s]??null;else typeof e=="string"&&e.trim()&&(t[0]=e);return t},k=()=>{try{return N(R,{})||{}}catch{return{}}},g=e=>{try{b.existsSync(E)||b.mkdirSync(E,{recursive:!0}),L(R,e,!0)}catch{}},T=!1,ne=async()=>{if(!T){T=!0;try{await b.pathExists(R);let e=D.join(E,"secrets.json");if(!await b.pathExists(e))return;let t=N(e,{})||{},s=k(),o=!1;for(let r of w){let a=A(s[r.canonical]);if(a.some(f)){s[r.canonical]=a;continue}let n=null;for(let c of r.secret)if(t[c]){n=t[c];break}n&&(S(r.canonical)?a[0]={key:n,baseUrl:""}:a[0]=n,s[r.canonical]=a,o=!0)}o&&g(s)}catch{}}},K=e=>{let t=m(e)||e,s=k();return A(s[t])},X=e=>K(e).filter(f).length,se=()=>w.filter(e=>!j.has(e.canonical)).map(e=>{let t=X(e.canonical);return{provider:e.canonical,count:t,hasKeys:t>0}}),C=async()=>{try{let{loadSettings:e}=await import("./settings-XLD5ZEHD.js"),t=await e();return t&&t.activeKeyIndex||{}}catch{return{}}},G=async e=>{try{let{loadSettings:t,saveSettings:s}=await import("./settings-XLD5ZEHD.js"),o=await t();o.activeKeyIndex=e,await s(o)}catch{}},_=async e=>{let t=m(e)||e,o=(await C())[t];return Number.isInteger(o)?o:null},h=async(e,t)=>{let s=m(e)||e,o=await C();return o[s]=t,await G(o),t},x=new Map,oe=(e,t,s=void 0)=>{let o=m(e)||e,r={key:t};s!==void 0&&(r.baseUrl=s),x.set(o,r)},re=e=>{let t=m(e)||e;return x.get(t)||null},ae=e=>x.has(m(e)||e),ce=()=>x.clear(),ie=e=>x.delete(m(e)||e),U=null,le=e=>{U=typeof e=="function"?e:null},z=e=>{try{U&&U(e)}catch{}},v=async()=>{try{let{loadSettings:e}=await import("./settings-XLD5ZEHD.js"),t=await e();return t.systemSettings&&t.systemSettings.customOpenAIBaseUrl||""}catch{return""}},ue=async(e,t={})=>{let s=m(e)||e,o=t.silent===!0,r=x.get(s);if(r&&r.key)return r.key;let a=K(s),n=await _(s);if(Number.isInteger(n)&&n>=0&&n<y&&f(a[n]))return I(a[n]);let c=a.findIndex(f);return c!==-1?(o||(await h(s,c),z(`No active key set for ${s}. Auto-selected slot ${c+1}.`)),I(a[c])):null},fe=async e=>{let t=m(e)||e;if(!S(t))return null;let s=x.get(t);if(s&&s.key)return s.baseUrl!==void 0?s.baseUrl:await v();let o=K(t),r=await _(t);if(Number.isInteger(r)&&r>=0&&r<y){let n=o[r];if(n&&typeof n=="object"&&n.key)return n.baseUrl||""}let a=o.findIndex(f);if(a!==-1){let n=o[a];if(n&&typeof n=="object")return n.baseUrl||""}return await v()},$=async(e,t,s)=>{if(S(e)){let o=s!==void 0?s:await v();return{key:t,baseUrl:o}}return t},F=(e,t)=>{let s=String(t),o=[],r=[];return e.forEach((a,n)=>{let c=I(a);c&&(c===s?o.push(n):c.includes(s)&&r.push(n))}),o.length?o:r},me=async(e,t,s={})=>{let o=m(e)||e;if(!t||!String(t).trim())return{ok:!1,error:"Empty key."};let r=String(t).trim(),a=k(),n=A(a[o]);if(n.some(l=>I(l)===r))return{ok:!1,error:`Key already exists in slot ${n.findIndex(u=>I(u)===r)+1}.`};if(Number.isInteger(s.index)){let l=s.index;if(l<0||l>=y)return{ok:!1,error:`Index must be between 1 and ${y}.`};let u=n[l]&&typeof n[l]=="object"?n[l].baseUrl:void 0;return n[l]=await $(o,r,u),a[o]=n,g(a),{ok:!0,index:l}}let c=n.findIndex(l=>!f(l));return c===-1?{ok:!1,error:"All slots full. Specify an index to overwrite.",full:!0}:(n[c]=await $(o,r),a[o]=n,g(a),{ok:!0,index:c})},pe=async(e,t,s={})=>{let o=m(e)||e,r=k(),a=A(r[o]);if(s.all||t==="--all"||t==="__all__")return r[o]=Y(),g(r),await h(o,null),{ok:!0,all:!0,remaining:0,needsNewKey:!0};let n=-1;if(t==null){let i=await _(o);if(n=Number.isInteger(i)&&f(a[i])?i:a.findIndex(f),n===-1)return{ok:!1,error:"No keys to remove."}}else if(Number.isInteger(t)){if(n=t,n<0||n>=y)return{ok:!1,error:`Index must be between 1 and ${y}.`};if(!f(a[n]))return{ok:!1,error:`Slot ${n+1} is already empty.`}}else{let i=F(a,t);if(i.length===0)return{ok:!1,error:"No matching key found."};if(i.length>1)return{ok:!1,error:`Duplicate match (slots ${i.map(d=>d+1).join(", ")}). Be more specific.`};n=i[0]}let c=I(a[n]),l=await _(o)===n;a[n]=null,r[o]=a,g(r);let u=a.filter(f).length;if(l){let i=a.findIndex(f);await h(o,i===-1?null:i)}return{ok:!0,removed:c,removedIndex:n,remaining:u,needsNewKey:u===0}},ye=async(e,t)=>{let s=m(e)||e,o=K(s),r=-1;if(Number.isInteger(t)){if(r=t,r<0||r>=y)return{ok:!1,error:`Index must be between 1 and ${y}.`};if(!f(o[r]))return{ok:!1,error:`Slot ${r+1} is empty.`}}else{let n=F(o,t);if(n.length===0)return{ok:!1,error:"No matching key found."};if(n.length>1)return{ok:!1,error:`Duplicate match (slots ${n.map(c=>c+1).join(", ")}). Be more specific.`};r=n[0]}await h(s,r);let a=null;if(S(s)){let n=o[r],c=n&&typeof n=="object"&&n.baseUrl?n.baseUrl.trim():"";if(c)try{let{loadSettings:l,saveSettings:u}=await import("./settings-XLD5ZEHD.js"),i=await l();if((i.systemSettings&&i.systemSettings.customOpenAIBaseUrl?i.systemSettings.customOpenAIBaseUrl.trim():"")!==c){let p={...i.systemSettings||{},customOpenAIBaseUrl:c,memory:!1};await u({...i,systemSettings:p}),a=c}}catch{}}return{ok:!0,index:r,key:I(o[r]),switchedBaseUrl:a}},de=async(e=null)=>{let t=k(),s=e?[m(e)||e]:V(),o=0;for(let r of s){let a=A(t[r]),n=a.filter(f);if(n.length===0){t[r]=a;continue}let c=await _(r),l=Number.isInteger(c)&&f(a[c])?a[c]:null,u=Y();n.forEach((d,p)=>{u[p]=d});let i=Number.isInteger(c)?c:null;if(l){let d=a.slice(0,y).map((p,P)=>({s:p,i:P})).filter(p=>f(p.s)).findIndex(p=>p.i===c);i=d===-1?null:d}t[r]=u,i!==c&&await h(r,i),o++}return g(t),{ok:!0,providers:s.length,touched:o}},M=e=>{if(!e)return"";let t=String(e),s=t.length;if(s<=3)return"...";let o=Math.floor(s/3),r=t.slice(0,o),a=t.slice(s-o);return r+"..."+a},J=e=>{if(!e)return"";let t=String(e).replace(/\/+$/,"");return t.length<=28?t:"..."+t.replace(/^https?:\/\//i,"").slice(-24)},Ie=async(e,t={})=>{let s=t.unmask===!0,o=m(e)||e,r=K(o),a=await _(o),n=x.get(o),c=[];n&&n.key&&c.push(`Temporary: ${s?n.key:M(n.key)}`);for(let l=0;l<y;l++){let u=r[l],i=I(u),d=i&&!s?M(i):i,p;if(!i)p="Empty";else if(S(o)){let B=u&&typeof u=="object"?J(u.baseUrl):"";p=B?`${d} (Saved: ${B})`:d}else p=d;let P=l===a&&i?" \u2190 active":"";c.push(`${l+1}: ${p}${P}`)}return c};export{j as a,w as b,m as c,V as d,S as e,ee as f,te as g,ne as h,K as i,X as j,se as k,_ as l,h as m,oe as n,re as o,ae as p,ce as q,ie as r,le as s,ue as t,fe as u,me as v,pe as w,ye as x,de as y,M as z,J as A,Ie as B};
@@ -1,3 +0,0 @@
1
- import{a as m}from"./chunk-PTFCY2D5.js";import{a as M}from"./chunk-HFTI3R3Q.js";import"./chunk-26BQ45XP.js";var z=async function*(k,C,U,A,E,K,v,d,$=1,L=""){let x=[];A&&x.push({role:"system",content:A});for(let t of U){let e=t.role==="user"?"user":"assistant",n=[];if(Array.isArray(t.parts)){for(let o of t.parts)if(o.text)n.push({type:"text",text:o.text});else if(o.inlineData&&v){let c=o.inlineData.mimeType,u=o.inlineData.data;c.startsWith("image/")&&n.push({type:"image_url",image_url:{url:`data:${c};base64,${u}`}})}}else{let o=t.text||"";o&&n.push({type:"text",text:o})}x.push({role:e,content:n.length===1&&n[0].type==="text"?n[0].text:n})}let P=M("c_openai",C,E),_=P!==null?P:{Fast:"none",Low:"low",Medium:"medium",Standard:"medium",High:"high",xHigh:"xhigh"}[E],a={model:C,messages:x,stream:!0,stream_options:{include_usage:!0},temperature:$,tools:[],tool_choice:"none"};_&&_!=="none"&&(a.reasoning_effort=_,a.reasoning={effort:_});let O=(L||process.env.CUSTOM_OPENAI_URL||process.env.C_OPENAI_URL||"").trim();if(!O)throw new Error("Custom OpenAI Base URL is not configured. Please set Base URL in /settings -> Providers.");let f=O.replace(/\/+$/,"");f.endsWith("/chat/completions")||(f.endsWith("/v1")?f=`${f}/chat/completions`:f=`${f}/chat/completions`);let p={"Content-Type":"application/json",Accept:"text/event-stream, application/json","X-Title":"Flux-Flow","User-Agent":"Flux-Flow"},T=k&&k!=="LOCAL"?k:process.env.CUSTOM_OPENAI_API_KEY||process.env.C_OPENAI_API_KEY||"";if(T&&T.trim()!==""){let t=T.trim();p.Authorization=t.startsWith("Bearer ")?t:`Bearer ${t}`,p["api-key"]=t}let s=await m(f,{method:"POST",headers:p,body:JSON.stringify(a),signal:d});if(!s.ok&&(s.status===400||s.status===422)&&(a.reasoning||a.reasoning_effort)){if(console.info(`
2
- `),a.reasoning&&a.reasoning_effort){let t={...a};delete t.reasoning_effort;let e=await m(f,{method:"POST",headers:p,body:JSON.stringify(t),signal:d}).catch(()=>null);e&&e.ok&&(s=e)}if(!s.ok&&a.reasoning_effort){let t={...a};delete t.reasoning;let e=await m(f,{method:"POST",headers:p,body:JSON.stringify(t),signal:d}).catch(()=>null);e&&e.ok&&(s=e)}if(!s.ok){let t={...a};delete t.reasoning,delete t.reasoning_effort;let e=await m(f,{method:"POST",headers:p,body:JSON.stringify(t),signal:d}).catch(()=>null);e&&e.ok&&(s=e)}}if(!s.ok){let t=await s.json().catch(()=>({})),e=t.error?.metadata?.raw||t.error?.message||(typeof t.error=="string"?t.error:"")||t.message||s.statusText||"Unknown error";throw new Error(`Custom OpenAI Error (${s.status}): ${e}`)}let W=s.body.getReader(),B=new TextDecoder,w="",i=[],l=null,y=Date.now(),g=!1,F=(t,e)=>{if(!t&&!e)return null;if(t){if(typeof t.reasoning_content=="string"&&t.reasoning_content)return t.reasoning_content;if(typeof t.reasoning=="string"&&t.reasoning)return t.reasoning;if(typeof t.thinking=="string"&&t.thinking)return t.thinking;if(typeof t.thought=="string"&&t.thought)return t.thought;if(typeof t.reasoning_text=="string"&&t.reasoning_text)return t.reasoning_text;if(Array.isArray(t.reasoning_details)&&t.reasoning_details.length>0){let n=t.reasoning_details.map(o=>typeof o=="string"?o:o?.text||o?.content||"").filter(Boolean).join("");if(n)return n}}if(e){if(typeof e.reasoning_content=="string"&&e.reasoning_content)return e.reasoning_content;if(typeof e.reasoning=="string"&&e.reasoning)return e.reasoning}return null},J=(t,e)=>{if(t){if(typeof t.content=="string"&&t.content)return t.content;if(typeof t.text=="string"&&t.text)return t.text;if(Array.isArray(t.content))return t.content.map(n=>typeof n=="string"?n:n?.text||"").join("")}return e&&typeof e.text=="string"&&e.text?e.text:""},R=t=>{let e=t.usage||t.usageMetadata||t.choices?.[0]?.usage||null;if(!e)return null;let n=e.prompt_tokens||e.promptTokenCount||e.input_tokens||0,o=e.completion_tokens||e.candidatesTokenCount||e.output_tokens||0,c=e.total_tokens||e.totalTokenCount||n+o,u=e.prompt_tokens_details?.cached_tokens||e.prompt_tokens_details?.cache_read_input_tokens||e.cachedContentTokenCount||e.cache_read_input_tokens||0,r=e.completion_tokens_details?.reasoning_tokens||e.thoughtsTokenCount||e.reasoning_tokens||0;return{totalTokenCount:c,promptTokenCount:n,candidatesTokenCount:o,cachedContentTokenCount:u,thoughtsTokenCount:r}};for(;;){let{done:t,value:e}=await W.read();if(t){g&&(i.length>0||l)&&(yield{candidates:i.length>0?[{content:{parts:i}}]:[],usageMetadata:l});break}w+=B.decode(e,{stream:!0});let n=w.split(`
3
- `);w=n.pop();for(let o of n){let c=o.trim();if(!c||!c.startsWith("data: "))continue;let u=!1;if(c==="data: [DONE]"||c==="data: [DONE]\r")u=!0;else try{let r=JSON.parse(c.substring(6));if(r.error){let H=r.error.metadata?.raw||r.error.message||(typeof r.error=="string"?r.error:JSON.stringify(r.error));throw new Error(`Custom OpenAI Stream Error: ${H}`)}let h=r.choices?.[0],S=h?.delta;h?.finish_reason&&h.finish_reason!=="null"&&(u=!0);let D=R(r);D&&(l=D,g=!0);let N=F(S,h);N&&(i.push({text:N,thought:!0}),g=!0);let I=J(S,h);I&&(i.push({text:I}),g=!0)}catch(r){if(r.message&&r.message.startsWith("Custom OpenAI Stream Error:"))throw r}if((u||Date.now()-y>=150)&&g&&(yield{candidates:i.length>0?[{content:{parts:[...i]}}]:[],usageMetadata:l},i=[],y=Date.now(),g=!1),u)break}Date.now()-y>=150&&g&&(yield{candidates:i.length>0?[{content:{parts:[...i]}}]:[],usageMetadata:l},i=[],y=Date.now(),g=!1)}};export{z as getCustomOpenAIStream};
@@ -1,2 +0,0 @@
1
- import{a as O}from"./chunk-HFTI3R3Q.js";import"./chunk-26BQ45XP.js";import{Ollama as D}from"ollama";var y=async function*(r,p,M,d,u,b,S,T,v=1,w="Cloud"){let m=[];d&&m.push({role:"system",content:d});for(let t of M){let l=t.role==="user"?"user":"assistant",a="",c=[];if(Array.isArray(t.parts)){a=t.parts.map(o=>o.text||"").filter(Boolean).join(`
2
- `);for(let o of t.parts){let h=o.inlineData||o.inline_data;h&&h.data&&c.push(h.data)}}else a=t.text||"";if(a||c.length>0){let o={role:l,content:a};c.length>0&&(o.images=c),m.push(o)}}let f=w==="Local"||!r||r==="LOCAL",g={host:f?process.env.OLLAMA_HOST||"http://127.0.0.1:11434":process.env.OLLAMA_HOST||"https://ollama.com"};!f&&r&&(g.headers={Authorization:"Bearer "+r});let C=new D(g),e=[],i=null,_=Date.now(),n=!1,s=O("Ollama",p,u),k={Fast:!1,Low:"medium",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:v}},L=await C.chat(x);for await(let t of L){if(T?.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 l=t.prompt_cached_count||0;if(!l&&t.prompt_eval_count){let a=t.prompt_eval_duration||0;a>0&&a<5e7&&(l=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:l,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{y as getOllamaStream};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-UXLD7KTZ.js";import"./chunk-YEVCTH3B.js";import"./chunk-P5HBJA23.js";import"./chunk-26BQ45XP.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};
@@ -1 +0,0 @@
1
- import{A,B,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-YEVCTH3B.js";import"./chunk-P5HBJA23.js";import"./chunk-26BQ45XP.js";export{a as HIDDEN_FROM_SUMMARY,b as PROVIDER_DEFS,v as addProviderKey,B as buildListLines,y as cleanProviderKeys,q as clearAllTempKeys,r as clearTempKey,j as countProviderKeys,A as formatBaseUrl,l as getActiveIndex,d as getCanonicalProviders,g as getProviderLabel,i as getProviderSlots,k as getProviderSummary,o as getTempKey,p as hasTempKey,f as isHiddenFromSummary,e as isUrlBearing,z as maskKey,h as migrateFromLegacy,c as normalizeProvider,w as removeProviderKey,t as resolveAPIKey,u as resolveBaseUrl,m as setActiveIndex,s as setNoticeHandler,n as setTempKey,x as useProviderKey};