fluxflow-cli 5.2.3 → 5.4.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/chunks/{ai-XQBXUQUH.js → ai-5JYZZ6PM.js} +1 -1
- package/dist/chunks/app-S5Y2PD6U.js +336 -0
- package/dist/chunks/{auto_completion-OZQRLAX5.js → auto_completion-UFHKJGZC.js} +1 -1
- package/dist/chunks/{chunk-7Z6XMKKL.js → chunk-46PS7WA4.js} +152 -150
- package/dist/chunks/{invoke-3PD3C5KP.js → invoke-5S7NCXAS.js} +2 -2
- package/dist/chunks/{invokeSync-HMYNQ5CZ.js → invokeSync-6TXH6V5Q.js} +2 -2
- package/dist/chunks/ollama-SMYO5EJG.js +3 -0
- package/dist/chunks/write_file-A6MKH4SC.js +34 -0
- package/dist/cli.js +4 -3
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/app-VPFJ2FV7.js +0 -331
- package/dist/chunks/ollama-53BJCQQX.js +0 -2
- package/dist/chunks/write_file-WX4O436W.js +0 -34
|
@@ -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};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{a as x}from"./chunk-KOCMIEPK.js";import{a as k}from"./chunk-Y5JU726N.js";import{o as P}from"./chunk-XAPXZ6KO.js";import{b as j}from"./chunk-UMS5SEYB.js";import"./chunk-75OCC24T.js";import"./chunk-NTZSL2UT.js";import{c as F,z as C}from"./chunk-YFIWMGCS.js";import t from"fs";import f from"path";var K=async(L,M={})=>{let{path:e,content:p}=k(L);if(!e)return'ERROR: Missing "path" argument for WriteFile.';if(p===void 0)return'ERROR: Missing "content" argument for WriteFile.';let{resolvedPath:O,isTildeResolved:b}=C(e);e=O,p=p.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
|
|
2
|
-
`).replace(/\r/g,`
|
|
3
|
-
`);let n=f.resolve(process.cwd(),e),y=f.dirname(n);try{await x.recordFileChange(n);let{systemSettings:o}=await j(),h=o?.overwriteProtection!==!1,a="",R=0;if(t.existsSync(n))try{let r=t.readFileSync(n,"utf8").split(/\r?\n/);if(R=r.length,!h)a="";else if(r.length<=50)a=`Old File contents:
|
|
4
|
-
${r.map((l,d)=>`${d+1} | ${l}`).join(`
|
|
5
|
-
`)}
|
|
6
|
-
|
|
7
|
-
`;else{let l=f.parse(n),d=f.join(F,"OverwriteBackups");t.existsSync(d)||t.mkdirSync(d,{recursive:!0});let E=`${l.name}-old-${Date.now()}${l.ext}.bak`,w=f.join(d,E);t.copyFileSync(n,w),a=`Old File contents:
|
|
8
|
-
- Renamed old file as ${w} and written requested content in ${e}. For reversal use Run
|
|
9
|
-
|
|
10
|
-
`}}catch{a=`[Note: Could not read existing file for reversal reference]
|
|
11
|
-
|
|
12
|
-
`}t.existsSync(y)||t.mkdirSync(y,{recursive:!0});let $=(i=>i.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
|
|
13
|
-
`).replace(/\r/g,`
|
|
14
|
-
`))(p),u=$.endsWith(`
|
|
15
|
-
`)?$:$+`
|
|
16
|
-
`,T=u.split(/\r?\n/).length,D=Buffer.byteLength(u,"utf8");t.writeFileSync(n,u,"utf8");let m=t.readFileSync(n,"utf8"),S=Buffer.byteLength(m,"utf8"),s=m.split(/\r?\n/),c=s.length;if(S===0&&D>0)return m=null,`ERROR: CRITICAL FAILURE: Verification failed. File [${e}] is empty on disk!`;let v="";if(c<=690)v=s.join(`
|
|
17
|
-
`);else{let i=s.slice(0,300).join(`
|
|
18
|
-
`),r=s.slice(-300).join(`
|
|
19
|
-
`);v=`${i}
|
|
20
|
-
|
|
21
|
-
... [${c-100} lines truncated] ...
|
|
22
|
-
|
|
23
|
-
${r}`}m=null,await P({added:c,removed:R,file:e});let g=`File [${e}] saved.
|
|
24
|
-
- Stats: [${c} lines, ${(S/1024).toFixed(1)} KB]
|
|
25
|
-
${a}- Content Preview:
|
|
26
|
-
|
|
27
|
-
${v}`;if(o?.compressToolResults&&c>6e3){let i=u.split(/\r?\n/),r=i.slice(0,25).join(`
|
|
28
|
-
`)===s.slice(0,25).join(`
|
|
29
|
-
`),l=i.slice(-25).join(`
|
|
30
|
-
`)===s.slice(-25).join(`
|
|
31
|
-
`);r&&l&&(g=`[[SAME]]
|
|
32
|
-
${g}`)}return b&&(g+=`
|
|
33
|
-
|
|
34
|
-
[Note: '~' resolved to user home directory. To target literal '~' in current directory, escape it as '\\~']`),g}catch(o){let h=o instanceof Error?o.message:String(o);return`ERROR: Failed to write file [${e}]: ${h}`}};export{K as write_file};
|