fluxflow-cli 4.23.1 → 4.23.3
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-XKTMUYEB.js → ai-4QWVJQQT.js} +1 -1
- package/dist/chunks/{app-WQFY3EJA.js → app-F2FUSYYF.js} +1 -1
- package/dist/chunks/{chunk-XZ2NUATR.js → chunk-ZH24NCF3.js} +194 -194
- package/dist/chunks/{invoke-ZKLEJF7D.js → invoke-4OQX5TRY.js} +2 -2
- package/dist/chunks/{invokeSync-FLO4TI2M.js → invokeSync-YUAXMXVT.js} +2 -2
- package/dist/cli.js +11 -11
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-
|
|
1
|
+
import{a as k,c as d}from"./chunk-56EJGQU3.js";import{a as b}from"./chunk-Y5JU726N.js";var I=async(w,s={})=>{let{runSubagent:U}=await import("./ai-4QWVJQQT.js"),l=b(w),c=l.task||l.instruction||l.prompt,C=l.model||null,E=l.title||null,m=l.tools||null;if(!c)return'ERROR: Missing "task" argument for invoke.';let f=null;if(m)try{let t=m.trim();t.startsWith("[")&&t.endsWith("]")&&(t=t.substring(1,t.length-1)),f=t.split(",").map(n=>n.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let i=`subagent-${Date.now()}-${Math.floor(Math.random()*1e3)}`,h=null,S=null,$=new Promise((t,n)=>{h=t,S=n}),e={id:i,title:E||c.substring(0,30),task:c,status:"running",startedAt:Date.now(),lastChunkTime:Date.now(),wps:0,questions:[],pendingSteerMessages:[],steer:t=>{t&&e.pendingSteerMessages.push(t)},completionPromise:$,_resolveCompletion:h,_rejectCompletion:S,progress:[]},r={chunks:[],totalWords:0};k.push(e),s.onSubagentUpdate&&s.onSubagentUpdate();let a=[],M={...s,taskId:i,onAskMain:async t=>{let n=`q-${Date.now()}-${Math.floor(Math.random()*1e3)}`,o=null,p=new Promise(g=>{o=g}),u={id:n,question:t,answered:!1,answer:null,askedAt:Date.now(),_resolve:o};return e.questions.push(u),e.status="waiting",s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" is WAITING FOR YOUR INPUT: "${t}"
|
|
2
2
|
Respond using tool: [tool:Answer(id="${i}", answer="...")]
|
|
3
3
|
[/SYSTEM]`),await p},onVisualFeedback:t=>{e.lastChunkTime=Date.now();let n=t.replace(/\x1b\[[0-9;]*m/g,""),o=n.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);o?e.currentTool=o[1].trim():e.currentTool=n,s.onSubagentUpdate&&s.onSubagentUpdate()},onTokenChunk:(t,n)=>{let o=Date.now();if(e.lastChunkTime=o,e.currentTool="Thinking",typeof n=="number"&&n>0){r.totalWords+=n,r.chunks.push({time:o,words:n});let p=o-400;if(r.chunks=r.chunks.filter(u=>u.time>=p),r.chunks.length>0){let u=r.chunks.reduce((_,A)=>_+A.words,0),T=r.chunks[0].time,g=Math.max(.4,(o-T)/1e3);e.wps=Math.round(u/g)}}s.onSubagentUpdate&&s.onSubagentUpdate()}};return U(c,M,C,f,50,t=>{if(e.status==="cancelled")return;if(t.startsWith("[Subagent Turn")&&a.length>0&&(e.progress.push([...a]),a=[]),t.includes("[Executing Tool]")){let o=t.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);o&&(!e.currentTool||e.currentTool==="Thinking")&&(e.currentTool=o[1])}let n=t;if(n.startsWith("[Tool Result]")){let o=n.split(`
|
|
4
4
|
`);o.length>5&&(n=o.slice(0,4).join(`
|
|
5
5
|
`)+`
|
|
6
|
-
... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-
|
|
6
|
+
... [Content/Diff Truncated from Logs] ...`)}a.push(n),s.onSubagentUpdate&&s.onSubagentUpdate()},!0).then(t=>{if(e.status==="cancelled"){e._resolveCompletion&&e._resolveCompletion(t);return}a.length>0&&(e.progress.push([...a]),a=[]),e.status="completed",e.finalAnswer=t,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) has FINISHED. Call GetProgress(id="${i}") to see the final result. [/SYSTEM]`),e._resolveCompletion&&e._resolveCompletion(t)}).catch(async t=>{let{isTerminationSignaled:n}=await import("./ai-4QWVJQQT.js");if(t.message==="Subagent task was cancelled."||e.status==="cancelled"||n()){e.status="cancelled",a.push("[SUBAGENT CANCELLED] Task was cancelled."),e.progress.push([...a]),s.onSubagentUpdate&&s.onSubagentUpdate(),e._resolveCompletion&&e._resolveCompletion(null);return}a.push(`[SUBAGENT FAILURE] Error: ${t.message}`),e.progress.push([...a]),e.status="failed",e.error=t.message,s.onSubagentUpdate&&s.onSubagentUpdate(),d(`[SYSTEM] Background subagent "${e.title}" (id: ${i}) FAILED with error: ${t.message}. [/SYSTEM]`),e._rejectCompletion&&e._rejectCompletion(t)}),`SUCCESS: Background subagent started. Task ID: ${i}`};export{I as invoke};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-
|
|
2
|
-
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-
|
|
1
|
+
import{a as o}from"./chunk-Y5JU726N.js";var k=async(b,t={})=>{let{runSubagent:u}=await import("./ai-4QWVJQQT.js"),s=o(b),a=s.task||s.instruction||s.prompt,m=s.model||null,l=s.tools||null;if(!a)return'ERROR: Missing "task" argument for invokeSync.';let r=null;if(l)try{let e=l.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),r=e.split(",").map(i=>i.trim().replace(/^["']|["']$/g,"")).filter(Boolean)}catch{}let n=s.title||a.substring(0,30);try{t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n}`);let e=await u(a,t,m,r,50);return t.onVisualFeedback&&t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} [COMPLETED]
|
|
2
|
+
`),e}catch(e){let{isTerminationSignaled:i}=await import("./ai-4QWVJQQT.js"),c=e.message==="Subagent task was cancelled by user."||i();if(t.onVisualFeedback){let d=c?"[CANCELLED]":"[FAILED]";t.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${n} ${d}
|
|
3
3
|
`)}return`ERROR: Subagent execution failed: ${e.message}`}};export{k as invokeSync};
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as b}from"./chunks/chunk-RI37VZYB.js";import{spawn as
|
|
3
|
-
[ERROR] Allocation value '${
|
|
4
|
-
`),process.exit(1));var
|
|
5
|
-
[MEMORY] Starting with: '${
|
|
2
|
+
import{a as b}from"./chunks/chunk-RI37VZYB.js";import{spawn as fe}from"child_process";import{fileURLToPath as oe}from"url";import ge from"os";import B from"path";import P from"fs";import T from"dotenv";try{let t=B.join(b,"AGENTS.md"),x=B.join(b,"FLUXFLOW.md");P.existsSync(b)||P.mkdirSync(b,{recursive:!0}),P.existsSync(t)||P.writeFileSync(t,"","utf8"),P.existsSync(x)||P.writeFileSync(x,"","utf8")}catch{}T.config({path:"./.env",override:!0,quiet:!0});T.config({path:`${b}/.env`,override:!0,quiet:!0});T.config({path:`${b}/.env.agents`,override:!0,quiet:!0});T.config({path:`${b}/.env.fluxflow`,override:!0,quiet:!0});T.config({path:"./.env.agents",override:!0,quiet:!0});T.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var xe=ge.totalmem(),se=xe/(1024*1024),we=.5,he=Math.floor(se*we),re=process.argv.slice(2),te=re.indexOf("--allocation"),g=te!==-1?parseInt(re[te+1],10):NaN,ve=process.env.EXPERIMENTAL_MEMORY_MANAGER==="true"||process.env.EXPERIMENTAL_MEMORY_MANAGER==="1"||process.env.EXPERIMENTAL_MEMORY_MANAGER===!0||process.env.EXPERIMENTAL_MEMORY_MANAGER===1||!1,ye=!isNaN(g)||ve||!1;!isNaN(g)&&g<64&&(console.error(`
|
|
3
|
+
[ERROR] Allocation value '${g} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
|
+
`),process.exit(1));var L=Math.floor(se*.75),Se=!isNaN(g)&&g>0?Math.min(g,L):Math.max(1536,Math.min(32768,he)),be=oe(import.meta.url).endsWith(".js");if(be&&!process.execArgv.some(t=>t.includes("max-old-space-size"))&&ye)Number.isNaN(g)||(console.log(`
|
|
5
|
+
[MEMORY] Starting with: '${g>L?L:g} MB' Allocation${g>L?" (Max allowed: '"+L+" MB')":""}. Please Wait...`),await new Promise(x=>setTimeout(x,5e3))),fe(process.execPath,[`--max-old-space-size=${Se}`,"--expose-gc","--max-semi-space-size=1",oe(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",x=>process.exit(x||0));else{let t=process.argv.slice(2),x=t.includes("--help")&&t[t.indexOf("--help")+1]==="commands",V=t.includes("--help")&&!x,J=t.includes("--version")||t.includes("-v"),K=t[0]==="--update",Q=t[0]==="--export";if(t[0]==="--usage"||t.includes("--usage")||t[0]==="--budget"||t.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-F2KOFF6O.js"),{url:d}=await o();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
7
|
\u2800\u2800\u2514\u2500 Serving at: ${d}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
@@ -66,27 +66,27 @@ Usage: fluxflow --export error`),process.exit(1)}if(J&&(console.log(`v${i}`),pro
|
|
|
66
66
|
/docs View documentation
|
|
67
67
|
/fluxflow init Create FluxFlow.md template
|
|
68
68
|
/update check Check for new version
|
|
69
|
-
/update latest Install latest release`),process.exit(0)),K){let C=t[1]||"latest";if(C==="check"){let w=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(w?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let p=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;p||(console.error("Error: Could not retrieve latest version."),process.exit(1)),p===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let s=(await import("react")).default,{useState:
|
|
69
|
+
/update latest Install latest release`),process.exit(0)),K){let C=t[1]||"latest";if(C==="check"){let w=t[2]==="latest";try{let y=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;y||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(w?`Latest version: v${y}`:y!==i?`A new version of FluxFlow is available: v${y} (current: v${i}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${i}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(C==="latest"){console.log("Checking latest version and settings...");try{let p=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;p||(console.error("Error: Could not retrieve latest version."),process.exit(1)),p===i&&(console.log(`FluxFlow is already up to date (v${i}).`),process.exit(0));let y=async()=>{let s=(await import("react")).default,{useState:I}=s,{render:U,Box:l,Text:$}=await import("ink"),k=(await import("ink-select-input")).default,Y=(await import("ink-text-input")).default;return new Promise(q=>{let H=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],W=({label:M,isSelected:v})=>s.createElement(l,{width:"100%"},s.createElement($,{bold:v},"\u2514\u2500 ",v?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",M)),N,X=()=>{let[M,v]=I("select"),[O,e]=I(""),n=F=>{F.value==="custom"?v("custom"):_({manager:F.value})},f=F=>{_({manager:"custom",customCommand:F})};return M==="custom"?s.createElement(l,{flexDirection:"column",marginY:1},s.createElement(l,{marginBottom:1},s.createElement($,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(l,{flexDirection:"row"},s.createElement($,{color:"cyan",bold:!0}," \u276F "),s.createElement(Y,{value:O,onChange:e,onSubmit:f})),s.createElement(l,{marginTop:1},s.createElement($,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(l,{flexDirection:"column",marginY:1},s.createElement(l,{marginBottom:1},s.createElement($,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(k,{items:H,onSelect:n,itemComponent:W,indicatorComponent:()=>null}))},_=M=>{N&&N(),q(M)},{unmount:z}=U(s.createElement(X,null));N=z})},a,A="",E;try{let{loadSettings:s}=await import("./chunks/settings-6BPZ6DG5.js");E=await s(),a=E?.systemSettings?.updateManager||E?.updateManager}catch{}if(!a){let s=await y();a=s.manager,A=s.customCommand}let m="";a==="pnpm"?m=`pnpm add -g fluxflow-cli@${p}`:a==="bun"?m=`bun add -g fluxflow-cli@${p}`:a==="yarn"?m=`yarn global add fluxflow-cli@${p}`:a==="custom"?m=A||E?.customUpdateCommand||`npm install -g fluxflow-cli@${p}`:m=`npm install -g fluxflow-cli@${p}`,console.log(`Updating FluxFlow to v${p} using ${a}...`),console.log(`Running: ${m}`);let{execSync:S}=await import("child_process");S(m,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${p}.\x1B[0m`)}catch(w){console.error("\x1B[31m\u274C Update failed:\x1B[0m",w.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:ne}=await import("react"),{render:ie}=await import("ink"),{default:ae}=await import("./chunks/app-F2FUSYYF.js");process.env.NODE_NO_WARNINGS="1";let le=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],ce=console.log,pe=console.warn,me=console.error,D=o=>{let d=o.map(String).join(" ");return le.some(r=>d.includes(r))};console.log=(...o)=>!D(o)&&ce(...o),console.warn=(...o)=>!D(o)&&pe(...o),console.error=(...o)=>!D(o)&&me(...o);let j=t.findIndex(o=>o==="--cwd"||o==="--path");if(j!==-1&&j+1<t.length){let o=t[j+1],d=await import("path"),r=await import("fs-extra"),u=d.default.resolve(o);try{r.default.existsSync(u)&&r.default.statSync(u).isDirectory()?process.chdir(u):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(h){console.error(`[ERROR] Failed to change directory to "${o}": ${h.message}`),process.exit(0)}}let R=t.includes("--commit_8f4a2b9c"),G=t.findIndex(o=>o==="-p"||o==="--prompt");if(G!==-1||R){let o=t.includes("--new")||t.includes("-n"),r=(G!==-1?t.slice(G+1).filter(e=>e!=="-n"&&e!=="--new"):[])[0];if(R)try{let{execSync:e}=await import("child_process"),n=e("git diff --cached",{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();n||process.exit(0),r=`Git Staged Diff:
|
|
70
70
|
${n}
|
|
71
71
|
---
|
|
72
72
|
|
|
73
|
-
Summarize
|
|
73
|
+
Summarize as neutral conventional commit message. No markdown, emojis, or fluff`}catch{process.exit(0)}let u=t.findIndex(e=>e==="-r"||e==="--run"),h=null,i=null;if(u!==-1&&u+1<t.length){h=t[u+1];try{let{execSync:e}=await import("child_process");i=e(h,{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim()}catch(e){i=(e.stdout?e.stdout.toString().trim():"")||(e.stderr?e.stderr.toString().trim():"")||e.message}}if(i){let{stripAnsi:e}=await import("./chunks/exec_command-2AU2ICOX.js");i=e(i).trim(),r?r=`Stdin Context (${h}):
|
|
74
74
|
${i}
|
|
75
75
|
---
|
|
76
76
|
|
|
77
|
-
${r}`:r=i}if(!
|
|
77
|
+
${r}`:r=i}if(!R&&!process.stdin.isTTY){let e=[];for await(let f of process.stdin)e.push(f);let n=Buffer.concat(e).toString("utf8").trim();if(n){let{stripAnsi:f}=await import("./chunks/exec_command-2AU2ICOX.js");n=f(n).trim(),r?r=`Stdin Context:
|
|
78
78
|
${n}
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
${r}`:r=n}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-6BPZ6DG5.js"),{getProviderAPIKey:w}=await import("./chunks/secrets-RFEEPY3S.js"),{getDefaultModel:c}=await import("./chunks/model_config-UZLNHYP5.js"),{generateSimpleContent:p}=await import("./chunks/ai-
|
|
81
|
+
${r}`:r=n}}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:C}=await import("./chunks/settings-6BPZ6DG5.js"),{getProviderAPIKey:w}=await import("./chunks/secrets-RFEEPY3S.js"),{getDefaultModel:c}=await import("./chunks/model_config-UZLNHYP5.js"),{generateSimpleContent:p}=await import("./chunks/ai-4QWVJQQT.js"),{checkQuotaDetailed:y}=await import("./chunks/usage-5LVLEH5S.js"),a=await C(),A=t.filter(e=>e!=="-p"&&e!=="--prompt"&&e!==r&&e!=="-n"&&e!=="--new"),E=R||A.includes("--raw")||t.includes("--raw"),m=e=>{for(let n of e){let f=A.indexOf(n);if(f!==-1&&f+1<A.length)return A[f+1]}return null},S=m(["--provider"])||a.aiProvider||"Google",s=m(["--model"])||a.activeModel||c(S,a.apiTier)||c(S,"paid"),I=m(["--key"])||await w(S);I||(console.error(`[ERROR] No API key resolved for provider "${S}".`),process.exit(1));let U=await y("agent",{aiProvider:S});U.allowed||(console.error(`[ERROR] ${U.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let l={aiProvider:S,apiKey:I,model:s,mode:"flow",thinkingLevel:m(["--thinking"])||"Fast",systemSettings:a.systemSettings||{}},$=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",k=new Date,Y=k.getFullYear(),q=k.toLocaleString("en-US",{month:"short"}).toUpperCase(),H=String(k.getDate()).padStart(2,"0"),W=k.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),N=`${Y}-${q}-${H}, ${W}`,X=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
82
82
|
Use NO markdown, only plain text
|
|
83
83
|
Additional Context:
|
|
84
84
|
- OS: ${$}
|
|
85
85
|
- Model: ${B.basename(l.model).trim().replace(":free","").replace("-free","").replace("/free","").replace("_free","").replace("free_","").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase().trim())}
|
|
86
|
-
- Approx time: ${
|
|
86
|
+
- Approx time: ${N}
|
|
87
87
|
- Non interactive CLI, support piped inputs
|
|
88
|
-
- 'fluxflow' TUI has full agentic tools & capabilities`.trim(),{getPromptSessionHistory:_,savePromptSessionHistory:z,clearPromptSessionHistory:M}=await import("./chunks/sessionDaemon-GHQTAGDG.js"),v=[];o?await M():v=await _();let
|
|
89
|
-
`)}let{text:e}=await p(l,s,
|
|
88
|
+
- 'fluxflow' TUI has full agentic tools & capabilities`.trim(),{getPromptSessionHistory:_,savePromptSessionHistory:z,clearPromptSessionHistory:M}=await import("./chunks/sessionDaemon-GHQTAGDG.js"),v=[];o&&!R?await M():o||(v=await _());let O=[];if(Array.isArray(v)&&v.length>0)for(let e of v)e.text&&O.push({role:e.role==="model"?"model":"user",parts:[{text:e.text}]});O.push({role:"user",parts:[{text:r}]});try{if(!E){let f="\x1B[36m",F="\x1B[35m",ee="\x1B[0m",de=B.basename(l.model).trim().replace(":free","").replace("-free","").replace("/free","").replaceAll("-"," ").replace(/\b\w/g,ue=>ue.toUpperCase().trim());process.stdout.write(`Responding with ${f}${de}${ee} from ${F}${l.aiProvider}${ee}:
|
|
89
|
+
`)}let{text:e}=await p(l,s,O,X,l.thinkingLevel),n=(e||"").trim();process.stdout.write(n+`
|
|
90
90
|
${E?"":`
|
|
91
91
|
`}`),n&&await z(r,n)}catch(e){console.error(`[ERROR] Prompt request failed: ${e.message.trim()}
|
|
92
92
|
|
package/dist/package.json
CHANGED
package/package.json
CHANGED